Example #1
0
 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     if ($event_type == 'module.postinstall') {
         global $adb;
         // Configure module seq number
         $entity_tmp = new CRMEntity();
         Accounting::checkConfig(0);
         $entity_tmp->setModuleSeqNumber("configure", "Accounting", "PAY", 1);
         // Configure workflow
         Accounting::configure_workflows();
         Accounting::updateConfigParam('customlinks', 'true');
         Accounting::updateCustomLinks(array("Leads", "Contacts", "Vendors", "Accounts", "Invoice", "PurchaseOrder", "SalesOrder", "Invoice"), 'true');
         Accounting::setRelatedModules('false');
         Accounting::setRelatedModules('true');
     } else {
         if ($event_type == 'module.disabled') {
             Accounting::setRelatedModules('false');
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 Accounting::setRelatedModules('true');
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                     Accounting::setRelatedModules('false');
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                             Accounting::updateDateFields();
                             Accounting::checkConfig(1);
                             Accounting::setRelatedModules('false');
                             Accounting::setRelatedModules('true');
                             Accounting::configure_workflows();
                             // TODO Handle actions after this module is updated.
                         }
                     }
                 }
             }
         }
     }
 }
Example #2
0
                                         Accounting::updateConfigParam('invoicewfpending', $_REQUEST["pendingInvoice"]);
                                         //Accounting::updateConfigParam('relmodules', $_REQUEST["relstatus"]);
                                         //Accounting::setRelatedModules('false');
                                         //Accounting::setRelatedModules($_REQUEST["relstatus"]);
                                         Accounting::updateConfigParam('invoicewf', $_REQUEST["wfstatus"]);
                                         Accounting::updateConfigParam('paymentwfpaid', $_REQUEST["paidPayment"]);
                                         Accounting::updateConfigParam('paymentwfpending', $_REQUEST["pendingPayment"]);
                                         Accounting::updateConfigParam('paymentwf', $_REQUEST["wfstatuspayment"]);
                                         Accounting::updateConfigParam('createpaymentwf', $_REQUEST["wfstatuscreatepayment"]);
                                         Accounting::updateConfigParam('wf_nopayments', $_REQUEST["createPayNo"]);
                                         Accounting::updateConfigParam('wf_frecuency', $_REQUEST["createPayFrec"]);
                                         Accounting::updateConfigParam('wf_firstpaymentdate', $_REQUEST["createPayDate"]);
                                         Accounting::updateConfigParam('wf_firstpaymentamount', $_REQUEST["createPayAmount"]);
                                         Accounting::updateConfigParam('associnvoice', $_REQUEST["associnvoice"]);
                                         Accounting::updateConfigParam('customlinks', $_REQUEST["addcustomlink"]);
                                         Accounting::updateCustomLinks(array("Project", "Potentials", "Leads", "Contacts", "Vendors", "Accounts", "Invoice", "PurchaseOrder", "SalesOrder", "Invoice"), $_REQUEST["addcustomlink"]);
                                         Accounting::updateTransactionMethods($_REQUEST['methodslist']);
                                         Accounting::updateConfigParam('showvat', $_REQUEST["showvat"]);
                                         Accounting::updateConfigParam('hidepopup', $_REQUEST["hidepopup"]);
                                         Accounting::updateConfigParam('defaultcurrency', $_REQUEST["defaultcurrency"]);
                                         Accounting::updateConfigParam('populateamount', $_REQUEST["populateamount"]);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }