123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900 |
- <?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')) {
- die('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);
|