|
Lines 39-45
BEGIN {
Link Here
|
| 39 |
@ISA = qw(Exporter); |
39 |
@ISA = qw(Exporter); |
| 40 |
@EXPORT = qw( |
40 |
@EXPORT = qw( |
| 41 |
get_report_types get_report_areas get_report_groups get_columns build_query get_criteria |
41 |
get_report_types get_report_areas get_report_groups get_columns build_query get_criteria |
| 42 |
save_report get_saved_reports execute_query get_saved_report create_compound run_compound |
42 |
save_report get_saved_reports execute_query get_saved_report |
| 43 |
get_column_type get_distinct_values save_dictionary get_from_dictionary |
43 |
get_column_type get_distinct_values save_dictionary get_from_dictionary |
| 44 |
delete_definition delete_report format_results get_sql |
44 |
delete_definition delete_report format_results get_sql |
| 45 |
nb_rows update_sql |
45 |
nb_rows update_sql |
|
Lines 718-752
sub get_saved_report {
Link Here
|
| 718 |
return $dbh->selectrow_hashref($query, undef, $report_arg); |
718 |
return $dbh->selectrow_hashref($query, undef, $report_arg); |
| 719 |
} |
719 |
} |
| 720 |
|
720 |
|
| 721 |
=head2 create_compound($masterID,$subreportID) |
|
|
| 722 |
|
| 723 |
This will take 2 reports and create a compound report using both of them |
| 724 |
|
| 725 |
=cut |
| 726 |
|
| 727 |
sub create_compound { |
| 728 |
my ( $masterID, $subreportID ) = @_; |
| 729 |
my $dbh = C4::Context->dbh(); |
| 730 |
|
| 731 |
# get the reports |
| 732 |
my $master = get_saved_report($masterID); |
| 733 |
my $mastersql = $master->{savedsql}; |
| 734 |
my $mastertype = $master->{type}; |
| 735 |
my $sub = get_saved_report($subreportID); |
| 736 |
my $subsql = $master->{savedsql}; |
| 737 |
my $subtype = $master->{type}; |
| 738 |
|
| 739 |
# now we have to do some checking to see how these two will fit together |
| 740 |
# or if they will |
| 741 |
my ( $mastertables, $subtables ); |
| 742 |
if ( $mastersql =~ / from (.*) where /i ) { |
| 743 |
$mastertables = $1; |
| 744 |
} |
| 745 |
if ( $subsql =~ / from (.*) where /i ) { |
| 746 |
$subtables = $1; |
| 747 |
} |
| 748 |
return ( $mastertables, $subtables ); |
| 749 |
} |
| 750 |
|
721 |
|
| 751 |
=head2 get_column_type($column) |
722 |
=head2 get_column_type($column) |
| 752 |
|
723 |
|