From 4ce0589c1ccca9ff8e5c15ae54615f08fc04afed Mon Sep 17 00:00:00 2001 From: Michael Hafen Date: Fri, 28 Mar 2008 11:27:40 -0600 Subject: [PATCH] Audio feedback for member status, issuing, and returning. These two swf files are created by an open source tool from .wav files in the ubuntu-sounds package. --- circ/circulation.pl | 54 ++++++++++++++++++++ circ/returns.pl | 12 ++++ .../prog/en/modules/circ/circulation.tmpl | 3 + .../prog/en/modules/circ/returns.tmpl | 2 + .../prog/en/modules/members/moremember.tmpl | 1 + koha-tmpl/intranet-tmpl/prog/img/error.swf | Bin 0 -> 3191 bytes koha-tmpl/intranet-tmpl/prog/img/ok.swf | Bin 0 -> 1101 bytes members/member.pl | 4 ++ members/moremember.pl | 39 ++++++++++++++ 9 files changed, 115 insertions(+), 0 deletions(-) mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/img/error.swf create mode 100644 koha-tmpl/intranet-tmpl/prog/img/ok.swf diff --git a/circ/circulation.pl b/circ/circulation.pl index f2af9be..5e3d997 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -101,6 +101,13 @@ my @failedrenews = $query->param('failedrenew'); my @renew_failed; for (@failedrenews) { $renew_failed[$_] = 1; } +my $sessionID = $query->cookie("CGISESSID") ; +my $session = get_session($sessionID); +my $sounderror; +my @soundederrors = @{ $session->param( 'soundederrors' ) } if ( $session->param( 'soundederrors' ) ); +my %soundederrors; +for ( @soundederrors ) { $soundederrors{ $_ } = 1; } + my $findborrower = $query->param('findborrower'); $findborrower =~ s|,| |g; #$findborrower =~ s|'| |g; @@ -188,12 +195,16 @@ if ( $print eq 'yes' && $borrowernumber ne '' ) { my $borrowerslist; my $message; if ($findborrower) { + $session->clear( 'soundederrors' ); + @soundederrors = (); + %soundederrors = (); my ( $count, $borrowers ) = SearchMember($findborrower, 'cardnumber', 'web' ); my @borrowers = @$borrowers; if ( $#borrowers == -1 ) { $query->param( 'findborrower', '' ); $message = "'$findborrower'"; + $sounderror = 1; } elsif ( $#borrowers == 0 ) { $query->param( 'borrowernumber', $borrowers[0]->{'borrowernumber'} ); @@ -212,6 +223,15 @@ if ($borrowernumber) { $borrower = GetMemberDetails( $borrowernumber, 0 ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); + if ( $od && ! $soundederrors{ ODUES } ) { + $sounderror = 1; + $soundederrors{ ODUES } = 1; + } + if ( $fines > 0 && ! $soundederrors{ CHARGES } ) { + $sounderror = 1; + $soundederrors{ CHARGES } = 1; + } + # Warningdate is the date that the warning starts appearing my ( $today_year, $today_month, $today_day ) = Today(); my ( $warning_year, $warning_month, $warning_day ) = split /-/, @@ -234,6 +254,10 @@ if ($borrowernumber) { expired => format_date($borrower->{dateexpiry}), renewaldate => format_date("$renew_year-$renew_month-$renew_day") ); + unless ( $soundederrors{ EXPIRED } ) { + $sounderror = 1; + $soundederrors{ EXPIRED } = 1; + } } # check for NotifyBorrowerDeparture elsif ( C4::Context->preference('NotifyBorrowerDeparture') && @@ -271,6 +295,7 @@ if ($barcode) { IMPOSSIBLE => 1 ); $noerror = 0; + $sounderror = 1; } if ($issueconfirmed && $noerror) { @@ -293,6 +318,7 @@ if ($barcode) { NEEDSCONFIRMATION => 1 ); $noquestion = 0; + $sounderror = 1; } # Because of the weird conditional structure (empty elsif block), # if we reached here, $issueconfirmed must be false. @@ -563,12 +589,24 @@ foreach $flag ( sort keys %$flags ) { ); if ( $flag eq 'GNA' ) { $template->param( gna => 'true' ); + unless ( $soundederrors{ GNA } ) { + $sounderror = 1; + $soundederrors{ GNA } = 1; + } } if ( $flag eq 'LOST' ) { $template->param( lost => 'true' ); + unless ( $soundederrors{ LOST } ) { + $sounderror = 1; + $soundederrors{ LOST } = 1; + } } if ( $flag eq 'DBARRED' ) { $template->param( dbarred => 'true' ); + unless ( $soundederrors{ DBARRED } ) { + $sounderror = 1; + $soundederrors{ DBARRED } = 1; + } } if ( $flag eq 'CHARGES' ) { $template->param( @@ -576,6 +614,10 @@ foreach $flag ( sort keys %$flags ) { chargesmsg => $flags->{'CHARGES'}->{'message'}, charges_is_blocker => 1 ); + unless ( $soundederrors{ CHARGES } ) { + $sounderror = 1; + $soundederrors{ CHARGES } = 1; + } } if ( $flag eq 'CREDITS' ) { $template->param( @@ -591,6 +633,10 @@ foreach $flag ( sort keys %$flags ) { flagged => 1, chargesmsg => $flags->{'CHARGES'}->{'message'} ); + unless ( $soundederrors{ CHARGES } ) { + $sounderror = 1; + $soundederrors{ CHARGES } = 1; + } } if ( $flag eq 'CREDITS' ) { $template->param( @@ -604,6 +650,10 @@ foreach $flag ( sort keys %$flags ) { flagged => 1, oduesmsg => $flags->{'ODUES'}->{'message'} ); + unless ( $soundederrors{ ODUES } ) { + $sounderror = 1; + $soundederrors{ ODUES } = 1; + } my $items = $flags->{$flag}->{'itemlist'}; # useless ??? @@ -714,6 +764,10 @@ if ($stickyduedate) { my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); $template->param( picture => 1 ) if $picture; +$session->param('soundederrors', [ keys %soundederrors ] ); +$template->param( + sounderror => $sounderror, + ); $template->param( debt_confirmed => $debt_confirmed, diff --git a/circ/returns.pl b/circ/returns.pl index 9c08c31..0f76b70 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -73,6 +73,8 @@ my $printers = GetPrinters(); #my $branch = C4::Context->userenv?C4::Context->userenv->{'branch'}:""; my $printer = C4::Context->userenv?C4::Context->userenv->{'branchprinter'}:""; my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off'); +my $sounderror; +my $soundok; # # Some code to handle the error if there is no branch or printer setting..... # @@ -148,6 +150,7 @@ if ( $query->param('resbarcode') ) { if ( $messages->{'transfert'} ) { + $sounderror = 1; $template->param( itemtitle => $iteminfo->{'title'}, itembiblionumber => $iteminfo->{'biblionumber'}, @@ -206,6 +209,7 @@ if ($barcode) { itembiblionumber => $biblio->{'biblionumber'}, ); if ($returned) { + $soundok = 1; $returneditems{0} = $barcode; $riborrowernumber{0} = $borrower->{'borrowernumber'}; $riduedate{0} = $issueinformation->{'date_due'}; @@ -243,6 +247,9 @@ if ($barcode) { } push( @inputloop, \%input ); } + if ( ! $returned ) { + $sounderror = 1; + } } $template->param( inputloop => \@inputloop ); @@ -310,6 +317,7 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) { # reserve found and item arrived at the expected branch # if ( $messages->{'ResFound'}) { + $sounderror = 1; my $reserve = $messages->{'ResFound'}; my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'}; my ($borr) = GetMemberDetails( $reserve->{'borrowernumber'}, 0 ); @@ -454,6 +462,7 @@ if ($borrower) { $flaginfo{redfont} = ( $flags->{$flag}->{'noissues'} ); $flaginfo{flag} = $flag; if ( $flag eq 'CHARGES' ) { + $sounderror = 1; $flaginfo{msg} = $flag; $flaginfo{charges} = 1; $flaginfo{borrowernumber} = $borrower->{borrowernumber}; @@ -478,6 +487,7 @@ if ($borrower) { $flaginfo{itemloop} = \@waitingitemloop; } elsif ( $flag eq 'ODUES' ) { + $sounderror = 1; my $items = $flags->{$flag}->{'itemlist'}; my @itemloop; foreach my $item ( sort { $a->{'date_due'} cmp $b->{'date_due'} } @@ -581,6 +591,8 @@ $template->param( dropboxmode => $dropboxmode, dropboxdate => $dropboxdate->output(), overduecharges => $overduecharges, + sounderror => $sounderror, + soundok => $soundok, ); # actually print the page! diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl old mode 100644 new mode 100755 index 1229390..bfb23fd --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -60,6 +60,9 @@ $.tablesorter.addParser({ + + +
Patron's account has been renewed until
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl index d4d3095..acba3d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl @@ -317,6 +317,8 @@ function Dopop(link) {
+ +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl index 9133705..39cb051 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -81,6 +81,7 @@ if (nodename =="barcodes[]"){
+ -->
diff --git a/koha-tmpl/intranet-tmpl/prog/img/error.swf b/koha-tmpl/intranet-tmpl/prog/img/error.swf new file mode 100644 index 0000000000000000000000000000000000000000..2126177338fdf7d47cdf4c4478b41c159789df4c GIT binary patch literal 3191 zcmdVddpOkD9|!R7%&p%A7lHeDo94WS?i(qTrMbCLk^u`ICJ!13cPn;pyuVgLYU7#vnj zMOzbb(3MDbIb{9+*tnp5_2T~Ya1SVec${m1*vZcegM^K&eV5BO7P6a69~{jKT~9U# zXCJi59vlH_N%LXYrezSkZJ<3K8=MvowQ$)i)Kk*6+AG6mZM7=idV<@9H%Ho@*Cr8! z&X^@Dw7XJ|!h{S}L^nr4Z~_x16nsB7hxbkHQMab6cOu{#GGQ!9|E?|dEdHMw7o@a? zeh#B0K#W6s8Ix974T2>fn~I6bs63>zl4X@kA@Cp(76L099@*Cs}tQ^pp{Jyole0!#3iUm zOPIsm)iF45HXkN7>3XNO`E+f|E4N=y2PlD{ZaxX;sa)qx?Hh`-ba;D4v7`7l2zHnD zaq!s3u?o43zjlz!hndo8Md{8Nou}OJYzxYyy zR4@-72zMUbe*N`aF`jaaXs-UjVcQsxUTK+esi~O;<5XC?-1SUw@4GShrj`8w|_~L~5ZS^L((1Yk)#Hb?IEIFmcr} zlWDBDMf7{5ToBSURLY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FbjrzU-E@<0fWe@~7dTayG@*Yk8zB=6PAh%I<&K z^T!$5LqKkVuo8fCOdji}O^^Z{w5Z{6`q0!t6A7K$Q>mEc)FYjl7vI^cjlnw=~CitB56Qjw7l d$ckRTipSr0>wi-EFMMFYBmo`>u=(!*{2LlRk<0)9 literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/ok.swf b/koha-tmpl/intranet-tmpl/prog/img/ok.swf new file mode 100644 index 0000000000000000000000000000000000000000..68624749c0d38db905eb8d190b761fffb2583126 GIT binary patch literal 1101 zcmZ<@4`%gcVPGg=;NHQ&u)9G;n32KxP*GZiGt>Y7|MxS?0p%nZ)Eu}OfZ+dQrz1d$ z*@Mx6fx*Yo*VS0h(p*6!DYYa~Gju2du!nS5$|_i!Rxoe~*c^~MRKx#sqs9E6oiRHC z{-0|3$**$q{C{Omrkc|J6yg6LPe`-K)b`9QNZtSc!&jaoi+CSvu&FUDaFk+2(&7!0oOze$2=H@q#k0fPSUqo(+Bi&O$%~ zl%5@VC}L`kEdn4Ol8)QJ-?)N-DNKTaNq)gk{!3BvGiFN8uAebOYNq7>r;mjmmMro8 z|FdGI8t0^mb`Jah%O^KDE&Aa1u%r2(bOH;*tLrIK|1+^T7-_QbyjsPql<9Ei?Ewqx z4j!pkW=$4`V=V?UN(_oWBtmTbxn9&A(6MH=lyDH>lMg(n)}3;)@5#xPlmF=7NNC7k zWFWXB_2Fr0C8559g4m`Dhgo zfIY;Y%(O?o!Gei_amRh2ZWy@#X14a8|Nqxd*SgT+s`EYU->>&x_4m{NJiGrtu1#d& znm(0(@3u!|ZJlNFRQ0yVDlDdhY@jm$dq_NZ+Kl=G0?Z7#+ivG>f3c`h=*0H&D$UBZ zGqbhhx;D-1Nq97CZEED^S8Eif+U}gt)i)*ft4s9n#l9x8lAE3-y!xaRc0bJS)asJG wVb2%a#a=tI@{6a}ru|Bj*+0fPXFDz0TeIa>suq1be3V&&frXI)SRyb0054nnZU6uP literal 0 HcmV?d00001 diff --git a/members/member.pl b/members/member.pl index 6d42b45..5a71380 100755 --- a/members/member.pl +++ b/members/member.pl @@ -78,6 +78,10 @@ $orderby = "surname,firstname" unless $orderby; $member =~ s/,//g; #remove any commas from search string $member =~ s/\*/%/g; +my $sessionID = $input->cookie("CGISESSID") ; +my $session = C4::Auth::get_session($sessionID); +$session->clear( 'soundederrors' ); + my ($count,$results); if(length($member) == 1) diff --git a/members/moremember.pl b/members/moremember.pl index 87a5659..9bca25c 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -97,6 +97,30 @@ if ( not defined $data ) { exit; } +my $sessionID = $input->cookie("CGISESSID") ; +my $session = C4::Auth::get_session($sessionID); +my $sounderror; +my @soundederrors = @{ $session->param( 'soundederrors' ) } if ( $session->param( 'soundederrors' ) ); +my %soundederrors; +for ( @soundederrors ) { $soundederrors{ $_ } = 1; } + +if ( $$data{ debarred } && !$soundederrors{ DBARRED } ) { + $sounderror = 1; + $soundederrors{ DBARRED } = 1; +} +if ( $$data{ gonenoaddress } && !$soundederrors{ GNA } ) { + $sounderror = 1; + $soundederrors{ GNA } = 1; +} +if ( $$data{ lost } && !$soundederrors{ LOST } ) { + $sounderror = 1; + $soundederrors{ LOST } = 1; +} +if ( $$data{ dateexpiry } lt POSIX::strftime( "%Y-%m-%d", localtime ) && !$soundederrors{ EXPIRED } ) { + $sounderror = 1; + $soundederrors{ EXPIRED } = 1; +} + # re-reregistration function to automatic calcul of date expiry if ( $reregistration eq 'y' ) { $data->{'dateexpiry'} = ExtendMemberSubscriptionTo( $borrowernumber ); @@ -212,6 +236,11 @@ my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} ); ( $template->param( lib1 => $lib1 ) ) if ($lib1); ( $template->param( lib2 => $lib2 ) ) if ($lib2); +if ( $total > 0 && ! $soundederrors{ CHARGES } ) { + $sounderror = 1; + $soundederrors{ CHARGES } = 1; +} + # current issues # my ( $count, $issue ) = GetPendingIssues($borrowernumber); @@ -231,6 +260,11 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { if ( $datedue lt $today ) { $overdues_exist = 1; $row{'red'} = 1; #print ""; + + unless ( $soundederrors{ ODUES } ) { + $sounderror = 1; + $soundederrors{ ODUES } = 1; + } } $row{toggle} = $toggle++ % 2; @@ -363,4 +397,9 @@ $template->param( dateformat => C4::Context->preference("dateformat"), ); +$session->param('soundederrors', [ keys %soundederrors ] ); +$template->param( + sounderror => $sounderror, + ); + output_html_with_http_headers $input, $cookie, $template->output; -- 1.5.4.3
Item InformationPatron Information