_oTriggerState = null; // initialise to initial state $this->sFriendlyName = _kt('Base class for workflow triggers'); $this->sDescription = _kt('This is an abstract base class for the overall workflow trigger. It should never actually be available for installation.'); } function loadConfig($oTriggerInstance) { $this->oTriggerInstance = $oTriggerInstance; } function isLoaded() { return (!is_null($this->oTriggerInstance)); } // simple function to inform the UI/registration what kind of event this is function getInfo() { return array( 'guard' => $this->bIsGuard, 'action' => $this->bIsAction, 'name' => $this->sFriendlyName, 'description' => $this->sDescription, ); } // return true for transition allowed on doc, false for transition not allowed on doc. function allowTransition($oDocument, $oUser) { return true; // abstract base class } // perform more expensive checks -before- performTransition. function precheckTrigger($oDocument, $oUser) { return true; } /* Multiple triggers can occur on a given transition. If this trigger fails, return a PEAR::error (the overall system -will- roll the db back - no need to do it yourself) with a -useful- human error message. Any other return is simply discarded. */ function performTransition($oDocument, $oUser) { return true; } } ?>