check if getTimeLine() returns data

This commit is contained in:
Uwe Steinmann 2015-11-19 06:43:36 +01:00
parent 1532ba3b82
commit f5bf326605

View File

@ -87,23 +87,23 @@ class SeedDMS_View_Timeline extends SeedDMS_Bootstrap_Style {
$to = time()-7*86400; $to = time()-7*86400;
} }
$data = $dms->getTimeline($from, $to); if($data = $dms->getTimeline($from, $to)) {
foreach($data as &$item) {
foreach($data as &$item) { switch($item['type']) {
switch($item['type']) { case 'add_version':
case 'add_version': $msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version']));
$msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version'])); break;
break; case 'add_file':
case 'add_file': $msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName())));
$msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()))); break;
break; case 'status_change':
case 'status_change': $msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version'], 'status'=> getOverallStatusText($item['status'])));
$msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version'], 'status'=> getOverallStatusText($item['status']))); break;
break; default:
default: $msg = '???';
$msg = '???'; }
$item['msg'] = $msg;
} }
$item['msg'] = $msg;
} }
$jsondata = array(); $jsondata = array();