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'));
 }
Esempio n. 2
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'));
     }
 }
Esempio n. 3
0
 public function editArticle($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('myarticle', 'editversion', array('id' => '{id}', 'articleid' => $parameters['id'], 'title' => 'Versie aanpassen', 'myacl' => array('target' => $article, 'right' => 'create_newversion', 'default' => false)));
         $view->assign('grid', $grid);
         if (myacl::isAllowed(myauth::getCurrentuser(), $article, 'manage_sectionlinks')) {
             $sectiongrid = new mygrid('sections_' . $article->getId());
             $sectiongrid->setModel(new processedmyarticlesectionlinkModel());
             $sectiongrid->setDefaultconditions($idcond);
             $sectiongrid->registerAddrequest('myarticle', 'addsectionlink', array('articleid' => $article->getId(), 'title' => 'Nieuwe sectie linken'));
             $sectiongrid->registerDeleterequest('myarticle', 'deletesectionlink', array('id' => '{id}', 'title' => 'Link met sectie verwijderen'));
             $view->assign('sectiongrid', $sectiongrid);
         }
         $aclcontroller = new myaclController();
         $view->assign('acllist', $aclcontroller->listacl(array('targetoutput' => '_return_', 'objecttype' => 'myarticleObject', 'objectid' => $parameters['id'])));
         return $view->fetch('myarticle_editarticle.tpl');
     } else {
         return false;
     }
 }
 public function managepages($parameters = array())
 {
     $view = new ui($this);
     if (!isset($parameters['parentid'])) {
         $parentid = 0;
     } else {
         $parentid = $parameters['parentid'];
     }
     $pagemodel = new pageModel();
     if ($parentid != 0) {
         $currentpage = $pagemodel->getfromId($parentid);
         if (count($currentpage) == 1) {
             $currentpage = $currentpage[0];
             if (!$parameters['history']) {
                 $this->response->addWaypoint('mypageadmin', 'managepages', 'pageadmin', $parameters);
             }
         }
     }
     $grid = new mygrid('pagelist_' . $parentid);
     $grid->setModel($pagemodel);
     $grid->setDefaultconditions(array('parentid' => array('mode' => '=', 'value' => $parentid)));
     $grid->setDefaultorder(array('fields' => array('order'), 'type' => 'ASC'));
     $grid->setOrderfield('order');
     $grid->registerRequest('title', 'mypageadmin', 'managepages', array('parentid' => '{id}'));
     if ($currentpage instanceof pageObject) {
         $add = myacl::isAllowed(myauth::getCurrentuser(), $currentpage, 'addpage');
     } else {
         $add = myacl::isAllowed(myauth::getCurrentuser(), new securitytarget('pagemanagement'), 'addrootpage');
     }
     if ($add) {
         $grid->registerAddrequest('mypageadmin', 'addpage', array('title' => 'Pagina toevoegen', 'parentid' => $parentid));
     }
     $view->assign('grid', $grid);
     $pageid = $currentpage instanceof pageObject ? $currentpage->getId() : -1;
     $areamodel = new areaModel();
     $areas = $areamodel->get();
     $modules = array();
     $idcond = array('pageid' => array('mode' => '=', 'value' => $pageid));
     foreach ($areas as $area) {
         $areacond = array('areaid' => array('mode' => '=', 'value' => $area->getId()));
         $grid = new mygrid('modules_page_' . $pageid . '_area_' . $area->getId());
         $grid->setModel(new processedmodulepageModel());
         $grid->setDefaultconditions(array('AND' => array($idcond, $areacond)));
         $grid->setDefaultorder(array('fields' => array('order'), 'type' => 'ASC'));
         $grid->setOrderfield('order');
         $grid->registerAddrequest('mypageadmin', 'addmodulepagelink', array('title' => 'Module aan pagina toevoegen', 'areaid' => $area->getId(), 'pageid' => $pageid));
         $modules[$area->getName()] = $grid;
     }
     $view->assign('modules', $modules);
     if ($currentpage instanceof pageObject) {
         $aclcontroller = new myaclController();
         $acl = $aclcontroller->listacl(array('targetoutput' => '_return_', 'objecttype' => 'pageObject', 'objectid' => $currentpage->getId()));
         $view->assign('acl', $acl);
         $titleform = new form($parameters);
         $titleform->addField(new textField('title', 'Titel', $currentpage->getTitle(), array('required')));
         $titleform->addField(new hiddenField('parentid', $currentpage->getId()));
         if ($titleform->validate()) {
             $flash = new popupController();
             if ($titleform->getFieldvalue('title') != $currentpage->getTitle()) {
                 $currentpage->setTitle($titleform->getFieldvalue('title'));
                 try {
                     $pagemodel->save($currentpage);
                 } catch (Exception $e) {
                     $flash->createflash(array('name' => 'err', 'type' => 'error', 'content' => 'De gegevens zijn niet goed bewaard! Raadpleeg de informaticadienst.'));
                     return false;
                 }
                 $flash->createflash(array('name' => 'success', 'type' => 'success', 'content' => 'De gegevens zijn goed bewaard.'));
             } else {
                 $flash->createflash(array('name' => 'warning', 'type' => 'warning', 'content' => 'De nieuwe titel is gelijk aan de vorige titel.'));
             }
             $view->assign('titleform', $titleform);
         } elseif (!$titleform->isSent()) {
             $view->assign('titleform', $titleform);
         } else {
             return false;
         }
     }
     $theparentid = $parentid;
     $path = array();
     while ($theparentid != 0) {
         $parent = $pagemodel->getfromId($theparentid);
         if (count($parent) == 1) {
             $parent = $parent[0];
             $tmp = array();
             $tmp['page'] = $parent;
             $tmp['request'] = new ajaxrequest('mypageadmin', 'managepages', array('parentid' => $theparentid));
             $path[] = $tmp;
             $theparentid = $parent->getParentid();
         } else {
             $theparentid = 0;
         }
     }
     $rootpage = new pageObject();
     $rootpage->setTitle('Root');
     $root['page'] = $rootpage;
     $root['request'] = new ajaxrequest('mypageadmin', 'managepages', array('parentid' => 0));
     $path[] = $root;
     $view->assign('path', array_reverse($path));
     $view->assign('currentpage', $currentpage);
     $this->response->assign($this->self, 'innerHTML', $view->fetch('mypageadmin_managepages.tpl'));
 }
 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;
     }
 }
Esempio n. 7
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'));
 }
 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;
     }
 }