/**
  * returns the a list of log files for the data grid
  */
 public function emailLogsAction()
 {
     $list = new Document_Email_Log_List();
     if ($this->_getParam('documentId')) {
         $list->setCondition('documentId = ' . (int) $this->_getParam('documentId'));
     }
     $list->setLimit($this->_getParam("limit"));
     $list->setOffset($this->_getParam("start"));
     $list->setOrderKey("sentDate");
     if ($this->_getParam('filter')) {
         if ($this->_getParam("filter")) {
             $filterTerm = $list->quote("%" . strtolower($this->_getParam("filter")) . "%");
             $list->setCondition("   `from` LIKE " . $filterTerm . " OR\r\n                                        `to` LIKE " . $filterTerm . " OR\r\n                                        `cc` LIKE " . $filterTerm . " OR\r\n                                        `bcc` LIKE " . $filterTerm . " OR\r\n                                        `subject` LIKE " . $filterTerm . " OR\r\n                                        `params` LIKE " . $filterTerm . "\r\n                                       ");
         }
     }
     $list->setOrder("DESC");
     $data = $list->load();
     $jsonData = array();
     if (is_array($data)) {
         foreach ($data as $entry) {
             $tmp = (array) get_object_vars($entry);
             unset($tmp['bodyHtml']);
             unset($tmp['bodyText']);
             $jsonData[] = $tmp;
         }
     }
     $this->_helper->json(array("data" => $jsonData, "success" => true, "total" => $list->getTotalCount()));
 }
Beispiel #2
0
 /**
  * returns the a list of log files for the data grid
  */
 public function emailLogsAction()
 {
     $list = new Document_Email_Log_List();
     if ($this->_getParam('documentId')) {
         $list->setCondition('documentId = ' . (int) $this->_getParam('documentId'));
     }
     $list->setLimit($this->_getParam("limit"));
     $list->setOffset($this->_getParam("start"));
     $list->setOrderKey("sentDate");
     $list->setOrder("DESC");
     $data = $list->load();
     $jsonData = array();
     if (is_array($data)) {
         foreach ($data as $entry) {
             $tmp = (array) get_object_vars($entry);
             unset($tmp['bodyHtml']);
             unset($tmp['bodyText']);
             $jsonData[] = $tmp;
         }
     }
     $this->_helper->json(array("data" => $jsonData, "success" => true, "total" => $list->getTotalCount()));
 }