diff --git a/VERSIONS_HOTLINE/72797 b/VERSIONS_HOTLINE/72797 new file mode 100644 index 0000000000000000000000000000000000000000..a340c2f2a0b800fae35683924bb9e89c312190b4 --- /dev/null +++ b/VERSIONS_HOTLINE/72797 @@ -0,0 +1,2 @@ + - ticket #72797 : Administration : correction du placement de la localisation de documents sur un plan. + \ No newline at end of file diff --git a/application/modules/admin/controllers/BibController.php b/application/modules/admin/controllers/BibController.php index 5c1ed5701526c36b2a22a9e0415e5ecad5de0a64..9ef8c5dc22073eeaf0d1eb9d3324a77bc1147a0b 100644 --- a/application/modules/admin/controllers/BibController.php +++ b/application/modules/admin/controllers/BibController.php @@ -65,8 +65,10 @@ class Admin_BibController extends ZendAfi_Controller_Action { protected function _checkPost($localisation) { $this->view->localisation = $localisation; + if (!$this->_request->isPost()) return false; + $erreurs=[]; $data = $this->_request->getPost(); if ($data) @@ -85,8 +87,7 @@ class Admin_BibController extends ZendAfi_Controller_Action { if (!$localisation->save()) return false; - $this->_redirect('admin/bib/localisations/id_bib/'.$id_bib); - return true; + return $this->_redirectToReferer(); } diff --git a/application/modules/admin/views/scripts/bib/localisationsmaj.phtml b/application/modules/admin/views/scripts/bib/localisationsmaj.phtml index 5791a3e6bdc5794525a61ba7a43eddce13495d1f..b418c794ee1886bcd7fb6a06647b0b3dd62ce20e 100644 --- a/application/modules/admin/views/scripts/bib/localisationsmaj.phtml +++ b/application/modules/admin/views/scripts/bib/localisationsmaj.phtml @@ -4,75 +4,80 @@ Class_ScriptLoader::getInstance()->addTagSelection(); <link rel="stylesheet" type="text/css" media="screen" href="<?php echo URL_ADMIN_JS ?>slimbox/slimbox2.css"> <script type="text/javascript" src="<?php echo URL_ADMIN_JS?>slimbox/slimbox2.js"> </script> -<script type="text/javascript" src="<?php echo URL_ADMIN_JS?>jquery_ui/jquery.ui.core.min.js"> </script> -<script type="text/javascript" src="<?php echo URL_ADMIN_JS?>jquery_ui/jquery.ui.widget.min.js"> </script> -<script type="text/javascript" src="<?php echo URL_ADMIN_JS?>jquery_ui/jquery.ui.mouse.min.js"> </script> -<script type="text/javascript" src="<?php echo URL_ADMIN_JS?>jquery_ui/jquery.ui.draggable.min.js"> </script> <script> - // Rendre le point draggable et effacer le x,y si on change de plan - $(function() - { - $('#point_localisation').draggable - ({ - containment: '#lbImage', - drag: function(event, ui) - { - container=$('#lbImage').offset(); - $('#POS_Y').attr('value',ui.position.top-container.top); - $('#POS_X').attr('value',ui.position.left-container.left); - } - }) - $('#id_plan').change(function() - { - $('#POS_X').attr('value','0'); - $('#POS_Y').attr('value','0'); - }); - }); - - - // Init function de fin du load ajax - jQuery(function($) - { - $('#plan').ajaxStop(function() - { - $('#patience').css('display','none'); - if($(this).html()=="ERREUR") {alert("Impossible de trouver l'image de ce plan."); return;} - $('#ref_plan').attr('title',$('#libelle').val()); - jQuery(function($) { - $("a[rel^='lightbox']").slimbox({onClose:function(){$('#point_localisation').css('display','none')}},null,null); - }); - $('#point_localisation > img').attr('src',$('#select_ANIMATION').attr('src')); - $('#img_plan').trigger('click'); - imageLoaded(); - }); - }); - - // Verif si le slimbox est affiché - function imageLoaded() - { - if($('#lbBottomContainer').css('display')=='none') - { - window.setTimeout(imageLoaded,1000); - return; - } - container=$('#lbImage').offset(); - x=container.left+parseInt($('#POS_X').val()); - y=container.top+parseInt($('#POS_Y').val()); - $('#point_localisation') - .css('display','block') - .css('top',y+'px') - .css('left',x+'px'); - } - - // Affichage du plan - function afficherPlan() - { - var id_plan=$("#id_plan").val(); - if(id_plan=="0") {alert("Sélectionnez le plan a associer à cette localisation."); return; } - $('#patience').css('display','block'); - $('#plan').load('<?php echo BASE_URL ?>/admin/bib/ajaximageplan/id_plan/'+id_plan); - } + // Rendre le point draggable et effacer le x,y si on change de plan + $(function() + { + $('#point_localisation').draggable( + { + containment: '#lbImage', + drag: function(event, ui) { + container=$('#lbImage').offset(); + $('.modules .form input').change(); + $('#POS_Y').attr('value',ui.position.top-container.top); + $('#POS_X').attr('value',ui.position.left-container.left); + } + }); + $('#id_plan').change(function() { + $('#POS_X').attr('value','0'); + $('#POS_Y').attr('value','0'); + }); + }); + + + function displayPlan() { + $('#patience').hide(); + + if($('#plan').html()=="ERREUR") { + alert("Impossible de trouver l'image de ce plan."); + return; + } + + $('#ref_plan').attr('title', + $('#libelle').val()); + + $("a[rel^='lightbox']").slimbox({ + onClose:function() { + $('#point_localisation').css('display','none')} + }, + null, + null); + + $('#point_localisation > img').attr('src', $('#select_ANIMATION').attr('src')); + $('#img_plan').trigger('click'); + imageLoaded(); + } + + // Verif si le slimbox est affiché + function imageLoaded() { + if($('#lbBottomContainer').css('display') == 'none') { + window.setTimeout(imageLoaded, 1000); + return; + } + $('#lbBottomContainer, #lbBottomContainer * ').css('z-index', '9998'); + + container=$('#lbImage').offset(); + x=container.left+parseInt($('#POS_X').val()); + y=container.top+parseInt($('#POS_Y').val()); + $('#point_localisation') + .css('display','block') + .css('top',y+'px') + .css('left',x+'px'); + } + + // Affichage du plan + function afficherPlan() { + $('#patience').show(); + var id_plan = $("#id_plan").val(); + + if(id_plan=="0") { + alert("Sélectionnez le plan a associer à cette localisation."); + return; + } + + $('#plan').load('<?php echo BASE_URL ?>/admin/bib/ajaximageplan/id_plan/'+id_plan, [], displayPlan()); + } </script> <div id="plan" style="display:none"></div> @@ -80,7 +85,6 @@ Class_ScriptLoader::getInstance()->addTagSelection(); <h3>Bibliothèque : <?php echo $this->nom_bib ?></h3> -<center> <div class="form" align="center" > <form name="form" action="<?php echo $this->url() ?>" method="post"> @@ -112,7 +116,7 @@ Class_ScriptLoader::getInstance()->addTagSelection(); <input type="hidden" name="POS_Y" id="POS_Y" value="<?php echo $this->localisation->getPosY() ?>"> <?php echo $this->formSelect("id_plan", $this->localisation->getPlan() ? $this->localisation->getPlan()->getId(): 0,"",$this->plans) ?> - <a href="#" onclick="afficherPlan()">» Placer sur le plan</a> + <a href="#" onclick="afficherPlan();">» Placer sur le plan</a> </td> </tr> @@ -182,21 +186,12 @@ Class_ScriptLoader::getInstance()->addTagSelection(); </tr> </table> </fieldset> - - <table> - <tr> - <td align="right" style="padding-right:5px;"> - <?php echo $this->button_Submit(); ?> - </td> - <td align="left" style="padding-left:5px;"> - <?php - echo $this->button_Back( - (new Class_Entity())->setUrl($this->url(['action' => 'localisations', - 'id_bib' => $this->id_bib]))); - ?> - </td> - </tr> - </table> </form> + <?php + $back_buttton_settings = (new Class_Entity())->setUrl($this->url(['action' => 'localisations', + 'id_bib' => $this->id_bib])); + echo $this->tag('div', + $this->button_Submit() . $this->button_Back($back_buttton_settings), + ['class' => 'admin-buttons']); + ?> </div> -</center>