Bugzilla – Attachment 84263 Details for
Bug 17047
Mana Knowledge Base : Data sharing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17047: add a dedicated page for Mana setup
Bug-17047-add-a-dedicated-page-for-Mana-setup.patch (text/plain), 67.36 KB, created by
Alex Arnaud
on 2019-01-21 09:46:13 UTC
(
hide
)
Description:
Bug 17047: add a dedicated page for Mana setup
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2019-01-21 09:46:13 UTC
Size:
67.36 KB
patch
obsolete
>From 2e4bd981ad7c22b02201b025c6062d629ed05c6a Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Thu, 27 Sep 2018 13:15:50 +0000 >Subject: [PATCH] Bug 17047: add a dedicated page for Mana setup > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Subscription/Frequency.pm | 4 - > admin/admin-home.pl | 2 + > admin/share_content.pl | 89 ++++++++++++ > .../atomicupdate/mana_02-add_Mana_syspref.sql | 3 +- > installer/data/mysql/sysprefs.sql | 2 +- > koha-tmpl/intranet-tmpl/lib/jquery/activatemana.js | 18 --- > .../en/includes/mana/mana-report-search-result.inc | 29 ++-- > .../mana/mana-subscription-search-result.inc | 33 ++--- > .../prog/en/includes/reports-toolbar.inc | 24 ++-- > .../prog/en/includes/serials-menu.inc | 2 +- > .../prog/en/includes/serials-toolbar.inc | 54 ++++---- > .../prog/en/modules/admin/admin-home.tt | 18 ++- > .../prog/en/modules/admin/preferences.tt | 1 - > .../en/modules/admin/preferences/web_services.pref | 6 +- > .../prog/en/modules/admin/share_content.tt | 152 +++++++++++++++++++++ > .../en/modules/reports/guided_reports_start.tt | 146 ++++++++++---------- > .../prog/en/modules/serials/serials-search.tt | 2 +- > .../prog/en/modules/serials/subscription-add.tt | 9 +- > .../prog/en/modules/serials/subscription-detail.tt | 2 +- > .../intranet-tmpl/prog/js/subscription-add.js | 6 +- > reports/guided_reports.pl | 4 +- > serials/subscription-add.pl | 5 +- > svc/mana/token | 55 -------- > t/db_dependent/Koha/Subscription.t | 2 + > 24 files changed, 427 insertions(+), 241 deletions(-) > create mode 100755 admin/share_content.pl > delete mode 100644 koha-tmpl/intranet-tmpl/lib/jquery/activatemana.js > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt > delete mode 100755 svc/mana/token > >diff --git a/Koha/Subscription/Frequency.pm b/Koha/Subscription/Frequency.pm >index d7d06dc..64dd327 100644 >--- a/Koha/Subscription/Frequency.pm >+++ b/Koha/Subscription/Frequency.pm >@@ -25,11 +25,7 @@ use base qw(Koha::Object); > > =head1 NAME > >-<<<<<<< b4c9007cc708d995838eae801a5a24b47435095e >-Koha::Subscription::Frequency - Koha Subscription Frequency Object class >-======= > Koha::Subscription::Frequency - Koha Subscription::Frequency Object class >->>>>>>> Bug 17047 subscriptions management with Mana-KB > > =head1 API > >diff --git a/admin/admin-home.pl b/admin/admin-home.pl >index ae16bf6..f6a7b23 100755 >--- a/admin/admin-home.pl >+++ b/admin/admin-home.pl >@@ -25,6 +25,7 @@ use Koha::Plugins; > my $query = new CGI; > > my $plugins_enabled = C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins"); >+my $mana_url = C4::Context->config('mana_config'); > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -38,5 +39,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > > $template->param( plugins_enabled => $plugins_enabled, ); >+$template->param( mana_url => $mana_url, ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/admin/share_content.pl b/admin/share_content.pl >new file mode 100755 >index 0000000..d900b3e >--- /dev/null >+++ b/admin/share_content.pl >@@ -0,0 +1,89 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+use JSON; >+use HTTP::Request; >+ >+use C4::Auth; >+use C4::Output; >+ >+use Koha::SharedContent; >+ >+my $query = new CGI; >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "admin/share_content.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { parameters => '*' }, >+ debug => 1, >+ } >+); >+ >+my $op = $query->param('op') || q||; >+ >+if ( $op eq 'save' ) { >+ my $auto_share = $query->param('autosharewithmana'); >+ my $mana = $query->param('mana'); >+ >+ C4::Context->set_preference('Mana', $mana); >+ >+ if ( $auto_share ne '' ) { >+ C4::Context->set_preference('AutoShareWithMana', 'subscription'); >+ } else { >+ C4::Context->set_preference('AutoShareWithMana', ''); >+ } >+} >+ >+if ( $op eq 'reset' ) { >+ C4::Context->set_preference('ManaToken', ''); >+} >+ >+if ( $op eq 'send' ) { >+ my $name = $query->param('lastname'); >+ my $firstname = $query->param('firstname'); >+ my $email = $query->param('email'); >+ >+ my $content = to_json({firstname => $firstname, >+ lastname => $name, >+ email => $email}); >+ >+ my $mana_ip = C4::Context->config('mana_config'); >+ my $url = "$mana_ip/getsecuritytoken"; >+ my $request = HTTP::Request->new( POST => $url ); >+ $request->content($content); >+ my $result = Koha::SharedContent::process_request($request); >+ >+ $template->param( result => $result ); >+ >+ if ( $result->{code} eq '201' && $result->{token} ) { >+ C4::Context->set_preference('ManaToken', $result->{token}); >+ } >+} >+ >+ >+my $mana_url = C4::Context->config('mana_config') || ''; >+ >+$template->param( >+ mana_url => $mana_url, >+); >+ >+output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql b/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql >index dda85a5..2a3c273 100644 >--- a/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql >+++ b/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql >@@ -1 +1,2 @@ >-INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('Mana','2', 0|1|2,'request to Mana Webservice. Mana centralize commun information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','Choice'); >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+('Mana','1',NULL,'request to Mana Webservice. Mana centralize common information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','YesNo'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index f94efd6..bc012d3 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -275,7 +275,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('LocalHoldsPriorityItemControl', 'holdingbranch', 'holdingbranch|homebranch', 'decides if the feature operates using the item''s home or holding library.', 'Choice'), > ('LocalHoldsPriorityPatronControl', 'PickupLibrary', 'HomeLibrary|PickupLibrary', 'decides if the feature operates using the library set as the patron''s home library, or the library set as the pickup library for the given hold.', 'Choice'), > ('makePreviousSerialAvailable','0','','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','YesNo'), >-('Mana','1',NULL,'request to Mana Webservice. Mana centralize commun information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','YesNo'), >+('Mana','1',NULL,'request to Mana Webservice. Mana centralize common information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','YesNo'), > ('ManInvInNoissuesCharge','1',NULL,'MANUAL_INV charges block checkouts (added to noissuescharge).','YesNo'), > ('MARCAuthorityControlField008','|| aca||aabn | a|a d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'), > ('MarcFieldDocURL', NULL, NULL, 'URL used for MARC field documentation. Following substitutions are available: {MARC} = marc flavour, eg. "MARC21" or "UNIMARC". {FIELD} = field number, eg. "000" or "048". {LANG} = user language, eg. "en" or "fi-FI"', 'free'), >diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/activatemana.js b/koha-tmpl/intranet-tmpl/lib/jquery/activatemana.js >deleted file mode 100644 >index 0e9b2e2..0000000 >--- a/koha-tmpl/intranet-tmpl/lib/jquery/activatemana.js >+++ /dev/null >@@ -1,18 +0,0 @@ >-$(document).ready(function(){ >- $("#activatemana").on("click", function(){ >- var mylastname = $("#lastname").val() >- var myfirstname = $("#firstname").val() >- var myemail = $("#email").val() >- $.ajax( { >- type: "POST", >- url: "/cgi-bin/koha/svc/mana/token", >- data: { lastname: mylastname, firstname: myfirstname, email: myemail}, >- dataType: "json", >- }) >- .done(function(result){ >- $("#pref_ManaToken").val(result.token); >- $("#pref_ManaToken").trigger("input"); >- }); >- return false; >- }); >-}); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc >index b95600c..fca1b12 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE AuthorisedValues %] > [% USE Branches %] >+[% USE raw %] > > <script type="text/javascript"> > //<![CDATA[ >@@ -45,30 +46,30 @@ $(document).ready(function() { > [% FOREACH report IN reports %] > [% UNLESS report.cannotdisplay %] > [% IF report.nbofcomment > highWarned %] >- <tr id="row[% report.id %]" class = "high-warned-row"> >+ <tr id="row[% report.id | $raw %]" class = "high-warned-row"> > [% ELSIF report.nbofcomment > warned %] >- <tr id="row[% report.id %]" class = "warned-row"> >+ <tr id="row[% report.id | $raw %]" class = "warned-row"> > [% ELSIF report.nbofcomment > lowWarned %] >- <tr id="row[% report.id %]" class = "highlighted-row"> >+ <tr id="row[% report.id | $raw %]" class = "highlighted-row"> > [% END %] >- <input hidden class="rowid" value="[% report.id %]"> >- <td>[% IF ( report.report_name ) %][% report.report_name %][% END %]</td> >- <td title="[% report.savedsql |html %]"><div> >+ <input hidden class="rowid" value="[% report.id | $raw %]"> >+ <td>[% IF ( report.report_name ) %][% report.report_name | html %][% END %]</td> >+ <td title="[% report.savedsql | html %]"><div> > [% IF report.notes.length > 200 %] >- [% report.notes.substr(0,200) %]<a class="showbutton">Show More</a></div><div hidden> >+ [% report.notes.substr(0,200) | html %]<a class="showbutton">Show More</a></div><div hidden> > [% END %] >- [% report.notes %] >+ [% report.notes | html %] > [% IF report.notes.length > 200 %] > <a class="hidebutton">Show Less</a></div> </td> > [% END %] >- <td> [% report.type %] </td> >- <td>[% IF ( report.nbofusers ) %][% report.nbofusers %][% END %]</td> >- <td><span title="[% report.lastimport %]">[% report.lastimport | $KohaDates %]</span></td> >- <td>[% FOREACH comment IN report.comments %][% comment.message %] ([% comment.nb %]) <br>[% END %]</td> >+ <td> [% report.type | html %] </td> >+ <td>[% IF ( report.nbofusers ) %][% report.nbofusers | $raw %][% END %]</td> >+ <td><span title="[% report.lastimport | $KohaDates %]">[% report.lastimport | $KohaDates %]</span></td> >+ <td>[% FOREACH comment IN report.comments %][% comment.message | html %] ([% comment.nb | $raw %]) <br>[% END %]</td> > > [% UNLESS search_only %] > <td> >- <button class="mana-use" id="mana-use-[% report.id %]"><i class="fa fa-inbox"></i> Use</button> >+ <button class="mana-use" id="mana-use-[% report.id | $raw %]"><i class="fa fa-inbox"></i> Use</button> > </td> > [% END %] > </tr> >@@ -77,5 +78,5 @@ $(document).ready(function() { > </tbody> > </table> > [% ELSE %] >- <h4> [% msg %] statuscode: [% statuscode %]</h4> >+ <h4> [% msg | html %] statuscode: [% statuscode | $raw %]</h4> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc >index 34c3f42..4570191 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE AuthorisedValues %] > [% USE Branches %] >+[% USE raw %] > [% INCLUDE 'mana.inc' %] > <script type="text/javascript"> > //<![CDATA[ >@@ -35,29 +36,29 @@ $(document).ready(function() { > [% FOREACH subscription IN subscriptions %] > [% UNLESS subscription.cannotdisplay %] > [% IF subscription.nbofcomment > highWarned %] >- <tr id="row[% subscription.subscriptionid %]" class = "high-warned-row" title="this resource has been reported more than [% highWarned %] times, take care!"> >+ <tr id="row[% subscription.subscriptionid | $raw %]" class = "high-warned-row" title="this resource has been reported more than [% highWarned | html %] times, take care!"> > [% ELSIF subscription.nbofcomment > warned %] >- <tr id="row[% subscription.subscriptionid %]" class = "warned-row" title="this resource has been reported more than [% warned %] times, take care!"> >+ <tr id="row[% subscription.subscriptionid | $raw %]" class = "warned-row" title="this resource has been reported more than [% warned | html %] times, take care!"> > [% ELSIF subscription.nbofcomment > lowWarned %] >- <tr id="row[% subscription.subscriptionid %]" class = "highlighted-row" title="this resource has been reported more than [% lowWarned %] times, take care!"> >+ <tr id="row[% subscription.subscriptionid | $raw %]" class = "highlighted-row" title="this resource has been reported more than [% lowWarned | html %] times, take care!"> > [% END %] >- <input hidden class="rowid" value="[% subscription.id %]"> >- <td>[% IF ( subscription.issn ) %][% subscription.issn %][% END %]</td> >- <td>[% subscription.title %]</a></td> >- <td>[% IF ( subscription.publishercode ) %][% subscription.publishercode %][% END %]</td> >- <td>[% IF ( subscription.sfdescription ) %][% subscription.sfdescription %][% END %]</td> >- <td>[% IF ( subscription.numberingmethod ) %][% subscription.numberingmethod %][% END %]</td> >- <td>[% IF ( subscription.nbofusers ) %][% subscription.nbofusers %][% END %]</td> >- <td><span title="[% subscription.lastimport %]">[% subscription.lastimport | $KohaDates %]</span></td> >- <td>[% FOREACH comment IN subscription.comments %][% comment.message %] ([% comment.nb %]) <br>[% END %]</td> >+ <input hidden class="rowid" value="[% subscription.id | $raw %]"> >+ <td>[% IF ( subscription.issn ) %][% subscription.issn | html %][% END %]</td> >+ <td>[% subscription.title | html %]</a></td> >+ <td>[% IF ( subscription.publishercode ) %][% subscription.publishercode | html %][% END %]</td> >+ <td>[% IF ( subscription.sfdescription ) %][% subscription.sfdescription | html %][% END %]</td> >+ <td>[% IF ( subscription.numberingmethod ) %][% subscription.numberingmethod | html %][% END %]</td> >+ <td>[% IF ( subscription.nbofusers ) %][% subscription.nbofusers | $raw %][% END %]</td> >+ <td><span title="[% subscription.lastimport | $KohaDates %]">[% subscription.lastimport | $KohaDates %]</span></td> >+ <td>[% FOREACH comment IN subscription.comments %][% comment.message | html %] ([% comment.nb | $raw %]) <br>[% END %]</td> > > [% UNLESS search_only %] > <td> >- <button class="mana-use" id="mana-use-[% subscription.id %]"><i class="fa fa-inbox"></i> Use</button> >- <select class="mana-actions" id="mana-actions-[% subscription.id %]"> >+ <button class="mana-use" id="mana-use-[% subscription.id | $raw %]"><i class="fa fa-inbox"></i> Use</button> >+ <select class="mana-actions" id="mana-actions-[% subscription.id | $raw %]"> > <option selected disabled>Report mistake</option> > [% FOREACH comment IN subscription.comments %] >- <option value="[% comment.id %]"> [% comment.message %] ([% comment.nb %])</option> >+ <option value="[% comment.id | $raw %]"> [% comment.message | html %] ([% comment.nb | $raw %])</option> > [% END %] > <option>other</option> > </select> >@@ -70,7 +71,7 @@ $(document).ready(function() { > </tbody> > </table> > [% ELSE %] >- <h4>Mana search fails with the code: [% statuscode %] </h4> >+ <h4>Mana search fails with the code: [% statuscode | html %] </h4> > [% END %] > > <div id="comment_box" class="modal" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="display: none;"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >index 9a2c4bb..cc1b083 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc >@@ -55,8 +55,8 @@ > <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> Report mistake <span class="caret"></span></button> > <ul class="dropdown-menu"> > [% FOREACH c IN mana_comments %] >- <li class="mana-comment" data-id="[% c.id %]"> >- <a href="#">[% c.message %] ([% c.nb %])</a> >+ <li class="mana-comment" data-id="[% c.id | $raw %]"> >+ <a href="#">[% c.message | html %] ([% c.nb | html %])</a> > </li> > [% END %] > <li role="separator" class="divider"></li> >@@ -73,7 +73,7 @@ > </div> > <div class="modal-body"> > <input hidden id="mana-resource" value="report"> >- <input hidden id="mana-resource-id" value="[% mana_id %]"> >+ <input hidden id="mana-resource-id" value="[% mana_id | $raw %]"> > <div> > <input type="text" maxlength="35" size="35" id="mana-comment"> > </div> >@@ -124,12 +124,16 @@ > <h3 id="mana_search_result_label"> Mana Search</h3> > </div> > <div> >- <form id="search_form" style="margin-left: 5%"> >- Please enter a few key words: >- <input type=text id=mana_search_field> >- <input type=button class="mana_search_button" value="Search"> >- </form> > <div class="modal-body"> >+ <fieldset> >+ <form id="mana_search_form" style="margin-left: 5%"> >+ Please enter a few key words: >+ <input type="text" id="mana_search_field"> >+ <input type="submit" class="mana_search_button" value="Search"> >+ </form> >+ </fieldset> >+ <div class="mana_result_content"> >+ </div> > </div> > </div> > </div> >@@ -158,6 +162,7 @@ > } > > function mana_search( textquery ){ >+ $(document.body).css({'cursor' : 'wait'}); > $.ajax({ > type: "POST", > url: "/cgi-bin/koha/svc/mana/search", >@@ -165,7 +170,8 @@ > dataType: "html", > }) > .done( function( result ) { >- $("#mana_search_result .modal-body").html(result); >+ $(document.body).css({'cursor' : 'default'}); >+ $("#mana_search_result .modal-body .mana_result_content").html(result); > $("#mana_search_result_label").text(_("Results from Mana Knowledge Base")); > $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ > "sPaginationType":"four_button", >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc >index 257c429..af85c11 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc >@@ -31,7 +31,7 @@ > </a> > </li> > <li><a href="/cgi-bin/koha/serials/add_fields.pl">Add subscription fields</a></li> >- [% IF Koha.Preference('Mana') %] >+ [% IF Koha.Preference('Mana') == 1 %] > <li><a href="/cgi-bin/koha/serials/serials-search.pl?mana=1">Search on Mana</a></li> > [% END %] > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc >index 4bba329..e8aabde 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc >@@ -7,7 +7,7 @@ > [% ELSE %] > <div class="btn-group"><a id="newsubscription" class="btn btn-default btn-sm" href="/cgi-bin/koha/serials/subscription-add.pl"><i class="fa fa-plus"></i> New subscription</a></div> > [% END %] >- [% IF Koha.Preference('Mana') and Koha.Preference('AutoShareWithMana').grep('subscription').size == 0 %] >+ [% IF Koha.Preference('Mana') == 1 and Koha.Preference('AutoShareWithMana').grep('subscription').size == 0 %] > [% IF one_language_enabled==0 or mana_id %] > <div class="btn-group"><a data-toggle="modal" data-toggle="tooltip" title="Share the subscription with other librairies. Your email address will be associated to your sharing." data-target="#mana_share_modal" class="btn btn-default btn-sm"><i class="fa fa-share-alt"></i> Share</a></div> > [% ELSE %] >@@ -66,8 +66,8 @@ > <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> Report mistake <span class="caret"></span></button> > <ul class="dropdown-menu"> > [% FOREACH c IN mana_comments %] >- <li class="mana-comment" data-id="[% c.id %]"> >- <a href="#">[% c.message %] ([% c.nb %])</a> >+ <li class="mana-comment" data-id="[% c.id | $raw %]"> >+ <a href="#">[% c.message | html %] ([% c.nb | html %])</a> > </li> > [% END %] > <li role="separator" class="divider"></li> >@@ -84,7 +84,7 @@ > </div> > <div class="modal-body"> > <input hidden id="mana-resource" value="subscription"> >- <input hidden id="mana-resource-id" value="[% mana_id %]"> >+ <input hidden id="mana-resource-id" value="[% mana_id | $raw %]"> > <div> > <input type="text" maxlength="35" size="35" id="mana-comment"> > </div> >@@ -109,12 +109,12 @@ > <div class="modal-dialog"> > <div class="modal-content"> > <div class="modal-header"> >- <h3 id="mana_share_modal_label">Share [% bibliotitle %] to Mana</h3> >+ <h3 id="mana_share_modal_label">Share [% bibliotitle | html %] to Mana</h3> > </div> > <div class="modal-body"> > [% IF (mana_id) %] > <div class="alert"> >-<h1>[% (mana_id) %]</h1> >+<h1>[% mana_id | $raw %]</h1> > <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p> > </div> > [% END %] >@@ -122,10 +122,10 @@ > [% UNLESS ( one_language_enabled ) %] > <div class="rows"> > <li><span class="label">Frequency: </span> >- [% frequency.description %] >+ [% frequency.description | html %] > </li> > <li><span class="label">Number pattern: </span> >- [% numberpattern.label %] >+ [% numberpattern.label | html %] > </li> > </ol> > </div> >@@ -140,20 +140,20 @@ > [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] > [% IF ( sublanguages_loo.enabled ) %] > [% IF ( sublanguages_loo.sublanguage_current ) %] >- <option value="[% languages_loo.rfc4646_subtag %]" selected> >- [% sublanguages_loo.native_description %] >- [% sublanguages_loo.script_description %] >- [% sublanguages_loo.region_description %] >- [% sublanguages_loo.variant_description %] >- ([% sublanguages_loo.rfc4646_subtag %]) >+ <option value="[% languages_loo.rfc4646_subtag | html %]" selected> >+ [% sublanguages_loo.native_description | html %] >+ [% sublanguages_loo.script_description | html %] >+ [% sublanguages_loo.region_description | html %] >+ [% sublanguages_loo.variant_description | html %] >+ ([% sublanguages_loo.rfc4646_subtag | html %]) > </option> > [% ELSE %] >- <option value="[% languages_loo.rfc4646_subtag %]"> >- [% sublanguages_loo.native_description %] >- [% sublanguages_loo.script_description %] >- [% sublanguages_loo.region_description %] >- [% sublanguages_loo.variant_description %] >- ([% sublanguages_loo.rfc4646_subtag %]) >+ <option value="[% languages_loo.rfc4646_subtag | html %]"> >+ [% sublanguages_loo.native_description | html %] >+ [% sublanguages_loo.script_description | html %] >+ [% sublanguages_loo.region_description | html %] >+ [% sublanguages_loo.variant_description | html %] >+ ([% sublanguages_loo.rfc4646_subtag | html %]) > </option> > [% END %] > [% END %] >@@ -161,19 +161,19 @@ > [% ELSE %] > [% IF ( languages_loo.group_enabled ) %] > [% IF ( languages_loo.current ) %] >- <option value="[% languages_loo.rfc4646_subtag %]" selected> >+ <option value="[% languages_loo.rfc4646_subtag | html %]" selected> > [% IF ( languages_loo.native_description ) %] >- [% languages_loo.native_description %] >+ [% languages_loo.native_description | html %] > [% ELSE %] >- [% languages_loo.rfc4646_subtag %] >+ [% languages_loo.rfc4646_subtag | html %] > [% END %] > </option> > [% ELSE %] >- <option value="[% languages_loo.rfc4646_subtag %]"> >+ <option value="[% languages_loo.rfc4646_subtag | html %]"> > [% IF ( languages_loo.native_description ) %] >- [% languages_loo.native_description %] >+ [% languages_loo.native_description | html %] > [% ELSE %] >- [% languages_loo.rfc4646_subtag %] >+ [% languages_loo.rfc4646_subtag | html %] > [% END %] > </option> > [% END %] >@@ -183,7 +183,7 @@ > [% END %] > </select> > <input type="hidden" id="op" name="op" value="share"/> >- <input type="hidden" id="subscriptionid" name="subscriptionid" value="[% subscriptionid %]"/> >+ <input type="hidden" id="subscriptionid" name="subscriptionid" value="[% subscriptionid | $raw %]"/> > </fieldset> > </form> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index e1e7767..2cc41d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -13,11 +13,15 @@ > <div class="main container-fluid"> > <div class="row"> > <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"> >- [% IF ( Koha.Preference('Mana') == 2) %] >- <fieldset> >- <p><center> You haven't decided if you want to activate Mana Knowlede Base, please let us know by clicking<center></p> >- <a href=/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=request+to+mana+webservice><center>Here</center></a> >- </fieldset> >+ [% IF ( Koha.Preference('Mana') == 1) && !mana_url %] >+ <div class="dialog message"> >+ <p><center>The Mana Knowledge Base feature is enabled but not configured.</center></p> >+ <p>This feature allows you to retrieve and share data (subscription patterns and reports) with other Koha libaries.</p> >+ <p> >+ Ask your system administrator to configure this feature, or remove this note by disabling the 'Mana' system preference >+ <a href=/cgi-bin/koha/admin/share_content.pl>here.</a> >+ </p> >+ </div> > [% END %] > <h1>Koha administration</h1> > <div class="row"> >@@ -192,6 +196,10 @@ > <dt><a href="/cgi-bin/koha/admin/usage_statistics.pl">Share your usage statistics</a></dt> > <dd>Share with the Koha community the usage statistics of your Koha installation.</dd> > [% END %] >+ [% IF ( CAN_user_parameters ) %] >+ <dt><a href="/cgi-bin/koha/admin/share_content.pl">Using Mana-KB</a></dt> >+ <dd>Share content (subscriptions, reports) with Koha communty</dd> >+ [% END %] > </dl> > [% END %] > </div> >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 d9d705c..6cc0570 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >@@ -197,7 +197,6 @@ > [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] > [% Asset.js("js/ajax.js") | $raw %] > [% Asset.js("js/pages/preferences.js") | $raw %] >- [% Asset.js("lib/jquery/activatemana.js") | $raw %] > [%# Add WYSIWYG editor for htmlarea system preferences %] > [% INCLUDE 'wysiwyg-systempreferences.inc' %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >index fe4a942..f9aa27b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >@@ -63,15 +63,13 @@ Web services: > - > - pref: Mana > choices: >- 0: Disable >- 1: Enable >- 2: No, let me think about it >+ yes: Enable >+ no: Disable > - request to Mana Webservice. Mana centralize commun information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana. The informations shared with Mana KB are shared under the CC-0 license. More infos about CC-0 license on https://creativecommons.org/choose/zero/ > - > - "Security token used to authenticate on mana:" > - pref: ManaToken > class: Text >- - <br> You need a security token to authenticate on Mana. If this sytem preference is empty, please fill in the following form, you will receive an email to confirm and activate your token. <br> <form> First name <input name="firstname" type="text" id="firstname"> <br> Last name <input name="lastname" type=text id=lastname> <br> Email address <input name="email" type=text id=email><br> <input type=submit id=activatemana value="Send"></form> > - > - 'Fields automatically shared with mana' > - pref: AutoShareWithMana >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >new file mode 100644 >index 0000000..5c4ec62 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >@@ -0,0 +1,152 @@ >+[% USE raw %] >+[% USE Asset %] >+[% SET footerjs = 1 %] >+[% USE Koha %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Administration › Koha usage statistics</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+ >+<body id="admin_usage_statistics" class="admin"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'cat-search.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › Usage statistics</div> >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <div class="col-sm-6"> >+ [% IF result.code != 201 && result.msg %] >+ <div class="alert alert-danger" role="alert"> >+ [% result.msg | html %] >+ </div> >+ [% END %] >+ >+ [% IF result.code == 201 %] >+ <div class="dialog message" role="alert"> >+Well done! You successfully created your Mana KB account. Check your mailbox and follow instructions. >+ </div> >+ [% END %] >+ >+ [% UNLESS (mana_url) %] >+ <div class="alert alert-danger" role="alert"> >+ Mana config is currently empty, this feature will not work. Please contact your site administartor. >+ </div> >+ [% END %] >+ >+ <h1>Share content with the Koha community using Mana KB</h1> >+ <p>Mana-kb is a global knowledge base for library-centric data. It has been designed initially to interact with Koha, the Open Source ILS, but can be used by any other software.</p> >+ >+ <p>Mana centralize commun information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana. The informations shared with Mana KB are shared under the CC-0 license. More infos about CC-0 license <a href="https://creativecommons.org/choose/zero/">here</a>.</p> >+ >+ <p>Learn more about Mana on the <a href="https://wiki.koha-community.org/wiki/Mana_central_database">official documentation</a>.</p> >+ >+ [% IF (mana_url) %] >+ <p> Your Mana KB server is currently: <strong>[% mana_url | url %]</strong></p> >+ [% END %] >+ >+ <form id="mana_preference" method="post"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="mana">Use Mana KB for sharing content: </label> >+ <select name="mana"> >+ [% IF Koha.Preference('Mana') == 0 %] >+ <option value="0" selected="selected">No</option> >+ [% ELSE %] >+ <option value="0"">No</option> >+ [% END %] >+ >+ [% IF Koha.Preference('Mana') == 1 %] >+ <option value="1" selected="selected">Yes</option> >+ [% ELSE %] >+ <option value="1">Yes</option> >+ [% END %] >+ </select> >+ <div class="hint">Enable Mana allow you to search, import and comment content from Mana server, and, to share your own.</div> >+ </li> >+ <li> >+ <label for="autosharewithmana">Auto subscriptions sharing: </label> >+ [% IF Koha.Preference('AutoShareWithMana').grep('subscription').size == 0 %] >+ <input type="checkbox" name="autosharewithmana"> >+ [% ELSE %] >+ <input type="checkbox" name="autosharewithmana" checked="checked"> >+ [% END %] >+ <div class="hint">If checked, new subscriptions you created yourself will be automatically shared with Mana KB.</div> >+ </li> >+ <li> >+ <input type="hidden" name="op" value="save"> >+ <input type="submit" value="Save"> >+ </li> >+ </ol> >+ </fieldset> >+ </form> >+ >+ [% UNLESS Koha.Preference('ManaToken') %] >+ <h3>Configure Mana KB</h3> >+ <p>Once you have enabled Mana, let's start to set it up. Type your first name, last name, email address and click on send. This will send a account creation request to Mana KB that will respond back with a Mana token (a crypted id that uniquely identify your Koha). This token will automatically be saved in your database. Just after that, you will receive an email. Read it and follow the instructions.</p> >+ [% END %] >+ >+ [% IF Koha.Preference('ManaToken') %] >+ <form id="mana_token" method="post"> >+ <fieldset class="rows" id="mana_token"> >+ <legend>Mana KB token</legend> >+ <ol> >+ <li> >+ <label for="token">Mana token: </label> >+ <input type="text" name="token" value="[% Koha.Preference('ManaToken') | html %]" size="50" disabled="disabled"> >+ <div class="hint">Your unique security token used for authentication on Mana KB service (anti spam).</div> >+ </li> >+ <li> >+ <input type="hidden" name="op" value="reset"> >+ <input type="submit" value="Reset your token"> >+ </li> >+ </ol> >+ </fieldset> >+ </form> >+ [% ELSE %] >+ <form id="mana_request" method="post"> >+ <fieldset class="rows" id="mana_subscription"> >+ <ol> >+ <li> >+ <label for="firstname">First name: </label> >+ <input type="text" name="firstname"> >+ </li> >+ <li> >+ <label for="lastname">Last name: </label> >+ <input type="text" name="lastname"> >+ </li> >+ <li> >+ <label for="email">Email: </label> >+ <input type="text" name="email" size="45" required="required"> >+ </li> >+ <li> >+ <input type="hidden" name="op" value="send"> >+ <input type="submit" value="Send to Mana KB"> >+ </li> >+ </ol> >+ </fieldset> >+ </form> >+ [% END %] >+ </div> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'admin-menu.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> >+ >+[% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/admin-menu.js") | $raw %] >+ <script> >+ $(document).ready(function() { >+ $('#mana_token').submit(function() { >+ return confirm("This will delete the Mana token from Koha. Do you want to continue?"); >+ }); >+ }); >+ </script> >+[% END %] >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index 17d3ccb..b8c4b0c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -137,7 +137,7 @@ canned reports and writing custom SQL reports.</p> > > [% IF report_converted %] > <div class="dialog message"> >- The report "[% report_converted %]" has been converted. >+ The report "[% report_converted | html %]" has been converted. > </div> > [% END %] > >@@ -179,7 +179,7 @@ canned reports and writing custom SQL reports.</p> > <div style="display:inline-block"> > [% IF manamsg %] > <div id="mana_search" class="dialog message"> >- <p> [% manamsg %] </p> >+ <p> [% manamsg | html %] </p> > </div> > [% END %] > >@@ -355,85 +355,78 @@ canned reports and writing custom SQL reports.</p> > <div id="note-error" class="alert alert-danger" role="alert"> > Please enter a report name and descriptive note before sharing (minimum 20 characters) > </div> >- [% IF ( languages_loop ) %] >- [% UNLESS ( one_language_enabled ) %] >- <div class="shared_infos rows"> >- <li> <span class="label">Id: </span><div id="shared_id"></div> >- </li> >- <li> <span class="label">Name: </span><div id="shared_name"></div> >- </li> >- <li> <span class="label">SQL: </span><div id="shared_sql"></div> >- </li> >- <li> <span class="label">Group: </span><div id="shared_group"></div> >- </li> >- <li> <span class="label">Type: </span><div id="shared_type"></div> >- </li> >- <li> <span class="label">Notes: </span><div id="shared_notes"></div> >- </li> >- >- </div> >- <div class="rows"> >- <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" > >- <input type="hidden" name="phase" value="Share"> >- >- <fieldset class="shared_infos"> >- <label for="mana_language">Language:</label> >- <select id="mana_language" name="mana_language"> >- [% FOREACH languages_loo IN languages_loop %] >- [% IF ( languages_loo.group_enabled ) %] >- [% IF ( languages_loo.plural ) %] >- [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] >- [% IF ( sublanguages_loo.enabled ) %] >- [% IF ( sublanguages_loo.sublanguage_current ) %] >- <option value="[% languages_loo.rfc4646_subtag %]" selected> >- [% sublanguages_loo.native_description %] >- [% sublanguages_loo.script_description %] >- [% sublanguages_loo.region_description %] >- >- [% sublanguages_loo.variant_description %] >- ([% sublanguages_loo.rfc4646_subtag %]) >- </option> >- [% ELSE %] >- <option value="[% languages_loo.rfc4646_subtag %]"> >- [% sublanguages_loo.native_description %] >- [% sublanguages_loo.script_description %] >- [% sublanguages_loo.region_description %] >- [% sublanguages_loo.variant_description %] >- ([% sublanguages_loo.rfc4646_subtag %]) >- </option> >- [% END %] >- [% END %] >- [% END %] >- [% ELSE %] >- [% IF ( languages_loo.group_enabled ) %] >- [% IF ( languages_loo.current ) %] >- <option value="[% languages_loo.rfc4646_subtag %]" selected> >- [% IF ( languages_loo.native_description ) %] >- [% languages_loo.native_description %] >- [% ELSE %] >- [% languages_loo.rfc4646_subtag %] >- [% END %] >+ <div class="shared_infos rows"> >+ <li><span class="label">Id: </span><div id="shared_id"></div></li> >+ <li><span class="label">Name: </span><div id="shared_name"></div></li> >+ <li><span class="label">SQL: </span><div id="shared_sql"></div></li> >+ <li><span class="label">Group: </span><div id="shared_group"></div></li> >+ <li><span class="label">Type: </span><div id="shared_type"></div></li> >+ <li><span class="label">Notes: </span><div id="shared_notes"></div></li> >+ </div> >+ <div class="rows"> >+ <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl" class="validated" > >+ <input type="hidden" name="phase" value="Share"> >+ >+ [% IF (languages_loop) %] >+ <fieldset class="shared_infos"> >+ <label for="mana_language">Language:</label> >+ <select id="mana_language" name="mana_language"> >+ [% FOREACH languages_loo IN languages_loop %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.plural ) %] >+ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %] >+ [% IF ( sublanguages_loo.enabled ) %] >+ [% IF ( sublanguages_loo.sublanguage_current ) %] >+ <option value="[% languages_loo.rfc4646_subtag | html %]" selected> >+ [% sublanguages_loo.native_description | html %] >+ [% sublanguages_loo.script_description | html %] >+ [% sublanguages_loo.region_description | html %] >+ >+ [% sublanguages_loo.variant_description | html %] >+ ([% sublanguages_loo.rfc4646_subtag | html %]) > </option> > [% ELSE %] >- <option value="[% languages_loo.rfc4646_subtag %]"> >- [% IF ( languages_loo.native_description ) %] >- [% languages_loo.native_description %] >- [% ELSE %] >- [% languages_loo.rfc4646_subtag %] >- [% END %] >+ <option value="[% languages_loo.rfc4646_subtag | html %]"> >+ [% sublanguages_loo.native_description | html %] >+ [% sublanguages_loo.script_description | html %] >+ [% sublanguages_loo.region_description | html %] >+ [% sublanguages_loo.variant_description | html %] >+ ([% sublanguages_loo.rfc4646_subtag | html %]) > </option> > [% END %] > [% END %] > [% END %] >+ [% ELSE %] >+ [% IF ( languages_loo.group_enabled ) %] >+ [% IF ( languages_loo.current ) %] >+ <option value="[% languages_loo.rfc4646_subtag | html %]" selected> >+ [% IF ( languages_loo.native_description ) %] >+ [% languages_loo.native_description | html %] >+ [% ELSE %] >+ [% languages_loo.rfc4646_subtag | html %] >+ [% END %] >+ </option> >+ [% ELSE %] >+ <option value="[% languages_loo.rfc4646_subtag | html %]"> >+ [% IF ( languages_loo.native_description ) %] >+ [% languages_loo.native_description | html %] >+ [% ELSE %] >+ [% languages_loo.rfc4646_subtag | html %] >+ [% END %] >+ </option> >+ [% END %] >+ [% END %] > [% END %] > [% END %] >- </select> >- <input type="hidden" id="reportid" name="reportid" value="[% savedreport.id %]"/> >- </fieldset> >- </form> >- </div> >- [% END %] >- [% END %] >+ [% END %] >+ </select> >+ </fieldset> >+ [% ELSE %] >+ <input type="hidden" name="mana_language" value="[% lang | html %]"> >+ [% END %] >+ <input type="hidden" id="reportid" name="reportid"/> >+ </form> >+ </div> > </div> > <div class="modal-footer"> > <button class="btn" id="ManaCloseButton" data-dismiss="modal" aria-hidden="true">Close</button> >@@ -1291,6 +1284,7 @@ canned reports and writing custom SQL reports.</p> > $("#note-error").show(); > } > else{ >+ $("#reportid").val($(this).closest("tr").find(".report_id").text()); > $("#shared_id").html($(this).closest("tr").find(".report_id").text()); > $("#shared_name").html($(this).closest("tr").find(".report_name").text()); > $("#shared_sql").html($(this).closest("tr").find(".report_sql").val()); >@@ -1496,7 +1490,11 @@ canned reports and writing custom SQL reports.</p> > }); > > $('div#ManaShareButton').click(function() { >- window.location="/cgi-bin/koha/reports/guided_reports.pl?phase=Share"; >+ $("#mana_share_form").submit(); >+ }); >+ >+ $("#mana_search_form").submit(function(e){ >+ e.preventDefault(); > }); > }); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >index adc7428..bbca46c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -516,7 +516,7 @@ > $(".ui-datepicker-trigger").hide(); > $("label[for=location], select#location_filter").hide(); > [% FOR field IN additional_fields_for_subscription %] >- $("label[for=additional_field_[% field.id %]], input#additional_field_[% field.id %]").hide(); >+ $("label[for=additional_field_[% field.id | $raw %]], input#additional_field_[% field.id | $raw %]").hide(); > [% END %] > [% END %] > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index a7bb471..e194a6c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -214,11 +214,10 @@ width: 300px; /* not enough for IE7 apparently */ > > <div id="page_2"> > <div class="col-md-6"> >- [% IF ( Koha.Preference('Mana') == 2) %] >+ [% IF ( Koha.Preference('Mana') == 1) && !mana_url %] > <fieldset> >- <p><center>You haven't activated the Mana Knowledge Base, click >- <a href=/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=request+to+mana+webservice>here</a> >- to configure.</center></p> >+ <p><center>The Mana Knowledge Base can be used to import subscription patterns submitted by other libraries and save you extra work. Ask your system administrator to configure this service and complete the configuration, or remove this message by disabling the system preference >+ <a href=/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=request+to+mana+webservice>here</a></center></p> > </fieldset> > [% END %] > >@@ -529,7 +528,7 @@ width: 300px; /* not enough for IE7 apparently */ > [% FOREACH field IN dont_export_field_loop %] > tags.push("[% field.fieldid | html %]"); > [% END %] >- var mana_enabled = [% Koha.Preference('Mana') %] >+ var mana_enabled = [% IF (Koha.Preference('Mana') && mana_url) %]1[% ELSE %]0[% END %]; > var MSG_LINK_TO_VENDOR = _("If you wish to claim late or missing issues you must link this subscription to a vendor. Click OK to ignore or Cancel to return and enter a vendor"); > var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record"); > var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date."); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index 141b63a..193b707 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -62,7 +62,7 @@ > [% IF mana_code.defined %] > <div id="alert-community" class="dialog message"> > <p> >- [% mana_code %] >+ [% mana_code | html %] > </p> > </div> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >index da8abd1..776c9fd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >@@ -507,7 +507,9 @@ function mana_use(mana_id){ > } > > $(document).ready(function() { >- mana_search(); >+ if ( mana_enabled == 1 ) { >+ mana_search(); >+ } > $("#displayexample").hide(); > $("#mana_search_result").modal("hide"); > $("#aqbooksellerid").on('keypress', function(e) { >@@ -617,7 +619,7 @@ $(document).ready(function() { > }); > $("#subscription_add_next").on("click",function(){ > if ( Check_page1() ){ >- if ( mana_enabled ) { >+ if ( mana_enabled == 1 ) { > mana_search(); > } > show_page_2(); >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 511d939..80edc2a 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -678,7 +678,9 @@ elsif ( $phase eq 'Save Report' ) { > } > > elsif ($phase eq 'Share'){ >- my $result = Koha::SharedContent::send_entity($input->param('mana_language'), $borrowernumber, scalar $input->param('reportid'), 'report'); >+ my $lang = $input->param('mana_language') || ''; >+ my $reportid = $input->param('reportid'); >+ my $result = Koha::SharedContent::send_entity($lang, $borrowernumber, $reportid, 'report'); > if ( $result ) { > print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved&manamsg=".$result->{msg}); > }else{ >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 2edb78d..31198c6 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -52,7 +52,7 @@ my $sub_length; > my $permission = > ( $op eq 'modify' || $op eq 'modsubscription' ) ? "edit_subscription" : "create_subscription"; > >-my ($template, $loggedinuser, $cookie) >+our ($template, $loggedinuser, $cookie) > = get_template_and_user({template_name => "serials/subscription-add.tt", > query => $query, > type => "intranet", >@@ -68,6 +68,9 @@ my $sub_on; > my $subs; > our $firstissuedate; > >+my $mana_url = C4::Context->config('mana_config'); >+$template->param( 'mana_url' => $mana_url ); >+ > if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { > > my $subscriptionid = $query->param('subscriptionid'); >diff --git a/svc/mana/token b/svc/mana/token >deleted file mode 100755 >index 3ea6254..0000000 >--- a/svc/mana/token >+++ /dev/null >@@ -1,55 +0,0 @@ >-#!/usr/bin/perl >- >-# Copyright 2016 BibLibre Baptiste Wojtkowski >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <http://www.gnu.org/licenses>. >-# >- >- >-use Modern::Perl; >- >-use Koha::SharedContent; >-use C4::Auth qw(check_cookie_auth); >- >-use CGI; >-use JSON; >- >-my $input = new CGI; >-binmode STDOUT, ":encoding(UTF-8)"; >-print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); >- >-my ( $auth_status, $sessionID ) = >- check_cookie_auth( $input->cookie('CGISESSID'), >- { serials => 'create_subscription' } ); >- >-if ( $auth_status ne "ok" ) { >- exit 0; >-} >- >-my $mana_ip = C4::Context->config('mana_config'); >- >-my $url = "$mana_ip/getsecuritytoken"; >-my $request = HTTP::Request->new( POST => $url ); >- >-my $content; >-$content->{ firstname }= $input->param("firstname"); >-$content->{ lastname }= $input->param("lastname"); >-$content->{ email }= $input->param("email"); >-my $json = to_json( $content, { utf8 => 1 } ); >-$request->content($json); >-my $result = Koha::SharedContent::process_request($request); >- >-print(to_json($result)); >diff --git a/t/db_dependent/Koha/Subscription.t b/t/db_dependent/Koha/Subscription.t >index fadaae7..926bdc1 100644 >--- a/t/db_dependent/Koha/Subscription.t >+++ b/t/db_dependent/Koha/Subscription.t >@@ -32,6 +32,8 @@ use t::lib::TestBuilder; > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > >+my $builder = t::lib::TestBuilder->new; >+ > use_ok('Koha::Subscription'); > > subtest 'Koha::Subscription->biblio' => sub { >-- >2.7.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 17047
:
56175
|
56176
|
56177
|
56178
|
56179
|
56180
|
56181
|
59728
|
59729
|
59931
|
61905
|
62045
|
62046
|
62047
|
62048
|
62049
|
62050
|
62051
|
62052
|
62053
|
62054
|
62075
|
62465
|
62475
|
62485
|
62540
|
62542
|
62543
|
62544
|
62545
|
62546
|
62547
|
62548
|
62549
|
62550
|
62551
|
62552
|
62553
|
62589
|
62591
|
62592
|
62593
|
62594
|
62595
|
62596
|
62597
|
62598
|
62599
|
62603
|
62604
|
62605
|
62606
|
62607
|
62768
|
63476
|
63601
|
63618
|
63619
|
63620
|
63621
|
63622
|
63623
|
64484
|
64530
|
64618
|
64619
|
64620
|
64621
|
64622
|
64623
|
64624
|
64625
|
64626
|
64627
|
64628
|
64629
|
64630
|
64631
|
64632
|
64633
|
64634
|
64635
|
64636
|
64637
|
64638
|
64639
|
64640
|
64641
|
64642
|
64643
|
64648
|
64649
|
64650
|
64651
|
64652
|
64653
|
64654
|
64706
|
64962
|
65058
|
65059
|
65060
|
65061
|
65062
|
65063
|
65064
|
65065
|
65773
|
66667
|
66668
|
66987
|
67003
|
67004
|
67005
|
67006
|
67009
|
67010
|
67011
|
67012
|
67013
|
67014
|
67015
|
67016
|
67017
|
67018
|
67019
|
67020
|
67021
|
67022
|
67023
|
69034
|
69035
|
69036
|
69037
|
69038
|
69039
|
69040
|
69041
|
69091
|
70203
|
70204
|
70205
|
70206
|
70208
|
70209
|
70210
|
70211
|
70561
|
70874
|
72660
|
72661
|
72662
|
72663
|
72664
|
72665
|
72666
|
72667
|
72668
|
72669
|
72670
|
73699
|
73737
|
73738
|
73739
|
73740
|
73741
|
73742
|
73743
|
73744
|
73745
|
73746
|
73747
|
73748
|
73975
|
73976
|
73977
|
73978
|
73979
|
73980
|
73981
|
73982
|
73983
|
73984
|
73985
|
73986
|
76673
|
76674
|
76675
|
76676
|
76677
|
76678
|
76679
|
76680
|
76681
|
76682
|
76683
|
76684
|
78215
|
78216
|
78217
|
78218
|
78219
|
78220
|
78221
|
78222
|
78223
|
78224
|
78225
|
78226
|
78227
|
78228
|
78229
|
79868
|
79869
|
79870
|
79871
|
79872
|
79874
|
79877
|
79878
|
79879
|
79880
|
79881
|
79882
|
79883
|
79884
|
79885
|
79886
|
79887
|
79888
|
79922
|
79923
|
79924
|
79925
|
79926
|
79927
|
79928
|
79929
|
79930
|
79931
|
79932
|
79933
|
79934
|
79935
|
79936
|
79937
|
79938
|
79939
|
80183
|
80184
|
80185
|
80186
|
80187
|
80188
|
80189
|
80190
|
80191
|
80192
|
80193
|
80194
|
80195
|
80196
|
80197
|
80198
|
80199
|
80200
|
80471
|
80472
|
80473
|
80907
|
80908
|
80909
|
80910
|
80911
|
80912
|
80913
|
80914
|
80915
|
80916
|
80917
|
80918
|
80919
|
80920
|
80921
|
80922
|
80923
|
80924
|
81935
|
81936
|
81937
|
81938
|
81939
|
81940
|
81941
|
81942
|
81943
|
81944
|
81945
|
81946
|
81947
|
81948
|
81949
|
81950
|
81951
|
81952
|
81968
|
83863
|
83864
|
83865
|
83866
|
83867
|
83868
|
83869
|
83870
|
83871
|
83872
|
83873
|
83874
|
83875
|
83876
|
83877
|
83878
|
83879
|
83880
|
83881
|
83892
|
83893
|
83894
|
83895
|
83896
|
83897
|
83898
|
83899
|
83900
|
83901
|
83902
|
83903
|
83904
|
83905
|
83906
|
83907
|
83908
|
83909
|
83910
|
83911
|
83912
|
84142
|
84145
|
84210
|
84260
|
84261
|
84262
|
84263
|
84264
|
84265
|
84323
|
84324
|
84325
|
84326
|
84327
|
84328
|
84329
|
84332