Commit c4ec5ebd9cb1b67d80cf59edc0f1c8d1f0df33c3
1 parent
7fe08f3b
Merged in...
KTC-627 "The Custom Document No is lost after a Document Filename has been renamed" Fixed. Added triggers to document rename. 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@9533 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
15 additions
and
0 deletions
lib/documentmanagement/documentutil.inc.php
| ... | ... | @@ -1249,6 +1249,21 @@ $sourceDocument->getName(), |
| 1249 | 1249 | $oDocumentTransaction = new DocumentTransaction($oDocument, _kt('Document renamed'), 'ktcore.transactions.update'); |
| 1250 | 1250 | $oDocumentTransaction->create(); |
| 1251 | 1251 | |
| 1252 | + $oKTTriggerRegistry = KTTriggerRegistry::getSingleton(); | |
| 1253 | + $aTriggers = $oKTTriggerRegistry->getTriggers('renameDocument', 'postValidate'); | |
| 1254 | + foreach ($aTriggers as $aTrigger) { | |
| 1255 | + $sTrigger = $aTrigger[0]; | |
| 1256 | + $oTrigger = new $sTrigger; | |
| 1257 | + $aInfo = array( | |
| 1258 | + 'document' => $oDocument | |
| 1259 | + ); | |
| 1260 | + $oTrigger->setInfo($aInfo); | |
| 1261 | + $ret = $oTrigger->postValidate(); | |
| 1262 | + if (PEAR::isError($ret)) { | |
| 1263 | + return $ret; | |
| 1264 | + } | |
| 1265 | + } | |
| 1266 | + | |
| 1252 | 1267 | // fire subscription alerts for the checked in document |
| 1253 | 1268 | $oSubscriptionEvent = new SubscriptionEvent(); |
| 1254 | 1269 | $oFolder = Folder::get($oDocument->getFolderID()); | ... | ... |