Commit f7d46754e458081975369abbfdee0a67a7f255d3

Authored by kevin_fourie
1 parent 239bd3a1

Merged rev 6274 from root trunk to STABLE

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@6275 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktcore/KTWorkflowTriggers.inc.php
... ... @@ -24,12 +24,12 @@
24 24 *
25 25 */
26 26  
27   -require_once(KT_LIB_DIR . "/workflow/workflowtrigger.inc.php");
  27 +require_once(KT_LIB_DIR . '/workflow/workflowtrigger.inc.php');
28 28  
29   -require_once(KT_LIB_DIR . "/permissions/permission.inc.php");
30   -require_once(KT_LIB_DIR . "/permissions/permissionutil.inc.php");
  29 +require_once(KT_LIB_DIR . '/permissions/permission.inc.php');
  30 +require_once(KT_LIB_DIR . '/permissions/permissionutil.inc.php');
31 31  
32   -require_once(KT_LIB_DIR . "/groups/GroupUtil.php");
  32 +require_once(KT_LIB_DIR . '/groups/GroupUtil.php');
33 33  
34 34 class PermissionGuardTrigger extends KTWorkflowTrigger {
35 35 var $sNamespace = 'ktcore.workflowtriggers.permissionguard';
... ... @@ -43,8 +43,8 @@ class PermissionGuardTrigger extends KTWorkflowTrigger {
43 43 var $bIsAction = false;
44 44  
45 45 function PermissionGuardTrigger() {
46   - $this->sFriendlyName = _kt("Permission Restrictions");
47   - $this->sDescription = _kt("Prevents users who do not have the specified permission from using this transition.");
  46 + $this->sFriendlyName = _kt('Permission Restrictions');
  47 + $this->sDescription = _kt('Prevents users who do not have the specified permission from using this transition.');
48 48 }
49 49  
50 50 // override the allow transition hook.
... ... @@ -79,10 +79,10 @@ class PermissionGuardTrigger extends KTWorkflowTrigger {
79 79 }
80 80  
81 81 $oTemplating =& KTTemplating::getSingleton();
82   - $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/permissions");
  82 + $oTemplate = $oTemplating->loadTemplate('ktcore/workflowtriggers/permissions');
83 83 $aTemplateData = array(
84   - "context" => $this,
85   - "perms" => $aKeyPermissions,
  84 + 'context' => $this,
  85 + 'perms' => $aKeyPermissions,
86 86 'current_perms' => $current_perms,
87 87 'args' => $args,
88 88 );
... ... @@ -148,8 +148,8 @@ class RoleGuardTrigger extends KTWorkflowTrigger {
148 148 var $bIsAction = false;
149 149  
150 150 function RoleGuardTrigger() {
151   - $this->sFriendlyName = _kt("Role Restrictions");
152   - $this->sDescription = _kt("Prevents users who do not have the specified role from using this transition.");
  151 + $this->sFriendlyName = _kt('Role Restrictions');
  152 + $this->sDescription = _kt('Prevents users who do not have the specified role from using this transition.');
153 153 }
154 154  
155 155 // override the allow transition hook.
... ... @@ -199,11 +199,11 @@ class RoleGuardTrigger extends KTWorkflowTrigger {
199 199 foreach ($aRoles as $oRole) { $aKeyedRoles[$oRole->getId()] = $oRole->getName(); }
200 200  
201 201 $oTemplating =& KTTemplating::getSingleton();
202   - $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/roles");
  202 + $oTemplate = $oTemplating->loadTemplate('ktcore/workflowtriggers/roles');
203 203 $aTemplateData = array(
204   - "context" => $this,
205   - "roles" => $aKeyedRoles,
206   - "current_role" => KTUtil::arrayGet($this->aConfig, 'role_id'),
  204 + 'context' => $this,
  205 + 'roles' => $aKeyedRoles,
  206 + 'current_role' => KTUtil::arrayGet($this->aConfig, 'role_id'),
207 207 'args' => $args,
208 208 );
209 209 return $oTemplate->render($aTemplateData);
... ... @@ -240,7 +240,7 @@ class RoleGuardTrigger extends KTWorkflowTrigger {
240 240 if (PEAR::isError($oRole)) {
241 241 return _kt('The role required for this trigger has been deleted, so anyone can perform this action.');
242 242 } else {
243   - return sprintf(_kt("The user will require the <strong>%s</strong> role."), htmlentities($oRole->getName(), ENT_NOQUOTES, 'UTF-8'));
  243 + return sprintf(_kt('The user will require the <strong>%s</strong> role.'), htmlentities($oRole->getName(), ENT_NOQUOTES, 'UTF-8'));
244 244 }
245 245 }
246 246 }
... ... @@ -258,8 +258,8 @@ class GroupGuardTrigger extends KTWorkflowTrigger {
258 258 var $bIsAction = false;
259 259  
260 260 function GroupGuardTrigger() {
261   - $this->sFriendlyName = _kt("Group Restrictions");
262   - $this->sDescription = _kt("Prevents users who are not members of the specified group from using this transition.");
  261 + $this->sFriendlyName = _kt('Group Restrictions');
  262 + $this->sDescription = _kt('Prevents users who are not members of the specified group from using this transition.');
263 263 }
264 264  
265 265 // override the allow transition hook.
... ... @@ -288,11 +288,11 @@ class GroupGuardTrigger extends KTWorkflowTrigger {
288 288 foreach ($aGroups as $oGroup) { $aKeyedGroups[$oGroup->getId()] = $oGroup->getName(); }
289 289  
290 290 $oTemplating =& KTTemplating::getSingleton();
291   - $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/group");
  291 + $oTemplate = $oTemplating->loadTemplate('ktcore/workflowtriggers/group');
292 292 $aTemplateData = array(
293   - "context" => $this,
294   - "groups" => $aKeyedGroups,
295   - "current_group" => KTUtil::arrayGet($this->aConfig, 'group_id'),
  293 + 'context' => $this,
  294 + 'groups' => $aKeyedGroups,
  295 + 'current_group' => KTUtil::arrayGet($this->aConfig, 'group_id'),
296 296 'args' => $args,
297 297 );
298 298 return $oTemplate->render($aTemplateData);
... ... @@ -329,7 +329,7 @@ class GroupGuardTrigger extends KTWorkflowTrigger {
329 329 if (PEAR::isError($oGroup)) {
330 330 return _kt('The group required for this trigger has been deleted, so anyone can perform this action.');
331 331 } else {
332   - return sprintf(_kt("The user must be a member of the group \"<strong>%s</strong>\"."), htmlentities($oGroup->getName(), ENT_NOQUOTES, 'UTF-8'));
  332 + return sprintf(_kt('The user must be a member of the group "<strong>%s</strong>".'), htmlentities($oGroup->getName(), ENT_NOQUOTES, 'UTF-8'));
333 333 }
334 334 }
335 335 }
... ... @@ -347,8 +347,8 @@ class ConditionGuardTrigger extends KTWorkflowTrigger {
347 347 var $bIsAction = false;
348 348  
349 349 function ConditionGuardTrigger() {
350   - $this->sFriendlyName = _kt("Conditional Restrictions");
351   - $this->sDescription = _kt("Prevents this transition from occuring if the condition specified is not met for the document.");
  350 + $this->sFriendlyName = _kt('Conditional Restrictions');
  351 + $this->sDescription = _kt('Prevents this transition from occuring if the condition specified is not met for the document.');
352 352 }
353 353  
354 354 // override the allow transition hook.
... ... @@ -372,11 +372,11 @@ class ConditionGuardTrigger extends KTWorkflowTrigger {
372 372 foreach ($aConditions as $oCondition) { $aKeyedConditions[$oCondition->getId()] = $oCondition->getName(); }
373 373  
374 374 $oTemplating =& KTTemplating::getSingleton();
375   - $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/condition");
  375 + $oTemplate = $oTemplating->loadTemplate('ktcore/workflowtriggers/condition');
376 376 $aTemplateData = array(
377   - "context" => $this,
378   - "conditions" => $aKeyedConditions,
379   - "current_condition" => KTUtil::arrayGet($this->aConfig, 'condition_id'),
  377 + 'context' => $this,
  378 + 'conditions' => $aKeyedConditions,
  379 + 'current_condition' => KTUtil::arrayGet($this->aConfig, 'condition_id'),
380 380 'args' => $args,
381 381 );
382 382 return $oTemplate->render($aTemplateData);
... ... @@ -413,7 +413,7 @@ class ConditionGuardTrigger extends KTWorkflowTrigger {
413 413 if (PEAR::isError($oCondition)) {
414 414 return _kt('The condition required for this trigger has been deleted, so it is always available.');
415 415 } else {
416   - return sprintf(_kt("The document must match condition \"<strong>%s</strong>\"."), htmlentities($oCondition->getName(), ENT_NOQUOTES, 'UTF-8'));
  416 + return sprintf(_kt('The document must match condition "<strong>%s</strong>".'), htmlentities($oCondition->getName(), ENT_NOQUOTES, 'UTF-8'));
417 417 }
418 418 }
419 419 }
... ... @@ -431,8 +431,8 @@ class CopyActionTrigger extends KTWorkflowTrigger {
431 431 var $bIsAction = true;
432 432  
433 433 function CopyActionTrigger() {
434   - $this->sFriendlyName = _kt("Moves Document");
435   - $this->sDescription = _kt("Moves the document to another folder.");
  434 + $this->sFriendlyName = _kt('Moves Document');
  435 + $this->sDescription = _kt('Moves the document to another folder.');
436 436 }
437 437  
438 438 // perform more expensive checks -before- performTransition.
... ... @@ -459,10 +459,10 @@ class CopyActionTrigger extends KTWorkflowTrigger {
459 459  
460 460 function displayConfiguration($args) {
461 461 $oTemplating =& KTTemplating::getSingleton();
462   - $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/moveaction");
  462 + $oTemplate = $oTemplating->loadTemplate('ktcore/workflowtriggers/moveaction');
463 463  
464   - require_once(KT_LIB_DIR . "/browse/DocumentCollection.inc.php");
465   - require_once(KT_LIB_DIR . "/browse/columnregistry.inc.php");
  464 + require_once(KT_LIB_DIR . '/browse/DocumentCollection.inc.php');
  465 + require_once(KT_LIB_DIR . '/browse/columnregistry.inc.php');
466 466  
467 467 $collection = new AdvancedCollection;
468 468 $oColumnRegistry = KTColumnRegistry::getSingleton();
... ... @@ -478,7 +478,7 @@ class CopyActionTrigger extends KTWorkflowTrigger {
478 478 $qsFrag = array();
479 479 foreach ($args as $k => $v) {
480 480 if ($k == 'action') { $v = 'editactiontrigger'; } // horrible hack - we really need iframe embedding.
481   - $qsFrag[] = sprintf("%s=%s",urlencode($k), urlencode($v));
  481 + $qsFrag[] = sprintf('%s=%s',urlencode($k), urlencode($v));
482 482 }
483 483 $qs = implode('&',$qsFrag);
484 484 $aOptions['result_url'] = KTUtil::addQueryStringSelf($qs);
... ... @@ -515,13 +515,13 @@ class CopyActionTrigger extends KTWorkflowTrigger {
515 515 $qsFrag2[] = sprintf('fFolderId=%d', $id);
516 516 $qs2 = implode('&',$qsFrag2);
517 517 $url = KTUtil::addQueryStringSelf($qs2);
518   - $aBreadcrumbs[] = sprintf("<a href=\"%s\">%s</a>", $url, htmlentities($folder_path_names[$index], ENT_NOQUOTES, 'UTF-8'));
  518 + $aBreadcrumbs[] = sprintf('<a href="%s">%s</a>', $url, htmlentities($folder_path_names[$index], ENT_NOQUOTES, 'UTF-8'));
519 519 }
520 520  
521 521 $sBreadcrumbs = implode(' &raquo; ', $aBreadcrumbs);
522 522  
523 523 $aTemplateData = array(
524   - "context" => $this,
  524 + 'context' => $this,
525 525 'breadcrumbs' => $sBreadcrumbs,
526 526 'collection' => $collection,
527 527 'args' => $args,
... ... @@ -559,7 +559,7 @@ class CopyActionTrigger extends KTWorkflowTrigger {
559 559 if (PEAR::isError($oFolder)) {
560 560 return _kt('<strong>The folder required for this trigger has been deleted, so the transition cannot be performed.</strong>');
561 561 } else {
562   - return sprintf(_kt("The document will be moved to folder \"<a href=\"%s\">%s</a>\"."), KTBrowseUtil::getUrlForFolder($oFolder), htmlentities($oFolder->getName(), ENT_NOQUOTES, 'UTF-8'));
  562 + return sprintf(_kt('The document will be moved to folder "<a href="%s">%s</a>".'), KTBrowseUtil::getUrlForFolder($oFolder), htmlentities($oFolder->getName(), ENT_NOQUOTES, 'UTF-8'));
563 563 }
564 564 }
565 565 }
... ... @@ -579,8 +579,8 @@ class CheckoutGuardTrigger extends KTWorkflowTrigger {
579 579 var $bIsConfigurable = false;
580 580  
581 581 function CheckoutGuardTrigger() {
582   - $this->sFriendlyName = _kt("Checkout Guard");
583   - $this->sDescription = _kt("Prevents a transition from being followed if the document is checked out..");
  582 + $this->sFriendlyName = _kt('Checkout Guard');
  583 + $this->sDescription = _kt('Prevents a transition from being followed if the document is checked out..');
584 584 }
585 585  
586 586 // override the allow transition hook.
... ...