Internal: Fix php warnings, notices

pull/3466/head
Julio Montoya 5 years ago
parent 033a533ce9
commit 3b93f3a80b
  1. 1
      public/main/admin/add_courses_to_usergroup.php
  2. 2
      public/main/admin/add_sessions_to_promotion.php
  3. 2
      public/main/admin/add_sessions_to_usergroup.php
  4. 2
      public/main/admin/add_users_to_usergroup.php
  5. 5
      public/main/admin/configure_inscription.php
  6. 5
      public/main/admin/configure_plugin.php
  7. 6
      public/main/admin/course_category.php
  8. 3
      public/main/admin/course_edit.php
  9. 36
      public/main/admin/index.php
  10. 4
      src/CoreBundle/Controller/SessionController.php
  11. 2
      src/CoreBundle/Framework/Container.php
  12. 8
      src/CoreBundle/Hook/HookManagement.php

@ -281,7 +281,6 @@ echo Display::select(
['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'], ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'],
false false
); );
unset($sessionUsersList);
?> ?>
</td> </td>
</tr> </tr>

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
// resetting the course id // resetting the course id
@ -235,7 +236,6 @@ if (!empty($errorMsg)) {
['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'session_in_promotion', 'size' => '15px'], ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'session_in_promotion', 'size' => '15px'],
false false
); );
unset($sessionUsersList);
?> ?>
</td> </td>
</tr> </tr>

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
// resetting the course id // resetting the course id
@ -263,7 +264,6 @@ echo Display::select(
['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'], ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'],
false false
); );
unset($sessionUsersList);
?> ?>
</td> </td>
</tr> </tr>

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
// resetting the course id // resetting the course id
@ -453,7 +454,6 @@ echo Display::input('hidden', 'add_type', null);
], ],
false false
); );
unset($sessionUsersList);
?> ?>
</div> </div>
</div> </div>

@ -351,9 +351,8 @@ $content .= '&nbsp;&nbsp;<a href="'.api_get_self().'?action=edit_top">'.
$content .= $form->returnForm(); $content .= $form->returnForm();
$page = Container::getPage('inscription'); //$page = Container::getPage('inscription');
//$tpl->assign('page', $page);
$tpl->assign('page', $page);
$tpl->assign('form', $content); $tpl->assign('form', $content);
$templateName = $tpl->get_template('auth/inscription_edit.html.twig'); $templateName = $tpl->get_template('auth/inscription_edit.html.twig');

@ -69,7 +69,7 @@ if (isset($form)) {
foreach ($values as $key => $value) { foreach ($values as $key => $value) {
api_add_setting( api_add_setting(
$value, $value,
Database::escape_string($pluginName.'_'.$key), $pluginName.'_'.$key,
$pluginName, $pluginName,
'setting', 'setting',
'Plugins', 'Plugins',
@ -81,12 +81,13 @@ if (isset($form)) {
1 1
); );
} }
Event::addEvent( Event::addEvent(
LOG_PLUGIN_CHANGE, LOG_PLUGIN_CHANGE,
LOG_PLUGIN_SETTINGS_CHANGE, LOG_PLUGIN_SETTINGS_CHANGE,
$pluginName, $pluginName,
api_get_utc_datetime(), api_get_utc_datetime(),
$user_id api_get_user_id()
); );
if (!empty($pluginInfo['plugin_class'])) { if (!empty($pluginInfo['plugin_class'])) {

@ -23,13 +23,13 @@ $action = isset($_GET['action']) ? $_GET['action'] : null;
$myCourseListAsCategory = api_get_configuration_value('my_courses_list_as_category'); $myCourseListAsCategory = api_get_configuration_value('my_courses_list_as_category');
if (!empty($action)) { if (!empty($action)) {
if ('delete' == $action) { if ('delete' === $action) {
CourseCategory::deleteNode($categoryId); CourseCategory::deleteNode($categoryId);
Display::addFlash(Display::return_message(get_lang('Deleted'))); Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); header('Location: '.api_get_self().'?category='.Security::remove_XSS($category));
exit(); exit();
} elseif (('add' == $action || 'edit' == $action) && isset($_POST['formSent']) && $_POST['formSent']) { } elseif (('add' == $action || 'edit' === $action) && isset($_POST['formSent']) && $_POST['formSent']) {
if ('add' == $action) { if ('add' === $action) {
$ret = CourseCategory::addNode( $ret = CourseCategory::addNode(
$_POST['code'], $_POST['code'],
$_POST['name'], $_POST['name'],

@ -154,8 +154,7 @@ if ($countCategories >= 100) {
// Category code // Category code
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category'; $url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
$categorySelect = $form->addElement( $categorySelect = $form->addSelectAjax(
'select_ajax',
'category_id', 'category_id',
get_lang('Category'), get_lang('Category'),
null, null,

@ -541,42 +541,6 @@ if (api_is_platform_admin()) {
$blocks['version_check']['search_form'] = null; $blocks['version_check']['search_form'] = null;
$blocks['version_check']['items'] = '<div class="block-admin-version_check"></div>'; $blocks['version_check']['items'] = '<div class="block-admin-version_check"></div>';
$blocks['version_check']['class'] = ''; $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'; $admin_ajax_url = api_get_path(WEB_AJAX_PATH).'admin.ajax.php';

@ -192,8 +192,6 @@ class SessionController extends AbstractController
} }
} }
$courseController = new CoursesController();
$plugin = \BuyCoursesPlugin::create(); $plugin = \BuyCoursesPlugin::create();
$checker = $plugin->isEnabled(); $checker = $plugin->isEnabled();
$sessionIsPremium = null; $sessionIsPremium = null;
@ -235,7 +233,7 @@ class SessionController extends AbstractController
$session->getId(), $session->getId(),
api_get_user_id() api_get_user_id()
), ),
'subscribe_button' => $courseController->getRegisteredInSessionButton( 'subscribe_button' => \CoursesAndSessionsCatalog::getRegisteredInSessionButton(
$session->getId(), $session->getId(),
$session->getName(), $session->getName(),
$hasRequirements, $hasRequirements,

@ -5,7 +5,6 @@
namespace Chamilo\CoreBundle\Framework; namespace Chamilo\CoreBundle\Framework;
use Chamilo\CoreBundle\Component\Editor\Editor; use Chamilo\CoreBundle\Component\Editor\Editor;
use Chamilo\CoreBundle\Hook\Interfaces\HookEventInterface;
use Chamilo\CoreBundle\Manager\SettingsManager; use Chamilo\CoreBundle\Manager\SettingsManager;
use Chamilo\CoreBundle\Repository\AccessUrlRepository; use Chamilo\CoreBundle\Repository\AccessUrlRepository;
use Chamilo\CoreBundle\Repository\CourseCategoryRepository; use Chamilo\CoreBundle\Repository\CourseCategoryRepository;
@ -37,7 +36,6 @@ use Chamilo\CourseBundle\Repository\CShortcutRepository;
use Chamilo\CourseBundle\Repository\CStudentPublicationAssignmentRepository; use Chamilo\CourseBundle\Repository\CStudentPublicationAssignmentRepository;
use Chamilo\CourseBundle\Repository\CStudentPublicationCommentRepository; use Chamilo\CourseBundle\Repository\CStudentPublicationCommentRepository;
use Chamilo\CourseBundle\Repository\CStudentPublicationRepository; use Chamilo\CourseBundle\Repository\CStudentPublicationRepository;
use Chamilo\PageBundle\Entity\Page;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;

@ -12,7 +12,7 @@ use Doctrine\ORM\EntityManager;
/** /**
* @TODO: Improve description * @TODO: Improve description
*/ */
class HookManagement implements HookManagementInterface class HookManagement
{ {
private $entityManager; private $entityManager;
@ -132,8 +132,8 @@ class HookManagement implements HookManagementInterface
* *
* @return int * @return int
*/ */
public function orderHook($eventName, $type, $hookOrders) //public function orderHook($eventName, $type, $hookOrders)
{ //{
/*foreach ($this->hookCalls[$eventName] as $observerClassName => $types) { /*foreach ($this->hookCalls[$eventName] as $observerClassName => $types) {
foreach ($hookOrders as $oldOrder => $newOrder) { foreach ($hookOrders as $oldOrder => $newOrder) {
$res = Database::update( $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. * Return a list an associative array where keys are the active hook observer class name.

Loading…
Cancel
Save