示例#1
0
 /**
  * Remind approval table approvers
  *
  * @return Void
  */
 public function remindApprovers()
 {
     $dao = new Docman_ApprovalTableItemDao();
     $dar = $dao->getTablesForReminder();
     $tables = array();
     if ($dar && !$dar->isError()) {
         foreach ($dar as $row) {
             if ($row['item_id']) {
                 $table = new Docman_ApprovalTableItem();
             } else {
                 $table = new Docman_ApprovalTableFile();
             }
             $table->initFromRow($row);
             $distance = DateHelper::dateDiffInDays($table->getDate(), $_SERVER['REQUEST_TIME']);
             if ($distance > 0 && DateHelper::isPeriodicallyDistant($distance, $table->getNotificationOccurence())) {
                 $this->sendNotificationToPendingApprovers($table);
             }
         }
     }
 }