source: indico/indico/MaKaC/webinterface/tpls/RoomBookingDetails.tpl @ 443bee

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

[FTR] Add information about capacity to 'New Booking' view

  • Property mode set to 100644
File size: 29.1 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"><small> ${ _("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 reservation.isRejected:
236                                        <tr>
237                                            <td align="right" valign="top"><small> ${ _("Rejection")}&nbsp;&nbsp;</small></td>
238                                            <td align="left" class="blacktext">${ reservation.rejectionReason }</td>
239                                        </tr>
240                                        % endif
241                                        <tr>
242                                            <td align="right" valign="top"><small> ${ _("Status")}&nbsp;&nbsp;</small></td>
243                                            <td align="left" class="blacktext">${ reservation.verboseStatus }${contextHelp('statusHelp' )}</td>
244                                        </tr>
245                                    </table>
246                                </td>
247                            </tr>
248                            <!-- ACTIONS -->
249                            <tr>
250                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Actions")}</span></td>
251                                <td>
252                                    <form name="submits" action="" method="post">
253                                        &nbsp;
254                                        % if canCancel  and  not reservation.isCancelled and not reservation.isRejected:
255                                            <input type="button" class="btn" value="${ _("Cancel Booking")}" onclick="submit_cancel();return false;"/>
256                                        % endif
257                                        % if canReject  and  not reservation.isConfirmed and not reservation.isCancelled and not reservation.isRejected:
258                                            <input type="button" class="btn" value="${ _("Accept")}" onclick="submit_accept();return false;"/>
259                                        % endif
260                                        % if canReject  and not reservation.isCancelled and not reservation.isRejected:
261                                            <input type="button" class="btn" value="${ _("Reject")}" onclick="submit_reject();return false;"/>
262                                        % endif
263                                        % if reservation.canModify( user ):
264                                            <input type="button" class="btn" value="${ _("Modify")}" onclick="submit_modify();return false;"/>
265                                        % endif
266                                        % if reservation.canDelete( user ):
267                                            <input type="button" class="btn" value="${ _("Delete")}" onclick="submit_delete();return false;"/>
268                                        % endif
269                                        <input type="button" class="btn" value="Clone" onclick="submit_clone();return false;"/>
270                                    </form>
271                                </td>
272                            </tr>
273                            % if reservation.getResvHistory().hasHistory() and ( reservation.isOwnedBy( user ) or reservation.room.isOwnedBy( user ) or user.isAdmin() ) :
274                            <tr><td>&nbsp;</td></tr>
275                            <!-- BOOKING HISTORY -->
276                            <script type="text/javascript">
277                                function performSlideOnEntry(entryNum, state){
278                                    if ( state ) {
279                                         IndicoUI.Effect.slide('bookingEntryLine' + entryNum, eval('height' + entryNum));
280                                         $E('bookingEntryMoreInfo' + entryNum).set('More Info');
281                                         $E('bookingEntryMoreInfo' + entryNum).dom.className = "fakeLink bookingDisplayEntryMoreInfo";
282                                     } else {
283                                         IndicoUI.Effect.slide('bookingEntryLine' + entryNum, eval('height' + entryNum));
284                                         $E('bookingEntryMoreInfo' + entryNum).set('Hide Info');
285                                         $E('bookingEntryMoreInfo' + entryNum).dom.className = "fakeLink bookingDisplayEntryHideInfo";
286                                     }
287                                     return !state
288                                }
289                            </script>
290                            <tr>
291                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Booking History")}</span></td>
292                                <td>
293                                <% count = 0 %>
294                                % for entry in reservation.getResvHistory().getEntries() :
295                                    % if count == 1 :
296                                    <!-- Construct the divs needed by the sliding effect -->
297                                    <div id="bookingHistoryLine" style="visibility: hidden; overflow: hidden;">
298                                    <div class="bookingDisplayBookingHistoryLine">
299                                    % endif
300                                        <div class="bookingHistoryEntry">
301                                            <span class="bookingDisplayHistoryTimestamp">${ entry.getTimestamp() }</span>
302                                            <span class="bookingDisplayHistoryInfo">${ entry.getInfo()[0] } by ${ entry.getResponsibleUser() }
303                                            % if len(entry.getInfo()) > 1 :
304                                                <span class='fakeLink bookingDisplayEntryMoreInfo' id='bookingEntryMoreInfo${ count }'> More Info </span>
305                                                </span>
306                                                <div id="bookingEntryLine${ count }"  style="visibility: hidden; overflow: hidden;">
307                                                <div class="bookingDisplayEntryLine">
308                                                    <ul>
309                                                    % for elem in entry.getInfo():
310                                                        % if entry.getInfo().index(elem) != 0:
311                                                        <li>
312                                                        ${ elem }
313                                                        </li>
314                                                        % endif
315                                                    % endfor
316                                                    </ul>
317                                                </div>
318                                                </div>
319                                                <script type="text/javascript">
320                                                    $E('bookingEntryMoreInfo${ count }').dom.onmouseover = function (event) {
321                                                        IndicoUI.Widgets.Generic.tooltip($E('bookingEntryMoreInfo${ count }').dom, event, '<div class="bookingHistoryTooltip">Click here to show / hide detailed information.</div>'
322                                                            );
323                                                      }
324                                                    var showEntryMoreState${ count } = false;
325                                                    var height${ count } = IndicoUI.Effect.prepareForSlide('bookingEntryLine${ count }', true);
326                                                    $E('bookingEntryMoreInfo${ count }').observeClick(function () {
327                                                        showEntryMoreState${ count } = performSlideOnEntry(${ count }, showEntryMoreState${ count });
328                                                        });
329                                                </script>
330                                            % else :
331                                                </span>
332                                            % endif
333                                            <% count += 1 %>
334                                        </div>
335                                % endfor
336                                % if count > 1 :
337                                    </div>
338                                    </div>
339                                    <div class="bookingShowHideHistory">
340                                        <span class="fakeLink bookingDisplayShowHistory" id="bookingShowHistory">
341                                        Show All History ...
342                                        </span>
343                                    </div>
344                                    <script type="text/javascript">
345                                          $E('bookingShowHistory').dom.onmouseover = function (event) {
346                                              IndicoUI.Widgets.Generic.tooltip($E('bookingShowHistory').dom, event, '<div class="bookingHistoryTooltip">Click here to show / hide detailed information.</div>'
347                                                  );
348                                            }
349                                          var height = IndicoUI.Effect.prepareForSlide('bookingHistoryLine', true);
350                                          var showHistoryState = false;
351                                          $E('bookingShowHistory').observeClick(function() {
352                                              if (showHistoryState) {
353                                                  height = IndicoUI.Effect.prepareForSlide('bookingHistoryLine', false);
354                                                  $E('bookingShowHistory').dom.className = "fakeLink bookingDisplayShowHistory";
355                                                  IndicoUI.Effect.slide('bookingHistoryLine', height);
356                                                  $E('bookingShowHistory').set('Show All History ...');
357                                                  }
358                                              else {
359                                                  $E('bookingShowHistory').dom.className = "fakeLink bookingDisplayHideHistory";
360                                                  IndicoUI.Effect.slide('bookingHistoryLine', height);
361                                                  $E('bookingShowHistory').set('Hide All History');
362                                                  }
363                                              showHistoryState = !showHistoryState
364                                        });
365                                    </script>
366                                % endif
367                                </td>
368                            </tr>
369                            % endif
370                            % if reservation.repeatability != None  and  reservation.getExcludedDays():
371                            <tr><td>&nbsp;</td></tr>
372                            <!-- Excluded dates -->
373                            <tr>
374                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Excluded days")}</span></td>
375                                <td>
376                                    <table width="100%">
377                                        <tr>
378                                            <td class="subFieldWidth" align="right" valign="top" style="padding-right: 4px;">
379                                            <small>
380                                                 ${ _("These days are NOT booked.")}
381                                             </small>
382                                            </td>
383                                            <td align="left" class="excluded" class="blacktext">
384                                            % for day in reservation.getExcludedDays():
385                                                ${ formatDate(day) } <br />
386                                            % endfor
387                                            </td>
388                                        </tr>
389                                    </table>
390                                </td>
391                            </tr>
392                            % endif
393                            % if reservation.repeatability != None:
394                            <tr><td>&nbsp;</td></tr>
395                            <!-- Occurrences -->
396                            <tr>
397                                <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Occurrences")}</span></td>
398                                <td>
399                                    <table width="100%">
400                                        <tr>
401                                            <td class="subFieldWidth" align="right" valign="top" style="padding-right: 4px;">
402                                            <small>
403                                                 ${ _("These days are booked.")}
404                                             </small>
405                                            </td>
406                                            <td align="left" class="blacktext">
407
408                                            % for period in reservation.splitToPeriods():
409                                                ${ formatDate(period.startDT.date()) }
410                                                % if canReject:
411                                                    <a href="javascript: void( 0 )" onclick="submit_reject_occurrence( '${ urlHandlers.UHRoomBookingRejectBookingOccurrence.getURL( reservation, formatDate(period.startDT.date()) ) }');">Reject</a>
412                                                % endif
413                                                % if canCancel:
414                                                    <a href="javascript: void( 0 )" onclick="submit_cancel_occurrence('${ urlHandlers.UHRoomBookingCancelBookingOccurrence.getURL( reservation, formatDate(period.startDT.date()) ) }');">Cancel</a>
415                                                % endif
416
417                                                <br />
418                                            % endfor
419                                            </td>
420                                        </tr>
421                                    </table>
422                                </td>
423                            </tr>
424                            % endif
425                            % if (reservation.room.isOwnedBy( user ) or user.isRBAdmin()) and not reservation.isConfirmed and collisions:
426                                <tr><td>&nbsp;</td></tr>
427                                <!-- Occurrences -->
428                                <tr>
429                                    <td class="bookingDisplayTitleCell"><span class="titleCellFormat"> ${ _("Conflicts at the same time")}</span></td>
430                                    <td>
431                                        % for col in collisions:
432                                            <strong>${"PRE-" if not col.withReservation.isConfirmed else ""}Booking: </strong>${ col.withReservation.bookedForName }, ${ verbose_dt(col.withReservation.startDT) } - ${ verbose_dt(col.withReservation.endDT) }
433                                            (<a href="${ urlHandlers.UHRoomBookingBookingDetails.getURL(col.withReservation) }" target="_blank">${ _("show this booking") }</a>)<br/>
434                                        % endfor
435                                    </td>
436                                </tr>
437                            % endif
438                        </table>
439
440                        </td>
441                    </tr>
442                </table>
443            </td>
444        </tr>
445    </table>
446    <br />
Note: See TracBrowser for help on using the repository browser.