Commit f6fc2fee032dc37ba2df24d29af51da2cd758dcc

Authored by conradverm
1 parent ac0d7619

KTS-673

"The search algorithm needs some work"
Updated. Internationalised advanced query builder.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7250 c91229c3-7414-0410-bfa2-8a42b809f60b
templates/ktcore/search2/adv_query_builder.smarty
... ... @@ -78,8 +78,8 @@ function createUserList(groupid, fid)
78 78 var html = "<table><tr><td width=\"140\">";
79 79  
80 80 html += "<SELECT style=\"width: 140px \" id=\"field" + groupid + "_" + fid + "op\">";
81   - html += "<option value=\"is\">is";
82   - html += "<option value=\"is not\">is not";
  81 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  82 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
83 83 html += "</SELECT>"
84 84  
85 85 html += "<td>"
... ... @@ -101,8 +101,8 @@ function createDocTypes(groupid, fid)
101 101 var html = "<table><tr><td width=\"140\">";
102 102  
103 103 html += "<SELECT style=\"width: 140px \" id=\"field" + groupid + "_" + fid + "op\">";
104   - html += "<option value=\"is\">is";
105   - html += "<option value=\"is not\">is not";
  104 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  105 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
106 106 html += "</SELECT>"
107 107  
108 108 html += "<td>"
... ... @@ -124,8 +124,8 @@ function createMimeTypes(groupid, fid)
124 124 var html = "<table><tr><td width=\"140\">";
125 125  
126 126 html += "<SELECT style=\"width: 140px \" id=\"field" + groupid + "_" + fid + "op\">";
127   - html += "<option value=\"is\">is";
128   - html += "<option value=\"is not\">is not";
  127 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  128 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
129 129 html += "</SELECT>"
130 130  
131 131 html += "<td>"
... ... @@ -181,11 +181,11 @@ function createRange(groupid, fid, type)
181 181 switch(type)
182 182 {
183 183 case 'DATE':
184   - html += "<option value=\"\>=\">after";
185   - html += "<option value=\"between\">between";
186   - html += "<option value=\"<=\">before";
187   - html += "<option value=\"is\">on";
188   - html += "<option value=\"is not\">not on";
  184 + html += "<option value=\"\>=\">{/literal}{i81n}after{/i81n}{literal}";
  185 + html += "<option value=\"between\">{/literal}{i81n}between{/i81n}{literal}";
  186 + html += "<option value=\"<=\">{/literal}{i81n}before{/i81n}{literal}";
  187 + html += "<option value=\"is\">{/literal}{i81n}on{/i81n}{literal}";
  188 + html += "<option value=\"is not\">{/literal}{i81n}not on{/i81n}{literal}";
189 189 break;
190 190 default:
191 191 html += "<option value=\"is\">=";
... ... @@ -194,7 +194,7 @@ function createRange(groupid, fid, type)
194 194 html += "<option value=\"\>=\">\>=";
195 195 html += "<option value=\"\<\">\<";
196 196 html += "<option value=\"\<=\">\<=";
197   - html += "<option value=\"between\">between";
  197 + html += "<option value=\"between\">{/literal}{i81n}between{/i81n}{literal}";
198 198 break;
199 199 }
200 200 html += "</SELECT>";
... ... @@ -316,10 +316,10 @@ function createFilesize(groupid, fid)
316 316 html += "<td valign=top width=\"50px\"><div id=\"field"+ groupid + '_' + fid +"input\"></div>";
317 317 html += "<td>";
318 318 html += "<SELECT id=\"field" + groupid + "_" + fid + "factor\" onchange=\"onFilesizeChange( " + groupid + "," + fid + ")\">";
319   - html += "<option>bytes";
320   - html += "<option>kilobytes";
321   - html += "<option>megabytes";
322   - html += "<option>gigabytes";
  319 + html += "<option>{/literal}{i81n}bytes{/i81n}{literal}";
  320 + html += "<option>{/literal}{i81n}kilobytes{/i81n}{literal}";
  321 + html += "<option>{/literal}{i81n}megabytes{/i81n}{literal}";
  322 + html += "<option>{/literal}{i81n}gigabytes{/i81n}{literal}";
323 323 html += "</SELECT>";
324 324 html += "<input style=\"display: none\" value=\"1\" id=\"field" + groupid + "_" + fid + "start\">";
325 325 html += "<td width=\"100%\">&nbsp;";
... ... @@ -333,17 +333,17 @@ function createDateDiff(groupid, fid)
333 333 var html = "<table><tr><td width=\"140\"";
334 334  
335 335 html += "<SELECT style=\"width: 140px\" id=\"field" + groupid + "_" + fid + "op\">";
336   - html += "<option value=\"is\">is";
337   - html += "<option value=\"is not\">is not";
  336 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  337 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
338 338 html += "</SELECT>"
339 339  
340 340  
341 341 html += "<td valign=top width=\"50px\"><div id=\"field"+ groupid + '_' + fid +"input\"></div>";
342 342 html += "<td>";
343 343 html += "<SELECT id=\"field" + groupid + "_" + fid + "period\" onchange=\"onDateDiffChange( " + groupid + "," + fid + ")\">";
344   - html += "<option>days";
345   - html += "<option>months";
346   - html += "<option>years";
  344 + html += "<option>{/literal}{i81n}days{/i81n}{literal}";
  345 + html += "<option>{/literal}{i81n}months{/i81n}{literal}";
  346 + html += "<option>{/literal}{i81n}years{/i81n}{literal}";
347 347 html += "</SELECT>";
348 348 html += "<td>ago"
349 349 html += "<input style=\"display: none\" value=\"1\" id=\"field" + groupid + "_" + fid + "start\">";
... ... @@ -358,8 +358,8 @@ function createSelect(groupid, fid, options)
358 358 var html = "<table><tr><td width=\"140\">";
359 359  
360 360 html += "<select id=\"field"+ groupid + "_" + fid +"op\" style=\"width: 140px\">";
361   - html += "<option value=\"is\">is";
362   - html += "<option value=\"is not\">is not";
  361 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  362 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
363 363 html += "</select>&nbsp;&nbsp;";
364 364  
365 365 html += "<td valign=top>";
... ... @@ -384,22 +384,22 @@ function createText(groupid, fid, type)
384 384 {
385 385 case 'STRINGMATCH':
386 386 readonly = 'readonly';
387   - html += "<option value=\"is\">is";
388   - html += "<option value=\"is not\">is not";
  387 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  388 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
389 389 break;
390 390 case 'STRING':
391   - html += "<option value=\"is\">is";
392   - html += "<option value=\"is not\">is not";
393   - html += "<option value=\"contains\">contains";
394   - html += "<option value=\"does not contain\">does not contain";
395   - html += "<option value=\"is like\">like";
396   - html += "<option value=\"is not like\">not like";
397   - html += "<option value=\"starts with\">starts with";
398   - html += "<option value=\"ends with\">ends with";
  391 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  392 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
  393 + html += "<option value=\"contains\">{/literal}{i81n}contains{/i81n}{literal}";
  394 + html += "<option value=\"does not contain\">{/literal}{i81n}does not contain{/i81n}{literal}";
  395 + html += "<option value=\"is like\">{/literal}{i81n}like{/i81n}{literal}";
  396 + html += "<option value=\"is not like\">{/literal}{i81n}not like{/i81n}{literal}";
  397 + html += "<option value=\"starts with\">{/literal}{i81n}starts with{/i81n}{literal}";
  398 + html += "<option value=\"ends with\">{/literal}{i81n}ends with{/i81n}{literal}";
399 399 break;
400 400 case 'FULLTEXT':
401   - html += "<option value=\"contains\">contains";
402   - html += "<option value=\"does not contain\">does not contain";
  401 + html += "<option value=\"contains\">{/literal}{i81n}contains{/i81n}{literal}";
  402 + html += "<option value=\"does not contain\">{/literal}{i81n}does not contain{/i81n}{literal}";
403 403 break;
404 404 }
405 405  
... ... @@ -416,12 +416,12 @@ function createText(groupid, fid, type)
416 416 function createBool(groupid, fid)
417 417 {
418 418 var html = "<select style=\"width: 140px\" id=\"field"+ groupid + "_" + fid +"op\"\>";
419   - html += "<option value=\"is\">is";
420   - html += "<option value=\"is not\">is not";
  419 + html += "<option value=\"is\">{/literal}{i81n}is{/i81n}{literal}";
  420 + html += "<option value=\"is not\">{/literal}{i81n}is not{/i81n}{literal}";
421 421 html += "</select>&nbsp;&nbsp;";
422 422 html += "<select id=\"field"+ groupid + "_" + fid +"start\"\>";
423   - html += "<option value=\"true\">True";
424   - html += "<option value=\"false\">False";
  423 + html += "<option value=\"true\">{/literal}{i81n}True{/i81n}{literal}";
  424 + html += "<option value=\"false\">{/literal}{i81n}False{/i81n}{literal}";
425 425 html += "</select>&nbsp;&nbsp;";
426 426  
427 427 return html;
... ... @@ -747,7 +747,7 @@ function butSearchClick()
747 747 var expr = buildExpression();
748 748 if (expr == '')
749 749 {
750   - alert('Please select some search criteria');
  750 + alert('{/literal}{i81n}Please select some search criteria{/i81n}{literal}');
751 751 return;
752 752 }
753 753  
... ... @@ -766,20 +766,20 @@ function butSearchClick()
766 766 <legend>{i18n}Metadata Query{/i18n}</legend>
767 767  
768 768  
769   - Return items which match <select id="allop">
770   - <option value="AND">all
771   - <option value="OR" SELECTED>any
772   - </select> of the criteria groups specified.
  769 + {i18n}Return items which match{/i18n} <select id="allop">
  770 + <option value="AND">{i18n}all{/i18n}
  771 + <option value="OR" SELECTED>{i18n}any{/i18n}
  772 + </select> {i18n}of the criteria groups specified.{/i18n}
773 773  
774 774 <div id="groupwrapping">
775 775 <div id="groupwrapper0">
776 776 <fieldset>
777 777 <legend>{i18n}Criteria Group{/i18n}</legend>
778 778  
779   - Return items which match <select id="groupop0">
780   - <option value="AND">all
781   - <option value="OR" SELECTED>any
782   - </select> of the criteria specified below.
  779 + {i18n}Return items which match{/i18n} <select id="groupop0">
  780 + <option value="AND">{i18n}all{/i18n}
  781 + <option value="OR" SELECTED>{i18n}any{/i18n}
  782 + </select> {i18n}of the criteria specified below.{/i18n}
783 783 <br>
784 784  
785 785 <div id="criteria0">
... ... @@ -789,9 +789,9 @@ function butSearchClick()
789 789 <tr>
790 790 <td width="50%" valign="top">
791 791 <br>
792   - <div id="criteria_nofields0" style="color: brown">No fields have been selected for the criteria group.
  792 + <div id="criteria_nofields0" style="color: brown">{i81n}No fields have been selected for the criteria group.{i81n}
793 793 <p>
794   - <input type=button value="Remove Criteria Group" onclick="removeCriteriaGroup(0)" id="removeCriteriaGroup0" style="display: none">
  794 + <input type=button value="{i81n}Remove Criteria Group{/i81n}" onclick="removeCriteriaGroup(0)" id="removeCriteriaGroup0" style="display: none">
795 795 </div>
796 796 <div id="criteria_fields0">
797 797  
... ... @@ -802,26 +802,26 @@ function butSearchClick()
802 802 <tr>
803 803 <td valign=top>
804 804 <select id="selector0" style="width: 200px" onchange="selectorChange(0)">
805   - <option value="0">Available Fields
806   - <option value="1">Available Fieldsets
807   - <option value="2">Available Workflows
  805 + <option value="0">{i81n}Available Fields{/i81n}
  806 + <option value="1">{i81n}Available Fieldsets{/i81n}
  807 + <option value="2">{i81n}Available Workflows{/i81n}
808 808 </select>
809 809 <br>
810 810 <div>
811 811 <select id="fields0" size="5" style="width: 200px; height: 100px; display: block" onclick="fieldChange(0)">
812   - <option value="" selected>--- Select a field ---
  812 + <option value="" selected>--- {i81n}Select a field{/i81n} ---
813 813 {foreach from=$metainfo.fields item=field}
814 814 <option>{$field.display}
815 815 {/foreach}
816 816 </select>
817 817 <select id="fieldsets0" size="5" style="width: 200px; height: 100px; display: none" onclick="fieldsetsChange(0)">
818   - <option value="" selected>--- Select a fieldset ---
  818 + <option value="" selected>--- {i81n}Select a fieldset{/i81n} ---
819 819 {foreach from=$metainfo.fieldsets item=fieldset}
820 820 <option>{$fieldset.name}
821 821 {/foreach}
822 822 </select>
823 823 <select id="workflows0" size="5" style="width: 200px; height: 100px; display: none" onclick="workflowsChange(0)" >
824   - <option value="" selected>--- Select a workflow ---
  824 + <option value="" selected>--- {i81n}Select a workflow{/i81n} ---
825 825 {foreach from=$metainfo.workflows item=workflow}
826 826 <option>{$workflow.name}
827 827 {/foreach}
... ... @@ -844,7 +844,7 @@ function butSearchClick()
844 844 </td>
845 845 <tr>
846 846 <td colspan=5>
847   - Click on a field above to add it to the criteria group.
  847 + {i81n}Click on a field above to add it to the criteria group.{/i81n}
848 848 </td>
849 849 </tr>
850 850 </table>
... ... @@ -857,8 +857,8 @@ function butSearchClick()
857 857 </div>
858 858 </div>
859 859 <div id="">
860   -<input type=button value="Add another set of criteria" onclick="addCriteriaSet()">
861   -<input type=button value="Search" onclick="butSearchClick()">
  860 +<input type=button value="{/literal}{i81n}Add another set of criteria{/i81n}{literal}" onclick="addCriteriaSet()">
  861 +<input type=button value="{/literal}{i81n}Search{/i81n}{literal}" onclick="butSearchClick()">
862 862 </div>
863 863  
864 864  
... ...