View | Details | Raw Unified | Return to bug 17047
Collapse All | Expand All

(-)a/Koha/Report.pm (-13 / +28 lines)
Lines 37-80 Koha::Report - Koha Report Object Class Link Here
37
37
38
=cut
38
=cut
39
39
40
=head3 type
40
=head3 get_search_info
41
41
42
=cut
42
=cut
43
43
44
sub get_search_info {
44
sub get_search_info {
45
    my $self=shift;
45
    my $self = shift;
46
    my $sub_mana_info = { 'query' => shift };
46
    my $sub_mana_info = { 'query' => shift };
47
    return $sub_mana_info;
47
    return $sub_mana_info;
48
}
48
}
49
49
50
sub get_sharable_info{
50
=head3 get_sharable_info
51
    my $self=shift;
51
52
    my $shared_report_id=shift;
52
=cut
53
    my $report = Koha::Reports->find($shared_report_id);
53
54
    my $sub_mana_info = {
54
sub get_sharable_info {
55
        'savedsql' => $report->savedsql,
55
    my $self             = shift;
56
        'report_name' => $report->report_name,
56
    my $shared_report_id = shift;
57
        'notes' => $report->notes,
57
    my $report           = Koha::Reports->find($shared_report_id);
58
    my $sub_mana_info    = {
59
        'savedsql'     => $report->savedsql,
60
        'report_name'  => $report->report_name,
61
        'notes'        => $report->notes,
58
        'report_group' => $report->report_group,
62
        'report_group' => $report->report_group,
59
        'type' => $report->type,
63
        'type'         => $report->type,
60
    };
64
    };
61
    return $sub_mana_info;
65
    return $sub_mana_info;
62
}
66
}
63
67
64
sub new_from_mana{
68
=head3 new_from_mana
69
70
=cut
71
72
sub new_from_mana {
65
    my $self = shift;
73
    my $self = shift;
66
    my $data = shift;
74
    my $data = shift;
75
76
    $data->{mana_id} = $data->{id};
77
67
    delete $data->{exportemail};
78
    delete $data->{exportemail};
68
    delete $data->{kohaversion};
79
    delete $data->{kohaversion};
69
    delete $data->{creationdate};
80
    delete $data->{creationdate};
70
    delete $data->{lastimport};
81
    delete $data->{lastimport};
71
    $data->{mana_id} = $data->{id};
72
    delete $data->{id};
82
    delete $data->{id};
73
    delete $data->{nbofusers};
83
    delete $data->{nbofusers};
74
    delete $data->{language};
84
    delete $data->{language};
85
75
    Koha::Report->new($data)->store;
86
    Koha::Report->new($data)->store;
76
}
87
}
77
88
89
=head3 type
90
91
=cut
92
78
sub _type {
93
sub _type {
79
    return 'SavedSql';
94
    return 'SavedSql';
80
}
95
}
(-)a/Koha/Reports.pm (+4 lines)
Lines 45-50 sub _type { Link Here
45
    return 'SavedSql';
45
    return 'SavedSql';
46
}
46
}
47
47
48
=head3 object_class
49
50
=cut
51
48
sub object_class {
52
sub object_class {
49
    return 'Koha::Report';
53
    return 'Koha::Report';
50
}
54
}
(-)a/Koha/Schema/Result/SavedSql.pm (-2 / +9 lines)
Lines 105-110 __PACKAGE__->table("saved_sql"); Link Here
105
  is_nullable: 1
105
  is_nullable: 1
106
  size: 80
106
  size: 80
107
107
108
=head2 mana_id
109
110
  data_type: 'integer'
111
  is_nullable: 1
112
108
=cut
113
=cut
109
114
110
__PACKAGE__->add_columns(
115
__PACKAGE__->add_columns(
Lines 148-153 __PACKAGE__->add_columns( Link Here
148
  { data_type => "varchar", is_nullable => 1, size => 80 },
153
  { data_type => "varchar", is_nullable => 1, size => 80 },
149
  "report_subgroup",
154
  "report_subgroup",
150
  { data_type => "varchar", is_nullable => 1, size => 80 },
155
  { data_type => "varchar", is_nullable => 1, size => 80 },
156
  "mana_id",
157
  { data_type => "integer", is_nullable => 1 },
151
);
158
);
152
159
153
=head1 PRIMARY KEY
160
=head1 PRIMARY KEY
Lines 163-170 __PACKAGE__->add_columns( Link Here
163
__PACKAGE__->set_primary_key("id");
170
__PACKAGE__->set_primary_key("id");
164
171
165
172
166
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-24 09:58:16
173
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-09-08 16:56:26
167
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eGWRRzpe1+EBialePAIhMQ
174
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:h0WO9NqYD7hGZIaYTBkYSA
168
175
169
176
170
# You can replace this text with custom content, and it will be preserved on regeneration
177
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Subscription.pm (-2 / +9 lines)
Lines 271-276 __PACKAGE__->table("subscription"); Link Here
271
  is_nullable: 1
271
  is_nullable: 1
272
  size: 10
272
  size: 10
273
273
274
=head2 mana_id
275
276
  data_type: 'integer'
277
  is_nullable: 1
278
274
=cut
279
=cut
275
280
276
__PACKAGE__->add_columns(
281
__PACKAGE__->add_columns(
Lines 358-363 __PACKAGE__->add_columns( Link Here
358
  { data_type => "varchar", is_nullable => 1, size => 10 },
363
  { data_type => "varchar", is_nullable => 1, size => 10 },
359
  "previousitemtype",
364
  "previousitemtype",
360
  { data_type => "varchar", is_nullable => 1, size => 10 },
365
  { data_type => "varchar", is_nullable => 1, size => 10 },
366
  "mana_id",
367
  { data_type => "integer", is_nullable => 1 },
361
);
368
);
362
369
363
=head1 PRIMARY KEY
370
=head1 PRIMARY KEY
Lines 445-452 __PACKAGE__->has_many( Link Here
445
);
452
);
446
453
447
454
448
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-09-12 09:39:32
455
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-09-08 16:56:26
449
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jAZGa1b6DkY8Sr12reD4nw
456
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B7uzwnRQgHBSLbPlditcsA
450
457
451
458
452
# You can replace this text with custom content, and it will be preserved on regeneration
459
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/SharedContent.pm (+32 lines)
Lines 28-33 use C4::Context; Link Here
28
28
29
our $MANA_IP = C4::Context->config('mana_config');
29
our $MANA_IP = C4::Context->config('mana_config');
30
30
31
=head1 DESCRIPTION
32
33
Package for accessing shared content via Mana
34
35
=head2 Package Functions
36
37
=cut
38
39
=head3 manaRequest
40
41
=cut
42
31
sub manaRequest {
43
sub manaRequest {
32
    my $mana_request = shift;
44
    my $mana_request = shift;
33
    my $result;
45
    my $result;
Lines 53-58 sub manaRequest { Link Here
53
    return $result ;
65
    return $result ;
54
}
66
}
55
67
68
=head3 manaIncrementRequest
69
70
=cut
71
56
sub manaIncrementRequest {
72
sub manaIncrementRequest {
57
    my $resource = shift;
73
    my $resource = shift;
58
    my $id       = shift;
74
    my $id       = shift;
Lines 71-76 sub manaIncrementRequest { Link Here
71
    return manaRequest($request);
87
    return manaRequest($request);
72
}
88
}
73
89
90
=head3 manaPostRequest
91
92
=cut
93
74
sub manaPostRequest {
94
sub manaPostRequest {
75
    my $resource = shift;
95
    my $resource = shift;
76
    my $content  = shift;
96
    my $content  = shift;
Lines 84-89 sub manaPostRequest { Link Here
84
    return manaRequest($request);
104
    return manaRequest($request);
85
}
105
}
86
106
107
=head3 manaShareInfos
108
109
=cut
110
87
sub manaShareInfos{
111
sub manaShareInfos{
88
    my ($query, $loggedinuser, $ressourceid, $ressourcetype) = @_;
112
    my ($query, $loggedinuser, $ressourceid, $ressourcetype) = @_;
89
    my $mana_language;
113
    my $mana_language;
Lines 132-137 sub manaShareInfos{ Link Here
132
    return $result;
156
    return $result;
133
}
157
}
134
158
159
=head3 manaGetRequestWithId
160
161
=cut
162
135
sub manaGetRequestWithId {
163
sub manaGetRequestWithId {
136
    my $resource = shift;
164
    my $resource = shift;
137
    my $id       = shift;
165
    my $id       = shift;
Lines 142-147 sub manaGetRequestWithId { Link Here
142
    return manaRequest($request);
170
    return manaRequest($request);
143
}
171
}
144
172
173
=head3 manaGetRequest
174
175
=cut
176
145
sub manaGetRequest {
177
sub manaGetRequest {
146
    my $resource   = shift;
178
    my $resource   = shift;
147
    my $parameters = shift;
179
    my $parameters = shift;
(-)a/Koha/Subscription.pm (-1 / +10 lines)
Lines 53-59 sub biblio { Link Here
53
    return scalar Koha::Biblios->find($self->biblionumber);
53
    return scalar Koha::Biblios->find($self->biblionumber);
54
}
54
}
55
55
56
=head3 type
56
=head3 get_search_info
57
57
58
=cut
58
=cut
59
59
Lines 74-79 sub get_search_info { Link Here
74
    return $sub_mana_info;
74
    return $sub_mana_info;
75
}
75
}
76
76
77
=head3 get_sharable_info
78
79
=cut
80
77
sub get_sharable_info {
81
sub get_sharable_info {
78
    my $self = shift;
82
    my $self = shift;
79
    my $shared_sub_id = shift;
83
    my $shared_sub_id = shift;
Lines 120-125 sub get_sharable_info { Link Here
120
    return $sub_mana_info;
124
    return $sub_mana_info;
121
}
125
}
122
126
127
128
=head3 _type
129
130
=cut
131
123
sub _type {
132
sub _type {
124
    return 'Subscription';
133
    return 'Subscription';
125
}
134
}
(-)a/Koha/Subscription/Numberpatterns.pm (-1 / +1 lines)
Lines 32-38 Koha::SubscriptionNumberpatterns - Koha SubscriptionNumberpattern object set cla Link Here
32
32
33
=cut
33
=cut
34
34
35
=head3 uniqeLabel
35
=head3 uniqueLabel
36
36
37
=cut
37
=cut
38
38
(-)a/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql (-2 / +2 lines)
Lines 1-2 Link Here
1
ALTER TABLE subscription ADD mana_id int(11);
1
ALTER TABLE subscription ADD mana_id int(11) NULL DEFAULT NULL;
2
ALTER TABLE saved_sql ADD mana_id int(11);
2
ALTER TABLE saved_sql ADD mana_id int(11) NULL DEFAULT NULL;
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 1470-1475 CREATE TABLE saved_sql ( -- saved sql reports Link Here
1470
    report_area varchar(6) default NULL,
1470
    report_area varchar(6) default NULL,
1471
    report_group varchar(80) default NULL,
1471
    report_group varchar(80) default NULL,
1472
    report_subgroup varchar(80) default NULL,
1472
    report_subgroup varchar(80) default NULL,
1473
    `mana_id` int(11) NULL DEFAULT NULL,
1473
   PRIMARY KEY  (`id`),
1474
   PRIMARY KEY  (`id`),
1474
   KEY sql_area_group_idx (report_group, report_subgroup),
1475
   KEY sql_area_group_idx (report_group, report_subgroup),
1475
   KEY boridx (`borrowernumber`)
1476
   KEY boridx (`borrowernumber`)
Lines 2128-2133 CREATE TABLE `subscription` ( -- information related to the subscription Link Here
2128
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2129
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2129
  `itemtype` VARCHAR( 10 ) NULL,
2130
  `itemtype` VARCHAR( 10 ) NULL,
2130
  `previousitemtype` VARCHAR( 10 ) NULL,
2131
  `previousitemtype` VARCHAR( 10 ) NULL,
2132
  `mana_id` int(11) NULL DEFAULT NULL,
2131
  PRIMARY KEY  (`subscriptionid`),
2133
  PRIMARY KEY  (`subscriptionid`),
2132
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2134
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2133
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
2135
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref (-1 / +1 lines)
Lines 59-65 Web services: Link Here
59
             - "Security token used to authenticate on mana:"
59
             - "Security token used to authenticate on mana:"
60
             - pref: ManaToken
60
             - pref: ManaToken
61
               class: Text
61
               class: Text
62
             - <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. <script src=/intranet-tmpl/lib/jquery/activatemana.js></script> <br> <form> Firstname <input name="firstname" type="text" id="firstname"> <br> Lastname <input name="lastname" type=text id=lastname> <br> email <input name="email" type=text id=email><br> <input type=submit id=activatemana value="Send"></form>
62
             - <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. <script src=/intranet-tmpl/lib/jquery/activatemana.js></script> <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>
63
        -
63
        -
64
            - 'Fields automatically shared with mana'
64
            - 'Fields automatically shared with mana'
65
            - pref: AutoShareWithMana
65
            - pref: AutoShareWithMana
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-1 lines)
Lines 417-423 function mana_search() { Link Here
417
    })
417
    })
418
    .done( function( result ) {
418
    .done( function( result ) {
419
        $("#mana_search_result .modal-body").html(result);
419
        $("#mana_search_result .modal-body").html(result);
420
debugger;
421
        $("#mana_search_result_label").text("Results from Mana Knowledge Base");
420
        $("#mana_search_result_label").text("Results from Mana Knowledge Base");
422
        $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, {
421
        $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, {
423
            "sPaginationType": "four_button",
422
            "sPaginationType": "four_button",
(-)a/serials/serials-collection.pl (-1 / +1 lines)
Lines 82-88 if($op eq 'gennext' && @subscriptionid){ Link Here
82
            ) = GetNextSeq($subscription, $pattern, $frequency, $expected->{publisheddate});
82
            ) = GetNextSeq($subscription, $pattern, $frequency, $expected->{publisheddate});
83
83
84
             ## We generate the next publication date
84
             ## We generate the next publication date
85
             my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
85
             $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
86
             my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, $frequency, 1);
86
             my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, $frequency, 1);
87
             ## Creating the new issue
87
             ## Creating the new issue
88
             NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'},
88
             NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'},
(-)a/t/db_dependent/Serials.t (-2 / +1 lines)
Lines 288-294 my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscrip Link Here
288
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
288
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
289
my $publisheddate = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
289
my $publisheddate = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
290
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
290
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
291
my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
291
$frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
292
my $nextpublisheddate = C4::Serials::GetNextDate($subscription, $publisheddate, $frequency, 1);
292
my $nextpublisheddate = C4::Serials::GetNextDate($subscription, $publisheddate, $frequency, 1);
293
my @statuses = qw( 2 2 3 3 3 3 3 4 4 41 42 43 44 5 );
293
my @statuses = qw( 2 2 3 3 3 3 3 4 4 41 42 43 44 5 );
294
# Add 14 serials
294
# Add 14 serials
295
- 

Return to bug 17047