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. 4
      public/main/admin/add_users_to_usergroup.php
  5. 7
      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'],
false
);
unset($sessionUsersList);
?>
</td>
</tr>

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

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

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
// resetting the course id
@ -60,7 +61,7 @@ function validate_filter() {
document.formulaire.submit();
}
function checked_in_no_group(checked)
function checked_in_no_group(checked)
{
$("#relation")
.find("option")
@ -453,7 +454,6 @@ echo Display::input('hidden', 'add_type', null);
],
false
);
unset($sessionUsersList);
?>
</div>
</div>

@ -346,14 +346,13 @@ $url = api_get_path(WEB_PUBLIC_PATH).'internal_page/edit/inscription';
//Form of language
//$content .= api_display_language_form();
$content .= '&nbsp;&nbsp;<a href="'.api_get_self().'?action=edit_top">'.
Display::return_icon('edit.gif', get_lang('Edit')).'</a>
Display::return_icon('edit.gif', get_lang('Edit')).'</a>
<a href="'.$url.'">'.get_lang('Edit notice').'</a>';
$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');

@ -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'])) {

@ -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'],

@ -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,

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

@ -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,

@ -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;

@ -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.

Loading…
Cancel
Save