Skip to content

Commit

Permalink
Add draft-review list actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Dec 10, 2023
1 parent 4815e00 commit fc30247
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
26 changes: 21 additions & 5 deletions etc/listactions.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,39 +76,55 @@
"order": 30050,
"allow_if": "view_review",
"function": "+GetReviews_ListAction",
"zip": false, "abstract": true, "author_view": false
"zip": false, "abstract": true, "author_view": false, "submitted": true
},
{
"name": "get/rev", "get": true,
"title": "Reviews/Reviews (text)",
"order": 30100,
"allow_if": "view_review",
"function": "+GetReviews_ListAction",
"zip": false, "abstract": false, "author_view": false
"zip": false, "abstract": false, "author_view": false, "submitted": true
},
{
"name": "get/revz", "get": true,
"title": "Reviews/Reviews (zip)",
"order": 30105,
"allow_if": "view_review",
"function": "+GetReviews_ListAction",
"zip": true, "abstract": false, "author_view": false
"zip": true, "abstract": false, "author_view": false, "submitted": true
},
{
"name": "get/revdraft", "get": true,
"title": "Reviews/Reviews (text, include drafts)",
"order": 30150,
"allow_if": "view_review && admin",
"function": "+GetReviews_ListAction",
"zip": false, "abstract": false, "author_view": false, "submitted": false
},
{
"name": "get/revdraftz", "get": true,
"title": "Reviews/Reviews (zip, include drafts)",
"order": 30151,
"allow_if": "view_review && admin",
"function": "+GetReviews_ListAction",
"zip": true, "abstract": false, "author_view": false, "submitted": false
},
{
"name": "get/revau", "get": true,
"title": "Reviews/Reviews (text, author view)",
"order": 30200,
"allow_if": "view_review && admin",
"function": "+GetReviews_ListAction",
"zip": false, "abstract": false, "author_view": true
"zip": false, "abstract": false, "author_view": true, "submitted": true
},
{
"name": "get/revauz", "get": true,
"title": "Reviews/Reviews (zip, author view)",
"order": 30205,
"allow_if": "view_review && admin",
"function": "+GetReviews_ListAction",
"zip": true, "abstract": false, "author_view": true
"zip": true, "abstract": false, "author_view": true, "submitted": true
},
{
"name": "get/revcsv", "get": true,
Expand Down
7 changes: 6 additions & 1 deletion src/listactions/la_getreviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// Copyright (c) 2006-2022 Eddie Kohler; see LICENSE.

class GetReviews_ListAction extends GetReviewBase_ListAction {
/** @var bool */
private $include_paper;
/** @var bool */
private $submitted;
function __construct($conf, $fj) {
parent::__construct(false, $fj->zip);
$this->include_paper = $fj->abstract;
$this->author_view = $fj->author_view;
$this->submitted = $fj->submitted;
}
function allow(Contact $user, Qrequest $qreq) {
return $user->can_view_some_review();
Expand All @@ -34,10 +38,11 @@ function run(Contact $user, Qrequest $qreq, SearchSelection $ssel) {
if ($this->author_view && $user->allow_administer($prow)) {
$viewer->add_overrides(Contact::OVERRIDE_AU_SEEREV);
}
foreach ($prow->viewable_submitted_reviews_and_comments($user) as $rc) {
foreach ($prow->viewable_reviews_and_comments($user) as $rc) {
if ($viewer === $user
|| (isset($rc->reviewId)
? $viewer->can_view_review($prow, $rc)
&& (!$this->submitted || $rc->reviewSubmitted)
: $viewer->can_view_comment($prow, $rc))) {
$rctext .= PaperInfo::review_or_comment_text_separator($last_rc, $rc);
if (isset($rc->reviewId)) {
Expand Down

0 comments on commit fc30247

Please sign in to comment.