Commit 7d3cc1e817bf89cc67457a6be35a52a660747307

Authored by Kevin Fourie
1 parent bd56ebb3

Merged in from STABLE trunk...

KTS-2126
"Cannot compare the current version of a document to the older version"
Fixed. Base version was NEVER being passed! This never could have worked as base would always be NULL!

KTS-2125
"Double negative message "cannot not" in non-editable fields when comparing meta data versions"
Fixed.

Committed By: Kevin
Reviewed By: Conrad

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6845 c91229c3-7414-0410-bfa2-8a42b809f60b
i18n/knowledgeTree.pot
... ... @@ -10551,7 +10551,7 @@ msgid "the user who did the check-out is not currently available to check it bac
10551 10551 msgstr ""
10552 10552  
10553 10553 #: i18n/templates.c:1061 i18n/templates.c:1067 i18n/templates.c:1088
10554   -msgid "this cannot not change between versions"
  10554 +msgid "this cannot change between versions"
10555 10555 msgstr ""
10556 10556  
10557 10557 #: i18n/templates.c:1022
... ...
plugins/ktcore/KTDocumentActions.php
... ... @@ -182,6 +182,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction {
182 182 $QS = array(
183 183 'action' => 'viewComparison',
184 184 'fDocumentId' => $this->oDocument->getId(),
  185 + 'fBaseVersion' => $_REQUEST['fBaseVersion'],
185 186 'fComparisonVersion' => $_REQUEST['fComparisonVersion'],
186 187 );
187 188  
... ...
plugins/ktstandard/KTDiscussion.php
... ... @@ -177,8 +177,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
177 177 $oComment = DiscussionComment::createFromArray(array(
178 178 'threadid' => $oThread->getId(),
179 179 'userid' => $this->oUser->getId(),
180   - 'subject' => sanitize($sSubject),
181   - 'body' => sanitize(KTUtil::formatPlainText($sBody)),
  180 + 'subject' => sanitizeForSQL($sSubject),
  181 + 'body' => sanitizeForSQL(KTUtil::formatPlainText($sBody)),
182 182 ));
183 183 $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread");
184 184 $this->oValidator->notError($oComment, $aErrorOptions);
... ... @@ -306,8 +306,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
306 306 $oComment = DiscussionComment::createFromArray(array(
307 307 'threadid' => $oThread->getId(),
308 308 'userid' => $this->oUser->getId(),
309   - 'subject' => sanitize($sSubject),
310   - 'body' => sanitize(KTUtil::formatPlainText($sBody)),
  309 + 'subject' => sanitizeForSQL($sSubject),
  310 + 'body' => sanitizeForSQL(KTUtil::formatPlainText($sBody)),
311 311 ));
312 312 $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread");
313 313 $this->oValidator->notError($oComment, $aErrorOptions);
... ... @@ -387,7 +387,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
387 387 }
388 388  
389 389 $aErrorOptions['message'] = _kt("No reason provided");
390   - $sReason = sanitize($this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'reason'), $aErrorOptions));
  390 + $sReason = sanitizeForSQL($this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'reason'), $aErrorOptions));
391 391  
392 392 if($iStateId > $oThread->getState()) {
393 393 $sTransactionNamespace = 'ktcore.transactions.collaboration_step_approve';
... ...
search/simpleSearch.php
... ... @@ -142,7 +142,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
142 142 $aErrorOptions = array(
143 143 "message" => _kt("Please provide a search term"),
144 144 );
145   - $searchable_text = sanitize(KTUtil::arrayGet($_REQUEST, "fSearchableText"));
  145 + $searchable_text = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, "fSearchableText"));
146 146 $this->oValidator->notEmpty($searchable_text, $aErrorOptions);
147 147  
148 148  
... ...
templates/kt3/fieldsets/generic_versioned.smarty
... ... @@ -41,12 +41,12 @@
41 41  
42 42 <tr class="odd">
43 43 <th>{i18n}Created by{/i18n}</th>
44   - <td colspan="2">{$creator} ({$creation_date}) <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</td>
  44 + <td colspan="2">{$creator} ({$creation_date}) <span class="descriptiveText">({i18n}this cannot change between versions{/i18n})</td>
45 45 </tr>
46 46  
47 47 <tr class="even">
48 48 <th>{i18n}Owned by{/i18n}</th>
49   - <td colspan="2">{$owner} <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</td>
  49 + <td colspan="2">{$owner} <span class="descriptiveText">({i18n}this cannot change between versions{/i18n})</td>
50 50 </tr>
51 51  
52 52 {capture assign="oldval"}{$comparison_last_modified_by} ({$comparison_last_modified_date}){/capture}
... ... @@ -83,7 +83,7 @@
83 83  
84 84 <tr class="even">
85 85 <th>{i18n}Document ID{/i18n}</th>
86   - <td colspan="2">{$document->getId()} <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</span></td>
  86 + <td colspan="2">{$document->getId()} <span class="descriptiveText">({i18n}this cannot change between versions{/i18n})</span></td>
87 87 </tr>
88 88  
89 89 </table>
... ...
view.php
... ... @@ -95,12 +95,12 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
95 95 function do_main() {
96 96 // fix legacy, broken items.
97 97 if (KTUtil::arrayGet($_REQUEST, "fDocumentID", true) !== true) {
98   - $_REQUEST["fDocumentId"] = sanitize(KTUtil::arrayGet($_REQUEST, "fDocumentID"));
  98 + $_REQUEST["fDocumentId"] = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, "fDocumentID"));
99 99 unset($_REQUEST["fDocumentID"]);
100 100 }
101 101  
102 102 $document_data = array();
103   - $document_id = sanitize(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
  103 + $document_id = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
104 104 if ($document_id === null) {
105 105 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl()));
106 106 return $this->do_error();
... ... @@ -252,7 +252,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
252 252 function do_viewComparison() {
253 253  
254 254 $document_data = array();
255   - $document_id = sanitize(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
  255 + $document_id = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
256 256 if ($document_id === null) {
257 257 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl()));
258 258 return $this->do_error();
... ... @@ -260,7 +260,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
260 260  
261 261 $document_data["document_id"] = $document_id;
262 262  
263   - $base_version = sanitize(KTUtil::arrayGet($_REQUEST, 'fBaseVersion'));
  263 + $base_version = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fBaseVersion'));
264 264  
265 265 // try get the document.
266 266 $oDocument =& Document::get($document_id, $base_version);
... ... @@ -285,7 +285,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
285 285 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
286 286 $this->oPage->setBreadcrumbDetails(_kt("compare versions"));
287 287  
288   - $comparison_version = sanitize(KTUtil::arrayGet($_REQUEST, 'fComparisonVersion'));
  288 + $comparison_version = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fComparisonVersion'));
289 289 if ($comparison_version=== null) {
290 290 $this->oPage->addError(sprintf(_kt("No comparison version was requested. Please <a href=\"%s\">select a version</a>."), KTUtil::addQueryStringSelf('action=history&fDocumentId=' . $document_id)));
291 291 return $this->do_error();
... ...