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

This commit is contained in:
Uwe Steinmann 2024-04-22 14:49:18 +02:00
commit 50b25a59ec
6 changed files with 20 additions and 16 deletions

View File

@ -30,7 +30,7 @@ class Controller {
* @return object an object of a class implementing the view
*/
static function factory($class, $params=array()) { /* {{{ */
global $settings, $session, $extMgr, $request;
global $settings, $session, $extMgr, $request, $logger;
if(!$class) {
return null;
}
@ -59,6 +59,7 @@ class Controller {
$controller->setParam('session', $session);
$controller->setParam('request', $request);
$controller->setParam('settings', $settings);
$controller->setParam('logger', $logger);
return $controller;
}
return null;

View File

@ -46,7 +46,7 @@ class UI extends UI_Default {
* @return object an object of a class implementing the view
*/
static function factory($theme, $class='', $params=array()) { /* {{{ */
global $settings, $dms, $user, $session, $extMgr, $request;
global $settings, $dms, $user, $session, $extMgr, $request, $logger;
if(!$class) {
$class = 'Bootstrap';
$class = 'Style';
@ -135,6 +135,7 @@ class UI extends UI_Default {
$view->setParam('class', $class);
$view->setParam('session', $session);
$view->setParam('request', $request);
$view->setParam('logger', $logger);
// $view->setParam('settings', $settings);
$view->setParam('sitename', $settings->_siteName);
$view->setParam('rootfolderid', $settings->_rootFolderID);

View File

@ -1754,11 +1754,11 @@ $(document).ready(function() {
function getSequenceChooser($parent, $type, $keepID = -1) { /* {{{ */
$objArr = [];
if($type == 'd') {
if(($c = $parent->hasDocuments()) < 50)
if(($c = $parent->hasDocuments()) < 200)
$objArr = $parent->getDocuments('s');
$minmax = $parent->getDocumentsMinMax();
} elseif($type = 'f') {
if(($c = $parent->hasSubFolders()) < 50)
if(($c = $parent->hasSubFolders()) < 200)
$objArr = $parent->getSubFolders('s');
$minmax = $parent->getFoldersMinMax();
} else
@ -1772,7 +1772,7 @@ $(document).ready(function() {
$min = (float) $minmax['min'];
$max = $minmax['max']+1.0;
}
$content = "<select name=\"sequence\">\n";
$content = "<select class=\"chzn-select\" name=\"sequence\">\n";
if ($keepID != -1) {
$content .= " <option value=\"keep\">" . getMLText("seq_keep");
}

View File

@ -668,9 +668,10 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php
break;
case 'select':
$allowempty = empty($conf['allow_empty']) ? false : $conf['allow_empty'];
if(!empty($conf['options'])) {
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
echo "<select class=\"chzn-select\" name=\"extensions[".$extname."][".$confkey."][]\"".(!empty($conf['multiple']) ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." style=\"width: 100%;\">";
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")." name=\"extensions[".$extname."][".$confkey."][]\"".(!empty($conf['multiple']) ? " multiple" : "").(!empty($conf['size']) ? " size=\"".$conf['size']."\"" : "")." style=\"width: 100%;\">";
if(is_array($conf['options'])) {
$options = $conf['options'];
} elseif(is_string($conf['options']) && $conf['options'] == 'hook') {
@ -678,6 +679,8 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
} else {
$options = [];
}
if($allowempty)
echo "<option value=\"\"></option>";
foreach($options as $key=>$opt) {
echo "<option value=\"".$key."\"";
if(in_array($key, $selections))
@ -687,7 +690,6 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
echo "</select>";
} elseif(!empty($conf['internal'])) {
$selections = empty($settings->_extensions[$extname][$confkey]) ? array() : explode(",", $settings->_extensions[$extname][$confkey]);
$allowempty = empty($conf['allow_empty']) ? false : $conf['allow_empty'];
switch($conf['internal']) {
case "categories":
$categories = $dms->getDocumentCategories();

View File

@ -1692,11 +1692,11 @@ $(document).ready(function() {
function getSequenceChooser($parent, $type, $keepID = -1) { /* {{{ */
$objArr = [];
if($type == 'd') {
if(($c = $parent->hasDocuments()) < 50)
if(($c = $parent->hasDocuments()) < 200)
$objArr = $parent->getDocuments('s');
$minmax = $parent->getDocumentsMinMax();
} elseif($type = 'f') {
if(($c = $parent->hasSubFolders()) < 50)
if(($c = $parent->hasSubFolders()) < 200)
$objArr = $parent->getSubFolders('s');
$minmax = $parent->getFoldersMinMax();
} else
@ -1710,7 +1710,7 @@ $(document).ready(function() {
$min = (float) $minmax['min'];
$max = $minmax['max']+1.0;
}
$content = "<select class=\"form-control\" name=\"sequence\">\n";
$content = "<select class=\"form-control chzn-select\" data-allow-clear=\"false\" name=\"sequence\">\n";
if ($keepID != -1) {
$content .= " <option value=\"keep\">" . getMLText("seq_keep");
}

View File

@ -737,9 +737,9 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$workflow = null;
if($this->settings->_workflowMode == 'traditional' || $this->settings->_workflowMode == 'traditional_only_approval') {
if($this->settings->_workflowMode == 'traditional') {
$reviewers = getMandatoryReviewers($document->getFolder(), $this->user);
$reviewers = getMandatoryReviewers($document->getFolder(), $document, $this->user);
}
$approvers = getMandatoryApprovers($document->getFolder(), $this->user);
$approvers = getMandatoryApprovers($document->getFolder(), $document, $this->user);
} elseif($this->settings->_workflowMode == 'advanced') {
if($workflows = $this->user->getMandatoryWorkflows()) {
$workflow = array_shift($workflows);
@ -809,9 +809,9 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$workflow = null;
if($this->settings->_workflowMode == 'traditional' || $this->settings->_workflowMode == 'traditional_only_approval') {
if($this->settings->_workflowMode == 'traditional') {
$reviewers = getMandatoryReviewers($folder, $this->user);
$reviewers = getMandatoryReviewers($folder, null, $this->user);
}
$approvers = getMandatoryApprovers($folder, $this->user);
$approvers = getMandatoryApprovers($folder, null, $this->user);
} elseif($this->settings->_workflowMode == 'advanced') {
if($workflows = $this->user->getMandatoryWorkflows()) {
$workflow = array_shift($workflows);
@ -1286,9 +1286,9 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$workflow = null;
if($this->settings->_workflowMode == 'traditional' || $this->settings->_workflowMode == 'traditional_only_approval') {
if($this->settings->_workflowMode == 'traditional') {
$reviewers = getMandatoryReviewers($objdest, $this->user);
$reviewers = getMandatoryReviewers($objdest, null, $this->user);
}
$approvers = getMandatoryApprovers($objdest, $this->user);
$approvers = getMandatoryApprovers($objdest, null, $this->user);
} elseif($this->settings->_workflowMode == 'advanced') {
if($workflows = $this->user->getMandatoryWorkflows()) {
$workflow = array_shift($workflows);