diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php
index d35f586ae7..8697ac00ed 100644
--- a/addressbook/inc/class.addressbook_ui.inc.php
+++ b/addressbook/inc/class.addressbook_ui.inc.php
@@ -2271,12 +2271,12 @@ window.egw_LAB.wait(function() {
{
if(!empty($_content))
{
- $do_email = $_content['do_email'];
+
$response = egw_json_response::get();
- $query = egw_session::appsession($do_email ? 'email' : 'index','addressbook');
+ $query = egw_session::appsession('index','addressbook');
- if ($_content['button']['cancel'])
+ if ($_content['button']['cancelsearch'])
{
unset($query['advanced_search']);
}
@@ -2291,18 +2291,15 @@ window.egw_LAB.wait(function() {
$query['start'] = 0;
$query['search'] = '';
// store the index state in the session
- egw_session::appsession($do_email ? 'email' : 'index','addressbook',$query);
+ egw_session::appsession('index','addressbook',$query);
// store the advanced search in the session to call it again
egw_session::appsession('advanced_search','addressbook',$query['advanced_search']);
error_log(__METHOD__. "() call ADV" );
if ($_content['button']['search']) $response->call("app.addressbook.adv_search");
- if ($_content['button']['cancel']) egw_framework::window_close (); //$response->addScript('this.close();');
- }
- else
- {
- $do_email = strpos($_SERVER['HTTP_REFERER'],'emailpopup') !== false;
+ if ($_content['button']['cancelsearch']) egw_framework::window_close (); //$response->addScript('this.close();');
}
+
//$GLOBALS['egw_info']['flags']['include_xajax'] = true;
//$GLOBALS['egw_info']['flags']['java_script'] .= "";
$GLOBALS['egw_info']['etemplate']['advanced_search'] = true;
@@ -2353,12 +2350,11 @@ window.egw_LAB.wait(function() {
// setting hidebuttons for content will hide the 'normal' addressbook edit dialog buttons
$content['hidebuttons'] = true;
$content['no_tid'] = true;
-
- $this->tmpl->read('addressbook.search');
+ $content['showsearchbuttons'] = true; // enable search operation and search buttons| they're disabled by default
+
+ $this->tmpl->read('addressbook.edit');
$this->tmpl->set_cell_attribute('change_org','disabled',true);
- return $this->tmpl->exec('addressbook.addressbook_ui.search',$content,$sel_options,$readonlys,array(
- 'do_email' => $do_email,
- ),2);
+ return $this->tmpl->exec('addressbook.addressbook_ui.search',$content,$sel_options,$readonlys,array(),2);
}
/**
diff --git a/addressbook/js/app.js b/addressbook/js/app.js
index 187ee5b85c..0cb0fdd26b 100644
--- a/addressbook/js/app.js
+++ b/addressbook/js/app.js
@@ -58,15 +58,23 @@ app.classes.addressbook = AppJS.extend(
// call parent
this._super.apply(this, arguments);
- if (typeof et2.templates['addressbook.edit'] != 'undefined')
+ if (typeof et2.templates['addressbook.edit'] != 'undefined') // addressbook_ui.edit
{
- this.show_custom_country($j('select[id*="adr_one_countrycode"]').get(0));
- this.show_custom_country($j('select[id*="adr_two_countrycode"]').get(0));
-
- // Instanciate infolog JS too - wrong app, so it won't be done automatically
- if(typeof window.app.infolog != 'object' && typeof window.app.classes['infolog'] == 'function')
+ var content = this.et2.getArrayMgr('content').data;
+ if (typeof content.showsearchbuttons == 'undefined' || !content.showsearchbuttons)
{
- window.app.infolog = new window.app.classes.infolog();
+ this.show_custom_country($j('select[id*="adr_one_countrycode"]').get(0));
+ this.show_custom_country($j('select[id*="adr_two_countrycode"]').get(0));
+
+ // Instanciate infolog JS too - wrong app, so it won't be done automatically
+ if(typeof window.app.infolog != 'object' && typeof window.app.classes['infolog'] == 'function')
+ {
+ window.app.infolog = new window.app.classes.infolog();
+ }
+ }
+ else // addressbook_ui.search
+ {
+ //Any changes specificaly on AB search popup implement here
}
}
diff --git a/addressbook/templates/default/edit.xet b/addressbook/templates/default/edit.xet
index 78f9068fc2..79f79b3528 100644
--- a/addressbook/templates/default/edit.xet
+++ b/addressbook/templates/default/edit.xet
@@ -165,10 +165,10 @@
-
-
-
-
+
+
+
+
@@ -283,17 +283,17 @@
-
+
-
+
-
+
@@ -305,7 +305,7 @@
-
+
@@ -645,6 +645,22 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addressbook/templates/default/search.xet b/addressbook/templates/default/search.xet
deleted file mode 100644
index b58c0517e1..0000000000
--- a/addressbook/templates/default/search.xet
+++ /dev/null
@@ -1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