diff --git a/VERSIONS_WIP/37788 b/VERSIONS_WIP/37788 new file mode 100644 index 0000000000000000000000000000000000000000..96910de407312f64fd834285eccbb1ec529fe618 --- /dev/null +++ b/VERSIONS_WIP/37788 @@ -0,0 +1 @@ + - ticket #37788 : Cosmogramme : correction du lancement de certaines phase pour des types de fichiers ne les concernant pas \ No newline at end of file diff --git a/library/Class/Cosmogramme/Integration/PhasePanier.php b/library/Class/Cosmogramme/Integration/PhasePanier.php index c439a4c9493c38c605118c8590079c82962a1d28..5bfc1fecfe76f8480404a5350b3575356176cfbf 100644 --- a/library/Class/Cosmogramme/Integration/PhasePanier.php +++ b/library/Class/Cosmogramme/Integration/PhasePanier.php @@ -28,6 +28,9 @@ class Class_Cosmogramme_Integration_PhasePanier extends Class_Cosmogramme_Integr protected function _init($new_phase) {} protected function _validateProfil($profil) { + if (!$profil->isBaskets()) + return false; + $errors = []; $fields = $this->getFields($profil); diff --git a/library/Class/Cosmogramme/Integration/PhasePatrons.php b/library/Class/Cosmogramme/Integration/PhasePatrons.php index 95647b8719c08f82af05a96d58d6ad9a7d80d9a8..6a0c8517b8d678ef31727a56ce397ec54cd6c159 100644 --- a/library/Class/Cosmogramme/Integration/PhasePatrons.php +++ b/library/Class/Cosmogramme/Integration/PhasePatrons.php @@ -102,6 +102,9 @@ class Class_Cosmogramme_Integration_PhasePatrons extends Class_Cosmogramme_Integ /** return true if given profil parameters are correct for this phase */ protected function _validateProfil($profil) { + if (!$profil->isPatrons()) + return false; + $errors = []; $fields = $this->getFields($profil); diff --git a/library/Class/Cosmogramme/Integration/PhaseReservation.php b/library/Class/Cosmogramme/Integration/PhaseReservation.php index 78c9ecd6b19d77693a440f27bb08228f0474a524..e4b9a67cb7eefcfb957bbcbca4ab661fc735b967 100644 --- a/library/Class/Cosmogramme/Integration/PhaseReservation.php +++ b/library/Class/Cosmogramme/Integration/PhaseReservation.php @@ -29,15 +29,21 @@ class Class_Cosmogramme_Integration_PhaseReservation extends Class_Cosmogramme_I protected function _init($new_phase) {} + protected function _afterFileProcessed($integration) {} + protected function _validateProfil($profil) { return $profil->isHolds(); } + protected function _processLine($line, $integration) { $transaction = new Class_Cosmogramme_Integration_Transaction($integration); - $line->withDataDo([$transaction, 'importHold']); + $line->withDataDo( + function($data) use ($transaction){ + return $transaction->importHold($data); + }); } @@ -47,7 +53,7 @@ class Class_Cosmogramme_Integration_PhaseReservation extends Class_Cosmogramme_I protected function _shouldIgnoreLine($line, $integration) { - return $line->withDataDo([$this, 'isPergameHeader']); + return $line->withDataDo(function($data) { return $this->isPergameHeader($data); }); } diff --git a/library/Class/IntProfilDonnees.php b/library/Class/IntProfilDonnees.php index 34c90106e3d0b6c80e1627dbc5c832e98c9d9fc6..f26537f8fc5639c5d4e6da40b91d47ecaf0c22df 100644 --- a/library/Class/IntProfilDonnees.php +++ b/library/Class/IntProfilDonnees.php @@ -485,7 +485,6 @@ class Class_IntProfilDonnees extends Storm_Model_Abstract { } - public function setTypeDocField($value) { return $this->setItemField(self::FIELD_ITEM_TYPE_DOC, $value); } @@ -515,6 +514,17 @@ class Class_IntProfilDonnees extends Storm_Model_Abstract { return self::FT_RECORDS == $this->getTypeFichier(); } + + public function isBaskets() { + return self::FT_BASKETS == $this->getTypeFichier(); + } + + + public function isPatrons() { + return self::FT_PATRONS == $this->getTypeFichier(); + } + + public function getSeparator() { switch ($this->getFormat()) { case self::FORMAT_SEMI_COLON_ASCII : return ';';break;