Page 3 of 5

Re: RESERVATION Module

Posted: Tue Aug 01, 2006 2:38 pm
by djkirstyjay
Welldone! That works perfectly!

Now I've just got to figure out how to change the style and change the daily bookings to weekly bookings.

I don't suppose you have an idea about the latter, do you... as I don't, and you seem so knowledgeable!  ;D ;D ;D ;D ;D

Re: RESERVATION Module

Posted: Tue Aug 01, 2006 2:53 pm
by vielos
All you need to know about Xin Calendar is here :

http://www.yxscripts.com/xc2/index.html

;D

Re: RESERVATION Module

Posted: Tue Aug 01, 2006 4:09 pm
by djkirstyjay
What's that? I wasn't talking about the calender, rather the booking period... at the moment, you book a room daily. So you can have 1 day, 3 days, 7 days, 247 days if you like... the point is, it's done by day and I want rooms to only be bookable in 7 day blocks.

After looking at that link, it seems to only address the pop up calendar functionality, rather than the booking periods... or have I missed something?

Re: RESERVATION Module

Posted: Wed Aug 02, 2006 1:33 am
by newclear
Well done vielos.
I think the cmsms team knew about this difference in the methods.
Now when the module works i can answer to djkirstyjay that there is only one formula that calculate the total price for the room.
I will give you more info soon

Re: RESERVATION Module

Posted: Wed Aug 02, 2006 7:44 am
by vielos
Hi again  :)

I tried to install the module on a CMSMS running with postgres and i had an issue : tables aren't created at all (but got no error from the install script). I am looking at this issue.

Did you had the same issue reported already newclear?

I am creating a fr_FR.php lang file as well. I will submit it to you if you want as soon as it's done.

Re: RESERVATION Module

Posted: Wed Aug 02, 2006 8:04 am
by newclear
I didn't try the module with postresql because i am not using it.
The install script have no checking. Tell me which tables crashes to create and I will see what can I do.

Maybe you can do a manual sql insert to create the tables. Just get the sql from Install method in Reservation.module.php and paste it in postresql

I saw in the last SVN that class.module.inc.php now have the right code in the return of createformstart.

I am happy that it works now for mysql.

A hint: You need to change in Typography CSS in /* TABLE */ table margin:0 0 0 0; for calendar to look right.

Re: RESERVATION Module

Posted: Wed Aug 02, 2006 12:39 pm
by djkirstyjay
Thanks for all your help guys. If it's ok, newclear, I'll put down here what you told me via e-mail about the dates, so that others can benefit if they need it...
The manipulation you want to doing is not just simple like I say but If you are PHP knowledgeable it should be not a problem for you.


You need to change the price in the step 2. See the line 1054. there the price is calculated by ( days * priceperday ).
If you take a look in the dateclass documentation you can see that the class can manage weeks too. I mean if some select date from and date to with 15 days difference the class will return 2 weeks. The text that say Price For n Days should be your period.

In step 3 you just need to change the text that say again Price for n days.

You can type in admin the room type price to be for week
Hmmm... I know a bit about php, so I think I know what you're on about, however I just need to clarify your meaning.

Line 1054 of Reservation.module.php reads :

$onerow->pricefordays = number_format(($row['price'] * $dayscount), 2);

What are you saying to change here? Should I put :

$onerow->pricefordays = number_format(($row['price'] * ($dayscount/7)), 2);



EDIT: And that works perfectly!!!  ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D

Oh, and just for your info, the 'childs' text needs to be changed to 'children' on the downloaded module. I've done it on mine... however it should be on the default, as it's better English.

Once again, thanks for ALL you help! I'm a happy bunny!

Re: RESERVATION Module

Posted: Wed Aug 02, 2006 1:17 pm
by newclear
The default module using is in price for a day.
The dateclass can say how many weeks are selected within the calendar.

change

Code: Select all

1020 line    $dayscount = $span->Span('d', $fromdate->TimeStamp(), $todate->TimeStamp());
to

Code: Select all

1020 line    $dayscount = $span->Span('w', $fromdate->TimeStamp(), $todate->TimeStamp());
This will return the number of weeks they select.

If you doing like this then the price per day in admin for a room type should be for a week!
Then nothing else should be changed except the lang file to look like the Price for n Days to be Price for n weeks. This string is separated like 'Price for' and 'Days'. So just change days to weeks.
This is like hardcoding the code for your needs but it should works fine i think.

The other way to doing this is to change the formula to calculate the price for a week. the date class will return the days but the formula can do the math. I cant figure out right now because of the deadly sunny day here in Bulgaria.

I think the first way is better for you. just tell me if something goes wrong.
There should be integrated option to say for what period you want to using the module.
Greetings
Svilen Sabev

EDIT: You did it. with the second way.
Now the module is happy too.  8)

Re: RESERVATION Module

Posted: Wed Aug 02, 2006 2:47 pm
by djkirstyjay
Thank you!

And to return the favour, here's the translation in Spanish  ;)  ;D (Just change the .txt file to a .php)

[attachment deleted by admin]

Re: RESERVATION Module

Posted: Fri Aug 11, 2006 2:42 pm
by djkirstyjay
Another little problem has cropped up.

Although the reservations are working properly and I'm getting the e-mail etc... I'm also getting a second e-mail that contains the following :

string(67) "Smarty error: unable to read resource: "globalcontent:mail_answer_""

Does anyone know what that's about? For every reservation I get two e-mails. One with the actual reservation info and one containing just that line on it's own.... ???

Re: RESERVATION Module

Posted: Fri Aug 11, 2006 3:17 pm
by newclear
The second mail is global content block named 'mail_answer_en' for me. I am using multilang version of cmsms but you dont so if you create a global content block with name 'mail_answer_' the content will be send to the client immediatly after the reservation is created.

You can also comment the lines where second mail is sending and stop receiving it.
The lines are from 1354 to 1361

Re: RESERVATION Module

Posted: Fri Aug 11, 2006 4:17 pm
by djkirstyjay
What file is that in? The resrvation.module.php only goes up to line 1506...

Re: RESERVATION Module

Posted: Fri Aug 11, 2006 7:30 pm
by newclear
yes in resrvation.module.php

Re: RESERVATION Module

Posted: Sat Aug 12, 2006 9:06 am
by djkirstyjay
Ta... I misread at first! I thought it said 1554 to 1561!

Sorry!

PS: Did you get the Spanish translation?

Re: RESERVATION Module

Posted: Sat Aug 12, 2006 9:28 am
by newclear
Yes I got it.
I have no time now to make another release because module needs some new features.
But i test the module in 1-beta of cmsms and it works fine.