summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorSebastian Wagner2011-09-05 15:24:17 +0200
committerSebastian Wagner2011-09-05 15:24:17 +0200
commitc050c638d0c8475241ceccf33ee22df1f01181be (patch)
treebfc4364c08382cc85af18854885da1dc2b7c4635 /application
parenteventResize- and eventDrop Function added (diff)
downloadpoolctrl-c050c638d0c8475241ceccf33ee22df1f01181be.tar.gz
poolctrl-c050c638d0c8475241ceccf33ee22df1f01181be.tar.xz
poolctrl-c050c638d0c8475241ceccf33ee22df1f01181be.zip
rename eventStates
Diffstat (limited to 'application')
-rw-r--r--application/controllers/EventController.php19
-rw-r--r--application/views/scripts/event/index.phtml5
2 files changed, 21 insertions, 3 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index cfca51f..175e454 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -496,6 +496,25 @@ class EventController extends Zend_Controller_Action
}
}
+ public function moveeventAction($id=null, $dayDelta, $allDay){
+
+ if ($id!=null) {
+ $ev = $this->Event->findById($id); //1 - locate the event in the DB
+ if ($allDay=='true') { //2- handle all day events
+ $ev['Event']['allday'] = 1;
+ } else {
+ $ev['Event']['allday'] = 0;
+ }
+ //3 - Start
+ $ev['Event']['end']=date('Y-m-d H:i:s',strtotime(''.$dayDelta.' days '.$minDelta.' minutes',strtotime($ev['Event']['end'])));
+ $ev['Event']['start']=date('Y-m-d H:i:s',strtotime(''.$dayDelta.' days '.$minDelta.' minutes',strtotime($ev['Event']['start'])));
+
+ $this->Event->save($ev); //4 - Save the event with the new data
+ //5 - redirect and reload
+ $this->redirect(array('controller' => "events", 'action' => "calendar",substr($ev['Event']['start'],0,4),substr($ev['Event']['start'],5,2),substr($ev['Event']['start'],8,2)));
+ }
+ }
+
public function listeventsAction(){
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index f4efc20..634d65c 100644
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -66,8 +66,8 @@ var lastview;
right: 'agendaWeek,agendaDay'
},
editable: true,
-// disableDragging: false,
-// droppable: true,
+// disableDragging: false,
+// droppable: true,
selectable: true,
selectHelper: true,
defaultView: 'agendaWeek',
@@ -111,7 +111,6 @@ var lastview;
"New start: " + newStart + "\n" +
"New end: " + newEnd);
-
}
},