[Koha-cvs] koha/members memberentry.pl [dev_week]

Kyle Hall kyle.m.hall at gmail.com
Thu May 3 15:11:08 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	07/05/03 13:11:08

Modified files:
	members        : memberentry.pl 

Log message:
	If editing member, branchcode defaults to members.branchcode,
	if new member, branchcode pulldown defaults to logged in branch.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/members/memberentry.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.5.2.13.2.1&r2=1.5.2.13.2.2

Patches:
Index: memberentry.pl
===================================================================
RCS file: /sources/koha/koha/members/memberentry.pl,v
retrieving revision 1.5.2.13.2.1
retrieving revision 1.5.2.13.2.2
diff -u -b -r1.5.2.13.2.1 -r1.5.2.13.2.2
--- memberentry.pl	17 Apr 2007 15:18:37 -0000	1.5.2.13.2.1
+++ memberentry.pl	3 May 2007 13:11:08 -0000	1.5.2.13.2.2
@@ -2,7 +2,7 @@
 # NOTE: This file uses standard 8-space tabs
 #       DO NOT SET TAB SIZE TO 4
 
-# $Id: memberentry.pl,v 1.5.2.13.2.1 2007/04/17 15:18:37 kylemhall Exp $
+# $Id: memberentry.pl,v 1.5.2.13.2.2 2007/05/03 13:11:08 kylemhall Exp $
 
 #script to set up screen for modification of borrower details
 #written 20/12/99 by chris at katipo.co.nz
@@ -89,10 +89,12 @@
 			push @errors, "ERROR_invalid_cardnumber";
 		}
 	}
+
 	if ($data{'sex'} eq '' && $categorycode ne "I"){
 		push @errors, "ERROR_gender";
 		$nok=1;
 	}
+
 	if ($data{'firstname'} eq '' && $categorycode ne "I"){
 		push @errors,"ERROR_firstname";
 		$nok=1;
@@ -122,7 +124,24 @@
 	if ($data{'expiry'} && format_date_in_iso($data{'joining'}) > format_date_in_iso($data{'expiry'})) {
 		push @errors, "ERROR_date";
 		warn "ERROR DATE";
+		$nok=1;
 	}
+	# TEST
+#	if ($data{'expiry'} eq ''){
+#	    push @errors, "ERROR_expiry";
+#	    $nok=1;
+#	    }
+#	if ($data{'expiry'} eq '0000-00-00'){
+#	    push @errors, "ERROR_expiry";
+#	    $nok=1;
+#	    }
+#	if ($data{'expiry'} eq 'NULL'){
+#	    push @errors, "ERROR_expiry";
+#	    $nok=1;
+#	    }
+	
+	
+	
 	if ($nok) {
 		foreach my $error (@errors) {
 			$template->param( $error => 1);
@@ -196,11 +215,13 @@
 	($categories,$labels)=borrowercategories();
 	my $catcodepopup = CGI::popup_menu(-name=>'categorycode',
 					-id => 'categorycode',
+					-class => 'focus',
+					-tabindex => '6',
 					-values=>$categories,
 					-default=>$data->{'categorycode'},
 					-labels=>$labels);
 
-	my @relationships = ('','workplace', 'relative','friend', 'neighbour');
+	my @relationships = ('','parent', 'guardian', 'grandparent', 'relative','friend', 'neighbour');
 	my @relshipdata;
 	while (@relationships) {
 		my $relship = shift @relationships;
@@ -215,8 +236,8 @@
 
 	# %flags: keys=$data-keys, datas=[formname, HTML-explanation]
 	my %flags = ('gonenoaddress' => ['gna', 'Gone no address'],
-				'lost'          => ['lost', 'Lost'],
-				'debarred'      => ['debarred', 'Debarred']);
+				'lost'          => ['lost', 'Lost Card'],
+				'debarred'      => ['debarred', 'Restricted']);
 
 	my @flagdata;
 	foreach (keys(%flags)) {
@@ -257,13 +278,29 @@
 				$default = C4::Context->userenv->{'branch'};
 		}
 	}
-	my $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
+
+        my $CGIbranch;
+	if ( $modify eq 'edit' ) {
+	  $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
 				-id => 'branchcode',
+					-class => 'focus',
+					-tabindex => '7',
+					-values   => \@select_branch,
+					-default  => $data->{'branchcode'},
+					-labels   => \%select_branches,
+					-size     => 1,
+					-multiple => 0 );	
+	} else {
+	  $CGIbranch=CGI::scrolling_list( -name     => 'branchcode',
+					-id => 'branchcode',
+					-class => 'focus',
+					-tabindex => '7',
 				-values   => \@select_branch,
 				-default  => $loggedInBranchcode,
 				-labels   => \%select_branches,
 				-size     => 1,
 				-multiple => 0 );
+	} 
 	
 	my $CGIsort1 = buildCGIsort("Bsort1","sort1",$data->{'sort1'});
 	if ($CGIsort1) {





More information about the Koha-cvs mailing list