Skip to content

Commit

Permalink
Merge pull request #177 from hathitrust/TTO-211-212
Browse files Browse the repository at this point in the history
TTO-211/212
  • Loading branch information
moseshll authored Apr 30, 2024
2 parents c361576 + 9d43c1e commit e5f3a0b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 52 deletions.
17 changes: 1 addition & 16 deletions cgi/Project/PublicationDate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ sub ValidateSubmission
return 'Unknown rights combination' unless defined $attr and defined $reason;
my $date = $cgi->param('date') || '';
my $note = $cgi->param('note');
my $country = $cgi->param('country') || '';
my $countries = Countries::GetCountries();
my $category = $cgi->param('category');
$date =~ s/\s+//g if $date;
if ($attr ne 'und')
Expand All @@ -110,17 +108,6 @@ sub ValidateSubmission
{
push @errs, 'Actual Publication Date must be a date or a date range (DDDD or DDDD-DDDD)';
}
if (!$cgi->param('c_spec'))
{
if (!length $country)
{
push @errs, 'Country of Publication is required';
}
}
}
if (length $country && !$countries->{$country})
{
push @errs, "Country of Publication ($country) not recognized – please check MARC country codes";
}
if ($attr eq 'und' && $reason eq 'nfi' &&
(!$category ||
Expand Down Expand Up @@ -151,14 +138,12 @@ sub ExtractReviewData

my $date = $cgi->param('date');
my $approximate = $cgi->param('approximate');
my $country = $cgi->param('country');
my $data;
if (defined $date || defined $country || defined $approximate)
if (defined $date || defined $approximate)
{
$data = {};
$data->{'date'} = $date if defined $date and length $date;
$data->{'approximate'} = $approximate if defined $approximate and length $approximate;
$data->{'country'} = $country if defined $country and length $country;
}
return $data;
}
Expand Down
8 changes: 3 additions & 5 deletions cgi/partial/ADDForm.tt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
</td>
</tr>
<!-- ACTUAL PUB DATE -->
<!-- Only visible when pub is unchecked and pub date is a range or unknown -->
<!-- Only visible when pub is unchecked -->
[% display = "table-row" %]
[% IF u_pub || data.bibdata.extracted_dates.size == 1 %]
[% IF u_pub %]
[% display = "none" %]
[% END %]
<tr id="actual-pub-date-row" style="display:[% display %];">
Expand Down Expand Up @@ -293,9 +293,7 @@ function toggleADD() {
addField.value = actualField.value;
}
} else {
if (gReviewData.bibdata.extracted_dates.length != 1) {
actualPubDateRow.style.display = "table-row";
}
actualPubDateRow.style.display = "table-row";
}
}

Expand Down
27 changes: 0 additions & 27 deletions cgi/partial/pubDateForm.tt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[% # Set up values from CGI (in case of error) or existing review (editing). %]
[% u_date = (error)? cgi.param('date') : data.reviews.$user.data.date %]
[% u_approx = (error)? cgi.param('approximate') : data.reviews.$user.data.approximate %]
[% u_country = (error)? cgi.param('country') : data.reviews.$user.data.country %]
[% u_rights = (error)? cgi.param('rights') : data.reviews.$user.rights %]
[% u_category = (error)? cgi.param('category') : data.reviews.$user.category %]
[% u_note = (error)? cgi.param('note') : data.reviews.$user.note %]
Expand All @@ -18,9 +17,6 @@
<input type="hidden" name="start" value="[% crms.GetNow() %]"/>
<input type="hidden" name="user" value="[% user %]"/>
<input type="hidden" name="editing" value="[% editing %]"/>
[% IF NOT data.bibdata.country.match('^Undetermined') %]
<input type="hidden" name="c_spec" value="1"/>
[% END %]
<table>
<tr>
<td class="nowrap">
Expand All @@ -43,29 +39,6 @@
<input type="checkbox" id="approx_cb" name="approximate" [% (u_approx)? 'checked="checked"':'' %]/>
</td>
</tr>
<td class="nowrap">
<strong><label id="countryFieldLabel" for="countryField">
Country of Publication: </label>
</strong></td>
<td class="nowrap">
<input id="countryField" type="text" name="country"
value="[% u_country %]" size="4"/>
[% IF tip %]
<span class="red">$tip</span>
[% END %]
<a style="position:absolute;left:-999px;" href="#" accesskey="c"
onfocus="document.getElementById('countryField').focus()">.</a>
<a class="tip" href="#">
<img width="16" height="16" alt="Country of Publication Help"
style="position:relative; left:4px; top:4px;"
src="[% crms.WebPath('web', 'help.png') %]"/>
<span>Use the code <strong>us</strong> for United States.<br/>
For other countries, refer to the <i>MARC Country Codes</i> authority.<br/>
You can leave the field blank if the country is already known.
</span>
</a>
</td>
</tr>
</table>

[% rights = crms.Rights(htid, 1) %]
Expand Down
10 changes: 6 additions & 4 deletions lib/CRMS/RightsPredictor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,12 @@ sub _predict_rights_with_source_copyright_expired {
else {
$self->{attr} = 'pd';
$self->{reason} = ($self->{is_corporate})? 'exp' : 'add';
$self->_add_description(
"$self->{last_source_copyright_year} < @{[ GATT_RESTORATION_START ]}" .
" or US © expired ($self->{last_us_copyright_year} < $self->{reference_year}) [no GATT]"
);
if ($self->{last_source_copyright_year} < GATT_RESTORATION_START) {
$self->_add_description("$self->{last_source_copyright_year} < @{[ GATT_RESTORATION_START ]} GATT elegibility date");
}
if ($self->{last_us_copyright_year} < $self->{reference_year}) {
$self->_add_description("US © expired ($self->{last_us_copyright_year} < $self->{reference_year}) [no GATT]");
}
}
}

Expand Down

0 comments on commit e5f3a0b

Please sign in to comment.