Merge branch 'seeddms-4.3.x' into seeddms-5.0.x

This commit is contained in:
Uwe Steinmann 2015-09-23 16:03:15 +02:00
commit 42dbb30e22
3 changed files with 11 additions and 5 deletions

View File

@ -2159,9 +2159,15 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
if (is_bool($resArr) && !$resArr)
return false;
/* The above query will also contain entries where a document status exists
* but no status log entry. Those records will have no date and must be
* skipped.
*/
foreach ($resArr as $row) {
$date = $row['date'];
$timeline[] = array('date'=>$date, 'msg'=>'Version '.$row['version'].': Status change to '.$row['status'], 'type'=>'status_change', 'version'=>$row['version'], 'document'=>$this, 'status'=>$row['status'], 'params'=>array($row['version'], $row['status']));
if($row['date']) {
$date = $row['date'];
$timeline[] = array('date'=>$date, 'msg'=>'Version '.$row['version'].': Status change to '.$row['status'], 'type'=>'status_change', 'version'=>$row['version'], 'document'=>$this, 'status'=>$row['status'], 'params'=>array($row['version'], $row['status']));
}
}
return $timeline;
} /* }}} */
@ -4454,7 +4460,7 @@ class SeedDMS_Core_AddContentResultSet { /* {{{ */
if (!is_integer($status)) {
return false;
}
if ($status<-3 || $status>2) {
if ($status<-3 || $status>3) {
return false;
}
$this->_status = $status;

View File

@ -41,7 +41,7 @@ if(!empty($_GET['todate'])) {
$to = time();
}
if(isset($_GET['skip'])) {
if(isset($_GET['skip']))
$skip = $_GET['skip'];
else
$skip = array();

View File

@ -1181,9 +1181,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</div>
<?php
if($user->isAdmin()) {
$this->contentHeading(getMLText("timeline"));
$timeline = $document->getTimeline();
if($timeline) {
$this->contentHeading(getMLText("timeline"));
foreach($timeline as &$item) {
switch($item['type']) {
case 'add_version':