Index: openacs-4/contrib/packages/room-reservation/room-reservation.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/room-reservation.info,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/room-reservation/room-reservation.info 13 Jan 2005 13:54:38 -0000 1.2 +++ openacs-4/contrib/packages/room-reservation/room-reservation.info 18 Oct 2005 23:32:34 -0000 1.3 @@ -6,14 +6,16 @@ Room Reservations f f - + + Deds Castillo Room Reservation - 2004-12-03 + 2005-10-18 Infiniteinfo Room reservations is a package which manages reservations of multiple rooms. + 0 - + @@ -22,108 +24,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - Index: openacs-4/contrib/packages/room-reservation/catalog/room-reservation.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/catalog/room-reservation.en_US.ISO-8859-1.xml,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/room-reservation/catalog/room-reservation.en_US.ISO-8859-1.xml 13 Jan 2005 13:54:38 -0000 1.2 +++ openacs-4/contrib/packages/room-reservation/catalog/room-reservation.en_US.ISO-8859-1.xml 18 Oct 2005 23:32:34 -0000 1.3 @@ -1,9 +1,9 @@ - + Action - Administer Additional information + Administer Administrative details Approve Back @@ -93,6 +93,7 @@ The reservation you are trying to make conflicts with reservation(s):<br> This [room-reservation::get_facilities_pretty_name] cannot be deleted due to the following reason: This [room-reservation::get_rooms_pretty_name] cannot be deleted due to the following reason: + View all Reservations View Reservation History View %rooms_pretty_plural% Name Index: openacs-4/contrib/packages/room-reservation/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/tcl/calendar-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/room-reservation/tcl/calendar-procs.tcl 13 Jan 2005 13:54:38 -0000 1.2 +++ openacs-4/contrib/packages/room-reservation/tcl/calendar-procs.tcl 18 Oct 2005 23:32:34 -0000 1.3 @@ -9,7 +9,7 @@ namespace eval room-reservation::calendar { ad_proc -public one_day_display { - {-room_id:required} + {-room_id} {-date ""} {-hour_template {$hour}} {-item_template {$item}} @@ -61,7 +61,7 @@ } ad_proc -public list_display { - {-room_id:required} + {-room_id} {-date ""} {-start_date ""} {-end_date ""} @@ -90,7 +90,7 @@ } ad_proc -public one_week_display { - {-room_id:required} + {-room_id} {-date ""} {-day_template "\$day   -   \$pretty_date"} {-item_template "\$item"} @@ -206,7 +206,7 @@ } ad_proc -public one_month_display { - {-room_id:required} + {-room_id} {-day_template "\$day_number"} {-item_template "\$item"} {-item_add_template ""} @@ -219,11 +219,22 @@ if {[empty_string_p $date]} { set date [dt_systime] } + + if {[info exists room_id]} { + set where_clause "and r.room_id = :room_id" + } else { + set where_clause "" + } set items [ns_set create] db_foreach select_monthly_reservations {} { - set item "$name (status: $status)" + if {[info exists room_id]} { + set item "$name (status: $status)" + } else { + set item "$room_name: $name (status: $status)" + } + set item "[subst $item_template]" if {![dt_no_time_p -start_time $start_time -end_time $end_time]} { Index: openacs-4/contrib/packages/room-reservation/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/room-reservation/www/index-postgresql.xql 18 Oct 2005 23:32:35 -0000 1.1 @@ -0,0 +1,50 @@ + + + + + + + + + + + + postgresql + 7.2 + + + + + + + select r.reservation_id, + f.name as facility_name, + fr.name as room_name, + r.status, + to_char(start_date, 'Mon DD, YYYY HH12:MI AM') as full_start_date, + to_char(end_date, 'Mon DD, YYYY HH12:MI AM') as full_end_date, + e.name, + start_date, + p.first_names||' '||p.last_name as username + from acs_events e join timespans s + on (e.timespan_id = s.timespan_id) + inner join time_intervals t + on (s.interval_id = t.interval_id) + inner join rr_reservations r + on (e.event_id = r.reservation_id) + inner join rr_rooms fr + on (r.room_id = fr.room_id) + inner join rr_facilities f + on (f.facility_id = fr.facility_id) + inner join persons p + on (r.reserving_user = p.person_id) + WHERE 1=1 + $where_clause + [template::list::filter_where_clauses -and -name room_reservations] + [template::list::orderby_clause -orderby -name room_reservations] + + + + + Index: openacs-4/contrib/packages/room-reservation/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/room-reservation/www/index.adp 22 Apr 2004 06:58:38 -0000 1.2 +++ openacs-4/contrib/packages/room-reservation/www/index.adp 18 Oct 2005 23:32:35 -0000 1.3 @@ -1,40 +1,10 @@ @title@ - - -

-#room-reservation.Your_reservations# +#room-reservation.Your_reservations#

-#room-reservation.Show# @filter_list:item@@filter_list:item@ | #room-reservation.reservations# -

- - - - - - - - - - - - - - - - - - - -
#room-reservation.lt_facilities_pretty_nam##room-reservation.lt_rooms_pretty_name_Nam##room-reservation.Event##room-reservation.Date_Reserved##room-reservation.Status##room-reservation.Action#
@personal_reservations.facility_name@@personal_reservations.room_name@@personal_reservations.name@#room-reservation.lt_personal_reservations#
@personal_reservations.full_end_date@
@personal_reservations.status@[ #room-reservation.View_Details# | #room-reservation.Edit# | #room-reservation.Cancel# ]
+ + +

Index: openacs-4/contrib/packages/room-reservation/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/room-reservation/www/index.tcl 1 Mar 2005 00:01:21 -0000 1.3 +++ openacs-4/contrib/packages/room-reservation/www/index.tcl 18 Oct 2005 23:32:35 -0000 1.4 @@ -10,6 +10,8 @@ } { {filter_on ""} + {orderby ""} + {status:optional} } -properties { title:onevalue context:onevalue @@ -21,38 +23,59 @@ set admin_p [ad_permission_p $package_id admin] -room-reservation::get_ui_params -facilities_pretty_name facilities_pretty_name -rooms_pretty_name rooms_pretty_name -rooms_pretty_plural rooms_pretty_plural - set title "[_ room-reservation.Room_Reservation]" -switch -exact -- $filter_on { - {canceled} { - set status "canceled" +set where_clause "and reserving_user = :user_id" + +set actions { + "View all Reservations" "room-reservations-all" "" + "Reserve / View Rooms" "rooms" "" +} + +if {$admin_p} { + append actions { + "Administer" "admin" "" } - {pending} { - set status "pending" - } - {approved} { - set status "approved" - } - {rejected} { - set status "rejected" - } - default { - set status "" - set filter_on "all" - } } -set filter_list [list all pending approved rejected canceled] +template::list::create \ + -name room_reservations \ + -multirow room_reservations \ + -key reservation_id \ + -actions $actions \ + -elements { + name { + label "Name" + display_template { + @name@ + } + } + room_name { + label "Room Name" + } + facility_name { + label "Facility Name" + } + full_end_date { + label "Date Reserved" + } + status { + label "Status" + } + } \ + -filters { + status { + label "Status" + values {{Pending pending} {Approved approved} {Rejected rejected} {Canceled canceled}} + where_clause { + status = :status + } + } + } \ + +db_multirow -extend {} room_reservations get_reservations { +} { + +} -set reservations [room-reservation::rooms::get_reservations_list_of_ns_sets \ - -reserving_user $user_id \ - -status_list [list $status] \ - -package_id $package_id \ - ] -template::util::list_of_ns_sets_to_multirow -rows $reservations -var_name personal_reservations - - -ad_return_template Index: openacs-4/contrib/packages/room-reservation/www/reservation-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/reservation-view.adp,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/room-reservation/www/reservation-view.adp 13 Jan 2005 13:54:38 -0000 1.3 +++ openacs-4/contrib/packages/room-reservation/www/reservation-view.adp 18 Oct 2005 23:32:35 -0000 1.4 @@ -5,74 +5,74 @@

- + - + - + - - + + - + - + - + - + - + - + - + - + - + Index: openacs-4/contrib/packages/room-reservation/www/room-reservations-all.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/room-reservations-all.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/room-reservation/www/room-reservations-all.adp 18 Oct 2005 23:32:35 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context@ + +
#room-reservation.lt_facilities_pretty_nam_1##room-reservation.lt_facilities_pretty_nam_1# @reservation_info.facility_name@
#room-reservation.lt_rooms_pretty_name_Nam_1##room-reservation.lt_rooms_pretty_name_Nam_1# @reservation_info.room_name@
#room-reservation.Event_1##room-reservation.Event_1# @reservation_info.name@
#room-reservation.lt_Reservation_Date_and_##room-reservation.lt_reservation_infofull_#
@reservation_info.full_end_date@
#room-reservation.lt_Reservation_Date_and_##room-reservation.lt_reservation_infofull_# @reservation_info.full_end_date@
#room-reservation.Reserved_by_1##room-reservation.Reserved_by_1# @reservation_info.username@
#room-reservation.lt_Estimated_No_of_Atten##room-reservation.lt_Estimated_No_of_Atten# @reservation_info.attendees@
#room-reservation.lt_Added_Instructions__E##room-reservation.lt_Added_Instructions__E# @reservation_info.note@
#room-reservation.Contact_Person##room-reservation.Contact_Person# @reservation_info.contact_person@
#room-reservation.Contact_Email##room-reservation.Contact_Email# @reservation_info.contact_email@
#room-reservation.Contact_Phone##room-reservation.Contact_Phone# @reservation_info.contact_phone@
#room-reservation.Status_1##room-reservation.Status_1# @reservation_info.status@
#room-reservation.lt_Administrators_reason##room-reservation.lt_Administrators_reason# @reservation_info.reason@
#room-reservation.lt_Date_when_reservation##room-reservation.lt_Date_when_reservation# @reservation_info.full_action_date@
+ + + + +
@calendar_navigation;noquote@@content;noquote@
Index: openacs-4/contrib/packages/room-reservation/www/room-reservations-all.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/room-reservations-all.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/room-reservation/www/room-reservations-all.tcl 18 Oct 2005 23:32:35 -0000 1.1 @@ -0,0 +1,70 @@ +# /packages/room-reservation/www/room-reservations.tcl + +ad_page_contract { + + Shows reservations of a Room + + @author Deds Castillo (deds@infiniteinfo.com) + @creation-date 2002-08-28 + @cvs-id $Id: room-reservations-all.tcl,v 1.1 2005/10/18 23:32:35 alexk Exp $ + +} { + {view "month"} + {date ""} + {julian_date ""} +} -properties { + title:onevalue + context:onevalue +} + +set user_id [auth::require_login] + +set date [calendar::adjust_date -date $date -julian_date $julian_date] + +room-reservation::get_ui_params -rooms_pretty_name rooms_pretty_name -rooms_pretty_plural rooms_pretty_plural + +set title "All Reservations" + +set context [list $title] + +set item_template "\$item" +set day_template "\$day - \$pretty_date" +set item_add_template "" + +switch -exact -- $view { + {week} { + set content [room-reservation::calendar::one_week_display \ + -date $date \ + -prev_nav_template "<" \ + -next_nav_template ">" \ + -item_template $item_template \ + -day_template $day_template \ + ] + } + {month} { + set content [room-reservation::calendar::one_month_display \ + -date $date \ + -prev_nav_template "<" \ + -next_nav_template ">" \ + -item_template "$item_template" \ + -day_template "\$day_number" \ + -item_add_template "$item_add_template" \ + ] + } + {day} { + set content [room-reservation::calendar::one_day_display \ + -date $date \ + -prev_nav_template "<" \ + -next_nav_template ">" \ + -item_template $item_template \ + ] + } + {list} { + set content [room-reservation::calendar::list_display \ + -date $date \ + -item_template $item_template \ + ] + } +} + +set calendar_navigation [dt_widget_calendar_navigation "room-reservations-all" $view $date ""] Index: openacs-4/contrib/packages/room-reservation/www/admin/room-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/admin/room-new.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/room-reservation/www/admin/room-new.tcl 22 Apr 2004 06:58:38 -0000 1.2 +++ openacs-4/contrib/packages/room-reservation/www/admin/room-new.tcl 18 Oct 2005 23:32:35 -0000 1.3 @@ -78,6 +78,8 @@ if {[room-reservation::rooms::name_exists -name $name -facility_id $facility_id]} { element set_error room name "[_ room-reservation.lt_the_name_you_provided]" + } elseif {$capacity == ""} { + } else { set room_id [room-reservation::rooms::new -room_id $room_id \ -name $name \ Index: openacs-4/contrib/packages/room-reservation/www/moderate/reservation-approve.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/moderate/reservation-approve.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/room-reservation/www/moderate/reservation-approve.tcl 18 Oct 2005 23:32:35 -0000 1.1 @@ -0,0 +1,24 @@ +# /packages/room-reservation/www/reservation-cancel.tcl + +ad_page_contract { + + Room Reservation + + @author Deds Castillo (deds@infiniteinfo.com) + @creation-date 2002-08-28 + @cvs-id $Id: reservation-approve.tcl,v 1.1 2005/10/18 23:32:35 alexk Exp $ + +} { + reservation_id:integer,notnull +} + +set user_id [auth::require_login] + +# Check if user has permission to cancel this room +if {![room-reservation::reservations::owner_p -reservation_id $reservation_id -user_id $user_id]} { + permission::require_permission -party_id $user_id -object_id $reservation_id -privilege "write" +} + +room-reservation::reservations::approve -reservation_id $reservation_id + +ad_returnredirect -message "You have approved this reservation" "../reservation-view?[export_url_vars reservation_id]" Index: openacs-4/contrib/packages/room-reservation/www/moderate/reservation-reject.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/moderate/reservation-reject.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/room-reservation/www/moderate/reservation-reject.tcl 18 Oct 2005 23:32:35 -0000 1.1 @@ -0,0 +1,23 @@ +# /packages/room-reservation/www/reservation-cancel.tcl + +ad_page_contract { + + Room Reservation + + @author Deds Castillo (deds@infiniteinfo.com) + @creation-date 2002-08-28 + @cvs-id $Id: reservation-reject.tcl,v 1.1 2005/10/18 23:32:35 alexk Exp $ + +} { + reservation_id:integer,notnull +} + +set user_id [auth::require_login] + +# Check if user has permission to cancel this room +if {![room-reservation::reservations::owner_p -reservation_id $reservation_id -user_id $user_id]} { + permission::require_permission -party_id $user_id -object_id $reservation_id -privilege "write" +} + +room-reservation::reservations::reject -reservation_id $reservation_id +ad_returnredirect -message "You have rejected this reservation" "../reservation-view?[export_url_vars reservation_id]"