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


PHP Phprojekt::getCurrentProjectId方法代碼示例

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


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

示例1: jsonDetailAction

 /**
  * When requesting the default values, adjust the start date to the start
  * date of the project.
  */
 public function jsonDetailAction()
 {
     $id = (int) $this->getRequest()->getParam('id');
     if (!empty($id)) {
         parent::jsonDetailAction();
     } else {
         $this->setCurrentProjectId();
         $project = new Project_Models_Project();
         $project->find(Phprojekt::getCurrentProjectId());
         $record = new Todo_Models_Todo();
         $record->startDate = $project->startDate;
         $record->endDate = $project->endDate;
         Phprojekt_Converter_Json::echoConvert($record, Phprojekt_ModelInformation_Default::ORDERING_FORM);
     }
 }
開發者ID:RainyBlueSky,項目名稱:PHProjekt,代碼行數:19,代碼來源:IndexController.php

示例2: getAllowedUsers

 /**
  * Return all the users that have at least read access on the current project.
  *
  * This function needs that Phprojekt::setCurrentProjectId is called before.
  *
  * @return array Array of users with 'id' and 'name'.
  */
 public function getAllowedUsers()
 {
     // Cache the query
     $sessionName = 'Phprojekt_User_User-getAllowedUsers' . '-' . (int) Phprojekt::getCurrentProjectId();
     $usersNamespace = new Zend_Session_Namespace($sessionName);
     if (!isset($usersNamespace->users)) {
         $displayName = $this->getDisplay();
         $rights = Phprojekt_Loader::getLibraryClass('Phprojekt_Item_Rights');
         $ids = $rights->getUsersWithRight(1, (int) Phprojekt::getCurrentProjectId());
         $where = sprintf('status = %s', $this->getAdapter()->quote('A'));
         if (!empty($ids)) {
             $where .= sprintf(' AND id IN (%s) ', implode(',', $ids));
         }
         $result = $this->fetchAll($where, $displayName);
         $values = array();
         foreach ($result as $node) {
             $values[] = array('id' => (int) $node->id, 'name' => $node->applyDisplay($displayName, $node));
         }
         $usersNamespace->users = $values;
     }
     return $usersNamespace->users;
 }
開發者ID:penSecIT,項目名稱:PHProjekt,代碼行數:29,代碼來源:User.php


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