Skip to content

biblibre/koha-plugin-generate-user-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Generate Userid Koha plugin

This plugin generates a patron userid following the pattern {prefix}{MAX(borrowernumber)+1} for configured patron categories.

Requirements

  • Koha ^23.05.x

How it works

When a patron is created or their userid is (re)generated, the plugin checks whether the patron's category is in the configured list. If so, it generates the userid as the configured prefix followed by the current maximum borrowernumber incremented by one. For all other categories, Koha's default userid generation applies.

Setup

Once the plugin is installed, you can access the plugin's configuration in the Koha's plugins home page.

  • find the Plugin Generate Userid plugin in the table
  • click on Action -> configure
  • select one or more patron categories to which the rule applies
  • set the prefix (e.g. USR, LIB, leave blank for a numeric-only userid)
  • save

Notes

  • Once the plugin is enabled, it handles userid generation for all patrons -- including those in unconfigured categories (using the standard firstname.lastname algorithm). This is a Koha constraint: when a plugin is active for this hook, Koha does not fall back to its own generator.
  • If two patrons in a configured category are created simultaneously, both may receive the same candidate userid. Koha checks uniqueness after generation; if the userid is already taken the patron will end up with no userid and the save will fail.
  • Changing the prefix after patrons have already been created does not retroactively update existing userids.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages