source: indico/indico/MaKaC/webinterface/tpls/RoomBookingDetails.tpl @ c8a3a93

hello-world-walkthroughipv6v0.98-seriesv0.98.2v0.98.3v0.99v1.0v1.1
Last change on this file since c8a3a93 was c8a3a93, checked in by Jose Benito <jose.benito.gonzalez@…>, 14 months ago

[FIX] Needs assistance modification - Notif

  • Property mode set to 100644
File size: 29.7 KB
Line 
1    <script type="text/javascript">
2        function submit_cancel()
3        {
4            if ( !confirm(  "${ _('Are you sure you want to CANCEL your booking?')}" ) )
5                return;
6            var frm = document.forms['submits'];
7            frm.action = '${ urlHandlers.UHRoomBookingCancelBooking.getURL( reservation ) }';
8            frm.submit();
9        }
10        function submit_accept()
11        {
12            if ( !confirm(  "${ _('Are you sure you want to ACCEPT this booking?')}" ) )
13                return;
14            var frm = document.forms['submits'];
15            frm.action = '${ urlHandlers.UHRoomBookingAcceptBooking.getURL( reservation ) }';
16            frm.submit();
17        }
18        function submit_reject()
19        {
20            reason = prompt(  "${ _('Are you sure you want to REJECT THE _WHOLE_ BOOKING? If so, please give a reason:')}", '' );
21            if ( reason == null )
22                return;
23            var frm = document.forms['submits'];
24            frm.action = '${ urlHandlers.UHRoomBookingRejectBooking.getURL( reservation ) }' + '&reason=' + encodeURI( reason );
25            frm.submit();
26        }
27        function submit_reject_occurrence( action )
28        {
29            reason = prompt(  "${ _('Are you sure you want to REJECT the booking for the selected date? If so, please give a reason:')}", '' );
30            if ( reason == null )
31                return;
32            var frm = document.forms['submits'];
33            frm.action = action + '&reason=' + encodeURI( reason );
34            frm.submit();
35        }
36        function submit_cancel_occurrence( action )
37        {
38            if (confirm("${ _('Are you sure you want to cancel the selected date from the booking?')}")) {
39              var frm = document.forms['submits'];
40              frm.action = action;
41              frm.submit();
42            }
43        }
44        function submit_modify()
45        {
46            var frm = document.forms['submits'];
47            frm.action = '${ modifyBookingUH.getURL( reservation ) }';
48            frm.submit();
49        }
50        function submit_delete()
51        {
52            if ( !confirm( "${ _('THIS ACTION IS IRREVERSIBLE. Are you sure you want to DELETE the booking?')}" ) )
53                return;
54            var frm = document.forms['submits'];
55            frm.action = '${ urlHandlers.UHRoomBookingDeleteBooking.getURL( reservation ) }';
56            frm.submit();
57        }
58        function submit_clone()
59        {
60            var frm = document.forms['submits'];
61            frm.action = '${ cloneURL }';
62            frm.submit();
63        }
64    </script>
65
66    <!-- CONTEXT HELP DIVS -->
67    <div id="tooltipPool" style="display: none">
68
69        <!-- Status -->
70        <div id="statusHelp" class="tip">
71             ${ _("Validity")}:<br />
72            <ul>
73                <li class="tip-no-borders"> ${ _("<b>Not confirmed</b> - the pre-booking is not confirmed (yet) by person responsible.")}</li>
74                <li class="tip-no-borders"> ${ _("<b>Cancelled</b> - the booking was cancelled by the requestor himself.")}</li>
75                <li class="tip-no-borders"> ${ _("<b>Rejected</b> - the booking was rejected by the person responsible for a room.")}</li>
76                <li class="tip-no-borders"> ${ _("<b>Valid</b> - the booking is confirmed and not cancelled. Note that for most rooms bookings are automatically confirmed.")}</li>
77            </ul>
78             ${ _("Time")}:<br />
79            <ul>
80                <li class="tip-no-borders"> ${ _("<b>Live</b> - the booking will take place in the future.")} </li>
81                <li class="tip-no-borders"> ${ _("<b>Archival</b> - the booking already past. It will never repeat in the future.")}</li>
82            </ul>
83        </div>
84        <img style="border-style: solid; border-width: thick; border-color: #101010;" />
85        <!-- Repetition type -->
86        <div id="repetitionTypeHelp" class="tip">
87             ${ _("Repetition type - this indicates how a booking repeats itself.")}
88        </div>
89        <!-- Where is key? -->
90        <div id="whereIsKeyHelp" class="tip">
91             ${ _("How to obtain a key? Often just a phone number.")}
92        </div>
93        <!-- Created -->
94        <div id="createdHelp" class="tip">
95             ${ _("When the booking was made?")}
96        </div>
97        <!-- Created -->
98        <div id="iWillUseVideoConferencing" class="tip">
99             ${ _("Is user going to use video-conferencing equipment?")}<br />
100        </div>
101        <div id="iNeedAVCSupport" class="tip">
102             ${ _("Has user requested support for video-conferencing equipment?")}<br />
103        </div>
104
105    </div>
106
107    <% canReject = reservation.canReject( user ) %>
108    <% canCancel = reservation.canCancel( user ) %>
109
110    <!-- END OF CONTEXT HELP DIVS -->
111
112    <table cellpadding="0" cellspacing="0" border="0" width="100%">
113        % if standalone:
114            <tr>
115            <td class="intermediateleftvtab" style="border-left: 2px solid #777777; border-right: 2px solid #777777; font-size: xx-small;" width="100%">&nbsp;</td> <!-- lastvtabtitle -->
116            </tr>
117        % endif
118        <tr>
119            <td class="bottomvtab" width="100%">
120                <table width="100%" cellpadding="0" cellspacing="0" class="htab" border="0">
121                    <tr>
122                        <td class="maincell">
123                            <span class="formTitle" style="border-bottom-width: 0px">${bookMessage}ing</span><br /> <!-- PRE-Booking or Booking -->
124                            % if actionSucceeded:
125                                <br />
126                                <span class="actionSucceeded">${ title }</span>
127                                <p style="margin-left: 6px;">${ description }</p>
128                                <br />
129                            % endif
130                            <br />
131                            <table width="90%" align="left" border="0">
132                              <!-- ROOM -->
133                              <tr>
134                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Room")}</span></td>
135                                <td>
136                                    <table width="100%">
137                                        <tr>
138                                            <td class="subFieldWidth" align="right" valign="top"><small> ${ _("Name")}&nbsp;&nbsp;</small></td>
139                                            <td align="left" class="blacktext"><a href="${ roomDetailsUH.getURL( reservation.room ) }">${ reservation.room.name }</a></td>
140                                        </tr>
141                                        % if reservation.room.photoId != None:
142                                        <tr>
143                                            <td align="right" valign="top"><small> ${ _("Interior")}&nbsp;&nbsp;</small></td>
144                                            <td align="left" class="thumbnail"><a href="${ reservation.room.getPhotoURL() }" rel="lightbox" title="${ reservation.room.photoId }"><img border="1px" src="${ reservation.room.getSmallPhotoURL() }"/></a></td>
145                                        </tr>
146                                        % endif
147                                        <tr>
148                                            <td align="right" valign="top"><small> ${ _("Capacity")}&nbsp;&nbsp;</small></td>
149                                            <td align="left" class="blacktext">${ reservation.room.capacity }&nbsp;${_("people")}</td>
150                                        </tr>
151                                        <tr>
152                                            <td align="right" valign="top"><small> ${ _("Room key")}&nbsp;&nbsp;</small></td>
153                                            <td align="left" class="blacktext">${ reservation.room.whereIsKey }${contextHelp('whereIsKeyHelp' )}</td>
154                                        </tr>
155                                    </table>
156                                </td>
157                              </tr>
158                              <tr><td>&nbsp;</td></tr>
159                              <!-- WHEN -->
160                              <tr>
161                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("When")}</span></td>
162                                <td>
163                                    <table width="100%">
164                                        <tr>
165                                            <td class="subFieldWidth" align="right" valign="top"><small>${ _("Dates")}&nbsp;&nbsp;</small></td>
166                                            <td align="left" class="blacktext">${ formatDate(reservation.startDT.date()) } &mdash; ${ formatDate(reservation.endDT.date()) }</td>
167                                        </tr>
168                                        <tr>
169                                            <td align="right" valign="top"><small> ${ _("Hours")}&nbsp;&nbsp;</small></td>
170
171                                            <td align="left" class="blacktext">${ verbose_t( reservation.startDT.time() ) } &mdash; ${ verbose_t( reservation.endDT.time() ) }</td>
172                                        </tr>
173                                        <tr>
174                                            <td align="right" valign="top"><small> ${ _("Type")}&nbsp;&nbsp;</small></td>
175                                            <td align="left" class="blacktext">${ reservation.verboseRepetition }${contextHelp('repetitionTypeHelp' )}</td>
176                                        </tr>
177                                    </table>
178                                </td>
179                            </tr>
180                            <tr><td>&nbsp;</td></tr>
181                            <!-- BOOKED FOR -->
182                            <tr>
183                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Booked for")}</span></td>
184                                <td>
185                                    <table width="100%">
186                                        <tr>
187                                            <td class="subFieldWidth" align="right" valign="top"><small> ${ _("Name")}&nbsp;&nbsp;</small></td>
188                                            <td align="left" class="blacktext">${ verbose( reservation.bookedForName ) }</td>
189                                        </tr>
190                                        <tr>
191                                            <td align="right" valign="top"><small> ${ _("E-mail")}&nbsp;&nbsp;</small></td>
192                                            <td align="left" class="blacktext"><a style="font-weight: normal" href="mailto:${ verbose( reservation.contactEmail ) }">${ reservation.contactEmail.replace(',',', ') }</a></td>
193                                        </tr>
194                                        <tr>
195                                            <td class="subFieldWidth" align="right" valign="top"><small> ${ _("Telephone")}&nbsp;&nbsp;</small></td>
196                                            <td align="left" class="blacktext">${ verbose( reservation.contactPhone ) }</td>
197                                        </tr>
198                                    </table>
199                                </td>
200                            </tr>
201                            <tr><td>&nbsp;</td></tr>
202                            <!-- CREATED -->
203                            <tr>
204                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Created")}</span></td>
205                                <td>
206                                    <table width="100%">
207                                        <tr>
208                                            <td class="subFieldWidth" align="right" valign="top"><small> ${ _("By")}&nbsp;&nbsp;</small></td>
209                                            <td align="left" class="blacktext">${ reservation.verboseCreatedBy }</td>
210                                        </tr>
211                                        <tr>
212                                            <td align="right" valign="top"><small> ${ _("Date")}&nbsp;&nbsp;</small></td>
213                                            <td align="left" class="blacktext">${ verbose_dt( reservation.createdDT ) } ${contextHelp('createdHelp' )}</td>
214                                        </tr>
215                                        <tr>
216                                            <td align="right" valign="top"><small> ${ _("Reason")}&nbsp;&nbsp;</small></td>
217                                            <td align="left" class="blacktext">${ reservation.reason }</td>
218                                        </tr>
219                                        % if reservation.room.needsAVCSetup:
220                                        <tr>
221                                            <td align="right" valign="top"><small> ${ _("Video-conf.")}&nbsp;&nbsp;</small></td>
222                                            <td align="left" class="blacktext">
223                                                ${ verbose( reservation.usesAVC, "no" ) } <small><font color="grey">(${ ", ".join(reservation.getUseVC()) })</font></small>
224                                                ${contextHelp('iWillUseVideoConferencing' )}
225                                            </td>
226                                        </tr>
227                                        <tr>
228                                            <td align="right" valign="top" nowrap><small> ${ _("Video-conf Assistance")}&nbsp;&nbsp;</small></td>
229                                            <td align="left" class="blacktext">
230                                                ${ verbose( reservation.needsAVCSupport, "no" ) }
231                                                ${contextHelp('iNeedAVCSupport' )}
232                                            </td>
233                                        </tr>
234                                        % endif
235                                        % if rh._isAssistenceEmailSetup and reservation.room.resvNotificationAssistance:
236                                        <tr>
237                                            <td align="right" valign="top" nowrap><small> ${ _("Startup Assistance")}&nbsp;&nbsp;</small></td>
238                                            <td align="left" class="blacktext">
239                                                ${ verbose( reservation.needsAssistance, "no" ) }
240                                            </td>
241                                        </tr>
242                                        % endif
243                                        % if reservation.isRejected:
244                                        <tr>
245                                            <td align="right" valign="top"><small> ${ _("Rejection")}&nbsp;&nbsp;</small></td>
246                                            <td align="left" class="blacktext">${ reservation.rejectionReason }</td>
247                                        </tr>
248                                        % endif
249                                        <tr>
250                                            <td align="right" valign="top"><small> ${ _("Status")}&nbsp;&nbsp;</small></td>
251                                            <td align="left" class="blacktext">${ reservation.verboseStatus }${contextHelp('statusHelp' )}</td>
252                                        </tr>
253                                    </table>
254                                </td>
255                            </tr>
256                            <!-- ACTIONS -->
257                            <tr>
258                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Actions")}</span></td>
259                                <td>
260                                    <form name="submits" action="" method="post">
261                                        &nbsp;
262                                        % if canCancel  and  not reservation.isCancelled and not reservation.isRejected:
263                                            <input type="button" class="btn" value="${ _("Cancel Booking")}" onclick="submit_cancel();return false;"/>
264                                        % endif
265                                        % if canReject  and  not reservation.isConfirmed and not reservation.isCancelled and not reservation.isRejected:
266                                            <input type="button" class="btn" value="${ _("Accept")}" onclick="submit_accept();return false;"/>
267                                        % endif
268                                        % if canReject  and not reservation.isCancelled and not reservation.isRejected:
269                                            <input type="button" class="btn" value="${ _("Reject")}" onclick="submit_reject();return false;"/>
270                                        % endif
271                                        % if reservation.canModify( user ):
272                                            <input type="button" class="btn" value="${ _("Modify")}" onclick="submit_modify();return false;"/>
273                                        % endif
274                                        % if reservation.canDelete( user ):
275                                            <input type="button" class="btn" value="${ _("Delete")}" onclick="submit_delete();return false;"/>
276                                        % endif
277                                        <input type="button" class="btn" value="Clone" onclick="submit_clone();return false;"/>
278                                    </form>
279                                </td>
280                            </tr>
281                            % if reservation.getResvHistory().hasHistory() and ( reservation.isOwnedBy( user ) or reservation.room.isOwnedBy( user ) or user.isAdmin() ) :
282                            <tr><td>&nbsp;</td></tr>
283                            <!-- BOOKING HISTORY -->
284                            <script type="text/javascript">
285                                function performSlideOnEntry(entryNum, state){
286                                    if ( state ) {
287                                         IndicoUI.Effect.slide('bookingEntryLine' + entryNum, eval('height' + entryNum));
288                                         $E('bookingEntryMoreInfo' + entryNum).set('More Info');
289                                         $E('bookingEntryMoreInfo' + entryNum).dom.className = "fakeLink bookingDisplayEntryMoreInfo";
290                                     } else {
291                                         IndicoUI.Effect.slide('bookingEntryLine' + entryNum, eval('height' + entryNum));
292                                         $E('bookingEntryMoreInfo' + entryNum).set('Hide Info');
293                                         $E('bookingEntryMoreInfo' + entryNum).dom.className = "fakeLink bookingDisplayEntryHideInfo";
294                                     }
295                                     return !state
296                                }
297                            </script>
298                            <tr>
299                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Booking History")}</span></td>
300                                <td>
301                                <% count = 0 %>
302                                % for entry in reservation.getResvHistory().getEntries() :
303                                    % if count == 1 :
304                                    <!-- Construct the divs needed by the sliding effect -->
305                                    <div id="bookingHistoryLine" style="visibility: hidden; overflow: hidden;">
306                                    <div class="bookingDisplayBookingHistoryLine">
307                                    % endif
308                                        <div class="bookingHistoryEntry">
309                                            <span class="bookingDisplayHistoryTimestamp">${ entry.getTimestamp() }</span>
310                                            <span class="bookingDisplayHistoryInfo">${ entry.getInfo()[0] } by ${ entry.getResponsibleUser() }
311                                            % if len(entry.getInfo()) > 1 :
312                                                <span class='fakeLink bookingDisplayEntryMoreInfo' id='bookingEntryMoreInfo${ count }'> More Info </span>
313                                                </span>
314                                                <div id="bookingEntryLine${ count }"  style="visibility: hidden; overflow: hidden;">
315                                                <div class="bookingDisplayEntryLine">
316                                                    <ul>
317                                                    % for elem in entry.getInfo():
318                                                        % if entry.getInfo().index(elem) != 0:
319                                                        <li>
320                                                        ${ elem }
321                                                        </li>
322                                                        % endif
323                                                    % endfor
324                                                    </ul>
325                                                </div>
326                                                </div>
327                                                <script type="text/javascript">
328                                                    $E('bookingEntryMoreInfo${ count }').dom.onmouseover = function (event) {
329                                                        IndicoUI.Widgets.Generic.tooltip($E('bookingEntryMoreInfo${ count }').dom, event, '<div class="bookingHistoryTooltip">Click here to show / hide detailed information.</div>'
330                                                            );
331                                                      }
332                                                    var showEntryMoreState${ count } = false;
333                                                    var height${ count } = IndicoUI.Effect.prepareForSlide('bookingEntryLine${ count }', true);
334                                                    $E('bookingEntryMoreInfo${ count }').observeClick(function () {
335                                                        showEntryMoreState${ count } = performSlideOnEntry(${ count }, showEntryMoreState${ count });
336                                                        });
337                                                </script>
338                                            % else :
339                                                </span>
340                                            % endif
341                                            <% count += 1 %>
342                                        </div>
343                                % endfor
344                                % if count > 1 :
345                                    </div>
346                                    </div>
347                                    <div class="bookingShowHideHistory">
348                                        <span class="fakeLink bookingDisplayShowHistory" id="bookingShowHistory">
349                                        Show All History ...
350                                        </span>
351                                    </div>
352                                    <script type="text/javascript">
353                                          $E('bookingShowHistory').dom.onmouseover = function (event) {
354                                              IndicoUI.Widgets.Generic.tooltip($E('bookingShowHistory').dom, event, '<div class="bookingHistoryTooltip">Click here to show / hide detailed information.</div>'
355                                                  );
356                                            }
357                                          var height = IndicoUI.Effect.prepareForSlide('bookingHistoryLine', true);
358                                          var showHistoryState = false;
359                                          $E('bookingShowHistory').observeClick(function() {
360                                              if (showHistoryState) {
361                                                  height = IndicoUI.Effect.prepareForSlide('bookingHistoryLine', false);
362                                                  $E('bookingShowHistory').dom.className = "fakeLink bookingDisplayShowHistory";
363                                                  IndicoUI.Effect.slide('bookingHistoryLine', height);
364                                                  $E('bookingShowHistory').set('Show All History ...');
365                                                  }
366                                              else {
367                                                  $E('bookingShowHistory').dom.className = "fakeLink bookingDisplayHideHistory";
368                                                  IndicoUI.Effect.slide('bookingHistoryLine', height);
369                                                  $E('bookingShowHistory').set('Hide All History');
370                                                  }
371                                              showHistoryState = !showHistoryState
372                                        });
373                                    </script>
374                                % endif
375                                </td>
376                            </tr>
377                            % endif
378                            % if reservation.repeatability != None  and  reservation.getExcludedDays():
379                            <tr><td>&nbsp;</td></tr>
380                            <!-- Excluded dates -->
381                            <tr>
382                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Excluded days")}</span></td>
383                                <td>
384                                    <table width="100%">
385                                        <tr>
386                                            <td class="subFieldWidth" align="right" valign="top" style="padding-right: 4px;">
387                                            <small>
388                                                 ${ _("These days are NOT booked.")}
389                                             </small>
390                                            </td>
391                                            <td align="left" class="excluded" class="blacktext">
392                                            % for day in reservation.getExcludedDays():
393                                                ${ formatDate(day) } <br />
394                                            % endfor
395                                            </td>
396                                        </tr>
397                                    </table>
398                                </td>
399                            </tr>
400                            % endif
401                            % if reservation.repeatability != None:
402                            <tr><td>&nbsp;</td></tr>
403                            <!-- Occurrences -->
404                            <tr>
405                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Occurrences")}</span></td>
406                                <td>
407                                    <table width="100%">
408                                        <tr>
409                                            <td class="subFieldWidth" align="right" valign="top" style="padding-right: 4px;">
410                                            <small>
411                                                 ${ _("These days are booked.")}
412                                             </small>
413                                            </td>
414                                            <td align="left" class="blacktext">
415
416                                            % for period in reservation.splitToPeriods():
417                                                ${ formatDate(period.startDT.date()) }
418                                                % if canReject:
419                                                    <a href="javascript: void( 0 )" onclick="submit_reject_occurrence( '${ urlHandlers.UHRoomBookingRejectBookingOccurrence.getURL( reservation, formatDate(period.startDT.date()) ) }');">Reject</a>
420                                                % endif
421                                                % if canCancel:
422                                                    <a href="javascript: void( 0 )" onclick="submit_cancel_occurrence('${ urlHandlers.UHRoomBookingCancelBookingOccurrence.getURL( reservation, formatDate(period.startDT.date()) ) }');">Cancel</a>
423                                                % endif
424
425                                                <br />
426                                            % endfor
427                                            </td>
428                                        </tr>
429                                    </table>
430                                </td>
431                            </tr>
432                            % endif
433                            % if (reservation.room.isOwnedBy( user ) or user.isRBAdmin()) and not reservation.isConfirmed and collisions:
434                                <tr><td>&nbsp;</td></tr>
435                                <!-- Occurrences -->
436                                <tr>
437                                    <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Conflicts at the same time")}</span></td>
438                                    <td>
439                                        % for col in collisions:
440                                            <strong>${"PRE-" if not col.withReservation.isConfirmed else ""}Booking: </strong>${ col.withReservation.bookedForName }, ${ verbose_dt(col.withReservation.startDT) } - ${ verbose_dt(col.withReservation.endDT) }
441                                            (<a href="${ urlHandlers.UHRoomBookingBookingDetails.getURL(col.withReservation) }" target="_blank">${ _("show this booking") }</a>)<br/>
442                                        % endfor
443                                    </td>
444                                </tr>
445                            % endif
446                        </table>
447
448                        </td>
449                    </tr>
450                </table>
451            </td>
452        </tr>
453    </table>
454    <br />
Note: See TracBrowser for help on using the repository browser.