public function _new() { parent::_new(); $mfshiftwaste = $this->_uses[$this->modeltype]; if ($mfshiftwaste->isLoaded()) { $this->_data['mf_shift_outputs_id'] = $mfshiftwaste->mf_shift_outputs_id; $this->_data['mf_centre_waste_type_id'] = $mfshiftwaste->mf_centre_waste_type_id; } if (isset($this->_data['mf_shift_outputs_id'])) { $mfshiftoutput = DataObjectFactory::Factory('MFShiftOutput'); $mfshiftoutput->load($this->_data['mf_shift_outputs_id']); if ($mfshiftoutput->isLoaded()) { $mfshift = $mfshiftoutput->shift_detail; if ($mfshift->isLoaded()) { $waste_types = $mfshift->getWasteTypes(); $this->view->set('waste_types', $waste_types); } } } if (isset($_POST[$this->modeltype]['mf_centre_waste_type_id'])) { $waste_type_id = $_POST[$this->modeltype]['mf_centre_waste_type_id']; } elseif (isset($this->_data['mf_centre_waste_type_id'])) { $waste_type_id = $this->_data['mf_centre_waste_type_id']; } else { $waste_type_id = key($waste_types); } $this->view->set('uom', $this->getWasteUom($waste_type_id)); }
public function _new() { parent::_new(); $mfdowntimecode = $this->_uses[$this->modeltype]; $this->view->set('mfdowntimecode', $mfdowntimecode); $this->view->set('mf_centres', $this->getCentres()); if ($mfdowntimecode->isLoaded()) { $this->view->set('selected_centres', $mfdowntimecode->mf_centres->getAssoc()); } $this->view->set('mfcentredowntimecode', DataObjectFactory::Factory('MFCentreDowntimeCode')); }
public function _new() { $flash = Flash::Instance(); // need to store the ajax flag in a different variable and the unset the original // this is to prevent any functions that are further called from returning the wrong datatype $ajax = isset($this->_data['ajax']); unset($this->_data['ajax']); parent::_new(); $mfshiftoutput = $this->_uses[$this->modeltype]; if ($mfshiftoutput->isLoaded()) { $this->_data['mf_shift_id'] = $mfshiftoutput->mf_shift_id; } elseif (isset($this->_data[$this->modeltype]['mf_shift_id'])) { $this->_data['mf_shift_id'] = $this->_data[$this->modeltype]['mf_shift_id']; } $stitems = array(); if (isset($this->_data['mf_shift_id'])) { $mfshift = DataObjectFactory::Factory('MFShift'); $mfshift->load($this->_data['mf_shift_id']); if ($mfshift->isLoaded()) { $this->view->set('mfshift', $mfshift); $stitems = $mfshift->getItems(); } $mf_centre_id = $mfshift->mf_centre_id; } else { $this->dataError(); sendBack(); } $this->view->set('stitems', $stitems); if (isset($_POST[$this->modeltype]['stitem_id'])) { $stitem_id = $_POST[$this->modeltype]['stitem_id']; } elseif ($mfshiftoutput->isLoaded()) { $stitem_id = $mfshiftoutput->stitem_id; } elseif (isset($this->_data['stitem_id'])) { $stitem_id = $this->_data['stitem_id']; } else { $stitem_id = key($stitems); } if (empty($stitem_id)) { $flash->addError('There are no currently manufactured items for this centre'); sendBack(); } else { $this->view->set('run_time_speed', $this->getRunTimeSpeed($stitem_id, $mf_centre_id)); $this->view->set('work_orders', $this->getWorkordersList($stitem_id)); $this->view->set('uoms', $this->getUomList($stitem_id)); } }
public function _new() { parent::_new(); $mfshiftdowntime = $this->_uses[$this->modeltype]; if ($mfshiftdowntime->isLoaded()) { $this->_data['mf_shift_id'] = $mfshiftdowntime->mf_shift_id; } if (isset($this->_data['mf_shift_id'])) { $mfshift = DataObjectFactory::Factory('MFShift'); $mfshift->load($this->_data['mf_shift_id']); if ($mfshift->isLoaded()) { $this->view->set('downtime_codes', $mfshift->getDowntimeCodes()); } } else { $this->dataError(); sendBack(); } }
public function _new() { parent::_new(); $mfshift = $this->_uses[$this->modeltype]; $mfdepts = $mfshift->getAllDept(); $this->view->set('mfdepts', $mfdepts); $mfcentres = array(); if (count($mfdepts) > 0) { if (isset($_POST[$this->modeltype]['mf_dept_id'])) { $mfdept_id = $_POST[$this->modeltype]['mf_dept_id']; } elseif ($mfshift->isLoaded()) { $mfdept_id = $mfshift->mf_dept_id; } elseif (isset($this->_data['mf_dept_id'])) { $mfdept_id = $this->_data['mf_dept_id']; } else { $mfdept_id = key($mfdepts); } $mfcentres = $mfshift->getAllCentres($mfdept_id); } $this->view->set('mfcentres', $mfcentres); }