Merge remote-tracking branch 'upstream/23.05.x' into HEAD

This commit is contained in:
Wainui Witika-Park 2024-10-02 11:23:43 +13:00
commit 5bbdd1cf2c
18 changed files with 175 additions and 67 deletions

View File

@ -1199,10 +1199,10 @@ sub checkauth {
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list };
if ( C4::Context->preference('AutoLocation') ) {
# we have to check they are coming from the right ip range
my $domain = $branches->{$branchcode}->{'branchip'};
my $domain = $branches->{$branchcode}->{'branchip'} // q{};
$domain =~ s|\.\*||g;
$domain =~ s/\s+//g;
if ( $ip !~ /^$domain/ ) {
if ( $domain && $ip !~ /^$domain/ ) {
$cookie = $cookie_mgr->replace_in_list( $cookie, $query->cookie(
-name => 'CGISESSID',
-value => '',

View File

@ -541,24 +541,30 @@ sub SendAlerts {
=head2 GetPreparedLetter( %params )
%params hash:
module => letter module, mandatory
letter_code => letter code, mandatory
branchcode => for letter selection, if missing default system letter taken
tables => a hashref with table names as keys. Values are either:
- a scalar - primary key value
- an arrayref - primary key values
- a hashref - full record
substitute => custom substitution key/value pairs
repeat => records to be substituted on consecutive lines:
- an arrayref - tries to guess what needs substituting by
taking remaining << >> tokensr; not recommended
- a hashref token => @tables - replaces <token> << >> << >> </token>
subtemplate for each @tables row; table is a hashref as above
want_librarian => boolean, if set to true triggers librarian details
substitution from the userenv
Return value:
letter fields hashref (title & content useful)
my $letter = GetPreparedLetter(
{
module => "letter module", # mandatory
letter_code => "letter code", # mandatory
branchcode => "for letter selection", # if missing default system letter taken
objects => {}, # a hashref with object names as keys and objects as values
tables => {}, # a hashref with table names as keys. Values are either:
# - a scalar - primary key value
# - an arrayref - primary key values
# - a hashref - full record
substitute => {}, # custom substitution key/value pairs
repeat => '', # records to be substituted on consecutive lines, accepts either:
# - an arrayref
# tries to guess what needs substituting by taking remaining
# << >> tokensr; not recommended
# - a hashref token => @tables
# replaces <token> << >> << >> </token> subtemplate for each
# @tables row; table is a hashref as above
want_librarian => '' # boolean, if set to true triggers librarian details substitution
# from the userenv
}
);
Return value: letter fields hashref (title & content useful)
=cut

View File

@ -73,7 +73,7 @@ sub validate {
return try {
my ( $status, $THE_cardnumber, $THE_userid, $patron ) = C4::Auth::checkpw( $identifier, $password );
unless ( $status && $status > 0 ) {
my $error_response = $status == -2 ? 'Password expired' : 'Validation failed';
my $error_response = ($status && $status == -2) ? 'Password expired' : 'Validation failed';
return $c->render(
status => 400,
openapi => { error => $error_response }

View File

@ -730,10 +730,11 @@ sub _convert_sort_fields {
# Convert the fields and orders, drop anything we don't know about.
grep { $_->{field} } map {
my ( $f, $d ) = /(.+)_(.+)/;
defined $f && defined $d ?
{
field => $sort_field_convert{$f},
direction => $sort_order_convert{$d}
}
} : { field => undef };
} @sort_by;
}

View File

@ -50,10 +50,10 @@ my $status = $query->param('status') || "ASKED";
# Get current branch count and total viewable count, if they don't match then pass
# both to template
if( C4::Context->only_my_library ){
my $local_pendingsuggestions_count = Koha::Suggestions->search({ status => "ASKED", branchcode => C4::Context->userenv()->{'branch'} })->count();
my $local_pendingsuggestions_count = Koha::Suggestions->search({ status => "ASKED", branchcode => C4::Context->userenv()->{'branch'}, archived => 0 })->count();
$template->param( suggestions_count => $local_pendingsuggestions_count );
} else {
my $pendingsuggestions = Koha::Suggestions->search({ status => "ASKED" });
my $pendingsuggestions = Koha::Suggestions->search({ status => "ASKED", archived => 0 });
my $local_pendingsuggestions_count = $pendingsuggestions->search({ 'me.branchcode' => C4::Context->userenv()->{'branch'} })->count();
my $pendingsuggestions_count = $pendingsuggestions->count();
$template->param(

View File

@ -156,30 +156,39 @@ else {
($recordObj1, $recordObj2) = ($recordObj2, $recordObj1);
}
# Getting frameworktext
my $frameworktext1 = Koha::Authority::Types->find( $recordObj1->authtypecode );
my $frameworktext2 = Koha::Authority::Types->find( $recordObj2->authtypecode );
my $frameworktextdestination = Koha::Authority::Types->find($framework);
# Creating a loop for display
my @records = (
{
recordid => $mergereference,
record => $recordObj1->record,
recordid => $mergereference,
record => $recordObj1->record,
frameworkcode => $recordObj1->authtypecode,
display => $recordObj1->createMergeHash($tagslib),
reference => 1,
frameworktext => $frameworktext1->authtypetext,
display => $recordObj1->createMergeHash($tagslib),
reference => 1,
},
{
recordid => $notreference,
record => $recordObj2->record,
recordid => $notreference,
record => $recordObj2->record,
frameworkcode => $recordObj2->authtypecode,
display => $recordObj2->createMergeHash($tagslib),
frameworktext => $frameworktext2->authtypetext,
display => $recordObj2->createMergeHash($tagslib),
},
);
# Parameters
$template->param(
recordid1 => $mergereference,
recordid2 => $notreference,
records => \@records,
framework => $framework,
recordid1 => $mergereference,
recordid2 => $notreference,
records => \@records,
framework => $framework,
frameworktext => $frameworktextdestination->authtypetext,
multipleauthtypes => ( $recordObj1->authtypecode ne $recordObj2->authtypecode ) ? 1 : 0,
);
}
else {
@ -194,10 +203,14 @@ else {
);
if ( $recordObj1->authtypecode ne $recordObj2->authtypecode ) {
my $authority_types = Koha::Authority::Types->search( { authtypecode => { '!=' => '' } }, { order_by => ['authtypetext'] } );
my $frameworktext1 = Koha::Authority::Types->find( $recordObj1->authtypecode );
my $frameworktext2 = Koha::Authority::Types->find( $recordObj2->authtypecode );
$template->param(
frameworkselect => $authority_types->unblessed,
frameworkcode1 => $recordObj1->authtypecode,
frameworkcode2 => $recordObj2->authtypecode,
frameworklabel1 => $frameworktext1->authtypetext,
frameworklabel2 => $frameworktext2->authtypetext,
);
}
}

View File

@ -51,7 +51,7 @@ if (defined $format and $format eq 'json') {
my @f = $cgi->multi_param('f');
my @q = $cgi->multi_param('q');
# If index indicates the value is a barcode, we need to preproccess it before searching
# If index indicates the value is a barcode, we need to preprocess it before searching
for ( my $i = 0; $i < @q; $i++ ) {
$q[$i] = barcodedecode($q[$i]) if $f[$i] eq 'barcode';
}
@ -141,10 +141,11 @@ if ( defined $format ) {
}
}
my @c = $cgi->multi_param('c');
my @fields = $cgi->multi_param('f');
my @q = $cgi->multi_param('q');
my @op = $cgi->multi_param('op');
my %param_names = map { $_ => 1 } $cgi->multi_param;
my @c = $param_names{'c[]'} ? $cgi->multi_param('c[]') : $cgi->multi_param('c');
my @fields = $param_names{'f[]'} ? $cgi->multi_param('f[]') : $cgi->multi_param('f');
my @q = $param_names{'q[]'} ? $cgi->multi_param('q[]') : $cgi->multi_param('q');
my @op = $param_names{'op[]'} ? $cgi->multi_param('op[]') : $cgi->multi_param('op');
my $f;
for (my $i = 0; $i < @fields; $i++) {

View File

@ -459,7 +459,7 @@ my $builder = Koha::SearchEngine::QueryBuilder->new(
my $searcher = Koha::SearchEngine::Search->new(
{ index => $Koha::SearchEngine::BIBLIOS_INDEX } );
# If index indicates the value is a barocode, we need to preproccess it before searching
# If index indicates the value is a barcode, we need to preprocess it before searching
for ( my $i = 0; $i < @operands; $i++ ) {
$operands[$i] = barcodedecode($operands[$i]) if (defined($indexes[$i]) && $indexes[$i] eq 'bc');
}

View File

@ -1286,7 +1286,7 @@ team:
newsletter:
name: Michael Kuhn
24.05:
release_date: 1716336000
release_date: 1716850801
manager:
name: Katrin Fischer
manager_assistants:
@ -1368,3 +1368,80 @@ team:
- name: Liz Rea
newsletter:
name: Michael Kuhn
24.11:
release_date: 1732233601
manager:
name: Katrin Fischer
manager_assistants:
- name: Tomás Cohen Arazi
- name: Martin Renvoize
- name: Jonathan Druart
maintainer:
- version: 24.05
name: Lucas Gass
- version: 23.11
name: Fridolin Somers
- version: 23.05
name: Wainui Witika-Park
- version: 22.11
name: Frédéric Demians
qa_manager:
name: Martin Renvoize
qa:
- name: Marcel de Rooy
- name: Kyle M Hall
- name: Emily Lamancusa
- name: Nick Clemens
- name: Lucas Gass
- name: Tomás Cohen Arazi
- name: Julian Maurice
- name: Victor Grousset
- name: Aleisha Amohia
- name: David Cook
- name: Laura Escamilla
- name: Jonathan Druart
- name: Pedro Amorim
- name: Matt Blenkinsop
- name: Thomas Klausner
te:
- area: UI Design
name: Owen Leonard
- area: Zebra
name: Fridolin Somers
- area: ERM
name: Matt Blenkinsop
- area: ILL
name: Pedro Amorim
- area: SIP2
name: Matthias Meusburger
- area: CAS
name: Matthias Meusburger
bugwrangler:
- name: Aleisha Amohia
- name: Jacob O'Mara
documentation:
name: Philip Orr
documentation_team:
- name: Aude Charillon
- name: Caroline Cyr La Rose
- name: Lucy Vaux-Harvey
- name: Emmanuel Bétemps
- name: Marie-Luce Laflamme
- name: Kelly McElligott
- name: Rasa Šatinskienė
- name: Heather Hernandez
meeting_facilitator:
- name: Paul Derscheid
packaging:
- name: Mason James
- name: Tomás Cohen Arazi
ktd:
- name: Tomás Cohen Arazi
- name: Jacob O'Mara
wiki:
- name: Thomas Dukleth
- name: George Williams
website:
- name: Liz Rea
newsletter:
name: Michael Kuhn

View File

@ -51,6 +51,7 @@
[% WRAPPER tab_item tabname= "tabrecord${record.recordid}" %]
[% record.recordid | html %]
[% IF record.reference %]<span>(ref)</span>[% END %]
<span>([% record.frameworktext | html %])</span>
[% END %]
[% END %]
[% END # /WRAPPER tabs_nav %]
@ -69,7 +70,7 @@
[% END %]
[% BLOCK mergetarget %]
<h2>Destination record</h2>
<h2>Destination record ([% authtypetext | html %])</h2>
<div id="result" class="page-section">
<ul id="resultul"></ul>
</div> <!-- // #result -->

View File

@ -382,7 +382,7 @@
</td>
<td>
<span class="order_name" data-order_id="[% order.ordernumber | html %]">[% order.budget_name | html %]</span></br>
<a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort_1="[% order.sort1 | html %]" data-sort_2="[% order.sort2 | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a>
<a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a>
</td>
</tr>
[% END # /FOREACH order %]
@ -615,16 +615,16 @@
$("#update_fund").data('order_id',$(this).data('order_id'));
$("#modify_budget_id").html(disabledBudgetsCopy);
$("#modify_budget_id").val(selected).find('option[value="'+selected+'"]').removeClass('b_inactive');
$("#sort1").val(sort1);
$("#sort2").val(sort2);
$("#updateFund").find('[name="sort1"]').val(sort1);
$("#updateFund").find('[name="sort2"]').val(sort2);
$("#modify_budget_id").find('.b_inactive').remove();
$("#modify_budget_id").change();
$("#updateFund").modal('show');
});
$("#update_fund").on('click',function(){
var new_fund = $("#modify_budget_id").val();
var sort1 = $("#sort1").val();
var sort2 = $("#sort2").val();
var sort1 = $("#updateFund").find('[name="sort1"]').val();
var sort2 = $("#updateFund").find('[name="sort2"]').val();
var new_fund_name = $('#modify_budget_id option[value="'+new_fund+'"]').text();
var order_id = $(this).data('order_id');
let options = {
@ -642,6 +642,8 @@
$("#updateFund").modal('hide');
$('#updateFund .showallfunds').prop('checked',false);
$('.modify_fund[data-order_id="'+order_id+'"]').data('budget_id',new_fund);
$('.modify_fund[data-order_id="'+order_id+'"]').data('sort1',sort1);
$('.modify_fund[data-order_id="'+order_id+'"]').data('sort2',sort2);
$('.order_name[data-order_id="'+order_id+'"]').text(new_fund_name);
humanMsg.displayAlert( _("Order updated"), { className: 'humanError' } );
})
@ -652,16 +654,16 @@
$("#modify_budget_id").change(function(){
var destination_sort1 = $(this).parents('.modal-body').find('input[name="sort1"]');
var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
var sort1 = $(destination_sort1).val() || "";
if ( destination_sort1.length < 1 ) {
destination_sort1 = $(this).parents('.modal-body').find('select[name="sort1"]');
}
var sort1 = $(destination_sort1).val() || "";
var destination_sort2 = $(this).parents('.modal-body').find('input[name="sort2"]');
var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
var sort2 = $(destination_sort2).val() || "";
if ( destination_sort2.length < 1 ) {
destination_sort2 = $(this).parents('.modal-body').find('select[name="sort2"]');
}
var sort2 = $(destination_sort2).val() || "";
getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
});

View File

@ -102,7 +102,7 @@ div#result { margin-top: 1em; }
[% PROCESS mergesource sourcerecords=records %]
</div>
<div class="col-sm-6">
[% PROCESS mergetarget %]
[% PROCESS mergetarget authtypetext=frameworktext %]
</div>
</div>
@ -111,6 +111,10 @@ div#result { margin-top: 1em; }
<input type="hidden" name="mergereference" value="[% mergereference | html %]" />
<input type="hidden" name="frameworkcode" value="[% framework | html %]" />
[% IF multipleauthtypes %]
<div class="dialog alert multiple-auth-types">Multiple authority types are used. There may be data loss when merging.</div>
[% END %]
<fieldset class="action"><input type="submit" name="merge" class="btn btn-primary" value="Merge" /></fieldset>
</form>

View File

@ -128,19 +128,19 @@
<li>
<label class="required" for="title">Title: </label>
[% IF ( editColTitle ) %]
<input type="text" name="title" value="[% editColTitle | html %]" required="required" />
<input id="title" type="text" name="title" value="[% editColTitle | html %]" required="required" />
<span class="required">Required</span>
[% ELSE %]
<input type="text" name="title" required="required" />
<input id="title" type="text" name="title" required="required" />
<span class="required">Required</span>
[% END %]
</li>
<li>
<label for="description">Description: </label>
[% IF (editColDescription ) %]
<input type="text" size="50" name="description" value="[% editColDescription | html %]" />
<input id="description" type="text" size="50" name="description" value="[% editColDescription | html %]" />
[% ELSE %]
<input type="text" size="50" name="description" />
<input id="description" type="text" size="50" name="description" />
[% END %]
</li>
</ol>

View File

@ -156,7 +156,7 @@
[% BLOCK translate_log_interface %]
[% SWITCH log_interface.upper %]
[% CASE 'INTRANET' %]<span>Intranet</span>
[% CASE 'INTRANET' %]<span>Staff interface</span>
[% CASE 'OPAC' %]<span>OPAC</span>
[% CASE 'SIP' %]<span>SIP</span>
[% CASE 'COMMANDLINE' %]<span>Command-line</span>

View File

@ -5,6 +5,7 @@
[% USE AudioAlerts %]
[% USE To %]
[% USE Price %]
[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Self checkout &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

View File

@ -88,10 +88,10 @@ my $pendingtags = get_count_by_tag_status(0);
# both to template
if( C4::Context->only_my_library ){
my $local_pendingsuggestions_count = Koha::Suggestions->search({ status => "ASKED", branchcode => C4::Context->userenv()->{'branch'} })->count();
my $local_pendingsuggestions_count = Koha::Suggestions->search({ status => "ASKED", branchcode => C4::Context->userenv()->{'branch'}, archived => 0 })->count();
$template->param( pendingsuggestions => $local_pendingsuggestions_count );
} else {
my $pendingsuggestions = Koha::Suggestions->search({ status => "ASKED" });
my $pendingsuggestions = Koha::Suggestions->search({ status => "ASKED", archived => 0 });
my $local_pendingsuggestions_count = $pendingsuggestions->search({ 'me.branchcode' => C4::Context->userenv()->{'branch'} })->count();
my $pendingsuggestions_count = $pendingsuggestions->count();
$template->param(

16
svc/bib
View File

@ -70,14 +70,14 @@ sub fetch_bib {
my $record;
my $exception;
my $invalid_metadata = 0;
eval { $record = $biblio->metadata->record( { embed_items => scalar $query->param('items') } ) };
if ($@) {
$exception = $@;
$exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
$record = $biblio->metadata->record_strip_nonxml( { embed_items => scalar $query->param('items') } );
$invalid_metadata = 1;
}
if ( defined $record ) {
if ( defined $biblio ) {
eval { $record = $biblio->metadata->record( { embed_items => scalar $query->param('items') } ) };
if ($@) {
$exception = $@;
$exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
$record = $biblio->metadata->record_strip_nonxml( { embed_items => scalar $query->param('items') } );
$invalid_metadata = 1;
}
print $query->header( -type => 'text/xml', -charset => 'utf-8', -invalid_metadata => $invalid_metadata );
print $record->as_xml_record();
} else {

View File

@ -273,7 +273,9 @@ if ( $op eq 'view' ) {
my $direction = $query->param('direction') || 'asc';
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
my $rows;
unless ( $query->param('print') ) {
if ( $query->param('print') ) {
$page = "";
} else {
$rows = C4::Context->preference('numSearchResults') || 20;
}