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

This commit is contained in:
Uwe Steinmann 2020-09-07 16:21:15 +02:00
commit 5a32f4b7c5
12 changed files with 100 additions and 7 deletions

View File

@ -175,6 +175,7 @@
--------------------------------------------------------------------------------
- fix import of users
- major rework of scripts in utils, unify reading of settings, use PHP_EOL
- allow inline editing of document name
--------------------------------------------------------------------------------
Changes in version 5.1.19

View File

@ -56,7 +56,8 @@ class SeedDMS_SQLiteFTS_Term {
5 => 'origfilename',
6 => 'owner',
7 => 'content',
8 => 'created'
8 => 'created',
9 => 'user'
);
$this->field = $fields[$col];
$this->_occurrence = $occurrence;

View File

@ -14,8 +14,8 @@
<date>2020-09-02</date>
<time>08:57:44</time>
<version>
<release>1.0.12</release>
<api>1.0.12</api>
<release>1.0.13</release>
<api>1.0.13</api>
</version>
<stability>
<release>stable</release>
@ -23,7 +23,7 @@
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
Index users with at least read access on a document
add user to list of terms
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">
@ -259,5 +259,21 @@ Set 'created' in index to creation date of indexed content (was set to current
timestamp)
</notes>
</release>
<release>
<date>2020-09-02</date>
<time>08:57:44</time>
<version>
<release>1.0.12</release>
<api>1.0.12</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
Index users with at least read access on a document
</notes>
</release>
</changelog>
</package>

View File

@ -76,6 +76,8 @@ class Settings { /* {{{ */
var $_apiUserId = 0;
// api allowed origins for restapi
var $_apiOrigin = '';
// allow inline editing of document/folder names
var $_inlineEditing = false;
// Strict form checking
var $_strictFormCheck = false;
// list of form fields which are visible by default but can be explixitly
@ -518,6 +520,7 @@ class Settings { /* {{{ */
$node = $xml->xpath('/configuration/site/edition');
$tab = $node[0]->attributes();
$this->_strictFormCheck = Settings::boolVal($tab["strictFormCheck"]);
$this->_inlineEditing = Settings::boolVal($tab["inlineEditing"]);
if(trim(strval($tab["noDocumentFormFields"])))
$this->_noDocumentFormFields = explode(',',strval($tab["noDocumentFormFields"]));
$this->setViewOnlineFileTypesFromString(strval($tab["viewOnlineFileTypes"]));
@ -898,6 +901,7 @@ class Settings { /* {{{ */
// XML Path: /configuration/site/edition
$node = $this->getXMLNode($xml, '/configuration/site', 'edition');
$this->setXMLAttributValue($node, "strictFormCheck", $this->_strictFormCheck);
$this->setXMLAttributValue($node, "inlineEditing", $this->_inlineEditing);
$this->setXMLAttributValue($node, "noDocumentFormFields", implode(',', $this->_noDocumentFormFields));
$this->setXMLAttributValue($node, "viewOnlineFileTypes", $this->getViewOnlineFileTypesToString());
$this->setXMLAttributValue($node, "editOnlineFileTypes", $this->getEditOnlineFileTypesToString());

View File

@ -606,6 +606,30 @@ switch($command) {
}
break; /* }}} */
case 'setdocumentname': /* {{{ */
if(1||$user) {
$document = $dms->getDocument($_REQUEST['id']);
if($document) {
if ($document->getAccessMode($user) >= M_READWRITE) {
if (!$document->setName($_REQUEST['name'])) {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>'Error setting name', 'data'=>''));
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_name_changed'), 'data'=>''));
add_log_line();
}
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>getMLText('access_denied'), 'data'=>''));
}
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_doc_id'), 'data'=>''));
}
}
break; /* }}} */
case 'submittranslation': /* {{{ */
if($settings->_showMissingTranslations) {
if($user && !empty($_POST['phrase'])) {

View File

@ -76,6 +76,7 @@ if ($action == "saveSettings")
// SETTINGS - SITE - EDITION
$settings->_strictFormCheck = getBoolValue("strictFormCheck");
$settings->_inlineEditing = getBoolValue("inlineEditing");
if(empty($_POST["noDocumentFormFields"]))
$settings->_noDocumentFormFields = array();
else

View File

@ -292,6 +292,11 @@ i.in-workflow {color: #11479e;}
i.workflow-action {color: #91479e;}
i.selected {border: 1px solid #d4d4d4;padding:3px;border-radius:3px;background-color:#fafafa;background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);}
span.editable:after {
font: normal normal normal 14px/1 FontAwesome;
content: " \f044";
}
span.openpopupbox {
cursor: pointer;
}

View File

@ -518,6 +518,30 @@ $(document).ready( function() {
$('button.history-back').on('click', function(event) { /* {{{ */
window.history.back();
}); /* }}} */
$("body").on("blur", "span.editable", function(e) { /* {{{ */
console.log($(this).data('document'));
console.log('Hallo'+$(this).text());
e.preventDefault();
$.post( "../op/op.Ajax.php", { command: "setdocumentname", id: $(this).data('document'), name: $(this).text() })
.done(function( data ) {
noty({
text: data.message,
type: data.success ? 'success' : 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
});
}); /* }}} */
$("body").on("keypress", "span.editable", function(e) { /* {{{ */
if(e.which == 13) {
$(this).blur();
}
return e.which != 13;
}); /* }}} */
});
function onAddClipboard(ev) { /* {{{ */

View File

@ -2228,6 +2228,22 @@ $(function() {
echo "</div>\n";
} /* }}} */
/**
* Wrap text in inline editing tags
*
* @param string text
*/
function printInlineEdit($text, $object){ /* {{{ */
if(!empty($this->params['settings']->_inlineEditing)) {
echo "<span class=\"editable\" contenteditable=\"true\"";
if($object->isType('document'))
echo " data-document=\"".$object->getId()."\"";
echo ">".$text;
echo "</span>\n";
} else
echo $text;
} /* }}} */
/**
* Print button with link for deleting a document
*

View File

@ -222,9 +222,9 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Bootstrap_Style {
echo "<a href=\"../out/out.Settings.php?currenttab=extensions#".$extname."\" title=\"".getMLText('configure_extension')."\"><i class=\"fa fa-cogs\"></i></a>";
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$extname."-download\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"download\" /><input type=\"hidden\" name=\"extname\" value=\"".$extname."\" /><a class=\"download\" data-extname=\"".$extname."\" title=\"".getMLText('download_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
if(!$settings->extensionIsDisabled($extname)) {
echo ' <a href="#" class="toggle" data-extname="'.$extname.'"><i class="fa fa-check"</i></a>';
echo ' <a href="#" class="toggle" data-extname="'.$extname.'" title="'.getMLText('disable_extension').'"><i class="fa fa-check"</i></a>';
} else {
echo ' <a href="#" class="toggle" data-extname="'.$extname.'"><i class="fa fa-check-minus"></i></a>';
echo ' <a href="#" class="toggle" data-extname="'.$extname.'" title="'.getMLText('enable_extension').'"><i class="fa fa-minus"></i></a>';
}
echo "</div>";
echo "</td>";

View File

@ -301,6 +301,7 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site'));
-->
<?php $this->showConfigHeadline('settings_Edition'); ?>
<?php $this->showConfigCheckbox('settings_strictFormCheck', 'strictFormCheck'); ?>
<?php $this->showConfigCheckbox('settings_inlineEditing', 'inlineEditing'); ?>
<?php $this->showConfigOption('settings_noDocumentFormFields', 'noDocumentFormFields', array('comment', 'keywords', 'categories', 'sequence', 'expires', 'version', 'version_comment', 'notification'), true, true); ?>
<?php $this->showConfigText('settings_viewOnlineFileTypes', 'viewOnlineFileTypes', 'array'); ?>
<?php $this->showConfigText('settings_editOnlineFileTypes', 'editOnlineFileTypes', 'array'); ?>

View File

@ -222,7 +222,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
?>
<tr>
<td><?php printMLText("name");?>:</td>
<td><?php print htmlspecialchars($document->getName());?></td>
<td><?php $this->printInlineEdit(htmlspecialchars($document->getName()), $document);?></td>
</tr>
<tr>
<td><?php printMLText("owner");?>:</td>