From 268adeda04178b7c286fbc547b551f5d2fd5ed91 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 12 Aug 2014 06:58:13 -0400 Subject: [PATCH] installation fix --- equipment.php | 8 ++++---- include/util/EquipmentInstaller.php | 2 +- install/sql/install_equipment.sql | 5 +++-- install/sql/upgrade_equipment.sql | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/equipment.php b/equipment.php index e9caec8..db04997 100644 --- a/equipment.php +++ b/equipment.php @@ -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!"; @@ -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(); } diff --git a/include/util/EquipmentInstaller.php b/include/util/EquipmentInstaller.php index 2aea7f8..edee12b 100644 --- a/include/util/EquipmentInstaller.php +++ b/include/util/EquipmentInstaller.php @@ -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. diff --git a/install/sql/install_equipment.sql b/install/sql/install_equipment.sql index 7ac92b5..a1caf57 100644 --- a/install/sql/install_equipment.sql +++ b/install/sql/install_equipment.sql @@ -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())$ @@ -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 @@ -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'$ \ No newline at end of file diff --git a/install/sql/upgrade_equipment.sql b/install/sql/upgrade_equipment.sql index 110d4b8..91562ed 100644 --- a/install/sql/upgrade_equipment.sql +++ b/install/sql/upgrade_equipment.sql @@ -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`$