Example #1
0
 public function SmartHookDelete()
 {
     $hookvalue = array();
     require_once dirname(__FILE__) . '/sql/addhook.php';
     foreach ($hookvalue as $hkv) {
         $hookid = Hook::getIdByName($hkv['name']);
         if ($hookid) {
             $dlt_hook = new Hook($hookid);
             $dlt_hook->delete();
         }
     }
 }
Example #2
0
 protected function _revertInstall($step)
 {
     if ($step >= 1) {
         $hook = new Hook(Hook::getIdByName('actionBeforeAddOrder'));
         $hook->delete();
         unset($hook);
     }
     if ($step >= 2) {
         $hook2 = new Hook(Hook::getIdByName('actionBeforeAddOrderInvoice'));
         $hook2->delete();
         unset($hook2);
     }
     if ($step >= 3) {
         $hook3 = new Hook(Hook::getIdByName('actionBeforeAddDeliveryNumber'));
         $hook3->delete();
         unset($hook3);
     }
     // if($step >= 4)
     // Uninstall DB changes
     if ($step >= 5) {
         parent::uninstall;
     }
     if ($step >= 6) {
         $this->uninstallXtraOverrides();
     }
     if ($step >= 7) {
         $this->unregisterHook('actionBeforeAddOrder');
     }
     if ($step >= 8) {
         $this->unregisterHook('actionBeforeAddOrderInvoice');
     }
     if ($step >= 9) {
         $this->unregisterHook('actionBeforeAddDeliveryNumber');
     }
     if ($step >= 10) {
         Configuration::deleteByName('ORD_REF_ORDERID');
     }
     if ($step >= 11) {
         Configuration::deleteByName('ORD_REF_PREFIXNULO');
     }
     if ($step >= 12) {
         Configuration::deleteByName('ORD_REF_PREFIXNULNRO');
     }
     if ($step >= 13) {
         Configuration::deleteByName('ORD_REF_PREFIXNULNRC');
     }
     if ($step >= 14) {
         Configuration::deleteByName('ORD_REF_PREFIXSIGNO');
     }
     if ($step >= 15) {
         Configuration::deleteByName('ORD_REF_CARTID');
     }
     if ($step >= 16) {
         Configuration::deleteByName('ORD_REF_PREFIXNULC');
     }
     if ($step >= 17) {
         Configuration::deleteByName('ORD_REF_PREFIXSIGNC');
     }
     if ($step >= 18) {
         Configuration::deleteByName('ORD_REF_PREFIXSIGN');
     }
     if ($step >= 19) {
         Configuration::deleteByName('INV_REF_ORDERID');
     }
     if ($step >= 20) {
         Configuration::deleteByName('INV_REF_CARTID');
     }
 }