当前位置: 首页>>代码示例>>PHP>>正文


PHP Codendi_Request::exist方法代码示例

本文整理汇总了PHP中Codendi_Request::exist方法的典型用法代码示例。如果您正苦于以下问题:PHP Codendi_Request::exist方法的具体用法?PHP Codendi_Request::exist怎么用?PHP Codendi_Request::exist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Codendi_Request的用法示例。


在下文中一共展示了Codendi_Request::exist方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateConfiguration

 public function updateConfiguration()
 {
     if (!$this->request->exist('kanban-title-admin')) {
         $this->response->missingKanbanTitle();
         return;
     }
     $kanban_is_activated = $this->getActivatedKanban();
     $this->config_manager->updateConfiguration($this->project_id, $this->config_manager->scrumIsActivatedForProject($this->project_id), $kanban_is_activated, $this->config_manager->getScrumTitle($this->project_id), $this->getKanbanTitle());
     if ($kanban_is_activated) {
         $this->first_kanban_creator->createFirstKanban();
     }
     $this->response->kanbanConfigurationUpdated();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:AgileDashboardKanbanConfigurationUpdater.class.php

示例2: update

 public function update()
 {
     $vChildren = new Valid_UInt('children');
     $vChildren->required();
     if ($this->request->validArray($vChildren)) {
         $this->dao->updateChildren($this->tracker->getId(), $this->request->get('children'));
     } else {
         if ($this->request->exist('children')) {
             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_hierarchy', 'controller_bad_request'));
         } else {
             $this->dao->deleteAllChildren($this->tracker->getId());
         }
     }
     $this->redirect(array('tracker' => $this->tracker->getId(), 'func' => 'admin-hierarchy'));
 }
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:15,代码来源:Controller.class.php

示例3: getCurrentCommitSha1

 private function getCurrentCommitSha1()
 {
     if ($this->request->exist(self::OLD_COMMIT_TREE)) {
         return $this->request->get(self::OLD_COMMIT_TREE);
     }
     return 'HEAD';
 }
开发者ID:blestab,项目名称:tuleap,代码行数:7,代码来源:Content.class.php

示例4: getDispatchableFromRequest

 /**
  * Return the Tracker object that correspond to the given request
  *
  * @param Codendi_Request $request The request
  * @param User            $user    Who access the request
  * 
  * @return Tracker_Dispatchable_Interface
  */
 function getDispatchableFromRequest(Codendi_Request $request, User $user)
 {
     if ((int) $request->get('aid')) {
         if ($artifact = $this->getArtifactFactory()->getArtifactByid($request->get('aid'))) {
             return $artifact;
         } else {
             throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'artifact_not_exist'));
         }
     } else {
         if ((int) $request->get('report')) {
             $store_in_session = true;
             if ($request->exist('store_in_session')) {
                 $store_in_session = (bool) $request->get('store_in_session');
             }
             if ($report = $this->getArtifactReportFactory()->getReportById($request->get('report'), $user->getId(), $store_in_session)) {
                 return $report;
             } else {
                 throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'report_not_exist'));
             }
         } else {
             if ((int) $request->get('tracker') || (int) $request->get('atid')) {
                 $tracker_id = (int) $request->get('tracker');
                 if (!$tracker_id) {
                     $tracker_id = (int) $request->get('atid');
                 }
                 if ($tracker = $this->getTrackerFactory()->getTrackerByid($tracker_id)) {
                     return $tracker;
                 } else {
                     throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'tracker_not_exist'));
                 }
             } else {
                 if ((int) $request->get('formElement')) {
                     if ($formElement = $this->getTracker_FormElementFactory()->getFormElementByid($request->get('formElement'))) {
                         return $formElement;
                     }
                 } else {
                     if ($request->get('func') == 'new-artifact-link') {
                         if ($artifact = Tracker_ArtifactFactory::instance()->getArtifactByid($request->get('id'))) {
                             return $artifact;
                         } else {
                             throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'artifact_not_exist'));
                         }
                     } else {
                         if ((int) $request->get('link-artifact-id')) {
                             if ($artifact = Tracker_ArtifactFactory::instance()->getArtifactByid($request->get('link-artifact-id'))) {
                                 return $artifact;
                             } else {
                                 throw new Tracker_ResourceDoesntExistException($GLOBALS['Language']->getText('plugin_tracker_common_type', 'artifact_not_exist'));
                             }
                         }
                     }
                 }
             }
         }
     }
     throw new Tracker_NoMachingResourceException();
 }
开发者ID:nterray,项目名称:tuleap,代码行数:65,代码来源:Tracker_URL.class.php

示例5: getSendNotificationsFromRequest

 /**
  * @return boolean
  */
 private function getSendNotificationsFromRequest(Codendi_Request $request)
 {
     $send_notifications = false;
     if ($request->exist('notify')) {
         if ($request->get('notify') == 'ok') {
             $send_notifications = true;
         }
     }
     return $send_notifications;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:MasschangeUpdater.class.php

示例6: getMilestoneArtifact

 private function getMilestoneArtifact(User $user, Codendi_Request $request, Tracker_Artifact $artifact)
 {
     $source_artifact = null;
     if ($request->exist('link-artifact-id')) {
         $ancestors = $artifact->getAllAncestors($user);
         if (count($ancestors) == 0) {
             $source_artifact = $this->getSourceArtifact($request, 'link-artifact-id');
         }
     } else {
         $source_artifact = $this->getSourceArtifact($request, 'child_milestone');
     }
     return $source_artifact;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:13,代码来源:ArtifactLinker.class.php

示例7: process

 /**
  * Process the artifact functions
  *
  * @param Tracker_IDisplayTrackerLayout  $layout          Displays the page header and footer
  * @param Codendi_Request                $request         The data from the user
  * @param PFUser                           $current_user    The current user
  *
  * @return void
  */
 public function process(Tracker_IDisplayTrackerLayout $layout, $request, $current_user)
 {
     switch ($request->get('func')) {
         case 'get-children':
             $children = $this->getChildPresenterCollection($current_user);
             $GLOBALS['Response']->sendJSON($children);
             exit;
             break;
         case 'update-comment':
             if ((int) $request->get('changeset_id') && $request->exist('content')) {
                 if ($changeset = $this->getChangeset($request->get('changeset_id'))) {
                     $comment_format = $this->validateCommentFormat($request, 'comment_format');
                     $changeset->updateComment($request->get('content'), $current_user, $comment_format, $_SERVER['REQUEST_TIME']);
                     if ($request->isAjax()) {
                         //We assume that we can only change a comment from a followUp
                         echo $changeset->getComment()->fetchFollowUp();
                     }
                 }
             }
             break;
         case 'preview-attachment':
         case 'show-attachment':
             if ((int) $request->get('field') && (int) $request->get('attachment')) {
                 $ff = Tracker_FormElementFactory::instance();
                 //TODO: check that the user can read the field
                 if ($field = $ff->getFormElementByid($request->get('field'))) {
                     $method = explode('-', $request->get('func'));
                     $method = $method[0];
                     $method .= 'Attachment';
                     if (method_exists($field, $method)) {
                         $field->{$method}($request->get('attachment'));
                     }
                 }
             }
             break;
         case 'artifact-delete-changeset':
             // @see comment in Tracker_Artifact_Changeset::fetchFollowUp()
             //if ($changeset = $this->getChangeset($request->get('changeset'))) {
             //    $changeset->delete($current_user);
             //}
             $GLOBALS['Response']->redirect('?aid=' . $this->id);
             break;
         case 'artifact-update':
             $action = new Tracker_Action_UpdateArtifact($this, $this->getFormElementFactory(), $this->getEventManager());
             $action->process($layout, $request, $current_user);
             break;
         case 'check-user-can-link-and-unlink':
             $source_artifact = (int) $request->get('from-artifact');
             $destination_artifact = (int) $request->get('to-artifact');
             if (!($this->userHasRankingPermissions($source_artifact) && $this->userHasRankingPermissions($destination_artifact))) {
                 $this->sendUserDoesNotHavePermissionsErrorCode();
             }
             break;
         case 'unassociate-artifact-to':
             $artlink_fields = $this->getFormElementFactory()->getUsedArtifactLinkFields($this->getTracker());
             $linked_artifact_id = $request->get('linked-artifact-id');
             if (!$this->userHasRankingPermissions($this->getId())) {
                 $this->sendUserDoesNotHavePermissionsErrorCode();
                 break;
             }
             if (count($artlink_fields)) {
                 $this->unlinkArtifact($artlink_fields, $linked_artifact_id, $current_user);
                 $this->summonArtifactAssociators($request, $current_user, $linked_artifact_id);
             } else {
                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker', 'must_have_artifact_link_field'));
                 $GLOBALS['Response']->sendStatusCode(400);
             }
             break;
         case 'associate-artifact-to':
             $linked_artifact_id = $request->get('linked-artifact-id');
             if (!$this->userHasRankingPermissions($this->getId())) {
                 $this->sendUserDoesNotHavePermissionsErrorCode();
                 break;
             }
             if (!$this->linkArtifact($linked_artifact_id, $current_user)) {
                 $GLOBALS['Response']->sendStatusCode(400);
             } else {
                 $this->summonArtifactAssociators($request, $current_user, $linked_artifact_id);
             }
             break;
         case 'higher-priority-than':
             $target_id = (int) $request->get('target-id');
             $milestone_id = (int) $request->get('milestone-id');
             $project_id = $this->getProjectId();
             $user_is_authorized = $this->userHasRankingPermissions($milestone_id);
             if (!$this->userHasRankingPermissions($milestone_id)) {
                 $this->sendUserDoesNotHavePermissionsErrorCode();
                 break;
             }
             $this->getPriorityManager()->moveArtifactBeforeWithHistoryChangeLogging($this->getId(), $target_id, $milestone_id, $project_id);
             break;
//.........这里部分代码省略.........
开发者ID:superlinger,项目名称:tuleap,代码行数:101,代码来源:Tracker_Artifact.class.php

示例8: process

 /**
  * Process the form
  *
  * @param Tracker_SemanticManager $sm              The semantic manager
  * @param TrackerManager          $tracker_manager The tracker manager
  * @param Codendi_Request         $request         The request
  * @param User                    $current_user    The user who made the request
  *
  * @return void
  */
 public function process(Tracker_SemanticManager $sm, TrackerManager $tracker_manager, Codendi_Request $request, User $current_user)
 {
     if ($request->exist('update')) {
         if ($request->get('field_id') == '-1') {
             if ($this->getField()) {
                 $this->delete();
             }
         } else {
             if ($field = Tracker_FormElementFactory::instance()->getUsedListFieldById($this->tracker, $request->get('field_id'))) {
                 if ($this->getFieldId() != $request->get('field_id') || $request->get('open_values')) {
                     $this->list_field = $field;
                     $open_values = $request->get('open_values');
                     if ($open_values && is_array($open_values) && isset($open_values[$this->getFieldId()]) && is_array($open_values[$this->getFieldId()])) {
                         $this->open_values = $open_values[$this->getFieldId()];
                         if ($this->save()) {
                             $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'status_now', array($field->getLabel())));
                             $GLOBALS['Response']->redirect($this->getUrl());
                         } else {
                             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'unable_save_status'));
                         }
                     } else {
                         //Display the form to choose the values
                         //nop - see below
                     }
                 }
             } else {
                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'bad_field_status'));
             }
         }
     }
     $this->displayAdmin($sm, $tracker_manager, $request, $current_user);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:42,代码来源:Tracker_Semantic_Status.class.php

示例9: process

 /**
  * Process the form
  *
  * @param Tracker_SemanticManager $sm              The semantic manager
  * @param TrackerManager          $tracker_manager The tracker manager
  * @param Codendi_Request         $request         The request
  * @param PFUser                    $current_user    The user who made the request
  *
  * @return void
  */
 public function process(Tracker_SemanticManager $sm, TrackerManager $tracker_manager, Codendi_Request $request, PFUser $current_user)
 {
     if ($request->exist('update')) {
         if ($field = Tracker_FormElementFactory::instance()->getUsedUserSbFieldById($this->tracker, $request->get('list_field_id'))) {
             $this->list_field = $field;
             if ($this->save()) {
                 $this->sendContributorChangeEvent();
                 $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'contributor_now', array($field->getLabel())));
                 $GLOBALS['Response']->redirect($this->getUrl());
             } else {
                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'unable_save_contributor'));
             }
         } elseif ($request->get('list_field_id') == self::NO_VALUE) {
             if ($this->delete()) {
                 $this->sendContributorChangeEvent();
                 $GLOBALS['Response']->redirect($this->getUrl());
             } else {
                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'unable_save_contributor'));
             }
         } else {
             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'bad_field_contributor'));
         }
     }
     $this->displayAdmin($sm, $tracker_manager, $request, $current_user);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:35,代码来源:Tracker_Semantic_Contributor.class.php

示例10: process

 /**
  * Process the form
  *
  * @param Tracker_SemanticManager $semantic_manager The semantic manager
  * @param TrackerManager          $tracker_manager  The tracker manager
  * @param Codendi_Request         $request          The request
  * @param PFUser                  $current_user     The user who made the request
  *
  * @return void
  */
 public function process(Tracker_SemanticManager $semantic_manager, TrackerManager $tracker_manager, Codendi_Request $request, PFUser $current_user)
 {
     if ($request->exist('update')) {
         $field_id = $request->get('initial_effort_field_id');
         $field = Tracker_FormElementFactory::instance()->getUsedPotentiallyContainingNumericValueFieldById($this->tracker, $field_id);
         if ($field) {
             $this->initial_effort_field = $field;
             if ($this->save()) {
                 $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_agiledashboard_admin_semantic', 'initial_effort_now', array($field->getLabel())));
                 $GLOBALS['Response']->redirect($this->getUrl());
             } else {
                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_agiledashboard_admin_semantic', 'unable_save_initial_effort'));
             }
         } else {
             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_agiledashboard_admin_semantic', 'bad_field_initial_effort'));
         }
     }
     $this->displayAdmin($semantic_manager, $tracker_manager, $request, $current_user);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:29,代码来源:Semantic_InitialEffort.class.php

示例11: processSOAP

 public function processSOAP(Codendi_Request $request)
 {
     $uri = $this->getSoapUri();
     $service_class = 'Statistics_SOAPServer';
     require_once $service_class . '.class.php';
     if ($request->exist('wsdl')) {
         $this->dumpWSDL($uri, $service_class);
     } else {
         $this->instantiateSOAPServer($uri, $service_class);
     }
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:11,代码来源:statisticsPlugin.class.php

示例12: process

 /**
  * Process the form
  *
  * @param Tracker_SemanticManager $sm              The semantic manager
  * @param TrackerManager          $tracker_manager The tracker manager
  * @param Codendi_Request         $request         The request
  * @param PFUser                    $current_user    The user who made the request
  *
  * @return void
  */
 public function process(Tracker_SemanticManager $sm, TrackerManager $tracker_manager, Codendi_Request $request, PFUser $current_user)
 {
     if ($request->exist('update')) {
         if ($field = Tracker_FormElementFactory::instance()->getUsedTextFieldById($this->tracker, $request->get('text_field_id'))) {
             $this->text_field = $field;
             if ($this->save()) {
                 $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'description_now', array($field->getLabel())));
                 $GLOBALS['Response']->redirect($this->getUrl());
             } else {
                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'unable_save_description'));
             }
         } else {
             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'bad_field_description'));
         }
     } else {
         if ($request->exist('delete')) {
             if ($this->delete()) {
                 $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'deleted_description'));
                 $GLOBALS['Response']->redirect($this->getUrl());
             } else {
                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'unable_save_description'));
             }
         }
     }
     $this->displayAdmin($sm, $tracker_manager, $request, $current_user);
 }
开发者ID:ndjido,项目名称:tuleap,代码行数:36,代码来源:Tracker_Semantic_Description.class.php

示例13: isFromOverlay

 private function isFromOverlay(Codendi_Request $request)
 {
     if ($request->existAndNonEmpty('link-artifact-id') && !$request->exist('immediate')) {
         return true;
     }
     return false;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:7,代码来源:CreateArtifact.class.php

示例14: getSelectReportUrl

 private function getSelectReportUrl(Codendi_Request $request, Tracker_Report $report)
 {
     $params = array('tracker' => $report->tracker_id);
     if ($request->exist('criteria')) {
         $params['criteria'] = $request->get('criteria');
     }
     return '?' . http_build_query($params);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:Tracker_Report_HeaderRenderer.php


注:本文中的Codendi_Request::exist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。