diff --git a/library/App/Model/ApprovalActionInterface.php b/library/App/Model/ApprovalActionInterface.php index da3a2f144d4bd16df9805985d2939082fc718237..6b49d295dce6d51af7957b43639b1141d7b1f3b3 100644 --- a/library/App/Model/ApprovalActionInterface.php +++ b/library/App/Model/ApprovalActionInterface.php @@ -1,5 +1,12 @@ <?php +/** + * Provides an interface for creating additional Approval Action types. + * An approval action represents a point at which some entity may potentially + * modify a request and then make a decision about the request (by modifying + * its status). A Model implementing this interface will be a child of Unl_Model. + */ + interface App_Model_ApprovalActionInterface { /** diff --git a/library/App/RequestNotification.php b/library/App/RequestNotification.php index f3fdb4bdb00b356beeaf624683c9ab19c3ce6715..1702ac3a245b354b23a14b17675f7a16636a0cac 100644 --- a/library/App/RequestNotification.php +++ b/library/App/RequestNotification.php @@ -1,9 +1,24 @@ <?php +/** + * This class handles the generation and scheduling of email notifications + * that alert users of requests that are pending their decisions. + */ + class App_RequestNotification { + /** + * Stores the list of notifications once it has been generated to avoid + * needlessly reproccessing it. + * + * @var array + */ static protected $_notifications; + /** + * Does the work of processing which users have pending requests and populates + * $_notifications with the list. + */ static protected function _loadNotifications() { if (Unl_Util::isArray(self::$_notifications)) { @@ -81,6 +96,10 @@ class App_RequestNotification } } + /** + * Prints out a simple list of the notifications in plain text. + * Mainly useful when debugging. + */ public static function listNotifications() { self::_loadNotifications(); @@ -93,6 +112,9 @@ class App_RequestNotification } } + /** + * Sends out an email to each user who has pending requests. + */ public static function sendNotifications() { self::_loadNotifications(); @@ -150,6 +172,10 @@ EOF } } + /** + * Sends out email notifications, then schedules itself to be called again in two days. + * This should really only be called by a cron job. + */ public static function scheduledNotifications() { self::sendNotifications();