예제 #1
0
파일: Task.php 프로젝트: sebbie42/casebox
 /**
  * load custom data for tasks
  * Note: should be removed after tasks upgraded and custom task tables removed
  */
 protected function loadCustomData()
 {
     parent::loadCustomData();
     $d =& $this->data;
     if (empty($d['data'])) {
         $d['data'] = array();
     }
     // $cd = &$d['data']; //custom data
     // $sd = &$d['sys_data']; //sys_data
     /* add possible action flags*/
     \CB\Tasks::setTaskActionFlags($d);
 }
예제 #2
0
파일: Tasks.php 프로젝트: sebbie42/casebox
 public function getData($id = false)
 {
     $rez = array('success' => true);
     if (empty(parent::getData($id))) {
         return $rez;
     }
     $params = array('pid' => $this->id, 'fq' => array('(template_type:task) OR (target_type:task)'), 'fl' => 'id,pid,name,template_id,date,date_end,cid,cdate,status', 'sort' => 'cdate', 'dir' => 'desc');
     $s = new \CB\Search();
     $sr = $s->query($params);
     foreach ($sr['data'] as $d) {
         $d['ago_text'] = @Util\formatDateTimePeriod($d['date'], null, @$_SESSION['user']['cfg']['timezone']);
         $d['user'] = User::getDisplayName($d['cid'], true);
         \CB\Tasks::setTaskActionFlags($d);
         $rez['data'][] = $d;
     }
     return $rez;
 }