Commit 7cb944f8 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Merge branch 'spartan-2023-06-19-pfi-label' into spartan

(Intitulé du N°Financier configurable)
parents 8d220d45 7caeca97
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -16,16 +16,16 @@ S'adresse aux gestionnaires d'application souhaitant installer et configurer une

### Configuration de base
 - [Authentification](configuration/config-auth.md)
 - [Gestion des documents](config-documents.md) : Configuration de la gestion des documents.
 - [Configuration des documents](config-documents.md)
 - [Configuration du moteur de recherche](config-elasticsearch.md)
 - [Configuration du serveur de tâche](config-gearman.md)
 - [Configuration du PFI](config-pfi.md)
 - [Configuration de la distribution des courriels](config-mailer.md)
 - [Configuration des notifications](config-notifications.md)
 - [Configuration de la numérotation automatique OSCAR](config-numerotation.md)
 - [Gestion des documents](configuration/config-documents.md) : Configuration de la gestion des documents.
 - [Configuration des documents](configuration/config-documents.md)
 - [Configuration du moteur de recherche](configuration/config-elasticsearch.md)
 - [Configuration du serveur de tâche](configuration/config-gearman.md)
 - [Configuration du PFI](configuration/config-pfi.md)
 - [Configuration de la distribution des courriels](configuration/config-mailer.md)
 - [Configuration des notifications](configuration/config-notifications.md)
 - [Configuration de la numérotation automatique OSCAR](configuration/config-numerotation.md)
 - [Configuration des feuilles de temps](timesheet.md)
 - [Configuration des dépenses (SIFAC)](config-sifac.md)
 - [Configuration des dépenses (SIFAC)](configuration/config-sifac.md)

### Synchronisation au Système d'Information
 - [Connectors Oscar](connectors.md) : Connecter Oscar au système d'information
@@ -34,7 +34,7 @@ S'adresse aux gestionnaires d'application souhaitant installer et configurer une
### Utilitaires et utilisation avancée
 - [Administrer Oscar en ligne de commande](oscar-commands.md)
 - [Oscar API](config-api.md) Configurer Oscar pour permettre son accès via une API Rest
 - [Modifier la méthode de génération des PDF](../config-docpdf.md) Permet un gain de performance pour la génération des *certains* documents
 - [Modifier la méthode de génération des PDF](configuration/config-docpdf.md) Permet un gain de performance pour la génération des *certains* documents

## Fonctionnalités optionnelles

+6 −0
Original line number Diff line number Diff line
@@ -346,6 +346,12 @@ class AdministrationController extends AbstractOscarController implements UsePro
                case OscarConfigurationService::pfi_strict:
                    $strict = $this->params()->fromPost(OscarConfigurationService::pfi_strict) == "on";
                    $regex = $this->params()->fromPost(OscarConfigurationService::pfi_strict_format);
                    $label = $this->params()->fromPost(OscarConfigurationService::financial_label);
                    //$description = $this->params()->fromPost(OscarConfigurationService::financial_description);

                    $this->getOscarConfigurationService()->setFinancialLabel($label);
                    //$this->getOscarConfigurationService()->setFinancialDescription($description);

                    if ($strict == true && !$regex) {
                        throw new OscarException(
                            "Vous ne pouvez pas appliquer le mode strict avec une expression régulière vide"
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ class DepenseController extends AbstractOscarController implements UseServiceCon

        try {
            if( !$activity->getCodeEOTP() ){
                throw new OscarException(sprintf(_("Cette activité n'a pas de PFI")));
                throw new OscarException(sprintf(_("Cette activité n'a pas de Numéro financier")));
            }
            //$spents = $this->getSpentService()->getGroupedSpentsDatas($activity->getCodeEOTP());
            $spents = $this->getSpentService()->getSpentsDatas($activity->getCodeEOTP());
+18 −46
Original line number Diff line number Diff line
@@ -1030,6 +1030,13 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // Récupération des informations annexes
            foreach ($activity->getPersons() as $activityPerson){
                $this->getPersonService()->personActivityRemove($activityPerson);
            }

            foreach ($activity->getOrganizations() as $activityOrganization){
                $this->getActivityService()->activityOrganizationRemove($activityOrganization);
            }

            // On supprime les créneaux
            try {
@@ -1040,6 +1047,9 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                );
            }

            // Suppression des notifications
            $this->getNotificationService()->deleteNotificationActivityById($activity->getId());

            // Suppression des documents
            $documents = $activity->getDocuments();
            if (count($documents)) {
@@ -1869,7 +1879,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
            }

            if (count($pfis) == 0) {
                return $this->getResponseInternalError("Pas de PFI");
                return $this->getResponseInternalError("Pas de numéro financier");
            }

            $out = $this->baseJsonResponse();
@@ -2455,7 +2465,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'adc' => 'Date de création',
                'adm' => 'Date de dernière mise à jour',
                'ads' => 'Date de signature',
                'adp' => 'Date d\'ouverture du PFI dans SIFAC',
                'adp' => 'Date d\'ouverture du numéro financier ('. $this->getOscarConfigurationService()->getFinancialLabel() .')',
                'pp' => 'Activités sans projet',
                'fdt' => 'Activités soumise à feuille de temps',
                'ds' => 'Ayant pour discipline',
@@ -2485,7 +2495,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'dateEnd' => 'Date fin',
                'dateUpdated' => 'Date de mise à jour',
                'dateSigned' => 'Date de signature',
                'dateOpened' => "Date d'ouverture du PFI dans SIFAC",
                'dateOpened' => "Date d'ouverture du " . $this->getOscarConfigurationService()->getFinancialLabel()
            ];

            $milestonesCriterias = [
@@ -2555,39 +2565,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                ->leftJoin('a.persons', 'm2')
                ->where('m1.person in(:ids) OR m2.person in (:ids)');

            $queryOrganisationNoRole = $this->getEntityManager()->createQueryBuilder()
                ->select('a.id')
                ->from(Activity::class, 'a', 'a.id')
                ->leftJoin('a.project', 'p')
                ->leftJoin('p.partners', 'o1')
                ->leftJoin('a.organizations', 'o2')
                ->leftJoin('p.members', 'm1')
                ->leftJoin('a.persons', 'm2')
                ->where('(o1.organization = :id OR o2.organization = :id)');

            $queryOrganisationRole = $this->getEntityManager()->createQueryBuilder()
                ->select('a.id')
                ->from(Activity::class, 'a', 'a.id')
                ->leftJoin('a.project', 'p')
                ->leftJoin('p.partners', 'o1')
                ->leftJoin('a.organizations', 'o2')
                ->leftJoin('p.members', 'm1')
                ->leftJoin('a.persons', 'm2')
                ->where(
                    '((o1.organization = :id AND o1.roleObj = :roleObj) OR (o2.organization = :id AND o2.roleObj = :roleObj))'
                );

            $queryOrganisationRoleNorOrg = $this->getEntityManager()->createQueryBuilder()
                ->select('a.id')
                ->from(Activity::class, 'a', 'a.id')
                ->leftJoin('a.project', 'p')
                ->leftJoin('p.partners', 'o1')
                ->leftJoin('a.organizations', 'o2')
                ->leftJoin('p.members', 'm1')
                ->leftJoin('a.persons', 'm2')
                ->where(
                    '(o1.roleObj = :roleObj OR o2.roleObj = :roleObj)'
                );

            $queryOrganisations = $this->getEntityManager()->createQueryBuilder()
                ->select('a.id')
@@ -2738,10 +2715,8 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                            )->getQuery()->getArrayResult()
                        );
                        break;
                    // Organisations (plusieurs)
                    case 'om' :


                    case 'om' :
                        $value1 = explode(',', $params[1]);
                        $crit['val1'] = $value1;
                        $organisationsRequire = $this->getOrganizationService()->getOrganizationsByIds($value1);
@@ -2751,14 +2726,10 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                            $filterOrganizations[$organisation->getId()] = (string)$organisation;
                        }

                        $ids = array_keys(
                            $queryOrganisations->setParameter(
                                'ids',
                                $value1
                            )->getQuery()->getArrayResult()
                        );
                        $ids = $this->getActivityService()->getActivityRepository()->getIdsWithOneOfOrganizationsRoled($value1);

                        break;

                    case 'ap' :
                    case 'sp' :
                        try {
@@ -2769,7 +2740,8 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                            $crit['val1Label'] = $person->getDisplayName();
                            $crit['val2Label'] = $value2 > 0 ? $this->getOscarUserContextService()->getAllRoleIdPerson(
                            )[$value2] : '';
                            $ids = $this->getActivityService()->getActivityRepository()->getIdsForPersonWithRole($person->getId(), $value2 ? $value2 : 0);
                            $ids = $this->getActivityService()->getActivityRepository()
                                ->getIdsForPersonWithRole($person->getId(), $value2 ? $value2 : 0);
                        } catch (\Exception $e) {
                            $crit['error'] = "Impossible de filtrer sur la personne";
                        }
+2 −1
Original line number Diff line number Diff line
@@ -1361,7 +1361,8 @@ class TimesheetController extends AbstractOscarController

        if ($action == "export2") {
            $out = $this->params()->fromQuery('out', 'pdf');
            $datas = $timesheetService->getPersonTimesheetsDatas($person, $period);
            $restrictedActivity = $this->params()->fromQuery('activityid', 0);
            $datas = $timesheetService->getPersonTimesheetsDatas($person, $period, false, $restrictedActivity);
            $datas['format'] = $out;

            if ($out == 'pdf') {
Loading