 |
| << | August 2010 | >> |
| Su |
Mo |
Tu |
We |
Th |
Fr |
Sa |
| 1 |
2 |
3 |
4 |
5 |
6 |
7 |
| 8 |
9 |
10 |
11 |
12 |
13 |
14 |
| 15 |
16 |
17 |
18 |
19 |
20 |
21 |
| 22 |
23 |
24 |
25 |
26 |
27 |
28 |
| 29 |
30 |
31 |
|
|
|
|
|
 |
 |
|
| Goto page 1, 2 Next |
jonb Post subject: Calendar Module Changes (Part Deux, iCal Adventures)
|
Thu Jul 12, 2007 4:03 pm Posts: 42 Location: Santa Fe, NM
|
| |
|
I figured I should start a new thread since this is a mod that relates to a different topic. iCal exporting. To see the calendar that I'm basing this from, see the following thread:
http://forums.vtiger.com/viewtopic.php?t=15075
Ok, that being out of the way, I have basic iCal exporting working in vTiger 5.0.3. The patch is attached below. Enjoy.
| Description: |
| A patch to enable iCal export in the Calendar module. Based on the improved calendar (See original thread). |
|
 Download |
| Filename: |
iCal-Export-5.0.3.patch.txt |
| Filesize: |
93.37 KB |
| Downloaded: |
592 Time(s) |
|
|
|
|
|
 |
jonb Post subject: Re: Calendar Module Changes (Part Deux, iCal Adventures)
|
Thu Jul 12, 2007 4:06 pm Posts: 42 Location: Santa Fe, NM
|
| |
|
In addition, here's my current revision of the Calendar module. I tarballed it for convenience. However, you must still apply many of the patches to get the stuff here to work. There are many changes outside of the Calendar module that must be applied.
| Description: |
| A tarball of my calendar module. This will only work if the other patches are applied correctly. |
|
 Download |
| Filename: |
Calendar-Module-iCal+Colors-5.0.3.tar.gz |
| Filesize: |
187.31 KB |
| Downloaded: |
581 Time(s) |
|
|
|
|
jonb Post subject: Re: Calendar Module Changes (Part Deux, iCal Adventures)
|
Thu Jul 12, 2007 4:12 pm Posts: 42 Location: Santa Fe, NM
|
| |
|
Oh, before anyone asks, I didn't make an interface for an end user to actually download the calendar (So there's no link within vtiger to get to the calendar). That will come later. If you want to use these patches as is, you can tell your users to Subscribe to the calendar at the following address in iCal or whatever.
http://your-vtiger-install/index.php?module=Calendar&action=iCal
If you really need a button to download a Calendar within vtiger, just modify the appropiate file in vtiger-install/Smarty/templates to create a link to the above.
_________________ http://www.codecrazy.net/
|
|
|
|
jonb Post subject: Re: Calendar Module Changes (Part Deux, iCal Adventures)
|
Thu Jul 12, 2007 4:21 pm Posts: 42 Location: Santa Fe, NM
|
| |
|
Here we go. This is a patch to the index file so the headers will be written out from the previous patch. It basically disables any output other than the text/calendar data.
| Code: |
Index: index.php
===================================================================
--- index.php (revision 140)
+++ index.php (working copy)
@@ -274,6 +274,7 @@
ereg("^ActivityAjax",$action) ||
ereg("^chat",$action) ||
ereg("^vtchat",$action) ||
+ ereg("^iCal",$action) ||
ereg("^updateCalendarSharing",$action) ||
ereg("^disable_sharing",$action) ||
ereg("^HeadLines",$action) ||
@@ -303,10 +304,11 @@
ereg("^massdelete", $action) ||
ereg("^mailmergedownloadfile",$action) || ereg("^get_img",$action) ||
ereg("^download",$action) ||
+ ereg("^iCal",$action) ||
ereg("^massdelete", $action ))
$skipFooters=true;
//skip footers for all these invocations as they are mostly popups
- if(ereg("^downloadfile", $action) || ereg("^fieldtypes",$action) || ereg("^mailmergedownloadfile",$action)|| ereg("^get_img",$action))
+ if(ereg("^iCal",$action) || ereg("^downloadfile", $action) || ereg("^fieldtypes",$action) || ereg("^mailmergedownloadfile",$action)|| ereg("^get_img",$action))
{
$viewAttachment = true;
}
|
|
|
|
|
jonb Post subject: Re: Calendar Module Changes (Part Deux, iCal Adventures)
|
Thu Jul 12, 2007 4:38 pm Posts: 42 Location: Santa Fe, NM
|
|
|
|
|
jonb Post subject: Re: Calendar Module Changes (Part Deux, iCal Adventures)
|
Fri Jul 13, 2007 4:50 pm Posts: 42 Location: Santa Fe, NM
|
| |
|
Does anyone have any suggestions for doing authentication? Basically as-is, you need to login to be able to access the calendar. I'm thinking about setting it so it creates it's own connection to the database and turning it into an essentially stand alone script that queries the database and returns the public calendar. This way users can subscribe to the calendar in iCal or whatever and not have to log in before hand. Any thoughts on this?
_________________ http://www.codecrazy.net/
|
|
|
|
jonb Post subject: Re: Calendar Module Changes (Part Deux, iCal Adventures)
|
Fri Jul 13, 2007 8:52 pm Posts: 42 Location: Santa Fe, NM
|
| |
|
I ended up modifying my version of the ical exporter to provide the calendar without authentication. I figure if someone manages to get into our internal network, viewing our calendar is the least of our worries. If you want your setup like this, move the iCal.php in modules/Calendar to your vtiger root and modify the beginning of it to resemble the following:
| Code: |
<?php
define('_BENNU_VERSION', '0.1');
require_once('include/database/PearDatabase.php');
require_once('include/utils/CommonUtils.php');
require_once('include/utils/UserInfoUtil.php');
require_once('modules/Calendar/CalendarCommon.php');
require_once('modules/Calendar/iCalendar_rfc2445.php');
require_once('modules/Calendar/iCalendar_components.php');
require_once('modules/Calendar/iCalendar_properties.php');
require_once('modules/Calendar/iCalendar_parameters.php');
// Connect to the database anyway if we aren't logged in
if(!isset($_REQUEST['action']) || !isset($_REQUEST['module']) ) {
global $adb;
$adb = NewADOConnection($dbconfig['db_type']);
$adb->Connect($dbconfig['db_server'], $dbconfig['db_username'], $dbconfig['db_password'], $dbconfig['db_name']);
}
$ical_query = "SELECT * FROM vtiger_activity
WHERE (
( STATUS != 'Completed' AND STATUS != 'Deferred' )
OR STATUS IS NULL
) AND (
( eventstatus != 'Held' AND eventstatus != 'Not Held' )
OR eventstatus IS NULL
)";
etc...
|
Enjoy.
_________________ http://www.codecrazy.net/
|
|
|
|
| |