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

This commit is contained in:
Uwe Steinmann 2020-05-20 06:26:20 +02:00
commit a2e07e34d5
4 changed files with 17 additions and 11 deletions

View File

@ -169,6 +169,7 @@
- use standard output for document rows on MyDocuments page
- new seeddms logo
- fix moving clipboard (Closes: #473)
- show access rights of folder/document if user has write access
--------------------------------------------------------------------------------
Changes in version 5.1.16

View File

@ -19,7 +19,7 @@ function usage() { /* {{{ */
echo " -h, --help: print usage information and exit.\n";
echo " -v, --version: print version and exit.\n";
echo " --config: set alternative config file.\n";
echo " --mode: set mode of operation (run, check, list).\n";
echo " --mode: set mode of operation (run, dryrun, check, list).\n";
} /* }}} */
$version = "0.0.1";
@ -49,7 +49,7 @@ if(isset($options['config'])) {
$mode = 'list';
if(isset($options['mode'])) {
if(!in_array($options['mode'], array('run', 'check', 'list'))) {
if(!in_array($options['mode'], array('run', 'dryrun', 'check', 'list'))) {
usage();
exit(1);
}
@ -71,15 +71,20 @@ foreach($tasks as $task) {
if(isset($GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$task->getExtension()]) && is_object($taskobj = $GLOBALS['SEEDDMS_SCHEDULER']['tasks'][$task->getExtension()][$task->getTask()])) {
switch($mode) {
case "run":
case "dryrun":
if(method_exists($taskobj, 'execute')) {
if(!$task->getDisabled()) {
if(!$task->getDisabled() && $task->isDue()) {
if($user = $dms->getUserByLogin('cli_scheduler')) {
if($taskobj->execute($task, $dms, $user)) {
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." successful.");
$task->updateLastNextRun();
} else {
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." failed, task has been disabled.", PEAR_LOG_ERR);
$task->setDisabled(1);
if($mode == 'run') {
if($taskobj->execute($task, $dms, $user)) {
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." successful.");
$task->updateLastNextRun();
} else {
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." failed, task has been disabled.", PEAR_LOG_ERR);
$task->setDisabled(1);
}
} elseif($mode == 'dryrun') {
echo "Running ".$task->getExtension()."::".$task->getTask()."\n";
}
} else {
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." failed because of missing user 'cli_scheduler'. Task has been disabled.", PEAR_LOG_ERR);

View File

@ -268,7 +268,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</tr>
<?php
}
if($user->isAdmin()) {
if($user->isAdmin() || $document->getAccessMode($user) > M_READ) {
echo "<tr>";
echo "<td>".getMLText('default_access').":</td>";
echo "<td>".$this->getAccessModeText($document->getDefaultAccess())."</td>";

View File

@ -262,7 +262,7 @@ $('body').on('click', '.order-btn', function(ev) {
echo "</tr>";
}
if($user->isAdmin()) {
if($user->isAdmin() || $folder->getAccessMode($user) > M_READ) {
echo "<tr>";
echo "<td>".getMLText('default_access').":</td>";
echo "<td>".$this->getAccessModeText($folder->getDefaultAccess())."</td>";