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 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 1428-1433 CREATE TABLE saved_sql ( -- saved sql reports Link Here
1428
    report_area varchar(6) default NULL,
1428
    report_area varchar(6) default NULL,
1429
    report_group varchar(80) default NULL,
1429
    report_group varchar(80) default NULL,
1430
    report_subgroup varchar(80) default NULL,
1430
    report_subgroup varchar(80) default NULL,
1431
    `mana_id` int(11) NULL DEFAULT NULL,
1431
   PRIMARY KEY  (`id`),
1432
   PRIMARY KEY  (`id`),
1432
   KEY sql_area_group_idx (report_group, report_subgroup),
1433
   KEY sql_area_group_idx (report_group, report_subgroup),
1433
   KEY boridx (`borrowernumber`)
1434
   KEY boridx (`borrowernumber`)
Lines 2087-2092 CREATE TABLE `subscription` ( -- information related to the subscription Link Here
2087
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2088
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2088
  `itemtype` VARCHAR( 10 ) NULL,
2089
  `itemtype` VARCHAR( 10 ) NULL,
2089
  `previousitemtype` VARCHAR( 10 ) NULL,
2090
  `previousitemtype` VARCHAR( 10 ) NULL,
2091
  `mana_id` int(11) NULL DEFAULT NULL,
2090
  PRIMARY KEY  (`subscriptionid`),
2092
  PRIMARY KEY  (`subscriptionid`),
2091
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2093
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2092
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
2094
  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 65-71 Web services: Link Here
65
             - "Security token used to authenticate on mana:"
65
             - "Security token used to authenticate on mana:"
66
             - pref: ManaToken
66
             - pref: ManaToken
67
               class: Text
67
               class: Text
68
             - <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>
68
             - <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>
69
        -
69
        -
70
            - 'Fields automatically shared with mana'
70
            - 'Fields automatically shared with mana'
71
            - pref: AutoShareWithMana
71
            - pref: AutoShareWithMana
(-)a/serials/serials-collection.pl (-1 / +1 lines)
Lines 81-87 if($op eq 'gennext' && @subscriptionid){ Link Here
81
            ) = GetNextSeq($subscription, $pattern, $frequency, $expected->{publisheddate});
81
            ) = GetNextSeq($subscription, $pattern, $frequency, $expected->{publisheddate});
82
82
83
             ## We generate the next publication date
83
             ## We generate the next publication date
84
             my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
84
             $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
85
             my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, $frequency, 1);
85
             my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, $frequency, 1);
86
             ## Creating the new issue
86
             ## Creating the new issue
87
             NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'},
87
             NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'},
(-)a/t/db_dependent/Serials.t (-2 / +1 lines)
Lines 289-295 my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscrip Link Here
289
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
289
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
290
my $publisheddate = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
290
my $publisheddate = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
291
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
291
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid );
292
my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
292
$frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity});
293
my $nextpublisheddate = C4::Serials::GetNextDate($subscription, $publisheddate, $frequency, 1);
293
my $nextpublisheddate = C4::Serials::GetNextDate($subscription, $publisheddate, $frequency, 1);
294
my @statuses = qw( 2 2 3 3 3 3 3 4 4 41 42 43 44 5 );
294
my @statuses = qw( 2 2 3 3 3 3 3 4 4 41 42 43 44 5 );
295
# Add 14 serials
295
# Add 14 serials
296
- 

Return to bug 17047