Don't hide upload dialog if no file was selected. Display an alert message for all empty file uploads (#1489685)
| | |
| | | // execute a specific command on the web client |
| | | this.command = function(command, props, obj, event) |
| | | { |
| | | var ret, uid, cid, url, flag; |
| | | var ret, uid, cid, url, flag, aborted = false; |
| | | |
| | | if (obj && obj.blur) |
| | | obj.blur(); |
| | |
| | | // Reset the auto-save timer |
| | | clearTimeout(this.save_timer); |
| | | |
| | | this.upload_file(props || this.gui_objects.uploadform, 'upload'); |
| | | if (!this.upload_file(props || this.gui_objects.uploadform, 'upload')) { |
| | | alert(this.get_label('selectimportfile')); |
| | | aborted = true; |
| | | } |
| | | break; |
| | | |
| | | case 'insert-sig': |
| | |
| | | if (!this.upload_file(form, 'import')) { |
| | | this.set_busy(false, null, importlock); |
| | | alert(this.get_label('selectimportfile')); |
| | | aborted = true; |
| | | } |
| | | break; |
| | | |
| | |
| | | var file = document.getElementById('rcmimportfile'); |
| | | if (file && !file.value) { |
| | | alert(this.get_label('selectimportfile')); |
| | | aborted = true; |
| | | break; |
| | | } |
| | | this.gui_objects.importform.submit(); |
| | |
| | | break; |
| | | } |
| | | |
| | | if (this.triggerEvent('after'+command, props) === false) |
| | | if (!aborted && this.triggerEvent('after'+command, props) === false) |
| | | ret = false; |
| | | this.triggerEvent('actionafter', {props:props, action:command}); |
| | | this.triggerEvent('actionafter', { props:props, action:command, aborted:aborted }); |
| | | |
| | | return ret === false ? false : obj ? false : true; |
| | | }; |
| | |
| | | if (numfiles) { |
| | | if (this.env.max_filesize && this.env.filesizeerror && size > this.env.max_filesize) { |
| | | this.display_message(this.env.filesizeerror, 'error'); |
| | | return; |
| | | return false; |
| | | } |
| | | |
| | | var frame_name = this.async_upload_form(form, action || 'upload', function(e) { |
| | |
| | | 'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage', |
| | | 'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'uploadingmany', |
| | | 'fileuploaderror', 'sendmessage', 'savenewresponse', 'responsename', 'responsetext', 'save', |
| | | 'savingresponse', 'restoresavedcomposedata', 'restoremessage', 'delete', 'restore', 'ignore'); |
| | | 'savingresponse', 'restoresavedcomposedata', 'restoremessage', 'delete', 'restore', 'ignore', |
| | | 'selectimportfile'); |
| | | |
| | | $OUTPUT->set_pagetitle($RCMAIL->gettext('compose')); |
| | | |