public function view() { if (!$this->loadData()) { $this->dataError(); sendBack(); } $whbin = $this->_uses[$this->modeltype]; $id = $whbin->id; $this->view->set('transaction', $whbin); $whlocation = new WHLocation(); $whlocation->load($whbin->whlocation_id); $this->view->set('whstore', $whlocation->whstore); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['stores'] = array('tag' => 'All Stores', 'link' => array_merge($this->_modules, array('controller' => 'WHStores', 'action' => 'index'))); $sidebarlist['locations'] = array('tag' => 'Locations for Store ' . $whlocation->whstore, 'link' => array_merge($this->_modules, array('controller' => 'WHLocations', 'action' => 'index', 'id' => $whbin->whlocation_id))); $sidebarlist['bins'] = array('tag' => 'Bins for Location ' . $whlocation->getIdentifierValue(), 'link' => array_merge($this->_modules, array('controller' => 'WHLocations', 'action' => 'view', 'id' => $whbin->whlocation_id))); $sidebar->addList('Show', $sidebarlist); $sidebarlist = array(); $sidebarlist['edit'] = array('tag' => 'Edit', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'edit', 'id' => $id, 'whlocation_id' => $whbin->whlocation_id))); // Do not allow delete if balances exist if ($whbin->balances->count() === 0) { $sidebarlist['delete'] = array('tag' => 'Delete', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'delete', 'id' => $id, 'whlocation_id' => $whbin->whlocation_id))); } $sidebar->addList('This Bin', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }