| View previous topic :: View next topic |
| Author |
Message |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Mon Mar 24, 2008 3:14 am Post subject: Showing event type rather than event title etc |
|
|
Hi,
First of all, great calendar! I've been playing around with a trial version and it's great (much better than a more expensive competing product I tried recently)...
I am in a quandary though (and don't want to purchase until I can get a proof of concept happening). I have a client who wants to use the calendar for her customers to book meeting rooms. I've created a custom form for any user (no need for them to login) to enter an event into the database manually - that much I can do.
However the bookings will only be tentative, until she receives a deposit. So what I'd like to do is create a category for tentative bookings, and a category for confirmed bookings. Now for privacy reasons we can't have the calendar displaying WHO has booked the rooms so we'd like the calendar to simply show "confirmed booking" or "tentative booking" instead of the event title. We'd also like the empty cells (ie the ones where nothing has been booked for that day) to display a link to the bookings page.
I've flicked through all the documentation on the website (which is GREAT by the way - it's helped with every other question I had) but I can't see any easy way of doing this without editing the core files. And I don't know which ones to edit... there are heaps!
Can anyone assist? Thanks in advance! |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Mon Mar 24, 2008 3:03 pm Post subject: |
|
|
Hi Ben,
This won't be a small task, but is doable. You'll probably only want to display things like this for public users because you'll want logged in users (most likely admins of some sort) to see the full event details.
Edit include/classes/class.event.php. At line 192, before the }, add something like this:
| Code: |
if($_cal_user->guest) {
$this->title = $this->category;
unset($this->url);
unset($this->location);
unset($this->notes);
unset($this->org_name);
unset($this->org_email);
} |
Add the same bit of code to include/classes/class.event_minimal.php at line 258.
Let me know if you have any questions / trouble. |
|
| Back to top |
|
 |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Mon Mar 24, 2008 9:57 pm Post subject: |
|
|
Yep, you're spot on - that's how I'd like it to work, if at all possible. Thanks very much for the tip!
I had thought that I could just do it with titles, too - but doing it by type would be better. This client of mine would like the events to automatically remove themselves if she hasn't received a deposit within a certain time - so my plan is to create a timestamp for when the events are inserted into the database (if it's not already there.. I haven't looked), and add a cron job to sort through them every day or so and cancel the ones that haven't been confirmed with a deposit.
I've made those edits though, and the calendars still seem to display as normal... (I have only the default calendar setup at the moment... have checked it both using the default view, as well as a view I made using the calendar publisher). Is there anything else I should check? (It'll be a month view calendar, if that makes any difference)....
I'm also looking for a way to add a link into the empty cells... but can't seem to figure it out.
(Do you guys do custom coding like this for a fee?)... |
|
| Back to top |
|
 |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Wed Mar 26, 2008 6:02 am Post subject: |
|
|
Ack. There was an even easier solution in the docs
I just switched on GUEST_NO_EVENT_DETAILS and set GUEST_EVENT_TITLE to Booked. It still shows the category (cool) so I just created my tentative, confirmed and cancelled types, and it all works like it should. Events show up as Booked (tentative) and Booked (confirmed) etc.
Now all I have to do is put a link to my bookings page in the empty days - any hints on how to do this? Edit: Found a solution to that too. I've edited /include/classes/cal_helpers/fill_month.php and changed
| Quote: |
if($this->static) {
echo($da) |
to
| Quote: |
if($this->static) {
echo("$da <span style=\"text-align: right;\"><a href=\"#\">Book</a></span>") |
It puts the link in every day, but it'll do. The link will go to my own bookings page which has a bucketload of info and questions in it.
Now I've just gotta work out this cron job... steep learning curve coming up methinks, I'm pretty basic on PHP/MySQL... |
|
| Back to top |
|
 |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Fri Apr 04, 2008 12:21 pm Post subject: |
|
|
Just an update.. I have things almost just how I want them - this calendar is so awesome to setup, it's great.
Just one minor thing I'm trying to work out is how to stop non-logged in users from being able to change the category when they add an event. I want the event to always be a tentative event when it's added by a guest...
I have been hacking away at the /include/templates/event_edit_tpl.php file with little luck. What I'm trying to do at the moment is
if($_cal_user->guest) {
add some code here for a select list with only one option - tentative!
}
else
{go back to normal thyme code here}
The trouble is no matter what I put in the first box nothing seems to print!
Am I on the right track here.. is there an easier way?
Oh and one other minor issue... I have installed the locations mod and configured it - but nothing is showing next to the select box. The module has a title which is displayed above that section no worries (I have the list in linear format rather than tabs.. and I've moved the location part to the top of the list) and moved dates, etc below it). But right now there is nothing to the left of the select field - bit strange. |
|
| Back to top |
|
 |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Sat Jun 28, 2008 8:31 am Post subject: |
|
|
I'm baack...
This project has been put on hold for a long time but is finally coming to fruition now. I've run into a minor problem with the following:
| Quote: |
I just switched on GUEST_NO_EVENT_DETAILS and set GUEST_EVENT_TITLE to Booked. It still shows the category (cool) so I just created my tentative, confirmed and cancelled types, and it all works like it should. Events show up as Booked (tentative) and Booked (confirmed) etc. |
This is perfect, but for some reason it's still showing a link to the event details... which still show all the information about the event (which is exactly what I'm trying to stop guests seeing). Can anyone point me in the right direction of the file to edit to fix this? I did comment out a section of class.event.php and got rid of part of the link but not all of it. Given that there is a setting to turn the links off altogether in the calendar publisher, I thought there might be an easier way to do it for a regular calendar too.
Secondly.. I have the locations mod installed.. and it would be nice to show the location of the event in the calendar (even for guests). The main reason being that the client has 3 different meeting rooms (which are set as locations) and they could be booked concurrently... if they're not shown in the calendar then potential clients won't know whether a particular rooom is free or not.
Thanks in advance for any pointers. |
|
| Back to top |
|
 |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Sun Jul 06, 2008 5:01 am Post subject: |
|
|
Some solutions for anyone that wants them.
You can switch off links to events for the main calendar in include/classes/class.calendar_real - find the line that says var $event_links = true; and change true to false. Easy!
Only trouble is, then even admins don't have links to events, which makes it hard to edit them. Doh! Is there any easier way around this? As I said in my previous post, I have GUEST_NO_EVENT_DETAILS switched on, but a link to the event still shows the details of the event organiser etc which is not the desired behaviour.
Still haven't figured out a way of getting the locations to show in the calendar view either. I have managed to get them to show in the event view by editing include/classes/class.event.php and adding $this->location onto the title. But that wasn't quite what I wanted.
To get what I want, I think I need to edit class.event_minimal.php - but for some reason the same edits don't work with that file, it's almost as if the variables have been unset somewhere because none of them seem to work (and I've commented out the lines which unset them for guests) so I'm a little confuzzled.
Has anyone got any suggestions? I'm getting fairly close to my deadling for finishing this.
Cheers,
Ben |
|
| Back to top |
|
 |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Sun Jul 27, 2008 2:07 am Post subject: |
|
|
Feel like I'm talking to myself?
Problems (mostly solved):
I went into calendar/include/classes/class.event.php and did the following:
Under the line
| Code: |
| if(@constant('_CAL_GUEST_EVENT_TITLE_')) $this->title = _CAL_GUEST_EVENT_TITLE_; |
I added the lines:
| Code: |
$this->org_name = "Not available to guests";
$this->com_name = "Not available to guests";
$this->phoneno = "Not available to guests"; |
before the closing curly bracket }
Works perfectly, and now if guests click on an event they only see the details of the event which aren't private. I should mention phoneno is a custom field that I added - it won't be present for most people.
I have only one other problem to fix, which is that when a user clicks on the "Events" tab, the event titles are still shown there (in my case the event title is usually the name of the organisation who's booked the event). I am assuming that to fix this I need to edit class.event_list.php - but this file is ioncube encoded. It's really important to me (and my client) that their guest's privacy is honoured, so any help I could get with this would be great.
Ian, will PM you (as I would like to get this resolved soon, I have a meeting with the client tomorrow)  |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Wed Jul 30, 2008 5:17 pm Post subject: |
|
|
Hi Ben,
Could you e-mail me regarding this? ian@extros... I'll send you the unencoded class.event_list.php with the changes already incorporated. |
|
| Back to top |
|
 |
BenM
Joined: 24 Mar 2008 Posts: 13
|
Posted: Wed Jul 30, 2008 10:45 pm Post subject: |
|
|
No worries Ian, email sent. Thanks very much for your help  |
|
| Back to top |
|
 |
|