Files
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

67 lines
1.6 KiB
PHP

<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
$allowSessionAdmins = api_get_plugin_setting('justification', 'access_for_session_admin') === 'true';
api_protect_admin_script($allowSessionAdmins);
$tool = 'justification';
$plugin = Justification::create();
$tpl = new Template($tool);
$fields = [];
$list = $plugin->getList();
$tpl->assign('list', $list);
$content = $tpl->fetch('justification/view/list.tpl');
$actionLinks = '';
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
switch ($action) {
case 'delete':
$sql = "DELETE FROM justification_document WHERE id = $id";
Database::query($sql);
Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: '.api_get_self());
exit;
break;
}
if (api_is_platform_admin()) {
$actionLinks .= Display::toolbarButton(
$plugin->get_lang('Add'),
api_get_path(WEB_PLUGIN_PATH).'justification/add.php',
'plus',
'primary'
);
}
$actionLinks .= Display::toolbarButton(
$plugin->get_lang('Users'),
api_get_path(WEB_PLUGIN_PATH).'justification/justification_by_user.php',
'user',
'primary'
);
if (api_is_platform_admin()) {
$actionLinks .= Display::toolbarButton(
$plugin->get_lang('SetNewCourse'),
api_get_path(WEB_PLUGIN_PATH).'justification/set_course.php',
'book',
'primary'
);
}
$tpl->assign(
'actions',
Display::toolbarAction('toolbar', [$actionLinks])
);
$tpl->assign('content', $content);
$tpl->display_one_col_template();