diff options
Diffstat (limited to 'apps/calendar/templates')
-rw-r--r-- | apps/calendar/templates/calendar.php | 12 | ||||
-rw-r--r-- | apps/calendar/templates/part.editevent.php | 34 | ||||
-rw-r--r-- | apps/calendar/templates/part.eventform.php | 12 | ||||
-rw-r--r-- | apps/calendar/templates/part.newevent.php | 34 |
4 files changed, 18 insertions, 74 deletions
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index aedfeda9cb4..c5717640fb5 100644 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -71,14 +71,14 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur <thead> <tr> <th class="calendar_time"><?php echo $l->t("Time");?></th> - <th id="onedayview_today" class="calendar_row" onclick="oc_cal_newevent('#onedayview_today');"></th> + <th id="onedayview_today" class="calendar_row" onclick="Calendar.UI.newEvent('#onedayview_today');"></th> </tr> </thead> <tbody> <?php foreach($hours as $time => $time_label): ?> <tr> <td class="calendar_time"><?php echo $time_label ?></td> - <td class="calendar_row <?php echo $time ?>" onclick="oc_cal_newevent('#onedayview_today', '<?php echo $time ?>');"></td> + <td class="calendar_row <?php echo $time ?>" onclick="Calendar.UI.newEvent('#onedayview_today', '<?php echo $time ?>');"></td> </tr> <?php endforeach; ?> </tbody> @@ -90,7 +90,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur <tr> <th class="calendar_time"><?php echo $l->t("Time");?></th> <?php foreach($weekdays as $weekdaynr => $weekday): ?> - <th class="calendar_row <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend_thead' : '' ?>" onclick="oc_cal_newevent('#oneweekview th.<?php echo $weekday ?>');"></th> + <th class="calendar_row <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend_thead' : '' ?>" onclick="Calendar.UI.newEvent('#oneweekview th.<?php echo $weekday ?>');"></th> <?php endforeach; ?> </tr> </thead> @@ -99,7 +99,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur <tr> <td class="calendar_time"><?php echo $time_label?></td> <?php foreach($weekdays as $weekdaynr => $weekday): ?> - <td class="<?php echo $weekday ?> <?php echo $time ?> calendar_row <?php echo $weekdaynr > 4 ? 'weekend_row' : '' ?>" onclick="oc_cal_newevent('#oneweekview th.<?php echo $weekday ?>', '<?php echo $time ?>');"></td> + <td class="<?php echo $weekday ?> <?php echo $time ?> calendar_row <?php echo $weekdaynr > 4 ? 'weekend_row' : '' ?>" onclick="Calendar.UI.newEvent('#oneweekview th.<?php echo $weekday ?>', '<?php echo $time ?>');"></td> <?php endforeach; ?> </tr> <?php endforeach; ?> @@ -121,7 +121,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur <tr class="week_<?php echo $week ?>"> <td class="calw"></td> <?php foreach($weekdays as $weekdaynr => $weekday): ?> - <td class="day <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend' : '' ?>" onclick="oc_cal_newevent('#fourweeksview .week_<?php echo $week ?> .<?php echo $weekday ?>')"> + <td class="day <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend' : '' ?>" onclick="Calendar.UI.newEvent('#fourweeksview .week_<?php echo $week ?> .<?php echo $weekday ?>')"> <div class="dateinfo"></div> <div class="events"></div> </td> @@ -144,7 +144,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur <?php foreach(range(1, 6) as $week): ?> <tr class="week_<?php echo $week ?>"> <?php foreach($weekdays as $weekdaynr => $weekday): ?> - <td class="day <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend' : '' ?>" onclick="oc_cal_newevent('#onemonthview .week_<?php echo $week ?> .<?php echo $weekday ?>')"> + <td class="day <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend' : '' ?>" onclick="Calendar.UI.newEvent('#onemonthview .week_<?php echo $week ?> .<?php echo $weekday ?>')"> <div class="dateinfo"></div> <div class="events"></div> </td> diff --git a/apps/calendar/templates/part.editevent.php b/apps/calendar/templates/part.editevent.php index 7fbb75756cd..8c6053dc88a 100644 --- a/apps/calendar/templates/part.editevent.php +++ b/apps/calendar/templates/part.editevent.php @@ -1,4 +1,4 @@ -<div id="editevent" title="<?php echo $l->t("Edit an event");?>"> +<div id="event" title="<?php echo $l->t("Edit an event");?>"> <form id="event_form"> <input type="hidden" name="id" value="<?php echo $_['id'] ?>"> <?php echo $this->inc("part.eventform"); ?> @@ -8,35 +8,3 @@ </span> </form> </div> -<script type="text/javascript"> - $( "#editevent" ).dialog({ - width : 500, - close : function() { - oc_cal_opendialog = 0; - var lastchild = document.getElementById("body-user").lastChild - while(lastchild.id != "lightbox"){ - document.getElementById("body-user").removeChild(lastchild); - lastchild = document.getElementById("body-user").lastChild; - } - } - }); - $( "#from" ).datepicker({ - dateFormat : 'dd-mm-yy' - }); - $( "#to" ).datepicker({ - dateFormat : 'dd-mm-yy' - }); - function lock_time() { - if(document.getElementById("totime").disabled == true) { - document.getElementById("fromtime").disabled = false; - document.getElementById("totime").disabled = false; - $("#fromtime").css('color', "#333"); - $("#totime").css('color', "#333"); - } else { - document.getElementById("fromtime").disabled = true; - document.getElementById("totime").disabled = true; - $("#fromtime").css('color', "#A9A9A9"); - $("#totime").css('color', "#A9A9A9"); - } - } -</script> diff --git a/apps/calendar/templates/part.eventform.php b/apps/calendar/templates/part.eventform.php index 4c3024e1deb..f80854177d6 100644 --- a/apps/calendar/templates/part.eventform.php +++ b/apps/calendar/templates/part.eventform.php @@ -39,8 +39,7 @@ <tr> <th width="75px"></th> <td> - <input onclick="lock_time();" type="checkbox"<?php if($_['allday']){echo 'checked="checked"';} ?> id="allday_checkbox" name="allday"> - <?php if($_['allday']){echo '<script type="text/javascript">document.getElementById("fromtime").disabled = true;document.getElementById("totime").disabled = true;document.getElementById("fromtime").style.color = "#A9A9A9";document.getElementById("totime").style.color = "#A9A9A9";</script>';}?> + <input onclick="Calendar.UI.lockTime();" type="checkbox"<?php if($_['allday']){echo 'checked="checked"';} ?> id="allday_checkbox" name="allday"> <label for="allday_checkbox"><?php echo $l->t("All Day Event");?></label></td> </tr> <tr> @@ -86,3 +85,12 @@ <td><textarea style="width:350px;height: 150px;" placeholder="<?php echo $l->t("Description of the Event");?>" name="description"><?php echo $_['description'] ?></textarea></td> </tr> </table> +<script type="text/javascript"> + Calendar.UI.lockTime(); + $( "#from" ).datepicker({ + dateFormat : 'dd-mm-yy' + }); + $( "#to" ).datepicker({ + dateFormat : 'dd-mm-yy' + }); +</script> diff --git a/apps/calendar/templates/part.newevent.php b/apps/calendar/templates/part.newevent.php index cff8d4412b2..2c8ba7b907d 100644 --- a/apps/calendar/templates/part.newevent.php +++ b/apps/calendar/templates/part.newevent.php @@ -1,4 +1,4 @@ -<div id="newevent" title="<?php echo $l->t("Create a new event");?>"> +<div id="event" title="<?php echo $l->t("Create a new event");?>"> <form id="event_form"> <?php echo $this->inc("part.eventform"); ?> <div style="width: 100%;text-align: center;color: #FF1D1D;" id="errorbox"></div> @@ -7,35 +7,3 @@ </span> </form> </div> -<script type="text/javascript"> - $("#newevent").dialog({ - width : 500, - close : function() { - oc_cal_opendialog = 0; - var lastchild = document.getElementById("body-user").lastChild - while(lastchild.id != "lightbox"){ - document.getElementById("body-user").removeChild(lastchild); - lastchild = document.getElementById("body-user").lastChild; - } - } - }); - $( "#from" ).datepicker({ - dateFormat : 'dd-mm-yy' - }); - $( "#to" ).datepicker({ - dateFormat : 'dd-mm-yy' - }); - function lock_time() { - if(document.getElementById("totime").disabled == true) { - document.getElementById("fromtime").disabled = false; - document.getElementById("totime").disabled = false; - $("#fromtime").css('color', "#333"); - $("#totime").css('color', "#333"); - } else { - document.getElementById("fromtime").disabled = true; - document.getElementById("totime").disabled = true; - $("#fromtime").css('color', "#A9A9A9"); - $("#totime").css('color', "#A9A9A9"); - } - } -</script> |