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

This commit is contained in:
Uwe Steinmann 2024-10-26 11:54:43 +02:00
commit d80009e484
8 changed files with 119 additions and 59 deletions

View File

@ -308,7 +308,7 @@
- use rename() on windows when moving an extension to its final destination - use rename() on windows when moving an extension to its final destination
- fixed bug in AddDocument, approver group wasn't checked properly against - fixed bug in AddDocument, approver group wasn't checked properly against
mandatory approvers mandatory approvers
- email from address in settings can be force for all outgoing mail - email From-address in settings can be forced for all outgoing mail
- checking of ssl certificate for smtp can be turned off - checking of ssl certificate for smtp can be turned off
- add chart for disk space per month - add chart for disk space per month
- clearing cache of js files works for a large number of files - clearing cache of js files works for a large number of files

View File

@ -1,3 +1,23 @@
Commands for converting documents
----------------------------------
This file contains commands for converting different document types
into
* text (for fulltext search)
* png (for preview images)
* pdf (for pdf documents)
Such conversions may not necessarily output an excact equivalent of
the input file, but outputs a suitable representation, e.g.
converting an mp3 file into text may output the metadata or even the
lyrics of the song. Converting it into a preview image may result
in a picture of the album cover.
Please note, that when ever a command outputs anything to stderr,
this will considered as a failure of the command. Most command line
programs have a parameter (.e.g. `-q`) to suppress such an output.
Conversion to text for fulltext search Conversion to text for fulltext search
======================================= =======================================
@ -78,6 +98,9 @@ message/rfc822
text/plain text/plain
iconv -c -f utf-8 -t latin1 '%f' | a2ps -1 -q -a1 -R -B -o - - | ps2pdf - - iconv -c -f utf-8 -t latin1 '%f' | a2ps -1 -q -a1 -R -B -o - - | ps2pdf - -
The parameter `-q` is important because a2ps sends some statistical
data to stderr, which makes SeedDMS believe the command has failed.
application/x-xopp application/x-xopp
xournalpp -p "%o" "%f" xournalpp -p "%o" "%f"

View File

@ -1,23 +1,35 @@
<?php <?php
// SeedDMS (Formerly MyDMS) Document Management System /**
// Copyright (C) 2002-2005 Markus Westphal * SeedDMS (Formerly MyDMS) Document Management System
// Copyright (C) 2006-2008 Malcolm Cowe *
// * PHP version 8
// This program is free software; you can redistribute it and/or modify *
// it under the terms of the GNU General Public License as published by * Copyright (C) 2002-2005 Markus Westphal
// the Free Software Foundation; either version 2 of the License, or * Copyright (C) 2006-2008 Malcolm Cowe
// (at your option) any later version. * Copyright (C) 2010-2024 Uwe Steinmann
// *
// This program is distributed in the hope that it will be useful, * This program is free software; you can redistribute it and/or modify
// but WITHOUT ANY WARRANTY; without even the implied warranty of * it under the terms of the GNU General Public License as published by
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * the Free Software Foundation; either version 2 of the License, or
// GNU General Public License for more details. * (at your option) any later version.
// *
// You should have received a copy of the GNU General Public License * This program is distributed in the hope that it will be useful,
// along with this program; if not, write to the Free Software * but WITHOUT ANY WARRANTY; without even the implied warranty of
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* @category SeedDMS
* @package SeedDMS
* @author Uwe Steinmann <info@seeddms.org>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://www.seeddms.org Main Site
*/
require("inc/inc.Settings.php"); require "inc/inc.Settings.php";
if(true) { if(true) {
require_once("inc/inc.Utils.php"); require_once("inc/inc.Utils.php");

View File

@ -1,49 +1,61 @@
<?php <?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010 Matteo Lucarelli
// Copyright (C) 2010-2016 Uwe Steinmann
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
if(!isset($settings)) /**
require_once("../inc/inc.Settings.php"); * MyDMS. Document Management System
require_once("inc/inc.Utils.php"); * Copyright (C) 2002-2005 Markus Westphal
require_once("inc/inc.LogInit.php"); * Copyright (C) 2006-2008 Malcolm Cowe
require_once("inc/inc.Language.php"); * Copyright (C) 2010 Matteo Lucarelli
require_once("inc/inc.Init.php"); * Copyright (C) 2010-2024 Uwe Steinmann
require_once("inc/inc.Extension.php"); *
require_once("inc/inc.DBInit.php"); * PHP version 8
require_once("inc/inc.ClassUI.php"); *
require_once("inc/inc.Authentication.php"); * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* @category SeedDMS
* @package SeedDMS
* @author Uwe Steinmann <info@seeddms.org>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://www.seeddms.org Main Site
*/
if (!isset($settings)) {
require_once "../inc/inc.Settings.php";
}
require_once "inc/inc.Utils.php";
require_once "inc/inc.LogInit.php";
require_once "inc/inc.Language.php";
require_once "inc/inc.Init.php";
require_once "inc/inc.Extension.php";
require_once "inc/inc.DBInit.php";
require_once "inc/inc.ClassUI.php";
require_once "inc/inc.Authentication.php";
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user)); $view = UI::factory($theme, $tmp[1], array('dms' => $dms, 'user' => $user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings); $accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if ($user->isGuest()) { if ($user->isGuest()) {
UI::exitError(getMLText("edit_user_details"),getMLText("access_denied")); UI::exitError(getMLText("edit_user_details"), getMLText("access_denied"));
} }
if (!$user->isAdmin() && ($settings->_disableSelfEdit)) { if (!$user->isAdmin() && ($settings->_disableSelfEdit)) {
UI::exitError(getMLText("edit_user_details"),getMLText("access_denied")); UI::exitError(getMLText("edit_user_details"), getMLText("access_denied"));
} }
if($view) { if ($view) {
$view->setParam('enableuserimage', $settings->_enableUserImage); $view->setParam('enableuserimage', $settings->_enableUserImage);
$view->setParam('enablelanguageselector', $settings->_enableLanguageSelector); $view->setParam('enablelanguageselector', $settings->_enableLanguageSelector);
$view->setParam('enablethemeselector', $settings->_enableThemeSelector); $view->setParam('enablethemeselector', $settings->_enableThemeSelector);

View File

@ -38,7 +38,7 @@ if (!$accessop->check_view_access($view, $_GET)) {
} }
if ($user->isGuest()) { if ($user->isGuest()) {
UI::exitError(getMLText("my_documents"),getMLText("access_denied")); UI::exitError(getMLText("my_documents"), getMLText("access_denied"));
} }
if($view) { if($view) {

View File

@ -879,9 +879,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
$menuitems['expires'] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetExpires".$docid, 'label'=>getMLText('expires')); $menuitems['expires'] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetExpires".$docid, 'label'=>getMLText('expires'));
} }
} }
if ($accessMode == M_ALL) { if ($document->getAccessMode($this->params['user'], 'removeDocument') == M_ALL) {
if ($accessobject->check_view_access('RemoveDocument')) if ($accessobject->check_view_access('RemoveDocument'))
$menuitems['rm_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.RemoveDocument".$docid, 'label'=>getMLText('rm_document')); $menuitems['rm_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.RemoveDocument".$docid, 'label'=>getMLText('rm_document'));
}
if($accessMode == M_ALL) {
if ($accessobject->check_view_access('DocumentAccess')) if ($accessobject->check_view_access('DocumentAccess'))
$menuitems['edit_document_access'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentAccess". $docid, 'label'=>getMLText('edit_document_access')); $menuitems['edit_document_access'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentAccess". $docid, 'label'=>getMLText('edit_document_access'));
} }
@ -3281,7 +3283,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
if(!empty($extracontent['begin_action_list'])) if(!empty($extracontent['begin_action_list']))
$content .= $extracontent['begin_action_list']; $content .= $extracontent['begin_action_list'];
if($accessop->check_view_access('RemoveDocument')) { if($accessop->check_view_access('RemoveDocument')) {
if($document->getAccessMode($user) >= M_ALL) { if($document->getAccessMode($user, 'removeDocument') >= M_ALL) {
$actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true); $actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true);
} else { } else {
$actions['remove_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>'; $actions['remove_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>';

View File

@ -199,7 +199,10 @@ $(document).ready( function() {
$session = array_shift($sessions); $session = array_shift($sessions);
echo "<tr><td>".getMLText('lastaccess')."</td><td>".getLongReadableDate($session->getLastAccess())."</td></tr>\n"; echo "<tr><td>".getMLText('lastaccess')."</td><td>".getLongReadableDate($session->getLastAccess())."</td></tr>\n";
} }
// echo "<tr><td>".getMLText('network_drive')."</td><td><a href=\"http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot.'checkout/'.preg_replace('/[^A-Za-z0-9_-]/', '', $seluser->getLogin())."\">".preg_replace('/[^A-Za-z0-9_-]/', '', $seluser->getLogin())."</a></td></tr>\n"; $item = $this->callHook('addInfoItem', $seluser);
if($item) {
echo "<tr><td>".$item[0]."</td><td>".$item[1]."</td></tr>\n";
}
echo "</table>"; echo "</table>";
} }
@ -469,9 +472,11 @@ $(document).ready( function() {
'options'=>$options 'options'=>$options
) )
); );
$this->contentContainerEnd();
if($workflowmode == "traditional" || $workflowmode == 'traditional_only_approval') { if($workflowmode == "traditional" || $workflowmode == 'traditional_only_approval') {
if($workflowmode == "traditional") { if($workflowmode == "traditional") {
$this->contentSubHeading(getMLText("mandatory_reviewers")); $this->contentSubHeading(getMLText("mandatory_reviewers"));
$this->contentContainerStart();
$options = array(); $options = array();
if($currUser) if($currUser)
$res=$currUser->getMandatoryReviewers(); $res=$currUser->getMandatoryReviewers();
@ -517,8 +522,10 @@ $(document).ready( function() {
) )
); );
} }
$this->contentContainerEnd();
$this->contentSubHeading(getMLText("mandatory_approvers")); $this->contentSubHeading(getMLText("mandatory_approvers"));
$this->contentContainerStart();
$options = array(); $options = array();
if($currUser) if($currUser)
$res=$currUser->getMandatoryApprovers(); $res=$currUser->getMandatoryApprovers();
@ -563,10 +570,12 @@ $(document).ready( function() {
'options'=>$options 'options'=>$options
) )
); );
$this->contentContainerEnd();
} elseif($workflowmode == 'advanced') { } elseif($workflowmode == 'advanced') {
$workflows = $dms->getAllWorkflows(); $workflows = $dms->getAllWorkflows();
if($workflows) { if($workflows) {
$this->contentSubHeading(getMLText("workflow")); $this->contentSubHeading(getMLText("workflow"));
$this->contentContainerStart();
$options = array(); $options = array();
$mandatoryworkflows = $currUser ? $currUser->getMandatoryWorkflows() : array(); $mandatoryworkflows = $currUser ? $currUser->getMandatoryWorkflows() : array();
foreach ($workflows as $workflow) { foreach ($workflows as $workflow) {
@ -585,9 +594,9 @@ $(document).ready( function() {
'options'=>$options 'options'=>$options
) )
); );
$this->contentContainerEnd();
} }
} }
$this->contentContainerEnd();
$this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText($currUser ? "save" : "add_user")); $this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText($currUser ? "save" : "add_user"));
?> ?>
</form> </form>

View File

@ -806,9 +806,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
$menuitems['expires'] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetExpires".$docid, 'label'=>getMLText('expires')); $menuitems['expires'] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetExpires".$docid, 'label'=>getMLText('expires'));
} }
} }
if ($accessMode == M_ALL) { if ($document->getAccessMode($this->params['user'], 'removeDocument') == M_ALL) {
if ($accessobject->check_view_access('RemoveDocument')) if ($accessobject->check_view_access('RemoveDocument'))
$menuitems['rm_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.RemoveDocument".$docid, 'label'=>getMLText('rm_document')); $menuitems['rm_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.RemoveDocument".$docid, 'label'=>getMLText('rm_document'));
}
if($accessMode == M_ALL) {
if ($accessobject->check_view_access('DocumentAccess')) if ($accessobject->check_view_access('DocumentAccess'))
$menuitems['edit_document_access'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentAccess". $docid, 'label'=>getMLText('edit_document_access')); $menuitems['edit_document_access'] = array('link'=>$this->params['settings']->_httpRoot."out/out.DocumentAccess". $docid, 'label'=>getMLText('edit_document_access'));
} }
@ -3255,7 +3257,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
if(!empty($extracontent['begin_action_list'])) if(!empty($extracontent['begin_action_list']))
$content .= $extracontent['begin_action_list']; $content .= $extracontent['begin_action_list'];
if($accessop->check_view_access('RemoveDocument')) { if($accessop->check_view_access('RemoveDocument')) {
if($document->getAccessMode($user) >= M_ALL) { if($document->getAccessMode($user, 'removeDocument') >= M_ALL) {
$actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true); $actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true);
} else { } else {
$actions['remove_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>'; $actions['remove_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>';