Commit 094bb63a3096fe7ad06ad12e1626abef8d68cf78

Authored by nbm
1 parent ebe38966

Use KTUtil::addQueryStringSelf to generate URLs.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4765 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktstandard/KTDocumentLinks.php
... ... @@ -13,27 +13,17 @@ require_once(KT_LIB_DIR . "/browse/browseutil.inc.php");
13 13 class KTDocumentLinkTitle extends TitleColumn {
14 14  
15 15 function buildDocumentLink($aDataRow) {
16   - $baseurl = KTUtil::arrayGet($this->aOptions, "folderurl", "");
17 16 $parentDocumentId = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
18   - return sprintf('%s?action=type_select&fDocumentId=%d&fTargetDocumentId=%d', $baseurl, $parentDocumentId, $aDataRow["document"]->getId());
  17 + return KTUtil::addQueryStringSelf(sprintf('action=type_select&fDocumentId=%d&fTargetDocumentId=%d', $baseurl, $parentDocumentId, $aDataRow["document"]->getId()));
19 18 }
20 19  
21 20 function buildFolderLink($aDataRow) {
22   - $baseurl = KTUtil::arrayGet($this->aOptions, "folderurl", "");
23   - $kt_path_info = KTUtil::arrayGet($_REQUEST, 'kt_path_info');
24 21 $parentDocumentId = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
25 22  
26   - if (empty($kt_path_info)) {
27   - return sprintf('%s?action=new&fDocumentId=%d&fFolderId=%d', $baseurl, $parentDocumentId, $aDataRow["folder"]->getId());
28   - } else {
29   - return sprintf('%s?kt_path_info=%s&action=new&ftDocumentId=%d&fFolderId=%d', $baseurl, $kt_path_info, $parentDocumentId, $aDataRow["folder"]->getId());
30   - }
  23 + return KTUtil::addQueryStringSelf(sprintf('action=new&fDocumentId=%d&fFolderId=%d', $baseurl, $parentDocumentId, $aDataRow["folder"]->getId()));
31 24 }
32 25 }
33 26  
34   -
35   -
36   -
37 27 class KTDocumentLinks extends KTPlugin {
38 28 var $sNamespace = "ktstandard.documentlinks.plugin";
39 29  
... ... @@ -112,7 +102,7 @@ class KTDocumentLinkAction extends KTDocumentAction {
112 102 $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0);
113 103 $batchSize = 20;
114 104  
115   - $resultURL = sprintf("?action=new&fDocumentId=%d", $oParentDocument->getId());
  105 + $resultURL = KTUtil::addQueryStringSelf(sprintf("action=new&fDocumentId=%d", $oParentDocument->getId()));
116 106 $collection->setBatching($resultURL, $batchPage, $batchSize);
117 107  
118 108 // ordering. (direction and column)
... ... @@ -135,7 +125,7 @@ class KTDocumentLinkAction extends KTDocumentAction {
135 125  
136 126 foreach (range(0, count($folder_path_ids) - 1) as $index) {
137 127 $id = $folder_path_ids[$index];
138   - $url = sprintf("?action=new&fDocumentId=%d&fFolderId=%d", $oParentDocument->getId(), $id);
  128 + $url = KTUtil::addQueryStringSelf(sprintf("action=new&fDocumentId=%d&fFolderId=%d", $oParentDocument->getId(), $id));
139 129 $aBreadcrumbs[] = array("url" => $url, "name" => $folder_path_names[$index]);
140 130 }
141 131  
... ... @@ -301,4 +291,4 @@ $oRegistry->registerPlugin('KTDocumentLinks', 'ktstandard.documentlinks.plugin',
301 291  
302 292  
303 293  
304   -?>
305 294 \ No newline at end of file
  295 +?>
... ...
search/booleanSearch.php
... ... @@ -100,7 +100,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
100 100  
101 101 $sSearch = md5(serialize($aCriteriaSet));
102 102 $_SESSION['boolean_search'][$sSearch] = $aCriteriaSet;
103   - $resultURL = "?action=performSearch&boolean_search_id=" . urlencode($sSearch);
  103 + $resultURL = KTUtil::addQueryStringSelf("action=performSearch&boolean_search_id=" . urlencode($sSearch));
104 104 $collection->setBatching($resultURL, $batchPage, $batchSize);
105 105  
106 106  
... ...
search/simpleSearch.php
... ... @@ -72,7 +72,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
72 72 $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0);
73 73 $batchSize = 20;
74 74  
75   - $resultURL = "?fSearchableText=" . $searchable_text;
  75 + $resultURL = KTUtil::addQueryStringSelf("fSearchableText=" . $searchable_text);
76 76 $collection->setBatching($resultURL, $batchPage, $batchSize);
77 77  
78 78  
... ...
view.php
... ... @@ -287,7 +287,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
287 287  
288 288 $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion');
289 289 if ($comparison_version=== null) {
290   - $this->oPage->addError('No comparison version was requested. Please <a href="?action=history&fDocumentId='.$document_id.'">select a version</a>.');
  290 + $this->oPage->addError('No comparison version was requested. Please <a href="' . KTUtil::addQueryStringSelf('action=history&fDocumentId=' . $document_id) . '">select a version</a>.');
291 291 return $this->do_error();
292 292 }
293 293  
... ... @@ -398,7 +398,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
398 398  
399 399 $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion');
400 400 if ($comparison_version=== null) {
401   - $this->oPage->addError('No comparison version was requested. Please <a href="?action=history&fDocumentId='.$document_id.'">select a version</a>.');
  401 + $this->oPage->addError('No comparison version was requested. Please <a href="' . KTUtil::addQueryStringSelf('action=history&fDocumentId='.$document_id) . '">select a version</a>.');
402 402 return $this->do_error();
403 403 }
404 404  
... ...