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 |
} |