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 (+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 1427-1432 CREATE TABLE saved_sql ( -- saved sql reports Link Here
1427
    report_area varchar(6) default NULL,
1427
    report_area varchar(6) default NULL,
1428
    report_group varchar(80) default NULL,
1428
    report_group varchar(80) default NULL,
1429
    report_subgroup varchar(80) default NULL,
1429
    report_subgroup varchar(80) default NULL,
1430
    `mana_id` int(11) NULL DEFAULT NULL,
1430
   PRIMARY KEY  (`id`),
1431
   PRIMARY KEY  (`id`),
1431
   KEY sql_area_group_idx (report_group, report_subgroup),
1432
   KEY sql_area_group_idx (report_group, report_subgroup),
1432
   KEY boridx (`borrowernumber`)
1433
   KEY boridx (`borrowernumber`)
Lines 2086-2091 CREATE TABLE `subscription` ( -- information related to the subscription Link Here
2086
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2087
  `reneweddate` date default NULL, -- date of last renewal for the subscription
2087
  `itemtype` VARCHAR( 10 ) NULL,
2088
  `itemtype` VARCHAR( 10 ) NULL,
2088
  `previousitemtype` VARCHAR( 10 ) NULL,
2089
  `previousitemtype` VARCHAR( 10 ) NULL,
2090
  `mana_id` int(11) NULL DEFAULT NULL,
2089
  PRIMARY KEY  (`subscriptionid`),
2091
  PRIMARY KEY  (`subscriptionid`),
2090
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2092
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id) ON DELETE SET NULL ON UPDATE CASCADE,
2091
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE
2093
  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