resource_calendar.html
1 <link href="css/plugins/appointment/appointment.css" rel="stylesheet" >
2 <@row class='hidden-desktop'>
3 <@columns>
4 <#list listDays as day>
5 <@row>
6 <@columns>
7 <@table>
8 <thead>
9 <tr>
10 <th>
11 #i18n{${list_days_of_week[day_index]}}<br />
12 ${day.date?date}
13 </th>
14 </tr>
15 </thead>
16 <tbody>
17 <#assign currentTime = startingTime />
18 <#assign currentMinute = startingMinute />
19 <#assign currentHour = startingHour />
20 <#if day.listAppointmentResourceDTO?has_content>
21 <#list day.listAppointmentResourceDTO as appointment>
22 <#assign nbOccur = ( ( ( appointment.startingHour * 60 + appointment.startingMinute ) - currentTime ) / duration)?round />
23 <#if nbOccur > 0>
24 <#list 1..nbOccur as i>
25 <@updateCurrentTimeHourAndMinute durationApp=duration />
26 </#list>
27 </#if>
28 <tr>
29 <@updateCurrentTimeHourAndMinute durationApp=appointment.duration />
30 <td class="appointment-slot-avaiable" title="">
31 <div>
32 <a href="jsp/admin/plugins/appointment/ManageAppointments.jsp?view=viewAppointment&id_appointment=${appointment.idApppointment}" title="#i18n{module.appointment.resource.resource_calendar.viewAppointment}&id_form=${appointment.idForm!}">
33 <#if appointment.startingHour < 10>0</#if>${appointment.startingHour}h<#if appointment.startingMinute < 10>0</#if>${appointment.startingMinute} - <#if appointment.endingHour < 10>0</#if>${appointment.endingHour}h<#if appointment.endingMinute < 10>0</#if>${appointment.endingMinute}
34 </a>
35 </div>
36 </td>
37 </tr>
38 </#list>
39 <#else>
40 <tr>
41 <td class="appointment-slot-closed appointment-row1">
42 #i18n{module.appointment.resource.labelNoAppointment}
43 </td>
44 </tr>
45 </#if>
46 </tbody>
47 </@table>
48 </@columns>
49 </@row>
50 </#list>
51 </@columns>
52 </@row>
53 <@row class='visible-desktop'>
54 <@columns>
55 <@table>
56 <tr>
57 <td>
58 <@table>
59 <tr>
60 <th>
61 <br />
62 <br />
63 </th>
64 </tr>
65 <#assign nbOccur = ( ( endingTime - startingTime ) / duration)?round />
66 <#assign currentTime = startingTime />
67 <#assign currentMinute = startingMinute />
68 <#assign currentHour = startingHour />
69 <#list 1..nbOccur as i>
70 <tr>
71 <td class="appointment-row1">
72 <#if currentHour < 10>0</#if>${currentHour}h<#if currentMinute < 10>0</#if>${currentMinute}
73 <@updateCurrentTimeHourAndMinute durationApp=duration />
74 </td>
75 </tr>
76 </#list>
77 </@table>
78 </td>
79 <#list listDays as day>
80 <td>
81 <@table class="table appointment-inner-table">
82 <thead>
83 <tr>
84 <th>
85 #i18n{${list_days_of_week[day_index]}}<br />
86 ${day.date?date}
87 </th>
88 </tr>
89 </thead>
90 <tbody>
91 <#assign currentTime = startingTime />
92 <#assign currentMinute = startingMinute />
93 <#assign currentHour = startingHour />
94 <#list day.listAppointmentResourceDTO as appointment>
95 <#assign nbOccur = ( ( ( appointment.startingHour * 60 + appointment.startingMinute ) - currentTime ) / duration)?round />
96 <#if nbOccur > 0>
97 <#list 1..nbOccur as i>
98 <@addEmptyLine durationApp=duration />
99 </#list>
100 </#if>
101 <tr>
102 <#assign rowspan=((appointment.duration)/duration)?round>
103 <@updateCurrentTimeHourAndMinute durationApp=appointment.duration />
104 <td class="appointment-slot-avaiable appointment-row${rowspan} appointment-tooltip" title="">
105 <div>
106 <a href="jsp/admin/plugins/appointment/ManageAppointments.jsp?view=viewAppointment&id_appointment=${appointment.idApppointment}&id_form=${appointment.idForm!}" title="#i18n{module.appointment.resource.resource_calendar.viewAppointment}">
107 <#if appointment.startingHour < 10>0</#if>${appointment.startingHour}h<#if appointment.startingMinute < 10>0</#if>${appointment.startingMinute}
108 </a>
109 </div>
110 <span class="appointment-tooltip-title">
111 <@getCellTitle startingHour=appointment.startingHour startingMinute=appointment.startingMinute endingHour=appointment.endingHour endingMinute=appointment.endingMinute appointmentDescription=appointment.appointmentDescription />
112 </span>
113 </td>
114 </tr>
115 </#list>
116 <#assign maxTime = endingTime />
117 <#assign nbOccur = ( ( maxTime - currentTime ) / duration )?round />
118 <#if nbOccur > 0>
119 <#list 1..nbOccur as i>
120 <@addEmptyLine durationApp=duration/>
121 </#list>
122 </#if>
123 </tbody>
124 </@table>
125 </td>
126 </#list>
127 </tr>
128 </@table>
129 </@columns>
130 </@row>
131 <#macro addEmptyLine durationApp>
132 <#assign saveCurrentHour = currentHour />
133 <#assign saveCurrentMinute = currentMinute />
134 <@updateCurrentTimeHourAndMinute durationApp=durationApp />
135 <tr>
136 <td class="appointment-slot-closed appointment-row1 appointment-tooltip" title="">
137
138 <span class="appointment-tooltip-title">
139 <@getCellTitle startingHour=saveCurrentHour startingMinute=saveCurrentMinute endingHour=currentHour endingMinute=currentMinute appointmentDescription='' />
140 </span>
141 </td>
142 </tr>
143 </#macro>
144
145 <#macro updateCurrentTimeHourAndMinute durationApp>
146 <#assign currentTime = currentTime + durationApp />
147 <#assign currentMinute = currentMinute + durationApp />
148 <#if currentMinute >= 60>
149 <#assign nbOccursPriv = (currentMinute / 60 )?floor />
150 <#list 1..nbOccursPriv as i>
151 <#assign currentHour = currentHour + 1 />
152 </#list>
153 <#assign currentMinute = currentMinute % 60 />
154 </#if>
155 </#macro>
156
157 <#macro getCellTitle startingHour startingMinute endingHour endingMinute appointmentDescription>
158 <#if startingHour < 10>0</#if>${startingHour}h<#if startingMinute < 10>0</#if>${startingMinute} - <#if endingHour < 10>0</#if>${endingHour}h<#if endingMinute < 10>0</#if>${endingMinute}
159 <#if appointmentDescription != ''>
160 <br />
161 ${appointmentDescription}
162 </#if>
163 </#macro>