From d28f6f672cc4436985869e4b1213fef4841a3329 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 8 Nov 2008 10:37:52 +0000 Subject: [PATCH] - fixed url recreation for links (use ? for get-params, if no ? in the link) - made bo_tracking abstract - added default return null to bo_tracking::get_config and removed it from extensions implementing no config - fixed signature of get_config($name,$data,$old=null) --- .../inc/class.addressbook_tracking.inc.php | 2 +- etemplate/inc/class.bo_tracking.inc.php | 10 +++++----- infolog/inc/class.infolog_tracking.inc.php | 16 ---------------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/addressbook/inc/class.addressbook_tracking.inc.php b/addressbook/inc/class.addressbook_tracking.inc.php index cd7e1beb93..d5cba6b78c 100644 --- a/addressbook/inc/class.addressbook_tracking.inc.php +++ b/addressbook/inc/class.addressbook_tracking.inc.php @@ -84,7 +84,7 @@ class addressbook_tracking extends bo_tracking * @param array $old=null old/last state of the entry or null for a new entry * @return mixed */ - function get_config($name,$data,$old) + function get_config($name,$data,$old=null) { //echo "

addressbook_tracking::get_config($name,".print_r($data,true).",...)

\n"; switch($name) diff --git a/etemplate/inc/class.bo_tracking.inc.php b/etemplate/inc/class.bo_tracking.inc.php index 59b918e786..74ea805448 100644 --- a/etemplate/inc/class.bo_tracking.inc.php +++ b/etemplate/inc/class.bo_tracking.inc.php @@ -23,7 +23,7 @@ * 4. optionally re-implement: get_title, get_subject, get_body, get_attachments, get_link, get_notification_link, get_message * They are all documented in this file via phpDocumentor comments. */ -class bo_tracking +abstract class bo_tracking { /** * Application we are tracking @@ -145,7 +145,6 @@ class bo_tracking * * Need to be implemented in your extended tracking class! * - * @abstract * @param string $what possible values are: * - 'copy' array of email addresses notifications should be copied too, can depend on $data * - 'lang' string lang code for copy mail @@ -156,7 +155,7 @@ class bo_tracking */ function get_config($name,$data,$old=null) { - die('You need to extend the bo_tracking class, to be able to use it (abstract base class)!'); + return null; } /** @@ -501,7 +500,8 @@ class bo_tracking { if (strpos($link,$this->id_field.'=') === false) { - $link .= '&'.$this->id_field.'='.$data[$this->id_field]; + $link .= strpos($link,'?') === false ? '?' : '&'; + $link .= $this->id_field.'='.$data[$this->id_field]; } } else @@ -512,7 +512,7 @@ class bo_tracking $popup = egw_link::is_popup($this->app,'view'); } } - if ($link{0} == '/') + if ($link[0] == '/') { $link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://'). ($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link; diff --git a/infolog/inc/class.infolog_tracking.inc.php b/infolog/inc/class.infolog_tracking.inc.php index 5d2d661595..7871b58026 100644 --- a/infolog/inc/class.infolog_tracking.inc.php +++ b/infolog/inc/class.infolog_tracking.inc.php @@ -123,22 +123,6 @@ class infolog_tracking extends bo_tracking $this->infolog =& $infolog_bo; } - /** - * Get a notification-config value - * - * @param string $what - * - 'copy' array of email addresses notifications should be copied too, can depend on $data - * - 'lang' string lang code for copy mail - * - 'sender' string send email address - * @param array $data current entry - * @param array $old=null old/last state of the entry or null for a new entry - * @return mixed - */ - function get_config($name,$data,$old) - { - return null; - } - /** * Get the subject for a given entry *