[Koha-cvs] CVS: koha/bull subscription-add.pl,1.6,1.7 subscription-detail.pl,1.6,1.7

Paul POULAIN tipaul at users.sourceforge.net
Thu Aug 4 10:54:57 CEST 2005


Update of /cvsroot/koha/koha/bull
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3043/bull

Modified Files:
	subscription-add.pl subscription-detail.pl 
Log Message:
Letters / alert system, continuing...
* adding a package Letters.pm, that manages Letters & alerts.
* adding feature : it's now possible to define a "letter" for any subscription created. If a letter is defined, users in OPAC can put an alert on the subscription. When an issue is marked "arrived", all users in the alert will recieve a mail (as defined in the "letter"). This last part (= send the mail) is not yet developped. (Should be done this week)
* adding feature : it's now possible to "put to an alert" in OPAC, for any serial subscription. The alert is stored in a new table, called alert. An alert can be put only if the librarian has activated them in subscription (and they activate it just by choosing a "letter" to sent to borrowers on new issues)
* adding feature : librarian can see in borrower detail which alerts they have put, and a user can see in opac-detail which alert they have put too.
Note that the system should be generic enough to manage any type of alert.
I plan to extend it soon to virtual shelves : a borrower will be able to put an alert on a virtual shelf, to be warned when something is changed in the virtual shelf (mail being sent once a day by cron, or manually by the shelf owner. Anyway, a mail won't be sent on every change, users would be spammed by Koha ;-) )

Index: subscription-add.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/subscription-add.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** subscription-add.pl	14 Jul 2005 09:13:25 -0000	1.6
--- subscription-add.pl	4 Aug 2005 08:54:54 -0000	1.7
***************
*** 14,17 ****
--- 14,18 ----
  use HTML::Template;
  use C4::Bull;
+ use C4::Letters;
  
  my $query = new CGI;
***************
*** 24,28 ****
  	$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
  	$numberingmethod, $status, $biblionumber, 
! 	$bibliotitle, $notes);
  
  	my @budgets;
--- 25,29 ----
  	$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
  	$numberingmethod, $status, $biblionumber, 
! 	$bibliotitle, $notes, $letter);
  
  	my @budgets;
***************
*** 83,86 ****
--- 84,88 ----
  	$bibliotitle = $subs->{'bibliotitle'},
  	$notes = $subs->{'notes'};
+ 	$letter = $subs->{'letter'};
  	$template->param(
  		$op => 1,
***************
*** 121,124 ****
--- 123,127 ----
  		bibliotitle => $bibliotitle,
  		notes => $notes,
+ 		letter => $letter,
  		subscriptionid => $subscriptionid,
  		);
***************
*** 139,142 ****
--- 142,152 ----
  #FIXME : END Added by hdl on July, 14 2005
  
+ my @letterlist = GetLetterList('serial');
+ for (my $i=0;$i<=$#letterlist;$i++) {
+ 	warn "$letterlist[$i]->{'code'} eq ".$letter;
+ 	$letterlist[$i]->{'selected'} =1 if $letterlist[$i]->{'code'} eq $letter;
+ }
+ $template->param(letters => \@letterlist);
+ 
  if ($op eq 'addsubscription') {
  	my $auser = $query->param('user');
***************
*** 169,172 ****
--- 179,183 ----
  	my $biblionumber = $query->param('biblionumber');
  	my $notes = $query->param('notes');
+ 	my $letter = $query->param('letter');
  	my $subscriptionid = newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
  					$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
***************
*** 174,178 ****
  					$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
  					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
! 					$numberingmethod, $status, $notes
  				);
  	print $query->redirect("/cgi-bin/koha/bull/subscription-detail.pl?subscriptionid=$subscriptionid");
--- 185,189 ----
  					$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
  					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
! 					$numberingmethod, $status, $notes, $letter
  				);
  	print $query->redirect("/cgi-bin/koha/bull/subscription-detail.pl?subscriptionid=$subscriptionid");

Index: subscription-detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/subscription-detail.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** subscription-detail.pl	1 Mar 2005 13:40:50 -0000	1.6
--- subscription-detail.pl	4 Aug 2005 08:54:54 -0000	1.7
***************
*** 23,27 ****
  	$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
  	$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
! 	$numberingmethod, $status, $biblionumber, $bibliotitle, $notes);
  
  $subscriptionid = $query->param('subscriptionid');
--- 23,27 ----
  	$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
  	$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
! 	$numberingmethod, $status, $biblionumber, $bibliotitle, $notes,$letter);
  
  $subscriptionid = $query->param('subscriptionid');
***************
*** 61,64 ****
--- 61,65 ----
  	$status = 1;
  	$notes = $query->param('notes');
+ 	$letter = $query->param('letter');
      
  	&modsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
***************
*** 67,71 ****
  					$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
  					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
! 					$numberingmethod, $status, $biblionumber, $notes, $subscriptionid);
  }
  
--- 68,72 ----
  					$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
  					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
! 					$numberingmethod, $status, $biblionumber, $notes, $letter, $subscriptionid);
  }
  
***************
*** 79,83 ****
  my ($totalissues, at serialslist) = getserials($subscriptionid);
  $totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue)
- # the subscription must be deletable if there is NO issues for a reason or another (should not happend, but...)
  
  ($template, $loggedinuser, $cookie)
--- 80,83 ----
***************
*** 90,95 ****
  				});
  
! my ($user, $cookie, $sessionID, $flags)
! 	= checkauth($query, 0, {catalogue => 1}, "intranet");
  
  $template->param(
--- 90,94 ----
  				});
  
! my ($user, $cookie, $sessionID, $flags) = checkauth($query, 0, {catalogue => 1}, "intranet");
  
  $template->param(
***************
*** 130,133 ****
--- 129,133 ----
  	bibliotitle => $subs->{bibliotitle},
  	notes => $subs->{notes},
+ 	letter => $subs->{letter},
  	subscriptionid => $subs->{subscriptionid},
  	serialslist => \@serialslist,





More information about the Koha-cvs mailing list