diff --git a/VERSIONS_HOTLINE/65088 b/VERSIONS_HOTLINE/65088 new file mode 100644 index 0000000000000000000000000000000000000000..687cdc99cadaa791ffb502fcac4960fad147933b --- /dev/null +++ b/VERSIONS_HOTLINE/65088 @@ -0,0 +1 @@ + - ticket #65088 : Cosmogramme : SIGB Nanook : Perte de l'historique des traitements \ No newline at end of file diff --git a/library/Class/Cosmogramme/Generator.php b/library/Class/Cosmogramme/Generator.php index ebbd3aa3c179ed1b8b1486ca3c0dc2f8d9fc3a09..a90906123e2ec9afdf9527f18c573f7724653029 100644 --- a/library/Class/Cosmogramme/Generator.php +++ b/library/Class/Cosmogramme/Generator.php @@ -164,18 +164,19 @@ class Class_Cosmogramme_Generator { 'visibilite' => Class_Bib::V_DATA]) ->save(); - Class_IntBib::deleteBy(['id_bib' => $bib->getIdSite()]); - $int_bib = Class_IntBib::newInstance(['id_bib' => $bib->getIdSite(), - 'nom' => $bib->getLibelle(), - 'nom_court' => $bib->getLibelle(), - 'qualite' => 5, - 'sigb' => $this->_params['type_sigb'], - 'planif_mode' => 'r', - 'planif_jours' => '1111111', - 'comm_sigb' => Class_IntBib::COM_PERGAME, - 'comm_params' => serialize(['Autoriser_docs_disponibles' => '0', - 'Max_par_carte' => '3', - 'Max_par_document' => '3'])]); + if (!$int_bib = Class_IntBib::findFirstBy(['id_bib' => $bib->getIdSite()])) + $int_bib = Class_IntBib::newInstance(['id_bib' => $bib->getIdSite()]); + + $int_bib->updateAttributes(['nom' => $bib->getLibelle(), + 'nom_court' => $bib->getLibelle(), + 'qualite' => 5, + 'sigb' => $this->_params['type_sigb'], + 'planif_mode' => 'r', + 'planif_jours' => '1111111', + 'comm_sigb' => Class_IntBib::COM_PERGAME, + 'comm_params' => serialize(['Autoriser_docs_disponibles' => '0', + 'Max_par_carte' => '3', + 'Max_par_document' => '3'])]); if ($this->isNanook()) $int_bib diff --git a/library/ZendAfi/Form/Configuration/Widget/Articles.php b/library/ZendAfi/Form/Configuration/Widget/Articles.php index 5898df1e684c70b4db0d38270852a7597ba0f91b..e229b986fe1f88e7a00b27af599eed3a6a11228f 100644 --- a/library/ZendAfi/Form/Configuration/Widget/Articles.php +++ b/library/ZendAfi/Form/Configuration/Widget/Articles.php @@ -59,9 +59,9 @@ class ZendAfi_Form_Configuration_Widget_Articles extends ZendAfi_Form_Configurat Class_ScriptLoader::getInstance() ->addJQueryReady( - 'formSelectToggleVisibilityForElement("input[name=\'display_order\']", "#fieldset-display_settings_group tr:nth-child(2)", ["DateCreationDesc", "DebutPublicationDesc", "EventDebut", "Random", "CommentCount"]);' + 'radioToggleVisibilityForElement("input[name=\'display_order\']", $("#nb_aff").closest("tr"), ["DateCreationDesc", "DebutPublicationDesc", "EventDebut", "Random", "CommentCount"]);' - . 'formSelectToggleVisibilityForElement("input[name=\'display_order\']", "#fieldset-display_settings_group tr:nth-child(3)", "Random");' + . 'radioToggleVisibilityForElement("input[name=\'display_order\']", $("#nb_analyse").closest("tr"), "Random");' . 'checkBoxToggleVisibilityForElement("#allow_link_on_title", $("#anchor").closest("tr"), true);'); } diff --git a/library/ZendAfi/View/Helper/Admin/Button/Back.php b/library/ZendAfi/View/Helper/Admin/Button/Back.php index e5af79cd6286c57f398bc2ac83b9082a44cbfdb9..9fbbeac3c90b7efb5ac5d59967ab8c7f6bbf71eb 100644 --- a/library/ZendAfi/View/Helper/Admin/Button/Back.php +++ b/library/ZendAfi/View/Helper/Admin/Button/Back.php @@ -23,7 +23,8 @@ class ZendAfi_View_Helper_Admin_Button_Back extends ZendAfi_View_Helper_Button_Back { protected function _getDefaultAttribs() { return array_merge(parent::_getDefaultAttribs(), - ['class' => 'back']); + ['class' => 'back', + 'data-popup' => 'false']); } @@ -31,6 +32,6 @@ class ZendAfi_View_Helper_Admin_Button_Back extends ZendAfi_View_Helper_Button_B return parent::_getDefaultButton($attribs) ->setImage($this->view->tagImg(Class_Admin_Skin::current() ->getIconUrl('buttons', - 'back'))); + 'back'))); } } \ No newline at end of file diff --git a/public/admin/js/global.js b/public/admin/js/global.js index d1a37eeed668756b24891a9ed01b66017f6e95e0..f85a69a84603e980cbadb02d74f2e28aa0c48fc8 100644 --- a/public/admin/js/global.js +++ b/public/admin/js/global.js @@ -80,6 +80,7 @@ function centrer_popup(oPopup) oPopup.style.top=document.body.scrollTop + Math.floor((screen.height - oPopup.clientHeight)/2)-100; } + function scroll_popup(sId,nPos,nStopY) { oPopup=document.getElementById(sId); @@ -95,6 +96,7 @@ function scroll_popup(sId,nPos,nStopY) if(nY > nStopY) setTimeout("scroll_popup('"+sId+"',"+nY+","+nStopY+")",5); } + function fermer_scroll_popup(sId,nPos) { oPopup=document.getElementById(sId); @@ -184,6 +186,17 @@ function formSelectToggleVisibilityForElement(eventSourceSelector, objectToShowS } +function radioToggleVisibilityForElement(eventSourceSelector, objectToShowSelector, visibleForValues) { + if (!(visibleForValues instanceof Array)) + visibleForValues = [visibleForValues]; + + return toggleVisibilityForElement(eventSourceSelector, + objectToShowSelector, + function(element) { + return ($(element).attr('checked') == 'checked') && (0 <= $.inArray(element.val(), visibleForValues)); + }); +} + function checkBoxToggleVisibilityForElement(eventSourceSelector, objectToShowSelector, visibleWhenChecked) { return toggleVisibilityForElement(eventSourceSelector, @@ -194,7 +207,6 @@ function checkBoxToggleVisibilityForElement(eventSourceSelector, objectToShowSel } - function toggleVisibilityForElement(eventSourceSelector, objectToShowSelector, testingAlgorithm) { var objectToShow = $(objectToShowSelector); var sourceObject = $(eventSourceSelector); @@ -213,13 +225,13 @@ function toggleVisibilityForElement(eventSourceSelector, objectToShowSelector, t } - function showCmsAvis(idCmsAvis) { avis = document.getElementById(idCmsAvis); avis.style.display = 'block'; } + function hideCmsAvis(idCmsAvis) { avis = document.getElementById(idCmsAvis); @@ -227,7 +239,6 @@ function hideCmsAvis(idCmsAvis) { } - function openIFrameDialog(url, title) { var iframe = $('<iframe style="padding: 0px"></iframe>'); iframe.dialog({title: title, modal: true, width: 600, height: 400 }); diff --git a/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php b/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php index 1adc0d8bfc722fd29a1f738817ebbb0c93188840..b8a24d4f2d621f541f39f5c8cf23b111762eec73 100644 --- a/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php +++ b/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php @@ -479,7 +479,6 @@ class PhasePrepareIntegrationsNanookStandardTest $this->fixture('Class_Cosmogramme_Generator_FixedIdBib', ['id' => 2, - //'id_site' => 2, 'libelle' => 'My library', 'ville' => 'My city', 'id_zone' => 1, @@ -496,12 +495,24 @@ class PhasePrepareIntegrationsNanookStandardTest 'rang' => 100, 'taille_min_import_total' => 0]); + $this->fixture('Class_Cosmogramme_Integration', + ['id' => 990, + 'id_bib' => 2, + 'type_operation' => Class_Cosmogramme_Integration::TYPE_OPERATION_TOTAL, + 'profil' => 102]); + $this->fixture('Class_IntBib', ['id' => 3, 'nom_court' => 'Old library', 'sigb' => Class_IntBib::SIGB_NANOOK]); $this->fixture('Class_IntMajAuto', ['id' => 1, 'id_bib' => 3]); + + $this->fixture('Class_Cosmogramme_Integration', + ['id' => 555, + 'id_bib' => 3, + 'type_operation' => Class_Cosmogramme_Integration::TYPE_OPERATION_TOTAL, + 'profil' => 102]); } @@ -578,9 +589,21 @@ class PhasePrepareIntegrationsNanookStandardTest } + /** @test */ + public function runQueuOfRemovedLibraryShouldNotBeLost() { + $this->assertNotEmpty(Class_Cosmogramme_Integration::findAllBy(['id_bib' => 3])); + } + + /** @test */ public function updatedLibraryShouldKeepPreviousCity() { $this->assertEquals('My city', Class_Cosmogramme_Generator_FixedIdBib::find(2)->getVille()); } + + + /** @test */ + public function updatedLibraryRunQueueShouldNotBeLost() { + $this->assertNotEmpty(Class_IntBib::find(2)->getIntegrations()); + } } \ No newline at end of file