check for enableMultiUpload and enableAttachmentUpload

This commit is contained in:
Uwe Steinmann 2017-04-27 06:51:16 +02:00
parent d2fc9b534f
commit a83b9ba395
2 changed files with 53 additions and 16 deletions

View File

@ -54,6 +54,8 @@ if($view) {
$view->setParam('folder', $folder); $view->setParam('folder', $folder);
$view->setParam('strictformcheck', $settings->_strictFormCheck); $view->setParam('strictformcheck', $settings->_strictFormCheck);
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload); $view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
$view->setParam('enableattachmentupload', $settings->_enableAttachmentUpload);
$view->setParam('enablemultiupload', $settings->_enableMultiUpload);
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp); $view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp); $view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('enableselfrevapp', $settings->_enableSelfRevApp); $view->setParam('enableselfrevapp', $settings->_enableSelfRevApp);

View File

@ -36,16 +36,27 @@ class SeedDMS_View_AddDocument extends SeedDMS_Bootstrap_Style {
$partitionsize = $this->params['partitionsize']; $partitionsize = $this->params['partitionsize'];
$maxuploadsize = $this->params['maxuploadsize']; $maxuploadsize = $this->params['maxuploadsize'];
$enablelargefileupload = $this->params['enablelargefileupload']; $enablelargefileupload = $this->params['enablelargefileupload'];
$enablemultiupload = $this->params['enablemultiupload'];
$enableattachmentupload = $this->params['enableattachmentupload'];
header('Content-Type: application/javascript; charset=UTF-8'); header('Content-Type: application/javascript; charset=UTF-8');
if($enablelargefileupload) if($enablelargefileupload) {
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize); $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize, $enablemultiupload);
if($enableattachmentupload) {
//$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize, , $enablemultiupload, 'attachment');
}
}
?> ?>
$(document).ready(function() { $(document).ready(function() {
$('#new-file').click(function(event) { $('#new-file').click(function(event) {
$("#upload-file").clone().appendTo("#upload-files").removeAttr("id").children('div').children('input').val(''); $("#userfile-upload-file").clone().appendTo("#userfile-upload-files").removeAttr("id").children('div').children('input').val('');
}); });
<?php if($enableattachmentupload) { ?>
$('#new-attachment').click(function(event) {
console.log('Hallo');
$("#attachment-upload-file").clone().appendTo("#attachment-upload-files").removeAttr("id").children('div').children('input').val('');
});
<?php } ?>
jQuery.validator.addMethod("alternatives", function(value, element, params) { jQuery.validator.addMethod("alternatives", function(value, element, params) {
if(value == '' && params.val() == '') if(value == '' && params.val() == '')
return false; return false;
@ -84,7 +95,10 @@ $(document).ready(function() {
if($enablelargefileupload) { if($enablelargefileupload) {
?> ?>
submitHandler: function(form) { submitHandler: function(form) {
manualuploader.uploadStoredFiles(); userfileuploader.uploadStoredFiles();
<?php if($enableattachmentupload) { ?>
// attachmentuploader.uploadStoredFiles();
<?php } ?>
}, },
<?php <?php
} }
@ -93,8 +107,8 @@ $(document).ready(function() {
<?php <?php
if($enablelargefileupload) { if($enablelargefileupload) {
?> ?>
fineuploaderuuids: { 'userfile-fine-uploader-uuids': {
fineuploader: [ manualuploader, $('#dropfolderfileform1') ] fineuploader: [ userfileuploader, $('#dropfolderfileform1') ]
} }
<?php <?php
} else { } else {
@ -141,6 +155,8 @@ $(document).ready(function() {
$user = $this->params['user']; $user = $this->params['user'];
$folder = $this->params['folder']; $folder = $this->params['folder'];
$enablelargefileupload = $this->params['enablelargefileupload']; $enablelargefileupload = $this->params['enablelargefileupload'];
$enablemultiupload = $this->params['enablemultiupload'];
$enableattachmentupload = $this->params['enableattachmentupload'];
$enableadminrevapp = $this->params['enableadminrevapp']; $enableadminrevapp = $this->params['enableadminrevapp'];
$enableownerrevapp = $this->params['enableownerrevapp']; $enableownerrevapp = $this->params['enableownerrevapp'];
$enableselfrevapp = $this->params['enableselfrevapp']; $enableselfrevapp = $this->params['enableselfrevapp'];
@ -164,9 +180,6 @@ $(document).ready(function() {
$this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder); $this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
$msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize"); $msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize");
if(0 && $enablelargefileupload) {
$msg .= "<p>".sprintf(getMLText('link_alt_updatedocument'), "out.AddMultiDocument.php?folderid=".$folderid."&showtree=".showtree())."</p>";
}
$this->warningMsg($msg); $this->warningMsg($msg);
$this->contentHeading(getMLText("add_document")); $this->contentHeading(getMLText("add_document"));
$this->contentContainerStart(); $this->contentContainerStart();
@ -306,21 +319,17 @@ $(document).ready(function() {
<tr> <tr>
<td><?php printMLText("local_file");?>:</td> <td><?php printMLText("local_file");?>:</td>
<td> <td>
<!--
<a href="javascript:addFiles()"><?php printMLtext("add_multiple_files") ?></a>
<ol id="files">
<li><input type="file" name="userfile[]" size="60"></li>
</ol>
-->
<?php <?php
if($enablelargefileupload) if($enablelargefileupload)
$this->printFineUploaderHtml(); $this->printFineUploaderHtml();
else { else {
$this->printFileChooser('userfile[]', false); $this->printFileChooser('userfile[]', false);
if($enablemultiupload) {
?> ?>
<a class="" id="new-file"><?php printMLtext("add_multiple_files") ?></a> <a class="" id="new-file"><?php printMLtext("add_multiple_files") ?></a>
<?php <?php
} }
}
?> ?>
</td> </td>
</tr> </tr>
@ -355,6 +364,32 @@ $(document).ready(function() {
} }
} }
} }
/* Do not allow upload of attachments if multiple documents can be uploaded,
* because attachments cannot be assigned uniquely to a document */
if($enableattachmentupload && !$enablemultiupload) {
?>
<tr>
<td>
<?php $this->contentSubHeading(getMLText("linked_files")); ?>
</td>
</tr>
<tr>
<td><?php printMLText("local_file");?>:</td>
<td>
<?php
if(0 && $enablelargefileupload)
$this->printFineUploaderHtml('attachment');
else {
$this->printFileChooser('attachment[]', false);
?>
<a class="" id="new-attachment"><?php printMLtext("add_multiple_files") ?></a>
<?php
}
?>
</td>
</tr>
<?php
}
if($workflowmode == 'advanced') { if($workflowmode == 'advanced') {
?> ?>
<tr> <tr>