2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
38 require_once('include/tabs.php');
43 * SearchForm Template to use (xtpl)
48 * SearchField meta data array to use. Populated from moduleDir/metadata/SearchFields
58 * Module the search from is for
63 * meta data for the tabs to display
73 * Use to determine whether or not to show the saved search options
76 var $showSavedSearchOptions = true;
79 * loads SearchFields MetaData, sets member variables
81 * @param string $module moduleDir
82 * @param bean $seedBean seed bean to use
83 * @param string $tpl template to use, defaults to moduleDir/SearchForm.html
86 function SearchForm($module, &$seedBean, $tpl = null) {
89 $this->module = $module;
90 require_once('modules/' . $module . '/metadata/SearchFields.php');
91 if(file_exists('custom/modules/' . $module . '/metadata/SearchFields.php')){
92 require_once('custom/modules/' . $module . '/metadata/SearchFields.php');
96 //require_once('modules/' . $module . '/metadata/SearchFields.php');
97 $this->searchFields = $searchFields[$module];
99 $this->tpl = 'modules/' . $module . '/SearchForm.html';
100 if(!empty($GLOBALS['layout_edit_mode'])){
101 $this->tpl = $GLOBALS['sugar_config']['cache_dir'].'studio/custom/working/modules/' . $module . '/SearchForm.html';
108 $this->bean = $seedBean;
109 $this->tabs = array(array('title' => $app_strings['LNK_BASIC_SEARCH'],
110 'link' => $module . '|basic_search',
111 'key' => $module . '|basic_search'),
112 array('title' => $app_strings['LNK_ADVANCED_SEARCH'],
113 'link' => $module . '|advanced_search',
114 'key' => $module . '|advanced_search'));
116 if(file_exists('modules/'.$this->module.'/index.php')){
117 $this->tabs[] = array('title' => $app_strings['LNK_SAVED_VIEWS'],
118 'link' => $module . '|saved_views',
119 'key' => $module . '|saved_views');
125 * Populate the searchFields from an array
127 * @param array $array array to search through
128 * @param string $switchVar variable to use in switch statement
129 * @param bool $addAllBeanFields true to process at all bean fields
131 function populateFromArray(&$array, $switchVar = null, $addAllBeanFields = true) {
134 if(empty($array['searchFormTab']) && empty($switchvar)) {
135 $array['searchFormTab'] = 'advanced_search';
138 if(!empty($array['searchFormTab']) || !empty($switchVar)) {
139 $arrayKeys = array_keys($array);
140 $searchFieldsKeys = array_keys($this->searchFields);
141 if(empty($switchVar)) $switchVar = $array['searchFormTab'];
144 foreach($this->searchFields as $name => $params) {
145 if(isset($array[$name . '_basic'])) {
146 $this->searchFields[$name]['value'] =
147 is_string($array[$name . '_basic'])?trim($array[$name . '_basic']):$array[$name . '_basic'];
150 if($addAllBeanFields) {
151 foreach($this->bean->field_name_map as $key => $params) {
152 if(in_array($key . '_basic' , $arrayKeys) && !in_array($key, $searchFieldsKeys)) {
154 $this->searchFields[$key] = array('query_type' => 'default',
155 'value' => $array[$key . '_basic']);
160 case 'advanced_search':
161 foreach($this->searchFields as $name => $params) {
162 if(isset($array[$name])) {
163 $this->searchFields[$name]['value'] = is_string($array[$name])?trim($array[$name]):$array[$name];
166 if((empty($array['massupdate']) || $array['massupdate'] == 'false') && $addAllBeanFields) {
167 foreach($this->bean->field_name_map as $key => $params) {
168 if(in_array($key, $arrayKeys) && !in_array($key, $searchFieldsKeys)) {
169 $this->searchFields[$key] = array('query_type' => 'default',
170 'value' => $array[$key]);
176 foreach($this->searchFields as $name => $params) {
177 if(isset($array[$name . '_basic'])) { // save basic first
178 $this->searchFields[$name]['value'] = $array[$name . '_basic'];
180 if(isset($array[$name])) { // overwrite by advanced if available
181 $this->searchFields[$name]['value'] = $array[$name];
184 if($addAllBeanFields) {
185 foreach($this->bean->field_name_map as $key => $params) {
186 if(!in_array($key, $searchFieldsKeys)) {
187 if(in_array($key . '_basic', $arrayKeys) ) {
188 $this->searchFields[$key] = array('query_type' => 'default',
189 'value' => $array[$key . '_basic']);
191 if(in_array($key, $arrayKeys)) {
192 $this->searchFields[$key] = array('query_type' => 'default',
193 'value' => $array[$key]);
203 * Populate the searchFields from $_REQUEST
205 * @param string $switchVar variable to use in switch statement
206 * @param bool $addAllBeanFields true to process at all bean fields
208 function populateFromRequest($switchVar = null, $addAllBeanFields = true) {
209 $this->populateFromArray($_REQUEST, $switchVar, $addAllBeanFields);
214 * The fuction will returns an array of filter conditions.
217 function generateSearchWhere($add_custom_fields = false, $module='') {
219 $values = $this->searchFields;
221 $where_clauses = array();
223 $table_name = $this->bean->object_name;
225 foreach($this->searchFields as $field=>$parms) {
226 $customField = false;
227 // Jenny - Bug 7462: We need a type check here to avoid database errors
228 // when searching for numeric fields. This is a temporary fix until we have
229 // a generic search form validation mechanism.
230 $type = (!empty($this->bean->field_name_map[$field]['type']))?$this->bean->field_name_map[$field]['type']:'';
231 if(!empty($this->bean->field_name_map[$field]['source']) && $this->bean->field_name_map[$field]['source'] == 'custom_fields'){
235 if ($type == 'int') {
236 if (!empty($parms['value'])) {
237 $tempVal = explode(',', $parms['value']);
239 foreach($tempVal as $key => $val) {
242 if(!empty($val) && !(is_numeric($val)))
247 $parms['value'] = $newVal;
250 // do not include where clause for custom fields with checkboxes that are unchecked
251 elseif($type == 'bool' && empty($parms['value']) && $customField) {
254 elseif($type == 'bool' && !empty($parms['value'])){
255 if ($parms['value'] == 'on'){
260 if(isset($parms['value']) && $parms['value'] != "") {
262 if(!empty($parms['operator'])) {
263 $operator = $parms['operator'];
266 if(is_array($parms['value'])) {
269 // If it is a custom field of mutliselect we have to do some special processing
270 if($customField && !empty($this->bean->field_name_map[$field]['isMultiSelect']) && $this->bean->field_name_map[$field]['isMultiSelect']) {
271 $operator = 'custom_enum';
272 $db_field = $this->bean->table_name . "_cstm." . $field;
273 foreach($parms['value'] as $key => $val) {
274 if($val != ' ' and $val != '') {
275 $qVal = $GLOBALS['db']->quote($val);
276 if (!empty($field_value)) {
277 $field_value .= ' or ';
279 $field_value .= "$db_field like '$qVal' or $db_field like '%$qVal^%' or $db_field like '%^$qVal%' or $db_field like '%^$qVal^%'";
283 $operator = $operator != 'subquery' ? 'in' : $operator;
284 foreach($parms['value'] as $key => $val) {
285 if($val != ' ' and $val != '') {
286 if (!empty($field_value)) {
289 $field_value .= "'" . $GLOBALS['db']->quote($val) . "'";
295 $field_value = $GLOBALS['db']->quote($parms['value']);
298 //set db_fields array.
299 if(!isset($parms['db_field'])) {
300 $parms['db_field'] = array($field);
303 if(isset($parms['my_items']) and $parms['my_items'] == true) {
304 global $current_user;
305 $field_value = $GLOBALS['db']->quote($current_user->id);
311 if($field_value != '') {
312 foreach ($parms['db_field'] as $db_field) {
314 if (strstr($db_field, '.') === false) {
316 $db_field = $this->bean->table_name . "." . $db_field;
318 $db_field = $this->bean->table_name . "_cstm." . $db_field;
323 if($type == 'date') {
324 // Collin - Have mysql as first because it's usually the case
325 // The regular expression check is to circumvent special case YYYY-MM
326 if($GLOBALS['db']->dbType == 'mysql') {
327 if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
328 $field_value = $timedate->to_db_date($field_value, false);
331 $operator = 'db_date';
333 } else if($GLOBALS['db']->dbType == 'oci8') {
334 if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
335 $field_value = $timedate->to_db_date($field_value, false);
336 $field_value = "to_date('" . $field_value . "', 'YYYY-MM-DD hh24:mi:ss')";
338 $operator = 'db_date';
339 } else if($GLOBALS['db']->dbType == 'mssql') {
340 if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
341 $field_value = "Convert(DateTime, '".$timedate->to_db_date($field_value, false)."')";
343 $operator = 'db_date';
345 $field_value = $timedate->to_db_date($field_value, false);
350 if($type == 'datetime'|| $type == 'datetimecombo') {
351 $dates = $timedate->getDayStartEndGMT($field_value);
352 $field_value = $dates["start"] . "<>" . $dates["end"];
353 $operator = 'between';
356 if($GLOBALS['db']->dbType == 'oci8' && isset($parms['query_type']) && $parms['query_type'] == 'case_insensitive') {
357 $db_field = 'upper(' . $db_field . ")";
358 $field_value = strtoupper($field_value);
365 switch(strtolower($operator)) {
368 if ( isset($parms['subquery_in_clause']) ) {
369 if ( !is_array($parms['subquery_in_clause']) ) {
370 $in = $parms['subquery_in_clause'];
372 elseif ( isset($parms['subquery_in_clause'][$field_value]) ) {
373 $in = $parms['subquery_in_clause'][$field_value];
376 $sq = $parms['subquery'];
379 if (isset($sq['OR'])){
384 if(empty($q) || strlen($q)<2) continue;
388 $where .= " {$db_field} $in ({$q} '{$field_value}%') ";
391 }elseif(!empty($parms['query_type']) && $parms['query_type'] == 'format'){
392 $stringFormatParams = array(0 => $field_value, 1 => $GLOBALS['current_user']->id);
393 $where .= "{$db_field} $in (".string_format($parms['subquery'], $stringFormatParams).")";
395 $where .= "{$db_field} $in ({$parms['subquery']} '{$field_value}%')";
400 $where .= $db_field . " like '".$field_value.$like_char."'";
403 $where .= $db_field . " in (".$field_value.')';
406 $where .= $db_field . " = '".$field_value ."'";
409 if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
410 $where .= $db_field . " = ". $field_value;
412 // Create correct date_format conversion String
413 if($GLOBALS['db']->dbType == 'oci8') {
414 $where .= db_convert($db_field,'date_format',array("'YYYY-MM'")) . " = '" . $field_value . "'";
416 $where .= db_convert($db_field,'date_format',array("'%Y-%m'")) . " = '" . $field_value . "'";
421 $field_value = explode('<>', $field_value);
422 $where .= $db_field . " >= '".$field_value[0] . "' AND " .$db_field . " <= '".$field_value[1]."'";
429 array_push($where_clauses, '( '.$where.' )');
432 array_push($where_clauses, $where);
438 return $where_clauses;
442 * displays the tabs (top of the search form)
444 * @param string $currentKey key in $this->tabs to show as the current tab
446 * @return string html
448 function displayTabs($currentKey) {
449 $GLOBALS['log']->debug('SearchForm.php->displayTabs(): tabs='.print_r($this->tabs,true));
451 $tabPanel = new SugarWidgetTabs($this->tabs, $currentKey, 'SUGAR.searchForm.searchFormSelect');
453 if(isset($_REQUEST['saved_search_select']) && $_REQUEST['saved_search_select']!='_none') {
454 $saved_search=loadBean('SavedSearch');
455 $saved_search->retrieveSavedSearch($_REQUEST['saved_search_select']);
458 $str = $tabPanel->display();
460 if(!empty($_REQUEST['displayColumns']))
461 $str .= 'SUGAR.savedViews.displayColumns = "' . $_REQUEST['displayColumns'] . '";';
462 elseif(isset($saved_search->contents['displayColumns']) && !empty($saved_search->contents['displayColumns']))
463 $str .= 'SUGAR.savedViews.displayColumns = "' . $saved_search->contents['displayColumns'] . '";';
464 if(!empty($_REQUEST['hideTabs']))
465 $str .= 'SUGAR.savedViews.hideTabs = "' . $_REQUEST['hideTabs'] . '";';
466 elseif(isset($saved_search->contents['hideTabs']) && !empty($saved_search->contents['hideTabs']))
467 $str .= 'SUGAR.savedViews.hideTabs = "' . $saved_search->contents['hideTabs'] . '";';
468 if(!empty($_REQUEST['orderBy']))
469 $str .= 'SUGAR.savedViews.selectedOrderBy = "' . $_REQUEST['orderBy'] . '";';
470 elseif(isset($saved_search->contents['orderBy']) && !empty($saved_search->contents['orderBy']))
471 $str .= 'SUGAR.savedViews.selectedOrderBy = "' . $saved_search->contents['orderBy'] . '";';
472 if(!empty($_REQUEST['sortOrder']))
473 $str .= 'SUGAR.savedViews.selectedSortOrder = "' . $_REQUEST['sortOrder'] . '";';
474 elseif(isset($saved_search->contents['sortOrder']) && !empty($saved_search->contents['sortOrder']))
475 $str .= 'SUGAR.savedViews.selectedSortOrder = "' . $saved_search->contents['sortOrder'] . '";';
483 * sets up the search forms, populates the preset values
487 global $mod_strings, $app_strings, $app_list_strings, $theme, $timedate;
488 $GLOBALS['log']->debug('SearchForm.php->setup()');
489 $this->xtpl = new XTemplate($this->tpl);
490 $this->xtpl->assign("MOD", $mod_strings);
491 $this->xtpl->assign("APP", $app_strings);
492 $this->xtpl->assign("THEME", $theme);
493 $this->xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
494 $this->xtpl->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')');
496 foreach($this->searchFields as $name => $params) {
497 if(isset($params['template_var'])) $templateVar = $params['template_var'];
498 else $templateVar = strtoupper($name);
499 if(isset($params['value'])) { // populate w/ preselected values
500 if(isset($params['options'])) {
501 $options = $app_list_strings[$params['options']];
502 if(isset($params['options_add_blank']) && $params['options_add_blank']) array_unshift($options, '');
503 $this->xtpl->assign($templateVar, get_select_options_with_id($options, $params['value']));
506 if(isset($params['input_type'])) {
507 switch($params['input_type']) {
508 case 'checkbox': // checkbox input
509 if($params['value'] == 'on' || $params['value'])
510 $this->xtpl->assign($templateVar, 'checked');
514 else {// regular text input
515 $this->xtpl->assign($templateVar, to_html($params['value']));
519 else { // populate w/o preselected values
520 if(isset($params['options'])) {
521 $options = $app_list_strings[$params['options']];
522 if(isset($params['options_add_blank']) && $params['options_add_blank']) array_unshift($options, '');
523 $this->xtpl->assign($templateVar, get_select_options_with_id($options, ''));
527 if (!empty($_REQUEST['assigned_user_id'])) $this->xtpl->assign("USER_FILTER", get_select_options_with_id(get_user_array(FALSE), $_REQUEST['assigned_user_id']));
528 else $this->xtpl->assign("USER_FILTER", get_select_options_with_id(get_user_array(FALSE), ''));
530 // handle my items only
531 if(isset($this->searchFields['current_user_only']) && isset($this->searchFields['current_user_only']['value']))
532 $this->xtpl->assign("CURRENT_USER_ONLY", "checked");
536 * displays the search form header
538 * @param string $view which view is currently being displayed
541 function displayHeader($view) {
542 global $current_user;
543 $GLOBALS['log']->debug('SearchForm.php->displayHeader()');
545 if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
546 $header_text = "<a href='index.php?action=index&module=DynamicLayout&from_action=SearchForm&from_module=".$_REQUEST['module'] ."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
549 echo $header_text . $this->displayTabs($this->module . '|' . $view);
550 echo "<form name='search_form' class='search_form'>" .
551 "<input type='hidden' name='searchFormTab' value='{$view}'/>" .
552 "<input type='hidden' name='module' value='{$_REQUEST['module']}'/>" .
553 "<input type='hidden' name='action' value='{$_REQUEST['action']}'/>" .
554 "<input type='hidden' name='query' value='true'/>";
558 * displays the search form body, for example if basic_search is being displayed, then the function call would be
559 * displayWithHeaders('basic_search', $htmlForBasicSearchBody) {
561 * @param string $view which view is currently being displayed
562 * @param string $basic_search_text body of the basic search tab
563 * @param string $advanced_search_text body of the advanced search tab
564 * @param string $saved_views_text body of the saved views tab
567 function displayWithHeaders($view, $basic_search_text = '', $advanced_search_text = '', $saved_views_text = '') {
568 $GLOBALS['log']->debug('SearchForm.php->displayWithHeaders()');
569 $this->displayHeader($view);
570 echo "<div id='{$this->module}basic_searchSearchForm' " . (($view == 'basic_search') ? '' : "style='display: none'") . ">" . $basic_search_text . "</div>";
571 echo "<div id='{$this->module}advanced_searchSearchForm' " . (($view == 'advanced_search') ? '' : "style='display: none'") . ">" . $advanced_search_text . "</div>";
572 echo "<div id='{$this->module}saved_viewsSearchForm' " . (($view == 'saved_views') ? '' : "style='display: none'") . ">" . $saved_views_text . "</div>";
573 echo $this->getButtons();
575 // echo '<script type="text/javascript">Calendar.setup ({inputField : "search_jscal_field", ifFormat : "'.$timedate->get_cal_date_format().'", showsTime : false, button : "search_jscal_trigger", singleClick : true, step : 1});</script>';
579 * displays the basic search form body
581 * @param bool $header display this with headers
582 * @param bool $return echo or return the html
584 * @return string html of contents
586 function displayBasic($header = true, $return = false) {
587 global $current_user;
589 $this->bean->custom_fields->populateAllXTPL($this->xtpl, 'search' );
590 $this->xtpl->parse("main");
591 if(!empty($GLOBALS['layout_edit_mode'])){
592 $this->xtpl->parse("advanced");
594 $text = $this->xtpl->text("main");
595 if(!empty($GLOBALS['layout_edit_mode'])){
596 $text .= $this->xtpl->text("advanced");
598 if($header && empty($GLOBALS['layout_edit_mode'])) {
599 $this->displayWithHeaders('basic_search', $text);
602 if($return) return $text;
608 * displays the advanced search form body
610 * @param bool $header display this with headers
611 * @param bool $return echo or return the html
613 * @return string html of contents
615 function displayAdvanced($header = true, $return = false, $listViewDefs='', $lv='') {
616 global $current_user, $current_language;
617 $GLOBALS['log']->debug('SearchForm.php->displayAdvanced()');
618 $this->bean->custom_fields->populateAllXTPL($this->xtpl, 'search' );
619 if(!empty($listViewDefs) && !empty($lv)){
620 $GLOBALS['log']->debug('SearchForm.php->displayAdvanced(): showing saved search');
621 $savedSearch = new SavedSearch($listViewDefs[$this->module], $lv->data['pageData']['ordering']['orderBy'], $lv->data['pageData']['ordering']['sortOrder']);
622 $this->xtpl->assign('SAVED_SEARCH', $savedSearch->getForm($this->module, false));
623 $this->xtpl->assign('MOD_SAVEDSEARCH', return_module_language($current_language, 'SavedSearch'));
624 $this->xtpl->assign('ADVANCED_SEARCH_IMG', SugarThemeRegistry::current()->getImageURL('advanced_search.gif'));
625 //this determines whether the saved search subform should be rendered open or not
626 if(isset($_REQUEST['showSSDIV']) && $_REQUEST['showSSDIV']=='yes'){
627 $this->xtpl->assign('SHOWSSDIV', 'yes');
628 $this->xtpl->assign('DISPLAYSS', '');
630 $this->xtpl->assign('SHOWSSDIV', 'no');
631 $this->xtpl->assign('DISPLAYSS', 'display:none');
634 $this->xtpl->parse("advanced");
635 $text = $this->xtpl->text("advanced");
638 $this->displayWithHeaders('advanced_search', '', $text);
641 if($return) return $text;
647 * displays the saved views form body
649 * @param bool $header display this with headers
650 * @param bool $return echo or return the html
652 * @return string html of contents
654 function displaySavedViews($listViewDefs, $lv, $header = true, $return = false) {
655 global $current_user;
657 $savedSearch = new SavedSearch($listViewDefs[$this->module], $lv->data['pageData']['ordering']['orderBy'], $lv->data['pageData']['ordering']['sortOrder']);
660 $this->displayWithHeaders('saved_views', $this->displayBasic(false, true), $this->displayAdvanced(false, true), $savedSearch->getForm($this->module));
661 echo '<script>SUGAR.savedViews.handleForm();</script>';
664 echo $savedSearch->getForm($this->module, false);
669 * get the search buttons
671 * @return string html of contents
673 function getButtons() {
676 $SAVED_SEARCHES_OPTIONS = '';
677 $savedSearch = new SavedSearch();
678 $SAVED_SEARCHES_OPTIONS = $savedSearch->getSelect($this->module);
679 $str = "<input tabindex='2' title='{$app_strings['LBL_SEARCH_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SEARCH_BUTTON_KEY']}' onclick='SUGAR.savedViews.setChooser()' class='button' type='submit' name='button' value='{$app_strings['LBL_SEARCH_BUTTON_LABEL']}'/> ";
680 $str .= "<input tabindex='2' title='{$app_strings['LBL_CLEAR_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CLEAR_BUTTON_KEY']}' onclick='SUGAR.searchForm.clear_form(this.form); return false;' class='button' type='button' name='clear' value=' {$app_strings['LBL_CLEAR_BUTTON_LABEL']} '/>";
682 if(!empty($SAVED_SEARCHES_OPTIONS) && $this->showSavedSearchOptions){
683 $str .= " <span class='white-space'>
684 | <b>{$app_strings['LBL_SAVED_SEARCH_SHORTCUT']}</b>
685 {$SAVED_SEARCHES_OPTIONS}
686 <span id='go_btn_span' style='display:none'><input tabindex='2' title='go_select' id='go_select' onclick='SUGAR.searchForm.clear_form(this.form);' class='button' type='button' name='go_select' value=' {$app_strings['LBL_GO_BUTTON_LABEL']} '/></span>
692 function toggleInlineSearch(){
693 if (document.getElementById('inlineSavedSearch').style.display == 'none'){
694 document.getElementById('showSSDIV').value = 'yes'
695 document.getElementById('inlineSavedSearch').style.display = '';
697 document.getElementById('up_down_img').src='".SugarThemeRegistry::current()->getImageURL('basic_search.gif')."';
701 document.getElementById('up_down_img').src='".SugarThemeRegistry::current()->getImageURL('advanced_search.gif')."';
703 document.getElementById('showSSDIV').value = 'no';
704 document.getElementById('inlineSavedSearch').style.display = 'none';