Index: openacs-4/contrib/packages/room-reservation/www/reservation-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/room-reservation/www/reservation-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/room-reservation/www/reservation-edit.tcl 22 Apr 2004 06:58:38 -0000 1.2 +++ openacs-4/contrib/packages/room-reservation/www/reservation-edit.tcl 13 Jan 2005 13:54:38 -0000 1.3 @@ -22,15 +22,18 @@ permission::require_permission -party_id $user_id -object_id $reservation_id -privilege "write" } -if {![string equal "pending" [room-reservation::reservations::get_status -reservation_id $reservation_id]] && ![permission::permission_p -party_id $user_id -object_id $reservation_id -privilege "admin"]} { +set room_id [room-reservation::reservations::get_room_id -reservation_id $reservation_id] +set room_full_name [room-reservation::rooms::get_full_name -room_id $room_id] + +if { \ + [room-reservation::rooms::needs_approval_p -room_id $room_id] && + ![string equal "pending" [room-reservation::reservations::get_status -reservation_id $reservation_id]] && \ + ![permission::permission_p -party_id $user_id -object_id $reservation_id -privilege "admin"]} { ad_return_complaint 1 "
  • you can only edit a pending reservation
  • " } room-reservation::get_ui_params -rooms_pretty_plural rooms_pretty_plural -set room_id [room-reservation::reservations::get_room_id -reservation_id $reservation_id] -set room_full_name [room-reservation::rooms::get_full_name -room_id $room_id] - set title "[_ room-reservation.Edit_A_Reservation]" set context [list [list "rooms" $rooms_pretty_plural] [list "room-view?room_id=$room_id" "[_ room-reservation.room_full_name_Info]"] [list "room-reservations?room_id=$room_id" "[_ room-reservation.lt_room_full_name_Reserv]"] [list "reservation-view?reservation_id=$reservation_id" "[_ room-reservation.Reservation_Info]"] $title] @@ -172,6 +175,7 @@ if { [form is_request reservation_edit] } { room-reservation::reservations::get -reservation_id $reservation_id -array reservation_info + set start_time_date [calendar::from_sql_datetime -sql_date $reservation_info(start_time) -format {HH12:MIam}] set end_time_date [calendar::from_sql_datetime -sql_date $reservation_info(end_time) -format {HH12:MIam}]