TechTutorials - Free Computer Tutorials  







Horde Tweaks 
 


Added: 07/24/2008, Hits: 4,517, Rating: 0, Comments: 1, Votes: 0
Add To Favorites | Comment on this article
If you're looking for a nice open-source groupware suite, take a look into http://www.horde.org. The Horde suite consists of a basic framework and a host of add-on modules that allow you to do things like web-based mail, calendaring, and contact management. Most of these different modules work pretty well straight out of the box but there are a few tweaks I found to make things more efficient.

Forcing responses to email read receipt requests:
I've had a number of managers ask for the ability to automatically enforce email read receipts so that employees can't claim ignorance about missing a memo or notice. Unfortunately most email clients give you the option whether to respond or not. This tweak shows how to configure IMP, the mail module, to automatically send a response when a message is read.

The section of code that deals with message disposition notifications (MDNs) is located in /horde_root/imp/message.php. Initially the code looks like this:

Code :

/* Do MDN processing now. */
if ($prefs->getValue('disposition_send_mdn')) {
/* Check to see if an MDN has been requested. */
require_once 'Horde/MIME/MDN.php';
$mdn = &new MIME_MDN($imp_headers_copy);
if ($mdn->getMDNReturnAddr()) {
/* See if we have already processed this message. */
if (!IMP_Maillog::sentMDN($msg_id, 'displayed')) {
$mdn_confirm = Util::getFormData('mdn_confirm');
/* See if we need to query the user. */
if ($mdn->userConfirmationNeeded() && !$mdn_confirm) {
$confirm_link = Horde::link(Util::addParameter($selfURL, 'mdn_confirm', 1), _("HERE")) . _("HERE") . '';
$notification->push(sprintf(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message. Please click %s to send the notification message."), $confirm_link), 'horde.message', array('content.raw'));
} else {
/* Send out the MDN now. */
$result = $mdn->generate(false, $mdn_confirm, 'displayed');


The fun part is that the userConfirmationNeeded function doesn't actually exist anywhere and always generates a return value of 1. Changing the final IF statement to look as follows causes a response to be sent for a read receipt without prompting the user or displaying a message:

Code :
if ($mdn->userConfirmationNeeded() && !$mdn_confirm && 0) {


Simplifying Free/Busy information:
This is one of the few things that is poorly configured out of the box. The default setup requires that EVERY user goes into their own calendar properties and selects their own calender to use for free/busy info. The default setup also requires that to view someone else's free/busy info, you have to add them as a contact in your personal addressbook with a proper free/busy URL. Even if you've done all that but the other person hasn't selected their own calendar for FB you still can't see their info. You can't even view your own FB info unless you set yourself up as a contact in your own address book. Basically, it's a headache.

Simplifying this involves first creating a shared address book (i.e. Company directory) and populating it with contacts that have correct Free/Busy URLs. In many situations this is useful and would be done anyway. Once this is done, the Calendar module, Kronolith, needs to be set to use this shared address book by default. This is done in the /horde_root/kronolith/config/prefs.php file. Change the following setting:

Code :
$_prefs['search_abook'] = array(
// If you want the localsql address book to be the default, use:
// 'value' => 'a:1:{i:0;s:8:"sql";}',
'value' => 'a:0:{}',
'locked' => false,
'shared' => false,
'type' => 'implicit',
'desc' => _("Choose the address books to search for free/busy URLs:")
);


to this:
Code :

$_prefs['search_abook'] = array(
// If you want the localsql address book to be the default, use:
'value' => 'a:1:{i:0;s:8:"shared_sql";}',
//'value' => 'a:0:{}',
'locked' => false,
'shared' => false,
'type' => 'implicit',
'desc' => _("Choose the address books to search for free/busy URLs:")
);

where shared_sql is the name of the shared address book.

The second half of this tweak involves telling Horde to use a person's default calendar for Free/Busy info without the user having to manually do it.

In /horde_root/kronolith/templates/calendars/calendar.inc change the following section:

Code :
function updateFBUrl()
{
cals = new Array();
for (i = 0; i < document.fb.fbcals.options.length; i++) {
if (document.fb.fbcals.options[ i].selected) {
cals[cals.length] = document.fb.fbcals.options[ i].value;
}
}

if (cals.length == 0) {
document.fb.fburl.value = ''
return;
} else if (cals.length == 1) {

document.fb.fburl.value = '?c=' + escape(cals[0]);

} else {

document.fb.fburl.value = '?c[]=' + escape(cals[0]);

for (i = 1; i < cals.length; i++) {

document.fb.fburl.value += '&c[]=' + escape(cals[ i]);

}
}
}


to look like this:

Code :
function updateFBUrl()
{
cals = new Array();

for (i = 0; i < document.fb.fbcals.options.length; i++) {
if (document.fb.fbcals.options[ i].selected) {
cals[cals.length] = document.fb.fbcals.options[ i].value;
}
}

if (cals.length == 0) {
document.fb.fburl.value = '?c=' + escape(cals[0]);
return;
} else if (cals.length == 1) {
document.fb.fburl.value = '?c=' + escape(cals[0]);
} else {
document.fb.fburl.value = '?c[]=' + escape(cals[0]);
for (i = 1; i < cals.length; i++) {
document.fb.fburl.value += '&c[]=' + escape(cals[ i]);
}
}
}


Essentially the user's calendar is now the Free/Busy default, instead of none.





Comments (1)

Review By: pjhealy [07/27/2010]
Review Text: The tweak at the top for auto-response to read receipts is exactly what I'm looking for... However, the more recent versions of IMP have moved the code around some. Has the author updated this tweak for the more recent versions?

Items Per Page:



Related Items








7 Seconds Resources, Inc.




IT Showcase