Exemplo n.º 1
0
 /**
  * Renders list of currently tracked tasks
  * 
  * @return string
  */
 public function render()
 {
     $result = '';
     if (!empty($this->trackingTasks)) {
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell(__('Address'));
         $cells .= wf_TableCell(__('Job type'));
         $cells .= wf_TableCell(__('Phone'));
         $cells .= wf_TableCell(__('Who should do'));
         $cells .= wf_TableCell(__('Worker done'));
         $cells .= wf_TableCell(__('Target date'));
         $cells .= wf_TableCell(__('Finish date'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($this->trackingTasks as $taskid => $trackid) {
             if (isset($this->allTasks[$taskid])) {
                 $taskData = $this->allTasks[$taskid];
                 if ($taskData['status']) {
                     $rowStyle = 'donetask';
                 } else {
                     $rowStyle = 'undone';
                 }
                 $cells = wf_TableCell($taskid);
                 $cells .= wf_TableCell($taskData['address']);
                 $cells .= wf_TableCell(@$this->allJobtypes[$taskData['jobtype']]);
                 $cells .= wf_TableCell($taskData['phone']);
                 $cells .= wf_TableCell(@$this->allEmployee[$taskData['employee']]);
                 $cells .= wf_TableCell(@$this->allEmployee[$taskData['employeedone']]);
                 $cells .= wf_TableCell($taskData['startdate']);
                 $cells .= wf_TableCell($taskData['enddate']);
                 $actLinks = wf_Link('?module=taskman&edittask=' . $taskid, web_edit_icon()) . ' ';
                 $actLinks .= wf_JSAlert('?module=taskmantrack&untrackid=' . $taskid, wf_img('skins/icon_cleanup.png', __('Stop tracking this task')), $this->messages->getEditAlert());
                 $cells .= wf_TableCell($actLinks);
                 $rows .= wf_TableRow($cells, $rowStyle);
             } else {
                 //task is deleted
             }
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
     } else {
         $result = $this->messages->getStyledMessage(__('You are currently not tracking any tasks'), 'info');
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Renders list of available reserved items sorted by Employee with some controls
  * 
  * @return string
  */
 public function reserveRenderList()
 {
     $result = '';
     if (!empty($this->allReserve)) {
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell(__('Warehouse storage'));
         $cells .= wf_TableCell(__('Category'));
         $cells .= wf_TableCell(__('Warehouse item type'));
         $cells .= wf_TableCell(__('Count'));
         $cells .= wf_TableCell(__('Worker'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($this->allReserve as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell(@$this->allStorages[$each['storageid']]);
             $cells .= wf_TableCell(@$this->allCategories[$this->allItemTypes[$each['itemtypeid']]['categoryid']]);
             $cells .= wf_TableCell(@$this->allItemTypeNames[$each['itemtypeid']]);
             $cells .= wf_TableCell($each['count'] . ' ' . @$this->unitTypes[$this->allItemTypes[$each['itemtypeid']]['unit']]);
             $cells .= wf_TableCell(@$this->allEmployee[$each['employeeid']]);
             $actLinks = wf_JSAlert(self::URL_ME . '&' . self::URL_RESERVE . '&deletereserve=' . $each['id'], web_delete_icon(), $this->messages->getEditAlert()) . ' ';
             $actLinks .= wf_modalAuto(web_edit_icon(), __('Edit') . ' ' . __('Reservation'), $this->reserveEditForm($each['id']), '');
             $cells .= wf_TableCell($actLinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
     } else {
         $result = $this->messages->getStyledMessage(__('Nothing found'), 'info');
     }
     return $result;
 }