Skip to content
Snippets Groups Projects
Commit 733c210c authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #50082 fix errors⎋

parent 27127192
Branches
Tags
6 merge requests!2080Sandbox detach zf from storm,!2061Master,!2009Master,!2008Hotline master,!2003Hotline#50082 mixed records links in loans list,!1917[WIP] Hotline#50082 mixed records links in loans list
......@@ -365,57 +365,10 @@ function chercher_videos(sId,sAuteur,sTitre) {
////////////////////////////////////////////////////////////////////////////////////
// Réservation de notice en ajax (pour comm sigb)
///////////////////////////////////////////////////////////////////////////////////
function reservationAjax(oImg,nIdBib,sIdOrigine, sCodeAnnexe)
{
var sUrl=baseUrl+'/recherche/reservationajax?id_bib='+nIdBib+"&id_origine="+sIdOrigine+"&code_annexe="+sCodeAnnexe;
var saveImg=$(oImg).attr('src');
$(oImg).attr('src',imagesUrl+'patience.gif');
$.getJSON(sUrl, function(data) {
$(oImg).attr('src',saveImg);
if (data.indexOf('http') == 0)
showPopWin(data, 500, 345,
function(event, ui) {
if (undefined == event.currentTarget)
reservationAjax(oImg,nIdBib,sIdOrigine, sCodeAnnexe);
});
else
alert(data);
});
}
var pickupImgCallback;
var pickupConfirmCallBack;
function reservationPickupAjax(oImg,nIdBib,sIdOrigine,sCodeAnnexe)
{
var sUrl = baseUrl+'/recherche/reservation-pickup-ajax?id_bib='+nIdBib+"&id_origine="+sIdOrigine+"&code_annexe="+sCodeAnnexe;
var saveImg = $(oImg).attr('src');
pickupImgLoadingCallback = function() {
$(oImg).attr('src', saveImg);
};
pickupConfirmCallBack = function(form) {
reservationPickupAjaxCancel();
var sCodeAnnexe = $(form).find('input:radio[name="code_annexe"]:checked').val();
reservationAjax(oImg, nIdBib, sIdOrigine, sCodeAnnexe);
};
var img = $(oImg).attr('src');
$(oImg).attr('src',imagesUrl+'patience.gif');
showPopWin(sUrl, 500, 345, function(){$(oImg).attr('src',img);});
}
function reservationPickupAjaxCancel() {
pickupImgLoadingCallback();
hidePopWin(false);
}
function reservationPickupAjaxConfirm(form) {
pickupConfirmCallBack(form);
}
var scrollToSelectedNoticeInResult = function() {
......
......@@ -746,7 +746,9 @@ class AbonneControllerPretsExtendAllLoansErrorThreePretsTest extends AbonneContr
return $this->mock()
->whenCalled('prolongerPret')
->answers(['statut' => 0,
'erreur' => utf8_encode('Prolongation impossible, votre abonnement est chu.')]);
'erreur' => utf8_encode('Prolongation impossible, votre abonnement est chu.')])
->whenCalled('getIntBib')
->answers(null);
}
......@@ -777,7 +779,10 @@ class AbonneControllerPretsExtendAllLoansSuccessAndErrorThreePretsTest extends A
->whenCalled('prolongerPret')
->with($this->florence, '13')
->answers(['statut' => 0,
'erreur' => 'Prolongation interdite pour ce type de document.']);
'erreur' => 'Prolongation interdite pour ce type de document.'])
->whenCalled('getIntBib')
->answers(null);
}
......@@ -835,7 +840,9 @@ class AbonneControllerPretsPeriodicalTitleTest extends AbstractAbonneControllerP
Class_CommSigb::setInstance($this->mock()
->whenCalled('ficheAbonne')
->answers(['fiche' => $patron]));
->answers(['fiche' => $patron])
->whenCalled('getIntBib')
->answers(null));
$record = $this->fixture('Class_Notice',
['id' => 889,
......
......@@ -125,20 +125,19 @@ class RechercheControllerReservationPickupAjaxActionTestWithChosenPickupDispatch
->whenCalled('isConnected')->answers(true)
->whenCalled('reserverExemplaire')->answers(true);
Class_WebService_SIGB_Nanook::setService($this->nanook);
ZendAfi_Auth::getInstance()->logUser($this->jajm);
Class_CosmoVar::newInstanceWithId('site_retrait_resa', ['valeur' => 1]);
$this->dispatch('recherche/reservationajax/id/11760/id_int_bib/23/id_bib/23/id_origine/594105/code_annexe/23/render/popup',true);
$this->_json = json_decode($this->_response->getBody());
$this->_xpath = new Storm_Test_XPath();
$this->fixture('Class_Exemplaire',
['id' => 12]);
$this->dispatch('recherche/reservationajax/id/11760/id_int_bib/23/id_bib/23/id_origine/594105/code_annexe/23/render/popup/copy_id/12',true);
}
/** @test */
public function parameterCodeAnnexeShouldBeUsedForReservation() {
$this->assertEquals('23',
......@@ -170,6 +169,7 @@ class RechercheControllerReservationPickupAjaxActionTestWithPatronLibraryPickup
$this->nanook = Storm_Test_ObjectWrapper::mock()
->whenCalled('isConnected')->answers(true)
->whenCalled('reserverExemplaire')->answers(true)
->whenCalled('providesPickupLocations')->answers(false)
->whenCalled('getUserAnnexe')->answers('12');
Class_WebService_SIGB_Nanook::setService($this->nanook);
......@@ -190,9 +190,10 @@ class RechercheControllerReservationPickupAjaxActionTestWithPatronLibraryPickup
Class_CosmoVar::newInstanceWithId('site_retrait_resa', ['valeur' => 2]);
$this->dispatch('recherche/reservation-pickup-ajax?id_bib=2&id_origine=12&code_annexe=ANN',true);
$this->_json = json_decode($this->_response->getBody());
$this->_xpath = new Storm_Test_XPath();
$this->fixture('Class_Exemplaire',
['id' => 12]);
$this->dispatch('recherche/reservation-pickup-ajax?id_bib=2&id_origine=12&code_annexe=ANN&copy_id=12',true);
}
......@@ -225,6 +226,7 @@ class RechercheControllerReservationPickupAjaxActionTestWithItemLibraryPickup ex
$this->nanook = Storm_Test_ObjectWrapper::mock()
->whenCalled('isConnected')->answers(true)
->whenCalled('providesPickupLocations')->answers(false)
->whenCalled('reserverExemplaire')->answers(true);
......@@ -245,9 +247,10 @@ class RechercheControllerReservationPickupAjaxActionTestWithItemLibraryPickup ex
->setCode('CRN')));
Class_CosmoVar::newInstanceWithId('site_retrait_resa', ['valeur' => 0]);
$this->dispatch('recherche/reservation-pickup-ajax?id_bib=2&id_origine=12&code_annexe=ANN',true);
$this->_json = json_decode($this->_response->getBody());
$this->_xpath = new Storm_Test_XPath();
$this->fixture('Class_Exemplaire',
['id' => 12]);
$this->dispatch('recherche/reservation-pickup-ajax?id_bib=2&id_origine=12&code_annexe=ANN&copy_id=12',true);
}
/** @test */
......@@ -261,6 +264,8 @@ class RechercheControllerReservationPickupAjaxActionTestWithItemLibraryPickup ex
}
class RechercheControllerReservationWithMailPostAction extends AbstractControllerTestCase {
protected $_sent_mails;
......
......@@ -173,7 +173,7 @@ class BiblixNetGetPatronInfoJustinTicou extends BiblixNetTestCase {
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Exemplaire')
->whenCalled('findFirstBy')
->with(['id_int_bib not' => [null, 0],
->with(['id_int_bib' => [0],
'code_barres' => '1069005966314'])
->answers(
Class_Exemplaire::getLoader()
......@@ -184,7 +184,7 @@ class BiblixNetGetPatronInfoJustinTicou extends BiblixNetTestCase {
->whenCalled('findFirstBy')
->with(['id_origine' => '00000007307',
'id_int_bib not' => ['00000007307', 0]])
'id_int_bib' => [0]])
->answers(
Class_Exemplaire::getLoader()
->newInstanceWithId(36)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment