Author: nathangray
New Revision: 56043
URL: http://svn.stylite.de/viewvc/egroupware?rev=56043&view=rev
Log:
Move tracker to new API
Modified:
trunk/tracker/inc/class.tracker_admin.inc.php
trunk/tracker/inc/class.tracker_bo.inc.php
trunk/tracker/inc/class.tracker_escalations.inc.php
trunk/tracker/inc/class.tracker_export_csv.inc.php
trunk/tracker/inc/class.tracker_hooks.inc.php
trunk/tracker/inc/class.tracker_import_csv.inc.php
trunk/tracker/inc/class.tracker_mailhandler.inc.php
trunk/tracker/inc/class.tracker_merge.inc.php
trunk/tracker/inc/class.tracker_so.inc.php
trunk/tracker/inc/class.tracker_tracking.inc.php
trunk/tracker/inc/class.tracker_ui.inc.php
trunk/tracker/inc/class.tracker_widget.inc.php
trunk/tracker/inc/class.tracker_wizard_export_csv.inc.php
trunk/tracker/inc/class.tracker_wizard_import_csv.inc.php
trunk/tracker/setup/default_records.inc.php
trunk/tracker/setup/tables_update.inc.php
trunk/tracker/sitemgr/class.module_tracker_add.inc.php
— trunk/tracker/inc/class.tracker_admin.inc.php (original)
+++ trunk/tracker/inc/class.tracker_admin.inc.php Thu May 5 20:34:45 2016
@@ -9,6 +9,12 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Etemplate;
/**
- Admin User Interface of the tracker
@@ -224,7 +230,7 @@
{
$mailhandler->check_mail($queue_id,true);
}
@@ -347,7 +353,7 @@
//echo “update to”; _debug_array($old_cat);
if (!isset($cats))
{
@@ -362,10 +368,10 @@
$this->reload_labels();
}
// Reload tracker app
-
if(egw_json_response::isJSONResponse())
-
{
-
// egw_framework::redirect_link() will exit, we need to keep going
-
egw_json_response::get()->redirect(egw_framework::link('/index.php', array(
-
if(Api\Json\Response::isJSONResponse())
-
{
-
// Framework::redirect_link() will exit, we need to keep going
-
Api\Json\Response::get()->redirect(Framework::link('/index.php', array(
'menuaction' => 'tracker.tracker_ui.index',
// reload is not a special flag, it just makes a different
// url to avoid smart refresh of just nextmatch
@@ -376,7 +382,7 @@
if ($button == ‘apply’) break;
// fall-through for save
case ‘cancel’:
-
Egw::redirect_link('/index.php', array(
'menuaction' => 'admin.admin_ui.index',
'ajax' => 'true'
), 'admin');
@@ -538,7 +544,7 @@
‘allow_voting’ => array(‘No’,‘Yes’),
‘allow_bounties’ => array(‘No’,‘Yes’),
‘autoassign’ => $this->get_staff($tracker),
-
'lang' => Api\Translation::get_installed_langs(),
'cat_id' => $this->get_tracker_labels('cat',$tracker),
// Mail handling
'interval' => array(
@@ -568,7 +574,7 @@
0 => ‘Creator’,
1 => ‘Nobody’,
),
@@ -579,7 +585,7 @@
$sel_options[‘mailheaderhandling’][] = $typ[1];
}
$GLOBALS[‘egw_info’][‘flags’][‘app_header’] = lang(‘Tracker configuration’).($tracker ? ': '.$this->trackers[$tracker] : ‘’);
-
$tpl = new Etemplate('tracker.admin');
return $tpl->exec('tracker.tracker_admin.admin',$content,$sel_options,$readonlys,$content);
}
@@ -786,7 +792,7 @@
{
$content[‘set’][‘tr_assigned’] = explode(’,’,$content[‘set’][‘tr_assigned’]);
}
— trunk/tracker/inc/class.tracker_bo.inc.php (original)
+++ trunk/tracker/inc/class.tracker_bo.inc.php Thu May 5 20:34:45 2016
@@ -11,6 +11,9 @@
*/
use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Vfs;
/**
- Some constants for the check_rights function
@@ -138,7 +141,7 @@
/
var $restrictions;
/*
-
- Enabled the acl queue access?
-
- Enabled the Acl queue access?
-
-
@var boolean
*/
@@ -394,7 +397,7 @@
{
parent::init();
if (isset($keys[‘tr_tracker’])&&!empty($keys[‘tr_tracker’])) $this->data[‘tr_tracker’]=$keys[‘tr_tracker’];
@@ -426,7 +429,7 @@
foreach($data[‘replies’] as &$reply)
{
$reply[‘reply_servertime’] = $reply[‘reply_created’];
@@ -448,7 +451,7 @@
$data[$field . ‘_servertime’] = $data[$field];
}
@@ -466,7 +469,7 @@
}
if (substr($data[‘tr_completion’],-1) == ‘%’) $data[‘tr_completion’] = (int) round(substr($data[‘tr_completion’],0,-1));
@@ -548,7 +551,7 @@
$testReply = $this->data[‘reply_message’];
if ($this->htmledit && isset($this->data[‘reply_message’]) && !empty($this->data[‘reply_message’]))
{
-
$testReply = trim(translation::convertHTMLToText(html::purify($this->data['reply_message']), false, true, true));
-
$testReply = trim(Api\Mail\Html::convertHTMLToText(Api\Html::purify($this->data['reply_message']), false, true, true));
}
//error_log(__METHOD__.__LINE__.' TestReplyMessage:'.$testReply);
if (!$changed && !((isset($this->data['reply_message']) && !empty($this->data['reply_message']) && !empty($testReply)) ||
@@ -634,10 +637,10 @@
if (!($err = parent::save()))
{
// create (and remove) links in custom fields
-
Api\Storage\Customfields::update_links('tracker',$this->data,$old,'tr_id');
// so other apps can update eg. their titles and the cached title gets unset
@@ -768,15 +771,15 @@
{
if ($GLOBALS[‘egw’]->accounts->get_type($uid) == ‘g’)
{
@@ -877,7 +880,7 @@
*/
function is_anonymous($user=null)
{
@@ -906,7 +909,7 @@
*/
function is_tracker_user($user=null)
{
@@ -1087,7 +1090,7 @@
* - write access: user is allowed to upload files or link with other entries
*
* @param int|array $id id of entry or entry array
-
-
@param int $check EGW_ACL_READ for read and EGW_ACL_EDIT for write or delete access
-
-
@param int $check Acl::READ for read and Acl::EDIT for write or delete access
-
@param string $rel_path = null currently not used in Tracker
-
@param int $user = null for which user to check, default current user
-
@return boolean true if access is granted or false otherwise
@@ -1105,8 +1108,8 @@
}
if (!isset($access))
{
-
$needed = $check == Acl::READ ? TRACKER_USER : $this->field_acl['link_to'];
-
$name = 'file_access '.($check == Acl::READ ? 'read' : 'write');
$access = $this->check_rights($needed,null,$id,$user,$name);
}
@@ -1171,7 +1174,7 @@
{
if (!isset($GLOBALS[‘egw’]->categories))
{
@@ -1179,7 +1182,7 @@
}
else
{
-
$cats = new Api\Categories($this->user,'tracker');
}
$this->all_cats = $cats->return_array('all',0,false);
if (!is_array($this->all_cats)) $this->all_cats = array();
@@ -1410,7 +1413,7 @@
$titles[$ticket[‘tr_id’]] = $this->link_title($ticket);
}
}
@@ -1450,7 +1453,7 @@
* @param array $query with keys ‘start’, ‘search’, ‘order’, ‘sort’, ‘col_filter’
* For other keys like ‘filter’, ‘cat_id’ you have to reimplement this method in a derived class.
* @param array &$rows returned rows/competitions
-
-
@param array &$readonlys eg. to disable buttons based on acl, not use here, maybe in a derived class
-
-
@param array &$readonlys eg. to disable buttons based on Acl, not use here, maybe in a derived class
-
@param string $join = ‘’ sql to do a join, added as is after the table-name, eg. “, table2 WHERE x=y” or
- “LEFT JOIN table2 ON (x=y)”, Note: there’s no quoting done on $join!
-
@param boolean $need_full_no_count = false If true an unlimited query is run to determine the total number of rows, default false
@@ -1473,7 +1476,7 @@
*/
function add_tracker($name)
{
-
$cats = new Api\Categories(categories::GLOBAL_ACCOUNT,'tracker'); // global cat!
if ($name && ($id = $cats->add(array(
'name' => $name,
'descr' => 'tracker',
@@ -1484,9 +1487,9 @@
$this->trackers[$id] = $name;
// Update cf type list
@@ -1502,7 +1505,7 @@
*/
function rename_tracker($tracker,$name)
{
@@ -1511,9 +1514,9 @@
$cats->edit($data);
// Update cf type list
@@ -1540,9 +1543,9 @@
$GLOBALS[‘egw’]->categories->delete($tracker,true);
// Update cf type list
@@ -1562,8 +1565,8 @@
{
foreach($this->config_names as $name)
{
-
#echo "<p>calling config::save_value('$name','{$this->$name}','tracker')</p>\n";
-
config::save_value($name,$this->$name,'tracker');
-
#echo "<p>calling Api\Config::save_value('$name','{$this->$name}','tracker')</p>\n";
-
Api\Config::save_value($name,$this->$name,'tracker');
}
self::set_async_job($this->pending_close_days > 0);
@@ -1580,12 +1583,12 @@
function load_config()
{
$migrate_config = false; // update old config-values, can be removed soon
-
foreach((array)Api\Config::read('tracker') as $name => $value)
{
if (substr($name,0,13) == 'notification_') // update old config-values, can be removed soon
{
$this->notification[0][substr($name,13)] = $value;
@@ -1595,7 +1598,7 @@
{
foreach($this->notification as $name => $value)
{
@@ -1660,7 +1663,7 @@
{
//echo ‘
’.METHOD.’(’.($start?‘true’:‘false’).")
\n";
@@ -1688,13 +1691,13 @@
))))
{
if (($default_lang = $GLOBALS[‘egw’]->preferences->default_prefs(‘common’,‘lang’)) && // load the system default language
@@ -1708,7 +1711,7 @@
if ($save_lang)
{
$GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘lang’] = $save_lang;
@@ -1962,7 +1965,7 @@
),
);
// find the addressbookentry to link with
@@ -1983,7 +1986,7 @@
// create as “ordinary” links and try to find/set the creator according to the sender (if it is a valid user to the all queues (tracker=0))
foreach ($contacts as $contact)
{
-
egw_link::link('tracker',$trackerentry['link_to']['to_id'],'addressbook',(isset($contact['contact_id'])?$contact['contact_id']:$contact['id']));
-
Link::link('tracker',$trackerentry['link_to']['to_id'],'addressbook',(isset($contact['contact_id'])?$contact['contact_id']:$contact['id']));
//error_log(__METHOD__.__LINE__.'linking ->'.array2string($trackerentry['link_to']['to_id']).' Status:'.$gg.': for'.(isset($contact['contact_id'])?$contact['contact_id']:$contact['id']));
$staff = $this->get_staff($tracker=0,0,'usersANDtechnicians');
if (empty($trackerentry['tr_creator'])&& $contact['account_id']>0)
@@ -2024,7 +2027,7 @@
else
{
// find the addressbookentry to idetify the reply creator
@@ -2079,7 +2082,7 @@
{
if (!$this->htmledit || stripos($reply[‘reply_message’], ‘<br’) === false && stripos($reply[‘reply_message’], ‘
’) === false)
{
@@ -2099,12 +2102,12 @@
{
if($attachment[‘egw_data’])
{
-
Link::link('tracker',$trackerentry['link_to']['to_id'],Link::DATA_APPNAME,$attachment);
}
else if(is_readable($attachment['tmp_name']) ||
@@ -2156,7 +2159,7 @@
case ‘upcoming’:
return “(tr_startdate IS NOT NULL and tr_startdate > {$this->now} )”;
}
-
return egw_time::sql_filter($name, $start, $end, $column, $this->date_filters);
-
return Api\DateTime::sql_filter($name, $start, $end, $column, $this->date_filters);
}
/**
— trunk/tracker/inc/class.tracker_escalations.inc.php (original)
+++ trunk/tracker/inc/class.tracker_escalations.inc.php Thu May 5 20:34:45 2016
@@ -12,10 +12,12 @@
+use EGroupware\Api;
+
/**
- Escalation of tickets
/
-class tracker_escalations extends so_sql2
+class tracker_escalations extends Api\Storage\Base2
{
/*
-
Name of escalations table
@@ -76,7 +78,7 @@
if (!is_null($id) && !$this->read($id))
{
@@ -153,7 +155,7 @@
$users = array();
foreach((array)$value as $uid)
{
@@ -524,7 +526,7 @@
{
//echo ‘
’.METHOD.’(’.($start?‘true’:‘false’).")
\n";
@@ -635,15 +637,15 @@
$GLOBALS[‘egw’]->acl->read_repository();
// load the right language if needed
-
Api\Translation::add_app('tracker');
-
}
-
-
// Load date/time preferences into Api\DateTime
-
Api\DateTime::init();
// Keep a list of tickets so we only send the user one notification / ticket
$notified = array();
@@ -688,14 +690,14 @@
$ticket[‘prefix’] = lang(‘Starting’).’ ‘;
$ticket[‘message’] = lang(’%1 is starting %2’,
self::$tracker->link_title($ticket[‘tr_id’]),
-
$ticket['tr_startdate'] ? Api\DateTime::to($ticket['tr_startdate']) : ''
);
break;
case 'notify_due':
$ticket['prefix'] = lang('Due') . ' ';
$ticket['message'] = lang('%1 is due %2',
self::$tracker->link_title($ticket['tr_id']),
— trunk/tracker/inc/class.tracker_export_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_export_csv.inc.php Thu May 5 20:34:45 2016
@@ -11,6 +11,8 @@
+use EGroupware\Api;
+
/**
-
export tickets to CSV
*/
@@ -18,7 +20,7 @@
public function __construct()
{
-
$query_key = 'tracker'.($options['tracker'] ? '-'.$options['tracker'] : '');
-
$query = $old_query = egw_session::appsession('index',$query_key);
-
$query_key = 'index'.($options['tracker'] ? '-'.$options['tracker'] : '');
-
$query = $old_query = Api\Cache::getSession('tracker',$query_key);
switch($options['selection'])
{
case 'search':
@@ -43,12 +45,13 @@
$this->ui->get_rows($query,$selection,$readonlys);
// Reset nm params
-
Api\Cache::setSession('tracker',$query_key, $old_query);
break;
case 'filter':
case 'all':
$query = array(
'num_rows' => -1, // all
-
'order' => 'tr_id',
'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session
);
if($options['selection'] == 'filter')
@@ -77,7 +80,7 @@
$this->ui->get_rows($query,$selection,$readonlys);
// Reset nm params
-
Api\Cache::setSession('tracker',$query_key, $old_query);
break;
default:
$selection = explode(',',$options['selection']);
@@ -187,7 +190,7 @@
// User date format
$date = date($GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘dateformat’] . ‘, ‘.
($GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘timeformat’] == ‘24’ ? ‘H’ : ‘h’).’:i:s’,$reply[‘reply_created’]);
-
$name = Api\Accounts::username($reply['reply_creator']);
$message = str_replace("\r\n", "\n", htmlspecialchars_decode(strip_tags($reply['reply_message'])));
$replies[$id] = "$date \t$name \t$message";
@@ -202,7 +205,7 @@
foreach($record->bounties as $key => $bounty) {
$date = date($GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘dateformat’] . ‘, ‘.
($GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘timeformat’] == ‘24’ ? ‘H’ : ‘h’).’:i:s’,$bounty[‘bounty_created’]);
— trunk/tracker/inc/class.tracker_hooks.inc.php (original)
+++ trunk/tracker/inc/class.tracker_hooks.inc.php Thu May 5 20:34:45 2016
@@ -10,6 +10,11 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+
/**
- diverse tracker hooks, all static
*/
@@ -70,30 +75,30 @@
if ($location == ‘sidebox_menu’)
{
// Magic etemplate2 favorites menu (from nextmatch widget)
-
'Tracker list' => Egw::link('/index.php',array(
'menuaction' => 'tracker.tracker_ui.index',
'ajax' => 'true')
),
array(
-
'text' => lang('Add %1',lang(Link::get_registry($appname, 'entry'))),
'no_lang' => true,
'link' => "javascript:egw.open('','$appname','add')"
),
);
-
$file['Placeholders'] = Egw::link('/index.php','menuaction=tracker.tracker_merge.show_replacements');
display_sidebox($appname,$GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu'),$file);
}
if ($GLOBALS['egw_info']['user']['apps']['admin'])
{
$file = Array(
-
'Site configuration' => egw::link('/index.php','menuaction=tracker.tracker_admin.admin'),
-
'Define escalations' => egw::link('/index.php','menuaction=tracker.tracker_admin.escalations'),
-
'Custom fields' => egw::link('/index.php','menuaction=tracker.tracker_customfields.index&use_private=1&ajax=true'),
-
'Site configuration' => Egw::link('/index.php','menuaction=tracker.tracker_admin.admin'),
-
'Define escalations' => Egw::link('/index.php','menuaction=tracker.tracker_admin.escalations'),
-
'Custom fields' => Egw::link('/index.php','menuaction=tracker.tracker_customfields.index&use_private=1&ajax=true'),
);
if ($location == 'admin')
{
@@ -241,7 +246,7 @@
// Merge print
if ($GLOBALS[‘egw_info’][‘user’][‘apps’][‘filemanager’])
{
@@ -250,7 +255,7 @@
‘name’ => ‘default_document’,
‘help’ => lang(‘If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.’,lang(‘tracker’)).’ ‘.
lang(‘The document can contain placeholder like {{%1}}, to be replaced with the data.’,‘tr_summary’).’ '.
-
lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
'run_lang' => false,
'xmlrpc' => True,
'admin' => False,
@@ -262,7 +267,7 @@
‘name’ => ‘document_dir’,
‘help’ => lang(‘If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the data inserted.’, lang(‘tracker’)).’ ‘.
lang(‘The document can contain placeholder like {{%1}}, to be replaced with the data.’,‘tr_summary’).’ '.
-
lang('The following document-types are supported:') . implode(',',Api\Storage\Merge::get_file_extensions()),
'run_lang' => false,
'xmlrpc' => True,
'admin' => False,
@@ -324,7 +329,7 @@
{
if ($data[‘prefs’][‘notify_due’] || $data[‘prefs’][‘notify_start’])
{
@@ -343,7 +348,7 @@
{
return array(
‘menuaction’ => ‘tracker.tracker_ui.mail_import’,
— trunk/tracker/inc/class.tracker_import_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_import_csv.inc.php Thu May 5 20:34:45 2016
@@ -11,6 +11,8 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
/**
-
class import_csv for tracker
@@ -146,7 +148,7 @@
$_definition->plugin_options[‘record_owner’] : $this->user;
// Used to try to automatically match names to account IDs
@@ -184,7 +186,7 @@
$this->errors[$import_csv->get_current_position()] = lang(
‘Unable to convert “%1” to account ID. Using plugin setting (%2) for %3.’,
$record[‘tr_’.$field],
@@ -313,7 +315,7 @@
// User date format
$date = date($GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘dateformat’] . ‘, ‘.
($GLOBALS[‘egw_info’][‘user’][‘preferences’][‘common’][‘timeformat’] == ‘24’ ? ‘H’ : ‘h’).’:i:s’,$reply[‘reply_created’]);
@@ -436,7 +438,7 @@
break;
}
default:
@@ -452,7 +454,7 @@
$id = $_data[$field];
}
if ($app && $app_id) {
— trunk/tracker/inc/class.tracker_mailhandler.inc.php (original)
+++ trunk/tracker/inc/class.tracker_mailhandler.inc.php Thu May 5 20:34:45 2016
@@ -12,6 +12,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
use EGroupware\Api\Mail;
@@ -213,7 +216,7 @@
catch (Exception $e)
{
error_log(METHOD.LINE.’ Failed loading mail profile:’.$e->getMessage());
@@ -273,7 +276,7 @@
if ($this->mailBox === false)
{
-
if ($TestConnection) throw new Api\Exception\WrongUserinput(lang("incomplete server profile for mailhandling provided; Disabling mailhandling for Queue %1", $queue));
// this line should prevent adding garbage to mailhandlerconfig
if (!isset($this->mailhandling[$queue]) || empty($this->mailhandling[$queue]) || $this->mailhandling[$queue]['interval']==0) return false;
error_log(__METHOD__.','.__LINE__.lang("incomplete server profile for mailhandling provided; Disabling mailhandling for Queue %1", $queue.' # Instance='.$GLOBALS['egw_info']['user']['domain']));
@@ -291,7 +294,7 @@
}
try
{
-
$this->smtpMail = new Api\Mailer();
if (self::LOG_LEVEL>2) error_log(__METHOD__.__LINE__.array2string($this->smtpMail));
} catch(Exception $e) {
// ignore exception, but log it, to block the account and give a correct error-message to user
@@ -300,7 +303,7 @@
}
}
-
$rFP=Api\Cache::getCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId));
if ($rFP && !empty($rFP))
{
$d = self::compareMailboxSettings($this->mailBox,$rFP);
@@ -313,7 +316,7 @@
$previousInterval = $this->mailhandling[$queue][‘interval’];
$this->mailhandling[$queue][‘interval’]=$this->mailhandling[$queue][‘interval’]*2;
$this->save_config();
-
egw_cache::setCache(egw_cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
-
Api\Cache::setCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
if ($GLOBALS['egw_info']['server']['admin_mails'] && $this->smtpMail)
{
// notify admin(s) via email
@@ -358,21 +361,21 @@
if ($TestConnection===true)
{
if (self::LOG_LEVEL>0) error_log(METHOD.’,’.LINE." failed to open mailbox:".array2string($mailobject->icServer));
-
egw_cache::setCache(egw_cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),$this->mailBox,$expiration=60*60*5);
-
Api\Cache::setCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),$this->mailBox,$expiration=60*60*5);
if (self::LOG_LEVEL>0) error_log(__METHOD__.','.__LINE__." failed to open mailbox:".array2string($this->mailBox));
return false;
}
else
{
-
egw_cache::setCache(egw_cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
-
Api\Cache::setCache(Api\Cache::INSTANCE,'email','rememberFailedProfile_'.trim($this->mailBox->ImapServerId),array(),$expiration=60*10);
}
// load lang stuff for mailheaderInfoSection creation
@@ -600,7 +603,7 @@
’[\030]’,’[\031]’,’[\032]’,’[\033]’,’[\034]’,’[\035]’,’[\036]’,’[\037]’);
//error_log(__METHOD__." Fetching body for ID $mid, Section $section with Structure: ".print_r($structure,true));
@@ -670,7 +673,7 @@
default:
break;
}
-
Api\Translation::convert($body,$charset);
if ($mimeType=='TEXT/PLAIN')
{
$newBody = @htmlentities($body,ENT_QUOTES, strtoupper($charset));
@@ -795,7 +798,7 @@
//error_log(METHOD." Attachments retrieved with attachments:".print_r($additionalAttachments,true));
for ($a=0; $a<sizeof($additionalAttachments);$a++) $attachments[] = $additionalAttachments[$a];
}
@@ -981,7 +984,7 @@
*/
function decode_header (&$header)
{
-
$header = Api\Mail\Html::decodeMailHeader($header);
}
/**
@@ -1268,7 +1271,7 @@
{
if(is_readable($attachment[‘tmp_name’]))
{
@@ -1528,7 +1531,7 @@
if(is_readable($attachment[‘tmp_name’]))
{
//error_log(METHOD.LINE.’# trying to link ‘.$attachment[‘tmp_name’].’# to:’.$this->data[‘tr_id’]);
@@ -1649,7 +1652,7 @@
*/
static function set_async_job($queue=0, $interval=0)
{
— trunk/tracker/inc/class.tracker_merge.inc.php (original)
+++ trunk/tracker/inc/class.tracker_merge.inc.php Thu May 5 20:34:45 2016
@@ -12,10 +12,13 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
/**
- Tracker - document merge object
/
-class tracker_merge extends bo_merge
+class tracker_merge extends Api\Storage\Merge
{
/*
-
Functions that can be called via menuaction
@@ -55,7 +58,7 @@
$this->bo = new tracker_bo();
// switch of handling of html formated content, if html is not used
@@ -78,8 +81,8 @@
$replies = array();
foreach($tracker[‘replies’] as $id => $reply) {
// User date format
-
$date = Api\DateTime::to($reply['reply_created']);
-
$name = Api\Accounts::username($reply['reply_creator']);
$message = str_replace("\r\n", "\n", $reply['reply_message']);
if($reply['reply_visible'] > 0) {
$message = '['.$message.']';
@@ -150,7 +153,7 @@
// HTML link to ticket
$tracker = new tracker_tracking($this->bo);
-
$array['tr_link'] = Api\Html::a_href($array['tr_summary'], $tracker->get_link($array, array()));
// Set any missing custom fields, or the marker will stay
foreach(array_keys($this->bo->customfields) as $name)
@@ -164,7 +167,7 @@
// Timesheet time
if(strpos($content, ‘tr_sum_timesheets’))
{
-
$links = Link::get_links('tracker',$id,'timesheet');
$sum = ExecMethod('timesheet.timesheet_bo.sum',$links);
$info['$$tr_sum_timesheets$$'] = $sum['duration'];
}
@@ -229,10 +232,10 @@
$reply[‘reply_message’] = ‘[’.$reply[‘reply_message’].’]’;
}
$this->comment_cache[$tr_id][] = array(
-
'$$comment/date$$' => Api\DateTime::to($reply['reply_created']),
'$$comment/message$$' => $reply['reply_message'],
'$$comment/restricted$$' => $reply['reply_visible'] ? ('[' .lang('restricted comment').']') : '',
-
'$$comment/user$$' => Api\Accounts::username($reply['reply_creator'])
);
if($reply['reply_creator'] == $tracker['tr_creator'] && !$last_creator_comment) $last_creator_comment = $reply;
if(is_array($tracker['tr_assigned']) && in_array($reply['reply_creator'], $tracker['tr_assigned']) && !$last_assigned_comment) $last_assigned_comment = $reply;
@@ -241,10 +244,10 @@
// Special comments
foreach(array(’’ => $replies[0], ‘/creator’ => $last_creator_comment, ‘/assigned_to’ => $last_assigned_comment) as $key => $comment) {
$this->comment_cache[$tr_id][-1][$key] = array(
-
'$$comment/-1'.$key.'/date$$' => $comment ? Api\DateTime::to($comment['reply_created']) : '',
'$$comment/-1'.$key.'/message$$' => $comment['reply_message'],
'$$comment/-1'.$key.'/restricted$$' => $comment['reply_visible'] ? ('[' .lang('restricted comment').']') : '',
@@ -273,7 +276,7 @@
{
$GLOBALS[‘egw_info’][‘flags’][‘app_header’] = lang(‘tracker’).’ - '.lang(‘Replacements for inserting entries into documents’);
$GLOBALS[‘egw_info’][‘flags’][‘nonavbar’] = false;
@@ -351,6 +354,6 @@
echo "</table>\n";
— trunk/tracker/inc/class.tracker_so.inc.php (original)
+++ trunk/tracker/inc/class.tracker_so.inc.php Thu May 5 20:34:45 2016
@@ -10,10 +10,12 @@
+use EGroupware\Api;
+
/**
- Storage Object of the tracker
/
-class tracker_so extends so_sql_cf
+class tracker_so extends Api\Storage
{
/*
- Table-name of the main tracker table
@@ -393,7 +395,7 @@
$stati = ExecMethod(‘tracker.tracker_bo.get_tracker_stati’, $tracker);
foreach($stati as $stati_id => $stati_label)
{
-
$data = Api\Categories::id2name($stati_id, 'data');
if($data['closed']) $custom_closed[] = $stati_id;
}
$not_closed = substr(self::SQL_NOT_CLOSED,0,-1) . ' AND tr_status != \'' . implode('\' AND tr_status != \'', $custom_closed) . '\')';
— trunk/tracker/inc/class.tracker_tracking.inc.php (original)
+++ trunk/tracker