UrlName, HttpInput::Str(GET, 'artwork-url-name')); // Artwork found under an artist alternate name, redirect there and exit. http_response_code(Enums\HttpCode::MovedPermanently->value); header('Location: ' . $artwork->Url); exit(); } catch(Exceptions\ArtistNotFoundException){ // The artwork is really not found, throw the original exception. throw $ex; } } $isReviewerView = $GLOBALS['User']->Benefits->CanReviewArtwork ?? false; $isAdminView = $GLOBALS['User']->Benefits->CanReviewOwnArtwork ?? false; // If the artwork is not approved, and we're not an admin or the submitter when they can edit, don't show it. if( ($GLOBALS['User'] === null && $artwork->Status != ArtworkStatusType::Approved) || ($GLOBALS['User'] !== null && $artwork->Status != ArtworkStatusType::Approved && $artwork->SubmitterUserId != $GLOBALS['User']->UserId && !$isReviewerView) ){ throw new Exceptions\InvalidPermissionsException(); } // We got here because an artwork was successfully submitted if($isSaved){ session_unset(); } // We got here because an artwork PATCH operation had errors and the user has to try again if($exception){ http_response_code(422); // Before we overwrite the original artwork with our new one, restore the old status, // because if the new status is 'approved' then it will hide the status form entirely, // which will be confusing. $oldStatus = $artwork->Status; /** @var Artwork $artwork */ $artwork = $_SESSION['artwork'] ?? $artwork; $artwork->Status = $oldStatus; session_unset(); } } catch(Exceptions\ArtworkNotFoundException){ Template::Emit404(); } catch(Exceptions\InvalidPermissionsException){ Template::Emit403(); } ?> $artwork->Name, 'artwork' => true]) ?>

Name) ?>

$exception]) ?>

Artwork saved!

Metadata

Reviewer !== null){ ?>

U.S. public domain proof

MuseumUrl !== null){ ?>

Museum page

MuseumUrl) ?>

Museum !== null){ ?>

Approved museum: Museum->Name) ?> (Museum->Domain) ?>)

Not an approved museum.

PublicationYear !== null){ ?>

Page scans

Exception !== null){ ?>

Public domain status exception reason

Exception) ?> Notes !== null){ ?>

Special notes

Notes) ?> CanBeEditedBy($GLOBALS['User'])){ ?>

Edit artwork

An editor or the submitter may edit this artwork before it’s approved. Once it’s approved, it can no longer be edited.

Edit this artwork.

CanStatusBeChangedBy($GLOBALS['User']) || $artwork->CanEbookUrlBeChangedBy($GLOBALS['User'])){ ?>

Editor options

CanStatusBeChangedBy($GLOBALS['User'])){ ?>

Review the metadata and PD proof for this artwork submission. Approve to make it available for future producers. Once an artwork is approved, it can no longer be edited.

CanStatusBeChangedBy($GLOBALS['User'])){ ?> CanEbookUrlBeChangedBy($GLOBALS['User'])){ ?>