public function _new()
 {
     parent::_new();
     $transferrule = $this->_uses[$this->modeltype];
     // Get the Action
     $whaction = new WHAction();
     if ($transferrule->isLoaded()) {
         $whaction_id = $transferrule->whaction_id;
     } elseif (isset($this->_data['whaction_id'])) {
         $whaction_id = $this->_data['whaction_id'];
     } else {
         $flash = Flash::Instance();
         $flash->addError('Data invalid for this action');
         $this->sendBack();
     }
     $whaction->load($whaction_id);
     // Get the From Locations list
     $locations = new WHLocationCollection(new WHLocation());
     $cc = new ConstraintChain();
     $names = array('has_balance', 'bin_controlled', 'saleable');
     foreach ($names as $name) {
         $type = $whaction->getFormatted('from_' . $name);
         if ($type != 'All') {
             $cc->add(new Constraint($name, 'is', $type));
         }
     }
     $from_location = $locations->getLocationList($cc);
     $this->view->set('from_location', $from_location);
     // Get the To Locations list
     $locations = new WHLocationCollection(new WHLocation());
     $cc = new ConstraintChain();
     foreach ($names as $name) {
         $type = $whaction->getFormatted('to_' . $name);
         if ($type != 'All') {
             $cc->add(new Constraint($name, 'is', $type));
         }
     }
     $to_location = $locations->getLocationList($cc);
     $this->view->set('to_location', $to_location);
 }
 public function _new()
 {
     if (!$this->CheckParams('whaction_id')) {
         sendBack();
     }
     $_whaction_id = $this->_data['whaction_id'];
     $errors = array();
     //		$this->displayLocations($whaction_id, $errors);
     $this->getTransferDetails($_whaction_id);
     if (count($errors) > 0) {
         $flash = Flash::Instance();
         $flash->addErrors($errors);
         sendTo('WHActions', 'actionsMenu', $this->_modules);
     }
     $whaction = new WHAction();
     $whaction->load($_whaction_id);
     $this->view->set('label', $whaction->label);
     $this->view->set('sub_title', $whaction->description);
     $this->view->set('page_title', $this->getPageName($whaction->action_name, ''));
     parent::_new();
 }