-
-
Notifications
You must be signed in to change notification settings - Fork 557
/
showMyCalendar.tpl.php
71 lines (57 loc) · 2.4 KB
/
showMyCalendar.tpl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
defined('RESTRICTED') or die('Restricted access');
?>
<div class="pageheader">
<div class="pageicon"><span class="<?php echo $this->getModulePicture() ?>"></span></div>
<div class="pagetitle">
<h5><?php echo $this->__('headline.calendar'); ?></h5>
<h1><?php echo $this->__('headline.my_calendar'); ?></h1>
</div>
</div><!--pageheader-->
<div class="maincontent">
<div class="maincontentinner">
<?php echo $this->displayLink(
'calendar.addEvent',
"<i class='iconfa-plus'></i> ".$this->__('buttons.add_event'),
null,
array('class'=>'btn btn-primary btn-rounded')
) ?>
<div id="calendar"></div>
</div>
</div>
<script type='text/javascript'>
jQuery(document).ready(function() {
var events=[<?php foreach($this->get('calendar') as $calendar): ?>
{
title: <?php echo json_encode($calendar['title']); ?>,
start: new Date(<?php echo
$calendar['dateFrom']['y'].','.
($calendar['dateFrom']['m'] - 1).','.
$calendar['dateFrom']['d'].','.
$calendar['dateFrom']['h'].','.
$calendar['dateFrom']['i'] ?>),
<?php if(isset($calendar['dateTo'])) : ?>
end: new Date(<?php echo
$calendar['dateTo']['y'].','.
($calendar['dateTo']['m'] - 1).','.
$calendar['dateTo']['d'].','.
$calendar['dateTo']['h'].','.
$calendar['dateTo']['i'] ?>),
<?php endif; ?>
<?php if ((isset($calendar['allDay']) && $calendar['allDay'] == TRUE)) : ?>
allDay: true,
<?php else: ?>
allDay: false,
<?php endif; ?>
<?php if(isset($calendar['eventType']) && $calendar['eventType'] == 'calendar') : ?>
url: '<?=BASE_URL ?>/calendar/editEvent/<?php echo $calendar['id'] ?>',
color: '#00814A'
<?php else: ?>
url: '<?=BASE_URL ?>/tickets/showTicket/<?php echo $calendar['id'] ?>?projectId=<?php echo $calendar['projectId'] ?>',
color:'#BC3600'
<?php endif; ?>
},
<?php endforeach; ?>];
leantime.calendarController.initCalendar(events);
});
</script>