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(); }
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(); }
function formatRow() { $this->current_row_html['forcedelete'] = "-"; parent::formatRow(); }
function setModel($model, $fields = null) { $m = parent::setModel($model, $fields); $this->on('click', '.acl-action', [$this, 'manageAction']); return $m; }
function render() { $this->js(true)->_selector('#' . $this->getJSID() . ' [title]')->tooltip(); parent::render(); }