public function runDeleteEdition(TBGRequest $request) { if ($this->access_level == TBGSettings::ACCESS_FULL) { try { $theEdition = TBGContext::factory()->TBGEdition($request->getParameter('edition_id')); $project = $theEdition->getProject(); $theEdition->delete(); $count = count(TBGEdition::getAllByProjectID($project->getID())); return $this->renderJSON(array('failed' => false, 'deleted' => true, 'itemcount' => $count, 'message' => TBGContext::getI18n()->__('Edition deleted'))); } catch (Exception $e) { return $this->renderJSON(array('failed' => true, "error" => TBGContext::getI18n()->__('Could not delete this edition') . ", " . $e->getMessage())); } } return $this->renderJSON(array('failed' => true, "error" => $i18n->__("You don't have access to modify edition"))); }
switch ($info['type']) { case TBGCustomDatatype::EDITIONS_CHOICE: ?> <a href="javascript:void(0);" onclick="setField('<?php echo make_url('issue_setfield', array('project_key' => $issue->getProject()->getKey(), 'issue_id' => $issue->getID(), 'field' => $field, $field . '_value' => "")); ?> ', '<?php echo $field; ?> ');"><?php echo $info['clear']; ?> </a><br> <ul class="choices"> <?php foreach (TBGEdition::getAllByProjectID($issue->getProject()->getID()) as $choice) { ?> <li> <?php echo image_tag('icon_edition.png', array('style' => 'float: left; margin-right: 5px;')); ?> <a href="javascript:void(0);" onclick="setField('<?php echo make_url('issue_setfield', array('project_key' => $issue->getProject()->getKey(), 'issue_id' => $issue->getID(), 'field' => $field, $field . '_value' => $choice->getID())); ?> ', '<?php echo $field; ?> ');"><?php echo $choice->getName(); ?> </a>
/** * Populates editions inside the project * * @return void */ protected function _populateEditions() { if ($this->_editions === null) { $this->_editions = array(); foreach (TBGEdition::getAllByProjectID($this->getID()) as $edition) { if ($edition->hasAccess()) { $this->_editions[$edition->getID()] = $edition; } } } }
<?php break; case TBGCustomDatatype::EDITIONS_CHOICE: ?> <select name="<?php echo $customdatatype->getKey(); ?> _id" id="<?php echo $customdatatype->getKey(); ?> _id_additional"> <?php if ($selected_project instanceof TBGProject) { ?> <?php foreach (TBGEdition::getAllByProjectID($selected_project->getID()) as $option) { ?> <option value="<?php echo $option->getID(); ?> "<?php if ($selected_customdatatype[$customdatatype->getKey()] == $option->getID()) { ?> selected<?php } ?> ><?php echo $option->getName(); ?> </option> <?php