View | Details | Raw Unified | Return to bug 20737
Collapse All | Expand All

(-)a/C4/External/BakerTaylor.pm (-3 / +3 lines)
Lines 44-50 sub _initialize { Link Here
44
	$user     = (@_ ? shift : C4::Context->preference('BakerTaylorUsername')    ) || ''; # LL17984
44
	$user     = (@_ ? shift : C4::Context->preference('BakerTaylorUsername')    ) || ''; # LL17984
45
	$pass     = (@_ ? shift : C4::Context->preference('BakerTaylorPassword')    ) || ''; # CC82349
45
	$pass     = (@_ ? shift : C4::Context->preference('BakerTaylorPassword')    ) || ''; # CC82349
46
	$link_url = (@_ ? shift : C4::Context->preference('BakerTaylorBookstoreURL'));
46
	$link_url = (@_ ? shift : C4::Context->preference('BakerTaylorBookstoreURL'));
47
        $image_url = "http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value=";
47
        $image_url = "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value=";
48
	$agent = "Koha/$VERSION [en] (Linux)";
48
	$agent = "Koha/$VERSION [en] (Linux)";
49
			#"Mozilla/4.76 [en] (Win98; U)",	#  if for some reason you want to go stealth, you might prefer this
49
			#"Mozilla/4.76 [en] (Win98; U)",	#  if for some reason you want to go stealth, you might prefer this
50
}
50
}
Lines 70-76 sub content_cafe_url { Link Here
70
	($user and $pass) or return;
70
	($user and $pass) or return;
71
	my $isbn = (@_ ? shift : '');
71
	my $isbn = (@_ ? shift : '');
72
	$isbn =~ s/(p|-)//g;	# sanitize
72
	$isbn =~ s/(p|-)//g;	# sanitize
73
	return "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn";
73
	return "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn";
74
}
74
}
75
75
76
sub http_jacket_link {
76
sub http_jacket_link {
Lines 90-96 sub availability { Link Here
90
	my $isbn = shift or return;
90
	my $isbn = shift or return;
91
	($user and $pass) or return;
91
	($user and $pass) or return;
92
	$isbn =~ s/(p|-)//g;	# sanitize
92
	$isbn =~ s/(p|-)//g;	# sanitize
93
	my $url = "http://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn";
93
	my $url = "https://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn";
94
	$debug and warn __PACKAGE__ . " request:\n$url\n";
94
	$debug and warn __PACKAGE__ . " request:\n$url\n";
95
	my $content = get($url);
95
	my $content = get($url);
96
	$debug and print STDERR $content, "\n";
96
	$debug and print STDERR $content, "\n";
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 1081-1087 if (C4::Context->preference("BakerTaylorEnabled")) { Link Here
1081
	{
1081
	{
1082
		$template->param(
1082
		$template->param(
1083
		BakerTaylorContentURL   =>
1083
		BakerTaylorContentURL   =>
1084
		sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
1084
		sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
1085
				$bt_user,$bt_pass,$isbn)
1085
				$bt_user,$bt_pass,$isbn)
1086
		);
1086
		);
1087
	}
1087
	}
(-)a/t/External/BakerTaylor.t (-3 / +2 lines)
Lines 20-27 t::lib::Mocks::mock_preference( 'BakerTaylorUsername', $username ); Link Here
20
t::lib::Mocks::mock_preference( 'BakerTaylorPassword', $password );
20
t::lib::Mocks::mock_preference( 'BakerTaylorPassword', $password );
21
t::lib::Mocks::mock_preference( 'BakerTaylorBookstoreURL', $link_url );
21
t::lib::Mocks::mock_preference( 'BakerTaylorBookstoreURL', $link_url );
22
22
23
my $image_url = "http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$username&Password=$password&Options=Y&Return=T&Type=S&Value=";
23
my $image_url = "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$username&Password=$password&Options=Y&Return=T&Type=S&Value=";
24
my $content_cafe = "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$username&Password=$password&Options=Y&ItemKey=";
24
my $content_cafe = "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$username&Password=$password&Options=Y&ItemKey=";
25
25
26
is( C4::External::BakerTaylor::image_url(), $image_url, "testing default image url");
26
is( C4::External::BakerTaylor::image_url(), $image_url, "testing default image url");
27
is( C4::External::BakerTaylor::image_url("aa"), $image_url."aa", "testing image url construction");
27
is( C4::External::BakerTaylor::image_url("aa"), $image_url."aa", "testing image url construction");
28
- 

Return to bug 20737