From 41136fb5f4e42139f719b9a72755f592559c05c5 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 14 Dec 2005 23:26:52 +0000 Subject: [PATCH] bug hunting and a (small) new set of widget code git-svn-id: svn://svn.open-ils.org/ILS/trunk@2388 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/reporter/clark-kent.pl | 14 +++++++++++--- Open-ILS/src/reporter/report_base.example.xml | 1 + Open-ILS/src/reporter/tables.example.xml | 17 ++++++----------- .../src/reporter/templates/logic_header.ttk | 3 ++- Open-ILS/src/reporter/templates/stage2.ttk | 15 ++++++++------- Open-ILS/src/reporter/templates/widget_manip | 2 +- Open-ILS/src/reporter/widgets.example.xml | 6 ++++++ 7 files changed, 35 insertions(+), 23 deletions(-) diff --git a/Open-ILS/src/reporter/clark-kent.pl b/Open-ILS/src/reporter/clark-kent.pl index 466d0fd0a7..ac063f9355 100755 --- a/Open-ILS/src/reporter/clark-kent.pl +++ b/Open-ILS/src/reporter/clark-kent.pl @@ -39,11 +39,12 @@ my $doc = $parser->parse_file($base_xml); my $db_driver = $doc->findvalue('/reporter/setup/database/driver'); my $db_host = $doc->findvalue('/reporter/setup/database/host'); +my $db_port = $doc->findvalue('/reporter/setup/database/port') || '5432'; my $db_name = $doc->findvalue('/reporter/setup/database/name'); my $db_user = $doc->findvalue('/reporter/setup/database/user'); my $db_pw = $doc->findvalue('/reporter/setup/database/password'); -my $dsn = "dbi:" . $db_driver . ":dbname=" . $db_name .';host=' . $db_host; +my $dsn = "dbi:" . $db_driver . ":dbname=" . $db_name .';host=' . $db_host . ';port=' . $db_port; my ($dbh,$running,$sth,@reports,$run, $current_time); @@ -194,9 +195,14 @@ for my $r ( @reports ) { $dbh->begin_work; - $dbh->do(<<' SQL',{}, $r->{run_time}, $r->{stage3}->{id}); + #$dbh->do(<<' SQL',{}, $r->{run_time}, $r->{stage3}->{id}); + # UPDATE reporter.stage3 + # SET runtime = CAST(? AS TIMESTAMP WITH TIME ZONE) + recurrence + # WHERE id = ? AND recurrence > '0 seconds'::INTERVAL; + #SQL + $dbh->do(<<' SQL',{}, $r->{stage3}->{id}); UPDATE reporter.stage3 - SET runtime = CAST(? AS TIMESTAMP WITH TIME ZONE) + recurrence + SET runtime = runtime + recurrence WHERE id = ? AND recurrence > '0 seconds'::INTERVAL; SQL $dbh->do(<<' SQL',{}, $r->{stage3}->{id}); @@ -593,6 +599,8 @@ sub draw_bars { } + return [] unless ($new_data[0] && @{$new_data[0]}); + for my $col (@use_me) { push @leg, $settings->{columns}->[$col + @groups - 1] if (map { 1 } grep { $col == $_ } @values); } diff --git a/Open-ILS/src/reporter/report_base.example.xml b/Open-ILS/src/reporter/report_base.example.xml index 77b4f38d77..41b8f2a6f3 100644 --- a/Open-ILS/src/reporter/report_base.example.xml +++ b/Open-ILS/src/reporter/report_base.example.xml @@ -9,6 +9,7 @@ Pg 127.0.0.1 + 5433 develooper postgres diff --git a/Open-ILS/src/reporter/tables.example.xml b/Open-ILS/src/reporter/tables.example.xml index c72eff74b2..1877895d68 100644 --- a/Open-ILS/src/reporter/tables.example.xml +++ b/Open-ILS/src/reporter/tables.example.xml @@ -39,16 +39,15 @@ - + Date of the copy's cataloging - + Date and Hour of the copy's cataloging - - + Date of the copy's last edit - + Date and Hour of the copy's last edit