diff --git a/extrafield.php b/extrafield.php index dcc5b06ce3..0f5b0c1948 100644 --- a/extrafield.php +++ b/extrafield.php @@ -75,4 +75,4 @@ foreach ($variables as $variable => $data) { } $id = $extraField->save($params); //$extraField->delete($id); -} \ No newline at end of file +} diff --git a/load_search.php b/load_search.php index 5be8b20d1d..c3dac34951 100644 --- a/load_search.php +++ b/load_search.php @@ -329,7 +329,7 @@ $extra = $extraField->addElements( $fieldsToShow = [ 'heures_disponibilite_par_semaine', 'moment_de_disponibilite', - 'langue_cible' + 'langue_cible', ]; $extra = $extraFieldUser->addElements( @@ -387,9 +387,8 @@ $extra = $extraField->addElements( true ); - $fieldsToShow = [ - 'langue_cible' + 'langue_cible', ]; $extra = $extraFieldUser->addElements( @@ -659,7 +658,6 @@ if ($form->validate()) { 'item_id' => $userToLoad, 'extra_heures_disponibilite_par_semaine' => isset($userData['extra_heures_disponibilite_par_semaine']) ? $userData['extra_heures_disponibilite_par_semaine'] : '', 'extra_langue_cible' => isset($userData['extra_langue_cible']) ? $userData['extra_langue_cible'] : '', - ]; $extraFieldValue->saveFieldValues( $userDataToSave, @@ -929,7 +927,6 @@ if (!empty($filterToSend)) { $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_search=true&load_extra_field='.$extraFieldListToString.'&_force_search=true&rows=20&page=1&sidx=&sord=asc'; } - // Autowidth $extra_params['autowidth'] = 'true'; diff --git a/main/admin/skill_translate.php b/main/admin/skill_translate.php index 6beb4c9097..8b847774e2 100644 --- a/main/admin/skill_translate.php +++ b/main/admin/skill_translate.php @@ -2,7 +2,6 @@ /* For licensing terms, see /license.txt */ use Chamilo\CoreBundle\Component\Utils\ChamiloApi; -use Chamilo\CoreBundle\Entity\ExtraField; use Chamilo\CoreBundle\Entity\Language; use Chamilo\CoreBundle\Entity\Skill; diff --git a/main/admin/user_information.php b/main/admin/user_information.php index 86e3e18dd3..275f8dc778 100755 --- a/main/admin/user_information.php +++ b/main/admin/user_information.php @@ -526,11 +526,11 @@ if (isset($_GET['action'])) { api_get_path(WEB_PATH) ); MessageManager::send_message_simple($userId, $subject, $content); - Display::addFlash(Display::return_message(get_lang('Sent')));*/ + Display::addFlash(Display::return_message(get_lang('Sent')));*/ // ofaj LegalManager::sendLegal($userId); break; - case 'delete_legal': + case 'delete_legal': // ofaj LegalManager::deleteLegal($userId); /*$extraFieldValue = new ExtraFieldValue('user'); @@ -541,7 +541,7 @@ if (isset($_GET['action'])) { $result = $extraFieldValue->delete($value['id']); if ($result) { Display::addFlash(Display::return_message(get_lang('Deleted'))); - }*/ + }*/ break; case 'unsubscribe': $courseId = !empty($_GET['course_id']) ? (int) $_GET['course_id'] : 0; diff --git a/main/auth/inscription.php b/main/auth/inscription.php index bc4896d337..8f1f49398e 100755 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -22,7 +22,7 @@ $allowedFields = [ 'status', 'language', 'extra_fields', - 'address' + 'address', ]; $allowedFieldsConfiguration = api_get_configuration_value('allow_fields_inscription'); diff --git a/main/auth/sso/sso.Drupal.class.php b/main/auth/sso/sso.Drupal.class.php index 497b117fef..e396202837 100755 --- a/main/auth/sso/sso.Drupal.class.php +++ b/main/auth/sso/sso.Drupal.class.php @@ -91,7 +91,7 @@ class ssoDrupal /** * Validates the received active connection data with the database. * - * @return null|false Return the loginFailed variable value to local.inc.php + * @return false|null Return the loginFailed variable value to local.inc.php */ public function check_user() { diff --git a/main/auth/sso/sso.TCC.class.php b/main/auth/sso/sso.TCC.class.php index 192ff84b6d..ece338dc0c 100644 --- a/main/auth/sso/sso.TCC.class.php +++ b/main/auth/sso/sso.TCC.class.php @@ -89,7 +89,7 @@ class ssoTCC /** * Validates the received active connection data with the database. * - * @return null|false Return the loginFailed variable value to local.inc.php + * @return false|null Return the loginFailed variable value to local.inc.php */ public function check_user() { @@ -297,7 +297,7 @@ class ssoTCC // In all other cases, generate a link to the Drupal profile edition $drupalUserId = $drupalUserIdData['value']; $url = "{$this->protocol}{$this->domain}/user/{$drupalUserId}/edit"; - + return $url; */ return api_get_path(WEB_CODE_PATH).'auth/profile.php'; diff --git a/main/coursecopy/import_moodle.php b/main/coursecopy/import_moodle.php index 05b01abe85..7d2496abe0 100644 --- a/main/coursecopy/import_moodle.php +++ b/main/coursecopy/import_moodle.php @@ -39,7 +39,7 @@ if ($form->validate()) { $moodleImport = new MoodleImport(); try { - $responseImport = $moodleImport->import($file); + $responseImport = $moodleImport->import($file); Display::addFlash( Display::return_message( diff --git a/main/document/showinframes.php b/main/document/showinframes.php index 5b0d768778..d75ffee57c 100755 --- a/main/document/showinframes.php +++ b/main/document/showinframes.php @@ -244,7 +244,6 @@ if ($is_freemind_available) { $execute_iframe = false; } - $execute_iframe = true; if (!$playerSupported && $execute_iframe) { diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index 5560f24096..1676056830 100755 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -862,7 +862,7 @@ function removeMoreIfMailing($file_id) * @param array $file * @param Dropbox_SentWork $work * - * @return array|null|string + * @return array|string|null */ function store_add_dropbox($file = [], $work = null) { diff --git a/main/exercise/TestCategory.php b/main/exercise/TestCategory.php index fa138bcd42..731ff6fe2d 100644 --- a/main/exercise/TestCategory.php +++ b/main/exercise/TestCategory.php @@ -652,7 +652,7 @@ class TestCategory * @param int $questionId * @param int $in_display_category_name * - * @return null|string + * @return string|null */ public static function returnCategoryAndTitle($questionId, $in_display_category_name = 1) { diff --git a/main/exercise/hotspot_answers.as.php b/main/exercise/hotspot_answers.as.php index 41fb24958a..c0503bb78f 100755 --- a/main/exercise/hotspot_answers.as.php +++ b/main/exercise/hotspot_answers.as.php @@ -96,7 +96,7 @@ if ($objExercise->selectResultsDisabled() == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_S $showOnlyScore = true; $showResults = true; $lpId = isset($trackExerciseInfo['orig_lp_id']) ? $trackExerciseInfo['orig_lp_id'] : 0; - $lpItemId = isset($trackExerciseInfo['orig_lp_item_id']) ? $trackExerciseInfo['orig_lp_item_id'] : 0; + $lpItemId = isset($trackExerciseInfo['orig_lp_item_id']) ? $trackExerciseInfo['orig_lp_item_id'] : 0; if ($objExercise->attempts > 0) { $attempts = Event::getExerciseResultsByUser( api_get_user_id(), diff --git a/main/exercise/overview.php b/main/exercise/overview.php index 71398d18e2..07a006f685 100755 --- a/main/exercise/overview.php +++ b/main/exercise/overview.php @@ -76,12 +76,11 @@ if ($origin != 'learnpath') { } $tpl = new Template('Overview'); -$list = array(); +$list = []; $html = ''; $message = ''; - $isAllowedToEdit = api_is_allowed_to_edit(null, true); $list['id'] = $objExercise->id; $list['session_id'] = $objExercise->sessionId; @@ -316,7 +315,7 @@ if ($objExercise->selectAttempts()) { } if ($time_control) { - $tpl->assign('time_control',$objExercise->return_time_left_div()); + $tpl->assign('time_control', $objExercise->return_time_left_div()); } $tpl->assign('fluid', $fluid); @@ -329,4 +328,3 @@ $tpl->assign('table_result', $tableContent); $layout = $tpl->get_template('exercise/overview.tpl'); $tpl->assign('content', $tpl->fetch($layout)); $tpl->display_one_col_template(); - diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 61595dd8f7..17dd4144ca 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -5699,7 +5699,6 @@ function send_notifications($forum_id = 0, $thread_id = 0, $post_id = 0) $forumCourseId = api_get_configuration_value('global_forums_course_id'); if (!empty($forumCourseId)) { if ($_course['real_id'] == $forumCourseId) { - return false; } } @@ -6643,7 +6642,7 @@ function postIsEditableByStudent($forum, $post) } /** - * @param int $postId + * @param int $postId * * @return bool */ @@ -6692,7 +6691,7 @@ function getPostRevision($postId) ); $revision = ''; if ($value && isset($value['value'])) { - $revision = $value['value']; + $revision = $value['value']; } return $revision; @@ -6742,7 +6741,7 @@ function getAskRevisionButton($postId, $threadInfo) } /** - * @param int $postId + * @param int $postId * @param array $threadInfo * * @return string @@ -6769,6 +6768,7 @@ function giveRevisionButton($postId, $threadInfo) /** * @param int $postId * @param array $threadInfo + * * @return string */ function getReportButton($postId, $threadInfo) @@ -6832,7 +6832,6 @@ function getReportRecepients() case 'community_managers': $managers = api_get_configuration_value('community_managers_user_list'); if (!empty($managers) && isset($managers['users'])) { - $users = array_merge($users, $managers['users']); } break; diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php index a04c5e7d69..313a18cd6d 100755 --- a/main/forum/viewforum.php +++ b/main/forum/viewforum.php @@ -500,16 +500,16 @@ if (is_array($threads)) { ); } - if($_user['status']==5) { - if($_user['has_certificates']){ + if ($_user['status'] == 5) { + if ($_user['has_certificates']) { $iconStatus = ''; - }else{ + } else { $iconStatus = ''; } - }else if($_user['status'] == 1){ - if($isAdmin){ + } elseif ($_user['status'] == 1) { + if ($isAdmin) { $iconStatus = ''; - }else{ + } else { $iconStatus = ''; } } diff --git a/main/forum/viewthread.php b/main/forum/viewthread.php index dafd3c3369..230eadca2c 100755 --- a/main/forum/viewthread.php +++ b/main/forum/viewthread.php @@ -70,7 +70,6 @@ $(function() { '; - /* Actions */ $my_action = isset($_GET['action']) ? $_GET['action'] : ''; diff --git a/main/gradebook/lib/be/category.class.php b/main/gradebook/lib/be/category.class.php index aa58343207..8249f6d029 100755 --- a/main/gradebook/lib/be/category.class.php +++ b/main/gradebook/lib/be/category.class.php @@ -296,7 +296,7 @@ class Category implements GradebookItem } /** - * @return null|int + * @return int|null */ public function get_grade_model_id() { @@ -514,7 +514,7 @@ class Category implements GradebookItem $sql .= ' '.$order_by; } } -//var_dump($sql); + //var_dump($sql); $result = Database::query($sql); $categories = []; if (Database::num_rows($result) > 0) { @@ -2644,7 +2644,7 @@ class Category implements GradebookItem * Internal function used by get_tree(). * * @param int $level - * @param null|int $visible + * @param int|null $visible * * @return array */ diff --git a/main/gradebook/lib/fe/gradebooktable.class.php b/main/gradebook/lib/fe/gradebooktable.class.php index 6323c4ceca..2857dbb741 100755 --- a/main/gradebook/lib/fe/gradebooktable.class.php +++ b/main/gradebook/lib/fe/gradebooktable.class.php @@ -1140,7 +1140,7 @@ class GradebookTable extends SortableTable /** * @param AbstractLink $item * - * @return null|string + * @return string|null */ private function build_edit_column($item) { diff --git a/main/gradebook/lib/fe/linkform.class.php b/main/gradebook/lib/fe/linkform.class.php index 33535f74a1..1f00d59b98 100755 --- a/main/gradebook/lib/fe/linkform.class.php +++ b/main/gradebook/lib/fe/linkform.class.php @@ -140,9 +140,9 @@ class LinkForm extends FormValidator /** * @param int $link - * @param null|string $courseCode + * @param string|null $courseCode * - * @return AttendanceLink|DropboxLink|ExerciseLink|ForumThreadLink|LearnpathLink|null|StudentPublicationLink|SurveyLink + * @return AttendanceLink|DropboxLink|ExerciseLink|ForumThreadLink|LearnpathLink|StudentPublicationLink|SurveyLink|null */ private function createLink($link, $courseCode) { diff --git a/main/gradebook/lib/fe/resulttable.class.php b/main/gradebook/lib/fe/resulttable.class.php index 9b525fb823..7c2cc0e287 100755 --- a/main/gradebook/lib/fe/resulttable.class.php +++ b/main/gradebook/lib/fe/resulttable.class.php @@ -22,7 +22,7 @@ class ResultTable extends SortableTable * * @param string $evaluation * @param array $results - * @param null|string $iscourse + * @param string|null $iscourse * @param array $addparams * @param bool $forprint */ diff --git a/main/gradebook/lib/gradebook_data_generator.class.php b/main/gradebook/lib/gradebook_data_generator.class.php index edb4f08d59..e4670d1801 100755 --- a/main/gradebook/lib/gradebook_data_generator.class.php +++ b/main/gradebook/lib/gradebook_data_generator.class.php @@ -431,7 +431,7 @@ class GradebookDataGenerator * @param GradebookItem $item * @param bool $ignore_score_color * - * @return null|string + * @return string|null */ private function build_result_column( $userId, diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index 8ab486c12f..2b622f8c81 100755 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -676,7 +676,7 @@ switch ($action) { break; case 'get_sessions': $list_type = isset($_REQUEST['list_type']) ? $_REQUEST['list_type'] : 'simple'; - $language = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : ''; + $language = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : ''; $session_columns = SessionManager::getGridColumns($list_type); $columns = $session_columns['simple_column_name']; diff --git a/main/inc/ajax/statistics.ajax.php b/main/inc/ajax/statistics.ajax.php index cc850b284d..612138f603 100644 --- a/main/inc/ajax/statistics.ajax.php +++ b/main/inc/ajax/statistics.ajax.php @@ -1,8 +1,6 @@ -'; } diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 0bea185f35..d6ca159076 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -4643,7 +4643,7 @@ function api_get_languages_combo($name = 'language') * @param bool Hide form if only one language available (defaults to false = show the box anyway) * @param bool $showAsButton * - * @return null|string Display the box directly + * @return string|null Display the box directly */ function api_display_language_form($hide_if_no_choice = false, $showAsButton = false) { @@ -6295,7 +6295,7 @@ function api_replace_dangerous_char($filename, $treat_spaces_as_hyphens = true) if (api_is_valid_utf8($result)) { $filename = $result; $encoding = 'UTF-8'; - } + } } } } diff --git a/main/inc/lib/attendance.lib.php b/main/inc/lib/attendance.lib.php index 43bf243a01..eaef40cd43 100755 --- a/main/inc/lib/attendance.lib.php +++ b/main/inc/lib/attendance.lib.php @@ -154,11 +154,11 @@ class Attendance $user_info = api_get_user_info(); $allowDelete = api_get_setting('allow_delete_attendance'); - $student_param = ''; + $student_param = ''; $studentRequestId = isset($_GET['student_id']) ? (int) $_GET['student_id'] : 0; if (api_is_drh() && !empty($studentRequestId)) { $student_param = '&student_id='.$studentRequestId; - } + } while ($attendance = Database::fetch_row($res)) { $session_star = ''; diff --git a/main/inc/lib/banner.lib.php b/main/inc/lib/banner.lib.php index 664178b0c8..3f3e8a4f5e 100755 --- a/main/inc/lib/banner.lib.php +++ b/main/inc/lib/banner.lib.php @@ -827,7 +827,7 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) } } - if (!empty($lis)) { + if (!empty($lis)) { //Ofaj $html .= Display::tag('ul', get_lang('YouAreHere').': '.$lis, ['class' => 'breadcrumb']); } diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php index c44aa5fb59..02aab2af56 100755 --- a/main/inc/lib/blog.lib.php +++ b/main/inc/lib/blog.lib.php @@ -3212,7 +3212,7 @@ class Blog * @param string $fullText * @param int $length * - * @return null|string + * @return string|null */ private static function getPostExtract($fullText, $length = BLOG_MAX_PREVIEW_CHARS) { diff --git a/main/inc/lib/chat.lib.php b/main/inc/lib/chat.lib.php index 794e29b993..5155742659 100755 --- a/main/inc/lib/chat.lib.php +++ b/main/inc/lib/chat.lib.php @@ -116,7 +116,6 @@ class Chat extends Model $chats = []; foreach ($chatHistory as $userId => $time) { - /*$items = $this->getPreviousMessages( $userId, api_get_user_id(), @@ -138,7 +137,6 @@ class Chat extends Model $chats[$userId]['window_user_info'] = api_get_user_info($userId); } - /* foreach ($chatHistory as $chat) { $userId = $chat['user_info']['user_id']; @@ -351,7 +349,7 @@ class Chat extends Model 'online' => $user_info['user_is_online'], 'avatar' => $user_info['avatar_small'], 'user_id' => $user_info['user_id'], - ] + ], ]; $items[$fromUserId] = $item; @@ -383,7 +381,7 @@ class Chat extends Model 'online' => $user_info['user_is_online'], 'avatar' => $user_info['avatar_small'], 'user_id' => $user_info['user_id'], - ] + ], ]; $items[$fromUserId] = $item; diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 29de53293b..9a353cfe4c 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -35,8 +35,8 @@ class CourseManager * Creates a course. * * @param array $params Columns in the main.course table. - * @param int $authorId Optional. - * @param int $accessUrlId Optional. + * @param int $authorId optional + * @param int $accessUrlId optional * * @return mixed false if the course was not created, array with the course info */ @@ -601,7 +601,7 @@ class CourseManager * * @param int $userId * @param string $courseCode - * @param int $status (STUDENT, COURSEMANAGER, COURSE_ADMIN, NORMAL_COURSE_MEMBER) + * @param int $status (STUDENT, COURSEMANAGER, COURSE_ADMIN, NORMAL_COURSE_MEMBER) * @param int $sessionId * @param int $userCourseCategoryId * @param bool $checkTeacherPermission @@ -648,7 +648,7 @@ class CourseManager $sessionId = empty($sessionId) ? api_get_session_id() : (int) $sessionId; $status = $status === STUDENT || $status === COURSEMANAGER ? $status : STUDENT; $courseUserTable = Database::get_main_table(TABLE_MAIN_COURSE_USER); - // The user has been already subscribed to the course. + // The user has been already subscribed to the course. if (!empty($sessionId)) { SessionManager::subscribe_users_to_session_course( [$userId], @@ -765,8 +765,8 @@ class CourseManager ); } - // Add event to the system log - Event::addEvent( + // Add event to the system log + Event::addEvent( LOG_SUBSCRIBE_USER_TO_COURSE, LOG_COURSE_CODE, $courseCode, @@ -775,7 +775,7 @@ class CourseManager $courseId ); - Event::addEvent( + Event::addEvent( LOG_SUBSCRIBE_USER_TO_COURSE, LOG_USER_OBJECT, $userInfo, @@ -784,8 +784,8 @@ class CourseManager $courseId ); - return true; - } + return true; + } return false; } diff --git a/main/inc/lib/database.lib.php b/main/inc/lib/database.lib.php index 4225868cdd..818b636276 100755 --- a/main/inc/lib/database.lib.php +++ b/main/inc/lib/database.lib.php @@ -180,7 +180,6 @@ class Database $sysPath."vendor/gedmo/doctrine-extensions/lib" ); - Type::overrideType( Type::DATETIME, self::getUTCDateTimeTypeClass() diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 4911e412c7..93315f0e12 100755 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -1900,7 +1900,7 @@ class Display /** * @param array $list * - * @return null|string + * @return string|null */ public static function description($list) { @@ -1919,7 +1919,7 @@ class Display /** * @param int $percentage - * @param bool $show_percentage + * @param bool $show_percentage * @param string $extra_info * * @return string @@ -2801,7 +2801,6 @@ HTML; default: //$html = self::url($data['basename'], $fileUrl); break; - } //$html = self::url($content, $fileUrl, ['ajax']); diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index 3d6e96f93d..d5ef260e2e 100755 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -3595,11 +3595,11 @@ class DocumentManager } /** - * @param int $doc_id + * @param int $doc_id * @param array $courseInfo * @param int $sessionId - * @param int $user_id - * @param int $groupId iid + * @param int $user_id + * @param int $groupId iid * @param bool $checkParentVisibility * * @return bool @@ -3658,7 +3658,7 @@ class DocumentManager return false; } else { if ($checkParentVisibility) { - return self::check_visibility_tree( + return self::check_visibility_tree( $document_data['parent_id'], $courseInfo, $sessionId, diff --git a/main/inc/lib/exercise.lib.php b/main/inc/lib/exercise.lib.php index 426bcb2457..dadd1e0594 100644 --- a/main/inc/lib/exercise.lib.php +++ b/main/inc/lib/exercise.lib.php @@ -1,7 +1,6 @@ getElementJS(); } - /** - * Get the necessary javascript for this datepicker. - * - * @return string - */ - private function getElementJS() - { - $js = null; - $id = $this->getAttribute('id'); - - $js .= ""; - - return $js; - } - /** * @param string $layout * @@ -122,7 +58,7 @@ class DateTimeRangePicker extends DateRangePicker if (empty($size)) { $sizeTemp = 8; } - $size = array(2, $sizeTemp, 2); + $size = [2, $sizeTemp, 2]; } else { if (is_array($size)) { if (count($size) != 3) { @@ -130,11 +66,11 @@ class DateTimeRangePicker extends DateRangePicker if (empty($size)) { $sizeTemp = 8; } - $size = array(2, $sizeTemp, 2); + $size = [2, $sizeTemp, 2]; } // else just keep the $size array as received } else { - $size = array(2, intval($size), 2); + $size = [2, intval($size), 2]; } } @@ -206,4 +142,68 @@ class DateTimeRangePicker extends DateRangePicker break; } } + + /** + * Get the necessary javascript for this datepicker. + * + * @return string + */ + private function getElementJS() + { + $js = null; + $id = $this->getAttribute('id'); + + $js .= ""; + + return $js; + } } diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php index 7421b2c1a8..8ca19c8b16 100755 --- a/main/inc/lib/formvalidator/FormValidator.class.php +++ b/main/inc/lib/formvalidator/FormValidator.class.php @@ -18,14 +18,14 @@ class FormValidator extends HTML_QuickForm /** * Constructor. * - * @param string $name Name of the form - * @param string $method (optional) Method ('post' (default) or 'get') - * @param string $action (optional) Action (default is $PHP_SELF) - * @param string $target (optional) Form's target defaults to '_self' - * @param mixed $attributes (optional) Extra attributes for
tag + * @param string $name Name of the form + * @param string $method (optional) Method ('post' (default) or 'get') + * @param string $action (optional) Action (default is $PHP_SELF) + * @param string $target (optional) Form's target defaults to '_self' + * @param mixed $attributes (optional) Extra attributes for tag * @param string $layout - * @param bool $trackSubmit (optional) Whether to track if the form was - * submitted by adding a special hidden field (default = true) + * @param bool $trackSubmit (optional) Whether to track if the form was + * submitted by adding a special hidden field (default = true) */ public function __construct( $name, @@ -60,7 +60,7 @@ class FormValidator extends HTML_QuickForm parent::__construct($name, $method, $action, $target, $attributes, $trackSubmit); // Modify the default templates - $renderer = & $this->defaultRenderer(); + $renderer = &$this->defaultRenderer(); // Form template $formTemplate = $this->getFormTemplate(); @@ -177,13 +177,15 @@ EOT; /** * Adds a text field to the form. * A trim-filter is attached to the field. - * @param string $label The label for the form-element - * @param string $name The element name - * @param bool $required (optional) Is the form-element required (default=true) - * @param array $attributes (optional) List of attributes for the form-element + * + * @param string $label The label for the form-element + * @param string $name The element name + * @param bool $required (optional) Is the form-element required (default=true) + * @param array $attributes (optional) List of attributes for the form-element + * * @return HTML_QuickForm_text */ - public function addText($name, $label, $required = true, $attributes = array()) + public function addText($name, $label, $required = true, $attributes = []) { $element = $this->addElement('text', $name, $label, $attributes); $this->applyFilter($name, 'trim'); @@ -220,7 +222,7 @@ EOT; /** * @param string $name * @param string $label - * @param array $attributes + * @param array $attributes * * @return mixed */ @@ -232,7 +234,7 @@ EOT; /** * @param string $name * @param string $label - * @param array $attributes + * @param array $attributes * * @return mixed */ @@ -244,8 +246,8 @@ EOT; /** * @param string $name * @param string $label - * @param array $options - * @param array $attributes + * @param array $options + * @param array $attributes * * @throws */ @@ -266,7 +268,7 @@ EOT; /** * @param string $name * @param string $label - * @param array $attributes + * @param array $attributes * * @return mixed */ @@ -319,10 +321,10 @@ EOT; /** * @param string $name * @param string $label - * @param string $icon font-awesome - * @param string $style default|primary|success|info|warning|danger|link - * @param string $size large|default|small|extra-small - * @param string $class Example plus is transformed to icon fa fa-plus + * @param string $icon font-awesome + * @param string $style default|primary|success|info|warning|danger|link + * @param string $size large|default|small|extra-small + * @param string $class Example plus is transformed to icon fa fa-plus * @param array $attributes * @param bool $createElement * @@ -366,9 +368,9 @@ EOT; /** * Returns a button with the primary color and a check mark. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -389,9 +391,9 @@ EOT; /** * Returns a cancel button. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -412,10 +414,10 @@ EOT; /** * Returns a button with the primary color and a "plus" icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method - * @param array $attributes Additional attributes + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method + * @param array $attributes Additional attributes * * @return HTML_QuickForm_button */ @@ -436,9 +438,9 @@ EOT; /** * Returns a button with the primary color and a pencil icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -459,9 +461,9 @@ EOT; /** * Returns a button with the danger color and a trash icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -482,9 +484,9 @@ EOT; /** * Returns a move style button. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -505,10 +507,10 @@ EOT; /** * Returns a button with the primary color and a paper-plane icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method - * @param array $attributes + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method + * @param array $attributes * * @return HTML_QuickForm_button */ @@ -530,7 +532,7 @@ EOT; * Returns a button with the default (grey?) color and a magnifier icon. * * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) + * @param string $name Element name (for form treatment purposes) * * @return HTML_QuickForm_button */ @@ -546,9 +548,9 @@ EOT; /** * Returns a button with the primary color and a right-pointing arrow icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param array $attributes Additional attributes + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param array $attributes Additional attributes * * @return HTML_QuickForm_button */ @@ -568,9 +570,9 @@ EOT; /** * Returns a button with the primary color and a check mark icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -591,9 +593,9 @@ EOT; /** * Returns a button with the primary color and a check-mark icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -614,9 +616,9 @@ EOT; /** * Shortcut to filter button. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -637,9 +639,9 @@ EOT; /** * Shortcut to reset button. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -679,9 +681,9 @@ EOT; /** * Returns a button with the primary color and an upload icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -702,9 +704,9 @@ EOT; /** * Returns a button with the primary color and a download icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -725,9 +727,9 @@ EOT; /** * Returns a button with the primary color and a magnifier icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -748,9 +750,9 @@ EOT; /** * Returns a button with the primary color and a copy (double sheet) icon. * - * @param string $label Text appearing on the button - * @param string $name Element name (for form treatment purposes) - * @param bool $createElement Whether to use the create or add method + * @param string $label Text appearing on the button + * @param string $name Element name (for form treatment purposes) + * @param bool $createElement Whether to use the create or add method * * @return HTML_QuickForm_button */ @@ -841,9 +843,9 @@ EOT; * @param $name * @param $label * @param $collection - * @param array $attributes - * @param bool $addNoneOption - * @param string $textCallable set a function getStringValue() by default __toString() + * @param array $attributes + * @param bool $addNoneOption + * @param string $textCallable set a function getStringValue() by default __toString() * * @return HTML_QuickForm_element */ @@ -991,7 +993,7 @@ EOT; * Adds a HTML-editor to the form. * * @param string $name - * @param string $label The label for the form-element + * @param string $label The label for the form-element * @param bool $required (optional) Is the form-element required (default=true) * @param bool $fullPage (optional) When it is true, the editor loads completed html code for a full page * @param array $config (optional) Configuration settings for the online editor @@ -1084,7 +1086,7 @@ EOT; $this->addHtml(''; $htmlHeadXtra[] = ''; @@ -115,6 +114,5 @@ $tpl->assign( $tpl->assign('places', json_encode($data)); $tpl->assign('api_key', $apiKey); - $layout = $tpl->get_template('social/map.tpl'); $tpl->display($layout); diff --git a/main/social/profile_friends_and_groups.inc.php b/main/social/profile_friends_and_groups.inc.php index 596d315982..0b3371b18a 100755 --- a/main/social/profile_friends_and_groups.inc.php +++ b/main/social/profile_friends_and_groups.inc.php @@ -138,7 +138,7 @@ if (isset($_GET['view']) && in_array($_GET['view'], $views)) { echo '
'.$count_groups.'
'; foreach ($grid_my_groups as $group) { - echo Display::panel($group[0], $group[1]) ; + echo Display::panel($group[0], $group[1]); } echo ''; } diff --git a/main/survey/preview.php b/main/survey/preview.php index 86e0641f86..7f37a6f52e 100755 --- a/main/survey/preview.php +++ b/main/survey/preview.php @@ -203,8 +203,8 @@ if (api_is_course_admin() || } $before = 0; - if (isset($_GET['show']) && isset($paged_questions[$_GET['show'] -1])) { - $before = count($paged_questions[$_GET['show'] -1]); + if (isset($_GET['show']) && isset($paged_questions[$_GET['show'] - 1])) { + $before = count($paged_questions[$_GET['show'] - 1]); } // Selecting the maximum number of pages diff --git a/main/survey/question.php b/main/survey/question.php index bd9722d351..ac28080c8f 100755 --- a/main/survey/question.php +++ b/main/survey/question.php @@ -138,7 +138,6 @@ switch ($_GET['type']) { break; } - // We are editing a question if (isset($_GET['question_id']) && !empty($_GET['question_id'])) { $formData = SurveyManager::get_question($_GET['question_id']); diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index 8ac0732aeb..e24ed0a858 100755 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -806,7 +806,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 * @@ -2208,7 +2208,6 @@ class SurveyManager ]; self::save_question($surveyData, $values); } - } } } diff --git a/main/webservices/lp.php b/main/webservices/lp.php index 318a168701..71cf714ffe 100644 --- a/main/webservices/lp.php +++ b/main/webservices/lp.php @@ -592,7 +592,7 @@ $server->register( /** * @param array $params * - * @return null|soap_fault + * @return soap_fault|null */ function WSCreateLp($params) { diff --git a/main/webservices/registration.soap.php b/main/webservices/registration.soap.php index d4772fe606..45c0305eb4 100755 --- a/main/webservices/registration.soap.php +++ b/main/webservices/registration.soap.php @@ -19,7 +19,7 @@ define('DEFAULT_ADMIN_USER_ID', 1); /** * @param string $code * - * @return null|soap_fault + * @return soap_fault|null */ function returnError($code) { @@ -1119,7 +1119,7 @@ $server->register( * * @param array $params - WSFunction parameters (include VerifyKey) * - * @return bool|null|soap_fault A simple boolean (true if teacher successful subscribed, false otherwise) + * @return bool|soap_fault|null A simple boolean (true if teacher successful subscribed, false otherwise) */ function WSSubscribeTeacherToSessionCourse($params) { @@ -1178,7 +1178,7 @@ $server->register( * * @param array $params - WSFunction parameters (include VerifyKey) * - * @return bool|null|soap_fault A simple boolean (true if teacher successful unsubscribed, false otherwise) + * @return bool|soap_fault|null A simple boolean (true if teacher successful unsubscribed, false otherwise) */ function WSUnsubscribeTeacherFromSessionCourse($params) { @@ -1609,7 +1609,7 @@ $server->register( * * @throws \Doctrine\DBAL\DBALException * - * @return bool|int|null|soap_fault + * @return bool|int|soap_fault|null */ function WSEditUserCredentials($params) { @@ -4720,7 +4720,7 @@ $server->register( * * @param array $params * - * @return array|int|null|soap_fault|string + * @return array|int|soap_fault|string|null */ function WSSubscribeUserToCourseSimple($params) { @@ -5241,7 +5241,7 @@ $server->register( /** * @param array $params * - * @return array|null|soap_fault + * @return array|soap_fault|null */ function WSUnSubscribeUserFromCourseSimple($params) { @@ -5540,7 +5540,7 @@ $server->register( /** * @param array $params * - * @return int|null|soap_fault|string + * @return int|soap_fault|string|null */ function WSSubscribeUserToSessionSimple($params) { @@ -6298,7 +6298,7 @@ $server->register( /** * @param array $params * - * @return int|null|soap_fault + * @return int|soap_fault|null */ function WSUpdateUserApiKey($params) { @@ -6481,7 +6481,7 @@ $server->register( * * @param array $params Array of parameters (course and user_id) * - * @return bool|null|soap_fault A simple boolean (true if user is subscribed, false otherwise) + * @return bool|soap_fault|null A simple boolean (true if user is subscribed, false otherwise) */ function WSUserSubscribedInCourse($params) { diff --git a/main/webservices/tcc.soap.php b/main/webservices/tcc.soap.php index a73c801d79..8d6bd1d257 100644 --- a/main/webservices/tcc.soap.php +++ b/main/webservices/tcc.soap.php @@ -22,7 +22,7 @@ define('WS_ERROR_SETTING', 4); /** * @param string $code * - * @return null|soap_fault + * @return soap_fault|null */ function returnError($code) { diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 2dc0a96d37..67047332e3 100755 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -3786,7 +3786,7 @@ function checkExistingWorkFileName($filename, $workId) * @param bool $checkDuplicated * @param bool $showFlashMessage * - * @return null|string + * @return string|null */ function processWorkForm( $workInfo, diff --git a/plugin/advanced_subscription/src/HookAdvancedSubscription.php b/plugin/advanced_subscription/src/HookAdvancedSubscription.php index 9677883ebc..0cc7e5035b 100644 --- a/plugin/advanced_subscription/src/HookAdvancedSubscription.php +++ b/plugin/advanced_subscription/src/HookAdvancedSubscription.php @@ -405,7 +405,7 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs /** * @param $params * - * @return null|soap_fault + * @return soap_fault|null */ public static function WSSessionListInCategory($params) { @@ -456,7 +456,7 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs /** * @param $params * - * @return null|soap_fault + * @return soap_fault|null */ public static function WSSessionGetDetailsByUser($params) { diff --git a/plugin/search_course/plugin.php b/plugin/search_course/plugin.php index 047b88936e..8d2a76fd96 100755 --- a/plugin/search_course/plugin.php +++ b/plugin/search_course/plugin.php @@ -1,4 +1,4 @@ - - * @author Julio Montoya - */ -class SepePlugin extends Plugin -{ - const TABLE_SEPE_CENTER = 'plugin_sepe_center'; - const TABLE_SEPE_ACTIONS = 'plugin_sepe_actions'; - const TABLE_SEPE_SPECIALTY = 'plugin_sepe_specialty'; - const TABLE_SEPE_SPECIALTY_CLASSROOM = 'plugin_sepe_specialty_classroom'; - const TABLE_SEPE_CENTERS = 'plugin_sepe_centers'; - const TABLE_SEPE_TUTORS = 'plugin_sepe_tutors'; - const TABLE_SEPE_SPECIALTY_TUTORS = 'plugin_sepe_specialty_tutors'; - const TABLE_SEPE_PARTICIPANTS = 'plugin_sepe_participants'; - const TABLE_SEPE_PARTICIPANTS_SPECIALTY = 'plugin_sepe_participants_specialty'; - const TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS = 'plugin_sepe_participants_specialty_tutorials'; - const TABLE_SEPE_COURSE_ACTIONS = 'plugin_sepe_course_actions'; - const TABLE_SEPE_TUTORS_COMPANY = 'plugin_sepe_tutors_company'; - const TABLE_SEPE_TEACHING_COMPETENCE = 'plugin_sepe_teaching_competence'; - const TABLE_SEPE_LOG_PARTICIPANT = 'plugin_sepe_log_participant'; - const TABLE_SEPE_LOG_MOD_PARTICIPANT = 'plugin_sepe_log_mod_participant'; - const TABLE_SEPE_LOG = 'plugin_sepe_log'; - - public $isAdminPlugin = true; - - protected function __construct() - { - parent::__construct( - '2.1', - ' - Jose Angel Ruiz - NoSoloRed (original author)
- Julio Montoya (SOAP integration) - ', - ['sepe_enable' => 'boolean'] - ); - } - - /** - * @return SepePlugin - */ - public static function create() - { - static $result = null; - - return $result ? $result : $result = new self(); - } - - /** - * This method creates the tables required to this plugin. - */ - public function install() - { - $tablesToBeCompared = [ - self::TABLE_SEPE_CENTER, - self::TABLE_SEPE_ACTIONS, - self::TABLE_SEPE_SPECIALTY, - self::TABLE_SEPE_SPECIALTY_CLASSROOM, - self::TABLE_SEPE_CENTERS, - self::TABLE_SEPE_TUTORS, - self::TABLE_SEPE_SPECIALTY_TUTORS, - self::TABLE_SEPE_PARTICIPANTS, - self::TABLE_SEPE_PARTICIPANTS_SPECIALTY, - self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS, - self::TABLE_SEPE_COURSE_ACTIONS, - self::TABLE_SEPE_TUTORS_COMPANY, - self::TABLE_SEPE_TEACHING_COMPETENCE, - self::TABLE_SEPE_LOG_PARTICIPANT, - self::TABLE_SEPE_LOG_MOD_PARTICIPANT, - self::TABLE_SEPE_LOG, - ]; - $em = Database::getManager(); - $cn = $em->getConnection(); - $sm = $cn->getSchemaManager(); - $tables = $sm->tablesExist($tablesToBeCompared); - - if ($tables) { - return false; - } - - require_once api_get_path(SYS_PLUGIN_PATH).'sepe/database.php'; - } - - /** - * This method drops the plugin tables. - */ - public function uninstall() - { - $tablesToBeDeleted = [ - self::TABLE_SEPE_CENTER, - self::TABLE_SEPE_SPECIALTY_CLASSROOM, - self::TABLE_SEPE_CENTERS, - self::TABLE_SEPE_TUTORS, - self::TABLE_SEPE_SPECIALTY_TUTORS, - self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS, - self::TABLE_SEPE_PARTICIPANTS_SPECIALTY, - self::TABLE_SEPE_COURSE_ACTIONS, - self::TABLE_SEPE_PARTICIPANTS, - self::TABLE_SEPE_TUTORS_COMPANY, - self::TABLE_SEPE_SPECIALTY, - self::TABLE_SEPE_ACTIONS, - self::TABLE_SEPE_TEACHING_COMPETENCE, - self::TABLE_SEPE_LOG_PARTICIPANT, - self::TABLE_SEPE_LOG_MOD_PARTICIPANT, - self::TABLE_SEPE_LOG, - ]; - - foreach ($tablesToBeDeleted as $tableToBeDeleted) { - $table = Database::get_main_table($tableToBeDeleted); - $sql = "DROP TABLE IF EXISTS $table"; - Database::query($sql); - } - $this->manageTab(false); - } - - /** - * Update. - */ - public function update() - { - $oldTableCenters = 'plugin_sepe_centros'; - $oldTableTutorsCompany = 'plugin_sepe_tutors_empresa'; - $oldTableCompetence = 'plugin_sepe_competencia_docente'; - $sql = "RENAME TABLE " - .$oldTableCenters." TO ".self::TABLE_SEPE_CENTERS.", " - .$oldTableTutorsCompany." TO ".self::TABLE_SEPE_TUTORS_COMPANY.", " - .$oldTableCompetence." TO ".self::TABLE_SEPE_TEACHING_COMPETENCE.";"; - Database::query($sql); - - $sepeCourseActionsTable = self::TABLE_SEPE_COURSE_ACTIONS; - $sql = "ALTER TABLE ".$sepeCourseActionsTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCourseActionsTable." - CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCourseActionsTable." - CHANGE `id_course` `course_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - - $sepeActionsTable = self::TABLE_SEPE_ACTIONS; - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `ORIGEN_ACCION` `action_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `CODIGO_ACCION` `action_code` VARCHAR(30)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `SITUACION` `situation` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `DURACION` `duration` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `FECHA_INICIO` `start_date` DATE NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `FECHA_FIN` `end_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `IND_ITINERARIO_COMPLETO` `full_itinerary_indicator` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `TIPO_FINANCIACION` `financing_type` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `NUMERO_ASISTENTES` `attendees_count` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `DENOMINACION_ACCION` `action_name` VARCHAR(50)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `INFORMACION_GENERAL` `global_info` LONGTEXT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `HORARIOS` `schedule` LONGTEXT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `REQUISITOS` `requirements` LONGTEXT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeActionsTable." - CHANGE `CONTACTO_ACCION` `contact_action` LONGTEXT"; - Database::query($sql); - - $sepeSpecialtyTable = self::TABLE_SEPE_SPECIALTY; - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `FECHA_INICIO` `start_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `FECHA_FIN` `end_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `MODALIDAD_IMPARTICION` `modality_impartition` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HORAS_PRESENCIAL` `classroom_hours` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HORAS_TELEFORMACION` `distance_hours` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HM_NUM_PARTICIPANTES` `mornings_participants_number` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HM_NUMERO_ACCESOS` `mornings_access_number` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HM_DURACION_TOTAL` `morning_total_duration` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HT_NUM_PARTICIPANTES` `afternoon_participants_number` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HT_NUMERO_ACCESOS` `afternoon_access_number` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HT_DURACION_TOTAL` `afternoon_total_duration` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HN_NUM_PARTICIPANTES` `night_participants_number` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HN_NUMERO_ACCESOS` `night_access_number` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `HN_DURACION_TOTAL` `night_total_duration` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `NUM_PARTICIPANTES` `attendees_count` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `NUMERO_ACTIVIDADES_APRENDIZAJE` `learning_activity_count` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `NUMERO_INTENTOS` `attempt_count` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTable." - CHANGE `NUMERO_ACTIVIDADES_EVALUACION` `evaluation_activity_count` INT( 10 ) UNSIGNED"; - Database::query($sql); - - $sepeParticipantTable = self::TABLE_SEPE_PARTICIPANTS; - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `cod_tutor_empresa` `company_tutor_id` INT( 10 ) UNSIGNED NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `cod_tutor_formacion` `training_tutor_id` INT( 10 ) UNSIGNED NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `INDICADOR_COMPETENCIAS_CLAVE` `key_competence` VARCHAR( 2 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `ID_CONTRATO_CFA` `contract_id` VARCHAR( 14 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantTable." - CHANGE `CIF_EMPRESA` `company_fiscal_number` VARCHAR( 9 )"; - Database::query($sql); - - $sepeCenterTable = self::TABLE_SEPE_CENTERS; - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; - Database::query($sql); - - $sepeSpecialtyClassroomTable = self::TABLE_SEPE_SPECIALTY_CLASSROOM; - $sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." - CHANGE `cod_specialty` `specialty_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." - CHANGE `cod_centro` `center_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - - $sepeSpecialtyTutorsTable = self::TABLE_SEPE_SPECIALTY_TUTORS; - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `cod_specialty` `specialty_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `cod_tutor` `tutor_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `ACREDITACION_TUTOR` `tutor_accreditation` VARCHAR(200)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `EXPERIENCIA_PROFESIONAL` `professional_experience` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `COMPETENCIA_DOCENTE` `teaching_competence` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `EXPERIENCIA_MODALIDAD_TELEFORMACION` `experience_teleforming` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." - CHANGE `FORMACION_MODALIDAD_TELEFORMACION` `training_teleforming` VARCHAR(2)"; - Database::query($sql); - - $sepeTutorsTable = self::TABLE_SEPE_TUTORS; - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `ACREDITACION_TUTOR` `tutor_accreditation` VARCHAR(200)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `EXPERIENCIA_PROFESIONAL` `professional_experience` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `COMPETENCIA_DOCENTE` `teaching_competence` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `EXPERIENCIA_MODALIDAD_TELEFORMACION` `experience_teleforming` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsTable." - CHANGE `FORMACION_MODALIDAD_TELEFORMACION` `training_teleforming` VARCHAR(2)"; - Database::query($sql); - - $sepeParticipantSpecialtyTable = self::TABLE_SEPE_PARTICIPANTS_SPECIALTY; - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `cod_participant` `participant_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `FECHA_ALTA` `registration_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `FECHA_BAJA` `leaving_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `FECHA_INICIO` `start_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `FECHA_FIN` `end_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `RESULTADO_FINAL` `final_result` VARCHAR(1)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `CALIFICACION_FINAL` `final_qualification` VARCHAR(4)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." - CHANGE `PUNTUACION_FINAL` `final_score` VARCHAR(4)"; - Database::query($sql); - - $sepeParticipantSpecialtyTutorialsTable = self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS; - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." - CHANGE `cod_participant_specialty` `participant_specialty_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." - CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." - CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." - CHANGE `FECHA_INICIO` `start_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." - CHANGE `FECHA_FIN` `end_date` DATE"; - Database::query($sql); - - $sepeTutorsCompanyTable = self::TABLE_SEPE_TUTORS_COMPANY; - - $sql = "UPDATE ".$sepeTutorsCompanyTable." SET empresa='1' WHERE empresa='SI'"; - Database::query($sql); - $sql = "UPDATE ".$sepeTutorsCompanyTable." SET empresa='0' WHERE empresa='NO'"; - Database::query($sql); - $sql = "UPDATE ".$sepeTutorsCompanyTable." SET formacion='1' WHERE formacion='SI'"; - Database::query($sql); - $sql = "UPDATE ".$sepeTutorsCompanyTable." SET formacion='0' WHERE formacion='NO'"; - Database::query($sql); - - $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." - CHANGE `alias` `alias` VARCHAR(255)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." - CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." - CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." - CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." - CHANGE `empresa` `company` VARCHAR(1)"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." - CHANGE `formacion` `training` VARCHAR(1)"; - Database::query($sql); - - $sepeCompetenceTable = self::TABLE_SEPE_TEACHING_COMPETENCE; - $sql = "ALTER TABLE ".$sepeCompetenceTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCompetenceTable." - CHANGE `valor` `value` LONGTEXT"; - Database::query($sql); - - $sepeLogParticipantTable = self::TABLE_SEPE_LOG_PARTICIPANT; - $sql = "ALTER TABLE ".$sepeLogParticipantTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeLogParticipantTable." - CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeLogParticipantTable." - CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeLogParticipantTable." - CHANGE `fecha_alta` `registration_date` DATE"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeLogParticipantTable." - CHANGE `fecha_baja` `leaving_date` DATE"; - Database::query($sql); - - $sepeLogModParticipantTable = self::TABLE_SEPE_LOG_MOD_PARTICIPANT; - $sql = "ALTER TABLE ".$sepeLogModParticipantTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeLogModParticipantTable." - CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeLogModParticipantTable." - CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeLogModParticipantTable." - CHANGE `fecha_mod` `change_date` DATE"; - Database::query($sql); - - $sepeCenterTable = self::TABLE_SEPE_CENTER; - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `origen_centro` `center_origin` VARCHAR( 255 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `codigo_centro` `center_code` VARCHAR( 255 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `nombre_centro` `center_name` VARCHAR( 255 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `url` `url` VARCHAR( 255 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `url_seguimiento` `tracking_url` VARCHAR( 255 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `telefono` `phone` VARCHAR( 255 )"; - Database::query($sql); - $sql = "ALTER TABLE ".$sepeCenterTable." - CHANGE `email` `mail` VARCHAR( 255 )"; - Database::query($sql); - } -} + + * @author Julio Montoya + */ +class SepePlugin extends Plugin +{ + const TABLE_SEPE_CENTER = 'plugin_sepe_center'; + const TABLE_SEPE_ACTIONS = 'plugin_sepe_actions'; + const TABLE_SEPE_SPECIALTY = 'plugin_sepe_specialty'; + const TABLE_SEPE_SPECIALTY_CLASSROOM = 'plugin_sepe_specialty_classroom'; + const TABLE_SEPE_CENTERS = 'plugin_sepe_centers'; + const TABLE_SEPE_TUTORS = 'plugin_sepe_tutors'; + const TABLE_SEPE_SPECIALTY_TUTORS = 'plugin_sepe_specialty_tutors'; + const TABLE_SEPE_PARTICIPANTS = 'plugin_sepe_participants'; + const TABLE_SEPE_PARTICIPANTS_SPECIALTY = 'plugin_sepe_participants_specialty'; + const TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS = 'plugin_sepe_participants_specialty_tutorials'; + const TABLE_SEPE_COURSE_ACTIONS = 'plugin_sepe_course_actions'; + const TABLE_SEPE_TUTORS_COMPANY = 'plugin_sepe_tutors_company'; + const TABLE_SEPE_TEACHING_COMPETENCE = 'plugin_sepe_teaching_competence'; + const TABLE_SEPE_LOG_PARTICIPANT = 'plugin_sepe_log_participant'; + const TABLE_SEPE_LOG_MOD_PARTICIPANT = 'plugin_sepe_log_mod_participant'; + const TABLE_SEPE_LOG = 'plugin_sepe_log'; + + public $isAdminPlugin = true; + + protected function __construct() + { + parent::__construct( + '2.1', + ' + Jose Angel Ruiz - NoSoloRed (original author)
+ Julio Montoya (SOAP integration) + ', + ['sepe_enable' => 'boolean'] + ); + } + + /** + * @return SepePlugin + */ + public static function create() + { + static $result = null; + + return $result ? $result : $result = new self(); + } + + /** + * This method creates the tables required to this plugin. + */ + public function install() + { + $tablesToBeCompared = [ + self::TABLE_SEPE_CENTER, + self::TABLE_SEPE_ACTIONS, + self::TABLE_SEPE_SPECIALTY, + self::TABLE_SEPE_SPECIALTY_CLASSROOM, + self::TABLE_SEPE_CENTERS, + self::TABLE_SEPE_TUTORS, + self::TABLE_SEPE_SPECIALTY_TUTORS, + self::TABLE_SEPE_PARTICIPANTS, + self::TABLE_SEPE_PARTICIPANTS_SPECIALTY, + self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS, + self::TABLE_SEPE_COURSE_ACTIONS, + self::TABLE_SEPE_TUTORS_COMPANY, + self::TABLE_SEPE_TEACHING_COMPETENCE, + self::TABLE_SEPE_LOG_PARTICIPANT, + self::TABLE_SEPE_LOG_MOD_PARTICIPANT, + self::TABLE_SEPE_LOG, + ]; + $em = Database::getManager(); + $cn = $em->getConnection(); + $sm = $cn->getSchemaManager(); + $tables = $sm->tablesExist($tablesToBeCompared); + + if ($tables) { + return false; + } + + require_once api_get_path(SYS_PLUGIN_PATH).'sepe/database.php'; + } + + /** + * This method drops the plugin tables. + */ + public function uninstall() + { + $tablesToBeDeleted = [ + self::TABLE_SEPE_CENTER, + self::TABLE_SEPE_SPECIALTY_CLASSROOM, + self::TABLE_SEPE_CENTERS, + self::TABLE_SEPE_TUTORS, + self::TABLE_SEPE_SPECIALTY_TUTORS, + self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS, + self::TABLE_SEPE_PARTICIPANTS_SPECIALTY, + self::TABLE_SEPE_COURSE_ACTIONS, + self::TABLE_SEPE_PARTICIPANTS, + self::TABLE_SEPE_TUTORS_COMPANY, + self::TABLE_SEPE_SPECIALTY, + self::TABLE_SEPE_ACTIONS, + self::TABLE_SEPE_TEACHING_COMPETENCE, + self::TABLE_SEPE_LOG_PARTICIPANT, + self::TABLE_SEPE_LOG_MOD_PARTICIPANT, + self::TABLE_SEPE_LOG, + ]; + + foreach ($tablesToBeDeleted as $tableToBeDeleted) { + $table = Database::get_main_table($tableToBeDeleted); + $sql = "DROP TABLE IF EXISTS $table"; + Database::query($sql); + } + $this->manageTab(false); + } + + /** + * Update. + */ + public function update() + { + $oldTableCenters = 'plugin_sepe_centros'; + $oldTableTutorsCompany = 'plugin_sepe_tutors_empresa'; + $oldTableCompetence = 'plugin_sepe_competencia_docente'; + $sql = "RENAME TABLE " + .$oldTableCenters." TO ".self::TABLE_SEPE_CENTERS.", " + .$oldTableTutorsCompany." TO ".self::TABLE_SEPE_TUTORS_COMPANY.", " + .$oldTableCompetence." TO ".self::TABLE_SEPE_TEACHING_COMPETENCE.";"; + Database::query($sql); + + $sepeCourseActionsTable = self::TABLE_SEPE_COURSE_ACTIONS; + $sql = "ALTER TABLE ".$sepeCourseActionsTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCourseActionsTable." + CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCourseActionsTable." + CHANGE `id_course` `course_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + + $sepeActionsTable = self::TABLE_SEPE_ACTIONS; + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `ORIGEN_ACCION` `action_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `CODIGO_ACCION` `action_code` VARCHAR(30)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `SITUACION` `situation` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `DURACION` `duration` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `FECHA_INICIO` `start_date` DATE NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `FECHA_FIN` `end_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `IND_ITINERARIO_COMPLETO` `full_itinerary_indicator` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `TIPO_FINANCIACION` `financing_type` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `NUMERO_ASISTENTES` `attendees_count` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `DENOMINACION_ACCION` `action_name` VARCHAR(50)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `INFORMACION_GENERAL` `global_info` LONGTEXT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `HORARIOS` `schedule` LONGTEXT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `REQUISITOS` `requirements` LONGTEXT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeActionsTable." + CHANGE `CONTACTO_ACCION` `contact_action` LONGTEXT"; + Database::query($sql); + + $sepeSpecialtyTable = self::TABLE_SEPE_SPECIALTY; + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `FECHA_INICIO` `start_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `FECHA_FIN` `end_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `MODALIDAD_IMPARTICION` `modality_impartition` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HORAS_PRESENCIAL` `classroom_hours` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HORAS_TELEFORMACION` `distance_hours` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HM_NUM_PARTICIPANTES` `mornings_participants_number` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HM_NUMERO_ACCESOS` `mornings_access_number` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HM_DURACION_TOTAL` `morning_total_duration` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HT_NUM_PARTICIPANTES` `afternoon_participants_number` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HT_NUMERO_ACCESOS` `afternoon_access_number` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HT_DURACION_TOTAL` `afternoon_total_duration` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HN_NUM_PARTICIPANTES` `night_participants_number` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HN_NUMERO_ACCESOS` `night_access_number` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `HN_DURACION_TOTAL` `night_total_duration` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `NUM_PARTICIPANTES` `attendees_count` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `NUMERO_ACTIVIDADES_APRENDIZAJE` `learning_activity_count` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `NUMERO_INTENTOS` `attempt_count` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTable." + CHANGE `NUMERO_ACTIVIDADES_EVALUACION` `evaluation_activity_count` INT( 10 ) UNSIGNED"; + Database::query($sql); + + $sepeParticipantTable = self::TABLE_SEPE_PARTICIPANTS; + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `cod_tutor_empresa` `company_tutor_id` INT( 10 ) UNSIGNED NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `cod_tutor_formacion` `training_tutor_id` INT( 10 ) UNSIGNED NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `INDICADOR_COMPETENCIAS_CLAVE` `key_competence` VARCHAR( 2 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `ID_CONTRATO_CFA` `contract_id` VARCHAR( 14 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantTable." + CHANGE `CIF_EMPRESA` `company_fiscal_number` VARCHAR( 9 )"; + Database::query($sql); + + $sepeCenterTable = self::TABLE_SEPE_CENTERS; + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; + Database::query($sql); + + $sepeSpecialtyClassroomTable = self::TABLE_SEPE_SPECIALTY_CLASSROOM; + $sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." + CHANGE `cod_specialty` `specialty_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." + CHANGE `cod_centro` `center_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + + $sepeSpecialtyTutorsTable = self::TABLE_SEPE_SPECIALTY_TUTORS; + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `cod_specialty` `specialty_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `cod_tutor` `tutor_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `ACREDITACION_TUTOR` `tutor_accreditation` VARCHAR(200)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `EXPERIENCIA_PROFESIONAL` `professional_experience` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `COMPETENCIA_DOCENTE` `teaching_competence` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `EXPERIENCIA_MODALIDAD_TELEFORMACION` `experience_teleforming` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." + CHANGE `FORMACION_MODALIDAD_TELEFORMACION` `training_teleforming` VARCHAR(2)"; + Database::query($sql); + + $sepeTutorsTable = self::TABLE_SEPE_TUTORS; + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `ACREDITACION_TUTOR` `tutor_accreditation` VARCHAR(200)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `EXPERIENCIA_PROFESIONAL` `professional_experience` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `COMPETENCIA_DOCENTE` `teaching_competence` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `EXPERIENCIA_MODALIDAD_TELEFORMACION` `experience_teleforming` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsTable." + CHANGE `FORMACION_MODALIDAD_TELEFORMACION` `training_teleforming` VARCHAR(2)"; + Database::query($sql); + + $sepeParticipantSpecialtyTable = self::TABLE_SEPE_PARTICIPANTS_SPECIALTY; + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `cod_participant` `participant_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `FECHA_ALTA` `registration_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `FECHA_BAJA` `leaving_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `FECHA_INICIO` `start_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `FECHA_FIN` `end_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `RESULTADO_FINAL` `final_result` VARCHAR(1)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `CALIFICACION_FINAL` `final_qualification` VARCHAR(4)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." + CHANGE `PUNTUACION_FINAL` `final_score` VARCHAR(4)"; + Database::query($sql); + + $sepeParticipantSpecialtyTutorialsTable = self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS; + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." + CHANGE `cod_participant_specialty` `participant_specialty_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." + CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." + CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." + CHANGE `FECHA_INICIO` `start_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." + CHANGE `FECHA_FIN` `end_date` DATE"; + Database::query($sql); + + $sepeTutorsCompanyTable = self::TABLE_SEPE_TUTORS_COMPANY; + + $sql = "UPDATE ".$sepeTutorsCompanyTable." SET empresa='1' WHERE empresa='SI'"; + Database::query($sql); + $sql = "UPDATE ".$sepeTutorsCompanyTable." SET empresa='0' WHERE empresa='NO'"; + Database::query($sql); + $sql = "UPDATE ".$sepeTutorsCompanyTable." SET formacion='1' WHERE formacion='SI'"; + Database::query($sql); + $sql = "UPDATE ".$sepeTutorsCompanyTable." SET formacion='0' WHERE formacion='NO'"; + Database::query($sql); + + $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." + CHANGE `alias` `alias` VARCHAR(255)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." + CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." + CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." + CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." + CHANGE `empresa` `company` VARCHAR(1)"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeTutorsCompanyTable." + CHANGE `formacion` `training` VARCHAR(1)"; + Database::query($sql); + + $sepeCompetenceTable = self::TABLE_SEPE_TEACHING_COMPETENCE; + $sql = "ALTER TABLE ".$sepeCompetenceTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCompetenceTable." + CHANGE `valor` `value` LONGTEXT"; + Database::query($sql); + + $sepeLogParticipantTable = self::TABLE_SEPE_LOG_PARTICIPANT; + $sql = "ALTER TABLE ".$sepeLogParticipantTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeLogParticipantTable." + CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeLogParticipantTable." + CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeLogParticipantTable." + CHANGE `fecha_alta` `registration_date` DATE"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeLogParticipantTable." + CHANGE `fecha_baja` `leaving_date` DATE"; + Database::query($sql); + + $sepeLogModParticipantTable = self::TABLE_SEPE_LOG_MOD_PARTICIPANT; + $sql = "ALTER TABLE ".$sepeLogModParticipantTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeLogModParticipantTable." + CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeLogModParticipantTable." + CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeLogModParticipantTable." + CHANGE `fecha_mod` `change_date` DATE"; + Database::query($sql); + + $sepeCenterTable = self::TABLE_SEPE_CENTER; + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `origen_centro` `center_origin` VARCHAR( 255 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `codigo_centro` `center_code` VARCHAR( 255 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `nombre_centro` `center_name` VARCHAR( 255 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `url` `url` VARCHAR( 255 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `url_seguimiento` `tracking_url` VARCHAR( 255 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `telefono` `phone` VARCHAR( 255 )"; + Database::query($sql); + $sql = "ALTER TABLE ".$sepeCenterTable." + CHANGE `email` `mail` VARCHAR( 255 )"; + Database::query($sql); + } +} diff --git a/search.php b/search.php index 8740473300..60999deec9 100644 --- a/search.php +++ b/search.php @@ -451,7 +451,7 @@ foreach ($elements as $element) { $fieldsToShow = [ 'heures_disponibilite_par_semaine', - 'moment_de_disponibilite' + 'moment_de_disponibilite', ]; $extra = $extraField->addElements( @@ -685,14 +685,12 @@ $userForm->addLabel(null, get_lang('MonEnvironnementDeTravailExplanationIntro2') $jqueryExtra .= $extra['jquery_ready_content']; - $fieldsToShow = [ 'browser_platforme', 'browser_platforme_autre', 'browser_platforme_version', ]; - $extra = $extraField->addElements( $userForm, api_get_user_id(), @@ -714,12 +712,8 @@ $userForm->addButtonSave(get_lang('Save'), 'submit_partial[collapseEight]'); $userForm->addHtml(''); $userForm->addHtml(''); - $userForm->addHtml(''); - - - $htmlHeadXtra[] = '