From 85d940ae6fddf6c8ca27dd50edb890a2c7cf2d8a Mon Sep 17 00:00:00 2001
From: gloas <gloas@git-test.afi-sa.fr>
Date: Mon, 10 Jun 2013 07:54:56 +0000
Subject: [PATCH] Skin: ajout modification barre de lien

---
 .gitattributes                                         |  2 ++
 .../opac/views/scripts/panier/ajout-ajax-success.phtml |  8 ++++++++
 library/ZendAfi/View/Helper/Notice/LienReserver.php    |  9 ++++-----
 public/opac/js/subModal.js                             | 10 ++++++++++
 4 files changed, 24 insertions(+), 5 deletions(-)
 create mode 100644 application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml
 create mode 100644 public/opac/js/subModal.js

diff --git a/.gitattributes b/.gitattributes
index 67fe8e54ac8..deff2ceb122 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -781,6 +781,7 @@ application/modules/opac/views/scripts/oai/list-metadata-formats.xml.phtml -text
 application/modules/opac/views/scripts/oai/list-records.xml.phtml -text svneol=unset#application/xml
 application/modules/opac/views/scripts/oai/list-sets.xml.phtml -text svneol=unset#application/xml
 application/modules/opac/views/scripts/panier/_panier_row.phtml -text
+application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml -text
 application/modules/opac/views/scripts/panier/error.phtml -text
 application/modules/opac/views/scripts/panier/export.phtml -text
 application/modules/opac/views/scripts/panier/index.phtml -text
@@ -4317,6 +4318,7 @@ public/opac/js/mootools.js -text
 public/opac/js/plan_acces.js -text
 public/opac/js/prototype.js -text
 public/opac/js/recherche.js -text
+public/opac/js/subModal.js -text
 public/opac/js/swfobject.js -text
 public/opac/skins/modele/css/calendar.css -text
 public/opac/skins/modele/css/dialog.css -text
diff --git a/application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml b/application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml
new file mode 100644
index 00000000000..db28f87eea9
--- /dev/null
+++ b/application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml
@@ -0,0 +1,8 @@
+<?php 
+$urlPanier = $this->url(['controller' => 'panier', 
+												 'action' => 'index',
+												 'id_panier' => $this->panier->getId()], null, true);
+?>
+<div class="ajout-result"><span>La notice <?php echo $this->notice->getTitrePrincipal();?> a bien été ajoutée au panier <?php echo $this->panier->getLibelle();?></span>
+<a href="#">Retour à la liste</a>
+<a href="<?php echo $urlPanier;?>#panier_contenu">Voir le panier</a></div>
\ No newline at end of file
diff --git a/library/ZendAfi/View/Helper/Notice/LienReserver.php b/library/ZendAfi/View/Helper/Notice/LienReserver.php
index fd12ee0ccca..57b2b74c8ed 100644
--- a/library/ZendAfi/View/Helper/Notice/LienReserver.php
+++ b/library/ZendAfi/View/Helper/Notice/LienReserver.php
@@ -21,7 +21,7 @@
 class ZendAfi_View_Helper_Notice_LienReserver extends Zend_View_Helper_HtmlElement {
 	protected $_script_added = false;
 
-	public function getScriptDialog() {
+	public function getScriptDialog($titrePrincipal) {
 		return '
 			var showPopWin = opacShowModal;
 			var hidePopWin = opacHideModal;
@@ -32,15 +32,14 @@ class ZendAfi_View_Helper_Notice_LienReserver extends Zend_View_Helper_HtmlEleme
 			}
 
 			var openDialogExemplaires = function(id_notice, anchor) {
-				var img_patience = $(\'<img src="'.URL_ADMIN_IMG.'patience.gif" style="vertical-align:middle"/>\').prependTo(anchor);
 				$.ajax({url: "'.$this->view->url(['controller' => 'noticeajax', 'action' => 'exemplaires'], null, true).'/id_notice/"+id_notice})
 				.done(function(data) {
-						img_patience.remove();
 						var dialog_reserver = $(\'<div id="dialog_reserver"></div>\')
 							.html(data)
 							.dialog({width: 800, 
 										   modal: true, 
-										   title: "'.$this->view->_("Exemplaires").'",
+                       dialogClass: "reservation-exemplaires",
+										   title: "'.$this->view->_("Réserver ").'",
 								       open: function() {
 									             $(\'div.ui-widget-overlay\').click(closeDialogExemplaires);
 									            }});
@@ -67,7 +66,7 @@ class ZendAfi_View_Helper_Notice_LienReserver extends Zend_View_Helper_HtmlEleme
 		if (!$this->_script_added) {
 			Class_ScriptLoader::getInstance()
 				->addOPACScript('subModal')
-				->addInlineScript($this->getScriptDialog());
+				->addInlineScript($this->getScriptDialog($notice->getTitrePrincipal()));
 			$this->_script_added = true;
 		}
 
diff --git a/public/opac/js/subModal.js b/public/opac/js/subModal.js
new file mode 100644
index 00000000000..7b26b6aef78
--- /dev/null
+++ b/public/opac/js/subModal.js
@@ -0,0 +1,10 @@
+var popupDialog = null;
+
+function opacShowModal(url, width, height, returnFunc, showCloseBox) {
+    popupDialog = $('<iframe src="'+url+'" style="min-width:95%"></div>')
+	.dialog({width: width, height: height, close: returnFunc, modal:true});
+}
+
+function opacHideModal() {
+    $(popupDialog).dialog('close');
+}
-- 
GitLab