Commit 0392b66e628eb526aaaa6a9cf930e9dca49fc1a9

Authored by Conrad Vermeulen
1 parent d3b8ec1f

KTS-673

"The search algorithm needs some work"
Updated. Updates based on initial review meeting. Also added conversion of double quotes to single quotes.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7248 c91229c3-7414-0410-bfa2-8a42b809f60b
templates/kt3/standard_page.smarty
... ... @@ -91,22 +91,24 @@
91 91 {/foreach}
92 92  
93 93 {literal}
94   - <script>
  94 + <script language="javascript">
95 95  
96 96 function search()
97 97 {
98 98 var sc = document.getElementById('searchCriteria');
99 99 var val = sc.value;
100 100  
101   - if (val == "Enter search criteria")
  101 + if (val == "{/literal}{i18n}Enter search criteria{/i18n}{literal}")
102 102 {
103   - alert('Please enter some search criteria');
  103 + alert('{/literal}{i18n}Please enter some search criteria{/i18n}{literal}');
104 104 return;
105 105 }
106 106 var sq = document.getElementById('txtQuery');
107 107  
108 108 var so = document.getElementById('searchOptions');
109 109  
  110 + val = val.replace(/\"/g, "'");
  111 +
110 112 if (so.value == 's')
111 113 {
112 114 sq.value = '(GeneralText contains "' + val + '")';
... ... @@ -116,9 +118,10 @@
116 118 sq.value = '(Metadata contains "' + val + '")';
117 119 }
118 120  
119   - var frm = document.getElementById('frmQuickSearch');
  121 + alert(sq.value);
  122 + return;
  123 + var frm = document.getElementById('frmQuickSearch');
120 124 frm.submit();
121   -
122 125 }
123 126 function processSearchEnter(event)
124 127 {
... ... @@ -135,7 +138,7 @@
135 138 if (characterCode.toString() == '13')
136 139 search();
137 140  
138   - if (sc.value == "Enter search criteria")
  141 + if (sc.value == "{/literal}{i18n}Enter search criteria{/i18n}{literal}")
139 142 {
140 143 sc.value = '';
141 144 }
... ... @@ -145,7 +148,7 @@
145 148 function searchGotFocus()
146 149 {
147 150 var sc = document.getElementById('searchCriteria');
148   - if (sc.value == "Enter search criteria")
  151 + if (sc.value == "{/literal}{i18n}Enter search criteria{/i18n}{literal}")
149 152 {
150 153 sc.value = "";
151 154 }
... ... @@ -155,7 +158,7 @@
155 158 var sc = document.getElementById('searchCriteria');
156 159 if (sc.value == "")
157 160 {
158   - sc.value = "Enter search criteria";
  161 + sc.value = "{/literal}{i18n}Enter search criteria{/i18n}{literal}";
159 162 }
160 163 }
161 164  
... ... @@ -194,18 +197,6 @@
194 197 case 'A':
195 198 document.location="search2.php?action=guiBuilder";
196 199 break;
197   - case 'Q':
198   - document.location="search2.php?action=queryBuilder";
199   - break;
200   - case 'M':
201   - document.location="search2.php?action=metadata";
202   - break;
203   - case 'S':
204   - document.location="search2.php?action=manage";
205   - break;
206   - case 'T':
207   - document.location="search2.php?action=tree";
208   - break;
209 200 default:
210 201 document.location="search2.php?action=processSaved&fSavedSearchId=" + so.value + "";
211 202 break;
... ... @@ -216,20 +207,14 @@
216 207 <!-- user menu -->
217 208 <li class="pref">
218 209 <div style="position: absolute;">
219   - <input id=searchCriteria value="Enter search criteria" style="width:160px; font-size:12px; position:relative; left: -260px; z-index: 11"
220   - onblur="searchLostFocus()" onkeypress="return processSearchEnter(event)" >
221   - <input type=button value=search style="width:60px; font-size:12px; position:relative; left: -240px;" onclick="search()">
222   - <select id=searchOptions style="width:180px; font-size:12px; position:absolute; left: -260px; z-index: 10" onchange="searchOptionSelect()">
  210 + <input id=searchCriteria value="Enter search criteria" style="width:129px; font-size:12px; position:relative; top: -2px; left: -180px; z-index: 11"
  211 + onfocus="searchGotFocus()" onblur="searchLostFocus()" onkeypress="return processSearchEnter(event)" >
  212 + <img onclick="search()" src="resources/tango-icons/system-search.png" border="0" style="position: relative; left: -183px; top: 3px; z-index: 11" />
  213 + <select id=searchOptions style="width:170px; font-size:12px; position:absolute; left: -180px; z-index: 10" onchange="searchOptionSelect()">
223 214 <option value="s">--- quick search ---
224   - <option value="s" selected>* general
  215 + <option value="s" selected>* content and metadata
225 216 <option value="m">metadata
226   - <option value="s">--- query builders ---
227   - <option value="A">Query Builder</option>
228   - <option value="M">Metadata Query Builder</option>
229   - <option value="Q">Advanced Query Builder</option>
230   - <option value="s">--- miscellaneous ---
231   - <option value="T">Tree Browser</option>
232   - <option value="S">Manage Saved Searches
  217 + <option value="A">Advanced Search
233 218 {if count($savedSearches) > 0}
234 219 <option value="s">--- saved searches ---
235 220 {foreach item=searchitem from=$savedSearches}
... ...