當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CAppUI::acl方法代碼示例

本文整理匯總了PHP中CAppUI::acl方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAppUI::acl方法的具體用法?PHP CAppUI::acl怎麽用?PHP CAppUI::acl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CAppUI的用法示例。


在下文中一共展示了CAppUI::acl方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: store

 public function store(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $stored = false;
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->field_id && canEdit('system')) {
         if ($msg = parent::store()) {
             return $msg;
         }
         $stored = true;
     }
     if (0 == $this->field_id && canEdit('system')) {
         if ($msg = parent::store()) {
             return $msg;
         }
         $stored = true;
     }
     return $stored;
 }
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:26,代碼來源:CustomFieldManager.class.php

示例2: store

 public function store(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $stored = false;
     $this->file_folder_id = (int) $this->file_folder_id;
     $this->file_folder_parent = (int) $this->file_folder_parent;
     $this->_error = $this->check();
     if (count($this->_error)) {
         return $this->_error;
     }
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->file_folder_id && $perms->checkModuleItem('files', 'edit')) {
         if ($msg = parent::store()) {
             return $msg;
         }
         $stored = true;
     }
     if (0 == $this->file_folder_id && $perms->checkModuleItem('files', 'add')) {
         if ($msg = parent::store()) {
             return $msg;
         }
         $stored = true;
     }
     return $stored;
 }
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:28,代碼來源:filefolder.class.php

示例3: remove

 public function remove(CAppUI $AppUI, w2p_Utilities_Date $date)
 {
     $perms = $AppUI->acl();
     $removed = false;
     if ($this->holiday_id && $perms->checkModuleItem('holiday', 'edit', $this->holiday_id)) {
         $holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
         $holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
         if ($holiday_start_date->equals($date->duplicate())) {
             if ($holiday_end_date->equals($date->duplicate())) {
                 $removed = $this->delete($AppUI);
             } else {
                 $holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
                 $this->holiday_start_date = $holiday_start_date->getNextDay()->getDate();
                 $removed = $this->store($AppUI);
             }
         } elseif ($holiday_end_date->equals($date->duplicate())) {
             $holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
             $this->holiday_end_date = $holiday_end_date->getPrevDay()->getDate();
             $removed = $this->store($AppUI);
         } elseif ($holiday_start_date->before($date->duplicate()) && $holiday_end_date->after($date->duplicate())) {
             $holiday_end_date = $this->holiday_end_date;
             $this->holiday_end_date = $date->getPrevDay()->getDate();
             $removed = $this->store($AppUI);
             $this->holiday_id = 0;
             // create new record
             $this->holiday_start_date = $date->getNextDay()->getDate();
             $this->holiday_end_date = $holiday_end_date;
             $removed = $this->store($AppUI);
         }
     }
     return $removed;
 }
開發者ID:Raithlin,項目名稱:web2project-holiday,代碼行數:32,代碼來源:holiday.class.php

示例4: remove

 public function remove(CAppUI $AppUI = null)
 {
     global $AppUI;
     $q = new w2p_Database_Query();
     $q->dropTable('history');
     $q->exec();
     $perms = $AppUI->acl();
     return $perms->unregisterModule('history');
 }
開發者ID:eureka2,項目名稱:web2project,代碼行數:9,代碼來源:setup.php

示例5: delete

 public function delete(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $this->_error = array();
     if ($perms->checkModuleItem('resources', 'delete', $this->resource_id)) {
         if ($msg = parent::delete()) {
             return $msg;
         }
         return true;
     }
     return false;
 }
開發者ID:eureka2,項目名稱:web2project,代碼行數:12,代碼來源:resources.class.php

示例6: store

 public function store(CAppUI $AppUI = null)
 {
     global $AppUI;
     global $helpdesk_available;
     $perms = $AppUI->acl();
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     if ($helpdesk_available && $this->file_helpdesk_item != 0) {
         $this->addHelpDeskTaskLog();
     }
     if ($msg = parent::store()) {
         return false;
     }
     addHistory('files', $this->file_id, 'store', $this->file_name, $this->file_id);
     return true;
 }
開發者ID:joly,項目名稱:web2project,代碼行數:18,代碼來源:files.class.php

示例7: delete

 public function delete(CAppUI $AppUI = null)
 {
     global $AppUI;
     $perms = $AppUI->acl();
     $result = false;
     $this->_error = array();
     if ($perms->checkModuleItem('forums', 'delete', $this->project_id)) {
         $q = $this->_query;
         $q->setDelete('forum_visits');
         $q->addWhere('visit_message = ' . (int) $this->message_id);
         $q->exec();
         // No error if this fails, it is not important.
         $q->clear();
         $q->addTable('forum_messages');
         $q->addQuery('message_forum');
         $q->addWhere('message_id = ' . (int) $this->message_id);
         $forumId = $q->loadResult();
         $q->clear();
         $q->setDelete('forum_messages');
         $q->addWhere('message_id = ' . (int) $this->message_id);
         if (!$q->exec()) {
             $result = db_error();
         } else {
             $result = null;
         }
         $q->clear();
         $q->addTable('forum_messages');
         $q->addQuery('COUNT(message_id)');
         $q->addWhere('message_forum = ' . (int) $forumId);
         $messageCount = $q->loadResult();
         $q->clear();
         $q->addTable('forums');
         $q->addUpdate('forum_message_count', $messageCount);
         $q->addWhere('forum_id = ' . (int) $forumId);
         $q->exec();
         $result = true;
     }
     return $result;
 }
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:39,代碼來源:forummessage.class.php

示例8: store

 public function store(CAppUI $AppUI)
 {
     global $AppUI;
     $perms = $AppUI->acl();
     return true;
 }
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:6,代碼來源:history.class.php

示例9: store

 public function store(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $stored = false;
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     $this->company_id = (int) $this->company_id;
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->company_id && $perms->checkModuleItem('companies', 'edit', $this->company_id)) {
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('companies', $this->company_id, 'update', $this->company_name, $this->company_id);
         $stored = true;
     }
     if (0 == $this->company_id && $perms->checkModuleItem('companies', 'add')) {
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('companies', $this->company_id, 'add', $this->company_name, $this->company_id);
         $stored = true;
     }
     if ($stored) {
         $custom_fields = new CustomFields('companies', 'addedit', $this->company_id, 'edit');
         $custom_fields->bind($_POST);
         $sql = $custom_fields->store($this->company_id);
         // Store Custom Fields
     }
     return $stored;
 }
開發者ID:joly,項目名稱:web2project,代碼行數:35,代碼來源:companies.class.php

示例10: store

 public function store(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $stored = false;
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     if ($this->link_id && $perms->checkModuleItem('links', 'edit', $this->link_id)) {
         $q = new DBQuery();
         $this->link_date = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('links', $this->link_id, 'update', $this->link_name, $this->link_id);
         $stored = true;
     }
     if (0 == $this->link_id && $perms->checkModuleItem('links', 'add')) {
         $q = new DBQuery();
         $this->link_date = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('links', $this->link_id, 'add', $this->link_name, $this->link_id);
         $stored = true;
     }
     return $stored;
 }
開發者ID:joly,項目名稱:web2project,代碼行數:28,代碼來源:links.class.php

示例11: deleteFile

 public function deleteFile(CAppUI $AppUI = null)
 {
     global $AppUI;
     $perms = $AppUI->acl();
     if ($perms->checkModuleItem('files', 'delete', $this->file_id)) {
         return @unlink(W2P_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename);
     }
 }
開發者ID:eureka2,項目名稱:web2project,代碼行數:8,代碼來源:files.class.php

示例12: getDepartments

 public static function getDepartments(CAppUI $AppUI, $companyId)
 {
     $perms = $AppUI->acl();
     if ($AppUI->isActiveModule('departments') && canView('departments')) {
         $q = new w2p_Database_Query();
         $q->addTable('departments');
         $q->addQuery('departments.*, COUNT(contact_department) dept_users');
         $q->addJoin('contacts', 'c', 'c.contact_department = dept_id');
         $q->addWhere('dept_company = ' . (int) $companyId);
         $q->addGroup('dept_id');
         $q->addOrder('dept_parent, dept_name');
         $department = new CDepartment();
         $department->setAllowedSQL($AppUI->user_id, $q);
         return $q->loadList();
     }
 }
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:16,代碼來源:companies.class.php

示例13: updateTaskSummary

 /**
  * Updates the variable information on the task.
  *
  * @param int $task_log_task that task id of task this task log is for
  *
  * @return void
  *
  * @access private
  */
 private function updateTaskSummary(CAppUI $AppUI, $task_id)
 {
     $perms = $AppUI->acl();
     $q = $this->_query;
     if ($perms->checkModuleItem('tasks', 'edit', $task_id)) {
         if ($this->task_log_percent_complete < 100) {
             $q->addQuery('task_log_percent_complete, task_log_date, task_log_task_end_date');
             $q->addTable('task_log');
             $q->addWhere('task_log_task = ' . (int) $task_id);
             $q->addOrder('task_log_date DESC, task_log_id DESC');
             $q->setLimit(1);
             $results = $q->loadHash();
             $q->clear();
             $percentComplete = $results['task_log_percent_complete'];
             /*
              * TODO: In theory, we shouldn't just use the task_log_task_end_date, 
              *   because if we're after that date and someone is still adding 
              *   logs to a task, obviously the task isn't complete. We may want 
              *   to check to see if task_log_date > task_log_task_end_date and 
              *   use the later one as the end date.. not sure yet.
              */
             $taskEndDate = $results['task_log_task_end_date'];
         } else {
             $percentComplete = 100;
             $taskEndDate = $this->task_log_date;
         }
         $task = new CTask();
         $task->load($task_id);
         $task->task_percent_complete = $percentComplete;
         $task->task_end_date = $taskEndDate;
         $msg = $task->store($AppUI);
         if (is_array($msg)) {
             $AppUI->setMsg($msg, UI_MSG_ERROR, true);
         }
         $task->pushDependencies($task_id, $task->task_end_date);
     }
     $q->addQuery('SUM(task_log_hours)');
     $q->addTable('task_log');
     $q->addWhere('task_log_task = ' . (int) $task_log_task);
     $totalHours = $q->loadResult();
     CTask::updateHoursWorked($task_id, $totalHours);
 }
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:51,代碼來源:tasklogs.class.php

示例14: delete

 public function delete(CAppUI $AppUI = null)
 {
     global $AppUI;
     $perms = $AppUI->acl();
     $this->_error = array();
     if ($perms->checkModuleItem('departments', 'delete', $this->dept_id)) {
         $q = new w2p_Database_Query();
         $q->addTable('departments', 'dep');
         $q->addQuery('dep.dept_id');
         $q->addWhere('dep.dept_parent = ' . (int) $this->dept_id);
         $rows = $q->loadList();
         $q->clear();
         if (count($rows)) {
             //return 'deptWithSub';
             return false;
         }
         $q->addTable('project_departments', 'pd');
         $q->addQuery('pd.project_id');
         $q->addWhere('pd.department_id = ' . (int) $this->dept_id);
         $rows = $q->loadList();
         $q->clear();
         if (count($rows)) {
             //return 'deptWithProject';
             return false;
         }
         if ($msg = parent::delete()) {
             return $msg;
         }
         return true;
     }
     return false;
 }
開發者ID:eureka2,項目名稱:web2project,代碼行數:32,代碼來源:departments.class.php

示例15: updateStatus

 public static function updateStatus(CAppUI $AppUI = null, $projectId, $statusId)
 {
     global $AppUI;
     trigger_error("CProject::updateStatus has been deprecated in v2.3 and will be removed by v4.0.", E_USER_NOTICE);
     $perms = $AppUI->acl();
     if ($perms->checkModuleItem('projects', 'edit', $projectId) && $projectId > 0 && $statusId >= 0) {
         $q = new w2p_Database_Query();
         $q->addTable('projects');
         $q->addUpdate('project_status', $statusId);
         $q->addWhere('project_id   = ' . (int) $projectId);
         $q->exec();
     }
 }
開發者ID:viniciusbudines,項目名稱:sisnuss,代碼行數:13,代碼來源:projects.class.php


注:本文中的CAppUI::acl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。