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

Original Message
"Recurring event increments"

Posted by Kyle Baker [kybaker@dhs.co.la.ca.us] on at 05:41 PM
Some of my users have asked if there is an easy way to modify the choices in the drop-down menu for recurring events. For instance, you have a choice of 3,5,7,10,14 days, etc, but what if you want the event to occur for four days? If it's a quick fix in PERL, let me know. If not, perhaps add the request to your future features list...

Thanks,
Kyle Baker
Webmaster
LA County Office of AIDS Programs and Policy


Table of contents

Messages in this discussion
"RE: Recurring event increments"
Posted by Bill Weiner on at 07:00 AM

That change wouldn't be totally straight forward, but if you're comfortable with Perl, you should be able to make the changes. Just make a backup of the working script first... just in case.

Anyway, you would first need to locate the "create_add_reserve_form" subroutine by doing a search on "sub create_add_reserve_form". In that subroutine, you should be able to see where each recurring event gets mapped to a "VALUE" of 1 - 16:

print " < OPTION VALUE=\"1\" > Single Event < /OPTION > ";
print " < OPTION VALUE=\"2\" > Daily Event For The Next 3 Days < /OPTION > ";
print " < OPTION VALUE=\"3\" > Daily Event For The Next 5 Days < /OPTION > ";
print " < OPTION VALUE=\"4\" > Daily Event For The Next 7 Days < /OPTION > ";
print " < OPTION VALUE=\"5\" > Daily Event For The Next 10 Days < /OPTION > ";
print " < OPTION VALUE=\"6\" > Daily Event For The Next 14 Days < /OPTION > ";
print " < OPTION VALUE=\"7\" > Weekly Event For The Next 4 Weeks < /OPTION > ";
print " < OPTION VALUE=\"8\" > Weekly Event For The Next 6 Weeks < /OPTION > ";
print " < OPTION VALUE=\"9\" > Weekly Event For The Next 8 Weeks < /OPTION > ";
print " < OPTION VALUE=\"10\" > Weekly Event For The Next 10 Weeks < /OPTION > ";
print " < OPTION VALUE=\"11\" > Weekly Event For The Next 12 Weeks < /OPTION > ";
print " < OPTION VALUE=\"12\" > Bi-weekly Event For The Next 4 Weeks < /OPTION > ";
print " < OPTION VALUE=\"13\" > Bi-weekly Event For The Next 6 Weeks < /OPTION > ";
print " < OPTION VALUE=\"14\" > Bi-weekly Event For The Next 8 Weeks < /OPTION > ";
print " < OPTION VALUE=\"15\" > Bi-weekly Event For The Next 10 Weeks < /OPTION > ";
print " < OPTION VALUE=\"16\" > Bi-weekly Event For The Next 12 Weeks < /OPTION > ";


You would want to edit the desired label accordingly


And as for actually getting the recurring event to be applied properly, you would need to locate the "reserve_resource" subroutine by doing a search on "sub reserve_resource". In that subroutine, you would need to adjust the $increment and $iterations variables based on the $res_field7 value.


As an example, if you wanted to change the "5 Day Event" to a "4 Day Event", you would first change the "Daily Event For The Next 5 Days" label in the "create_add_reserve_form" subroutine to "Daily Event For The Next 4 Days". And since the that event is mapped to a value of "3", you would then modify the "reserve_resource" subroutine to change the lines:

elsif ($res_field7 == 3)
{
$iterations = 5;
}


To these lines:


elsif ($res_field7 == 3)
{
$iterations = 4;
}


"RE: Recurring event increments"
Posted by Kyle Baker [kybaker@dhs.co.la.ca.us] on at 03:07 PM
Exactly! Thanks so much for your prompt reply; I nailed it right away with your instructions.

> That change wouldn't be totally straight
>forward, but if you're comfortable with
>Perl, you should be able to
>make the changes