Ejemplo n.º 1
0
 public function testVisitSelectbox()
 {
     $visitor = new Tracker_FormElement_View_Admin_Visitor(array());
     $formElement = new Tracker_FormElement_Field_Selectbox(null, null, null, null, null, null, null, null, null, null, null, null);
     $formElement->accept($visitor);
     $this->assertIsA($visitor->getAdmin(), 'Tracker_FormElement_View_Admin_Field_Selectbox');
 }
Ejemplo n.º 2
0
 /**
  * @param Cardwall_Board $board The board
  * @param string $redirect_parameter the redirect paramter to add to various url
  * @param Tracker_FormElement_Field_Selectbox $field form to choose the column. false if no form (in widget) (thus no typehinting)
  * @param $form
  */
 public function __construct(Cardwall_Board $board, $redirect_parameter, $field, $form)
 {
     parent::__construct($board, $redirect_parameter);
     $hp = Codendi_HTMLPurifier::instance();
     $this->nifty = Toggler::getClassname('cardwall_board-nifty') == 'toggler' ? 'nifty' : false;
     $this->swimline_title = '';
     $this->has_swimline_header = false;
     $this->field = $field ? $field : false;
     $this->form = $form ? $form : false;
     $this->has_columns = count($this->board->columns) > 0;
     $this->warn_please_choose = $GLOBALS['Language']->getText('plugin_cardwall', 'warn_please_choose');
     $field_label = $field ? $hp->purify($this->field->getLabel()) : '###';
     $this->warn_no_values = $GLOBALS['Language']->getText('plugin_cardwall', 'warn_no_values', $field_label);
 }
Ejemplo n.º 3
0
 /**
  * Create values in selectBox field
  *
  * @param Tracker_FormElement_Field_Selectbox $field
  * @param Array $values
  */
 private function createSelectBoxValues(Tracker_FormElement_Field_Selectbox $field, $values)
 {
     $request = new SOAPRequest(array());
     $concatenatedValues = implode("\n", $values);
     $bindValues['add'] = $concatenatedValues;
     $request->set('bind', $bindValues);
     try {
         $field->processSoap($request);
     } catch (Exception $e) {
         return new SoapFault((string) $e->getCode(), $e->getMessage());
     }
     return true;
 }
 public function isNone($value)
 {
     return parent::isNone($this->filterZeroWhenArray($value));
 }
 public function getFieldDataFromCSVValue($csv_value)
 {
     if ($csv_value == null) {
         return array(Tracker_FormElement_Field_List_Bind_StaticValue_None::VALUE_ID);
     }
     return parent::getFieldDataFromCSVValue($csv_value);
 }
 protected function getMaxSize()
 {
     return $this->getproperty('size') ? $this->getproperty('size') : parent::getMaxSize();
 }
 public function itThrowsAnExceptionWhenReturningValueIndexedByFieldName()
 {
     $field = new Tracker_FormElement_Field_Selectbox(1, 101, null, 'field_sb', 'Field SB', '', 1, 'P', true, '', 1);
     $this->expectException('Tracker_FormElement_RESTValueByField_NotImplementedException');
     $value = 'some_value';
     $field->getFieldDataFromRESTValueByField($value);
 }