mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
a4f96c76d6
|
@ -755,6 +755,16 @@ switch($command) {
|
|||
}
|
||||
}
|
||||
|
||||
if(isset($_POST["attributes"]))
|
||||
$attributes = $_POST["attributes"];
|
||||
else
|
||||
$attributes = array();
|
||||
|
||||
if(isset($_POST["comment"]))
|
||||
$comment = trim($_POST["comment"]);
|
||||
else
|
||||
$comment = '';
|
||||
|
||||
// Get the list of reviewers and approvers for this document.
|
||||
$reviewers = array();
|
||||
$approvers = array();
|
||||
|
@ -796,7 +806,7 @@ switch($command) {
|
|||
$controller->setParam('folder', $folder);
|
||||
$controller->setParam('fulltextservice', $fulltextservice);
|
||||
$controller->setParam('name', $name);
|
||||
$controller->setParam('comment', '');
|
||||
$controller->setParam('comment', $comment);
|
||||
$controller->setParam('expires', $expires);
|
||||
$controller->setParam('keywords', '');
|
||||
$controller->setParam('categories', $cats);
|
||||
|
@ -814,7 +824,7 @@ switch($command) {
|
|||
$controller->setParam('approvers', $approvers);
|
||||
$controller->setParam('reqversion', 1);
|
||||
$controller->setParam('versioncomment', '');
|
||||
$controller->setParam('attributes', array());
|
||||
$controller->setParam('attributes', $attributes);
|
||||
$controller->setParam('attributesversion', array());
|
||||
$controller->setParam('workflow', $workflow);
|
||||
$controller->setParam('notificationgroups', array());
|
||||
|
|
|
@ -777,6 +777,31 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
}
|
||||
}
|
||||
|
||||
// formData - instance of FormData object
|
||||
// data - object to post
|
||||
SeedDMSUpload.getFormData = function(formData, data, previousKey) {
|
||||
if (data instanceof Object) {
|
||||
Object.keys(data).forEach(key => {
|
||||
const value = data[key];
|
||||
if (value instanceof Object && !Array.isArray(value)) {
|
||||
return this.getFormData(formData, value, key);
|
||||
}
|
||||
if (previousKey) {
|
||||
key = `${previousKey}[${key}]`;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(val => {
|
||||
formData.append(`${key}[]`, val);
|
||||
});
|
||||
} else {
|
||||
formData.append(key, value);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
formData.append(previousKey, data);
|
||||
}
|
||||
}
|
||||
|
||||
SeedDMSUpload.handleFileUpload = function(files,obj,statusbar) {
|
||||
/* target is set for the quick upload area */
|
||||
var target_id = obj.data('target');
|
||||
|
@ -794,8 +819,12 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
fd.append('targettype', target_type);
|
||||
fd.append('folderid', target_id);
|
||||
fd.append('formtoken', obj.data('uploadformtoken'));
|
||||
if (typeof obj.data('comment') !== 'undefined') {
|
||||
fd.append('comment', obj.data('comment'));
|
||||
}
|
||||
fd.append('userfile', files[i]);
|
||||
fd.append('command', 'uploaddocument');
|
||||
this.getFormData(fd, obj.data('attributes'), 'attributes');
|
||||
// fd.append('path', files[i].webkitRelativePath);
|
||||
|
||||
statusbar.parent().show();
|
||||
|
|
|
@ -808,6 +808,31 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
}
|
||||
}
|
||||
|
||||
// formData - instance of FormData object
|
||||
// data - object to post
|
||||
SeedDMSUpload.getFormData = function(formData, data, previousKey) {
|
||||
if (data instanceof Object) {
|
||||
Object.keys(data).forEach(key => {
|
||||
const value = data[key];
|
||||
if (value instanceof Object && !Array.isArray(value)) {
|
||||
return this.getFormData(formData, value, key);
|
||||
}
|
||||
if (previousKey) {
|
||||
key = `${previousKey}[${key}]`;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(val => {
|
||||
formData.append(`${key}[]`, val);
|
||||
});
|
||||
} else {
|
||||
formData.append(key, value);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
formData.append(previousKey, data);
|
||||
}
|
||||
}
|
||||
|
||||
SeedDMSUpload.handleFileUpload = function(files,obj,statusbar) {
|
||||
/* target is set for the quick upload area */
|
||||
var target_id = obj.data('target');
|
||||
|
@ -825,8 +850,12 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
fd.append('targettype', target_type);
|
||||
fd.append('folderid', target_id);
|
||||
fd.append('formtoken', obj.data('uploadformtoken'));
|
||||
if (typeof obj.data('comment') !== 'undefined') {
|
||||
fd.append('comment', obj.data('comment'));
|
||||
}
|
||||
fd.append('userfile', files[i]);
|
||||
fd.append('command', 'uploaddocument');
|
||||
this.getFormData(fd, obj.data('attributes'), 'attributes');
|
||||
// fd.append('path', files[i].webkitRelativePath);
|
||||
|
||||
statusbar.parent().show();
|
||||
|
|
Loading…
Reference in New Issue
Block a user