public function getTitle()
 {
     $title = $GLOBALS['Language']->getText('plugin_agiledashboard', 'milestone_planning_pane_title', $this->submilestone_tracker->getName());
     if (ForgeConfig::get('sys_showdeprecatedplanningv1')) {
         $title .= ' V2';
     }
     return $title;
 }
Exemple #2
0
 /**
  * @return Reference
  */
 public function __construct(Tracker $tracker, $keyword)
 {
     $base_id = 0;
     $visibility = 'P';
     $is_used = 1;
     parent::__construct($base_id, $keyword, $GLOBALS['Language']->getText('project_reference', 'reference_art_desc_key') . ' - ' . $tracker->getName(), TRACKER_BASE_URL . '/?aid=$1&group_id=$group_id', $visibility, trackerPlugin::SERVICE_SHORTNAME, Tracker_Artifact::REFERENCE_NATURE, $is_used, $tracker->getGroupId());
 }
 public function getPossibleArtifactParents(Tracker $parent_tracker, PFUser $user, $limit, $offset)
 {
     $label = '';
     $possible_parents = array();
     $display_selector = true;
     EventManager::instance()->processEvent(TRACKER_EVENT_ARTIFACT_PARENTS_SELECTOR, array('user' => $user, 'parent_tracker' => $parent_tracker, 'possible_parents' => &$possible_parents, 'label' => &$label, 'display_selector' => &$display_selector));
     if (!$possible_parents) {
         $label = $GLOBALS['Language']->getText('plugin_tracker_artifact', 'formelement_artifactlink_open_parent', array($parent_tracker->getName()));
         $possible_parents = $this->artifact_factory->getPaginatedPossibleParentArtifactsUserCanView($user, $parent_tracker->getId(), $limit, $offset);
     }
     return array($label, $possible_parents, $display_selector);
 }
 /**
  * @return string eg: 'Card Wall'
  */
 public function getTitle()
 {
     return $GLOBALS['Language']->getText('plugin_agiledashboard', 'milestone_planning_pane_title', $this->submilestone_tracker->getName());
 }
 public function tracker_name()
 {
     return $this->tracker->getName();
 }
Exemple #6
0
 public static function showEditForm(Tracker $tracker)
 {
     $tpl = array();
     $tpl['TRACKER_TYPE'] = $tracker->trackerType();
     $form = new PHPWS_Form('tracker');
     $form->addHidden('module', 'analytics');
     $form->addHidden('command', 'save_tracker');
     $form->addSubmit('submit', dgettext('analytics', 'Save Tracker'));
     if (isset($_REQUEST['tracker'])) {
         $form->addHidden('tracker', $_REQUEST['tracker']);
     }
     if ($tracker->getId() > 0) {
         $form->addHidden('tracker_id', $tracker->getId());
     }
     $form->addText('name', $tracker->getName());
     $form->setLabel('name', dgettext('analytics', 'Friendly Name'));
     $form->setRequired('name');
     $form->addCheck('active', 1);
     $form->setMatch('active', $tracker->isActive());
     $form->setLabel('active', dgettext('analytics', 'Currently Active'));
     $form->addCheck('disable_if_logged', 1);
     $form->setMatch('disable_if_logged', $tracker->getDisableIfLogged());
     $form->setLabel('disable_if_logged', dgettext('analytics', 'Disable Analytics if a user is logged in'));
     $tracker->addForm($form);
     $tpl = array_merge($tpl, $form->getTemplate());
     $tpl['TRACKER_FORM'] = PHPWS_Template::process($tpl, 'analytics', $tracker->getFormTemplate());
     return PHPWS_Template::process($tpl, 'analytics', 'edit.tpl');
 }
 private function saveFieldMapping(Tracker $mapping_tracker, Tracker_FormElement $field)
 {
     if ($this->dao->save($this->tracker->getId(), $mapping_tracker->getId(), $field->getId())) {
         $this->value_dao->delete($this->tracker->getId(), $mapping_tracker->getId());
         $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_cardwall', 'on_top_mapping_changed', array($mapping_tracker->getName(), $field->getLabel())));
     }
 }
 public function getLabel()
 {
     return $this->tracker->getName();
 }
 /**
  * Do all stuff which have to be done after a tracker creation, like reference creation for example
  *
  * @param Tracker $tracker The tracker
  *
  * @return void
  */
 protected function postCreateActions(Tracker $tracker)
 {
     // Create corresponding reference
     $ref = new Reference(0, strtolower($tracker->getItemName()), $GLOBALS['Language']->getText('project_reference', 'reference_art_desc_key') . ' - ' . $tracker->getName(), TRACKER_BASE_URL . '/?aid=$1&group_id=$group_id', 'P', 'plugin_tracker', Tracker_Artifact::REFERENCE_NATURE, '1', $tracker->getGroupId());
     // Force reference creation because default trackers use reserved keywords
     $this->getReferenceManager()->createReference($ref, true);
 }
 private function sortTrackerAlphabetically(Tracker $a, Tracker $b)
 {
     return strnatcasecmp($a->getName(), $b->getName());
 }
 /**
  * 
  * @param array $tracker_mapping
  * @param array $field_mapping
  * @param Tracker $tracker
  * @param int $from_project_id
  * @param int $to_project_id
  * @param array $ugroup_mapping the ugroup mapping
  * @return type
  */
 private function duplicateTracker($tracker_mapping, $field_mapping, $tracker, $from_project_id, $to_project_id, $ugroup_mapping)
 {
     $tracker_and_field_mapping = $this->create($to_project_id, $from_project_id, $tracker->getId(), $tracker->getName(), $tracker->getDescription(), $tracker->getItemName(), $ugroup_mapping);
     if ($tracker_and_field_mapping) {
         $tracker_mapping[$tracker->getId()] = $tracker_and_field_mapping['tracker']->getId();
         $field_mapping = array_merge($field_mapping, $tracker_and_field_mapping['field_mapping']);
     } else {
         $GLOBALS['Response']->addFeedback('warning', $GLOBALS['Language']->getText('plugin_tracker_admin', 'tracker_not_duplicated', array($tracker->getName())));
     }
     return array($tracker_mapping, $field_mapping);
 }
 /**
  * Renders a link to the given tracker.
  * 
  * @param Tracker $tracker
  * @return String
  */
 private function getLinkToTracker(Tracker $tracker)
 {
     $tracker_id = $tracker->getId();
     $tracker_name = $tracker->getName();
     $tracker_url = TRACKER_BASE_URL . "/?tracker={$tracker_id}&func=admin-formElements";
     $hp = Codendi_HTMLPurifier::instance();
     return '<a href="' . $tracker_url . '">' . $hp->purify($tracker_name) . '</a>';
 }
 /**
  * Créer la popup d'édition
  * @param Tracker $p_oTracker
  * @return Code HTML
  */
 private function createEditPopup($p_oTracker)
 {
     $oPopup = new View('popup');
     $oPopup->addData('id', $p_oTracker->getId());
     $oPopup->addData('buttonstyle', 'btn-primary');
     $oPopup->addData('buttonicon', 'fa-edit');
     $oPopup->addData('buttontext', 'Editer');
     $oPopup->addData('title', 'Edition du Tracker');
     //Création du formulaire
     $oFormEdit = new FormGenerator();
     $oFormEdit->setAction('index.php?p=admintrackers&edit=' . $p_oTracker->getId());
     $oFormEdit->addInput('Nom', 'name', true, false, 'text', '', $p_oTracker->getName());
     $oFormEdit->addInput('Format du lien vers la fiche', 'link', false, false, 'text', '', $p_oTracker->getLink());
     $oFormEdit->addInput('Format du lien vers le torrent', 'directlink', false, false, 'text', '', $p_oTracker->getDirectLink());
     $oFormEdit->addCheckbox('Supprimer', 'delete');
     $oFormEdit->create();
     $oPopup->addData('content', $oFormEdit->getCode());
     $oPopup->create();
     return $oPopup->getCode();
 }