Commit e6ab5c20 authored by Aspasia Katsi's avatar Aspasia Katsi

Merge branch 'master' of gitlab.minedu.gov.gr:itminedu/gredu_labs

parents 73f9de65 d4eb5da9
<?php <?php
/** /**
* gredu_labs. * gredu_labs.
* *
* @link https://github.com/eellak/gredu_labs for the canonical source repository * @link https://github.com/eellak/gredu_labs for the canonical source repository
* *
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/) * @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
...@@ -20,6 +20,7 @@ return [ ...@@ -20,6 +20,7 @@ return [
'module/sch_sync/bootstrap.php', 'module/sch_sync/bootstrap.php',
'module/schools/bootstrap.php', 'module/schools/bootstrap.php',
'module/application_form/bootstrap.php', 'module/application_form/bootstrap.php',
'module/receive_equip/bootstrap.php',
'module/tpe_survey/bootstrap.php', 'module/tpe_survey/bootstrap.php',
'module/in_numbers/bootstrap.php', 'module/in_numbers/bootstrap.php',
'module/in_numbers_mm/bootstrap.php', 'module/in_numbers_mm/bootstrap.php',
......
...@@ -6,21 +6,20 @@ ...@@ -6,21 +6,20 @@
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/) * @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html * @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/ */
return [ return [
'acl' => [ 'acl' => [
'default_role' => 'guest', 'default_role' => 'guest',
'roles' => [ 'roles' => [
'guest' => [], 'guest' => [],
'user' => [], 'user' => [],
'school' => ['user'], 'school' => ['user'],
'admin' => ['user'], 'admin' => ['user'],
], ],
'resoures' => [], 'resoures' => [],
'guards' => [ 'guards' => [
'resources' => [], 'resources' => [],
'callables' => [], 'callables' => [],
'routes' => [ 'routes' => [
['/', ['guest', 'user'], ['get']], ['/', ['guest', 'user'], ['get']],
['/about', ['guest', 'user'], ['get']], ['/about', ['guest', 'user'], ['get']],
['/school', ['school'], ['get']], ['/school', ['school'], ['get']],
...@@ -32,6 +31,10 @@ return [ ...@@ -32,6 +31,10 @@ return [
['/application-form', ['school'], ['get', 'post']], ['/application-form', ['school'], ['get', 'post']],
['/application-form/submit-success', ['school'], ['get']], ['/application-form/submit-success', ['school'], ['get']],
['/application-form/report', ['school'], ['get']], ['/application-form/report', ['school'], ['get']],
['/receive-equip', ['school'], ['get', 'post'], GrEduLabs\ReceiveEquip\Acl\Assertion\CanSubmit::class],
['/receive-equip/submit-success', ['school'], ['get']],
['/receive-equip/report', ['school'], ['get']],
['/receive-equip/receive-doc/{fn}', ['school'], ['get']],
['/tpe_survey', ['school'], ['get', 'post']], ['/tpe_survey', ['school'], ['get', 'post']],
['/tpe_survey/total-teachers', ['school'], ['post']], ['/tpe_survey/total-teachers', ['school'], ['post']],
['/forum', ['guest', 'user'], ['get']], ['/forum', ['guest', 'user'], ['get']],
......
<?php <?php
/** /**
* gredu_labs. * gredu_labs.
* *
* @link https://github.com/eellak/gredu_labs for the canonical source repository * @link https://github.com/eellak/gredu_labs for the canonical source repository
* *
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/) * @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
...@@ -51,6 +51,10 @@ return [ ...@@ -51,6 +51,10 @@ return [
'label' => 'Αίτηση', 'label' => 'Αίτηση',
'route' => 'application_form', 'route' => 'application_form',
], ],
'receive-equip' => [
'label' => 'Παραλαβή εξοπλισμού',
'route' => 'receive_equip',
],
'open-data' => [ 'open-data' => [
'label' => 'Ανοικτά δεδομένα', 'label' => 'Ανοικτά δεδομένα',
'route' => 'open_data', 'route' => 'open_data',
......
<?php
/**
* gredu_labs.
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
*
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
return [
'open_data' => [
'pagesize' => 20, // default page size
'maxpagesize' => 200, // maximum page size
],
];
<?php
/**
* gredu_labs
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
return [
'receive_equip' => [
'file_upload_path' => __DIR__ . '/../../data/uploads', // path to save file
'file_upload_max_size' => 3145728, // Maximum number of bytes allowed(default 3MB)
'file_upload_types_permitted' => ['jpg', 'jpeg', 'pdf', 'png'], // Array of allowed extensions
],
];
...@@ -22,12 +22,16 @@ CREATE TABLE `applicationform` ( ...@@ -22,12 +22,16 @@ CREATE TABLE `applicationform` (
`comments` text COLLATE utf8mb4_unicode_ci, `comments` text COLLATE utf8mb4_unicode_ci,
`submitted` int(11) unsigned NOT NULL, `submitted` int(11) unsigned NOT NULL,
`submitted_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `submitted_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`received_ts` timestamp NULL,
`received_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`received_document` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `index_foreignkey_applicationform_school` (`school_id`), KEY `index_foreignkey_applicationform_school` (`school_id`),
CONSTRAINT `c_fk_applicationform_school_id` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE CONSTRAINT `c_fk_applicationform_school_id` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
CREATE INDEX `index_applicationform_submitted` ON `applicationform`(`submitted`);
CREATE INDEX `index_applicationform_received_ts` ON `applicationform`(`received_ts`);
-- --
-- Dumping data for table `applicationform` -- Dumping data for table `applicationform`
-- --
...@@ -49,6 +53,7 @@ CREATE TABLE `applicationformitem` ( ...@@ -49,6 +53,7 @@ CREATE TABLE `applicationformitem` (
`itemcategory_id` int(11) unsigned NOT NULL, `itemcategory_id` int(11) unsigned NOT NULL,
`qty` int(11) unsigned NOT NULL, `qty` int(11) unsigned NOT NULL,
`qtyacquired` int(11) unsigned NOT NULL DEFAULT 0, `qtyacquired` int(11) unsigned NOT NULL DEFAULT 0,
`qtyreceived` int(11) unsigned DEFAULT 0,
`reasons` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `reasons` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`applicationform_id` int(11) unsigned NOT NULL, `applicationform_id` int(11) unsigned NOT NULL,
`lab_id` int(11) unsigned NOT NULL, `lab_id` int(11) unsigned NOT NULL,
...@@ -172,7 +177,7 @@ CREATE TABLE `itemcategory` ( ...@@ -172,7 +177,7 @@ CREATE TABLE `itemcategory` (
LOCK TABLES `itemcategory` WRITE; LOCK TABLES `itemcategory` WRITE;
/*!40000 ALTER TABLE `itemcategory` DISABLE KEYS */; /*!40000 ALTER TABLE `itemcategory` DISABLE KEYS */;
INSERT INTO `itemcategory` (`id`,`name`,`groupflag`,`sort`) VALUES INSERT INTO `itemcategory` (`id`,`name`,`groupflag`,`sort`) VALUES
(8,'ACCESS POINT',0,8), (8,'ACCESS POINT',0,8),
(26,'ΦΟΡΗΤΟΣ Η/Υ (LAPTOP)',0,26), (26,'ΦΟΡΗΤΟΣ Η/Υ (LAPTOP)',0,26),
(6,'MODEM / ROUTER ',0,6), (6,'MODEM / ROUTER ',0,6),
...@@ -196,7 +201,7 @@ INSERT INTO `itemcategory` (`id`,`name`,`groupflag`,`sort`) VALUES ...@@ -196,7 +201,7 @@ INSERT INTO `itemcategory` (`id`,`name`,`groupflag`,`sort`) VALUES
(43,'ΤΡΙΣΔΙΑΣΤΑΤΟΣ ΣΑΡΩΤΗΣ',0,43), (43,'ΤΡΙΣΔΙΑΣΤΑΤΟΣ ΣΑΡΩΤΗΣ',0,43),
(44,'ΣΕΤ ΡΟΜΠΟΤΙΚΗΣ - ΑΙΣΘΗΤΗΡΩΝ',0,44), (44,'ΣΕΤ ΡΟΜΠΟΤΙΚΗΣ - ΑΙΣΘΗΤΗΡΩΝ',0,44),
(45,'ΔΟΜΗΜΕΝΗ ΚΑΛΩΔΙΩΣΗ',0,45); (45,'ΔΟΜΗΜΕΝΗ ΚΑΛΩΔΙΩΣΗ',0,45);
INSERT INTO `itemcategory` (`id`,`name`,`groupflag`,`sort`) VALUES INSERT INTO `itemcategory` (`id`,`name`,`groupflag`,`sort`) VALUES
(101,'ΣΤΑΘΕΡΟΣ ΗΛΕΚΤΡΟΝΙΚΟΣ ΥΠΟΛΟΓΙΣΤΗΣ (DESKTOP)', 1,1), (101,'ΣΤΑΘΕΡΟΣ ΗΛΕΚΤΡΟΝΙΚΟΣ ΥΠΟΛΟΓΙΣΤΗΣ (DESKTOP)', 1,1),
(102,'ΦΟΡΗΤΟΣ ΗΛΕΚΤΡΟΝΙΚΟΣ ΥΠΟΛΟΓΙΣΤΗΣ (LAPTOP)', 1,2), (102,'ΦΟΡΗΤΟΣ ΗΛΕΚΤΡΟΝΙΚΟΣ ΥΠΟΛΟΓΙΣΤΗΣ (LAPTOP)', 1,2),
(103,'ΕΠΙΤΡΑΠΕΖΙΟΣ ΒΙΝΤΕΟΠΡΟΒΟΛΕΑΣ (SHORT THROW PROJECTOR)', 1,3), (103,'ΕΠΙΤΡΑΠΕΖΙΟΣ ΒΙΝΤΕΟΠΡΟΒΟΛΕΑΣ (SHORT THROW PROJECTOR)', 1,3),
...@@ -280,7 +285,7 @@ CREATE TABLE `lab_lesson` ( ...@@ -280,7 +285,7 @@ CREATE TABLE `lab_lesson` (
UNIQUE KEY `UQ_82ac3a020f1d21984f224331fbd99880f89b2e71` (`lab_id`,`lesson_id`), UNIQUE KEY `UQ_82ac3a020f1d21984f224331fbd99880f89b2e71` (`lab_id`,`lesson_id`),
KEY `index_foreignkey_lab_lesson_lesson` (`lesson_id`), KEY `index_foreignkey_lab_lesson_lesson` (`lesson_id`),
KEY `index_foreignkey_lab_lesson_lab` (`lab_id`), KEY `index_foreignkey_lab_lesson_lab` (`lab_id`),
CONSTRAINT `c_fk_lab_lesson_lesson_id` FOREIGN KEY (`lesson_id`) REFERENCES `lesson` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `c_fk_lab_lesson_lesson_id` FOREIGN KEY (`lesson_id`) REFERENCES `lesson` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `c_fk_lab_lesson_lab_id` FOREIGN KEY (`lab_id`) REFERENCES `lab` (`id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `c_fk_lab_lesson_lab_id` FOREIGN KEY (`lab_id`) REFERENCES `lab` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
......
ALTER TABLE `applicationformitem`
DROP COLUMN `qtyreceived` ;
ALTER TABLE `applicationform`
DROP COLUMN `received_ts` ;
ALTER TABLE `applicationform`
DROP COLUMN `received_by` ;
ALTER TABLE applicationform DROP INDEX `index_applicationform_submitted`;
ALTER TABLE `applicationformitem`
ADD COLUMN `qtyreceived` int(11) unsigned NOT NULL DEFAULT 0
AFTER `qtyacquired` ;
ALTER TABLE `applicationform`
ADD COLUMN `received_ts` timestamp NULL
AFTER `submitted_by` ;
ALTER TABLE `applicationform`
ADD COLUMN `received_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
AFTER `received_ts` ;
CREATE INDEX `index_applicationform_submitted` ON `applicationform`(`submitted`);
CREATE INDEX `index_applicationform_received_ts` ON `applicationform`(`received_ts`);
ALTER TABLE `applicationform`
DROP COLUMN `received_document` ;
ALTER TABLE `applicationform`
ADD COLUMN `received_document` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''
AFTER `received_by` ;
...@@ -22,11 +22,16 @@ CREATE TABLE `applicationform` ( ...@@ -22,11 +22,16 @@ CREATE TABLE `applicationform` (
`comments` text COLLATE utf8mb4_unicode_ci, `comments` text COLLATE utf8mb4_unicode_ci,
`submitted` int(11) unsigned NOT NULL, `submitted` int(11) unsigned NOT NULL,
`submitted_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `submitted_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`received_ts` timestamp NULL,
`received_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`received_document` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `index_foreignkey_applicationform_school` (`school_id`), KEY `index_foreignkey_applicationform_school` (`school_id`),
CONSTRAINT `c_fk_applicationform_school_id` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE CONSTRAINT `c_fk_applicationform_school_id` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
CREATE INDEX `index_applicationform_submitted` ON `applicationform`(`submitted`);
CREATE INDEX `index_applicationform_received_ts` ON `applicationform`(`received_ts`);
-- --
-- Dumping data for table `applicationform` -- Dumping data for table `applicationform`
...@@ -49,6 +54,7 @@ CREATE TABLE `applicationformitem` ( ...@@ -49,6 +54,7 @@ CREATE TABLE `applicationformitem` (
`itemcategory_id` int(11) unsigned NOT NULL, `itemcategory_id` int(11) unsigned NOT NULL,
`qty` int(11) unsigned NOT NULL, `qty` int(11) unsigned NOT NULL,
`qtyacquired` int(11) unsigned DEFAULT 0, `qtyacquired` int(11) unsigned DEFAULT 0,
`qtyreceived` int(11) unsigned DEFAULT 0,
`reasons` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `reasons` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`applicationform_id` int(11) unsigned NOT NULL, `applicationform_id` int(11) unsigned NOT NULL,
`lab_id` int(11) unsigned NOT NULL, `lab_id` int(11) unsigned NOT NULL,
...@@ -61,7 +67,6 @@ CREATE TABLE `applicationformitem` ( ...@@ -61,7 +67,6 @@ CREATE TABLE `applicationformitem` (
CONSTRAINT `c_fk_applicationformitem_lab_id` FOREIGN KEY (`lab_id`) REFERENCES `lab` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE CONSTRAINT `c_fk_applicationformitem_lab_id` FOREIGN KEY (`lab_id`) REFERENCES `lab` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
-- Dumping data for table `applicationformitem` -- Dumping data for table `applicationformitem`
-- --
...@@ -78,4 +83,4 @@ UNLOCK TABLES; ...@@ -78,4 +83,4 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
\ No newline at end of file
<?php <?php
/** /**
* gredu_labs. * gredu_labs.
* *
* @link https://github.com/eellak/gredu_labs for the canonical source repository * @link https://github.com/eellak/gredu_labs for the canonical source repository
* *
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/) * @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
...@@ -42,7 +42,7 @@ class Login ...@@ -42,7 +42,7 @@ class Login
/** /**
* *
* @param Twig $view * @param Twig $view
* @param AuthenticationService $authService * @param AuthenticationService $authService
* @param Messages $flash * @param Messages $flash
......
...@@ -43,6 +43,7 @@ return function (App $app) { ...@@ -43,6 +43,7 @@ return function (App $app) {
'ID', 'ID',
'Κωδικός σχολείου', 'Κωδικός σχολείου',
'Ονομασία σχολείου', 'Ονομασία σχολείου',
'Περιφερειακή διεύθυνση εκπαίδευσης',
'Ονομασία χώρου', 'Ονομασία χώρου',
'Τύπος χώρου', 'Τύπος χώρου',
'Ειδικότητα υπευθύνου', 'Ειδικότητα υπευθύνου',
...@@ -65,6 +66,7 @@ return function (App $app) { ...@@ -65,6 +66,7 @@ return function (App $app) {
'Τύπος χώρου', 'Τύπος χώρου',
'Κωδικός σχολείου', 'Κωδικός σχολείου',
'Ονομασία σχολείου', 'Ονομασία σχολείου',
'Περιφερειακή διεύθυνση εκπαίδευσης',
'Σχόλια - Παρατηρήσεις', 'Σχόλια - Παρατηρήσεις',
], ],
], ],
...@@ -74,6 +76,7 @@ return function (App $app) { ...@@ -74,6 +76,7 @@ return function (App $app) {
'Τύπος', 'Τύπος',
'Κωδικός σχολείου', 'Κωδικός σχολείου',
'Ονομασία σχολείου', 'Ονομασία σχολείου',
'Περιφερειακή διεύθυνση εκπαίδευσης',
'ID χώρου', 'ID χώρου',
'Τύπος χώρου', 'Τύπος χώρου',
'Ονομασία', 'Ονομασία',
...@@ -87,6 +90,7 @@ return function (App $app) { ...@@ -87,6 +90,7 @@ return function (App $app) {
'ID', 'ID',
'Κωδικός σχολείου', 'Κωδικός σχολείου',
'Ονομασία σχολείου', 'Ονομασία σχολείου',
'Περιφερειακή διεύθυνση εκπαίδευσης',
'Ημερομηνία υποβολής', 'Ημερομηνία υποβολής',
'Σχόλια - Παρατηρήσεις', 'Σχόλια - Παρατηρήσεις',
], ],
...@@ -98,6 +102,7 @@ return function (App $app) { ...@@ -98,6 +102,7 @@ return function (App $app) {
'ID', 'ID',
'Κωδικός σχολείου', 'Κωδικός σχολείου',
'Ονομασία σχολείου', 'Ονομασία σχολείου',
'Περιφερειακή διεύθυνση εκπαίδευσης',
'Ημερομηνία υποβολής', 'Ημερομηνία υποβολής',
'Σχόλια - Παρατηρήσεις', 'Σχόλια - Παρατηρήσεις',
], ],
...@@ -110,6 +115,7 @@ return function (App $app) { ...@@ -110,6 +115,7 @@ return function (App $app) {
'ID', 'ID',
'Κωδικός σχολείου', 'Κωδικός σχολείου',
'Ονομασία σχολείου', 'Ονομασία σχολείου',
'Περιφερειακή διεύθυνση εκπαίδευσης',
'Ημερομηνία υποβολής', 'Ημερομηνία υποβολής',
'ID χώρου', 'ID χώρου',
'Τύπος χώρου', 'Τύπος χώρου',
...@@ -125,9 +131,14 @@ return function (App $app) { ...@@ -125,9 +131,14 @@ return function (App $app) {
'ID', 'ID',
'Κωδικός σχολείου', 'Κωδικός σχολείου',
'Ονομασία σχολείου', 'Ονομασία σχολείου',
'Περιφερειακή διεύθυνση εκπαίδευσης',
'Ημερομηνία υποβολής',
'ID χώρου',
'Τύπος χώρου',
'Νέος χώρος',
'Είδος', 'Είδος',
'Πλήθος Υπαρχόντων που λειτουργούν',
'Πλήθος Αιτουμένων', 'Πλήθος Αιτουμένων',
'Πλήθος Υπαρχόντων που λειτουργούν',
'Αιτιολογία χρήσης', 'Αιτιολογία χρήσης',
], ],
], ],
...@@ -198,6 +209,7 @@ return function (App $app) { ...@@ -198,6 +209,7 @@ return function (App $app) {
$sql = 'SELECT lab.id AS id, ' $sql = 'SELECT lab.id AS id, '
. ' school.registry_no AS school_registry_no, ' . ' school.registry_no AS school_registry_no, '
. ' school.name AS school_name, ' . ' school.name AS school_name, '
. ' regioneduadmin.name AS region_edu_admin, '
. ' TRIM(lab.name) AS name, ' . ' TRIM(lab.name) AS name, '
. ' TRIM(labtype.name) AS type, ' . ' TRIM(labtype.name) AS type, '
. ' branch.name AS responsible_branch, ' . ' branch.name AS responsible_branch, '
...@@ -211,6 +223,8 @@ return function (App $app) { ...@@ -211,6 +223,8 @@ return function (App $app) {
. ' FROM lab ' . ' FROM lab '
. ' LEFT JOIN labtype ON lab.labtype_id = labtype.id ' . ' LEFT JOIN labtype ON lab.labtype_id = labtype.id '
. ' LEFT JOIN school ON lab.school_id = school.id ' . ' LEFT JOIN school ON lab.school_id = school.id '
. ' LEFT JOIN eduadmin ON school.eduadmin_id = eduadmin.id '
. ' LEFT JOIN regioneduadmin ON eduadmin.regioneduadmin_id = regioneduadmin.id '
. ' LEFT JOIN lab_lesson ON lab_lesson.lab_id = lab.id ' . ' LEFT JOIN lab_lesson ON lab_lesson.lab_id = lab.id '
. ' LEFT JOIN lesson ON lab_lesson.lesson_id = lesson.id ' . ' LEFT JOIN lesson ON lab_lesson.lesson_id = lesson.id '
. ' LEFT JOIN teacher ON lab.responsible_id = teacher.id ' . ' LEFT JOIN teacher ON lab.responsible_id = teacher.id '
...@@ -234,10 +248,13 @@ return function (App $app) { ...@@ -234,10 +248,13 @@ return function (App $app) {
. ' TRIM(labtype.name) AS lab_type, ' . ' TRIM(labtype.name) AS lab_type, '
. ' school.registry_no AS school_registry_no, ' . ' school.registry_no AS school_registry_no, '
. ' school.name AS school_name, ' . ' school.name AS school_name, '
. ' regioneduadmin.name AS region_edu_admin, '
. ' schoolasset.comments AS comments ' . ' schoolasset.comments AS comments '
. ' FROM schoolasset ' . ' FROM schoolasset '
. ' LEFT JOIN itemcategory ON schoolasset.itemcategory_id = itemcategory.id ' . ' LEFT JOIN itemcategory ON schoolasset.itemcategory_id = itemcategory.id '
. ' LEFT JOIN school ON schoolasset.school_id = school.id ' . ' LEFT JOIN school ON schoolasset.school_id = school.id '
. ' LEFT JOIN eduadmin ON school.eduadmin_id = eduadmin.id '
. ' LEFT JOIN regioneduadmin ON eduadmin.regioneduadmin_id = regioneduadmin.id '
. ' LEFT JOIN lab ON schoolasset.lab_id = lab.id ' . ' LEFT JOIN lab ON schoolasset.lab_id = lab.id '
. ' LEFT JOIN labtype ON lab.labtype_id = labtype.id ' . ' LEFT JOIN labtype ON lab.labtype_id = labtype.id '
. ' GROUP BY schoolasset.id ' . ' GROUP BY schoolasset.id '
...@@ -249,15 +266,13 @@ return function (App $app) { ...@@ -249,15 +266,13 @@ return function (App $app) {
}; };
}; };
$c['csv_export_software'] = function ($c) {
$c['csv_export_software'] = function ($c) {
return function () { return function () {
$sql = 'SELECT softwarecategory.name AS name, ' $sql = 'SELECT softwarecategory.name AS name, '
. ' school.registry_no AS school_registry_no, ' . ' school.registry_no AS school_registry_no, '
. ' school.name AS school_name, ' . ' school.name AS school_name, '
. ' regioneduadmin.name AS region_edu_admin, '
. ' lab.id AS lab_id, ' . ' lab.id AS lab_id, '
. ' TRIM(labtype.name) AS lab_type, ' . ' TRIM(labtype.name) AS lab_type, '
. ' TRIM(software.title) AS title, ' . ' TRIM(software.title) AS title, '
...@@ -266,6 +281,8 @@ return function (App $app) { ...@@ -266,6 +281,8 @@ return function (App $app) {
. ' FROM software ' . ' FROM software '
. ' LEFT JOIN softwarecategory ON software.softwarecategory_id = softwarecategory.id ' . ' LEFT JOIN softwarecategory ON software.softwarecategory_id = softwarecategory.id '
. ' LEFT JOIN school ON software.school_id = school.id ' . ' LEFT JOIN school ON software.school_id = school.id '
. ' LEFT JOIN eduadmin ON school.eduadmin_id = eduadmin.id '
. ' LEFT JOIN regioneduadmin ON eduadmin.regioneduadmin_id = regioneduadmin.id '
. ' LEFT JOIN lab ON software.lab_id = lab.id ' . ' LEFT JOIN lab ON software.lab_id = lab.id '
. ' LEFT JOIN labtype ON lab.labtype_id = labtype.id ' . ' LEFT JOIN labtype ON lab.labtype_id = labtype.id '
. ' ORDER BY school_name '; . ' ORDER BY school_name ';
...@@ -284,17 +301,8 @@ return function (App $app) { ...@@ -284,17 +301,8 @@ return function (App $app) {
}; };
}; };
$c['csv_export_appforms'] = function ($c) { $c['csv_export_appforms'] = function ($c) {
//return function () {
return function () use ($c) { return function () use ($c) {
$settings = $c->get('settings'); $settings = $c->get('settings');
$version = $settings['application_form']['itemcategory']['currentversion']; $version = $settings['application_form']['itemcategory']['currentversion'];
...@@ -322,11 +330,14 @@ return function (App $app) { ...@@ -322,11 +330,14 @@ return function (App $app) {
$sql = 'SELECT applicationform.id AS id, ' $sql = 'SELECT applicationform.id AS id, '
. ' school.registry_no AS school_registry_no, ' . ' school.registry_no AS school_registry_no, '
. ' school.name AS school_name, ' . ' school.name AS school_name, '
. ' regioneduadmin.name AS region_edu_admin, '
. ' FROM_UNIXTIME(applicationform.submitted) AS submitted, ' . ' FROM_UNIXTIME(applicationform.submitted) AS submitted, '
. ' TRIM(applicationform.comments) AS comments' . ' TRIM(applicationform.comments) AS comments'
. ' FROM applicationformitem ' . ' FROM applicationformitem '
. ' LEFT JOIN applicationform ON applicationformitem.applicationform_id = applicationform.id ' . ' LEFT JOIN applicationform ON applicationformitem.applicationform_id = applicationform.id '
. ' LEFT JOIN school ON applicationform.school_id = school.id ' . ' LEFT JOIN school ON applicationform.school_id = school.id '
. ' LEFT JOIN eduadmin ON school.eduadmin_id = eduadmin.id '
. ' LEFT JOIN regioneduadmin ON eduadmin.regioneduadmin_id = regioneduadmin.id '
. ' LEFT JOIN itemcategory ON applicationformitem.itemcategory_id = itemcategory.id ' . ' LEFT JOIN itemcategory ON applicationformitem.itemcategory_id = itemcategory.id '
. ' LEFT JOIN lab ON applicationformitem.lab_id = lab.id ' . ' LEFT JOIN lab ON applicationformitem.lab_id = lab.id '
. ' LEFT JOIN labtype ON lab.labtype_id = labtype.id ' . ' LEFT JOIN labtype ON lab.labtype_id = labtype.id '
...@@ -337,51 +348,35 @@ return function (App $app) { ...@@ -337,51 +348,35 @@ return function (App $app) {
return $appForms; return $appForms;
// $sql = 'SELECT applicationform.id AS id, '
// . ' school.registry_no AS school_registry_no, '
// . ' school.name AS school_name, '
// . ' FROM_UNIXTIME(applicationform.submitted) AS submitted, '
// . ' TRIM(applicationform.comments) AS comments '
// . ' FROM applicationform '
// . ' LEFT JOIN school ON applicationform.school_id = school.id '
// . ' GROUP BY school.id '
// . ' HAVING MAX(applicationform.submitted)';
// $appForms = R::getAll($sql);
// return $appForms;
}; };
}; };
$c['csv_export_appnewforms'] = function ($c) { $c['csv_export_appnewforms'] = function ($c) {
return function () use ($c) { return function () use ($c) {
$appFormIdsSql = 'SELECT id FROM applicationform WHERE (submitted) IN( SELECT MAX(submitted) FROM applicationform GROUP BY school_id)'; $appFormIdsSql = 'SELECT id FROM applicationform WHERE (submitted) IN( SELECT MAX(submitted) FROM applicationform GROUP BY school_id)';
$appFormIds = R::getCol($appFormIdsSql); $appFormIds = R::getCol($appFormIdsSql);
if (empty($appFormIds)) { if (empty($appFormIds)) {
return []; return [];
} }
$in = implode(',', array_fill(0, count($appFormIds), '?')); $in = implode(',', array_fill(0, count($appFormIds), '?'));
$settings = $c->get('settings'); $settings = $c->get('settings');
$version = $settings['application_form']['itemcategory']['currentversion']; $version = $settings['application_form']['itemcategory']['currentversion'];
$sql = 'SELECT applicationform.id AS id, ' $sql = 'SELECT applicationform.id AS id, '
. ' school.registry_no AS school_registry_no, ' . ' school.registry_no AS school_registry_no, '
. ' school.name AS school_name, ' . ' school.name AS school_name, '
. ' regioneduadmin.name AS region_edu_admin, '
. ' FROM_UNIXTIME(applicationform.submitted) AS submitted, ' . ' FROM_UNIXTIME(applicationform.submitted) AS submitted, '
. ' TRIM(applicationform.comments) AS comments' . ' TRIM(applicationform.comments) AS comments'
. ' FROM applicationformitem ' . ' FROM applicationformitem '
. ' LEFT JOIN applicationform ON applicationformitem.applicationform_id = applicationform.id ' . ' LEFT JOIN applicationform ON applicationformitem.applicationform_id = applicationform.id '
. ' LEFT JOIN school ON applicationform.school_id = school.id ' . ' LEFT JOIN school ON applicationform.school_id = school.id '
. ' LEFT JOIN eduadmin ON school.eduadmin_id = eduadmin.id '
. ' LEFT JOIN regioneduadmin ON eduadmin.regioneduadmin_id = regioneduadmin.id '
. ' LEFT JOIN itemcategory ON applicationformitem.itemcategory_id = itemcategory.id ' . ' LEFT JOIN itemcategory ON applicationformitem.itemcategory_id = itemcategory.id '
. ' LEFT JOIN lab ON applicationformitem.lab_id = lab.id ' . ' LEFT JOIN lab ON applicationformitem.lab_id = lab.id '
. ' LEFT JOIN labtype ON lab.labtype_id = labtype.id ' . ' LEFT JOIN labtype ON lab.labtype_id = labtype.id '
...@@ -395,8 +390,6 @@ return function (App $app) { ...@@ -395,8 +390,6 @@ return function (App $app) {
}; };
}; };
$c['csv_export_appforms_items'] = function ($c) { $c['csv_export_appforms_items'] = function ($c) {
return function () use ($c){ return function () use ($c){
...@@ -413,14 +406,6 @@ return function (App $app) { ...@@ -413,14 +406,6 @@ return function (App $app) {
. ' WHERE itemcategory.groupflag NOT IN(' . $version . ')' . ' WHERE itemcategory.groupflag NOT IN(' . $version . ')'
. ' GROUP BY school.id)'; . ' GROUP BY school.id)';