diff --git a/public/main/admin/add_courses_to_usergroup.php b/public/main/admin/add_courses_to_usergroup.php index b63db1e27c..1b7fceb157 100644 --- a/public/main/admin/add_courses_to_usergroup.php +++ b/public/main/admin/add_courses_to_usergroup.php @@ -281,7 +281,6 @@ echo Display::select( ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'], false ); -unset($sessionUsersList); ?> diff --git a/public/main/admin/add_sessions_to_promotion.php b/public/main/admin/add_sessions_to_promotion.php index c4db603768..19ce2b3b80 100644 --- a/public/main/admin/add_sessions_to_promotion.php +++ b/public/main/admin/add_sessions_to_promotion.php @@ -1,4 +1,5 @@ 'width:360px', 'multiple' => 'multiple', 'id' => 'session_in_promotion', 'size' => '15px'], false ); - unset($sessionUsersList); ?> diff --git a/public/main/admin/add_sessions_to_usergroup.php b/public/main/admin/add_sessions_to_usergroup.php index 6d3e24fcfc..e54377fdaa 100644 --- a/public/main/admin/add_sessions_to_usergroup.php +++ b/public/main/admin/add_sessions_to_usergroup.php @@ -1,4 +1,5 @@ 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'], false ); - unset($sessionUsersList); ?> diff --git a/public/main/admin/add_users_to_usergroup.php b/public/main/admin/add_users_to_usergroup.php index efcf642b6d..228e6ac591 100644 --- a/public/main/admin/add_users_to_usergroup.php +++ b/public/main/admin/add_users_to_usergroup.php @@ -1,4 +1,5 @@ diff --git a/public/main/admin/configure_inscription.php b/public/main/admin/configure_inscription.php index e5f62b93fe..b26d9270af 100644 --- a/public/main/admin/configure_inscription.php +++ b/public/main/admin/configure_inscription.php @@ -346,14 +346,13 @@ $url = api_get_path(WEB_PUBLIC_PATH).'internal_page/edit/inscription'; //Form of language //$content .= api_display_language_form(); $content .= '  '. - Display::return_icon('edit.gif', get_lang('Edit')).' + Display::return_icon('edit.gif', get_lang('Edit')).' '.get_lang('Edit notice').''; $content .= $form->returnForm(); -$page = Container::getPage('inscription'); - -$tpl->assign('page', $page); +//$page = Container::getPage('inscription'); +//$tpl->assign('page', $page); $tpl->assign('form', $content); $templateName = $tpl->get_template('auth/inscription_edit.html.twig'); diff --git a/public/main/admin/configure_plugin.php b/public/main/admin/configure_plugin.php index ff2838ab69..8256afb039 100644 --- a/public/main/admin/configure_plugin.php +++ b/public/main/admin/configure_plugin.php @@ -69,7 +69,7 @@ if (isset($form)) { foreach ($values as $key => $value) { api_add_setting( $value, - Database::escape_string($pluginName.'_'.$key), + $pluginName.'_'.$key, $pluginName, 'setting', 'Plugins', @@ -81,12 +81,13 @@ if (isset($form)) { 1 ); } + Event::addEvent( LOG_PLUGIN_CHANGE, LOG_PLUGIN_SETTINGS_CHANGE, $pluginName, api_get_utc_datetime(), - $user_id + api_get_user_id() ); if (!empty($pluginInfo['plugin_class'])) { diff --git a/public/main/admin/course_category.php b/public/main/admin/course_category.php index fcdafeb518..ea0dec54e9 100644 --- a/public/main/admin/course_category.php +++ b/public/main/admin/course_category.php @@ -23,13 +23,13 @@ $action = isset($_GET['action']) ? $_GET['action'] : null; $myCourseListAsCategory = api_get_configuration_value('my_courses_list_as_category'); if (!empty($action)) { - if ('delete' == $action) { + if ('delete' === $action) { CourseCategory::deleteNode($categoryId); Display::addFlash(Display::return_message(get_lang('Deleted'))); header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); exit(); - } elseif (('add' == $action || 'edit' == $action) && isset($_POST['formSent']) && $_POST['formSent']) { - if ('add' == $action) { + } elseif (('add' == $action || 'edit' === $action) && isset($_POST['formSent']) && $_POST['formSent']) { + if ('add' === $action) { $ret = CourseCategory::addNode( $_POST['code'], $_POST['name'], diff --git a/public/main/admin/course_edit.php b/public/main/admin/course_edit.php index b1102bfdde..30fccb5e1e 100644 --- a/public/main/admin/course_edit.php +++ b/public/main/admin/course_edit.php @@ -154,8 +154,7 @@ if ($countCategories >= 100) { // Category code $url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category'; - $categorySelect = $form->addElement( - 'select_ajax', + $categorySelect = $form->addSelectAjax( 'category_id', get_lang('Category'), null, diff --git a/public/main/admin/index.php b/public/main/admin/index.php index 073d2ac87f..fb7319f7d1 100644 --- a/public/main/admin/index.php +++ b/public/main/admin/index.php @@ -541,42 +541,6 @@ if (api_is_platform_admin()) { $blocks['version_check']['search_form'] = null; $blocks['version_check']['items'] = '
'; $blocks['version_check']['class'] = ''; - - // Check Hook Event for Admin Block Object - if (!empty($hook)) { - // If not empty, then notify Post process to Hook Observers for Admin Block - $hook->setEventData(['blocks' => $blocks]); - $data = $hook->notifyAdminBlock(HOOK_EVENT_TYPE_POST); - // Check if blocks data is not null - if (isset($data['blocks'])) { - // Get modified blocks - $blocks = $data['blocks']; - } - } - - //Hack for fix migration on session_rel_user - $tableColumns = Database::getManager() - ->getConnection() - ->getSchemaManager() - ->listTableColumns( - Database::get_main_table(TABLE_MAIN_SESSION_USER) - ); - - if (!array_key_exists('duration', $tableColumns)) { - try { - $dbSchema = Database::getManager()->getConnection()->getSchemaManager(); - $durationColumn = new \Doctrine\DBAL\Schema\Column( - 'duration', - Doctrine\DBAL\Types\Type::getType(\Doctrine\DBAL\Types\Type::INTEGER), - ['notnull' => false] - ); - $tableDiff = new \Doctrine\DBAL\Schema\TableDiff('session_rel_user', [$durationColumn]); - $dbSchema->alterTable($tableDiff); - } catch (Exception $e) { - error_log($e->getMessage()); - } - } - //end hack } $admin_ajax_url = api_get_path(WEB_AJAX_PATH).'admin.ajax.php'; diff --git a/src/CoreBundle/Controller/SessionController.php b/src/CoreBundle/Controller/SessionController.php index f2f62f9b4c..a5922490fa 100644 --- a/src/CoreBundle/Controller/SessionController.php +++ b/src/CoreBundle/Controller/SessionController.php @@ -192,8 +192,6 @@ class SessionController extends AbstractController } } - $courseController = new CoursesController(); - $plugin = \BuyCoursesPlugin::create(); $checker = $plugin->isEnabled(); $sessionIsPremium = null; @@ -235,7 +233,7 @@ class SessionController extends AbstractController $session->getId(), api_get_user_id() ), - 'subscribe_button' => $courseController->getRegisteredInSessionButton( + 'subscribe_button' => \CoursesAndSessionsCatalog::getRegisteredInSessionButton( $session->getId(), $session->getName(), $hasRequirements, diff --git a/src/CoreBundle/Framework/Container.php b/src/CoreBundle/Framework/Container.php index 30eb7eea3d..de1fedabdd 100644 --- a/src/CoreBundle/Framework/Container.php +++ b/src/CoreBundle/Framework/Container.php @@ -5,7 +5,6 @@ namespace Chamilo\CoreBundle\Framework; use Chamilo\CoreBundle\Component\Editor\Editor; -use Chamilo\CoreBundle\Hook\Interfaces\HookEventInterface; use Chamilo\CoreBundle\Manager\SettingsManager; use Chamilo\CoreBundle\Repository\AccessUrlRepository; use Chamilo\CoreBundle\Repository\CourseCategoryRepository; @@ -37,7 +36,6 @@ use Chamilo\CourseBundle\Repository\CShortcutRepository; use Chamilo\CourseBundle\Repository\CStudentPublicationAssignmentRepository; use Chamilo\CourseBundle\Repository\CStudentPublicationCommentRepository; use Chamilo\CourseBundle\Repository\CStudentPublicationRepository; -use Chamilo\PageBundle\Entity\Page; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\Session; diff --git a/src/CoreBundle/Hook/HookManagement.php b/src/CoreBundle/Hook/HookManagement.php index fdae38806a..b65bbf0467 100644 --- a/src/CoreBundle/Hook/HookManagement.php +++ b/src/CoreBundle/Hook/HookManagement.php @@ -12,7 +12,7 @@ use Doctrine\ORM\EntityManager; /** * @TODO: Improve description */ -class HookManagement implements HookManagementInterface +class HookManagement { private $entityManager; @@ -132,8 +132,8 @@ class HookManagement implements HookManagementInterface * * @return int */ - public function orderHook($eventName, $type, $hookOrders) - { + //public function orderHook($eventName, $type, $hookOrders) + //{ /*foreach ($this->hookCalls[$eventName] as $observerClassName => $types) { foreach ($hookOrders as $oldOrder => $newOrder) { $res = Database::update( @@ -152,7 +152,7 @@ class HookManagement implements HookManagementInterface } } }*/ - } + //} /** * Return a list an associative array where keys are the active hook observer class name.