Merge branch 'MDL-68991-master' of git://github.com/rezaies/moodle
[moodle.git] / lib / classes / userfeedback.php
index 8128336..af2d7f8 100644 (file)
@@ -57,9 +57,9 @@ class core_userfeedback {
         $actions = [
             [
                 'title' => get_string('calltofeedback_give'),
-                'url' => '#',
+                'url' => static::make_link()->out(false),
                 'data' => [
-                        'action' => 'give',
+                    'action' => 'give',
                     'record' => 1,
                     'hide' => 1,
                 ],
@@ -103,13 +103,13 @@ class core_userfeedback {
             $lastactiontime = max($give ?: 0, $remind ?: 0);
 
             switch ($CFG->userfeedback_nextreminder) {
-                case self::REMIND_AFTER_UPGRADE:
-                    $lastupgrade = self::last_major_upgrade_time();
+                case static::REMIND_AFTER_UPGRADE:
+                    $lastupgrade = static::last_major_upgrade_time();
                     if ($lastupgrade >= $lastactiontime) {
                         return $lastupgrade + ($CFG->userfeedback_remindafter * DAYSECS) < time();
                     }
                     break;
-                case self::REMIND_PERIODICALLY:
+                case static::REMIND_PERIODICALLY:
                     return $lastactiontime + ($CFG->userfeedback_remindafter * DAYSECS) < time();
                     break;
             }
@@ -153,7 +153,7 @@ class core_userfeedback {
     public static function can_give_feedback(): bool {
         global $CFG;
 
-        return $CFG->enableuserfeedback && isloggedin() && !isguestuser();
+        return !empty($CFG->enableuserfeedback) && isloggedin() && !isguestuser();
     }
 
     /**