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

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

View File

@ -99,8 +99,12 @@
--------------------------------------------------------------------------------
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)
- 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

View File

@ -441,6 +441,8 @@ class Settings { /* {{{ */
$this->_rootDir = strval($tab["rootDir"]);
$this->_httpRoot = strval($tab["httpRoot"]);
$this->_contentDir = strval($tab["contentDir"]);
if(substr($this->_contentDir, -1, 1) != DIRECTORY_SEPARATOR)
$this->_contentDir .= DIRECTORY_SEPARATOR;
$this->_cacheDir = strval($tab["cacheDir"]);
$this->_stagingDir = strval($tab["stagingDir"]);
$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);
//
//
// return $string;
//}
@ -184,48 +184,48 @@ function mydmsDecodeString($string) { /* {{{ */
function createVersionigFile($document) { /* {{{ */
global $settings, $dms;
// if directory has been removed recreate it
if (!file_exists($dms->contentDir . $document->getDir()))
if (!SeedDMS_Core_File::makeDir($dms->contentDir . $document->getDir())) return false;
$handle = fopen($dms->contentDir . $document->getDir() .$settings-> _versioningFileName , "wb");
if (is_bool($handle)&&!$handle) return false;
$tmp = $document->getName()." (ID ".$document->getID().")\n\n";
fwrite($handle, $tmp);
$owner = $document->getOwner();
$tmp = getMLText("owner")." = ".$owner->getFullName()." <".$owner->getEmail().">\n";
fwrite($handle, $tmp);
$tmp = getMLText("creation_date")." = ".getLongReadableDate($document->getDate())."\n";
fwrite($handle, $tmp);
$latestContent = $document->getLatestContent();
$tmp = "\n### ".getMLText("current_version")." ###\n\n";
fwrite($handle, $tmp);
$tmp = getMLText("version")." = ".$latestContent->getVersion()."\n";
fwrite($handle, $tmp);
fwrite($handle, $tmp);
$tmp = getMLText("file")." = ".$latestContent->getOriginalFileName()." (".$latestContent->getMimeType().")\n";
fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $latestContent->getComment()."\n";
fwrite($handle, $tmp);
$status = $latestContent->getStatus();
$tmp = getMLText("status")." = ".getOverallStatusText($status["status"])."\n";
fwrite($handle, $tmp);
$reviewStatus = $latestContent->getReviewStatus();
$tmp = "\n### ".getMLText("reviewers")." ###\n";
fwrite($handle, $tmp);
foreach ($reviewStatus as $r) {
switch ($r["type"]) {
case 0: // Reviewer is an individual.
$required = $dms->getUser($r["required"]);
@ -241,25 +241,25 @@ function createVersionigFile($document) { /* {{{ */
$tmp = "\n".$reqName."\n";
fwrite($handle, $tmp);
$tmp = getMLText("status")." = ".getReviewStatusText($r["status"])."\n";
fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $r["comment"]."\n";
fwrite($handle, $tmp);
$tmp = getMLText("last_update")." = ".$r["date"]."\n";
fwrite($handle, $tmp);
}
$approvalStatus = $latestContent->getApprovalStatus();
$tmp = "\n### ".getMLText("approvers")." ###\n";
fwrite($handle, $tmp);
foreach ($approvalStatus as $r) {
switch ($r["type"]) {
case 0: // Reviewer is an individual.
$required = $dms->getUser($r["required"]);
@ -275,42 +275,42 @@ function createVersionigFile($document) { /* {{{ */
$tmp = "\n".$reqName."\n";
fwrite($handle, $tmp);
$tmp = getMLText("status")." = ".getApprovalStatusText($r["status"])."\n";
fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $r["comment"]."\n";
fwrite($handle, $tmp);
$tmp = getMLText("last_update")." = ".$r["date"]."\n";
fwrite($handle, $tmp);
}
$versions = $document->getContent();
$versions = $document->getContent();
$tmp = "\n### ".getMLText("previous_versions")." ###\n";
fwrite($handle, $tmp);
for ($i = count($versions)-2; $i >= 0; $i--){
$version = $versions[$i];
$status = $version->getStatus();
$status = $version->getStatus();
$tmp = "\n".getMLText("version")." = ".$version->getVersion()."\n";
fwrite($handle, $tmp);
fwrite($handle, $tmp);
$tmp = getMLText("file")." = ".$version->getOriginalFileName()." (".$version->getMimeType().")\n";
fwrite($handle, $tmp);
$tmp = getMLText("comment")." = ". $version->getComment()."\n";
fwrite($handle, $tmp);
$status = $latestContent->getStatus();
$tmp = getMLText("status")." = ".getOverallStatusText($status["status"])."\n";
fwrite($handle, $tmp);
}
fclose($handle);
return true;
} /* }}} */
@ -388,13 +388,13 @@ function add_log_line($msg="", $priority=null) { /* {{{ */
function _add_log_line($msg="") { /* {{{ */
global $settings,$user;
if ($settings->_logFileEnable!=TRUE) return;
if ($settings->_logFileRotation=="h") $logname=date("YmdH", time());
else if ($settings->_logFileRotation=="d") $logname=date("Ymd", time());
else $logname=date("Ym", time());
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");
fclose($h);
@ -419,13 +419,13 @@ function _add_log_line($msg="") { /* {{{ */
return $txtpath;
} /* }}} */
function showtree() { /* {{{ */
global $settings;
if (isset($_GET["showtree"])) return intval($_GET["showtree"]);
else if ($settings->_enableFolderTree==0) return 0;
else if ($settings->_expandFolderTree==0) return 0;
return 1;
} /* }}} */
@ -458,7 +458,7 @@ function createFormKey($formid='') { /* {{{ */
* @return string input field for html formular
*/
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))
return true;
}
return false;
} /* }}} */

View File

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

View File

@ -44,7 +44,6 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
$this->contentStart();
$this->pageNavigation("", "admin_tools");
$this->contentHeading(getMLText("user_list"));
$this->contentContainerStart();
$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>
<?php
foreach ($allUsers as $currUser) {
echo "<tr>";
echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">";
echo "<td>";
if ($currUser->hasImage())
print "<img width=\"100\" src=\"".$httproot . "out/out.UserImage.php?userid=".$currUser->getId()."\">";
@ -124,7 +123,6 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
}
echo "</tbody></table>";
$this->contentContainerEnd();
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */