コード例 #1
0
 public function getGroup()
 {
     if (!isset($this->group)) {
         $this->group = new Mutable(SupplierGroupDAO::getInstance()->getSupplierGroup($this->getGroupId()));
     }
     return $this->group->get();
 }
コード例 #2
0
 private function validateForm()
 {
     if (!$this->user->hasPermission('modify', 'catalog/supplier_group')) {
         $this->error['warning'] = $this->language->get('error_permission');
     }
     $supplier_info = SupplierGroupDAO::getInstance()->getSupplierGroupByName($this->request->post['name']);
     if ($supplier_info) {
         $this->error['warning'] = $this->language->get('error_exists');
     }
     if (utf8_strlen($this->request->post['name']) < 3 || utf8_strlen($this->request->post['name']) > 64) {
         $this->error['name'] = $this->language->get('error_name');
     }
     if (!$this->error) {
         return true;
     } else {
         return false;
     }
 }
コード例 #3
0
 public function print_page_removed_nickname()
 {
     $this->load->language('sale/order_items');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->load->model('catalog/product');
     $this->load->model('catalog/supplier_group');
     $this->load->model('tool/image');
     if (isset($_REQUEST['sort'])) {
         $sort = $_REQUEST['sort'];
     } else {
         $sort = 'order_item_id';
     }
     if (isset($_REQUEST['order'])) {
         $order = $_REQUEST['order'];
     } else {
         $order = 'ASC';
     }
     $data = array('selected_items' => $_REQUEST['selectedItems'], 'sort' => $sort, 'order' => $order);
     foreach (OrderItemDAO::getInstance()->getOrderItems($data, null, true) as $orderItem) {
         if ($orderItem->getImagePath() && file_exists(DIR_IMAGE . $orderItem->getImagePath())) {
             $image = $this->model_tool_image->resize($orderItem->getImagePath(), 100, 100);
         } else {
             $image = $this->model_tool_image->resize('no_image.jpg', 100, 100);
         }
         if (SupplierGroupDAO::getInstance()->getSupplierGroup($orderItem->getSupplierGroupId())) {
             $supplier_group = SupplierGroupDAO::getInstance()->getSupplierGroup($orderItem->getSupplierGroupId());
             $supplier_group_name = $supplier_group['name'];
         } else {
             $supplier_group_name = "";
         }
         $this->data['order_items'][] = array('comment' => $orderItem->getPrivateComment(), 'id' => $orderItem->getId(), 'image_path' => $image, 'name' => $orderItem->getName(), 'name_korean' => $orderItem->getKoreanName(), 'options' => OrderItemDAO::getInstance()->getOrderItemOptionsString($orderItem->getId()), 'order_id' => $orderItem->getOrderId(), 'quantity' => $orderItem->getQuantity(), 'status' => $orderItem->getStatusId(), 'supplier_group' => $supplier_group_name, 'supplier_name' => $orderItem->getSupplier()->getName());
     }
     $this->data['storeAddress'] = $this->config->get('config_address');
     $this->data['storeName'] = $this->config->get('config_name');
     $this->data['storePhone'] = $this->config->get('config_telephone');
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['text_no_results'] = $this->language->get('text_no_results');
     $this->data['text_missing'] = $this->language->get('text_missing');
     $this->data['column_comment'] = $this->language->get('field_comment');
     $this->data['column_item_image'] = $this->language->get('column_item_image');
     $this->data['column_item'] = $this->language->get('field_item');
     // $this->data['column_customer'] = $this->language->get('column_customer');
     // $this->data['column_nickname'] = $this->language->get('field_customer_nick');
     $this->data['column_order_id'] = $this->language->get('field_order_id');
     $this->data['column_order_item_id'] = $this->language->get('field_order_item_id');
     $this->data['column_supplier_group'] = $this->language->get('field_supplier_group');
     $this->data['column_status'] = $this->language->get('column_status');
     $this->data['column_price'] = $this->language->get('column_price');
     $this->data['column_quantity'] = $this->language->get('column_quantity');
     //$this->data['token'] = $this->session->data['token'];
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     if (isset($this->session->data['success'])) {
         $this->data['success'] = $this->session->data['success'];
         unset($this->session->data['success']);
     } else {
         $this->data['success'] = '';
     }
     $this->data['sort'] = $sort;
     $this->data['order'] = $order;
     $this->template = 'sale/order_items_list_print_nickname_removed.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render());
 }
コード例 #4
0
ファイル: supplier.php プロジェクト: ralfeus/moomi-daeri.com
 /**
  * @param Supplier $supplier
  * @throws Exception
  */
 private function getForm($supplier)
 {
     $this->data['text_amount'] = $this->language->get('text_amount');
     $this->data['text_enabled'] = $this->language->get('text_enabled');
     $this->data['text_disabled'] = $this->language->get('text_disabled');
     $this->data['text_default'] = $this->language->get('text_default');
     $this->data['text_image_manager'] = $this->language->get('text_image_manager');
     $this->data['text_browse'] = $this->language->get('text_browse');
     $this->data['text_clear'] = $this->language->get('text_clear');
     $this->data['text_none'] = $this->language->get('text_none');
     $this->data['text_percent'] = $this->language->get('text_percent');
     $this->data['textFreeShippingThreshold'] = $this->language->get('FREE_SHIPPING_THRESHOLD');
     $this->data['textRelatedManufacturer'] = $this->language->get('MANUFACTURER');
     $this->data['textShippingCost'] = $this->language->get('textShippingCost');
     $this->data['entry_name'] = $this->language->get('field_name') . ':';
     $this->data['entry_supplier_group'] = $this->language->get('field_supplier_group') . ':';
     $this->data['entry_internal_model'] = $this->language->get('field_internal_model') . ':';
     $this->data['button_save'] = $this->language->get('button_save');
     $this->data['button_cancel'] = $this->language->get('button_cancel');
     $this->data['tab_general'] = $this->language->get('tab_general');
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     foreach ($this->error as $key => $value) {
         $this->data["error_{$key}"] = $value;
     }
     $url = '';
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('catalog/supplier', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: ');
     if (!$supplier->getId()) {
         $this->data['action'] = $this->url->link('catalog/supplier/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');
     } else {
         $this->data['action'] = $this->url->link('catalog/supplier/update', 'token=' . $this->session->data['token'] . '&supplierId=' . $supplier->getId() . $url, 'SSL');
     }
     $this->data['cancel'] = $this->url->link('catalog/supplier', 'token=' . $this->session->data['token'] . $url, 'SSL');
     $this->data['token'] = $this->session->data['token'];
     //    	if (isset($this->request->get['supplierId']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
     //      		$supplier = SupplierDAO::getInstance()->getSupplier($this->request->get['supplierId']);
     //    	} else {
     //            $supplier = null;
     //        }
     $this->load->model('localisation/language');
     $this->data['languages'] = $this->model_localisation_language->getLanguages();
     $this->data['supplier_groups'] = SupplierGroupDAO::getInstance()->getSupplierGroups();
     $this->data['manufacturers'] = ManufacturerDAO::getInstance()->getManufacturers();
     $this->data = array_merge($this->data, $this->parameters);
     $this->data['freeShippingThreshold'] = $supplier->getFreeShippingThreshold();
     $this->data['internalModel'] = $supplier->getInternalModel();
     $this->data['name'] = $supplier->getName();
     $this->data['relatedManufacturerId'] = $supplier->getRelatedManufacturer()->getId();
     $this->data['supplierGroupId'] = $supplier->getGroupId();
     $this->data['shippingCost'] = $supplier->getShippingCost();
     $this->template = 'catalog/supplierForm.tpl.php';
     $this->children = array('common/header', 'common/footer');
     $this->getResponse()->setOutput($this->render());
 }