Skip to content

Commit

Permalink
installation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Aug 12, 2014
1 parent 1129e81 commit 268aded
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions equipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function needUpgrade() {

function configureUpgrade() {

$installer = new EquipmentInstaller();
$installer = new \util\EquipmentInstaller();
if (!$installer->upgrade()) {
echo "Upgrade configuration error. "
. "Unable to upgrade database tables!";
Expand All @@ -337,17 +337,17 @@ function configureFirstRun() {
* @return boolean
*/
function createDBTables() {
$installer = new EquipmentInstaller();
$installer = new \util\EquipmentInstaller();
return $installer->install();
}

/**
* Uninstall hook.
* @param type $errors
* @return boolean
* @return boolean
*/
function pre_uninstall(&$errors) {
$installer = new EquipmentInstaller();
$installer = new \util\EquipmentInstaller();
return $installer->remove();
}

Expand Down
2 changes: 1 addition & 1 deletion include/util/EquipmentInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class.equipment_install.php
* ******************************************************************** */
require_once 'class.setup.php';

class EquipmentInstaller extends SetupWizard {
class EquipmentInstaller extends \SetupWizard {

/**
* Loads, checks and installs SQL file.
Expand Down
5 changes: 3 additions & 2 deletions install/sql/install_equipment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%equipment_ticket_recurring` (
`ticket_id` int(11) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8$

INSERT INTO `%TABLE_PREFIX%list` (`name`, `created`,`notes`,`updated`)
VALUES ('equipment_status',NOW(),'internal equipment plugin list, do not modify',NOW())$
Expand Down Expand Up @@ -296,6 +296,7 @@ BEGIN
END$

DROP TRIGGER IF EXISTS `%TABLE_PREFIX%ticket_event_AUPD`$

CREATE TRIGGER `%TABLE_PREFIX%ticket_event_AUPD` AFTER UPDATE ON `%TABLE_PREFIX%ticket_event` FOR EACH ROW
BEGIN
SET @status_id = (SELECT status_id FROM `%TABLE_PREFIX%EquipmentFormView` WHERE
Expand All @@ -321,7 +322,7 @@ BEGIN
UPDATE `%TABLE_PREFIX%equipment` SET status_id = @status_id WHERE equipment_id=@equipment_id;
END IF;

END IF;

END$

UPDATE `%TABLE_PREFIX%plugin` SET version='0.2' WHERE name = 'Equipment Manager'$
2 changes: 1 addition & 1 deletion install/sql/upgrade_equipment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%equipment_ticket_recurring` (
`ticket_id` int(11) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8$

DROP PROCEDURE IF EXISTS `%TABLE_PREFIX%CreateEquipmentFormFields`$

Expand Down

0 comments on commit 268aded

Please sign in to comment.