Commit c45f9facd9e8517d0113fd595c9e28771697c2be
1 parent
8268245c
KTS-1687
"Double quote to single quote conversion" Fixed. Reviewed by: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6258 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
142 additions
and
142 deletions
plugins/ktcore/KTDocumentActions.php
| ... | ... | @@ -30,11 +30,11 @@ require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); |
| 30 | 30 | require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php'); |
| 31 | 31 | require_once(KT_LIB_DIR . '/documentmanagement/PhysicalDocumentManager.inc'); |
| 32 | 32 | |
| 33 | -require_once(KT_LIB_DIR . "/browse/DocumentCollection.inc.php"); | |
| 34 | -require_once(KT_LIB_DIR . "/browse/BrowseColumns.inc.php"); | |
| 35 | -require_once(KT_LIB_DIR . "/browse/PartialQuery.inc.php"); | |
| 33 | +require_once(KT_LIB_DIR . '/browse/DocumentCollection.inc.php'); | |
| 34 | +require_once(KT_LIB_DIR . '/browse/BrowseColumns.inc.php'); | |
| 35 | +require_once(KT_LIB_DIR . '/browse/PartialQuery.inc.php'); | |
| 36 | 36 | |
| 37 | -require_once(KT_LIB_DIR . "/widgets/forms.inc.php"); | |
| 37 | +require_once(KT_LIB_DIR . '/widgets/forms.inc.php'); | |
| 38 | 38 | |
| 39 | 39 | // {{{ KTDocumentDetailsAction |
| 40 | 40 | class KTDocumentDetailsAction extends KTDocumentAction { |
| ... | ... | @@ -63,15 +63,15 @@ class KTDocumentTransactionHistoryAction extends KTDocumentAction { |
| 63 | 63 | function do_main() { |
| 64 | 64 | $this->oPage->setSecondaryTitle($this->oDocument->getName()); |
| 65 | 65 | |
| 66 | - $this->oPage->setBreadcrumbDetails(_kt("history")); | |
| 66 | + $this->oPage->setBreadcrumbDetails(_kt('history')); | |
| 67 | 67 | |
| 68 | 68 | $aTransactions = array(); |
| 69 | 69 | // FIXME create a sane "view user information" page somewhere. |
| 70 | 70 | // FIXME do we really need to use a raw db-access here? probably... |
| 71 | - $sQuery = "SELECT DTT.name AS transaction_name, U.name AS user_name, DT.version AS version, DT.comment AS comment, DT.datetime AS datetime " . | |
| 72 | - "FROM " . KTUtil::getTableName("document_transactions") . " AS DT INNER JOIN " . KTUtil::getTableName("users") . " AS U ON DT.user_id = U.id " . | |
| 73 | - "INNER JOIN " . KTUtil::getTableName("transaction_types") . " AS DTT ON DTT.namespace = DT.transaction_namespace " . | |
| 74 | - "WHERE DT.document_id = ? ORDER BY DT.datetime DESC"; | |
| 71 | + $sQuery = 'SELECT DTT.name AS transaction_name, U.name AS user_name, DT.version AS version, DT.comment AS comment, DT.datetime AS datetime ' . | |
| 72 | + 'FROM ' . KTUtil::getTableName('document_transactions') . ' AS DT INNER JOIN ' . KTUtil::getTableName('users') . ' AS U ON DT.user_id = U.id ' . | |
| 73 | + 'INNER JOIN ' . KTUtil::getTableName('transaction_types') . ' AS DTT ON DTT.namespace = DT.transaction_namespace ' . | |
| 74 | + 'WHERE DT.document_id = ? ORDER BY DT.datetime DESC'; | |
| 75 | 75 | $aParams = array($this->oDocument->getId()); |
| 76 | 76 | |
| 77 | 77 | $res = DBUtil::getResultArray(array($sQuery, $aParams)); |
| ... | ... | @@ -84,14 +84,14 @@ class KTDocumentTransactionHistoryAction extends KTDocumentAction { |
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | // render pass. |
| 87 | - $this->oPage->setTitle(_kt("Document History")); | |
| 87 | + $this->oPage->setTitle(_kt('Document History')); | |
| 88 | 88 | |
| 89 | - $oTemplate = $this->oValidator->validateTemplate("ktcore/document/transaction_history"); | |
| 89 | + $oTemplate = $this->oValidator->validateTemplate('ktcore/document/transaction_history'); | |
| 90 | 90 | $aTemplateData = array( |
| 91 | - "context" => $this, | |
| 92 | - "document_id" => $this->oDocument->getId(), | |
| 93 | - "document" => $this->oDocument, | |
| 94 | - "transactions" => $aTransactions, | |
| 91 | + 'context' => $this, | |
| 92 | + 'document_id' => $this->oDocument->getId(), | |
| 93 | + 'document' => $this->oDocument, | |
| 94 | + 'transactions' => $aTransactions, | |
| 95 | 95 | ); |
| 96 | 96 | return $oTemplate->render($aTemplateData); |
| 97 | 97 | } |
| ... | ... | @@ -110,7 +110,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { |
| 110 | 110 | function do_main() { |
| 111 | 111 | |
| 112 | 112 | $this->oPage->setSecondaryTitle($this->oDocument->getName()); |
| 113 | - $this->oPage->setBreadcrumbDetails(_kt("Version History")); | |
| 113 | + $this->oPage->setBreadcrumbDetails(_kt('Version History')); | |
| 114 | 114 | |
| 115 | 115 | $aMetadataVersions = KTDocumentMetadataVersion::getByDocument($this->oDocument); |
| 116 | 116 | $aVersions = array(); |
| ... | ... | @@ -119,9 +119,9 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // render pass. |
| 122 | - $this->oPage->title = _kt("Document History"); | |
| 122 | + $this->oPage->title = _kt('Document History'); | |
| 123 | 123 | |
| 124 | - $oTemplate = $this->oValidator->validateTemplate("ktcore/document/metadata_history"); | |
| 124 | + $oTemplate = $this->oValidator->validateTemplate('ktcore/document/metadata_history'); | |
| 125 | 125 | |
| 126 | 126 | $aActions = KTDocumentActionUtil::getDocumentActionsByNames(array('ktcore.actions.document.view'), 'documentinfo'); |
| 127 | 127 | $oAction = $aActions[0]; |
| ... | ... | @@ -129,10 +129,10 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { |
| 129 | 129 | $oAction->setDocument($this->oDocument); |
| 130 | 130 | |
| 131 | 131 | $aTemplateData = array( |
| 132 | - "context" => $this, | |
| 133 | - "document_id" => $this->oDocument->getId(), | |
| 134 | - "document" => $this->oDocument, | |
| 135 | - "versions" => $aVersions, | |
| 132 | + 'context' => $this, | |
| 133 | + 'document_id' => $this->oDocument->getId(), | |
| 134 | + 'document' => $this->oDocument, | |
| 135 | + 'versions' => $aVersions, | |
| 136 | 136 | 'downloadaction' => $oAction, |
| 137 | 137 | ); |
| 138 | 138 | return $oTemplate->render($aTemplateData); |
| ... | ... | @@ -143,7 +143,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { |
| 143 | 143 | |
| 144 | 144 | $oDocument =& Document::get($this->oDocument->getId(), $comparison_version); |
| 145 | 145 | if (PEAR::isError($oDocument)) { |
| 146 | - return $this->redirectToMain(_kt("The document you selected was invalid")); | |
| 146 | + return $this->redirectToMain(_kt('The document you selected was invalid')); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (!Permission::userHasDocumentReadPermission($oDocument)) { |
| ... | ... | @@ -151,7 +151,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { |
| 151 | 151 | } |
| 152 | 152 | $this->oDocument =& $oDocument; |
| 153 | 153 | $this->oPage->setSecondaryTitle($oDocument->getName()); |
| 154 | - $this->oPage->setBreadcrumbDetails(_kt("Select Document Version to compare against")); | |
| 154 | + $this->oPage->setBreadcrumbDetails(_kt('Select Document Version to compare against')); | |
| 155 | 155 | |
| 156 | 156 | $aMetadataVersions = KTDocumentMetadataVersion::getByDocument($oDocument); |
| 157 | 157 | $aVersions = array(); |
| ... | ... | @@ -160,12 +160,12 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $oTemplating =& KTTemplating::getSingleton(); |
| 163 | - $oTemplate = $oTemplating->loadTemplate("ktcore/document/comparison_version_select"); | |
| 163 | + $oTemplate = $oTemplating->loadTemplate('ktcore/document/comparison_version_select'); | |
| 164 | 164 | $aTemplateData = array( |
| 165 | - "context" => $this, | |
| 166 | - "document_id" => $this->oDocument->getId(), | |
| 167 | - "document" => $oDocument, | |
| 168 | - "versions" => $aVersions, | |
| 165 | + 'context' => $this, | |
| 166 | + 'document_id' => $this->oDocument->getId(), | |
| 167 | + 'document' => $oDocument, | |
| 168 | + 'versions' => $aVersions, | |
| 169 | 169 | 'downloadaction' => $oAction, |
| 170 | 170 | ); |
| 171 | 171 | return $oTemplate->render($aTemplateData); |
| ... | ... | @@ -182,7 +182,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { |
| 182 | 182 | $frag = array(); |
| 183 | 183 | |
| 184 | 184 | foreach ($QS as $k => $v) { |
| 185 | - $frag[] = sprintf("%s=%s", urlencode($k), urlencode($v)); | |
| 185 | + $frag[] = sprintf('%s=%s', urlencode($k), urlencode($v)); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | redirect(KTUtil::ktLink('view.php',null,implode('&', $frag))); |
| ... | ... | @@ -208,7 +208,7 @@ class KTDocumentViewAction extends KTDocumentAction { |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | function customiseInfo($aInfo) { |
| 211 | - $aInfo['alert'] = _kt("This will download a copy of the document and is not the same as Checking Out a document. Changes to this downloaded file will not be managed in the DMS."); | |
| 211 | + $aInfo['alert'] = _kt('This will download a copy of the document and is not the same as Checking Out a document. Changes to this downloaded file will not be managed in the DMS.'); | |
| 212 | 212 | return $aInfo; |
| 213 | 213 | } |
| 214 | 214 | |
| ... | ... | @@ -218,7 +218,7 @@ class KTDocumentViewAction extends KTDocumentAction { |
| 218 | 218 | $iVersion = KTUtil::arrayGet($_REQUEST, 'version'); |
| 219 | 219 | if ($iVersion) { |
| 220 | 220 | $oVersion = KTDocumentContentVersion::get($iVersion); |
| 221 | - $aOptions['version'] = sprintf("%d.%d", $oVersion->getMajorVersionNumber(), $oVersion->getMinorVersionNumber());; | |
| 221 | + $aOptions['version'] = sprintf('%d.%d', $oVersion->getMajorVersionNumber(), $oVersion->getMinorVersionNumber());; | |
| 222 | 222 | $res = $oStorage->downloadVersion($this->oDocument, $iVersion); |
| 223 | 223 | } else { |
| 224 | 224 | $res = $oStorage->download($this->oDocument); |
| ... | ... | @@ -230,7 +230,7 @@ class KTDocumentViewAction extends KTDocumentAction { |
| 230 | 230 | exit(0); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - $oDocumentTransaction = & new DocumentTransaction($this->oDocument, "Document downloaded", 'ktcore.transactions.download', $aOptions); | |
| 233 | + $oDocumentTransaction = & new DocumentTransaction($this->oDocument, 'Document downloaded', 'ktcore.transactions.download', $aOptions); | |
| 234 | 234 | $oDocumentTransaction->create(); |
| 235 | 235 | exit(0); |
| 236 | 236 | } |
| ... | ... | @@ -241,7 +241,7 @@ class KTDocumentViewAction extends KTDocumentAction { |
| 241 | 241 | class KTDocumentCheckOutAction extends KTDocumentAction { |
| 242 | 242 | var $sName = 'ktcore.actions.document.checkout'; |
| 243 | 243 | |
| 244 | - var $_sShowPermission = "ktcore.permissions.write"; | |
| 244 | + var $_sShowPermission = 'ktcore.permissions.write'; | |
| 245 | 245 | |
| 246 | 246 | var $_bMutator = true; |
| 247 | 247 | var $_bMutationAllowedByAdmin = false; |
| ... | ... | @@ -271,7 +271,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { |
| 271 | 271 | |
| 272 | 272 | // "normal". |
| 273 | 273 | if ($this->oDocument->getIsCheckedOut()) { |
| 274 | - $_SESSION['KTErrorMessage'][] = _kt("This document is already checked out"); | |
| 274 | + $_SESSION['KTErrorMessage'][] = _kt('This document is already checked out'); | |
| 275 | 275 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 276 | 276 | exit(0); |
| 277 | 277 | } |
| ... | ... | @@ -281,22 +281,22 @@ class KTDocumentCheckOutAction extends KTDocumentAction { |
| 281 | 281 | function form_checkout() { |
| 282 | 282 | $oForm = new KTForm; |
| 283 | 283 | $oForm->setOptions(array( |
| 284 | - 'label' => _kt("Checkout"), | |
| 284 | + 'label' => _kt('Checkout'), | |
| 285 | 285 | 'action' => 'checkout', |
| 286 | 286 | 'fail_action' => 'main', |
| 287 | 287 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| 288 | - 'submit_label' => _kt("Checkout document"), | |
| 288 | + 'submit_label' => _kt('Checkout document'), | |
| 289 | 289 | 'context' => &$this, |
| 290 | 290 | )); |
| 291 | 291 | $oForm->setWidgets(array( |
| 292 | 292 | array('ktcore.widgets.reason', array( |
| 293 | - 'label' => _kt("Reason"), | |
| 294 | - 'description' => _kt("Please specify why you are checking out this document. It will assist other users in understanding why you have locked this file. Please bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 293 | + 'label' => _kt('Reason'), | |
| 294 | + 'description' => _kt('Please specify why you are checking out this document. It will assist other users in understanding why you have locked this file. Please bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 295 | 295 | 'name' => 'reason', |
| 296 | 296 | )), |
| 297 | 297 | array('ktcore.widgets.boolean', array( |
| 298 | - 'label' => _kt("Download File"), | |
| 299 | - 'description' => _kt("Indicate whether you would like to download this file as part of the checkout."), | |
| 298 | + 'label' => _kt('Download File'), | |
| 299 | + 'description' => _kt('Indicate whether you would like to download this file as part of the checkout.'), | |
| 300 | 300 | 'name' => 'download_file', |
| 301 | 301 | 'value' => true, |
| 302 | 302 | )), |
| ... | ... | @@ -317,7 +317,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | function do_main() { |
| 320 | - $this->oPage->setBreadcrumbDetails(_kt("checkout")); | |
| 320 | + $this->oPage->setBreadcrumbDetails(_kt('checkout')); | |
| 321 | 321 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkout'); |
| 322 | 322 | |
| 323 | 323 | $oForm = $this->form_checkout(); |
| ... | ... | @@ -353,7 +353,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { |
| 353 | 353 | $this->commitTransaction(); |
| 354 | 354 | |
| 355 | 355 | if (!$data['download_file']) { |
| 356 | - $this->addInfoMessage(_kt("Document checked out.")); | |
| 356 | + $this->addInfoMessage(_kt('Document checked out.')); | |
| 357 | 357 | redirect(KTBrowseUtil::getUrlForDocument($this->oDocument)); |
| 358 | 358 | exit(0); |
| 359 | 359 | } |
| ... | ... | @@ -381,7 +381,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { |
| 381 | 381 | class KTDocumentCheckInAction extends KTDocumentAction { |
| 382 | 382 | var $sName = 'ktcore.actions.document.checkin'; |
| 383 | 383 | |
| 384 | - var $_sShowPermission = "ktcore.permissions.write"; | |
| 384 | + var $_sShowPermission = 'ktcore.permissions.write'; | |
| 385 | 385 | var $sIconClass = 'checkin'; |
| 386 | 386 | |
| 387 | 387 | function getDisplayName() { |
| ... | ... | @@ -404,8 +404,8 @@ class KTDocumentCheckInAction extends KTDocumentAction { |
| 404 | 404 | if ($res !== true) { |
| 405 | 405 | return $res; |
| 406 | 406 | } |
| 407 | - $postExpected = KTUtil::arrayGet($_REQUEST, "postExpected"); | |
| 408 | - $postReceived = KTUtil::arrayGet($_REQUEST, "postReceived"); | |
| 407 | + $postExpected = KTUtil::arrayGet($_REQUEST, 'postExpected'); | |
| 408 | + $postReceived = KTUtil::arrayGet($_REQUEST, 'postReceived'); | |
| 409 | 409 | if (!empty($postExpected)) { |
| 410 | 410 | $aErrorOptions = array( |
| 411 | 411 | 'redirect_to' => array('main', sprintf('fDocumentId=%d', $this->oDocument->getId())), |
| ... | ... | @@ -414,12 +414,12 @@ class KTDocumentCheckInAction extends KTDocumentAction { |
| 414 | 414 | $this->oValidator->notEmpty($postReceived, $aErrorOptions); |
| 415 | 415 | } |
| 416 | 416 | if (!$this->oDocument->getIsCheckedOut()) { |
| 417 | - $_SESSION['KTErrorMessage'][] = _kt("This document is not checked out"); | |
| 417 | + $_SESSION['KTErrorMessage'][] = _kt('This document is not checked out'); | |
| 418 | 418 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 419 | 419 | exit(0); |
| 420 | 420 | } |
| 421 | 421 | if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) { |
| 422 | - $_SESSION['KTErrorMessage'][] = _kt("This document is checked out, but not by you"); | |
| 422 | + $_SESSION['KTErrorMessage'][] = _kt('This document is checked out, but not by you'); | |
| 423 | 423 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 424 | 424 | exit(0); |
| 425 | 425 | } |
| ... | ... | @@ -430,22 +430,22 @@ class KTDocumentCheckInAction extends KTDocumentAction { |
| 430 | 430 | function form_main() { |
| 431 | 431 | $oForm = new KTForm; |
| 432 | 432 | $oForm->setOptions(array( |
| 433 | - 'label' => _kt("Checkin Document"), | |
| 433 | + 'label' => _kt('Checkin Document'), | |
| 434 | 434 | 'action' => 'checkin', |
| 435 | 435 | 'actionparams' => 'postExpected=1&fDocumentId='.$this->oDocument->getId(), |
| 436 | 436 | 'fail_action' => 'main', |
| 437 | 437 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| 438 | - 'submit_label' => _kt("Checkin"), | |
| 438 | + 'submit_label' => _kt('Checkin'), | |
| 439 | 439 | 'context' => &$this, |
| 440 | 440 | 'file_upload' => true, // otherwise the post is not received. |
| 441 | 441 | )); |
| 442 | 442 | |
| 443 | - $major_inc = sprintf("%d.%d", $this->oDocument->getMajorVersionNumber()+1, 0); | |
| 444 | - $minor_inc = sprintf("%d.%d", $this->oDocument->getMajorVersionNumber(), $this->oDocument->getMinorVersionNumber()+1); | |
| 443 | + $major_inc = sprintf('%d.%d', $this->oDocument->getMajorVersionNumber()+1, 0); | |
| 444 | + $minor_inc = sprintf('%d.%d', $this->oDocument->getMajorVersionNumber(), $this->oDocument->getMinorVersionNumber()+1); | |
| 445 | 445 | |
| 446 | 446 | $oForm->setWidgets(array( |
| 447 | 447 | array('ktcore.widgets.file', array( |
| 448 | - 'label' => _kt("File"), | |
| 448 | + 'label' => _kt('File'), | |
| 449 | 449 | 'description' => sprintf(_kt('Please specify the file you wish to upload. Unless you also indicate that you are changing its filename (see "Force Original Filename" below), this will need to be called <strong>%s</strong>'), $this->oDocument->getFilename()), |
| 450 | 450 | 'name' => 'file', |
| 451 | 451 | 'basename' => 'file', |
| ... | ... | @@ -458,8 +458,8 @@ class KTDocumentCheckInAction extends KTDocumentAction { |
| 458 | 458 | 'value' => false, |
| 459 | 459 | )), |
| 460 | 460 | array('ktcore.widgets.reason', array( |
| 461 | - 'label' => _kt("Reason"), | |
| 462 | - 'description' => _kt("Please describe the changes you made to the document. Bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 461 | + 'label' => _kt('Reason'), | |
| 462 | + 'description' => _kt('Please describe the changes you made to the document. Bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 463 | 463 | 'name' => 'reason', |
| 464 | 464 | )), |
| 465 | 465 | array('ktcore.widgets.boolean',array( |
| ... | ... | @@ -494,7 +494,7 @@ class KTDocumentCheckInAction extends KTDocumentAction { |
| 494 | 494 | |
| 495 | 495 | |
| 496 | 496 | function do_main() { |
| 497 | - $this->oPage->setBreadcrumbDetails(_kt("Checkin")); | |
| 497 | + $this->oPage->setBreadcrumbDetails(_kt('Checkin')); | |
| 498 | 498 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkin'); |
| 499 | 499 | |
| 500 | 500 | $oForm = $this->form_main(); |
| ... | ... | @@ -538,7 +538,7 @@ class KTDocumentCheckInAction extends KTDocumentAction { |
| 538 | 538 | |
| 539 | 539 | $res = KTDocumentUtil::checkin($this->oDocument, $data['file']['tmp_name'], $sReason, $this->oUser, $aOptions); |
| 540 | 540 | if (PEAR::isError($res)) { |
| 541 | - $this->errorRedirectToMain(_kt("An error occurred while trying to check in the document"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); | |
| 541 | + $this->errorRedirectToMain(_kt('An error occurred while trying to check in the document'), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); | |
| 542 | 542 | } |
| 543 | 543 | redirect(KTBrowseUtil::getUrlForDocument($this->oDocument)); |
| 544 | 544 | exit(0); |
| ... | ... | @@ -551,7 +551,7 @@ class KTDocumentCheckInAction extends KTDocumentAction { |
| 551 | 551 | class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 552 | 552 | var $sName = 'ktcore.actions.document.cancelcheckout'; |
| 553 | 553 | |
| 554 | - var $_sShowPermission = "ktcore.permissions.write"; | |
| 554 | + var $_sShowPermission = 'ktcore.permissions.write'; | |
| 555 | 555 | var $bAllowInAdminMode = true; |
| 556 | 556 | var $bInAdminMode = null; |
| 557 | 557 | var $sIconClass = 'cancel_checkout'; |
| ... | ... | @@ -586,7 +586,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 586 | 586 | return $res; |
| 587 | 587 | } |
| 588 | 588 | if (!$this->oDocument->getIsCheckedOut()) { |
| 589 | - $_SESSION['KTErrorMessage'][] = _kt("This document is not checked out"); | |
| 589 | + $_SESSION['KTErrorMessage'][] = _kt('This document is not checked out'); | |
| 590 | 590 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 591 | 591 | exit(0); |
| 592 | 592 | } |
| ... | ... | @@ -601,7 +601,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 601 | 601 | return true; |
| 602 | 602 | } |
| 603 | 603 | if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) { |
| 604 | - $_SESSION['KTErrorMessage'][] = _kt("This document is checked out, but not by you"); | |
| 604 | + $_SESSION['KTErrorMessage'][] = _kt('This document is checked out, but not by you'); | |
| 605 | 605 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 606 | 606 | exit(0); |
| 607 | 607 | } |
| ... | ... | @@ -611,17 +611,17 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 611 | 611 | function form_main() { |
| 612 | 612 | $oForm = new KTForm; |
| 613 | 613 | $oForm->setOptions(array( |
| 614 | - 'label' => _kt("Cancel Checkout"), | |
| 614 | + 'label' => _kt('Cancel Checkout'), | |
| 615 | 615 | 'action' => 'checkin', |
| 616 | 616 | 'fail_action' => 'main', |
| 617 | 617 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| 618 | - 'submit_label' => _kt("Cancel Checkout"), | |
| 618 | + 'submit_label' => _kt('Cancel Checkout'), | |
| 619 | 619 | 'context' => &$this, |
| 620 | 620 | )); |
| 621 | 621 | $oForm->setWidgets(array( |
| 622 | 622 | array('ktcore.widgets.reason', array( |
| 623 | - 'label' => _kt("Reason"), | |
| 624 | - 'description' => _kt("Please specify why you are cancelling this document's checked-out status. Please bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 623 | + 'label' => _kt('Reason'), | |
| 624 | + 'description' => _kt('Please specify why you are cancelling this document\'s checked-out status. Please bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 625 | 625 | 'name' => 'reason', |
| 626 | 626 | )), |
| 627 | 627 | )); |
| ... | ... | @@ -637,7 +637,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | function do_main() { |
| 640 | - $this->oPage->setBreadcrumbDetails(_kt("cancel checkout")); | |
| 640 | + $this->oPage->setBreadcrumbDetails(_kt('cancel checkout')); | |
| 641 | 641 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/cancel_checkout'); |
| 642 | 642 | |
| 643 | 643 | $oForm = $this->form_main(); |
| ... | ... | @@ -666,7 +666,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 666 | 666 | $res = $this->oDocument->update(); |
| 667 | 667 | if (PEAR::isError($res) || ($res === false)) { |
| 668 | 668 | $this->rollbackTransaction(); |
| 669 | - return $this->errorRedirectToMain(_kt("Failed to force the document's checkin."),sprintf('fDocumentId=%d'),$this->oDocument->getId()); | |
| 669 | + return $this->errorRedirectToMain(_kt('Failed to force the document\'s checkin.'),sprintf('fDocumentId=%d'),$this->oDocument->getId()); | |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | // checkout cancelled transaction |
| ... | ... | @@ -674,7 +674,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 674 | 674 | $res = $oDocumentTransaction->create(); |
| 675 | 675 | if (PEAR::isError($res) || ($res === false)) { |
| 676 | 676 | $this->rollbackTransaction(); |
| 677 | - return $this->errorRedirectToMain(_kt("Failed to force the document's checkin."),sprintf('fDocumentId=%d'),$this->oDocument->getId()); | |
| 677 | + return $this->errorRedirectToMain(_kt('Failed to force the document\'s checkin.'),sprintf('fDocumentId=%d'),$this->oDocument->getId()); | |
| 678 | 678 | } |
| 679 | 679 | $this->commitTransaction(); |
| 680 | 680 | redirect(KTBrowseUtil::getUrlForDocument($this->oDocument)); |
| ... | ... | @@ -687,7 +687,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { |
| 687 | 687 | class KTDocumentDeleteAction extends KTDocumentAction { |
| 688 | 688 | var $sName = 'ktcore.actions.document.delete'; |
| 689 | 689 | |
| 690 | - var $_sShowPermission = "ktcore.permissions.delete"; | |
| 690 | + var $_sShowPermission = 'ktcore.permissions.delete'; | |
| 691 | 691 | var $_bMutator = true; |
| 692 | 692 | |
| 693 | 693 | function getDisplayName() { |
| ... | ... | @@ -707,7 +707,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { |
| 707 | 707 | return $res; |
| 708 | 708 | } |
| 709 | 709 | if ($this->oDocument->getIsCheckedOut()) { |
| 710 | - $_SESSION["KTErrorMessage"][]= _kt("This document can't be deleted because it is checked out"); | |
| 710 | + $_SESSION['KTErrorMessage'][]= _kt('This document can\'t be deleted because it is checked out'); | |
| 711 | 711 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 712 | 712 | exit(0); |
| 713 | 713 | } |
| ... | ... | @@ -718,17 +718,17 @@ class KTDocumentDeleteAction extends KTDocumentAction { |
| 718 | 718 | function form_main() { |
| 719 | 719 | $oForm = new KTForm; |
| 720 | 720 | $oForm->setOptions(array( |
| 721 | - 'label' => _kt("Delete Document"), | |
| 721 | + 'label' => _kt('Delete Document'), | |
| 722 | 722 | 'action' => 'delete', |
| 723 | 723 | 'fail_action' => 'main', |
| 724 | 724 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| 725 | - 'submit_label' => _kt("Delete Document"), | |
| 725 | + 'submit_label' => _kt('Delete Document'), | |
| 726 | 726 | 'context' => &$this, |
| 727 | 727 | )); |
| 728 | 728 | $oForm->setWidgets(array( |
| 729 | 729 | array('ktcore.widgets.reason', array( |
| 730 | - 'label' => _kt("Reason"), | |
| 731 | - 'description' => _kt("Please specify why you are deleting this document. Please bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 730 | + 'label' => _kt('Reason'), | |
| 731 | + 'description' => _kt('Please specify why you are deleting this document. Please bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 732 | 732 | 'name' => 'reason', |
| 733 | 733 | )), |
| 734 | 734 | )); |
| ... | ... | @@ -744,7 +744,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | function do_main() { |
| 747 | - $this->oPage->setBreadcrumbDetails(_kt("Delete")); | |
| 747 | + $this->oPage->setBreadcrumbDetails(_kt('Delete')); | |
| 748 | 748 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/delete'); |
| 749 | 749 | |
| 750 | 750 | $oForm = $this->form_main(); |
| ... | ... | @@ -769,7 +769,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { |
| 769 | 769 | $fFolderId = $this->oDocument->getFolderId(); |
| 770 | 770 | $res = KTDocumentUtil::delete($this->oDocument, $sReason); |
| 771 | 771 | if (PEAR::isError($res)) { |
| 772 | - $this->errorRedirectToMain(sprintf(_kt("Unexpected failure deleting document: %s"), $res->getMessage())); | |
| 772 | + $this->errorRedirectToMain(sprintf(_kt('Unexpected failure deleting document: %s'), $res->getMessage())); | |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | $_SESSION['KTInfoMessage'][] = sprintf(_kt('Document "%s" Deleted.'),$this->oDocument->getName()); |
| ... | ... | @@ -785,7 +785,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { |
| 785 | 785 | class KTDocumentMoveAction extends KTDocumentAction { |
| 786 | 786 | var $sName = 'ktcore.actions.document.move'; |
| 787 | 787 | |
| 788 | - var $_sShowPermission = "ktcore.permissions.write"; | |
| 788 | + var $_sShowPermission = 'ktcore.permissions.write'; | |
| 789 | 789 | var $_bMutator = true; |
| 790 | 790 | |
| 791 | 791 | function getDisplayName() { |
| ... | ... | @@ -805,7 +805,7 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 805 | 805 | return $res; |
| 806 | 806 | } |
| 807 | 807 | if ($this->oDocument->getIsCheckedOut()) { |
| 808 | - $_SESSION["KTErrorMessage"][]= _kt("This document can't be moved because it is checked out"); | |
| 808 | + $_SESSION['KTErrorMessage'][]= _kt('This document can\'t be moved because it is checked out'); | |
| 809 | 809 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 810 | 810 | exit(0); |
| 811 | 811 | } |
| ... | ... | @@ -824,8 +824,8 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 824 | 824 | function form_move() { |
| 825 | 825 | $oForm = new KTForm; |
| 826 | 826 | $oForm->setOptions(array( |
| 827 | - 'label' => sprintf(_kt("Move Document \"%s\""), $this->oDocument->getName()), | |
| 828 | - 'submit_label' => _kt("Move"), | |
| 827 | + 'label' => sprintf(_kt('Move Document "%s"'), $this->oDocument->getName()), | |
| 828 | + 'submit_label' => _kt('Move'), | |
| 829 | 829 | 'identifier' => 'ktcore.actions.movedoc', |
| 830 | 830 | 'action' => 'move', |
| 831 | 831 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| ... | ... | @@ -849,8 +849,8 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 849 | 849 | 'folder_id' => $this->oDocument->getFolderID(), |
| 850 | 850 | )), |
| 851 | 851 | array('ktcore.widgets.reason', array( |
| 852 | - 'label' => _kt("Reason"), | |
| 853 | - 'description' => _kt("Please specify why you are moving this document. Bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 852 | + 'label' => _kt('Reason'), | |
| 853 | + 'description' => _kt('Please specify why you are moving this document. Bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 854 | 854 | 'name' => 'reason', |
| 855 | 855 | )), |
| 856 | 856 | )); |
| ... | ... | @@ -875,9 +875,9 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 875 | 875 | if (!empty($err['name']) || !empty($err['filename'])) { |
| 876 | 876 | $oForm->addWidget( |
| 877 | 877 | array('ktcore.widgets.string', array( |
| 878 | - 'label' => _kt("Document Title"), | |
| 878 | + 'label' => _kt('Document Title'), | |
| 879 | 879 | 'value' => $this->oDocument->getName(), |
| 880 | - 'important_description' => _kt("Please indicate a new title to use to resolve any title conflicts."), | |
| 880 | + 'important_description' => _kt('Please indicate a new title to use to resolve any title conflicts.'), | |
| 881 | 881 | 'name' => 'name', |
| 882 | 882 | 'required' => true, |
| 883 | 883 | )) |
| ... | ... | @@ -891,9 +891,9 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 891 | 891 | |
| 892 | 892 | $oForm->addWidget( |
| 893 | 893 | array('ktcore.widgets.string', array( |
| 894 | - 'label' => _kt("Filename"), | |
| 894 | + 'label' => _kt('Filename'), | |
| 895 | 895 | 'value' => $this->oDocument->getFilename(), |
| 896 | - 'important_description' => _kt("Please indicate a new filename to use to resolve any conflicts."), | |
| 896 | + 'important_description' => _kt('Please indicate a new filename to use to resolve any conflicts.'), | |
| 897 | 897 | 'name' => 'filename', |
| 898 | 898 | 'required' => true, |
| 899 | 899 | )) |
| ... | ... | @@ -917,7 +917,7 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 917 | 917 | |
| 918 | 918 | if (!is_null($data['browse'])) { |
| 919 | 919 | if ($data['browse']->getId() == $this->oDocument->getFolderID()) { |
| 920 | - $extra_errors['browse'] = _kt("You cannot move the document within the same folder."); | |
| 920 | + $extra_errors['browse'] = _kt('You cannot move the document within the same folder.'); | |
| 921 | 921 | } else { |
| 922 | 922 | $bNameClash = KTDocumentUtil::nameExists($data['browse'], $this->oDocument->getName()); |
| 923 | 923 | if ($bNameClash && isset($data['name'])) { |
| ... | ... | @@ -927,7 +927,7 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 927 | 927 | $name = $this->oDocument->getName(); |
| 928 | 928 | } |
| 929 | 929 | if ($bNameClash) { |
| 930 | - $extra_errors['name'] = _kt("A document with this title already exists in your chosen folder. Please choose a different folder, or specify a new title for the copied document."); | |
| 930 | + $extra_errors['name'] = _kt('A document with this title already exists in your chosen folder. Please choose a different folder, or specify a new title for the copied document.'); | |
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | $bFileClash = KTDocumentUtil::fileExists($this->oFolder, $this->oDocument->getFilename()); |
| ... | ... | @@ -938,11 +938,11 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 938 | 938 | $filename = $this->oDocument->getFilename(); |
| 939 | 939 | } |
| 940 | 940 | if ($bFileClash) { |
| 941 | - $extra_errors['filename'] = _kt("A document with this filename already exists in your chosen folder. Please choose a different folder, or specify a new filename for the copied document."); | |
| 941 | + $extra_errors['filename'] = _kt('A document with this filename already exists in your chosen folder. Please choose a different folder, or specify a new filename for the copied document.'); | |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | if (!Permission::userHasFolderWritePermission($data['browse'])) { |
| 945 | - $extra_errors['browse'] = _kt("You do not have permission to create new documents in that folder."); | |
| 945 | + $extra_errors['browse'] = _kt('You do not have permission to create new documents in that folder.'); | |
| 946 | 946 | } |
| 947 | 947 | } |
| 948 | 948 | } |
| ... | ... | @@ -956,7 +956,7 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 956 | 956 | |
| 957 | 957 | $res = KTDocumentUtil::move($this->oDocument, $data['browse'], $this->oUser, $sReason); |
| 958 | 958 | if (PEAR::isError($oNewDoc)) { |
| 959 | - $this->errorRedirectTo("main", _kt("Failed to move document: ") . $oNewDoc->getMessage()); | |
| 959 | + $this->errorRedirectTo('main', _kt('Failed to move document: ') . $oNewDoc->getMessage()); | |
| 960 | 960 | exit(0); |
| 961 | 961 | } |
| 962 | 962 | |
| ... | ... | @@ -965,7 +965,7 @@ class KTDocumentMoveAction extends KTDocumentAction { |
| 965 | 965 | |
| 966 | 966 | $res = $this->oDocument->update(); |
| 967 | 967 | if (PEAR::isError($res)) { |
| 968 | - return $this->errorRedirectTo("main", _kt("Failed to move document: ") . $res->getMessage()); | |
| 968 | + return $this->errorRedirectTo('main', _kt('Failed to move document: ') . $res->getMessage()); | |
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | $this->commitTransaction(); |
| ... | ... | @@ -984,7 +984,7 @@ class KTDocumentCopyColumn extends TitleColumn { |
| 984 | 984 | parent::TitleColumn($sLabel, $sName); |
| 985 | 985 | } |
| 986 | 986 | function buildFolderLink($aDataRow) { |
| 987 | - return KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $aDataRow["folder"]->getId())); | |
| 987 | + return KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $aDataRow['folder']->getId())); | |
| 988 | 988 | } |
| 989 | 989 | } |
| 990 | 990 | |
| ... | ... | @@ -992,7 +992,7 @@ class KTDocumentCopyColumn extends TitleColumn { |
| 992 | 992 | class KTDocumentCopyAction extends KTDocumentAction { |
| 993 | 993 | var $sName = 'ktcore.actions.document.copy'; |
| 994 | 994 | |
| 995 | - var $_sShowPermission = "ktcore.permissions.read"; | |
| 995 | + var $_sShowPermission = 'ktcore.permissions.read'; | |
| 996 | 996 | |
| 997 | 997 | function getDisplayName() { |
| 998 | 998 | return _kt('Copy'); |
| ... | ... | @@ -1012,7 +1012,7 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1012 | 1012 | return $res; |
| 1013 | 1013 | } |
| 1014 | 1014 | if ($this->oDocument->getIsCheckedOut()) { |
| 1015 | - $_SESSION["KTErrorMessage"][]= _kt("This document can't be copied because it is checked out"); | |
| 1015 | + $_SESSION['KTErrorMessage'][]= _kt('This document can\'t be copied because it is checked out'); | |
| 1016 | 1016 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 1017 | 1017 | exit(0); |
| 1018 | 1018 | } |
| ... | ... | @@ -1025,8 +1025,8 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1025 | 1025 | function form_copyselection() { |
| 1026 | 1026 | $oForm = new KTForm; |
| 1027 | 1027 | $oForm->setOptions(array( |
| 1028 | - 'label' => sprintf(_kt("Copy Document \"%s\""), $this->oDocument->getName()), | |
| 1029 | - 'submit_label' => _kt("Copy"), | |
| 1028 | + 'label' => sprintf(_kt('Copy Document "%s"'), $this->oDocument->getName()), | |
| 1029 | + 'submit_label' => _kt('Copy'), | |
| 1030 | 1030 | 'identifier' => 'ktcore.actions.copydoc', |
| 1031 | 1031 | 'action' => 'copy', |
| 1032 | 1032 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| ... | ... | @@ -1050,8 +1050,8 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1050 | 1050 | 'folder_id' => $this->oDocument->getFolderID(), |
| 1051 | 1051 | )), |
| 1052 | 1052 | array('ktcore.widgets.reason', array( |
| 1053 | - 'label' => _kt("Reason"), | |
| 1054 | - 'description' => _kt("Please specify why you are copying this document. Bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 1053 | + 'label' => _kt('Reason'), | |
| 1054 | + 'description' => _kt('Please specify why you are copying this document. Bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 1055 | 1055 | 'name' => 'reason', |
| 1056 | 1056 | )), |
| 1057 | 1057 | )); |
| ... | ... | @@ -1076,9 +1076,9 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1076 | 1076 | if (!empty($err['name']) || !empty($err['filename'])) { |
| 1077 | 1077 | $oForm->addWidget( |
| 1078 | 1078 | array('ktcore.widgets.string', array( |
| 1079 | - 'label' => _kt("Document Title"), | |
| 1079 | + 'label' => _kt('Document Title'), | |
| 1080 | 1080 | 'value' => $this->oDocument->getName(), |
| 1081 | - 'important_description' => _kt("Please indicate a new title to use to resolve any title conflicts."), | |
| 1081 | + 'important_description' => _kt('Please indicate a new title to use to resolve any title conflicts.'), | |
| 1082 | 1082 | 'name' => 'name', |
| 1083 | 1083 | 'required' => true, |
| 1084 | 1084 | )) |
| ... | ... | @@ -1092,9 +1092,9 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1092 | 1092 | |
| 1093 | 1093 | $oForm->addWidget( |
| 1094 | 1094 | array('ktcore.widgets.string', array( |
| 1095 | - 'label' => _kt("Filename"), | |
| 1095 | + 'label' => _kt('Filename'), | |
| 1096 | 1096 | 'value' => $this->oDocument->getFilename(), |
| 1097 | - 'important_description' => _kt("Please indicate a new filename to use to resolve any conflicts."), | |
| 1097 | + 'important_description' => _kt('Please indicate a new filename to use to resolve any conflicts.'), | |
| 1098 | 1098 | 'name' => 'filename', |
| 1099 | 1099 | 'required' => true, |
| 1100 | 1100 | )) |
| ... | ... | @@ -1110,7 +1110,7 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1110 | 1110 | } |
| 1111 | 1111 | |
| 1112 | 1112 | function do_main() { |
| 1113 | - $this->oPage->setBreadcrumbDetails(_kt("Copy")); | |
| 1113 | + $this->oPage->setBreadcrumbDetails(_kt('Copy')); | |
| 1114 | 1114 | $oForm = $this->form_copyselection(); |
| 1115 | 1115 | return $oForm->renderPage(); |
| 1116 | 1116 | } |
| ... | ... | @@ -1132,7 +1132,7 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1132 | 1132 | $name = $this->oDocument->getName(); |
| 1133 | 1133 | } |
| 1134 | 1134 | if ($bNameClash) { |
| 1135 | - $extra_errors['name'] = _kt("A document with this title already exists in your chosen folder. Please choose a different folder, or specify a new title for the copied document."); | |
| 1135 | + $extra_errors['name'] = _kt('A document with this title already exists in your chosen folder. Please choose a different folder, or specify a new title for the copied document.'); | |
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | $bFileClash = KTDocumentUtil::fileExists($data['browse'], $this->oDocument->getFilename()); |
| ... | ... | @@ -1144,11 +1144,11 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1144 | 1144 | $filename = $this->oDocument->getFilename(); |
| 1145 | 1145 | } |
| 1146 | 1146 | if ($bFileClash) { |
| 1147 | - $extra_errors['filename'] = _kt("A document with this filename already exists in your chosen folder. Please choose a different folder, or specify a new filename for the copied document."); | |
| 1147 | + $extra_errors['filename'] = _kt('A document with this filename already exists in your chosen folder. Please choose a different folder, or specify a new filename for the copied document.'); | |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | 1150 | if (!Permission::userHasFolderWritePermission($data['browse'])) { |
| 1151 | - $extra_errors['browse'] = _kt("You do not have permission to create new documents in that folder."); | |
| 1151 | + $extra_errors['browse'] = _kt('You do not have permission to create new documents in that folder.'); | |
| 1152 | 1152 | } |
| 1153 | 1153 | } |
| 1154 | 1154 | |
| ... | ... | @@ -1163,7 +1163,7 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1163 | 1163 | |
| 1164 | 1164 | $oNewDoc = KTDocumentUtil::copy($this->oDocument, $data['browse'], $sReason); |
| 1165 | 1165 | if (PEAR::isError($oNewDoc)) { |
| 1166 | - $this->errorRedirectTo("main", _kt("Failed to copy document: ") . $oNewDoc->getMessage(), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId())); | |
| 1166 | + $this->errorRedirectTo('main', _kt('Failed to copy document: ') . $oNewDoc->getMessage(), sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())); | |
| 1167 | 1167 | exit(0); |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| ... | ... | @@ -1172,7 +1172,7 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1172 | 1172 | |
| 1173 | 1173 | $res = $oNewDoc->update(); |
| 1174 | 1174 | if (PEAR::isError($res)) { |
| 1175 | - return $this->errorRedirectTo("main", _kt("Failed to copy document: ") . $res->getMessage(), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId())); | |
| 1175 | + return $this->errorRedirectTo('main', _kt('Failed to copy document: ') . $res->getMessage(), sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())); | |
| 1176 | 1176 | } |
| 1177 | 1177 | |
| 1178 | 1178 | $this->commitTransaction(); |
| ... | ... | @@ -1184,9 +1184,9 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1184 | 1184 | $sTrigger = $aTrigger[0]; |
| 1185 | 1185 | $oTrigger = new $sTrigger; |
| 1186 | 1186 | $aInfo = array( |
| 1187 | - "document" => $oNewDocument, | |
| 1188 | - "old_folder" => $this->oDocumentFolder, | |
| 1189 | - "new_folder" => $data['browse'], | |
| 1187 | + 'document' => $oNewDocument, | |
| 1188 | + 'old_folder' => $this->oDocumentFolder, | |
| 1189 | + 'new_folder' => $data['browse'], | |
| 1190 | 1190 | ); |
| 1191 | 1191 | $oTrigger->setInfo($aInfo); |
| 1192 | 1192 | $ret = $oTrigger->postValidate(); |
| ... | ... | @@ -1207,7 +1207,7 @@ class KTDocumentCopyAction extends KTDocumentAction { |
| 1207 | 1207 | // {{{ KTDocumentArchiveAction |
| 1208 | 1208 | class KTDocumentArchiveAction extends KTDocumentAction { |
| 1209 | 1209 | var $sName = 'ktcore.actions.document.archive'; |
| 1210 | - var $_sShowPermission = "ktcore.permissions.write"; | |
| 1210 | + var $_sShowPermission = 'ktcore.permissions.write'; | |
| 1211 | 1211 | var $_bMutator = true; |
| 1212 | 1212 | |
| 1213 | 1213 | function getDisplayName() { |
| ... | ... | @@ -1224,17 +1224,17 @@ class KTDocumentArchiveAction extends KTDocumentAction { |
| 1224 | 1224 | function form_main() { |
| 1225 | 1225 | $oForm = new KTForm; |
| 1226 | 1226 | $oForm->setOptions(array( |
| 1227 | - 'label' => _kt("Archive Document"), | |
| 1227 | + 'label' => _kt('Archive Document'), | |
| 1228 | 1228 | 'action' => 'archive', |
| 1229 | 1229 | 'fail_action' => 'main', |
| 1230 | 1230 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| 1231 | - 'submit_label' => _kt("Archive Document"), | |
| 1231 | + 'submit_label' => _kt('Archive Document'), | |
| 1232 | 1232 | 'context' => &$this, |
| 1233 | 1233 | )); |
| 1234 | 1234 | $oForm->setWidgets(array( |
| 1235 | 1235 | array('ktcore.widgets.reason', array( |
| 1236 | - 'label' => _kt("Reason"), | |
| 1237 | - 'description' => _kt("Please specify why you are archiving this document. Please bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 1236 | + 'label' => _kt('Reason'), | |
| 1237 | + 'description' => _kt('Please specify why you are archiving this document. Please bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 1238 | 1238 | 'name' => 'reason', |
| 1239 | 1239 | )), |
| 1240 | 1240 | )); |
| ... | ... | @@ -1250,7 +1250,7 @@ class KTDocumentArchiveAction extends KTDocumentAction { |
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | 1252 | function do_main() { |
| 1253 | - $this->oPage->setBreadcrumbDetails(_kt("Archive Document")); | |
| 1253 | + $this->oPage->setBreadcrumbDetails(_kt('Archive Document')); | |
| 1254 | 1254 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/archive'); |
| 1255 | 1255 | |
| 1256 | 1256 | $oForm = $this->form_main(); |
| ... | ... | @@ -1277,11 +1277,11 @@ class KTDocumentArchiveAction extends KTDocumentAction { |
| 1277 | 1277 | $this->oDocument->setStatusID(ARCHIVED); |
| 1278 | 1278 | $res = $this->oDocument->update(); |
| 1279 | 1279 | if (PEAR::isError($res) || ($res === false)) { |
| 1280 | - $_SESSION['KTErrorMessage'][] = _kt("There was a database error while trying to archive this file"); | |
| 1280 | + $_SESSION['KTErrorMessage'][] = _kt('There was a database error while trying to archive this file'); | |
| 1281 | 1281 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 1282 | 1282 | exit(0); |
| 1283 | 1283 | } |
| 1284 | - $oDocumentTransaction = & new DocumentTransaction($this->oDocument, sprintf(_kt("Document archived: %s"), $sReason), 'ktcore.transactions.update'); | |
| 1284 | + $oDocumentTransaction = & new DocumentTransaction($this->oDocument, sprintf(_kt('Document archived: %s'), $sReason), 'ktcore.transactions.update'); | |
| 1285 | 1285 | $oDocumentTransaction->create(); |
| 1286 | 1286 | |
| 1287 | 1287 | $this->commitTransaction(); |
| ... | ... | @@ -1292,7 +1292,7 @@ class KTDocumentArchiveAction extends KTDocumentAction { |
| 1292 | 1292 | $sTrigger = $aTrigger[0]; |
| 1293 | 1293 | $oTrigger = new $sTrigger; |
| 1294 | 1294 | $aInfo = array( |
| 1295 | - "document" => $this->oDocument, | |
| 1295 | + 'document' => $this->oDocument, | |
| 1296 | 1296 | ); |
| 1297 | 1297 | $oTrigger->setInfo($aInfo); |
| 1298 | 1298 | $ret = $oTrigger->postValidate(); |
| ... | ... | @@ -1302,7 +1302,7 @@ class KTDocumentArchiveAction extends KTDocumentAction { |
| 1302 | 1302 | } |
| 1303 | 1303 | } |
| 1304 | 1304 | |
| 1305 | - $_SESSION['KTInfoMessage'][] = _kt("Document archived."); | |
| 1305 | + $_SESSION['KTInfoMessage'][] = _kt('Document archived.'); | |
| 1306 | 1306 | controllerRedirect('browse', 'fFolderId=' . $this->oDocument->getFolderID()); |
| 1307 | 1307 | exit(0); |
| 1308 | 1308 | } |
| ... | ... | @@ -1312,12 +1312,12 @@ class KTDocumentArchiveAction extends KTDocumentAction { |
| 1312 | 1312 | // {{{ KTDocumentWorkflowAction |
| 1313 | 1313 | class KTDocumentWorkflowAction extends KTDocumentAction { |
| 1314 | 1314 | var $sName = 'ktcore.actions.document.workflow'; |
| 1315 | - var $_sShowPermission = "ktcore.permissions.read"; | |
| 1315 | + var $_sShowPermission = 'ktcore.permissions.read'; | |
| 1316 | 1316 | |
| 1317 | 1317 | var $sHelpPage = 'ktcore/user/workflow.html'; |
| 1318 | 1318 | |
| 1319 | 1319 | function predispatch() { |
| 1320 | - $this->persistParams(array("fTransitionId")); | |
| 1320 | + $this->persistParams(array('fTransitionId')); | |
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | function getDisplayName() { |
| ... | ... | @@ -1325,8 +1325,8 @@ class KTDocumentWorkflowAction extends KTDocumentAction { |
| 1325 | 1325 | } |
| 1326 | 1326 | |
| 1327 | 1327 | function do_main() { |
| 1328 | - $this->oPage->setBreadcrumbDetails(_kt("workflow")); | |
| 1329 | - $oTemplate =& $this->oValidator->validateTemplate("ktcore/workflow/documentWorkflow"); | |
| 1328 | + $this->oPage->setBreadcrumbDetails(_kt('workflow')); | |
| 1329 | + $oTemplate =& $this->oValidator->validateTemplate('ktcore/workflow/documentWorkflow'); | |
| 1330 | 1330 | $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); |
| 1331 | 1331 | |
| 1332 | 1332 | $oWorkflow = KTWorkflowUtil::getWorkflowForDocument($oDocument); |
| ... | ... | @@ -1350,11 +1350,11 @@ class KTDocumentWorkflowAction extends KTDocumentAction { |
| 1350 | 1350 | foreach ($aTransitions as $oTransition) { |
| 1351 | 1351 | $aVocab[$oTransition->getId()] = $oTransition->showDescription(); |
| 1352 | 1352 | } |
| 1353 | - $fieldOptions = array("vocab" => $aVocab); | |
| 1353 | + $fieldOptions = array('vocab' => $aVocab); | |
| 1354 | 1354 | $transition_fields[] = new KTLookupWidget(_kt('Transition to perform'), _kt('The transition listed will cause the document to change from its current state to the listed destination state.'), 'fTransitionId', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); |
| 1355 | 1355 | $transition_fields[] = new KTTextWidget( |
| 1356 | 1356 | _kt('Reason for transition'), _kt('Describe why this document qualifies to be changed from its current state to the destination state of the transition chosen.'), |
| 1357 | - 'fComments', "", | |
| 1357 | + 'fComments', '', | |
| 1358 | 1358 | $this->oPage, true, null, null, |
| 1359 | 1359 | array('cols' => 80, 'rows' => 4)); |
| 1360 | 1360 | } |
| ... | ... | @@ -1415,8 +1415,8 @@ class KTDocumentWorkflowAction extends KTDocumentAction { |
| 1415 | 1415 | $oForm = new KTForm; |
| 1416 | 1416 | $oForm->setOptions(array( |
| 1417 | 1417 | 'identifier' => 'ktcore.workflow.quicktransition', |
| 1418 | - 'label' => _kt("Perform Quick Transition"), | |
| 1419 | - 'submit_label' => _kt("Perform Transition"), | |
| 1418 | + 'label' => _kt('Perform Quick Transition'), | |
| 1419 | + 'submit_label' => _kt('Perform Transition'), | |
| 1420 | 1420 | 'context' => $this, |
| 1421 | 1421 | 'action' => 'performquicktransition', |
| 1422 | 1422 | 'fail_action' => 'quicktransition', |
| ... | ... | @@ -1424,9 +1424,9 @@ class KTDocumentWorkflowAction extends KTDocumentAction { |
| 1424 | 1424 | )); |
| 1425 | 1425 | $oForm->setWidgets(array( |
| 1426 | 1426 | array('ktcore.widgets.reason', array( |
| 1427 | - 'label' => _kt("Reason"), | |
| 1428 | - 'description' => _kt("Specify your reason for performing this action."), | |
| 1429 | - 'important_description' => _kt("Please bear in mind that you can use a maximum of <strong>250</strong> characters."), | |
| 1427 | + 'label' => _kt('Reason'), | |
| 1428 | + 'description' => _kt('Specify your reason for performing this action.'), | |
| 1429 | + 'important_description' => _kt('Please bear in mind that you can use a maximum of <strong>250</strong> characters.'), | |
| 1430 | 1430 | 'name' => 'reason', |
| 1431 | 1431 | )), |
| 1432 | 1432 | )); |
| ... | ... | @@ -1449,7 +1449,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { |
| 1449 | 1449 | $oTransition = KTWorkflowTransition::get($transition_id); |
| 1450 | 1450 | |
| 1451 | 1451 | $oForm = $this->form_quicktransition(); |
| 1452 | - return $oForm->renderPage(sprintf(_kt("Perform Transition: %s"), $oTransition->getName())); | |
| 1452 | + return $oForm->renderPage(sprintf(_kt('Perform Transition: %s'), $oTransition->getName())); | |
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | function do_performquicktransition() { |
| ... | ... | @@ -1483,7 +1483,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { |
| 1483 | 1483 | |
| 1484 | 1484 | class KTOwnershipChangeAction extends KTDocumentAction { |
| 1485 | 1485 | var $sName = 'ktcore.actions.document.ownershipchange'; |
| 1486 | - var $_sShowPermission = "ktcore.permissions.security"; | |
| 1486 | + var $_sShowPermission = 'ktcore.permissions.security'; | |
| 1487 | 1487 | |
| 1488 | 1488 | function getDisplayName() { |
| 1489 | 1489 | return _kt('Change Document Ownership'); |
| ... | ... | @@ -1492,7 +1492,7 @@ class KTOwnershipChangeAction extends KTDocumentAction { |
| 1492 | 1492 | function form_owner() { |
| 1493 | 1493 | $oForm = new KTForm; |
| 1494 | 1494 | $oForm->setOptions(array( |
| 1495 | - 'label' => _kt("Change Document Ownership"), | |
| 1495 | + 'label' => _kt('Change Document Ownership'), | |
| 1496 | 1496 | 'description' => _kt('Changing document ownership allows you to keep the "owner" role relevant, even when the original user no longer is an appropriate choice.'), |
| 1497 | 1497 | 'action' => 'reown', |
| 1498 | 1498 | 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument), |
| ... | ... | @@ -1502,8 +1502,8 @@ class KTOwnershipChangeAction extends KTDocumentAction { |
| 1502 | 1502 | )); |
| 1503 | 1503 | $oForm->setWidgets(array( |
| 1504 | 1504 | array('ktcore.widgets.entityselection', array( |
| 1505 | - 'label' => _kt("New Owner"), | |
| 1506 | - 'description' => _kt("The owner of a document is usually the person with ultimate responsibility for its contents. It is initially set to the person who created the document, but can be changed to any other user."), | |
| 1505 | + 'label' => _kt('New Owner'), | |
| 1506 | + 'description' => _kt('The owner of a document is usually the person with ultimate responsibility for its contents. It is initially set to the person who created the document, but can be changed to any other user.'), | |
| 1507 | 1507 | 'important_description' => _kt('Please note that changing the owner may affect access to this document.'), |
| 1508 | 1508 | 'label_method' => 'getName', |
| 1509 | 1509 | 'vocab' => User::getList('id > 0'), |
| ... | ... | @@ -1523,8 +1523,8 @@ class KTOwnershipChangeAction extends KTDocumentAction { |
| 1523 | 1523 | } |
| 1524 | 1524 | |
| 1525 | 1525 | function do_main() { |
| 1526 | - $this->oPage->setBreadcrumbDetails(_kt("Changing Ownership")); | |
| 1527 | - $oTemplate =& $this->oValidator->validateTemplate("ktcore/document/ownershipchangeaction"); | |
| 1526 | + $this->oPage->setBreadcrumbDetails(_kt('Changing Ownership')); | |
| 1527 | + $oTemplate =& $this->oValidator->validateTemplate('ktcore/document/ownershipchangeaction'); | |
| 1528 | 1528 | |
| 1529 | 1529 | $change_form = $this->form_owner(); |
| 1530 | 1530 | |
| ... | ... | @@ -1553,16 +1553,16 @@ class KTOwnershipChangeAction extends KTDocumentAction { |
| 1553 | 1553 | $this->oDocument->setOwnerID($oUser->getId()); |
| 1554 | 1554 | $res = $this->oDocument->update(); |
| 1555 | 1555 | if (PEAR::isError($res)) { |
| 1556 | - $this->errorRedirectToMain(sprintf(_kt("Failed to update document: %s"), $res->getMessage()), sprintf('fDocumentId=%d', $this->oDocument->getId())); | |
| 1556 | + $this->errorRedirectToMain(sprintf(_kt('Failed to update document: %s'), $res->getMessage()), sprintf('fDocumentId=%d', $this->oDocument->getId())); | |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | 1559 | $res = KTPermissionUtil::updatePermissionLookup($this->oDocument); |
| 1560 | 1560 | |
| 1561 | 1561 | if (PEAR::isError($res)) { |
| 1562 | - $this->errorRedirectToMain(sprintf(_kt("Failed to update document: %s"), $res->getMessage()), sprintf('fDocumentId=%d', $this->oDocument->getId())); | |
| 1562 | + $this->errorRedirectToMain(sprintf(_kt('Failed to update document: %s'), $res->getMessage()), sprintf('fDocumentId=%d', $this->oDocument->getId())); | |
| 1563 | 1563 | } |
| 1564 | 1564 | |
| 1565 | - $this->successRedirectToMain(_kt("Ownership changed."), sprintf('fDocumentId=%d', $this->oDocument->getId())); | |
| 1565 | + $this->successRedirectToMain(_kt('Ownership changed.'), sprintf('fDocumentId=%d', $this->oDocument->getId())); | |
| 1566 | 1566 | } |
| 1567 | 1567 | } |
| 1568 | 1568 | ... | ... |