1 //<script type="text/javascript">
3 // generic groups edit dialog
15 this.dialog = new Roo.LayoutDialog(Roo.get(document.body).createChild({tag:'div'}), {
30 // tabPosition: 'top',
36 this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
37 this.dialog.addButton("Cancel", this.dialog.hide, this.dialog);
39 this.dialog.addButton("Save", this.save, this);
40 this.layout = this.dialog.getLayout();
41 this.layout.beginUpdate();
45 this.form = new Roo.form.Form({
48 actionfailed : function(f, act) {
49 _this.dialog.el.unmask();
52 Pman.standardActionFailed(f,act);
55 actioncomplete: function(f, act) {
56 _this.dialog.el.unmask();
57 //console.log('load completed');
58 // error messages?????
61 if (act.type == 'load') {
63 _this.data = act.result.data;
69 if (act.type == 'submit') { // only submitted here if we are
72 _this.callback.call(this, act.result.data);
84 //?? will this work...
85 this.form.addxtype.apply(this.form,[{
87 fieldLabel : "Group Name", // should be team name for other one.!!!!!
90 qtip : "Enter Group name",
100 qtip : "Select Person Who opened",
104 store: new Roo.data.Store({
106 proxy: new Roo.data.HttpProxy({
107 url: baseURL + '/Roo/core_person',
110 reader: new Roo.data.JsonReader({}, []),
112 beforeload : function(st,o)
114 // compnay myst be set..
116 o.params.company_id = Pman.Login.authUser.company_id * 1;
126 hiddenName: 'leader',
128 forceSelection: true,
129 doForce : function(){
130 if(this.el.dom.value.length > 0){
132 this.lastSelectionText === undefined ? "" : this.lastSelectionText;
133 this.applyEmptyText();
134 if (!this.el.dom.value.length) {
135 this.setFromData({ id: 0, name: '----' });
141 triggerAction: 'all',
142 tpl: new Roo.Template(
143 '<div class="x-grid-cell-text x-btn button">',
144 '<b>{name}</b> {role}',
147 queryParam: 'query[name]',
148 loadingText: "Searching...",
164 name : 'type', // 0 == Group, 1 == team..
170 var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
171 ef.dom.style.margin = 10;
173 this.form.render(ef.dom);
175 var vp = this.dialog.getLayout().add('center', new Roo.ContentPanel(ef, {
177 //title: 'Org Details',
187 this.layout.endUpdate();
190 show : function(data, callback)
192 this.callback= callback;
197 this.form.setValues(data);
200 this.dialog.setTitle(data.type ? "Edit Group" : "Edit Team");
201 var lw = Roo.get(this.form.findField('leader').el.dom.parentNode.parentNode.parentNode);
202 // change the label!?!!?
203 lw.setVisibilityMode(Roo.Element.DISPLAY);
204 if (this.data.type) {
208 this.form.findField('leader').setFromData({
209 id: this.data.leader,
210 name : this.data.leader ? this.data.leader_name : ''
224 this.form.doAction('submit', {
225 url: baseURL + '/Roo/core_group.php',