sFriendlyName = "{className} Plugin"; $this->sDescription = "Autogenerated plugin for class {className}"; $this->sPluginFolder = "{className}"; $this->sSetupPage = "setup"; $this->iVersion = 1; //$this->iPMVersion = 2425; $this->aWorkspaces = null; //$this->aWorkspaces = array("os"); {dashboardAttributeValue} return $res; } public function setup() { $this->setCompanyLogo("/plugin/{className}/{className}.png"); $this->registerMenu("processmaker", "menu{className}.php"); $this->registerMenu("cases", "menuCases{className}.php"); //$this->registerMenu("processmaker", "menu{className}OnTransit.php"); $this->registerStep("{GUID}", "step{className}Application", "{className} external step"); $this->registerReport(); $this->registerPmFunction(); $this->redirectLogin("PROCESSMAKER_{className}", "users/users_List"); {dashboardSetup} } public function install() { $RBAC = RBAC::getSingleton() ; $RBAC->initRBAC(); $roleData = array(); $roleData["ROL_UID"] = G::GenerateUniqueId(); $roleData["ROL_PARENT"] = ""; $roleData["ROL_SYSTEM"] = "00000000000000000000000000000002"; $roleData["ROL_CODE"] = "PROCESSMAKER_{className}"; $roleData["ROL_CREATE_DATE"] = date("Y-m-d H:i:s"); $roleData["ROL_UPDATE_DATE"] = date("Y-m-d H:i:s"); $roleData["ROL_STATUS"] = "1"; $RBAC->createRole($roleData); $RBAC->createPermision("PM_{className}"); } public function enable() { {dashboardEnable} } public function disable() { {dashboardDisable} } public function dashletInsert() { require_once ("classes/model/Dashlet.php"); $connection = Propel::getConnection(DashletPeer::DATABASE_NAME); foreach ($this->dashletsUids as $dashletData) { $dashlet = new Dashlet(); if (is_null($dashlet->load($dashletData["DAS_UID"]))) { $dashlet->fromArray($dashletData, BasePeer::TYPE_FIELDNAME); $connection->begin(); $dashlet->save(); $connection->commit(); } } } public function dashletDelete() { require_once ("classes/model/Dashlet.php"); foreach ($this->dashletsUids as $dashletData) { $criteria = new Criteria("workflow"); $criteria->add(DashletPeer::DAS_UID, $dashletData["DAS_UID"]); DashletPeer::doDelete($criteria); } } } $oPluginRegistry = &PMPluginRegistry::getSingleton(); $oPluginRegistry->registerPlugin("{className}", __FILE__);