mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
b3e7b9a2dd
|
@ -20,6 +20,17 @@ chzn_template_func = function (state) {
|
|||
var $newstate = $(html);
|
||||
return $newstate;
|
||||
};
|
||||
function escapeHtml(text) {
|
||||
var map = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
};
|
||||
|
||||
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
|
||||
}
|
||||
$(document).ready( function() {
|
||||
/* close popovers when clicking somewhere except in the popover or the
|
||||
* remove icon
|
||||
|
@ -166,9 +177,7 @@ $(document).ready( function() {
|
|||
{ command: 'addtoclipboard', type: type, id: id },
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
// $("#main-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=mainclipboard')
|
||||
$("#main-clipboard").html('Loading').load('../out/out.Clipboard.php?action=mainclipboard')
|
||||
//$("#menu-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=menuclipboard')
|
||||
$("#menu-clipboard").html('Loading').load('../out/out.Clipboard.php?action=menuclipboard')
|
||||
noty({
|
||||
text: attr_msg,
|
||||
|
@ -203,9 +212,7 @@ $(document).ready( function() {
|
|||
{ command: 'removefromclipboard', type: type, id: id },
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
// $("#main-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=mainclipboard')
|
||||
$("#main-clipboard").html('Loading').load('../out/out.Clipboard.php?action=mainclipboard')
|
||||
//$("#menu-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=menuclipboard')
|
||||
$("#menu-clipboard").html('Loading').load('../out/out.Clipboard.php?action=menuclipboard')
|
||||
noty({
|
||||
text: attr_msg,
|
||||
|
@ -443,9 +450,7 @@ $(document).ready( function() {
|
|||
success: function(data){
|
||||
if(data.success) {
|
||||
if(element.data('param1') == 'command=clearclipboard') {
|
||||
// $("#main-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=mainclipboard')
|
||||
$("#main-clipboard").html('Loading').load('../out/out.Clipboard.php?action=mainclipboard')
|
||||
//$("#menu-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=menuclipboard')
|
||||
$("#menu-clipboard").html('Loading').load('../out/out.Clipboard.php?action=menuclipboard')
|
||||
}
|
||||
noty({
|
||||
|
@ -481,16 +486,12 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
source_type = source_info.type;
|
||||
source_id = source_info.id;
|
||||
formtoken = source_info.formtoken;
|
||||
// source_type = ev.originalEvent.dataTransfer.getData("type");
|
||||
// source_id = ev.originalEvent.dataTransfer.getData("id");
|
||||
if(source_type == 'document' || source_type == 'folder') {
|
||||
$.get('../op/op.Ajax.php',
|
||||
{ command: 'addtoclipboard', type: source_type, id: source_id },
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
// $("#main-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=mainclipboard')
|
||||
$("#main-clipboard").html('Loading').load('../out/out.Clipboard.php?action=mainclipboard')
|
||||
//$("#menu-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=menuclipboard')
|
||||
$("#menu-clipboard").html('Loading').load('../out/out.Clipboard.php?action=menuclipboard')
|
||||
noty({
|
||||
text: data.message,
|
||||
|
@ -757,6 +758,7 @@ $(document).ready(function() { /* {{{ */
|
|||
attr_rel = $(e.currentTarget).data('droptarget');
|
||||
target_type = attr_rel.split("_")[0];
|
||||
target_id = attr_rel.split("_")[1];
|
||||
target_name = $(e.currentTarget).data('name')
|
||||
if(target_type == 'folder') {
|
||||
var files = e.originalEvent.dataTransfer.files;
|
||||
if(files.length > 0) {
|
||||
|
@ -769,7 +771,10 @@ $(document).ready(function() { /* {{{ */
|
|||
formtoken = source_info.formtoken;
|
||||
console.log('Drop '+source_type+' '+source_id+' on '+target_type+' '+target_id);
|
||||
if(source_type == 'document') {
|
||||
bootbox.dialog(trans.confirm_move_document, [{
|
||||
var bootbox_message = trans.confirm_move_document;
|
||||
if(source_info.name)
|
||||
bootbox_message += "<p> "+escapeHtml(source_info.name)+' <i class="icon-arrow-right"></i> '+escapeHtml(target_name)+"</p>";
|
||||
bootbox.dialog(bootbox_message, [{
|
||||
"label" : "<i class='icon-remove'></i> "+trans.move_document,
|
||||
"class" : "btn-danger",
|
||||
"callback": function() {
|
||||
|
@ -810,7 +815,10 @@ $(document).ready(function() { /* {{{ */
|
|||
url = "../out/out.MoveDocument.php?documentid="+source_id+"&targetid="+target_id;
|
||||
// document.location = url;
|
||||
} else if(source_type == 'folder' && source_id != target_id) {
|
||||
bootbox.dialog(trans.confirm_move_folder, [{
|
||||
var bootbox_message = trans.confirm_move_folder;
|
||||
if(source_info.name)
|
||||
bootbox_message += "<p> "+escapeHtml(source_info.name)+' <i class="icon-arrow-right"></i> '+escapeHtml(target_name)+"</p>";
|
||||
bootbox.dialog(bootbox_message, [{
|
||||
"label" : "<i class='icon-remove'></i> "+trans.move_folder,
|
||||
"class" : "btn-danger",
|
||||
"callback": function() {
|
||||
|
@ -947,8 +955,22 @@ $(document).ready(function() { /* {{{ */
|
|||
var dragStartInfo = {
|
||||
id : attr_rel.split("_")[1],
|
||||
type : "folder",
|
||||
formtoken : $(e.target).attr('formtoken')
|
||||
formtoken : $(e.target).attr('formtoken'),
|
||||
name: $(e.target).data('name')
|
||||
};
|
||||
/* Currently not used
|
||||
$.ajax({url: '../out/out.ViewFolder.php',
|
||||
type: 'GET',
|
||||
dataType: "json",
|
||||
data: {action: 'data', folderid: attr_rel.split("_")[1]},
|
||||
success: function(data) {
|
||||
if(data) {
|
||||
dragStartInfo.source = data;
|
||||
}
|
||||
},
|
||||
timeout: 3000
|
||||
});
|
||||
*/
|
||||
e.originalEvent.dataTransfer.setData("text", JSON.stringify(dragStartInfo));
|
||||
});
|
||||
|
||||
|
@ -959,7 +981,8 @@ $(document).ready(function() { /* {{{ */
|
|||
var dragStartInfo = {
|
||||
id : attr_rel.split("_")[1],
|
||||
type : "document",
|
||||
formtoken : $(e.target).attr('formtoken')
|
||||
formtoken : $(e.target).attr('formtoken'),
|
||||
name: $(e.target).data('name')
|
||||
};
|
||||
e.originalEvent.dataTransfer.setData("text", JSON.stringify(dragStartInfo));
|
||||
});
|
||||
|
@ -1014,9 +1037,6 @@ $(document).ready(function() { /* {{{ */
|
|||
source_type = source_info.type;
|
||||
source_id = source_info.id;
|
||||
formtoken = source_info.formtoken;
|
||||
// source_type = e.originalEvent.dataTransfer.getData("type");
|
||||
// source_id = e.originalEvent.dataTransfer.getData("id");
|
||||
// formtoken = e.originalEvent.dataTransfer.getData("formtoken");
|
||||
if(source_type == 'document') {
|
||||
bootbox.dialog(trans.confirm_move_document, [{
|
||||
"label" : "<i class='icon-remove'></i> "+trans.move_document,
|
||||
|
|
|
@ -2409,7 +2409,7 @@ $(document).ready( function() {
|
|||
*/
|
||||
function documentListRowStart($document, $class='') { /* {{{ */
|
||||
$docID = $document->getID();
|
||||
return "<tr id=\"table-row-document-".$docID."\" class=\"table-row-document droptarget ".($class ? ' '.$class : '')."\" data-droptarget=\"document_".$docID."\" rel=\"document_".$docID."\" formtoken=\"".createFormKey('')."\" draggable=\"true\">";
|
||||
return "<tr id=\"table-row-document-".$docID."\" class=\"table-row-document droptarget ".($class ? ' '.$class : '')."\" data-droptarget=\"document_".$docID."\" rel=\"document_".$docID."\" formtoken=\"".createFormKey('')."\" draggable=\"true\" data-name=\"".htmlspecialchars($document->getName(), ENT_QUOTES)."\">";
|
||||
} /* }}} */
|
||||
|
||||
function documentListRowEnd($document) { /* {{{ */
|
||||
|
@ -2612,7 +2612,7 @@ $(document).ready( function() {
|
|||
* @return string starting tr tag for a table
|
||||
*/
|
||||
function folderListRowStart($folder, $class='') { /* {{{ */
|
||||
return "<tr id=\"table-row-folder-".$folder->getID()."\" draggable=\"true\" data-droptarget=\"folder_".$folder->getID()."\" rel=\"folder_".$folder->getID()."\" class=\"folder table-row-folder droptarget".($class ? ' '.$class : '')."\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">";
|
||||
return "<tr id=\"table-row-folder-".$folder->getID()."\" draggable=\"true\" data-droptarget=\"folder_".$folder->getID()."\" rel=\"folder_".$folder->getID()."\" class=\"folder table-row-folder droptarget".($class ? ' '.$class : '')."\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\" data-name=\"".htmlspecialchars($folder->getName(), ENT_QUOTES)."\">";
|
||||
} /* }}} */
|
||||
|
||||
function folderListRowEnd($folder) { /* {{{ */
|
||||
|
|
|
@ -36,6 +36,16 @@ require_once("SeedDMS/Preview.php");
|
|||
*/
|
||||
class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
|
||||
|
||||
function data() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$folder = $this->params['folder'];
|
||||
|
||||
$jsondata = array('name'=>$folder->getName());
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($jsondata);
|
||||
} /* }}} */
|
||||
|
||||
function getAccessModeText($defMode) { /* {{{ */
|
||||
switch($defMode) {
|
||||
case M_NONE:
|
||||
|
|
Loading…
Reference in New Issue
Block a user