diff --git a/eprints1.pl b/eprints1.pl index 8ea9b7b1148df5ef9e62fa5f4a1abfd433a2d4ca..1ab4eef47c13a699e5b4e6835dd32b71e420de88 100755 --- a/eprints1.pl +++ b/eprints1.pl @@ -3248,6 +3248,45 @@ sub get_thesis_data $policies->{lock_status}= 0 if ($policies->{lock_until_date} lt $ts_now); # not locked if lock_until_date is in the past } + if ($row->{eprint_status} eq 'buffer') + { + +=begin comment + +nd 2020-06-30: fixup fulltext_locked for items with eprint_status='buffer' depending on einverstaendnis and sperre + +NOTES: +* we use already processed and maybe fixed (read: corrected) values here +* einverstaendnis is used as authorisation_to_use_by_author +* sperre is used as lock_status +* this whole thing aims at those records where einverstaendnis='TRUE' and sperre='FALSE'; + for these we should get fulltext_locked=0, most everything else should be fulltext_locked=1, + the few cases that may remain are controlled by full_text_status which is usually 'restricted' + +mysql> select count(*), einverstaendnis, sperre, full_text_status + -> from eprint where eprint_status='buffer' + -> group by einverstaendnis, sperre, full_text_status; ++----------+-----------------+--------+------------------+ +| count(*) | einverstaendnis | sperre | full_text_status | ++----------+-----------------+--------+------------------+ +| 1 | NULL | NULL | none | +| 1 | NULL | NULL | restricted | +| 1 | NULL | TRUE | restricted | +| 5 | TRUE | NULL | restricted | +| 1 | TRUE | TRUE | restricted | +| 2064 | TRUE | FALSE | restricted | +| 4 | FALSE | NULL | restricted | +| 2 | FALSE | TRUE | restricted | +| 2868 | FALSE | FALSE | restricted | ++----------+-----------------+--------+------------------+ + +=end comment +=cut + + $policies->{fulltext_locked}= 0 if ($policies->{authorisation_to_use_by_author} == 1 && $policies->{lock_status} == 0); + $policies->{fulltext_locked}= 1 if ($policies->{authorisation_to_use_by_author} == 0); + } + if ($row->{abstract_nicht_anzeigen} eq 'TRUE') { $policies->{abstract_locked}= $policies->{keywords_locked}= 1;