add new lenny dependency libmodule-install-perl to the apt-get-debian-lenny.sh script
[koha_gimpoz] / reports / issues_avg_stats.pl
index 60d198a..8285bec 100755 (executable)
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
+#use warnings; FIXME - Bug 2505
 use C4::Auth;
 use CGI;
 use C4::Context;
@@ -26,6 +27,7 @@ use C4::Branch; # GetBranches
 use C4::Output;
 use C4::Koha;
 use C4::Circulation;
+use C4::Reports;
 use C4::Dates qw/format_date format_date_in_iso/;
 use Date::Calc qw(Delta_Days);
 
@@ -61,7 +63,7 @@ my ($template, $borrowernumber, $cookie)
                 query => $input,
                 type => "intranet",
                 authnotrequired => 0,
-                flagsrequired => {reports => 1},
+                flagsrequired => {reports => '*'},
                 debug => 1,
                     });
 our $sep     = $input->param("sep");
@@ -449,7 +451,6 @@ sub calculate {
     }
     $strsth2 .=" GROUP BY $colfield";
     $strsth2 .=" ORDER BY $colorder";
-    warn "". $strsth2;
     
     my $sth2 = $dbh->prepare( $strsth2 );
     if (( @colfilter ) and ($colfilter[1])){
@@ -520,7 +521,6 @@ sub calculate {
     $strcalc .= " AND monthname(returndate) like '" . @$filters[6] ."'" if ( @$filters[6] );
     
     $strcalc .= " group by  $linefield, $colfield, issuedate, returndate order by $linefield, $colfield";
-    warn "SQL :". $strcalc;
     
     my $dbcalc = $dbh->prepare($strcalc);
     $dbcalc->execute;