mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 09:32:24 -04:00
Link to discussion if project producer has no email
This commit is contained in:
parent
5782d6ca7d
commit
93a1b40b89
2 changed files with 11 additions and 9 deletions
|
@ -36,6 +36,8 @@ $includeStatus = $includeStatus ?? true;
|
|||
<td class="producer">
|
||||
<? if($project->ProducerEmail !== null){ ?>
|
||||
<a href="mailto:<?= Formatter::EscapeHtml($project->ProducerEmail) ?>"><?= Formatter::EscapeHtml($project->ProducerName) ?></a>
|
||||
<? }elseif($project->DiscussionUrl !== null){ ?>
|
||||
<a href="<?= Formatter::EscapeHtml($project->DiscussionUrl) ?>"><?= Formatter::EscapeHtml($project->ProducerName) ?></a>
|
||||
<? }else{ ?>
|
||||
<?= Formatter::EscapeHtml($project->ProducerName) ?>
|
||||
<? } ?>
|
||||
|
|
|
@ -73,15 +73,6 @@ try{
|
|||
$ebookPlaceholder->FillFromHttpPost();
|
||||
$ebook->EbookPlaceholder = $ebookPlaceholder;
|
||||
|
||||
$ebook->FillIdentifierFromTitleAndContributors();
|
||||
try{
|
||||
$existingEbook = Ebook::GetByIdentifier($ebook->Identifier);
|
||||
throw new Exceptions\DuplicateEbookException($ebook->Identifier);
|
||||
}
|
||||
catch(Exceptions\EbookNotFoundException){
|
||||
// Pass and create the placeholder. There is no existing ebook with this identifier.
|
||||
}
|
||||
|
||||
// Do we have a `Project` to create at the same time?
|
||||
$project = null;
|
||||
if($ebookPlaceholder->IsInProgress){
|
||||
|
@ -92,6 +83,15 @@ try{
|
|||
$project->Validate();
|
||||
}
|
||||
|
||||
$ebook->FillIdentifierFromTitleAndContributors();
|
||||
try{
|
||||
$existingEbook = Ebook::GetByIdentifier($ebook->Identifier);
|
||||
throw new Exceptions\DuplicateEbookException($ebook->Identifier);
|
||||
}
|
||||
catch(Exceptions\EbookNotFoundException){
|
||||
// Pass and create the placeholder. There is no existing ebook with this identifier.
|
||||
}
|
||||
|
||||
// These properties must be set before calling `Ebook::Create()` to prevent the getters from triggering DB queries or accessing `Ebook::$EbookId` before it is set.
|
||||
$ebook->Tags = [];
|
||||
$ebook->LocSubjects = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue