Add placeholders for ebooks

This commit is contained in:
Mike Colagrosso 2024-12-13 11:45:14 -06:00 committed by Alex Cabal
parent cf5f488cae
commit 1ab95df084
52 changed files with 1192 additions and 237 deletions

View file

@ -15,6 +15,7 @@ class Benefits{
public bool $CanReviewArtwork = false;
public bool $CanReviewOwnArtwork = false;
public bool $CanEditUsers = false;
public bool $CanCreateEbookPlaceholders = false;
protected bool $_HasBenefits;
@ -27,6 +28,8 @@ class Benefits{
$this->CanReviewOwnArtwork
||
$this->CanEditUsers
||
$this->CanCreateEbookPlaceholders
){
return true;
}
@ -58,18 +61,18 @@ class Benefits{
public function Create(): void{
Db::Query('
INSERT into Benefits (UserId, CanAccessFeeds, CanVote, CanBulkDownload, CanUploadArtwork, CanReviewArtwork, CanReviewOwnArtwork, CanEditUsers)
values (?, ?, ?, ?, ?, ?, ?, ?)
', [$this->UserId, $this->CanAccessFeeds, $this->CanVote, $this->CanBulkDownload, $this->CanUploadArtwork, $this->CanReviewArtwork, $this->CanReviewOwnArtwork, $this->CanEditUsers]);
INSERT into Benefits (UserId, CanAccessFeeds, CanVote, CanBulkDownload, CanUploadArtwork, CanReviewArtwork, CanReviewOwnArtwork, CanEditUsers, CanCreateEbookPlaceholders)
values (?, ?, ?, ?, ?, ?, ?, ?, ?)
', [$this->UserId, $this->CanAccessFeeds, $this->CanVote, $this->CanBulkDownload, $this->CanUploadArtwork, $this->CanReviewArtwork, $this->CanReviewOwnArtwork, $this->CanEditUsers, $this->CanCreateEbookPlaceholders]);
}
public function Save(): void{
Db::Query('
UPDATE Benefits
set CanAccessFeeds = ?, CanVote = ?, CanBulkDownload = ?, CanUploadArtwork = ?, CanReviewArtwork = ?, CanReviewOwnArtwork = ?, CanEditUsers = ?
set CanAccessFeeds = ?, CanVote = ?, CanBulkDownload = ?, CanUploadArtwork = ?, CanReviewArtwork = ?, CanReviewOwnArtwork = ?, CanEditUsers = ?, CanCreateEbookPlaceholders = ?
where
UserId = ?
', [$this->CanAccessFeeds, $this->CanVote, $this->CanBulkDownload, $this->CanUploadArtwork, $this->CanReviewArtwork, $this->CanReviewOwnArtwork, $this->CanEditUsers, $this->UserId]);
', [$this->CanAccessFeeds, $this->CanVote, $this->CanBulkDownload, $this->CanUploadArtwork, $this->CanReviewArtwork, $this->CanReviewOwnArtwork, $this->CanEditUsers, $this->CanCreateEbookPlaceholders, $this->UserId]);
}
public function FillFromHttpPost(): void{
@ -80,5 +83,6 @@ class Benefits{
$this->PropertyFromHttp('CanReviewArtwork');
$this->PropertyFromHttp('CanReviewOwnArtwork');
$this->PropertyFromHttp('CanEditUsers');
$this->PropertyFromHttp('CanCreateEbookPlaceholders');
}
}