]> git.koha-community.org Git - koha.git/commit
Bug 6782 - Move auto member cardnumber generation to occur when record is "Saved...
authorMeenakshi.R <meenakshi.r@osslabs.biz>
Wed, 6 Jun 2012 11:16:15 +0000 (16:46 +0530)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jan 2017 11:47:00 +0000 (11:47 +0000)
commit141d29358f15eed2659de041ee5c4295c24e0fb5
tree8a46b0518e5e7fdb8b98bfacb74b02d05c3ed263
parentd3752c85dc2f5af974ec2fe4585efa8510302968
Bug 6782 - Move auto member cardnumber generation to occur when record is "Saved" (avoid collisions).

Currently the card number is generated when the user enters the patron creation form. This creates a problem of concurrency - when two or more simulataneous users are registering members, the error "card no. in use" can occur.

This change moves the card number generation to occur after the "Save" button is pressed.

Changes:
-C4/Members.pm:
Added code to fixup_cardnumber,If the cardnumber is blank and "autoMemberNum" ON.
-koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt:
Added code to display "leave blank for auto calc during registration" in cardnumber label in patron registration form only if "autoMemberNum" ON.
-members/memberentry.pl:
Added code to get weather or not "autoMemberNum" is on or off and removed fixup_cardnumber generation.

Test cases:
-If "autoMemberNum" ON:
->In blank case, must generate auto card number in simulataneous users.
->If user entered, check for unique card number.

-If "autoMemberNum" OFF:
Must work normal.

Followed test plan, works as expected.
Note: Syspref PorrowerMandatoryField must not include cardnumber, otherwise
      you can not save. Maybe that should be mentioned in the comment for
      syspref autoMemberNum.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Members.pm
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
members/memberentry.pl