missing commit of app.js

This commit is contained in:
Ralf Becker 2014-03-07 09:29:01 +00:00
parent 22b96163a4
commit 393cf2d78b

View File

@ -17,13 +17,6 @@
app.classes.addressbook = AppJS.extend(
{
appname: 'addressbook',
/**
* et2 widget container
*/
et2: null,
/**
* path widget
*/
/**
* Constructor
@ -51,15 +44,17 @@ app.classes.addressbook = AppJS.extend(
* and ready. If you must store a reference to the et2 object,
* make sure to clean it up in destroy().
*
* @param et2 etemplate2 Newly ready object
* @param {etemplate2} et2 newly ready object
* @param {string} name
*/
et2_ready: function(et2)
et2_ready: function(et2, name)
{
// call parent
this._super.apply(this, arguments);
if (typeof et2.templates['addressbook.edit'] != 'undefined') // addressbook_ui.edit
switch (name)
{
case 'addressbook.edit':
var content = this.et2.getArrayMgr('content').data;
if (typeof content.showsearchbuttons == 'undefined' || !content.showsearchbuttons)
{
@ -72,10 +67,7 @@ app.classes.addressbook = AppJS.extend(
window.app.infolog = new window.app.classes.infolog();
}
}
else // addressbook_ui.search
{
//Any changes specificaly on AB search popup implement here
}
break;
}
jQuery('select[id*="adr_one_countrycode"]').each(function() {
@ -86,6 +78,40 @@ app.classes.addressbook = AppJS.extend(
});
},
/**
* Run an action from CRM view toolbar
*
* @param {object} _action
*/
view_actions: function(_action)
{
// no idea why this.et2 is sometimes not initialised
if (!this.et2 && typeof etemplate2 == 'object')
{
var template = etemplate2.getByApplication('addressbook.view')[0];
this.et2 = template.widgetContainer;
}
var template = this.et2._inst;
var id = this.et2.getArrayMgr('content').data.id;
switch(_action.id)
{
case 'edit':
this.egw.open(id, 'addressbook', 'edit');
break;
case 'copy':
this.egw.open(id, 'addressbook', 'edit', { makecp: 1});
break;
case 'cancel':
default:
this.egw.open(null, 'addressbook', 'list', null, '_self', 'addressbook');
break;
//default:
template.submit(_action.id);
break;
}
},
/**
* Add appointment or show calendar for selected contacts, call default nm_action after some checks
*