/** * add body rows * * @param Tinebase_Record_RecordSet $records */ public function processIteration($_records) { $record = $_records->getFirstRecord(); $converter = Tinebase_Convert_Factory::factory($record); $resolved = $converter->fromTine20Model($record); foreach ($this->_config->properties->prop as $prop) { $property = (string) $prop; // @TODO: remove the utf8_decode here when PHPWord_Template does not convert to utf8 anymore. // the htmlspecialchars shouldn't be required, this should have been done by the PHPWord Library $this->_docTemplate->setValue($property, isset($resolved[$property]) ? utf8_decode(htmlspecialchars($resolved[$property])) : ''); } }
public function processIteration($_records) { $record = $_records->getFirstRecord(); $converter = Tinebase_Convert_Factory::factory($record); $resolved = $converter->fromTine20Model($record); $this->_docTemplate->setValue('salutation_letter', $this->_getSalutation($resolved)); $this->_docTemplate->setValue('salutation_resolved', $this->_getShortSalutation($resolved)); parent::processIteration($_records); }
/** * convert client record to array * * @return array */ protected function _clientRecordToArray() { if (!$this->_clientRecord) { return array(); } $this->_resolveClientRecordTags(); $converter = Tinebase_Convert_Factory::factory($this->_clientRecord); $result = $converter->fromTine20Model($this->_clientRecord); return $result; }
/** * returns multiple records prepared for json transport * * @param Tinebase_Record_RecordSet $_records Tinebase_Record_Abstract * @param Tinebase_Model_Filter_FilterGroup $_filter * @param Tinebase_Model_Pagination $_pagination * @return array data */ protected function _multipleRecordsToJson(Tinebase_Record_RecordSet $_records, $_filter = NULL, $_pagination = NULL) { $result = array(); if ($_records->getFirstRecord()) { $converter = Tinebase_Convert_Factory::factory($_records->getFirstRecord()); $result = $converter->fromTine20RecordSet($_records, $_filter, $_pagination); } return $result; }
/** * add body rows * * @param Tinebase_Record_RecordSet $records */ public function processIteration($_records) { $record = $_records->getFirstRecord(); $converter = Tinebase_Convert_Factory::factory($record); $resolved = $converter->fromTine20Model($record); foreach ($this->_config->properties->prop as $prop) { $property = (string) $prop; $this->_docTemplate->setValue($property, isset($resolved[$property]) ? htmlspecialchars($resolved[$property]) : ''); } }
/** * get exception data as array * * @return array * * @todo check if model has a specific json converter (use factory?) */ protected function _dataToArray() { $converter = Tinebase_Convert_Factory::factory($this->_modelName); $result = $converter->fromTine20RecordSet($this->_exceptionData); return $result; }