public function showoverzicht($parameters = array())
 {
     $view = new ui($this);
     $specmodel = new wdokterspecialismeModel();
     $wachtmodel = new wachtdokterviewModel();
     $specs = $specmodel->get(array(), array('fields' => array('name'), 'type' => 'ASC'));
     $list = array();
     $startcond = array('start' => array('mode' => '<', 'value' => time()));
     $stopcond = array('stop' => array('mode' => '>', 'value' => time()));
     foreach ($specs as $spec) {
         $temp = array();
         $temp['name'] = $spec->getName();
         $temp['request'] = new ajaxrequest('mydoktervanwacht', 'showspecdetails', array('specid' => $spec->getId()));
         $speccond = array('specialisme' => array('mode' => '=', 'value' => $spec->getId()));
         $wachtdokter = $wachtmodel->get(array('AND' => array($startcond, $stopcond, $speccond)), array('type' => 'DESC', 'fields' => array('start')));
         if (count($wachtdokter) > 0) {
             $wachtdokter = $wachtdokter[0];
             $temp['wachtdokter'] = $wachtdokter;
         }
         $list[] = $temp;
     }
     $view->assign('list', $list);
     $poolgrid = new mygrid('wachtpools');
     $poolgrid->setModel(new wdokterspecialismeModel());
     $view->assign('poolgrid', $poolgrid);
     $this->response->assign($this->self, 'innerHTML', $view->fetch('mydoktervanwacht_overzicht.tpl'));
 }
Ejemplo n.º 2
0
 public function managemodules($parameters = array())
 {
     $view = new ui($this);
     $grid = new mygrid('modules');
     $grid->setModel(new processedmoduleModel());
     $grid->setNosortfield(array('arguments'));
     $grid->registerAddrequest('mymoduleadmin', 'addmodule', array('title' => 'Module toevoegen'));
     $grid->registerEditrequest('mymoduleadmin', 'editmodule', array('title' => 'Module aanpassen', 'moduleid' => '{id}'));
     $grid->registerDeleterequest('mymoduleadmin', 'deletemodule', array('title' => 'Module verwijderen', 'moduleid' => '{id}'));
     $view->assign('grid', $grid);
     $this->response->assign($this->self, 'innerHTML', $view->fetch('mymoduleadmin_managemodules.tpl'));
 }
 public function listlogs($parameters = array())
 {
     $view = new ui($this);
     $grid = new mygrid('loglist');
     $grid->setModel(new mbprocessedlogModel());
     $grid->setDefaultorder(array('fields' => array('parsedate'), 'type' => 'DESC'));
     $grid->setDefaultpagesize(15);
     $grid->setDefaultconditions('');
     $grid->registerRequest('filename', 'medibridgeparser', 'showLog', array('logid' => '{id}'));
     $errorgrid = new mygrid('errorlist');
     $errorgrid->setModel(new mbprocessedlogModel());
     $errorgrid->setDefaultorder(array('fields' => array('parsedate'), 'type' => 'DESC'));
     $errorgrid->setDefaultpagesize(10);
     $errorgrid->setDefaultconditions(array('AND' => array('OR' => array(array('statusdelivery' => array('mode' => '=', 'value' => 'DELIVERY_ERROR')), array('statusdelivery' => array('mode' => '=', 'value' => 'PARSER_ERROR')), array('statusdelivery' => array('mode' => '=', 'value' => 'NO_PARSER')), array('statusbackup' => array('mode' => '=', 'value' => 'BACKUP_ERROR')), array('statusbackup' => array('mode' => '=', 'value' => 'FILE_TIMEOUT')), array('statuserror' => array('mode' => '=', 'value' => 'ERROR_MOVE_ERROR'))), 'statusdelivery' => array('mode' => '<>', 'value' => 'MESSAGE_IGNORED'))));
     $errorgrid->registerRequest('filename', 'medibridgeparser', 'editMessage', array('logid' => '{id}'));
     $view->assign('loglist', $grid);
     $view->assign('errorlist', $errorgrid);
     $this->response->assign($this->self, 'innerHTML', $view->fetch($parameters['viewprefix'] . 'medibridgeparser_listlogs.tpl'));
 }
Ejemplo n.º 4
0
 public function listacl($parameters = array())
 {
     $target = isset($parameters['targetoutput']) ? $parameters['targetoutput'] : $this->self;
     $view = new ui($this);
     $conds = array();
     $add = false;
     $showobject = true;
     $showrequester = true;
     if (isset($parameters['objecttype'])) {
         $conds[] = array('objecttype' => array('mode' => '=', 'value' => $parameters['objecttype']));
         $conds[] = array('objectid' => array('mode' => '=', 'value' => $parameters['objectid']));
         $add = true;
         $showobject = false;
         $gridid = 'listacl_o_' . $parameters['objecttype'] . '_' . $parameters['objectid'];
     }
     $view->assign('showobject', $showobject);
     if (isset($parameters['requestertype'])) {
         $conds[] = array('requestertype' => array('mode' => '=', 'value' => $parameters['requestertype']));
         $conds[] = array('requesterid' => array('mode' => '=', 'value' => $parameters['requesterid']));
         $showrequester = false;
         $gridid = 'listacl_r_' . $parameters['requestertype'] . '_' . $parameters['requesterid'];
     }
     $view->assign('showrequester', $showrequester);
     $grid = new mygrid($gridid);
     $grid->setModel(new processedmyaclModel());
     $grid->setDefaultconditions(array('AND' => $conds));
     $grid->setDefaultorder(array('fields' => array('requester', 'rightdesc'), 'type' => 'ASC'));
     if ($add) {
         $object = new $parameters['objecttype']();
         $object->setId($parameters['objectid']);
         if (myacl::isAllowed(myauth::getCurrentuser(), $object, 'managerights')) {
             $grid->registerAddrequest('myacl', 'addacl', array_merge(array('title' => 'Recht toevoegen'), $parameters));
             $grid->registerDeleterequest('myacl', 'deleteacl', array('title' => 'Recht verwijderen', 'id' => '{id}'));
         }
     }
     $view->assign('acllist', $grid);
     if ($target == '_return_') {
         return $view->fetch('myacl_listacl.tpl');
     } else {
         $this->response->assign($target, 'innerHTML', $view->fetch('myacl_listacl.tpl'));
     }
 }
Ejemplo n.º 5
0
 public function addsectionlink($parameters = array())
 {
     if (isset($parameters['sectionid'])) {
         $newlink = new myarticlesectionlinkObject();
         $newlink->setArticleid($parameters['articleid']);
         $newlink->setSectionid($parameters['sectionid']);
         $model = new myarticlesectionlinkModel();
         $newlink->setOrder($model->getmax('order', array('sectionid' => array('mode' => '=', 'value' => $parameters['sectionid']))) + 1);
         $flash = new popupController();
         $testcond = array('AND' => array(array('sectionid' => array('mode' => '=', 'value' => $parameters['sectionid'])), array('articleid' => array('mode' => '=', 'value' => $parameters['articleid']))));
         if (count($model->get($testcond)) > 0) {
             $flash->createflash(array('name' => 'warning', 'type' => 'warning', 'content' => 'Deze sectie was reeds gelinked'));
             return false;
         }
         try {
             $model->save($newlink);
         } catch (Exception $e) {
             $flash->createflash(array('name' => 'error', 'type' => 'error', 'content' => 'De aanpassing werd niet doorgevoerd! Contacteer de informaticadienst.'));
             return false;
         }
         $flash->createflash(array('name' => 'error', 'type' => 'success', 'content' => 'De aanpassing werd goed doorgevoerd.'));
         $gridcontr = new mygridController();
         $gridcontr->reloadgrid($parameters['oldgrid']);
         return true;
     } else {
         $view = new ui($this);
         $grid = new mygrid('sections');
         $grid->setModel(new myarticlesectionModel());
         $grid->registerRequest('name', 'myarticle', 'addsectionlink', array('sectionid' => '{id}', 'articleid' => $parameters['articleid'], 'oldgrid' => $parameters['-gridid-'], 'myacl' => array('target' => '{this}', 'right' => 'manage_articlelinks', 'default' => false)));
         $view->assign('grid', $grid);
         return $view->fetch('myarticle_addsectionlink.tpl');
     }
 }
Ejemplo n.º 6
0
 public function addmodulepagelink($parameters = array())
 {
     if (!isset($parameters['moduleid'])) {
         $view = new ui($this);
         $grid = new mygrid('addmodules');
         $grid->setModel(new processedmoduleModel());
         $grid->registerRequest('title', 'mypageadmin', 'addmodulepagelink', array('title' => $parameters['title'], 'areaid' => $parameters['areaid'], 'pageid' => $parameters['pageid'], 'moduleid' => '{id}', 'oldgrid' => $parameters['-gridid-']));
         $view->assign('grid', $grid);
         return $view->fetch('mypageadmin_addmodulepagelink.tpl');
     } else {
         $linkmodel = new modulepageModel();
         $link = new modulepageObject();
         $link->setPageid($parameters['pageid']);
         $link->setAreaid($parameters['areaid']);
         $link->setModuleid($parameters['moduleid']);
         $link->setOrder($linkmodel->getmax('order', array('AND' => array(array('areaid' => array('mode' => '=', 'value' => $parameters['areaid'])), array('pageid' => array('mode' => '=', 'value' => $parameters['pageid']))))) + 1);
         $flash = new popupController();
         try {
             $linkmodel->save($link);
         } catch (Exception $e) {
             $flash->createflash(array('name' => 'error', 'type' => 'error', 'content' => 'De aanpassing werd niet doorgevoerd! Contacteer de informaticadienst.'));
             return false;
         }
         $flash->createflash(array('name' => 'error', 'type' => 'success', 'content' => 'De aanpassing werd goed doorgevoerd.'));
         $gridcontr = new mygridController();
         $gridcontr->reloadgrid($parameters['oldgrid']);
     }
 }
Ejemplo n.º 7
0
 public function showstatus($parameters = array())
 {
     $view = new ui($this);
     $dienstmodel = new keukendienstModel();
     $kamermodel = new keukenkamerModel();
     $diensten = $dienstmodel->get();
     $adiensten = array();
     $kamercond = array();
     foreach ($diensten as $dienst) {
         if (myacl::isAllowed(myauth::getCurrentuser(), $dienst, 'view')) {
             $adiensten[$dienst->getId()] = $dienst;
         }
     }
     if (count($adiensten > 1)) {
         $form = new form($parameters);
         $select = new selectField('dienst', 'Dienst', array('required'), true);
         $select->addOption(new selectoptionField('Alles', '_all_', true));
         foreach ($adiensten as $id => $dienst) {
             $select->addOption(new selectoptionField($dienst->getName(), $id));
         }
         $form->addField($select);
         $continue = true;
         if ($form->validate()) {
             $all = false;
             foreach ($form->getFieldvalue('dienst') as $id) {
                 $chosendienst[$id] = $adiensten[$id];
                 if ($id == '_all_') {
                     $all = true;
                     break;
                 }
             }
             if (!$all) {
                 $adiensten = $chosendienst;
             }
             $view->assign('form', $form);
         } elseif (!$form->isSent()) {
             $view->assign('form', $form);
         } else {
             $continue = false;
         }
     }
     if ($continue) {
         foreach ($adiensten as $id => $dienst) {
             $kamers = $kamermodel->getfromDienstid($id);
             foreach ($kamers as $kamer) {
                 $kamercond[] = array('kamer' => array('mode' => '=', 'value' => $kamer->getKamernr()));
             }
         }
         if (count($kamercond) > 0) {
             $kamercond = array('OR' => $kamercond);
         } else {
             //Geen kamers, lege lijst voorzien
             $kamercond = array('kamer' => array('mode' => '=', 'value' => '-1'));
         }
         $model = new keukenpatientModel();
         $count = $model->getcount($kamercond);
         $view->assign('count', $count);
         $grid = new mygrid('keukenstatus');
         $grid->setModel($model);
         $grid->setDefaultconditions($kamercond);
         $grid->setDefaultorder(array('fields' => array('kamer', 'bed'), 'type' => 'ASC'));
         $grid->registerEditrequest('keukenpakket', 'editPatient', array('title' => 'Maaltijdfiche aanpassen', 'id' => '{id}'));
         $grid->setPagesize(999);
         $view->assign('grid', $grid);
         $this->response->assign($this->self, 'innerHTML', $view->fetch('keukenpakket_showstatus.tpl'));
     }
 }
 public function pathdetails($parameters = array())
 {
     $view = new ui($this);
     $flash = new popupController();
     $model = new dirstatusModel();
     $current = $model->getfromId($parameters['id']);
     if (count($current) == 1) {
         $current = $current[0];
         $view->assign('current', $current);
         $closerequest = new ajaxrequest('mygrid', 'closeextra', array('id' => 'gridextra_' . $parameters['-gridid-']));
         $view->assign('closerequest', $closerequest);
         $history = new mygrid('directorywatcher_' . $current->getId());
         $history->setModel(new dirstatusModel());
         $history->setDefaultconditions(array('path' => array('mode' => '=', 'value' => $current->getPath())));
         $history->setDefaultorder(array('fields' => array('reporttime'), 'type' => 'DESC'));
         $view->assign('history', $history);
         $testmodel = new directorywatchertresholdModel();
         $treshold = new mygrid('treshold_' . $current->getId());
         $treshold->setModel($testmodel);
         $currentresholds = $testmodel->getfromPath($current->getPath());
         if (count($currentresholds) == 0) {
             $treshold->registerAddrequest('directorywatcher', 'addTreshold', array('title' => 'Treshold toevoegen', 'currentid' => $current->getId()));
             $parent = $current->getParent();
             $parenttresholds = array();
             if ($parent != '') {
                 $parentobj = $model->getfromPath($parent);
                 $parentobj = $parentobj[0];
                 $parenttresholds = $testmodel->getfromPath($parent);
                 while (count($parenttresholds) == 0 && $parent != '') {
                     $parent = $parentobj->getParent();
                     $parentobj = $model->getfromPath($parent);
                     $parentobj = $parentobj[0];
                     $parenttresholds = $testmodel->getfromPath($parent);
                 }
             }
             if (count($parenttresholds) == 0 && $parent == '') {
                 $parent = '_default_';
                 $parenttresholds = $testmodel->getfromPath($parent);
             }
             $treshold->setDefaultconditions(array('path' => array('mode' => '=', 'value' => $parent)));
             $treshold->unregisterRequest('-edit-');
             $treshold->unregisterRequest('-delete-');
         } else {
             $treshold->setDefaultconditions(array('path' => array('mode' => '=', 'value' => $current->getPath())));
             $treshold->unregisterRequest('-add-');
             $treshold->registerEditrequest('directorywatcher', 'editTreshold', array('title' => 'Treshold aanpassen', 'id' => '{id}'));
             $treshold->registerDeleterequest('directorywatcher', 'deleteTreshold', array('title' => 'Treshold verwijderen', 'id' => '{id}', 'currentid' => $current->getId()));
         }
         $view->assign('tresholdgrid', $treshold);
         $this->response->assign('gridextra_' . $parameters['-gridid-'], 'innerHTML', $view->fetch('directorywatcher_pathdetails.tpl'));
         $this->response->script('var myFx = new Fx.Scroll(window).toElement(\'gridextra_' . $parameters['-gridid-'] . '\')');
     } else {
         $flash->createflash(array('name' => 'err', 'type' => 'error', 'content' => 'Dit path werd niet gevonden.'));
         return false;
     }
 }
Ejemplo n.º 9
0
 public function setOrder($parameters = array())
 {
     $col = $parameters['col'];
     if (isset($parameters['gridid'])) {
         $grid = new mygrid($parameters['gridid']);
         $current = $grid->getOrder();
         //			$model = $grid->getModel();
         //			$assoc = $model->getAssoc();
         //			if(isset($assoc[$col])){
         //				if($assoc[$col]['type'] = 'map'){
         //					$col = $assoc[$col]['relationkey'];
         //				}
         //			}
         if (is_array($current)) {
             $field = $current['fields'][0];
             if ($field == $col) {
                 if ($current['type'] == 'ASC') {
                     $type = 'DESC';
                 } else {
                     $type = 'ASC';
                 }
             } else {
                 $type = 'ASC';
             }
         } else {
             $type = 'ASC';
         }
         $grid->setOrder(array('fields' => array($col), 'type' => $type));
         $template = new ui($this);
         $template->assign('grid', $grid);
         $this->response->assign($parameters['gridid'], 'innerHTML', $template->fetch($parameters['viewprefix'] . 'mygridstructure.tpl'));
     }
 }
Ejemplo n.º 10
0
 public function listTicketstome($parameters = array())
 {
     require FRAMEWORK . DS . 'conf' . DS . 'myticket.php';
     $view = new ui($this);
     $mdienstenmodel = new meldingdienstenModel();
     $mdiensten = $mdienstenmodel->get();
     foreach ($mdiensten as $dienst) {
         if (myacl::isAllowed(myauth::getCurrentuser(), $dienst, 'view')) {
             $diensten[$dienst->getId()] = $dienst;
         }
     }
     asort($diensten);
     foreach ($diensten as $id => $dienst) {
         $tmp = new mygrid('myticketstome_' . $id);
         $tmp->setModel(new myticketModel());
         $tmp->setDefaultpagesize(15);
         $cond = array('to' => array('mode' => '=', 'value' => $dienst->getId()));
         $tmp->setDefaultconditions($cond);
         $tmp->setDefaultorder(array('fields' => array('time'), 'type' => 'DESC'));
         $tmp->registerRequest('titel', 'myticket', 'showticket', array('id' => '{id}'));
         $tickets[$dienst->getName()] = $tmp;
     }
     $view->assign('tickets', $tickets);
     $this->response->assign($this->self, 'innerHTML', $view->fetch('myticket_listmytickets.tpl'));
 }
Ejemplo n.º 11
0
 public function editpromotext($parameters = array())
 {
     $view = new ui($this);
     $articlemodel = new myarticleModel();
     $versionmodel = new myarticleversionModel();
     $article = $articlemodel->getfromId($parameters['id']);
     if (count($article) == 1) {
         $article = $article[0];
         $view->assign('article', $article);
         $aliasform = new mygridform($parameters, $parameters['-gridid-'], 'edit');
         $aliasform->addField(new textField('alias', 'Werktitel', $article->getAlias(), array('required')));
         $aliasform->addField(new hiddenField('id', $parameters['id']));
         $aliasform->addField(new hiddenField('title', $parameters['title']));
         if ($aliasform->validate()) {
             $article->setAlias($aliasform->getFieldvalue('alias'));
             $flash = new popupController();
             try {
                 $articlemodel->save($article);
             } catch (Exception $e) {
                 $flash->createflash(array('name' => 'error', 'type' => 'error', 'content' => 'De aanpassing werd niet doorgevoerd! Contacteer de informaticadienst.'));
                 return false;
             }
             $flash->createflash(array('name' => 'error', 'type' => 'success', 'content' => 'De aanpassing werd goed doorgevoerd.'));
             $gridcontroller = new mygridController();
             unset($parameters['hidden_form_id']);
             $parameters['alias'] = '';
             $gridcontroller->editrequest($parameters);
             return true;
         } elseif (!$aliasform->isSent()) {
             $view->assign('aliasform', $aliasform);
         } else {
             return false;
         }
         $versionsids = $article->getVersion();
         $grid = new mygrid('articleversions-' . $article->getId());
         $grid->setModel(new myarticleversionModel());
         $idcond = array('articleid' => array('mode' => '=', 'value' => $parameters['id']));
         $grid->setDefaultconditions($idcond);
         $grid->setDefaultorder(array('fields' => array('state', 'creationdate'), 'type' => 'DESC'));
         $grid->registerEditrequest('mycafetaria', 'editpromotextversion', array('id' => '{id}', 'articleid' => $parameters['id'], 'title' => 'Versie aanpassen'));
         $view->assign('grid', $grid);
         return $view->fetch('myarticle_editarticle.tpl');
     } else {
         return false;
     }
 }
Ejemplo n.º 12
0
 public function showallowed($parameter = array())
 {
     $view = new ui($this);
     $grid = new mygrid('allowed');
     $grid->setModel(new ftgdallowedModel());
     $grid->setDefaultorder(array('fields' => array('time'), 'type' => 'DESC'));
     $grid->setPagesize(15);
     $grid->registerRequest('user', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{user}'));
     $grid->registerRequest('group', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{group}'));
     $grid->registerRequest('sourceip', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{sourceip}'));
     $grid->registerRequest('host', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{host}'));
     $grid->registerRequest('cat', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{cat}'));
     $grid->registerRequest('destip', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{destip}'));
     $view->assign('blocked', $grid);
     $this->response->assign($this->self, 'innerHTML', $view->fetch('ftgd_allowed.tpl'));
 }