Esempio n. 1
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $js = parent::_getEndJs();
     $js .= "pageJs.getResults(true, " . $this->pageSize . ");";
     $js .= "pageJs._bindSearchKey();";
     return $js;
 }
Esempio n. 2
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $js = parent::_getEndJs();
     $js .= 'pageJs';
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 3
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $manufactureArray = $supplierArray = $statuses = $productCategoryArray = array();
     foreach (Manufacturer::getAll() as $os) {
         $manufactureArray[] = $os->getJson();
     }
     foreach (Supplier::getAll() as $os) {
         $supplierArray[] = $os->getJson();
     }
     foreach (ProductStatus::getAll() as $os) {
         $statuses[] = $os->getJson();
     }
     foreach (ProductCategory::getAll() as $os) {
         $productCategoryArray[] = $os->getJson();
     }
     $js = parent::_getEndJs();
     if (($product = Product::get($this->Request['id'])) instanceof Product) {
         $js .= "\$('searchPanel').hide();";
         $js .= "pageJs._singleProduct = true;";
     }
     $js .= 'pageJs._loadManufactures(' . json_encode($manufactureArray) . ')';
     $js .= '._loadSuppliers(' . json_encode($supplierArray) . ')';
     $js .= '._loadCategories(' . json_encode($productCategoryArray) . ')';
     $js .= '._loadProductStatuses(' . json_encode($statuses) . ')';
     $js .= "._loadChosen()";
     $js .= "._bindSearchKey()";
     $js .= ".setCallbackId('priceMatching', '" . $this->priceMatchingBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleActive', '" . $this->toggleActiveBtn->getUniqueID() . "')";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 4
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $js = parent::_getEndJs();
     $js .= "pageJs";
     $js .= ".setCallbackId('updateInvoiceNo', '" . $this->updateInvoiceNoBtn->getUniqueID() . "')";
     $js .= ".init()";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 5
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $js = parent::_getEndJs();
     $preloadData = array('supplierId' => trim($this->Request['supplierId']), 'invoiceNo' => isset($_REQUEST['invoiceNo']) ? trim($this->Request['invoiceNo']) : '');
     $js .= "pageJs";
     $js .= ".setPreloadData(" . json_encode($preloadData) . ")";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 6
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $js = parent::_getEndJs();
     $js .= "pageJs._bindSearchKey()";
     $js .= "._loadDataPicker()";
     $js .= ".setCallbackId('deactivateItems', '" . $this->deactivateItemBtn->getUniqueID() . "')";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 7
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $statusOptions = RMA::getAllStatuses();
     $js = parent::_getEndJs();
     $js .= "pageJs._statusOptions=" . json_encode($statusOptions) . ";";
     $js .= "pageJs._bindSearchKey()";
     $js .= ".setCallbackId('deactivateItems', '" . $this->deactivateItemBtn->getUniqueID() . "')";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 8
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $js = parent::_getEndJs();
     $js .= "pageJs.setHTMLID('searchPanel', 'searchPanel')";
     $js .= ";";
     $js .= "\$('searchBtn').click();";
     if (isset($_REQUEST['nosearch']) && intval($_REQUEST['nosearch']) === 1) {
         $js .= "\$(pageJs.getHTMLID('searchPanel')).hide();";
     }
     return $js;
 }
Esempio n. 9
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $from = isset($this->Request['from']) ? $this->Request['from'] : '';
     $to = isset($this->Request['to']) ? $this->Request['to'] : '';
     $productId = isset($this->Request['productid']) ? $this->Request['productid'] : '';
     $js = parent::_getEndJs();
     $js .= "pageJs";
     $js .= "._bindSearchKey()";
     $js .= "._loadDataPicker()";
     $js .= ".setPreData(" . json_encode($from) . ", " . json_encode($to) . ", " . json_encode(($product = Product::get($productId)) instanceof Product ? $product->getJson() : '') . ")";
     $js .= ";";
     return $js;
 }
Esempio n. 10
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $applyToOptions = CreditNote::getApplyToTypes();
     $js = parent::_getEndJs();
     if (isset($_REQUEST['orderid']) && ($order = Order::get(trim($_REQUEST['orderid']))) instanceof Order) {
         $js .= "pageJs._order=" . json_encode($order->getJson()) . ";";
     }
     $js .= "pageJs._applyToOptions=" . json_encode($applyToOptions) . ";";
     $js .= "pageJs._bindSearchKey()";
     $js .= ".setCallbackId('deactivateItems', '" . $this->deactivateItemBtn->getUniqueID() . "')";
     $js .= ".init(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 11
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $statusOptions = PurchaseOrder::getStatusOptions();
     $js = parent::_getEndJs();
     $js .= "pageJs._status=" . json_encode($statusOptions) . ";";
     $js .= 'pageJs';
     $js .= ".setCallbackId('deactivateItems', '" . $this->deactivateItemBtn->getUniqueID() . "')";
     $js .= "._bindSearchKey()";
     $js .= "._loadChosen()";
     $js .= "._loadDataPicker();";
     $js .= "\$('searchBtn').click();";
     return $js;
 }
Esempio n. 12
0
 /**
  * (non-PHPdoc)
  * @see BPCPageAbstract::_preGetEndJs()
  */
 protected function _preGetEndJs()
 {
     parent::_preGetEndJs();
     $order = $tech = $customer = null;
     if (isset($_REQUEST['customerId']) && !($customer = Customer::get(trim($_REQUEST['customerId']))) instanceof Customer) {
         die('Invalid Customer provided!');
     }
     if (isset($_REQUEST['orderId']) && !($order = Order::get(trim($_REQUEST['orderId']))) instanceof Order) {
         die('Invalid Order provided!');
     }
     if (isset($_REQUEST['techId']) && !($tech = UserAccount::get(trim($_REQUEST['techId']))) instanceof UserAccount) {
         die('Invalid Technician provided!');
     }
     $statusIds = array();
     if (isset($_REQUEST['statusIds']) && ($statusIds = trim($_REQUEST['statusIds'])) !== '') {
         $statusIds = array_map(create_function('$a', 'return intval(trim($a));'), explode(',', $statusIds));
     }
     $allstatuses = isset($_REQUEST['allstatuses']) && intval(trim($_REQUEST['allstatuses'])) === 1;
     $preSetData = array('statuses' => array(), 'order' => $order instanceof Order ? $order->getJson() : array(), 'technician' => $tech instanceof UserAccount ? $tech->getJson() : array(), 'customer' => $customer instanceof Customer ? $customer->getJson() : array(), 'meId' => Core::getUser()->getId(), 'noDueDateStatusIds' => array());
     $statuses = array();
     foreach (TaskStatus::getAll() as $status) {
         $statuses[] = $statusJson = $status->getJson();
         if (($noDueDateChecking = in_array(intval($status->getId()), TaskStatus::getClosedStatusIds())) === true) {
             $preSetData['noDueDateStatusIds'][] = $status->getId();
         }
         if (count($statusIds) > 0) {
             if (in_array(intval($status->getId()), $statusIds)) {
                 $preSetData['statuses'][] = $statusJson;
             }
         } else {
             if ($allstatuses === false && !$noDueDateChecking) {
                 $preSetData['statuses'][] = $statusJson;
             }
         }
     }
     if (count($statusIds) > 0 && count($preSetData['statuses']) === 0) {
         die('Invalide Task Status provided.');
     }
     $js = "pageJs";
     $js .= ".setOpenInFancyBox(" . (isset($_REQUEST['blanklayout']) && intval(trim($_REQUEST['blanklayout'])) === 1 && (isset($_REQUEST['nosearch']) && intval($_REQUEST['nosearch']) === 1) ? 'false' : 'true') . ")";
     $js .= ".setStatuses(" . json_encode($statuses) . ")";
     $js .= ".setPreSetData(" . json_encode($preSetData) . ")";
     $js .= ";";
     return $js;
 }
Esempio n. 13
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $manufactureArray = $supplierArray = $statuses = $productCategoryArray = array();
     foreach (Manufacturer::getAll() as $os) {
         $manufactureArray[] = $os->getJson();
     }
     foreach (Supplier::getAll() as $os) {
         $supplierArray[] = $os->getJson();
     }
     foreach (ProductStatus::getAll() as $os) {
         $statuses[] = $os->getJson();
     }
     foreach (ProductCategory::getAll() as $os) {
         $productCategoryArray[] = $os->getJson();
     }
     $js = parent::_getEndJs();
     if (($product = Product::get($this->Request['id'])) instanceof Product) {
         $js .= "\$('searchPanel').hide();";
         $js .= "pageJs._singleProduct = true;";
     }
     $js .= 'pageJs.totalValueId = "total-found-value";';
     $js .= 'pageJs.totalQtyId = "total-found-qty";';
     $js .= 'pageJs._loadManufactures(' . json_encode($manufactureArray) . ')';
     $js .= '._loadSuppliers(' . json_encode($supplierArray) . ')';
     $js .= '._loadCategories(' . json_encode($productCategoryArray) . ')';
     $js .= '._loadProductStatuses(' . json_encode($statuses) . ')';
     $js .= "._loadChosen()";
     $js .= "._bindSearchKey()";
     $js .= "._bindNewRuleBtn()";
     $js .= ".setCallbackId('priceMatching', '" . $this->priceMatchingBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleActive', '" . $this->toggleActiveBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleSellOnWeb', '" . $this->toggleSellOnWebBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('updatePrice', '" . $this->updatePriceBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('updateStockLevel', '" . $this->updateStockLevelBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleIsKit', '" . $this->toggleIsKitBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleManualFeed', '" . $this->toggleManualFeedBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('newRule', '" . $this->newRuleBtn->getUniqueID() . "')";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
Esempio n. 14
0
 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $js = parent::_getEndJs();
     $js .= "pageJs.setCallbackId('deleteItem', '" . $this->deleteItemBtn->getUniqueID() . "');";
     if (isset($_REQUEST['productid']) || isset($_REQUEST['purchaseorderid'])) {
         if (isset($_REQUEST['productid'])) {
             if (!($product = Product::get(trim($_REQUEST['productid']))) instanceof Product) {
                 die('Invalid Product Provided');
             }
             $js .= "\$('searchBtn').up('.panel').down('.panel-body').insert({'bottom': new Element('input', {'type': 'hidden', 'search_field': 'productid', 'value': '" . $product->getId() . "'}) });";
             $js .= "\$('searchBtn').up('.panel').hide();";
         }
         if (isset($_REQUEST['purchaseorderid'])) {
             if (!($purchaseOrder = PurchaseOrder::get(trim($_REQUEST['purchaseorderid']))) instanceof PurchaseOrder) {
                 die('Invalid PurchaseOrder Provided');
             }
             $js .= "\$('searchBtn').up('.panel').down('.panel-body').insert({'bottom': new Element('input', {'type': 'hidden', 'search_field': 'purchaseorderid', 'value': '" . $purchaseOrder->getId() . "'}) });";
             $js .= "\$('searchBtn').up('.panel').hide();";
         }
         $js .= "\$('searchBtn').click();";
     }
     $js .= "pageJs._bindSearchKey();";
     return $js;
 }