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

burotelhello-world-walkthroughipv6new-webexv0.97-seriesv0.98-seriesv0.98.2v0.98.3v0.98b1v0.98b2v0.99v1.0v1.1
Last change on this file since cd05ca was cd05ca, checked in by Jose Benito <jose.benito.gonzalez@…>, 3 years ago

[IMP] Booking Actions History

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