'metaTemplates', 'action' => 'view', $newestMetaTemplate->id ]); $bodyHtml = ''; $bodyHtml .= sprintf('
%s: %s
', __('Current version'), h($oldMetaTemplate->version)); $bodyHtml .= sprintf('
%s: %s
', __('Newest version'), $urlNewestMetaTemplate, h($newestMetaTemplate->version)); $bodyHtml .= sprintf('

%s

', __('{0} Entities with meta-fields for the meta-template version {1}', h($entityCount), h($oldMetaTemplate->version))); // debug($conflictingEntities); if (empty($conflictingEntities)) { $bodyHtml .= $this->Bootstrap->alert([ 'text' => __('All entities can updated automatically', count($conflictingEntities)), 'variant' => 'success', 'dismissible' => false, ]); } else { $bodyHtml .= $this->Bootstrap->alert([ 'html' => sprintf( '', $this->Bootstrap->node('li', [], __('{0} entities can be updated automatically', $entityCount - count($conflictingEntities))), $this->Bootstrap->node('li', [], __('{0} entities cannot be updated automatically and require manual migration', count($conflictingEntities))) ), 'variant' => 'warning', 'dismissible' => false, ]); $bodyHtml .= ''; } $form = sprintf( '
%s%s
', $this->Form->create(null, [ 'url' => [ 'controller' => 'MetaTemplates', 'action' => 'migrateMetafieldsToNewestTemplate', $oldMetaTemplate->id, ] ]), $this->Form->end() ); $bodyHtml .= $form; $title = __('{0} has a new meta-template and meta-fields to be updated', sprintf('%s', h($oldMetaTemplate->name))); if (!empty($ajax)) { echo $this->Bootstrap->modal([ 'titleHtml' => $title, 'bodyHtml' => $bodyHtml, 'size' => 'lg', 'type' => 'confirm', 'confirmButton' => [ 'text' => __('Migrate meta-fields'), 'variant' => 'success', ], 'confirmFunction' => 'migrateMetafieldsToNewestTemplate', ]); } else { echo $this->Bootstrap->node('h1', [], $title); echo $bodyHtml; echo $this->Bootstrap->button([ 'text' => __('Migrate meta-fields'), 'variant' => 'success', 'onclick' => '$(".hidden-form-container form").submit()', ]); } ?>