/**
  * returns array with the filter settings of this filter group
  *
  * @param  bool $_valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     if (is_string($this->_value)) {
         $this->_value = Addressbook_Controller_ListRole::getInstance()->get($this->_value)->toArray();
     }
     return parent::toArray($_valueToJson);
 }
 /**
  * returns array with the filter settings of this filter
  *
  * @param  bool $_valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     $result = parent::toArray($_valueToJson);
     if ($_valueToJson == true) {
         $tags = Tinebase_Tags::getInstance()->getTagsById($this->_value)->toArray();
         if (count($tags) > 0) {
             $result['value'] = is_array($this->_value) ? $tags : $tags[0];
         } else {
             $result['value'] = '';
         }
     }
     return $result;
 }
Exemplo n.º 3
0
 /**
  * returns array with the filter settings of this filter
  *
  * @param  bool $_valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     $result = parent::toArray($_valueToJson);
     if ($_valueToJson) {
         if (is_array($result['value'])) {
             foreach ($result['value'] as $key => $value) {
                 $result['value'][$key] = $this->_resolveRecord($value);
             }
         } else {
             $result['value'] = $this->_resolveRecord($result['value']);
         }
     }
     return $result;
 }
 /**
  * returns array with the filter settings of this filter
  *
  * @param  bool $_valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     $result = parent::toArray($_valueToJson);
     if ($_valueToJson == true) {
         $result['value'] = Timetracker_Controller_Timeaccount::getInstance()->get($result['value'])->toArray();
     }
     return $result;
 }
 /**
  * returns array with the filter settings of this filter
  *
  * @param  bool $_valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     $result = parent::toArray($_valueToJson);
     $result['value'] = array('from' => $this->_from, 'until' => $this->_until);
     return $result;
 }
 /**
  * returns array with the filter settings of this filter
  *
  * @param  bool $valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($valueToJson = false)
 {
     $result = parent::toArray($valueToJson);
     if (strtolower($this->_cfRecord->definition['type']) == 'record') {
         try {
             $modelParts = explode('.', $this->_cfRecord->definition['recordConfig']['value']['records']);
             // get model parts from saved record class e.g. Tine.Admin.Model.Group
             $controller = Tinebase_Core::getApplicationInstance($modelParts[1], $modelParts[3]);
             $result['value']['value'] = $controller->get($result['value']['value'])->toArray();
         } catch (Exception $e) {
             if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) {
                 Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' Error resolving custom field record: ' . $e->getMessage());
             }
             $result['value']['value'] = $customField->value;
         }
     }
     return $result;
 }
Exemplo n.º 7
0
 /**
  * returns array with the filter settings of this filter
  *
  * @param  bool $_valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     $result = parent::toArray($_valueToJson);
     if ($_valueToJson) {
         Calendar_Model_Attender::resolveAttendee($this->_value);
     }
     $result['value'] = $this->_operator == 'equals' ? $this->_value[0]->toArray($_valueToJson) : $this->_value->toArray($_valueToJson);
     return $result;
 }
 /**
  * returns array with the filter settings of this filter
  *
  * @param  bool $_valueToJson resolve value for json api
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     $result = parent::toArray($_valueToJson);
     if ($_valueToJson == true) {
         // NOTE: at this point operators should be equals or in and all values should be paths
         $values = array();
         foreach ((array) $this->_value as $path) {
             $containerData = array('path' => $path);
             if ($containerId = Tinebase_Model_Container::pathIsContainer($path)) {
                 $containerData = array_merge($containerData, Tinebase_Container::getInstance()->getContainerById($containerId, TRUE)->toArray());
             } else {
                 if ($ownerId = Tinebase_Model_Container::pathIsPersonalNode($path)) {
                     // transform current user
                     $owner = Tinebase_User::getInstance()->getUserByPropertyFromSqlBackend('accountId', $ownerId);
                     $containerData['name'] = $owner->accountDisplayName;
                     $containerData['path'] = "/personal/{$ownerId}";
                     $containerData['owner'] = $owner->toArray();
                 }
             }
             $values[] = $containerData;
         }
         $result['value'] = is_array($this->_value) ? $values : $values[0];
     }
     return $result;
 }
Exemplo n.º 9
0
 /**
  * returns account id and type
  * @see tine20/Tinebase/Model/Filter/Tinebase_Model_Filter_Abstract::toArray()
  * 
  * @param  bool $_valueToJson resolve value for json api?
  * @return array
  */
 public function toArray($_valueToJson = false)
 {
     $result = parent::toArray($_valueToJson);
     $result['value'] = array('accountId' => $this->_accountId, 'accountType' => $this->_accountType);
     return $result;
 }