Add submitted by column to artworks

This commit is contained in:
Alex Cabal 2024-01-07 13:15:27 -06:00
parent 5a1c05d8c5
commit 8e955bf357
2 changed files with 7 additions and 3 deletions

View file

@ -32,6 +32,7 @@ class Artwork extends PropertiesBase{
public $Updated;
public $Status;
public $EbookWwwFilesystemPath;
public $SubmitterUserId;
public $ReviewerUserId;
public $MuseumUrl;
public $PublicationYear;
@ -380,7 +381,7 @@ class Artwork extends PropertiesBase{
Db::Query('
INSERT into
Artworks (ArtistId, Name, UrlName, CompletedYear, CompletedYearIsCirca, Created, Status, ReviewerUserId, MuseumUrl,
Artworks (ArtistId, Name, UrlName, CompletedYear, CompletedYearIsCirca, Created, Status, SubmitterUserId, ReviewerUserId, MuseumUrl,
PublicationYear, PublicationYearPageUrl, CopyrightPageUrl, ArtworkPageUrl, IsPublishedInUs,
EbookWwwFilesystemPath, MimeType, Exception)
values (?,
@ -399,9 +400,10 @@ class Artwork extends PropertiesBase{
?,
?,
?,
?,
?)
', [$this->Artist->ArtistId, $this->Name, $this->UrlName, $this->CompletedYear, $this->CompletedYearIsCirca,
$this->Created, $this->Status, $this->ReviewerUserId, $this->MuseumUrl, $this->PublicationYear, $this->PublicationYearPageUrl,
$this->Created, $this->Status, $this->SubmitterUserId, $this->ReviewerUserId, $this->MuseumUrl, $this->PublicationYear, $this->PublicationYearPageUrl,
$this->CopyrightPageUrl, $this->ArtworkPageUrl, $this->IsPublishedInUs, $this->EbookWwwFilesystemPath, $this->MimeType->value ?? null, $this->Exception]
);
@ -447,6 +449,7 @@ class Artwork extends PropertiesBase{
CompletedYearIsCirca = ?,
Created = ?,
Status = ?,
SubmitterUserId = ?,
ReviewerUserId = ?,
MuseumUrl = ?,
PublicationYear = ?,
@ -460,7 +463,7 @@ class Artwork extends PropertiesBase{
where
ArtworkId = ?
', [$this->Artist->ArtistId, $this->Name, $this->UrlName, $this->CompletedYear, $this->CompletedYearIsCirca,
$this->Created, $this->Status, $this->ReviewerUserId, $this->MuseumUrl, $this->PublicationYear, $this->PublicationYearPageUrl,
$this->Created, $this->Status, $this->SubmitterUserId, $this->ReviewerUserId, $this->MuseumUrl, $this->PublicationYear, $this->PublicationYearPageUrl,
$this->CopyrightPageUrl, $this->ArtworkPageUrl, $this->IsPublishedInUs, $this->EbookWwwFilesystemPath, $this->MimeType->value ?? null, $this->Exception,
$this->ArtworkId]
);

View file

@ -34,6 +34,7 @@ try{
$artwork->CompletedYearIsCirca = HttpInput::Bool(POST, 'artwork-year-is-circa', false);
$artwork->Tags = Artwork::ParseTags(HttpInput::Str(POST, 'artwork-tags', false));
$artwork->Status = HttpInput::Str(POST, 'artwork-status', false) ?? COVER_ARTWORK_STATUS_UNVERIFIED;
$artwork->SubmitterUserId = $GLOBALS['User']->UserId ?? null;
$artwork->IsPublishedInUs = HttpInput::Bool(POST, 'artwork-is-published-in-us', false);
$artwork->PublicationYear = HttpInput::Int(POST, 'artwork-publication-year');
$artwork->PublicationYearPageUrl = HttpInput::Str(POST, 'artwork-publication-year-page-url', false);