summaryrefslogtreecommitdiffstats
path: root/application/views/scripts
diff options
context:
space:
mode:
authorSebastian Wagner2011-07-27 14:57:59 +0200
committerSebastian Wagner2011-07-27 14:57:59 +0200
commit30adb4b5b1cac8639e3fb9579a86e0c92a290729 (patch)
tree357a4e88e602fa4265a2045ef3e50c5d7573701e /application/views/scripts
parentminor (diff)
downloadpoolctrl-30adb4b5b1cac8639e3fb9579a86e0c92a290729.tar.gz
poolctrl-30adb4b5b1cac8639e3fb9579a86e0c92a290729.tar.xz
poolctrl-30adb4b5b1cac8639e3fb9579a86e0c92a290729.zip
some calendar changes
Diffstat (limited to 'application/views/scripts')
-rw-r--r--application/views/scripts/event/index.phtml70
1 files changed, 39 insertions, 31 deletions
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 15ef05b..55db303 100644
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -4,15 +4,12 @@
<link rel='stylesheet' type='text/css' href='/media/css/fullcalendar.css' />
<script type='text/javascript'>
-
- $(document).ready(function() {
-
- var date = new Date();
- var d = date.getDate();
- var m = date.getMonth();
- var y = date.getFullYear();
-
- $('#calendar').fullCalendar({
+
+$(document).ready(function() {iniCalendar();});
+
+ function iniCalendar() {
+
+ var calendar = $('#calendar').fullCalendar({
header: {
left: 'title',
center: 'prev,next today',
@@ -21,31 +18,48 @@
editable: true,
// disableDragging: false,
// droppable: true,
-
- events: [
- {
- title: 'Thist is a TestEvent!',
- start: new Date(y, m, d, 13, 15),
- end: new Date(y, m, d, 14, 45),
- allDay: false
+ selectable: true,
+ selectHelper: true,
+
+ events: "calendarEvents.php",
+
+ select: function(start, end, allDay) {
+ var title = prompt('Event Title:');
+ if (title) {
+ calendar.fullCalendar('renderEvent',
+ {
+ title: title,
+ start: start,
+ end: end,
+ allDay: allDay
+ },
+ true // make the event "stick"
+ );
}
- ]
- });
- });
+ calendar.fullCalendar('unselect');
+ },
+
+ eventClick: function(event, element) {
+ var title = prompt('New Title:');
+ event.title = title;
+
+ $('#calendar').fullCalendar('updateEvent', event);
+
+ }
+ });
+ }
</script>
</head>
-<h1>Pool Control</h1>
-
-<!-- <input type="button" value="ShowCalender" onClick="showCalendar();"> -->
-
+<h1>Pool Control</h1>
<?php echo $this->formButton('addEvent', 'Add Event', array(
'onclick' => 'self.location="/event/add/"',
'class' => 'addbutton'))
?>
+
<form name="PoolSelectForm">
<select name="PoolSelectbox" onChange="deselectAll();selectPool();">
- <option> Choose a Pool </option>
+ <option> Please choose a Pool </option>
<?php if(count($this->poollist)>0){
foreach($this->poollist as $pool => $p){
echo "<option value='" . $p->getID() . "'>" . $p->getTitle() . "</option>";
@@ -57,13 +71,7 @@
<div id='calendar' style='margin:3em 0;font-size:13px'></div>
<script type="text/javascript">
- function showCalendar() {
-// document.write(document.getElementById(calendar).style.display);
- document.getElementById("calendar").style.display = "block";
-// setVisible(document.getElementById("calendar"));
- }
-
-
+
function selectPool() {
selectForm = document.PoolSelectForm;
selectBox = selectForm.PoolSelectbox;