Пример #1
0
 public function process(Vtiger_Request $request)
 {
     $modulePermissions = $request->get('permissions');
     $modulePermissions[4] = $modulePermissions[6];
     foreach ($modulePermissions as $tabId => $permission) {
         $moduleModel = Settings_SharingAccess_Module_Model::getInstance($tabId);
         $moduleModel->set('permission', $permission);
         try {
             $moduleModel->save();
         } catch (AppException $e) {
         }
     }
     Settings_SharingAccess_Module_Model::recalculateSharingRules();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->emit();
 }
Пример #2
0
 public function delete()
 {
     $db = PearDatabase::getInstance();
     $ruleId = $this->getId();
     $relationTypeComponents = explode('::', $this->get('relationtype'));
     $sourceType = $relationTypeComponents[0];
     $targetType = $relationTypeComponents[1];
     $tableColumnInfo = self::$dataShareTableColArr[$sourceType][$targetType];
     $tableName = $tableColumnInfo['table'];
     $db->pquery("DELETE FROM {$tableName} WHERE shareid=?", array($ruleId));
     $db->pquery('DELETE FROM vtiger_datashare_module_rel WHERE shareid=?', array($ruleId));
     Settings_SharingAccess_Module_Model::recalculateSharingRules();
 }
Пример #3
0
 public function delete()
 {
     $db = PearDatabase::getInstance();
     $ruleId = $this->getId();
     $relationTypeComponents = explode('::', $this->get('relationtype'));
     $sourceType = $relationTypeComponents[0];
     $targetType = $relationTypeComponents[1];
     $tableColumnInfo = self::$dataShareTableColArr[$sourceType][$targetType];
     $tableName = $tableColumnInfo['table'];
     $db->delete($tableName, 'shareid = ?', [$ruleId]);
     $db->delete('vtiger_datashare_module_rel', 'shareid = ?', [$ruleId]);
     Settings_SharingAccess_Module_Model::recalculateSharingRules();
 }