adamsorkin
Newbie
Karma: 0
Posts: 1
|
 |
« on: November 02, 2006, 11:41:58 AM » |
|
Would it be possible to modify to allow users to modify reservations in the past? We'd like be able to use this system as a usage log, as well, so users could schedule researchers as desired, but modify their reservation after they've finished to reflect actual usage time.
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5506
|
 |
« Reply #1 on: November 06, 2006, 09:54:08 AM » |
|
This would be 2 simple changes. 1) Add this code after line 474 in lib/Schedule.class.php $viewable_date = true; 2) Change line 575 of lib/Reservation.class.php to: $day_has_passed = false;
|
|
|
|
|
Logged
|
|
|
|
jenkel
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #2 on: March 06, 2008, 03:01:36 PM » |
|
Hi Nick,
How do I modify to allow user to reserve the current hour? Say currently it's 1:30 pm and user want to include 1:00 pm in their schedule.
Thanks
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5506
|
 |
« Reply #3 on: March 10, 2008, 10:05:13 AM » |
|
You would only want this if you are within the exact hour? If it's 2:00 and the reservation started at 1:30, can it be modified?
|
|
|
|
|
Logged
|
|
|
|
jenkel
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #4 on: March 10, 2008, 10:04:14 PM » |
|
No, basically I want to include the current hour in my reservation. If it's 2:00 pm, then the reservation starts at 2. If it's 2:01 to 2:59, then it should start also at 2:00. Right now, if it's 2:01, I can only start the reservation at 3:00.
Thanks
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5506
|
 |
« Reply #5 on: March 11, 2008, 09:40:26 AM » |
|
Try changing line 457 of lib/Reservation.class.php to this: ($this->start_date == $min_date && $this->start <= $min_time) )
|
|
|
|
|
Logged
|
|
|
|
jenkel
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #6 on: March 11, 2008, 11:05:05 AM » |
|
No, this change did not work.
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5506
|
 |
« Reply #7 on: March 12, 2008, 01:32:59 PM » |
|
Alright, try replacing line 453 with this code: $min_time = ((intval($min_notice % 24) + $hour + 1) * 60);
|
|
|
|
|
Logged
|
|
|
|
aliweb
Jr. Member

Karma: 0
Posts: 84
|
 |
« Reply #8 on: April 24, 2008, 10:12:47 AM » |
|
Hi, I have already modified the lib/Reservation.class.php to allow users to modify past reservations (up to -744 hours, one month), but I also want to allow users to add new reservations in the past since we are using this as an equipment charge-out system.
It seems that users can add new reservations for the current day, even though the time has passed. So, creating past reservations would work fine IF the equipment was visible for past days (it is grayed out for days earlier than today).
The code you suggested did not work for me, and when I added the following line the bookings page was no longer viewable:
Add this code after line 474 in lib/Schedule.class.php: $viewable_date = true;
Thanks, Alison
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5506
|
 |
« Reply #9 on: April 28, 2008, 10:17:00 AM » |
|
Change line 169 of lib/schedule.class.php to return true; And line 459 of lib/reservation.class.php to: $dates_valid = true;
|
|
|
|
|
Logged
|
|
|
|
aliweb
Jr. Member

Karma: 0
Posts: 84
|
 |
« Reply #10 on: May 01, 2008, 10:51:40 AM » |
|
Hi Nick,
I changed the following:
Line 575 of lib/Reservation.class.php to: $day_has_passed = false;
Line 169 of lib/schedule.class.php to: return true;
Line 459 of lib/reservation.class.php to: $dates_valid = true;
It seems to work fine, just wondering if the past reservations can be viewable in the control panel. Right now only reservations in the future show up.
Thanks! Alison
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5506
|
 |
« Reply #11 on: May 02, 2008, 10:00:55 AM » |
|
Sure, comment out line 221 of lib/DBEngine.class.php and change line 226 to
$values = array($id);
|
|
|
|
|
Logged
|
|
|
|
aliweb
Jr. Member

Karma: 0
Posts: 84
|
 |
« Reply #12 on: May 02, 2008, 10:41:37 AM » |
|
Can the past and upcoming reservations be separated in the control panel?
|
|
|
|
|
Logged
|
|
|
|
Nick
Administrator
Hero Member
   
Karma: 15
Posts: 5506
|
 |
« Reply #13 on: May 06, 2008, 09:58:46 AM » |
|
You would need to do some coding to put all past reservations into one table and current/future into another.
|
|
|
|
|
Logged
|
|
|
|
|