- 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)
This commit is contained in:
Ralf Becker 2008-11-08 10:37:52 +00:00
parent 5e0cbfb49e
commit d28f6f672c
3 changed files with 6 additions and 22 deletions

View File

@ -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 * @param array $old=null old/last state of the entry or null for a new entry
* @return mixed * @return mixed
*/ */
function get_config($name,$data,$old) function get_config($name,$data,$old=null)
{ {
//echo "<p>addressbook_tracking::get_config($name,".print_r($data,true).",...)</p>\n"; //echo "<p>addressbook_tracking::get_config($name,".print_r($data,true).",...)</p>\n";
switch($name) switch($name)

View File

@ -23,7 +23,7 @@
* 4. optionally re-implement: get_title, get_subject, get_body, get_attachments, get_link, get_notification_link, get_message * 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. * They are all documented in this file via phpDocumentor comments.
*/ */
class bo_tracking abstract class bo_tracking
{ {
/** /**
* Application we are tracking * Application we are tracking
@ -145,7 +145,6 @@ class bo_tracking
* *
* Need to be implemented in your extended tracking class! * Need to be implemented in your extended tracking class!
* *
* @abstract
* @param string $what possible values are: * @param string $what possible values are:
* - 'copy' array of email addresses notifications should be copied too, can depend on $data * - 'copy' array of email addresses notifications should be copied too, can depend on $data
* - 'lang' string lang code for copy mail * - 'lang' string lang code for copy mail
@ -156,7 +155,7 @@ class bo_tracking
*/ */
function get_config($name,$data,$old=null) 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) 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 else
@ -512,7 +512,7 @@ class bo_tracking
$popup = egw_link::is_popup($this->app,'view'); $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://'). $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; ($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link;

View File

@ -123,22 +123,6 @@ class infolog_tracking extends bo_tracking
$this->infolog =& $infolog_bo; $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 * Get the subject for a given entry
* *