phpScheduleIt
May 18, 2013, 06:20:29 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Maximum Booking Notice ignored in repeating events  (Read 2149 times)
samato
Guest
« on: September 21, 2008, 02:13:26 PM »

I'm trying to limit repeat bookings, and have a Maximum Booking Notice set to 168 hours.  This does successfully remove the option to click on dates more than a week ahead and prevent booking.  However, t if I set an event to repeat daily, so for a month, the system seems to ignore the maximum booking notice and repeats the event even on days when it should fail due to the maximum booking notice.  Is there some way to correct this?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #1 on: September 22, 2008, 09:57:33 AM »

Sounds like a bug on my part.  I'll get this on my list.
Logged
samato
Guest
« Reply #2 on: September 23, 2008, 02:05:36 PM »

Thanks.  It would be extremely nice if you could let me know when this is fixed.....
Logged
tdr
Newbie
*

Karma: 0
Posts: 21


« Reply #3 on: February 28, 2010, 07:10:38 AM »

This problem still seems to exist with version 1.2.12. Any idea on a likely fix date?

thanks
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #4 on: March 01, 2010, 02:17:53 PM »

This was not fixed.  I'll move this up in priority.  In the mean time, can you try the following changes to add_res() in lib/Reservation.class.php?

Move lines 195-197 underline 221

Code:
//195-197
if ($this->check_startdate()) {
$this->check_times(); // Check valid times
}

Code:
// line 221
$is_valid = $this->check_res($resources_to_add);

And change it slightly to

Code:
if ($this->check_startdate()) {
$is_valid = $is_valid && $this->check_times(); // Check valid times
}

If that works you'll need to make equivalent changes to mod_res()
Logged
tdr
Newbie
*

Karma: 0
Posts: 21


« Reply #5 on: March 02, 2010, 05:21:18 AM »

Hi Nick,
Made the suggested code changes. My test case:
Set maximum booking notice to 24 hours for a resource
Try to reserve for the next 4 consecutive days.

Firstly I get this kind of "stacked" error box when saving the reservation which looks like this:


Please go back and correct errors
This resource cannot be reserved for more than 24 hours in advance

This resource cannot be reserved for more than 24 hours in advance
Please go back and correct errors

Your booking was successfully created for
Date1
Date2
Date3

The system does not book day 4.

To confirm, this is what the code looks like at line 221 of /lib/Reservation.class.php :
Code:
$is_valid = $this->check_res($resources_to_add);
if ($this->check_startdate()) {
$is_valid = $is_valid && $this->check_times(); // Check valid times
}

Also note: I haven't made the changes yet to mod_res()

thanks
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #6 on: March 08, 2010, 02:01:35 PM »

So did it still place the reservation for days 2 and 3, even though it shouldn't have?
Logged
saswanb
Newbie
*

Karma: 0
Posts: 4


« Reply #7 on: May 13, 2010, 02:01:32 PM »

Hello, I also had the same issue.  Following your advice, and expanding it a little after line 221:

         $is_valid = $this->check_res($resources_to_add);
         //  begin mod
         if ($this->check_startdate()) {
            $this->check_times();         // Check valid times
         }
         else {
            $is_valid=false;
         }
         //  end mod

The $is_valid set to false is needed to stop the loop from going ahead and creating the reservation anyway, even after generating the error message. 
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #8 on: May 17, 2010, 01:40:22 PM »

This issue was fixed in the 1.2.12 release, if I remember correctly.
Logged
saswanb
Newbie
*

Karma: 0
Posts: 4


« Reply #9 on: May 18, 2010, 01:13:06 PM »

I'm running 1.2.12 and it wasn't fixed in that release.
Logged
Lazi
Newbie
*

Karma: 0
Posts: 9


« Reply #10 on: July 20, 2011, 09:23:55 AM »

I'm running 1.2.12 and it wasn't fixed in that release.
I have the same version and it seems that it does not work...

Can somebody write piece of code which should be add/exchange into configuration? It looks, that for many people this feature will be usefull.

Regards
Lazi
Logged
Carmon Oksen
Newbie
*

Karma: 0
Posts: 1

Actions speak louder than words.


WWW
« Reply #11 on: July 20, 2011, 09:15:38 PM »

This problem is still annoying me. Can someone kindly fix it out and tell us the right solution?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!