R36503 - /trunk/etemplate/js/et2_widget_file.js

Author: nathangray
New Revision: 36503

URL: http://svn.stylite.de/viewvc/egroupware?rev=36503&view=rev
Log:
Pass etemplate_exec_id in POST instead of GET to avoid potential issues with long ids

Modified:
trunk/etemplate/js/et2_widget_file.js

Modified: trunk/etemplate/js/et2_widget_file.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/js/et2_widget_file.js?rev=36503&r1=36502&r2=36503&view=diff

— trunk/etemplate/js/et2_widget_file.js (original)
+++ trunk/etemplate/js/et2_widget_file.js Thu Sep 8 22:33:46 2011
@@ -55,10 +55,17 @@
this._super.apply(this, arguments)

	this.node = null;
  •   this.input = null;
    
  •   this.progress = null;
    
  •   if(!this.options.id) {
    
  •   	console.warn("File widget needs an ID.  Used 'file_widget'.");
    
  •   	this.options.id = "file_widget";
    
  •   }
    
      // Set up the URL to have the request ID & the widget ID
      var instance = this.getInstanceManager();
    
  •   var self = this;
      this.asyncOptions = {
      	// Callbacks
    

@@ -69,11 +76,17 @@
onProgress: function(event, progress, name, number, total) { return self.onProgress(event,progress,name,number,total);},
onError: function(event, name, error) { return self.onError(event,name,error);},
sendBoundary: window.FormData || jQuery.browser.mozilla,

  •   	url: egw_json_request.prototype._assembleAjaxUrl("etemplate_widget_file::ajax_upload") + 
    
  •   		"&request_id="+ instance.etemplate_exec_id
    
  •   	beforeSend: function(form) { return self.beforeSend(form);},
    
  •   	url: egw_json_request.prototype._assembleAjaxUrl("etemplate_widget_file::ajax_upload::etemplate")
      };
      this.asyncOptions.fieldName = this.options.id;
      this.createInputWidget();
    
  • },

  • destroy: function() {

  •   this.node = null;
    
  •   this.input = null;
    
  •   this.progress = null;
    

    },

    createInputWidget: function() {
    @@ -108,6 +121,20 @@

    getInputNode: function() {
    return this.input[0];

  • },

  • /**

    • Add in the request id
  • */

  • beforeSend: function(form) {

  •   var instance = this.getInstanceManager();
    
  •   // Form object available, mess with it directly
    
  •   if(form) {
    
  •   	return form.append("request_id", instance.etemplate_exec_id);
    
  •   }
    
  •   // No Form object, add in as string
    
  •   return 'Content-Disposition: form-data; name="request_id"\r\n\r\n'+instance.etemplate_exec_id+'\r\n';
    

    },

    /**


Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs