Commit a1b4a142 authored by Alexandre Zvenigorosky's avatar Alexandre Zvenigorosky
Browse files

Merge branch 'b8.1' of https://git.unicaen.fr/open-source/OSE into types-diplome

parents a55d31cf 81b8518c
......@@ -3,6 +3,16 @@ title: "Changements intervenus sur OSE"
author: Laurent Lécluse - DSI - Unicaen
...
#OSE 8.1
## Corrections de bugs
* Les avenants comportaient par défaut un champ "modifieComplete" qui n'était pas fourni par la vue.
## Nouveautés
* Il est désormais possible de customiser et/ou de traduire de petites parties de l'application. Attention toutefois : le travail de mise en place du dispositif n'en est qu'au tout début.
#OSE 8.0.3
## Corrections de bugs
......
......@@ -4,7 +4,6 @@ namespace Application\Controller;
use Application\Entity\Db\nommaj;
use Application\Service\Traits\nommajServiceAwareTrait;
use Application\Exception\DbException;
use Application\Form\nommaj\Traits\nommajSaisieFormAwareTrait;
use UnicaenApp\View\Model\MessengerViewModel;
......@@ -46,8 +45,7 @@ class nommajController extends AbstractController
$this->getServicenommaj()->save($fr);
$this->flashMessenger()->addSuccessMessage('Enregistrement effectué');
} catch (\Exception $e) {
$e = DbException::translate($e);
$this->flashMessenger()->addErrorMessage($e->getMessage() . ':' . $fr->getId());
$this->flashMessenger()->addErrorMessage($this->translate($e));
}
});
......@@ -62,7 +60,7 @@ class nommajController extends AbstractController
$this->getServicenommaj()->delete($nomm);
$this->flashMessenger()->addSuccessMessage("nommaj supprimée avec succès.");
} catch (\Exception $e) {
$this->flashMessenger()->addErrorMessage(DbException::translate($e)->getMessage());
$this->flashMessenger()->addErrorMessage($this->translate($e));
}
return new MessengerViewModel(compact('nomm'));
}
......
......@@ -15,6 +15,9 @@ return [
/* Affichage complet des erreurs (false en production) */
'affichageErreurs' => true,
/* Langue utilisée (la liste des langues est disponible dans le répertoire /language de l'application) */
'locale' => 'fr_FR',
],
......
......@@ -57,6 +57,11 @@ INSERT INTO CATEGORIE_PRIVILEGE (ID,CODE,LIBELLE) VALUES (
'structures',
'Structures'
);
INSERT INTO CATEGORIE_PRIVILEGE (ID,CODE,LIBELLE) VALUES (
CATEGORIE_PRIVILEGE_ID_SEQ.nextval,
'formule',
'Formule de calcul'
);
INSERT INTO PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
SELECT
......@@ -67,19 +72,124 @@ SELECT
(SELECT count(*) FROM PRIVILEGE WHERE categorie_id = (SELECT id FROM CATEGORIE_PRIVILEGE WHERE code = t1.c )) + rownum ORDRE
FROM (
SELECT 'odf' c, 'grands-types-diplome-visualisation' p, 'Grands types de diplômes (visualisation)' l FROM dual
UNION ALL SELECT 'odf' c, 'grands-types-diplome-edition' p, 'Grands types de diplômes (édition)' l FROM dual
UNION ALL SELECT 'odf' c, 'types-diplome-visualisation' p, 'Types de diplômes (visualisation)' l FROM dual
UNION ALL SELECT 'odf' c, 'types-diplome-edition' p, 'Types de diplômes (édition)' l FROM dual
UNION ALL SELECT 'motifs-modification-service-du' c, 'visualisation' p, 'Administration (visualisation)' l FROM dual
UNION ALL SELECT 'motifs-modification-service-du' c, 'edition' p, 'Administration (édition)' l FROM dual
UNION ALL SELECT 'structures' c, 'administration-visualisation' p, 'Administration (visualisation)' l FROM dual
UNION ALL SELECT 'structures' c, 'administration-edition' p, 'Administration (édition)' l FROM dual
UNION ALL SELECT 'budget' c, 'types-ressources-visualisation' p, 'Types de ressources - Visualisation' l FROM dual
UNION ALL SELECT 'budget' c, 'types-ressources-edition' p, 'Types de ressources - Édition' l FROM dual
) t1;
\ No newline at end of file
SELECT 'odf' c, 'grands-types-diplome-visualisation' p, 'Grands types de diplômes (visualisation)' l FROM dual
UNION ALL SELECT 'odf' c, 'grands-types-diplome-edition' p, 'Grands types de diplômes (édition)' l FROM dual
UNION ALL SELECT 'odf' c, 'types-diplome-visualisation' p, 'Types de diplômes (visualisation)' l FROM dual
UNION ALL SELECT 'odf' c, 'types-diplome-edition' p, 'Types de diplômes (édition)' l FROM dual
UNION ALL SELECT 'motifs-modification-service-du' c, 'visualisation' p, 'Administration (visualisation)' l FROM dual
UNION ALL SELECT 'motifs-modification-service-du' c, 'edition' p, 'Administration (édition)' l FROM dual
UNION ALL SELECT 'structures' c, 'administration-visualisation' p, 'Administration (visualisation)' l FROM dual
UNION ALL SELECT 'structures' c, 'administration-edition' p, 'Administration (édition)' l FROM dual
UNION ALL SELECT 'budget' c, 'types-ressources-visualisation' p, 'Types de ressources - Visualisation' l FROM dual
UNION ALL SELECT 'budget' c, 'types-ressources-edition' p, 'Types de ressources - Édition' l FROM dual
UNION ALL SELECT 'formule' c, 'tests' p, 'Tests' l FROM dual
) t1;
CREATE OR REPLACE FORCE VIEW "V_CONTRAT_MAIN" AS
WITH hs AS (
SELECT contrat_id, sum(heures) "serviceTotal" FROM V_CONTRAT_SERVICES GROUP BY contrat_id
)
SELECT
ct.id contrat_id,
ct."annee",
ct."nom",
ct."prenom",
ct."civilite",
ct."e",
ct."dateNaissance",
ct."adresse",
ct."numInsee",
ct."statut",
ct."totalHETD",
ct."tauxHoraireValeur",
ct."tauxHoraireDate",
ct."dateSignature",
ct."modifieComplete",
CASE WHEN ct.est_contrat=1 THEN 1 ELSE null END "contrat1",
CASE WHEN ct.est_contrat=1 THEN null ELSE 1 END "avenant1",
CASE WHEN ct.est_contrat=1 THEN '3' ELSE '2' END "n",
to_char(SYSDATE, 'dd/mm/YYYY - hh24:mi:ss') "horodatage",
'Exemplaire à conserver' "exemplaire1",
'Exemplaire à retourner' || ct."exemplaire2" "exemplaire2",
ct."serviceTotal",
CASE ct.est_contrat
WHEN 1 THEN -- contrat
'Contrat de travail '
ELSE
'Avenant au contrat de travail initial modifiant le volume horaire initial'
|| ' de recrutement en qualité '
END "titre",
CASE WHEN ct.est_atv = 1 THEN
'd''agent temporaire vacataire'
ELSE
'de chargé' || ct."e" || ' d''enseignement vacataire'
END "qualite",
CASE
WHEN ct.est_projet = 1 AND ct.est_contrat = 1 THEN 'Projet de contrat'
WHEN ct.est_projet = 0 AND ct.est_contrat = 1 THEN 'Contrat n°' || ct.id
WHEN ct.est_projet = 1 AND ct.est_contrat = 0 THEN 'Projet d''avenant'
WHEN ct.est_projet = 0 AND ct.est_contrat = 0 THEN 'Avenant n°' || ct.contrat_id || '.' || ct.numero_avenant
END "titreCourt"
FROM
(
SELECT
c.*,
a.libelle "annee",
COALESCE(d.nom_usuel,i.nom_usuel) "nom",
COALESCE(d.prenom,i.prenom) "prenom",
civ.libelle_court "civilite",
CASE WHEN civ.sexe = 'F' THEN 'e' ELSE '' END "e",
to_char(COALESCE(d.date_naissance,i.date_naissance), 'dd/mm/YYYY') "dateNaissance",
COALESCE(d.adresse,ose_divers.formatted_adresse(
ai.NO_VOIE, ai.NOM_VOIE, ai.BATIMENT, ai.MENTION_COMPLEMENTAIRE, ai.LOCALITE,
ai.CODE_POSTAL, ai.VILLE, ai.PAYS_LIBELLE)) "adresse",
COALESCE(d.numero_insee,i.numero_insee || ' ' || COALESCE(LPAD(i.numero_insee_cle,2,'0'),'')) "numInsee",
si.libelle "statut",
replace(ltrim(to_char(COALESCE(fr.total,0), '999999.00')),'.',',') "totalHETD",
replace(ltrim(to_char(COALESCE(th.valeur,0), '999999.00')),'.',',') "tauxHoraireValeur",
COALESCE(to_char(th.histo_creation, 'dd/mm/YYYY'), 'TAUX INTROUVABLE') "tauxHoraireDate",
to_char(COALESCE(v.histo_creation, c.histo_creation), 'dd/mm/YYYY') "dateSignature",
CASE WHEN c.structure_id <> COALESCE(cp.structure_id,0) THEN 'modifié' ELSE 'complété' END "modifieComplete",
CASE WHEN s.aff_adresse_contrat = 1 THEN
' signé à l''adresse suivante :' || CHR(13) || CHR(10) ||
s.libelle_court || ' - ' || REPLACE(ose_divers.formatted_adresse(
astr.NO_VOIE, astr.NOM_VOIE, null, null, astr.LOCALITE,
astr.CODE_POSTAL, astr.VILLE, null), CHR(13), ' - ')
ELSE '' END "exemplaire2",
replace(ltrim(to_char(COALESCE(hs."serviceTotal",0), '999999.00')),'.',',') "serviceTotal",
CASE WHEN c.contrat_id IS NULL THEN 1 ELSE 0 END est_contrat,
CASE WHEN v.id IS NULL THEN 1 ELSE 0 END est_projet,
si.tem_atv est_atv
FROM
contrat c
JOIN type_contrat tc ON tc.id = c.type_contrat_id
JOIN intervenant i ON i.id = c.intervenant_id
JOIN annee a ON a.id = i.annee_id
JOIN statut_intervenant si ON si.id = i.statut_id
JOIN structure s ON s.id = c.structure_id
LEFT JOIN adresse_structure astr ON astr.structure_id = s.id AND astr.principale = 1 AND astr.histo_destruction IS NULL
LEFT JOIN dossier d ON d.intervenant_id = i.id AND d.histo_destruction IS NULL
JOIN civilite civ ON civ.id = COALESCE(d.civilite_id,i.civilite_id)
LEFT JOIN validation v ON v.id = c.validation_id AND v.histo_destruction IS NULL
LEFT JOIN adresse_intervenant ai ON ai.intervenant_id = i.id AND ai.histo_destruction IS NULL
JOIN type_volume_horaire tvh ON tvh.code = 'PREVU'
JOIN etat_volume_horaire evh ON evh.code = 'valide'
LEFT JOIN formule_resultat fr ON fr.intervenant_id = i.id AND fr.type_volume_horaire_id = tvh.id AND fr.etat_volume_horaire_id = evh.id
LEFT JOIN taux_horaire_hetd th ON c.histo_creation BETWEEN th.histo_creation AND COALESCE(th.histo_destruction,SYSDATE)
LEFT JOIN hs ON hs.contrat_id = c.id
LEFT JOIN contrat cp ON cp.id = c.contrat_id
WHERE
c.histo_destruction IS NULL
) ct;
msgid ""
msgstr ""
"Project-Id-Version: OSE\n"
"POT-Creation-Date: 2019-02-19 17:47+0100\n"
"PO-Revision-Date: 2019-02-19 17:50+0100\n"
"Last-Translator: Laurent Lécluse <laurent.lecluse@unicaen.fr>\n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.11\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: translate;setLabel;setLegend;_\n"
"X-Poedit-SearchPath-0: module/Application\n"
"X-Poedit-SearchPathExcluded-0: public/vendor\n"
"X-Poedit-SearchPathExcluded-1: vendor/unicaen/import/public/ace-builds-"
"master\n"
#: module/Application/src/Application/Controller/BudgetController.php:217
#: module/Application/src/Application/Controller/BudgetController.php:218
msgid "Dont, au titre de "
msgstr ""
#: module/Application/src/Application/Controller/BudgetController.php:219
msgid "Année civile "
msgstr ""
#: module/Application/src/Application/Controller/BudgetController.php:323
msgid "Composante"
msgstr ""
#: module/Application/src/Application/Controller/EtablissementController.php:38
msgid "Recherchez l'établissement concerné :"
msgstr ""
#: module/Application/src/Application/Controller/StructureController.php:39
msgid "Recherchez la structure concernée :"
msgstr ""
#: module/Application/src/Application/Form/Droits/AffectationForm.php:68
msgid "Utilisateur"
msgstr ""
#: module/Application/src/Application/Form/Intervenant/HeuresCompForm.php:29
msgid "Type de service :"
msgstr ""
#: module/Application/src/Application/Form/Intervenant/HeuresCompForm.php:35
#: module/Application/src/Application/Form/Service/RechercheForm.php:201
msgid "État :"
msgstr ""
#: module/Application/src/Application/Form/ParametresForm.php:138
#: module/Application/src/Application/Form/Service/SaisieFieldset.php:100
msgid "Établissement :"
msgstr ""
#: module/Application/src/Application/Form/Service/RechercheForm.php:150
msgid "Statut :"
msgstr ""
#: module/Application/src/Application/Form/Service/RechercheForm.php:181
#: module/Application/src/Application/Form/Service/SaisieFieldset.php:71
#: module/Application/src/Application/Form/ServiceReferentiel/SaisieFieldset.php:79
msgid "Intervenant :"
msgstr ""
#: module/Application/src/Application/Form/Service/RechercheForm.php:188
msgid "Enseignement :"
msgstr ""
#: module/Application/src/Application/Form/Service/RechercheForm.php:194
msgid "Type :"
msgstr ""
#: module/Application/src/Application/Traits/TranslatorTrait.php:43
msgid "bdd "
msgstr ""
#: module/Application/src/Application/View/Helper/AppLink.php:108
msgid "Page d'accueil de l'application"
msgstr ""
#: module/Application/src/Application/View/Helper/ServiceReferentiel/FormSaisie.php:128
msgid "Prévu => réalisé"
msgstr ""
#: module/Application/src/Application/translate.php:9
msgid "bdd .SERVICE__UN"
msgstr ""
"Vous ne pouvez pas enregistrer cet enseignement car il en existe déjà un de "
"similaire."
#: module/Application/src/Application/translate.php:10
msgid "bdd ORA-01722"
msgstr "Nombre invalide"
#: module/Application/src/Application/translate.php:11
msgid "bdd .MEP_FR_SERVICE_FK"
msgstr ""
"Vous ne pouvez pas dévalider ces heures d'enseignement, car des demandes de "
"mise en paiement ou des mises en paiement ont été faites."
#: module/Application/src/Application/translate.php:12
msgid "bdd .MEP_FR_SERVICE_REF_FK"
msgstr ""
"Vous ne pouvez pas dévalider ces heures de référentiel, car des demandes de "
"mise en paiement ou des mises en paiement ont été faites."
#: module/Application/src/Application/translate.php:13
msgid "bdd .EP_CODE__UN"
msgstr ""
"Un enseignement existe déjà avec le même code. Merci de choisir un autre "
"code d'enseignement."
#: module/Application/src/Application/translate.php:14
msgid "bdd .ETAPE_SOURCE_UN"
msgstr ""
"Une formation existe déjà avec le même code. Merci de choisir un autre code "
"de formation."
#: module/Application/view/application/index/index.phtml:53
msgid "Tableau synthétique des enseignements concernant ma composante..."
msgstr ""
#: module/Application/view/application/index/index.phtml:66
msgid "Connectez-vous..."
msgstr ""
#: module/Application/view/application/indicateur/envoi-mail-intervenants.phtml:17
msgid "Expéditeur du mail"
msgstr ""
#: module/Application/view/application/indicateur/envoi-mail-intervenants.phtml:20
msgid "Nombre de mails à envoyer"
msgstr ""
#: module/Application/view/application/indicateur/envoi-mail-intervenants.phtml:23
msgid "Objet du mail"
msgstr ""
#: module/Application/view/application/indicateur/envoi-mail-intervenants.phtml:24
msgid "Corps du mail"
msgstr ""
#: module/Application/view/application/intervenant/cloturer-saisie.phtml:2
msgid "J'ai terminé la saisie de la totalité de mon service réalisé."
msgstr ""
#: module/Application/view/application/intervenant/partial/cloture.phtml:43
msgid "J'ai terminé la saisie de la totalité de mon service réalisé"
msgstr ""
#: module/Application/view/application/intervenant/partial/cloture.phtml:60
msgid "L'intervenant a terminé la saisie de la totalité de son service réalisé"
msgstr ""
#: module/Application/view/error/exception.phtml:1
msgid "Opération impossible"
msgstr ""
#: module/Application/view/error/exception.phtml:17
#: module/Application/view/error/index.phtml:13
msgid "Additional information"
msgstr "Informations supplémentaires"
#: module/Application/view/error/exception.phtml:20
#: module/Application/view/error/exception.phtml:44
#: module/Application/view/error/index.phtml:16
#: module/Application/view/error/index.phtml:42
msgid "File"
msgstr "Fichier"
#: module/Application/view/error/exception.phtml:24
#: module/Application/view/error/exception.phtml:48
#: module/Application/view/error/index.phtml:47
msgid "Message"
msgstr "Message"
#: module/Application/view/error/exception.phtml:28
#: module/Application/view/error/exception.phtml:52
#: module/Application/view/error/index.phtml:21
#: module/Application/view/error/index.phtml:51
msgid "Stack trace"
msgstr "Pile d'exécution"
#: module/Application/view/error/exception.phtml:38
#: module/Application/view/error/index.phtml:32
msgid "Previous exceptions"
msgstr "Erreurs précédentes"
#: module/Application/view/error/exception.phtml:69
msgid "No Exception available"
msgstr "Aucune erreur trouvée"
#~ msgid "ETAPE_SOURCE_UN"
#~ msgstr ""
#~ "Une formation existe déjà avec le même code. Merci de choisir un autre "
#~ "code de formation."
#~ msgid "(OSE.ETAPE_SOURCE_UN)"
#~ msgstr ""
#~ "Une formation existe déjà avec le même code. Merci de choisir un autre "
#~ "code de formation."
#~ msgid "OSE.EP_CODE__UN"
#~ msgstr ""
#~ "Un enseignement existe déjà avec le même code. Merci de choisir un autre "
#~ "code d'enseignement"
#~ msgid "test formule2"
#~ msgstr "test form33"
#~ msgid "test formule"
#~ msgstr "test trad"
......@@ -513,7 +513,6 @@ return [
'Application\Assertion\PaiementAssertion' => __DIR__ . '/src/Application/Assertion/PaiementAssertion.php',
'Application\Assertion\ServiceAssertion' => __DIR__ . '/src/Application/Assertion/ServiceAssertion.php',
'Application\Assertion\DossierPiecesAssertion' => __DIR__ . '/src/Application/Assertion/DossierPiecesAssertion.php',
'Application\Exception\DbException' => __DIR__ . '/src/Application/Exception/DbException.php',
'Application\Hydrator\Service\Interfaces\RechercheHydratorAwareInterface' => __DIR__ . '/src/Application/Hydrator/Service/Interfaces/RechercheHydratorAwareInterface.php',
'Application\Hydrator\Service\RechercheHydrator' => __DIR__ . '/src/Application/Hydrator/Service/RechercheHydrator.php',
'Application\Hydrator\Service\Traits\RechercheHydratorAwareTrait' => __DIR__ . '/src/Application/Hydrator/Service/Traits/RechercheHydratorAwareTrait.php',
......
......@@ -55,6 +55,16 @@ $config = [
'zfcuser' => [
'user_entity_class' => Entity\Db\Utilisateur::class,
],
'translator' => [
'locale' => \AppConfig::get('global', 'locale'),
'translation_file_patterns' => [
[
'type' => 'gettext',
'base_dir' => getcwd().'/language',
'pattern' => '%s.mo',
],
],
],
'router' => [
'routes' => [
'home' => [
......
......@@ -2,15 +2,73 @@
namespace Application;
use Application\Provider\Privilege\Privileges;
use UnicaenAuth\Guard\PrivilegeController;
return [
/* Déclaration du contrôleur */
'controllers' => [
'controllers' => [
'factories' => [
'Application\Controller\Formule' => Controller\Factory\FormuleControllerFactory::class,
],
],
'router' => [
'routes' => [
'formule-calcul' => [
'type' => 'Literal',
'options' => [
'route' => '/formule-calcul',
'defaults' => [
'controller' => 'Application\Controller\Formule',
//'action' => 'index',
],
],
'child_routes' => [
'test' => [
'type' => 'Literal',
'options' => [
'route' => '/test',
'defaults' => [
'action' => 'test',
],
],
'may_terminate' => true,
'child_routes' => [
'saisir' => [
'type' => 'Segment',
'options' => [
'route' => '/saisir[/:formuleTestIntervenant]',
'constraints' => [
'formuleTestIntervenant' => '[0-9]*',
],
'defaults' => [
'action' => 'test-saisir',
],
],
'may_terminate' => true,
],
'supprimer' => [
'type' => 'Segment',
'options' => [
'route' => '/supprimer/:formuleTestIntervenant',
'constraints' => [
'formuleTestIntervenant' => '[0-9]*',
],
'defaults' => [
'action' => 'test-supprimer',
],
],
'may_terminate' => true,
],
],
],
],
],
],
],
'console' => [
'router' => [
'routes' => [
......@@ -27,9 +85,43 @@ return [
],
],
'navigation' => [
'default' => [
'home' => [
'pages' => [
'administration' => [
'pages' => [
'formule-calcul' => [
'label' => 'Test de formule de calcul',
'icon' => 'glyphicon glyphicon-briefcase',
'route' => 'formule-calcul/test',
'resource' => PrivilegeController::getResourceId('Application\Controller\Formule', 'test'),
'order' => 80,
'border-color' => '#0C8758',
],
],
],
],
],
],
],
'bjyauthorize' => [
'guards' => [
PrivilegeController::class => [
[
'controller' => 'Application\Controller\Formule',
'action' => ['test', 'test-saisir', 'test-supprimer'],
'privileges' => [Privileges::FORMULE_TESTS],
],
],
],
],
'service_manager' => [
'factories' => [
Service\FormuleService::class => Service\Factory\FormuleServiceFactory::class,
'factories' => [
Service\FormuleService::class => Service\Factory\FormuleServiceFactory::class,
Service\FormuleTestIntervenantService::class => Service\Factory\FormuleTestIntervenantServiceFactory::class,
],
'invokables' => [
Service\FormuleResultatService::class => Service\FormuleResultatService::class,
......@@ -39,4 +131,10 @@ return [
Service\FormuleResultatVolumeHoraireReferentielService::class => Service\FormuleResultatVolumeHoraireReferentielService::class,
],
],
'form_elements' => [
'factories' => [
Form\FormuleTest\IntervenantForm::class => Form\FormuleTest\Factory\IntervenantFormFactory::class,
],
],
];
\ No newline at end of file
......@@ -2,8 +2,8 @@
namespace Application\Controller;
use Application\Exception\DbException;
use Application\Form\Supprimer;
use Application\Traits\TranslatorTrait;
use Doctrine\ORM\EntityManager;
use UnicaenApp\Exporter\Pdf;
use Zend\Mvc\Controller\AbstractActionController;
......@@ -16,6 +16,7 @@ use Zend\Mvc\Controller\AbstractActionController;
*/
abstract class AbstractController extends AbstractActionController
{
use TranslatorTrait;
/**
* @param $saveFnc
......@@ -31,8 +32,7 @@ abstract class AbstractController extends AbstractActionController
try {
$saveFnc();
} catch (\Exception $e) {
$e = DbException::translate($e);
$this->flashMessenger()->addErrorMessage($e->getMessage());
$this->flashMessenger()->addErrorMessage($this->translate($e));
return null;
}