mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
Display warnings encountered during import
This commit is contained in:
parent
f6a443a917
commit
8c4e8dee2f
@ -68,6 +68,12 @@
|
|||||||
$this->message .= "\n" . lang($action) . ": $a_count";
|
$this->message .= "\n" . lang($action) . ": $a_count";
|
||||||
$total_processed += $a_count;
|
$total_processed += $a_count;
|
||||||
}
|
}
|
||||||
|
if(count($plugin->get_warnings())) {
|
||||||
|
$this->message .= "\n".lang('Warnings').':';
|
||||||
|
foreach($plugin->get_warnings() as $record => $message) {
|
||||||
|
$this->message .= "\n$record: $message";
|
||||||
|
}
|
||||||
|
}
|
||||||
if(count($plugin->get_errors())) {
|
if(count($plugin->get_errors())) {
|
||||||
$this->message .= "\n".lang('Problems during import:');
|
$this->message .= "\n".lang('Problems during import:');
|
||||||
foreach($plugin->get_errors() as $record => $message) {
|
foreach($plugin->get_errors() as $record => $message) {
|
||||||
|
@ -44,6 +44,22 @@
|
|||||||
$data = array();
|
$data = array();
|
||||||
if(is_array($async_list)) {
|
if(is_array($async_list)) {
|
||||||
foreach($async_list as $id => $async) {
|
foreach($async_list as $id => $async) {
|
||||||
|
foreach(array('errors', 'warnings', 'result') as $messages)
|
||||||
|
{
|
||||||
|
if(is_array($async['data'][$messages]))
|
||||||
|
{
|
||||||
|
$list = array();
|
||||||
|
foreach($async['data'][$messages] as $target => $message)
|
||||||
|
{
|
||||||
|
$list[] = array(
|
||||||
|
'target' => (is_numeric($target) ? '' : $target),
|
||||||
|
'message' => implode("\n", (array)$message)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$async['data'][$messages] = $list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
if(is_array($async['data']['errors'])) {
|
if(is_array($async['data']['errors'])) {
|
||||||
$processed_errors = array();
|
$processed_errors = array();
|
||||||
foreach($async['data']['errors'] as $target => $errors)
|
foreach($async['data']['errors'] as $target => $errors)
|
||||||
@ -56,6 +72,13 @@
|
|||||||
$async['data']['errors'] = $processed_errors;
|
$async['data']['errors'] = $processed_errors;
|
||||||
}
|
}
|
||||||
$results = array();
|
$results = array();
|
||||||
|
foreach((array)$async['data']['warnings'] as $target => $message)
|
||||||
|
{
|
||||||
|
$warnings[] = array(
|
||||||
|
'target' => $target,
|
||||||
|
'result' => implode("\n",(array)$result)
|
||||||
|
);
|
||||||
|
}
|
||||||
foreach((array)$async['data']['result'] as $target => $result)
|
foreach((array)$async['data']['result'] as $target => $result)
|
||||||
{
|
{
|
||||||
$results[] = array(
|
$results[] = array(
|
||||||
@ -63,6 +86,7 @@
|
|||||||
'result' => implode("\n",(array)$result)
|
'result' => implode("\n",(array)$result)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if($results)
|
if($results)
|
||||||
{
|
{
|
||||||
$async['data']['result'] = $results;
|
$async['data']['result'] = $results;
|
||||||
@ -363,6 +387,7 @@
|
|||||||
|
|
||||||
$data['record_count'] = 0;
|
$data['record_count'] = 0;
|
||||||
unset($data['errors']);
|
unset($data['errors']);
|
||||||
|
unset($data['warnings']);
|
||||||
unset($data['result']);
|
unset($data['result']);
|
||||||
$data['last_run'] = time();
|
$data['last_run'] = time();
|
||||||
|
|
||||||
@ -441,6 +466,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(method_exists($po, 'get_warnings') && $po->get_warnings()) {
|
||||||
|
fwrite(STDERR, 'importexport_schedule: ' . date('c') . ": Import warnings:\n#\tWarning\n");
|
||||||
|
foreach($po->get_warnings() as $record => $msg) {
|
||||||
|
$data['warnings'][$target][] = "#$record: $msg";
|
||||||
|
fwrite(STDERR, "$record\t$msg\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unset($data['warnings'][$target]);
|
||||||
|
}
|
||||||
if(method_exists($po, 'get_errors') && $po->get_errors()) {
|
if(method_exists($po, 'get_errors') && $po->get_errors()) {
|
||||||
fwrite(STDERR, 'importexport_schedule: ' . date('c') . ": Import errors:\n#\tError\n");
|
fwrite(STDERR, 'importexport_schedule: ' . date('c') . ": Import errors:\n#\tError\n");
|
||||||
foreach($po->get_errors() as $record => $error) {
|
foreach($po->get_errors() as $record => $error) {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user