Minor - Format code, add "exit" after redirect using header.

pull/2487/head
jmontoyaa 8 years ago
parent e60adf4072
commit 5f48b8f811
  1. 5
      plugin/sepe/src/configuration.php
  2. 7
      plugin/sepe/src/formative-action-edit.php
  3. 4
      plugin/sepe/src/formative-action.php
  4. 4
      plugin/sepe/src/formative-actions-list.php
  5. 3
      plugin/sepe/src/identification-data-edit.php
  6. 4
      plugin/sepe/src/identification-data.php
  7. 1
      plugin/sepe/src/index.sepe.php
  8. 9
      plugin/sepe/src/participant-action-edit.php
  9. 13
      plugin/sepe/src/participant-specialty-edit.php
  10. 4
      plugin/sepe/src/sepe-administration-menu.php
  11. 2
      plugin/sepe/src/sepe.lib.php
  12. 1
      plugin/sepe/src/sepe_plugin.class.php
  13. 22
      plugin/sepe/src/specialty-action-edit.php
  14. 6
      plugin/sepe/src/specialty-classroom-edit.php
  15. 6
      plugin/sepe/src/specialty-tutor-edit.php
  16. 10
      plugin/sepe/src/specialty-tutorial-edit.php

@ -1,12 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays setting api key user.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -22,7 +22,6 @@ if (api_is_platform_admin()) {
if (Database::num_rows($result) > 0) {
$tmp = Database::fetch_assoc($result);
$info = $tmp['api'];
} else {
$info = '';
}

@ -1,10 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a formative action edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -163,7 +164,7 @@ if (api_is_platform_admin()) {
$templateName = $plugin->get_lang('formativeActionEdit');
$tpl = new Template($templateName);
$tpl->assign('info', $info);
if ($info['start_date'] != "0000-00-00" && $info['start_date'] != NULL) {
if ($info['start_date'] != "0000-00-00" && $info['start_date'] != null) {
$tpl->assign('day_start', date("j", strtotime($info['start_date'])));
$tpl->assign('month_start', date("n", strtotime($info['start_date'])));
$tpl->assign('year_start', date("Y", strtotime($info['start_date'])));
@ -173,7 +174,7 @@ if (api_is_platform_admin()) {
} else {
$yearStart = date("Y");
}
if ($info['end_date'] != "0000-00-00" && $info['end_date'] != NULL) {
if ($info['end_date'] != "0000-00-00" && $info['end_date'] != null) {
$tpl->assign('day_end', date("j", strtotime($info['end_date'])));
$tpl->assign('month_end', date("n", strtotime($info['end_date'])));
$tpl->assign('year_end', date("Y", strtotime($info['end_date'])));

@ -1,12 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a basic info of formative action.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';

@ -1,11 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a formatives actions list.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();

@ -1,10 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a data center edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();

@ -1,12 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a basic info about data center.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();

@ -1,5 +1,6 @@
<?php
/* For license terms, see /license.txt */
/**
* Index of the Sepe plugin
*/

@ -1,11 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a participant edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -15,8 +16,8 @@ $_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$companyTutorId = (!empty($_POST['company_tutor_id']) ? intval($_POST['company_tutor_id']) : NULL);
$trainingTutorId = (!empty($_POST['training_tutor_id']) ? intval($_POST['training_tutor_id']) : NULL);
$companyTutorId = (!empty($_POST['company_tutor_id']) ? intval($_POST['company_tutor_id']) : null);
$trainingTutorId = (!empty($_POST['training_tutor_id']) ? intval($_POST['training_tutor_id']) : null);
$tutorCompanyDocumentType = Database::escape_string(trim($_POST['tutor_company_document_type']));
$tutorCompanyDocumentNumber = Database::escape_string(trim($_POST['tutor_company_document_number']));
$tutorCompanyDocumentLetter = Database::escape_string(trim($_POST['tutor_company_document_letter']));
@ -158,6 +159,7 @@ if (!empty($_POST)) {
}
session_write_close();
header("Location: participant-action-edit.php?new_participant=0&participant_id=".$participantId."&action_id=".$actionId);
exit;
} else {
$participantId = intval($_POST['participant_id']);
$actionId = intval($_POST['action_id']);
@ -167,6 +169,7 @@ if (!empty($_POST)) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
session_write_close();
header("Location: participant-action-edit.php?new_participant=".$newParticipant."&participant_id=".$participantId."&action_id=".$actionId);
exit;
}
} else {
$token = Security::get_token();

@ -1,11 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a participant specialty edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -141,6 +142,7 @@ if (!empty($_POST)) {
}
session_write_close();
header("Location: participant-specialty-edit.php?new_specialty=0&specialty_id=".$specialtyId."&participant_id=".$participantId."&action_id=".$actionId);
exit;
} else {
$newSpecialty = intval($_POST['new_specialty']);
$participantId = intval($_POST['participant_id']);
@ -151,6 +153,7 @@ if (!empty($_POST)) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
session_write_close();
header("Location: participant-specialty-edit.php?new_specialty=".$newSpecialty."&specialty_id=".$specialtyId."&participant_id=".$participantId."&action_id=".$actionId);
exit;
}
} else {
$token = Security::get_token();
@ -182,7 +185,7 @@ if (api_is_platform_admin()) {
$info = getInfoSpecialtyParticipant(intval($_GET['specialty_id']));
$tpl->assign('info', $info);
$tpl->assign('new_specialty', '0');
if ($info['registration_date'] != '0000-00-00' && $info['registration_date'] != NULL) {
if ($info['registration_date'] != '0000-00-00' && $info['registration_date'] != null) {
$tpl->assign('day_registration', date("j", strtotime($info['registration_date'])));
$tpl->assign('month_registration', date("n", strtotime($info['registration_date'])));
$tpl->assign('year_registration', date("Y", strtotime($info['registration_date'])));
@ -192,7 +195,7 @@ if (api_is_platform_admin()) {
} else {
$registrationYear = date("Y");
}
if ($info['leaving_date'] != '0000-00-00' && $info['leaving_date'] != NULL) {
if ($info['leaving_date'] != '0000-00-00' && $info['leaving_date'] != null) {
$tpl->assign('day_leaving', date("j", strtotime($info['leaving_date'])));
$tpl->assign('month_leaving', date("n", strtotime($info['leaving_date'])));
$tpl->assign('year_leaving', date("Y", strtotime($info['leaving_date'])));
@ -202,7 +205,7 @@ if (api_is_platform_admin()) {
} else {
$leaveYear = date("Y");
}
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != NULL) {
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != null) {
$tpl->assign('day_start', date("j", strtotime($info['start_date'])));
$tpl->assign('month_start', date("n", strtotime($info['start_date'])));
$tpl->assign('year_start', date("Y", strtotime($info['start_date'])));
@ -212,7 +215,7 @@ if (api_is_platform_admin()) {
} else {
$startYear = date("Y");
}
if ($info['end_date'] != '0000-00-00' && $info['end_date'] != NULL) {
if ($info['end_date'] != '0000-00-00' && $info['end_date'] != null) {
$tpl->assign('day_end', date("j", strtotime($info['end_date'])));
$tpl->assign('month_end', date("n", strtotime($info['end_date'])));
$tpl->assign('year_end', date("Y", strtotime($info['end_date'])));

@ -1,12 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a administrator menu.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();

@ -186,7 +186,7 @@ function getCentersList()
function listTutorType($condition)
{
global $tableTutorCompany;
$sql = "SELECT * FROM $tableTutorCompany WHERE ".$condition." ORDER BY alias ASC, document_number ASC;";
$sql = "SELECT * FROM $tableTutorCompany WHERE ".$condition." ORDER BY alias ASC, document_number ASC;";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {

@ -1,5 +1,6 @@
<?php
/* For license terms, see /license.txt */
/**
* Plugin class for the SEPE plugin
* @package chamilo.plugin.sepe

@ -1,11 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a specialty action edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -155,9 +156,18 @@ if (!empty($_POST)) {
if (api_is_platform_admin()) {
$id_course = getCourse(intval($_GET['action_id']));
$interbreadcrumb[] = array("url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe'));
$interbreadcrumb[] = array("url" => "formative-actions-list.php", "name" => $plugin->get_lang('FormativesActionsList'));
$interbreadcrumb[] = array("url" => "formative-action.php?cid=".$id_course, "name" => $plugin->get_lang('FormativeAction'));
$interbreadcrumb[] = array(
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
);
$interbreadcrumb[] = array(
"url" => "formative-actions-list.php",
"name" => $plugin->get_lang('FormativesActionsList'),
);
$interbreadcrumb[] = array(
"url" => "formative-action.php?cid=".$id_course,
"name" => $plugin->get_lang('FormativeAction'),
);
if (isset($_GET['new_specialty']) && intval($_GET['new_specialty']) == 1) {
$templateName = $plugin->get_lang('NewSpecialtyAccion');
$tpl = new Template($templateName);
@ -172,7 +182,7 @@ if (api_is_platform_admin()) {
$tpl->assign('action_id', intval($_GET['action_id']));
$info = getSpecialtActionInfo(intval($_GET['specialty_id']));
$tpl->assign('info', $info);
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != NULL) {
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != null) {
$tpl->assign('day_start', date("j", strtotime($info['start_date'])));
$tpl->assign('month_start', date("n", strtotime($info['start_date'])));
$tpl->assign('year_start', date("Y", strtotime($info['start_date'])));
@ -182,7 +192,7 @@ if (api_is_platform_admin()) {
} else {
$yearStart = date("Y");
}
if ($info['end_date'] != '0000-00-00' && $info['end_date'] != NULL) {
if ($info['end_date'] != '0000-00-00' && $info['end_date'] != null) {
$tpl->assign('day_end', date("j", strtotime($info['end_date'])));
$tpl->assign('month_end', date("n", strtotime($info['end_date'])));
$tpl->assign('year_end', date("Y", strtotime($info['end_date'])));

@ -1,11 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a specialty classroom edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -69,6 +69,7 @@ if (!empty($_POST)) {
}
session_write_close();
header("Location: specialty-action-edit.php?new_specialty=0&specialty_id=".$specialtyId."&action_id=".$actionId);
exit;
} else {
$newClassroom = intval($_POST['new_classroom']);
$actionId = intval($_POST['action_id']);
@ -79,6 +80,7 @@ if (!empty($_POST)) {
$token = Security::get_token();
session_write_close();
header("Location:specialty-classroom-edit.php?new_classroom=".$newClassroom."&specialty_id=".$specialtyId."&classroom_id=".$classroomId."&action_id=".$actionId);
exit;
}
} else {
$token = Security::get_token();

@ -1,11 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a specialty tutors edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -153,6 +154,7 @@ if (!empty($_POST)) {
}
session_write_close();
header("Location: specialty-action-edit.php?new_specialty=0&specialty_id=".$specialtyId."&action_id=".$actionId);
exit;
} else {
$actionId = intval($_POST['action_id']);
$newTutor = intval($_POST['new_tutor']);
@ -163,6 +165,7 @@ if (!empty($_POST)) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
session_write_close();
header("Location: specialty-tutor-edit.php?new_tutor=".$newTutor."&specialty_id=".$specialtyId."&tutor_id=".$specialtyTutorId."&action_id=".$actionId);
exit;
}
} else {
$token = Security::get_token();
@ -217,4 +220,5 @@ if (api_is_platform_admin()) {
$tpl->display_one_col_template();
} else {
header('Location:'.api_get_path(WEB_PATH));
exit;
}

@ -1,11 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
/**
* This script displays a specialty tutorial edit form.
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
@ -62,6 +63,7 @@ if (!empty($_POST)) {
session_write_close();
$participantId = getParticipantId($specialtyId);
header("Location: participant-specialty-edit.php?new_specialty=0&participant_id=".$participantId."&specialty_id=".$specialtyId."&action_id=".$actionId);
exit;
} else {
$tutorialId = intval($_POST['tutorial_id']);
$actionId = intval($_POST['action_id']);
@ -72,6 +74,7 @@ if (!empty($_POST)) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
session_write_close();
header("Location: specialty-tutorial-edit.php?new_tutorial=".$newTutorial."&specialty_id=".$specialtyId."&tutorial_id=".$tutorialId."&action_id=".$actionId);
exit;
}
} else {
$token = Security::get_token();
@ -102,7 +105,7 @@ if (api_is_platform_admin()) {
$info = getInfoSpecialtyTutorial(intval($_GET['tutorial_id']));
$tpl->assign('info', $info);
$tpl->assign('new_tutorial', '0');
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != NULL) {
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != null) {
$tpl->assign('day_start', date("j", strtotime($info['start_date'])));
$tpl->assign('month_start', date("n", strtotime($info['start_date'])));
$tpl->assign('year_start', date("Y", strtotime($info['start_date'])));
@ -112,7 +115,7 @@ if (api_is_platform_admin()) {
} else {
$startYear = date("Y");
}
if ($info['end_date'] != '0000-00-00' && $info['end_date'] != NULL) {
if ($info['end_date'] != '0000-00-00' && $info['end_date'] != null) {
$tpl->assign('day_end', date("j", strtotime($info['end_date'])));
$tpl->assign('month_end', date("n", strtotime($info['end_date'])));
$tpl->assign('year_end', date("Y", strtotime($info['end_date'])));
@ -154,4 +157,5 @@ if (api_is_platform_admin()) {
$tpl->display_one_col_template();
} else {
header('Location:'.api_get_path(WEB_PATH));
exit;
}

Loading…
Cancel
Save