Commit 72a30218 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- Ajout d'un filtre pour les activités soumises aux feuilles de temps...

 - Ajout d'un filtre pour les activités soumises aux feuilles de temps (présence de lots de travail)
parent fa0d819d
Loading
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2289,6 +2289,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'ads' => 'Date de signature',
                'adp' => 'Date d\'ouverture du PFI dans SIFAC',
                'pp' => 'Activités sans projet',
                'fdt' => 'Activités soumise à feuille de temps',
                'ds' => 'Ayant pour discipline',

                // Ajout d'un filtre sur les jalons
@@ -2556,9 +2557,16 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                            $qb->andWhere(implode(' AND ', $clause));
                        }
                        break;

                    case 'pp' :
                        $qb->andWhere('c.project IS NULL');
                        break;

                    // Filtre sur les activités ayant des feuilles de temps (Lot de travail)
                    case 'fdt' :
                        $ids = $this->getProjectGrantService()->getActivityRepository()->getActivityIdsWithWorkpackage();
                        break;

                    // Personne (plusieurs)
                    case 'pm' :
                        $value1 = explode(',', $params[1]);
@@ -2800,7 +2808,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                        break;
                }
                $criterias[] = $crit;
                if ($type == 'ap' || $type == 'ao' || $type == 'pm' || $type == 'om') {
                if ($type == 'ap' || $type == 'ao' || $type == 'pm' || $type == 'om' || $type == 'fdt') {
                    if ($filterIds === null) {
                        $filterIds = $ids;
                    } else {
+21 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
namespace Oscar\Entity;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Oscar\Exception\OscarException;
use Oscar\Utils\DateTimeUtils;

@@ -180,4 +181,24 @@ class ActivityRepository extends EntityRepository
            ->where('a.dateStart > a.dateEnd');
        return $qb->getQuery()->getResult();
    }


    public function getActivityIdsWithWorkpackage() :array
    {
        return array_map(
            'current',
           $this->getQueryActivityIdsWithWorkpackage()
                ->getQuery()
                ->getResult()
        );
    }

    public function getQueryActivityIdsWithWorkpackage() :QueryBuilder
    {
        $qb = $this->createQueryBuilder('a')
            ->select('a.id')
            ->innerJoin('a.workPackages', 'wp');

        return $qb;
    }
}
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -290,7 +290,12 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
                $activity = $this->getEntityManager()->getRepository(Activity::class)->find(
                    $declaration->getObjectId()
                );

                if( !$activity ){
                    $label = 'invalid';
                } else {
                    $label = (string)$activity->getFullLabel();
                }
            } else {
                $label = $this->getOthersWPByCode($object)['label'];
            }
+3 −0
Original line number Diff line number Diff line
@@ -737,6 +737,9 @@
                    else if(datas.type == 'pp' ) {
                        dom = $(tplStatic(datas));
                    }
                    else if(datas.type == 'fdt' ) {
                        dom = $(tplStatic(datas));
                    }
                    else if(datas.type == 'mp' ) {
                        dom = $(tplNumber(datas));
                    }