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 = Session::$User->Benefits->CanReviewArtwork ?? false; $isAdminView = Session::$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( (Session::$User === null && $artwork->Status != Enums\ArtworkStatusType::Approved) || (Session::$User !== null && $artwork->Status != Enums\ArtworkStatusType::Approved && $artwork->SubmitterUserId != Session::$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(Enums\HttpCode::UnprocessableContent->value); // 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, 'css' => ['/css/artwork.css']]) ?>

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(Session::$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(Session::$User) || $artwork->CanEbookUrlBeChangedBy(Session::$User)){ ?>

Editor options

CanStatusBeChangedBy(Session::$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(Session::$User)){ ?> CanEbookUrlBeChangedBy(Session::$User)){ ?>