Commit 76e1fe179469e20f27cb76cdcad333590de92d1c

Authored by Conrad Vermeulen
1 parent 0734126e

KTS-2827

"Search by created/modified/checkout date returns wrong results"
Fixed. The date manipulation was correct

Committed By: Conrad Vermeulen
Reviewed By: Megan  Watson


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7894 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/search/fields/CheckedOutDeltaField.inc.php
... ... @@ -59,7 +59,7 @@ class CheckedOutDeltaField extends DBFieldExpr
59 59  
60 60 public function modifyValue($value)
61 61 {
62   - return "cast(cast($this->modifiedName as date) + $value as date)";
  62 + return "adddate(cast($this->modifiedName as date), interval '$value' day)";
63 63 }
64 64  
65 65 public function getInputRequirements()
... ...
search2/search/fields/CreatedDeltaField.inc.php
... ... @@ -59,7 +59,7 @@ class CreatedDeltaField extends DBFieldExpr
59 59  
60 60 public function modifyValue($value)
61 61 {
62   - return "cast(cast($this->modifiedName as date) + $value as date)";
  62 + return "adddate(cast($this->modifiedName as date), interval '$value' day)";
63 63 }
64 64  
65 65 public function getInputRequirements()
... ...
search2/search/fields/ModifiedDeltaField.inc.php
... ... @@ -58,7 +58,7 @@ class ModifiedDeltaField extends DBFieldExpr
58 58  
59 59 public function modifyValue($value)
60 60 {
61   - return "cast(cast($this->modifiedName as date) + $value as date)";
  61 + return "adddate(cast($this->modifiedName as date), interval '$value' day)";
62 62 }
63 63  
64 64 public function getInputRequirements()
... ...
templates/ktcore/search2/adv_query_builder.smarty
1   -{$context->oPage->requireCSSResource("thirdpartyjs/extjs/resources/css/ext-all.css")}
2   -
3   -{$context->oPage->requireJSResource("thirdpartyjs/extjs/adapter/ext/ext-base.js")}
4   -{$context->oPage->requireJSResource("thirdpartyjs/extjs/ext-all.js")}
5 1  
6 2  
7 3 {literal}
... ... @@ -320,7 +316,7 @@ function createFilesize(groupid, fid)
320 316 html += "<option>{/literal}{i18n}megabytes{/i18n}{literal}";
321 317 html += "<option>{/literal}{i18n}gigabytes{/i18n}{literal}";
322 318 html += "</SELECT>";
323   - html += "<input style=\"display: none\" value=\"1\" id=\"field" + groupid + "_" + fid + "start\">";
  319 + html += "<input style=\"display: none\" value=\"0\" id=\"field" + groupid + "_" + fid + "start\">";
324 320 html += "<td width=\"100%\">&nbsp;";
325 321  
326 322 html += "</table>";
... ... @@ -332,8 +328,8 @@ function createDateDiff(groupid, fid)
332 328 var html = "<table><tr><td width=\"140\"";
333 329  
334 330 html += "<SELECT style=\"width: 140px\" id=\"field" + groupid + "_" + fid + "op\">";
335   - html += "<option value=\"is\">{/literal}{i18n}is{/i18n}{literal}";
336   - html += "<option value=\"is not\">{/literal}{i18n}is not{/i18n}{literal}";
  331 + html += "<option value=\"<\">{/literal}{i18n}less than{/i18n}{literal}";
  332 + html += "<option value=\">\">{/literal}{i18n}greater than{/i18n}{literal}";
337 333 html += "</SELECT>"
338 334  
339 335  
... ...