Ticket #2954 (new enhancement)
Validate ISBN (10 and 13 digit) and ISSN
| Reported by: | tmb | Owned by: | cjg |
|---|---|---|---|
| Priority: | unset | Milestone: | EPrints 3.2.10 |
| Component: | Workflow & InputForm | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The Algorithm::CheckDigits? module makes this simple and helps us claim better quality metadata.
Need to decide whether we want to add this.
I added this ISBN check to field_validate.pl for NORA (Algorithm::CheckDigits? can also check ISSNs):
if( $field->get_name eq "isbn" && EPrints::Utils::is_set( $value ) ) {
use Algorithm::CheckDigits?;
my $isbn = CheckDigits?( "ISBN" ); my $isbn13 = CheckDigits?( "ISBN13" );
if( !$isbn->is_valid( $value ) && !$isbn13->is_valid( $value ) ) {
my $fieldname = $session->make_element( "span", class=>"ep_problem_field:".$field->get_name ); $fieldname->appendChild( $field->render_name( $session ) ); push @problems,
$session->html_phrase( "validate:bad_isbn",
fieldname=>$fieldname );
}
}
Should make this only apply if Algorithm::CheckDigits? is installed so as not to add to lists of required modules.
