Adapt plugin SEPE to code convections

pull/2487/head
nosolored 9 years ago
parent e33c20ca80
commit de6a71a0ef
  1. 13
      plugin/sepe/admin.php
  2. 7
      plugin/sepe/config.php
  3. 532
      plugin/sepe/database.php
  4. 11
      plugin/sepe/index.php
  5. 11
      plugin/sepe/install.php
  6. 319
      plugin/sepe/js/sepe.js
  7. 326
      plugin/sepe/lang/english.php
  8. 304
      plugin/sepe/lang/spanish.php
  9. 3
      plugin/sepe/plugin.php
  10. 4
      plugin/sepe/readme.txt
  11. 77
      plugin/sepe/resources/plugin.css
  12. 42
      plugin/sepe/src/configuration.php
  13. 221
      plugin/sepe/src/formative-action-edit.php
  14. 51
      plugin/sepe/src/formative-action.php
  15. 41
      plugin/sepe/src/formative-actions-list.php
  16. 120
      plugin/sepe/src/function.php
  17. 94
      plugin/sepe/src/identification-data-edit.php
  18. 37
      plugin/sepe/src/identification-data.php
  19. 69
      plugin/sepe/src/index.sepe.php
  20. 230
      plugin/sepe/src/participant-action-edit.php
  21. 276
      plugin/sepe/src/participant-specialty-edit.php
  22. 62
      plugin/sepe/src/sepe-administration-menu.php
  23. 407
      plugin/sepe/src/sepe.lib.php
  24. 427
      plugin/sepe/src/sepe_plugin.class.php
  25. 236
      plugin/sepe/src/specialty-action-edit.php
  26. 135
      plugin/sepe/src/specialty-classroom-edit.php
  27. 224
      plugin/sepe/src/specialty-tutor-edit.php
  28. 159
      plugin/sepe/src/specialty-tutorial-edit.php
  29. 2
      plugin/sepe/uninstall.php
  30. 13
      plugin/sepe/update.php
  31. 33
      plugin/sepe/view/configuration.tpl
  32. 300
      plugin/sepe/view/formative-action-edit.tpl
  33. 269
      plugin/sepe/view/formative-action.tpl
  34. 71
      plugin/sepe/view/formative-actions-list.tpl
  35. 86
      plugin/sepe/view/identification-data-edit.tpl
  36. 96
      plugin/sepe/view/identification-data.tpl
  37. 318
      plugin/sepe/view/participant-action-edit.tpl
  38. 322
      plugin/sepe/view/participant-specialty-edit.tpl
  39. 5
      plugin/sepe/view/sepe-administration-menu.tpl
  40. 365
      plugin/sepe/view/specialty-action-edit.tpl
  41. 94
      plugin/sepe/view/specialty-classroom-edit.tpl
  42. 285
      plugin/sepe/view/specialty-tutor-edit.tpl
  43. 127
      plugin/sepe/view/specialty-tutorial-edit.tpl
  44. 4
      plugin/sepe/ws/ProveedorCentroTFWS.wsdl
  45. 1349
      plugin/sepe/ws/Sepe.php
  46. 102
      plugin/sepe/ws/service.php

@ -1,13 +1,12 @@
<?php
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
$plugin = SepePlugin::create();
$enable = $plugin->get('sepe_enable');
$pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/menu_sepe_administracion.php';
$enable = $plugin->get('sepe_enable') == 'true';
$pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/sepe-administration-menu.php';
if ($enable == "true" && api_is_platform_admin()) {
if ($enable && api_is_platform_admin()) {
header('Location:'.$pluginPath);
} else {
header('Location: ../../index.php');
}
header('Location: ../../index.php');
}

@ -1,9 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Config the plugin
* @author Jose Angel Ruiz <jaruiz@nosolored.com>
* @author Julio Montoya <gugli100@gmail.com>
* @package chamilo.plugin.sepe
*/
require_once __DIR__ . '/../../main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
require_once 'src/sepe.lib.php';
require_once 'src/sepe_plugin.class.php';

File diff suppressed because it is too large Load Diff

@ -1,7 +1,10 @@
<?php
/* For license terms, see /license.txt */
/* For licensing terms, see /license.txt */
/**
* Show form
* Config the plugin
* @author Jose Angel Ruiz <jaruiz@nosolored.com>
* @author Julio Montoya <gugli100@gmail.com>
* @package chamilo.plugin.sepe
*/
require_once('config.php');
require_once('src/index.sepe.php');
require_once __DIR__ . '/config.php';
require_once __DIR__ . '/src/index.sepe.php';

@ -1,14 +1,11 @@
<?php
/* For license terms, see /license.txt */
/* For licensing terms, see /license.txt */
/**
* This script is included by main/admin/settings.lib.php and generally
* includes things to execute in the main database (settings_current table)
* Config the plugin
* @package chamilo.plugin.sepe
*/
/**
* Initialization
*/
require_once dirname(__FILE__) . '/config.php';
require_once __DIR__ . '/config.php';
if (!api_is_platform_admin()) {
die ('You must have admin permissions to install plugins');
}

@ -4,221 +4,220 @@
* @package chamilo.plugin.sepe
*/
$(document).ready(function () {
$("#borrar_datos_identificativos").click(function (e) {
e.preventDefault();
$("#delete-center-data").click(function (e) {
e.preventDefault();
e.stopPropagation();
if(confirm("Confirme si desea borrar todos los datos identificativos del centro y las acciones formativas creadas")){
$.post("function.php", {tab: "borra_datos_centro"},
if (confirm($('#confirmDeleteCenterData').val())) {
$.post("function.php", {tab: "delete_center_data"},
function (data) {
if (data.status == "false") {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
alert(data.content);
location.reload();
}
}, "json");
}
}
});
$("#borrar_accion_formativa").click(function (e) {
e.preventDefault();
$("#delete-action").click(function (e) {
e.preventDefault();
e.stopPropagation();
vcod = $("#cod_action").val();
if(confirm("Confirme si desea borrar la acción formativa y todos los datos almacenados.")){
$.post("function.php", {tab: "borra_accion_formativa", cod:vcod},
var actionId = $("#action_id").val();
if (confirm($('#confirmDeleteAction').val())) {
$.post("function.php", {tab: "delete_action", id:actionId},
function (data) {
if (data.status == "false") {
if (data.status == 'false') {
alert(data.content);
} else {
window.location.replace("listado-acciones-formativas.php");
//location.reload();
window.location.replace("formative-actions-list.php");
}
}, "json");
}
}
});
$(".del_specialty").click(function(e){
e.preventDefault();
$(".delete-specialty").click(function(e){
e.preventDefault();
e.stopPropagation();
vcod = $(this).prop("id");
if(confirm("Confirme si desea borrar la especialidad de la acción formativa y todos los datos de centros almacenados.")){
$.post("function.php", {tab: "borra_especialidad_accion", cod:vcod},
iid = $(this).prop("id");
if (confirm($('#confirmDeleteSpecialty').val())) {
$.post("function.php", {tab: "delete_specialty", id:iid},
function (data) {
if (data.status == "false") {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".del_classroom").click(function(e){
e.preventDefault();
}
});
$(".delete-classroom").click(function(e){
e.preventDefault();
e.stopPropagation();
vcod = $(this).prop("id");
if(confirm("Confirme si desea borrar el centro presencial de la especialidad de la acción formativa.")){
$.post("function.php", {tab: "borra_especialidad_classroom", cod:vcod},
iid = $(this).prop("id");
if (confirm($('#confirmDeleteClassroom').val())) {
$.post("function.php", {tab: "delete_classroom", id:iid},
function (data) {
if (data.status == "false") {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".del_tutor").click(function(e){
e.preventDefault();
}
});
$(".delete-tutor").click(function(e){
e.preventDefault();
e.stopPropagation();
vcod = $(this).prop("id");
if(confirm("Confirme si desea borrar los datos del tutor de la especialidad de la acción formativa.")){
$.post("function.php", {tab: "borra_especialidad_tutor", cod:vcod},
iid = $(this).prop("id");
if (confirm($('#confirmDeleteTutor').val())) {
$.post("function.php", {tab: "delete_tutor", id:iid},
function (data) {
if (data.status == "false") {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".del_participant").click(function(e){
e.preventDefault();
}
});
$(".delete-participant").click(function(e){
e.preventDefault();
e.stopPropagation();
vcod = $(this).prop("id");
if(confirm("Confirme si desea borrar el participante de la acción formativa y todos los datos almacenados.")){
$.post("function.php", {tab: "borra_participante_accion", cod:vcod},
iid = $(this).prop("id");
if (confirm($('#confirmDeleteParticipant').val())) {
$.post("function.php", {tab: "delete_participant", id:iid},
function (data) {
if (data.status == "false") {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".del_specialty_participant").click(function(e){
e.preventDefault();
}
});
$(".delete-specialty-participant").click(function(e){
e.preventDefault();
e.stopPropagation();
vcod = $(this).prop("id");
if(confirm("Confirme si desea borrar la especialidad del participante.")){
$.post("function.php", {tab: "borra_especialidad_participante", cod:vcod},
iid = $(this).prop("id");
if (confirm($("#confirmDeleteParticipantSpecialty").val())) {
$.post("function.php", {tab: "delete_specialty_participant", id:iid},
function (data) {
if (data.status == "false") {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".asignar_action_formativa").click(function(e){
e.preventDefault();
}
});
$(".assign_action").click(function(e){
e.preventDefault();
e.stopPropagation();
vcourse = $(this).prop("id");
vaction = $(this).parent().prev().children().val();
if(vaction != ''){
$.post("function.php", {tab: "asignar_accion", cod_course:vcourse, cod_action:vaction},
function (data) {
if (data.status == "false") {
alert(data.content);
} else {
location.reload();
}
}, "json");
}else{
alert("Seleccione una accion formativa del desplegable");
}
});
$(".desvincular_accion").click(function(e){
e.preventDefault();
vcourse = $(this).prop("id");
vaction = $(this).parent().prev().children().val();
if (vaction != '') {
$.post("function.php", {tab:"assign_action", course_id:vcourse, action_id:vaction},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
location.reload();
}
}, "json");
} else {
alert($("#alertAssignAction").val());
}
});
$(".unlink-action").click(function(e){
e.preventDefault();
e.stopPropagation();
vcod = $(this).prop("id");
$.post("function.php", {tab: "desvincular_action", cod:vcod},
function (data) {
if (data.status == "false") {
alert(data.content);
} else {
location.reload();
}
}, "json");
});
$(".del_action_formativa").click(function(e){
e.preventDefault();
iid = $(this).prop("id");
$.post("function.php", {tab: "unlink_action", id:iid},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
location.reload();
}
}, "json");
});
$(".delete-action").click(function(e){
e.preventDefault();
e.stopPropagation();
vcod = $(this).prop("id").substr(3);
if(confirm("Confirme si desea borrar la acci\u00F3n formativa y desvincular del curso actual")){
$.post("function.php", {tab: "borra_accion_formativa", cod:vcod},
function (data) {
if (data.status == "false") {
alert(data.content);
} else {
location.reload();
}
}, "json");
}
});
$("#slt_user_existente").change(function(){
if($(this).val() == "NO"){
$("#box_datos_tutor").show();
$("#box_listado_tutores").hide();
}else{
$("#box_listado_tutores").show();
$("#box_datos_tutor").hide();
}
});
$(".info_tutor").click(function(e){
e.preventDefault();
iid = $(this).prop("id").substr(16);
if (confirm($('#confirmDeleteUnlinkAction').val())) {
$.post("function.php", {tab: "delete_action", id:iid},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
location.reload();
}
}, "json");
}
});
$("#slt_user_exists").change(function(){
if ($(this).val() == "0") {
$("#tutor-data-layer").show();
$("#tutors-list-layer").hide();
} else {
$("#tutors-list-layer").show();
$("#tutor-data-layer").hide();
}
});
$(".info_tutor").click(function(e){
e.preventDefault();
e.stopPropagation();
$(this).parent().parent().next().toggle("slow");
});
$("#slt_centro_existente").change(function(){
if($(this).val() == "NO"){
$("#box_datos_centro").show();
$("#box_listado_centros").hide();
}else{
$("#box_listado_centros").show();
$("#box_datos_centro").hide();
}
});
$('form[name="form_participant_action"] input[type="submit"]').click(function(e){
e.preventDefault();
$(this).parent().parent().next().toggle("slow");
});
$("#slt_centers_exists").change(function(){
if ($(this).val() == "0") {
$("#center-data-layer").show();
$("#centers-list-layer").hide();
} else {
$("#centers-list-layer").show();
$("#center-data-layer").hide();
}
});
$('form[name="form_participant_action"] input[type="submit"]').click(function(e){
e.preventDefault();
e.stopPropagation();
if($('#cod_user_chamilo').val() == ''){
alert("Debe indicar un usuario de chamilo del curso con el que corresponda");
}else{
$('form[name="form_participant_action"]').submit();
}
});
$("#generar_key_sepe").click(function(e){
e.preventDefault();
if ($('#platform_user_id').val() == '') {
alert($("#alertSelectUser").val());
} else {
$('form[name="form_participant_action"]').submit();
}
});
$("#key-sepe-generator").click(function(e){
e.preventDefault();
e.stopPropagation();
$.post("function.php", {tab: "generar_api_key_sepe"},
function (data) {
if (data.status == "false") {
alert(data.content);
} else {
$("#input_key").val(data.content);
}
}, "json");
});
$.post("function.php", {tab: "key_sepe_generator"},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
$("#input_key").val(data.content);
}
}, "json");
});
});

@ -1,43 +1,291 @@
<?php
//Needed in order to show the plugin title
$strings['plugin_title'] = "Manager SEPE";
$strings['plugin_comment'] = "Informes de seguimiento para las certificaciones.";
$strings['datos_centro'] = "Datos identificativos del centro";
$strings['editar_datos_centro'] = "Formulario datos identificativos del centro";
$strings['formulario_acciones_formativas'] = "Formulario acciones formativas";
$strings['listado_acciones_formativas'] = "Listado acciones formativas";
$strings['accion_formativa'] = "Datos acción formativa";
$strings['editar_accion_formativa'] = "Formulario acción formativa";
$strings['new_accion_formativa'] = "Formulario crear acción formativa";
$strings['new_specialty_accion'] = "Formulario crear especialidad acción formativa";
$strings['edit_specialty_accion'] = "Formulario especialidad acción formativa";
$strings['new_participant_accion'] = "Formulario crear participante acción formativa";
$strings['edit_participant_accion'] = "Formulario participante acción formativa";
$strings['informes'] = "Informes";
$strings['configuracion_sepe'] = "Configuración";
$strings['informe_plataforma'] = "Informe plataforma";
$strings['sepe_enable'] = "Habilitar SEPE";
$strings['plugin_title'] = "SEPE manager";
$strings['sepe_enable'] = "SEPE enable";
$strings['plugin_comment'] = "Configuration of the formative actions of SEPE.";
$strings['Options'] = "Options";
$strings['Setting'] = "Setting";
$strings['sepe_url'] = "URL SEPE";
$strings['ProblemToDeleteInfoCenter'] = 'Problema para eliminar los datos identificativos del centro.';
$strings['ProblemToDeleteInfoAction'] = 'Problema para eliminar los datos de la acción formativa.';
$strings['ProblemToDesvincularInfoAction'] = 'Problema para desvincular los datos de la acción formativa.';
$strings['ProblemToDeleteInfoSpecialty'] = 'Problema para eliminar los datos de la especialidad de la acción formativa.';
$strings['ProblemToDeleteInfoParticipant'] = 'Problema para eliminar los datos del participante de la acción formativa.';
$strings['ProblemToDeleteInfoSpecialtyClassroom'] = 'Problema para eliminar los datos del centro presencial de la especialidad de la acción formativa.';
$strings['ProblemToDeleteInfoSpecialtyTutor'] = 'Problema para eliminar los datos del tutor de la especialidad de la acción formativa.';
$strings['DeleteOk'] = 'Borrado con éxito';
$strings['especialidad_accion_formativa'] = "Especialidad de la acción formativa";
$strings['participante_accion_formativa'] = "Participante de la acción formativa";
$strings['participante_especialidad_formativa'] = "Especialidad participante";
$strings['new_specialty_classroom'] = "Formulario crear centro presencial";
$strings['edit_specialty_classroom'] = "Formulario centro presencial";
$strings['new_specialty_tutor'] = "Formulario crear tutor-formador";
$strings['edit_specialty_tutor'] = "Formulario tutor-formador";
$strings['new_specialty_participant'] = "Formulario crear especialidad del participante";
$strings['edit_specialty_participant'] = "Formulario especialidad del participante";
$strings['new_tutorial'] = "Formulario crear tutoria presencial";
$strings['edit_tutorial'] = "Formulario tutoria presencial";
$strings['Inicio'] = "Inicio";
$strings['menu_sepe_administracion'] = 'Menu SEPE Administración';
$strings['menu_sepe'] = 'Menu SEPE';
$strings['DataCenter'] = "Identification data of the center";
$strings['DataCenterEdit'] = "Formulario datos identificativos del centro";
$strings['FormativeActionsForm'] = "Form identifying data of the center";
$strings['ActionsList'] = "Actions list";
$strings['DeleteAction'] = "Delete actions";
$strings['FormativesActionsList'] = "Formative actions list";
$strings['FormativeActionData'] = "Formative action data";
$strings['FormativeAction'] = "Formative action";
$strings['FormativeActionParticipant'] = "Participant of the formative action";
$strings['NewParticipantAction'] = "New participant form";
$strings['EditParticipantAction'] = "Participant Action form";
$strings['SpecialtyFormativeParcipant'] = "Participant specialty";
$strings['NewSpecialtyParticipant'] = "New participant specialty form";
$strings['EditSpecialtyParticipant'] = "Participant specialty form";
$strings['ActionId'] = "Action Id";
$strings['Delete'] = "Delete";
$strings['Edit'] = "Edit";
$strings['Unlink'] = "Unlink";
$strings['SeeOrEdit'] = "View or edit";
$strings['NoFormativeActionToCourse'] = "No action formative relation a course.";
$strings['CourseFreeOfFormativeAction'] = "Course free of actions formative";
$strings['SelectAction'] = "Select action";
$strings['AssignAction'] = "Assign action";
$strings['CreateAction'] = "Create action";
$strings['ActionIdentifier'] = "Action identifier";
$strings['ActionOrigin'] = "Action origin";
$strings['ActionCode'] = "Action code";
$strings['Situation'] = "Situation";
$strings['MainSpecialtyIdentifier'] = "Main specialty identifier";
$strings['SpecialtyOrigin'] = "Specialty origin";
$strings['ProfessionalArea'] = "Professional area";
$strings['SpecialtyCode'] = "Specialty code";
$strings['Duration'] = "Duration";
$strings['Unspecified'] = "";
$strings['StartDate'] = "Start date";
$strings['EndDate'] = "End date";
$strings['FullItineraryIndicator'] = "Full itinerary indicator";
$strings['FinancingType'] = "Financing type";
$strings['AttendeesCount'] = "Attendees Count";
$strings['DescriptionAction'] = "Action formative description";
$strings['NameAction'] = "Action formative name";
$strings['GlobalInfo'] = "General information";
$strings['Schedule'] = "Schedule";
$strings['Requirements'] = "Requirements";
$strings['ContactAction'] = "Action contact";
$strings['NoFormativeAction'] = "No info of action formative";
$strings['Specialtys'] = "specialtys";
$strings['CreateSpecialty'] = "Create specialty";
$strings['Specialty'] = "Specialty";
$strings['Participants'] = "Participants";
$strings['CreateParticipant'] = "Create participant";
$strings['Participant'] = "Participant";
$strings['NumHoursFormativeAction'] = "Number hours formative action.";
$strings['StartDateMessage'] = "Formative action start date.";
$strings['EndDateMessage'] = "Formative action end date";
$strings['FullItineraryIndicatorMessage'] = "Indicates if the training action is imparted in full.";
$strings['FinancingTypeMessage'] = "Origin of the economic endowment.";
$strings['AttendeesCountMessage'] = "Number of places offered.";
$strings['NameActionMessage'] = "Name or brief description of the formative action.";
$strings['GlobalInfoMessage'] = "Brief descriptive text of the objectives, contents and structure of the training action.";
$strings['ScheduleMessage'] = "Brief text that indicates the time period during which the training action takes place.";
$strings['RequirementsMessage'] = "Short text that specifies the requirements of access to training.";
$strings['ContactActionMessage'] = "Telephone, website or email address through which to obtain specific and detailed information about the training action.";
$strings['NoSaveChange'] = "No save change";
$strings['SaveChange'] = "Success save change";
$strings['NoExistsCourse'] = "[formative-action-edit.php] - The course to which the training action is associated does not exist";
$strings['NoSaveSeleccion'] = "[formative-action-edit.php] - Failed to save selection";
$strings['Actions'] = "Action";
$strings['SaveChanges'] = "Save changes";
$strings['Reset'] = "Reset";
$strings['formativeActionNew'] = "Form create formative action";
$strings['formativeActionEdit'] = "Form formative action";
$strings['NewSpecialtyAccion'] = "Form create specialty formative action";
$strings['EditSpecialtyAccion'] = "Form edit specialty formative action";
$strings['SpecialtyFormativeAction'] = "Specialty formative action";
$strings['SpecialtyIdentifier'] = "Specialty identifier";
$strings['DeliveryCenter'] = "Delivery Center";
$strings['CenterOrigin'] = "Center origin";
$strings['CenterCode'] = "Center code";
$strings['SpecialtyStartDateMessage'] = "Start date formative specialty.";
$strings['SpecialtyEndDateMessage'] = "End date formative specialty.";
$strings['ModalityImpartition'] = "Modality impartition";
$strings['ModalityImpartitionMessage'] = "Mode of delivery of the training specialty of the action.";
$strings['DurationData'] = "Duration data";
$strings['ClassroomHours'] = "Classroom Hours";
$strings['ClassroomHoursMessage'] = "Number of hours taken in person.";
$strings['DistanceHours'] = "Teletraining hours";
$strings['DistanceHoursMessage'] = "Number of hours realized through teletraining.";
$strings['ClassroomSessionCenter'] = "Classroom session center";
$strings['ClassroomSessionCenterMessage'] = "You must save your changes before you create a classroom center";
$strings['CreateClassroomCenter'] = "Create classroom center";
$strings['ClassroomCenter'] = "Classroom center";
$strings['TrainingTutors'] = "Training tutors";
$strings['TrainingTutorsMessage'] = "You must save your changes before you create a new training tutor.";
$strings['CreateTrainingTutor'] = "Create training tutor";
$strings['TrainingTutor'] = "Training tutor";
$strings['ContentUse'] = "Content use";
$strings['MorningSchedule'] = "Morning schedule";
$strings['MorningScheduleMessage'] = "The time period between 7:00 and 15:00 hours will be considered.";
$strings['ParticipantsNumber'] = "Participant number";
$strings['AccessNumber'] = "Access number";
$strings['TotalDuration'] = "Total duration";
$strings['AfternoonSchedule'] = "Afternoon schedule";
$strings['AfternoonScheduleMessage'] = "The time period between 15:00 and 23:00 hours will be considered.";
$strings['NightSchedule'] = "Night schedule";
$strings['NightScheduleMessage'] = "The time period between 23:00 and 7:00 hours will be considered.";
$strings['MonitoringAndEvaluation'] = "Monitoring and evaluation";
$strings['LearningActivityCount'] = "Learning activity number";
$strings['AttemptCount'] = "Attempt count";
$strings['EvaluationActivityCount'] = "Evaluation activity number";
$strings['UseExistingCenter'] = "Use existing center";
$strings['Center'] = "Center";
$strings['CreateNewCenter'] = "Create a new center";
$strings['UseExisting'] = "Use existing";
$strings['CenterList'] = "Centers list";
$strings['NewSpecialtyClassroom'] = "Form create classroom";
$strings['EditSpecialtyClassroom'] = "Form edit classroom";
$strings['NewSpecialtyTutor'] = "Form create a new tutor";
$strings['EditSpecialtyTutor'] = "Form tutor";
$strings['UseExistingTutor'] = "Use tutor existing";
$strings['CreateNewTutor'] = "Create new tutor";
$strings['TutorsList'] = "Tutors list";
$strings['Tutor'] = "Tutor";
$strings['TutorTrainer'] = "Tutor - Trainer";
$strings['TutorIdentifier'] = "Tutor identifier";
$strings['DocumentType'] = "Document type";
$strings['DocumentNumber'] = "Document number";
$strings['DocumentLetter'] = "Document letter";
$strings['DocumentFormatMessage'] = "The field \"document number\" have a length of 10 alphanumeric characters.
<table id=\"sepe-tbl-info-fiscal-number\">
<tr><th>Tipo</th><th>Número</th><th>Fiscal letter</th></tr>
<tr><td>D</td><td>bbN8</td><td>L</td></tr>
<tr><td>E</td><td>bbXN7<br />bbYN7<br />bbZN7</td><td>L<br />L<br />L</td></tr>
<tr><td>U</td><td>bbN8</td><td>L</td></tr>
<tr><td>W</td><td>bbN8</td><td>L</td></tr>
<tr><td>G</td><td>N10</td><td>L</td></tr>
<tr><td>H</td><td>bbN8</td><td>L</td></tr>
</table>";
$strings['TutorAccreditation'] = "Tutor accreditation";
$strings['TutorAccreditationMessage'] = "Qualification or certification of the academic or professional formation that possesses.";
$strings['ProfessionalExperience'] = "Professional experience";
$strings['ProfessionalExperienceMessage'] = "Duration (years) of professional experience in the field of competences related to the training module.";
$strings['TeachingCompetence'] = "Teaching competence";
$strings['ExperienceTeleforming'] = "Experience teleforming";
$strings['ExperienceTeleformingMessage'] = "An integer equivalent to the duration (in hours) of teaching experience in the mode of teletraining.";
$strings['TrainingTeleforming'] = "Training modality e-learning";
$strings['PlatformTeacher'] = "Professor course on the platform";
$strings['Teacher'] = "Teacher";
$strings['Student'] = "Student";
$strings['RequiredTutorField'] = "The tutor dentifier fields are mandatory";
$strings['SelectUserExistsMessage'] = "Select a tutor from the list or select Create new tutor";
$strings['DocumentTypeD'] = "D - National identity document (DNI)";
$strings['DocumentTypeE'] = "E - Foreign Identity Number (NIE)";
$strings['DocumentTypeU'] = "U - Conventional identification for citizens of the European Economic Area without NIE";
$strings['DocumentTypeG'] = "G - People deprived of their liberty";
$strings['DocumentTypeW'] = "W - Conventional identification for citizens who do not belong to the European Economic Area and without NIE";
$strings['DocumentTypeH'] = "H - Conventional identification of Persons who have not been able to be adequate in the process of adequacy of data";
$strings['TeachingCompetence01'] = "Certificate of professionalism in vocational training for employment";
$strings['TeachingCompetence02'] = "Certificate of professionalism of occupational trainer";
$strings['TeachingCompetence03'] = "Certificate of Pedagogical Aptitude or professional title of Didactic Specialization or Certificate of Pedagogical Qualification";
$strings['TeachingCompetence04'] = "Master's degree";
$strings['TeachingCompetence05'] = "Training course equivalent to pedagogical and didactic training";
$strings['TeachingCompetence06'] = "Experienced teaching experience of at least 600 hours of training courses";
$strings['TrainingTeleforming01'] = "Certificate of professionalism in vocational training for employment";
$strings['TrainingTeleforming02'] = "Accreditation partial cumulative corresponding to the training module MF1444_3";
$strings['TrainingTeleforming03'] = "Diploma issued by the competent labor administration certifying that the training has passed with a positive evaluation, lasting no less than 30 hours";
$strings['TrainingTeleforming04'] = "Diploma certifying that training actions, of at least 30 hours duration";
$strings['UserPlatformList'] = "List of course users on the platform";
$strings['ParticipantIdentifier'] = "Participant ID";
$strings['CompetenceKey'] = "Indicator of key competences";
$strings['TrainingAgreement'] = "Training agreement";
$strings['ContractId'] = "Contract ID";
$strings['ContractIdMessage'] = "<em class='alert alert-info mensaje_info mtop5'>14-point alphanumeric data consisting of the concatenation of:<br />
<ul>
<li> 1 alphabetical position indicating the agency that assigned the contract identifier. Currently always state \"E\".</li>
<li> 2 numeric positions with the province code.</li>
<li> 4 numeric positions with the year of the contract.</li>
<li> 7 numeric positions with the sequential number assigned to the contract in the province and year.</li>
</ul>
</em>";
$strings['CompanyFiscalNumber'] = "Company fiscal number";
$strings['TutorIdCompany'] = "Company tutor ID";
$strings['CompanyTutorsList'] = "Company tutors list";
$strings['CreateNewTutorCompany'] = "Create a new company tutor";
$strings['Name'] = "Name";
$strings['TutorIdTraining'] = "Training tutor ID";
$strings['TrainingTutorsList'] = "Training tutors list";
$strings['CreateNewTutorTraining'] = "Create a new training tutor";
$strings['SpecialtiesParcipant'] = "Participant specialties";
$strings['SpecialtiesParcipantMessage'] = "You must save the changes before creating a specialty to the participant.";
$strings['RegistrationDate'] = "Registration date";
$strings['RegistrationDateMessage'] = "Registration date to access the specialty of the training action.";
$strings['LeavingDate'] = "Leaving date";
$strings['LeavingDateMessage'] = "Leaving date to access the specialty of the training action.";
$strings['ClassroomTutorials'] = "Classroom tutorials";
$strings['ClassroomTutorialsMessage'] = "You must save your changes before you create a classroom tutoring center";
$strings['CreateClassroomTutorial'] = "Create classroom tutorial";
$strings['ClassroomTutorial'] = "Classroom tutorial";
$strings['FinalEvaluation'] = "Final evaluation";
$strings['FinalEvaluationClassroom'] = "Final evaluation Classroom";
$strings['StartDateMessageEvaluation'] = "Start date final evaluation.";
$strings['EndDateMessageEvaluation'] = "End date final evaluation.";
$strings['Results'] = "Results";
$strings['FinalResult'] = "Final results";
$strings['Initiated'] = "0 - Started";
$strings['LeavePlacement'] = "1 - Leave for placement";
$strings['AbandonOtherReasons'] = "2 - Abandon for other reasons";
$strings['EndsPositiveEvaluation'] = "3 - Ends with positive evaluation";
$strings['EndsNegativeEvaluation'] = "4 - Ends with negative evaluation";
$strings['EndsNoEvaluation'] = "5 - Finish without evaluating";
$strings['FreeEvaluation'] = "6 - Free evaluation";
$strings['Exempt'] = "7 - Exempt";
$strings['FinalResultMessage'] = "Value that indicates the situation of the participant and the result achieved by the participant in the specialty of the training action.<br />
You can take the values of:<br />
<ul>
<li>0 – Started</li>
<li>1 – Leave for placement</li>
<li>2 – Abandon for other reasons</li>
<li>3 – Ends with positive evaluation</li>
<li>4 – Ends with negative evaluation</li>
<li>5 – Finish without evaluating</li>
<li>6 – Free evaluation.</li>
<li>7 – Exempt.</li>
</ul>";
$strings['FinalQualification'] = "Final qualification";
$strings['FinalQualificationMessage'] = "Score obtained in the final evaluation test of the module (regardless of the call in which it was obtained) reflecting, where appropriate, the scores corresponding to the formative units that compose it.
It adopts a value between 5 and 10, registering with four digits to accommodate the decimal scores (for example, the rating 7.6 should register as 760).";
$strings['FinalScore'] = "Final Score";
$strings['FinalScoreMessage'] = "Sum of the average score obtained in the evaluation during the learning process, and the score obtained in the final evaluation test of the module, previously weighted with a weight of 30 percent and 70 percent, respectively.
It adopts a value between 5 and 10, which can not be less than 5, nor inferior to that obtained in the final evaluation test. <br />
It is recorded with four digits to accommodate the decimal scores (for example, the score 8.3 should be recorded as 830).";
$strings['StartDateMessageTutorial'] = "Starting date of classroom tutoring.";
$strings['EndDateMessageTutorial'] = "Ending date of classroom tutoring.";
$strings['NewCenter'] = "New center";
$strings['EditCenter'] = "Edit center";
$strings['DeleteCenter'] = "Delete center";
$strings['NameCenter'] = "Center name";
$strings['PlatformUrl'] = "URL platform";
$strings['TrackingUrl'] = "URL tracking";
$strings['Phone'] = "Phone";
$strings['Mail'] = "Mail";
$strings['SepeUser'] = "SEPE user";
$strings['ApiKey'] = "API key";
$strings['GenerateApiKey'] = "Generate api key";
$strings['NoIdentificationData'] = "There is no identification data of the center";
$strings['ActionEdit'] = "Edit action";
$strings['ProblemToDeleteInfoCenter'] = 'Problem to eliminate the identification data of the center.';
$strings['ProblemToDeleteInfoAction'] = 'Problem to eliminate the data of the formative action.';
$strings['ProblemToDesvincularInfoAction'] = 'Problem to unlink the data of the training action.';
$strings['ProblemToDeleteInfoSpecialty'] = 'Problem to eliminate the data of the specialty of the formative action.';
$strings['ProblemToDeleteInfoParticipant'] = 'Problem to eliminate the data of the participant of the formative action.';
$strings['ProblemToDeleteInfoSpecialtyClassroom'] = 'Problem to eliminate the data of the face-to-face of the specialty of the formative action.';
$strings['ProblemToDeleteInfoSpecialtyTutor'] = 'Problem to eliminate the data of the tutor of the specialty of the formative action.';
$strings['DeleteOk'] = 'Success delete';
$strings['ProblemDataBase'] = 'Database problem';
$strings['ModDataTeacher'] = 'Information: It will modify the identification data of the teacher of Chamilo';
$strings['AdministratorSepe'] = 'SEPE administration';
$strings['MenuSepeAdministrator'] = 'SEPE administration menu';
$strings['MenuSepe'] = 'SEPE menu';
$strings['Public'] = 'Public';
$strings['Private'] = 'Private';
$strings['confirmDeleteCenterData'] = 'Confirm if you want to delete all the data identifying the center and the training actions created';
$strings['confirmDeleteAction'] = "Confirm if you want to delete the training action and all the stored data";
$strings['confirmDeleteUnlinkAction'] = "Confirm if you want to delete the training action and unlink from the current course";
$strings['confirmDeleteSpecialty'] = "Confirm if you want to delete the specialty of the training action";
$strings['confirmDeleteParticipant'] = "Confirm if you want to delete the participant from the training action and all the stored data.";
$strings['confirmDeleteClassroom'] = "Confirm if you want to erase the classroom presence of the specialty of the training action.";
$strings['confirmDeleteTutor'] = "Confirm if you want to delete the data of the tutor of the specialty of the training action.";
$strings['confirmDeleteParticipantSpecialty'] = "Confirm if you want to delete the participant's specialty.";
$strings['alertAssignAction'] = "Select a formative action from the dropdown";
$strings['alertSelectUser'] = "You must indicate a course user with the corresponding course";
$strings['Situation10'] = "10-Requested Authorization";
$strings['Situation20'] = "20-Scheduled / Authorized";
$strings['Situation30'] = "30-Started";
$strings['Situation40'] = "40-Finished";
$strings['Situation50'] = "50-Canceled";
$strings['ProblemGenerateApiKey'] = "Problem generating a new api key";
$strings['ErrorDataIncorrect'] = "Failed to receive data";
$strings['NoSaveData'] = "Unable to save selection";
$strings['NoExistsCourse'] = "The course to which the training action is associated does not exist";
$strings['FormativeActionInUse'] = "The chosen training action is being used for another course";
$strings['ProblemToken'] = "Token not valid";

@ -2,23 +2,257 @@
//Needed in order to show the plugin title
$strings['plugin_title'] = "Gestión SEPE";
$strings['plugin_comment'] = "Configuración de las acciones formativas del SEPE.";
$strings['datos_centro'] = "Datos identificativos del centro";
$strings['editar_datos_centro'] = "Formulario datos identificativos del centro";
$strings['formulario_acciones_formativas'] = "Formulario acciones formativas";
$strings['listado_acciones_formativas'] = "Listado acciones formativas";
$strings['accion_formativa'] = "Datos acción formativa";
$strings['editar_accion_formativa'] = "Formulario acción formativa";
$strings['new_accion_formativa'] = "Formulario crear acción formativa";
$strings['new_specialty_accion'] = "Formulario crear especialidad acción formativa";
$strings['edit_specialty_accion'] = "Formulario especialidad acción formativa";
$strings['new_participant_accion'] = "Formulario crear participante acción formativa";
$strings['edit_participant_accion'] = "Formulario participante acción formativa";
$strings['informes'] = "Informes";
$strings['configuracion_sepe'] = "Configuración";
$strings['informe_plataforma'] = "Informe plataforma";
$strings['sepe_enable'] = "Habilitar SEPE";
$strings['plugin_comment'] = "Configuración de las acciones formativas del SEPE.";
$strings['Options'] = "Opciones";
$strings['Setting'] = "Configuración";
$strings['sepe_url'] = "URL SEPE";
$strings['DataCenter'] = "Datos identificativos del centro";
$strings['DataCenterEdit'] = "Formulario datos identificativos del centro";
$strings['FormativeActionsForm'] = "Formulario acciones formativas";
$strings['ActionsList'] = "Listado acciones";
$strings['DeleteAction'] = "Borrar acción";
$strings['FormativesActionsList'] = "Listado acciones formativas";
$strings['FormativeActionData'] = "Datos acción formativa";
$strings['FormativeAction'] = "Acción formativa";
$strings['FormativeActionParticipant'] = "Participante de la acción formativa";
$strings['NewParticipantAction'] = "Formulario crear participante acción formativa";
$strings['EditParticipantAction'] = "Formulario participante acción formativa";
$strings['SpecialtyFormativeParcipant'] = "Especialidad participante";
$strings['NewSpecialtyParticipant'] = "Formulario crear especialidad del participante";
$strings['EditSpecialtyParticipant'] = "Formulario especialidad del participante";
$strings['ActionId'] = "Id acción";
$strings['Delete'] = "Borrar";
$strings['Edit'] = "Editar";
$strings['Unlink'] = "Desvincular";
$strings['SeeOrEdit'] = "Ver o Editar";
$strings['NoFormativeActionToCourse'] = "No hay acciones formativas asociadas a un curso.";
$strings['CourseFreeOfFormativeAction'] = "Cursos sin acciones formativas asignadas";
$strings['SelectAction'] = "Seleccione una acción formativa";
$strings['AssignAction'] = "Asignar acción";
$strings['CreateAction'] = "Crear acción";
$strings['ActionIdentifier'] = "Identificado de acción";
$strings['ActionOrigin'] = "Origen de la acción";
$strings['ActionCode'] = "Código de la acción";
$strings['Situation'] = "Situación";
$strings['MainSpecialtyIdentifier'] = "Identificador de especialidad principal";
$strings['SpecialtyOrigin'] = "Origen de especialidad";
$strings['ProfessionalArea'] = "Área profesional";
$strings['SpecialtyCode'] = "Código de Especialidad";
$strings['Duration'] = "Duración";
$strings['Unspecified'] = "Sin especificar";
$strings['StartDate'] = "Fecha de inicio";
$strings['EndDate'] = "Fecha fin";
$strings['FullItineraryIndicator'] = "Indicador de itinerario completo";
$strings['FinancingType'] = "Tipo de Financiación";
$strings['AttendeesCount'] = "Número de Asistentes";
$strings['DescriptionAction'] = "Descripción de la acción formativa";
$strings['NameAction'] = "Denominación de la Acción";
$strings['GlobalInfo'] = "Información General";
$strings['Schedule'] = "Horarios";
$strings['Requirements'] = "Requisitos";
$strings['ContactAction'] = "Contacto Acción";
$strings['NoFormativeAction'] = "No hay información de la acción formativa";
$strings['Specialtys'] = "Especialidades";
$strings['CreateSpecialty'] = "Crear especialidad";
$strings['Specialty'] = "Especialidad";
$strings['Participants'] = "Participantes";
$strings['CreateParticipant'] = "Crear participante";
$strings['Participant'] = "Participante";
$strings['NumHoursFormativeAction'] = "Número de horas de la acción formativa.";
$strings['StartDateMessage'] = "Fecha de inicio de la acción formativa.";
$strings['EndDateMessage'] = "Fecha de finalización de la acción formativa.";
$strings['FullItineraryIndicatorMessage'] = "Indica si la acción formativa se imparte de forma completa.";
$strings['FinancingTypeMessage'] = "Procedencia de la dotación económica.";
$strings['AttendeesCountMessage'] = "Número de plazas ofertadas.";
$strings['NameActionMessage'] = "Nombre o descripción breve de la acción formativa.";
$strings['GlobalInfoMessage'] = "Breve texto descriptivo de los objetivos, contenidos y estructura de la acción formativa.";
$strings['ScheduleMessage'] = "Breve texto que señala el periodo temporal durante el que se desarrolla la acción formativa.";
$strings['RequirementsMessage'] = "Breve texto que especifica los requisitos de acceso a la formación.";
$strings['ContactActionMessage'] = "Teléfono, sitio web o dirección de correo electrónico a través de los que obtener información específica y detallada sobre la acción formativa.";
$strings['NoSaveChange'] = "No se ha guardado los cambios";
$strings['SaveChange'] = "Se ha guardado los cambios";
$strings['NoExistsCourse'] = "[formative-action-edit.php] - El curso al que se le asocia la accion formativa no existe";
$strings['NoSaveSeleccion'] = "[formative-action-edit.php] - No se ha podido guardar la seleccion";
$strings['Actions'] = "Acciones";
$strings['SaveChanges'] = "Guardar cambios";
$strings['Reset'] = "Restablecer";
$strings['formativeActionNew'] = "Formulario crear acción formativa";
$strings['formativeActionEdit'] = "Formulario acción formativa";
$strings['NewSpecialtyAccion'] = "Formulario crear especialidad acción formativa";
$strings['EditSpecialtyAccion'] = "Formulario especialidad acción formativa";
$strings['SpecialtyFormativeAction'] = "Especialidad Acción Formativa";
$strings['SpecialtyIdentifier'] = "Identificador de especialidad";
$strings['DeliveryCenter'] = "Centro de impartición";
$strings['CenterOrigin'] = "Origen del centro";
$strings['CenterCode'] = "Código del centro";
$strings['SpecialtyStartDateMessage'] = "Fecha de inicio de la especialidad formativa.";
$strings['SpecialtyEndDateMessage'] = "Fecha de finalización de especialidad formativa.";
$strings['ModalityImpartition'] = "Modalidad de impartición";
$strings['ModalityImpartitionMessage'] = "Modo de impartición de la especialidad formativa de la acción.";
$strings['DurationData'] = "Datos de duración";
$strings['ClassroomHours'] = "Horas presenciales";
$strings['ClassroomHoursMessage'] = "Número de horas realizadas de forma presencial.";
$strings['DistanceHours'] = "Horas teleformación";
$strings['DistanceHoursMessage'] = "Número de horas realizadas a través de teleformación.";
$strings['ClassroomSessionCenter'] = "Centro de sesiones presenciales";
$strings['ClassroomSessionCenterMessage'] = "Debe guardar los cambios antes de crear un centro presencial";
$strings['CreateClassroomCenter'] = "Crear centro presencial";
$strings['ClassroomCenter'] = "Centro presencial";
$strings['TrainingTutors'] = "Tutores-Formadores";
$strings['TrainingTutorsMessage'] = "Debe guardar los cambios antes de crear un centro presencial.";
$strings['CreateTrainingTutor'] = "Crear tutor-formador";
$strings['TrainingTutor'] = "Tutor-formador";
$strings['ContentUse'] = "Uso del contenido";
$strings['MorningSchedule'] = "Horario mañana";
$strings['MorningScheduleMessage'] = "Se considerará el período temporal comprendido entre las 7:00 y las 15:00 horas.";
$strings['ParticipantsNumber'] = "Nº de participantes";
$strings['AccessNumber'] = "Número de accesos";
$strings['TotalDuration'] = "Duración Total";
$strings['AfternoonSchedule'] = "Horario tarde";
$strings['AfternoonScheduleMessage'] = "Se considerará el período temporal comprendido entre las 15:00 horas y las 23:00 horas.";
$strings['NightSchedule'] = "Horario noche";
$strings['NightScheduleMessage'] = "Se considerará el período temporal comprendido entre las 23:00 horas y las 7:00 horas.";
$strings['MonitoringAndEvaluation'] = "Seguimiento y evaluación";
$strings['LearningActivityCount'] = "Número de actividades de aprendizaje";
$strings['AttemptCount'] = "Número de intentos";
$strings['EvaluationActivityCount'] = "Número de actividades de evaluación";
$strings['UseExistingCenter'] = "Usar centro existente";
$strings['Center'] = "Centro";
$strings['CreateNewCenter'] = "Crear nuevo centro";
$strings['UseExisting'] = "Usar existente";
$strings['CenterList'] = "Listado de centros";
$strings['NewSpecialtyClassroom'] = "Formulario crear centro presencial";
$strings['EditSpecialtyClassroom'] = "Formulario centro presencial";
$strings['NewSpecialtyTutor'] = "Formulario crear tutor-formador";
$strings['EditSpecialtyTutor'] = "Formulario tutor-formador";
$strings['UseExistingTutor'] = "Usar tutor existente";
$strings['CreateNewTutor'] = "Crear nuevo tutor";
$strings['TutorsList'] = "Listado de tutores";
$strings['Tutor'] = "Tutor";
$strings['TutorTrainer'] = "Tutor - Formador";
$strings['TutorIdentifier'] = "Identificador del tutor";
$strings['DocumentType'] = "Tipo del documento";
$strings['DocumentNumber'] = "Número del documento";
$strings['DocumentLetter'] = "Letra del NIF";
$strings['DocumentFormatMessage'] = "El campo de \"Número del documento\" tiene una longitud de 10 caracteres alfanuméricos.
<table id=\"sepe-tbl-info-fiscal-number\">
<tr><th>Tipo</th><th>Número</th><th>Carácter de control NIF</th></tr>
<tr><td>D</td><td>bbN8</td><td>L</td></tr>
<tr><td>E</td><td>bbXN7<br />bbYN7<br />bbZN7</td><td>L<br />L<br />L</td></tr>
<tr><td>U</td><td>bbN8</td><td>L</td></tr>
<tr><td>W</td><td>bbN8</td><td>L</td></tr>
<tr><td>G</td><td>N10</td><td>L</td></tr>
<tr><td>H</td><td>bbN8</td><td>L</td></tr>
</table>";
$strings['TutorAccreditation'] = "Acreditación del tutor";
$strings['TutorAccreditationMessage'] = "Titulación o certificación de la formación académica o profesional que posee.";
$strings['ProfessionalExperience'] = "Experiencia profesional";
$strings['ProfessionalExperienceMessage'] = "Duración (en años) de experiencia profesional en el campo de las competencias relacionadas con el módulo formativo.";
$strings['TeachingCompetence'] = "Competencia docente";
$strings['ExperienceTeleforming'] = "Experiencia modalidad teleformación";
$strings['ExperienceTeleformingMessage'] = "Número entero que equivale a la duración (en horas) de experiencia docente en modalidad de teleformación.";
$strings['TrainingTeleforming'] = "Formación modalidad teleformación";
$strings['PlatformTeacher'] = "Profesor curso en la plataforma";
$strings['Teacher'] = "Profesor";
$strings['Student'] = "Estudiante";
$strings['RequiredTutorField'] = "Los campos de Identificador del tutor son obligatorios";
$strings['SelectUserExistsMessage'] = "Seleccione un tutor de la lista o seleccione Crear nuevo tutor";
$strings['DocumentTypeD'] = "D - Documento Nacional de Identidad (DNI)";
$strings['DocumentTypeE'] = "E - Número de Identificador de Extranjero (NIE)";
$strings['DocumentTypeU'] = "U - Identificación convencional para ciudadanos del Espacio Económico Europeo sin NIE";
$strings['DocumentTypeG'] = "G - Personas privadas de libertad";
$strings['DocumentTypeW'] = "W - Identificación convencional para ciudadanos que no pertenecen Espacio Económico Europeo y sin NIE";
$strings['DocumentTypeH'] = "H - Identificación convencional de Personas que no hayan podido ser adecuadas en el proceso de adecuación de datos";
$strings['TeachingCompetence01'] = "Certificado de profesionalidad de docencia de la formación profesional para el empleo";
$strings['TeachingCompetence02'] = "Certificado de profesionalidad de formador ocupacional";
$strings['TeachingCompetence03'] = "Certificado de Aptitud Pedagógica o título profesional de Especialización Didáctica o Certificado de Cualificación Pedagógica";
$strings['TeachingCompetence04'] = "Máster Universitario";
$strings['TeachingCompetence05'] = "Curso de formación equivalente a la formación pedagógica y didáctica";
$strings['TeachingCompetence06'] = "Experiencia docente contrastada de al menos 600 horas de impartición de acciones formativas";
$strings['TrainingTeleforming01'] = "Certificado de profesionalidad de docencia de la formación profesional para el empleo";
$strings['TrainingTeleforming02'] = "Acreditación parcial acumulable correspondiente al módulo formativo MF1444_3";
$strings['TrainingTeleforming03'] = "Diploma expedido por la administración laboral competente que certifique que se ha superado con evaluación positiva la formación, de duración no inferior a 30 horas";
$strings['TrainingTeleforming04'] = "Diploma que certifique que se han superado con evaluación positiva acciones de formación, de al menos 30 horas de duración";
$strings['UserPlatformList'] = "Listado de usuarios del curso en la plataforma";
$strings['ParticipantIdentifier'] = "Identificador participante";
$strings['CompetenceKey'] = "Indicador de competencias clave";
$strings['TrainingAgreement'] = "Contrato de formación";
$strings['ContractId'] = "ID contrato CFA";
$strings['ContractIdMessage'] = "<em class='alert alert-info mensaje_info mtop5'>Dato alfanumérico de 14 posiciones formado por la concatenación de:<br />
<ul>
<li> 1 posición alfabética que indica el organismo que asignó identificador al contrato. En la actualidad siempre “E” estatal.</li>
<li> 2 posiciones numéricas con el código de la provincia.</li>
<li> 4 posiciones numéricas con el año del contrato.</li>
<li> 7 posiciones numéricas con el número secuencial asignado al contrato en la provincia y año.</li>
</ul>
</em>";
$strings['CompanyFiscalNumber'] = "CIF empresa";
$strings['TutorIdCompany'] = "Id tutor empresa";
$strings['CompanyTutorsList'] = "Listado tutores empresa";
$strings['CreateNewTutorCompany'] = "Crear nuevo tutor empresa";
$strings['Name'] = "Nombre";
$strings['TutorIdTraining'] = "Id tutor formación";
$strings['TrainingTutorsList'] = "Listado tutores formación";
$strings['CreateNewTutorTraining'] = "Crear nuevo tutor formación";
$strings['SpecialtiesParcipant'] = "Especialidades del participante";
$strings['SpecialtiesParcipantMessage'] = "Debe guardar los cambios antes de crear una especialidad al participante.";
$strings['RegistrationDate'] = "Fecha de Alta";
$strings['RegistrationDateMessage'] = "Alta para acceder a la especialidad de la acción formativa.";
$strings['LeavingDate'] = "Fecha de baja";
$strings['LeavingDateMessage'] = "Baja para acceder a la especialidad de la acción formativa.";
$strings['ClassroomTutorials'] = "Tutorías presenciales";
$strings['ClassroomTutorialsMessage'] = "Debe guardar los cambios antes de crear un centro de tutorias presenciales";
$strings['CreateClassroomTutorial'] = "Crear tutoria presencial";
$strings['ClassroomTutorial'] = "Tutoria presencial";
$strings['FinalEvaluation'] = "Evaluación final";
$strings['FinalEvaluationClassroom'] = "Centro presencial de evaluación final";
$strings['StartDateMessageEvaluation'] = "Fecha de inicio de la evaluación final.";
$strings['EndDateMessageEvaluation'] = "Fecha de finalización de la evaluación final.";
$strings['Results'] = "Resultados";
$strings['FinalResult'] = "Resultado final";
$strings['Initiated'] = "0 - Iniciado";
$strings['LeavePlacement'] = "1 - Abandona por colocación";
$strings['AbandonOtherReasons'] = "2 - Abandona por otras causas";
$strings['EndsPositiveEvaluation'] = "3 - Termina con evaluación positiva";
$strings['EndsNegativeEvaluation'] = "4 - Termina con evaluación negativa";
$strings['EndsNoEvaluation'] = "5 - Termina sin evaluar";
$strings['FreeEvaluation'] = "6 - Exento";
$strings['Exempt'] = "7 - Eximido";
$strings['FinalResultMessage'] = "Valor que indica la situación del participante y el resultado logrado por el participante en la especialidad de la acción formativa.<br />
Puede tomar los valores de:<br />
<ul>
<li>0 – Iniciado</li>
<li>1 – Abandona por colocación</li>
<li>2 – Abandona por otras causas</li>
<li>3 – Termina con evaluación positiva</li>
<li>4 – Termina con evaluación negativa</li>
<li>5 – Termina sin evaluar</li>
<li>6 – Exento (de la realización del módulo de formación práctica en centros de trabajo por formación en alternancia con el empleo o por acreditación de la experiencia laboral requerida a tal fin, según lo establecido en el artículo 5bis4 del Real Decreto 34/2008, de 18 de enero).</li>
<li>7 – Eximido (de la realización aquellos módulos formativos asociados a unidades de competencia para las que se ha obtenido acreditación, ya sea mediante formación o a través de procesos de reconocimiento de las competencias profesionales adquiridas por la experiencia laboral, regulados en el Real Decreto 1224/2009, de 17 de julio).</li>
</ul>";
$strings['FinalQualification'] = "Calificación final";
$strings['FinalQualificationMessage'] = "Puntuación obtenida en la prueba de evaluación final del módulo (con independencia de la convocatoria en la que se obtuvo) reflejando, en su caso, las puntuaciones correspondientes a las unidades formativas que lo compongan.<br />
Adopta un valor entre 5 y 10, registrándose con cuatro dígitos para dar cabida a las calificaciones decimales (por ejemplo, la calificación 7,6 debe registrarse como 760).";
$strings['FinalScore'] = "Puntuación final";
$strings['FinalScoreMessage'] = "Suma de la puntuación media obtenida en la evaluación durante el proceso de aprendizaje, y de la puntuación obtenida en la prueba de evaluación final del módulo, ponderándolas previamente con un peso de 30 por ciento y 70 por ciento, respectivamente.
Adopta un valor entre 5 y 10, sin que pueda ser inferior a 5, ni inferior a la obtenida en la prueba de evaluación final.<br />
Se registra con cuatro dígitos para dar cabida a las puntuaciones decimales (por ejemplo, la puntuación 8,3 debe registrarse como 830).";
$strings['StartDateMessageTutorial'] = "Fecha de inicio de la tutoría presencial.";
$strings['EndDateMessageTutorial'] = "Fecha de finalización de la tutoría presencial.";
$strings['NewCenter'] = "Nuevo centro";
$strings['EditCenter'] = "Editar centro";
$strings['DeleteCenter'] = "Borrar centro";
$strings['NameCenter'] = "Nombre Centro";
$strings['PlatformUrl'] = "URL plataforma";
$strings['TrackingUrl'] = "URL seguimiento";
$strings['Phone'] = "Teléfono";
$strings['Mail'] = "E-mail";
$strings['SepeUser'] = "Usuario SEPE";
$strings['ApiKey'] = "Clave API";
$strings['GenerateApiKey'] = "Generar api key";
$strings['NoIdentificationData'] = "No hay datos identificativos del centro";
$strings['ActionEdit'] = "Editar acción";
$strings['ProblemToDeleteInfoCenter'] = 'Problema para eliminar los datos identificativos del centro.';
$strings['ProblemToDeleteInfoAction'] = 'Problema para eliminar los datos de la acción formativa.';
$strings['ProblemToDesvincularInfoAction'] = 'Problema para desvincular los datos de la acción formativa.';
@ -29,17 +263,29 @@ $strings['ProblemToDeleteInfoSpecialtyTutor'] = 'Problema para eliminar los dato
$strings['DeleteOk'] = 'Borrado con éxito';
$strings['ProblemDataBase'] = 'Problema con la base de datos';
$strings['ModDataTeacher'] = 'Información: Se va a modificar los datos identificativos del profesor de Chamilo';
$strings['especialidad_accion_formativa'] = "Especialidad de la acción formativa";
$strings['participante_accion_formativa'] = "Participante de la acción formativa";
$strings['participante_especialidad_formativa'] = "Especialidad participante";
$strings['new_specialty_classroom'] = "Formulario crear centro presencial";
$strings['edit_specialty_classroom'] = "Formulario centro presencial";
$strings['new_specialty_tutor'] = "Formulario crear tutor-formador";
$strings['edit_specialty_tutor'] = "Formulario tutor-formador";
$strings['new_specialty_participant'] = "Formulario crear especialidad del participante";
$strings['edit_specialty_participant'] = "Formulario especialidad del participante";
$strings['new_tutorial'] = "Formulario crear tutoria presencial";
$strings['edit_tutorial'] = "Formulario tutoria presencial";
$strings['Inicio'] = "Inicio";
$strings['menu_sepe_administracion'] = 'Menu SEPE Administración';
$strings['menu_sepe'] = 'Menú SEPE';
$strings['AdministratorSepe'] = 'Administración Sepe';
$strings['MenuSepeAdministrator'] = 'Menu SEPE Administración';
$strings['MenuSepe'] = 'Menú SEPE';
$strings['Public'] = 'Pública';
$strings['Private'] = 'Privada';
$strings['confirmDeleteCenterData'] = 'Confirme si desea borrar todos los datos identificativos del centro y las acciones formativas creadas';
$strings['confirmDeleteAction'] = "Confirme si desea borrar la acción formativa y todos los datos almacenados";
$strings['confirmDeleteUnlinkAction'] = "Confirme si desea borrar la acción formativa y desvincular del curso actual";
$strings['confirmDeleteSpecialty'] = "Confirme si desea eliminar la especialidad de la acción formativa";
$strings['confirmDeleteParticipant'] = "Confirme si desea borrar el participante de la acción formativa y todos los datos almacenados.";
$strings['confirmDeleteClassroom'] = "Confirme si desea borrar el centro presencial de la especialidad de la acción formativa.";
$strings['confirmDeleteTutor'] = "Confirme si desea borrar los datos del tutor de la especialidad de la acción formativa.";
$strings['confirmDeleteParticipantSpecialty'] = "Confirme si desea borrar la especialidad del participante.";
$strings['alertAssignAction'] = "Seleccione una accion formativa del desplegable";
$strings['alertSelectUser'] = "Debe indicar un usuario de chamilo del curso con el que corresponda";
$strings['Situation10'] = "10-Solicitada Autorización";
$strings['Situation20'] = "20-Programada/Autorizada";
$strings['Situation30'] = "30-Iniciada";
$strings['Situation40'] = "40-Finalizada";
$strings['Situation50'] = "50-Cancelada";
$strings['ProblemGenerateApiKey'] = "Problema al generar una nueva api key";
$strings['ErrorDataIncorrect'] = "Error al recibir los datos";
$strings['NoSaveData'] = "No se ha podido guardar la selección";
$strings['NoExistsCourse'] = "El curso al que se le asocia la acci&oacute;n formativa no existe";
$strings['FormativeActionInUse'] = "La acci&oacute;n formativa elegida est&aacute; siendo usada por otro curso";
$strings['ProblemToken'] = "Token incorrecto, pruebe de nuevo a guardar los cambios";

@ -8,6 +8,5 @@
/**
* Plugin details (must be present)
*/
require_once dirname(__FILE__) . '/config.php';
require_once __DIR__ . '/config.php';
$plugin_info = SepePlugin::create()->get_info();

@ -10,10 +10,10 @@
- Seleccionar una región del plugin -> menu_administrator <br>
- Crear un usuario llamado SEPE con perfil de recursos humanos.<br>
- Ir al menú del plugin Sepe (en la sección de plugin activos en administración) y seleccionar el link de "Configuración" -> Generar API key. Usar esta clave para realizar pruebas con el SOAP.<br>
- En el fichero <em>/plugin/sepe/ws/ProveedorCentroTFWS.wsdl</em> modificar la linea 910 para indicar el dominio de la plataforma sustituyendo la cadena ##midominio## por el dominio que corresponda.<br>
- En el fichero <em>/plugin/sepe/ws/ProveedorCentroTFWS.wsdl</em> modificar la linea 910 para indicar el dominio de la plataforma.<br>
<br>
<b>Composer:</b><br>
- Es necesario incluir (en el caso de que no estuviera añadido) en el fichero <i>composer.json</i> en el apartado de "require" bajo la linea <em>"zendframework/zend-config": "2.3.3",</em> insertar <em>"zendframework/zend-soap": "2.*",</em> <br>
- Es necesario incluir en el fichero <i>composer.json</i> en el apartado de "require" bajo la linea <em>"zendframework/zend-config": "2.3.3",</em> insertar <em>"zendframework/zend-soap": "2.*",</em> <br>
- A continuación habrá que actualizar desde la linea de comandos el directorio vendor, usando la orden 'composer update'<br>
<br>
<b>Verificación del Webservices:</b><br>

@ -1,38 +1,30 @@
.cleared{
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
line-height:0;
}
.campo_texto{
.sepe-input-text{
color: #00829c;
font-size: 1.3em;
font-weight: normal;
padding-top: 2px;
}
.sepe_borrar_link {
.sepe-delete-link {
background: url("icon-delete.png") no-repeat scroll 0px 10px;
padding-left: 30px;
font-size:1.3em;
}
.sepe_editar_link {
.sepe-edit-link {
background: url("icon-edit.png") no-repeat scroll 0 10px;
padding-left: 30px;
font-size:1.3em;
}
.sepe_listado_link {
.sepe-list-link {
background: url("options-lines.png") no-repeat scroll 0 10px;
padding-left: 30px;
font-size:1.3em;
}
input.btn_menu_lateral{
input.sepe-btn-menu-side{
width:100%;
margin-bottom:10px;
}
legend.subcampo {
legend.sepe-subfield {
font-size: 16px;
line-height: 16px;
padding-bottom: 10px;
@ -40,9 +32,12 @@ legend.subcampo {
padding-right: 0;
padding-top: 0;
}
.well.subcampo {
.well.sepe-subfield {
background: none repeat scroll 0 0 #fafafa;
}
.well .well {
background: white;
}
em.span4 {
float: none;
margin: 0;
@ -55,73 +50,41 @@ em{
padding: 5px;
display: block;
}
.mensaje_info{
.message-info{
padding:5px 10px;
}
.slt_fecha {
.sepe-slt-date {
width:auto;
display:inline-block;
}
textarea.accion_formativa, input.accion_formativa {
margin-bottom: 5px;
width: 95%;
}
input.numerico {
input.sepe-numeric-field {
text-align: center;
width: 60px;
}
.subcampo2 {
.sepe-subfield2 {
font-size: 16px;
text-align: center;
}
.mlateral{
.sepe-margin-side{
margin: 0 5px;
}
#tabla_info_nif{
#sepe-tbl-info-fiscal-number{
width:90%;
margin:5px auto;
}
#tabla_info_nif td, #tabla_info_nif th {
#sepe-tbl-info-fiscal-number td, #sepe-tbl-info-fiscal-number th {
background: none repeat scroll 0 0 white;
border: 1px solid;
color: #333;
font-weight: bold;
text-align:center;
}
.va_middle, .table td.va_middle{
.sepe-vertical-align-middle, .table td.sepe-vertical-align-middle{
vertical-align:middle;
}
.box_centrado{
.sepe-box-center{
margin:0 auto;
}
.dinline{
display:inline;
}
.fright{
float:right;
}
.cursor{
cursor:pointer;
}
.ta-center{
text-align:center;
}
.mtop5{
.sepe-margin-top{
margin-top:5px;
}

@ -0,0 +1,42 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays setting api key user.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (api_is_platform_admin()) {
$tUser = Database::get_main_table(TABLE_MAIN_USER);
$tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
$login = 'SEPE';
$sql = "SELECT a.api_key AS api FROM $tUser u, $tApi a WHERE u.username='".$login."' and u.user_id = a.user_id AND a.api_service = 'dokeos';";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$tmp = Database::fetch_assoc($result);
$info = $tmp['api'];
} else {
$info = '';
}
$templateName = $plugin->get_lang('Setting');
$interbreadcrumb[] = array("url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe'));
$tpl = new Template($templateName);
$tpl->assign('info', $info);
$listing_tpl = 'sepe/view/configuration.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,221 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a formative action edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$actionOrigin = trim(Security::remove_XSS(stripslashes($_POST['action_origin'])));
$actionCode = trim(Security::remove_XSS(stripslashes($_POST['action_code'])));
$situation = trim(Security::remove_XSS(stripslashes($_POST['situation'])));
$specialtyOrigin = trim(Security::remove_XSS(stripslashes($_POST['specialty_origin'])));
$professionalArea = trim(Security::remove_XSS(stripslashes($_POST['professional_area'])));
$specialtyCode = trim(Security::remove_XSS(stripslashes($_POST['specialty_code'])));
$duration = trim(Security::remove_XSS(stripslashes($_POST['duration'])));
$dayStart = trim(Security::remove_XSS(stripslashes($_POST['day_start'])));
$monthStart = trim(Security::remove_XSS(stripslashes($_POST['month_start'])));
$yearStart = trim(Security::remove_XSS(stripslashes($_POST['year_start'])));
$dayEnd = trim(Security::remove_XSS(stripslashes($_POST['day_end'])));
$monthEnd = trim(Security::remove_XSS(stripslashes($_POST['month_end'])));
$yearEnd = trim(Security::remove_XSS(stripslashes($_POST['year_end'])));
$fullItineraryIndicator = trim(Security::remove_XSS(stripslashes($_POST['full_itinerary_indicator'])));
$financingType = trim(Security::remove_XSS(stripslashes($_POST['financing_type'])));
$attendeesCount = trim(Security::remove_XSS(stripslashes($_POST['attendees_count'])));
$actionName = trim(Security::remove_XSS(stripslashes($_POST['action_name'])));
$globalInfo = trim(Security::remove_XSS(stripslashes($_POST['global_info'])));
$schedule = trim(Security::remove_XSS(stripslashes($_POST['schedule'])));
$requirements = trim(Security::remove_XSS(stripslashes($_POST['requirements'])));
$contactAction = trim(Security::remove_XSS(stripslashes($_POST['contact_action'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$courseId = trim(Security::remove_XSS(stripslashes($_POST['course_id'])));
$startDate = $yearStart."-".$monthStart."-".$dayStart;
$endDate = $yearEnd."-".$monthEnd."-".$dayEnd;
if (!empty($actionId) && $actionId != '0') {
$sql = "UPDATE plugin_sepe_actions SET
action_origin='".$actionOrigin."',
action_code='".$actionCode."',
situation='".$situation."',
specialty_origin='".$specialtyOrigin."',
professional_area='".$professionalArea."',
specialty_code='".$specialtyCode."',
duration='".$duration."',
start_date='".$startDate."',
end_date='".$endDate."',
full_itinerary_indicator='".$fullItineraryIndicator."',
financing_type='".$financingType."',
attendees_count='".$attendeesCount."',
action_name='".$actionName."',
global_info='".$globalInfo."',
schedule='".$schedule."',
requirements='".$requirements."',
contact_action='".$contactAction."'
WHERE id='".$actionId."';";
} else {
$sql = "INSERT INTO plugin_sepe_actions (
action_origin,
action_code,
situation,
specialty_origin,
professional_area,
specialty_code,
duration,
start_date,
end_date,
full_itinerary_indicator,
financing_type,
attendees_count,
action_name,
global_info,
schedule,
requirements,
contact_action
) VALUES (
'".$actionOrigin."',
'".$actionCode."',
'".$situation."',
'".$specialtyOrigin."',
'".$professionalArea."',
'".$specialtyCode."',
'".$duration."',
'".$startDate."',
'".$endDate."',
'".$fullItineraryIndicator."',
'".$financingType."',
'".$attendeesCount."',
'".$actionName."',
'".$globalInfo."',
'".$schedule."',
'".$requirements."',
'".$contactAction."'
);";
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($actionId == '0') {
//Sync formative action and course
$actionId = Database::insert_id();
$sql = "SELECT 1 FROM course WHERE id='".$courseId."';";
$rs = Database::query($sql);
if (Database::num_rows($rs) == 0) {
$sepe_message_error .= $plugin->get_lang('NoExistsCourse');
error_log($sepe_message_error);
} else {
$sql = "INSERT INTO $tableSepeCourseActions (course_id, action_id) VALUES ('".$courseId."','".$actionId."');";
$rs = Database::query($sql);
if (!$rs) {
$sepe_message_error .= $plugin->get_lang('NoSaveSeleccion');
error_log($sepe_message_error);
} else {
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
}
}
}
$courseId = getCourse($actionId);
header("Location: formative-action.php?cid=".$courseId);
} else {
Security::clear_token();
$token = Security::get_token();
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
session_write_close();
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
if ($actionId == '0') {
$courseId = trim(Security::remove_XSS(stripslashes($_POST['course_id'])));
header("Location: formative-action-edit.php?new_action=1&cid=".$courseId);
} else {
header("Location: formative-action-edit.php?action_id=".$actionId);
}
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
if (isset($_GET['new_action']) && $_GET['new_action'] == '1') {
$info = array();
$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'));
$templateName = $plugin->get_lang('formativeActionNew');
$tpl = new Template($templateName);
$yearStart = $yearEnd = date("Y");
$tpl->assign('info', $info);
$tpl->assign('new_action', '1');
$tpl->assign('course_id', $_GET['cid']);
} else {
$courseId = getCourse($_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=".$courseId, "name" => $plugin->get_lang('FormativeAction'));
$info = getActionInfo($_GET['action_id']);
$templateName = $plugin->get_lang('formativeActionEdit');
$tpl = new Template($templateName);
$tpl->assign('info', $info);
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'])));
$yearStart = date("Y",strtotime($info['start_date']));
} elseif (strpos($info['start_date'],'0000') === false) {
$yearStart = date("Y",strtotime($info['start_date']));
} else {
$yearStart = date("Y");
}
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'])));
$yearEnd = date("Y",strtotime($info['end_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$yearEnd = date("Y",strtotime($info['end_date']));
} else {
$yearEnd = date("Y");
}
$tpl->assign('new_action', '0');
}
$yearList = array();
if ($yearStart > $yearEnd) {
$tmp = $yearStart;
$yearStart = $yearEnd;
$yearEnd = $tmp;
}
$yearStart -= 5;
$yearEnd += 5;
$fin_rango_anio = (($yearStart + 15) < $yearEnd) ? ($yearEnd+1):($yearStart +15);
while ($yearStart <= $fin_rango_anio) {
$yearList[] = $yearStart;
$yearStart++;
}
$tpl->assign('list_year', $yearList);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/formative-action-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,51 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a basic info of formative action.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (api_is_platform_admin()) {
$actionId = getActionId($_GET['cid']);
$info = getActionInfo($actionId);
if ($info === false) {
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']);
unset($_SESSION['sepe_message_info']);
}
if (isset($_SESSION['sepe_message_error'])) {
$tpl->assign('message_error', $_SESSION['sepe_message_error']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('info', $info);
$tpl->assign('start_date', date("d/m/Y",strtotime($info['start_date'])));
$tpl->assign('end_date', date("d/m/Y",strtotime($info['end_date'])));
$tpl->assign('action_id', $actionId);
$listSpecialty = specialtyList($actionId);
$tpl->assign('listSpecialty', $listSpecialty);
$listParticipant = participantList($actionId);
$tpl->assign('listParticipant', $listParticipant);
$listing_tpl = 'sepe/view/formative-action.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,41 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a formatives actions list.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();
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']);
unset($_SESSION['sepe_message_info']);
}
if (isset($_SESSION['sepe_message_error'])) {
$tpl->assign('message_error', $_SESSION['sepe_message_error']);
unset($_SESSION['sepe_message_error']);
}
$courseActionList = listCourseAction();
$courseFreeList = listCourseFree();
$actionFreeList = listActionFree();
$tpl->assign('course_action_list', $courseActionList);
$tpl->assign('course_free_list', $courseFreeList);
$tpl->assign('action_free_list', $actionFreeList);
$listing_tpl = 'sepe/view/formative-actions-list.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -4,34 +4,12 @@
* Functions for the Sepe plugin
* @package chamilo.plugin.sepe
*/
/**
* Init
*/
require_once '../config.php';
/*
require_once 'sepe.lib.php';
//require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
$tableSepeCenter = Database::get_main_table(TABLE_SEPE_CENTER);
$tableSepeActions = Database::get_main_table(TABLE_SEPE_ACTIONS);
$tableSepeSpecialty = Database::get_main_table(TABLE_SEPE_SPECIALTY);
$tableSepeSpecialtyClassroom = Database::get_main_table(TABLE_SEPE_SPECIALTY_CLASSROOM);
$tableSepeSpecialtyTutors = Database::get_main_table(TABLE_SEPE_SPECIALTY_TUTORS);
$tableSepeTutors = Database::get_main_table(TABLE_SEPE_TUTORS);
$tableSepeParticipants = Database::get_main_table(TABLE_SEPE_PARTICIPANTS);
$tableSepeParticipantsSpecialty = Database::get_main_table(TABLE_SEPE_PARTICIPANTS_SPECIALTY);
$tableSepeParticipantsSpecialtyTutorials = Database::get_main_table(TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS);
$tableSepeCourseActions = Database::get_main_table(TABLE_SEPE_COURSE_ACTIONS);
$tableCourse = Database::get_main_table(TABLE_MAIN_COURSE);
$tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tableUser = Database::get_main_table(TABLE_MAIN_USER);
*/
$plugin = SepePlugin::create();
if ($_REQUEST['tab'] == 'borra_datos_centro') {
if ($_REQUEST['tab'] == 'delete_center_data') {
$sql = "DELETE FROM $tableSepeCenter;";
$res = Database::query($sql);
if (!$res) {
@ -45,9 +23,9 @@ if ($_REQUEST['tab'] == 'borra_datos_centro') {
}
}
if ($_REQUEST['tab'] == 'borra_accion_formativa') {
$cod = $_REQUEST['cod'];
$sql = "DELETE FROM $tableSepeActions WHERE cod='".$cod."';";
if ($_REQUEST['tab'] == 'delete_action') {
$id = $_REQUEST['id'];
$sql = "DELETE FROM $tableSepeActions WHERE id='".$id."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoAction') . Database::error();
@ -59,9 +37,9 @@ if ($_REQUEST['tab'] == 'borra_accion_formativa') {
}
}
if ($_REQUEST['tab'] == 'borra_especialidad_accion') {
$cod = substr($_REQUEST['cod'],9);
$sql = "DELETE FROM $tableSepeSpecialty WHERE cod='".$cod."';";
if ($_REQUEST['tab'] == 'delete_specialty') {
$id = substr($_REQUEST['id'],9);
$sql = "DELETE FROM $tableSepeSpecialty WHERE id='".$id."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty') . Database::error();
@ -72,9 +50,9 @@ if ($_REQUEST['tab'] == 'borra_especialidad_accion') {
}
}
if ($_REQUEST['tab'] == 'borra_especialidad_participante') {
$cod = substr($_REQUEST['cod'],9);
$sql = "DELETE FROM $tableSepeParticipantsSpecialty WHERE cod='".$cod."';";
if ($_REQUEST['tab'] == 'delete_specialty_participant') {
$id = substr($_REQUEST['id'],9);
$sql = "DELETE FROM $tableSepeParticipantsSpecialty WHERE id='".$id."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty') . Database::error();
@ -85,9 +63,9 @@ if ($_REQUEST['tab'] == 'borra_especialidad_participante') {
}
}
if ($_REQUEST['tab'] == 'borra_especialidad_classroom') {
$cod = substr($_REQUEST['cod'],9);
$sql = "DELETE FROM $tableSepeSpecialtyClassroom WHERE cod='".$cod."';";
if ($_REQUEST['tab'] == 'delete_classroom') {
$id = substr($_REQUEST['id'],9);
$sql = "DELETE FROM $tableSepeSpecialtyClassroom WHERE id='".$id."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyClassroom') . Database::error();
@ -98,14 +76,15 @@ if ($_REQUEST['tab'] == 'borra_especialidad_classroom') {
}
}
if ($_REQUEST['tab'] == 'comprobar_editar_tutor') {
//$cod = substr($_REQUEST['cod'],9);
$tipo = $_REQUEST['tipo'];
$num = $_REQUEST['num'];
$letra=$_REQUEST['letra'];
$codchamilo = $_REQUEST['codchamilo'];
if ($_REQUEST['tab'] == 'checkTutorEdit') {
$type = $_REQUEST['type'];
$number = $_REQUEST['number'];
$letter=$_REQUEST['letter'];
$platform_user_id = $_REQUEST['platform_user_id'];
$sql = "SELECT cod_user_chamilo FROM $tableSepeTutors WHERE TIPO_DOCUMENTO='".$tipo."' AND NUM_DOCUMENTO='".$num."' AND LETRA_NIF='".$letra."';";
$sql = "SELECT platform_user_id
FROM $tableSepeTutors
WHERE document_type='".$type."' AND document_number='".$number."' AND document_letter='".$letter."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemDataBase') . Database::error();
@ -113,7 +92,7 @@ if ($_REQUEST['tab'] == 'comprobar_editar_tutor') {
exit;
} else {
$aux = Database::fetch_assoc($res);
if ($aux['cod_user_chamilo']==$codchamilo || $aux['cod_user_chamilo']=='0') {
if ($aux['platform_user_id'] == $platform_user_id || $aux['platform_user_id'] == '0') {
echo json_encode(array("status" => "true"));
} else {
$content = $plugin->get_lang('ModDataTeacher');
@ -122,9 +101,9 @@ if ($_REQUEST['tab'] == 'comprobar_editar_tutor') {
}
}
if ($_REQUEST['tab'] == 'borra_especialidad_tutor') {
$cod = substr($_REQUEST['cod'],5);
$sql = "DELETE FROM $tableSepeSpecialtyTutors WHERE cod='".$cod."';";
if ($_REQUEST['tab'] == 'delete_tutor') {
$id = substr($_REQUEST['id'],5);
$sql = "DELETE FROM $tableSepeSpecialtyTutors WHERE id='".$id."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyTutor') . Database::error();
@ -135,16 +114,16 @@ if ($_REQUEST['tab'] == 'borra_especialidad_tutor') {
}
}
if ($_REQUEST['tab'] == 'borra_participante_accion') {
$cod = substr($_REQUEST['cod'],11);
$sql = "SELECT cod_user_chamilo, cod_action FROM $tableSepeParticipants WHERE cod='".$cod."';";
if ($_REQUEST['tab'] == 'delete_participant') {
$id = substr($_REQUEST['id'],11);
$sql = "SELECT platform_user_id, action_id FROM $tableSepeParticipants WHERE id='".$id."';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
$sql = "UPDATE plugin_sepe_log_participant SET fecha_baja='".date("Y-m-d H:i:s")."' WHERE cod_user_chamilo='".$row['cod_user_chamilo']."' AND cod_action='".$row['cod_action']."';";
$sql = "UPDATE plugin_sepe_log_participant SET fecha_baja='".date("Y-m-d H:i:s")."' WHERE platform_user_id='".$row['platform_user_id']."' AND action_id='".$row['action_id']."';";
$res = Database::query($sql);
$sql = "DELETE FROM $tableSepeParticipants WHERE cod='".$cod."';";
$sql = "DELETE FROM $tableSepeParticipants WHERE id='".$id."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoParticipant') . Database::error();
@ -155,9 +134,9 @@ if ($_REQUEST['tab'] == 'borra_participante_accion') {
}
}
if ($_REQUEST['tab'] == 'desvincular_action') {
$cod = substr($_REQUEST['cod'],3);
$sql = "DELETE FROM $tableSepeCourseActions WHERE cod='".$cod."';";
if ($_REQUEST['tab'] == 'unlink_action') {
$id = substr($_REQUEST['id'],16);
$sql = "DELETE FROM $tableSepeCourseActions WHERE id='".$id."';";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDesvincularInfoAction') . Database::error();
@ -168,30 +147,30 @@ if ($_REQUEST['tab'] == 'desvincular_action') {
}
}
if ($_REQUEST['tab'] == 'asignar_accion') {
$id_course = substr($_REQUEST['cod_course'],11);
$cod_action = $_REQUEST['cod_action'];
if ($_REQUEST['tab'] == 'assign_action') {
$course_id = substr($_REQUEST['course_id'],9);
$action_id = $_REQUEST['action_id'];
if (trim($cod_action)!='' && trim($id_course)!='') {
$cod_action = Database::escape_string($cod_action);
$id_course = Database::escape_string($id_course);
$sql = "SELECT * FROM $tableSepeCourseActions WHERE cod_action='".$cod_action."';";
if (trim($action_id) != '' && trim($course_id) != '') {
$action_id = Database::escape_string($action_id);
$course_id = Database::escape_string($course_id);
$sql = "SELECT * FROM $tableSepeCourseActions WHERE action_id='".$action_id."';";
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
$content = "La acci&oacute;n formativa elegida est&aacute; siendo usada por otro curso";
$content = $plugin->get_lang('FormativeActionInUse');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$sql = "SELECT 1 FROM course WHERE id='".$id_course."';";
$sql = "SELECT 1 FROM course WHERE id='".$course_id."';";
$rs = Database::query($sql);
if (Database::num_rows($rs) == 0) {
$content = "El curso al que se le asocia la acci&oacute;n formativa no existe";
$content = $plugin->get_lang('NoExistsCourse');
echo json_encode(array("status" => "false", "content" => $content));
} else {
$sql = "INSERT INTO $tableSepeCourseActions (id_course, cod_action) VALUES ('".$id_course."','".$cod_action."');";
$sql = "INSERT INTO $tableSepeCourseActions (course_id, action_id) VALUES ('".$course_id."','".$action_id."');";
$rs = Database::query($sql);
if (!$rs) {
$content = "No se ha podido guardar la selección";
$content = $plugin->get_lang('NoSaveData');
echo json_encode(array("status" => "false", "content" => utf8_encode($content)));
} else {
echo json_encode(array("status" => "true"));
@ -199,14 +178,13 @@ if ($_REQUEST['tab'] == 'asignar_accion') {
}
}
} else {
$content = "Error al recibir los datos";
$content = $plugin->get_lang('ErrorDataIncorrect');
echo json_encode(array("status" => "false", "content" => $content));
}
}
if ($_REQUEST['tab'] == 'generar_api_key_sepe') {
if ($_REQUEST['tab'] == 'key_sepe_generator') {
$tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
//$info_user = UserManager::get_user_info('SEPE');
$info_user = api_get_user_info_from_username('SEPE');
$array_list_key = array();
@ -215,11 +193,11 @@ if ($_REQUEST['tab'] == 'generar_api_key_sepe') {
$num = UserManager::update_api_key($user_id, $api_service);
$array_list_key = UserManager::get_api_keys($user_id, $api_service);
if (trim($array_list_key[$num])!='') {
if (trim($array_list_key[$num]) != '') {
$content = $array_list_key[$num];
echo json_encode(array("status" => "true", "content" => $content));
} else {
$content = "Problema al generar una nueva api key";
$content = $plugin->get_lang('ProblemGenerateApiKey');
echo json_encode(array("status" => "false", "content" => $content));
}
}

@ -0,0 +1,94 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a data center edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();
if ( !empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$centerOrigin = trim(Security::remove_XSS(stripslashes($_POST['center_origin'])));
$centerCode = trim(Security::remove_XSS(stripslashes($_POST['center_code'])));
$centerName = trim(Security::remove_XSS(stripslashes($_POST['center_name'])));
$url = trim(Security::remove_XSS(stripslashes($_POST['url'])));
$trackingUrl = trim(Security::remove_XSS(stripslashes($_POST['tracking_url'])));
$phone = trim(Security::remove_XSS(stripslashes($_POST['phone'])));
$mail = trim(Security::remove_XSS(stripslashes($_POST['mail'])));
$id = trim(Security::remove_XSS(stripslashes($_POST['id'])));
if (checkIdentificationData()) {
$sql = "UPDATE $tableSepeCenter SET
center_origin='".$centerOrigin."',
center_code='".$centerCode."',
center_name='".$centerName."',
url='".$url."',
tracking_url='".$trackingUrl."',
phone='".$phone."',
mail='".$mail."'
WHERE id='".$id."'";
} else {
$sql = "INSERT INTO $tableSepeCenter (
id,
center_origin,
center_code,
center_name,
url,
tracking_url,
phone,
mail
) VALUES (
'1',
'".$centerOrigin."',
'".$centerCode."',
'".$centerName."',
'".$url."',
'".$trackingUrl."',
'".$phone."',
'".$mail."'
);";
}
$res = Database::query($sql);
if (!$res) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
header("Location: identification-data.php");
} else {
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
Security::clear_token();
$token = Security::get_token();
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$interbreadcrumb[] = array("url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe'));
$interbreadcrumb[] = array("url" => "identification-data.php", "name" => $plugin->get_lang('DataCenter'));
$templateName = $plugin->get_lang('DataCenterEdit');
$tpl = new Template($templateName);
$info = getInfoIdentificationData();
$tpl->assign('info', $info);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/identification-data-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,37 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a basic info about data center.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();
$_cid = 0;
if (api_is_platform_admin()) {
$info = getInfoIdentificationData();
$templateName = $plugin->get_lang('DataCenter');
$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']);
unset($_SESSION['sepe_message_info']);
}
if (isset($_SESSION['sepe_message_error'])) {
$tpl->assign('message_error', $_SESSION['sepe_message_error']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('info', $info);
$listing_tpl = 'sepe/view/identification-data.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -4,43 +4,40 @@
* Index of the Sepe plugin
* @package chamilo.plugin.sepe
*/
/**
*
*/
$plugin = SepePlugin::create();
$is_enable = $plugin->get('sepe_enable');
$title="Administraci&oacute;n SEPE";
$plugin = SepePlugin::create();
$enable = $plugin->get('sepe_enable') == 'true';
$title = $plugin->get_lang('AdministratorSepe');
$pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/';
if (api_is_platform_admin() && $is_enable=="true") {
echo '<div class="panel panel-default">';
echo '<div class="panel-heading" role="tab">';
echo '<h4 class="panel-title">'.$title.'</h4>';
echo '</div>';
echo '<div class="panel-collapse collapse in" role="tabpanel">';
echo '<div class="panel-body">';
echo '<ul class="nav nav-pills nav-stacked">';
echo '<li>';
echo '<a href="'.$pluginPath.'datos-identificativos.php">';
echo '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/list.png">';
echo $plugin->get_lang('datos_centro');
echo '</a>';
echo '</li>';
echo '<li>';
echo '<a href="'.$pluginPath.'listado-acciones-formativas.php">';
echo '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/forms.png">';
echo $plugin->get_lang('formulario_acciones_formativas');
echo '</a>';
echo '</li>';
echo '<li>';
echo '<a href="'.$pluginPath.'configuracion.php">';
echo '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/settings.png">';
echo $plugin->get_lang('configuracion_sepe');
echo '</a>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '</div>';
if (api_is_platform_admin() && $enable) {
echo '<div class="panel panel-default">';
echo '<div class="panel-heading" role="tab">';
echo '<h4 class="panel-title">'.$title.'</h4>';
echo '</div>';
echo '<div class="panel-collapse collapse in" role="tabpanel">';
echo '<div class="panel-body">';
echo '<ul class="nav nav-pills nav-stacked">';
echo '<li>';
echo '<a href="'.$pluginPath.'identification-data.php">';
echo '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/list.png">';
echo $plugin->get_lang('DataCenter');
echo '</a>';
echo '</li>';
echo '<li>';
echo '<a href="'.$pluginPath.'formative-actions-list.php">';
echo '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/forms.png">';
echo $plugin->get_lang('FormativeActionsForm');
echo '</a>';
echo '</li>';
echo '<li>';
echo '<a href="'.$pluginPath.'configuration.php">';
echo '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/settings.png">';
echo $plugin->get_lang('Setting');
echo '</a>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '</div>';
}

@ -0,0 +1,230 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a participant edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if ( !empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$companyTutorId = trim(Security::remove_XSS(stripslashes($_POST['company_tutor_id'])));
$tutorCompanyDocumentType = trim(Security::remove_XSS(stripslashes($_POST['tutor_company_document_type'])));
$tutorCompanyDocumentNumber = trim(Security::remove_XSS(stripslashes($_POST['tutor_company_document_number'])));
$tutorCompanyDocumentLetter = trim(Security::remove_XSS(stripslashes($_POST['tutor_company_document_letter'])));
$tutorCompanyAlias = trim(Security::remove_XSS(stripslashes($_POST['tutor_company_alias'])));
$trainingTutorId = trim(Security::remove_XSS(stripslashes($_POST['training_tutor_id'])));
$tutorTrainingDocumentType = trim(Security::remove_XSS(stripslashes($_POST['tutor_training_document_type'])));
$tutorTrainingDocumentNumber = trim(Security::remove_XSS(stripslashes($_POST['tutor_training_document_number'])));
$tutorTrainingDocumentLetter = trim(Security::remove_XSS(stripslashes($_POST['tutor_training_document_letter'])));
$tutorTrainingAlias = trim(Security::remove_XSS(stripslashes($_POST['tutor_training_alias'])));
$newParticipant = trim(Security::remove_XSS(stripslashes($_POST['new_participant'])));
$platformUserId = trim(Security::remove_XSS(stripslashes($_POST['platform_user_id'])));
$documentType = trim(Security::remove_XSS(stripslashes($_POST['document_type'])));
$documentNumber = trim(Security::remove_XSS(stripslashes($_POST['document_number'])));
$documentLetter = trim(Security::remove_XSS(stripslashes($_POST['document_letter'])));
$keyCompetence = trim(Security::remove_XSS(stripslashes($_POST['key_competence'])));
$contractId = trim(Security::remove_XSS(stripslashes($_POST['contract_id'])));
$companyFiscalNumber = trim(Security::remove_XSS(stripslashes($_POST['company_fiscal_number'])));
$participantId = trim(Security::remove_XSS(stripslashes($_POST['participant_id'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
if (isset($companyTutorId) && $companyTutorId == "new_company_tutor") {
$sql = "SELECT * FROM $tableTutorCompany
WHERE document_type='".$tutorCompanyDocumentType."' AND document_number='".$tutorCompanyDocumentNumber."' AND document_letter='".$tutorCompanyDocumentLetter."';";
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
$row = Database::fetch_assoc($rs);
$companyTutorId = $row['id'];
$sql = "UPDATE $tableTutorCompany SET company='1' WHERE id='".$companyTutorId."'";
Database::query($sql);
} else {
$sql = "INSERT INTO $tableTutorCompany (alias,document_type,document_number,document_letter,company)
VALUES ('".$tutorCompanyAlias."','".$tutorCompanyDocumentType."','".$tutorCompanyDocumentNumber."','".$tutorCompanyDocumentLetter."','1');";
$rs = Database::query($sql);
if (!$rs) {
echo Database::error();
} else {
$companyTutorId = Database::insert_id();
}
}
}
if (isset($trainingTutorId) && $trainingTutorId == "new_training_tutor") {
$sql = "SELECT * FROM $tableTutorCompany
WHERE document_type='".$tutorTrainingDocumentType."' AND document_number='".$tutorTrainingDocumentNumber."' AND document_letter='".$tutorTrainingDocumentLetter."';";
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
$row = Database::fetch_assoc($rs);
$trainingTutorId = $row['id'];
$sql = "UPDATE $tableTutorCompany SET training='1' WHERE id='".$trainingTutorId."'";
Database::query($sql);
} else {
$sql = "INSERT INTO $tableTutorCompany (alias,document_type,document_number,document_letter,training)
VALUES ('".$tutorTrainingAlias."','".$tutorTrainingDocumentType."','".$tutorTrainingDocumentNumber."','".$tutorTrainingDocumentLetter."','1');";
$rs = Database::query($sql);
if (!$rs) {
echo Database::error();
} else {
$trainingTutorId = Database::insert_id();
}
}
}
if (isset($newParticipant) && $newParticipant != "1") {
$sql = "UPDATE plugin_sepe_participants SET
platform_user_id='".$platformUserId."',
document_type='".$documentType."',
document_number='".$documentNumber."',
document_letter='".$documentLetter."',
key_competence='".$keyCompetence."',
contract_id='".$contractId."',
company_fiscal_number='".$companyFiscalNumber."',
company_tutor_id='".$companyTutorId."',
training_tutor_id='".$trainingTutorId."'
WHERE id='".$participantId."';";
} else {
$sql = "INSERT INTO plugin_sepe_participants(
action_id,
platform_user_id,
document_type,
document_number,
document_letter,
key_competence,
contract_id,
company_fiscal_number,
company_tutor_id,
training_tutor_id
) VALUES (
'".$actionId."',
'".$platformUserId."',
'".$documentType."',
'".$documentNumber."',
'".$documentLetter."',
'".$keyCompetence."',
'".$contractId."',
'".$companyFiscalNumber."',
'".$companyTutorId."',
'".$trainingTutorId."'
);";
}
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newParticipant == '1') {
$participantId = Database::insert_id();
}
$insertLog = checkInsertNewLog($platformUserId,$actionId);
if ($insertLog) {
$sql = "INSERT INTO $tableSepeLogParticipant (
platform_user_id,
action_id,
registration_date
) VALUES (
'".$platformUserId."',
'".$actionId."',
'".date("Y-m-d H:i:s")."'
);";
} else {
$sql = "INSERT INTO $tableSepeLogChangeParticipant (
platform_user_id,
action_id,
change_date
) VALUES (
'".$platformUserId."',
'".$actionId."',
'".date("Y-m-d H:i:s")."'
);";
}
$res = Database::query($sql);
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
session_write_close();
header("Location: participant-action-edit.php?new_participant=0&participant_id=".$participantId."&action_id=".$actionId);
} else {
$participantId = trim(Security::remove_XSS(stripslashes($_POST['participant_id'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$newParticipant = trim(Security::remove_XSS(stripslashes($_POST['new_participant'])));
Security::clear_token();
$token = Security::get_token();
$_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);
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$courseId = getCourse($_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=".$courseId, "name" => $plugin->get_lang('FormativeAction'));
if (isset($_GET['new_participant']) && $_GET['new_participant'] == '1') {
$templateName = $plugin->get_lang('NewParticipantAction');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$info = array();
$tpl->assign('info', $info);
$tpl->assign('new_participant', '1');
} else {
$templateName = $plugin->get_lang('EditParticipantAction');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$info = getInfoParticipantAction($_GET['participant_id']);
$tpl->assign('info', $info);
$tpl->assign('new_participant', '0');
$tpl->assign('participant_id', $_GET['participant_id']);
if ($info['platform_user_id'] != 0) {
$infoUserPlatform = api_get_user_info($info['platform_user_id']);//UserManager::get_user_info_by_id($info['platform_user_id']);
$tpl->assign('info_user_platform', $infoUserPlatform);
}
$listParticipantSpecialty = listParticipantSpecialty($_GET['participant_id']);
$tpl->assign('listParticipantSpecialty', $listParticipantSpecialty);
}
$courseCode = getCourseCode($_GET['action_id']);
$listStudentInfo = array();
$listStudent = CourseManager::get_student_list_from_course_code($courseCode);
foreach ($listStudent as $value) {
$sql = "SELECT 1 FROM $tableSepeParticipants WHERE platform_user_id='".$value['user_id']."';";
$res = Database::query($sql);
if (Database::num_rows($res)==0) {
$listStudentInfo[] = api_get_user_info($value['user_id']);
}
}
$tpl->assign('listStudent', $listStudentInfo);
$listTutorCompany = array();
$listTutorCompany = listTutorType("company='1'");
$tpl->assign('list_tutor_company', $listTutorCompany);
$listTutorTraining = array();
$listTutorTraining= listTutorType("training='1'");
$tpl->assign('list_tutor_training', $listTutorTraining);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/participant-action-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,276 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a participant specialty edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if ( !empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$newSpecialty = trim(Security::remove_XSS(stripslashes($_POST['new_specialty'])));
$specialtyOrigin = trim(Security::remove_XSS(stripslashes($_POST['specialty_origin'])));
$professionalArea = trim(Security::remove_XSS(stripslashes($_POST['professional_area'])));
$specialtyCode = trim(Security::remove_XSS(stripslashes($_POST['specialty_code'])));
$centerOrigin = trim(Security::remove_XSS(stripslashes($_POST['center_origin'])));
$centerCode = trim(Security::remove_XSS(stripslashes($_POST['center_code'])));
$finalResult = trim(Security::remove_XSS(stripslashes($_POST['final_result'])));
$finalQualification = trim(Security::remove_XSS(stripslashes($_POST['final_qualification'])));
$finalScore = trim(Security::remove_XSS(stripslashes($_POST['final_score'])));
$yearRegistration = trim(Security::remove_XSS(stripslashes($_POST['year_registration'])));
$monthRegistration = trim(Security::remove_XSS(stripslashes($_POST['month_registration'])));
$dayRegistration = trim(Security::remove_XSS(stripslashes($_POST['day_registration'])));
$yearLeaving = trim(Security::remove_XSS(stripslashes($_POST['year_leaving'])));
$monthLeaving = trim(Security::remove_XSS(stripslashes($_POST['month_leaving'])));
$dayLeaving = trim(Security::remove_XSS(stripslashes($_POST['day_leaving'])));
$dayStart = trim(Security::remove_XSS(stripslashes($_POST['day_start'])));
$monthStart = trim(Security::remove_XSS(stripslashes($_POST['month_start'])));
$yearStart = trim(Security::remove_XSS(stripslashes($_POST['year_start'])));
$dayEnd = trim(Security::remove_XSS(stripslashes($_POST['day_end'])));
$monthEnd = trim(Security::remove_XSS(stripslashes($_POST['month_end'])));
$yearEnd = trim(Security::remove_XSS(stripslashes($_POST['year_end'])));
$participantId = trim(Security::remove_XSS(stripslashes($_POST['participant_id'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$registrationDate = $yearRegistration."-".$monthRegistration."-".$dayRegistration;
$leavingDate = $yearLeaving."-".$monthLeaving."-".$dayLeaving;
$startDate = $yearStart."-".$monthStart."-".$dayStart;
$endDate = $yearEnd."-".$monthEnd."-".$dayEnd;
if (isset($newSpecialty) && $newSpecialty != "1") {
$sql = "UPDATE $tableSepeParticipantsSpecialty SET
specialty_origin='".$specialtyOrigin."',
professional_area='".$professionalArea."',
specialty_code='".$specialtyCode."',
registration_date='".$registrationDate."',
leaving_date='".$leavingDate."',
center_origin='".$centerOrigin."',
center_code='".$centerCode."',
start_date='".$startDate."',
end_date='".$endDate."',
final_result='".$finalResult."',
final_qualification='".$finalQualification."',
final_score='".$finalScore."'
WHERE id='".$specialtyId."';";
} else {
$sql = "INSERT INTO $tableSepeParticipantsSpecialty (
participant_id,
specialty_origin,
professional_area,
specialty_code,
registration_date,
leaving_date,
center_origin,
center_code,
start_date,
end_date,
final_result,
final_qualification,
final_score
) VALUES (
'".$participantId."',
'".$specialtyOrigin."',
'".$professionalArea."',
'".$specialtyCode."',
'".$registrationDate."',
'".$leavingDate."',
'".$centerOrigin."',
'".$centerCode."',
'".$startDate."',
'".$endDate."',
'".$finalResult."',
'".$finalQualification."',
'".$finalScore."'
);";
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
if ($newSpecialty == "1") {
$specialtyId = Database::insert_id();
}
$platformUserId = etUserPlatformFromParticipant($participantId);
$insertLog = checkInsertNewLog($platformUserId,$actionId);
if ($insertLog) {
if ($finalResult == "1" || $finalResult == "2") {
$leavingDateLog = date("Y-m-d H:i:s");
} else {
$leavingDateLog = '0000-00-00';
}
$sql = "INSERT INTO $tableSepeLogParticipant (
platform_user_id,
action_id,
registration_date,
leaving_date
) VALUES (
'".$platformUserId."',
'".$actionId."',
'".date("Y-m-d H:i:s")."'
'".$leavingDateLog."'
);";
} else {
if ($finalResult == "1" || $finalResult == "2") {
$sql = "UPDATE $tableSepeLogParticipant
SET leaving_date='".date("Y-m-d H:i:s")."'
WHERE platform_user_id='".$platformUserId."' AND action_id='".$actionId."';";
} else {
$sql = "INSERT INTO $tableSepeLogChangeParticipant (
platform_user_id,
action_id,
change_date
) VALUES (
'".$platformUserId."',
'".$actionId."',
'".date("Y-m-d H:i:s")."'
);";
}
}
$res = Database::query($sql);
}
session_write_close();
header("Location: participant-specialty-edit.php?new_specialty=0&specialty_id=".$specialtyId."&participant_id=".$participantId."&action_id=".$actionId);
} else {
$newSpecialty = trim(Security::remove_XSS(stripslashes($_POST['new_specialty'])));
$participantId = trim(Security::remove_XSS(stripslashes($_POST['participant_id'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
Security::clear_token();
$token = Security::get_token();
$_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);
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$courseId = getCourse($_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=".$courseId, "name" => $plugin->get_lang('FormativeAction'));
$interbreadcrumb[] = array("url" => "participant-action-edit.php?new_participant=0&participant_id=".$_GET['participant_id']."&action_id=".$_GET['action_id'], "name" => $plugin->get_lang('FormativeActionParticipant'));
if (isset($_GET['new_specialty']) && $_GET['new_specialty'] == "1") {
$templateName = $plugin->get_lang('NewSpecialtyParticipant');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('participant_id', $_GET['participant_id']);
$info = array();
$tpl->assign('info', $info);
$tpl->assign('new_specialty', '1');
$startYear = $endYear = date("Y");
$registrationYear = $leaveYear = date("Y");
} else {
$templateName = $plugin->get_lang('EditSpecialtyParticipant');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('specialty_id', $_GET['specialty_id']);
$tpl->assign('participant_id', $_GET['participant_id']);
$info = getInfoSpecialtyParticipant($_GET['specialty_id']);
$tpl->assign('info', $info);
$tpl->assign('new_specialty', '0');
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'])));
$registrationYear = date("Y",strtotime($info['registration_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$registrationYear = date("Y",strtotime($info['registration_date']));
} else {
$registrationYear = date("Y");
}
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'])));
$leaveYear = date("Y",strtotime($info['leaving_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$leaveYear = date("Y",strtotime($info['leaving_date']));
} else {
$leaveYear = date("Y");
}
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'])));
$startYear = date("Y",strtotime($info['start_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$startYear = date("Y",strtotime($info['start_date']));
} else {
$startYear = date("Y");
}
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'])));
$endYear = date("Y",strtotime($info['end_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$endYear = date("Y",strtotime($info['end_date']));
} else {
$endYear = date("Y");
}
$listSpecialtyTutorials = getListSpecialtyTutorial($_GET['specialty_id']);
$tpl->assign('listSpecialtyTutorials', $listSpecialtyTutorials);
}
$listYear = array();
if ($registrationYear > $leaveYear) {
$tmp = $registrationYear;
$registrationYear = $leaveYear;
$leaveYear = $tmp;
}
$registrationYear -= 5;
$leaveYear += 5;
$endRangeYear = (($registrationYear + 15) < $leaveYear) ? ($leaveYear+1):($registrationYear + 15);
while ($registrationYear <= $endRangeYear) {
$listYear[] = $registrationYear;
$registrationYear++;
}
$tpl->assign('list_year', $listYear);
$listYear = array();
if ($startYear > $endYear) {
$tmp = $startYear;
$startYear = $endYear;
$endYear = $tmp;
}
$startYear -= 5;
$endYear += 5;
$endRangeYear = (($startYear + 15) < $endYear) ? ($endYear+1):($startYear +15);
while ($startYear <= $endRangeYear) {
$listYear[] = $startYear;
$startYear++;
}
$tpl->assign('list_year_2', $listYear);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/participant-specialty-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,62 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a administrator menu.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$plugin = SepePlugin::create();
$enable = $plugin->get('sepe_enable') == 'true';
$title = $plugin->get_lang('AdministratorSepe');
$pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/';
if (api_is_platform_admin() && $enable) {
$htmlText = '';
$htmlText .= '<div class="panel panel-default">';
$htmlText .= '<div class="panel-heading" role="tab">';
$htmlText .= '<h4 class="panel-title">'.$title.'</h4>';
$htmlText .= '</div>';
$htmlText .= '<div class="panel-collapse collapse in" role="tabpanel">';
$htmlText .= '<div class="panel-body">';
$htmlText .= '<ul class="nav nav-pills nav-stacked">';
$htmlText .= '<li>';
$htmlText .= '<a href="'.$pluginPath.'identification-data.php">';
$htmlText .= '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/list.png">';
$htmlText .= $plugin->get_lang('DataCenter');
$htmlText .= '</a>';
$htmlText .= '</li>';
$htmlText .= '<li>';
$htmlText .= '<a href="'.$pluginPath.'formative-actions-list.php">';
$htmlText .= '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/forms.png">';
$htmlText .= $plugin->get_lang('FormativeActionsForm');
$htmlText .= '</a>';
$htmlText .= '</li>';
$htmlText .= '<li>';
$htmlText .= '<a href="'.$pluginPath.'configuration.php">';
$htmlText .= '<img src="'.api_get_path(WEB_PLUGIN_PATH).'sepe/resources/settings.png">';
$htmlText .=$plugin->get_lang('Setting');
$htmlText .= '</a>';
$htmlText .= '</li>';
$htmlText .= '</ul>';
$htmlText .= '</div>';
$htmlText .= '</div>';
$htmlText .= '</div>';
$templateName = $plugin->get_lang('MenuSepeAdministrator');
$interbreadcrumb[] = array("url" => "/main/admin/index.php", "name" => get_lang('Administration'));
$tpl = new Template($templateName);
$tpl->assign('html_text', $htmlText);
$listing_tpl = 'sepe/view/sepe-administration-menu.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -3,9 +3,7 @@
* Functions
* @package chamilo.plugin.sepe
*/
//require_once __DIR__ . '../../../main/inc/global.inc.php';
//require_once '../config.php';
//require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
require_once 'sepe_plugin.class.php';
$tableSepeCenter = Database::get_main_table(SepePlugin::TABLE_SEPE_CENTER);
@ -21,11 +19,13 @@ $tableSepeCourseActions = Database::get_main_table(SepePlugin::TABLE_SEPE_COURSE
$tableCourse = Database::get_main_table(TABLE_MAIN_COURSE);
$tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tableUser = Database::get_main_table(TABLE_MAIN_USER);
$tableCentros = Database::get_main_table(SepePlugin::TABLE_SEPE_CENTROS);
$tableTutorE = Database::get_main_table(SepePlugin::TABLE_SEPE_TUTORS_EMPRESA);
$tableCenters = Database::get_main_table(SepePlugin::TABLE_SEPE_CENTERS);
$tableTutorCompany = Database::get_main_table(SepePlugin::TABLE_SEPE_TUTORS_COMPANY);
$tableSepeCourseActions = Database::get_main_table(SepePlugin::TABLE_SEPE_COURSE_ACTIONS);
$tableSepeLogParticipant = Database::get_main_table(SepePlugin::TABLE_SEPE_LOG_PARTICIPANT);
$tableSepeLogChangeParticipant = Database::get_main_table(SepePlugin::TABLE_SEPE_LOG_MOD_PARTICIPANT);
function datos_identificativos()
function getInfoIdentificationData()
{
global $tableSepeCenter;
$sql = "SELECT * FROM $tableSepeCenter;";
@ -38,46 +38,49 @@ function datos_identificativos()
return $row;
}
function obtener_cod_action($cod)
function checkIdentificationData()
{
global $tableSepeCenter;
$sql = "SELECT 1 FROM $tableSepeCenter;";
$result = Database::query($sql);
if (Database::affected_rows($result) > 0) {
return true;
}else{
return false;
}
}
function getActionId($courseId)
{
global $tableSepeCourseActions;
$sql = "SELECT cod_action FROM $tableSepeCourseActions WHERE id_course='".$cod."';";
$sql = "SELECT action_id FROM $tableSepeCourseActions WHERE course_id='".$courseId."';";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['cod_action'];
return $aux['action_id'];
}
function obtener_course($cod)
function getCourse($actionId)
{
global $tableSepeCourseActions;
$sql = "SELECT id_course FROM $tableSepeCourseActions WHERE cod_action='".$cod."';";
$sql = "SELECT course_id FROM $tableSepeCourseActions WHERE action_id='".$actionId."';";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['id_course'];
return $aux['course_id'];
}
function obtener_course_code($cod)
function getCourseCode($actionId)
{
global $tableCourse;
$course_id = obtener_course($cod);
$sql = "SELECT code FROM $tableCourse WHERE id='".$course_id."'";
$courseId = getCourse($actionId);
$sql = "SELECT code FROM $tableCourse WHERE id='".$courseId."'";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['code'];
}
function obtener_participant($cod)
{
global $tableSepeParticipantsSpecialty;
$sql = "SELECT cod_participant FROM $tableSepeParticipantsSpecialty WHERE cod='".$cod."';";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['cod_participant'];
}
function accion_formativa($cod)
function getActionInfo($id)
{
global $tableSepeActions;
$sql = "SELECT * FROM $tableSepeActions WHERE cod='".$cod."';";
$sql = "SELECT * FROM $tableSepeActions WHERE id='".$id."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
@ -88,10 +91,10 @@ function accion_formativa($cod)
return $row;
}
function especialidad_accion($cod)
function getSpecialtActionInfo($specialtyId)
{
global $tableSepeSpecialty;
$sql = "SELECT * FROM $tableSepeSpecialty WHERE cod='".$cod."';";
$sql = "SELECT * FROM $tableSepeSpecialty WHERE id='".$specialtyId."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
@ -102,13 +105,13 @@ function especialidad_accion($cod)
return $row;
}
function especialidad_classroom($cod)
function getInfoSpecialtyClassroom($classroomId)
{
global $tableSepeSpecialtyClassroom;
global $tableCentros;
$sql = "SELECT a.*,ORIGEN_CENTRO,CODIGO_CENTRO FROM $tableSepeSpecialtyClassroom a LEFT JOIN $tableCentros b
ON a.cod_centro=b.cod WHERE a.cod='".$cod."';";
//echo $sql; exit;
global $tableCenters;
$sql = "SELECT a.*, center_origin, center_code
FROM $tableSepeSpecialtyClassroom a LEFT JOIN $tableCenters b ON a.center_id=b.id
WHERE a.id='".$classroomId."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
@ -119,10 +122,10 @@ function especialidad_classroom($cod)
return $row;
}
function especialidad_tutorial($cod)
function getInfoSpecialtyTutorial($tutorialId)
{
global $tableSepeParticipantsSpecialtyTutorials;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE cod='".$cod."';";
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE id='".$tutorialId."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
@ -133,10 +136,10 @@ function especialidad_tutorial($cod)
return $row;
}
function list_tutor($cod_specialty)
function list_tutor($specialtyId)
{
global $tableSepeSpecialtyTutors;
$sql = "SELECT * FROM $tableSepeSpecialtyTutors WHERE cod_specialty='".$cod_specialty."';";
$sql = "SELECT * FROM $tableSepeSpecialtyTutors WHERE specialty_id='".$specialtyId."';";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
@ -146,10 +149,10 @@ function list_tutor($cod_specialty)
return $row;
}
function listado_centros()
function getCentersList()
{
global $tableCentros;
$sql = "SELECT * FROM $tableCentros;";
global $tableCenters;
$sql = "SELECT * FROM $tableCenters;";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
@ -158,82 +161,48 @@ function listado_centros()
return $aux;
}
function listadoTutorE($cond="empresa='SI'")
function listTutorType($condition)
{
global $tableTutorE;
$sql = "SELECT * FROM $tableTutorE WHERE ".$cond." ORDER BY alias ASC, NUM_DOCUMENTO ASC;";
global $tableTutorCompany;
$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)) {
$tmp = array();
$tmp['cod'] = $row['cod'];
if (trim($row['alias'])!='') {
$tmp['alias'] = $row['alias'].' - '.$row['TIPO_DOCUMENTO'].' '.$row['NUM_DOCUMENTO'].' '.$row['LETRA_NIF'];
$tmp['id'] = $row['id'];
if (trim($row['alias']) != '') {
$tmp['alias'] = $row['alias'].' - '.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
} else {
$tmp['alias'] = $row['TIPO_DOCUMENTO'].' '.$row['NUM_DOCUMENTO'].' '.$row['LETRA_NIF'];
$tmp['alias'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
}
$aux[] = $tmp;
}
return $aux;
}
function listadoTutorF()
{
global $tableTutorE;
$sql = "SELECT * FROM $tableTutorE WHERE formacion='SI' ORDER BY alias ASC, NUM_DOCUMENTO ASC;";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
$tmp = array();
$tmp['cod'] = $row['cod'];
if (trim($row['alias'])!='') {
$tmp['alias'] = $row['alias'].' - '.$row['TIPO_DOCUMENTO'].' '.$row['NUM_DOCUMENTO'].' '.$row['LETRA_NIF'];
} else {
$tmp['alias'] = $row['TIPO_DOCUMENTO'].' '.$row['NUM_DOCUMENTO'].' '.$row['LETRA_NIF'];
}
$aux[] = $tmp;
}
return $aux;
}
function listado_tutores()
{
global $tableSepeTutors;
global $tableUser;
$sql = "SELECT a.*, b.firstname AS firstname, b.lastname AS lastname
FROM $tableSepeTutors AS a, $tableUser AS b
WHERE a.cod_user_chamilo=b.user_id;";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
function listado_tutores_specialty($cod_specialty)
function getTutorsSpecialty($specialtyId)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
global $tableUser;
$sql = "SELECT cod_tutor FROM $tableSepeSpecialtyTutors;";
$sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors;";
$rs = Database::query($sql);
$lista_tutores = array();
$tutorsList = array();
while ($tmp = Database::fetch_assoc($rs)) {
$lista_tutores[] = $tmp['cod_tutor'];
$tutorsList[] = $tmp['tutor_id'];
}
$sql = "SELECT a.*, b.firstname AS firstname, b.lastname AS lastname
FROM $tableSepeTutors AS a LEFT JOIN $tableUser AS b ON a.cod_user_chamilo=b.user_id;";
$sql = "SELECT a.*, b.firstname AS firstname, b.lastname AS lastname
FROM $tableSepeTutors AS a LEFT JOIN $tableUser AS b ON a.platform_user_id=b.user_id;";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
if (!in_array($row['cod'],$lista_tutores)) {
if (!in_array($row['id'],$tutorsList)) {
$tutor = array();
$tutor['cod'] = $row['cod'];
if (trim($row['firstname'])!='' || trim($row['lastname'])!='') {
$tutor['datos'] = $row['firstname'].' '.$row['lastname'].' ('.$row['TIPO_DOCUMENTO'].' '.$row['NUM_DOCUMENTO'].' '.$row['LETRA_NIF'].' )';
$tutor['id'] = $row['id'];
if (trim($row['firstname']) != '' || trim($row['lastname']) != '') {
$tutor['data'] = $row['firstname'].' '.$row['lastname'].' ('.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'].' )';
} else {
$tutor['datos'] = $row['TIPO_DOCUMENTO'].' '.$row['NUM_DOCUMENTO'].' '.$row['LETRA_NIF'];
$tutor['data'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
}
$aux[] = $tutor;
}
@ -241,13 +210,14 @@ function listado_tutores_specialty($cod_specialty)
return $aux;
}
function especialidad_tutor($cod)
function getInfoSpecialtyTutor($tutorId)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
$sql = "SELECT a.*,cod_user_chamilo,TIPO_DOCUMENTO,NUM_DOCUMENTO,LETRA_NIF FROM $tableSepeSpecialtyTutors a
INNER JOIN $tableSepeTutors b ON a.cod_tutor=b.cod
WHERE a.cod='".$cod."';";
$sql = "SELECT a.*,platform_user_id,document_type, document_number,document_letter
FROM $tableSepeSpecialtyTutors a
INNER JOIN $tableSepeTutors b ON a.tutor_id=b.id
WHERE a.id='".$tutorId."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
@ -258,31 +228,36 @@ function especialidad_tutor($cod)
return $row;
}
function limpiarAsignadosProfesores($listProfesor,$cod_specialty,$cod_profesor_chamilo)
function freeTeacherList($teacherList,$specialtyId,$platform_user_id)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
$sql = "SELECT cod_tutor FROM $tableSepeSpecialtyTutors WHERE cod_specialty='".$cod_specialty."';";
$sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors WHERE specialty_id='".$specialtyId."';";
$rs = Database::query($sql);
if (Database::num_rows($rs)>0) {
if (Database::num_rows($rs) > 0) {
while ($aux = Database::fetch_assoc($rs)) {
$sql = "SELECT cod_user_chamilo FROM $tableSepeTutors WHERE cod='".$aux['cod_tutor']."';";
$sql = "SELECT platform_user_id FROM $tableSepeTutors WHERE id='".$aux['tutor_id']."';";
$res = Database::query($sql);
if (Database::num_rows($res)>0) {
if (Database::num_rows($res) > 0) {
$tmp = Database::fetch_assoc($res);
if ($tmp['cod_user_chamilo']!=$cod_profesor_chamilo) {
unset($listProfesor[$tmp['cod_user_chamilo']]);
if ($tmp['platform_user_id'] != 0 && $tmp['platform_user_id'] != $platform_user_id) {
foreach ($teacherList as $key => $value) {
if ($value['id'] == $tmp['platform_user_id']) {
unset($teacherList[$key]);
break;
}
}
}
}
}
}
return $listProfesor;
return $teacherList;
}
function participante_accion($cod)
function getInfoParticipantAction($participantId)
{
global $tableSepeParticipants;
$sql = "SELECT * FROM $tableSepeParticipants WHERE cod='".$cod."';";
$sql = "SELECT * FROM $tableSepeParticipants WHERE id='".$participantId."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
@ -293,24 +268,19 @@ function participante_accion($cod)
return $row;
}
function especialidad_participante($cod)
function getParticipantId($id)
{
global $tableSepeParticipantsSpecialty;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE cod='".$cod."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
} else {
$row = false;
}
return $row;
$sql = "SELECT participant_id FROM $tableSepeParticipantsSpecialty WHERE id='".$id."';";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['participant_id'];
}
function tutorias_especialidad_participante($cod)
function getInfoSpecialtyParticipant($specialtyId)
{
global $tableSepeParticipantsSpecialtyTutorials;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE cod='".$cod."';";
global $tableSepeParticipantsSpecialty;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE id='".$specialtyId."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
@ -321,28 +291,12 @@ function tutorias_especialidad_participante($cod)
return $row;
}
function existeDatosIdentificativos()
{
global $tableSepeCenter;
$sql = "SELECT 1 FROM $tableSepeCenter;";
$result = Database::query($sql);
if ( Database::affected_rows($result) > 0 ) {
return true;
} else {
return false;
}
}
/**
* List specialties
* @return array Results (list of specialty details)
*/
function listSpecialty($cod)
function specialtyList($actionId)
{
global $tableSepeSpecialty;
$sql = "SELECT cod, ORIGEN_ESPECIALIDAD, AREA_PROFESIONAL, CODIGO_ESPECIALIDAD
$sql = "SELECT id, specialty_origin, professional_area, specialty_code
FROM $tableSepeSpecialty
WHERE cod_action='".$cod."';";
WHERE action_id='".$actionId."';";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
@ -351,17 +305,13 @@ function listSpecialty($cod)
return $aux;
}
/**
* List participants
* @return array Results (list of participants details)
*/
function listParticipant($cod)
function participantList($actionId)
{
global $tableSepeParticipants;
global $tableUser;
$sql = "SELECT cod, TIPO_DOCUMENTO, NUM_DOCUMENTO, LETRA_NIF, firstname, lastname
FROM $tableSepeParticipants LEFT JOIN $tableUser ON $tableSepeParticipants.cod_user_chamilo=$tableUser.user_id
WHERE cod_action='".$cod."';";
$sql = "SELECT $tableSepeParticipants.id AS id, document_type, document_number, document_letter, firstname, lastname
FROM $tableSepeParticipants LEFT JOIN $tableUser ON $tableSepeParticipants.platform_user_id=$tableUser.user_id
WHERE action_id='".$actionId."';";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
@ -370,16 +320,10 @@ function listParticipant($cod)
return $aux;
}
/**
* List classroom
* @return array Results (list of classroom details)
*/
function listClassroom($cod)
function listParticipantSpecialty($participantId)
{
global $tableSepeSpecialtyClassroom;
global $tableCentros;
$sql = "SELECT a.*,ORIGEN_CENTRO,CODIGO_CENTRO FROM $tableSepeSpecialtyClassroom a LEFT JOIN $tableCentros b
ON a.cod_centro=b.cod WHERE cod_specialty='".$cod."';";
global $tableSepeParticipantsSpecialty;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE participant_id='".$participantId."';";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
@ -388,51 +332,42 @@ function listClassroom($cod)
return $aux;
}
/**
* List tutors
* @return array Results (list of tutors details)
*/
function listTutors($cod)
function classroomList($specialtyId)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
global $tableUser;
$aux = array();
$sql = "SELECT a.*,TIPO_DOCUMENTO,NUM_DOCUMENTO,LETRA_NIF, firstname, lastname FROM $tableSepeSpecialtyTutors a
INNER JOIN $tableSepeTutors b ON a.cod_tutor=b.cod
LEFT JOIN $tableUser c ON b.cod_user_chamilo=c.user_id
WHERE a.cod_specialty='".$cod."';";
global $tableSepeSpecialtyClassroom;
global $tableCenters;
$sql = "SELECT a.*, center_origin, center_code
FROM $tableSepeSpecialtyClassroom a LEFT JOIN $tableCenters b ON a.center_id=b.id
WHERE specialty_id='".$specialtyId."';";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
/**
* List participants specialty
* @return array Results (list of participants specialty details)
*/
function listParticipantSpecialty($cod)
function tutorsList($specialtyId)
{
global $tableSepeParticipantsSpecialty;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE cod_participant='".$cod."';";
$res = Database::query($sql);
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
global $tableUser;
$aux = array();
$sql = "SELECT a.*,document_type,document_number,document_letter, firstname, lastname FROM $tableSepeSpecialtyTutors a
INNER JOIN $tableSepeTutors b ON a.tutor_id=b.id
LEFT JOIN $tableUser c ON b.platform_user_id=c.user_id
WHERE a.specialty_id='".$specialtyId."';";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
/**
* List participants specialty
* @return array Results (list of participants specialty details)
*/
function listSpecialtyTutorial($cod)
function getListSpecialtyTutorial($specialtyId)
{
global $tableSepeParticipantsSpecialtyTutorials;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE cod_participant_specialty='".$cod."';";
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE participant_specialty_id='".$specialtyId."';";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
@ -441,19 +376,14 @@ function listSpecialtyTutorial($cod)
return $aux;
}
/**
* List of courses associated with formative actions
* @return array Results (list of courses id)
*/
function listCourseAction()
{
global $tableSepeActions;
global $tableSepeCourseActions;
//global ;
//$table = Database::get_main_table(TABLE_SEPE_COURSE_ACTIONS);
$sql = "SELECT $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.ORIGEN_ACCION AS ORIGEN_ACCION, $tableSepeActions.CODIGO_ACCION AS CODIGO_ACCION
$sql = "SELECT $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.action_origin AS action_origin, $tableSepeActions.action_code AS action_code
FROM $tableSepeCourseActions, course, $tableSepeActions
WHERE $tableSepeCourseActions.id_course=course.id AND $tableSepeActions.cod=$tableSepeCourseActions.cod_action";
WHERE $tableSepeCourseActions.course_id=course.id
AND $tableSepeActions.id=$tableSepeCourseActions.action_id";
$res = Database::query($sql);
$aux = array();
while ($row = Database::fetch_assoc($res)) {
@ -468,7 +398,7 @@ function listCourseFree()
global $tableSepeCourseActions;
$sql = "SELECT id, title FROM $tableCourse
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions WHERE $tableCourse.id = $tableSepeCourseActions.id_course)
SELECT * FROM $tableSepeCourseActions WHERE $tableCourse.id = $tableSepeCourseActions.course_id)
;";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
@ -477,14 +407,13 @@ function listCourseFree()
return $aux;
}
function listActionFree()
{
global $tableSepeActions;
global $tableSepeCourseActions;
$sql = "SELECT cod, ORIGEN_ACCION,CODIGO_ACCION FROM $tableSepeActions
$sql = "SELECT id, action_origin, action_code FROM $tableSepeActions
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions WHERE $tableSepeActions.cod = $tableSepeCourseActions.cod_action)
SELECT * FROM $tableSepeCourseActions WHERE $tableSepeActions.id = $tableSepeCourseActions.action_id)
;";
$res = Database::query($sql);
$aux = array();
@ -494,94 +423,38 @@ function listActionFree()
return $aux;
}
/**
* function texto_aleatorio (integer $long = 5, boolean $lestras_min = true, boolean $letras_max = true, boolean $num = true))
*
* Permite generar contrasenhas de manera aleatoria.
*
* @$long: Especifica la longitud de la contrasenha
* @$letras_min: Podra usar letas en minusculas
* @$letras_max: Podra usar letas en mayusculas
* @$num: Podra usar numeros
*
* return string
*/
function texto_aleatorio ($long = 6, $letras_min = true, $letras_max = true, $num = true)
function getSpecialtyTutorId($specialtyId, $tutorId)
{
$salt = $letras_min?'abchefghknpqrstuvwxyz':'';
$salt .= $letras_max?'ACDEFHKNPRSTUVWXYZ':'';
$salt .= $num?(strlen($salt)?'2345679':'0123456789'):'';
if (strlen($salt) == 0) {
return '';
}
$i = 0;
$str = '';
srand((double)microtime()*1000000);
while ($i < $long) {
$num = rand(0, strlen($salt)-1);
$str .= substr($salt, $num, 1);
$i++;
}
return $str;
}
function info_tutor_rel_profesor($cod)
{
global $tableSepeTutors;
$sql = "SELECT * FROM $tableSepeTutors WHERE cod_user_chamilo='".$cod."';";
$res = Database::query($sql);
$aux = array();
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
} else {
$row = false;
}
return $row;
}
function info_compentencia_docente($code)
{
$sql = "SELECT * FROM plugin_sepe_competencia_docente WHERE code='".$code."';";
global $tableSepeSpecialtyTutors;
$sql = "SELECT id
FROM $tableSepeSpecialtyTutors
WHERE specialty_id='".$specialtyId."' AND tutor_id='".$tutorId."';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
return $row['valor'];
return $row['id'];
}
function obtener_usuario_chamilo($cod_participant)
function checkInsertNewLog($platformUserId,$actionId)
{
global $tableSepeParticipants;
$sql = "SELECT * FROM $tableSepeParticipants WHERE cod='".$cod_participant."';";
global $tableSepeLogParticipant;
$sql = "SELECT * FROM $tableSepeLogParticipant WHERE platform_user_id='".$platformUserId."' AND action_id='".$actionId."';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
if ($row['cod_user_chamilo']=='0' || $row['cod_user_chamilo']=='') {
if (Database::num_rows($res) > 0) {
return false;
} else {
return $row['cod_user_chamilo'];
return true;
}
}
/*
function obtener_modulos_alumno_accion($user_id, $cod_action)
function getUserPlatformFromParticipant($participantId)
{
global $tableSepeParticipants;
global $tableSepeParticipantsSpecialty;
$sql = "SELECT cod FROM $tableSepeParticipants WHERE cod_action='".$cod_action."' AND cod_user_chamilo='".$user_id."';";
$sql = "SELECT * FROM $tableSepeParticipants WHERE id='".$participantId."';";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
if ($row['cod']=='' || $row['cod']==0) {
return 'No sincronizado con acción formativa';
if ($row['platform_user_id'] == '0' || $row['platform_user_id'] == '') {
return false;
} else {
$sql = "SELECT COUNT(*) AS num FROM $tableSepeParticipantsSpecialty WHERE cod_participant='".$row['cod']."';";
$res = Database::query($sql);
$tmp = Database::fetch_assoc($res);
$resultado = $tmp['num'];
return $resultado;
return $row['platform_user_id'];
}
}
*/

@ -3,30 +3,30 @@
/**
* Plugin class for the SEPE plugin
* @package chamilo.plugin.sepe
* @author Jose Angel Ruiz <jaruiz@nosolored.com>
* @author Jose Angel Ruiz <jaruiz@nosolored.com>
* @author Julio Montoya <gugli100@gmail.com>
*/
class SepePlugin extends Plugin
{
const TABLE_SEPE_CENTER = 'plugin_sepe_center';
const TABLE_SEPE_ACTIONS = 'plugin_sepe_actions';
const TABLE_SEPE_SPECIALTY = 'plugin_sepe_specialty';
const TABLE_SEPE_SPECIALTY_CLASSROOM = 'plugin_sepe_specialty_classroom';
const TABLE_SEPE_CENTROS = 'plugin_sepe_centros';
const TABLE_SEPE_TUTORS = 'plugin_sepe_tutors';
const TABLE_SEPE_SPECIALTY_TUTORS = 'plugin_sepe_specialty_tutors';
const TABLE_SEPE_PARTICIPANTS = 'plugin_sepe_participants';
const TABLE_SEPE_PARTICIPANTS_SPECIALTY = 'plugin_sepe_participants_specialty';
const TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS = 'plugin_sepe_participants_specialty_tutorials';
const TABLE_SEPE_COURSE_ACTIONS = 'plugin_sepe_course_actions';
const TABLE_SEPE_TUTORS_EMPRESA = 'plugin_sepe_tutors_empresa';
const TABLE_SEPE_COMPETENCIA_DOCENTE = 'plugin_sepe_competencia_docente';
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';
const TABLE_SEPE_CENTER = 'plugin_sepe_center';
const TABLE_SEPE_ACTIONS = 'plugin_sepe_actions';
const TABLE_SEPE_SPECIALTY = 'plugin_sepe_specialty';
const TABLE_SEPE_SPECIALTY_CLASSROOM = 'plugin_sepe_specialty_classroom';
const TABLE_SEPE_CENTERS = 'plugin_sepe_centers';
const TABLE_SEPE_TUTORS = 'plugin_sepe_tutors';
const TABLE_SEPE_SPECIALTY_TUTORS = 'plugin_sepe_specialty_tutors';
const TABLE_SEPE_PARTICIPANTS = 'plugin_sepe_participants';
const TABLE_SEPE_PARTICIPANTS_SPECIALTY = 'plugin_sepe_participants_specialty';
const TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS = 'plugin_sepe_participants_specialty_tutorials';
const TABLE_SEPE_COURSE_ACTIONS = 'plugin_sepe_course_actions';
const TABLE_SEPE_TUTORS_COMPANY = 'plugin_sepe_tutors_company';
const TABLE_SEPE_TEACHING_COMPETENCE = 'plugin_sepe_teaching_competence';
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;
/**
public $isAdminPlugin = true;
/**
*
* @return StaticPlugin
*/
@ -39,37 +39,37 @@ class SepePlugin extends Plugin
protected function __construct()
{
parent::__construct(
'1.0',
'
Jose Angel Ruiz - NoSoloRed (original author) <br>
Julio Montoya (SOAP integration)
',
array('sepe_enable' => 'boolean')
);
'2.0',
'
Jose Angel Ruiz - NoSoloRed (original author) <br>
Julio Montoya (SOAP integration)
',
array('sepe_enable' => 'boolean')
);
}
/**
/**
* This method creates the tables required to this plugin
*/
function install()
{
$tablesToBeCompared = array(
self::TABLE_SEPE_CENTER,
self::TABLE_SEPE_ACTIONS,
self::TABLE_SEPE_SPECIALTY,
self::TABLE_SEPE_SPECIALTY_CLASSROOM,
self::TABLE_SEPE_CENTROS,
self::TABLE_SEPE_TUTORS,
self::TABLE_SEPE_SPECIALTY_TUTORS,
self::TABLE_SEPE_PARTICIPANTS,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS,
self::TABLE_SEPE_COURSE_ACTIONS,
self::TABLE_SEPE_TUTORS_EMPRESA,
self::TABLE_SEPE_COMPETENCIA_DOCENTE,
self::TABLE_SEPE_LOG_PARTICIPANT,
self::TABLE_SEPE_LOG_MOD_PARTICIPANT,
self::TABLE_SEPE_LOG
self::TABLE_SEPE_CENTER,
self::TABLE_SEPE_ACTIONS,
self::TABLE_SEPE_SPECIALTY,
self::TABLE_SEPE_SPECIALTY_CLASSROOM,
self::TABLE_SEPE_CENTERS,
self::TABLE_SEPE_TUTORS,
self::TABLE_SEPE_SPECIALTY_TUTORS,
self::TABLE_SEPE_PARTICIPANTS,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS,
self::TABLE_SEPE_COURSE_ACTIONS,
self::TABLE_SEPE_TUTORS_COMPANY,
self::TABLE_SEPE_TEACHING_COMPETENCE,
self::TABLE_SEPE_LOG_PARTICIPANT,
self::TABLE_SEPE_LOG_MOD_PARTICIPANT,
self::TABLE_SEPE_LOG
);
$em = Database::getManager();
$cn = $em->getConnection();
@ -82,29 +82,29 @@ class SepePlugin extends Plugin
require_once api_get_path(SYS_PLUGIN_PATH) . 'sepe/database.php';
}
/**
/**
* This method drops the plugin tables
*/
function uninstall()
{
$tablesToBeDeleted = array(
self::TABLE_SEPE_CENTER,
self::TABLE_SEPE_SPECIALTY_CLASSROOM,
self::TABLE_SEPE_CENTROS,
self::TABLE_SEPE_TUTORS,
self::TABLE_SEPE_SPECIALTY_TUTORS,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY,
self::TABLE_SEPE_COURSE_ACTIONS,
self::TABLE_SEPE_PARTICIPANTS,
self::TABLE_SEPE_TUTORS_EMPRESA,
self::TABLE_SEPE_SPECIALTY,
self::TABLE_SEPE_ACTIONS,
self::TABLE_SEPE_COMPETENCIA_DOCENTE,
self::TABLE_SEPE_LOG_PARTICIPANT,
self::TABLE_SEPE_LOG_MOD_PARTICIPANT,
self::TABLE_SEPE_LOG
self::TABLE_SEPE_SPECIALTY_CLASSROOM,
self::TABLE_SEPE_CENTERS,
self::TABLE_SEPE_TUTORS,
self::TABLE_SEPE_SPECIALTY_TUTORS,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS,
self::TABLE_SEPE_PARTICIPANTS_SPECIALTY,
self::TABLE_SEPE_COURSE_ACTIONS,
self::TABLE_SEPE_PARTICIPANTS,
self::TABLE_SEPE_TUTORS_COMPANY,
self::TABLE_SEPE_SPECIALTY,
self::TABLE_SEPE_ACTIONS,
self::TABLE_SEPE_TEACHING_COMPETENCE,
self::TABLE_SEPE_LOG_PARTICIPANT,
self::TABLE_SEPE_LOG_MOD_PARTICIPANT,
self::TABLE_SEPE_LOG
);
foreach ($tablesToBeDeleted as $tableToBeDeleted) {
@ -115,4 +115,309 @@ class SepePlugin extends Plugin
$this->manageTab(false);
}
function update()
{
$oldTableCenters = 'plugin_sepe_centros';
$oldTableTutorsCompany = 'plugin_sepe_tutors_empresa';
$oldTableCompetence = 'plugin_sepe_competencia_docente';
$sql = "RENAME TABLE "
. $oldTableCenters ." TO ". self::TABLE_SEPE_CENTERS .", "
. $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);
$sql = "ALTER TABLE ".$sepeCourseActionsTable." CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL";
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);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `ORIGEN_ACCION` `action_origin` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `CODIGO_ACCION` `action_code` VARCHAR(30)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `SITUACION` `situation` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `DURACION` `duration` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `FECHA_INICIO` `start_date` DATE NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `FECHA_FIN` `end_date` DATE";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `IND_ITINERARIO_COMPLETO` `full_itinerary_indicator` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `TIPO_FINANCIACION` `financing_type` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `NUMERO_ASISTENTES` `attendees_count` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `DENOMINACION_ACCION` `action_name` VARCHAR(50)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `INFORMACION_GENERAL` `global_info` LONGTEXT";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `HORARIOS` `schedule` LONGTEXT";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeActionsTable." CHANGE `REQUISITOS` `requirements` LONGTEXT";
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);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `FECHA_INICIO` `start_date` DATE";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `FECHA_FIN` `end_date` DATE";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `MODALIDAD_IMPARTICION` `modality_impartition` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HORAS_PRESENCIAL` `classroom_hours` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HORAS_TELEFORMACION` `distance_hours` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HM_NUM_PARTICIPANTES` `mornings_participants_number` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HM_NUMERO_ACCESOS` `mornings_access_number` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HM_DURACION_TOTAL` `morning_total_duration` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HT_NUM_PARTICIPANTES` `afternoon_participants_number` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HT_NUMERO_ACCESOS` `afternoon_access_number` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HT_DURACION_TOTAL` `afternoon_total_duration` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HN_NUM_PARTICIPANTES` `night_participants_number` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HN_NUMERO_ACCESOS` `night_access_number` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `HN_DURACION_TOTAL` `night_total_duration` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `NUM_PARTICIPANTES` `attendees_count` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `NUMERO_ACTIVIDADES_APRENDIZAJE` `learning_activity_count` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTable." CHANGE `NUMERO_INTENTOS` `attempt_count` INT( 10 ) UNSIGNED";
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);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `cod_tutor_empresa` `company_tutor_id` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `cod_tutor_formacion` `training_tutor_id` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `INDICADOR_COMPETENCIAS_CLAVE` `key_competence` VARCHAR( 2 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable." CHANGE `ID_CONTRATO_CFA` `contract_id` VARCHAR( 14 )";
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);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)";
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);
$sql = "ALTER TABLE ".$sepeSpecialtyClassroomTable." CHANGE `cod_specialty` `specialty_id` INT( 10 ) UNSIGNED NOT NULL";
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);
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `cod_specialty` `specialty_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `cod_tutor` `tutor_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `ACREDITACION_TUTOR` `tutor_accreditation` VARCHAR(200)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `EXPERIENCIA_PROFESIONAL` `professional_experience` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `COMPETENCIA_DOCENTE` `teaching_competence` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeSpecialtyTutorsTable." CHANGE `EXPERIENCIA_MODALIDAD_TELEFORMACION` `experience_teleforming` INT( 10 ) UNSIGNED";
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);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `ACREDITACION_TUTOR` `tutor_accreditation` VARCHAR(200)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `EXPERIENCIA_PROFESIONAL` `professional_experience` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `COMPETENCIA_DOCENTE` `teaching_competence` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsTable." CHANGE `EXPERIENCIA_MODALIDAD_TELEFORMACION` `experience_teleforming` INT( 10 ) UNSIGNED";
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);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `cod_participant` `participant_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `ORIGEN_ESPECIALIDAD` `specialty_origin` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `AREA_PROFESIONAL` `professional_area` VARCHAR(4)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `CODIGO_ESPECIALIDAD` `specialty_code` VARCHAR(14)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `FECHA_ALTA` `registration_date` DATE";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `FECHA_BAJA` `leaving_date` DATE";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `FECHA_INICIO` `start_date` DATE";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `FECHA_FIN` `end_date` DATE";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `RESULTADO_FINAL` `final_result` VARCHAR(1)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTable." CHANGE `CALIFICACION_FINAL` `final_qualification` VARCHAR(4)";
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);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." CHANGE `cod_participant_specialty` `participant_specialty_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." CHANGE `ORIGEN_CENTRO` `center_origin` VARCHAR(2)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." CHANGE `CODIGO_CENTRO` `center_code` VARCHAR(16)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantSpecialtyTutorialsTable." CHANGE `FECHA_INICIO` `start_date` DATE";
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'";
Database::query($sql);
$sql = "UPDATE ".$sepeTutorsCompanyTable." SET formacion='1' WHERE formacion='SI'";
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)";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsCompanyTable." CHANGE `TIPO_DOCUMENTO` `document_type` VARCHAR( 1 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsCompanyTable." CHANGE `NUM_DOCUMENTO` `document_number` VARCHAR( 10 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsCompanyTable." CHANGE `LETRA_NIF` `document_letter` VARCHAR( 1 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeTutorsCompanyTable." CHANGE `empresa` `company` VARCHAR(1)";
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);
$sql = "ALTER TABLE ".$sepeLogParticipantTable." CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeLogParticipantTable." CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeLogParticipantTable." CHANGE `fecha_alta` `registration_date` DATE";
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);
$sql = "ALTER TABLE ".$sepeLogModParticipantTable." CHANGE `cod_user_chamilo` `platform_user_id` INT( 10 ) UNSIGNED NOT NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeLogModParticipantTable." CHANGE `cod_action` `action_id` INT( 10 ) UNSIGNED NOT NULL";
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);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `origen_centro` `center_origin` VARCHAR( 255 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `codigo_centro` `center_code` VARCHAR( 255 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `nombre_centro` `center_name` VARCHAR( 255 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `url` `url` VARCHAR( 255 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `url_seguimiento` `tracking_url` VARCHAR( 255 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `telefono` `phone` VARCHAR( 255 )";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeCenterTable." CHANGE `email` `mail` VARCHAR( 255 )";
Database::query($sql);
}
}

@ -0,0 +1,236 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty action edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$specialtyOrigin = trim(Security::remove_XSS(stripslashes($_POST['specialty_origin'])));
$professionalArea = trim(Security::remove_XSS(stripslashes($_POST['professional_area'])));
$specialtyCode = trim(Security::remove_XSS(stripslashes($_POST['specialty_code'])));
$centerOrigin = trim(Security::remove_XSS(stripslashes($_POST['center_origin'])));
$centerCode = trim(Security::remove_XSS(stripslashes($_POST['center_code'])));
$dayStart = trim(Security::remove_XSS(stripslashes($_POST['day_start'])));
$monthStart = trim(Security::remove_XSS(stripslashes($_POST['month_start'])));
$yearStart = trim(Security::remove_XSS(stripslashes($_POST['year_start'])));
$dayEnd = trim(Security::remove_XSS(stripslashes($_POST['day_end'])));
$monthEnd = trim(Security::remove_XSS(stripslashes($_POST['month_end'])));
$yearEnd = trim(Security::remove_XSS(stripslashes($_POST['year_end'])));
$modality_impartition = trim(Security::remove_XSS(stripslashes($_POST['modality_impartition'])));
$classroomHours = trim(Security::remove_XSS(stripslashes($_POST['classroom_hours'])));
$distanceHours = trim(Security::remove_XSS(stripslashes($_POST['distance_hours'])));
$morningsParticipantsNumber = trim(Security::remove_XSS(stripslashes($_POST['mornings_participants_number'])));
$morningsAccessNumber = trim(Security::remove_XSS(stripslashes($_POST['mornings_access_number'])));
$morningTotalDuration = trim(Security::remove_XSS(stripslashes($_POST['morning_total_duration'])));
$afternoonParticipantsNumber = trim(Security::remove_XSS(stripslashes($_POST['afternoon_participants_number'])));
$afternoonAccessNumber = trim(Security::remove_XSS(stripslashes($_POST['afternoon_access_number'])));
$afternoonTotalDuration = trim(Security::remove_XSS(stripslashes($_POST['afternoon_total_duration'])));
$nightParticipantsNumber = trim(Security::remove_XSS(stripslashes($_POST['night_participants_number'])));
$nightAccessNumber = trim(Security::remove_XSS(stripslashes($_POST['night_access_number'])));
$nightTotalDuration = trim(Security::remove_XSS(stripslashes($_POST['night_total_duration'])));
$attendeesCount = trim(Security::remove_XSS(stripslashes($_POST['attendees_count'])));
$learningActivityCount = trim(Security::remove_XSS(stripslashes($_POST['learning_activity_count'])));
$attemptCount = trim(Security::remove_XSS(stripslashes($_POST['attempt_count'])));
$evaluationActivityCount = trim(Security::remove_XSS(stripslashes($_POST['evaluation_activity_count'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$newSpecialty = trim(Security::remove_XSS(stripslashes($_POST['new_specialty'])));
$startDate = $yearStart."-".$monthStart."-".$dayStart;
$endDate = $yearEnd."-".$monthEnd."-".$dayEnd;
if (isset($newSpecialty) && $newSpecialty != "1") {
$sql = "UPDATE plugin_sepe_specialty SET
specialty_origin='".$specialtyOrigin."',
professional_area='".$professionalArea."',
specialty_code='".$specialtyCode."',
center_origin='".$centerOrigin."',
center_code='".$centerCode."',
start_date='".$startDate."',
end_date='".$endDate."',
modality_impartition='".$modalityImpartition."',
classroom_hours='".$classroomHours."',
distance_hours='".$distanceHours."',
mornings_participants_number='".$morningsParticipantsNumber."',
mornings_access_number='".$morningsAccessNumber."',
morning_total_duration='".$morningTotalDuration."',
afternoon_participants_number='".$afternoonParticipantsNumber."',
afternoon_access_number='".$afternoonAccessNumber."',
afternoon_total_duration='".$afternoonTotalDuration."',
night_participants_number='".$nightParticipantsNumber."',
night_access_number='".$nightAccessNumber."',
night_total_duration='".$nightTotalDuration."',
attendees_count='".$attendeesCount."',
learning_activity_count='".$learningActivityCount."',
attempt_count='".$attemptCount."',
evaluation_activity_count='".$evaluationActivityCount."'
WHERE id='".$specialtyId."';";
} else {
$sql = "INSERT INTO plugin_sepe_specialty (
action_id,
specialty_origin,
professional_area,
specialty_code,
center_origin,
center_code,
start_date,
end_date,
modality_impartition,
classroom_hours,
distance_hours,
mornings_participants_number,
mornings_access_number,
morning_total_duration,
afternoon_participants_number,
afternoon_access_number,
afternoon_total_duration,
night_participants_number,
night_access_number,
night_total_duration,
attendees_count,
learning_activity_count,
attempt_count,
evaluation_activity_count
) VALUES (
'".$actionId."',
'".$specialtyOrigin."',
'".$professionalArea."',
'".$specialtyCode."',
'".$centerOrigin."',
'".$centerCode."',
'".$startDate."',
'".$endDate."',
'".$modalityImpartition."',
'".$classroomHours."',
'".$distanceHours."',
'".$morningsParticipantsNumber."',
'".$morningsAccessNumber."',
'".$morningTotalDuration."',
'".$afternoonParticipantsNumber."',
'".$afternoonAccessNumber."',
'".$afternoonTotalDuration."',
'".$nightParticipantsNumber."',
'".$nightAccessNumber."',
'".$nightTotalDuration."',
'".$attendeesCount."',
'".$learningActivityCount."',
'".$attemptCount."',
'".$evaluationActivityCount."'
);";
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newSpecialty == "1") {
$specialtyId = Database::insert_id();
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
}
session_write_close();
header("Location: specialty-action-edit.php?new_specialty=0&specialty_id=".$specialtyId."&action_id=".$actionId);
} else {
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$newSpecialty = trim(Security::remove_XSS(stripslashes($_POST['new_specialty'])));
Security::clear_token();
$token = Security::get_token();
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
session_write_close();
header("Location: specialty-action-edit.php?new_specialty=".$newSpecialty."&specialty_id=".$specialtyId."&action_id=".$actionId);
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$id_course = getCourse($_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'));
if (isset($_GET['new_specialty']) && $_GET['new_specialty'] == "1") {
$templateName = $plugin->get_lang('NewSpecialtyAccion');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$info = array();
$tpl->assign('info', $info);
$tpl->assign('new_action', '1');
$yearStart = $yearEnd = date("Y");
} else {
$templateName = $plugin->get_lang('EditSpecialtyAccion');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$info = getSpecialtActionInfo($_GET['specialty_id']);
$tpl->assign('info', $info);
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'])));
$yearStart = date("Y",strtotime($info['start_date']));
} elseif (strpos($info['start_date'],'0000') === false) {
$yearStart = date("Y",strtotime($info['start_date']));
} else {
$yearStart = date("Y");
}
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'])));
$yearEnd = date("Y",strtotime($info['end_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$yearEnd = date("Y",strtotime($info['end_date']));
} else {
$yearEnd = date("Y");
}
$tpl->assign('new_action', '0');
$tpl->assign('specialty_id', $_GET['specialty_id']);
$listClassroom = classroomList($_GET['specialty_id']);
$tpl->assign('listClassroom', $listClassroom);
$listTutors = tutorsList($_GET['specialty_id']);
$tpl->assign('listTutors', $listTutors);
}
$yearList = array();
if ($yearStart > $yearEnd) {
$tmp = $yearStart;
$yearStart = $yearEnd;
$yearEnd = $tmp;
}
$yearStart -= 5;
$yearEnd += 5;
$fin_rango_anio = (($yearStart + 15) < $yearEnd) ? ($yearEnd+1):($yearStart +15);
while ($yearStart <= $fin_rango_anio) {
$yearList[] = $yearStart;
$yearStart++;
}
$tpl->assign('list_year', $yearList);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/specialty-action-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,135 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty classroom edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$sltCentersExists = trim(Security::remove_XSS(stripslashes($_POST['slt_centers_exists'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$existsCenterId = trim(Security::remove_XSS(stripslashes($_POST['exists_center_id'])));
$centerOrigin = trim(Security::remove_XSS(stripslashes($_POST['center_origin'])));
$centerCode = trim(Security::remove_XSS(stripslashes($_POST['center_code'])));
$newClassroom = trim(Security::remove_XSS(stripslashes($_POST['new_classroom'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$classroomId = trim(Security::remove_XSS(stripslashes($_POST['classroom_id'])));
if ($sltCentersExists == '1') {
$sql = "INSERT INTO $tableSepeSpecialtyClassroom (specialty_id, center_id)
VALUES ('".$specialtyId."','".$existsCenterId."');";
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newClassroom == "1") {
$classroomId = Database::insert_id();
}
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
} else {
//Checker exists centers
$sql = "SELECT * FROM $tableCenters
WHERE center_origin='".$centerOrigin."' AND center_code='".$centerCode."'";
$rs_tmp = Database::query($sql);
if (Database::num_rows($rs_tmp) > 0) {
$aux = Database::fetch_assoc($rs_tmp);
$centerId = $aux['id'];
} else {
$params = array(
'center_origin' => $centerOrigin,
'center_code' => $centerCode,
);
$centerId = Database::insert($tableCenters, $params);
}
if (isset($newClassroom) && $newClassroom != '1') {
$sql = "UPDATE $tableSepeSpecialtyClassroom SET center_id='".$centerId."' WHERE id='".$classroomId."';";
} else {
$sql = "INSERT INTO $tableSepeSpecialtyClassroom (specialty_id, center_id) VALUES ('".$specialtyId."','".$centerId."');";
}
$res = Database::query($sql);
if (!$res) {
echo Database::error();
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newClassroom == '1') {
$classroomId = Database::insert_id();
}
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
}
session_write_close();
header("Location: specialty-action-edit.php?new_specialty=0&specialty_id=".$specialtyId."&action_id=".$actionId);
} else {
$newClassroom = trim(Security::remove_XSS(stripslashes($_POST['new_classroom'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$classroomId = trim(Security::remove_XSS(stripslashes($_POST['classroom_id'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
Security::clear_token();
$_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
$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);
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$courseId = getCourse($_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=".$courseId, "name" => $plugin->get_lang('FormativeAction'));
$interbreadcrumb[] = array("url" => "specialty-action-edit.php?new_specialty=0&specialty_id=".$_GET['specialty_id']."&action_id=".$_GET['action_id'], "name" => $plugin->get_lang('SpecialtyFormativeAction'));
if (isset($_GET['new_classroom']) && $_GET['new_classroom'] == "1") {
$templateName = $plugin->get_lang('NewSpecialtyClassroom');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('specialty_id', $_GET['specialty_id']);
$info = array();
$tpl->assign('info', $info);
$tpl->assign('new_classroom', '1');
} else {
$templateName = $plugin->get_lang('EditSpecialtyClassroom');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('specialty_id', $_GET['specialty_id']);
$tpl->assign('classroom_id', $_GET['classroom_id']);
$info = getInfoSpecialtyClassroom($_GET['classroom_id']);
$tpl->assign('info', $info);
$tpl->assign('new_classroom', '0');
}
$centerList = getCentersList();
$tpl->assign('listExistsCenters', $centerList);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/specialty-classroom-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,224 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty tutors edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if ( !empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$sltUserExists = trim(Security::remove_XSS(stripslashes($_POST['slt_user_exists'])));
$existingTutor = trim(Security::remove_XSS(stripslashes($_POST['existingTutor'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$tutorAccreditation = trim(Security::remove_XSS(stripslashes($_POST['tutor_accreditation'])));
$professionalExperience = trim(Security::remove_XSS(stripslashes($_POST['professional_experience'])));
$teachingCompetence = trim(Security::remove_XSS(stripslashes($_POST['teaching_competence'])));
$experienceTeleforming = trim(Security::remove_XSS(stripslashes($_POST['experience_teleforming'])));
$trainingTeleforming = trim(Security::remove_XSS(stripslashes($_POST['training_teleforming'])));
$specialtyTutorId = trim(Security::remove_XSS(stripslashes($_POST['specialtyTutorId'])));
$documentType = trim(Security::remove_XSS(stripslashes($_POST['document_type'])));
$documentNumber = trim(Security::remove_XSS(stripslashes($_POST['document_number'])));
$documentLetter = trim(Security::remove_XSS(stripslashes($_POST['document_letter'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$newTutor = trim(Security::remove_XSS(stripslashes($_POST['new_tutor'])));
$platformUserId = trim(Security::remove_XSS(stripslashes($_POST['platform_user_id'])));
if ($sltUserExists == "1") {
$sql = "SELECT * FROM plugin_sepe_tutors WHERE cod='".$existingTutor."';";
$rs = Database::query($sql);
$tmp = Database::fetch_assoc($rs);
$sql = "INSERT INTO $tableSepeSpecialtyTutors (
specialty_id,
tutor_id,
tutor_accreditation,
professional_experience,
teaching_competence,
experience_teleforming ,
training_teleforming
) VALUES (
'".$specialtyId."',
'".$existingTutor."',
'".$tmp['tutor_accreditation']."',
'".$tmp['professional_experience']."',
'".$tmp['teaching_competence']."',
'".$tmp['experience_teleforming ']."',
'".$tmp['training_teleforming']."'
);";
$res = Database::query($sql);
} else {
$sql = "SELECT id
FROM $tableSepeTutors
WHERE
document_type='".$documentType."'
AND document_number='".$documentNumber."'
AND document_letter='".$documentLetter."';";
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
$aux = Database::fetch_assoc($rs);
$sql = "UPDATE $tableSepeTutors SET
platform_user_id='".$platformUserId."',
tutor_accreditation='".$tutorAccreditation."',
professional_experience='".$professionalExperience."',
teaching_competence='".$teachingCompetence."',
experience_teleforming='".$experienceTeleforming."',
training_teleforming='".$trainingTeleforming."'
WHERE id='".$aux['id']."';";
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
}
$newTutor = 0; //Reset variable, no create new tutor, exists tutor
$tutor_id = $aux['id'];
$specialtyTutorId = getSpecialtyTutorId($specialtyId, $tutor_id);
} else {
$sql = "UPDATE $tableSepeTutors
SET platform_user_id=''
WHERE platform_user_id='".$platformUserId."'";
Database::query($sql);
$sql = "INSERT INTO $tableSepeTutors (
platform_user_id,
document_type,
document_number,
document_letter,
tutor_accreditation,
professional_experience,
teaching_competence,
experience_teleforming,
training_teleforming
) VALUES (
'".$platformUserId."',
'".$documentType."',
'".$documentNumber."',
'".$documentLetter."',
'".$tutorAccreditation."',
'".$professionalExperience."',
'".$teachingCompetence."',
'".$experienceTeleforming."',
'".$trainingTeleforming."'
);";
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$tutor_id = Database::insert_id();
}
}
if (isset($newTutor) && $newTutor != "1") {
$sql = "UPDATE $tableSepeSpecialtyTutors SET
tutor_id='".$tutor_id."',
tutor_accreditation='".$tutorAccreditation."',
professional_experience='".$professionalExperience."',
teaching_competence='".$teachingCompetence."',
experience_teleforming='".$experienceTeleforming."',
training_teleforming='".$trainingTeleforming."'
WHERE id='".$specialtyTutorId."';";
} else {
$sql = "INSERT INTO $tableSepeSpecialtyTutors (
specialty_id,
tutor_id,
tutor_accreditation,
professional_experience,
teaching_competence,
experience_teleforming,
training_teleforming
) VALUES (
'".$specialtyId."',
'".$tutor_id."',
'".$tutorAccreditation."',
'".$professionalExperience."',
'".$teachingCompetence."',
'".$experienceTeleforming."',
'".$trainingTeleforming."'
);";
}
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newTutor == "1") {
$tutor_id = Database::insert_id();
}
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
}
session_write_close();
header("Location: specialty-action-edit.php?new_specialty=0&specialty_id=".$specialtyId."&action_id=".$actionId);
} else {
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$newTutor = trim(Security::remove_XSS(stripslashes($_POST['new_tutor'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$specialtyTutorId = trim(Security::remove_XSS(stripslashes($_POST['specialtyTutorId'])));
Security::clear_token();
$token = Security::get_token();
$_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);
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$courseId = getCourse($_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=".$courseId, "name" => $plugin->get_lang('FormativeAction'));
$interbreadcrumb[] = array("url" => "specialty-action-edit.php?new_specialty=0&specialty_id=".$_GET['specialty_id']."&action_id=".$_GET['action_id'], "name" => $plugin->get_lang('SpecialtyFormativeAction'));
if (isset($_GET['new_tutor']) && $_GET['new_tutor'] == "1") {
$templateName = $plugin->get_lang('NewSpecialtyTutor');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('specialty_id', $_GET['specialty_id']);
$info = array();
$tpl->assign('info', $info);
$tpl->assign('new_tutor', '1');
$platformUserId = '';
} else {
$templateName = $plugin->get_lang('EditSpecialtyTutor');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('specialty_id', $_GET['specialty_id']);
$tpl->assign('tutor_id', $_GET['tutor_id']);
$info = getInfoSpecialtyTutor($_GET['tutor_id']);
$tpl->assign('info', $info);
$tpl->assign('new_tutor', '0');
$platformUserId = $info['platform_user_id'];
}
$tutorsList = getTutorsSpecialty($_GET['specialty_id']);
$tpl->assign('ExistingTutorsList', $tutorsList);
$listTeachers = CourseManager::getTeachersFromCourse($courseId);
$listTeachers = freeTeacherList($listTeachers,$_GET['specialty_id'],$platformUserId);
$tpl->assign('listTeachers', $listTeachers);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/specialty-tutor-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -0,0 +1,159 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty tutorial edit form.
* @package chamilo.plugin.sepe
*/
use \ChamiloSession as Session;
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if ( !empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$centerOrigin = trim(Security::remove_XSS(stripslashes($_POST['center_origin'])));
$centerCode = trim(Security::remove_XSS(stripslashes($_POST['center_code'])));
$dayStart = trim(Security::remove_XSS(stripslashes($_POST['day_start'])));
$monthStart = trim(Security::remove_XSS(stripslashes($_POST['month_start'])));
$yearStart = trim(Security::remove_XSS(stripslashes($_POST['year_start'])));
$dayEnd = trim(Security::remove_XSS(stripslashes($_POST['day_end'])));
$monthEnd = trim(Security::remove_XSS(stripslashes($_POST['month_end'])));
$yearEnd = trim(Security::remove_XSS(stripslashes($_POST['year_end'])));
$tutorialId = trim(Security::remove_XSS(stripslashes($_POST['tutorial_id'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$newTutorial = trim(Security::remove_XSS(stripslashes($_POST['new_tutorial'])));
$starDate = $yearStart."-".$monthStart."-".$dayStart;
$endDate = $yearEnd."-".$monthEnd."-".$dayEnd;
if (isset($newTutorial) && $newTutorial != "1") {
$sql = "UPDATE $tableSepeParticipantsSpecialtyTutorials SET
center_origin='".$centerOrigin."',
center_code='".$centerCode."',
start_date='".$starDate."',
end_date='".$endDate."'
WHERE id='".$tutorialId."';";
} else {
$sql = "INSERT INTO $tableSepeParticipantsSpecialtyTutorials (
participant_specialty_id,
center_origin,
center_code,
start_date,
end_date
) VALUES (
'".$specialtyId."',
'".$centerOrigin."',
'".$centerCode."',
'".$starDate."',
'".$endDate."'
);";
}
$res = Database::query($sql);
if (!$res) {
error_log(Database::error());
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
}
session_write_close();
$participantId = getParticipantId($specialtyId);
header("Location: participant-specialty-edit.php?new_specialty=0&participant_id=".$participantId."&specialty_id=".$specialtyId."&action_id=".$actionId);
} else {
$tutorialId = trim(Security::remove_XSS(stripslashes($_POST['tutorial_id'])));
$actionId = trim(Security::remove_XSS(stripslashes($_POST['action_id'])));
$specialtyId = trim(Security::remove_XSS(stripslashes($_POST['specialty_id'])));
$newTutorial = trim(Security::remove_XSS(stripslashes($_POST['new_tutorial'])));
Security::clear_token();
$token = Security::get_token();
$_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);
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$courseId = getCourse($_GET['action_id']);
$participantId = getParticipantId($_GET['specialty_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=".$courseId, "name" => $plugin->get_lang('FormativeAction'));
$interbreadcrumb[] = array("url" => "participant-specialty-edit.php?new_specialty=0&participant_id=".$participantId."&specialty_id=".$_GET['specialty_id']."&action_id=".$_GET['action_id'], "name" => $plugin->get_lang('SpecialtyFormativeParcipant'));
if (isset($_GET['new_tutorial']) && $_GET['new_tutorial'] == "1") {
$templateName = $plugin->get_lang('new_tutorial');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('specialty_id', $_GET['specialty_id']);
$info = array();
$tpl->assign('info', $info);
$tpl->assign('new_tutorial', '1');
$startYear = $endYear = date("Y");
} else {
$templateName = $plugin->get_lang('edit_tutorial');
$tpl = new Template($templateName);
$tpl->assign('action_id', $_GET['action_id']);
$tpl->assign('specialty_id', $_GET['specialty_id']);
$tpl->assign('tutorial_id', $_GET['tutorial_id']);
$info = getInfoSpecialtyTutorial($_GET['tutorial_id']);
$tpl->assign('info', $info);
$tpl->assign('new_tutorial', '0');
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'])));
$startYear = date("Y",strtotime($info['start_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$startYear = date("Y",strtotime($info['start_date']));
} else {
$startYear = date("Y");
}
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'])));
$endYear = date("Y",strtotime($info['end_date']));
} elseif (strpos($info['end_date'],'0000') === false) {
$endYear = date("Y",strtotime($info['end_date']));
} else {
$endYear = date("Y");
}
}
$listYears = array();
if ($startYear > $endYear) {
$tmp = $startYear;
$startYear = $endYear;
$endYear = $tmp;
}
$startYear -= 5;
$endYear += 5;
$endRangeYear = (($startYear + 15) < $endYear) ? ($endYear+1):($startYear +15);
while ($startYear <= $endRangeYear) {
$listYears[] = $startYear;
$startYear++;
}
$tpl->assign('list_year', $listYears);
if (isset($_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']);
unset($_SESSION['sepe_message_error']);
}
$tpl->assign('sec_token',$token);
$listing_tpl = 'sepe/view/specialty-tutorial-edit.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} else {
header('Location:' . api_get_path(WEB_PATH));
}

@ -9,5 +9,5 @@
/**
* Queries
*/
require_once dirname(__FILE__) . '/config.php';
require_once __DIR__ . '/config.php';
SepePlugin::create()->uninstall();

@ -0,0 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Config the plugin
* @package chamilo.plugin.sepe
*/
require_once __DIR__ . '/config.php';
if (!api_is_platform_admin()) {
die ('You must have admin permissions to install plugins');
}
SepePlugin::create()->update();

@ -0,0 +1,33 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="configuration.php" method="post" name="configuration_form">
<div class="col-md-2">&nbsp;</div>
<div class="col-md-8">
{% if message_info != "" %}
<div class="confirmation-message">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="error-message">
{{ message_error }}
</div>
{% endif %}
<fieldset>
<legend>{{ 'SepeUser' | get_plugin_lang('SepePlugin') }}</legend>
<div class="form-group">
<label class="col-md-2 control-label">{{ 'ApiKey' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-md-7">
<input class="form-control" type="text" id="input_key" name="api_key" value="{{ info }}" />
</div>
<div class="col-md-3">
<input type="button" id="key-sepe-generator" class="btn btn-info" value="{{ 'GenerateApiKey' | get_plugin_lang('SepePlugin') }}" />
</div>
</div>
</fieldset>
</div>
<div class="col-md-2">&nbsp;</div>
</form>
</div>

@ -0,0 +1,300 @@
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="formative-action-edit.php" method="post" name="data-center-form">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
{% if new_action == "1" %}
<input type="hidden" name="action_id" value="0" />
<input type="hidden" name="course_id" value="{{ course_id }}" />
{% else %}
<input type="hidden" name="action_id" value="{{ info.id }}" />
{% endif %}
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border">
<fieldset>
<legend>{{ 'FormativeAction' | get_plugin_lang('SepePlugin') }}</legend>
<div class="well">
<legend><h4>{{ 'ActionIdentifier' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'ActionOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-2">
<input class="form-control" type="text" name="action_origin" value="{{ info.action_origin }}" />
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'ActionCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-2">
<input class="form-control" type="text" name="action_code" value="{{ info.action_code }}" />
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'Situation' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<select name="situation" class="form-control">
<option value=""></option>
{% if info.situation == "10" %}
<option value="10" selected="selected">{{ 'Situation10' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="10">{{ 'Situation10' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.situation == "20" %}
<option value="20" selected="selected">{{ 'Situation20' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="20">{{ 'Situation20' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.situation == "30" %}
<option value="30" selected="selected">{{ 'Situation30' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="30">{{ 'Situation30' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.situation == "40" %}
<option value="40" selected="selected">{{ 'Situation40' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="40">{{ 'Situation40' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.situation == "50" %}
<option value="50" selected="selected">{{ 'Situation50' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="50">{{ 'Situation50' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
</select>
</div>
</div>
<div class="well">
<legend><h4>{{ 'MainSpecialtyIdentifier' | get_plugin_lang('SepePlugin') | upper }}</h4></legend>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'SpecialtyOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<input class="form-control" type="text" name="specialty_origin" value="{{ info.specialty_origin }}" />
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'ProfessionalArea' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<input class="form-control" type="text" name="professional_area" value="{{ info.professional_area }}" />
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'SpecialtyCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<input class="form-control" type="text" name="specialty_code" value="{{ info.specialty_code }}"/>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'Duration' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-2">
<input class="form-control" type="number" name="duration" value="{{ info.duration }}" />
</div>
<div class="col-md-7 alert alert-info sepe-message-info">
{{ 'NumHoursFormativeAction' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'StartDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-4">
<select name="day_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_start == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="col-md-5 alert alert-info sepe-message-info">
{{ 'StartDateMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'EndDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-4">
<select name="day_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_end == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info col-md-5 sepe-message-info">
{{ 'EndDateMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'FullItineraryIndicator' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-2">
<select class="form-control" name="full_itinerary_indicator">
<option value=""></option>
{% if info.full_itinerary_indicator == "SI" %}
<option value="SI" selected="selected">SI</option>
{% else %}
<option value="SI">SI</option>
{% endif %}
{% if info.full_itinerary_indicator == "NO" %}
<option value="NO" selected="selected">NO</option>
{% else %}
<option value="NO">NO</option>
{% endif %}
</select>
</div>
<div class="alert alert-info col-md-7 sepe-message-info">
{{ 'FullItineraryIndicatorMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'FinancingType' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-2">
<select name="financing_type" class="form-control">
<option value=""></option>
{% if info.financing_type == "PU" %}
<option value="PU" selected="selected">{{ 'Public' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="PU">{{ 'Public' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.financing_type == "PR" %}
<option value="PR" selected="selected">{{ 'Private' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="PR">{{ 'Private' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
</select>
</div>
<div class="alert alert-info col-md-7 sepe-message-info">
{{ 'FinancingTypeMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'AttendeesCount' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-2">
<input class="form-control" type="number" name="attendees_count" value="{{ info.attendees_count }}" />
</div>
<div class="alert alert-info col-md-7 sepe-message-info">
{{ 'AttendeesCountMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="well">
<legend><h4>{{ 'DescriptionAction' | get_plugin_lang('SepePlugin') | upper }}</h4></legend>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'NameAction' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<input class="form-control" type="text" name="action_name" value="{{ info.action_name }}" />
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'NameActionMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'GlobalInfo' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<textarea class="form-control" name="global_info">{{ info.global_info }}</textarea>
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'GlobalInfoMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'Schedule' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<textarea class="form-control" name="schedule">{{ info.schedule }}</textarea>
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'ScheduleMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'Requirements' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<textarea class="form-control" name="requirements">{{ info.requirements }}</textarea>
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'RequirementsMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'ContactAction' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-md-9">
<textarea class="form-control" name="contact_action">{{ info.contact_action }}</textarea>
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'ContactActionMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
</form>
</div>

@ -0,0 +1,269 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Options' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li class="sepe-edit-link">
<a href="formative-action-edit.php?action_id={{ action_id }}">{{ 'ActionEdit' | get_plugin_lang('SepePlugin') }}</a>
</li>
<li class="sepe-delete-link">
<input type="hidden" id="action_id" value="{{ action_id }}" />
<input type="hidden" id="confirmDeleteAction" value="{{ 'confirmDeleteAction' | get_plugin_lang('SepePlugin') }}" />
<a href="formative-action-delete.php" id="delete-action">{{ 'DeleteAction' | get_plugin_lang('SepePlugin') }}</a>
</li>
<li class="sepe-list-link">
<a href="formative-actions-list.php">{{ 'ActionsList' | get_plugin_lang('SepePlugin') }}</a>
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border">
<form class="form-horizontal">
<fieldset>
<legend>{{ 'FormativeAction' | get_plugin_lang('SepePlugin') }}:</legend>
{% if info != false %}
<div class="well">
<legend><h4>{{ 'ActionIdentifier' | get_plugin_lang('SepePlugin') }}: </h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ActionOrigin' | get_plugin_lang('SepePlugin') }}:</label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.action_origin|e }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ActionCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.action_code|e }}</label>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Situation' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">
{% if info.situation == "10" %}
10-Solicitada Autorización
{% endif %}
{% if info.situation == "20" %}
20-Programada/Autorizada
{% endif %}
{% if info.situation == "30" %}
30-Iniciada
{% endif %}
{% if info.situation == "40" %}
40-Finalizada
{% endif %}
{% if info.situation == "50" %}
50-Cancelada
{% endif %}
</label>
</div>
</div>
<div class="well sepe-subfield">
<legend><h4>{{ 'MainSpecialtyIdentifier' | get_plugin_lang('SepePlugin') }}</h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'SpecialtyOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.specialty_origin|e }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ProfessionalArea' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.professional_area|e }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'SpecialtyCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.specialty_code|e }}</label>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Duration' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">
{% if info.duration > 0 %}
{{ info.duration }}
{% else %}
<i>{{ 'Unspecified' | get_plugin_lang('SepePlugin') }}</i>
{% endif %}
</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'StartDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">
{% if info.start_date == "0000-00-00" %}
<i>{{ 'Unspecified' | get_plugin_lang('SepePlugin') }}</i>
{% else %}
{{ start_date }}
{% endif %}
</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'EndDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">
{% if info.end_date == "0000-00-00" %}
<i>{{ 'Unspecified' | get_plugin_lang('SepePlugin') }}</i>
{% else %}
{{ end_date }}
{% endif %}
</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'FullItineraryIndicator' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.full_itinerary_indicator }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'FinancingType' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">
{% if info.financing_type == "PU" %}
Pública
{% endif %}
{% if info.financing_type == "PR" %}
Privada
{% endif %}
{% if info.financing_type == "" %}
<i>{{ 'Unspecified' | get_plugin_lang('SepePlugin') }}</i>
{% endif %}
</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'AttendeesCount' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.attendees_count }}</label>
</div>
</div>
<div class="well">
<legend><h4>{{ 'DescriptionAction' | get_plugin_lang('SepePlugin') }}</h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'NameAction' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.action_name|e }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'GlobalInfo' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.global_info|e }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Schedule' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.schedule|e }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Requirements' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.requirements|e }}</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ContactAction' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ info.contact_action|e }}</label>
</div>
</div>
</div>
{% else %}
<div class="error-message">{{ 'NoFormativeAction' | get_plugin_lang('SepePlugin') }}</div>
{% endif %}
</fieldset>
</form>
</div>
<div class="well_border">
<form class="form-horizontal">
<fieldset>
<legend>{{ 'Specialtys' | get_plugin_lang('SepePlugin') }}:
<a href="specialty-action-edit.php?new_specialty=1&action_id={{ action_id }}" class="btn btn-info pull-right">{{ 'CreateSpecialty' | get_plugin_lang('SepePlugin') }}</a>
</legend>
<input type="hidden" id="confirmDeleteSpecialty" value="{{ 'confirmDeleteSpecialty' | get_plugin_lang('SepePlugin') }}" />
{% for specialty in listSpecialty %}
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Specialty' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<table width="100%" class="sepe-input-text">
<tr>
<td>{{ specialty.specialty_origin }} {{ specialty.professional_area }} {{ specialty.specialty_code }}</td>
<td>
<a href="#" class="btn btn-danger btn-sm pull-right sepe-margin-side delete-specialty" id="specialty{{ specialty.id }}">{{ 'Delete' | get_plugin_lang('SepePlugin') }}</a>
<a href="specialty-action-edit.php?new_specialty=0&specialty_id={{ specialty.id }}&action_id={{ action_id }}" class="btn btn-warning btn-sm pull-right sepe-margin-side">{{ 'Edit' | get_plugin_lang('SepePlugin') }}</a>
</td>
</tr>
</table>
</div>
</div>
{% endfor %}
</fieldset>
</form>
</div>
<div class="well_border">
<form class="form-horizontal">
<fieldset>
<legend>{{ 'Participants' | get_plugin_lang('SepePlugin') }}:
<a href="participant-action-edit.php?new_participant=1&action_id={{ action_id }}" class="btn btn-info pull-right">{{ 'CreateParticipant' | get_plugin_lang('SepePlugin') }}</a>
</legend>
<input type="hidden" id="confirmDeleteParticipant" value="{{ 'confirmDeleteParticipant' | get_plugin_lang('SepePlugin') }}" />
{% for participant in listParticipant %}
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Participant' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<table width="100%" class="sepe-input-text">
<tr>
<td>{{ participant.firstname }} {{ participant.lastname }} </td>
<td>{{ participant.document_number }} {{ participant.documente_letter }} </td>
<td>
<a href="#" class="btn btn-danger btn-sm pull-right sepe-margin-side delete-participant" id="participant{{ participant.id }}">{{ 'Delete' | get_plugin_lang('SepePlugin') }}</a>
<a href="participant-action-edit.php?new_participant=0&participant_id={{ participant.id }}&action_id={{ action_id }}" class="btn btn-warning btn-sm pull-right sepe-margin-side">{{ 'Edit' | get_plugin_lang('SepePlugin') }}</a>
</td>
</tr>
</table>
</div>
</div>
{% endfor %}
</fieldset>
</form>
</div>
</div>
</div>

@ -0,0 +1,71 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<div class="col-md-12">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="page-header">
<h2>{{ 'FormativesActionsList' | get_plugin_lang('SepePlugin') }}</h2>
</div>
<div class="report_section">
{% if course_action_list|length > 0 %}
<input type="hidden" id="confirmDeleteUnlinkAction" value="{{ 'confirmDeleteAction' | get_plugin_lang('SepePlugin') }}" />
<table class="table table-bordered sepe-box-center" style="width:auto">
{% for course in course_action_list %}
<tr>
<td class="sepe-vertical-align-middle">{{ 'Course' | get_lang }}: <strong>{{ course.title }}</strong> -> {{ 'ActionId' | get_plugin_lang('SepePlugin') | upper }}: <strong>{{ course.action_origin }} {{ course.action_code }}</strong></td>
<td class="text-center">
<a href="#" class="btn btn-danger btn-sm sepe-margin-side delete-action" id="delete-action-id{{ course.action_id }}">{{ 'Delete' | get_plugin_lang('SepePlugin') }}</a>
<a href="#" class="btn btn-warning btn-sm sepe-margin-side unlink-action" id="unlink-action-id{{ course.id }}">{{ 'Unlink' | get_plugin_lang('SepePlugin') }}</a>
<a href="formative-action.php?cid={{ course.course_id }}" class="btn btn-info btn-sm sepe-margin-side">{{ 'SeeOrEdit' | get_plugin_lang('SepePlugin') }}</a>
</td>
</tr>
{% endfor %}
</table>
{% else %}
<div class="alert alert-warning">
{{ 'NoFormativeActionToCourse' | get_plugin_lang('SepePlugin') }}
</div>
{% endif %}
</div>
<hr />
<div class="page-header">
<h2>{{ 'CourseFreeOfFormativeAction' | get_plugin_lang('SepePlugin') }}</h2>
</div>
<div class="report_section">
<input type="hidden" id="alertAssignAction" value="{{ 'alertAssignAction'| get_plugin_lang('SepePlugin') }}" />
<table class="table table-striped">
{% for course in course_free_list %}
<tr>
<td class="sepe-vertical-align-middle">{{ 'Course' | get_lang }}: <strong>{{ course.title }}</strong></td>
<td class="text-center sepe-vertical-align-middle">
<select class="chzn-select" id="action_formative{{ course.id }}" style="width:250px">
<option value="">{{ 'SelectAction' | get_plugin_lang('SepePlugin') }}</option>
{% for action in action_free_list %}
<option value="{{ action.id }}">
{{ action.action_origin }} {{ action.action_code }}
</option>
{% endfor %}
</select>
</td>
<td class="text-center sepe-vertical-align-middle" style="min-width:240px">
<a href="#" class="btn btn-info btn-sm sepe-margin-side assign_action" id="course_id{{ course.id }}">{{ 'AssignAction' | get_plugin_lang('SepePlugin') }}</a>
<a href="formative-action-edit.php?new_action=1&cid={{ course.id }}" class="btn btn-success btn-sm sepe-margin-side">{{ 'CreateAction' | get_plugin_lang('SepePlugin') }}</a>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>

@ -0,0 +1,86 @@
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="identification-data-edit.php" method="post" name="form_data_center">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Options' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
<input type="hidden" name="id" value="{{ info.id }}" />
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border span8">
<fieldset>
<legend>{{ 'DataCenter' | get_plugin_lang('SepePlugin') }}</legend>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'CenterOrigin' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="center_origin" value="{{ info.center_origin }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'CenterCode' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="center_code" value="{{ info.center_code }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'NameCenter' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="center_name" value="{{ info.center_name }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'PlatformUrl' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="url" value="{{ info.url }}" style="width:100%"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'TrackingUrl' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="tracking_url" value="{{ info.tracking_url }}" style="width:100%" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'Phone' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-3">
<input type="text" class="form-control" name="phone" value="{{ info.phone }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'Mail' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-3">
<input type="text" class="form-control" name="mail" value="{{ info.mail }}" />
</div>
</div>
</fieldset>
</div>
</div>
</form>
</div>

@ -0,0 +1,96 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Options' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li class="sepe-edit-link">
<a href="identification-data-edit.php">
{% if info == false %}
{{ 'NewCenter' | get_plugin_lang('SepePlugin') }}
{% else %}
{{ 'EditCenter' | get_plugin_lang('SepePlugin') }}
{% endif %}
</a>
</li>
<li class="sepe-delete-link">
<input type="hidden" id="confirmDeleteCenterData" value="{{ 'confirmDeleteCenterData'|get_plugin_lang('SepePlugin') }}" />
<a href="identification-data-delete.php" id="delete-center-data">{{ 'DeleteCenter' | get_plugin_lang('SepePlugin') }}</a>
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border">
<form class="form-horizontal">
<fieldset>
<legend>{{ 'DataCenter' | get_plugin_lang('SepePlugin') }}</legend>
{% if info != false %}
<div class="form-group ">
<label class="col-sm-3 control-label">{{ 'CenterOrigin' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<label class="sepe-input-text text-primary">{{ info.center_origin }}</label>
</div>
</div>
<div class="form-group ">
<label class="col-sm-3 control-label">{{ 'CenterCode' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<label class="sepe-input-text text-primary">{{ info.center_code }}</label>
</div>
</div>
<div class="form-group ">
<label class="col-sm-3 control-label">{{ 'NameCenter' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<label class="sepe-input-text text-primary">{{ info.center_name }}</label>
</div>
</div>
<div class="form-group ">
<label class="col-sm-3 control-label">{{ 'PlatformUrl' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<label class="sepe-input-text text-primary">{{ info.url }}</label>
</div>
</div>
<div class="form-group ">
<label class="col-sm-3 control-label">{{ 'TrackingUrl' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<label class="sepe-input-text text-primary">{{ info.tracking_url }}</label>
</div>
</div>
<div class="form-group ">
<label class="col-sm-3 control-label">{{ 'Phone' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<label class="sepe-input-text text-primary">{{ info.phone }}</label>
</div>
</div>
<div class="form-group ">
<label class="col-sm-3 control-label">{{ 'Mail' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<label class="sepe-input-text text-primary">{{ info.mail }}</label>
</div>
</div>
{% else %}
<div class="alert alert-danger">{{ 'NoIdentificationData' | get_plugin_lang('SepePlugin') }}</div>
{% endif %}
</fieldset>
</form>
</div>
</div>
</div>

@ -0,0 +1,318 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<script type='text/javascript'>
$(document).ready(function () {
$("select[name='company_tutor_id']").change(function(){
if ($(this).val() == "new_company_tutor") {
$("#new-company-tutor-layer").show();
} else {
$("#new-company-tutor-layer").hide();
}
});
$("select[name='training_tutor_id']").change(function(){
if ($(this).val() == "new_training_tutor") {
$("#new-training-tutor-layer").show();
} else {
$("#new-training-tutor-layer").hide();
}
});
});
</script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="participant-action-edit.php" method="post" name="form_participant_action">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
{% if new_participant == "1" %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="new_participant" value="1" />
{% else %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="participant_id" value="{{ participant_id }}" />
<input type="hidden" name="new_participant" value="0" />
{% endif %}
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border">
<fieldset>
<legend>{{ 'FormativeActionParticipant' | get_plugin_lang('SepePlugin') }}</legend>
<div class="well sepe-subfield">
<legend><h4>{{ 'UserPlatformList' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Student' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input type="hidden" id="alertSelectUser" value="{{ 'alertSelectUser'|get_plugin_lang('SepePlugin') }}" />
<select name="platform_user_id" id="platform_user_id" class="form-control">
{% if info_user_platform is empty %}
<option value="" selected="selected"></option>
{% else %}
<option value=""></option>
<option value="{{ info_user_platform.user_id }}" selected="selected">{{ info_user_platform.firstname }} {{ info_user_platform.lastname }}</option>
{% endif %}
{% for student in listStudent %}
<option value="{{ student.user_id }}">{{ student.firstname }} {{ student.lastname }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="well sepe-subfield">
<legend><h4>{{ 'ParticipantIdentifier' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentType' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="document_type" class="form-control">
<option value=""></option>
{% if info.document_type == "D" %}
<option value="D" selected="selected">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="D">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "E" %}
<option value="E" selected="selected">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="E">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "U" %}
<option value="U" selected="selected">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="U">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "G" %}
<option value="G" selected="selected">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="G">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "W" %}
<option value="W" selected="selected">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="W">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "H" %}
<option value="H" selected="selected">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="H">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-3">
<input class="form-control" type="text" name="document_number" value="{{ info.document_number }}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentLetter' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="document_letter" value="{{ info.document_letter }}" />
</div>
</div>
<div class="alert alert-warning">
{{ 'DocumentFormatMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CompetenceKey' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="key_competence" value="{{ info.key_competence }}" />
</div>
</div>
<div class="well sepe-subfield">
<legend class="sepe-subfield">{{ 'TrainingAgreement' | get_plugin_lang('SepePlugin') | upper }}: </legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ContractId' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="contract_id" value="{{ info.contract_id }}" />
{{ 'ContractIdMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CompanyFiscalNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="company_fiscal_number" value="{{ info.company_fiscal_number }}" />
</div>
</div>
<div class="well">
<legend class="sepe-subfield2">{{ 'TutorIdCompany' | get_plugin_lang('SepePlugin') | upper }}: </legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CompanyTutorsList' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<select name="company_tutor_id" class="form-control">
<option value="new_company_tutor">{{ 'CreateNewTutorCompany' | get_plugin_lang('SepePlugin') }}</option>
{% for tutor in list_tutor_company %}
{% if tutor.id == info.company_tutor_id or ( info|length == 0 and tutor.id == "1" ) %}
<option value="{{ tutor.id }}" selected="selected">{{ tutor.alias }}</option>
{% else %}
<option value="{{ tutor.id }}">{{ tutor.alias }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div id="new-company-tutor-layer" style="display:none">
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Name' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<input class="form-control" type="text" name="tutor_company_alias" value="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentType' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="tutor_company_document_type" class="form-control">
<option value="" selected="selected"></option>
<option value="D">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
<option value="E">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
<option value="U">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
<option value="G">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
<option value="W">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
<option value="H">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-3">
<input class="form-control" type="text" name="tutor_company_document_number" value="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentLetter' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="tutor_company_document_letter" value="" />
</div>
</div>
<div class="alert alert-warning mensaje_info">
{{ 'DocumentFormatMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="well">
<legend class="sepe-subfield2">{{ 'TutorIdTraining' | get_plugin_lang('SepePlugin') | upper }}: </legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'TrainingTutorsList' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<select name="training_tutor_id" class="form-control">
<option value="new_training_tutor">{{ 'CreateNewTutorTraining' | get_plugin_lang('SepePlugin') }}</option>
{% for tutor in list_tutor_training %}
{% if tutor.id == info.training_tutor_id or ( info|length == 0 and tutor.id == "1" ) %}
<option value="{{ tutor.id }}" selected="selected">{{ tutor.alias }}</option>
{% else %}
<option value="{{ tutor.id }}">{{ tutor.alias }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div id="new-training-tutor-layer" style="display:none">
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Name' | get_plugin_lang('SepePlugin') }}</label>
<div class="col-sm-9">
<input class="form-control" type="text" name="tutor_training_alias" value="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentType' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="tutor_training_document_type" class="form-control">
<option value="" selected="selected"></option>
<option value="D">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
<option value="E">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
<option value="U">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
<option value="G">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
<option value="W">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
<option value="H">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-3">
<input class="form-control" type="text" name="tutor_training_document_number" value="" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentLetter' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="tutor_training_document_letter" value="" />
</div>
</div>
<div class="alert alert-warning">
{{ 'DocumentFormatMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
</div>
<div class="well sepe-subfield">
{% if new_participant == "1" %}
<legend>{{ 'SpecialtiesParcipant' | get_plugin_lang('SepePlugin') | upper }}: </legend>
<div class="alert alert-warning">{{ 'SpecialtiesParcipantMessage' | get_plugin_lang('SepePlugin') }}</div>
{% else %}
<legend>{{ 'SpecialtiesParcipant' | get_plugin_lang('SepePlugin') | upper }}:
<a href="participant-specialty-edit.php?new_specialty=1&participant_id={{ info.id }}&action_id={{ action_id }}" class="btn btn-sm btn-info pull-right">{{ 'CreateSpecialty' | get_plugin_lang('SepePlugin') }}</a>
</legend>
<input type="hidden" id="confirmDeleteParticipantSpecialty" value="{{ 'confirmDeleteParticipantSpecialty'|get_plugin_lang('SepePlugin') }}" />
{% for specialty in listParticipantSpecialty %}
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Specialty' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="sepe-input-text">{{ specialty.specialty_origin }} {{ specialty.professional_area }} {{ specialty.specialty_code }}
<a href="#" class="btn btn-danger btn-sm pull-right sepe-margin-side delete-specialty-participant" id="specialty{{ specialty.id }}">{{ 'Delete' | get_plugin_lang('SepePlugin') }}</a>
<a href="participant-specialty-edit.php?new_specialty=0&participant_id={{ info.id }}&specialty_id={{ specialty.id }}&action_id={{ action_id }}" class="btn btn-warning btn-sm pull-right sepe-margin-side">{{ 'Edit' | get_plugin_lang('SepePlugin') }}</a>
</label>
</div>
</div>
{% endfor %}
{% endif %}
</div>
</fieldset>
</div>
</div>
</form>
</div>

@ -0,0 +1,322 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="participant-specialty-edit.php" method="post" name="form_specialty_action">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
{% if new_specialty == "1" %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="participant_id" value="{{ participant_id }}" />
<input type="hidden" name="new_specialty" value="1" />
{% else %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="participant_id" value="{{ participant_id }}" />
<input type="hidden" name="new_specialty" value="0" />
{% endif %}
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border">
<fieldset>
<legend>{{ 'SpecialtiesParcipant' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="well sepe-subfield">
<legend><h4>{{ 'SpecialtyIdentifier' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'SpecialtyOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="specialty_origin" value="{{ info.specialty_origin }}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ProfessionalArea' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="professional_area" value="{{ info.professional_area }}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'SpecialtyCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="specialty_code" value="{{ info.specialty_code }}" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3">{{ 'RegistrationDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_registration" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_registration == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_registration" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_registration == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_registration" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_registration == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info col-lg-5 sepe-message-info">
{{ 'RegistrationDateMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3">{{ 'LeavingDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_leaving" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_leaving == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_leaving" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_leaving == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_leaving" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_leaving == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info col-lg-5">
{{ 'LeavingDateMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="well sepe-subfield">
{% if new_specialty == "1" %}
<legend>{{ 'ClassroomTutorials' | get_plugin_lang('SepePlugin') | upper }}: </legend>
<div class="alert alert-warning">
{{ 'ClassroomTutorialsMessage' | get_plugin_lang('SepePlugin') }}
</div>
{% else %}
<legend>{{ 'ClassroomTutorials' | get_plugin_lang('SepePlugin') | upper }}:
<a href="specialty-tutorial-edit.php?new_tutorial=1&specialty_id={{ info.id }}&action_id={{ action_id }}" class="btn btn-sm btn-info pull-right">{{ 'CreateClassroomTutorial' | get_plugin_lang('SepePlugin') }}</a>
</legend>
{% for tutorial in listSpecialtyTutorials %}
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ClassroomTutorial' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="campo_texto">{{ tutorial.center_origin }} {{ tutorial.center_code }}
<a href="#" class="btn btn-danger btn-sm pull-right sepe-margin-side del_classroom" id="tutorial{{ tutorial.id }}">{{ 'Delete' | get_plugin_lang('SepePlugin') }}</a>
<a href="specialty-tutorial-edit.php?new_tutorial=0&specialty_id={{ info.id }}&tutorial_id={{ tutorial.id }}&action_id={{ action_id }}" class="btn btn-warning btn-sm pull-right sepe-margin-side">{{ 'Edit' | get_plugin_lang('SepePlugin') }}</a>
</label>
</div>
</div>
{% endfor %}
{% endif %}
</div>
<div class="well sepe-subfield">
<legend><h4>{{ 'FinalEvaluation' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="well">
<legend class="sepe-subfield2">{{ 'FinalEvaluationClassroom' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CenterOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="center_origin" value="{{ info.center_origin }}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CenterCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="center_code" value="{{ info.center_code }}" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3">{{ 'StartDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year_2 %}
{% if year_start == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info col-lg-5 sepe-message-info">
{{ 'StartDateMessageEvaluation' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3">{{ 'EndDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year_2 %}
{% if year_end == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info col-lg-5 sepe-message-info">
{{ 'EndDateMessageEvaluation' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="well sepe-subfield">
<legend><h4>{{ 'Results' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'FinalResult' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="final_result" class="form-control">
<option value=""></option>
{% if info.final_result == "0" %}
<option value="0" selected="selected">{{ 'Initiated' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="0">{{ 'Initiated' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.final_result == "1" %}
<option value="1" selected="selected">{{ 'LeavePlacement' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="1">{{ 'LeavePlacement' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.final_result == "2" %}
<option value="2" selected="selected">{{ 'AbandonOtherReasons' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="2">{{ 'AbandonOtherReasons' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.final_result == "3" %}
<option value="3" selected="selected">{{ 'EndsPositiveEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="3">{{ 'EndsPositiveEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.final_result == "4" %}
<option value="4" selected="selected">{{ 'EndsNegativeEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="4">{{ 'EndsNegativeEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.final_result == "5" %}
<option value="5" selected="selected">{{ 'EndsNoEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="5">{{ 'EndsNoEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.final_result == "6" %}
<option value="6" selected="selected">{{ 'FreeEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="6">{{ 'FreeEvaluation' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.final_result == "7" %}
<option value="7" selected="selected">{{ 'Exempt' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="7">{{ 'Exempt' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
</select>
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'FinalResultMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'FinalQualification' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="final_qualification" value="{{ info.final_qualification }}" />
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'FinalQualificationMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'FinalScore' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" class="form-control" type="text" name="final_score" value="{{ info.final_score }}" />
<div class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'FinalScoreMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
</form>
</div>

@ -0,0 +1,5 @@
<div class="row">
<div class="col-md-12">
{{ html_text }}
</div>
</div>

@ -0,0 +1,365 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="specialty-action-edit.php" method="post" name="form_specialty_action">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
{% if new_action == "1" %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="new_specialty" value="1" />
{% else %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="new_specialty" value="0" />
{% endif %}
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border">
<fieldset>
<legend>{{ 'SpecialtyFormativeAction' | get_plugin_lang('SepePlugin') }}</legend>
<div class="well">
<legend><h4>{{ 'SpecialtyIdentifier' | get_plugin_lang('SepePlugin') | upper}}: </h4></legend>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'SpecialtyOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="specialty_origin" value="{{ info.specialty_origin }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ProfessionalArea' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="professional_area" value="{{ info.professional_area }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'SpecialtyCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-3">
<input class="form-control" type="text" name="specialty_code" value="{{ info.specialty_code }}" />
</div>
</div>
</div>
<div class="well">
<legend><h4>{{ 'DeliveryCenter' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'CenterOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="center_origin" value="{{ info.center_origin }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'CenterCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-3">
<input class="form-control" type="text" name="center_code" value="{{ info.center_code }}" />
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">{{ 'StartDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_start == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info sepe-message-info col-lg-5">
{{ 'SpecialtyStartDateMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">{{ 'EndDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_end" class="form-control sepe-slt-date">
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_end == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="col-lg-5 sepe-message-info alert alert-info">
{{ 'SpecialtyEndDateMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ModalityImpartition' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="modality_impartition" class="chzn-select">
<option value=""></option>
{% if info.modality_impartition == "TF" %}
<option value="TF" selected="selected">Teleformación</option>
{% else %}
<option value="TF">Teleformación</option>
{% endif %}
{% if info.modality_impartition == "PR" %}
<option value="PR" selected="selected">Presencial</option>
{% else %}
<option value="PR">Presencial</option>
{% endif %}
{% if info.modality_impartition == "PE" %}
<option value="PE" selected="selected">Práctica no laboral (formación) en centro de trabajo</option>
{% else %}
<option value="PE">Práctica no laboral (formación) en centro de trabajo</option>
{% endif %}
</select>
<em class="alert alert-info sepe-message-info sepe-margin-top">
{{ 'ModalityImpartitionMessage' | get_plugin_lang('SepePlugin') }}
</em>
</div>
</div>
<div class="well sepe-subfield">
<legend><h4>{{ 'DurationData' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ClassroomHours' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="classroom_hours" value="{{ info.classroom_hours }}" />
</div>
<div class="col-sm-7 alert alert-info sepe-message-info">{{ 'ClassroomHoursMessage' | get_plugin_lang('SepePlugin') }}</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'DistanceHours' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="distance_hours" value="{{ info.distance_hours }}" />
</div>
<div class="col-sm-7 alert alert-info sepe-message-info">{{ 'DistanceHoursMessage' | get_plugin_lang('SepePlugin') }}</div>
</div>
</div>
<div class="well">
{% if new_action == "1" %}
<legend><h4>{{ 'ClassroomSessionCenter' | get_plugin_lang('SepePlugin') | upper}}: </h4></legend>
<div class="alert alert-warning">{{ 'ClassroomSessionCenterMessage' | get_plugin_lang('SepePlugin') }}</div>
{% else %}
<legend>
<h4>
{{ 'ClassroomSessionCenter' | get_plugin_lang('SepePlugin') }}:
<a href="specialty-classroom-edit.php?new_classroom=1&specialty_id={{ info.id }}&action_id={{ action_id }}" class="btn btn-sm btn-info pull-right">{{ 'CreateClassroomCenter' | get_plugin_lang('SepePlugin') }}</a>
</h4>
</legend>
<input type="hidden" id="confirmDeleteClassroom" value="{{ 'confirmDeleteClassroom'|get_plugin_lang('SepePlugin') }}" />
{% for classroom in listClassroom %}
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ClassroomCenter' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="campo_texto">{{ classroom.center_origin }} {{ classroom.center_code }}
<a href="#" class="btn btn-danger btn-sm pull-right sepe-margin-side delete-classroom" id="classroom{{ classroom.id }}">{{ 'Delete' | get_plugin_lang('SepePlugin') }}</a>
<a href="specialty-classroom-edit.php?new_classroom=0&specialty_id={{ info.id }}&classroom_id={{ classroom.id }}&action_id={{ action_id }}" class="btn btn-warning btn-sm pull-right sepe-margin-side">{{ 'Edit' | get_plugin_lang('SepePlugin') }}</a>
</label>
</div>
</div>
{% endfor %}
{% endif %}
</div>
<div class="well">
{% if new_action == "1" %}
<legend><h4>{{ 'TrainingTutors' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="alert alert-warning">{{ 'TrainingTutorsMessage' | get_plugin_lang('SepePlugin') }}</div>
{% else %}
<legend>
<h4>
{{ 'TrainingTutors' | get_plugin_lang('SepePlugin') }}:
<a href="specialty-tutor-edit.php?new_tutor=1&specialty_id={{ info.id }}&action_id={{ action_id }}" class="btn btn-sm btn-info pull-right">{{ 'CreateTrainingTutor' | get_plugin_lang('SepePlugin') }}</a>
</h4>
</legend>
<input type="hidden" id="confirmDeleteTutor" value="{{ 'confirmDeleteTutor'|get_plugin_lang('SepePlugin') }}" />
{% for tutor in listTutors %}
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'TrainingTutor' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<label class="campo_texto">
{{ tutor.firstname }} {{ tutor.lastname }}
( {{ tutor.document_number }}-{{ tutor.document_letter }} )
<a href="#" class="btn btn-danger btn-sm pull-right sepe-margin-side delete-tutor" id="tutor{{ tutor.id }}">{{ 'Delete' | get_plugin_lang('SepePlugin') }}</a>
<a href="specialty-tutor-edit.php?new_tutor=0&specialty_id={{ info.id }}&tutor_id={{ tutor.id }}&action_id={{ action_id }}" class="btn btn-warning btn-sm pull-right sepe-margin-side">{{ 'Edit' | get_plugin_lang('SepePlugin') }}</a>
</label>
</div>
</div>
{% endfor %}
{% endif %}
</div>
<div class="well">
<legend><h4>{{ 'ContentUse' | get_plugin_lang('SepePlugin') | upper }}</h4></legend>
<div class="well">
<legend class="sepe-subfield2">{{ 'MorningSchedule' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="alert alert-info sepe-message-info">{{ 'MorningScheduleMessage' | get_plugin_lang('SepePlugin') }}</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ParticipantsNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="mornings_participants_number" value="{{ info.mornings_participants_number }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'AccessNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="mornings_access_number" value="{{ info.mornings_access_number }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'TotalDuration' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="morning_total_duration" value="{{ info.morning_total_duration }}"/>
</div>
</div>
</div>
<hr />
<div class="well">
<legend class="sepe-subfield2">{{ 'AfternoonSchedule' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="alert alert-info sepe-message-info">{{ 'AfternoonScheduleMessage' | get_plugin_lang('SepePlugin') }}</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ParticipantsNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="afternoon_participants_number" value="{{ info.afternoon_participants_number }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'AccessNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="afternoon_access_number" value="{{ info.afternoon_access_number }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'TotalDuration' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="afternoon_total_duration" value="{{ info.afternoon_total_duration }}"/>
</div>
</div>
</div>
<hr />
<div class="well">
<legend class="sepe-subfield2">{{ 'NightSchedule' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="alert alert-info sepe-message-info">{{ 'NightScheduleMessage' | get_plugin_lang('SepePlugin') }}</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ParticipantsNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="night_participants_number" value="{{ info.night_participants_number }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'AccessNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="night_access_number" value="{{ info.night_access_number }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'TotalDuration' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="night_total_duration" value="{{ info.night_total_duration }}"/>
</div>
</div>
</div>
<hr />
<div class="well">
<legend class="sepe-subfield2">{{ 'MonitoringAndEvaluation' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'ParticipantsNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="attendees_count" value="{{ info.attendees_count }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'LearningActivityCount' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="learning_activity_count" value="{{ info.learning_activity_count }}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'AttemptCount' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="attempt_count" value="{{ info.attempt_count }}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{{ 'EvaluationActivityCount' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="evaluation_activity_count" value="{{ info.evaluation_activity_count }}"/>
</div>
</div>
</div>
<hr />
</div>
</fieldset>
</div>
</div>
</form>
</div>

@ -0,0 +1,94 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="specialty-classroom-edit.php" method="post" name="form_specialty_action">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
{% if new_classroom == "1" %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="new_classroom" value="1" />
{% else %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="classroom_id" value="{{ classroom_id }}" />
<input type="hidden" name="new_classroom" value="0" />
{% endif %}
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
{% if new_classroom == "1" %}
<div class="well_border">
<div class="form-group">
<label class="control-label col-sm-3">{{ 'UseExistingCenter' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select id="slt_centers_exists" class="chzn-select" style="width:100%" name="slt_centers_exists">
<option value="1" selected="selected">{{ 'UseExisting' | get_plugin_lang('SepePlugin') }}</option>
<option value="0">{{ 'CreateNewCenter' | get_plugin_lang('SepePlugin') }}</option>
</select>
</div>
</div>
</div>
<div class="well_border" id="centers-list-layer">
<fieldset>
<legend>{{ 'CenterList' | get_plugin_lang('SepePlugin') }}</legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Center' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="exists_center_id" class="chzn-select" style="width:100%">
<option value="" selected="selected"></option>
{% for center in listExistsCenters %}
<option value="{{ center.id }}">{{ center.center_origin }} {{ center.center_code }}</option>
{% endfor %}
</select>
</div>
</div>
</fieldset>
</div>
<div class="well_border" style="display:none" id="center-data-layer">
{% else %}
<div class="well_border" id="center-data-layer">
{% endif %}
<fieldset>
<legend>{{ 'ClassroomCenter' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CenterOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="center_origin" value="{{ info.center_origin }}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CenterCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-3">
<input class="form-control" type="text" name="center_code" value="{{ info.center_code }}" />
</div>
</div>
</fieldset>
</div>
</div>
</form>
</div>

@ -0,0 +1,285 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<script type='text/javascript'>
$(document).ready(function () {
$("input[type='submit']").click(function(e){
e.preventDefault();
e.stopPropagation();
if ( $("#slt_user_exists").val() == "1" ) {
if ($("select[name='existingTutor']").val()=="") {
alert("{{ 'SelectUserExistsMessage' | get_plugin_lang('SepePlugin') }}")
} else {
$("form").submit();
}
} else {
var document_type = $("select[name='document_type']").val();
var document_number = $("input[name='document_number']").val();
var document_letter = $("input[name='document_letter']").val();
var vplatform_user_id = $("select[name='platform_user_id']").val();
if ($.trim(document_type)=='' || $.trim(document_number)=='' || $.trim(document_letter)=='') {
alert("{{ 'RequiredTutorField' | get_plugin_lang('SepePlugin') }}");
} else {
if ($("input[name='new_tutor']" ).val()=="0") {
$.post("function.php", {tab:"checkTutorEdit", type:document_type, number:document_number, letter:document_letter, platform_user_id:vplatform_user_id},
function (data) {
if (data.status == "false") {
if (confirm(data.content)) {
$("form").submit();
}
} else {
$("form").submit();
}
}, "json");
} else {
$("form").submit();
}
}
}
});
});
</script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="specialty-tutor-edit.php" method="post" name="form_specialty_action">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
{% if new_tutor == "1" %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="new_tutor" value="1" />
{% else %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="specialtyTutorId" value="{{ tutor_id }}" />
<input type="hidden" name="new_tutor" value="0" />
{% endif %}
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
{% if new_tutor == "1" %}
<div class="well_border">
<div class="form-group">
<label class="control-label col-sm-3">{{ 'UseExistingTutor' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select id="slt_user_exists" class="form-control" name="slt_user_exists">
<option value="1" selected="selected">{{ 'UseExisting' | get_plugin_lang('SepePlugin') }}</option>
<option value="0">{{ 'CreateNewTutor' | get_plugin_lang('SepePlugin') }}</option>
</select>
</div>
</div>
</div>
<div class="well_border" id="tutors-list-layer">
<fieldset>
<legend>{{ 'TutorsList' | get_plugin_lang('SepePlugin') }}</legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Tutor' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="existingTutor" class="form-control">
<option value=""></option>
{% for tutor in ExistingTutorsList %}
<option value="{{ tutor.id }}">{{ tutor.data }}</option>
{% endfor %}
</select>
</div>
</div>
</fieldset>
</div>
<div class="well_border" style="display:none" id="tutor-data-layer">
{% else %}
<input type="hidden" name="slt_user_exists" value="0" />
<div class="well_border" id="tutor-data-layer">
{% endif %}
<fieldset>
<legend>{{ 'TutorTrainer' | get_plugin_lang('SepePlugin') }}</legend>
<div class="well">
<legend><h4>{{ 'TutorIdentifier' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentType' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="document_type" class="form-control">
<option value=""></option>
{% if info.document_type == "D" %}
<option value="D" selected="selected">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="D">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "E" %}
<option value="E" selected="selected">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="E">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "U" %}
<option value="U" selected="selected">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="U">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "G" %}
<option value="G" selected="selected">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="G">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "W" %}
<option value="W" selected="selected">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="W">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.document_type == "H" %}
<option value="H" selected="selected">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="H">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentNumber' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="text" name="document_number" value="{{ info.document_number }}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'DocumentLetter' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-1">
<input class="form-control" type="text" name="document_letter" value="{{ info.document_letter }}" />
</div>
</div>
<div class="warning-message">
{{ 'DocumentFormatMessage' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'TutorAccreditation' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="tutor_accreditation" value="{{ info.tutor_accreditation }}" style="width:100%" />
<div class="alert alert-info sepe-message-info sepe-margin-top">{{ 'TutorAccreditationMessage' | get_plugin_lang('SepePlugin') }}</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ProfessionalExperience' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" class="sepe-numeric-field" type="number" name="professional_experience" value="{{ info.professional_experience }}" />
</div>
<div class="alert alert-info sepe-message-info col-sm-7">{{ 'ProfessionalExperienceMessage' | get_plugin_lang('SepePlugin') }}</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'TeachingCompetence' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="teaching_competence" class="form-control" >
<option value=""></option>
{% if info.teaching_competence == "01" %}
<option value="01" selected="selected">{{ 'TeachingCompetence01' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="01">{{ 'TeachingCompetence01' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.teaching_competence == "02" %}
<option value="02" selected="selected">{{ 'TeachingCompetence02' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="02">{{ 'TeachingCompetence02' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}{% if info.teaching_competence == "03" %}
<option value="03" selected="selected">{{ 'TeachingCompetence03' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="03">{{ 'TeachingCompetence03' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}{% if info.teaching_competence == "04" %}
<option value="04" selected="selected">{{ 'TeachingCompetence04' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="04">{{ 'TeachingCompetence04' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}{% if info.teaching_competence == "05" %}
<option value="05" selected="selected">{{ 'TeachingCompetence05' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="05">{{ 'TeachingCompetence05' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}{% if info.teaching_competence == "06" %}
<option value="06" selected="selected">{{ 'TeachingCompetence06' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="06">{{ 'TeachingCompetence06' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'ExperienceTeleforming' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-2">
<input class="form-control" type="number" name="experience_teleforming" value="{{ info.experience_teleforming }}" />
</div>
<div class="col-sm-7 alert alert-info sepe-message-info">{{ 'ExperienceTeleformingMessage' | get_plugin_lang('SepePlugin') }}</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'TrainingTeleforming' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="training_teleforming" class="form-control">
<option value=""></option>
{% if info.training_teleforming == "01" %}
<option value="01" selected="selected">{{ 'TrainingTeleforming01' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="01">{{ 'TrainingTeleforming01' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.training_teleforming == "02" %}
<option value="02" selected="selected">{{ 'TrainingTeleforming02' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="02">{{ 'TrainingTeleforming02' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.training_teleforming == "03" %}
<option value="03" selected="selected">{{ 'TrainingTeleforming03' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="03">{{ 'TrainingTeleforming03' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
{% if info.training_teleforming == "04" %}
<option value="04" selected="selected">{{ 'TrainingTeleforming04' | get_plugin_lang('SepePlugin') }}</option>
{% else %}
<option value="04">{{ 'TrainingTeleforming04' | get_plugin_lang('SepePlugin') }}</option>
{% endif %}
</select>
</div>
</div>
<div class="well sepe-subfield">
<legend class="sepe-subfield">{{ 'PlatformTeacher' | get_plugin_lang('SepePlugin') | upper }}: </legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'Teacher' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<select name="platform_user_id" class="form-control">
<option value="" selected="selected"></option>
{% for teacher in listTeachers %}
{% if info.platform_user_id == teacher.user_id %}
<option value="{{ teacher.user_id }}" selected="selected">{{ teacher.firstname }} {{ teacher.lastname }}</option>
{% else %}
<option value="{{ teacher.user_id }}">{{ teacher.firstname }} {{ teacher.lastname }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
</div>
</fieldset>
</div>
</form>
</div>

@ -0,0 +1,127 @@
<script type='text/javascript' src="../js/sepe.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row">
<form class="form-horizontal" action="specialty-tutorial-edit.php" method="post" name="form_specialty_action">
<div class="col-md-3">
<div id="course_category_well" class="well">
<ul class="nav nav-list">
<li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
<li>
{% if new_tutorial == "1" %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="new_tutorial" value="1" />
{% else %}
<input type="hidden" name="action_id" value="{{ action_id }}" />
<input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
<input type="hidden" name="tutorial_id" value="{{ tutorial_id }}" />
<input type="hidden" name="new_tutorial" value="0" />
{% endif %}
<input type="hidden" name="sec_token" value="{{ sec_token }}" />
<input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
</li>
<li>
<input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
</li>
</ul>
</div>
</div>
<div class="col-md-9">
{% if message_info != "" %}
<div class="alert alert-success">
{{ message_info }}
</div>
{% endif %}
{% if message_error != "" %}
<div class="alert alert-danger">
{{ message_error }}
</div>
{% endif %}
<div class="well_border">
<fieldset>
<legend>{{ 'ClassroomCenter' | get_plugin_lang('SepePlugin') | upper }}</legend>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CenterOrigin' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="center_origin" value="{{ info.center_origin }}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">{{ 'CenterCode' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-sm-9">
<input class="form-control" type="text" name="center_code" value="{{ info.center_code }}" />
</div>
</div>
</fieldset>
<div class="form-group">
<label class="control-label col-lg-3">{{ 'StartDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_start == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_start" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_start == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info sepe-message-info col-lg-5">
{{ 'StartDateMessageTutorial' | get_plugin_lang('SepePlugin') }}
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">{{ 'EndDate' | get_plugin_lang('SepePlugin') }}: </label>
<div class="col-lg-4">
<select name="day_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..31 %}
<option value="{{ i }}" {% if day_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="month_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in 1..12 %}
<option value="{{ i }}" {% if month_end == i %} selected="selected" {% endif %} >{{ "%02d"|format(i) }}</option>
{% endfor %}
</select>
/
<select name="year_end" class="form-control sepe-slt-date">
<option value=""></option>
{% for i in list_year %}
{% if year_end == i %}
<option value="{{ i }}" selected="selected">{{ i }}</option>
{% else %}
<option value="{{ i }}">{{ i }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="alert alert-info sepe-message-info col-lg-5">
{{ 'EndDateMessageTutorial' | get_plugin_lang('SepePlugin') }}
</div>
</div>
</div>
</div>
</form>
</div>

@ -907,7 +907,7 @@
</wsdl:binding>
<wsdl:service name="ProveedorCentroTFWS">
<wsdl:port binding="impl:ProveedorCentroEndPointSoapBinding" name="ProveedorCentroEndPoint">
<soap:address location="http://##midominio##/plugin/sepe/ws/service.php"/>
<soap:address location="http://111.nosolored.pro/plugin/sepe/ws/service.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
</wsdl:definitions>

File diff suppressed because it is too large Load Diff

@ -48,16 +48,6 @@ class CustomServer extends Zend\Soap\Server
public function handle($request = null)
{
$response = parent::handle($request);
//$response = str_replace("\n", '', $response);
//$response = str_replace("00/00/0000", '', $response);
/*$response = str_replace(
'xmlns:ns1="http://impl.ws.application.proveedorcentro.meyss.spee.es"',
'xmlns:ns1="http://impl.ws.application.proveedorcentro.meyss.spee.es" xmlns:sal="http://salida.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:ent="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es"',
$response
);*/
$response = str_replace(
'xmlns:ns1="http://impl.ws.application.proveedorcentro.meyss.spee.es"',
'xmlns:ns1="http://impl.ws.application.proveedorcentro.meyss.spee.es" xmlns:impl="http://impl.ws.application.proveedorcentro.meyss.spee.es" xmlns:sal="http://salida.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:ent="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"',
@ -86,6 +76,7 @@ class CustomServer extends Zend\Soap\Server
$response
);
//$response = file_get_contents('/tmp/log4.xml');
header('Content-Length:'.strlen($response));
echo $response;
@ -94,72 +85,59 @@ class CustomServer extends Zend\Soap\Server
}
function authenticate($WSUser,$WSKey)
{
$tUser = Database::get_main_table(TABLE_MAIN_USER);
{
$tUser = Database::get_main_table(TABLE_MAIN_USER);
$tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
$login = Database::escape_string($WSUser);
$sql = "SELECT u.user_id, u.status FROM $tUser u, $tApi a WHERE u.username='".$login."' and u.user_id = a.user_id AND a.api_service = 'dokeos' and a.api_key='".$WSKey."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0)
{
$row = Database::fetch_row($result);
if ($row[1] == '4') { //UserManager::is_admin($row[0])) {
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$row = Database::fetch_row($result);
if ($row[1] == '4') { //UserManager::is_admin($row[0])) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
$doc = new DOMDocument();
$post = file_get_contents('php://input');
if (!empty($post)) {
$doc->loadXML($post);
$WSUser = $doc->getElementsByTagName('Username')->item(0)->nodeValue;
$WSKey = $doc->getElementsByTagName('Password')->item(0)->nodeValue;
$WSUser = $doc->getElementsByTagName('Username')->item(0)->nodeValue;
$WSKey = $doc->getElementsByTagName('Password')->item(0)->nodeValue;
$s = new WSSESoapServer($doc);
//error_log(print_r($s,true));
if (!empty($WSUser) && !empty($WSKey)) {
if (authenticate($WSUser,$WSKey))
{
//error_log("Claves correctas");
// pointing to the current file here
$options = array(
'soap_version' => SOAP_1_1
);
//error_log('s1');
$soap = new CustomServer($wsdl, $options);
//error_log('s2');
$soap->setObject(new Sepe());
//error_log('s3');
if ($s->process()) {
//error_log(print_r($s,true));
//error_log('s4');
$xml = $s->saveXML();
//error_log('s5');
//error_log(print_r($xml,true));
//header('Content-type: application/xml');
$soap->handle($xml);
error_log('s6');
exit;
} else {
error_log('not processed');
}
} else {
error_log('Claves incorrectas');
}
} else {
error_log('not processed');
}
if (!empty($WSUser) && !empty($WSKey)) {
if (authenticate($WSUser,$WSKey)) {
// pointing to the current file here
$options = array(
'soap_version' => SOAP_1_1
);
$soap = new CustomServer($wsdl, $options);
$soap->setObject(new Sepe());
if ($s->process()) {
$xml = $s->saveXML();
//header('Content-type: application/xml');
$soap->handle($xml);
exit;
} else {
error_log('not processed');
}
} else {
error_log('Claves incorrectas');
}
} else {
error_log('not processed');
}
} else {
$contents = file_get_contents($wsdl);

Loading…
Cancel
Save