Bugzilla – Attachment 62473 Details for
Bug 15352
Use URLLinkText instead of URL for item links
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 15352: Add syspref URLLinkTextItems, defines text to display for URL
SIGNED-OFF-Bug-15352-Add-syspref-URLLinkTextItems-.patch (text/plain), 9.09 KB, created by
Owen Leonard
on 2017-04-20 14:00:54 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 15352: Add syspref URLLinkTextItems, defines text to display for URL
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-04-20 14:00:54 UTC
Size:
9.09 KB
patch
obsolete
>From 6604bb4579571042780bec9b4235d2536ff3abc3 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 19 Apr 2017 01:40:13 +0000 >Subject: [PATCH] [SIGNED-OFF] Bug 15352: Add syspref URLLinkTextItems, defines > text to display for URL > >URLLinkTextItems replaces the URL of an item on catalog detail pages >with this placeholder. > >To test: >1) Apply patch and update database >2) Edit an item (not a record) and add a URL (field u) >3) Notice the detail page shows the full URL in staff client and OPAC. If >this is a very long URL it looks really ugly >4) Go to Admin -> Search for URLLinkTextItems syspref >5) Type something in the textbox (eg: "This is a link") >6) Refresh the detail pages for the record on staff client and OPAC. >Confirm the text you entered has replaced the URL text. >7) Confirm the link still redirects you as expected. > >Sponsored-by: Catalyst IT > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../bug_15352_-_add_URLLinkTextItems_syspref.sql | 1 + > installer/data/mysql/sysprefs.sql | 1 + > .../en/modules/admin/preferences/cataloguing.pref | 4 +++ > .../prog/en/modules/catalogue/detail.tt | 6 ++++- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 31 ++++++++++++++++------ > 5 files changed, 34 insertions(+), 9 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_15352_-_add_URLLinkTextItems_syspref.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_15352_-_add_URLLinkTextItems_syspref.sql b/installer/data/mysql/atomicupdate/bug_15352_-_add_URLLinkTextItems_syspref.sql >new file mode 100644 >index 0000000..67b18e2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_15352_-_add_URLLinkTextItems_syspref.sql >@@ -0,0 +1 @@ >+INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('URLLinkTextItems', '', NULL, 'Replace links for items with this text', 'Free'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 64aa493..f73e0e8 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -542,6 +542,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'), > ('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'), > ('URLLinkText','',NULL,'Text to display as the link anchor in the OPAC','free'), >+('URLLinkTextItems', '', NULL, 'Replace links for items with this text', 'Free'), > ('UsageStats', 0, NULL, 'Share anonymous usage data on the Hea Koha community website.', 'YesNo'), > ('UsageStatsCountry', '', NULL, 'The country where your library is located, to be shown on the Hea Koha community website', 'Choice'), > ('UsageStatsID', '', NULL, 'This preference is part of Koha but it should not be deleted or updated manually.', 'Free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index 1aeadf9..a261b2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -127,6 +127,10 @@ Cataloging: > - If the pref is empty, no fields are restricted. > Display: > - >+ - Show >+ - pref: URLLinkTextItems >+ - as the text of links for items. >+ - > - 'Separate multiple displayed authors, series or subjects with ' > - pref: AuthoritySeparator > class: short >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index b9bf9ed..d10def1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -783,7 +783,11 @@ function verify_images() { > </td> > [% END %] > [% IF ( itemdata_uri ) %] >- <td class="uri"><a href="[% item.uri %]">[% item.uri %]</a></td> >+ [% IF ( Koha.Preference('URLLinkTextItems') && item.uri ) %] >+ <td class="uri"><a href="[% item.uri %]">[% Koha.Preference('URLLinkTextItems') %]</a></td> >+ [% ELSE %] >+ <td class="uri"><a href="[% item.uri %]">[% item.uri %]</a></td> >+ [% END %] > [% END %] > [% IF ( itemdata_copynumber ) %] > <td class="copynumber">[% item.copynumber %]</td> >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 ca6e1b1..769408f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1288,18 +1288,33 @@ > [% IF ( itemdata_uri ) %] > <td class="url"> > [% IF ITEM_RESULT.uri %] >- [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] >- [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >- <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblionumber |url %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a> >+ [% IF Koha.Preference('URLLinkTextItems') %] >+ [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] >+ [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >+ <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblionumber |url %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">[% Koha.Preference('URLLinkTextItems') %]</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblionumber |url %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url">[% Koha.Preference('URLLinkTextItems') %]</a> >+ [% END %] > [% ELSE %] >- <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblionumber |url %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a> >+ [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >+ <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri %]" property="url">[% Koha.Preference('URLLinkTextItems') %]</a> >+ [% ELSE %] >+ <a href="[% ITEM_RESULT.uri %]" property="url">[% Koha.Preference('URLLinkTextItems') %]</a> >+ [% END %] > [% END %] >- > [% ELSE %] >- [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >- <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a> >+ [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] >+ [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >+ <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblionumber |url %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&biblionumber=[% biblionumber |url %]&itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a> >+ [% END %] > [% ELSE %] >- <a href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a> >+ [% IF Koha.Preference("OPACURLOpenInNewWindow") %] >+ <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a> >+ [% ELSE %] >+ <a href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a> >+ [% END %] > [% END %] > [% END %] > [% END %] >-- >2.1.4
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 15352
:
45578
|
62347
|
62473
|
65335
|
98784
|
98828
|
98832
|
98901
|
98905
|
98927