mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Fix up advanced search
This commit is contained in:
parent
7f291a17a6
commit
806165d947
@ -1444,9 +1444,10 @@ window.egw_LAB.wait(function() {
|
|||||||
$op = 'OR';
|
$op = 'OR';
|
||||||
if ($query['advanced_search'])
|
if ($query['advanced_search'])
|
||||||
{
|
{
|
||||||
$op = $query['advanced_search']['operator'];
|
// Make sure op & wildcard are only valid options
|
||||||
|
$op = $query['advanced_search']['operator'] == $op ? $op : 'AND';
|
||||||
unset($query['advanced_search']['operator']);
|
unset($query['advanced_search']['operator']);
|
||||||
$wildcard = $query['advanced_search']['meth_select'];
|
$wildcard = $query['advanced_search']['meth_select'] == $wildcard ? $wildcard : false;
|
||||||
unset($query['advanced_search']['meth_select']);
|
unset($query['advanced_search']['meth_select']);
|
||||||
}
|
}
|
||||||
//if ($do_email ) $email_only = array('id','owner','tid','n_fn','n_family','n_given','org_name','email','email_home');
|
//if ($do_email ) $email_only = array('id','owner','tid','n_fn','n_family','n_given','org_name','email','email_home');
|
||||||
@ -2628,20 +2629,27 @@ window.egw_LAB.wait(function() {
|
|||||||
{
|
{
|
||||||
if(!$value) unset($query['advanced_search'][$key]);
|
if(!$value) unset($query['advanced_search'][$key]);
|
||||||
}
|
}
|
||||||
|
// Skip n_fn, it causes problems in sql
|
||||||
|
unset($query['advanced_search']['n_fn']);
|
||||||
}
|
}
|
||||||
$query['start'] = 0;
|
|
||||||
$query['search'] = '';
|
$query['search'] = '';
|
||||||
// store the index state in the session
|
// store the index state in the session
|
||||||
egw_session::appsession('index','addressbook',$query);
|
egw_session::appsession('index','addressbook',$query);
|
||||||
|
|
||||||
// store the advanced search in the session to call it again
|
// store the advanced search in the session to call it again
|
||||||
egw_session::appsession('advanced_search','addressbook',$query['advanced_search']);
|
egw_session::appsession('advanced_search','addressbook',$query['advanced_search']);
|
||||||
if ($_content['button']['search']) $response->call("app.addressbook.adv_search");
|
|
||||||
if ($_content['button']['cancelsearch']) egw_framework::window_close (); //$response->addScript('this.close();');
|
// Update client / nextmatch with filters, or clear
|
||||||
|
$response->call("app.addressbook.adv_search", array('advanced_search' => $_content['button']['search'] ? $query['advanced_search'] : ''));
|
||||||
|
if ($_content['button']['cancelsearch'])
|
||||||
|
{
|
||||||
|
egw_framework::window_close (); //$response->addScript('this.close();');
|
||||||
|
|
||||||
|
// No need to reload popup
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//$GLOBALS['egw_info']['flags']['include_xajax'] = true;
|
|
||||||
//$GLOBALS['egw_info']['flags']['java_script'] .= "<script>window.egw_LAB.wait(function() {window.focus();});</script>";
|
|
||||||
$GLOBALS['egw_info']['etemplate']['advanced_search'] = true;
|
$GLOBALS['egw_info']['etemplate']['advanced_search'] = true;
|
||||||
|
|
||||||
// initialize etemplate arrays
|
// initialize etemplate arrays
|
||||||
|
@ -34,7 +34,6 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
*/
|
*/
|
||||||
destroy: function()
|
destroy: function()
|
||||||
{
|
{
|
||||||
//delete this.et2;
|
|
||||||
// call parent
|
// call parent
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
},
|
},
|
||||||
@ -492,14 +491,29 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Apply advanced search filters to index nextmatch
|
||||||
*/
|
*/
|
||||||
adv_search: function()
|
adv_search: function(filters)
|
||||||
{
|
{
|
||||||
var link = opener.location.href;
|
var index = window.opener.etemplate2.getById('addressbook-index');
|
||||||
link = link.replace(/#/,'');
|
if(!index)
|
||||||
opener.location.href=link.replace(/\#/,'');
|
{
|
||||||
},
|
alert('Could not find index');
|
||||||
|
window.close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var nm = index.widgetContainer.getWidgetById('nm');
|
||||||
|
if(!index)
|
||||||
|
{
|
||||||
|
window.opener.egw.message('Could not find list', 'error');
|
||||||
|
window.close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Reset filters first
|
||||||
|
nm.activeFilters = {};
|
||||||
|
nm.applyFilters(filters);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mail vCard
|
* Mail vCard
|
||||||
|
Loading…
Reference in New Issue
Block a user