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

This commit is contained in:
Uwe Steinmann 2020-02-25 17:14:36 +01:00
commit 33c4f88636
16 changed files with 160 additions and 28 deletions

View File

@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
Changes in version 6.0.8
--------------------------------------------------------------------------------
- merge changes up to 5.1.15
--------------------------------------------------------------------------------
Changes in version 6.0.7
--------------------------------------------------------------------------------
@ -117,6 +122,12 @@
- add document list which can be exported as an archive
- search results can be exported
--------------------------------------------------------------------------------
Changes in version 5.1.15
--------------------------------------------------------------------------------
- Improved import from file system
- HTTP Proxy for access on external extension repository can be set
--------------------------------------------------------------------------------
Changes in version 5.1.14
--------------------------------------------------------------------------------

View File

@ -459,7 +459,7 @@ class SeedDMS_Core_DMS {
$this->callbacks = array();
$this->version = '@package_version@';
if($this->version[0] == '@')
$this->version = '6.0.7';
$this->version = '6.0.8';
} /* }}} */
/**

View File

@ -12,11 +12,11 @@
<email>uwe@steinmann.cx</email>
<active>yes</active>
</lead>
<date>2020-02-17</date>
<date>2020-02-18</date>
<time>09:16:48</time>
<version>
<release>6.0.7</release>
<api>6.0.7</api>
<release>6.0.8</release>
<api>6.0.8</api>
</version>
<stability>
<release>stable</release>
@ -24,11 +24,6 @@
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
SeedDMS_Core_Document::getTimeline() returns revision only for latest content
add callback onSetStatus in SeedDMS_Core_DocumentContent::setStatus()
add new list type 'DueRevision' in SeedDMS_Core_DMS::getDocumentList()
a revision can also be started if some revisors have already reviewed the document
remove a user from all its process can also be used to set a new user
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">
@ -1720,8 +1715,8 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
</notes>
</release>
<release>
<date>2019-12-13</date>
<time>07:31:17</time>
<date>2020-02-17</date>
<time>09:16:48</time>
<version>
<release>5.1.14</release>
<api>5.1.14</api>
@ -1735,6 +1730,21 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
- speed up SeedDMS_Core_Folder::getSubFolders() SeedDMS_Core_Folder::getDocuments() by minimizing the number of sql queries.
</notes>
</release>
<release>
<date>2020-02-18</date>
<time>09:16:48</time>
<version>
<release>5.1.15</release>
<api>5.1.15</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
</notes>
</release>
<release>
<date>2017-02-28</date>
<time>06:34:50</time>
@ -1885,5 +1895,25 @@ if currently in S_DRAFT status und no workflow, review, approval, or revision
is pending.
</notes>
</release>
<release>
<date>2020-02-17</date>
<time>09:16:48</time>
<version>
<release>6.0.7</release>
<api>6.0.7</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
SeedDMS_Core_Document::getTimeline() returns revision only for latest content
add callback onSetStatus in SeedDMS_Core_DocumentContent::setStatus()
add new list type 'DueRevision' in SeedDMS_Core_DMS::getDocumentList()
a revision can also be started if some revisors have already reviewed the document
remove a user from all its process can also be used to set a new user
</notes>
</release>
</changelog>
</package>

View File

@ -58,6 +58,16 @@ class SeedDMS_Controller_RemoveFolder extends SeedDMS_Controller_Common {
if($index)
$dms->setCallback('onPreRemoveDocument', 'removeFromIndex', array($index, $indexconf));
function removePreviews($arr, $document) {
$previewer = $arr[0];
$previewer->deleteDocumentPreviews($document);
return null;
}
require_once("SeedDMS/Preview.php");
$previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir);
$dms->addCallback('onPreRemoveDocument', 'removePreviews', array($previewer));
if (!$folder->remove()) {
$this->errormsg = 'error_occured';
return false;

View File

@ -104,6 +104,12 @@ class Settings { /* {{{ */
var $_createCheckOutDir = false;
// Where the repository for extensions is located
var $_repositoryUrl = null;
// URL of proxy
var $_proxyUrl = null;
// User of proxy
var $_proxyUser = null;
// Password of proxy
var $_proxyPassword = null;
// enable removal of file from dropfolder after success import
var $_removeFromDropFolder = false;
// Where the stop word file is located

View File

@ -20,7 +20,7 @@
class SeedDMS_Version { /* {{{ */
const _number = "6.0.7";
const _number = "6.0.8";
const _string = "SeedDMS";
function __construct() {

View File

@ -455,6 +455,16 @@ switch($command) {
'groups'=>array_unique(array_merge($fnl['groups'], $pnl['groups']), SORT_REGULAR)
);
$foldername = $folder->getName();
function removePreviews($arr, $document) {
$previewer = $arr[0];
$previewer->deleteDocumentPreviews($document);
return null;
}
require_once("SeedDMS/Preview.php");
$previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir);
$dms->addCallback('onPreRemoveDocument', 'removePreviews', array($previewer));
if($folder->remove()) {
if ($notifier) {
$subject = "folder_deleted_email_subject";

View File

@ -48,6 +48,33 @@ if(strpos($dirname, realpath($settings->_dropFolderDir.'/'.$user->getLogin().'/'
UI::exitError(getMLText("admin_tools"),getMLText("invalid_dropfolder_folder"));
}
function getBaseData($colname, $coldata, $objdata) { /* {{{ */
$objdata[$colname] = $coldata;
return $objdata;
} /* }}} */
function getAttributeData($attrdef, $coldata, $objdata) { /* {{{ */
$objdata['attributes'][$attrdef->getID()] = $coldata;
return $objdata;
} /* }}} */
function getCategoryData($colname, $coldata, $objdata) { /* {{{ */
global $catids;
$kk = explode(',', $coldata);
foreach($kk as $k) {
if(isset($catids[$k]))
$objdata['category'][] = $catids[$k];
}
return $objdata;
} /* }}} */
function getUserData($colname, $coldata, $objdata) { /* {{{ */
global $userids;
if(isset($userids[$coldata]))
$objdata['owner'] = $userids[$coldata];
return $objdata;
} /* }}} */
$metadata = array();
if(!empty($_GET["dropfolderfileform2"])) {
$metadatafile = realpath($settings->_dropFolderDir.'/'.$user->getLogin()."/".$_GET["dropfolderfileform2"]);
@ -56,34 +83,53 @@ if(!empty($_GET["dropfolderfileform2"])) {
if($fp = fopen($metadatafile, 'r')) {
$colmap = array();
if($header = fgetcsv($fp, 0, $csvdelim, $csvencl)) {
print_r($header);
foreach($header as $i=>$colname) {
if(in_array($colname, array('filename', 'category'))) {
$colmap[$colname] = $i;
$colname = trim($colname);
if(in_array($colname, array('category'))) {
$colmap[$i] = array("getCategoryData", $colname);
} elseif(in_array($colname, array('owner'))) {
$colmap[$i] = array("getUserData", $colname);
} elseif(in_array($colname, array('filename', 'category', 'name', 'comment'))) {
$colmap[$i] = array("getBaseData", $colname);
} elseif(substr($colname, 0, 5) == 'attr:') {
$kk = explode(':', $colname, 2);
if(($attrdef = $dms->getAttributeDefinitionByName($kk[1])) || ($attrdef = $dms->getAttributeDefinition((int) $kk[1]))) {
$colmap[$i] = array("getAttributeData", $attrdef);
}
}
}
}
// echo "<pre>";print_r($colmap);echo "</pre>";
if(count($colmap) > 1) {
$nameprefix = dirname($dirname).'/';
$allcats = $dms->getDocumentCategories();
$catids = array();
foreach($allcats as $cat)
$catids[$cat->getName()] = $cat;
$allusers = $dms->getAllUsers();
$userids = array();
foreach($allusers as $muser)
$userids[$muser->getLogin()] = $muser;
while(!feof($fp)) {
if($data = fgetcsv($fp, 0, $csvdelim, $csvencl)) {
$metadata[$nameprefix.$data[$colmap['filename']]] = array('category'=>array());
if($data[$colmap['category']]) {
$kk = explode(',', $data[$colmap['category']]);
foreach($kk as $k) {
if(isset($catids[$k]))
$metadata[$nameprefix.$data[$colmap['filename']]]['category'][] = $catids[$k];
$mi = $nameprefix.$data[$colmap['filename']];
// $metadata[$mi] = array('category'=>array());
$md = array();
$md['attributes'] = array();
foreach($data as $i=>$coldata) {
if(isset($colmap[$i])) {
$md = call_user_func($colmap[$i][0], $colmap[$i][1], $coldata, $md);
}
}
if(!empty($md['filename']))
$metadata[$nameprefix.$md['filename']] = $md;
}
}
}
}
}
//echo "<pre>";print_r($metadata);echo "</pre>";
//exit;
$setfiledate = false;
if(isset($_GET['setfiledate']) && $_GET["setfiledate"]) {
@ -109,7 +155,6 @@ function import_folder($dirname, $folder, $setfiledate, $setfolderdate, $metadat
$reviewers = array();
$approvers = array();
$comment = '';
$version_comment = '';
$reqversion = 1;
$expires = false;
@ -122,11 +167,16 @@ function import_folder($dirname, $folder, $setfiledate, $setfolderdate, $metadat
if (is_bool($lastDotIndex) && !$lastDotIndex) $filetype = ".";
else $filetype = substr($name, $lastDotIndex);
// echo $mimetype." - ".$filetype." - ".$path."\n";
if($res = $folder->addDocument($name, $comment, $expires, $user, $keywords,
$docname = !empty($metadata[$path]['name']) ? $metadata[$path]['name'] : $name;
$comment = !empty($metadata[$path]['comment']) ? $metadata[$path]['comment'] : '';
$owner = !empty($metadata[$path]['owner']) ? $metadata[$path]['owner'] : $user;
echo $mimetype." - ".$filetype." - ".$path."<br />\n";
if($res = $folder->addDocument($docname, $comment, $expires, $owner, $keywords,
$metadata[$path]['category'], $filetmp, $name,
$filetype, $mimetype, $sequence, $reviewers,
$approvers, $reqversion, $version_comment)) {
$approvers, $reqversion, $version_comment,
$metadata[$path]['attributes'])) {
$doccount++;
if($setfiledate) {
$newdoc = $res[0];
@ -135,7 +185,9 @@ function import_folder($dirname, $folder, $setfiledate, $setfolderdate, $metadat
$lc->setDate(filemtime($path));
}
} else {
return false;
echo "Error importing ".$path."<br />";
echo "<pre>".print_r($res, true)."</pre>";
// return false;
}
set_time_limit(30);
} elseif(is_dir($path)) {
@ -148,7 +200,7 @@ function import_folder($dirname, $folder, $setfiledate, $setfolderdate, $metadat
if(!import_folder($path, $newfolder, $setfiledate, $setfolderdate, $metadata))
return false;
} else {
return false;
// return false;
}
}
$sequence++;

View File

@ -61,15 +61,17 @@ if($settings->_enableFullSearch) {
$index = null;
}
/*
function removePreviews($arr, $document) {
$previewer = $arr[0];
$previewer->deleteDocumentPreviews($document);
return true;
return null;
}
require_once("SeedDMS/Preview.php");
$previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir);
$dms->addCallback('onPreRemoveDocument', 'removePreviews', array($previewer));
*/
/* Get the notify list before removing the folder
* Also inform the users/groups of the parent folder

View File

@ -131,6 +131,9 @@ if ($action == "saveSettings")
$settings->_checkOutDir = addDirSep($_POST["checkOutDir"]);
$settings->_createCheckOutDir = getBoolValue("createCheckOutDir");
$settings->_repositoryUrl = addDirSep($_POST["repositoryUrl"]);
$settings->_proxyUrl = addDirSep($_POST["proxyUrl"]);
$settings->_proxyUser = addDirSep($_POST["proxyUser"]);
$settings->_proxyPassword = addDirSep($_POST["proxyPassword"]);
$settings->_logFileEnable = getBoolValue("logFileEnable");
$settings->_logFileRotation = $_POST["logFileRotation"];
$settings->_enableLargeFileUpload = getBoolValue("enableLargeFileUpload");

1
styles/.htaccess Normal file
View File

@ -0,0 +1 @@
Options -Indexes

View File

@ -48,6 +48,7 @@ $(document).ready( function() {
});
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {attrdefid: $(this).val()});
window.history.pushState({"html":"","pageTitle":""},"", '../out/out.AttributeMgr.php?attrdefid=' + $(this).val());
});
});
<?php

View File

@ -62,6 +62,7 @@ class SeedDMS_Bootstrap_Style extends SeedDMS_View_Common {
header($csp . ": " . $csp_rules);
}
}
// header('X-Content-Type-Options: nosniff');
if($httpheader) {
foreach($httpheader as $name=>$value) {
header($name . ": " . $value);

View File

@ -101,6 +101,7 @@ $(document).ready( function() {
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {groupid: $(this).val()});
window.history.pushState({"html":"","pageTitle":""},"", '../out/out.GroupMgr.php?groupid=' + $(this).val());
});
});
<?php

View File

@ -357,6 +357,9 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site'));
<?php $this->showConfigText('settings_checkOutDir', 'checkOutDir'); ?>
<?php $this->showConfigCheckbox('settings_createCheckOutDir', 'createCheckOutDir'); ?>
<?php $this->showConfigText('settings_repositoryUrl', 'repositoryUrl'); ?>
<?php $this->showConfigText('settings_proxyUrl', 'proxyUrl'); ?>
<?php $this->showConfigText('settings_proxyUser', 'proxyUser'); ?>
<?php $this->showConfigText('settings_proxyUPassword', 'proxyPassword', 'password'); ?>
<?php $this->showConfigCheckbox('settings_logFileEnable', 'logFileEnable'); ?>
<?php $this->showConfigOption('settings_logFileRotation', 'logFileRotation', array('h'=>'hourly', 'd'=>'daily', 'm'=>'monthly'), false, true); ?>
<?php $this->showConfigCheckbox('settings_enableLargeFileUpload', 'enableLargeFileUpload'); ?>

View File

@ -77,6 +77,7 @@ $(document).ready( function() {
});
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {userid: $(this).val()});
window.history.pushState({"html":"","pageTitle":""},"", '../out/out.UsrMgr.php?userid=' + $(this).val());
});
});
<?php