diff --git a/cosmogramme/cosmozend/application/modules/cosmo/views/scripts/data-profile/index.phtml b/cosmogramme/cosmozend/application/modules/cosmo/views/scripts/data-profile/index.phtml index a14977fd2f1adeee97056ec89b0a69e8fb9847cf..f1524784bbac0547b89e927ef009e0f440e0bf1b 100644 --- a/cosmogramme/cosmozend/application/modules/cosmo/views/scripts/data-profile/index.phtml +++ b/cosmogramme/cosmozend/application/modules/cosmo/views/scripts/data-profile/index.phtml @@ -13,10 +13,12 @@ echo $this->tag('div', echo $this->tagModelTable($this->data_profiles, [$this->_('Libellé'), $this->_('Type de fichier'), - $this->_('Format')], + $this->_('Format'), + $this->_('Utilisé par une intégration')], ['libelle', 'filetype-label', - 'format-label'], + 'format-label', + 'is-used-label'], [['action' => 'edit', 'content' => $this->boutonIco('type=edit')], ['action' => 'delete', 'content' => $this->boutonIco('type=del')] ], '' ); diff --git a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerTest.php b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerTest.php index 494405d9291e878ee766c557ee43c797882b8aa4..0537851b28ea71a6dcd78571177708a047c9b230 100644 --- a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerTest.php +++ b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerTest.php @@ -103,6 +103,12 @@ class Cosmo_DataProfileControllerIndexTest extends Cosmo_DataProfileControllerTe } + /** @test */ + public function thirdTrShouldContainsNonUsedFlag() { + $this->assertXPathContentContains('//table//tr[3]/td[4]', 'Non'); + } + + /** @test */ public function secondTrShouldContainsLinkEditKohaProfile() { $this->assertXPath('//table//tr[2]/td/a[contains(@href, "/cosmo/data-profile/edit/id/56")]'); diff --git a/library/Class/IntProfilDonnees.php b/library/Class/IntProfilDonnees.php index 748013479b36dd1100ef55e7ea4c1e0a72165f36..af566875bedf5a590d28aa4bb2222bb2a4a08347 100644 --- a/library/Class/IntProfilDonnees.php +++ b/library/Class/IntProfilDonnees.php @@ -769,6 +769,13 @@ class Class_IntProfilDonnees extends Storm_Model_Abstract { } + public function getIsUsedLabel() { + return 0 < Class_IntMajAuto::countBy(['profil' => $this->getId()]) + ? $this->_('Oui') + : $this->_('Non'); + } + + public function getXmlPatronField() { return $this->getProfilePrefs()->getPatronXmlField(); }