Просмотр исходного кода

#1904 Classes module: classes status (completed or not)

Alex Trofimov 6 лет назад
Родитель
Сommit
32236da0ea

+ 9 - 0
modules/boonex/classes/classes/BxClssAlertsResponse.php

@@ -16,6 +16,15 @@ class BxClssAlertsResponse extends BxBaseModTextAlertsResponse
         $this->MODULE = 'bx_classes';
         parent::__construct();
     }
+
+    public function response($oAlert)
+    {
+        $CNF = $this->_oModule->_oConfig->CNF;
+
+        if ('bx_classes' == $oAlert->sUnit && 'commentPost' == $oAlert->sAction) {
+            $this->_oModule->_oDb->updateClassStatus($oAlert->iObject, $oAlert->iSender, 'replied');
+        }
+    }
 }
 
 /** @} */

+ 1 - 1
modules/boonex/classes/classes/BxClssDb.php

@@ -96,7 +96,7 @@ class BxClssDb extends BxBaseModTextDb
             'class' => $iClassId,
             'student' => $iStudentProfileId,
         ))) {
-            return $this->res("UPDATE `bx_classes_statuses` SET `$sStatus` = :ts WHERE `class_id` = :class AND `student_profile_id` = :student", array(
+            return $this->query("UPDATE `bx_classes_statuses` SET `$sStatus` = :ts WHERE `class_id` = :class AND `student_profile_id` = :student", array(
                 'ts' => time(),
                 'class' => $iClassId,
                 'student' => $iStudentProfileId,

+ 2 - 0
modules/boonex/classes/install/sql/enable.sql

@@ -365,6 +365,8 @@ INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 ('system', 'save_setting', @iHandler),
 ('profile', 'delete', @iHandler),
 
+('bx_classes', 'commentPost', @iHandler),
+
 ('bx_classes_videos_mp4', 'transcoded', @iHandler);