mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Fix HiddenUpload shares fail to complete the upload
This commit is contained in:
parent
075ba0f330
commit
c9eaeb51ea
@ -1314,9 +1314,12 @@ export class filemanagerAPP extends EgwApp
|
|||||||
* Check if a row can have the Hidden Uploads action
|
* Check if a row can have the Hidden Uploads action
|
||||||
* Needs to be a directory
|
* Needs to be a directory
|
||||||
*/
|
*/
|
||||||
hidden_upload_enabled(_action: egwAction, _senders: egwActionObject[])
|
hidden_upload_enabled(_action : egwAction, _senders : egwActionObject[])
|
||||||
{
|
{
|
||||||
if (_senders[0].id == 'nm') return false;
|
if(_senders[0].id == 'nm')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let data = egw.dataGetUIDdata(_senders[0].id);
|
let data = egw.dataGetUIDdata(_senders[0].id);
|
||||||
let readonly = (data?.data.class || '').split(/ +/).indexOf('noEdit') >= 0;
|
let readonly = (data?.data.class || '').split(/ +/).indexOf('noEdit') >= 0;
|
||||||
|
|
||||||
@ -1324,6 +1327,12 @@ export class filemanagerAPP extends EgwApp
|
|||||||
return (!_senders[0].id || data.data.is_dir && !readonly);
|
return (!_senders[0].id || data.data.is_dir && !readonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hiddenUploadOnOne(event)
|
||||||
|
{
|
||||||
|
let path = event.data?.options?.uploadPath || this.get_path() + "/Upload";
|
||||||
|
this.upload(event, 1, '/Shared dir/Upload', 'rename', 'EGroupware\\Filemanager\\Sharing\\HiddenUpload::ajax_action');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View the link from an existing share
|
* View the link from an existing share
|
||||||
* (EPL only)
|
* (EPL only)
|
||||||
|
@ -49,8 +49,9 @@ class HiddenUpload extends AnonymousList
|
|||||||
|
|
||||||
// Take over upload, change target and conflict strategy
|
// Take over upload, change target and conflict strategy
|
||||||
$path = Vfs::concat(self::get_home_dir(), Sharing::HIDDEN_UPLOAD_DIR);
|
$path = Vfs::concat(self::get_home_dir(), Sharing::HIDDEN_UPLOAD_DIR);
|
||||||
$target = str_replace('\\', '\\\\', __CLASS__);
|
$this->etemplate->setElementAttribute('nm[upload]', 'onFinishOne', "app.filemanager.hiddenUploadOnOne");
|
||||||
$this->etemplate->setElementAttribute('nm[upload]', 'onFinishOne', "app.filemanager.upload(ev, 1, '$path', 'rename', '{$target}::ajax_action')");
|
// Not a real attribute, but we need to make sure we always upload to the correct place
|
||||||
|
$this->etemplate->setElementAttribute('nm[upload]', 'uploadPath', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::listview($content, $msg);
|
return parent::listview($content, $msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user