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

Travaux sur l'étape intermédiaire avant envoi PCRU

parent 9153f526
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@

  "require": {
    "unicaen/app": "^3.0",
    "unicaen/auth": "dev-release-3.2.0",
    "unicaen/auth": "^3.2.0",
    "oro/doctrine-extensions": "^1.2",
    "symfony/yaml": "^4.3",
    "fightbulc/moment": "^1.30",
+126 −125

File changed.

Preview size limit exceeded, changes collapsed.

+17 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ use Oscar\Entity\ValidationPeriod;
use Oscar\Entity\ValidationPeriodRepository;
use Oscar\Exception\OscarException;
use Oscar\Factory\ActivityPcruInfoFromActivityFactory;
use Oscar\Form\ActivityInfosPcruForm;
use Oscar\Form\PcruInfosForm;
use Oscar\Form\ProjectGrantForm;
use Oscar\Formatter\ActivityPaymentFormatter;
@@ -47,6 +48,7 @@ use Oscar\Formatter\JSONFormatter;
use Oscar\Formatter\Spent\EstimatedSpentActivityHTMLFormater;
use Oscar\Formatter\Spent\EstimatedSpentActivityPDFFormater;
use Oscar\Formatter\TimesheetActivityPeriodHtmlFormatter;
use Oscar\Hydrator\ActivityInfosPCRUFormHydrator;
use Oscar\Hydrator\PcruInfosFormHydrator;
use Oscar\OscarVersion;
use Oscar\Provider\Privileges;
@@ -903,7 +905,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
        $this->getOscarUserContextService()->check(Privileges::ACTIVITY_NOTIFICATIONS_GENERATE, $entity);
        $this->getNotificationService()->purgeNotificationsActivity($entity);
        $this->getNotificationService()->generateNotificationsForActivity($entity);
        // die("ICI");
        $this->flashMessenger()->addSuccessMessage('Les notifications ont été mises à jour');
        return $this->redirect()->toRoute('contract/notifications', ['id' => $entity->getId()]);
    }
@@ -2849,6 +2850,21 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
        /** @var Activity $activity */
        $activity = $this->getActivityFromRoute();

        if( $this->params()->fromQuery("a") == "beta" ){
            $form = new ActivityInfosPcruForm();
            $form->setHydrator(new ActivityInfosPCRUFormHydrator());
            $preview = $this->getProjectGrantService()->getPCRUService()->getPreview($activity);
            $form->init();
            $form->bind($preview['infos']);

            $preview['form'] = $form;
            $preview['activity'] = $activity;
            $view = new ViewModel($preview);
            $view->setTemplate('oscar/activity/pcruinfos-form.phtml');

            return $view;
        }


        $this->getOscarUserContextService()->check(Privileges::ACTIVITY_PCRU, $activity);

+15 −0
Original line number Diff line number Diff line
@@ -786,6 +786,11 @@ class ActivityPcruInfos
        return $this->dateDerniereSignature;
    }

    public function getDateDerniereSignatureStr() :string
    {
        return $this->getDateDerniereSignature() ? $this->getDateDerniereSignature()->format('Y-m-d') : "";
    }

    /**
     * @param \DateTime $dateDerniereSignature
     */
@@ -820,6 +825,11 @@ class ActivityPcruInfos
        return $this->dateDebut;
    }

    public function getDateDebutStr() :string
    {
        return $this->getDateDebut() ? $this->getDateDebut()->format('Y-m-d') : "";
    }

    /**
     * @param \DateTime $dateDebut
     */
@@ -837,6 +847,11 @@ class ActivityPcruInfos
        return $this->dateFin;
    }

    public function getDateFinStr() :string
    {
        return $this->getDateFin() ? $this->getDateFin()->format('Y-m-d') : "";
    }

    /**
     * @param \DateTime $dateFin
     */
+697 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading