Author: ralfbecker
New Revision: 56118
URL: http://svn.stylite.de/viewvc/egroupware?rev=56118&view=rev
Log:
fix PHP Warning: tracker_so::escalate_filter called static and many IDE warnings
@Nathan please have a look at tracker_import_csv line 452
Added:
trunk/tracker/templates/default/admin.types.xet.bak
trunk/tracker/templates/default/admin.xet.bak
trunk/tracker/templates/default/customfields.xet.bak
trunk/tracker/templates/default/edit.custom.xet.bak
trunk/tracker/templates/default/edit.xet.bak
trunk/tracker/templates/default/escalations.xet.bak
trunk/tracker/templates/default/importexport_wizard_chooseowner.xet.bak
trunk/tracker/templates/default/index.left.xet.bak
trunk/tracker/templates/default/index.left_multiqueue.xet.bak
trunk/tracker/templates/default/index.rows.xet.bak
trunk/tracker/templates/default/index.xet.bak
trunk/tracker/templates/default/report.xet.bak
trunk/tracker/templates/default/wizard_import_options.xet.bak
trunk/tracker/templates/pixelegg/app.less.edited
Modified:
trunk/tracker/inc/class.tracker_admin.inc.php
trunk/tracker/inc/class.tracker_egw_record.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_so.inc.php
trunk/tracker/inc/class.tracker_tracking.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/inc/class.tracker_admin.inc.php (original)
+++ trunk/tracker/inc/class.tracker_admin.inc.php Wed May 11 11:51:00 2016
@@ -5,7 +5,7 @@
-
-
@param array $content=null
-
-
@param array $_content=null
-
@return string
*/
- function admin($content=null,$msg=’’)
- function admin($_content=null,$msg=’’)
{
-
//_debug_array($_content);
-
$tracker = (int) $_content['tracker'];
// apply preferences for assigning of defaultprojects, and provide the project list
if ($this->prefs['allow_defaultproject'] && $tracker)
@@ -72,24 +72,24 @@
$allow_defaultproject = $this->prefs[‘allow_defaultproject’];
}
@@ -101,11 +101,11 @@
break;
case 'rename':
@@ -132,18 +132,18 @@
foreach(array_diff($this->config_names,array(‘field_acl’,‘technicians’,‘admins’,‘users’,‘restrictions’,‘notification’,‘mailhandling’,‘priorities’)) as $name)
{
if (in_array($name,array(‘overdue_days’,‘pending_close_days’)) &&
@@ -172,18 +172,18 @@
{
$staff =& $this->$name;
if (!isset($staff[$tracker])) $staff[$tracker] = array();
-
if (!isset($content[$name])) $content[$name] = array();
-
-
if ($staff[$tracker] != $content[$name])
-
{
-
$staff[$tracker] = $content[$name];
-
if (!isset($_content[$name])) $_content[$name] = array();
-
-
if ($staff[$tracker] != $_content[$name])
-
{
-
$staff[$tracker] = $_content[$name];
$need_update = true;
}
}
// build the (normalized!) priority array
$prios = array();
@@ -223,7 +223,8 @@
$validationError=true;
}
$mailhandler = new tracker_mailhandler($this->mailhandling);
@@ -253,7 +254,7 @@
‘responses’ => lang(‘Canned response’),
) as $name => $what)
{
@@ -399,9 +400,9 @@
‘responses’ => lang(‘Canned response’),
) as $name => $what)
{
@@ -423,9 +424,9 @@
‘notification’ => $this->notification[$tracker],
‘restrictions’ => $this->restrictions[$tracker],
‘mailhandling’ => $this->mailhandling[$tracker],
-
'priorities' => $tracker == $_content['tracker'] ? array('cat_id' => $_content['priorities']['cat_id']) : array(),
);
foreach(array_diff($this->config_names,array('admins','technicians','users','notification','restrictions','mailhandling','priorities')) as $name)
@@ -638,16 +639,16 @@
/**
* Define escalations
*
-
-
@param array $_content
-
@param string $msg
*/
- function escalations(array $content=null,$msg=’’)
- function escalations(array $_content=null,$msg=’’)
{
$escalations = new tracker_escalations();
-
if (!is_array($content))
-
{
-
$content['nm'] = array(
-
if (!is_array($_content))
-
{
-
$_content['nm'] = array(
'get_rows' => 'tracker.tracker_admin.get_rows',
'no_cat' => true,
'no_filter2'=> true,
@@ -671,33 +672,33 @@
}
else
{
-
list($button) = @each($content['button']);
-
unset($content['button']);
-
$escalations->init($content);
-
list($button) = @each($_content['button']);
-
unset($_content['button']);
-
$escalations->init($_content);
switch($button)
{
case 'save':
case 'apply':
// 'Before' only valid for start & due dates
-
if($content['esc_before_after'] == tracker_escalations::BEFORE &&
-
!in_array($content['esc_type'],array(tracker_escalations::START,tracker_escalations::DUE)))
-
if($_content['esc_before_after'] == tracker_escalations::BEFORE &&
-
!in_array($_content['esc_type'],array(tracker_escalations::START,tracker_escalations::DUE)))
{
$msg = lang('"%2" only valid for start date and due date. Use "%1".',lang('after'),lang('before'));
$escalations->data['esc_before_after'] = tracker_escalations::AFTER;
break;
}
// Handle before time
-
elseif (($err = $escalations->save(null,null,!$content['esc_run_on_existing'])) == 0)
-
{
-
$msg = $content['esc_id'] ? lang('Escalation saved.') : lang('Escalation added.');
-
elseif (($err = $escalations->save(null,null,!$_content['esc_run_on_existing'])) == 0)
-
{
-
$msg = $_content['esc_id'] ? lang('Escalation saved.') : lang('Escalation added.');
}
if ($button == 'apply' || $err) break;
// fall-through
@@ -705,18 +706,18 @@
$escalations->init();
break;
}
-
$action = $content['nm']['action'];
-
list($id) = $content['nm']['selected'];
-
$id = (int)$id;
-
unset($content['nm']['action']);
-
unset($content['nm']['selected']);
-
$action = $_content['nm']['action'];
-
list($_id) = $_content['nm']['selected'];
-
$id = (int)$_id;
-
unset($_content['nm']['action']);
-
unset($_content['nm']['selected']);
switch($action)
{
case 'edit':
@@ -740,7 +741,7 @@
}
}
$content = $escalations->data + array(
— trunk/tracker/inc/class.tracker_egw_record.inc.php (original)
+++ trunk/tracker/inc/class.tracker_egw_record.inc.php Wed May 11 11:51:00 2016
@@ -124,7 +124,7 @@
* @return string identifier
*/
public function save ( $_dst_identifier ) {
— trunk/tracker/inc/class.tracker_escalations.inc.php (original)
+++ trunk/tracker/inc/class.tracker_escalations.inc.php Wed May 11 11:51:00 2016
@@ -1,13 +1,13 @@
<?php
/**
- * eGroupWare Tracker - Escalation of tickets
+ * EGroupware Tracker - Escalation of tickets
*
* Sponsored by Hexagon Metrolegy (www.hexagonmetrology.net)
*
* @link http://www.egroupware.org
* @author Ralf Becker
* @package tracker
- * @copyright (c) 2008 by Ralf Becker
+ * @copyright (c) 2008-16 by Ralf Becker
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
@@ -135,7 +135,7 @@
$data['set'][substr($key,4)] = $value;
if (!is_null($value))
{
- static $col2action;
+ static $col2action=null;
if (is_null($col2action))
{
$col2action = array(
@@ -233,7 +233,7 @@
/**
* Get an SQL filter to include in a tracker search returning only matches of a given escalation
*
- * @param boolean $due=false true = return only tickets due to escalate, default false = return all tickets matching the escalation filter
+ * @param boolean $due =false true = return only tickets due to escalate, default false = return all tickets matching the escalation filter
* @return array|boolean array with filter or false if escalation not found
*/
function get_filter($due=false)
@@ -372,7 +372,7 @@
}
self::$tracker->init($ticket);
- if ($result = self::$tracker->save() != 0)
+ if (($result = self::$tracker->save()) != 0)
{
return false; // error saving the ticket
}
@@ -478,7 +478,8 @@
// filter only due tickets
$filter = $this->get_filter(true);
// not having this escalation already done
- $filter[] = tracker_bo::escalated_filter($this->id,$join,
+ $join = null;
+ $filter[] = self::$tracker->escalated_filter($this->id,$join,
$this->data['esc_match_repeat'] ? time() - $this->data['esc_match_repeat']*60 : false
);
@@ -520,7 +521,7 @@
/**
* Check if exist and if not start or stop an async job to close pending items
*
- * @param boolean $start=true true=start, false=stop
+ * @param boolean $start =true true=start, false=stop
*/
static function set_async_job($start=true)
{
@@ -567,7 +568,8 @@
// filter only due tickets
$filter = $this->get_filter(true);
// not having this escalation already done
- $filter[] = tracker_bo::escalated_filter($this->id,$join,
+ $join = null;
+ $filter[] = self::$tracker->escalated_filter($this->id,$join,
$this->data['esc_match_repeat'] ? time() - $this->data['esc_match_repeat']*60 : false
);
@@ -624,6 +626,7 @@
// Get a list of users
$users = self::$tracker->users_with_open_entries();
+ $notified = null;
foreach($users as $user)
{
if (isset($notified)) $notified=array();
Modified: trunk/tracker/inc/class.tracker_export_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_export_csv.inc.php?rev=56118&r1=56117&r2=56118&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_export_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_export_csv.inc.php Wed May 11 11:51:00 2016
@@ -42,6 +42,7 @@
// ui selection with checkbox 'use_all'
$query['num_rows'] = -1; // all
$query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
+ $readonlys = null;
$this->ui->get_rows($query,$selection,$readonlys);
// Reset nm params
@@ -56,7 +57,7 @@
);
if($options['selection'] == 'filter')
{
- $fields = importexport_helper_functions::get_filter_fields($_definition->application, $this);
+ importexport_helper_functions::get_filter_fields($_definition->application, $this);
$query['col_filter'] = $_definition->filter;
// Backend expects a string
@@ -182,6 +183,7 @@
* @param tracker_egw_record $record Record to be converted
*/
protected static function convert(tracker_egw_record &$record, array $options = array()) {
+ unset($options); // not used, but required by function signature
$record->tr_description = htmlspecialchars_decode(strip_tags($record->tr_description));
if(is_array($record->replies)) {
@@ -202,7 +204,7 @@
if( count($record->bounties) > 0) {
$bounties = array();
$total = 0;
- foreach($record->bounties as $key => $bounty) {
+ foreach($record->bounties as $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']);
$name = Api\Accounts::username($bounty['bounty_creator']);
@@ -230,7 +232,7 @@
'tr_priority' => $this->ui->get_tracker_priorities(),
'tr_private' => array('' => lang('no'),0 => lang('no'),'1'=>lang('yes')),
);
- foreach($this->selects['tr_tracker'] as $id => $name) {
+ foreach(array_keys($this->selects['tr_tracker']) as $id) {
$this->selects['tr_version'] += $this->ui->get_tracker_labels('version', $id);
$this->selects['tr_status'] += $this->ui->get_tracker_stati($id);
$this->selects['tr_resolution'] += $this->ui->get_tracker_labels('resolution',$id);
Modified: trunk/tracker/inc/class.tracker_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_hooks.inc.php?rev=56118&r1=56117&r2=56118&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_hooks.inc.php (original)
+++ trunk/tracker/inc/class.tracker_hooks.inc.php Wed May 11 11:51:00 2016
@@ -5,7 +5,7 @@
* @link http://www.egroupware.org
* @author Ralf Becker
* @package tracker
- * @copyright (c) 2006-11 by Ralf Becker
+ * @copyright (c) 2006-16 by Ralf Becker
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
@@ -28,6 +28,8 @@
*/
static function search_link($location)
{
+ unset($location); // not used, but required by function signature
+
$link = array(
'query' => 'tracker.tracker_bo.link_query',
'title' => 'tracker.tracker_bo.link_title',
@@ -246,8 +248,6 @@
// Merge print
if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
{
- $link = Egw::link('/index.php','menuaction=tracker.tracker_merge.show_replacements');
-
$settings['default_document'] = array(
'type' => 'vfs_file',
'size' => 60,
@@ -293,10 +293,11 @@
}
catch (Exception $e)
{
+ unset($e); // not used
// permission error
continue;
}
- if ($title = $definition->get_title())
+ if (($title = $definition->get_title()))
{
$options[$title] = $title;
}
@@ -346,6 +347,8 @@
*/
public static function mail_import($args)
{
+ unset($args); // not used, but required by function signature
+
return array(
'menuaction' => 'tracker.tracker_ui.mail_import',
'popup' => Link::get_registry('tracker', 'add_popup'),
Modified: trunk/tracker/inc/class.tracker_import_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_import_csv.inc.php?rev=56118&r1=56117&r2=56118&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_import_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_import_csv.inc.php Wed May 11 11:51:00 2016
@@ -147,9 +147,6 @@
$_definition->plugin_options['record_owner'] = isset( $_definition->plugin_options['record_owner'] ) ?
$_definition->plugin_options['record_owner'] : $this->user;
- // Used to try to automatically match names to account IDs
- $addressbook = new Api\Contacts\Storage();
-
// Process cat_id as a normal select
$types = tracker_egw_record::$types;
unset($types['select-cat']);
@@ -171,10 +168,10 @@
// don't import empty records
if( count( array_unique( $record ) ) < 2 ) continue;
-
+
$result = importexport_import_csv::convert($record, $types, 'tracker', $_lookups, $_definition->plugin_options['convert']);
if($result) $this->warnings[$import_csv->get_current_position()] = $result;
-
+
// Set creator/group, unless it's supposed to come from CSV file
foreach(array('owner' => 'creator', 'group' => 'group', 'assigned' => 'assigned') as $option => $field) {
if($_definition->plugin_options[$option.'_from_csv'] && $record['tr_'.$field]) {
@@ -215,12 +212,12 @@
// Translate lookups
foreach($lookups as $field => &$l_values)
{
- foreach($l_values as $l_key => &$l_label)
+ foreach($l_values as &$l_label)
{
$l_label = lang($l_label);
}
}
- $lookups = $_lookups + $lookups;
+ $all_lookups = $_lookups + $lookups;
foreach(array('tr_tracker', 'tr_version','tr_status','tr_priority','tr_resolution','cat_id') as $field) {
if(!is_numeric($record[$field]) || $_definition->plugin_options['convert'] == 1) {
@@ -230,12 +227,12 @@
//echo "Checking $field. Currently {$record[$field]}.
";
// Check for key as value - importing DB values, or from conversion
- if(is_numeric($record[$field]) && $lookups[$field][$record[$field]]) $key = $record[$field];
+ if(is_numeric($record[$field]) && $all_lookups[$field][$record[$field]]) $key = $record[$field];
// Look for human values - existing ones should already be IDs
if(!$key)
{
- $key = array_search($record[$field], $lookups[$field]);
+ $key = array_search($record[$field], $all_lookups[$field]);
}
if($key !== false) {
$record[$field] = $key;
@@ -282,7 +279,7 @@
));
}
$record[$field] = $cat_id;
- } elseif($key = array_search($t_field, $lookups[$field])) {
+ } elseif(($key = array_search($t_field, $all_lookups[$field]))) {
$record[$field] = $key;
} else {
$record[$field] = $t_field;
@@ -292,8 +289,8 @@
}
}
if($field == 'tr_tracker') {
- $lookups['tr_priority'] = $this->bo->get_tracker_priorities($record['tr_tracker'], $record['cat_id']);
- $lookups['cat_id'] = $this->bo->get_tracker_labels('cat', $record['tr_tracker']);
+ $all_lookups['tr_priority'] = $this->bo->get_tracker_priorities($record['tr_tracker'], $record['cat_id']);
+ $all_lookups['cat_id'] = $this->bo->get_tracker_labels('cat', $record['tr_tracker']);
}
//echo "Final: {$record[$field]}
";
}
@@ -402,7 +399,7 @@
$this->results['unchanged']++;
break;
}
-
+
// Fall through
case 'insert' :
// Defaults
@@ -442,8 +439,7 @@
}
// Process some additional fields
- $_link_id = false;
- foreach(self::$special_fields as $field => $desc) {
+ foreach(array_keys(self::$special_fields) as $field) {
if(!$_data[$field]) continue;
// Links
@@ -453,8 +449,8 @@
$app = $field;
$id = $_data[$field];
}
- if ($app && $app_id) {
- $link_id = Link::link('tracker',$id,$app,$app_id);
+ if ($app && $app_id) { // todo nathan: $app_id is undefined
+ Link::link('tracker',$id,$app,$app_id);
}
}
return true;
@@ -550,21 +546,21 @@
// end of iface_export_plugin
// Extra conversion functions - must be static
- public static function addr_id( $n_family,$n_given=null,$org_name=null ) {
+ public static function addr_id( $_n_family,$n_given=null,$org_name=null ) {
// find in Addressbook, at least n_family AND (n_given OR org_name) have to match
- static $contacts;
+ static $contacts=null;
+ if (!isset($contacts))
+ {
+ $contacts = new Api\Contacts();
+ }
if (is_null($n_given) && is_null($org_name))
{
// Maybe all in one
- list($n_family, $n_given, $org_name) = explode(',', $n_family);
- }
- $n_family = trim($n_family);
+ list($_n_family, $n_given, $org_name) = explode(',', $_n_family);
+ }
+ $n_family = trim($_n_family);
if(!is_null($n_given)) $n_given = trim($n_given);
- if (!is_object($contacts))
- {
- $contacts =& CreateObject('phpgwapi.contacts');
- }
if (!is_null($org_name)) // org_name given?
{
$org_name = trim($org_name);
@@ -589,4 +585,3 @@
return False;
}
}
-?>
— trunk/tracker/inc/class.tracker_mailhandler.inc.php (original)
+++ trunk/tracker/inc/class.tracker_mailhandler.inc.php Wed May 11 11:51:00 2016
@@ -1,6 +1,6 @@
<?php
/**
- * eGroupWare Tracker - Handle incoming mails
+ * EGroupware Tracker - Handle incoming mails
*
* This class handles incoming mails in the async services.
* It is an addition for the eGW Tracker app by Ralf Becker
@@ -159,6 +159,7 @@
}
catch(Exception $e)
{
+ unset($e); // not used
if ($reference->hostspec != $profile->hostspec) $diff['acc_imap_host']=array('reference'=>$reference->hostspec,'profile'=>$profile->hostspec);
if ($reference->port != $profile->port) $diff['acc_imap_port']=array('reference'=>$reference->port,'profile'=>$profile->port);
if ($reference->username != $profile->username) $diff['acc_imap_username']=array('reference'=>$reference->username,'profile'=>$profile->username);
@@ -377,7 +378,6 @@
// load lang stuff for mailheaderInfoSection creation
Api\Translation::add_app('mail');
// retrieve list
- if (self::LOG_LEVEL>0 && $tretval===false) error_log(__METHOD__.__LINE__.'#'.array2string($tretval).$mailobjecterrorMessage);
if (self::LOG_LEVEL>1) error_log(__METHOD__.__LINE__." Processing mailbox {$_folderName} with ServerID:".$mailobject->icServer->ImapServerId." for queue $queue\n".array2string($mailobject->icServer));
$_filter=array('status'=>array('UNSEEN','UNDELETED'));
if (!empty($this->mailhandling[$queue]['address']))
@@ -385,12 +385,12 @@
$_filter['type']='TO';
$_filter['string']=trim($this->mailhandling[$queue]['address']);
}
- $_sortResult = $mailobject->getSortedList($_folderName, $_sort=0, $_reverse=1, $_filter,$byUid=true,false);
+ $_sortResult = $mailobject->getSortedList($_folderName, $_sort=0, 1, $_filter, true, false);
$sortResult = $_sortResult['match']->ids;
if (self::LOG_LEVEL>1 && $sortResult) error_log(__METHOD__.__LINE__.'#'.array2string($sortResult));
$deletedCounter = 0;
$mailobject->reopen($_folderName);
- foreach ((array)$sortResult as $i => $uid)
+ foreach ((array)$sortResult as $uid)
{
if (empty($uid)) continue;
if (self::LOG_LEVEL>1) error_log(__METHOD__.__LINE__.'# fetching Data for:'.array2string(array('uid'=>$uid,'folder'=>$_folderName)).' Mode:'.$this->htmledit.' SaveAsOption:'.$GLOBALS['egw_info']['user']['preferences']['mail']['saveAsOptions']);
@@ -557,7 +557,7 @@
$oMInx = 0;
$alienSender = false;
- foreach ($mailCntArray as $key => $val)
+ foreach (array_keys($mailCntArray) as $key)
{
if (preg_match ("/^From:.*@gmail.*/", $mailCntArray[$key]))
{
@@ -683,7 +683,7 @@
if (empty($newBody)) $newBody = htmlentities($body,ENT_QUOTES);
$body = $newBody;
}
- $body = preg_replace($nonDisplayAbleCharacters,'',$body);
+ $body_out = preg_replace($nonDisplayAbleCharacters,'',$body);
// handle Attachments
$contentParts = count($structure->parts);
@@ -737,7 +737,10 @@
}
}
$att[$k] = $rv['struct'];
- if (!empty($rv['attachments'])) for ($a=0; $a<sizeof($rv['attachments']);$a++) $additionalAttachments[] = $rv['attachments'][$a];
+ if (!empty($rv['attachments'])) for ($a=0; $a<sizeof($rv['attachments']);$a++)
+ {
+ $additionalAttachments[] = $rv['attachments'][$a];
+ }
if (empty($attachments[$num]['attachment']) && empty($rv['attachments']))
{
unset($attachments[$num]);
@@ -793,15 +796,12 @@
}
}
//if (!empty($attachments)) error_log(__METHOD__." Attachments with this mail:".print_r($attachments,true));
- if (!empty($additionalAttachments))
- {
- //error_log(__METHOD__." Attachments retrieved with attachments:".print_r($additionalAttachments,true));
- for ($a=0; $a Api\Translation::convertHTMLToText(nl2br(Api\Html::purify($body))),
- 'struct' => $struct,
- 'attachments' => $attachments
- );
+ return array(
+ 'body' => Api\Translation::convertHTMLToText(nl2br(Api\Html::purify($body_out))),
+ 'struct' => $struct,
+ 'attachments' => !empty($additionalAttachments) ?
+ array_merge($attachments, $additionalAttachments) : $attachments,
+ );
}
/**
@@ -875,7 +875,6 @@
break;
case 'process' : // Process normally...
return false; // ...so act as if it's no automail
- break;
default : // default: 'ignore'
break;
}
@@ -937,8 +936,8 @@
$returnVal = $this->forward_message2($mailobject, $uid, $mailcontent['subject'], lang("automatic mails (bounces) are configured to be forwarded"), $queue);
if ($returnVal)
{
- $rv = $mailobject->flagMessages('seen', $uid, $_folderName);
- $rv = $mailobject->flagMessages('forwarded', $uid, $_folderName);
+ $mailobject->flagMessages('seen', $uid, $_folderName);
+ $mailobject->flagMessages('forwarded', $uid, $_folderName);
}
default : // default: 'ignore'
break;
@@ -962,13 +961,12 @@
$returnVal = $this->forward_message2($mailobject, $uid, $mailcontent['subject'], lang("automatic mails (replies) are configured to be forwarded"), $queue);
if ($returnVal)
{
- $rv = $mailobject->flagMessages('seen', $uid, $_folderName);
- $rv = $mailobject->flagMessages('forwarded', $uid, $_folderName);
+ $mailobject->flagMessages('seen', $uid, $_folderName);
+ $mailobject->flagMessages('forwarded', $uid, $_folderName);
}
break;
case 'process' : // Process normally...
return false; // ...so act as if it's no automail
- break;
default : // default: 'ignore'
break;
}
@@ -1097,16 +1095,13 @@
{
case 'ignore' : // Do nothing
return false;
- break;
case 'delete' : // Delete, whatever the overall delete setting is
@imap_delete($this->mbox, $mid);
return false; // Prevent from a second delete attempt
- break;
case 'forward' : // Return the status of the forward attempt
$returnVal = self::forward_message($mid, $msgHeader, $queue);
if ($returnVal) $status = $this->flagMessageAsSeen($mid, $msgHeader);
return $returnVal;
- break;
case 'default' : // Save as default user; handled below
default : // Duh ??
break;
@@ -1291,9 +1286,9 @@
function process_message2 ($mailobject, $uid, $_folderName, $queue)
{
$senderIdentified = true;
- $sR = $mailobject->getHeaders($_folderName, $_startMessage=1, $_numberOfMessages=1, $_sort='INTERNALDATE', $_reverse=true, $_filter=array(),$_thisUIDOnly=$uid, $_cacheResult=false);
+ $sR = $mailobject->getHeaders($_folderName, $_startMessage=1, 1, 'INTERNALDATE', true, array(), $uid, false);
$s = $sR['header'][$uid];
- $subject = $mailobject->decode_subject($s['subject']);// we use the needed headers for determining beforehand, if we have a new ticket, or a comment
+ $subject_in = $mailobject->decode_subject($s['subject']);// we use the needed headers for determining beforehand, if we have a new ticket, or a comment
// FLAGS - control in case filter wont work
$flags = $s;//implicit with retrieved information on getHeaders
if ($flags['deleted'] || $flags['seen'])
@@ -1307,13 +1302,13 @@
($flags['answered'] && $flags['seen']) || // is answered and seen
$flags['draft']) // is Draft
{
- if (self::LOG_LEVEL>1) error_log(__METHOD__.__LINE__.':'."UID:$uid in Folder $_folderName with".' Subject:'.$subject.
+ if (self::LOG_LEVEL>1) error_log(__METHOD__.__LINE__.':'."UID:$uid in Folder $_folderName with".' Subject:'.$subject_in.
"\n Date:".$s['date'].
"\n Flags:".print_r($flags,true).
"\n Stopped processing Mail ($uid). Not recent, new, or already answered, or draft");
return false;
}
- $subject = Mail::adaptSubjectForImport($subject);
+ $subject = Mail::adaptSubjectForImport($subject_in);
$tId = $this->get_ticketId($subject);
if ($tId)
{
@@ -1399,20 +1394,17 @@
{
case 'ignore' : // Do nothing
return false;
- break;
case 'delete' : // Delete, whatever the overall delete setting is
$mailobject->deleteMessages($uid, $_folderName, 'move_to_trash');
return false; // Prevent from a second delete attempt
- break;
case 'forward' : // Return the status of the forward attempt
$returnVal = $this->forward_message2($mailobject, $uid, $mailcontent['subject'], $this->data['msg'], $queue);
if ($returnVal)
{
- $rv = $mailobject->flagMessages('seen', $uid, $_folderName);
- $rv = $mailobject->flagMessages('forwarded', $uid, $_folderName);
+ $mailobject->flagMessages('seen', $uid, $_folderName);
+ $mailobject->flagMessages('forwarded', $uid, $_folderName);
}
return $returnVal;
- break;
case 'default' : // Save as defa