Commit eec4f9a677ed9c4ccc5ddf04e966b0c65b02e733

Authored by kevin_fourie
1 parent 7c2c0102

Merged in...

KTS-3818
"Folder copy doesn't create a transaction in the log"
Fixed. Added the create transaction code.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.4-Release-Branch@9562 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/foldermanagement/folderutil.inc.php
... ... @@ -608,6 +608,19 @@ class KTFolderUtil {
608 608 }
609 609 }
610 610  
  611 + $sComment = sprintf(_kt("Folder copied from %s to %s"), $oSrcFolder->getFullPath(), $oDestFolder->getFullPath());
  612 + if($sReason !== null) {
  613 + $sComment .= sprintf(_kt(" (reason: %s)"), $sReason);
  614 + }
  615 +
  616 + $oTransaction = KTFolderTransaction::createFromArray(array(
  617 + 'folderid' => $oFolder->getId(),
  618 + 'comment' => $sComment,
  619 + 'transactionNS' => 'ktcore.transactions.copy',
  620 + 'userid' => $oUser->getId(),
  621 + 'ip' => Session::getClientIP(),
  622 + ));
  623 +
611 624 // If the folder inherits its permissions then we set it to inherit from the new parent folder and update permissions
612 625 // If it defines its own then copy the permission object over
613 626 if($bInheritPermissions){
... ...