From bd8f90387bdee26838725380738340a9539b81c9 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sun, 9 Mar 2008 20:48:26 -0500 Subject: [PATCH] Add Local-use statistical patron category_type Signed-off-by: Joshua Ferraro --- C4/Circulation.pm | 7 ++++++- C4/Items.pm | 8 +++++++- .../prog/en/includes/patron-toolbar.inc | 3 +++ .../prog/en/modules/admin/categorie.tmpl | 2 ++ .../prog/en/modules/circ/circulation.tmpl | 4 ++++ .../prog/en/modules/help/admin/categorie.tmpl | 19 ++++++++++--------- .../en/modules/members/memberentrygen.tmpl | 5 +++-- members/memberentry.pl | 5 +++-- 8 files changed, 38 insertions(+), 15 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0ed7b58e94..82e868ca8c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -659,7 +659,7 @@ sub CanBookBeIssued { my $item = GetItem(GetItemnumberFromBarcode( $barcode )); my $issue = GetItemIssue($item->{itemnumber}); my $biblioitem = GetBiblioItemData($item->{biblioitemnumber}); - $item->{'itemtype'}=$biblioitem->{'itemtype'}; + $item->{'itemtype'}=$item->{'itype'}; my $dbh = C4::Context->dbh; # @@ -670,6 +670,11 @@ sub CanBookBeIssued { # # BORROWER STATUS # + if ( $borrower->{'category_type'} eq 'X' && ( $item->{barcode} )) { + # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . + &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itemtype'},$borrower->{'borrowernumber'}); + return( { STATS => 1 }, {}); + } if ( $borrower->{flags}->{GNA} ) { $issuingimpossible{GNA} = 1; } diff --git a/C4/Items.pm b/C4/Items.pm index 049be3fae7..2b892709f4 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -143,7 +143,13 @@ sub GetItem { $ssth->execute($data->{'itemnumber'}) ; ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); warn $data->{'serialseq'} , $data->{'publisheddate'}; - } + } + #if we don't have an items.itype, use biblioitems.itemtype. + if( ! $data->{'itype'} ) { + my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); + $sth->execute($data->{'biblionumber'}); + ($data->{'itype'}) = $sth->fetchrow_array; + } return $data; } # sub GetItem diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc index 76aea2f999..ad572f9a79 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc @@ -9,6 +9,7 @@ $("#addprofessional").parent().remove(); $("#addorganisation").parent().remove(); $("#addstaff").parent().remove(); + $("#addstatistical").parent().remove(); $("#newmenuc").empty(); yuiToolbar(); }); @@ -23,6 +24,7 @@ { text: _("Professional Patron"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&category_type=P" }, { text: _("Organisation"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&category_type=I" }, { text: _("Staff"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&category_type=S" }, + { text: _("Statistical"), url: "/cgi-bin/koha/members/memberentry.pl?op=add&category_type=X" }, ] new YAHOO.widget.Button({ @@ -43,4 +45,5 @@
  • Professional
  • Organisation
  • Staff
  • +
  • Statistical
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl index 3bad64fa68..868fdb3348 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl @@ -128,6 +128,7 @@ + @@ -234,6 +235,7 @@ Confirm Deletion of Category Prof. Org. Staff + Statistical months years diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index d0b54dffb5..8b562bf3db 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -158,6 +158,10 @@ No patron matched