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

This commit is contained in:
Uwe Steinmann 2020-08-10 07:34:14 +02:00
commit e3bb44d504
4 changed files with 17 additions and 13 deletions

View File

@ -168,6 +168,7 @@
- add hooks showDocumentAttribute and showDocumentContentAttribute in Search view
- fix layout problems of select2 menu, add option for adding an icon to each option
- better import for users from csv file
- fix various methods in restapi (Closes: #481)
--------------------------------------------------------------------------------
Changes in version 5.1.18

View File

@ -443,6 +443,7 @@ class RestapiController { /* {{{ */
function createFolder($request, $response, $args) { /* {{{ */
$dms = $this->container->dms;
$userobj = $this->container->userobj;
$settings = $this->container->config;
if(!$userobj) {
return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403);
@ -584,6 +585,7 @@ class RestapiController { /* {{{ */
function uploadDocument($request, $response, $args) { /* {{{ */
$dms = $this->container->dms;
$userobj = $this->container->userobj;
$settings = $this->container->config;
if(!$userobj) {
return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403);
@ -748,6 +750,7 @@ class RestapiController { /* {{{ */
function uploadDocumentPut($request, $response, $args) { /* {{{ */
$dms = $this->container->dms;
$userobj = $this->container->userobj;
$settings = $this->container->config;
if(!$userobj) {
return $response->withJson(array('success'=>false, 'message'=>'Not logged in', 'data'=>''), 403);

View File

@ -1416,9 +1416,9 @@ function folderSelected<?php echo $formName ?>(id, name) {
} /* }}} */
function getFolderChooserHtml($form, $accessMode, $exclude = -1, $default = false, $formname = '') { /* {{{ */
$formid = "targetid".$form;
if(!$formname)
$formname = "targetid";
$formid = $formname.$form;
$content = '';
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<div class=\"input-append\">\n";
@ -1447,17 +1447,20 @@ function folderSelected<?php echo $formName ?>(id, name) {
echo self::getFolderChooserHtml($form, $accessMode, $exclude, $default, $formname);
} /* }}} */
function printFolderChooserJs($form) { /* {{{ */
function printFolderChooserJs($form, $formname='') { /* {{{ */
if(!$formname)
$formname = "targetid";
$formid = $formname.$form;
?>
function folderSelected<?php echo $form ?>(id, name) {
$('#targetid<?php echo $form ?>').val(id);
$('#<?php echo $formid ?>').val(id);
$('#choosefoldersearch<?php echo $form ?>').val(name);
$('#folderChooser<?php echo $form ?>').modal('hide');
}
$(document).ready(function() {
$('#clearfolder<?php print $form ?>').click(function(ev) {
$('#choosefoldersearch<?php echo $form ?>').val('');
$('#targetid<?php echo $form ?>').val('');
$('#<?php echo $formid ?>').val('');
});
});
<?php
@ -1468,7 +1471,7 @@ $(document).ready(function() {
?>
<script language="JavaScript">
<?php
$this->printFolderChooserJs($form);
$this->printFolderChooserJs($form, $formname);
?>
</script>
<?php
@ -2064,7 +2067,10 @@ $(function() {
echo json_encode($tree);
} /* }}} */
function printTreeNavigation($folderid, $showtree){ /* {{{ */
/**
* Deprecated!
*/
function __printTreeNavigation($folderid, $showtree){ /* {{{ */
if ($showtree==1){
$this->contentHeading("<a href=\"../out/out.ViewFolder.php?folderid=". $folderid."&showtree=0\"><i class=\"icon-minus-sign\"></i></a>", true);
$this->contentContainerStart();

View File

@ -46,7 +46,7 @@ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style {
$orderby = $this->params['orderby'];
header('Content-Type: application/javascript');
$this->printNewTreeNavigationJs($rootfolderid, $mode, 0, $form, '', $orderby);
$this->printNewTreeNavigationJs($rootfolderid, $mode, 0, $form, 0, $orderby);
} /* }}} */
function show() { /* {{{ */
@ -59,14 +59,8 @@ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style {
$rootfolderid = $this->params['rootfolderid'];
// $this->htmlStartPage(getMLText("choose_target_folder"));
// $this->contentContainerStart();
if(1) {
$this->printNewTreeNavigationHtml($rootfolderid, $mode, 0, $form, 0, $orderby);
echo '<script src="../out/out.FolderChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
} else {
$this->printNewTreeNavigation($rootfolderid, $mode, 0, $form);
}
// $this->contentContainerEnd();
// $this->htmlEndPage(true);
} /* }}} */
}