/** * Sets the body of the email according to the data received from Notification class * * @param array $params Array with options. * @param array $fields Array with the fields of the model. * @param array $changes Array with changes done in the model. * @param Zend_Locale $lang Locale for use in translations. * * @return void */ public function setCustomBody($params, $fields, $changes, $lang) { $phproject = Phprojekt::getInstance(); $view = $phproject->getView(); $view->mainFields = $fields; if ($changes !== null) { $view->changes = $changes; } $view->title = $phproject->translate('A', $lang) . " " . '"' . $phproject->translate($params['moduleTable'], $lang) . '" ' . $phproject->translate('item has been', $lang) . " " . $phproject->translate($params['actionLabel'], $lang); $view->currentData = $phproject->translate('Current data', $lang); $view->changesDone = $phproject->translate('Changes done', $lang); $view->field = $phproject->translate('Field', $lang); $view->oldValue = $phproject->translate('Old value', $lang); $view->copyright = Phprojekt::COPYRIGHT; $view->url = $params['url']; if ($this->_bodyMode == self::MODE_TEXT) { $view->endOfLine = $this->getEndOfLine(); } Phprojekt_Loader::loadViewScript(); $body = $view->render('mail' . $this->_bodyMode . '.phtml'); switch ($this->_bodyMode) { case self::MODE_TEXT: default: $this->setBodyText($body); break; case self::MODE_HTML: $this->setBodyHtml($body); break; } }
/** * Returns a string with HTML representing the minutes data. * * @param Minutes_Models_Minutes $minutes Minutes object to use for data. * * @return string HTML representation of minutes data. */ private function _getHtmlList(Phprojekt_Model_Interface $minutes) { $items = $minutes->items->fetchAll(); $translate = Phprojekt::getInstance()->getTranslate(); $newitem = array(); foreach ($items as $item) { $data = array(); $data['topicId'] = $this->view->escape($item->topicId); $data['topicType'] = $this->view->escape($item->information->getTopicType($item->topicType)); $data['display'] = nl2br($this->view->escape($item->getDisplay())); $newitem[] = $data; } $this->view->items = $newitem; $this->view->title = $this->view->escape($minutes->title); $this->view->description = nl2br($this->view->escape($minutes->description)); $this->view->txtNo = $translate->translate('No.'); $this->view->txtType = $translate->translate('Type'); $this->view->txtItem = $translate->translate('Item'); Phprojekt_Loader::loadViewScript($this->view); return $this->view->render('table.phtml'); }