Bugzilla – Attachment 166185 Details for
Bug 29948
Display author information for researchers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29948: Allow to sort info
Bug-29948-Allow-to-sort-info.patch (text/plain), 6.60 KB, created by
ByWater Sandboxes
on 2024-05-06 07:53:44 UTC
(
hide
)
Description:
Bug 29948: Allow to sort info
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2024-05-06 07:53:44 UTC
Size:
6.60 KB
patch
obsolete
>From a0998b7a5f76b931b86ae3161dbae214672a32a0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 14 Mar 2024 10:40:29 +0100 >Subject: [PATCH] Bug 29948: Allow to sort info > >With this patch the different info can be ordered when editing the >syspref > >Sponsored-by: Orex Digital >Signed-off-by: hugo <hagud@orex.es> >--- > admin/preferences.pl | 17 +++++++++++++++++ > .../prog/en/modules/admin/preferences.tt | 14 ++++++++++++++ > .../prog/en/modules/admin/preferences/opac.pref | 2 +- > .../bootstrap/en/modules/opac-auth-detail.tt | 3 ++- > .../bootstrap/en/modules/opac-detail.tt | 3 ++- > 5 files changed, 36 insertions(+), 3 deletions(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 63f495c771..66f7208998 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -161,8 +161,25 @@ sub _get_chunk { > } > keys %{ $options{multiple} } > ]; >+ } elsif ( $options{'multiple_sortable'} ) { >+ my @values; >+ @values = split /,/, $value if defined($value); >+ $chunk->{type} = 'multiple_sortable'; >+ $chunk->{CHOICES} = [ >+ sort { $a->{'text'} cmp $b->{'text'} } >+ map { >+ my $option_value = $_; >+ { >+ text => $options{multiple_sortable}->{$option_value}, >+ value => $option_value, >+ selected => (grep { $_ eq $option_value } @values) ? 1 : 0, >+ } >+ } >+ keys %{ $options{multiple_sortable} } >+ ]; > } > >+ > $chunk->{ 'type_' . $chunk->{'type'} } = 1; > > return $chunk; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >index 0321b61679..1df62540f1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >@@ -151,6 +151,20 @@ > </option> > [% END %] > </select> >+ [% ELSIF ( CHUNK.type_multiple_sortable ) %] >+ <ul class="sortable" style="max-width: 30em;"> >+ [% FOREACH CHOICE IN CHUNK.CHOICES %] >+ <li> >+ <i class="fa-solid fa-fw fa-grip-vertical" aria-hidden="true" style="color:#B7B7B7"></i> >+ <label for="pref_[% CHUNK.name | html %]_[% CHOICE.value | html %]">[% CHOICE.text | html %]</label> >+ [% IF ( CHOICE.selected ) %] >+ <input type="checkbox" id="pref_[% CHUNK.name | html %]_[% CHOICE.value | html %]" name="pref_[% CHUNK.name | html %]" value="[% CHOICE.value | html %]" checked="checked" class="preference preference-checkbox"> >+ [% ELSE %] >+ <input type="checkbox" id="pref_[% CHUNK.name | html %]_[% CHOICE.value | html %]" name="pref_[% CHUNK.name | html %]" value="[% CHOICE.value | html %]" class="preference preference-checkbox"> >+ [% END %] >+ </li> >+ [% END %] >+ </ul> > [% ELSIF ( CHUNK.type_textarea )%] > [% IF ( CHUNK.syntax == "text/html" && Koha.Preference('UseWYSIWYGinSystemPreferences') ) %] > <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %] mce" rows="20" cols="60">[% CHUNK.value | html %]</textarea> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 3212c3456f..5de642f1cc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -527,7 +527,7 @@ OPAC: > - > - "Display the following information for authors and contributors to the detail pages in the OPAC." > - pref: OPACAuthorIdentifiersAndInformation >- multiple: >+ multiple_sortable: > activity: Activity (372$a$s$t) > address: Address (371$a$b$d$e) > associated_group: Associated group (373$a$s$t$u$v$0) >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt >index e5babfd0d6..bd5bc10b82 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt >@@ -185,7 +185,8 @@ > <div class="author_identifier_info"> > <span>Identifiers/information</span> > <ul> >- [% FOR info IN author_information.keys %] >+ [% FOR info IN Koha.Preference( 'OPACAuthorIdentifiersAndInformation' ).split(',') %] >+ [% NEXT IF author_information.keys.grep(info).size <= 0 %] > [% PROCESS "authority-information.inc" information => author_information.$info, info_type => info %] > [% END %] > </ul> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index a99cc2452d..be73e30e1c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -949,7 +949,8 @@ > <div class="author_information"> > <span class="author_name"><a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% author.authid | uri %]">[% author.name | html %]</a></span> > <ul> >- [% FOR info IN author.information.keys %] >+ [% FOR info IN Koha.Preference( 'OPACAuthorIdentifiersAndInformation' ).split(',') %] >+ [% NEXT IF author.information.keys.grep(info).size <= 0 %] > [% PROCESS "authority-information.inc" information => author.information.$info, info_type => info %] > [% END %] > </ul> >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29948
:
163167
|
163168
|
163169
|
163696
|
163697
|
163698
|
163699
|
163700
|
166166
|
166167
|
166168
|
166169
|
166181
|
166183
|
166184
|
166185
|
166186
|
166197
|
166198
|
166199
|
166200
|
166201
|
166202
|
166203
|
166205
|
166206
|
166207
|
166208
|
166209
|
166210
|
166211
|
166594
|
166595
|
166596
|
166597
|
166598
|
166599
|
166600
|
166642