X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=mig-bin%2Fmig-reporter;h=f1857c9ebd8eeab4fe92e22ca05ffad2ce3a6494;hp=169be4d782a0e0b1145e3716e31d1bc3cee08dae;hb=f5dcd3923b62a9f5d54b5f8460a81de6cfa90f76;hpb=35219b6520c2d8cbfb22dc3a06d4e05d315375e7 diff --git a/mig-bin/mig-reporter b/mig-bin/mig-reporter index 169be4d..f1857c9 100755 --- a/mig-bin/mig-reporter +++ b/mig-bin/mig-reporter @@ -32,6 +32,10 @@ Allows you to override the default evergreen_staged_report.xml in the mig-xml fo Pushes output to an Excel file instead of asciidoc file. +--captions or --captions_off + +Adds the captions tag to asciidoc header to turn off captions in generated output. + =back =cut @@ -52,6 +56,7 @@ use Excel::Writer::XLSX; use Pod::Usage; use Switch; use Cwd 'abs_path'; +use Cwd qw(getcwd); use FindBin; my $mig_bin = "$FindBin::Bin/"; use lib "$FindBin::Bin/"; @@ -151,16 +156,14 @@ foreach my $arg (@ARGV) { } } -if (!defined $tags) {$tags = 'circs.holds.actors.bibs.assets.money'}; +if (!defined $tags) {$tags = 'circs.holds.actors.bibs.assets.money.notices'}; if (!defined $report_title) { abort('--report_title must be supplied'); } if ($excel_output == 0 and !defined $analyst) { abort('--analyst must be supplied'); } my $mig_path = abs_path($0); $mig_path =~ s|[^/]+$||; -if (!defined $reports_xml) { - if ($excel_output == 0) { $reports_xml = $mig_path . '../mig-xml/evergreen_staged_report.xml'; } - else { $reports_xml = $mig_path . '../mig-xml/excel_mapping_reports.xml'; } - } else { $reports_xml = $mig_path . '/../mig-xml/' . $reports_xml; } +$reports_xml = find_xml($reports_xml,$mig_path,$excel_output); +if (!defined $reports_xml) { abort("Can not find xml reports file."); } my $dom = $parser->parse_file($reports_xml); if (defined $added_page_file or defined $added_page_title) { @@ -276,6 +279,28 @@ if ($excel_output eq 1) { $workbook->close(); } ############ end of main logic +sub find_xml { + my $reports_xml = shift; + my $mig_path = shift; + my $excel_output = shift; + + if (!defined $reports_xml) { + if ($excel_output == 0) { $reports_xml = $mig_path . '../mig-xml/evergreen_staged_report.xml'; return $reports_xml; } + else { $reports_xml = $mig_path . '../mig-xml/excel_mapping_reports.xml'; return $reports_xml; } + }; + + if ($reports_xml =~ m/\//) { return $reports_xml; } + + my $mig_test_file = $mig_path . '/../mig-xml/' . $reports_xml; + my $working_test_dir = getcwd(); + my $working_test_file = $working_test_dir . '/' . $reports_xml; + + if (-e $mig_test_file) { return $mig_test_file; } + if (-e $working_test_file) { return $working_test_file; } + + return undef; +} + sub find_report { my $dom = shift; my $tag = shift;