public function ajaxMergeStakeholderItemPackSizeAction() { $this->_helper->layout->disableLayout(); $sips = new Model_StakeholderItemPackSizes(); $sips->form_values = array('item_id' => $this->_request->getParam('product')); $result = $sips->getStakeholderItemPackSizesByItem(); $this->view->result = $result; $this->view->role_id = $this->_identity->getRoleId(); }
public function init() { //Generate Item Combo $sips = new Model_StakeholderItemPackSizes(); $sips->form_values['stakeholder_id'] = '1'; $result = $sips->getAllProductsByStakeholderType(); $this->_childlist["item_pack_size_id"][''] = "Select"; foreach ($result as $row) { $this->_childlist["item_pack_size_id"][$row['item_pack_size_id']] = $row['item_name']; } foreach ($this->_fields as $col => $name) { switch ($col) { case "transaction_reference": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "transaction_number": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "transaction_date": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "readonly" => "true"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "comments": $this->addElement("textarea", $col, array("attribs" => array("class" => "form-control", "rows" => "2"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option")))))); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "hdn_activity_id": case "hdn_receive_warehouse_id": case "hdn_stock_master_id": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }
public function ajaxGetProductsIssueByStakeholderActivityAction() { $this->_helper->layout->disableLayout(); $sips = new Model_StakeholderItemPackSizes(); $type = $this->_request->getParam('type', ''); $sips->form_values['stakeholder_id'] = $this->_request->getParam('activity_id', ''); if (!empty($type) && $type == 2) { $result = $sips->getAllIssueProductsByStakeholder(); } else { $result = $sips->getAllProductsByStakeholderType(); } $this->view->result = $result; }
function checkSetupBarcodeCombinationUpdateAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(TRUE); $form_values = $this->_request->getPost(); $stakeholder_item_pack_sizes = new Model_StakeholderItemPackSizes(); $stakeholder_item_pack_sizes->form_values = $form_values; $result = $stakeholder_item_pack_sizes->checkSetupBarcodeCombinationUpdate(); if (!empty($result) && count($result) > 0) { echo 'f'; } else { echo 't'; } }
public function getProductsByActivity($type) { //Generate Products(items) Combo $items = array(); $sips = new Model_StakeholderItemPackSizes(); $sips->form_values['stakeholder_id'] = $type; $result2 = $sips->getAllProductsByStakeholderType(); $items[''] = "Select"; if ($result2) { foreach ($result2 as $item) { $items[$item['item_pack_size_id']] = $item['item_name']; } } $this->getElement("item_id")->setMultiOptions($items); $this->getElement("manufacturer_id")->setMultiOptions(array("" => "Select")); }