Browse Source

Minor - format code.

jmontoyaa 7 years ago
parent
commit
f641619280

+ 12 - 7
main/inc/lib/extra_field.lib.php

@@ -539,7 +539,11 @@ class ExtraField extends Model
                 );
 
                 if ($field['field_type'] == self::FIELD_TYPE_TAG) {
-                    $tags = UserManager::get_user_tags_to_string($itemId, $field['id'], false);
+                    $tags = UserManager::get_user_tags_to_string(
+                        $itemId,
+                        $field['id'],
+                        false
+                    );
                     $extra_data['extra_'.$field['variable']] = $tags;
 
                     continue;
@@ -549,7 +553,11 @@ class ExtraField extends Model
                     $field_value = $field_value['value'];
                     switch ($field['field_type']) {
                         case self::FIELD_TYPE_TAG:
-                            $tags = UserManager::get_user_tags_to_string($itemId, $field['id'], false);
+                            $tags = UserManager::get_user_tags_to_string(
+                                $itemId,
+                                $field['id'],
+                                false
+                            );
 
                             $extra_data['extra_'.$field['variable']] = $tags;
                             break;
@@ -1077,7 +1085,6 @@ class ExtraField extends Model
                             if (isset($optionList[$defaultValueId]) &&
                                 isset($optionList[$defaultValueId]['priority'])
                             ) {
-
                                 if (!empty($optionList[$defaultValueId]['priority'])) {
                                     $priorityId = $optionList[$defaultValueId]['priority'];
                                     $option = new ExtraFieldOption($this->type);
@@ -1303,7 +1310,6 @@ class ExtraField extends Model
                         $tagsSelect->setMultiple(true);
 
                         $selectedOptions = [];
-
                         if ($this->type === 'user') {
                             // The magic should be here
                             $user_tags = UserManager::get_user_tags($itemId, $field_details['id']);
@@ -1314,7 +1320,6 @@ class ExtraField extends Model
                                         $tag['tag'],
                                         $tag['tag']
                                     );
-
                                     $selectedOptions[] = $tag['tag'];
                                 }
                             }
@@ -2316,8 +2321,8 @@ JAVASCRIPT;
                         'op' => 'cn',
                     );
 
-                    //Second
-                    $search_options['value']    = $field['id'].':';
+                    // Second
+                    $search_options['value'] = $field['id'].':';
                     $search_options['dataInit'] = 'register_second_select';
 
                     $column_model[] = array(

+ 4 - 3
main/inc/lib/extra_field_option.lib.php

@@ -1,6 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 
+use Chamilo\CoreBundle\Entity\ExtraFieldOptions;
+
 /**
  * Class ExtraFieldOption
  * Handles the extra fields for various objects (users, sessions, courses)
@@ -31,7 +33,6 @@ class ExtraFieldOption extends Model
         $this->type = $type;
         $extraField = new ExtraField($this->type);
         $this->extraField = $extraField;
-
         $this->table = Database::get_main_table(TABLE_EXTRA_FIELD_OPTIONS);
         $this->tableExtraField = Database::get_main_table(TABLE_EXTRA_FIELD);
     }
@@ -44,7 +45,6 @@ class ExtraFieldOption extends Model
         return $this->extraField;
     }
 
-
     /**
      * Gets the number of options already available in the table for this item type
      * @return int Number of options available
@@ -453,6 +453,7 @@ class ExtraFieldOption extends Model
         }
 
         $options = [];
+        /** @var ExtraFieldOptions $row */
         foreach ($result as $row) {
             $option = [
                 'id' => $row->getId(),
@@ -494,7 +495,7 @@ class ExtraFieldOption extends Model
             ->findSecondaryOptions($option);
 
         $optionsInfo = [];
-
+        /** @var ExtraFieldOptions $subOption */
         foreach ($subOptions as $subOption) {
             $optionsInfo[] = [
                 'id' => $subOption->getId(),

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

@@ -111,6 +111,7 @@ class ExtraFieldValue extends Model
             }
 
             $field_variable = $fieldDetails['variable'];
+
             if (isset($params['extra_'.$field_variable])) {
                 $value = $params['extra_'.$field_variable];
             } else {
@@ -310,7 +311,6 @@ class ExtraFieldValue extends Model
                         'value' => $value,
                         'comment' => $comment
                     );
-
                     self::save($newParams, $showQuery);
             }
         }

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

@@ -4465,7 +4465,6 @@ class SessionManager
             $error_message = get_lang('NotCSV');
         } else {
             $tag_names = array();
-
             foreach ($content as $key => $enreg) {
                 $enreg = explode(';', trim($enreg));
                 if ($key) {
@@ -4659,7 +4658,6 @@ class SessionManager
                     }
 
                     if ($my_session_result === false) {
-
                         // Creating a session.
                         $sql = "INSERT IGNORE INTO $tbl_session SET
                                 name = '$session_name',