URL: http://www.uburst.com/cgi-bin/dcforum/dcboard.cgi
Forum: uReserve_general
Thread Number: 16
[ Go back to previous page ]

Original Message
"Restrict reservation."

Posted by Ed [edch@qwest.net] on at 10:11 PM
Hello,
Is there a way for me as admin to restrict
reservations to only 4 weeks out instead of
indefinite. People tend to forget about their
reservations if it is too far out. However, if a
request for 2 months out comes into
me, I would like to be able to schedule it.
Thanks

Table of contents

Messages in this discussion
"RE: Restrict reservation."
Posted by Bill Weiner on at 04:57 AM
There's not really an easy way to restrict the reservations to within 4 weeks, but here are some instructions on how you could make a simple modification to the script in order to accomplish that:

STEP 1: Make a backup of your current ureserve.pl script... just in case.

STEP 2: Open your ureserve.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

elsif ($command eq "goto_next_week")

STEP 4: About 3 lines down from there you will see this line:

$goto_seconds = $form_text{'seconds'};

Immediately AFTER that line, try adding these four lines:

if (($goto_seconds - time) > ($SECONDS_PER_DAY * 28))
{
&display_message("Out of Range","The reservation schedule is restricted to 4 weeks in advance.");
}

STEP 5: Do a search on the following line:

elsif ($command eq "goto_date")

STEP 6: About 4 lines down from there you will see this line:

$goto_seconds = &get_date_seconds($goto_date);

Immediately AFTER that line, try adding those same four lines:

if (($goto_seconds - time) > ($SECONDS_PER_DAY * 28))
{
&display_message("Out of Range","The reservation schedule is restricted to 4 weeks in advance.");
}

STEP 7: Save the script... as TEXT if your editor asks... and try it out!

The result of this modification should be that visitors can not view/make reservations further than 4 weeks in the future.

NOTE: When adding the code above, the &display_message lines should all be on one line... ie. don't let it wrap around to the next line.


"restricting"
Posted by Ed [edch@qwest.net] on at 09:40 AM
I tried that and it does what you say thanks.

Just wondering tho can I as admin surpass that and make a schedule for 2 or 3 months out if a special request is made.
Thanks again for your quick responces!


"RE: restricting"
Posted by Bill Weiner on at 05:27 AM
The easiest way to keep the restriction modification that you made above... while allowing the admin to surpass that restriction... would be to just install a second copy of the ureserve.pl script... one in which just the admin would use. Here's how:

STEP 1: Rename the original (unmodified) ureserve.pl script to something like "ureserve_admin.pl".

STEP 2: Configure/install the "ureserve_admin.pl" script as you did with the regular ureserve.pl script.... and be sure that the $data_directory setting in configuration question #6 maps to the same "data" directory that your modified "ureserve.pl" script uses.

STEP 3: And just have the administorator always use this second script to make reservations and do other admin stuff.

Yes, this is not totally fool-proof in that if a regular website visitor guesses the name/URL of the second admin script... then they would be able to make reservations outside of the 4 week modification that you made to the public "ureserve.pl" script... but that would be very unlikely.