mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
do not output timeline if no data is available
This commit is contained in:
parent
109f814fa9
commit
6a91429711
|
@ -2018,6 +2018,8 @@ mayscript>
|
|||
* @param object $document document
|
||||
*/
|
||||
protected function printTimeline($timeline, $height=300, $start='', $end='') { /* {{{ */
|
||||
if(!$timeline)
|
||||
return;
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var timeline;
|
||||
|
|
|
@ -87,6 +87,7 @@ echo "</div>\n";
|
|||
|
||||
echo "<div class=\"span9\">\n";
|
||||
$this->contentHeading(getMLText("timeline"));
|
||||
if($data) {
|
||||
foreach($data as &$item) {
|
||||
switch($item['type']) {
|
||||
case 'add_version':
|
||||
|
@ -103,7 +104,8 @@ $this->contentHeading(getMLText("timeline"));
|
|||
}
|
||||
$item['msg'] = $msg;
|
||||
}
|
||||
$this->printTimeline($data, 550, date('Y-m-d', $from), date('Y-m-d', $to+1));
|
||||
$this->printTimeline($data, 550, date('Y-m-d', $from), date('Y-m-d', $to+1));
|
||||
}
|
||||
echo "</div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
|
|
|
@ -1115,6 +1115,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
if($user->isAdmin()) {
|
||||
$this->contentHeading(getMLText("timeline"));
|
||||
$timeline = $document->getTimeline();
|
||||
if($timeline) {
|
||||
foreach($timeline as &$item) {
|
||||
switch($item['type']) {
|
||||
case 'add_version':
|
||||
|
@ -1133,6 +1134,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
$this->printTimeline($timeline, 300, '', date('Y-m-d'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user