From 92dfe76f77f43de501d02cb8c6d8d924b07ef46c Mon Sep 17 00:00:00 2001 From: Gerhard Gonter <ggonter@gmail.com> Date: Thu, 2 Jul 2020 19:32:35 +0200 Subject: [PATCH] add fixup for fulltext_locked as specified in a meeting on 2020-06-30 --- eprints1.pl | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/eprints1.pl b/eprints1.pl index 8ea9b7b..1ab4eef 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; -- GitLab