protected function fetchFieldValue(Tracker_FormElement_Field_List_Value $value, $name, $is_selected) { if ($value->getId() == Tracker_FormElement_Field_List_Bind_StaticValue_None::VALUE_ID) { return ''; } $id = $value->getId(); $html = ''; $checked = $is_selected ? 'checked="checked"' : ''; $html .= '<label class="checkbox" for="cb_' . $id . '" ><input type="hidden" ' . $name . ' value="0" />'; $html .= '<input type="checkbox" ' . $name . ' value="' . $id . '" id=cb_' . $id . ' ' . $checked . ' valign="middle" />'; $html .= $this->getBind()->formatChangesetValueWithoutLink($value) . '</label>'; return $html; }
protected function fetchFieldValue(Tracker_FormElement_Field_List_Value $value, $name, $is_selected) { if ($value->getId() == Tracker_FormElement_Field_List_Bind_StaticValue_None::VALUE_ID) { if ($this->isRequired()) { return ''; } $is_selected = true; //Hackalert: "None" selected by default. Overrided when other value is selected } $label = $this->getBind()->formatChangesetValueWithoutLink($value); if (!$name) { $name = 'name="admin"'; } $id = $value->getId(); $html = ''; $checked = $is_selected ? 'checked="checked"' : ''; $html .= '<div class="val_' . $id . '">'; $html .= ' <label class="radio" for="rb_' . $id . '" >'; $html .= ' <input type="radio" ' . $name . ' value="' . $id . '" id=rb_' . $id . ' ' . $checked . ' valign="middle" />'; $html .= ' ' . $label . '</label>'; $html .= '</div>'; return $html; }
public function __construct($id) { parent::__construct($id); }
protected function getRESTBindValue(Tracker_FormElement_Field_List_Value $value) { return $value->getAPIValue(); }
public function getFullRESTValue(Tracker_FormElement_Field_List_Value $value) { $class_user_representation = '\\Tuleap\\Project\\REST\\UserGroupRepresentation'; $ugroup_representation = new $class_user_representation(); $ugroup_manager = new UGroupManager(); $project = $this->getField()->getTracker()->getProject(); $user_group = $ugroup_manager->getUGroupByName($project, $value->getLabel()); $ugroup_representation->build($project->getID(), $user_group); return $ugroup_representation; }
private function fetchAdminEditRowNotModifiable(Tracker_FormElement_Field_List_Value $v) { $html = ''; $html .= '<tr valign="top" class="' . ($v->isHidden() ? 'tracker_admin_static_value_hidden' : '') . '">'; $html .= '<td>' . $this->formatChangesetValue(array('id' => $v->getId())) . '</td>'; $html .= '</tr>'; return $html; }
protected function fetchFieldValue(Tracker_FormElement_Field_List_Value $value, $name, $is_selected) { $id = $value->getId(); if ($id == Tracker_FormElement_Field_List_Bind_StaticValue_None::VALUE_ID) { $label = $value->getLabel(); } else { $label = $this->getBind()->formatArtifactValue($id); } $style = $this->getBind()->getSelectOptionInlineStyle($id); $selected = $is_selected ? 'selected="selected"' : ''; return '<option value="' . $id . '" ' . $selected . ' title="' . $label . '" style="' . $style . '">' . $label . '</option>'; }
protected function getRESTBindValue(Tracker_FormElement_Field_List_Value $value) { $class_with_right_namespace = '\\Tuleap\\Tracker\\REST\\FieldValueRepresentation'; $representation = new $class_with_right_namespace(); $values = array(self::SOAP_ID_KEY => $value->getId(), self::SOAP_LABEL_KEY => $value->getSoapValue()); $representation->build($values); return $representation; }
public function getFullRESTValue(Tracker_FormElement_Field_List_Value $value) { return array('label' => $value->getLabel(), 'id' => $value->getId()); }
public function getFullRESTValue(Tracker_FormElement_Field_List_Value $value) { $user_manager = UserManager::instance(); $class_user_representation = '\\Tuleap\\User\\REST\\UserRepresentation'; $user_representation = new $class_user_representation(); $user = $user_manager->getUserByUserName($value->getLabel()); if (!$user) { $user = new PFUser(); $user->setEmail($value->getLabel()); } $user_representation->build($user); return $user_representation; }
public function __construct($id, $label) { parent::__construct($id); $this->label = $label; }
public function getValueLabel() { return $this->value->getLabel(); }
protected function getFullRESTBindValue(Tracker_FormElement_Field_List_Value $value) { return $value->getFullRESTValue($this->field); }
protected function getRESTBindValue(Tracker_FormElement_Field_List_Value $value) { $project = $value->getProject(); $class_ugroup_representation = '\\Tuleap\\Project\\REST\\UserGroupRepresentation'; $ugroup_representation = new $class_ugroup_representation(); $ugroup_representation->build($project->getID(), $this->ugroup_manager->getUGroup($project, $value->getUgroupId())); $class_ugroupvalue_representation = '\\Tuleap\\Tracker\\REST\\FieldListBindUGroupValueRepresentation'; $representation = new $class_ugroupvalue_representation(); $representation->build($value, $ugroup_representation); return $representation; }