From 0be09dba6178dda45a7489151bceb389e13521d4 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 18 Jan 2019 19:09:22 +0000 Subject: [PATCH] Bug 17047: (follow-up) Improve mana messages, enable by default, show messages if not configured --- admin/admin-home.pl | 2 ++ .../data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql | 2 +- installer/data/mysql/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt | 12 ++++++++---- .../prog/en/modules/serials/subscription-add.tt | 9 ++++----- serials/subscription-add.pl | 3 +++ 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/admin/admin-home.pl b/admin/admin-home.pl index ae16bf6680..f6a7b23ac1 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/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql b/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql index 9fccb5c131..66725aa973 100644 --- a/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql +++ b/installer/data/mysql/atomicupdate/mana_02-add_Mana_syspref.sql @@ -1,2 +1,2 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES -('Mana','0',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'); +('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 634e57830b..bc012d370f 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','0',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'), +('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/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt index 6212e30e7a..2cc41d5b8e 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,10 +13,14 @@
- [% IF ( Koha.Preference('Mana') == 2) %] -
-

You haven't decided if you want to activate Mana Knowlede Base, please let us know by clicking

-
Here
+ [% IF ( Koha.Preference('Mana') == 1) && !mana_url %] +
+

The Mana Knowledge Base feature is enabled but not configured.

+

This feature allows you to retrieve and share data (subscription patterns and reports) with other Koha libaries.

+

+ Ask your system administrator to configure this feature, or remove this note by disabling the 'Mana' system preference + here. +

[% END %]

Koha administration

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 77db9bdca9..2d00bb0cd0 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 */
- [% IF ( Koha.Preference('Mana') == 2) %] + [% IF ( Koha.Preference('Mana') == 1) && !mana_url %]
-

You haven't activated the Mana Knowledge Base, click - here - to configure.

+

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 + here

[% 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') | html %] + 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/serials/subscription-add.pl b/serials/subscription-add.pl index 491f9fbcef..31198c6518 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -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'); -- 2.11.0