本文整理汇总了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());
}
}
示例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);
//.........这里部分代码省略.........
示例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);
}
}