コード例 #1
0
ファイル: OfficialDocument.php プロジェクト: xepan/hr
 function formatRow()
 {
     $thisTask = $this->model;
     $action_btn_list = $this->model->actions[$this->model['status'] ?: "All"];
     if ($this->officialdocument_type == "Folder") {
         $edit_action = ['edit', 'add_new_folder', 'add_new_file'];
         $action_name = "<a href='" . $this->api->url(null, ['folder_id' => $this->model->id]) . "'>" . $this->model['name'] . "</a>";
     } else {
         $edit_action = ['edit'];
         $action_name = "<a target='_blank' href='" . $this->api->url('xepan_hr_file', ['id' => $this->model->id, 'type' => $this->model['type']]) . "'>" . $this->model['name'] . "</a>";
     }
     // manage action list
     if (!$this->model->iCanEdit()) {
         $action_btn_list = array_diff($action_btn_list, $edit_action);
     }
     if (!$this->model->iCanDelete()) {
         $edit_action = ['delete'];
         $action_btn_list = array_diff($action_btn_list, $edit_action);
     }
     if (!$this->model->iCanShare()) {
         $edit_action = ['share'];
         $action_btn_list = array_diff($action_btn_list, $edit_action);
     }
     $action_btn = $this->add('AbstractController')->add('xepan\\hr\\View_ActionBtn', ['actions' => $action_btn_list ?: [], 'id' => $this->model->id, 'status' => $action_name]);
     $this->current_row_html['action'] = $action_btn->getHTML();
     // $this->current_row_html['starting_date'] = date_format(date_create($this['starting_date']), 'g:ia jS F Y');
     return parent::formatRow();
 }
コード例 #2
0
ファイル: StockAvailibility.php プロジェクト: xepan/commerce
 function formatRow()
 {
     $item = $this->add('xepan\\commerce\\Model_Item');
     $data = $item->getConsumption($this->model['quantity'], json_decode($this->model['extra_info'], true), $this->model['item_id']);
     echo "<pre>";
     print_r($data);
     parent::formatRow();
 }
コード例 #3
0
ファイル: QSP.php プロジェクト: xepan/commerce
 function formatRow()
 {
     $array = json_decode($this->model['extra_info'] ?: "[]", true);
     // echo "<pre>";
     // var_dump($array);
     // exit;
     $cf_html = " ";
     foreach ($array as $department_id => &$details) {
         $department_name = $details['department_name'];
         $cf_list = $this->add('CompleteLister', null, 'extra_info', ['view\\qsp\\extrainfo']);
         $cf_list->template->trySet('department_name', $department_name);
         $cf_list->template->trySet('narration', $details['narration']);
         unset($details['department_name']);
         $cf_list->setSource($details);
         $cf_html .= $cf_list->getHtml();
     }
     if ($cf_html != " ") {
         $cf_html = "<br/>" . $cf_html;
     }
     $this->current_row_html['extra_info'] = $cf_html;
     $this->current_row_html['narration'] = $this->model['narration'];
     $export_design = "";
     $design = $this->add('xepan\\commerce\\Model_Item_Template_Design')->addCondition('item_id', $this->model['item_id'])->addCondition('id', $this->model['item_template_design_id'])->addCondition('contact_id', $this->model['customer_id']);
     $design->tryLoadAny();
     if ($design->loaded()) {
         $url = $this->api->url('xepan_commerce_designer_exportpdf', array('item_id' => "not-defined", 'item_member_design_id' => $design->id, 'xsnb_design_template' => false, 'print_ratio' => 10, 'order_no' => $this->model['qsp_master_id']));
         // $url = str_replace("admin/", "", $url);
         $export_design = '<a class="btn btn-primary" href="' . $url . '" target="_blank">Export Design</a>';
     }
     $this->current_row_html['export_design'] = $export_design;
     $attachements = $this->add("xepan\\commerce\\Model_QSP_DetailAttachment")->addCondition('qsp_detail_id', $this->model->id)->count()->getOne();
     if ($attachements) {
         $this->current_row_html['export_attachments'] = '<a class="btn btn-primary order-export-attachments" data-id="' . $this->model->id . '" >Export Attachements</a>';
     }
     parent::formatRow();
 }
コード例 #4
0
ファイル: DayBook.php プロジェクト: xepan/accounts
 function formatRow()
 {
     $this->current_row_html['forcedelete'] = "-";
     parent::formatRow();
 }
コード例 #5
0
ファイル: TaskList.php プロジェクト: xepan/projects
 function formatRow()
 {
     $thisTask = $this->model;
     $this->current_row['task_no'] = str_pad($this->model->id, 4, '0', STR_PAD_LEFT);
     if ($this->del_action_wrapper) {
         $this->current_row['dashboard_sport_for_action'] = $thisTask['status'];
         $this->current_row['action_wrapper'] = ' ';
     } else {
         $this->current_row['dashboard_sport_for_action'] = ' ';
         $this->current_row['status_wrapper'] = ' ';
     }
     if ($this->isCurrentTask()) {
         $this->createRunning();
     } else {
         $this->createStopped();
     }
     $action_btn_list = $this->model->actions[$this->model['status']];
     // first Column
     if ($thisTask->isMyTask()) {
         if ($this['status'] == 'Pending' && !$thisTask->createdByMe()) {
             unset($action_btn_list[1]);
         }
         // submit
         if ($this['status'] == 'Pending' && $thisTask->createdByMe()) {
             unset($action_btn_list[0]);
         }
         // submit
         if (!$thisTask->createdByMe() && $this['status'] == 'Submitted') {
             $action_btn_list = [];
         }
         if ($this['status'] == 'Inprogress' && !$thisTask->createdByMe()) {
             unset($action_btn_list[1]);
         }
         // mark_submit
         if ($this['status'] == 'Inprogress' && $thisTask->createdByMe()) {
             unset($action_btn_list[0]);
         }
         // mark_submit
     }
     // Second Column
     if ($thisTask->IhaveAssignedToOthers() && ($this['status'] == "Inprogress" or $this['status'] == "Completed")) {
         $action_btn_list = [];
     }
     if ($thisTask->IhaveAssignedToOthers() && ($this['status'] == "Pending" or $this['status'] == "Assigned")) {
         unset($action_btn_list[0]);
         unset($action_btn_list[1]);
         unset($action_btn_list[2]);
     }
     if (!$thisTask->canDelete()) {
         $this->current_row_html['delete'] = ' ';
     }
     if (!$thisTask->iCanPlay()) {
         $this->current_row['display_play_pause'] = 'none';
     } else {
         $this->current_row['display_play_pause'] = 'block';
     }
     $action_btn = $this->add('AbstractController')->add('xepan\\hr\\View_ActionBtn', ['actions' => $action_btn_list ?: [], 'id' => $this->model->id, 'status' => $this->model['status'], 'action_btn_group' => 'xs']);
     $this->current_row_html['action'] = $action_btn->getHTML();
     $this->current_row_html['starting_date'] = date_format(date_create($this['starting_date']), 'g:ia jS F Y');
     return parent::formatRow();
 }