Ejemplo n.º 1
0
 public function editrequest($parameters)
 {
     $template = new ui($this);
     $grid = new mygrid($parameters['-gridid-']);
     $template->assign('grid', $grid);
     $controllername = $parameters['controller'] . 'Controller';
     $controller = new $controllername();
     $action = $parameters['action'];
     $result = $controller->{$action}($parameters);
     if ($result === true) {
         $this->reloadgrid($parameters['-gridid-']);
     } elseif ($result !== false) {
         if (!$parameters['history']) {
             $this->response->addWaypoint('mygrid', 'editrequest', $grid->getId(), $parameters);
         }
         if ($parameters['type'] == 'popup') {
             $popup = new popupController();
             $popup->create(array('name' => $parameters['-gridid-'], 'title' => $parameters['title'], 'content' => $result));
         } else {
             $template->assign('title', $parameters['title']);
             $closerequest = new ajaxrequest('mygrid', 'closeextra', array('id' => 'gridextra_' . $parameters['-gridid-']));
             $template->assign('closerequest', $closerequest);
             $template->assign('content', $result);
             $this->response->assign('gridextra_' . $parameters['-gridid-'], 'innerHTML', $template->fetch($parameters['viewprefix'] . 'mygrid_editrequest.tpl'));
             $this->response->script('var myFx = new Fx.Scroll(window).toElement(\'gridextra_' . $parameters['-gridid-'] . '\')');
         }
     }
 }
 public function deletegast($parameters)
 {
     $gastid = $parameters['gastid'];
     $popupcontroller = new popupController();
     $gastModel = new ingeschrevenModel();
     $gast = $gastModel->getfromId($gastid);
     if (count($gast) == 1) {
         $gast = $gast[0];
     } else {
         return;
     }
     $sure = $parameters['sure'];
     if ($sure != 'sure') {
         $template = new ui($this);
         $template->assign('gast', $gast);
         $ja = new ajaxrequest('myvoorinschrijving', 'deletegast', array('gastid' => $gastid, 'sure' => 'sure'));
         $template->assign('ja', $ja);
         $popupcontroller->create(array('name' => 'confirm', 'content' => $template->fetch('myvoorinschrijving_confirmdelete.tpl')));
     } elseif (myacl::isAllowed(myauth::getCurrentuser(), $gast, 'delete')) {
         $popupcontroller->destroy(array('name' => 'confirm'));
         $gastModel->deletebyId($gastid);
         $this->response->remove($gastid . '_rij');
     }
 }
Ejemplo n.º 3
0
 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();
             }
         }
     }
 }