Add selectAccount_ro to handle ajax user names

This commit is contained in:
Nathan Gray 2012-03-14 19:02:28 +00:00
parent 45751ff042
commit e5b4bcfe7f
3 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,49 @@
/**
* eGroupWare eTemplate2 - JS Select account widget
*
* Selecting accounts needs special UI, and displaying needs special consideration
* to avoid sending the entire user list to the client.
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @subpackage api
* @link http://www.egroupware.org
* @author Nathan Gray
* @copyright Nathan Gray 2011
* @version $Id$
*/
"use strict";
/*egw:uses
et2_widget_link;
*/
/**
* et2_selectAccount_ro is the readonly implementation of select account
* It extends et2_link to avoid needing the whole user list on the client.
* Instead, it just asks for the names of the ones needed, as needed.
*/
var et2_selectAccount_ro = et2_link.extend([et2_IDetachedDOM], {
init: function(_parent, options) {
/**
Resolve some circular dependency problems here
selectAccount extends link, link is in a file that needs select,
select has menulist wrapper, which needs to know about selectAccount before it allows it
*/
if(_parent.supportedWidgetClasses.indexOf(et2_selectAccount_ro) < 0)
{
_parent.supportedWidgetClasses.push(et2_selectAccount_ro);
}
this._super.apply(this, arguments);
this.options.application = 'home-accounts';
// Don't make it look like a link though
this.link.removeClass("et2_link");
}
});
et2_register_widget(et2_selectAccount_ro, ["select-account_ro"]);

View File

@ -335,7 +335,7 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
});
et2_register_widget(et2_selectbox_ro, ["menupopup_ro", "listbox_ro", "select_ro", "select-cat_ro",
"select-account_ro", "select-percent_ro", 'select-priority_ro', 'select-access_ro',
"select-percent_ro", 'select-priority_ro', 'select-access_ro',
'select-country_ro', 'select-state_ro', 'select-year_ro', 'select-month_ro',
'select-day_ro', 'select-dow_ro', 'select-hour_ro', 'select-number_ro', 'select-app_ro',
'select-lang_ro', 'select-bool_ro', 'select-timezone_ro' ]);

View File

@ -34,6 +34,7 @@
et2_widget_file;
et2_widget_link;
et2_widget_progress;
et2_widget_selectAccount;
et2_extension_nextmatch;
et2_extension_customfields;