Actualización

This commit is contained in:
Xes
2025-04-10 12:36:07 +02:00
parent 1da7c3f3b9
commit 4aff98e77b
3147 changed files with 320647 additions and 0 deletions

26
plugin/sepe/CHANGELOG.md Normal file
View File

@@ -0,0 +1,26 @@
v2.1 - 2018-04-05
=================
- Fix: SEPE plugin foreign key constraint fails [#2461](https://github.com/chamilo/chamilo-lms/issues/2461)
##### Database changes
You need execute these SQL queries in your database.
```sql
ALTER TABLE plugin_sepe_participants MODIFY company_tutor_id INT( 10 ) UNSIGNED NULL;
ALTER TABLE plugin_sepe_participants MODIFY training_tutor_id INT( 10 ) UNSIGNED NULL;
```
v2.0 - 2017-05-23
=================
This version has been fixed and improved for Chamilo LMS 1.11.x.
Upgrade procedure
-----------------
If you are working with this plugin since earlier versions, you will have to
look at the installer to *fix* your plugin tables (add a few fields).
http://*yourdominio.com*/**plugin/sepe/update.php**
v1.0 - 2016-11-14
=================
This is the first release of the plugin, valid for Chamilo LMS 1.10.x

35
plugin/sepe/README.md Normal file
View File

@@ -0,0 +1,35 @@
SEPE plugin
===
This plugin is specific to the Spanish context. As such, most of its documentation and code might include Spanish language.
Plugin que conecta el SEPE con la plataforma de formación Chamilo
---
*Integra*:
- Conexiones SOAP
- Formularios para editar datos
*Instrucciones*:
- Instalar plugin
- En configuración del plugin: Habilitar Sepe -> SI -> Guardar
- Seleccionar una región del plugin -> menu_administrator
- Crear un usuario llamado SEPE con perfil de recursos humanos.
- 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.
- En el fichero <em>/plugin/sepe/ws/ProveedorCentroTFWS.wsdl</em> modificar la linea 910 para indicar el dominio de la plataforma.
*Composer*:
- 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>
- A continuación habrá que actualizar desde la linea de comandos el directorio vendor, usando la orden 'composer update'
*Verificación del WebService*:
- Para verificar que el webservice está activo, habrá que entrar desde un navegador web a la siguiente dirección:
<em>http://dominioquecorresponda/plugin/sepe/ws/service.php</em>
Icons made by <a href="http://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a>

14
plugin/sepe/admin.php Normal file
View File

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

14
plugin/sepe/config.php Normal file
View File

@@ -0,0 +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 'src/sepe.lib.php';
require_once 'src/sepe_plugin.class.php';

900
plugin/sepe/database.php Normal file
View File

@@ -0,0 +1,900 @@
<?php
/* For license terms, see /license.txt */
/**
* Plugin database installation script. Can only be executed if included
* inside another script loading global.inc.php.
*
* @package chamilo.plugin.sepe
*/
/**
* Check if script can be called.
*/
if (!function_exists('api_get_path')) {
exit('This script must be loaded through the Chamilo plugin installer sequence');
}
$entityManager = Database::getManager();
$pluginSchema = new \Doctrine\DBAL\Schema\Schema();
$connection = $entityManager->getConnection();
$platform = $connection->getDatabasePlatform();
//Create tables
/* ========== PLUGIN_SEPE_CENTER ========== */
$sepeCenterTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_CENTER);
$sepeCenterTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeCenterTable->addColumn('center_origin', \Doctrine\DBAL\Types\Type::STRING);
$sepeCenterTable->addColumn('center_code', \Doctrine\DBAL\Types\Type::STRING);
$sepeCenterTable->addColumn('center_name', \Doctrine\DBAL\Types\Type::STRING);
$sepeCenterTable->addColumn('url', \Doctrine\DBAL\Types\Type::STRING);
$sepeCenterTable->addColumn('tracking_url', \Doctrine\DBAL\Types\Type::STRING);
$sepeCenterTable->addColumn('phone', \Doctrine\DBAL\Types\Type::STRING);
$sepeCenterTable->addColumn('mail', \Doctrine\DBAL\Types\Type::STRING);
$sepeCenterTable->setPrimaryKey(['id']);
/* ========== PLUGIN_SEPE_ACTIONS ========== */
$sepeActionsTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_ACTIONS);
$sepeActionsTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeActionsTable->addColumn(
'action_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeActionsTable->addColumn(
'action_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 30]
);
$sepeActionsTable->addColumn(
'situation',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeActionsTable->addColumn(
'specialty_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeActionsTable->addColumn(
'professional_area',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 4]
);
$sepeActionsTable->addColumn(
'specialty_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 14]
);
$sepeActionsTable->addColumn(
'duration',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeActionsTable->addColumn('start_date', \Doctrine\DBAL\Types\Type::DATE);
$sepeActionsTable->addColumn('end_date', \Doctrine\DBAL\Types\Type::DATE);
$sepeActionsTable->addColumn(
'full_itinerary_indicator',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeActionsTable->addColumn(
'financing_type',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeActionsTable->addColumn(
'attendees_count',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeActionsTable->addColumn(
'action_name',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 250]
);
$sepeActionsTable->addColumn('global_info', \Doctrine\DBAL\Types\Type::TEXT);
$sepeActionsTable->addColumn('schedule', \Doctrine\DBAL\Types\Type::TEXT);
$sepeActionsTable->addColumn('requirements', \Doctrine\DBAL\Types\Type::TEXT);
$sepeActionsTable->addColumn('contact_action', \Doctrine\DBAL\Types\Type::TEXT);
$sepeActionsTable->setPrimaryKey(['id']);
/* ==========PLUGIN_SEPE_SPECIALTY========== */
$sepeSpecialtyTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_SPECIALTY);
$sepeSpecialtyTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeSpecialtyTable->addColumn(
'action_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyTable->addColumn(
'specialty_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeSpecialtyTable->addColumn(
'professional_area',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 4]
);
$sepeSpecialtyTable->addColumn(
'specialty_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 14]
);
$sepeSpecialtyTable->addColumn(
'center_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeSpecialtyTable->addColumn(
'center_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 16]
);
$sepeSpecialtyTable->addColumn('start_date', \Doctrine\DBAL\Types\Type::DATE);
$sepeSpecialtyTable->addColumn('end_date', \Doctrine\DBAL\Types\Type::DATE);
$sepeSpecialtyTable->addColumn(
'modality_impartition',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeSpecialtyTable->addColumn(
'classroom_hours',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyTable->addColumn(
'distance_hours',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyTable->addColumn(
'mornings_participants_number',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'mornings_access_number',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'morning_total_duration',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'afternoon_participants_number',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'afternoon_access_number',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'afternoon_total_duration',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'night_participants_number',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'night_access_number',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'night_total_duration',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'attendees_count',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'learning_activity_count',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'attempt_count',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->addColumn(
'evaluation_activity_count',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeSpecialtyTable->setPrimaryKey(['id']);
$sepeSpecialtyTable->addForeignKeyConstraint(
$sepeActionsTable,
['action_id'],
['id'],
['onDelete' => 'CASCADE']
);
/* ========== PLUGIN_SEPE_CENTROS ========== */
$sepeCentrosTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_CENTERS);
$sepeCentrosTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeCentrosTable->addColumn(
'center_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeCentrosTable->addColumn(
'center_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 16]
);
$sepeCentrosTable->setPrimaryKey(['id']);
/* ========== PLUGIN_SEPE_SPECIALTY_CLASSROOM ========== */
$sepeSpecialtyClassroomTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_SPECIALTY_CLASSROOM);
$sepeSpecialtyClassroomTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeSpecialtyClassroomTable->addColumn(
'specialty_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyClassroomTable->addColumn(
'center_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyClassroomTable->setPrimaryKey(['id']);
$sepeSpecialtyClassroomTable->addForeignKeyConstraint(
$sepeSpecialtyTable,
['specialty_id'],
['id'],
['onDelete' => 'CASCADE']
);
/* ========== PLUGIN_SEPE_TUTORS ========== */
$sepeTutorsTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_TUTORS);
$sepeTutorsTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeTutorsTable->addColumn(
'platform_user_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeTutorsTable->addColumn(
'document_type',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 1]
); //enum('D','E','U','W','G','H')
$sepeTutorsTable->addColumn(
'document_number',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 10]
);
$sepeTutorsTable->addColumn(
'document_letter',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 1]
);
$sepeTutorsTable->addColumn(
'tutor_accreditation',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 200]
);
$sepeTutorsTable->addColumn(
'professional_experience',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeTutorsTable->addColumn(
'teaching_competence',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeTutorsTable->addColumn(
'experience_teleforming',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeTutorsTable->addColumn(
'training_teleforming',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeTutorsTable->setPrimaryKey(['id']);
/* ========== PLUGIN_SEPE_SPECIALTY_TUTORS ========== */
$sepeSpecialtyTutorsTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_SPECIALTY_TUTORS);
$sepeSpecialtyTutorsTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeSpecialtyTutorsTable->addColumn(
'specialty_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyTutorsTable->addColumn(
'tutor_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyTutorsTable->addColumn(
'tutor_accreditation',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 200]
);
$sepeSpecialtyTutorsTable->addColumn(
'professional_experience',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyTutorsTable->addColumn(
'teaching_competence',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeSpecialtyTutorsTable->addColumn(
'experience_teleforming',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeSpecialtyTutorsTable->addColumn(
'training_teleforming',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeSpecialtyTutorsTable->setPrimaryKey(['id']);
$sepeSpecialtyTutorsTable->addForeignKeyConstraint(
$sepeSpecialtyTable,
['specialty_id'],
['id'],
['onDelete' => 'CASCADE']
);
/* ========== PLUGIN_SEPE_TUTORS_EMPRESA ========== */
$sepeTutorsCompanyTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_TUTORS_COMPANY);
$sepeTutorsCompanyTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeTutorsCompanyTable->addColumn(
'alias',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 255]
);
$sepeTutorsCompanyTable->addColumn(
'document_type',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 1, 'notnull' => false]
); //enum('D','E','U','W','G','H')
$sepeTutorsCompanyTable->addColumn(
'document_number',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 10, 'notnull' => false]
);
$sepeTutorsCompanyTable->addColumn(
'document_letter',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 1, 'notnull' => false]
);
$sepeTutorsCompanyTable->addColumn(
'company',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeTutorsCompanyTable->addColumn(
'training',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeTutorsCompanyTable->setPrimaryKey(['id']);
/* ========== PLUGIN_SEPE_PARTICIPANTS ========== */
$sepeParticipantsTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_PARTICIPANTS);
$sepeParticipantsTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeParticipantsTable->addColumn(
'action_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeParticipantsTable->addColumn(
'platform_user_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeParticipantsTable->addColumn(
'document_type',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 1]
); //enum('D','E','U','W','G','H')
$sepeParticipantsTable->addColumn(
'document_number',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 10]
);
$sepeParticipantsTable->addColumn(
'document_letter',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 1]
);
$sepeParticipantsTable->addColumn(
'key_competence',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeParticipantsTable->addColumn(
'contract_id',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 14, 'notnull' => false]
);
$sepeParticipantsTable->addColumn(
'company_fiscal_number',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 9, 'notnull' => false]
);
$sepeParticipantsTable->addColumn(
'company_tutor_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeParticipantsTable->addColumn(
'training_tutor_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true, 'notnull' => false]
);
$sepeParticipantsTable->setPrimaryKey(['id']);
$sepeParticipantsTable->addForeignKeyConstraint(
$sepeActionsTable,
['action_id'],
['id'],
['onDelete' => 'CASCADE']
);
$sepeParticipantsTable->addForeignKeyConstraint(
$sepeTutorsCompanyTable,
['company_tutor_id'],
['id'],
['onDelete' => 'CASCADE']
);
$sepeParticipantsTable->addForeignKeyConstraint(
$sepeTutorsCompanyTable,
['training_tutor_id'],
['id'],
['onDelete' => 'CASCADE']
);
/* ========== PLUGIN_SEPE_PARTICIPANTS_SPECIALTY ========== */
$sepeParticipantsSpecialtyTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_PARTICIPANTS_SPECIALTY);
$sepeParticipantsSpecialtyTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeParticipantsSpecialtyTable->addColumn(
'participant_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeParticipantsSpecialtyTable->addColumn(
'specialty_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'professional_area',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 4, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'specialty_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 14, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'registration_date',
\Doctrine\DBAL\Types\Type::DATE,
['notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'leaving_date',
\Doctrine\DBAL\Types\Type::DATE,
['notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'center_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'center_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 16, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'start_date',
\Doctrine\DBAL\Types\Type::DATE,
['notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'end_date',
\Doctrine\DBAL\Types\Type::DATE,
['notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'final_result',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 1, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'final_qualification',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 4, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->addColumn(
'final_score',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 4, 'notnull' => false]
);
$sepeParticipantsSpecialtyTable->setPrimaryKey(['id']);
$sepeParticipantsSpecialtyTable->addForeignKeyConstraint(
$sepeParticipantsTable,
['participant_id'],
['id'],
['onDelete' => 'CASCADE']
);
/* ========== PLUGIN_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS ========== */
$sepeParticipantsSpecialtyTutorialsTable = $pluginSchema->createTable(
SepePlugin::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS
);
$sepeParticipantsSpecialtyTutorialsTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeParticipantsSpecialtyTutorialsTable->addColumn(
'participant_specialty_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeParticipantsSpecialtyTutorialsTable->addColumn(
'center_origin',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeParticipantsSpecialtyTutorialsTable->addColumn(
'center_code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 16]
);
$sepeParticipantsSpecialtyTutorialsTable->addColumn('start_date', \Doctrine\DBAL\Types\Type::DATE);
$sepeParticipantsSpecialtyTutorialsTable->addColumn('end_date', \Doctrine\DBAL\Types\Type::DATE);
$sepeParticipantsSpecialtyTutorialsTable->setPrimaryKey(['id']);
$sepeParticipantsSpecialtyTutorialsTable->addForeignKeyConstraint(
$sepeParticipantsSpecialtyTable,
['participant_specialty_id'],
['id'],
['onDelete' => 'CASCADE']
);
/* ========== PLUGIN_SEPE_COURSE_ACTIONS ========== */
$sepeCourseActionsTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_COURSE_ACTIONS);
$sepeCourseActionsTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeCourseActionsTable->addColumn(
'course_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeCourseActionsTable->addColumn(
'action_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeCourseActionsTable->setPrimaryKey(['id']);
$sepeCourseActionsTable->addForeignKeyConstraint(
$sepeActionsTable,
['action_id'],
['id'],
['onDelete' => 'CASCADE']
);
/* ========== PLUGIN_SEPE_TEACHING_COMPETENCE ========== */
$sepeTeachingCompetenceTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_TEACHING_COMPETENCE);
$sepeTeachingCompetenceTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeTeachingCompetenceTable->addColumn(
'code',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 2]
);
$sepeTeachingCompetenceTable->addColumn('value', \Doctrine\DBAL\Types\Type::TEXT);
$sepeTeachingCompetenceTable->setPrimaryKey(['id']);
/* ========== PLUGIN_SEPE_LOG_PARTICIPANT ========== */
$sepeLogParticipantTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_LOG_PARTICIPANT);
$sepeLogParticipantTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeLogParticipantTable->addColumn(
'platform_user_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeLogParticipantTable->addColumn(
'action_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeLogParticipantTable->addColumn('registration_date', \Doctrine\DBAL\Types\Type::DATETIME);
$sepeLogParticipantTable->addColumn('leaving_date', \Doctrine\DBAL\Types\Type::DATETIME);
$sepeLogParticipantTable->setPrimaryKey(['id']);
/* ========== PLUGIN_SEPE_LOG_MOD_PARTICIPANT ========== */
$sepeLogModParticipantTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_LOG_MOD_PARTICIPANT);
$sepeLogModParticipantTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeLogModParticipantTable->addColumn(
'platform_user_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeLogModParticipantTable->addColumn(
'action_id',
\Doctrine\DBAL\Types\Type::INTEGER,
['unsigned' => true]
);
$sepeLogModParticipantTable->addColumn('change_date', \Doctrine\DBAL\Types\Type::DATETIME);
$sepeLogModParticipantTable->setPrimaryKey(['id']);
/* ==========PLUGIN_SEPE_LOG ========== */
$sepeLogTable = $pluginSchema->createTable(SepePlugin::TABLE_SEPE_LOG);
$sepeLogTable->addColumn(
'id',
\Doctrine\DBAL\Types\Type::INTEGER,
['autoincrement' => true, 'unsigned' => true]
);
$sepeLogTable->addColumn(
'ip',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 200]
);
$sepeLogTable->addColumn(
'action',
\Doctrine\DBAL\Types\Type::STRING,
['length' => 255]
);
$sepeLogTable->addColumn('date', \Doctrine\DBAL\Types\Type::DATETIME);
$sepeLogTable->setPrimaryKey(['id']);
$queries = $pluginSchema->toSql($platform);
foreach ($queries as $query) {
Database::query($query);
}
//Insert data
$sepeTeachingCompetenceTable = Database::get_main_table(SepePlugin::TABLE_SEPE_TEACHING_COMPETENCE);
$competences = [
[
1,
'01',
'Certificado de profesionalidad de docencia de la formación profesional para el empleo regulado por Real Decreto 1697/2011, de 18 de noviembre.',
],
[2, '02', 'Certificado de profesionalidad de formador ocupacional.'],
[
3,
'03',
'Certificado de Aptitud Pedagógica o título profesional de Especialización Didáctica o Certificado de Cualificación Pedagógica.',
],
[
4,
'04',
'Máster Universitario habilitante para el ejercicio de las Profesiones reguladas de Profesor de Educación Secundaria Obligatoria y Bachillerato, Formación Profesional y Escuelas Oficiales de Idiomas.',
],
[
5,
'05',
'Curso de formación equivalente a la formación pedagógica y didáctica exigida para aquellas personas que, estando en posesion de una titulación declarada equivalente a efectos de docencia, no pueden realizar los estudios de máster, establecida en la disposición adicional primera del Real Decreto 1834/2008, de 8 de noviembre.',
],
[
6,
'06',
'Experiencia docente contrastada de al menos 600 horas de impartición de acciones formativas de formación profesional para el empleo o del sistema educativo en modalidad presencial, en los últimos diez años.',
],
];
foreach ($competences as $competence) {
Database::insert(
$sepeTeachingCompetenceTable,
[
'id' => $competence[0],
'code' => $competence[1],
'value' => $competence[2],
]
);
}
$sepeTutorsCompanyTable = Database::get_main_table(SepePlugin::TABLE_SEPE_TUTORS_COMPANY);
Database::insert(
$sepeTutorsCompanyTable,
[
'id' => 1,
'alias' => 'Sin tutor',
'company' => 'SI',
'training' => 'SI',
]
);
/* Create extra fields for platform users */
$fieldlabel = 'sexo';
$fieldtype = '3';
$fieldtitle = 'Género';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$sql = "INSERT INTO extra_field_options (field_id, option_value, display_text, option_order) VALUES ('".$field_id."', 'Hombre', 'Hombre',1);";
Database::query($sql);
$sql = "INSERT INTO extra_field_options (field_id, option_value, display_text, option_order) VALUES ('".$field_id."', 'Mujer', 'Mujer',2);";
Database::query($sql);
$sql = "INSERT INTO extra_field_options (field_id, option_value, display_text, option_order) VALUES ('".$field_id."', 'Otros', 'Otros',3);";
Database::query($sql);
$fieldlabel = 'edad';
$fieldtype = '6';
$fieldtitle = 'Fecha de nacimiento';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'nivel_formativo';
$fieldtype = '1';
$fieldtitle = 'Nivel formativo';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'situacion_laboral';
$fieldtype = '1';
$fieldtitle = 'Situación Laboral';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'provincia_residencia';
$fieldtype = '4';
$fieldtitle = 'Provincia Residencia';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$provinces = 'Albacete;Alicante/Alacant;Almería;Araba/Álava;Asturias;Ávila;Badajoz;Balears, Illes;Barcelona;Bizkaia;Burgos;Cáceres;Cádiz;Cantabria;Castellón/Castelló;Ciudad Real;Córdoba;Coruña, A;Cuenca;Gipuzkoa;Girona;Granada;Guadalajara;Huelva;Huesca;Jaén;León;Lleida;Lugo;Madrid;Málaga;Murcia;Navarra;Ourense;Palencia;Palmas, Las;Pontevedr;Rioja, La;Salamanca;Santa Cruz de Tenerife;Segovia;Sevilla;Soria;Tarragona;Teruel;Toledo;Valencia/Valéncia;Valladolid;Zamora;Zaragoza;Ceuta;Melilla';
$list_provinces = explode(';', $provinces);
$i = 1;
foreach ($list_provinces as $value) {
$sql = "INSERT INTO extra_field_options (field_id, option_value, display_text, option_order) VALUES ('".$field_id."', '".$i."', '".$value."','".$i."');";
Database::query($sql);
$i++;
}
$fieldlabel = 'comunidad_residencia';
$fieldtype = '4';
$fieldtitle = 'Comunidad autonoma de residencia';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$ccaa = ';Andalucía;Aragón;Asturias, Principado de;Balears, Illes;Canarias;Cantabria;Castilla y León;Castilla - La Mancha;Cataluña;Comunitat Valenciana;Extremadura;Galicia;Madrid, Comunidad de;Murcia, Región de;Navarra, Comunidad Foral de;País Vasco;Rioja, La;Ceuta;Melilla';
$list_ccaa = explode(';', $ccaa);
$i = 1;
foreach ($list_ccaa as $value) {
$sql = "INSERT INTO extra_field_options (field_id, option_value, display_text, option_order) VALUES ('".$field_id."', '".$i."', '".$value."','".$i."');";
Database::query($sql);
$i++;
}
$fieldlabel = 'provincia_trabajo';
$fieldtype = '4';
$fieldtitle = 'Provincia Trabajo';
$fielddefault = '';
//$fieldoptions = ';Albacete;Alicante/Alacant;Almería;Araba/Álava;Asturias;Ávila;Badajoz;Balears, Illes;Barcelona;Bizkaia;Burgos;Cáceres;Cádiz;Cantabria;Castellón/Castelló;Ciudad Real;Córdoba;Coruña, A;Cuenca;Gipuzkoa;Girona;Granada;Guadalajara;Huelva;Huesca;Jaén;León;Lleida;Lugo;Madrid;Málaga;Murcia;Navarra;Ourense;Palencia;Palmas, Las;Pontevedr;Rioja, La;Salamanca;Santa Cruz de Tenerife;Segovia;Sevilla;Soria;Tarragona;Teruel;Toledo;Valencia/Valéncia;Valladolid;Zamora;Zaragoza;Ceuta;Melilla';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$i = 1;
foreach ($list_provinces as $value) {
$sql = "INSERT INTO extra_field_options (field_id, option_value, display_text, option_order) VALUES ('".$field_id."', '".$i."', '".$value."','".$i."');";
Database::query($sql);
$i++;
}
$fieldlabel = 'comunidad_trabajo';
$fieldtype = '4';
$fieldtitle = 'Comunidad autonoma Trabajo';
$fielddefault = '';
//$fieldoptions = ';Andalucía;Aragón;Asturias, Principado de;Balears, Illes;Canarias;Cantabria;Castilla y León;Castilla - La Mancha;Cataluña;Comunitat Valenciana;Extremadura;Galicia;Madrid, Comunidad de;Murcia, Región de;Navarra, Comunidad Foral de;País Vasco;Rioja, La;Ceuta;Melilla';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$i = 1;
foreach ($list_ccaa as $value) {
$sql = "INSERT INTO extra_field_options (field_id, option_value, display_text, option_order) VALUES ('".$field_id."', '".$i."', '".$value."','".$i."');";
Database::query($sql);
$i++;
}
$fieldlabel = 'medio_conocimiento';
$fieldtype = '2';
$fieldtitle = 'Medio de conocimiento Acción formativa';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'experiencia_anterior';
$fieldtype = '2';
$fieldtitle = 'Experiencia anterior en la realización de cursos on-line';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'razones_teleformacion';
$fieldtype = '2';
$fieldtitle = 'Razones por la modalidad teleformación';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'valoracion_modalidad';
$fieldtype = '2';
$fieldtitle = 'Valoración general sobre la modalidad';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'categoria_profesional';
$fieldtype = '1';
$fieldtitle = 'Categoría profesional';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'tamano_empresa';
$fieldtype = '1';
$fieldtitle = 'Tamaño de la empresa';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'horario_accion_formativa';
$fieldtype = '1';
$fieldtitle = 'Horario de la acción formativa';
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);

12
plugin/sepe/index.php Normal file
View File

@@ -0,0 +1,12 @@
<?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__.'/config.php';
require_once __DIR__.'/src/index.sepe.php';

14
plugin/sepe/install.php Normal file
View File

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

223
plugin/sepe/js/sepe.js Normal file
View File

@@ -0,0 +1,223 @@
/* For licensing terms, see /license.txt */
/**
* JS library for the Chamilo sepe plugin
* @package chamilo.plugin.sepe
*/
$(document).ready(function () {
$("#delete-center-data").click(function (e) {
e.preventDefault();
e.stopPropagation();
if (confirm($('#confirmDeleteCenterData').val())) {
$.post("function.php", {tab: "delete_center_data"},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
location.reload();
}
}, "json");
}
});
$("#delete-action").click(function (e) {
e.preventDefault();
e.stopPropagation();
var actionId = $("#action_id").val();
if (confirm($('#confirmDeleteAction').val())) {
$.post("function.php", {tab: "delete_action", id:actionId},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
window.location.replace("formative-actions-list.php");
}
}, "json");
}
});
$(".delete-specialty").click(function(e){
e.preventDefault();
e.stopPropagation();
iid = $(this).prop("id");
if (confirm($('#confirmDeleteSpecialty').val())) {
$.post("function.php", {tab: "delete_specialty", id:iid},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".delete-classroom").click(function(e){
e.preventDefault();
e.stopPropagation();
iid = $(this).prop("id");
if (confirm($('#confirmDeleteClassroom').val())) {
$.post("function.php", {tab: "delete_classroom", id:iid},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".delete-tutor").click(function(e){
e.preventDefault();
e.stopPropagation();
iid = $(this).prop("id");
if (confirm($('#confirmDeleteTutor').val())) {
$.post("function.php", {tab: "delete_tutor", id:iid},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".delete-participant").click(function(e){
e.preventDefault();
e.stopPropagation();
iid = $(this).prop("id");
if (confirm($('#confirmDeleteParticipant').val())) {
$.post("function.php", {tab: "delete_participant", id:iid},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".delete-specialty-participant").click(function(e){
e.preventDefault();
e.stopPropagation();
iid = $(this).prop("id");
if (confirm($("#confirmDeleteParticipantSpecialty").val())) {
$.post("function.php", {tab: "delete_specialty_participant", id:iid},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
alert(data.content);
location.reload();
}
}, "json");
}
});
$(".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:"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();
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();
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_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 ($('#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: "key_sepe_generator"},
function (data) {
if (data.status == 'false') {
alert(data.content);
} else {
$("#input_key").val(data.content);
}
}, "json");
});
});

View File

@@ -0,0 +1,292 @@
<?php
//Needed in order to show the plugin title
$strings['plugin_title'] = "SEPE manager";
$strings['sepe_enable'] = "SEPE enable";
$strings['plugin_comment'] = "Configuration of the formative actions of SEPE (from the Spanish ministry of labour).";
$strings['Options'] = "Options";
$strings['Setting'] = "Setting";
$strings['sepe_url'] = "URL 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";
$strings['NoTutor'] = "No tutor";

View File

@@ -0,0 +1,292 @@
<?php
//Needed in order to show the plugin title
$strings['plugin_title'] = "Gestión SEPE";
$strings['sepe_enable'] = "Habilitar SEPE";
$strings['plugin_comment'] = "Configuración de las acciones formativas del SEPE (Ministerio de Trabajo de España).";
$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.';
$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['ProblemDataBase'] = 'Problema con la base de datos';
$strings['ModDataTeacher'] = 'Información: Se va a modificar los datos identificativos del profesor de Chamilo';
$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ón formativa no existe";
$strings['FormativeActionInUse'] = "La acción formativa elegida está siendo usada por otro curso";
$strings['ProblemToken'] = "Token incorrecto, pruebe de nuevo a guardar los cambios";
$strings['NoTutor'] = "Sin tutor";

14
plugin/sepe/plugin.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
/* For license terms, see /license.txt */
/**
* This script is a configuration file for the date plugin.
* You can use it as a master for other platform plugins (course plugins are slightly different).
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins).
*
* @package chamilo.plugin.sepe
*/
/**
* Plugin details (must be present).
*/
require_once __DIR__.'/config.php';
$plugin_info = SepePlugin::create()->get_info();

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

View File

@@ -0,0 +1,90 @@
.sepe-input-text{
color: #00829c;
font-size: 1.3em;
font-weight: normal;
padding-top: 2px;
}
.sepe-delete-link {
background: url("icon-delete.png") no-repeat scroll 0px 10px;
padding-left: 30px;
font-size:1.3em;
}
.sepe-edit-link {
background: url("icon-edit.png") no-repeat scroll 0 10px;
padding-left: 30px;
font-size:1.3em;
}
.sepe-list-link {
background: url("options-lines.png") no-repeat scroll 0 10px;
padding-left: 30px;
font-size:1.3em;
}
input.sepe-btn-menu-side{
width:100%;
margin-bottom:10px;
}
legend.sepe-subfield {
font-size: 16px;
line-height: 16px;
padding-bottom: 10px;
padding-left: 0;
padding-right: 0;
padding-top: 0;
}
.well.sepe-subfield {
background: none repeat scroll 0 0 #fafafa;
}
.well .well {
background: white;
}
em.span4 {
float: none;
margin: 0;
padding: 5px;
display:inline-block;
}
em{
float: none;
margin: 5px 0 0 0;
padding: 5px;
display: block;
}
.message-info{
padding:5px 10px;
}
.sepe-slt-date {
width:auto;
display:inline-block;
}
input.sepe-numeric-field {
text-align: center;
width: 60px;
}
.sepe-subfield2 {
font-size: 16px;
text-align: center;
}
.sepe-margin-side{
margin: 0 5px;
}
#sepe-tbl-info-fiscal-number{
width:90%;
margin:5px auto;
}
#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;
}
.sepe-vertical-align-middle, .table td.sepe-vertical-align-middle{
vertical-align:middle;
}
.sepe-box-center{
margin:0 auto;
}
.sepe-margin-top{
margin-top:5px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,43 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays setting api key user.
*/
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[] = [
"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));
exit;
}

View File

@@ -0,0 +1,234 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a formative action edit form.
*/
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$actionOrigin = Database::escape_string(trim($_POST['action_origin']));
$actionCode = Database::escape_string(trim($_POST['action_code']));
$situation = Database::escape_string(trim($_POST['situation']));
$specialtyOrigin = Database::escape_string(trim($_POST['specialty_origin']));
$professionalArea = Database::escape_string(trim($_POST['professional_area']));
$specialtyCode = Database::escape_string(trim($_POST['specialty_code']));
$duration = Database::escape_string(trim($_POST['duration']));
$dayStart = Database::escape_string(trim($_POST['day_start']));
$monthStart = Database::escape_string(trim($_POST['month_start']));
$yearStart = Database::escape_string(trim($_POST['year_start']));
$dayEnd = Database::escape_string(trim($_POST['day_end']));
$monthEnd = Database::escape_string(trim($_POST['month_end']));
$yearEnd = Database::escape_string(trim($_POST['year_end']));
$fullItineraryIndicator = Database::escape_string(trim($_POST['full_itinerary_indicator']));
$financingType = Database::escape_string(trim($_POST['financing_type']));
$attendeesCount = intval($_POST['attendees_count']);
$actionName = Database::escape_string(trim($_POST['action_name']));
$globalInfo = Database::escape_string(trim($_POST['global_info']));
$schedule = Database::escape_string(trim($_POST['schedule']));
$requirements = Database::escape_string(trim($_POST['requirements']));
$contactAction = Database::escape_string(trim($_POST['contact_action']));
$actionId = intval($_POST['action_id']);
$courseId = intval($_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) {
$_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 = intval($_POST['action_id']);
if ($actionId == '0') {
$courseId = intval($_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']) && intval($_GET['new_action']) == 1) {
$info = [];
$interbreadcrumb[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = [
"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', intval($_GET['cid']));
} else {
$courseId = getCourse($_GET['action_id']);
$interbreadcrumb[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = [
"url" => "formative-actions-list.php",
"name" => $plugin->get_lang('FormativesActionsList'),
];
$interbreadcrumb[] = [
"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 = [];
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));
exit;
}

View File

@@ -0,0 +1,54 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a basic info of formative action.
*/
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");
exit;
}
$templateName = $plugin->get_lang('FormativeActionData');
$interbreadcrumb[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = [
"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));
}

View File

@@ -0,0 +1,42 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a formatives actions list.
*/
require_once '../config.php';
$plugin = SepePlugin::create();
if (api_is_platform_admin()) {
$templateName = $plugin->get_lang('FormativesActionsList');
$interbreadcrumb[] = [
"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));
exit;
}

View File

@@ -0,0 +1,200 @@
<?php
/* For license terms, see /license.txt */
/**
* Functions for the Sepe plugin.
*
* @package chamilo.plugin.sepe
*/
require_once '../config.php';
$plugin = SepePlugin::create();
if ($_REQUEST['tab'] == 'delete_center_data') {
$sql = "DELETE FROM $tableSepeCenter;";
$res = Database::query($sql);
if (!$res) {
$sql = "DELETE FROM $tableSepeActions;";
$res = Database::query($sql);
$content = $plugin->get_lang('ProblemToDeleteInfoCenter');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
echo json_encode(["status" => "true", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'delete_action') {
$id = intval($_REQUEST['id']);
$sql = "DELETE FROM $tableSepeActions WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoAction');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
$_SESSION['sepe_message_info'] = $content;
echo json_encode(["status" => "true"]);
}
}
if ($_REQUEST['tab'] == 'delete_specialty') {
$id = intval(substr($_REQUEST['id'], 9));
$sql = "DELETE FROM $tableSepeSpecialty WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
echo json_encode(["status" => "true", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'delete_specialty_participant') {
$id = intval(substr($_REQUEST['id'], 9));
$sql = "DELETE FROM $tableSepeParticipantsSpecialty WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialty');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
echo json_encode(["status" => "true", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'delete_classroom') {
$id = intval(substr($_REQUEST['id'], 9));
$sql = "DELETE FROM $tableSepeSpecialtyClassroom WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyClassroom');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
echo json_encode(["status" => "true", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'checkTutorEdit') {
$type = Database::escape_string(trim($_REQUEST['type']));
$number = Database::escape_string(trim($_REQUEST['number']));
$letter = Database::escape_string(trim($_REQUEST['letter']));
$platform_user_id = intval($_REQUEST['platform_user_id']);
$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');
error_log(print_r($content, 1));
exit;
} else {
$aux = Database::fetch_assoc($res);
if ($aux['platform_user_id'] == $platform_user_id || $aux['platform_user_id'] == 0) {
echo json_encode(["status" => "true"]);
} else {
$content = $plugin->get_lang('ModDataTeacher');
echo json_encode(["status" => "false", "content" => $content]);
}
}
}
if ($_REQUEST['tab'] == 'delete_tutor') {
$id = intval(substr($_REQUEST['id'], 5));
$sql = "DELETE FROM $tableSepeSpecialtyTutors WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoSpecialtyTutor');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
echo json_encode(["status" => "true", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'delete_participant') {
$id = intval(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 platform_user_id='".$row['platform_user_id']."' AND action_id='".$row['action_id']."';";
$res = Database::query($sql);
$sql = "DELETE FROM $tableSepeParticipants WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDeleteInfoParticipant');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
echo json_encode(["status" => "true", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'unlink_action') {
$id = intval(substr($_REQUEST['id'], 16));
$sql = "DELETE FROM $tableSepeCourseActions WHERE id = $id;";
$res = Database::query($sql);
if (!$res) {
$content = $plugin->get_lang('ProblemToDesvincularInfoAction');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$content = $plugin->get_lang('DeleteOk');
echo json_encode(["status" => "true", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'assign_action') {
$course_id = intval(substr($_REQUEST['course_id'], 9));
$action_id = intval($_REQUEST['action_id']);
if ($action_id != 0 && $course_id != 0) {
$sql = "SELECT * FROM $tableSepeCourseActions WHERE action_id = $action_id;";
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
$content = $plugin->get_lang('FormativeActionInUse');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$sql = "SELECT 1 FROM course WHERE id = $course_id;";
$rs = Database::query($sql);
if (Database::num_rows($rs) == 0) {
$content = $plugin->get_lang('NoExistsCourse');
echo json_encode(["status" => "false", "content" => $content]);
} else {
$sql = "INSERT INTO $tableSepeCourseActions (course_id, action_id) VALUES ($course_id, $action_id);";
$rs = Database::query($sql);
if (!$rs) {
$content = $plugin->get_lang('NoSaveData');
echo json_encode(["status" => "false", "content" => utf8_encode($content)]);
} else {
echo json_encode(["status" => "true"]);
}
}
}
} else {
$content = $plugin->get_lang('ErrorDataIncorrect');
echo json_encode(["status" => "false", "content" => $content]);
}
}
if ($_REQUEST['tab'] == 'key_sepe_generator') {
$tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
$info_user = api_get_user_info_from_username('SEPE');
$array_list_key = [];
$user_id = $info_user['user_id'];
$api_service = 'dokeos';
$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]) != '') {
$content = $array_list_key[$num];
echo json_encode(["status" => "true", "content" => $content]);
} else {
$content = $plugin->get_lang('ProblemGenerateApiKey');
echo json_encode(["status" => "false", "content" => $content]);
}
}

View File

@@ -0,0 +1,95 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a data center edit form.
*/
require_once '../config.php';
$plugin = SepePlugin::create();
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$centerOrigin = Database::escape_string(trim($_POST['center_origin']));
$centerCode = Database::escape_string(trim($_POST['center_code']));
$centerName = Database::escape_string(trim($_POST['center_name']));
$url = Database::escape_string(trim($_POST['url']));
$trackingUrl = Database::escape_string(trim($_POST['tracking_url']));
$phone = Database::escape_string(trim($_POST['phone']));
$mail = Database::escape_string(trim($_POST['mail']));
$id = intval($_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[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = ["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));
exit;
}

View File

@@ -0,0 +1,36 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a basic info about data center.
*/
require_once '../config.php';
$plugin = SepePlugin::create();
$_cid = 0;
if (api_is_platform_admin()) {
$info = getInfoIdentificationData();
$templateName = $plugin->get_lang('DataCenter');
$interbreadcrumb[] = [
"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));
}

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,41 @@
<?php
/* For license terms, see /license.txt */
/**
* Index of the Sepe plugin.
*/
$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) {
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>';
}

View File

@@ -0,0 +1,248 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a participant edit form.
*/
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$companyTutorId = (!empty($_POST['company_tutor_id']) ? intval($_POST['company_tutor_id']) : null);
$trainingTutorId = (!empty($_POST['training_tutor_id']) ? intval($_POST['training_tutor_id']) : null);
$tutorCompanyDocumentType = Database::escape_string(trim($_POST['tutor_company_document_type']));
$tutorCompanyDocumentNumber = Database::escape_string(trim($_POST['tutor_company_document_number']));
$tutorCompanyDocumentLetter = Database::escape_string(trim($_POST['tutor_company_document_letter']));
$tutorCompanyAlias = Database::escape_string(trim($_POST['tutor_company_alias']));
$tutorTrainingDocumentType = Database::escape_string(trim($_POST['tutor_training_document_type']));
$tutorTrainingDocumentNumber = Database::escape_string(trim($_POST['tutor_training_document_number']));
$tutorTrainingDocumentLetter = Database::escape_string(trim($_POST['tutor_training_document_letter']));
$tutorTrainingAlias = Database::escape_string(trim($_POST['tutor_training_alias']));
$newParticipant = intval($_POST['new_participant']);
$platformUserId = intval($_POST['platform_user_id']);
$documentType = Database::escape_string(trim($_POST['document_type']));
$documentNumber = Database::escape_string(trim($_POST['document_number']));
$documentLetter = Database::escape_string(trim($_POST['document_letter']));
$keyCompetence = Database::escape_string(trim($_POST['key_competence']));
$contractId = Database::escape_string(trim($_POST['contract_id']));
$companyFiscalNumber = Database::escape_string(trim($_POST['company_fiscal_number']));
$participantId = intval($_POST['participant_id']);
$actionId = intval($_POST['action_id']);
if (isset($companyTutorId) && $companyTutorId == 0) {
$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) {
} else {
$companyTutorId = Database::insert_id();
}
}
}
if (isset($trainingTutorId) && $trainingTutorId == 0) {
$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) {
} else {
$trainingTutorId = Database::insert_id();
}
}
}
if (isset($newParticipant) && $newParticipant != 1) {
$sql = "UPDATE $tableSepeParticipants SET
platform_user_id = '".$platformUserId."',
document_type = '".$documentType."',
document_number = '".$documentNumber."',
document_letter = '".$documentLetter."',
key_competence = '".$keyCompetence."',
contract_id = '".$contractId."',
company_fiscal_number = '".$companyFiscalNumber."'
WHERE id = $participantId";
} else {
$sql = "INSERT INTO $tableSepeParticipants(
action_id,
platform_user_id,
document_type,
document_number,
document_letter,
key_competence,
contract_id,
company_fiscal_number
) VALUES (
'".$actionId."',
'".$platformUserId."',
'".$documentType."',
'".$documentNumber."',
'".$documentLetter."',
'".$keyCompetence."',
'".$contractId."',
'".$companyFiscalNumber."'
);";
}
$res = Database::query($sql);
if (!$res) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newParticipant == 1) {
$participantId = Database::insert_id();
}
// Update tutors
if (is_null($companyTutorId)) {
$sql = "UPDATE $tableSepeParticipants SET company_tutor_id = NULL WHERE id = $participantId";
} else {
$sql = "UPDATE $tableSepeParticipants SET company_tutor_id = $companyTutorId WHERE id = $participantId";
}
Database::query($sql);
if (is_null($trainingTutorId)) {
$sql = "UPDATE $tableSepeParticipants SET training_tutor_id = NULL WHERE id = $participantId";
} else {
$sql = "UPDATE $tableSepeParticipants SET training_tutor_id = $trainingTutorId WHERE id = $participantId";
}
Database::query($sql);
$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);
exit;
} else {
$participantId = intval($_POST['participant_id']);
$actionId = intval($_POST['action_id']);
$newParticipant = intval($_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);
exit;
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$actionId = intval($_GET['action_id']);
$courseId = getCourse($actionId);
$interbreadcrumb[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = [
"url" => "formative-actions-list.php",
"name" => $plugin->get_lang('FormativesActionsList'),
];
$interbreadcrumb[] = [
"url" => "formative-action.php?cid=".$courseId,
"name" => $plugin->get_lang('FormativeAction'),
];
if (isset($_GET['new_participant']) && intval($_GET['new_participant']) == 1) {
$templateName = $plugin->get_lang('NewParticipantAction');
$tpl = new Template($templateName);
$tpl->assign('action_id', $actionId);
$info = [];
$tpl->assign('info', $info);
$tpl->assign('new_participant', '1');
} else {
$templateName = $plugin->get_lang('EditParticipantAction');
$tpl = new Template($templateName);
$tpl->assign('action_id', $actionId);
$info = getInfoParticipantAction($_GET['participant_id']);
$tpl->assign('info', $info);
$tpl->assign('new_participant', '0');
$tpl->assign('participant_id', (int) $_GET['participant_id']);
if ($info['platform_user_id'] != 0) {
$infoUserPlatform = api_get_user_info($info['platform_user_id']);
$tpl->assign('info_user_platform', $infoUserPlatform);
}
$listParticipantSpecialty = listParticipantSpecialty(intval($_GET['participant_id']));
$tpl->assign('listParticipantSpecialty', $listParticipantSpecialty);
}
$courseCode = getCourseCode($actionId);
$listStudentInfo = [];
$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 = listTutorType("company = '1'");
$tpl->assign('list_tutor_company', $listTutorCompany);
$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));
exit;
}

View File

@@ -0,0 +1,284 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a participant specialty edit form.
*/
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$newSpecialty = intval($_POST['new_specialty']);
$specialtyOrigin = Database::escape_string(trim($_POST['specialty_origin']));
$professionalArea = Database::escape_string(trim($_POST['professional_area']));
$specialtyCode = Database::escape_string(trim($_POST['specialty_code']));
$centerOrigin = Database::escape_string(trim($_POST['center_origin']));
$centerCode = Database::escape_string(trim($_POST['center_code']));
$finalResult = Database::escape_string(trim($_POST['final_result']));
$finalQualification = Database::escape_string(trim($_POST['final_qualification']));
$finalScore = Database::escape_string(trim($_POST['final_score']));
$yearRegistration = Database::escape_string(trim($_POST['year_registration']));
$monthRegistration = Database::escape_string(trim($_POST['month_registration']));
$dayRegistration = Database::escape_string(trim($_POST['day_registration']));
$yearLeaving = Database::escape_string(trim($_POST['year_leaving']));
$monthLeaving = Database::escape_string(trim($_POST['month_leaving']));
$dayLeaving = Database::escape_string(trim($_POST['day_leaving']));
$dayStart = Database::escape_string(trim($_POST['day_start']));
$monthStart = Database::escape_string(trim($_POST['month_start']));
$yearStart = Database::escape_string(trim($_POST['year_start']));
$dayEnd = Database::escape_string(trim($_POST['day_end']));
$monthEnd = Database::escape_string(trim($_POST['month_end']));
$yearEnd = Database::escape_string(trim($_POST['year_end']));
$participantId = intval($_POST['participant_id']);
$actionId = intval($_POST['action_id']);
$specialtyId = intval($_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) {
$_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 = getUserPlatformFromParticipant($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);
exit;
} else {
$newSpecialty = intval($_POST['new_specialty']);
$participantId = intval($_POST['participant_id']);
$actionId = intval($_POST['action_id']);
$specialtyId = intval($_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);
exit;
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$actionId = (int) $_GET['action_id'];
$courseId = getCourse($actionId);
$participantId = (int) $_GET['participant_id'];
$interbreadcrumb[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = ["url" => "formative-actions-list.php", "name" => $plugin->get_lang('FormativesActionsList')];
$interbreadcrumb[] = [
"url" => "formative-action.php?cid=".$courseId,
"name" => $plugin->get_lang('FormativeAction'),
];
$interbreadcrumb[] = [
"url" => "participant-action-edit.php?new_participant=0&participant_id=".$participantId."&action_id=".$actionId,
"name" => $plugin->get_lang('FormativeActionParticipant'),
];
if (isset($_GET['new_specialty']) && intval($_GET['new_specialty']) == 1) {
$templateName = $plugin->get_lang('NewSpecialtyParticipant');
$tpl = new Template($templateName);
$tpl->assign('action_id', $actionId);
$tpl->assign('participant_id', $participantId);
$info = [];
$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', $actionId);
$tpl->assign('specialty_id', intval($_GET['specialty_id']));
$tpl->assign('participant_id', $participantId);
$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 = [];
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 = [];
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));
exit;
}

View File

@@ -0,0 +1,59 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a administrator menu.
*/
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[] = ["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));
exit;
}

View File

@@ -0,0 +1,586 @@
<?php
/**
* Functions.
*
* @package chamilo.plugin.sepe
*/
$tableSepeCenter = Database::get_main_table(SepePlugin::TABLE_SEPE_CENTER);
$tableSepeActions = Database::get_main_table(SepePlugin::TABLE_SEPE_ACTIONS);
$tableSepeSpecialty = Database::get_main_table(SepePlugin::TABLE_SEPE_SPECIALTY);
$tableSepeSpecialtyClassroom = Database::get_main_table(SepePlugin::TABLE_SEPE_SPECIALTY_CLASSROOM);
$tableSepeSpecialtyTutors = Database::get_main_table(SepePlugin::TABLE_SEPE_SPECIALTY_TUTORS);
$tableSepeTutors = Database::get_main_table(SepePlugin::TABLE_SEPE_TUTORS);
$tableSepeParticipants = Database::get_main_table(SepePlugin::TABLE_SEPE_PARTICIPANTS);
$tableSepeParticipantsSpecialty = Database::get_main_table(SepePlugin::TABLE_SEPE_PARTICIPANTS_SPECIALTY);
$tableSepeParticipantsSpecialtyTutorials = Database::get_main_table(SepePlugin::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS);
$tableSepeCourseActions = Database::get_main_table(SepePlugin::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);
$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 getInfoIdentificationData()
{
global $tableSepeCenter;
$sql = "SELECT * FROM $tableSepeCenter;";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
$row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
$row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
$row['center_name'] = Security::remove_XSS(stripslashes($row['center_name']));
$row['url'] = Security::remove_XSS(stripslashes($row['url']));
$row['tracking_url'] = Security::remove_XSS(stripslashes($row['tracking_url']));
$row['phone'] = Security::remove_XSS(stripslashes($row['phone']));
$row['mail'] = Security::remove_XSS(stripslashes($row['mail']));
} else {
$row = false;
}
return $row;
}
function checkIdentificationData()
{
global $tableSepeCenter;
$sql = "SELECT 1 FROM $tableSepeCenter;";
$result = Database::query($sql);
if (Database::affected_rows($result) > 0) {
return true;
}
return false;
}
function getActionId($courseId)
{
global $tableSepeCourseActions;
$courseId = (int) $courseId;
$sql = "SELECT action_id FROM $tableSepeCourseActions WHERE course_id = $courseId";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['action_id'];
}
function getCourse($actionId)
{
global $tableSepeCourseActions;
$actionId = (int) $actionId;
$sql = "SELECT course_id FROM $tableSepeCourseActions WHERE action_id = $actionId";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['course_id'];
}
function getCourseCode($actionId)
{
global $tableCourse;
$actionId = (int) $actionId;
$courseId = getCourse($actionId);
$sql = "SELECT code FROM $tableCourse WHERE id = $courseId";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['code'];
}
function getActionInfo($id)
{
global $tableSepeActions;
$id = (int) $id;
$sql = "SELECT * FROM $tableSepeActions WHERE id = $id";
$res = Database::query($sql);
$row = false;
if (Database::num_rows($res) > 0) {
$row['action_origin'] = Security::remove_XSS(stripslashes($row['action_origin']));
$row['action_code'] = Security::remove_XSS(stripslashes($row['action_code']));
$row['situation'] = Security::remove_XSS(stripslashes($row['situation']));
$row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
$row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
$row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
$row['full_itinerary_indicator'] = Security::remove_XSS(stripslashes($row['full_itinerary_indicator']));
$row['financing_type'] = Security::remove_XSS(stripslashes($row['financing_type']));
$row['action_name'] = Security::remove_XSS(stripslashes($row['action_name']));
$row['global_info'] = Security::remove_XSS(stripslashes($row['global_info']));
$row['schedule'] = Security::remove_XSS(stripslashes($row['schedule']));
$row['requirements'] = Security::remove_XSS(stripslashes($row['requirements']));
$row['contact_action'] = Security::remove_XSS(stripslashes($row['contact_action']));
$row = Database::fetch_assoc($res);
}
return $row;
}
function getSpecialtActionInfo($specialtyId)
{
global $tableSepeSpecialty;
$specialtyId = (int) $specialtyId;
$sql = "SELECT * FROM $tableSepeSpecialty WHERE id = $specialtyId";
$res = Database::query($sql);
$row = false;
if (Database::num_rows($res) > 0) {
$row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
$row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
$row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
$row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
$row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
$row['modality_impartition'] = Security::remove_XSS(stripslashes($row['modality_impartition']));
$row = Database::fetch_assoc($res);
}
return $row;
}
function getInfoSpecialtyClassroom($classroomId)
{
global $tableSepeSpecialtyClassroom;
global $tableCenters;
$classroomId = (int) $classroomId;
$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);
$row = false;
if (Database::num_rows($res) > 0) {
$row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
$row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
$row = Database::fetch_assoc($res);
}
return $row;
}
function getInfoSpecialtyTutorial($tutorialId)
{
global $tableSepeParticipantsSpecialtyTutorials;
$tutorialId = (int) $tutorialId;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE id = $tutorialId";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
} else {
$row = false;
}
return $row;
}
function list_tutor($specialtyId)
{
global $tableSepeSpecialtyTutors;
$specialtyId = (int) $specialtyId;
$sql = "SELECT * FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
} else {
$row = false;
}
return $row;
}
function getCentersList()
{
global $tableCenters;
$sql = "SELECT * FROM $tableCenters;";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
function listTutorType($condition)
{
global $tableTutorCompany;
$condition = Database::escape_string($condition);
$sql = "SELECT * FROM $tableTutorCompany WHERE ".$condition." ORDER BY alias ASC, document_number ASC;";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
$tmp = [];
$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['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
}
$aux[] = $tmp;
}
return $aux;
}
function getTutorsSpecialty($specialtyId)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
global $tableUser;
$specialtyId = (int) $specialtyId;
$sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
$rs = Database::query($sql);
$tutorsList = [];
while ($tmp = Database::fetch_assoc($rs)) {
$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.platform_user_id=b.user_id;";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
if (!in_array($row['id'], $tutorsList)) {
$tutor = [];
$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['data'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
}
$aux[] = $tutor;
}
}
return $aux;
}
function getInfoSpecialtyTutor($tutorId)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
$tutorId = (int) $tutorId;
$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);
if (Database::num_rows($res) > 0) {
$row['tutor_accreditation'] = Security::remove_XSS(stripslashes($row['tutor_accreditation']));
$row['teaching_competence'] = Security::remove_XSS(stripslashes($row['teaching_competence']));
$row['training_teleforming'] = Security::remove_XSS(stripslashes($row['training_teleforming']));
$row = Database::fetch_assoc($res);
} else {
$row = false;
}
return $row;
}
function freeTeacherList($teacherList, $specialtyId, $platform_user_id)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
$specialtyId = (int) $specialtyId;
$platform_user_id = (int) $platform_user_id;
$sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
while ($aux = Database::fetch_assoc($rs)) {
$sql = "SELECT platform_user_id FROM $tableSepeTutors WHERE id='".$aux['tutor_id']."';";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$tmp = Database::fetch_assoc($res);
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 $teacherList;
}
function getInfoParticipantAction($participantId)
{
global $tableSepeParticipants;
$participantId = (int) $participantId;
$sql = "SELECT * FROM $tableSepeParticipants WHERE id = $participantId";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
$result = [];
$result['id'] = $row[''];
$result['action_id'] = $row['action_id'];
$result['company_tutor_id'] = $row['company_tutor_id'];
$result['training_tutor_id'] = $row['training_tutor_id'];
$result['platform_user_id'] = $row['platform_user_id'];
$result['document_type'] = Security::remove_XSS(stripslashes($row['document_type']));
$result['document_number'] = Security::remove_XSS(stripslashes($row['document_number']));
$result['document_letter'] = Security::remove_XSS(stripslashes($row['document_letter']));
$result['key_competence'] = Security::remove_XSS(stripslashes($row['key_competence']));
$result['contract_id'] = Security::remove_XSS(stripslashes($row['contract_id']));
$result['company_fiscal_number'] = Security::remove_XSS(stripslashes($row['company_fiscal_number']));
} else {
$result = false;
}
return $result;
}
function getParticipantId($id)
{
global $tableSepeParticipantsSpecialty;
$id = (int) $id;
$sql = "SELECT participant_id FROM $tableSepeParticipantsSpecialty WHERE id = $id";
$rs = Database::query($sql);
$aux = Database::fetch_assoc($rs);
return $aux['participant_id'];
}
function getInfoSpecialtyParticipant($specialtyId)
{
global $tableSepeParticipantsSpecialty;
$specialtyId = (int) $specialtyId;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE id = $specialtyId";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$row = Database::fetch_assoc($res);
$row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
$row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
$row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
$row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
$row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
$row['final_result'] = Security::remove_XSS(stripslashes($row['final_result']));
$row['final_qualification'] = Security::remove_XSS(stripslashes($row['final_qualification']));
$row['final_score'] = Security::remove_XSS(stripslashes($row['final_score']));
} else {
$row = false;
}
return $row;
}
function specialtyList($actionId)
{
global $tableSepeSpecialty;
$actionId = (int) $actionId;
$sql = "SELECT id, specialty_origin, professional_area, specialty_code
FROM $tableSepeSpecialty
WHERE action_id = $actionId";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
function participantList($actionId)
{
global $tableSepeParticipants;
global $tableUser;
$actionId = (int) $actionId;
$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 = [];
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
function listParticipantSpecialty($participantId)
{
global $tableSepeParticipantsSpecialty;
$participantId = (int) $participantId;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE participant_id = $participantId";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
$row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
$row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
$row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
$row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
$row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
$row['final_result'] = Security::remove_XSS(stripslashes($row['final_result']));
$row['final_qualification'] = Security::remove_XSS(stripslashes($row['final_qualification']));
$row['final_score'] = Security::remove_XSS(stripslashes($row['final_score']));
$aux[] = $row;
}
return $aux;
}
function classroomList($specialtyId)
{
global $tableSepeSpecialtyClassroom;
global $tableCenters;
$specialtyId = (int) $specialtyId;
$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 = [];
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
function tutorsList($specialtyId)
{
global $tableSepeSpecialtyTutors;
global $tableSepeTutors;
global $tableUser;
$specialtyId = (int) $specialtyId;
$aux = [];
$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;
}
function getListSpecialtyTutorial($specialtyId)
{
global $tableSepeParticipantsSpecialtyTutorials;
$specialtyId = (int) $specialtyId;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials
WHERE participant_specialty_id = $specialtyId";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
$row['tutor_accreditation'] = Security::remove_XSS(stripslashes($row['tutor_accreditation']));
$row['teaching_competence'] = Security::remove_XSS(stripslashes($row['teaching_competence']));
$row['training_teleforming'] = Security::remove_XSS(stripslashes($row['training_teleforming']));
$aux[] = $row;
}
return $aux;
}
function listCourseAction()
{
global $tableSepeActions;
global $tableSepeCourseActions;
$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.course_id=course.id
AND $tableSepeActions.id=$tableSepeCourseActions.action_id";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
function listCourseFree()
{
global $tableCourse;
global $tableSepeCourseActions;
$sql = "SELECT id, title FROM $tableCourse
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions
WHERE $tableCourse.id = $tableSepeCourseActions.course_id)
;";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$aux[] = $row;
}
return $aux;
}
function listActionFree()
{
global $tableSepeActions;
global $tableSepeCourseActions;
$sql = "SELECT id, action_origin, action_code FROM $tableSepeActions
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions WHERE $tableSepeActions.id = $tableSepeCourseActions.action_id)
;";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
$row['action_origin'] = Security::remove_XSS(stripslashes($row['action_origin']));
$row['action_code'] = Security::remove_XSS(stripslashes($row['action_code']));
$aux[] = $row;
}
return $aux;
}
function getSpecialtyTutorId($specialtyId, $tutorId)
{
global $tableSepeSpecialtyTutors;
$specialtyId = (int) $specialtyId;
$tutorId = (int) $tutorId;
$sql = "SELECT id
FROM $tableSepeSpecialtyTutors
WHERE specialty_id = $specialtyId AND tutor_id = $tutorId";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
return $row['id'];
}
function checkInsertNewLog($platformUserId, $actionId)
{
global $tableSepeLogParticipant;
$platformUserId = (int) $platformUserId;
$actionId = (int) $actionId;
$sql = "SELECT * FROM $tableSepeLogParticipant
WHERE platform_user_id = $platformUserId AND action_id = $actionId";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
return false;
} else {
return true;
}
}
function getUserPlatformFromParticipant($participantId)
{
global $tableSepeParticipants;
$participantId = (int) $participantId;
$sql = "SELECT * FROM $tableSepeParticipants WHERE id = $participantId";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
if ($row['platform_user_id'] == 0 || $row['platform_user_id'] == '') {
return false;
} else {
return $row['platform_user_id'];
}
}

View File

@@ -0,0 +1,557 @@
<?php
/* For license terms, see /license.txt */
/**
* Plugin class for the SEPE plugin.
*
* @package chamilo.plugin.sepe
*
* @author Jose Angel Ruiz <jaruiz@nosolored.com>
* @author Julio Montoya <gugli100@gmail.com>
*/
class SepePlugin extends Plugin
{
public const TABLE_SEPE_CENTER = 'plugin_sepe_center';
public const TABLE_SEPE_ACTIONS = 'plugin_sepe_actions';
public const TABLE_SEPE_SPECIALTY = 'plugin_sepe_specialty';
public const TABLE_SEPE_SPECIALTY_CLASSROOM = 'plugin_sepe_specialty_classroom';
public const TABLE_SEPE_CENTERS = 'plugin_sepe_centers';
public const TABLE_SEPE_TUTORS = 'plugin_sepe_tutors';
public const TABLE_SEPE_SPECIALTY_TUTORS = 'plugin_sepe_specialty_tutors';
public const TABLE_SEPE_PARTICIPANTS = 'plugin_sepe_participants';
public const TABLE_SEPE_PARTICIPANTS_SPECIALTY = 'plugin_sepe_participants_specialty';
public const TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS = 'plugin_sepe_participants_specialty_tutorials';
public const TABLE_SEPE_COURSE_ACTIONS = 'plugin_sepe_course_actions';
public const TABLE_SEPE_TUTORS_COMPANY = 'plugin_sepe_tutors_company';
public const TABLE_SEPE_TEACHING_COMPETENCE = 'plugin_sepe_teaching_competence';
public const TABLE_SEPE_LOG_PARTICIPANT = 'plugin_sepe_log_participant';
public const TABLE_SEPE_LOG_MOD_PARTICIPANT = 'plugin_sepe_log_mod_participant';
public const TABLE_SEPE_LOG = 'plugin_sepe_log';
public $isAdminPlugin = true;
protected function __construct()
{
parent::__construct(
'2.1',
'
Jose Angel Ruiz - NoSoloRed (original author) <br>
Julio Montoya (SOAP integration)
',
['sepe_enable' => 'boolean']
);
}
/**
* @return SepePlugin
*/
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
}
/**
* This method creates the tables required to this plugin.
*/
public function install()
{
$tablesToBeCompared = [
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();
$sm = $cn->getSchemaManager();
$tables = $sm->tablesExist($tablesToBeCompared);
if (empty($tables)) {
return false;
}
require_once api_get_path(SYS_PLUGIN_PATH).'sepe/database.php';
}
/**
* This method drops the plugin tables.
*/
public function uninstall()
{
$tablesToBeDeleted = [
self::TABLE_SEPE_CENTER,
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) {
$table = Database::get_main_table($tableToBeDeleted);
$sql = "DROP TABLE IF EXISTS $table";
Database::query($sql);
}
$this->manageTab(false);
}
/**
* Update.
*/
public 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 NULL";
Database::query($sql);
$sql = "ALTER TABLE ".$sepeParticipantTable."
CHANGE `cod_tutor_formacion` `training_tutor_id` INT( 10 ) UNSIGNED NULL";
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);
}
}

View File

@@ -0,0 +1,241 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty action edit form.
*/
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$specialtyOrigin = Database::escape_string(trim($_POST['specialty_origin']));
$professionalArea = Database::escape_string(trim($_POST['professional_area']));
$specialtyCode = Database::escape_string(trim($_POST['specialty_code']));
$centerOrigin = Database::escape_string(trim($_POST['center_origin']));
$centerCode = Database::escape_string(trim($_POST['center_code']));
$dayStart = Database::escape_string(trim($_POST['day_start']));
$monthStart = Database::escape_string(trim($_POST['month_start']));
$yearStart = Database::escape_string(trim($_POST['year_start']));
$dayEnd = Database::escape_string(trim($_POST['day_end']));
$monthEnd = Database::escape_string(trim($_POST['month_end']));
$yearEnd = Database::escape_string(trim($_POST['year_end']));
$modality_impartition = Database::escape_string(trim($_POST['modality_impartition']));
$classroomHours = Database::escape_string(trim($_POST['classroom_hours']));
$distanceHours = intval($_POST['distance_hours']);
$morningsParticipantsNumber = intval($_POST['mornings_participants_number']);
$morningsAccessNumber = intval($_POST['mornings_access_number']);
$morningTotalDuration = intval($_POST['morning_total_duration']);
$afternoonParticipantsNumber = intval($_POST['afternoon_participants_number']);
$afternoonAccessNumber = intval($_POST['afternoon_access_number']);
$afternoonTotalDuration = intval($_POST['afternoon_total_duration']);
$nightParticipantsNumber = intval($_POST['night_participants_number']);
$nightAccessNumber = intval($_POST['night_access_number']);
$nightTotalDuration = intval($_POST['night_total_duration']);
$attendeesCount = intval($_POST['attendees_count']);
$learningActivityCount = intval($_POST['learning_activity_count']);
$attemptCount = intval($_POST['attempt_count']);
$evaluationActivityCount = intval($_POST['evaluation_activity_count']);
$actionId = intval($_POST['action_id']);
$specialtyId = intval($_POST['specialty_id']);
$newSpecialty = intval($_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) {
$_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 = intval($_POST['action_id']);
$specialtyId = intval($_POST['specialty_id']);
$newSpecialty = intval($_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(intval($_GET['action_id']));
$interbreadcrumb[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = [
"url" => "formative-actions-list.php",
"name" => $plugin->get_lang('FormativesActionsList'),
];
$interbreadcrumb[] = [
"url" => "formative-action.php?cid=".$id_course,
"name" => $plugin->get_lang('FormativeAction'),
];
if (isset($_GET['new_specialty']) && intval($_GET['new_specialty']) == 1) {
$templateName = $plugin->get_lang('NewSpecialtyAccion');
$tpl = new Template($templateName);
$tpl->assign('action_id', intval($_GET['action_id']));
$info = [];
$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', intval($_GET['action_id']));
$info = getSpecialtActionInfo(intval($_GET['specialty_id']));
$tpl->assign('info', $info);
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != null) {
$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', intval($_GET['specialty_id']));
$listClassroom = classroomList(intval($_GET['specialty_id']));
$tpl->assign('listClassroom', $listClassroom);
$listTutors = tutorsList(intval($_GET['specialty_id']));
$tpl->assign('listTutors', $listTutors);
}
$yearList = [];
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));
exit;
}

View File

@@ -0,0 +1,131 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty classroom edit form.
*/
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$sltCentersExists = intval($_POST['slt_centers_exists']);
$specialtyId = intval($_POST['specialty_id']);
$existsCenterId = intval($_POST['exists_center_id']);
$centerOrigin = Database::escape_string(trim($_POST['center_origin']));
$centerCode = Database::escape_string(trim($_POST['center_code']));
$newClassroom = intval($_POST['new_classroom']);
$actionId = intval($_POST['action_id']);
$classroomId = intval($_POST['classroom_id']);
if ($sltCentersExists == 1) {
$sql = "INSERT INTO $tableSepeSpecialtyClassroom (specialty_id, center_id)
VALUES ($specialtyId, $existsCenterId);";
$res = Database::query($sql);
if (!$res) {
$_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 = [
'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) {
$_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);
exit;
} else {
$newClassroom = intval($_POST['new_classroom']);
$actionId = intval($_POST['action_id']);
$classroomId = intval($_POST['classroom_id']);
$specialtyId = intval($_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);
exit;
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$courseId = getCourse($_GET['action_id']);
$interbreadcrumb[] = ["url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe')];
$interbreadcrumb[] = ["url" => "formative-actions-list.php", "name" => $plugin->get_lang('FormativesActionsList')];
$interbreadcrumb[] = ["url" => "formative-action.php?cid=".$courseId, "name" => $plugin->get_lang('FormativeAction')];
$interbreadcrumb[] = ["url" => "specialty-action-edit.php?new_specialty=0&specialty_id=".intval($_GET['specialty_id'])."&action_id=".intval($_GET['action_id']), "name" => $plugin->get_lang('SpecialtyFormativeAction')];
if (isset($_GET['new_classroom']) && intval($_GET['new_classroom']) == 1) {
$templateName = $plugin->get_lang('NewSpecialtyClassroom');
$tpl = new Template($templateName);
$tpl->assign('action_id', intval($_GET['action_id']));
$tpl->assign('specialty_id', intval($_GET['specialty_id']));
$info = [];
$tpl->assign('info', $info);
$tpl->assign('new_classroom', '1');
} else {
$templateName = $plugin->get_lang('EditSpecialtyClassroom');
$tpl = new Template($templateName);
$tpl->assign('action_id', intval($_GET['action_id']));
$tpl->assign('specialty_id', intval($_GET['specialty_id']));
$tpl->assign('classroom_id', intval($_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));
exit;
}

View File

@@ -0,0 +1,232 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty tutors edit form.
*/
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$sltUserExists = intval($_POST['slt_user_exists']);
$existingTutor = intval($_POST['existingTutor']);
$specialtyId = intval($_POST['specialty_id']);
$tutorAccreditation = Database::escape_string(trim($_POST['tutor_accreditation']));
$professionalExperience = intval($_POST['professional_experience']);
$teachingCompetence = Database::escape_string(trim($_POST['teaching_competence']));
$experienceTeleforming = intval($_POST['experience_teleforming']);
$trainingTeleforming = Database::escape_string(trim($_POST['training_teleforming']));
$specialtyTutorId = intval($_POST['specialtyTutorId']);
$documentType = Database::escape_string(trim($_POST['document_type']));
$documentNumber = Database::escape_string(trim($_POST['document_number']));
$documentLetter = Database::escape_string(trim($_POST['document_letter']));
$actionId = intval($_POST['action_id']);
$newTutor = intval($_POST['new_tutor']);
$platformUserId = intval($_POST['platform_user_id']);
if ($sltUserExists == 1) {
$sql = "SELECT * FROM $tableSepeTutors WHERE id = $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) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
}
$newTutor = 0; //Reset variable, no create new tutor, exists tutor
$tutorId = $aux['id'];
$specialtyTutorId = getSpecialtyTutorId($specialtyId, $tutorId);
} 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) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
$tutorId = Database::insert_id();
}
}
if (isset($newTutor) && $newTutor != 1) {
$sql = "UPDATE $tableSepeSpecialtyTutors SET
tutor_id = $tutorId,
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,
$tutorId,
'".$tutorAccreditation."',
$professionalExperience,
'".$teachingCompetence."',
$experienceTeleforming,
'".$trainingTeleforming."'
);";
}
$res = Database::query($sql);
if (!$res) {
$_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
} else {
if ($newTutor == 1) {
$tutorId = 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);
exit;
} else {
$actionId = intval($_POST['action_id']);
$newTutor = intval($_POST['new_tutor']);
$specialtyId = intval($_POST['specialty_id']);
$specialtyTutorId = intval($_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);
exit;
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$actionId = (int) $_GET['action_id'];
$specialtyId = (int) $_GET['specialty_id'];
$courseId = getCourse($actionId);
$interbreadcrumb[] = [
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
];
$interbreadcrumb[] = ["url" => "formative-actions-list.php", "name" => $plugin->get_lang('FormativesActionsList')];
$interbreadcrumb[] = [
"url" => "formative-action.php?cid=".$courseId,
"name" => $plugin->get_lang('FormativeAction'),
];
$interbreadcrumb[] = [
"url" => "specialty-action-edit.php?new_specialty=0&specialty_id=".$specialtyId."&action_id=".$actionId,
"name" => $plugin->get_lang('SpecialtyFormativeAction'),
];
if (isset($_GET['new_tutor']) && intval($_GET['new_tutor']) == 1) {
$templateName = $plugin->get_lang('NewSpecialtyTutor');
$tpl = new Template($templateName);
$tpl->assign('action_id', $actionId);
$tpl->assign('specialty_id', $specialtyId);
$info = [];
$tpl->assign('info', $info);
$tpl->assign('new_tutor', '1');
$platformUserId = '';
} else {
$templateName = $plugin->get_lang('EditSpecialtyTutor');
$tpl = new Template($templateName);
$tpl->assign('action_id', $actionId);
$tpl->assign('specialty_id', $specialtyId);
$tpl->assign('tutor_id', intval($_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));
exit;
}

View File

@@ -0,0 +1,158 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script displays a specialty tutorial edit form.
*/
require_once '../config.php';
$course_plugin = 'sepe';
$plugin = SepePlugin::create();
$_cid = 0;
if (!empty($_POST)) {
$check = Security::check_token('post');
if ($check) {
$centerOrigin = Database::escape_string(trim($_POST['center_origin']));
$centerCode = Database::escape_string(trim($_POST['center_code']));
$dayStart = Database::escape_string(trim($_POST['day_start']));
$monthStart = Database::escape_string(trim($_POST['month_start']));
$yearStart = Database::escape_string(trim($_POST['year_start']));
$dayEnd = Database::escape_string(trim($_POST['day_end']));
$monthEnd = Database::escape_string(trim($_POST['month_end']));
$yearEnd = Database::escape_string(trim($_POST['year_end']));
$tutorialId = intval($_POST['tutorial_id']);
$actionId = intval($_POST['action_id']);
$specialtyId = intval($_POST['specialty_id']);
$newTutorial = intval($_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) {
$_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);
exit;
} else {
$tutorialId = intval($_POST['tutorial_id']);
$actionId = intval($_POST['action_id']);
$specialtyId = intval($_POST['specialty_id']);
$newTutorial = intval($_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);
exit;
}
} else {
$token = Security::get_token();
}
if (api_is_platform_admin()) {
$courseId = getCourse(intval($_GET['action_id']));
$participantId = getParticipantId(intval($_GET['specialty_id']));
$interbreadcrumb[] = ["url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe')];
$interbreadcrumb[] = ["url" => "formative-actions-list.php", "name" => $plugin->get_lang('FormativesActionsList')];
$interbreadcrumb[] = ["url" => "formative-action.php?cid=".$courseId, "name" => $plugin->get_lang('FormativeAction')];
$interbreadcrumb[] = ["url" => "participant-specialty-edit.php?new_specialty=0&participant_id=".$participantId."&specialty_id=".intval($_GET['specialty_id'])."&action_id=".intval($_GET['action_id']), "name" => $plugin->get_lang('SpecialtyFormativeParcipant')];
if (isset($_GET['new_tutorial']) && intval($_GET['new_tutorial']) == 1) {
$templateName = $plugin->get_lang('new_tutorial');
$tpl = new Template($templateName);
$tpl->assign('action_id', intval($_GET['action_id']));
$tpl->assign('specialty_id', intval($_GET['specialty_id']));
$info = [];
$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', intval($_GET['action_id']));
$tpl->assign('specialty_id', intval($_GET['specialty_id']));
$tpl->assign('tutorial_id', intval($_GET['tutorial_id']));
$info = getInfoSpecialtyTutorial(intval($_GET['tutorial_id']));
$tpl->assign('info', $info);
$tpl->assign('new_tutorial', '0');
if ($info['start_date'] != '0000-00-00' && $info['start_date'] != null) {
$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 = [];
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));
exit;
}

View File

@@ -0,0 +1,204 @@
<?php
/**
* soap-server-wsse.php
*
* Copyright (c) 2007, Robert Richards <rrichards@ctindustries.net>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Robert Richards nor the names of his
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @author Robert Richards <rrichards@ctindustries.net>
* @copyright 2007 Robert Richards <rrichards@ctindustries.net>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version 1.0.0
*/
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecurityKey;
/**
* Class WSSESoapServer
*/
class WSSESoapServer
{
const WSSENS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
const WSSENS_2003 = 'http://schemas.xmlsoap.org/ws/2003/06/secext';
const WSUNS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd';
const WSSEPFX = 'wsse';
const WSUPFX = 'wsu';
private $soapNS, $soapPFX;
private $soapDoc = null;
private $envelope = null;
private $SOAPXPath = null;
private $secNode = null;
public $signAllHeaders = false;
private function locateSecurityHeader($setActor = null)
{
$wsNamespace = null;
if ($this->secNode == null) {
$secnode = null;
$headers = $this->SOAPXPath->query('//wssoap:Envelope/wssoap:Header');
if ($header = $headers->item(0)) {
$secnodes = $this->SOAPXPath->query('./*[local-name()="Security"]', $header);
foreach ($secnodes as $node) {
$nsURI = $node->namespaceURI;
if (($nsURI == self::WSSENS) || ($nsURI == self::WSSENS_2003)) {
$actor = $node->getAttributeNS($this->soapNS, 'actor');
if (empty($actor) || ($actor == $setActor)) {
$secnode = $node;
$wsNamespace = $nsURI;
break;
}
}
}
}
$this->secNode = $secnode;
}
return $wsNamespace;
}
public function __construct($doc)
{
$this->soapDoc = $doc;
$this->envelope = $doc->documentElement;
$this->soapNS = $this->envelope->namespaceURI;
$this->soapPFX = $this->envelope->prefix;
$this->SOAPXPath = new DOMXPath($doc);
$this->SOAPXPath->registerNamespace('wssoap', $this->soapNS);
$this->SOAPXPath->registerNamespace('wswsu', self::WSUNS);
$wsNamespace = $this->locateSecurityHeader();
if (!empty($wsNamespace)) {
$this->SOAPXPath->registerNamespace('wswsse', $wsNamespace);
}
}
public function processSignature($refNode)
{
$objXMLSecDSig = new XMLSecurityDSig();
$objXMLSecDSig->idKeys[] = 'wswsu:Id';
$objXMLSecDSig->idNS['wswsu'] = self::WSUNS;
$objXMLSecDSig->sigNode = $refNode;
/* Canonicalize the signed info */
$objXMLSecDSig->canonicalizeSignedInfo();
$retVal = $objXMLSecDSig->validateReference();
if (!$retVal) {
throw new Exception("Validation Failed");
}
$key = null;
$objKey = $objXMLSecDSig->locateKey();
if ($objKey) {
if ($objKeyInfo = XMLSecEnc::staticLocateKeyInfo($objKey, $refNode)) {
/* Handle any additional key processing such as encrypted keys here */
}
}
if (empty($objKey)) {
throw new Exception("Error loading key to handle Signature");
}
do {
if (empty($objKey->key)) {
$this->SOAPXPath->registerNamespace('xmlsecdsig', XMLSecurityDSig::XMLDSIGNS);
$query = "./xmlsecdsig:KeyInfo/wswsse:SecurityTokenReference/wswsse:Reference";
$nodeset = $this->SOAPXPath->query($query, $refNode);
if ($encmeth = $nodeset->item(0)) {
if ($uri = $encmeth->getAttribute("URI")) {
$arUrl = parse_url($uri);
if (empty($arUrl['path']) && ($identifier = $arUrl['fragment'])) {
$query = '//wswsse:BinarySecurityToken[@wswsu:Id="'.$identifier.'"]';
$nodeset = $this->SOAPXPath->query($query);
if ($encmeth = $nodeset->item(0)) {
$x509cert = $encmeth->textContent;
$x509cert = str_replace(array("\r", "\n"), "", $x509cert);
$x509cert = "-----BEGIN CERTIFICATE-----\n".chunk_split($x509cert, 64, "\n")."-----END CERTIFICATE-----\n";
$objKey->loadKey($x509cert);
break;
}
}
}
}
throw new Exception("Error loading key to handle Signature");
}
} while(0);
if (! $objXMLSecDSig->verify($objKey)) {
throw new Exception("Unable to validate Signature");
}
return true;
}
public function process()
{
if (empty($this->secNode)) {
return;
}
$node = $this->secNode->firstChild;
while ($node) {
$nextNode = $node->nextSibling;
switch ($node->localName) {
case "Signature":
if ($this->processSignature($node)) {
if ($node->parentNode) {
$node->parentNode->removeChild($node);
}
} else {
/* throw fault */
return false;
}
}
$node = $nextNode;
}
$this->secNode->parentNode->removeChild($this->secNode);
$this->secNode = null;
return true;
}
public function saveXML()
{
return $this->soapDoc->saveXML();
}
public function save($file)
{
return $this->soapDoc->save($file);
}
}

View File

@@ -0,0 +1,168 @@
<?php
/**
* soap-wsa.php
*
* Copyright (c) 2007, Robert Richards <rrichards@ctindustries.net>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Robert Richards nor the names of his
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @author Robert Richards <rrichards@ctindustries.net>
* @copyright 2007 Robert Richards <rrichards@ctindustries.net>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version 1.0.0
*/
/**
* Class WSASoap
*/
class WSASoap
{
const WSANS = 'http://schemas.xmlsoap.org/ws/2004/08/addressing';
const WSAPFX = 'wsa';
private $soapNS, $soapPFX;
private $soapDoc = null;
private $envelope = null;
private $SOAPXPath = null;
private $header = null;
private $messageID = null;
private function locateHeader()
{
if ($this->header == null) {
$headers = $this->SOAPXPath->query('//wssoap:Envelope/wssoap:Header');
$header = $headers->item(0);
if (!$header) {
$header = $this->soapDoc->createElementNS($this->soapNS, $this->soapPFX.':Header');
$this->envelope->insertBefore($header, $this->envelope->firstChild);
}
$this->header = $header;
}
return $this->header;
}
public function __construct($doc)
{
$this->soapDoc = $doc;
$this->envelope = $doc->documentElement;
$this->soapNS = $this->envelope->namespaceURI;
$this->soapPFX = $this->envelope->prefix;
$this->SOAPXPath = new DOMXPath($doc);
$this->SOAPXPath->registerNamespace('wssoap', $this->soapNS);
$this->SOAPXPath->registerNamespace('wswsa', self::WSANS);
$this->envelope->setAttributeNS("http://www.w3.org/2000/xmlns/", 'xmlns:'.self::WSAPFX, self::WSANS);
$this->locateHeader();
}
public function addAction($action)
{
/* Add the WSA Action */
$header = $this->locateHeader();
$nodeAction = $this->soapDoc->createElementNS(self::WSANS, self::SAPFX.':Action', $action);
$header->appendChild($nodeAction);
}
public function addTo($location)
{
/* Add the WSA To */
$header = $this->locateHeader();
$nodeTo = $this->soapDoc->createElementNS(WSASoap::WSANS, WSASoap::WSAPFX.':To', $location);
$header->appendChild($nodeTo);
}
private function createID()
{
$uuid = md5(uniqid(rand(), true));
$guid = 'uudi:'.substr($uuid, 0, 8)."-".
substr($uuid, 8, 4)."-".
substr($uuid, 12, 4)."-".
substr($uuid, 16, 4)."-".
substr($uuid, 20, 12);
return $guid;
}
public function addMessageID($id = null)
{
/* Add the WSA MessageID or return existing ID */
if (!is_null($this->messageID)) {
return $this->messageID;
}
if (empty($id)) {
$id = $this->createID();
}
$header = $this->locateHeader();
$nodeID = $this->soapDoc->createElementNS(self::WSANS, self::WSAPFX.':MessageID', $id);
$header->appendChild($nodeID);
$this->messageID = $id;
}
public function addReplyTo($address = null)
{
/* Create Message ID is not already added - required for ReplyTo */
if (is_null($this->messageID)) {
$this->addMessageID();
}
/* Add the WSA ReplyTo */
$header = $this->locateHeader();
$nodeReply = $this->soapDoc->createElementNS(self::WSANS, self::WSAPFX.':ReplyTo');
$header->appendChild($nodeReply);
if (empty($address)) {
$address = 'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous';
}
$nodeAddress = $this->soapDoc->createElementNS(self::WSANS, self::WSAPFX.':Address', $address);
$nodeReply->appendChild($nodeAddress);
}
public function getDoc()
{
return $this->soapDoc;
}
public function saveXML()
{
return $this->soapDoc->saveXML();
}
public function save($file)
{
return $this->soapDoc->save($file);
}
}

View File

@@ -0,0 +1,540 @@
<?php
/**
* soap-wsse.php
*
* Copyright (c) 2010, Robert Richards <rrichards@ctindustries.net>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Robert Richards nor the names of his
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @author Robert Richards <rrichards@ctindustries.net>
* @copyright 2007-2010 Robert Richards <rrichards@ctindustries.net>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version 1.1.0-dev
*/
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecurityKey;
/**
* Class WSSESoap
*/
class WSSESoap
{
const WSSENS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
const WSUNS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd';
const WSUNAME = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0';
const WSSEPFX = 'wsse';
const WSUPFX = 'wsu';
private $soapNS, $soapPFX;
private $soapDoc = null;
private $envelope = null;
private $SOAPXPath = null;
private $secNode = null;
public $signAllHeaders = false;
private function locateSecurityHeader($bMustUnderstand = true, $setActor = null)
{
if ($this->secNode == null) {
$headers = $this->SOAPXPath->query('//wssoap:Envelope/wssoap:Header');
$header = $headers->item(0);
if (!$header) {
$header = $this->soapDoc->createElementNS($this->soapNS, $this->soapPFX.':Header');
$this->envelope->insertBefore($header, $this->envelope->firstChild);
}
$secnodes = $this->SOAPXPath->query('./wswsse:Security', $header);
$secnode = null;
foreach ($secnodes as $node) {
$actor = $node->getAttributeNS($this->soapNS, 'actor');
if ($actor == $setActor) {
$secnode = $node;
break;
}
}
if (!$secnode) {
$secnode = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':Security');
///if (isset($secnode) && !empty($secnode)) {
$header->appendChild($secnode);
//}
if ($bMustUnderstand) {
$secnode->setAttributeNS($this->soapNS, $this->soapPFX.':mustUnderstand', '1');
}
if (! empty($setActor)) {
$ename = 'actor';
if ($this->soapNS == 'http://www.w3.org/2003/05/soap-envelope') {
$ename = 'role';
}
$secnode->setAttributeNS($this->soapNS, $this->soapPFX.':'.$ename, $setActor);
}
}
$this->secNode = $secnode;
}
return $this->secNode;
}
public function __construct($doc, $bMustUnderstand = true, $setActor = null)
{
$this->soapDoc = $doc;
$this->envelope = $doc->documentElement;
$this->soapNS = $this->envelope->namespaceURI;
$this->soapPFX = $this->envelope->prefix;
$this->SOAPXPath = new DOMXPath($doc);
$this->SOAPXPath->registerNamespace('wssoap', $this->soapNS);
$this->SOAPXPath->registerNamespace('wswsse', self::WSSENS);
$this->locateSecurityHeader($bMustUnderstand, $setActor);
}
public function addTimestamp($secondsToExpire = 3600)
{
/* Add the WSU timestamps */
$security = $this->locateSecurityHeader();
$timestamp = $this->soapDoc->createElementNS(self::WSUNS, self::WSUPFX.':Timestamp');
$security->insertBefore($timestamp, $security->firstChild);
$currentTime = time();
$created = $this->soapDoc->createElementNS(
self::WSUNS,
self::WSUPFX.':Created',
gmdate("Y-m-d\TH:i:s", $currentTime).'Z'
);
$timestamp->appendChild($created);
if (!is_null($secondsToExpire)) {
$expire = $this->soapDoc->createElementNS(
self::WSUNS,
self::WSUPFX.':Expires',
gmdate("Y-m-d\TH:i:s", $currentTime + $secondsToExpire).'Z'
);
$timestamp->appendChild($expire);
}
}
public function addUserToken($userName, $password = null, $passwordDigest = false)
{
if ($passwordDigest && empty($password)) {
throw new Exception("Cannot calculate the digest without a password");
}
$security = $this->locateSecurityHeader();
$token = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':UsernameToken');
$security->insertBefore($token, $security->firstChild);
$username = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':Username', $userName);
$token->appendChild($username);
/* Generate nonce - create a 256 bit session key to be used */
$objKey = new XMLSecurityKey(XMLSecurityKey::AES256_CBC);
$nonce = $objKey->generateSessionKey();
unset($objKey);
$createdate = gmdate("Y-m-d\TH:i:s").'Z';
if ($password) {
$passType = self::WSUNAME.'#PasswordText';
if ($passwordDigest) {
$password = base64_encode(sha1($nonce.$createdate.$password, true));
$passType = self::WSUNAME.'#PasswordDigest';
}
$passwordNode = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':Password', $password);
$token->appendChild($passwordNode);
$passwordNode->setAttribute('Type', $passType);
}
$nonceNode = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':Nonce', base64_encode($nonce));
$token->appendChild($nonceNode);
$created = $this->soapDoc->createElementNS(self::WSUNS, self::WSUPFX.':Created', $createdate);
$token->appendChild($created);
}
public function addBinaryToken($cert, $isPEMFormat = true, $isDSig = true)
{
$security = $this->locateSecurityHeader();
$data = XMLSecurityDSig::get509XCert($cert, $isPEMFormat);
$token = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':BinarySecurityToken', $data);
$security->insertBefore($token, $security->firstChild);
$token->setAttribute(
'EncodingType',
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary'
);
$token->setAttributeNS(self::WSUNS, self::WSUPFX.':Id', XMLSecurityDSig::generate_GUID());
$token->setAttribute(
'ValueType',
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3'
);
return $token;
}
public function attachTokentoSig($token)
{
if (!($token instanceof DOMElement)) {
throw new Exception('Invalid parameter: BinarySecurityToken element expected');
}
$objXMLSecDSig = new XMLSecurityDSig();
if ($objDSig = $objXMLSecDSig->locateSignature($this->soapDoc)) {
$tokenURI = '#'.$token->getAttributeNS(self::WSUNS, "Id");
$this->SOAPXPath->registerNamespace('secdsig', XMLSecurityDSig::XMLDSIGNS);
$query = "./secdsig:KeyInfo";
$nodeset = $this->SOAPXPath->query($query, $objDSig);
$keyInfo = $nodeset->item(0);
if (!$keyInfo) {
$keyInfo = $objXMLSecDSig->createNewSignNode('KeyInfo');
$objDSig->appendChild($keyInfo);
}
$tokenRef = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':SecurityTokenReference');
$keyInfo->appendChild($tokenRef);
$reference = $this->soapDoc->createElementNS(self::WSSENS, self::WSSEPFX.':Reference');
$reference->setAttribute("URI", $tokenURI);
$tokenRef->appendChild($reference);
} else {
throw new Exception('Unable to locate digital signature');
}
}
public function signSoapDoc($objKey, $options = null)
{
$objDSig = new XMLSecurityDSig();
$objDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
$arNodes = array();
foreach ($this->secNode->childNodes as $node) {
if ($node->nodeType == XML_ELEMENT_NODE) {
$arNodes[] = $node;
}
}
if ($this->signAllHeaders) {
foreach ($this->secNode->parentNode->childNodes as $node) {
if (($node->nodeType == XML_ELEMENT_NODE) &&
($node->namespaceURI != self::WSSENS)) {
$arNodes[] = $node;
}
}
}
foreach ($this->envelope->childNodes as $node) {
if ($node->namespaceURI == $this->soapNS && $node->localName == 'Body') {
$arNodes[] = $node;
break;
}
}
$algorithm = XMLSecurityDSig::SHA1;
if (is_array($options) && isset($options["algorithm"])) {
$algorithm = $options["algorithm"];
}
$arOptions = array('prefix' => self::WSUPFX, 'prefix_ns' => self::WSUNS);
$objDSig->addReferenceList($arNodes, $algorithm, null, $arOptions);
$objDSig->sign($objKey);
$insertTop = true;
if (is_array($options) && isset($options["insertBefore"])) {
$insertTop = (bool)$options["insertBefore"];
}
$objDSig->appendSignature($this->secNode, $insertTop);
/* New suff */
if (is_array($options)) {
if (!empty($options["KeyInfo"])) {
if (!empty($options["KeyInfo"]["X509SubjectKeyIdentifier"])) {
$sigNode = $this->secNode->firstChild->nextSibling;
$objDoc = $sigNode->ownerDocument;
$keyInfo = $sigNode->ownerDocument->createElementNS(XMLSecurityDSig::XMLDSIGNS, 'ds:KeyInfo');
$sigNode->appendChild($keyInfo);
$tokenRef = $objDoc->createElementNS(self::WSSENS, self::WSSEPFX.':SecurityTokenReference');
$keyInfo->appendChild($tokenRef);
$reference = $objDoc->createElementNS(self::WSSENS, self::WSSEPFX.':KeyIdentifier');
$reference->setAttribute(
"ValueType",
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier"
);
$reference->setAttribute(
"EncodingType",
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
);
$tokenRef->appendChild($reference);
$x509 = openssl_x509_parse($objKey->getX509Certificate());
$keyid = $x509["extensions"]["subjectKeyIdentifier"];
$arkeyid = split(":", $keyid);
$data = "";
foreach ($arkeyid as $hexchar) {
$data .= chr(hexdec($hexchar));
}
$dataNode = new DOMText(base64_encode($data));
$reference->appendChild($dataNode);
}
}
}
}
public function addEncryptedKey($node, $key, $token, $options = null)
{
if (!$key->encKey) {
return false;
}
$encKey = $key->encKey;
$security = $this->locateSecurityHeader();
$doc = $security->ownerDocument;
if (!$doc->isSameNode($encKey->ownerDocument)) {
$key->encKey = $security->ownerDocument->importNode($encKey, true);
$encKey = $key->encKey;
}
if (!empty($key->guid)) {
return true;
}
$lastToken = null;
$findTokens = $security->firstChild;
while ($findTokens) {
if ($findTokens->localName == 'BinarySecurityToken') {
$lastToken = $findTokens;
}
$findTokens = $findTokens->nextSibling;
}
if ($lastToken) {
$lastToken = $lastToken->nextSibling;
}
$security->insertBefore($encKey, $lastToken);
$key->guid = XMLSecurityDSig::generate_GUID();
$encKey->setAttribute('Id', $key->guid);
$encMethod = $encKey->firstChild;
while ($encMethod && $encMethod->localName != 'EncryptionMethod') {
$encMethod = $encMethod->nextChild;
}
if ($encMethod) {
$encMethod = $encMethod->nextSibling;
}
$objDoc = $encKey->ownerDocument;
$keyInfo = $objDoc->createElementNS('http://www.w3.org/2000/09/xmldsig#', 'dsig:KeyInfo');
$encKey->insertBefore($keyInfo, $encMethod);
$tokenRef = $objDoc->createElementNS(self::WSSENS, self::WSSEPFX.':SecurityTokenReference');
$keyInfo->appendChild($tokenRef);
/* New suff */
if (is_array($options)) {
if (!empty($options["KeyInfo"])) {
if (!empty($options["KeyInfo"]["X509SubjectKeyIdentifier"])) {
$reference = $objDoc->createElementNS(self::WSSENS, self::WSSEPFX.':KeyIdentifier');
$reference->setAttribute(
"ValueType",
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier"
);
$reference->setAttribute(
"EncodingType",
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
);
$tokenRef->appendChild($reference);
$x509 = openssl_x509_parse($token->getX509Certificate());
$keyid = $x509["extensions"]["subjectKeyIdentifier"];
$arkeyid = split(":", $keyid);
$data = "";
foreach ($arkeyid as $hexchar) {
$data .= chr(hexdec($hexchar));
}
$dataNode = new DOMText(base64_encode($data));
$reference->appendChild($dataNode);
return true;
}
}
}
$tokenURI = '#'.$token->getAttributeNS(self::WSUNS, "Id");
$reference = $objDoc->createElementNS(self::WSSENS, self::WSSEPFX.':Reference');
$reference->setAttribute("URI", $tokenURI);
$tokenRef->appendChild($reference);
return true;
}
public function AddReference($baseNode, $guid)
{
$refList = null;
$child = $baseNode->firstChild;
while ($child) {
if (($child->namespaceURI == XMLSecEnc::XMLENCNS) && ($child->localName == 'ReferenceList')) {
$refList = $child;
break;
}
$child = $child->nextSibling;
}
$doc = $baseNode->ownerDocument;
if (is_null($refList)) {
$refList = $doc->createElementNS(XMLSecEnc::XMLENCNS, 'xenc:ReferenceList');
$baseNode->appendChild($refList);
}
$dataref = $doc->createElementNS(XMLSecEnc::XMLENCNS, 'xenc:DataReference');
$refList->appendChild($dataref);
$dataref->setAttribute('URI', '#'.$guid);
}
public function EncryptBody($siteKey, $objKey, $token)
{
$enc = new XMLSecEnc();
$node = false;
foreach ($this->envelope->childNodes as $node) {
if ($node->namespaceURI == $this->soapNS && $node->localName == 'Body') {
break;
}
}
$enc->setNode($node);
/* encrypt the symmetric key */
$enc->encryptKey($siteKey, $objKey, false);
$enc->type = XMLSecEnc::Content;
/* Using the symmetric key to actually encrypt the data */
$encNode = $enc->encryptNode($objKey);
$guid = XMLSecurityDSig::generate_GUID();
$encNode->setAttribute('Id', $guid);
$refNode = $encNode->firstChild;
while ($refNode && $refNode->nodeType != XML_ELEMENT_NODE) {
$refNode = $refNode->nextSibling;
}
if ($refNode) {
$refNode = $refNode->nextSibling;
}
if ($this->addEncryptedKey($encNode, $enc, $token)) {
$this->AddReference($enc->encKey, $guid);
}
}
public function encryptSoapDoc($siteKey, $objKey, $options = null, $encryptSignature = true)
{
$enc = new XMLSecEnc();
$xpath = new DOMXPath($this->envelope->ownerDocument);
if ($encryptSignature == false) {
$nodes = $xpath->query('//*[local-name()="Body"]');
} else {
$nodes = $xpath->query('//*[local-name()="Signature"] | //*[local-name()="Body"]');
}
foreach ($nodes as $node) {
$type = XMLSecEnc::Element;
$name = $node->localName;
if ($name == "Body") {
$type = XMLSecEnc::Content;
}
$enc->addReference($name, $node, $type);
}
$enc->encryptReferences($objKey);
$enc->encryptKey($siteKey, $objKey, false);
$nodes = $xpath->query('//*[local-name()="Security"]');
$signode = $nodes->item(0);
$this->addEncryptedKey($signode, $enc, $siteKey, $options);
}
public function decryptSoapDoc($doc, $options)
{
$privKey = null;
$privKey_isFile = false;
$privKey_isCert = false;
if (is_array($options)) {
$privKey = (!empty($options["keys"]["private"]["key"]) ? $options["keys"]["private"]["key"] : null);
$privKey_isFile = (!empty($options["keys"]["private"]["isFile"]) ? true : false);
$privKey_isCert = (!empty($options["keys"]["private"]["isCert"]) ? true : false);
}
$objenc = new XMLSecEnc();
$xpath = new DOMXPath($doc);
$envns = $doc->documentElement->namespaceURI;
$xpath->registerNamespace("soapns", $envns);
$xpath->registerNamespace("soapenc", "http://www.w3.org/2001/04/xmlenc#");
$nodes = $xpath->query('/soapns:Envelope/soapns:Header/*[local-name()="Security"]/soapenc:EncryptedKey');
$references = array();
if ($node = $nodes->item(0)) {
$objenc = new XMLSecEnc();
$objenc->setNode($node);
if (!$objKey = $objenc->locateKey()) {
throw new Exception("Unable to locate algorithm for this Encrypted Key");
}
$objKey->isEncrypted = true;
$objKey->encryptedCtx = $objenc;
XMLSecEnc::staticLocateKeyInfo($objKey, $node);
if ($objKey && $objKey->isEncrypted) {
$objencKey = $objKey->encryptedCtx;
$objKey->loadKey($privKey, $privKey_isFile, $privKey_isCert);
$key = $objencKey->decryptKey($objKey);
$objKey->loadKey($key);
}
$refnodes = $xpath->query('./soapenc:ReferenceList/soapenc:DataReference/@URI', $node);
foreach ($refnodes as $reference) {
$references[] = $reference->nodeValue;
}
}
foreach ($references as $reference) {
$arUrl = parse_url($reference);
$reference = $arUrl['fragment'];
$query = '//*[@Id="'.$reference.'"]';
$nodes = $xpath->query($query);
$encData = $nodes->item(0);
if ($algo = $xpath->evaluate("string(./soapenc:EncryptionMethod/@Algorithm)", $encData)) {
$objKey = new XMLSecurityKey($algo);
$objKey->loadKey($key);
}
$objenc->setNode($encData);
$objenc->type = $encData->getAttribute("Type");
$decrypt = $objenc->decryptNode($objKey, true);
}
return true;
}
public function saveXML()
{
return $this->soapDoc->saveXML();
}
public function save($file)
{
return $this->soapDoc->save($file);
}
}

11
plugin/sepe/uninstall.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
/* For license terms, see /license.txt */
/**
* This script is included by main/admin/settings.lib.php when unselecting a plugin
* and is meant to remove things installed by the install.php script in both
* the global database and the courses tables.
*
* @package chamilo.plugin.sepe
*/
require_once __DIR__.'/config.php';
SepePlugin::create()->uninstall();

14
plugin/sepe/update.php Normal file
View File

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

View File

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

View File

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

View File

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

View File

@@ -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-hover table-striped 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>

View File

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

View File

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

View File

@@ -0,0 +1,320 @@
<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() == "0") {
$("#new-company-tutor-layer").show();
} else {
$("#new-company-tutor-layer").hide();
}
});
$("select[name='training_tutor_id']").change(function(){
if ($(this).val() == "0") {
$("#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="" selected="selected">{{ 'NoTutor' | get_plugin_lang('SepePlugin') }}</option>
<option value="0">{{ '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="" selected="selected">{{ 'NoTutor' | get_plugin_lang('SepePlugin') }}</option>
<option value="0">{{ '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>

View File

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

View File

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

View File

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

View File

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

View File

@@ -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.id }}" selected="selected">{{ teacher.firstname }} {{ teacher.lastname }}</option>
{% else %}
<option value="{{ teacher.id }}">{{ teacher.firstname }} {{ teacher.lastname }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
</div>
</fieldset>
</div>
</form>
</div>

View File

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

View File

@@ -0,0 +1,913 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ProveedorCentroTFWS" targetNamespace="http://impl.ws.application.proveedorcentro.meyss.spee.es" xmlns:entrada="http://entrada.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:entsal="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:impl="http://impl.ws.application.proveedorcentro.meyss.spee.es" xmlns:salida="http://salida.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema targetNamespace="http://impl.ws.application.proveedorcentro.meyss.spee.es" xmlns="http://impl.ws.application.proveedorcentro.meyss.spee.es">
<xsd:import namespace="http://salida.bean.domain.common.proveedorcentro.meyss.spee.es"/>
<xsd:import namespace="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es"/>
<xsd:element name="crearCentro">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="entsal:DATOS_IDENTIFICATIVOS"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="crearCentroResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="salida:RESPUESTA_DATOS_CENTRO"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="obtenerDatosCentro">
<xsd:complexType/>
</xsd:element>
<xsd:element name="obtenerDatosCentroResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="salida:RESPUESTA_DATOS_CENTRO"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="crearAccion">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="entsal:ACCION_FORMATIVA"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="crearAccionResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="salida:RESPUESTA_OBT_ACCION"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="obtenerAccion">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="entsal:ID_ACCION"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="obtenerAccionResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="salida:RESPUESTA_OBT_ACCION"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="obtenerListaAcciones">
<xsd:complexType/>
</xsd:element>
<xsd:element name="obtenerListaAccionesResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="salida:RESPUESTA_OBT_LISTA_ACCIONES"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="eliminarAccion">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="entsal:ID_ACCION"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="eliminarAccionResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="salida:RESPUESTA_ELIMINAR_ACCION"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema targetNamespace="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es">
<xsd:simpleType name="tipo_fecha">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tipo_si_no">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="SI"/>
<xsd:enumeration value="NO"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tipo_documento">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="D"/>
<xsd:enumeration value="E"/>
<xsd:enumeration value="U"/>
<xsd:enumeration value="W"/>
<xsd:enumeration value="G"/>
<xsd:enumeration value="H"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="codigo_retorno">
<xsd:restriction base="xsd:int">
<xsd:minInclusive value="-2"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="origen">
<xsd:restriction base="xsd:string">
<xsd:minLength value="2"/>
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="codigo_centro">
<xsd:restriction base="xsd:string">
<xsd:length value="16"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string_40">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="url">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="400"/>
<xsd:pattern value="^(http|https|HTTP|HTTPS){1}://\w{1}(\w|[-_.~!*&apos;();:@&amp;=+$,/?%#]|\[|\])*$"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="telefono">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
<xsd:pattern value="^([+]\d)?\d{9,15}$"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="email">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="250"/>
<xsd:pattern value="^\w([.]?(\w|[!#$&apos;*+\-/=?\^_`{|}~]))*@(\w|[.\-]){1,254}[.](\w){2,6}$"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="DATOS_IDENTIFICATIVOS">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ID_CENTRO" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_CENTRO" nillable="false" type="origen"/>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_CENTRO" nillable="false" type="codigo_centro"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="NOMBRE_CENTRO" nillable="false" type="string_40"/>
<xsd:element maxOccurs="1" minOccurs="1" name="URL_PLATAFORMA" nillable="false" type="url"/>
<xsd:element maxOccurs="1" minOccurs="1" name="URL_SEGUIMIENTO" nillable="false" type="url"/>
<xsd:element maxOccurs="1" minOccurs="1" name="TELEFONO" nillable="false" type="telefono"/>
<xsd:element maxOccurs="1" minOccurs="1" name="EMAIL" nillable="false" type="email"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ID_ACCION">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_ACCION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_ACCION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="30"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ACCION_FORMATIVA">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ID_ACCION" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_ACCION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_ACCION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="30"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="SITUACION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="ID_ESPECIALIDAD_PRINCIPAL" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_ESPECIALIDAD" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="AREA_PROFESIONAL" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="4"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_ESPECIALIDAD" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="14"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="DURACION" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="FECHA_INICIO" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="1" name="FECHA_FIN" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="1" name="IND_ITINERARIO_COMPLETO" nillable="false" type="tipo_si_no"/>
<xsd:element maxOccurs="1" minOccurs="1" name="TIPO_FINANCIACION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="NUMERO_ASISTENTES" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="DESCRIPCION_ACCION" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="DENOMINACION_ACCION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="250"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="INFORMACION_GENERAL" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="650"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="HORARIOS" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="650"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="REQUISITOS" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="650"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CONTACTO_ACCION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="0"/>
<xsd:maxLength value="650"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="ESPECIALIDADES_ACCION">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="ESPECIALIDAD">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ID_ESPECIALIDAD" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_ESPECIALIDAD" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="AREA_PROFESIONAL" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="4"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_ESPECIALIDAD" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="14"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CENTRO_IMPARTICION" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_CENTRO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_CENTRO" nillable="false" type="codigo_centro"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="FECHA_INICIO" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="1" name="FECHA_FIN" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="1" name="MODALIDAD_IMPARTICION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="DATOS_DURACION" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="HORAS_PRESENCIAL" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="HORAS_TELEFORMACION" nillable="false" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CENTROS_SESIONES_PRESENCIALES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="CENTRO_PRESENCIAL" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_CENTRO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_CENTRO" nillable="false" type="codigo_centro"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="TUTORES_FORMADORES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="TUTOR_FORMADOR" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ID_TUTOR" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="TIPO_DOCUMENTO" nillable="false" type="tipo_documento"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_DOCUMENTO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="LETRA_NIF" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="ACREDITACION_TUTOR" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="200"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="EXPERIENCIA_PROFESIONAL" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="COMPETENCIA_DOCENTE" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="EXPERIENCIA_MODALIDAD_TELEFORMACION" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="FORMACION_MODALIDAD_TELEFORMACION" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="USO" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="HORARIO_MANANA">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_PARTICIPANTES" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUMERO_ACCESOS" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="DURACION_TOTAL" nillable="false" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="HORARIO_TARDE">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_PARTICIPANTES" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUMERO_ACCESOS" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="DURACION_TOTAL" nillable="false" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="HORARIO_NOCHE">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_PARTICIPANTES" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUMERO_ACCESOS" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="DURACION_TOTAL" nillable="false" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="SEGUIMIENTO_EVALUACION">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_PARTICIPANTES" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUMERO_ACTIVIDADES_APRENDIZAJE" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUMERO_INTENTOS" nillable="false" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUMERO_ACTIVIDADES_EVALUACION" nillable="false" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="PARTICIPANTES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="PARTICIPANTE">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ID_PARTICIPANTE" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="TIPO_DOCUMENTO" nillable="false" type="tipo_documento"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_DOCUMENTO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="LETRA_NIF" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="INDICADOR_COMPETENCIAS_CLAVE" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CONTRATO_FORMACION">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="ID_CONTRATO_CFA" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="^[A-Za-z]\d{13}$"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="CIF_EMPRESA" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="9"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="ID_TUTOR_EMPRESA" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="TIPO_DOCUMENTO" nillable="false" type="tipo_documento"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_DOCUMENTO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="LETRA_NIF" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="ID_TUTOR_FORMACION" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="TIPO_DOCUMENTO" nillable="false" type="tipo_documento"/>
<xsd:element maxOccurs="1" minOccurs="1" name="NUM_DOCUMENTO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="LETRA_NIF" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="ESPECIALIDADES_PARTICIPANTE">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="1" name="ESPECIALIDAD" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ID_ESPECIALIDAD" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_ESPECIALIDAD" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="AREA_PROFESIONAL" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="4"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_ESPECIALIDAD" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="14"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="FECHA_ALTA" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="0" name="FECHA_BAJA" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="1" name="TUTORIAS_PRESENCIALES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="TUTORIA_PRESENCIAL" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="CENTRO_PRESENCIAL_TUTORIA" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_CENTRO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_CENTRO" nillable="false" type="codigo_centro"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="FECHA_INICIO" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="1" name="FECHA_FIN" nillable="false" type="tipo_fecha"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="EVALUACION_FINAL">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="CENTRO_PRESENCIAL_EVALUACION" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="ORIGEN_CENTRO" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_CENTRO" nillable="false" type="codigo_centro"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="FECHA_INICIO" nillable="false" type="tipo_fecha"/>
<xsd:element maxOccurs="1" minOccurs="0" name="FECHA_FIN" nillable="false" type="tipo_fecha"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" name="RESULTADOS">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="RESULTADO_FINAL" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="CALIFICACION_FINAL" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:int"/>
</xsd:simpleType>
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="PUNTUACION_FINAL" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:int"/>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema targetNamespace="http://salida.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns="http://salida.bean.domain.common.proveedorcentro.meyss.spee.es">
<xsd:import namespace="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es"/>
<xsd:simpleType name="mensaje_error">
<xsd:restriction base="xsd:string">
<xsd:length value="250"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="RESPUESTA_DATOS_CENTRO">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_RETORNO" nillable="false" type="entsal:codigo_retorno"/>
<xsd:element maxOccurs="1" minOccurs="1" name="ETIQUETA_ERROR" nillable="true" type="mensaje_error"/>
<xsd:element maxOccurs="1" ref="entsal:DATOS_IDENTIFICATIVOS"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RESPUESTA_OBT_ACCION">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_RETORNO" nillable="false" type="entsal:codigo_retorno"/>
<xsd:element maxOccurs="1" minOccurs="1" name="ETIQUETA_ERROR" nillable="true" type="mensaje_error"/>
<xsd:element maxOccurs="1" ref="entsal:ACCION_FORMATIVA"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RESPUESTA_OBT_LISTA_ACCIONES">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_RETORNO" nillable="false" type="entsal:codigo_retorno"/>
<xsd:element maxOccurs="1" minOccurs="1" name="ETIQUETA_ERROR" nillable="true" type="mensaje_error"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="entsal:ID_ACCION"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="RESPUESTA_ELIMINAR_ACCION">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="CODIGO_RETORNO" nillable="false" type="entsal:codigo_retorno"/>
<xsd:element maxOccurs="1" minOccurs="1" name="ETIQUETA_ERROR" nillable="true" type="mensaje_error"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="obtenerDatosCentroMessageRequest">
<wsdl:part element="impl:obtenerDatosCentro" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="crearAccionMessageResponse">
<wsdl:part element="impl:crearAccionResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="eliminarAccionMessageResponse">
<wsdl:part element="impl:eliminarAccionResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="obtenerListaAccionesMessageResponse">
<wsdl:part element="impl:obtenerListaAccionesResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="crearCentroMessageResponse">
<wsdl:part element="impl:crearCentroResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="crearCentroMessageRequest">
<wsdl:part element="impl:crearCentro" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="crearAccionMessageRequest">
<wsdl:part element="impl:crearAccion" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="obtenerAccionMessageRequest">
<wsdl:part element="impl:obtenerAccion" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="obtenerDatosCentroMessageResponse">
<wsdl:part element="impl:obtenerDatosCentroResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="obtenerListaAccionesMessageRequest">
<wsdl:part element="impl:obtenerListaAcciones" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="eliminarAccionMessageRequest">
<wsdl:part element="impl:eliminarAccion" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="obtenerAccionMessageResponse">
<wsdl:part element="impl:obtenerAccionResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="IProveedorCentroEndPoint">
<wsdl:operation name="crearCentro">
<wsdl:input message="impl:crearCentroMessageRequest" name="crearCentroInput">
</wsdl:input>
<wsdl:output message="impl:crearCentroMessageResponse" name="crearCentroOutput">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="obtenerDatosCentro">
<wsdl:input message="impl:obtenerDatosCentroMessageRequest" name="obtenerDatosCentroInput">
</wsdl:input>
<wsdl:output message="impl:obtenerDatosCentroMessageResponse" name="obtenerDatosCentroOutput">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="crearAccion">
<wsdl:input message="impl:crearAccionMessageRequest" name="crearAccionInput">
</wsdl:input>
<wsdl:output message="impl:crearAccionMessageResponse" name="crearAccionOutput">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="obtenerAccion">
<wsdl:input message="impl:obtenerAccionMessageRequest" name="obtenerAccionInput">
</wsdl:input>
<wsdl:output message="impl:obtenerAccionMessageResponse" name="obtenerAccionOutput">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="obtenerListaAcciones">
<wsdl:input message="impl:obtenerListaAccionesMessageRequest" name="obtenerListaAccionesInput">
</wsdl:input>
<wsdl:output message="impl:obtenerListaAccionesMessageResponse" name="obtenerListaAccionesOutput">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="eliminarAccion">
<wsdl:input message="impl:eliminarAccionMessageRequest" name="eliminarAccionInput">
</wsdl:input>
<wsdl:output message="impl:eliminarAccionMessageResponse" name="eliminarAccionOutput">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ProveedorCentroEndPointSoapBinding" type="impl:IProveedorCentroEndPoint">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsp:PolicyReference URI="#UsernameTokenPolicy" wsdl:required="false"/>
<wsdl:operation name="crearCentro">
<soap:operation soapAction="crearCentro"/>
<wsdl:input name="crearCentroInput">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="crearCentroOutput">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="obtenerDatosCentro">
<soap:operation soapAction="obtenerDatosCentro"/>
<wsdl:input name="obtenerDatosCentroInput">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="obtenerDatosCentroOutput">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="crearAccion">
<soap:operation soapAction="crearAccion"/>
<wsdl:input name="crearAccionInput">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="crearAccionOutput">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="obtenerAccion">
<soap:operation soapAction="obtenerAccion"/>
<wsdl:input name="obtenerAccionInput">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="obtenerAccionOutput">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="obtenerListaAcciones">
<soap:operation soapAction="obtenerListaAcciones"/>
<wsdl:input name="obtenerListaAccionesInput">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="obtenerListaAccionesOutput">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="eliminarAccion">
<soap:operation soapAction="eliminarAccion"/>
<wsdl:input name="eliminarAccionInput">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="eliminarAccionOutput">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ProveedorCentroTFWS">
<wsdl:port binding="impl:ProveedorCentroEndPointSoapBinding" name="ProveedorCentroEndPoint">
<soap:address location="http://change-this-url.com/plugin/sepe/ws/service.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

1374
plugin/sepe/ws/Sepe.php Normal file

File diff suppressed because it is too large Load Diff

149
plugin/sepe/ws/service.php Normal file
View File

@@ -0,0 +1,149 @@
<?php
/* For licensing terms, see /license.txt */
ini_set('log_errors_max_len', 0);
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
require_once '../../../main/inc/global.inc.php';
require_once '../../../vendor/autoload.php';
ini_set("soap.wsdl_cache_enabled", 0);
$libpath = api_get_path(LIBRARY_PATH);
require_once api_get_path(SYS_PLUGIN_PATH).'sepe/ws/Sepe.php';
require_once $libpath.'nusoap/class.nusoap_base.php';
require_once api_get_path(SYS_PLUGIN_PATH).'sepe/src/wsse/soap-server-wsse.php';
$ns = api_get_path(WEB_PLUGIN_PATH)."sepe/ws/ProveedorCentroTFWS.wsdl";
$wsdl = api_get_path(SYS_PLUGIN_PATH)."sepe/ws/ProveedorCentroTFWS.wsdl";
$serviceUrl = api_get_path(WEB_PLUGIN_PATH).'sepe/ws/service.php';
/**
* Class CustomServer.
*/
class CustomServer extends Zend\Soap\Server
{
/**
* {@inheritdoc}
*/
public function __construct($wsdl = null, array $options = null)
{
parent::__construct($wsdl, $options);
// Response of handle will always be returned
$this->setReturnResponse(true);
}
public function handle($request = null)
{
$response = parent::handle($request);
$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/"',
$response
);
$response = $this->addNamespaceToTag($response, 'RESPUESTA_DATOS_CENTRO', 'sal');
$response = $this->addNamespaceToTag($response, 'RESPUESTA_OBT_LISTA_ACCIONES', 'sal');
$response = $this->addNamespaceToTag($response, 'RESPUESTA_ELIMINAR_ACCION', 'sal');
$response = $this->addNamespaceToTag($response, 'RESPUESTA_OBT_ACCION', 'sal');
$response = $this->addNamespaceToTag($response, 'ACCION_FORMATIVA', 'ent');
$response = $this->addNamespaceToTag($response, 'ID_ACCION', 'ent');
$response = $this->addNamespaceToTag($response, 'DATOS_IDENTIFICATIVOS', 'ent');
// Dentro de ACCION_FORMATIVA no hay ent:ID_ACCION
$response = str_replace(
'<ent:ACCION_FORMATIVA><ent:ID_ACCION>',
'<ent:ACCION_FORMATIVA><ID_ACCION>',
$response
);
$response = str_replace(
'</ent:ID_ACCION><SITUACION>',
'</ID_ACCION><SITUACION>',
$response
);
//$response = file_get_contents('/tmp/log4.xml');
header('Content-Length:'.strlen($response));
echo $response;
exit;
}
private function addNamespaceToTag($response, $tag, $namespace)
{
return str_replace(
$tag,
$namespace.":".$tag,
$response
);
}
}
function authenticate($WSUser, $WSKey)
{
$tUser = Database::get_main_table(TABLE_MAIN_USER);
$tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
$login = Database::escape_string($WSUser);
$WSKey = Database::escape_string($WSKey);
$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') {
return true;
}
}
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;
$s = new WSSESoapServer($doc);
if (!empty($WSUser) && !empty($WSKey)) {
if (authenticate($WSUser, $WSKey)) {
// pointing to the current file here
$options = [
'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);
header('Content-type: application/xml');
echo $contents;
exit;
}
exit;