예제 #1
0
 /**
  * Get edit form for user
  */
 public function runGetUserEditForm(TBGRequest $request)
 {
     return $this->renderJSON(array('failed' => false, "content" => get_template_html('finduser_row_editable', array('user' => TBGContext::factory()->TBGUser($request->getParameter('user_id'))))));
 }
    ?>
</div>
							<?php 
    if ($step->getNumberOfOutgoingTransitions() == 0) {
        ?>
								<div class="faded_out"><?php 
        echo __("This step doesn't have any outgoing transitions");
        ?>
</div>
							<?php 
    } else {
        ?>
								<?php 
        $output = array();
        foreach ($step->getOutgoingTransitions() as $transition) {
            $output[] = get_template_html('configuration/workflowtransition', array('transition' => $transition, 'direction' => 'outgoing'));
        }
        echo join($glue, $output);
        ?>
							<?php 
    }
    ?>
						</div>
					</div>
					<?php 
    include_template('configuration/workflowaddtransition', array('step' => $step));
    ?>
					<div id="workflow_details_step">
						<dl id="step_details_info">
							<dt><?php 
    echo __('Name');
예제 #3
0
function acme_portfolio_shortcode($attributes, $content = null)
{
    $default_attributes = array();
    $attributes = shortcode_atts($default_attributes, $attributes);
    return get_template_html('page-portfolio', $attributes);
}
예제 #4
0
 public function runAddAffected(TBGRequest $request)
 {
     TBGContext::loadLibrary('ui');
     try {
         $issue = TBGContext::factory()->TBGIssue($request['issue_id']);
         $statuses = TBGStatus::getAll();
         switch ($request['item_type']) {
             case 'edition':
                 if (!$issue->getProject()->isEditionsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('Editions are disabled')));
                 } elseif (!$issue->canEditAffectedEditions()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('You are not allowed to do this')));
                 }
                 $edition = TBGContext::factory()->TBGEdition($request['which_item_edition']);
                 if (TBGIssueAffectsEditionTable::getTable()->getByIssueIDandEditionID($issue->getID(), $edition->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('%item is already affected by this issue', array('%item' => $edition->getName()))));
                 }
                 $edition = $issue->addAffectedEdition($edition);
                 $item = $edition;
                 $itemtype = 'edition';
                 $itemtypename = TBGContext::getI18n()->__('Edition');
                 $content = get_template_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 $message = TBGContext::getI18n()->__('Edition <b>%edition</b> is now affected by this issue', array('%edition' => $edition['edition']->getName()));
                 break;
             case 'component':
                 if (!$issue->getProject()->isComponentsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('Components are disabled')));
                 } elseif (!$issue->canEditAffectedComponents()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('You are not allowed to do this')));
                 }
                 $component = TBGContext::factory()->TBGComponent($request['which_item_component']);
                 if (TBGIssueAffectsComponentTable::getTable()->getByIssueIDandComponentID($issue->getID(), $component->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('%item is already affected by this issue', array('%item' => $component->getName()))));
                 }
                 $component = $issue->addAffectedComponent($component);
                 $item = $component;
                 $itemtype = 'component';
                 $itemtypename = TBGContext::getI18n()->__('Component');
                 $content = get_template_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 $message = TBGContext::getI18n()->__('Component <b>%component</b> is now affected by this issue', array('%component' => $component['component']->getName()));
                 break;
             case 'build':
                 if (!$issue->getProject()->isBuildsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('Releases are disabled')));
                 } elseif (!$issue->canEditAffectedBuilds()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('You are not allowed to do this')));
                 }
                 $build = TBGContext::factory()->TBGBuild($request['which_item_build']);
                 if (TBGIssueAffectsBuildTable::getTable()->getByIssueIDandBuildID($issue->getID(), $build->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => TBGContext::getI18n()->__('%item is already affected by this issue', array('%item' => $build->getName()))));
                 }
                 $build = $issue->addAffectedBuild($build);
                 $item = $build;
                 $itemtype = 'build';
                 $itemtypename = TBGContext::getI18n()->__('Release');
                 $content = get_template_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 $message = TBGContext::getI18n()->__('Release <b>%build</b> is now affected by this issue', array('%build' => $build['build']->getName()));
                 break;
             default:
                 throw new Exception('Internal error');
                 break;
         }
         $editions = array();
         $components = array();
         $builds = array();
         if ($issue->getProject()->isEditionsEnabled()) {
             $editions = $issue->getEditions();
         }
         if ($issue->getProject()->isComponentsEnabled()) {
             $components = $issue->getComponents();
         }
         if ($issue->getProject()->isBuildsEnabled()) {
             $builds = $issue->getBuilds();
         }
         $count = count($editions) + count($components) + count($builds);
         return $this->renderJSON(array('content' => $content, 'message' => $message, 'itemcount' => $count));
     } catch (Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => $e->getMessage()));
     }
 }
<?php

$found = false;
foreach ($editions as $releases) {
    if (array_key_exists(0, $releases)) {
        $found = true;
        if ($releases[0]->getEdition() instanceof TBGEdition) {
            echo '<div class="tab_header">' . $releases[0]->getEdition()->getName() . '</div>';
        }
        echo '<ul class="simple_list">' . get_template_html('project/release', array('build' => $releases[0])) . '</ul>';
    }
}
if ($found == false) {
    ?>
<p class="content faded_out"><?php 
    echo __('There are no downloadable releases at the moment');
    ?>
</p><?php 
}