Commit 2253aacbe1b100a4e6c3cb641279422e3bb9b662

Authored by kevin_fourie
1 parent e28c2d79

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,7 +10551,7 @@ msgid "the user who did the check-out is not currently available to check it bac
10551 msgstr "" 10551 msgstr ""
10552 10552
10553 #: i18n/templates.c:1061 i18n/templates.c:1067 i18n/templates.c:1088 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 msgstr "" 10555 msgstr ""
10556 10556
10557 #: i18n/templates.c:1022 10557 #: i18n/templates.c:1022
plugins/ktcore/KTDocumentActions.php
@@ -182,6 +182,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { @@ -182,6 +182,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction {
182 $QS = array( 182 $QS = array(
183 'action' => 'viewComparison', 183 'action' => 'viewComparison',
184 'fDocumentId' => $this->oDocument->getId(), 184 'fDocumentId' => $this->oDocument->getId(),
  185 + 'fBaseVersion' => $_REQUEST['fBaseVersion'],
185 'fComparisonVersion' => $_REQUEST['fComparisonVersion'], 186 'fComparisonVersion' => $_REQUEST['fComparisonVersion'],
186 ); 187 );
187 188
plugins/ktstandard/KTDiscussion.php
@@ -177,8 +177,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -177,8 +177,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
177 $oComment = DiscussionComment::createFromArray(array( 177 $oComment = DiscussionComment::createFromArray(array(
178 'threadid' => $oThread->getId(), 178 'threadid' => $oThread->getId(),
179 'userid' => $this->oUser->getId(), 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 $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); 183 $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread");
184 $this->oValidator->notError($oComment, $aErrorOptions); 184 $this->oValidator->notError($oComment, $aErrorOptions);
@@ -306,8 +306,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -306,8 +306,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
306 $oComment = DiscussionComment::createFromArray(array( 306 $oComment = DiscussionComment::createFromArray(array(
307 'threadid' => $oThread->getId(), 307 'threadid' => $oThread->getId(),
308 'userid' => $this->oUser->getId(), 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 $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); 312 $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread");
313 $this->oValidator->notError($oComment, $aErrorOptions); 313 $this->oValidator->notError($oComment, $aErrorOptions);
@@ -387,7 +387,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -387,7 +387,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
387 } 387 }
388 388
389 $aErrorOptions['message'] = _kt("No reason provided"); 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 if($iStateId > $oThread->getState()) { 392 if($iStateId > $oThread->getState()) {
393 $sTransactionNamespace = 'ktcore.transactions.collaboration_step_approve'; 393 $sTransactionNamespace = 'ktcore.transactions.collaboration_step_approve';
search/simpleSearch.php
@@ -142,7 +142,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { @@ -142,7 +142,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
142 $aErrorOptions = array( 142 $aErrorOptions = array(
143 "message" => _kt("Please provide a search term"), 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 $this->oValidator->notEmpty($searchable_text, $aErrorOptions); 146 $this->oValidator->notEmpty($searchable_text, $aErrorOptions);
147 147
148 148
templates/kt3/fieldsets/generic_versioned.smarty
@@ -41,12 +41,12 @@ @@ -41,12 +41,12 @@
41 41
42 <tr class="odd"> 42 <tr class="odd">
43 <th>{i18n}Created by{/i18n}</th> 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 </tr> 45 </tr>
46 46
47 <tr class="even"> 47 <tr class="even">
48 <th>{i18n}Owned by{/i18n}</th> 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 </tr> 50 </tr>
51 51
52 {capture assign="oldval"}{$comparison_last_modified_by} ({$comparison_last_modified_date}){/capture} 52 {capture assign="oldval"}{$comparison_last_modified_by} ({$comparison_last_modified_date}){/capture}
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 83
84 <tr class="even"> 84 <tr class="even">
85 <th>{i18n}Document ID{/i18n}</th> 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 </tr> 87 </tr>
88 88
89 </table> 89 </table>
view.php
@@ -95,12 +95,12 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -95,12 +95,12 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
95 function do_main() { 95 function do_main() {
96 // fix legacy, broken items. 96 // fix legacy, broken items.
97 if (KTUtil::arrayGet($_REQUEST, "fDocumentID", true) !== true) { 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 unset($_REQUEST["fDocumentID"]); 99 unset($_REQUEST["fDocumentID"]);
100 } 100 }
101 101
102 $document_data = array(); 102 $document_data = array();
103 - $document_id = sanitize(KTUtil::arrayGet($_REQUEST, 'fDocumentId')); 103 + $document_id = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
104 if ($document_id === null) { 104 if ($document_id === null) {
105 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl())); 105 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl()));
106 return $this->do_error(); 106 return $this->do_error();
@@ -252,7 +252,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -252,7 +252,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
252 function do_viewComparison() { 252 function do_viewComparison() {
253 253
254 $document_data = array(); 254 $document_data = array();
255 - $document_id = sanitize(KTUtil::arrayGet($_REQUEST, 'fDocumentId')); 255 + $document_id = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
256 if ($document_id === null) { 256 if ($document_id === null) {
257 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl())); 257 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl()));
258 return $this->do_error(); 258 return $this->do_error();
@@ -260,7 +260,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -260,7 +260,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
260 260
261 $document_data["document_id"] = $document_id; 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 // try get the document. 265 // try get the document.
266 $oDocument =& Document::get($document_id, $base_version); 266 $oDocument =& Document::get($document_id, $base_version);
@@ -285,7 +285,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -285,7 +285,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
285 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); 285 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
286 $this->oPage->setBreadcrumbDetails(_kt("compare versions")); 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 if ($comparison_version=== null) { 289 if ($comparison_version=== null) {
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))); 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 return $this->do_error(); 291 return $this->do_error();