From 82dbae58ee37d9ae220c373ef5132bf75e78c621 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 15 Dec 2011 17:01:01 +0000 Subject: [PATCH] Add warnings to notification email --- .../class.importexport_schedule_ui.inc.php | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/importexport/inc/class.importexport_schedule_ui.inc.php b/importexport/inc/class.importexport_schedule_ui.inc.php index e40c36b1b8..49f3ac3607 100644 --- a/importexport/inc/class.importexport_schedule_ui.inc.php +++ b/importexport/inc/class.importexport_schedule_ui.inc.php @@ -551,18 +551,30 @@ } // Send notification to user - if($data['errors']) + if($data['warnings'] || $data['errors']) { $notify = new notifications(); $notify->set_sender($data['account_id']); $notify->add_receiver($data['account_id']); $notify->set_subject(lang('Schedule import | export'). ' ' . lang('errors')); - $contents = lang($data['type']) . ' ' . lang('Errors') . ' ' . egw_time::to() . ':'; - foreach($data['errors'] as $target => $errors) + if($data['warnings']) { - $contents .= "\n". (is_numeric($target) ? '' : $target."\n"); - $contents .= is_array($errors) ? implode("\n",$errors) : $errors; + $contents = lang($data['type']) . ' ' . lang('Warnings') . ' ' . egw_time::to() . ':'; + foreach($data['warnings'] as $target => $message) + { + $contents .= "\n". (is_numeric($target) ? '' : $target."\n"); + $contents .= is_array($message) ? implode("\n",$message) : $message; + } + } + if($data['errors']) + { + $contents = lang($data['type']) . ' ' . lang('Errors') . ' ' . egw_time::to() . ':'; + foreach($data['errors'] as $target => $errors) + { + $contents .= "\n". (is_numeric($target) ? '' : $target."\n"); + $contents .= is_array($errors) ? implode("\n",$errors) : $errors; + } } $notify->set_message($contents); $notify->send();