public function index() { $errors = array(); $s_data = array(); $whlocation = new WHLocation(); // Set context from calling module if (isset($this->_data['whlocation_id'])) { $s_data['whlocation_id'] = $this->_data['whlocation_id']; } $this->setSearch('whbinsSearch', 'useDefault', $s_data); $whlocation_id = $this->search->getValue('whlocation_id'); if (!empty($whlocation_id)) { $whlocation->load($whlocation_id); } $this->view->set('whlocation', $whlocation); $this->view->set('clickaction', 'view'); parent::index(new WHBinCollection($this->_templateobject)); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['all_stores'] = array('tag' => 'all stores', 'link' => array_merge($this->_modules, array('controller' => 'WHLocations', 'action' => 'index', 'whstore_id' => $whlocation->whstore_id))); $sidebarlist['all_locations'] = array('tag' => 'locations for store ' . $whlocation->whstore, 'link' => array_merge($this->_modules, array('controller' => 'WHLocations', 'action' => 'index', 'whstore_id' => $whlocation->whstore_id))); $sidebar->addList('Show', $sidebarlist); $sidebarlist = array(); $sidebarlist['edit'] = array('tag' => 'Edit', 'link' => array_merge($this->_modules, array('controller' => 'WHLocations', 'action' => 'edit', 'id' => $whlocation->id))); $sidebarlist['new'] = array('tag' => 'New Bin', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'new', 'whlocation_id' => $whlocation->id))); if (!$whlocation->isBinControlled() || $whlocation->bins->count() == 0) { $sidebarlist['delete'] = array('tag' => 'Delete', 'link' => array_merge($this->_modules, array('controller' => 'WHLocations', 'action' => 'delete', 'id' => $whlocation->id))); } $sidebar->addList('This Location', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); $this->view->set('page_title', $this->getPageName('Location', 'View Bins for')); }
public function index() { $errors = array(); $s_data = array(); // Set context from calling module if (isset($this->_data['whstore_id'])) { $s_data['whstore_id'] = $this->_data['whstore_id']; } $this->setSearch('whlocationsSearch', 'useDefault', $s_data); $id = $this->search->getValue('whstore_id'); $this->view->set('clickaction', 'view'); parent::index(new WHLocationCollection($this->_templateobject)); $store = new WHStore(); $store->load($id); $this->view->set('whstore', $store); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['stores'] = array('tag' => 'View All Stores', 'link' => array_merge($this->_modules, array('controller' => 'WHStores', 'action' => 'index'))); $sidebarlist['new'] = array('tag' => 'New Location for ' . $store->getIdentifierValue(), 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'new', 'whstore_id' => $id))); $sidebarlist['edit'] = array('tag' => 'Edit ' . $store->getIdentifierValue(), 'link' => array_merge($this->_modules, array('controller' => 'WHStores', 'action' => 'edit', 'id' => $id))); if ($store->locations->count() === 0) { $sidebarlist['delete'] = array('tag' => 'Delete ' . $store->getIdentifierValue(), 'link' => array_merge($this->_modules, array('controller' => 'WHStores', 'action' => 'delete', 'id' => $id))); } $sidebar->addList('Actions', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function view() { if (!$this->loadData()) { $this->dataError(); sendBack(); } $transaction = $this->_uses[$this->modeltype]; $id = $transaction->id; $this->view->set('transaction', $transaction); $elements = new MFCentreCollection(new MFCentre()); $sh = $this->setSearchHandler($elements); $sh->addConstraint(new Constraint('mfdept_id', '=', $id)); parent::index($elements, $sh); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['all'] = array('tag' => 'All Departments', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'index'))); $sidebar->addList('Show', $sidebarlist); $sidebarlist = array(); $sidebarlist['edit'] = array('tag' => 'Edit', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'edit', 'id' => $id))); if ($elements->count() == 0) { $sidebarlist['delete'] = array('tag' => 'Delete', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'delete', 'id' => $id))); } $sidebarlist['add'] = array('tag' => 'Add Centre', 'link' => array_merge($this->_modules, array('controller' => 'MFCentres', 'action' => 'new', 'mfdept_id' => $id))); $sidebar->addList('This Department', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); $this->view->set('clickaction', 'view'); $this->view->set('clickcontroller', 'MFCentres'); }
public function index() { $this->view->set('clickaction', 'edit'); parent::index(new STTypecodeCollection($this->_templateobject)); $sidebar = new SidebarController($this->view); $sidebar->addList('Actions', array('new' => array('tag' => 'New Stock Type Code', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'new'))))); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function index() { $this->view->set('clickaction', 'view'); parent::index(new WHStoreCollection($this->_templateobject)); $sidebar = new SidebarController($this->view); $sidebar->addList('Actions', array('new' => array('link' => array_merge($this->_modules, array('controller' => 'WHStores', 'action' => 'new')), 'tag' => 'New Store'))); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function view_balance() { $errors = array(); $s_data = array(); // Set context from calling module if (isset($this->_data['status'])) { $s_data['status'] = $this->_data['status']; } if (isset($this->_data['stitem_id'])) { $s_data['stitem_id'] = $this->_data['stitem_id']; } if (isset($this->_data['whlocation_id'])) { $s_data['whlocation_id'] = $this->_data['whlocation_id']; } $s_data['created']['from'] = date(DATE_FORMAT, strtotime('-7 days')); $s_data['created']['to'] = date(DATE_FORMAT); $this->setSearch('sttransactionsSearch', 'useDefault', $s_data); $sttransactions = new STTransactionCollection($this->_templateobject); parent::index($sttransactions); $this->view->set('clickaction', 'view'); }
public function view() { if (!$this->loadData()) { $this->dataError(); sendBack(); } $transaction = $this->_uses[$this->modeltype]; $id = $transaction->id; $this->view->set('transaction', $transaction); $elements = new MFOperationCollection(new MFOperation()); if (!isset($this->_data['orderby']) && !isset($this->_data['page'])) { $sh = new SearchHandler($elements, false); $sh->addConstraint(new Constraint('mfresource_id', '=', $id)); } else { $sh = new SearchHandler($elements); } $sh->extract(); parent::index($elements, $sh); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['view'] = array('tag' => 'View all resources', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'index')); $sidebarlist['edit'] = array('tag' => 'Edit', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'edit', 'id' => $id)); if ($elements->count() == 0) { $sidebarlist['delete'] = array('tag' => 'Delete', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'delete', 'id' => $id)); } $sidebar->addList('This Resource', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function showParts() { parent::index(new MFOperationCollection(new MFOperation())); }
public function view_Transactions() { if (!$this->loadData()) { $this->dataError(); sendBack(); } $works_order = $this->_uses[$this->modeltype]; $transaction = DataObjectFactory::Factory('STTransaction'); $transaction->setDefaultDisplayFields(array('stitem' => 'stock_item', 'created', 'flocation' => 'from_location', 'fbin' => 'from_bin', 'whlocation' => 'to_location', 'whbin' => 'to_bin', 'qty', 'error_qty', 'balance', 'status', 'remarks')); $related_collection = new STTransactionCollection($transaction); $sh = $this->setSearchHandler($related_collection); $sh->addConstraint(new Constraint('process_id', '=', $works_order->id)); $sh->addConstraint(new Constraint('process_name', '=', 'WO')); $sh->addConstraint(new Constraint('qty', '>=', 0)); $sh->addConstraint(new Constraint('error_qty', '>=', 0)); parent::index($related_collection, $sh); $this->_templateName = $this->getTemplateName('view_related'); $this->view->set('clickaction', 'view'); $this->view->set('clickcontroller', 'stitems'); $this->view->set('linkvaluefield', 'stitem_id'); $this->view->set('related_collection', $related_collection); $this->view->set('collection', $related_collection); $this->view->set('no_ordering', true); }