Loading module/Oscar/src/Oscar/Entity/AbstractTreeData.php +1 −0 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 18/06/15 12:01 Loading module/Oscar/src/Oscar/Entity/AbstractTreeDataRepository.php +9 −7 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 18/06/15 12:05 Loading @@ -7,7 +8,6 @@ namespace Oscar\Entity; use Doctrine\ORM\EntityRepository; /** Loading @@ -22,7 +22,8 @@ class AbstractTreeDataRepository extends EntityRepository * @param AbstractTreeData $child * @param AbstractTreeData $parent */ public function addTo( AbstractTreeData $child, AbstractTreeData $parent ){ public function addTo(AbstractTreeData $child, AbstractTreeData $parent) { $parentRight = $parent->getRgt(); $em = $this->getEntityManager(); $child->setLft($parentRight); Loading Loading @@ -62,10 +63,10 @@ class AbstractTreeDataRepository extends EntityRepository $em->persist($child); $em->flush(); echo "SAVE"; } public function deleteNode( AbstractTreeData $child ){ public function deleteNode(AbstractTreeData $child) { // lft >= :lft / rgt <= :rgt } Loading Loading @@ -93,11 +94,12 @@ class AbstractTreeDataRepository extends EntityRepository ))->setMaxResults(1)->execute(); } public function getChildren( AbstractTreeData $node ){ public function getChildren(AbstractTreeData $node) { } public function getAll(){ public function getAll() { $query = $this->createQueryBuilder('t')->select()->addOrderBy('t.lft', 'ASC')->addOrderBy('t.rgt', 'ASC'); return $query->getQuery()->execute(); } Loading module/Oscar/src/Oscar/Entity/AbstractVersionnedDocument.php +1 −2 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 16-06-17 15:35 Loading Loading @@ -292,6 +293,4 @@ abstract class AbstractVersionnedDocument { return $this->getFileName(); } } module/Oscar/src/Oscar/Entity/Actions.php +3 −2 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 23/02/16 15:18 Loading @@ -7,7 +8,6 @@ namespace Oscar\Entity; class Actions { const PROJECT_CREATE = 'PROJECT_CREATE'; Loading @@ -21,7 +21,8 @@ class Actions * * @return string[] */ public static function getActionsLabeled(){ public static function getActionsLabeled() { return [ self::PROJECT_CREATE => 'Créer un projet', self::PROJECT_EDIT => 'Éditer un projet', Loading module/Oscar/src/Oscar/Entity/Activity.php +19 −30 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 01/06/15 12:44 Loading Loading @@ -564,8 +565,7 @@ class Activity implements ResourceInterface { if ($this->getAmount()) { return 100 / $this->getAmount() * abs($this->getTotalSpent()); } else { } else { return 0; } } Loading Loading @@ -812,14 +812,12 @@ class Activity implements ResourceInterface $percent = sprintf(' (%s)', $value); } $data = $this->getAmount() / 100 * floatval($value); } else { } else { $data = floatval($value); } $out = number_format($data, 2, ',', ''); } else { } else { $out = "0,00"; } Loading Loading @@ -875,8 +873,7 @@ class Activity implements ResourceInterface $missings = []; if (!$this->getProject()) { $missings[] = _("L'activité doit être attachée à un projet avec un acronyme"); } elseif (!$this->getAcronym()) { } elseif (!$this->getAcronym()) { $missings[] = _("Le projet de l'activité doit avoir un acronyme"); } Loading Loading @@ -1316,8 +1313,7 @@ class Activity implements ResourceInterface { if ($this->getDateOpened()) { return $this->getDateOpened()->format($format); } else { } else { return ""; } } Loading Loading @@ -2040,8 +2036,7 @@ class Activity implements ResourceInterface if ($person == $activityPerson->getPerson()) { if ($role !== null && $activityPerson->getRoleObj() !== $role) { continue; } else { } else { $found = true; } } Loading Loading @@ -2107,8 +2102,7 @@ class Activity implements ResourceInterface } if (isset($this->_cachePersonsByRole[$role])) { return $this->_cachePersonsByRole[$role]; } else { } else { return []; } } Loading Loading @@ -2190,8 +2184,7 @@ class Activity implements ResourceInterface } if (isset($this->_cacheOrganizationsByRole[$role])) { return $this->_cacheOrganizationsByRole[$role]; } else { } else { return []; } } Loading Loading @@ -2234,8 +2227,7 @@ class Activity implements ResourceInterface $key = $document->getFileName(); if (!array_key_exists($key, $out)) { $out[$key] = $document; } else { } else { if ($out[$key]->getVersion() < $document->getVersion()) { $out[$key] = $document; } Loading Loading @@ -2358,8 +2350,10 @@ class Activity implements ResourceInterface { /** @var ActivityPayment $payment */ foreach ($this->getPayments() as $payment) { if ($payment->getDatePayment() == $datePayment && $payment->getAmount( ) == $amount && $payment->getDatePredicted() == $datePredicted) { if ( $payment->getDatePayment() == $datePayment && $payment->getAmount( ) == $amount && $payment->getDatePredicted() == $datePredicted ) { return true; } } Loading Loading @@ -2504,8 +2498,7 @@ class Activity implements ResourceInterface { if ($this->getDateStart()) { return $this->getDateStart()->format($format); } else { } else { return ""; } } Loading @@ -2520,8 +2513,7 @@ class Activity implements ResourceInterface { if ($this->getDateEnd()) { return $this->getDateEnd()->format($format); } else { } else { return ""; } } Loading @@ -2534,8 +2526,7 @@ class Activity implements ResourceInterface { if ($this->getDateSigned()) { return $this->getDateSigned()->format($format); } else { } else { return ""; } } Loading Loading @@ -2662,8 +2653,7 @@ class Activity implements ResourceInterface $versementsEffectues[] = $amount; $versementsEffectuesStr[] = $amount . ' le ' . $date; $versementsEffectuesDate[] = $date; } else { } else { if ($payment->getDatePredicted()) { $date = $payment->getDatePredicted()->format('d/m/Y'); $versementsPrevus[] = $amount; Loading Loading @@ -3087,8 +3077,7 @@ class Activity implements ResourceInterface $this->_noTimesheetReason = []; if (!$this->getProject()) { $reasons[] = "L'activité n'a pas de projet"; } elseif (!$this->getProject()->getAcronym()) { } elseif (!$this->getProject()->getAcronym()) { $reasons[] = "Le projet de l'activité n'a pas d'acronyme'"; } Loading Loading
module/Oscar/src/Oscar/Entity/AbstractTreeData.php +1 −0 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 18/06/15 12:01 Loading
module/Oscar/src/Oscar/Entity/AbstractTreeDataRepository.php +9 −7 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 18/06/15 12:05 Loading @@ -7,7 +8,6 @@ namespace Oscar\Entity; use Doctrine\ORM\EntityRepository; /** Loading @@ -22,7 +22,8 @@ class AbstractTreeDataRepository extends EntityRepository * @param AbstractTreeData $child * @param AbstractTreeData $parent */ public function addTo( AbstractTreeData $child, AbstractTreeData $parent ){ public function addTo(AbstractTreeData $child, AbstractTreeData $parent) { $parentRight = $parent->getRgt(); $em = $this->getEntityManager(); $child->setLft($parentRight); Loading Loading @@ -62,10 +63,10 @@ class AbstractTreeDataRepository extends EntityRepository $em->persist($child); $em->flush(); echo "SAVE"; } public function deleteNode( AbstractTreeData $child ){ public function deleteNode(AbstractTreeData $child) { // lft >= :lft / rgt <= :rgt } Loading Loading @@ -93,11 +94,12 @@ class AbstractTreeDataRepository extends EntityRepository ))->setMaxResults(1)->execute(); } public function getChildren( AbstractTreeData $node ){ public function getChildren(AbstractTreeData $node) { } public function getAll(){ public function getAll() { $query = $this->createQueryBuilder('t')->select()->addOrderBy('t.lft', 'ASC')->addOrderBy('t.rgt', 'ASC'); return $query->getQuery()->execute(); } Loading
module/Oscar/src/Oscar/Entity/AbstractVersionnedDocument.php +1 −2 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 16-06-17 15:35 Loading Loading @@ -292,6 +293,4 @@ abstract class AbstractVersionnedDocument { return $this->getFileName(); } }
module/Oscar/src/Oscar/Entity/Actions.php +3 −2 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 23/02/16 15:18 Loading @@ -7,7 +8,6 @@ namespace Oscar\Entity; class Actions { const PROJECT_CREATE = 'PROJECT_CREATE'; Loading @@ -21,7 +21,8 @@ class Actions * * @return string[] */ public static function getActionsLabeled(){ public static function getActionsLabeled() { return [ self::PROJECT_CREATE => 'Créer un projet', self::PROJECT_EDIT => 'Éditer un projet', Loading
module/Oscar/src/Oscar/Entity/Activity.php +19 −30 Original line number Diff line number Diff line <?php /** * @author Stéphane Bouvry<stephane.bouvry@unicaen.fr> * @date: 01/06/15 12:44 Loading Loading @@ -564,8 +565,7 @@ class Activity implements ResourceInterface { if ($this->getAmount()) { return 100 / $this->getAmount() * abs($this->getTotalSpent()); } else { } else { return 0; } } Loading Loading @@ -812,14 +812,12 @@ class Activity implements ResourceInterface $percent = sprintf(' (%s)', $value); } $data = $this->getAmount() / 100 * floatval($value); } else { } else { $data = floatval($value); } $out = number_format($data, 2, ',', ''); } else { } else { $out = "0,00"; } Loading Loading @@ -875,8 +873,7 @@ class Activity implements ResourceInterface $missings = []; if (!$this->getProject()) { $missings[] = _("L'activité doit être attachée à un projet avec un acronyme"); } elseif (!$this->getAcronym()) { } elseif (!$this->getAcronym()) { $missings[] = _("Le projet de l'activité doit avoir un acronyme"); } Loading Loading @@ -1316,8 +1313,7 @@ class Activity implements ResourceInterface { if ($this->getDateOpened()) { return $this->getDateOpened()->format($format); } else { } else { return ""; } } Loading Loading @@ -2040,8 +2036,7 @@ class Activity implements ResourceInterface if ($person == $activityPerson->getPerson()) { if ($role !== null && $activityPerson->getRoleObj() !== $role) { continue; } else { } else { $found = true; } } Loading Loading @@ -2107,8 +2102,7 @@ class Activity implements ResourceInterface } if (isset($this->_cachePersonsByRole[$role])) { return $this->_cachePersonsByRole[$role]; } else { } else { return []; } } Loading Loading @@ -2190,8 +2184,7 @@ class Activity implements ResourceInterface } if (isset($this->_cacheOrganizationsByRole[$role])) { return $this->_cacheOrganizationsByRole[$role]; } else { } else { return []; } } Loading Loading @@ -2234,8 +2227,7 @@ class Activity implements ResourceInterface $key = $document->getFileName(); if (!array_key_exists($key, $out)) { $out[$key] = $document; } else { } else { if ($out[$key]->getVersion() < $document->getVersion()) { $out[$key] = $document; } Loading Loading @@ -2358,8 +2350,10 @@ class Activity implements ResourceInterface { /** @var ActivityPayment $payment */ foreach ($this->getPayments() as $payment) { if ($payment->getDatePayment() == $datePayment && $payment->getAmount( ) == $amount && $payment->getDatePredicted() == $datePredicted) { if ( $payment->getDatePayment() == $datePayment && $payment->getAmount( ) == $amount && $payment->getDatePredicted() == $datePredicted ) { return true; } } Loading Loading @@ -2504,8 +2498,7 @@ class Activity implements ResourceInterface { if ($this->getDateStart()) { return $this->getDateStart()->format($format); } else { } else { return ""; } } Loading @@ -2520,8 +2513,7 @@ class Activity implements ResourceInterface { if ($this->getDateEnd()) { return $this->getDateEnd()->format($format); } else { } else { return ""; } } Loading @@ -2534,8 +2526,7 @@ class Activity implements ResourceInterface { if ($this->getDateSigned()) { return $this->getDateSigned()->format($format); } else { } else { return ""; } } Loading Loading @@ -2662,8 +2653,7 @@ class Activity implements ResourceInterface $versementsEffectues[] = $amount; $versementsEffectuesStr[] = $amount . ' le ' . $date; $versementsEffectuesDate[] = $date; } else { } else { if ($payment->getDatePredicted()) { $date = $payment->getDatePredicted()->format('d/m/Y'); $versementsPrevus[] = $amount; Loading Loading @@ -3087,8 +3077,7 @@ class Activity implements ResourceInterface $this->_noTimesheetReason = []; if (!$this->getProject()) { $reasons[] = "L'activité n'a pas de projet"; } elseif (!$this->getProject()->getAcronym()) { } elseif (!$this->getProject()->getAcronym()) { $reasons[] = "Le projet de l'activité n'a pas d'acronyme'"; } Loading