updated several Controllers in Drupal

parent 4221a15c
...@@ -46,10 +46,15 @@ function epal_mail($key, &$message, $params) { ...@@ -46,10 +46,15 @@ function epal_mail($key, &$message, $params) {
$message['subject'] = t('Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ: Επιβεβαίωση e-mail', $options); $message['subject'] = t('Σύστημα υποβολής αιτήσεων εγγραφής σε ΕΠΑΛ: Επιβεβαίωση e-mail', $options);
$message['body'][] = $params['message']; $message['body'][] = $params['message'];
break; break;
case 'massive_mail': case 'massive_mail_unallocated':
$message['from'] = \Drupal::config('system.site')->get('mail'); $message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options); $message['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options);
$message['body'][] = $params['message']; $message['body'][] = $params['message'];
break; break;
case 'massive_mail_located':
$message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ', $options);
$message['body'][] = $params['message'];
break;
} }
} }
...@@ -73,7 +73,7 @@ epal.application_submit: ...@@ -73,7 +73,7 @@ epal.application_submit:
epal.allocation: epal.allocation:
path: '/epal/distribution' path: '/epal/distribution'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
_controller: '\Drupal\epal\Controller\Distribution::createDistribution' _controller: '\Drupal\epal\Controller\Distribution::createDistribution'
requirements: requirements:
...@@ -151,7 +151,7 @@ epal.ministry.report-completeness: ...@@ -151,7 +151,7 @@ epal.ministry.report-completeness:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.ministry.report-all-stat: epal.ministry.report-all-stat:
path: '/ministry/report-all-stat/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}' path: '/ministry/report-all-stat/{regionId}/{adminId}/{schId}/{classId}/{sectorId}/{courseId}/{finalized}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -174,12 +174,20 @@ epal.ministry.retrieve-registry-id: ...@@ -174,12 +174,20 @@ epal.ministry.retrieve-registry-id:
_controller: '\Drupal\epal\Controller\ReportsCreator::retrieveUserRegistryNo' _controller: '\Drupal\epal\Controller\ReportsCreator::retrieveUserRegistryNo'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.ministry.massive_mail: epal.ministry.massive_mail_unallocated:
path: '/ministry/send-massive-mail' path: '/ministry/send-unallocated-massive-mail'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudents'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.massive_mail_located:
path: '/ministry/send-located-massive-mail'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToStudents' _controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToLocatedStudents'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.ministry.retrievesettings: epal.ministry.retrievesettings:
...@@ -246,5 +254,3 @@ gettypeofschool: ...@@ -246,5 +254,3 @@ gettypeofschool:
_controller: '\Drupal\epal\Controller\DirectorView::gettypeofschool' _controller: '\Drupal\epal\Controller\DirectorView::gettypeofschool'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
...@@ -87,7 +87,7 @@ class MinisterSettings extends ControllerBase { ...@@ -87,7 +87,7 @@ class MinisterSettings extends ControllerBase {
//minister settings retrieve //minister settings retrieve
$config_storage = $this->entityTypeManager->getStorage('epal_config'); $config_storage = $this->entityTypeManager->getStorage('epal_config');
$epalConfigs = $config_storage->loadByProperties(array('id' => 1)); $epalConfigs = $config_storage->loadByProperties(array('name' => 'epal_config'));
$epalConfig = reset($epalConfigs); $epalConfig = reset($epalConfigs);
if (!$epalConfig) { if (!$epalConfig) {
return $this->respondWithStatus([ return $this->respondWithStatus([
...@@ -157,7 +157,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView ...@@ -157,7 +157,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
} }
$config_storage = $this->entityTypeManager->getStorage('epal_config'); $config_storage = $this->entityTypeManager->getStorage('epal_config');
$epalConfigs = $config_storage->loadByProperties(array('id' => 1)); $epalConfigs = $config_storage->loadByProperties(array('name' => 'epal_config'));
$epalConfig = reset($epalConfigs); $epalConfig = reset($epalConfigs);
if (!$epalConfig) { if (!$epalConfig) {
return $this->respondWithStatus([ return $this->respondWithStatus([
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment