Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2017-07-20 15:09:39 +02:00
commit 7259c668c4
5 changed files with 51 additions and 49 deletions

View File

@ -163,8 +163,12 @@
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 4.3.36 Changes in version 4.3.36
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
- mark disabled users in user list and substitute user list
- if expandFolderTree is set to hidden the tree actually is hidden (partially
closes #312)
- fix sql statement for creating temp. tables (sqlite) - fix sql statement for creating temp. tables (sqlite)
- remove empty lines at end of view/bootstrap/class.*.php files (Closes #329) - remove empty lines at end of view/bootstrap/class.*.php files (Closes #329)
- make sure contentDir ends with DIRECTORY_SEPARATOR (Closes #323)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 4.3.35 Changes in version 4.3.35

View File

@ -475,6 +475,8 @@ class Settings { /* {{{ */
$this->_rootDir = strval($tab["rootDir"]); $this->_rootDir = strval($tab["rootDir"]);
$this->_httpRoot = strval($tab["httpRoot"]); $this->_httpRoot = strval($tab["httpRoot"]);
$this->_contentDir = strval($tab["contentDir"]); $this->_contentDir = strval($tab["contentDir"]);
if(substr($this->_contentDir, -1, 1) != DIRECTORY_SEPARATOR)
$this->_contentDir .= DIRECTORY_SEPARATOR;
$this->_cacheDir = strval($tab["cacheDir"]); $this->_cacheDir = strval($tab["cacheDir"]);
$this->_stagingDir = strval($tab["stagingDir"]); $this->_stagingDir = strval($tab["stagingDir"]);
$this->_luceneDir = strval($tab["luceneDir"]); $this->_luceneDir = strval($tab["luceneDir"]);

View File

@ -122,7 +122,7 @@ function cmpVersion($ver1, $ver2) {
// $string = str_replace("/*", "", $string); // $string = str_replace("/*", "", $string);
// $string = str_replace("*/", "", $string); // $string = str_replace("*/", "", $string);
// $string = str_replace("\"", """, $string); // $string = str_replace("\"", """, $string);
// //
// return $string; // return $string;
//} //}
@ -184,48 +184,48 @@ function mydmsDecodeString($string) { /* {{{ */
function createVersionigFile($document) { /* {{{ */ function createVersionigFile($document) { /* {{{ */
global $settings, $dms; global $settings, $dms;
// if directory has been removed recreate it // if directory has been removed recreate it
if (!file_exists($dms->contentDir . $document->getDir())) if (!file_exists($dms->contentDir . $document->getDir()))
if (!SeedDMS_Core_File::makeDir($dms->contentDir . $document->getDir())) return false; if (!SeedDMS_Core_File::makeDir($dms->contentDir . $document->getDir())) return false;
$handle = fopen($dms->contentDir . $document->getDir() .$settings-> _versioningFileName , "wb"); $handle = fopen($dms->contentDir . $document->getDir() .$settings-> _versioningFileName , "wb");
if (is_bool($handle)&&!$handle) return false; if (is_bool($handle)&&!$handle) return false;
$tmp = $document->getName()." (ID ".$document->getID().")\n\n"; $tmp = $document->getName()." (ID ".$document->getID().")\n\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$owner = $document->getOwner(); $owner = $document->getOwner();
$tmp = getMLText("owner")." = ".$owner->getFullName()." <".$owner->getEmail().">\n"; $tmp = getMLText("owner")." = ".$owner->getFullName()." <".$owner->getEmail().">\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("creation_date")." = ".getLongReadableDate($document->getDate())."\n"; $tmp = getMLText("creation_date")." = ".getLongReadableDate($document->getDate())."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$latestContent = $document->getLatestContent(); $latestContent = $document->getLatestContent();
$tmp = "\n### ".getMLText("current_version")." ###\n\n"; $tmp = "\n### ".getMLText("current_version")." ###\n\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("version")." = ".$latestContent->getVersion()."\n"; $tmp = getMLText("version")." = ".$latestContent->getVersion()."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("file")." = ".$latestContent->getOriginalFileName()." (".$latestContent->getMimeType().")\n"; $tmp = getMLText("file")." = ".$latestContent->getOriginalFileName()." (".$latestContent->getMimeType().")\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $latestContent->getComment()."\n"; $tmp = getMLText("comment")." = ". $latestContent->getComment()."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$status = $latestContent->getStatus(); $status = $latestContent->getStatus();
$tmp = getMLText("status")." = ".getOverallStatusText($status["status"])."\n"; $tmp = getMLText("status")." = ".getOverallStatusText($status["status"])."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$reviewStatus = $latestContent->getReviewStatus(); $reviewStatus = $latestContent->getReviewStatus();
$tmp = "\n### ".getMLText("reviewers")." ###\n"; $tmp = "\n### ".getMLText("reviewers")." ###\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
foreach ($reviewStatus as $r) { foreach ($reviewStatus as $r) {
switch ($r["type"]) { switch ($r["type"]) {
case 0: // Reviewer is an individual. case 0: // Reviewer is an individual.
$required = $dms->getUser($r["required"]); $required = $dms->getUser($r["required"]);
@ -241,25 +241,25 @@ function createVersionigFile($document) { /* {{{ */
$tmp = "\n".$reqName."\n"; $tmp = "\n".$reqName."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("status")." = ".getReviewStatusText($r["status"])."\n"; $tmp = getMLText("status")." = ".getReviewStatusText($r["status"])."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $r["comment"]."\n"; $tmp = getMLText("comment")." = ". $r["comment"]."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("last_update")." = ".$r["date"]."\n"; $tmp = getMLText("last_update")." = ".$r["date"]."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
} }
$approvalStatus = $latestContent->getApprovalStatus(); $approvalStatus = $latestContent->getApprovalStatus();
$tmp = "\n### ".getMLText("approvers")." ###\n"; $tmp = "\n### ".getMLText("approvers")." ###\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
foreach ($approvalStatus as $r) { foreach ($approvalStatus as $r) {
switch ($r["type"]) { switch ($r["type"]) {
case 0: // Reviewer is an individual. case 0: // Reviewer is an individual.
$required = $dms->getUser($r["required"]); $required = $dms->getUser($r["required"]);
@ -275,42 +275,42 @@ function createVersionigFile($document) { /* {{{ */
$tmp = "\n".$reqName."\n"; $tmp = "\n".$reqName."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("status")." = ".getApprovalStatusText($r["status"])."\n"; $tmp = getMLText("status")." = ".getApprovalStatusText($r["status"])."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $r["comment"]."\n"; $tmp = getMLText("comment")." = ". $r["comment"]."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("last_update")." = ".$r["date"]."\n"; $tmp = getMLText("last_update")." = ".$r["date"]."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
} }
$versions = $document->getContent(); $versions = $document->getContent();
$tmp = "\n### ".getMLText("previous_versions")." ###\n"; $tmp = "\n### ".getMLText("previous_versions")." ###\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
for ($i = count($versions)-2; $i >= 0; $i--){ for ($i = count($versions)-2; $i >= 0; $i--){
$version = $versions[$i]; $version = $versions[$i];
$status = $version->getStatus(); $status = $version->getStatus();
$tmp = "\n".getMLText("version")." = ".$version->getVersion()."\n"; $tmp = "\n".getMLText("version")." = ".$version->getVersion()."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("file")." = ".$version->getOriginalFileName()." (".$version->getMimeType().")\n"; $tmp = getMLText("file")." = ".$version->getOriginalFileName()." (".$version->getMimeType().")\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $version->getComment()."\n"; $tmp = getMLText("comment")." = ". $version->getComment()."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
$status = $latestContent->getStatus(); $status = $latestContent->getStatus();
$tmp = getMLText("status")." = ".getOverallStatusText($status["status"])."\n"; $tmp = getMLText("status")." = ".getOverallStatusText($status["status"])."\n";
fwrite($handle, $tmp); fwrite($handle, $tmp);
} }
fclose($handle); fclose($handle);
return true; return true;
} /* }}} */ } /* }}} */
@ -388,13 +388,13 @@ function add_log_line($msg="", $priority=null) { /* {{{ */
function _add_log_line($msg="") { /* {{{ */ function _add_log_line($msg="") { /* {{{ */
global $settings,$user; global $settings,$user;
if ($settings->_logFileEnable!=TRUE) return; if ($settings->_logFileEnable!=TRUE) return;
if ($settings->_logFileRotation=="h") $logname=date("YmdH", time()); if ($settings->_logFileRotation=="h") $logname=date("YmdH", time());
else if ($settings->_logFileRotation=="d") $logname=date("Ymd", time()); else if ($settings->_logFileRotation=="d") $logname=date("Ymd", time());
else $logname=date("Ym", time()); else $logname=date("Ym", time());
if($h = fopen($settings->_contentDir.$logname.".log", "a")) { if($h = fopen($settings->_contentDir.$logname.".log", "a")) {
fwrite($h,date("Y/m/d H:i", time())." ".$user->getLogin()." (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg."\n"); fwrite($h,date("Y/m/d H:i", time())." ".$user->getLogin()." (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg."\n");
fclose($h); fclose($h);
@ -419,13 +419,13 @@ function _add_log_line($msg="") { /* {{{ */
return $txtpath; return $txtpath;
} /* }}} */ } /* }}} */
function showtree() { /* {{{ */ function showtree() { /* {{{ */
global $settings; global $settings;
if (isset($_GET["showtree"])) return intval($_GET["showtree"]); if (isset($_GET["showtree"])) return intval($_GET["showtree"]);
else if ($settings->_enableFolderTree==0) return 0; else if ($settings->_expandFolderTree==0) return 0;
return 1; return 1;
} /* }}} */ } /* }}} */
@ -458,7 +458,7 @@ function createFormKey($formid='') { /* {{{ */
* @return string input field for html formular * @return string input field for html formular
*/ */
function createHiddenFieldWithKey($formid='') { /* {{{ */ function createHiddenFieldWithKey($formid='') { /* {{{ */
return '<input type="hidden" name="formtoken" value="'.createFormKey($formid).'" />'; return '<input type="hidden" name="formtoken" value="'.createFormKey($formid).'" />';
} /* }}} */ } /* }}} */
/** /**
@ -482,7 +482,7 @@ function checkFormKey($formid='', $method='POST') { /* {{{ */
if(isset($_POST['formtoken']) && $_POST['formtoken'] == createFormKey($formid)) if(isset($_POST['formtoken']) && $_POST['formtoken'] == createFormKey($formid))
return true; return true;
} }
return false; return false;
} /* }}} */ } /* }}} */

View File

@ -45,7 +45,6 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Bootstrap_Style {
$this->pageNavigation(getMLText("admin_tools"), "admin_tools"); $this->pageNavigation(getMLText("admin_tools"), "admin_tools");
$this->contentHeading(getMLText("substitute_user")); $this->contentHeading(getMLText("substitute_user"));
$this->contentContainerStart();
?> ?>
<table class="table table-condensed"> <table class="table table-condensed">
<thead> <thead>
@ -54,7 +53,7 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Bootstrap_Style {
<tbody> <tbody>
<?php <?php
foreach ($allUsers as $currUser) { foreach ($allUsers as $currUser) {
echo "<tr>"; echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">";
echo "<td>"; echo "<td>";
echo htmlspecialchars($currUser->getFullName())." (".htmlspecialchars($currUser->getLogin()).")<br />"; echo htmlspecialchars($currUser->getFullName())." (".htmlspecialchars($currUser->getLogin()).")<br />";
echo "<small>".htmlspecialchars($currUser->getComment())."</small>"; echo "<small>".htmlspecialchars($currUser->getComment())."</small>";
@ -97,7 +96,6 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Bootstrap_Style {
} }
echo "</tbody>"; echo "</tbody>";
echo "</table>"; echo "</table>";
$this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();

View File

@ -44,7 +44,6 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
$this->contentStart(); $this->contentStart();
$this->pageNavigation("", "admin_tools"); $this->pageNavigation("", "admin_tools");
$this->contentHeading(getMLText("user_list")); $this->contentHeading(getMLText("user_list"));
$this->contentContainerStart();
$sessionmgr = new SeedDMS_SessionMgr($dms->getDB()); $sessionmgr = new SeedDMS_SessionMgr($dms->getDB());
?> ?>
@ -53,7 +52,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
<thead><tr><th></th><th><?php printMLText('name'); ?></th><th><?php printMLText('groups'); ?></th><th><?php printMLText('role'); ?></th><th><?php printMLText('discspace'); ?></th><th><?php printMLText('authentication'); ?></th><th></th></tr></thead><tbody> <thead><tr><th></th><th><?php printMLText('name'); ?></th><th><?php printMLText('groups'); ?></th><th><?php printMLText('role'); ?></th><th><?php printMLText('discspace'); ?></th><th><?php printMLText('authentication'); ?></th><th></th></tr></thead><tbody>
<?php <?php
foreach ($allUsers as $currUser) { foreach ($allUsers as $currUser) {
echo "<tr>"; echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">";
echo "<td>"; echo "<td>";
if ($currUser->hasImage()) if ($currUser->hasImage())
print "<img width=\"100\" src=\"".$this->html_url('UserImage', array('userid'=>$currUser->getId()))."\" >"; print "<img width=\"100\" src=\"".$this->html_url('UserImage', array('userid'=>$currUser->getId()))."\" >";
@ -116,7 +115,6 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
} }
echo "</tbody></table>"; echo "</tbody></table>";
$this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */