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


PHP Tracker_FormElement_Field::process方法代码示例

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


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

示例1: process

 /**
  * @see Tracker_FormElement::process()
  */
 public function process(Tracker_IDisplayTrackerLayout $layout, $request, $current_user)
 {
     parent::process($layout, $request, $current_user);
     if ($request->get('func') == 'get-values') {
         $GLOBALS['Response']->sendJSON($this->getBind()->fetchFormattedForJson());
     }
 }
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:10,代码来源:Tracker_FormElement_Field_List.class.php

示例2: process

 /**
  * Process the request
  * 
  * @param Tracker_IDisplayTrackerLayout  $layout          Displays the page header and footer
  * @param Codendi_Request                $request         The data coming from the user
  * @param User                           $current_user    The user who mades the request
  *
  * @return void
  */
 public function process(Tracker_IDisplayTrackerLayout $layout, $request, $current_user)
 {
     switch ($request->get('func')) {
         case 'fetch-artifacts':
             $read_only = false;
             $prefill_removed_values = array();
             $only_rows = true;
             $this_project_id = $this->getTracker()->getProject()->getGroupId();
             $hp = Codendi_HTMLPurifier::instance();
             $ugroups = $current_user->getUgroups($this_project_id, array());
             $ids = $request->get('ids');
             //2, 14, 15
             $tracker = array();
             $result = array();
             //We must retrieve the last changeset ids of each artifact id.
             $dao = new Tracker_ArtifactDao();
             foreach ($dao->searchLastChangesetIds($ids, $ugroups, $current_user->isSuperUser()) as $matching_ids) {
                 $tracker_id = $matching_ids['tracker_id'];
                 $tracker = $this->getTrackerFactory()->getTrackerById($tracker_id);
                 $project = $tracker->getProject();
                 if ($tracker->userCanView()) {
                     $trf = Tracker_ReportFactory::instance();
                     $report = $trf->getDefaultReportsByTrackerId($tracker->getId());
                     if ($report) {
                         $renderers = $report->getRenderers();
                         // looking for the first table renderer
                         foreach ($renderers as $renderer) {
                             if ($renderer->getType() === Tracker_Report_Renderer::TABLE) {
                                 $key = $this->id . '_' . $report->id . '_' . $renderer->getId();
                                 $result[$key] = $renderer->fetchAsArtifactLink($matching_ids, $this->getId(), $read_only, $prefill_removed_values, $only_rows);
                                 $head = '<div>';
                                 $project_name = '';
                                 if ($project->getGroupId() != $this_project_id) {
                                     $project_name = ' (<abbr title="' . $hp->purify($project->getPublicName(), CODENDI_PURIFIER_CONVERT_HTML) . '">';
                                     $project_name .= $hp->purify($project->getUnixName(), CODENDI_PURIFIER_CONVERT_HTML);
                                     $project_name .= '</abbr>)';
                                 }
                                 $head .= '<h2 class="tracker-form-element-artifactlink-tracker_' . $tracker->getId() . '">';
                                 $head .= $hp->purify($tracker->getName(), CODENDI_PURIFIER_CONVERT_HTML) . $project_name;
                                 $head .= '</h2>';
                                 //if ($artifact) {
                                 //    $title = $hp->purify('link a '. $tracker->getItemName(), CODENDI_PURIFIER_CONVERT_HTML);
                                 //    $head .= '<a href="'.TRACKER_BASE_URL.'/?tracker='.$tracker_id.'&func=new-artifact-link&id='.$artifact->getId().'" class="tracker-form-element-artifactlink-link-new-artifact">'. 'create a new '.$hp->purify($tracker->getItemName(), CODENDI_PURIFIER_CONVERT_HTML)  .'</a>';
                                 //}
                                 $result[$key]['head'] = $head . $result[$key]['head'];
                                 break;
                             }
                         }
                     }
                 }
             }
             if ($result) {
                 $head = array();
                 $rows = array();
                 foreach ($result as $key => $value) {
                     $head[$key] = $value["head"];
                     $rows[$key] = $value["rows"];
                 }
                 header('Content-type: application/json');
                 echo json_encode(array('head' => $head, 'rows' => $rows));
             }
             exit;
             break;
         case 'fetch-aggregates':
             $read_only = false;
             $prefill_removed_values = array();
             $only_rows = true;
             $only_one_column = false;
             $extracolumn = Tracker_Report_Renderer_Table::EXTRACOLUMN_UNLINK;
             $read_only = true;
             $use_data_from_db = false;
             $ugroups = $current_user->getUgroups($this->getTracker()->getGroupId(), array());
             $ids = $request->get('ids');
             //2, 14, 15
             $tracker = array();
             $json = array('tabs' => array());
             $dao = new Tracker_ArtifactDao();
             foreach ($dao->searchLastChangesetIds($ids, $ugroups, $current_user->isSuperUser()) as $matching_ids) {
                 $tracker_id = $matching_ids['tracker_id'];
                 $tracker = $this->getTrackerFactory()->getTrackerById($tracker_id);
                 $project = $tracker->getProject();
                 if ($tracker->userCanView()) {
                     $trf = Tracker_ReportFactory::instance();
                     $report = $trf->getDefaultReportsByTrackerId($tracker->getId());
                     if ($report) {
                         $renderers = $report->getRenderers();
                         // looking for the first table renderer
                         foreach ($renderers as $renderer) {
                             if ($renderer->getType() === Tracker_Report_Renderer::TABLE) {
                                 $key = $this->id . '_' . $report->id . '_' . $renderer->getId();
                                 $columns = $renderer->getTableColumns($only_one_column, $use_data_from_db);
//.........这里部分代码省略.........
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:Tracker_FormElement_Field_ArtifactLink.class.php

示例3: process

 /**
  *
  * @param Tracker_IDisplayTrackerLayout $layout
  * @param Codendi_Request               $request
  * @param User                          $current_user 
  */
 public function process(Tracker_IDisplayTrackerLayout $layout, $request, $current_user)
 {
     switch ($request->get('func')) {
         case self::FUNC_SHOW_BURNDOWN:
             try {
                 $artifact_id = $request->getValidated('src_aid', 'uint', 0);
                 $artifact = Tracker_ArtifactFactory::instance()->getArtifactById($artifact_id);
                 if (!$artifact) {
                     return false;
                 }
                 $this->fetchBurndownImage($artifact, $current_user);
             } catch (Tracker_FormElement_Field_BurndownException $e) {
                 $this->displayErrorImage($GLOBALS['Language']->getText('plugin_tracker', $e->getMessage()));
             }
             break;
         default:
             parent::process($layout, $request, $current_user);
     }
 }
开发者ID:nterray,项目名称:tuleap,代码行数:25,代码来源:Tracker_FormElement_Field_Burndown.class.php


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