My Subscriptions

No active or expired subscriptions. View Available Subscriptions

News Feed

Receive our Newsletter

Advanced Search

Pages: [1]
Print
Author Topic: Private Calendars  (Read 4528 times)
rasheed21
Newbie
*

Karma: +0/-0
Posts: 15


View Profile Email
« on: June 09, 2007, 12:30:30 PM »

I was able to implement JCalPro as a Private Calendar for Each User. This is different from Multiple Calendars that Syldes implemented that allows a site to have more than one calendar, perhaps for different types of events or groups. However, each of these calendars are shared by multiple users that can see each other's event. Private Calendar on the other hand is a way for allowing users to have their own events that no one else sees but themselves. In other words calendar events are not shared among users and one user will not be able to see the events of another user (except admin--of course). For those of you interested in trying this out on your NON-production sites see instructions below.

How to make Private Calendar/Events in JCalPro:
Note: This information ONLY applies to com_jcalpro. I did not need mod_latest nor mod_minical for my site so anyone who needs to add private calendar capabilities to these modules will have to look at my code changes to get ideas of how to implement this himself.

Step 1. (Database)
Use PhpMyAdmin in your control panel to do the following:
  • Create a backup/copy of your jos_jcalpro_events table in your Joomla database. Note: jos is the joomla database prefix and could be different on your site.
  • Add a field to your jos_jcalpro_events table called username (varchar(50) and null = yes). Note: please add the field at the end of all the fields--this minimizes interference with the way jcalpro's code interacts with the database.

Step 2. (File Backup)
rename the following files to any name you want (maybe filename.php.ORG) and note that JOOMLA_HOME is the location of your Joomla home directory whatever it is.

  • JOOMLA_HOME/administrator/components/com_jcalpro/includes/events.php
  • JOOMLA_HOME/components/com_jcalpro/include/functions.inc.php
  • JOOMLA_HOME/components/com_jcalpro/admin_events.php
  • JOOMLA_HOME/components/com_jcalpro/jcalpro.class.php

Step 3. (Upload)
Upload the attached files to the respective directories above.

YOU'RE DONE!!!
Test it out by loging on as a different users and notice each user will only see their cal events.

If you want to see the changes I made in each file, just do a search in the file for "RASHEED BEGIN" you'll find that I didn't really do much and how easy the changes were, so I'm suspecting that doing your own changes for mod_latest or mod_minical would be even easier.

Disclaimer: While the changes made were very easy/simple and seems to work without any problems, DO NOT implement on your production sites unless you're knowledgeable about what you are doing. The intent of this information is only to provide you with insights and ideas about how to use JCalPro as a private calendar. If you use this information on a production site you do so at your OWN risk.

UPDATE: functions.inc.php attachment has been updated, please re-download it if you have downloaded if before. The previous file had some debugging code in it that I was using to attempt to get jCalPro to work with Joomla 1.5 and was causing errors with Private Calendar.

UPDATE: Please see my next post for an additional file. I was not able to post it in this post because we're allowed only 4 attachments per post.
« Last Edit: July 27, 2008, 02:33:05 PM by rasheed21 » Logged
qneal78710
Newbie
*

Karma: +0/-0
Posts: 5


View Profile
« Reply #1 on: June 23, 2007, 02:49:47 AM »

OKay folks, the man of the hour is Rasheed. I installed his updates to allow users to have their own calendar and I had only one problem...the problem was that after installing Rasheeds files in place of the original JCal files the functions.inc.php had a bug in it. Inside this file was the wrong link pointing to one of his installations, and I go the error message:

JCAL Pro critical error:
Unable to load template file

So I went inside the file and changed the link it was pointing to so that it would show the link for my installation.

Everything worked fine, I was able to create events and log out then log back in as a different user and not see the other users events. I love this guy.

Great Work dude
« Last Edit: June 23, 2007, 11:10:37 AM by qneal78710 » Logged
rasheed21
Newbie
*

Karma: +0/-0
Posts: 15


View Profile Email
« Reply #2 on: June 23, 2007, 04:45:30 PM »

Additional file for private calendars

Please place the attached file in the following directory overriding the original.

  • JOOMLA_HOME/components/com_jcalpro/jcalpro.php

This should solve the problem mentioned further below regarding events becoming public in flat, weekly and daily views. Also I was not able to attach this file to the original post because we're only allowed 4 attachments per post.
« Last Edit: July 27, 2008, 02:15:35 PM by rasheed21 » Logged
kerlj001
Newbie
*

Karma: +0/-0
Posts: 1


View Profile
« Reply #3 on: August 04, 2007, 09:48:02 AM »

Hi All

I'm VERY new to Joola/Jcal.  The Calendar option looks awesome and just what I need.  Can I ask:

1. Does everone recieve a standard company cal to start with that a user can add their own events to.
2. Can my company Outlook cal be imported as a base cal.
3. Can a user haves acces to others private cal ie PA access to CEO cal

Cheers any MANY Thanks
==============================================================
Mr Jody Kerley
Network Manager
Chatham South School
Letchworth Avenue
CHATHAM
Kent
ME4 6NT
 
T: 01634 888138 (Direct)
T: 01634 404277 (Main Switchboard)
F: 01634 829010
E: kerlj001@medway.org.uk
 
General Enquiries: office@chathamsouth.medway.sch.uk
=============================================================
Logged
rasheed21
Newbie
*

Karma: +0/-0
Posts: 15


View Profile Email
« Reply #4 on: September 10, 2007, 08:22:32 PM »

Hi Jody:

I'm not sure what you mean by standard company calendar. JCalPro is a web-based calendar that is plugged into your Joomla website. (Joomla is a web content management platform/system that has layouts and common website functionalities prepackaged for almost instant setup of a website with little work on you part, all you have to do is just provide content without worrying about the back end functionality. Joomla also allows you to create add-ons that offer additional/personalized functionality, which is exactly what JCalPro is--an add-on to Joomla.)

Now to answer your questions.
1. JCalPro does have a standard look for all users. However, private calendars so far are only possible using the hack that I provided above. This will allow each user to manage their own calendar events that are private to almost all other users.

2. Currently I think Outlook import is not possible, but maybe someone else can verify this.

3. Only administrators will be able to see calendar events of other users.

Hope this helps,
Rasheed
Logged
gkomnin
Newbie
*

Karma: +0/-0
Posts: 2


View Profile Email
« Reply #5 on: October 16, 2007, 03:55:23 AM »

I think there is a problem with the hack...
1.File events.php is corrupted(see at the end of the file)
2.Same with file functions.inc.php
3.The calendar works fine when with the calendar view but when you see the categories view
you can see all events not the current logged user's events.
I'll try to fix it and i'll post
If someone has the solution ready please post it
Thanks Rasheed
-----------------------------
SOLUTION

In the file jcalpro.php

in the line 752 add the lines
Quote
global $mainframe;
$cur_user = $mainframe->getUser();
in the line 775 and 785 add in the query an extra "AND"
Quote
AND username ='". $cur_user->username ."'
in line 785 e.username not username!!!
in line 826
Quote
global $mainframe;
$cur_user = $mainframe->getUser();
in lines 842 849 same as the above
Quote
AND username ='". $cur_user->username ."'

It works ok now i think..
« Last Edit: October 16, 2007, 04:50:35 AM by gkomnin » Logged
Silly
Newbie
*

Karma: +0/-0
Posts: 2


View Profile Email
« Reply #6 on: October 28, 2007, 03:06:13 PM »

Hi rasheed and all other contributors,
when I saw your hack, I knew that jcalpro + rasheed hack is exactly what I needed...
unfortunatly i have encountered an error every time I implement the hack. I did all the steps as mentioned. I believe I have done them correctly...
I've put a link in the joomla main menu to the jcal component, but whenever I try to access it from either the back end or the front end I receive an error 500:


"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, @@ServerAdmin@@ and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log."


I guess the error doesn't say a lot Smiley.

When I installed the hack (on my localhost server) I took care to do it as mentioned, I hope I didn't miss anything:
1) the database - in the correct prefix (standard jos). At the last spot on the list I created a new line, called "username", type is "varchar50", and "not null" is not marked.

Later on I replaced the files as needed.

As I said, it ended with this error both in front and back end.

Anyone has any idea? maybe version issues (i downloded the current one)
Thanks,
Silly.
btw, i'm really in the start of my way in this area, so i'm sorry if this question is silly  Smiley
Logged
Ycoco
Newbie
*

Karma: +0/-0
Posts: 1


View Profile WWW Email
« Reply #7 on: November 04, 2007, 05:12:01 PM »

Do the administrators have the ability to modify events?
Logged
fred23
Newbie
*

Karma: +0/-0
Posts: 1


View Profile
« Reply #8 on: December 05, 2007, 06:06:59 PM »

Works perfectly on Joomla 1.0.13. Excellent hack. Great work.
Logged
teddyfresco
Newbie
*

Karma: +0/-0
Posts: 1


View Profile Email
« Reply #9 on: April 10, 2008, 01:07:02 PM »

is this hack going to work with latest versions, most important with the one compatible with Joomla 1.5?
I'd be willing to pay for a private calendar version...
Logged
qneal78710
Newbie
*

Karma: +0/-0
Posts: 5


View Profile
« Reply #10 on: April 11, 2008, 02:18:13 AM »

Rasheed,

I think we have a problem. The calendar has been working fine, mainly because nobody has tried to repeat an event, but once you repeat an event, everyone on the website sees that event in their personal calendar on JCal Pro. I did a test and created two users, put in an event then logged out and the event did not show up but I logged back in as the original user and edited the event to repeat then logged out and found that the second user can now see the first user’s events.


Quinton
Logged
qneal78710
Newbie
*

Karma: +0/-0
Posts: 5


View Profile
« Reply #11 on: April 14, 2008, 02:04:32 AM »

Okay folks Rasheed found the answer to the problem.

Problem:

When a user adds an event in the calendar, then choose to repeat that event for more than one day. The event shows up in everybody's calendar. So everyone can see what that events is, so now they know your business.

Solution:

Now with the code below given to me by Rasheed, your events you add with multiple days are no longer on everyone's calendar. I tried it with two users and it works.

Thanks Rasheed, you're still the greatest, man!!!!!!!!!


Look in file functions.inc.php and somewhere around line number 1382 you should see the following chunk of code:

 

if($include_recurrent) {

// calculate recurrent events

      if(isset($cat_id) && is_numeric($cat_id)) $cat_filter .= "AND e.cat = '".$cat_id."'";

$query = "SELECT e.extid, e.cat, recur_type, recur_val, recur_until, start_date, end_date, recur_end_type, recur_count from " . $CONFIG_EXT['TABLE_EVENTS'] . " AS e LEFT JOIN " . $CONFIG_EXT['TABLE_CATEGORIES'] . " AS c ON e.cat=c.cat_id ";

      $query .= "WHERE (DATE_FORMAT(e.start_date,'%Y%m%d') <= $day_pattern) AND c.published = '1' AND e.published = '1' AND approved = '1' AND recur_type <> '' $cat_filter ORDER BY start_date,title ASC";

      $result1 = extcal_db_query($query);

      $recur_events = array();

 

Replace the following line:

      $query .= "WHERE (DATE_FORMAT(e.start_date,'%Y%m%d') <= $day_pattern) AND c.published = '1' AND e.published = '1' AND approved = '1' AND recur_type <> '' $cat_filter ORDER BY start_date,title ASC";

With this line:

      $query .= "WHERE (DATE_FORMAT(e.start_date,'%Y%m%d') <= $day_pattern) AND c.published = '1' AND e.published = '1' AND approved = '1' AND recur_type <> '' AND e.username = '" . $cur_user->username . "' $cat_filter ORDER BY start_date,title ASC";

 

Note that if you’re still using the same code that I submitted the variable  $cur_user->username should already exist.

 

Cheers,

Rasheed



Logged
jodamanx
Newbie
*

Karma: +0/-0
Posts: 1


View Profile
« Reply #12 on: July 26, 2008, 02:46:01 PM »

Rasheed or qneal78710,

It seems as though the altered .php files are no longer available for download on this forum.
Is there anyway you can repost with a link or send me an e-mail with all updated files?

jodamanx@gmail.com

I desperately need PRIVATE CALENDER function, and this will help me tremendously!!!

Thank you!
Logged
rasheed21
Newbie
*

Karma: +0/-0
Posts: 15


View Profile Email
« Reply #13 on: July 27, 2008, 02:18:45 PM »

My 1st two posts have been updated with fixes to all the issues up until now.
The attachments from these original posts should work fine.
Logged
Pages: [1]
Print
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com

Original Joomla Template design by RocketTheme ( Conversion by Bloc)