$this->addContentLock($this->config->maxPages);
}
+ $this->checkConfig();
$this->checkPageLabels();
// We need to be able to reference both navOrder and navOrderH so convert both to arrays
}
+ protected function checkConfig()
+ {
+ if ($this->isMobileFirst() && $this->fluidbookSettings->mobilefirstFluidbookId) {
+ FluidbookHealthIssues::addIssue($this->book_id, FluidbookHealthIssues::TYPE_MOBILEFIRST_CONFIG, ['mobilefirstId' => $this->fluidbookSettings->mobilefirstFluidbookId]);
+ }
+ }
+
public function log($step)
{
parent::setStatus($newStatus);
foreach ($this->getPageData()->publications as $publication) {
+ /** @var FluidbookPublication $fb */
$fb = FluidbookPublication::withoutGlobalScopes()->find($publication['fluidbook']);
- $fb->setStatus($newStatus);
$fb->setOwner($this->owner);
- $fb->save();
+ $fb->setStatus($newStatus);
+ $fb->saveQuietlyWithoutFlushingCache();
}
RefreshUsersTree::dispatchSync();
foreach ($this->getPageData()->publications as $publication) {
$fb = FluidbookPublication::withoutGlobalScopes()->find($publication['fluidbook']);
+ $fb->setStatus($this->status);
$fb->setOwner($owner);
- $fb->save();
+ $fb->saveQuietlyWithoutFlushingCache();
}
RefreshUsersTree::dispatchSync();
{
const TYPE_MISSING_FILE = 1;
const TYPE_QRCODE_NOT_READABLE = 2;
+ const TYPE_MOBILEFIRST_CONFIG = 3;
const CRIT_ERROR = 5;
const CRIT_WARNING = 3;
protected static function getTypeData($fluidbookId)
{
/*
- * __('Le chemin ":path" est introuvable')
- * __('Le QRcode du lien :uid (page :page) n\'a pas pu être décodé')
+ * __('Le chemin ":path" est introuvable')
+ * __('Le QRcode du lien :uid (page :page) n\'a pas pu être décodé')
+ * __(''Ce fluidbook mobile first a le paramètre "Identifiant du fluidbook Mobile first" défini. Ce paramètre est réservé aux fluidbooks Desktop')
+ *
*/
return [
static::TYPE_MISSING_FILE =>
[
'summary' => __('Erreur 404'),
'criticality' => self::CRIT_ERROR,
- 'text' => 'Le chemin ":path" est introuvable',
+ 'text' => __('Le chemin ":path" est introuvable'),
],
static::TYPE_QRCODE_NOT_READABLE =>
[
'summary' => __('QRcode illisible'),
'criticality' => self::CRIT_ERROR,
- 'text' => 'Le QRcode du lien :uid (page :page) n\'a pas pu être décodé',
+ 'text' => __('Le QRcode du lien :uid (page :page) n\'a pas pu être décodé'),
'fixText' => __('Aller sur l\'éditeur de liens'),
'fixURL' => route('fluidbook_linkeditor', ['id' => $fluidbookId]) . '#:page',
],
+ static::TYPE_MOBILEFIRST_CONFIG => [
+ 'summary' => __('Configuration MobileFirst'),
+ 'criticality' => self::CRIT_WARNING,
+ 'text' => 'Ce fluidbook mobile first a le paramètre "Identifiant du fluidbook Mobile first" défini. Ce paramètre est réservé aux fluidbooks Desktop',
+ 'fixText' => __('Editer la configuration'),
+ 'fixURL' => route('fluidbook_linkeditor', ['id' => $fluidbookId]) . '#s_section_mobilefirst',
+ ],
];
$this->saveQuietly();
}
+ public function getMobileFirstId()
+ {
+ if ($this->getSettings()->get('mobileNavigationType') === "mobilefirst") {
+ return false;
+ }
+ return $this->getSettings()->get('mobilefirstFluidbookId', false);
+ }
+
+ public function setStatus($newStatus)
+ {
+ parent::setStatus($newStatus);
+ $mfid = $this->getMobileFirstId();
+ if ($mfid) {
+ $mf = static::withoutGlobalScopes()->find($mfid);
+ if ($mf) {
+ $mf->setStatus($newStatus);
+ $mf->setOwner($this->owner);
+ $mf->saveQuietlyWithoutFlushingCache();
+ }
+ }
+ }
+
+ public function setOwner($owner)
+ {
+ parent::setOwner($owner);
+ $mfid = $this->getMobileFirstId();
+ if ($mfid) {
+ $mf = static::withoutGlobalScopes()->find($mfid);
+ if ($mf) {
+ $mf->setOwner($owner);
+ $mf->setStatus($this->status);
+ $mf->saveQuietlyWithoutFlushingCache();
+ }
+ }
+ }
+
protected function _replicateMedia($newId)
{
static::copyAssets($this->id, $newId, 'link');
color: #c00;
}
.la-exclamation-triangle {
- color: #F74D07;
+ color: #f7a307;
}
.message {
text-align: center;
@error: #c00;
-@warning: #F74D07;
+@warning: #f7a307;