From 04fc20696b94de5398e60da6f7da10b6fd3d1261 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Wed, 8 Mar 2017 15:46:24 +0000 Subject: [PATCH] Bug 17047 SQL reports management with Mana-KB Includes: * code factorization Some code from subscription & Mana-KB has been factorized in order to speed-up next developments * SytemPreferences: Mana Activation: - add a value "no, let me think about it", that is the default value. - as long as this value is selected, messages ask if user want to activate it ( in Administration and Add-subscription(page 2) ) AutoShareWithMana - Add the syspref AutoShareWithMana: user can automatically share infos with Mana-KB (not set by default) * Interface : - On mana-search, rows are now sorted by date of last import, then by number of users - Windows redesigned to improve the user experience * New Feature : report a mistake. - people can now report an invalid data (wrong, obsolete,...) - if a data is reported as invalid many time, it will appear differently - Added few tooltip (to explain the fields last import, nb of users, to explain the new feature) - When reporting a data as invalid, a comment can also be added. Koha will then display comments related to data in result lists * API (svc/mana) - add svc/mana/addvaluetofield: allows to ask mana incrementing a field of a resource - no hardcoding for resources in the code of api (api needs to be called with a ressourcename) * New feature : SQL report sharing - Create Koha::Report.pm and Koha::Reports.pm, objects class for Reports - New feature: share reports with Mana-KB - New feature: search report in Mana-KB with keywords - New feature: load reports from Mana-KB ========= Test plan ========= (see BibLibre complete documentation, attached to this patch) 1 - Apply Patch + update database 2 - Copy the three lines about mana config in etc/koha-conf.xml in ../etc/koha-conf.xml 3 - Check Mana syspref and AutoShareWithMana syspref are not activated 4 - subscriptions - Try create a new subscription for a first serial => Koha shouldn't show you anything (except if the base hase been filled) - Share this serial on Mana-KB (on the subscription detail page there must be a Share button) - Try to create a new subscription for serial #1 => a message should appear when you click on "next", click on "use", the fields should automaticaly appear - Activate AutoShareWithMana => Subscriptions - Create a new subscription for a second serial - There shouldn't be any Share button - Create a second subscription => the message should appear, click again on use 5 - SQL Report - Create a new report, without notes. - On the table with all report (reports > use saved), there should be the action "Share" - If you click on share, you have an error message - Create a new report, with a title and notes longer than 20 characters - You can share it on Mana-KB => you will have a success message - On (report > use saved), there must be a message inviting you to search on mana-KB for more results, enter a few word from title, notes, type of the report you shared, it should appear. You can use it, it will load it into your report list. 6 - Comments. - On any table containing mana search results, you can report a mistake & comment why you report: click on report mistake. You only can chose "other" because there's no comment in Mana-KB [if there are comments, you'll get other values]. - If you click other, a new textbox appears. Enter a short comment. - Reload the whole page, the comment should appear in the menu and in the comment column. - If you select a comment and reload the whole page, there should be one more comment with this name - If you select a comment and click on cancel just after, there shouldn't be any change when you reload. Signed-off-by: Brendan A Gallagher Signed-off-by: Kyle M Hall --- Koha/Report.pm | 82 ++++++ Koha/Reports.pm | 58 +++++ Koha/SharedContent.pm | 66 ++++- Koha/Subscription.pm | 2 + etc/koha-conf.xml | 4 + .../mana_01-add_mana_id_in_subscription.sql | 1 + .../atomicupdate/mana_02-add_Mana_syspref.sql | 2 +- .../atomicupdate/mana_03-add_mana_autoshare.sql | 2 + installer/data/mysql/sysprefs.sql | 1 + koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 6 + .../includes/mana-subscription-search-result.inc | 46 ---- .../en/includes/mana/mana-report-search-result.inc | 83 ++++++ .../mana/mana-subscription-search-result.inc | 82 ++++++ .../prog/en/includes/serials-toolbar.inc | 16 +- .../prog/en/modules/admin/admin-home.tt | 8 + .../en/modules/admin/preferences/web_services.pref | 12 +- .../en/modules/mana/mana-report-search-result.tt | 1 + .../mana/mana-subscription-search-result.tt | 1 + .../en/modules/reports/guided_reports_start.tt | 287 ++++++++++++++++++++- .../serials/mana-subscription-search-result.tt | 1 - .../prog/en/modules/serials/subscription-add.tt | 19 +- .../intranet-tmpl/prog/js/subscription-add.js | 64 ++++- reports/guided_reports.pl | 13 +- serials/subscription-add.pl | 9 +- serials/subscription-detail.pl | 39 +-- svc/mana/addvaluetofield | 42 +++ svc/mana/search | 31 ++- svc/mana/share | 47 ++++ svc/mana/use | 19 +- 29 files changed, 906 insertions(+), 138 deletions(-) create mode 100644 Koha/Report.pm create mode 100644 Koha/Reports.pm create mode 100644 installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/mana/mana-report-search-result.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/mana/mana-subscription-search-result.tt delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/serials/mana-subscription-search-result.tt create mode 100755 svc/mana/addvaluetofield create mode 100755 svc/mana/share diff --git a/Koha/Report.pm b/Koha/Report.pm new file mode 100644 index 0000000..b0197fb --- /dev/null +++ b/Koha/Report.pm @@ -0,0 +1,82 @@ +package Koha::Report; + +# Copyright 2017 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; +use JSON; +use Koha::Reports; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Report - Koha Report Object Class + +=head1 Ap + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub get_search_info { + my $self=shift; + my $sub_mana_info = { 'query' => shift }; + return $sub_mana_info; +} + +sub get_sharable_info{ + my $self=shift; + my $shared_report_id=shift; + my $report = Koha::Reports->find($shared_report_id); + my $sub_mana_info = { + 'savedsql' => $report->savedsql, + 'report_name' => $report->report_name, + 'notes' => $report->notes, + 'report_group' => $report->report_group, + 'type' => $report->type, + }; + return $sub_mana_info; +} + +sub new_from_mana{ + my $self = shift; + my $data = shift; + delete $data->{exportemail}; + delete $data->{kohaversion}; + delete $data->{creationdate}; + delete $data->{lastimport}; + $data->{mana_id} = $data->{id}; + delete $data->{id}; + delete $data->{nbofusers}; + delete $data->{language}; + Koha::Report->new($data)->store; +} + +sub _type { + return 'SavedSql'; +} + +1; diff --git a/Koha/Reports.pm b/Koha/Reports.pm new file mode 100644 index 0000000..dca236c --- /dev/null +++ b/Koha/Reports.pm @@ -0,0 +1,58 @@ +package Koha::Reports; + +# Copyright 2017 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::Report; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Serial - Koha Serial Object class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'SavedSql'; +} + +sub object_class { + return 'Koha::Report'; +} + +=head1 AUTHOR + +Kyle M Hall + +=cut + +1; diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm index e0c512b..7ac12f4 100644 --- a/Koha/SharedContent.pm +++ b/Koha/SharedContent.pm @@ -22,7 +22,10 @@ use JSON; use HTTP::Request; use LWP::UserAgent; -our $MANA_IP = "http://10.25.159.107:5000"; +use Koha::Serials; +use Koha::Reports; + +our $MANA_IP = C4::Context->config('mana_config'); sub manaRequest { my $mana_request = shift; @@ -40,12 +43,20 @@ sub manaRequest { return $result if ( $response->code =~ /^2..$/ ); } -sub manaNewUserPatchRequest { +sub manaIncrementRequest { my $resource = shift; my $id = shift; - - my $url = "$MANA_IP/$resource/$id.json/newUser"; - my $request = HTTP::Request->new( PATCH => $url ); + my $field = shift; + my $step = shift; + my $param; + $param->{step} = $step || 1; + $param->{id} = $id; + $param->{resource} = $resource; + $param = join '&', + map { defined $param->{$_} ? $_ . "=" . $param->{$_} : () } + keys %$param; + my $url = "$MANA_IP/$resource/$id.json/increment/$field?$param"; + my $request = HTTP::Request->new( POST => $url ); return manaRequest($request); } @@ -64,6 +75,51 @@ sub manaPostRequest { return manaRequest($request); } +sub manaShareInfos{ + my ($query, $loggedinuser, $ressourceid, $ressourcetype) = @_; + my $mana_language; + if ( $query->param('mana_language') ) { + $mana_language = $query->param('mana_language'); + } + else { + my $result = $mana_language = C4::Context->preference('language'); + } + + my $mana_email; + if ( $loggedinuser ne 0 ) { + my $borrower = Koha::Patrons->find($loggedinuser); + $mana_email = $borrower->email + if ( ( not defined($mana_email) ) or ( $mana_email eq '' ) ); + $mana_email = $borrower->emailpro + if ( ( not defined($mana_email) ) or ( $mana_email eq '' ) ); + $mana_email = + Koha::Libraries->find( C4::Context->userenv->{'branch'} )->branchemail + if ( ( not defined($mana_email) ) or ( $mana_email eq '' ) ); + } + $mana_email = C4::Context->preference('KohaAdminEmailAddress') + if ( ( not defined($mana_email) ) or ( $mana_email eq '' ) ); + my %versions = C4::Context::get_versions(); + + my $mana_info = { + language => $mana_language, + kohaversion => $versions{'kohaVersion'}, + exportemail => $mana_email + }; + my ($ressource, $ressource_mana_info); + my $packages = "Koha::".ucfirst($ressourcetype)."s"; + my $package = "Koha::".ucfirst($ressourcetype); + $ressource_mana_info = $package->get_sharable_info($ressourceid); + $ressource_mana_info = { %$ressource_mana_info, %$mana_info }; + $ressource = $packages->find($ressourceid); + + my $result = Koha::SharedContent::manaPostRequest( $ressourcetype, + $ressource_mana_info ); + if ( $result and ($result->{code} eq "200" or $result->{code} eq "201") ) { + $ressource->set( { mana_id => $result->{id} } )->store; + } + return $result; +} + sub manaGetRequestWithId { my $resource = shift; my $id = shift; diff --git a/Koha/Subscription.pm b/Koha/Subscription.pm index b865eaf..4000b72 100644 --- a/Koha/Subscription.pm +++ b/Koha/Subscription.pm @@ -58,6 +58,7 @@ sub biblio { =cut sub get_search_info { + my $self=shift; my $searched_sub_id = shift; my $biblio = Koha::Biblios->find( { 'biblionumber' => $searched_sub_id } ); my $biblioitem = @@ -73,6 +74,7 @@ sub get_search_info { } sub get_sharable_info { + my $self = shift; my $shared_sub_id = shift; my $subscription = Koha::Subscriptions->find($shared_sub_id); my $biblio = Koha::Biblios->find( $subscription->biblionumber ); diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index 268175d..5aac1e5 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -146,6 +146,10 @@ __PAZPAR2_TOGGLE_XML_POST__ __KOHA_CONF_DIR__/sms_send/ + + + http://mana-kb.koha-community.org + 50 2 diff --git a/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql b/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql index 5c590d1..66c23ac 100644 --- a/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql +++ b/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql @@ -1 +1,2 @@ ALTER TABLE subscription ADD mana_id int(11); +ALTER TABLE saved_sql ADD mana_id int(11); 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 38d7ffb..dda85a5 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 @@ -INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('Mana', '1', '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.', NULL, 'YesNo'); +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'); diff --git a/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql b/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql new file mode 100644 index 0000000..353ffc1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql @@ -0,0 +1,2 @@ +INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES +('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index e07d9d8..eb5393f 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -60,6 +60,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'), ('AutoEmailOpacUser','0',NULL,'Sends notification emails containing new account details to patrons - when account is created.','YesNo'), ('AutoEmailPrimaryAddress','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address where \'Account Details\' emails are sent.','Choice'), +('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'), ('AutoLocation','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff client from unauthorized IP addresses','YesNo'), ('AutomaticItemReturn','1',NULL,'If ON, Koha will automatically set up a transfer of this item to its homebranch','YesNo'), ('autoMemberNum','1','','If ON, patron number is auto-calculated','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css index 3ab9d7e..31bc135 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css @@ -299,6 +299,12 @@ table+table { .highlighted-row, .highlighted-row td { background-color: #FFD000 !important } +.warned-row, +.warned-row td { background-color: #FF9000 !important } + +.high-warned-row, +.high-warned-row td { background-color: #FF0000 !important } + tbody tr:nth-child(odd) td { background-color : #F3F3F3; border : 1px solid #BCBCBC; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc deleted file mode 100644 index 4ce9b9b..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc +++ /dev/null @@ -1,46 +0,0 @@ -[% USE KohaDates %] - - - - - - - - - - [% UNLESS search_only %] - - [% END %] - - - - - - - - - - - [% UNLESS search_only %] - - [% END %] - - - - [% FOREACH subscription IN subscriptions %] - [% UNLESS subscription.cannotdisplay %] - - - - - - - - [% UNLESS search_only %] - - [% END %] - - [% END %] - [% END %] - -
ISSNTitleFrequencyNumbering patternNumber of usersLast ImportActions
[% IF ( subscription.issn ) %][% subscription.issn %][% END %][% subscription.title %][% IF ( subscription.sfdescription ) %][% subscription.sfdescription %][% END %][% IF ( subscription.numberingmethod ) %][% subscription.numberingmethod %][% END %][% IF ( subscription.nbofusers ) %][% subscription.nbofusers %][% END %][% subscription.lastimport | $KohaDates %] Use
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 new file mode 100644 index 0000000..7f74257 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc @@ -0,0 +1,83 @@ +[% USE KohaDates %] +[% USE Koha %] +[% USE AuthorisedValues %] +[% USE Branches %] + + + + + + + + + + + [% UNLESS search_only %] + + [% END %] + + + + [% FOREACH report IN reports %] + [% UNLESS report.cannotdisplay %] + highWarned %] + class = "high-warned-row" + [% ELSIF report.nbofcomment > warned %] + class = "warned-row" + [% ELSIF report.nbofcomment > lowWarned %] + class = "highlighted-row" + [% END %] + > + + + + [% END %] + + + + + + [% UNLESS search_only %] + + [% END %] + + [% END %] + [% END %] + +
Report NameNotesType# of usersLast import Comments Actions
[% IF ( report.report_name ) %][% report.report_name %][% END %]
+ [% IF report.notes.length > 200 %] + [% report.notes.substr(0,200) %]Show More
[% report.type %] [% IF ( report.nbofusers ) %][% report.nbofusers %][% END %][% report.lastimport | $KohaDates %][% FOREACH comment IN report.comments %][% comment.message %] ([% comment.nb %])
[% 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 new file mode 100644 index 0000000..447ab50 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc @@ -0,0 +1,82 @@ +[% USE KohaDates %] +[% USE Koha %] +[% USE AuthorisedValues %] +[% USE Branches %] + + + + + + + + + + + + + + + [% UNLESS search_only %] + + [% END %] + + + + [% FOREACH subscription IN subscriptions %] + [% UNLESS subscription.cannotdisplay %] + highWarned %] + class = "high-warned-row" title="this resource has been reported more than [% highWarned %] times, take care!" + [% ELSIF subscription.nbofcomment > warned %] + class = "warned-row" title="this resource has been reported more than [% warned %] times, take care!" + [% ELSIF subscription.nbofcomment > lowWarned %] + class = "highlighted-row" title="this resource has been reported more than [% lowWarned %] times, take care!" + [% END %] + > + + + + + + + + + + + [% UNLESS search_only %] + + [% END %] + + [% END %] + [% END %] + +
ISSNTitle Published by FrequencyNumbering pattern# of usersLast import Comments Actions
[% IF ( subscription.issn ) %][% subscription.issn %][% END %][% subscription.title %][% IF ( subscription.publishercode ) %][% subscription.publishercode %][% END %][% IF ( subscription.sfdescription ) %][% subscription.sfdescription %][% END %][% IF ( subscription.numberingmethod ) %][% subscription.numberingmethod %][% END %][% IF ( subscription.nbofusers ) %][% subscription.nbofusers %][% END %][% subscription.lastimport | $KohaDates %][% FOREACH comment IN subscription.comments %][% comment.message %] ([% comment.nb %])
[% END %]
+ + + + +
+ + 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 4905143..86ff761 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc @@ -7,11 +7,11 @@ [% ELSE %] [% END %] - [% IF Koha.Preference('Mana') %] + [% IF Koha.Preference('Mana') and Koha.Preference('AutoShareWithMana').grep('subscription').size == 0 %] [% IF one_language_enabled==0 or mana_id %] - + [% ELSE %] - + [% END %] [% END %] [% END %] @@ -80,18 +80,16 @@ + + [% IF ( saved1 ) %] [% IF ( savedreports ) %]

Saved reports

@@ -147,6 +167,25 @@ canned reports and writing custom SQL reports.

+
+ [% IF (manamsg == 'success') %] + + [% ELSIF (manamsg == 'fail') %] + + [% END %] + + [% IF (Koha.Preference('Mana') == 1) %] + + [% END %] + + +

[% savedreport.sql %]

@@ -174,23 +213,24 @@ canned reports and writing custom SQL reports.

[% FOREACH savedreport IN savedreports %] [% UNLESS ( loop.odd ) %][% ELSE %][% END %] - - - + - - + + - + @@ -239,6 +279,9 @@ canned reports and writing custom SQL reports.

  • Edit
  • Duplicate
  • [% END %] + [% IF (Koha.Preference('Mana') == 1) %] +
  • + [% END %]
  • Schedule
  • [% IF ( CAN_user_reports_delete_reports ) %]
  • Delete
  • @@ -251,6 +294,7 @@ canned reports and writing custom SQL reports.

    [% END %]
    + [% IF ( CAN_user_reports_delete_reports ) %] [% END %] + + [% IF ( savedreport.report_name ) %] [% savedreport.report_name %] [% ELSE %] [ no name ] [% END %] [% savedreport.type %][% savedreport.groupname %][% savedreport.type %][% savedreport.groupname %] [% savedreport.subgroupname %][% savedreport.notes %][% savedreport.notes %] [% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %]) [% savedreport.date_created | $KohaDates %] [% savedreport.last_modified | $KohaDates with_hours => 1 %]
    +
    [% IF ( CAN_user_reports_delete_reports ) %]
    @@ -291,6 +335,111 @@ canned reports and writing custom SQL reports.

    [% END %] [% END %] + + [% IF ( build1 ) %] [% IF ( cache_error) %] @@ -958,6 +1107,10 @@ Sub report: window.history.back(); }); + $(".mana_search_button").on("click",function(){ + mana_search($(this).prev().val()); + }); + + $(".ShareButton").on("click", function(){ + if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ + $("#shared_infos").hide(); + $("#ManaShareButton").hide(); + $("#noterror").show(); + } + else{ + $("#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()); + $("#shared_type").html($(this).closest("tr").find(".report_type").text()); + $("#shared_group").html($(this).closest("tr").find(".report_group").text()); + $("#shared_notes").html($(this).closest("tr").find(".report_notes").text()); + } + }); + + $('#search_form').submit(function () { + return false; + }); + $("#addColumn").on("click",function(){ addColumn(); }); @@ -1152,6 +1329,104 @@ Sub report: