Commit 74198129 authored by Χάρης Παπαδόπουλος's avatar Χάρης Παπαδόπουλος
Browse files

conflict resolution

parents 09a18345 531e252b
......@@ -141,7 +141,7 @@ epal.ministry.log_out_go:
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.general_report:
path: '/ministry/general-report'
path: '/ministry/general-report/{regionId}/{adminId}/{schId}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -149,7 +149,7 @@ epal.ministry.general_report:
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-completeness:
path: '/ministry/report-completeness'
path: '/ministry/report-completeness/{regionId}/{adminId}/{schId}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -157,7 +157,7 @@ epal.ministry.report-completeness:
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-all-stat:
path: '/ministry/report-all-stat'
path: '/ministry/report-all-stat/{regionId}/{adminId}/{schId}'
options:
_auth: [ 'basic_auth' ]
defaults:
......
......@@ -72,12 +72,14 @@ class CreateDemoData extends ControllerBase {
$epaluserid = \Drupal::currentUser()->id();
for ($i = 1; $i <= 500; $i++) {
for ($i = 1; $i <= 1000; $i++) {
//srand($this->make_seed());
$curclass = rand(1,3);
//$curclass = 2;
$currentepal = rand(137,165);
//$currentepal = rand(137,165);
$currentepal = rand(5,399);
$student = array(
//'epaluser_id' => $aitisi[0][epaluser_id],
......@@ -146,8 +148,8 @@ class CreateDemoData extends ControllerBase {
$ids = $eepalSpecialtiesInEpal_storage->getQuery()
->condition('specialty_id', $coursefield_id, "=")
->condition('epal_id', 137, ">=")
->condition('epal_id', 165, "<=")
//->condition('epal_id', 137, ">=")
//->condition('epal_id', 165, "<=")
->execute();
$eepalSpecialtiesInEpal = $eepalSpecialtiesInEpal_storage->loadMultiple($ids);
......@@ -185,8 +187,8 @@ class CreateDemoData extends ControllerBase {
$ids = $eepalSectorsInEpal_storage->getQuery()
->condition('sector_id', $sectorfield_id, "=")
->condition('epal_id', 137, ">=")
->condition('epal_id', 165, "<=")
//->condition('epal_id', 137, ">=")
//->condition('epal_id', 165, "<=")
->execute();
$eepalSectorsInEpal = $eepalSectorsInEpal_storage->loadMultiple($ids);
......@@ -206,8 +208,10 @@ class CreateDemoData extends ControllerBase {
else if ($curclass === 1) {
print_r("<br> CLASS A: ");
$school_id_start = 137;
for ($l=0; $l < 29; $l++)
//$school_id_start = 137;
$school_id_start = 5;
//for ($l=0; $l < 29; $l++)
for ($l=0; $l < 395; $l++)
array_push($availableSchools, $school_id_start + $l);
}
......
......@@ -56,7 +56,7 @@ class ReportsCreator extends ControllerBase {
}
public function makegGeneralReport(Request $request) {
public function makegGeneralReport(Request $request, $regionId, $adminId, $schId) {
try {
if (!$request->isMethod('GET')) {
......@@ -116,22 +116,8 @@ class ReportsCreator extends ControllerBase {
->condition('eStudent.id', $studentIds, 'NOT IN');
$numNoAllocated = $sCon->countQuery()->execute()->fetchField();
/*
$list[] = array(
'num_applications' => $numTotal,
'numchoice1' => $numData[0],
'numchoice2' => $numData[1],
'numchoice3' => $numData[2],
'num_noallocated' => $numNoAllocated,
);
*/
$list = array();
//$record = new generalReportSchema;
//$record->name = "nikos";
//$record->numStudents = 20;
array_push($list,(object) array('name' => "Αριθμός Αιτήσεων", 'numStudents' => $numTotal));
array_push($list,(object) array('name' => "Αριθμός μαθητών που τοποθετήθηκαν στην πρώτη τους προτίμηση", 'numStudents' => $numData[0]));
array_push($list,(object) array('name' => "Αριθμός μαθητών που τοποθετήθηκαν στην δεύτερή τους προτίμηση", 'numStudents' => $numData[1]));
......@@ -153,7 +139,7 @@ class ReportsCreator extends ControllerBase {
}
public function makeReportCompleteness(Request $request) {
public function makeReportCompleteness(Request $request, $regionId, $adminId, $schId) {
//$this->checkAuthorization($request);
......@@ -191,10 +177,17 @@ class ReportsCreator extends ControllerBase {
$list = array();
//βρες όλα τα σχολεία
//βρες όλα τα σχολεία που πληρούν τα κριτήρια / φίλτρα
$sCon = $this->connection->select('eepal_school_field_data', 'eSchool')
->fields('eSchool', array('id', 'name', 'capacity_class_a'));
->fields('eSchool', array('id', 'name', 'capacity_class_a', 'region_edu_admin_id', 'edu_admin_id'));
if ($regionId != 0)
$sCon->condition('eSchool.region_edu_admin_id', $regionId, '=');
if ($adminId != 0)
$sCon->condition('eSchool.edu_admin_id', $adminId, '=');
if ($schId != 0)
$sCon->condition('eSchool.id', $schId, '=');
$epalSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
//βρες ανώτατο επιτρεπόμενο όριο μαθητών
$sCon = $this->connection->select('epal_class_limits', 'eSchool')
->fields('eSchool', array('name', 'limit_up'))
......@@ -245,7 +238,8 @@ class ReportsCreator extends ControllerBase {
$percTotal = number_format (array_sum($num) / array_sum($capacity) * 100, 1) . "%";
//αποστολή αποτελεσμάτων / στατιστικών
if ($num[0] !== "0" || $num[1] !== "0" || $num[2] !== "0")
//if ($num[0] !== "0" || $num[1] !== "0" || $num[2] !== "0")
/*
array_push($list,(object) array(
......@@ -282,7 +276,7 @@ class ReportsCreator extends ControllerBase {
public function makeReportAllStat(Request $request) {
public function makeReportAllStat(Request $request, $regionId, $adminId, $schId) {
try {
......@@ -316,12 +310,18 @@ class ReportsCreator extends ControllerBase {
], Response::HTTP_FORBIDDEN);
}
$list = array();
//βρες όλα τα σχολεία
//βρες όλα τα σχολεία που πληρούν τα κριτήρια / φίλτρα
$sCon = $this->connection->select('eepal_school_field_data', 'eSchool')
->fields('eSchool', array('id', 'name', 'capacity_class_a', 'region_edu_admin_id', 'edu_admin_id'));
//->condition('eSchool.region_edu_admin_id', $regionId, '=');
if ($regionId != 0)
$sCon->condition('eSchool.region_edu_admin_id', $regionId, '=');
if ($adminId != 0)
$sCon->condition('eSchool.edu_admin_id', $adminId, '=');
if ($schId != 0)
$sCon->condition('eSchool.id', $schId, '=');
$epalSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalSchools as $epalSchool) { //για κάθε σχολείο
......@@ -332,14 +332,14 @@ class ReportsCreator extends ControllerBase {
$adminColumn = array();
$regionColumn = array();
//εύρεση ΠΔΕ που ανήκει το σχολείο
//εύρεση ονόματος ΠΔΕ που ανήκει το σχολείο
$sCon = $this->connection->select('eepal_region_field_data', 'eRegion')
->fields('eRegion', array('id','name'))
->condition('eRegion.id', $epalSchool->region_edu_admin_id, '=');
$epalRegions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$epalRegion = reset($epalRegions);
//εύρεση ΔΙΔΕ που ανήκει το σχολείο
//εύρεση ονόματος ΔΙΔΕ που ανήκει το σχολείο
$sCon = $this->connection->select('eepal_admin_area_field_data', 'eAdmin')
->fields('eAdmin', array('id','name'))
->condition('eAdmin.id', $epalSchool->edu_admin_id, '=');
......
langcode: el
status: true
dependencies:
config:
- user.role.eduadmin
- user.role.ministry
- user.role.regioneduadmin
module:
- basic_auth
- epalreadydata
- hal
- rest
- serialization
- user
id: adminfields
label: adminfields
module: views
description: ''
tag: ''
base_table: eepal_admin_area_field_data
base_field: id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: role
options:
role:
ministry: ministry
eduadmin: eduadmin
regioneduadmin: regioneduadmin
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: serializer
row:
type: fields
options:
inline: { }
separator: ''
hide_empty: false
default_field_elements: true
fields:
id:
id: id
table: eepal_admin_area_field_data
field: id
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: number_integer
settings:
thousand_separator: ''
prefix_suffix: true
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: eepal_admin_area
entity_field: id
plugin_id: field
name:
table: eepal_admin_area_field_data
field: name
id: name
entity_type: null
entity_field: name
plugin_id: field
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
filters: { }
sorts: { }
header: { }
footer: { }
empty: { }
relationships: { }
arguments:
region_to_belong:
id: region_to_belong
table: eepal_admin_area_field_data
field: region_to_belong
relationship: none
group_type: group
admin_label: ''
default_action: default
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: query_parameter
default_argument_options:
query_param: region
fallback: ''
multiple: and
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: false
validate:
type: none
fail: 'not found'
validate_options: { }
break_phrase: false
not: false
entity_type: eepal_admin_area
entity_field: region_to_belong
plugin_id: numeric
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- url
- url.query_args
- user.roles
tags: { }
rest_export_1:
display_plugin: rest_export
id: rest_export_1
display_title: 'REST export'
position: 1
display_options:
display_extenders: { }
path: adminfields/list
pager:
type: some
options:
items_per_page: 0
offset: 0
style:
type: serializer
options:
uses_fields: false
formats:
hal_json: hal_json
json: json
row:
type: data_field
options:
field_options:
id:
alias: ''
raw_output: true
name:
alias: ''
raw_output: true
auth:
- basic_auth
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- url
- user.roles
tags: { }
langcode: el
status: true
dependencies:
config:
- user.role.eduadmin
- user.role.ministry
- user.role.regioneduadmin
module:
- basic_auth
- epalreadydata
- hal
- rest
- serialization
- user
id: regionfields
label: regionfields
module: views
description: ''
tag: ''
base_table: eepal_region_field_data
base_field: id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: role
options:
role:
ministry: ministry
eduadmin: eduadmin
regioneduadmin: regioneduadmin
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: serializer
row:
type: fields
options:
inline: { }
separator: ''