From 2a8868e7687894bee161dd602221abf187cafae4 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 27 Oct 2011 16:09:31 +0200 Subject: Edit weiter korrigiert --- application/configs/application.ini.dist | 1 + application/controllers/EventController.php | 221 ++++++++++++++------- application/forms/EventEdit.php | 15 +- application/views/scripts/event/add.phtml | 14 +- application/views/scripts/gearman/boot.phtml | 2 - .../views/scripts/gearman/checkbootstatus.phtml | 3 - .../scripts/gearman/checkshutdownstatus.phtml | 3 - application/views/scripts/gearman/index.phtml | 20 -- application/views/scripts/gearman/shutdown.phtml | 2 - application/views/scripts/gearman/someping.phtml | 12 -- install.sh | 6 +- public/index.php | 6 +- public/media/js/script.js | 6 + 13 files changed, 168 insertions(+), 143 deletions(-) delete mode 100755 application/views/scripts/gearman/boot.phtml delete mode 100755 application/views/scripts/gearman/checkbootstatus.phtml delete mode 100755 application/views/scripts/gearman/checkshutdownstatus.phtml delete mode 100755 application/views/scripts/gearman/index.phtml delete mode 100755 application/views/scripts/gearman/shutdown.phtml delete mode 100755 application/views/scripts/gearman/someping.phtml diff --git a/application/configs/application.ini.dist b/application/configs/application.ini.dist index e2d8b73..a22dfc4 100755 --- a/application/configs/application.ini.dist +++ b/application/configs/application.ini.dist @@ -24,6 +24,7 @@ pbs2.checkright = /resource/checkright/apikey/ pbs2.getbootoss = /resource/getbootos/apikey/ pbs2.getpools = /resource/getpool/apikey/ pbs2.addbootmenu = /resource/addbootmenu/apikey/ +pbs2.changebootmenu = /resource/changebootmenu/apikey/ pbs2.deletebootmenu = /resource/deletebootmenu/apikey/ pbs2.addfilter = /resource/addfilter/apikey/ pbs2.changefilter = /resource/changefilter/apikey/ diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php index 579dc28..fef6257 100755 --- a/application/controllers/EventController.php +++ b/application/controllers/EventController.php @@ -284,6 +284,42 @@ class EventController extends Zend_Controller_Action $event->setRunning(0); } $event->setCreated(time()); + if(!$event->getParticipants()) { + $event->setParticipants(null); + } + if(!$event->getEnd()) { + $event->setEnd(null); + } + if(!$event->getNote()) { + $event->setNote(null); + } + if(!$event->getPbs_bootosID()) { + $event->setPbs_bootosID(null); + } + if(!$event->getPbs_configID()) { + $event->setPbs_configID(null); + } + if(!$event->getPbs_filterID()) { + $event->setPbs_filterID(null); + } + if(!$event->getPbs_bootmenuID()) { + $event->setPbs_bootmenuID(null); + } + if(!$event->getRepeattype()) { + $event->setRepeattype(null); + } + if(!$event->getRepeatend()) { + $event->setRepeatend(null); + } + if(!$event->getRepeatdate()) { + $event->setRepeatdate(null); + } + if(!$event->getRepeatings()) { + $event->setRepeatings(null); + } + if(!$event->getRunningtype()) { + $event->setRunningtype(null); + } $overlapping = 0; if($event->repeat) { $overlapping = $this->repeatEvent($event); @@ -446,6 +482,10 @@ class EventController extends Zend_Controller_Action $params['end'] = date ('Y-m-d H:i:s', strtotime($params['end'])); } else { unset($params['end']); + $event->setEnd(null); + } + if(!isset($params['repeat'])) { + unset($params['repeat']); } if(!isset($params['repeattype'])) { unset($params['repeattype']); @@ -461,13 +501,57 @@ class EventController extends Zend_Controller_Action if(!isset($params['repeatings'])) { unset($params['repeatings']); } + if(!isset($params['participants'])) { + unset($params['participants']); + $event->setParticipants(null); + } $params['immediate'] = 0; $event->setOptions($params); $event->setID($eventID); + if(!$event->getParticipants()) { + $event->setParticipants(null); + } + if(!$event->getEnd()) { + $event->setEnd(null); + } + if(!$event->getNote()) { + $event->setNote(null); + } + if(!$event->getPbs_bootosID()) { + $event->setPbs_bootosID(null); + } + if(!$event->getPbs_configID()) { + $event->setPbs_configID(null); + } + if(!$event->getPbs_filterID()) { + $event->setPbs_filterID(null); + } + if(!$event->getPbs_bootmenuID()) { + $event->setPbs_bootmenuID(null); + } + if(!$event->getRepeattype()) { + $event->setRepeattype(null); + } + if(!$event->getRepeatend()) { + $event->setRepeatend(null); + } + if(!$event->getRepeatdate()) { + $event->setRepeatdate(null); + } + if(!$event->getRepeatings()) { + $event->setRepeatings(null); + } + if(!$event->getRunningtype()) { + $event->setRunningtype(null); + } + if(!$event->getCreated()) { + $event->setCreated(null); + } $overlapping = 0; - if($event->getRepeat() == 1 && !isset($params['wdh'])) { + if($event->getRepeat() == 1 && $params['wdh'] != 1) { $event->setRepeat(2); - } else { + } + if($event->getRepeat() == 0 || $event->getRepeat() == 2) { $overlappingEvents = $this->eventMapper->getOverlappingEvents(date('Y-m-d H:i:s', strtotime($event->getStart())), date('Y-m-d H:i:s', strtotime($event->getEnd())), $event->getPbs_PoolID(), $event); if(count($overlappingEvents) > 0 ) { $overlapping = 1; @@ -478,23 +562,20 @@ class EventController extends Zend_Controller_Action if($event->getCategory() != $shutdownCategory->getID()) { $diff = $this->eventMapper->compare($oldEvent, $event); if(isset($diff['pbs_bootosID']) || isset($diff['title']) || isset($diff['pbs_configID'])) { - $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $oldEvent->getPbs_bootmenuID()); - unset($bootmenuApiResult); - $bootmenuquery = "bootosID=" . $event->getPbs_bootosID() . "&startcounter=0&title=Poolctrl-Bootmenu for " . $event->getTitle() . "&defaultbootmenu=0&order=0&kcl=0"; + $bootmenuquery = "bootmenuid=" . $event->getPbs_bootmenuID() . "&bootosID=" . $event->getPbs_bootosID() . "&startcounter=0&title=Poolctrl-Bootmenu for " . $event->getTitle() . "&defaultbootmenu=0&order=0&kcl=0&changeentry=1"; if($event->getPbs_configID()) { $bootmenuquery .= "&configID=" . $event->getPbs_configID(); } - $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addbootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery); - $bootmenuXMLString = $bootmenuApiResult['http-body']; - $bootmenuXML = new SimpleXMLElement($bootmenuXMLString); - $bootmenuID = sprintf("%s", $bootmenuXML->bootmenu->id); - $event->setPbs_bootmenuID($bootmenuID); - $filterQuerie = "filterid=" . $event->getPbs_filterID() . "&bootmenuID = " . $bootmenuID; + $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['changebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery); + + } + if(isset($diff['title'])) { + $filterQuerie = "filterid=" . $event->getPbs_filterID() . "&title=Poolctrl-Filter for " . $event->getTitle() . "&description=This Filter was automatically created by the Poolctrl for Event " . $event->getTitle(); $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['changefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterQuerie); unset($filterApiResult); } if(isset($diff['start']) || isset($diff['end']) || isset($diff['pbs_poolID'])) { - if(isset($params['wdh']) || !$oldEvent->getRepeat()) { + if($event->getRepeat() != 2) { $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "filterid=" . $oldEvent->getPbs_filterID()); unset($filterApiResult); } @@ -520,19 +601,17 @@ class EventController extends Zend_Controller_Action $filterentriesXMLString2 = $filterentriesApiResult2['http-body']; $filterentriesXML2 = new SimpleXMLElement($filterentriesXMLString2); $filterentriesID2 = sprintf("%s", $filterentriesXML2->filterentry->id); - if(!$event->getRepeat()) { - $startDate = date('d.m.Y', strtotime($event->getStart())); - if($event->getEnd()) { - $endDate = date('d.m.Y', strtotime($event->getEnd())); - } else { - $endDate = date('d.m.Y', strtotime($event->getStart())); - } - $filterentriesquery3 = "filterID=" . $event->getPbs_filterID() . "&filtertypeID=11&filtervalue=" . strtotime($startDate) . "&filtervalue2=" . strtotime($endDate); - $filterentriesApiResult3 = PostToHost($this->pbs2host, $this->config['pbs2']['addfilterentry'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterentriesquery3); - $filterentriesXMLString3 = $filterentriesApiResult3['http-body']; - $filterentriesXML3 = new SimpleXMLElement($filterentriesXMLString3); - $filterentriesID3 = sprintf("%s", $filterentriesXML3->filterentry->id); + $startDate = date('d.m.Y', strtotime($event->getStart())); + if($event->getEnd()) { + $endDate = date('d.m.Y', strtotime($event->getEnd())); + } else { + $endDate = date('d.m.Y', strtotime($event->getStart())); } + $filterentriesquery3 = "filterID=" . $event->getPbs_filterID() . "&filtertypeID=11&filtervalue=" . strtotime($startDate) . "&filtervalue2=" . strtotime($endDate); + $filterentriesApiResult3 = PostToHost($this->pbs2host, $this->config['pbs2']['addfilterentry'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterentriesquery3); + $filterentriesXMLString3 = $filterentriesApiResult3['http-body']; + $filterentriesXML3 = new SimpleXMLElement($filterentriesXMLString3); + $filterentriesID3 = sprintf("%s", $filterentriesXML3->filterentry->id); } } } @@ -2812,7 +2891,7 @@ class EventController extends Zend_Controller_Action } foreach($events as $event) { - $overlappingEvents = $this->eventMapper->getOverlappingEvents(date('Y-m-d H:i:s', strtotime($event->getStart())), date('Y-m-d H:i:s', strtotime($event->getEnd())), $event->getPbs_PoolID()); + $overlappingEvents = $this->eventMapper->getOverlappingEvents(date('Y-m-d H:i:s', strtotime($event->getStart())), date('Y-m-d H:i:s', strtotime($event->getEnd())), $event->getPbs_PoolID(), $event, true); if(count($overlappingEvents) > 0 ) { $overlapping = true; break; @@ -2822,20 +2901,11 @@ class EventController extends Zend_Controller_Action if(!$overlapping) { if($newEvent->getCategory() != $shutdownCategory->getID()) { if(isset($diff['pbs_bootosID']) || isset($diff['title']) || isset($diff['pbs_configID'])) { - $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $oldEvent->getPbs_bootmenuID()); - unset($bootmenuApiResult); - $bootmenuquery = "bootosID=" . $newEvent->getPbs_bootosID() . "&startcounter=0&title=Poolctrl-Bootmenu for " . $newEvent->getTitle() . "&defaultbootmenu=0&order=0&kcl=0"; + $bootmenuquery = "bootmenuid=" . $newEvent->getPbs_bootmenuID() . "&bootosID=" . $newEvent->getPbs_bootosID() . "&startcounter=0&title=Poolctrl-Bootmenu for " . $newEvent->getTitle() . "&defaultbootmenu=0&order=0&kcl=0&changeentry=1"; if($newEvent->getPbs_configID()) { $bootmenuquery .= "&configID=" . $newEvent->getPbs_configID(); } - $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addbootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery); - $bootmenuXMLString = $bootmenuApiResult['http-body']; - $bootmenuXML = new SimpleXMLElement($bootmenuXMLString); - $bootmenuID = sprintf("%s", $bootmenuXML->bootmenu->id); - $newEvent->setPbs_bootmenuID($bootmenuID); - $filterQuerie = "filterid=" . $newEvent->getPbs_filterID() . "&bootmenuID = " . $bootmenuID; - $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['changefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterQuerie); - unset($filterApiResult); + $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['changebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery); } $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "filterid=" . $oldEvent->getPbs_filterID()); unset($filterApiResult); @@ -2871,20 +2941,21 @@ class EventController extends Zend_Controller_Action } } foreach($events as $event) { - try { - if($repeattype != "Once a week" && $event->getCategory() != $shutdownCategory->getID()) { - $startDate = date('d.m.Y', strtotime($event->getStart())); - if($newEvent->getEnd()) { - $endDate = date('d.m.Y', strtotime($event->getEnd())); - } else { - $endDate = date('d.m.Y', strtotime($event->getStart())); - } - $filterentriesquery3 = "filterID=" . $event->getPbs_filterID() . "&filtertypeID=11&filtervalue=" . strtotime($startDate) . "&filtervalue2=" . strtotime($endDate); - $filterentriesApiResult3 = PostToHost($this->pbs2host, $this->config['pbs2']['addfilterentry'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterentriesquery3); - $filterentriesXMLString3 = $filterentriesApiResult3['http-body']; - $filterentriesXML3 = new SimpleXMLElement($filterentriesXMLString3); - $filterentriesID3 = sprintf("%s", $filterentriesXML3->filterentry->id); + $event->setPbs_filterID($newEvent->getPbs_filterID()); + if($repeattype != "Once a week" && $event->getCategory() != $shutdownCategory->getID()) { + $startDate = date('d.m.Y', strtotime($event->getStart())); + if($newEvent->getEnd()) { + $endDate = date('d.m.Y', strtotime($event->getEnd())); + } else { + $endDate = date('d.m.Y', strtotime($event->getStart())); } + $filterentriesquery3 = "filterID=" . $event->getPbs_filterID() . "&filtertypeID=11&filtervalue=" . strtotime($startDate) . "&filtervalue2=" . strtotime($endDate); + $filterentriesApiResult3 = PostToHost($this->pbs2host, $this->config['pbs2']['addfilterentry'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterentriesquery3); + $filterentriesXMLString3 = $filterentriesApiResult3['http-body']; + $filterentriesXML3 = new SimpleXMLElement($filterentriesXMLString3); + $filterentriesID3 = sprintf("%s", $filterentriesXML3->filterentry->id); + } + try { $this->eventMapper->save($event); } catch(Zend_Exception $e) { @@ -2898,27 +2969,22 @@ class EventController extends Zend_Controller_Action } else { if($newEvent->getCategory() != $shutdownCategory->getID()) { if(isset($diff['pbs_bootosID']) || isset($diff['title']) || isset($diff['pbs_configID'])) { - $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $oldEvent->getPbs_bootmenuID()); - unset($bootmenuApiResult); - $bootmenuquery = "bootosID=" . $newEvent->getPbs_bootosID() . "&startcounter=0&title=Poolctrl-Bootmenu for " . $newEvent->getTitle() . "&defaultbootmenu=0&order=0&kcl=0"; + $bootmenuquery = "bootmenuid=" . $newEvent->getPbs_bootmenuID() . "&bootosID=" . $newEvent->getPbs_bootosID() . "&startcounter=0&title=Poolctrl-Bootmenu for " . $newEvent->getTitle() . "&defaultbootmenu=0&order=0&kcl=0&changeentry=1"; if($newEvent->getPbs_configID()) { $bootmenuquery .= "&configID=" . $newEvent->getPbs_configID(); } - $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addbootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery); - $bootmenuXMLString = $bootmenuApiResult['http-body']; - $bootmenuXML = new SimpleXMLElement($bootmenuXMLString); - $bootmenuID = sprintf("%s", $bootmenuXML->bootmenu->id); - $newEvent->setPbs_bootmenuID($bootmenuID); - $filterQuerie = "filterid=" . $newEvent->getPbs_filterID() . "&bootmenuID = " . $bootmenuID; + $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['changebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery); + } + if(isset($diff['title'])) { + $filterQuerie = "filterid=" . $newEvent->getPbs_filterID() . "&title=Poolctrl-Filter for " . $newEvent->getTitle() . "&description=This Filter was automatically created by the Poolctrl for Event " . $newEvent->getTitle(); $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['changefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterQuerie); unset($filterApiResult); } + $newFilter = false; if(isset($diff['pbs_poolID'])) { - if(isset($params['wdh']) || !$oldEvent->getRepeat()) { - $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "filterid=" . $oldEvent->getPbs_filterID()); - unset($filterApiResult); - } - $filterquery = "bootmenuID=" . $newEvent->getPbs_bootmenuID() . "&title=Poolctrl-Filter for " . $newEvent->getTitle() . "&description=This Filter was automatically created by the Poolctrl for Event " . $newEvent->getTitle() . "&created= " . time() . "&priority=100"; + $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "filterid=" . $oldEvent->getPbs_filterID()); + unset($filterApiResult); + $filterquery = "filterID=" . $newEvent->getPbs_bootmenuID() . "&title=Poolctrl-Filter for " . $newEvent->getTitle() . "&description=This Filter was automatically created by the Poolctrl for Event " . $newEvent->getTitle() . "&created= " . time() . "&priority=100"; $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addfilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterquery); $filterXMLString = $filterApiResult['http-body']; $filterXML = new SimpleXMLElement($filterXMLString); @@ -2940,24 +3006,31 @@ class EventController extends Zend_Controller_Action $filterentriesXMLString2 = $filterentriesApiResult2['http-body']; $filterentriesXML2 = new SimpleXMLElement($filterentriesXMLString2); $filterentriesID2 = sprintf("%s", $filterentriesXML2->filterentry->id); + $newFilter = true; } } $events = $this->eventMapper->findBy(array('poolctrl_event.repeat' => $oldEvent->getRepeat(), 'title' => $oldEvent->getTitle())); try { foreach($events as $event) { $event->setOptions($diff); - if($event->getCategory() != $shutdownCategory->getID() && isset($diff['pbs_poolID'])) { - $startDate = date('d.m.Y', strtotime($event->getStart())); - if($newEvent->getEnd()) { - $endDate = date('d.m.Y', strtotime($event->getEnd())); - } else { - $endDate = date('d.m.Y', strtotime($event->getStart())); + if($newFilter) { + $event->setPbs_filterID($newEvent->getPbs_filterID()); + if($event->getCategory() != $shutdownCategory->getID() && isset($diff['pbs_poolID'])) { + $startDate = date('d.m.Y', strtotime($event->getStart())); + if($event->getEnd()) { + $endDate = date('d.m.Y', strtotime($event->getEnd())); + } else { + $endDate = date('d.m.Y', strtotime($event->getStart())); + } + $filterentriesquery3 = "filterID=" . $event->getPbs_filterID() . "&filtertypeID=11&filtervalue=" . strtotime($startDate) . "&filtervalue2=" . strtotime($endDate); + $filterentriesApiResult3 = PostToHost($this->pbs2host, $this->config['pbs2']['addfilterentry'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterentriesquery3); + $filterentriesXMLString3 = $filterentriesApiResult3['http-body']; + $filterentriesXML3 = new SimpleXMLElement($filterentriesXMLString3); + $filterentriesID3 = sprintf("%s", $filterentriesXML3->filterentry->id); } - $filterentriesquery3 = "filterID=" . $event->getPbs_filterID() . "&filtertypeID=11&filtervalue=" . strtotime($startDate) . "&filtervalue2=" . strtotime($endDate); - $filterentriesApiResult3 = PostToHost($this->pbs2host, $this->config['pbs2']['addfilterentry'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $filterentriesquery3); - $filterentriesXMLString3 = $filterentriesApiResult3['http-body']; - $filterentriesXML3 = new SimpleXMLElement($filterentriesXMLString3); - $filterentriesID3 = sprintf("%s", $filterentriesXML3->filterentry->id); + } + if(!$event->getParticipants()) { + $event->setParticipants(null); } $this->eventMapper->save($event); } diff --git a/application/forms/EventEdit.php b/application/forms/EventEdit.php index 840ecca..c5809e0 100755 --- a/application/forms/EventEdit.php +++ b/application/forms/EventEdit.php @@ -101,6 +101,7 @@ class Application_Form_EventEdit extends Zend_Form { $this->setName('EventEdit'); $this->setMethod('post'); + $this->setAttrib('onsubmit', "return editEnableOnSubmit();"); $eventcategoryfield = $this->createElement('select','category'); $eventcategoryfield ->setLabel('Category:'); @@ -178,7 +179,7 @@ class Application_Form_EventEdit extends Zend_Form array('StringLength', false, array(0, 19)), array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())), - array('EventOverlapping', false, array('poolID' => $this->params['pbs_poolID'], 'start' => $this->getElement('start')->getValue())), + array('EventOverlapping', false, array('poolID' => $this->params['pbs_poolID'], 'start' => $this->getElement('start')->getValue())), ), 'required' => false, 'label' => 'End:', @@ -193,14 +194,14 @@ class Application_Form_EventEdit extends Zend_Form 'label' => 'Repeat:', 'value'=>array(0,1), 'checked' => 'checked', - 'disabled' => true, + 'readOnly' => true, )); } else { $this->addElement('checkbox', 'repeat', array( 'required' => false, 'label' => 'Repeat:', 'value'=>array(0,1), - 'disabled' => true, + 'readOnly' => true, )); } @@ -255,7 +256,7 @@ class Application_Form_EventEdit extends Zend_Form 'required' => false, 'label' => 'Repeat End Date:', 'value' => date('m/d/Y h:i a', strtotime($this->params['repeatdate'])), - 'disabled' => true, + 'readOnly' => true, )); } else { $this->addElement('text', 'repeatdate', array( @@ -267,7 +268,7 @@ class Application_Form_EventEdit extends Zend_Form 'required' => false, 'label' => 'Repeat End Date:', 'value' => 'mm/dd/yyyy h:min am/pm', - 'disabled' => true, + 'readOnly' => true, )); } } @@ -282,7 +283,7 @@ class Application_Form_EventEdit extends Zend_Form 'required' => false, 'label' => 'Repeatings:', 'value' => $this->params['repeatings'], - 'disabled' => true, + 'readOnly' => true, )); } else { $this->addElement('text', 'repeatings', array( @@ -293,7 +294,7 @@ class Application_Form_EventEdit extends Zend_Form 'required' => false, 'label' => 'Repeatings:', 'value' => '1', - 'disabled' => true, + 'readOnly' => true, )); } } diff --git a/application/views/scripts/event/add.phtml b/application/views/scripts/event/add.phtml index 43fd4c2..90fc889 100755 --- a/application/views/scripts/event/add.phtml +++ b/application/views/scripts/event/add.phtml @@ -30,23 +30,13 @@ if(isset($this->params['add'])) { ?> $(function() { $("#start").datetimepicker({ - onSelect: function (selectedDateTime){ - var start = $(this).datetimepicker('getDate'); - var end = $('#end').datetimepicker("getDate"); - $('#end').datetimepicker('option', 'minDate', new Date(start.getTime())); - $('#end').datetimepicker('setDate', end); - }, + minDate: new Date(), dateFormat: "mm/dd/yy", timeFormat: "hh:mm tt", ampm: true }); $("#end").datetimepicker({ - onSelect: function (selectedDateTime){ - var end = $(this).datetimepicker('getDate'); - var start = $('#start').datetimepicker('getDate'); - $('#start').datetimepicker('option', 'maxDate', new Date(end.getTime()) ); - $('#start').datetimepicker('setDate', start); - }, + minDate: new Date(), dateFormat: "mm/dd/yy", timeFormat: "hh:mm tt", ampm: true diff --git a/application/views/scripts/gearman/boot.phtml b/application/views/scripts/gearman/boot.phtml deleted file mode 100755 index e07fcaa..0000000 --- a/application/views/scripts/gearman/boot.phtml +++ /dev/null @@ -1,2 +0,0 @@ -

Boot

-result;?> \ No newline at end of file diff --git a/application/views/scripts/gearman/checkbootstatus.phtml b/application/views/scripts/gearman/checkbootstatus.phtml deleted file mode 100755 index a276048..0000000 --- a/application/views/scripts/gearman/checkbootstatus.phtml +++ /dev/null @@ -1,3 +0,0 @@ -result); -?> \ No newline at end of file diff --git a/application/views/scripts/gearman/checkshutdownstatus.phtml b/application/views/scripts/gearman/checkshutdownstatus.phtml deleted file mode 100755 index a276048..0000000 --- a/application/views/scripts/gearman/checkshutdownstatus.phtml +++ /dev/null @@ -1,3 +0,0 @@ -result); -?> \ No newline at end of file diff --git a/application/views/scripts/gearman/index.phtml b/application/views/scripts/gearman/index.phtml deleted file mode 100755 index 4d20a8f..0000000 --- a/application/views/scripts/gearman/index.phtml +++ /dev/null @@ -1,20 +0,0 @@ -

Gearman Testpage

-formButton('somePing', 'PingTest', array( - 'onclick' => 'self.location="/gearman/someping"' - )) ?> -
-formButton('boot', 'BootTest', array( - 'onclick' => 'self.location="/gearman/boot"' - )) ?> -
-formButton('boot status', 'BootStatusTest', array( - 'onclick' => 'self.location="/gearman/checkbootstatus"' - )) ?> -
-formButton('shutdown', 'ShutdownTest', array( - 'onclick' => 'self.location="/gearman/shutdown"' - )) ?> -
-formButton('shutdown status', 'ShutdownStatusTest', array( - 'onclick' => 'self.location="/gearman/checkshutdownstatus"' - )) ?> \ No newline at end of file diff --git a/application/views/scripts/gearman/shutdown.phtml b/application/views/scripts/gearman/shutdown.phtml deleted file mode 100755 index e1e194a..0000000 --- a/application/views/scripts/gearman/shutdown.phtml +++ /dev/null @@ -1,2 +0,0 @@ -

Shutdown

-result;?> \ No newline at end of file diff --git a/application/views/scripts/gearman/someping.phtml b/application/views/scripts/gearman/someping.phtml deleted file mode 100755 index ce458c8..0000000 --- a/application/views/scripts/gearman/someping.phtml +++ /dev/null @@ -1,12 +0,0 @@ -results as $k => $result) { -?> -

Result :

-
-	rawoutput; ?>
- alive: alive) echo 'yes'; else echo 'no'; ?>
- returncode: rc; ?> -
- \ No newline at end of file diff --git a/install.sh b/install.sh index a0445c8..dd5e482 100755 --- a/install.sh +++ b/install.sh @@ -15,7 +15,7 @@ echo "Copying to /var/www/" sourceDir=$(readlink -f $(dirname $(readlink -f $0))) echo -n "enter vhost name: " read vhost_name -sed -e "38s/\$/$vhost_name/" -i $targetDir/application/configs/application.ini +sed -e "39s/\$/$vhost_name/" -i $targetDir/application/configs/application.ini targetDir="/var/www/$vhost_name" mkdir -p $targetDir cp -R $sourceDir/* $targetDir @@ -72,12 +72,12 @@ sed -e "21s/\$/$pbs2_host/" -i $targetDir/application/configs/application.ini echo -n "Please enter host of gearman server [localhost]: " read gearman_server_host [ "x" = "x$gearman_server_host" ] && gearman_server_host="localhost" -sed -e "41s/\$/$gearman_server_host/" -i $targetDir/application/configs/application.ini +sed -e "42s/\$/$gearman_server_host/" -i $targetDir/application/configs/application.ini echo -n "Please enter port of gearman server [4730]: " read gearman_server_port [ "x" = "x$gearman_server_port" ] && gearman_server_port="4730" -sed -e "42s/\$/$gearman_server_port/" -i $targetDir/application/configs/application.ini +sed -e "43s/\$/$gearman_server_port/" -i $targetDir/application/configs/application.ini echo "Create database and tables" cat $targetDir/setup/poolctrl.sql | sed -e "s,##poolctrl##,$db_name," > /tmp/poolctrl.sql diff --git a/public/index.php b/public/index.php index c7c26a6..93036a7 100755 --- a/public/index.php +++ b/public/index.php @@ -32,11 +32,7 @@ APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); -// Set Session lifetime -if(stristr($_SERVER['HTTP_USER_AGENT'],'prebootGUI')) - Zend_Session::setOptions(array('cookie_lifetime' => null)); -else - Zend_Session::setOptions(array('cookie_lifetime' => '3600')); +Zend_Session::setOptions(array('cookie_lifetime' => '3600')); // Run bootstrap $application->bootstrap() diff --git a/public/media/js/script.js b/public/media/js/script.js index 1829d34..641a24e 100755 --- a/public/media/js/script.js +++ b/public/media/js/script.js @@ -285,6 +285,12 @@ function bootosfieldChanged(name, bootosIDs) { } } +function editEnableOnSubmit() { + enableElement('repeattype'); + enableElement('repeatend'); + return true; +} + function getOverlappingVar() { if (window.location.href.search(/overlapping/) >= 0) { index = window.location.href.indexOf('/overlapping/') + 13; -- cgit v1.2.3-55-g7522