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. 12
      plugin/sepe/src/formative-action.php
  4. 10
      plugin/sepe/src/formative-actions-list.php
  5. 5
      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. 8
      plugin/sepe/src/sepe.lib.php
  12. 41
      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';
@ -17,19 +17,19 @@ if (api_is_platform_admin()) {
$actionId = getActionId(intval($_GET['cid']));
$info = getActionInfo($actionId);
if ($info === false) {
header("Location: formative-actions-list.php");
header("Location: formative-actions-list.php");
}
$templateName = $plugin->get_lang('FormativeActionData');
$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'));
$tpl = new Template($templateName);
if (isset($_SESSION['sepe_message_info'])) {
$tpl->assign('message_info', $_SESSION['sepe_message_info']);
$tpl->assign('message_info', $_SESSION['sepe_message_info']);
unset($_SESSION['sepe_message_info']);
}
if (isset($_SESSION['sepe_message_error'])) {
$tpl->assign('message_error', $_SESSION['sepe_message_error']);
$tpl->assign('message_error', $_SESSION['sepe_message_error']);
unset($_SESSION['sepe_message_error']);
}

@ -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();
@ -14,13 +14,13 @@ if (api_is_platform_admin()) {
$templateName = $plugin->get_lang('FormativesActionsList');
$interbreadcrumb[] = array("url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe'));
$tpl = new Template($templateName);
if (isset($_SESSION['sepe_message_info'])) {
$tpl->assign('message_info', $_SESSION['sepe_message_info']);
$tpl->assign('message_info', $_SESSION['sepe_message_info']);
unset($_SESSION['sepe_message_info']);
}
if (isset($_SESSION['sepe_message_error'])) {
$tpl->assign('message_error', $_SESSION['sepe_message_error']);
$tpl->assign('message_error', $_SESSION['sepe_message_error']);
unset($_SESSION['sepe_message_error']);
}
$courseActionList = listCourseAction();

@ -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();
@ -30,7 +31,7 @@ if (!empty($_POST)) {
tracking_url = '".$trackingUrl."',
phone = '".$phone."',
mail = '".$mail."'
WHERE id = $id";
WHERE id = $id";
} else {
$sql = "INSERT INTO $tableSepeCenter (
id,

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

@ -78,7 +78,7 @@ function getCourseCode($actionId)
{
global $tableCourse;
$courseId = getCourse($actionId);
$sql = "SELECT code FROM $tableCourse WHERE id = $courseId";
$sql = "SELECT code FROM $tableCourse WHERE id = $courseId";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['code'];
@ -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)) {
@ -195,7 +195,7 @@ function listTutorType($condition)
if (trim($row['alias']) != '') {
$tmp['alias'] = $row['alias'].' - '.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
} else {
$tmp['alias'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
$tmp['alias'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
}
$aux[] = $tmp;
}
@ -224,7 +224,7 @@ function getTutorsSpecialty($specialtyId)
if (trim($row['firstname']) != '' || trim($row['lastname']) != '') {
$tutor['data'] = $row['firstname'].' '.$row['lastname'].' ('.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'].' )';
} else {
$tutor['data'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
$tutor['data'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
}
$aux[] = $tutor;
}

@ -1,5 +1,6 @@
<?php
/* For license terms, see /license.txt */
/**
* Plugin class for the SEPE plugin
* @package chamilo.plugin.sepe
@ -24,7 +25,7 @@ class SepePlugin extends Plugin
const TABLE_SEPE_LOG_PARTICIPANT = 'plugin_sepe_log_participant';
const TABLE_SEPE_LOG_MOD_PARTICIPANT = 'plugin_sepe_log_mod_participant';
const TABLE_SEPE_LOG = 'plugin_sepe_log';
public $isAdminPlugin = true;
/**
@ -47,7 +48,7 @@ class SepePlugin extends Plugin
array('sepe_enable' => 'boolean')
);
}
/**
* This method creates the tables required to this plugin
*/
@ -82,7 +83,7 @@ class SepePlugin extends Plugin
require_once api_get_path(SYS_PLUGIN_PATH).'sepe/database.php';
}
/**
* This method drops the plugin tables
*/
@ -128,7 +129,7 @@ class SepePlugin extends Plugin
. $oldTableTutorsCompany." TO ".self::TABLE_SEPE_TUTORS_COMPANY.", "
. $oldTableCompetence." TO ".self::TABLE_SEPE_TEACHING_COMPETENCE.";";
Database::query($sql);
$sepeCourseActionsTable = self::TABLE_SEPE_COURSE_ACTIONS;
$sql = "ALTER TABLE ".$sepeCourseActionsTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -136,7 +137,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCourseActionsTable." CHANGE `id_course` `course_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sepeActionsTable = self::TABLE_SEPE_ACTIONS;
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -174,7 +175,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `CONTACTO_ACCION` `contact_action` LONGTEXT";
Database::query($sql);
$sepeSpecialtyTable = self::TABLE_SEPE_SPECIALTY;
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -226,7 +227,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `NUMERO_ACTIVIDADES_EVALUACION` `evaluation_activity_count` INT( 10 ) UNSIGNED";
Database::query($sql);
$sepeParticipantTable = self::TABLE_SEPE_PARTICIPANTS;
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -250,7 +251,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `CIF_EMPRESA` `company_fiscal_number` VARCHAR( 9 )";
Database::query($sql);
$sepeCenterTable = self::TABLE_SEPE_CENTERS;
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -258,7 +259,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)";
Database::query($sql);
$sepeSpecialtyClassroomTable = self::TABLE_SEPE_SPECIALTY_CLASSROOM;
$sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -266,7 +267,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." CHANGE `cod_centro` `center_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sepeSpecialtyTutorsTable = self::TABLE_SEPE_SPECIALTY_TUTORS;
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -284,7 +285,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `FORMACION_MODALIDAD_TELEFORMACION` `training_teleforming` VARCHAR(2)";
Database::query($sql);
$sepeTutorsTable = self::TABLE_SEPE_TUTORS;
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -306,7 +307,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `FORMACION_MODALIDAD_TELEFORMACION` `training_teleforming` VARCHAR(2)";
Database::query($sql);
$sepeParticipantSpecialtyTable = self::TABLE_SEPE_PARTICIPANTS_SPECIALTY;
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -336,7 +337,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `PUNTUACION_FINAL` `final_score` VARCHAR(4)";
Database::query($sql);
$sepeParticipantSpecialtyTutorialsTable = self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS;
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -350,9 +351,9 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." CHANGE `FECHA_FIN` `end_date` DATE";
Database::query($sql);
$sepeTutorsCompanyTable = self::TABLE_SEPE_TUTORS_COMPANY;
$sql = "UPDATE ".$sepeTutorsCompanyTable." SET empresa='1' WHERE empresa='SI'";
Database::query($sql);
$sql = "UPDATE ".$sepeTutorsCompanyTable." SET empresa='0' WHERE empresa='NO'";
@ -361,7 +362,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "UPDATE ".$sepeTutorsCompanyTable." SET formacion='0' WHERE formacion='NO'";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsCompanyTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsCompanyTable." CHANGE `alias` `alias` VARCHAR(255)";
@ -376,13 +377,13 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsCompanyTable." CHANGE `formacion` `training` VARCHAR(1)";
Database::query($sql);
$sepeCompetenceTable = self::TABLE_SEPE_TEACHING_COMPETENCE;
$sql = "ALTER TABLE ".$sepeCompetenceTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCompetenceTable." CHANGE `valor` `value` LONGTEXT";
Database::query($sql);
$sepeLogParticipantTable = self::TABLE_SEPE_LOG_PARTICIPANT;
$sql = "ALTER TABLE ".$sepeLogParticipantTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -394,7 +395,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeLogParticipantTable." CHANGE `fecha_baja` `leaving_date` DATE";
Database::query($sql);
$sepeLogModParticipantTable = self::TABLE_SEPE_LOG_MOD_PARTICIPANT;
$sql = "ALTER TABLE ".$sepeLogModParticipantTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);
@ -404,7 +405,7 @@ class SepePlugin extends Plugin
Database::query($sql);
$sql = "ALTER TABLE ".$sepeLogModParticipantTable." CHANGE `fecha_mod` `change_date` DATE";
Database::query($sql);
$sepeCenterTable = self::TABLE_SEPE_CENTER;
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `cod` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT";
Database::query($sql);

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