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

(-)a/Koha/Report.pm (-11 / +14 lines)
Lines 42-48 Return search info Link Here
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
}
Lines 54-68 Return properties that can be shared. Link Here
54
=cut
54
=cut
55
55
56
sub get_sharable_info {
56
sub get_sharable_info {
57
    my $self=shift;
57
    my $self             = shift;
58
    my $shared_report_id=shift;
58
    my $shared_report_id = shift;
59
    my $report = Koha::Reports->find($shared_report_id);
59
    my $report           = Koha::Reports->find($shared_report_id);
60
    my $sub_mana_info = {
60
    my $sub_mana_info    = {
61
        'savedsql' => $report->savedsql,
61
        'savedsql'     => $report->savedsql,
62
        'report_name' => $report->report_name,
62
        'report_name'  => $report->report_name,
63
        'notes' => $report->notes,
63
        'notes'        => $report->notes,
64
        'report_group' => $report->report_group,
64
        'report_group' => $report->report_group,
65
        'type' => $report->type,
65
        'type'         => $report->type,
66
    };
66
    };
67
    return $sub_mana_info;
67
    return $sub_mana_info;
68
}
68
}
Lines 73-89 Clear a Mana report to be imported in Koha? Link Here
73
73
74
=cut
74
=cut
75
75
76
sub new_from_mana{
76
sub new_from_mana {
77
    my $self = shift;
77
    my $self = shift;
78
    my $data = shift;
78
    my $data = shift;
79
80
    $data->{mana_id} = $data->{id};
81
79
    delete $data->{exportemail};
82
    delete $data->{exportemail};
80
    delete $data->{kohaversion};
83
    delete $data->{kohaversion};
81
    delete $data->{creationdate};
84
    delete $data->{creationdate};
82
    delete $data->{lastimport};
85
    delete $data->{lastimport};
83
    $data->{mana_id} = $data->{id};
84
    delete $data->{id};
86
    delete $data->{id};
85
    delete $data->{nbofusers};
87
    delete $data->{nbofusers};
86
    delete $data->{language};
88
    delete $data->{language};
89
87
    Koha::Report->new($data)->store;
90
    Koha::Report->new($data)->store;
88
}
91
}
89
92
(-)a/Koha/Schema/Result/SavedSql.pm (+7 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
(-)a/Koha/Schema/Result/Subscription.pm (+7 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
(-)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 111-117 sub remove_subscriber { Link Here
111
    $subscriber->delete if $subscriber;
111
    $subscriber->delete if $subscriber;
112
}
112
}
113
113
114
=head3 type
114
=head3 get_search_info
115
115
116
=cut
116
=cut
117
117
Lines 132-137 sub get_search_info { Link Here
132
    return $sub_mana_info;
132
    return $sub_mana_info;
133
}
133
}
134
134
135
=head3 get_sharable_info
136
137
=cut
138
135
sub get_sharable_info {
139
sub get_sharable_info {
136
    my $self = shift;
140
    my $self = shift;
137
    my $shared_sub_id = shift;
141
    my $shared_sub_id = shift;
Lines 178-183 sub get_sharable_info { Link Here
178
    return $sub_mana_info;
182
    return $sub_mana_info;
179
}
183
}
180
184
185
186
=head3 _type
187
188
=cut
189
181
sub _type {
190
sub _type {
182
    return 'Subscription';
191
    return 'Subscription';
183
}
192
}
(-)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 1444-1449 CREATE TABLE saved_sql ( -- saved sql reports Link Here
1444
    report_area varchar(6) default NULL,
1444
    report_area varchar(6) default NULL,
1445
    report_group varchar(80) default NULL,
1445
    report_group varchar(80) default NULL,
1446
    report_subgroup varchar(80) default NULL,
1446
    report_subgroup varchar(80) default NULL,
1447
    `mana_id` int(11) NULL DEFAULT NULL,
1447
   PRIMARY KEY  (`id`),
1448
   PRIMARY KEY  (`id`),
1448
   KEY sql_area_group_idx (report_group, report_subgroup),
1449
   KEY sql_area_group_idx (report_group, report_subgroup),
1449
   KEY boridx (`borrowernumber`)
1450
   KEY boridx (`borrowernumber`)
Lines 2107-2112 CREATE TABLE `subscription` ( -- information related to the subscription Link Here
2107
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2108
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2108
  `itemtype` VARCHAR( 10 ) NULL,
2109
  `itemtype` VARCHAR( 10 ) NULL,
2109
  `previousitemtype` VARCHAR( 10 ) NULL,
2110
  `previousitemtype` VARCHAR( 10 ) NULL,
2111
  `mana_id` int(11) NULL DEFAULT NULL,
2110
  PRIMARY KEY  (`subscriptionid`),
2112
  PRIMARY KEY  (`subscriptionid`),
2111
  KEY `by_biblionumber` (`biblionumber`),
2113
  KEY `by_biblionumber` (`biblionumber`),
2112
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2114
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (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 71-77 Web services: Link Here
71
             - "Security token used to authenticate on mana:"
71
             - "Security token used to authenticate on mana:"
72
             - pref: ManaToken
72
             - pref: ManaToken
73
               class: Text
73
               class: Text
74
             - <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>
74
             - <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>
75
        -
75
        -
76
            - 'Fields automatically shared with mana'
76
            - 'Fields automatically shared with mana'
77
            - pref: AutoShareWithMana
77
            - pref: AutoShareWithMana
(-)a/serials/serials-collection.pl (-1 / +1 lines)
Lines 85-91 if($op eq 'gennext' && @subscriptionid){ Link Here
85
            ) = GetNextSeq($subscription, $pattern, $frequency, $expected->{publisheddate});
85
            ) = GetNextSeq($subscription, $pattern, $frequency, $expected->{publisheddate});
86
86
87
             ## We generate the next publication date
87
             ## We generate the next publication date
88
             my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
88
             $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
89
             my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, $frequency, 1);
89
             my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, $frequency, 1);
90
             my $planneddate = $date_received_today ? dt_from_string : $nextpublisheddate;
90
             my $planneddate = $date_received_today ? dt_from_string : $nextpublisheddate;
91
             ## Creating the new issue
91
             ## Creating the new issue
(-)a/t/db_dependent/Serials.t (-2 / +1 lines)
Lines 285-291 my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscrip Link Here
285
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
285
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
286
my $publisheddate = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
286
my $publisheddate = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
287
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
287
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
288
my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
288
$frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
289
my $nextpublisheddate = C4::Serials::GetNextDate($subscription, $publisheddate, $frequency, 1);
289
my $nextpublisheddate = C4::Serials::GetNextDate($subscription, $publisheddate, $frequency, 1);
290
my @statuses = qw( 2 2 3 3 3 3 3 4 4 41 42 43 44 5 );
290
my @statuses = qw( 2 2 3 3 3 3 3 4 4 41 42 43 44 5 );
291
# Add 14 serials
291
# Add 14 serials
292
- 

Return to bug 17047