Browse Source

Minor - flint fixes

Julio Montoya 6 years ago
parent
commit
de2678cd19

+ 0 - 3
main/admin/course_category.php

@@ -41,7 +41,6 @@ if (!empty($action)) {
 
             $errorMsg = Display::return_message(get_lang('Created'));
         } else {
-
             $ret = CourseCategory::editNode(
                 $_POST['code'],
                 $_POST['name'],
@@ -170,8 +169,6 @@ if ($action == 'add' || $action == 'edit') {
         $text = get_lang('Save');
         $form->setDefaults($categoryInfo);
         $form->addButtonSave($text);
-
-
     } else {
         $class = "add";
         $text = get_lang('AddCategory');

+ 4 - 5
main/inc/ajax/message.ajax.php

@@ -18,9 +18,9 @@ switch ($action) {
         $listInvitations = [];
         $temp = [];
         if (api_get_setting('allow_social_tool') == 'true') {
-            $list = SocialManager::get_list_invitation_of_friends_by_user_id($userId,3);
+            $list = SocialManager::get_list_invitation_of_friends_by_user_id($userId, 3);
 
-            foreach ($list as $row){
+            foreach ($list as $row) {
                 $user = api_get_user_info($row['user_sender_id']);
                 $temp['title'] = $row['title'];
                 $temp['content'] = $row['content'];
@@ -29,7 +29,7 @@ switch ($action) {
                 $temp['fullname'] = $user['complete_name'];
                 $temp['email'] = $user['email'];
                 $temp['avatar'] = $user['avatar_small'];
-                $listInvitations[]=$temp;
+                $listInvitations[] = $temp;
             }
         }
         header("Content-type:application/json");
@@ -65,9 +65,8 @@ switch ($action) {
             $invitations = [
                 'ms_friends' => intval($number_of_new_messages_of_friend),
                 'ms_groups' => $group_pending_invitations,
-                'ms_inbox' => intval($count_unread_message)
+                'ms_inbox' => intval($count_unread_message),
             ];
-
         }
         header("Content-type:application/json");
         echo json_encode($invitations);

+ 5 - 5
main/inc/lib/course_category.lib.php

@@ -1014,18 +1014,18 @@ class CourseCategory
         return true;
     }
 
-
     /**
-     * Deletes the image on disk and in the database
+     * Deletes the image on disk and in the database.
+     *
      * @param $categoryId
+     *
      * @return bool Always returns true
      */
     public static function deletePictureCategory($categoryId)
     {
-
         $dirName = 'course_category/';
-        $fileImage = $dirName . 'cc_' . $categoryId . '.jpg';
-        $fileDir = api_get_path(SYS_UPLOAD_PATH) . $fileImage;
+        $fileImage = $dirName.'cc_'.$categoryId.'.jpg';
+        $fileDir = api_get_path(SYS_UPLOAD_PATH).$fileImage;
         if (file_exists($fileDir)) {
             try {
                 unlink($fileDir);

+ 1 - 1
main/inc/lib/social.lib.php

@@ -416,7 +416,7 @@ class SocialManager extends UserManager
                 WHERE
                     user_receiver_id = '.$userId.' AND
                     msg_status = '.MESSAGE_STATUS_INVITATION_PENDING;
-        if($limit){
+        if ($limit) {
             $sql .= ' LIMIT '.$limit;
         }
         $res = Database::query($sql);

+ 2 - 0
main/inc/lib/template.lib.php

@@ -1710,7 +1710,9 @@ class Template
 
     /**
      * Get platform meta image tag (check meta_image_path setting, then use the logo).
+     *
      * @param string $imageAlt The alt attribute for the image
+     *
      * @return string The meta image HTML tag, or empty
      */
     private function getMetaPortalImagePath($imageAlt = '')

+ 1 - 2
main/survey/survey.lib.php

@@ -339,7 +339,6 @@ class SurveyManager
                 }
             }
 
-
             $from = api_get_utc_datetime($values['start_date'].'00:00:00', true, true);
             $until = api_get_utc_datetime($values['end_date'].'23:59:59', true, true);
             if ($allowSurveyAvailabilityDatetime) {
@@ -815,7 +814,7 @@ class SurveyManager
      * This function duplicates a survey (and also all the question in that survey.
      *
      * @param int $surveyId id of the survey that has to be duplicated
-     * @param int $courseId  id of the course which survey has to be duplicated
+     * @param int $courseId id of the course which survey has to be duplicated
      *
      * @return true
      *

+ 8 - 9
main/survey/surveyUtil.class.php

@@ -2295,7 +2295,6 @@ class SurveyUtil
             $params['answered'] = $params['answered'] ?? 0;
             $params['group_id'] = $params['group_id'] ?? 0;
 
-
             $insertId = Database::insert($table, $params);
             if ($insertId) {
                 $sql = "UPDATE $table 
@@ -2866,16 +2865,16 @@ class SurveyUtil
                 Display::return_icon('preview_view.png', get_lang('Preview')),
                 $codePath.'survey/preview.php?'.http_build_query($params + ['survey_id' => $survey_id])
             );
-            }
+        }
 
-            $actions[] = Display::url(
+        $actions[] = Display::url(
                 Display::return_icon('mail_send.png', get_lang('Publish')),
                 $codePath.'survey/survey_invite.php?'.http_build_query($params + ['survey_id' => $survey_id])
             );
 
-            if ($type != 3) {
-                $actions[] = $hideReportingButton ? null : $reportingLink;
-            }
+        if ($type != 3) {
+            $actions[] = $hideReportingButton ? null : $reportingLink;
+        }
 
         if (api_is_allowed_to_edit() ||
             api_is_element_in_the_session(TOOL_SURVEY, $survey_id)
@@ -3105,12 +3104,12 @@ class SurveyUtil
                         $survey[1],
                         api_get_path(WEB_CODE_PATH).'survey/meeting.php?survey_id='.$survey[0].'&'.api_get_cidreq()
                     );
-            } else {
-                $array[1] = Display::url(
+                } else {
+                    $array[1] = Display::url(
                     $survey[1],
                     api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey[0].'&'.api_get_cidreq()
                 );
-            }
+                }
             }
 
             // Validation when belonging to a session

+ 0 - 1
src/CoreBundle/Entity/SharedSurvey.php

@@ -275,7 +275,6 @@ class SharedSurvey
     }
 
     /**
-     *
      * @return string
      */
     public function getSurveyThanks()

+ 0 - 1
src/CoreBundle/Migrations/Schema/V200/Version20.php

@@ -774,7 +774,6 @@ class Version20 extends AbstractMigrationChamilo
 
         $this->addSql('ALTER TABLE c_lp CHANGE author author LONGTEXT NOT NULL');
 
-
         // Drop unused columns
         $dropColumnsAndIndex = [
             'track_e_uploads' => ['columns' => ['upload_cours_id'], 'index' => ['upload_cours_id']],

+ 0 - 1
src/CourseBundle/Entity/CSurveyQuestionOption.php

@@ -79,7 +79,6 @@ class CSurveyQuestionOption
 
     /**
      * CSurveyQuestionOption constructor.
-     *
      */
     public function __construct()
     {