koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4 Stats.pm,1.7,1.8


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4 Stats.pm,1.7,1.8
Date: Fri, 27 Sep 2002 21:56:54 -0700

Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv19133

Modified Files:
        Stats.pm 
Log Message:
Added POD.
Removed extraneous trailing whitespace.


Index: Stats.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Stats.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Stats.pm    14 Aug 2002 18:12:52 -0000      1.7
--- Stats.pm    28 Sep 2002 04:56:52 -0000      1.8
***************
*** 28,36 ****
--- 28,73 ----
  $VERSION = 0.01;
  
+ =head1 NAME
+ 
+ C4::Stats - Update Koha statistics (log)
+ 
+ =head1 SYNOPSIS
+ 
+   use C4::Stats;
+ 
+ =head1 DESCRIPTION
+ 
+ The C<&UpdateStats> function adds an entry to the statistics table in
+ the Koha database, which acts as an activity log.
+ 
+ =head1 FUNCTIONS
+ 
+ =over 2
+ 
+ =cut
+ 
  @ISA = qw(Exporter);
  @EXPORT = qw(&UpdateStats &statsreport &Count &Overdues &TotalOwing
  &TotalPaid &getcharges &Getpaidbranch &unfilledreserves);
  
+ =item UpdateStats
+ 
+   &UpdateStats($env, $branch, $type, $value, $other, $itemnumber,
+                $itemtype, $borrowernumber);
  
+ Adds a line to the statistics table of the Koha database. In effect,
+ it logs an event.
+ 
+ C<$branch>, C<$type>, C<$value>, C<$other>, C<$itemnumber>,
+ C<$itemtype>, and C<$borrowernumber> correspond to the fields of the
+ statistics table in the Koha database.
+ 
+ If C<$branch> is the empty string, the branch code will be taken from
+ C<$env-E<gt>{branchcode}>.
+ 
+ C<$env-E<gt>{usercode} specifies the value of the C<usercode> field.
+ 
+ =cut
+ #'
  sub UpdateStats {
    #module to insert stats data into stats table
***************
*** 42,48 ****
    my $user = $env->{'usercode'};
    print $borrowernumber;
    my $sth=$dbh->prepare("Insert into statistics
    (datetime,branch,type,usercode,value,
!   other,itemnumber,itemtype,borrowernumber) 
    values (now(),'$branch','$type','$user','$amount',
    '$other','$itemnum','$itemtype','$borrowernumber')");
--- 79,86 ----
    my $user = $env->{'usercode'};
    print $borrowernumber;
+   # FIXME - Use $dbh->do() instead?
    my $sth=$dbh->prepare("Insert into statistics
    (datetime,branch,type,usercode,value,
!   other,itemnumber,itemtype,borrowernumber)
    values (now(),'$branch','$type','$user','$amount',
    '$other','$itemnum','$itemtype','$borrowernumber')");
***************
*** 52,55 ****
--- 90,98 ----
  }
  
+ # XXX - POD
+ # FIXME - Why does this function exist? Why not just rename &circrep
+ # to &statsreport?
+ # Then again, it only appears to be used in reports.pl which, in turn,
+ # doesn't appear to be used. So presumably this function is obsolete.
  sub statsreport {
    #module to return a list of stats for a given day,time,branch type
***************
*** 64,67 ****
--- 107,112 ----
  }
  
+ # XXX - Doc. Only used internally. Probably useless: see comment for
+ # &statsreport.
  sub circrep {
    my ($time,$type)address@hidden;
***************
*** 69,72 ****
--- 114,118 ----
    my $query="Select * from statistics";
    if ($time eq 'today'){
+     # FIXME - What is this supposed to do? MySQL 3.23.42 barfs on it.
      $query=$query." where type='$type' and datetime
      >=datetime('yesterday'::date)";
***************
*** 87,90 ****
--- 133,138 ----
  }
  
+ # XXX - POD
+ # FIXME - This is only used in stats.pl, which in turn is never used.
  sub Count {
    my ($type,$branch,$time,$time2)address@hidden;
***************
*** 101,104 ****
--- 149,153 ----
  }
  
+ # XXX - POD. Doesn't appear to be used
  sub Overdues{
    my $dbh=C4Connect;
***************
*** 109,115 ****
    $sth->finish;
    $dbh->disconnect;
!   return($count->{'count(*)'});  
  }
  
  sub TotalOwing{
    my ($type)address@hidden;
--- 158,165 ----
    $sth->finish;
    $dbh->disconnect;
!   return($count->{'count(*)'});
  }
  
+ # XXX - POD. Never used
  sub TotalOwing{
    my ($type)address@hidden;
***************
*** 124,131 ****
     my $total=$sth->fetchrow_hashref;
     $sth->finish;
!   $dbh->disconnect; 
    return($total->{'sum(amountoutstanding)'});
  }
  
  sub TotalPaid {
    my ($time)address@hidden;
--- 174,182 ----
     my $total=$sth->fetchrow_hashref;
     $sth->finish;
!   $dbh->disconnect;
    return($total->{'sum(amountoutstanding)'});
  }
  
+ # XXX - POD. Never used
  sub TotalPaid {
    my ($time)address@hidden;
***************
*** 158,166 ****
    }
     $sth->finish;
!   $dbh->disconnect; 
  #  print $query;
    return(@results);
  }
  
  sub getcharges{
    my($borrowerno,$timestamp)address@hidden;
--- 209,218 ----
    }
     $sth->finish;
!   $dbh->disconnect;
  #  print $query;
    return(@results);
  }
  
+ # XXX - POD. Only used in stats.pl, which in turn is never used.
  sub getcharges{
    my($borrowerno,$timestamp)address@hidden;
***************
*** 185,188 ****
--- 237,242 ----
  }
  
+ # XXX - POD. This is only used in stats.pl and stats2.pl, neither of
+ # which is used.
  sub Getpaidbranch{
    my($date,$borrno)address@hidden;
***************
*** 199,202 ****
--- 253,258 ----
  }
  
+ # XXX - POD. This is only used in reservereport.pl and
+ # reservereport.xls, neither of which is used.
  sub unfilledreserves {
    my $dbh=C4Connect;
***************
*** 236,239 ****
  
  END { }       # module clean-up code here (global destructor)
!   
!     
--- 292,303 ----
  
  END { }       # module clean-up code here (global destructor)
! 
! 1;
! __END__
! =back
! 
! =head1 AUTHOR
! 
! Koha Developement team <address@hidden>
! 
! =cut




reply via email to

[Prev in Thread] Current Thread [Next in Thread]