Loading module/Oscar/src/Oscar/Controller/AdministrationController.php +1 −11 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ use Oscar\Entity\TVA; use Oscar\Exception\OscarException; use Oscar\Formatter\OscarFormatterConst; use Oscar\Provider\Privileges; use Oscar\Service\administration\AdminActivityFormAPIService; use Oscar\Service\administration\AdminDisciplineAPIService; use Oscar\Service\administration\AdministrationConfigService; use Oscar\Service\administration\AdminRolePrivilegeServiceAPIService; Loading Loading @@ -2063,17 +2064,6 @@ class AdministrationController extends AbstractOscarController implements ]; } public function disciplineAction() { $this->getOscarUserContextService()->check(Privileges::MAINTENANCE_DISCIPLINE_MANAGE); $disciplineConfigApi = new AdminDisciplineAPIService(); $disciplineConfigApi->setServiceContainer($this->getServiceLocator()); if ($this->isAjax() || $this->getRequest()->getQuery('f') === 'json') { return $disciplineConfigApi->entrypoint($this->getRequest()); } return []; } public function activityFormAction() { $this->getOscarUserContextService()->check(Privileges::MAINTENANCE_PARAMETERS_MANAGE); Loading module/Oscar/src/Oscar/Form/ProjectGrantForm.php +6 −1 Original line number Diff line number Diff line Loading @@ -178,14 +178,19 @@ class ProjectGrantForm extends Form implements InputFilterProviderInterface, Use if ($fieldConfig['type'] === 'Select') { $options['value_options'] = $this->getOptionsValues($fieldConfig['name']); } $type = $fieldConfig['type']; if( $type === 'Date' ){ $type = 'Text'; $attributes['class'] .= " input-date"; } $this->add([ 'name' => $fieldName, 'help' => "Some helping message", 'required' => $fieldConfig['use'] === true, 'type' => $fieldConfig['type'], 'type' => $type, 'attributes' => $attributes, 'options' => $options, ]); Loading module/Oscar/src/Oscar/Service/OscarConfigurationService.php +5 −5 Original line number Diff line number Diff line Loading @@ -1086,7 +1086,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateStart", "type" => 'Text', "type" => 'Date', "label" => "Date de début", "help" => "TOTO", "allow_use" => false, Loading @@ -1096,7 +1096,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateEnd", "type" => 'Text', "type" => 'Date', "label" => "Date de fin", "help" => "", "allow_use" => false, Loading @@ -1106,7 +1106,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateSigned", "type" => 'Text', "type" => 'Date', "label" => "Date de signature", "help" => "", "allow_use" => false, Loading @@ -1116,7 +1116,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateOpened", "type" => 'Text', "type" => 'Date', "label" => "Date d'ouverture financier", "help" => "", "allow_use" => false, Loading @@ -1126,7 +1126,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateNegociation", "type" => 'Text', "type" => 'Date', "label" => "Date négociation", "help" => "", "allow_use" => true, Loading module/Oscar/src/Oscar/Service/ProjectGrantApiService.php +12 −1 Original line number Diff line number Diff line Loading @@ -539,8 +539,9 @@ class ProjectGrantApiService implements $numeros[$key] = $value; } $config = $this->getOscarConfigurationService()->getActivityFormConfigKeying(); return [ $out = [ 'id' => $activity->getId(), 'label' => $activity->getLabel(), 'numOscar' => $activity->getOscarNum(), Loading Loading @@ -569,6 +570,16 @@ class ProjectGrantApiService implements 'pcru' => $urlPlugin->fromRoute('contract/pcru-informations', ['id' => $activity->getId()]) ] ]; foreach ($config as $configKey => $configField) { if ($configField['use'] === false) { unset($out[$configKey]); } } return $out; } /** Loading module/Oscar/view/oscar/project-grant/form.phtml +16 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ </div> <script> Initer.ready(function () { console.log("INIT"); require(['select2'], function () { $('.select2,select[multiple]').select2(); }); Loading @@ -183,5 +184,20 @@ require(['Keyvalue'], function (KeyValue) { console.log(KeyValue); }); var $dater = $('.input-date'); console.log("DATERS", $dater); if( $dater.length ){ require(['datepicker'], function(){ $dater.datepicker({ format: "yyyy-mm-dd", todayBtn: "linked", clearBtn: true, language: "fr", autoclose: true, toggleActive: true }); }); } }) </script> No newline at end of file Loading
module/Oscar/src/Oscar/Controller/AdministrationController.php +1 −11 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ use Oscar\Entity\TVA; use Oscar\Exception\OscarException; use Oscar\Formatter\OscarFormatterConst; use Oscar\Provider\Privileges; use Oscar\Service\administration\AdminActivityFormAPIService; use Oscar\Service\administration\AdminDisciplineAPIService; use Oscar\Service\administration\AdministrationConfigService; use Oscar\Service\administration\AdminRolePrivilegeServiceAPIService; Loading Loading @@ -2063,17 +2064,6 @@ class AdministrationController extends AbstractOscarController implements ]; } public function disciplineAction() { $this->getOscarUserContextService()->check(Privileges::MAINTENANCE_DISCIPLINE_MANAGE); $disciplineConfigApi = new AdminDisciplineAPIService(); $disciplineConfigApi->setServiceContainer($this->getServiceLocator()); if ($this->isAjax() || $this->getRequest()->getQuery('f') === 'json') { return $disciplineConfigApi->entrypoint($this->getRequest()); } return []; } public function activityFormAction() { $this->getOscarUserContextService()->check(Privileges::MAINTENANCE_PARAMETERS_MANAGE); Loading
module/Oscar/src/Oscar/Form/ProjectGrantForm.php +6 −1 Original line number Diff line number Diff line Loading @@ -178,14 +178,19 @@ class ProjectGrantForm extends Form implements InputFilterProviderInterface, Use if ($fieldConfig['type'] === 'Select') { $options['value_options'] = $this->getOptionsValues($fieldConfig['name']); } $type = $fieldConfig['type']; if( $type === 'Date' ){ $type = 'Text'; $attributes['class'] .= " input-date"; } $this->add([ 'name' => $fieldName, 'help' => "Some helping message", 'required' => $fieldConfig['use'] === true, 'type' => $fieldConfig['type'], 'type' => $type, 'attributes' => $attributes, 'options' => $options, ]); Loading
module/Oscar/src/Oscar/Service/OscarConfigurationService.php +5 −5 Original line number Diff line number Diff line Loading @@ -1086,7 +1086,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateStart", "type" => 'Text', "type" => 'Date', "label" => "Date de début", "help" => "TOTO", "allow_use" => false, Loading @@ -1096,7 +1096,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateEnd", "type" => 'Text', "type" => 'Date', "label" => "Date de fin", "help" => "", "allow_use" => false, Loading @@ -1106,7 +1106,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateSigned", "type" => 'Text', "type" => 'Date', "label" => "Date de signature", "help" => "", "allow_use" => false, Loading @@ -1116,7 +1116,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateOpened", "type" => 'Text', "type" => 'Date', "label" => "Date d'ouverture financier", "help" => "", "allow_use" => false, Loading @@ -1126,7 +1126,7 @@ class OscarConfigurationService implements ServiceLocatorAwareInterface ], [ "name" => "dateNegociation", "type" => 'Text', "type" => 'Date', "label" => "Date négociation", "help" => "", "allow_use" => true, Loading
module/Oscar/src/Oscar/Service/ProjectGrantApiService.php +12 −1 Original line number Diff line number Diff line Loading @@ -539,8 +539,9 @@ class ProjectGrantApiService implements $numeros[$key] = $value; } $config = $this->getOscarConfigurationService()->getActivityFormConfigKeying(); return [ $out = [ 'id' => $activity->getId(), 'label' => $activity->getLabel(), 'numOscar' => $activity->getOscarNum(), Loading Loading @@ -569,6 +570,16 @@ class ProjectGrantApiService implements 'pcru' => $urlPlugin->fromRoute('contract/pcru-informations', ['id' => $activity->getId()]) ] ]; foreach ($config as $configKey => $configField) { if ($configField['use'] === false) { unset($out[$configKey]); } } return $out; } /** Loading
module/Oscar/view/oscar/project-grant/form.phtml +16 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ </div> <script> Initer.ready(function () { console.log("INIT"); require(['select2'], function () { $('.select2,select[multiple]').select2(); }); Loading @@ -183,5 +184,20 @@ require(['Keyvalue'], function (KeyValue) { console.log(KeyValue); }); var $dater = $('.input-date'); console.log("DATERS", $dater); if( $dater.length ){ require(['datepicker'], function(){ $dater.datepicker({ format: "yyyy-mm-dd", todayBtn: "linked", clearBtn: true, language: "fr", autoclose: true, toggleActive: true }); }); } }) </script> No newline at end of file