protected function fillObject($data) { $object = parent::fillObject($data); $mealorderoptionsetModel = new mealorderoptionsetModel(); $mealorderoptionModel = new mealorderoptionModel(); $optionsets = $mealorderoptionsetModel->getfromMealorderid($object->getId()); $opties = ''; foreach ($optionsets as $optionset) { $opties .= '<strong>' . $optionset->getOptionset() . ': </strong> '; $options = $mealorderoptionModel->getfromMealorderoptionsetid($optionset->getId()); if ($optionset->getOptionsettype() == 3) { if ($options[0] instanceof mealorderoptionObject) { if ($options[0]->isSelected()) { $opties .= 'Ja'; } else { $opties .= 'Nee'; } } } else { foreach ($options as $option) { if ($option->isSelected()) { $opties .= $option->getOption() . ', '; } } $opties = substr($opties, 0, -2); } $opties .= '<br />'; } //$object->setOption($opties); $object->setMeal('<strong>' . $object->getMeal() . '</strong><br /><br />' . $opties); $object->setPrinted($object->getPrinted() ? 'Ja' : 'Nee'); return $object; }
public function reprint($parameters = array()) { $sure = $parameters['sure']; $popupcontroller = new popupController(); $model = new mealorderModel(); $order = $model->getfromId($parameters['id']); if (count($order) == 1) { $order = $order[0]; if ($order->getPrinted()) { if ($sure != 'sure') { $template = new ui($this); $ja = new ajaxrequest('mycafetaria', 'reprint', array('id' => $parameters['id'], 'sure' => 'sure')); $template->assign('ja', $ja); $popupcontroller->create(array('name' => 'confirm', 'content' => $template->fetch('mycafetaria_confirmreprint.tpl'))); } else { $popupcontroller->destroy(array('name' => 'confirm')); $order->setPrinted(0); $model->save($order); $this->listallorders(); } } } }