Fix autoselected radioBottons for actions group in mail->sieve->edit popup

This commit is contained in:
Hadi Nategh 2013-10-09 16:44:03 +00:00
parent f40f41a7d4
commit 603fb8e782
2 changed files with 20 additions and 19 deletions

View File

@ -10,7 +10,7 @@
/** /**
* UI for mail * UI for mail
* *
* @augments AppJS * @augments AppJS
*/ */
app.mail = AppJS.extend( app.mail = AppJS.extend(
@ -52,6 +52,7 @@ app.mail = AppJS.extend(
destroy: function() destroy: function()
{ {
delete this.et2; delete this.et2;
delete this.et2_obj;
// call parent // call parent
this._super.apply(this, arguments); this._super.apply(this, arguments);
}, },
@ -231,10 +232,10 @@ app.mail = AppJS.extend(
// How to pull data from the Mail IDs for the compose // How to pull data from the Mail IDs for the compose
from: '' from: ''
}; };
// We only handle one for everything but forward // We only handle one for everything but forward
settings.id = (typeof _elems == 'undefined'?'':_elems[0].id); settings.id = (typeof _elems == 'undefined'?'':_elems[0].id);
switch(_action.id) switch(_action.id)
{ {
case 'compose': case 'compose':
@ -269,19 +270,19 @@ app.mail = AppJS.extend(
var window_name = 'compose_' + compose_list.length + '_'+ (settings.from || '') + '_' + settings.id; var window_name = 'compose_' + compose_list.length + '_'+ (settings.from || '') + '_' + settings.id;
return egw().open('','mail','add',settings,window_name,'mail'); return egw().open('','mail','add',settings,window_name,'mail');
}, },
/** /**
* Set content into a compose window * Set content into a compose window
* *
* @function * @function
* @memberOf mail * @memberOf mail
* *
* @param {String} window_name The name of an open content window. * @param {String} window_name The name of an open content window.
* @param content Data to set into the window's fields * @param content Data to set into the window's fields
* @param content.to Addresses to add to the to line * @param content.to Addresses to add to the to line
* @param content.cc Addresses to add to the CC line * @param content.cc Addresses to add to the CC line
* @param content.bcc Addresses to add to the BCC line * @param content.bcc Addresses to add to the BCC line
* *
* @return {boolean} Success * @return {boolean} Success
*/ */
setCompose: function(window_name, content) setCompose: function(window_name, content)
@ -289,14 +290,14 @@ app.mail = AppJS.extend(
// Get window // Get window
var compose = window.open('', window_name); var compose = window.open('', window_name);
if(!compose || compose.closed) return false; if(!compose || compose.closed) return false;
// Get etemplate of popup // Get etemplate of popup
var compose_et2 = compose.etemplate2.getByApplication('mail'); var compose_et2 = compose.etemplate2.getByApplication('mail');
if(!compose_et2 || compose_et2.length != 1 || !compose_et2[0].widgetContainer) if(!compose_et2 || compose_et2.length != 1 || !compose_et2[0].widgetContainer)
{ {
return false; return false;
} }
// Set each field provided // Set each field provided
var success = true; var success = true;
for(var field in content) for(var field in content)
@ -304,7 +305,7 @@ app.mail = AppJS.extend(
try try
{ {
var widget = compose_et2[0].widgetContainer.getWidgetById(field); var widget = compose_et2[0].widgetContainer.getWidgetById(field);
// Merge array values, replace strings // Merge array values, replace strings
var value = widget.getValue() || content[field]; var value = widget.getValue() || content[field];
if(jQuery.isArray(value)) if(jQuery.isArray(value))
@ -1351,7 +1352,7 @@ app.mail = AppJS.extend(
/** /**
* Send names of uploaded files (again) to server, to process them: either copy to vfs or ask overwrite/rename * Send names of uploaded files (again) to server, to process them: either copy to vfs or ask overwrite/rename
* *
* @param _event * @param _event
* @param _file_count * @param _file_count
* @param {string} [_path=current directory] Where the file is uploaded to. * @param {string} [_path=current directory] Where the file is uploaded to.
@ -1377,7 +1378,7 @@ app.mail = AppJS.extend(
/** /**
* Send names of uploaded files (again) to server, to process them: either copy to vfs or ask overwrite/rename * Send names of uploaded files (again) to server, to process them: either copy to vfs or ask overwrite/rename
* *
* @param _event * @param _event
* @param _file_count * @param _file_count
* @param {string} [_path=current directory] Where the file is uploaded to. * @param {string} [_path=current directory] Where the file is uploaded to.

View File

@ -90,23 +90,23 @@
</columns> </columns>
<rows> <rows>
<row> <row>
<radio label="File into:" id="action[]" options="folder"/> <radio label="File into:" id="action" options="folder"/>
<hbox> <hbox>
<taglist id="action_folder_text" width="40%" autocomplete_url="mail.mail_compose.ajax_searchFolder" autocomplete_params="" allowFreeEntries="false" maxSelection="1" /> <taglist id="action_folder_text" width="40%" autocomplete_url="mail.mail_compose.ajax_searchFolder" autocomplete_params="" allowFreeEntries="false" maxSelection="1" onfocus="app.mail.sieve_focus_radioBtn" />
</hbox> </hbox>
</row> </row>
<row> <row>
<radio label="Forward to address:" id="action[]" options="address"/> <radio label="Forward to address:" id="action" options="address"/>
<hbox> <hbox>
<taglist-email allowFreeEntries="true" id="action_address_text" width="40%" maxSelection="1" /> <taglist-email allowFreeEntries="true" id="action_address_text" width="40%" maxSelection="1" onfocus="app.mail.sieve_focus_radioBtn" />
</hbox> </hbox>
</row> </row>
<row> <row>
<radio label="Send a reject message:" id="action[]" options="reject"/> <radio label="Send a reject message:" id="action" options="reject"/>
<textbox multiline="true" id="action_reject_text"/> <textbox multiline="true" id="action_reject_text" onfocus="app.mail.sieve_focus_radioBtn" />
</row> </row>
<row> <row>
<radio label="Discard message" id="action[]" options="discard"/> <radio label="Discard message" id="action" options="discard"/>
<description/> <description/>
</row> </row>
</rows> </rows>