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 = sugar_cached('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 = strtolower($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 // The regular expression check is to circumvent special case YYYY-MM
326 if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) {
327 $db_field = $this->bean->db->convert($db_field, "date_format", "%Y-%m");
329 $field_value = $timedate->to_db_date($field_value, false);
330 $db_field = $this->bean->db->convert($db_field, "date_format", "%Y-%m-%d");
334 if($type == 'datetime'|| $type == 'datetimecombo') {
335 $dates = $timedate->getDayStartEndGMT($field_value);
336 $field_value = array($this->bean->db->convert($dates["start"], "datetime"),
337 $this->bean->db->convert($dates["end"], "datetime"));
338 $operator = 'between';
341 if($this->bean->db->supports('case_sensitive') && isset($parms['query_type']) && $parms['query_type'] == 'case_insensitive') {
342 $db_field = 'upper(' . $db_field . ")";
343 $field_value = strtoupper($field_value);
353 if ( isset($parms['subquery_in_clause']) ) {
354 if ( !is_array($parms['subquery_in_clause']) ) {
355 $in = $parms['subquery_in_clause'];
357 elseif ( isset($parms['subquery_in_clause'][$field_value]) ) {
358 $in = $parms['subquery_in_clause'][$field_value];
361 $sq = $parms['subquery'];
364 if (isset($sq['OR'])){
369 if(empty($q) || strlen($q)<2) continue;
373 $where .= " {$db_field} $in ({$q} '{$field_value}%') ";
376 }elseif(!empty($parms['query_type']) && $parms['query_type'] == 'format'){
377 $stringFormatParams = array(0 => $field_value, 1 => $GLOBALS['current_user']->id);
378 $where .= "{$db_field} $in (".string_format($parms['subquery'], $stringFormatParams).")";
380 $where .= "{$db_field} $in ({$parms['subquery']} '{$field_value}%')";
385 $where .= $db_field . " like ".$this->bean->db->quoted($field_value.'%');
388 $where .= $db_field . " in (".$field_value.')';
391 $where .= $db_field . " = ".$this->bean->db->quoted($field_value);
394 if(!is_array($field_value)) {
395 $field_value = explode('<>', $field_value);
397 $where .= "(". $db_field . " >= ".$this->bean->db->quoted($field_value[0]) .
398 " AND " .$db_field . " <= ".$this->bean->db->quoted($field_value[1]).")";
405 array_push($where_clauses, '( '.$where.' )');
408 array_push($where_clauses, $where);
414 return $where_clauses;
418 * displays the tabs (top of the search form)
420 * @param string $currentKey key in $this->tabs to show as the current tab
422 * @return string html
424 function displayTabs($currentKey) {
425 $GLOBALS['log']->debug('SearchForm.php->displayTabs(): tabs='.print_r($this->tabs,true));
427 $tabPanel = new SugarWidgetTabs($this->tabs, $currentKey, 'SUGAR.searchForm.searchFormSelect');
429 if(isset($_REQUEST['saved_search_select']) && $_REQUEST['saved_search_select']!='_none') {
430 $saved_search=loadBean('SavedSearch');
431 $saved_search->retrieveSavedSearch($_REQUEST['saved_search_select']);
434 $str = $tabPanel->display();
436 if(!empty($_REQUEST['displayColumns']))
437 $str .= 'SUGAR.savedViews.displayColumns = "' . $_REQUEST['displayColumns'] . '";';
438 elseif(isset($saved_search->contents['displayColumns']) && !empty($saved_search->contents['displayColumns']))
439 $str .= 'SUGAR.savedViews.displayColumns = "' . $saved_search->contents['displayColumns'] . '";';
440 if(!empty($_REQUEST['hideTabs']))
441 $str .= 'SUGAR.savedViews.hideTabs = "' . $_REQUEST['hideTabs'] . '";';
442 elseif(isset($saved_search->contents['hideTabs']) && !empty($saved_search->contents['hideTabs']))
443 $str .= 'SUGAR.savedViews.hideTabs = "' . $saved_search->contents['hideTabs'] . '";';
444 if(!empty($_REQUEST['orderBy']))
445 $str .= 'SUGAR.savedViews.selectedOrderBy = "' . $_REQUEST['orderBy'] . '";';
446 elseif(isset($saved_search->contents['orderBy']) && !empty($saved_search->contents['orderBy']))
447 $str .= 'SUGAR.savedViews.selectedOrderBy = "' . $saved_search->contents['orderBy'] . '";';
448 if(!empty($_REQUEST['sortOrder']))
449 $str .= 'SUGAR.savedViews.selectedSortOrder = "' . $_REQUEST['sortOrder'] . '";';
450 elseif(isset($saved_search->contents['sortOrder']) && !empty($saved_search->contents['sortOrder']))
451 $str .= 'SUGAR.savedViews.selectedSortOrder = "' . $saved_search->contents['sortOrder'] . '";';
459 * sets up the search forms, populates the preset values
463 global $mod_strings, $app_strings, $app_list_strings, $theme, $timedate;
464 $GLOBALS['log']->debug('SearchForm.php->setup()');
465 $this->xtpl = new XTemplate($this->tpl);
466 $this->xtpl->assign("MOD", $mod_strings);
467 $this->xtpl->assign("APP", $app_strings);
468 $this->xtpl->assign("THEME", $theme);
469 $this->xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
470 $this->xtpl->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')');
472 foreach($this->searchFields as $name => $params) {
473 if(isset($params['template_var'])) $templateVar = $params['template_var'];
474 else $templateVar = strtoupper($name);
475 if(isset($params['value'])) { // populate w/ preselected values
476 if(isset($params['options'])) {
477 $options = $app_list_strings[$params['options']];
478 if(isset($params['options_add_blank']) && $params['options_add_blank']) array_unshift($options, '');
479 $this->xtpl->assign($templateVar, get_select_options_with_id($options, $params['value']));
482 if(isset($params['input_type'])) {
483 switch($params['input_type']) {
484 case 'checkbox': // checkbox input
485 if($params['value'] == 'on' || $params['value'])
486 $this->xtpl->assign($templateVar, 'checked');
490 else {// regular text input
491 $this->xtpl->assign($templateVar, to_html($params['value']));
495 else { // populate w/o preselected values
496 if(isset($params['options'])) {
497 $options = $app_list_strings[$params['options']];
498 if(isset($params['options_add_blank']) && $params['options_add_blank']) array_unshift($options, '');
499 $this->xtpl->assign($templateVar, get_select_options_with_id($options, ''));
503 if (!empty($_REQUEST['assigned_user_id'])) $this->xtpl->assign("USER_FILTER", get_select_options_with_id(get_user_array(FALSE), $_REQUEST['assigned_user_id']));
504 else $this->xtpl->assign("USER_FILTER", get_select_options_with_id(get_user_array(FALSE), ''));
506 // handle my items only
507 if(isset($this->searchFields['current_user_only']) && isset($this->searchFields['current_user_only']['value']))
508 $this->xtpl->assign("CURRENT_USER_ONLY", "checked");
512 * displays the search form header
514 * @param string $view which view is currently being displayed
517 function displayHeader($view) {
518 global $current_user;
519 $GLOBALS['log']->debug('SearchForm.php->displayHeader()');
521 if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
522 $header_text = "<a href='index.php?action=index&module=DynamicLayout&from_action=SearchForm&from_module=".$_REQUEST['module'] ."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif','Edit Layout')."</a>";
525 echo $header_text . $this->displayTabs($this->module . '|' . $view);
526 echo "<form name='search_form' class='search_form'>" .
527 "<input type='hidden' name='searchFormTab' value='{$view}'/>" .
528 "<input type='hidden' name='module' value='{$_REQUEST['module']}'/>" .
529 "<input type='hidden' name='action' value='{$_REQUEST['action']}'/>" .
530 "<input type='hidden' name='query' value='true'/>";
534 * displays the search form body, for example if basic_search is being displayed, then the function call would be
535 * displayWithHeaders('basic_search', $htmlForBasicSearchBody) {
537 * @param string $view which view is currently being displayed
538 * @param string $basic_search_text body of the basic search tab
539 * @param string $advanced_search_text body of the advanced search tab
540 * @param string $saved_views_text body of the saved views tab
543 function displayWithHeaders($view, $basic_search_text = '', $advanced_search_text = '', $saved_views_text = '') {
544 $GLOBALS['log']->debug('SearchForm.php->displayWithHeaders()');
545 $this->displayHeader($view);
546 echo "<div id='{$this->module}basic_searchSearchForm' " . (($view == 'basic_search') ? '' : "style='display: none'") . ">" . $basic_search_text . "</div>";
547 echo "<div id='{$this->module}advanced_searchSearchForm' " . (($view == 'advanced_search') ? '' : "style='display: none'") . ">" . $advanced_search_text . "</div>";
548 echo "<div id='{$this->module}saved_viewsSearchForm' " . (($view == 'saved_views') ? '' : "style='display: none'") . ">" . $saved_views_text . "</div>";
549 echo $this->getButtons();
551 // 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>';
555 * displays the basic search form body
557 * @param bool $header display this with headers
558 * @param bool $return echo or return the html
560 * @return string html of contents
562 function displayBasic($header = true, $return = false) {
563 global $current_user;
565 $this->bean->custom_fields->populateAllXTPL($this->xtpl, 'search' );
566 $this->xtpl->parse("main");
567 if(!empty($GLOBALS['layout_edit_mode'])){
568 $this->xtpl->parse("advanced");
570 $text = $this->xtpl->text("main");
571 if(!empty($GLOBALS['layout_edit_mode'])){
572 $text .= $this->xtpl->text("advanced");
574 if($header && empty($GLOBALS['layout_edit_mode'])) {
575 $this->displayWithHeaders('basic_search', $text);
578 if($return) return $text;
584 * displays the advanced search form body
586 * @param bool $header display this with headers
587 * @param bool $return echo or return the html
589 * @return string html of contents
591 function displayAdvanced($header = true, $return = false, $listViewDefs='', $lv='') {
592 global $current_user, $current_language;
593 $GLOBALS['log']->debug('SearchForm.php->displayAdvanced()');
594 $this->bean->custom_fields->populateAllXTPL($this->xtpl, 'search' );
595 if(!empty($listViewDefs) && !empty($lv)){
596 $GLOBALS['log']->debug('SearchForm.php->displayAdvanced(): showing saved search');
597 $savedSearch = new SavedSearch($listViewDefs[$this->module], $lv->data['pageData']['ordering']['orderBy'], $lv->data['pageData']['ordering']['sortOrder']);
598 $this->xtpl->assign('SAVED_SEARCH', $savedSearch->getForm($this->module, false));
599 $this->xtpl->assign('MOD_SAVEDSEARCH', return_module_language($current_language, 'SavedSearch'));
600 $this->xtpl->assign('ADVANCED_SEARCH_IMG', SugarThemeRegistry::current()->getImageURL('advanced_search.gif'));
601 //this determines whether the saved search subform should be rendered open or not
602 if(isset($_REQUEST['showSSDIV']) && $_REQUEST['showSSDIV']=='yes'){
603 $this->xtpl->assign('SHOWSSDIV', 'yes');
604 $this->xtpl->assign('DISPLAYSS', '');
606 $this->xtpl->assign('SHOWSSDIV', 'no');
607 $this->xtpl->assign('DISPLAYSS', 'display:none');
610 $this->xtpl->parse("advanced");
611 $text = $this->xtpl->text("advanced");
614 $this->displayWithHeaders('advanced_search', '', $text);
617 if($return) return $text;
623 * displays the saved views form body
625 * @param bool $header display this with headers
626 * @param bool $return echo or return the html
628 * @return string html of contents
630 function displaySavedViews($listViewDefs, $lv, $header = true, $return = false) {
631 global $current_user;
633 $savedSearch = new SavedSearch($listViewDefs[$this->module], $lv->data['pageData']['ordering']['orderBy'], $lv->data['pageData']['ordering']['sortOrder']);
636 $this->displayWithHeaders('saved_views', $this->displayBasic(false, true), $this->displayAdvanced(false, true), $savedSearch->getForm($this->module));
637 echo '<script>SUGAR.savedViews.handleForm();</script>';
640 echo $savedSearch->getForm($this->module, false);
645 * get the search buttons
647 * @return string html of contents
649 function getButtons() {
652 $SAVED_SEARCHES_OPTIONS = '';
653 $savedSearch = new SavedSearch();
654 $SAVED_SEARCHES_OPTIONS = $savedSearch->getSelect($this->module);
655 $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']}' id='search_form_submit'/> ";
656 $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']} ' id='search_form_clear'/>";
658 if(!empty($SAVED_SEARCHES_OPTIONS) && $this->showSavedSearchOptions){
659 $str .= " <span class='white-space'>
660 | <b>{$app_strings['LBL_SAVED_SEARCH_SHORTCUT']}</b>
661 {$SAVED_SEARCHES_OPTIONS}
662 <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>
668 function toggleInlineSearch(){
669 if (document.getElementById('inlineSavedSearch').style.display == 'none'){
670 document.getElementById('showSSDIV').value = 'yes'
671 document.getElementById('inlineSavedSearch').style.display = '';
673 document.getElementById('up_down_img').src='".SugarThemeRegistry::current()->getImageURL('basic_search.gif')."';
674 document.getElementById('up_down_img').setAttribute('alt','".$GLOBALS['app_strings']['LBL_ALT_HIDE_OPTIONS']."');
678 document.getElementById('up_down_img').src='".SugarThemeRegistry::current()->getImageURL('advanced_search.gif')."';
679 document.getElementById('up_down_img').setAttribute('alt','".$GLOBALS['app_strings']['LBL_ALT_SHOW_OPTIONS']."');
680 document.getElementById('showSSDIV').value = 'no';
681 document.getElementById('inlineSavedSearch').style.display = 'none';