"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tine20/Filemanager/js/nodeActions.js" between
tine20-2020.08.3.tar.gz and tine20-2020.08.4.tar.gz

About: Tine 2.0 is a platform independent business software system which combines groupware and customer relationship management (CRM). Commercial support is available. Source code.

nodeActions.js  (tine20-2020.08.3):nodeActions.js  (tine20-2020.08.4)
skipping to change at line 138 skipping to change at line 138
// /** // /**
// * reload // * reload
// */ // */
// Tine.Filemanager.nodeActions.Reload = { // Tine.Filemanager.nodeActions.Reload = {
// app: 'Filemanager', // app: 'Filemanager',
// text: 'Reload', // _('Reload'), // text: 'Reload', // _('Reload'),
// iconCls: 'x-tbar-loading', // iconCls: 'x-tbar-loading',
// handler: function() { // handler: function() {
// var record = this.initialConfig.selections[0]; // var record = this.initialConfig.selections[0];
// // arg - does not trigger tree children reload! // // arg - does not trigger tree children reload!
// Tine.Filemanager.fileRecordBackend.loadRecord(record); // Tine.Filemanager.nodeBackend.loadRecord(record);
// } // }
// }; // };
/** /**
* create new folder, needs a single folder selection with addGrant * create new folder, needs a single folder selection with addGrant
*/ */
Tine.Filemanager.nodeActions.CreateFolder = { Tine.Filemanager.nodeActions.CreateFolder = {
app: 'Filemanager', app: 'Filemanager',
requiredGrant: 'addGrant', requiredGrant: 'addGrant',
allowMultiple: false, allowMultiple: false,
skipping to change at line 172 skipping to change at line 172
const grid = _.get(this, 'initialConfig.selectionModel.grid'); const grid = _.get(this, 'initialConfig.selectionModel.grid');
if (grid) { if (grid) {
const gridWdgt = grid.ownerCt.ownerCt; const gridWdgt = grid.ownerCt.ownerCt;
const newRecord = new Tine.Filemanager.Model.Node(Tine.Filemanager.M odel.Node.getDefaultData({ const newRecord = new Tine.Filemanager.Model.Node(Tine.Filemanager.M odel.Node.getDefaultData({
name: app.i18n._('New Folder'), name: app.i18n._('New Folder'),
type: 'folder' type: 'folder'
})); }));
gridWdgt.newInlineRecord(newRecord, 'name', async (localRecord) => { gridWdgt.newInlineRecord(newRecord, 'name', async (localRecord) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
Tine.Filemanager.fileRecordBackend.createFolder(currentPath + '/' + localRecord.get('name'), { Tine.Filemanager.nodeBackend.createFolder(currentPath + '/' + localRecord.get('name'), {
success: resolve, success: resolve,
failure: reject failure: reject
}); });
}) })
}); });
} else { } else {
Ext.MessageBox.prompt(app.i18n._('New Folder'), app.i18n._('Please e nter the name of the new folder:'), function (btn, text) { Ext.MessageBox.prompt(app.i18n._('New Folder'), app.i18n._('Please e nter the name of the new folder:'), function (btn, text) {
if (currentFolderNode && btn === 'ok') { if (currentFolderNode && btn === 'ok') {
if (!text) { if (!text) {
Ext.Msg.alert(String.format(app.i18n._('No {0} added'), nodeName), String.format(app.i18n._('You have to supply a {0} name!'), nodeName) ); Ext.Msg.alert(String.format(app.i18n._('No {0} added'), nodeName), String.format(app.i18n._('You have to supply a {0} name!'), nodeName) );
return; return;
} }
var filename = currentPath + '/' + text; var filename = currentPath + '/' + text;
Tine.Filemanager.fileRecordBackend.createFolder(filename); Tine.Filemanager.nodeBackend.createFolder(filename);
} }
}, this); }, this);
} }
}, },
actionUpdater: function(action, grants, records, isFilterSelect, filteredCon tainers) { actionUpdater: function(action, grants, records, isFilterSelect, filteredCon tainers) {
var enabled = !isFilterSelect var enabled = !isFilterSelect
&& records && records.length === 1 && records && records.length === 1
&& records[0].get('type') === 'folder' && records[0].get('type') === 'folder'
&& window.lodash.get(records, '[0].data.account_grants.addGrant', fa lse) && window.lodash.get(records, '[0].data.account_grants.addGrant', fa lse)
&& Tine.Filemanager.nodeActionsMgr.checkConstraints('create', record s[0], [{type: 'folder'}]); && Tine.Filemanager.nodeActionsMgr.checkConstraints('create', record s[0], [{type: 'folder'}]);
skipping to change at line 282 skipping to change at line 282
}, },
scope: this, scope: this,
prompt: true, prompt: true,
icon: Ext.MessageBox.QUESTION icon: Ext.MessageBox.QUESTION
}); });
}, },
executor: function(record, text) { executor: function(record, text) {
// @TODO validate filename // @TODO validate filename
var targetPath = record.get('path').replace(new RegExp(_.escapeRegExp(re cord.get('name')) +'$'), text); var targetPath = record.get('path').replace(new RegExp(_.escapeRegExp(re cord.get('name')) +'$'), text);
Tine.Filemanager.fileRecordBackend.copyNodes([record], targetPath, true) ; Tine.Filemanager.nodeBackend.copyNodes([record], targetPath, true);
} }
}; };
/** /**
* single file or directory node with editGrant * single file or directory node with editGrant
*/ */
Tine.Filemanager.nodeActions.SystemLink = { Tine.Filemanager.nodeActions.SystemLink = {
app: 'Filemanager', app: 'Filemanager',
requiredGrant: 'readGrant', requiredGrant: 'readGrant',
allowMultiple: false, allowMultiple: false,
skipping to change at line 357 skipping to change at line 357
this.conflictConfirmWin = Tine.widgets.dialog.FileListDialog.openWindow( { this.conflictConfirmWin = Tine.widgets.dialog.FileListDialog.openWindow( {
modal: true, modal: true,
allowCancel: false, allowCancel: false,
height: 180, height: 180,
width: 300, width: 300,
title: app.i18n._('Do you really want to delete the following files? '), title: app.i18n._('Do you really want to delete the following files? '),
text: nodeName, text: nodeName,
scope: this, scope: this,
handler: function (button) { handler: function (button) {
if (nodes && button == 'yes') { if (nodes && button == 'yes') {
Tine.Filemanager.fileRecordBackend.deleteItems(nodes); Tine.Filemanager.nodeBackend.deleteItems(nodes);
} }
for (var i = 0; i < nodes.length; i++) { for (var i = 0; i < nodes.length; i++) {
var node = nodes[i]; var node = nodes[i];
if (node.fileRecord) { if (node.fileRecord) {
var upload = Tine.Tinebase.uploadManager.getUpload(node. fileRecord.get('uploadKey')); var upload = Tine.Tinebase.uploadManager.getUpload(node. fileRecord.get('uploadKey'));
if (upload) { if (upload) {
upload.setPaused(true); upload.setPaused(true);
Tine.Tinebase.uploadManager.unregisterUpload(upload. id); Tine.Tinebase.uploadManager.unregisterUpload(upload. id);
skipping to change at line 409 skipping to change at line 409
var filePickerDialog = new Tine.Filemanager.FilePickerDialog({ var filePickerDialog = new Tine.Filemanager.FilePickerDialog({
windowTitle: app.i18n._('Move Items'), windowTitle: app.i18n._('Move Items'),
singleSelect: true, singleSelect: true,
constraint: (targetNode) => { constraint: (targetNode) => {
return Tine.Filemanager.nodeActionsMgr.checkConstraints('move', targetNode, records); return Tine.Filemanager.nodeActionsMgr.checkConstraints('move', targetNode, records);
} }
}); });
filePickerDialog.on('apply', function(node) { filePickerDialog.on('apply', function(node) {
Tine.Filemanager.fileRecordBackend.copyNodes(records, node[0], true) ; Tine.Filemanager.nodeBackend.copyNodes(records, node[0], true);
}); });
filePickerDialog.openWindow(); filePickerDialog.openWindow();
} }
}; };
/** /**
* one file node with download grant * one file node with download grant
*/ */
Tine.Filemanager.nodeActions.Download = { Tine.Filemanager.nodeActions.Download = {
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)