bring into standalone plugin for distribution
This commit is contained in:
32
templates/ExternalProductCatalogs/add.php
Normal file
32
templates/ExternalProductCatalogs/add.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $externalProductCatalog
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $productCatalogs
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List External Product Catalogs'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="externalProductCatalogs form content">
|
||||
<?= $this->Form->create($externalProductCatalog) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add External Product Catalog') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('product_catalog_id', ['options' => $productCatalogs]);
|
||||
echo $this->Form->control('base_url');
|
||||
echo $this->Form->control('api_url');
|
||||
echo $this->Form->control('deleted', ['empty' => true]);
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
37
templates/ExternalProductCatalogs/edit.php
Normal file
37
templates/ExternalProductCatalogs/edit.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $externalProductCatalog
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $productCatalogs
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $externalProductCatalog->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $externalProductCatalog->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List External Product Catalogs'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="externalProductCatalogs form content">
|
||||
<?= $this->Form->create($externalProductCatalog) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit External Product Catalog') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('product_catalog_id', ['options' => $productCatalogs]);
|
||||
echo $this->Form->control('base_url');
|
||||
echo $this->Form->control('api_url');
|
||||
echo $this->Form->control('deleted', ['empty' => true]);
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
54
templates/ExternalProductCatalogs/index.php
Normal file
54
templates/ExternalProductCatalogs/index.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $externalProductCatalogs
|
||||
*/
|
||||
?>
|
||||
<div class="externalProductCatalogs index content">
|
||||
<?= $this->Html->link(__('New External Product Catalog'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||
<h3><?= __('External Product Catalogs') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('product_catalog_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('base_url') ?></th>
|
||||
<th><?= $this->Paginator->sort('api_url') ?></th>
|
||||
<th><?= $this->Paginator->sort('created') ?></th>
|
||||
<th><?= $this->Paginator->sort('deleted') ?></th>
|
||||
<th><?= $this->Paginator->sort('enabled') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($externalProductCatalogs as $externalProductCatalog): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($externalProductCatalog->id) ?></td>
|
||||
<td><?= $externalProductCatalog->hasValue('product_catalog') ? $this->Html->link($externalProductCatalog->product_catalog->name, ['controller' => 'ProductCatalogs', 'action' => 'view', $externalProductCatalog->product_catalog->id]) : '' ?></td>
|
||||
<td><?= h($externalProductCatalog->base_url) ?></td>
|
||||
<td><?= h($externalProductCatalog->api_url) ?></td>
|
||||
<td><?= h($externalProductCatalog->created) ?></td>
|
||||
<td><?= h($externalProductCatalog->deleted) ?></td>
|
||||
<td><?= h($externalProductCatalog->enabled) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $externalProductCatalog->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $externalProductCatalog->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $externalProductCatalog->id], ['confirm' => __('Are you sure you want to delete # {0}?', $externalProductCatalog->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
52
templates/ExternalProductCatalogs/view.php
Normal file
52
templates/ExternalProductCatalogs/view.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $externalProductCatalog
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit External Product Catalog'), ['action' => 'edit', $externalProductCatalog->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete External Product Catalog'), ['action' => 'delete', $externalProductCatalog->id], ['confirm' => __('Are you sure you want to delete # {0}?', $externalProductCatalog->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List External Product Catalogs'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New External Product Catalog'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="externalProductCatalogs view content">
|
||||
<h3><?= h($externalProductCatalog->base_url) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Product Catalog') ?></th>
|
||||
<td><?= $externalProductCatalog->hasValue('product_catalog') ? $this->Html->link($externalProductCatalog->product_catalog->name, ['controller' => 'ProductCatalogs', 'action' => 'view', $externalProductCatalog->product_catalog->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Base Url') ?></th>
|
||||
<td><?= h($externalProductCatalog->base_url) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Api Url') ?></th>
|
||||
<td><?= h($externalProductCatalog->api_url) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($externalProductCatalog->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Created') ?></th>
|
||||
<td><?= h($externalProductCatalog->created) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Deleted') ?></th>
|
||||
<td><?= h($externalProductCatalog->deleted) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Enabled') ?></th>
|
||||
<td><?= $externalProductCatalog->enabled ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
29
templates/ProductCatalogs/add.php
Normal file
29
templates/ProductCatalogs/add.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCatalog
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Product Catalogs'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCatalogs form content">
|
||||
<?= $this->Form->create($productCatalog) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Product Catalog') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('catalog_description');
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
34
templates/ProductCatalogs/edit.php
Normal file
34
templates/ProductCatalogs/edit.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCatalog
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $productCatalog->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $productCatalog->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Product Catalogs'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCatalogs form content">
|
||||
<?= $this->Form->create($productCatalog) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Product Catalog') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('catalog_description');
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
48
templates/ProductCatalogs/index.php
Normal file
48
templates/ProductCatalogs/index.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $productCatalogs
|
||||
*/
|
||||
?>
|
||||
<div class="productCatalogs index content">
|
||||
<?= $this->Html->link(__('New Product Catalog'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||
<h3><?= __('Product Catalogs') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('catalog_description') ?></th>
|
||||
<th><?= $this->Paginator->sort('enabled') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($productCatalogs as $productCatalog): ?>
|
||||
<tr>
|
||||
<td><?= $productCatalog->id; ?></td>
|
||||
<td><?= h($productCatalog->name) ?></td>
|
||||
<td><?= h($productCatalog->catalog_description) ?></td>
|
||||
<td><?= h($productCatalog->enabled) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $productCatalog->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $productCatalog->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $productCatalog->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCatalog->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
73
templates/ProductCatalogs/view.php
Normal file
73
templates/ProductCatalogs/view.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCatalog
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Product Catalog'), ['action' => 'edit', $productCatalog->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Product Catalog'), ['action' => 'delete', $productCatalog->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCatalog->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Product Catalogs'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Product Catalog'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCatalogs view content">
|
||||
<h3><?= h($productCatalog->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($productCatalog->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Catalog Description') ?></th>
|
||||
<td><?= h($productCatalog->catalog_description) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $productCatalog->id; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Enabled') ?></th>
|
||||
<td><?= $productCatalog->enabled ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Product Categories') ?></h4>
|
||||
<?php if (!empty($productCatalog->product_categories)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Product Catalog Id') ?></th>
|
||||
<th><?= __('Name') ?></th>
|
||||
<th><?= __('Category Description') ?></th>
|
||||
<th><?= __('Parent Id') ?></th>
|
||||
<th><?= __('Enabled') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($productCatalog->product_categories as $productCategories) : ?>
|
||||
<tr>
|
||||
<td><?= h($productCategories->id) ?></td>
|
||||
<td><?= h($productCategories->product_catalog_id) ?></td>
|
||||
<td><?= h($productCategories->name) ?></td>
|
||||
<td><?= h($productCategories->category_description) ?></td>
|
||||
<td><?= h($productCategories->parent_id) ?></td>
|
||||
<td><?= h($productCategories->enabled) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'ProductCategories', 'action' => 'view', $productCategories->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'ProductCategories', 'action' => 'edit', $productCategories->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'ProductCategories', 'action' => 'delete', $productCategories->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategories->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
33
templates/ProductCategories/add.php
Normal file
33
templates/ProductCategories/add.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategory
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $productCatalogs
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $parentProductCategories
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Product Categories'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCategories form content">
|
||||
<?= $this->Form->create($productCategory) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Product Category') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('product_catalog_id', ['options' => $productCatalogs]);
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('category_description');
|
||||
echo $this->Form->control('parent_id', ['options' => $parentProductCategories, 'empty' => true]);
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
38
templates/ProductCategories/edit.php
Normal file
38
templates/ProductCategories/edit.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategory
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $productCatalogs
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $parentProductCategories
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $productCategory->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $productCategory->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Product Categories'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCategories form content">
|
||||
<?= $this->Form->create($productCategory) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Product Category') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('product_catalog_id', ['options' => $productCatalogs]);
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('category_description');
|
||||
echo $this->Form->control('parent_id', ['options' => $parentProductCategories, 'empty' => true]);
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
50
templates/ProductCategories/index.php
Normal file
50
templates/ProductCategories/index.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $productCategories
|
||||
*/
|
||||
?>
|
||||
<div class="productCategories index content">
|
||||
<?= $this->Html->link(__('New Product Category'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||
<h3><?= __('Product Categories') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('product_catalog_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('parent_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('enabled') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($productCategories as $productCategory): ?>
|
||||
<tr>
|
||||
<td><?= $productCategory->id; ?></td>
|
||||
<td><?= $productCategory->hasValue('product_catalog') ? $this->Html->link($productCategory->product_catalog->name, ['controller' => 'ProductCatalogs', 'action' => 'view', $productCategory->product_catalog->id]) : '' ?></td>
|
||||
<td><?= h($productCategory->name) ?></td>
|
||||
<td><?= $productCategory->hasValue('parent_product_category') ? $this->Html->link($productCategory->parent_product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategory->parent_product_category->id]) : '' ?></td>
|
||||
<td><?= h($productCategory->enabled) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $productCategory->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $productCategory->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $productCategory->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategory->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
95
templates/ProductCategories/view.php
Normal file
95
templates/ProductCategories/view.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategory
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Product Category'), ['action' => 'edit', $productCategory->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Product Category'), ['action' => 'delete', $productCategory->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategory->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Product Categories'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Product Category'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCategories view content">
|
||||
<h3><?= h($productCategory->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Product Catalog') ?></th>
|
||||
<td><?= $productCategory->hasValue('product_catalog') ? $this->Html->link($productCategory->product_catalog->name, ['controller' => 'ProductCatalogs', 'action' => 'view', $productCategory->product_catalog->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($productCategory->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Parent Product Category') ?></th>
|
||||
<td><?= $productCategory->hasValue('parent_product_category') ? $this->Html->link($productCategory->parent_product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategory->parent_product_category->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $productCategory->id; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Lft') ?></th>
|
||||
<td><?= $this->Number->format($productCategory->lft) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Rght') ?></th>
|
||||
<td><?= $this->Number->format($productCategory->rght) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Enabled') ?></th>
|
||||
<td><?= $productCategory->enabled ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text">
|
||||
<strong><?= __('Category Description') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($productCategory->category_description)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Product Categories') ?></h4>
|
||||
<?php if (!empty($productCategory->child_product_categories)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Product Catalog Id') ?></th>
|
||||
<th><?= __('Name') ?></th>
|
||||
<th><?= __('Category Description') ?></th>
|
||||
<th><?= __('Parent Id') ?></th>
|
||||
<th><?= __('Lft') ?></th>
|
||||
<th><?= __('Rght') ?></th>
|
||||
<th><?= __('Enabled') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($productCategory->child_product_categories as $childProductCategories) : ?>
|
||||
<tr>
|
||||
<td><?= h($childProductCategories->id) ?></td>
|
||||
<td><?= h($childProductCategories->product_catalog_id) ?></td>
|
||||
<td><?= h($childProductCategories->name) ?></td>
|
||||
<td><?= h($childProductCategories->category_description) ?></td>
|
||||
<td><?= h($childProductCategories->parent_id) ?></td>
|
||||
<td><?= h($childProductCategories->lft) ?></td>
|
||||
<td><?= h($childProductCategories->rght) ?></td>
|
||||
<td><?= h($childProductCategories->enabled) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'ProductCategories', 'action' => 'view', $childProductCategories->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'ProductCategories', 'action' => 'edit', $childProductCategories->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'ProductCategories', 'action' => 'delete', $childProductCategories->id], ['confirm' => __('Are you sure you want to delete # {0}?', $childProductCategories->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
20
templates/ProductCategoryAttributeOptions/add.php
Normal file
20
templates/ProductCategoryAttributeOptions/add.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use App\View\AppView;
|
||||
use Cake\Datasource\EntityInterface;
|
||||
|
||||
/**
|
||||
* @var AppView $this
|
||||
* @var EntityInterface $productCategoryAttributeOption
|
||||
*/
|
||||
|
||||
$this->setLayout('ajax');
|
||||
$prefix = $prefix ?? '';
|
||||
if ($this->request->getQuery('prefix') !== null) {
|
||||
$prefix = 'product_category_attribute_options.' . $this->request->getQuery('prefix') . '.';
|
||||
}
|
||||
echo '<hr class="my-2">';
|
||||
echo $this->element('ProductCategoryAttributes/product_category_attribute_option_form', [
|
||||
'prefix' => $prefix
|
||||
]);
|
||||
?>
|
||||
27
templates/ProductCategoryAttributes/add.php
Normal file
27
templates/ProductCategoryAttributes/add.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategoryAttribute
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $productCategories
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Product Category Attributes'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCategoryAttributes form content">
|
||||
<?= $this->Form->create($productCategoryAttribute) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Product Category Attribute') ?></legend>
|
||||
<?= $this->element('ProductCategoryAttributes/form'); ?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->Html->script('CakeProducts.product_category_attribute_options.js'); ?>
|
||||
32
templates/ProductCategoryAttributes/edit.php
Normal file
32
templates/ProductCategoryAttributes/edit.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategoryAttribute
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $productCategories
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $productCategoryAttribute->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $productCategoryAttribute->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Product Category Attributes'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCategoryAttributes form content">
|
||||
<?= $this->Form->create($productCategoryAttribute) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Product Category Attribute') ?></legend>
|
||||
<?= $this->element('ProductCategoryAttributes/form'); ?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->Html->script('CakeProducts.product_category_attribute_options.js'); ?>
|
||||
50
templates/ProductCategoryAttributes/index.php
Normal file
50
templates/ProductCategoryAttributes/index.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $productCategoryAttributes
|
||||
*/
|
||||
?>
|
||||
<div class="productCategoryAttributes index content">
|
||||
<?= $this->Html->link(__('New Product Category Attribute'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||
<h3><?= __('Product Category Attributes') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('product_category_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('attribute_type_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('enabled') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($productCategoryAttributes as $productCategoryAttribute): ?>
|
||||
<tr>
|
||||
<td><?= $productCategoryAttribute->id ?></td>
|
||||
<td><?= h($productCategoryAttribute->name) ?></td>
|
||||
<td><?= $productCategoryAttribute->hasValue('product_category') ? $this->Html->link($productCategoryAttribute->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategoryAttribute->product_category->id]) : '' ?></td>
|
||||
<td><?= $productCategoryAttribute->attribute_type_id->name ?></td>
|
||||
<td><?= h($productCategoryAttribute->enabled) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $productCategoryAttribute->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $productCategoryAttribute->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $productCategoryAttribute->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategoryAttribute->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
71
templates/ProductCategoryAttributes/view.php
Normal file
71
templates/ProductCategoryAttributes/view.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategoryAttribute
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Product Category Attribute'), ['action' => 'edit', $productCategoryAttribute->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Product Category Attribute'), ['action' => 'delete', $productCategoryAttribute->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategoryAttribute->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Product Category Attributes'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Product Category Attribute'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="productCategoryAttributes view content">
|
||||
<h3><?= h($productCategoryAttribute->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($productCategoryAttribute->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Product Category') ?></th>
|
||||
<td><?= $productCategoryAttribute->hasValue('product_category') ? $this->Html->link($productCategoryAttribute->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategoryAttribute->product_category->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $productCategoryAttribute->id ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Enabled') ?></th>
|
||||
<td><?= $productCategoryAttribute->enabled ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Product Category Attribute Options') ?></h4>
|
||||
<?php if (!empty($productCategoryAttribute->product_category_attribute_options)) : ?>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<th><?= __('Product Category Attribute Id') ?></th>
|
||||
<th><?= __('Attribute Value') ?></th>
|
||||
<th><?= __('Attribute Label') ?></th>
|
||||
<th><?= __('Enabled') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($productCategoryAttribute->product_category_attribute_options as $productCategoryAttributeOptions) : ?>
|
||||
<tr>
|
||||
<td><?= h($productCategoryAttributeOptions->id) ?></td>
|
||||
<td><?= h($productCategoryAttributeOptions->product_category_attribute_id) ?></td>
|
||||
<td><?= h($productCategoryAttributeOptions->attribute_value) ?></td>
|
||||
<td><?= h($productCategoryAttributeOptions->attribute_label) ?></td>
|
||||
<td><?= h($productCategoryAttributeOptions->enabled) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'ProductCategoryAttributeOptions', 'action' => 'view', $productCategoryAttributeOptions->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'ProductCategoryAttributeOptions', 'action' => 'edit', $productCategoryAttributeOptions->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'ProductCategoryAttributeOptions', 'action' => 'delete', $productCategoryAttributeOptions->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategoryAttributeOptions->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
30
templates/Products/add.php
Normal file
30
templates/Products/add.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $product
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $productCategories
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Products'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="products form content">
|
||||
<?= $this->Form->create($product) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Product') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('product_category_id', ['options' => $productCategories]);
|
||||
echo $this->Form->control('product_type_id');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
35
templates/Products/edit.php
Normal file
35
templates/Products/edit.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $product
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $productCategories
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $product->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $product->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Products'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="products form content">
|
||||
<?= $this->Form->create($product) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Product') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('product_category_id', ['options' => $productCategories]);
|
||||
echo $this->Form->control('product_type_id');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
48
templates/Products/index.php
Normal file
48
templates/Products/index.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface> $products
|
||||
*/
|
||||
?>
|
||||
<div class="products index content">
|
||||
<?= $this->Html->link(__('New Product'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||
<h3><?= __('Products') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('product_category_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('product_type_id') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($products as $product): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($product->id) ?></td>
|
||||
<td><?= h($product->name) ?></td>
|
||||
<td><?= $product->hasValue('product_category') ? $this->Html->link($product->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $product->product_category->id]) : '' ?></td>
|
||||
<td><?= $product->product_type_id->name ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $product->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $product->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $product->id], ['confirm' => __('Are you sure you want to delete # {0}?', $product->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
40
templates/Products/view.php
Normal file
40
templates/Products/view.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $product
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Product'), ['action' => 'edit', $product->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Product'), ['action' => 'delete', $product->id], ['confirm' => __('Are you sure you want to delete # {0}?', $product->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Products'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Product'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="products view content">
|
||||
<h3><?= h($product->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($product->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Product Category') ?></th>
|
||||
<td><?= $product->hasValue('product_category') ? $this->Html->link($product->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $product->product_category->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($product->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Product Type Id') ?></th>
|
||||
<td><?= $product->product_type_id->name ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
55
templates/element/Layout/submenu.php
Normal file
55
templates/element/Layout/submenu.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?= $this->ActiveLink->link('Catalogs', [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCatalogs',
|
||||
'action' => 'index',
|
||||
], [
|
||||
'class' => 'submenu-link',
|
||||
'target' => [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCatalogs',
|
||||
],
|
||||
]); ?>
|
||||
<?= $this->ActiveLink->link('Products', [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'Products',
|
||||
'action' => 'index',
|
||||
], [
|
||||
'class' => 'submenu-link',
|
||||
'target' => [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'Products',
|
||||
],
|
||||
]); ?>
|
||||
<?= $this->ActiveLink->link('Categories', [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCategories',
|
||||
'action' => 'index',
|
||||
], [
|
||||
'class' => 'submenu-link',
|
||||
'target' => [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCategories',
|
||||
],
|
||||
]); ?>
|
||||
<?= $this->ActiveLink->link('Attributes', [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCategoryAttributes',
|
||||
'action' => 'index',
|
||||
], [
|
||||
'class' => 'submenu-link',
|
||||
'target' => [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCategoryAttributes',
|
||||
],
|
||||
]); ?>
|
||||
<?= $this->ActiveLink->link('External Catalogs', [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ExternalProductCatalogs',
|
||||
'action' => 'index',
|
||||
], [
|
||||
'class' => 'submenu-link',
|
||||
'target' => [
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ExternalProductCatalogs',
|
||||
],
|
||||
]); ?>
|
||||
49
templates/element/ProductCategoryAttributes/form.php
Normal file
49
templates/element/ProductCategoryAttributes/form.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategoryAttribute
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $productCategories
|
||||
*/
|
||||
|
||||
$numOptions = !$productCategoryAttribute->hasValue('product_category_attribute_options') || empty($productCategoryAttribute->product_category_attribute_options) ? 0 : count($productCategoryAttribute->product_category_attribute_options);
|
||||
$cnt = 0;
|
||||
$prefix = $prefix ?? '';
|
||||
?>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('product_category_id', ['options' => $productCategories, 'empty' => true]);
|
||||
echo $this->Form->control('attribute_type_id');
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
<legend><?= __('Attribute Options') . '<small class="ms-2">' . $this->Html->link('Add Option', '#', [
|
||||
'id' => 'add-option-button',
|
||||
]) . '</small>'; ?></legend>
|
||||
<?= $this->Form->number('prefix', [
|
||||
'value' => $numOptions - 1,
|
||||
'id' => 'attribute_options_prefix',
|
||||
'style' => 'display:none;',
|
||||
'hx-get' => $this->Url->build([
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCategoryAttributeOptions',
|
||||
'action' => 'add',
|
||||
]),
|
||||
'hx-trigger' => 'change',
|
||||
'hx-target' => '#attribute-options-container',
|
||||
'hx-swap' => 'beforeend',
|
||||
'data-test' => 1,
|
||||
]); ?>
|
||||
|
||||
<div id="attribute-options-container" class="container">
|
||||
<?php if ($productCategoryAttribute->hasValue('product_category_attribute_options')) : ?>
|
||||
<?php
|
||||
foreach ($productCategoryAttribute->product_category_attribute_options as $attributeOption) {
|
||||
$prefix = 'product_category_attribute_options.' . $cnt . '.';
|
||||
echo '<hr class="my-2">';
|
||||
echo $this->element('CakeProducts.ProductCategoryAttributes/product_category_attribute_option_form', [
|
||||
'attributeOption' => $attributeOption,
|
||||
'prefix' => $prefix,
|
||||
]);
|
||||
$cnt++;
|
||||
} ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategoryAttributeOption
|
||||
*/
|
||||
$cnt = 0;
|
||||
$prefix = $prefix ?? '';
|
||||
\Cake\Log\Log::debug('$prefix');
|
||||
\Cake\Log\Log::debug($prefix);
|
||||
?>
|
||||
<div class="container product-category-attribute-options-container" data-test="1" data-prefix="<?= $prefix; ?>">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<?= $this->Form->control($prefix . 'attribute_value', [
|
||||
'label' => 'Value',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col">
|
||||
<?= $this->Form->control($prefix . 'attribute_label', [
|
||||
'label' => 'Label',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col">
|
||||
<?= $this->Form->control($prefix . 'enabled', [
|
||||
'type' => 'checkbox',
|
||||
'checked' => true,
|
||||
'label' => 'Enabled',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user