added field lock_redults in epal_config entity, added PdfCreator Controller

parent 1ac43e61
......@@ -199,7 +199,7 @@ epal.ministry.retrievesettings:
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.storesettings:
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}'
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsResultsDisabled}'
options:
_auth: [ 'basic_auth' ]
defaults:
......
......@@ -98,6 +98,7 @@ class MinisterSettings extends ControllerBase {
$capacityDisabled = $epalConfig->lock_school_capacity->getString();
$directorViewDisabled = $epalConfig->lock_school_students_view->getString();
$applicantsLoginDisabled = $epalConfig->lock_application->getString();
$applicantsResultsDisabled = $epalConfig->lock_results->getString();
}
$config_storage->resetCache();
......@@ -107,6 +108,7 @@ class MinisterSettings extends ControllerBase {
'capacityDisabled' => $capacityDisabled,
'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled,
], Response::HTTP_OK);
} //end try
......@@ -123,7 +125,7 @@ class MinisterSettings extends ControllerBase {
}
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled ) {
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled, $applicantsResultsDisabled ) {
try {
if (!$request->isMethod('GET')) {
......@@ -168,6 +170,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
$epalConfig->set('lock_school_capacity', $capacityDisabled);
$epalConfig->set('lock_school_students_view', $directorViewDisabled);
$epalConfig->set('lock_application', $applicantsLoginDisabled);
$epalConfig->set('lock_results', $applicantsResultsDisabled);
$epalConfig->save();
}
$config_storage->resetCache();
......@@ -178,6 +181,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
'capacityDisabled' => $capacityDisabled,
'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled,
], Response::HTTP_OK);
} //end try
......
......@@ -207,7 +207,7 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
......@@ -227,7 +227,7 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
......@@ -247,7 +247,27 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'boolean',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['lock_results'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Lock Results'))
->setDescription(t('Lock Results.'))
->setSettings(array(
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
......
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