function applyChange() { if ($this->hasError()) { $this->sendError(); } if ($this->isApplied()) { $this->sendMsg('Changeset ' . get_class($this) . ' already applied!'); } else { $emailsInstance = Vtiger_Module::getInstance('Emails'); // Allow Sharing access and role-based security for Vendors Vtiger_Access::deleteSharing($emailsInstance); Vtiger_Access::initSharing($emailsInstance); Vtiger_Access::allowSharing($emailsInstance); Vtiger_Access::setDefaultSharing($emailsInstance, 'private'); Vtiger_Profile::initForModule($emailsInstance); // Email Reporting - set reports to public because access is private by default and configurable now $emrpts = "UPDATE vtiger_report SET sharingtype='Public' WHERE reportname in ('Contacts Email Report','Accounts Email Report','Leads Email Report','Vendors Email Report')"; $this->ExecuteQuery($emrpts, array()); $this->sendMsg('Changeset ' . get_class($this) . ' applied!'); $this->markApplied(); } $this->finishExecution(); }
/** * Delete this instance */ function delete() { if ($this->isentitytype) { Vtiger_Access::deleteSharing($this); Vtiger_Access::deleteTools($this); Vtiger_Filter::deleteForModule($this); Vtiger_Block::deleteForModule($this); if (method_exists($this, 'deinitWebservice')) { $this->deinitWebservice(); } } $this->__delete(); Vtiger_Profile::deleteForModule($this); Vtiger_Link::deleteAll($this->id); Vtiger_Menu::detachModule($this); self::syncfile(); }
/** * Delete this field instance * @access private */ function __delete() { global $adb; Vtiger_Profile::deleteForField($this); $adb->pquery("DELETE FROM vtiger_field WHERE fieldid=?", array($this->id)); self::log("Deleteing Field {$this->name} ... DONE"); }
/** * Enable tool for module. * @param Vtiger_Module Instance of module to use * @param String Tool (action name) like Import, Export, Merge * @param Boolean true to enable tool, false to disable * @param Integer (optional) profile id to use, false applies to all profile. * @access private */ static function updateTool($moduleInstance, $toolAction, $flag, $profileid = false) { global $adb; $result = $adb->pquery("SELECT actionid FROM vtiger_actionmapping WHERE actionname=?", array($toolAction)); if ($adb->num_rows($result)) { $actionid = $adb->query_result($result, 0, 'actionid'); $permission = $flag == true ? '0' : '1'; $profileids = array(); if ($profileid) { $profileids[] = $profileid; } else { $profileids = Vtiger_Profile::getAllIds(); } self::log(($flag ? 'Enabling' : 'Disabling') . " {$toolAction} for Profile [", false); foreach ($profileids as $useprofileid) { $result = $adb->pquery("SELECT permission FROM vtiger_profile2utility WHERE profileid=? AND tabid=? AND activityid=?", array($useprofileid, $moduleInstance->id, $actionid)); if ($adb->num_rows($result)) { $curpermission = $adb->query_result($result, 0, 'permission'); if ($curpermission != $permission) { $adb->pquery("UPDATE vtiger_profile2utility set permission=? WHERE profileid=? AND tabid=? AND activityid=?", array($permission, $useprofileid, $moduleInstance->id, $actionid)); } } else { $adb->pquery("INSERT INTO vtiger_profile2utility (profileid, tabid, activityid, permission) VALUES(?,?,?,?)", array($useprofileid, $moduleInstance->id, $actionid, $permission)); } self::log("{$useprofileid},", false); } self::log("] ... DONE"); } }
/** * Delete this field instance * @access private */ function __delete() { $adb = PearDatabase::getInstance(); Vtiger_Profile::deleteForField($this); $adb->pquery("DELETE FROM vtiger_field WHERE fieldid=?", array($this->id)); self::log("Deleteing Field {$this->name} ... DONE"); }
/** * Delete this instance */ function delete() { if ($this->isentitytype) { Vtiger_Access::deleteSharing($this); Vtiger_Access::deleteTools($this); Vtiger_Filter::deleteForModule($this); Vtiger_Block::deleteForModule($this); } $this->__delete(); Vtiger_Profile::deleteForModule($this); Vtiger_Link::deleteAll($this->id); Vtiger_Menu::detachModule($this); self::syncfile(); }
/** * Delete this instance */ function delete() { $moduleInstance = Vtiger_Module_Model::getInstance($this->name); require_once "modules/{$this->name}/{$this->name}.php"; $focus = new $this->name(); $this->tableName = $focus->table_name; if ($this->isentitytype) { $this->deleteFromCRMEntity(); Vtiger_Access::deleteTools($this); Vtiger_Filter::deleteForModule($this); Vtiger_Block::deleteForModule($this); if (method_exists($this, 'deinitWebservice')) { $this->deinitWebservice(); } } $this->deleteIcons(); $this->unsetAllRelatedList($moduleInstance); ModComments_Module_Model::deleteForModule($moduleInstance); Vtiger_Language::deleteForModule($moduleInstance); Vtiger_Access::deleteSharing($moduleInstance); $this->deleteFromModentityNum(); Vtiger_Cron::deleteForModule($moduleInstance); Vtiger_Profile::deleteForModule($moduleInstance); Settings_Workflows_Module_Model::deleteForModule($moduleInstance); Vtiger_Menu::deleteForModule($moduleInstance); $this->deleteGroup2Modules(); $this->deleteModuleTables(); $this->deleteCRMEntityRel(); Vtiger_Profile::deleteForModule($this); Vtiger_Link::deleteAll($this->id); $this->deleteDir($moduleInstance); $this->__delete(); self::syncfile(); }