AttributesAv management
This commit is contained in:
@@ -50,6 +50,7 @@ class AttributeAv extends BaseAction implements EventSubscriberInterface
|
|||||||
$attribute
|
$attribute
|
||||||
->setDispatcher($this->getDispatcher())
|
->setDispatcher($this->getDispatcher())
|
||||||
|
|
||||||
|
->setAttributeId($event->getAttributeId())
|
||||||
->setLocale($event->getLocale())
|
->setLocale($event->getLocale())
|
||||||
->setTitle($event->getTitle())
|
->setTitle($event->getTitle())
|
||||||
|
|
||||||
@@ -57,11 +58,6 @@ class AttributeAv extends BaseAction implements EventSubscriberInterface
|
|||||||
;
|
;
|
||||||
|
|
||||||
$event->setAttributeAv($attribute);
|
$event->setAttributeAv($attribute);
|
||||||
|
|
||||||
// Add atribute to all product templates if required
|
|
||||||
if ($event->getAddToAllTemplates() != 0) {
|
|
||||||
// TODO: add to all product template
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -70,7 +70,8 @@
|
|||||||
|
|
||||||
<form name="thelia.admin.attribute.creation" class="Thelia\Form\AttributeCreationForm"/>
|
<form name="thelia.admin.attribute.creation" class="Thelia\Form\AttributeCreationForm"/>
|
||||||
<form name="thelia.admin.attribute.modification" class="Thelia\Form\AttributeModificationForm"/>
|
<form name="thelia.admin.attribute.modification" class="Thelia\Form\AttributeModificationForm"/>
|
||||||
<form name="thelia.admin.attribute-value.creation" class="Thelia\Form\AttributeValueCreationForm"/>
|
|
||||||
|
<form name="thelia.admin.attributeav.creation" class="Thelia\Form\AttributeAvCreationForm"/>
|
||||||
</forms>
|
</forms>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
180
core/lib/Thelia/Controller/Admin/AttributeAvController.php
Normal file
180
core/lib/Thelia/Controller/Admin/AttributeAvController.php
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
<?php
|
||||||
|
/*************************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* Thelia */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) OpenStudio */
|
||||||
|
/* email : info@thelia.net */
|
||||||
|
/* web : http://www.thelia.net */
|
||||||
|
/* */
|
||||||
|
/* This program is free software; you can redistribute it and/or modify */
|
||||||
|
/* it under the terms of the GNU General Public License as published by */
|
||||||
|
/* the Free Software Foundation; either version 3 of the License */
|
||||||
|
/* */
|
||||||
|
/* This program is distributed in the hope that it will be useful, */
|
||||||
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||||
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||||
|
/* GNU General Public License for more details. */
|
||||||
|
/* */
|
||||||
|
/* You should have received a copy of the GNU General Public License */
|
||||||
|
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
/* */
|
||||||
|
/*************************************************************************************/
|
||||||
|
|
||||||
|
namespace Thelia\Controller\Admin;
|
||||||
|
|
||||||
|
use Thelia\Core\Event\AttributeAvDeleteEvent;
|
||||||
|
use Thelia\Core\Event\TheliaEvents;
|
||||||
|
use Thelia\Core\Event\AttributeAvUpdateEvent;
|
||||||
|
use Thelia\Core\Event\AttributeAvCreateEvent;
|
||||||
|
use Thelia\Model\AttributeAvQuery;
|
||||||
|
use Thelia\Form\AttributeAvModificationForm;
|
||||||
|
use Thelia\Form\AttributeAvCreationForm;
|
||||||
|
use Thelia\Core\Event\UpdatePositionEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages attributes-av sent by mail
|
||||||
|
*
|
||||||
|
* @author Franck Allimant <franck@cqfdev.fr>
|
||||||
|
*/
|
||||||
|
class AttributeAvController extends AbstractCrudController
|
||||||
|
{
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct(
|
||||||
|
'attribute',
|
||||||
|
'manual',
|
||||||
|
|
||||||
|
'admin.configuration.attributes-av.view',
|
||||||
|
'admin.configuration.attributes-av.create',
|
||||||
|
'admin.configuration.attributes-av.update',
|
||||||
|
'admin.configuration.attributes-av.delete',
|
||||||
|
|
||||||
|
TheliaEvents::ATTRIBUTE_AV_CREATE,
|
||||||
|
TheliaEvents::ATTRIBUTE_AV_UPDATE,
|
||||||
|
TheliaEvents::ATTRIBUTE_AV_DELETE,
|
||||||
|
null, // No visibility toggle
|
||||||
|
TheliaEvents::ATTRIBUTE_AV_UPDATE_POSITION
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getCreationForm() {
|
||||||
|
return new AttributeAvCreationForm($this->getRequest());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getUpdateForm() {
|
||||||
|
return new AttributeAvModificationForm($this->getRequest());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getCreationEvent($formData) {
|
||||||
|
$createEvent = new AttributeAvCreateEvent();
|
||||||
|
|
||||||
|
$createEvent
|
||||||
|
->setAttributeId($formData['attribute_id'])
|
||||||
|
->setTitle($formData['title'])
|
||||||
|
->setLocale($formData["locale"])
|
||||||
|
;
|
||||||
|
|
||||||
|
return $createEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getUpdateEvent($formData) {
|
||||||
|
|
||||||
|
$changeEvent = new AttributeAvUpdateEvent($formData['id']);
|
||||||
|
|
||||||
|
// Create and dispatch the change event
|
||||||
|
$changeEvent
|
||||||
|
->setLocale($formData["locale"])
|
||||||
|
->setTitle($formData['title'])
|
||||||
|
->setChapo($formData['chapo'])
|
||||||
|
->setDescription($formData['description'])
|
||||||
|
->setPostscriptum($formData['postscriptum'])
|
||||||
|
;
|
||||||
|
|
||||||
|
return $changeEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function createUpdatePositionEvent($positionChangeMode, $positionValue) {
|
||||||
|
|
||||||
|
return new UpdatePositionEvent(
|
||||||
|
$this->getRequest()->get('attributeav_id', null),
|
||||||
|
$positionChangeMode,
|
||||||
|
$positionValue
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getDeleteEvent() {
|
||||||
|
return new AttributeAvDeleteEvent($this->getRequest()->get('attributeav_id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function eventContainsObject($event) {
|
||||||
|
return $event->hasAttributeAv();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function hydrateObjectForm($object) {
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'id' => $object->getId(),
|
||||||
|
'locale' => $object->getLocale(),
|
||||||
|
'title' => $object->getTitle(),
|
||||||
|
'chapo' => $object->getChapo(),
|
||||||
|
'description' => $object->getDescription(),
|
||||||
|
'postscriptum' => $object->getPostscriptum()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Setup the object form
|
||||||
|
return new AttributeAvModificationForm($this->getRequest(), "form", $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectFromEvent($event) {
|
||||||
|
return $event->hasAttributeAv() ? $event->getAttributeAv() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getExistingObject() {
|
||||||
|
return AttributeAvQuery::create()
|
||||||
|
->joinWithI18n($this->getCurrentEditionLocale())
|
||||||
|
->findOneById($this->getRequest()->get('attributeav_id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectLabel($object) {
|
||||||
|
return $object->getTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectId($object) {
|
||||||
|
return $object->getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getViewArguments() {
|
||||||
|
return array(
|
||||||
|
'attribute_id' => $this->getRequest()->get('attribute_id'),
|
||||||
|
'order' => $this->getCurrentListOrder()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function renderListTemplate($currentOrder) {
|
||||||
|
// We always return to the attribute edition form
|
||||||
|
return $this->render(
|
||||||
|
'attribute-edit',
|
||||||
|
$this->getViewArguments()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function renderEditionTemplate() {
|
||||||
|
// We always return to the attribute edition form
|
||||||
|
return $this->render('attribute-edit', $this->getViewArguments());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function redirectToEditionTemplate() {
|
||||||
|
// We always return to the attribute edition form
|
||||||
|
$this->redirectToRoute(
|
||||||
|
"admin.configuration.attributes.update",
|
||||||
|
$this->getViewArguments()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function redirectToListTemplate() {
|
||||||
|
$this->redirectToRoute(
|
||||||
|
"admin.configuration.attributes.update",
|
||||||
|
$this->getViewArguments()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,7 +28,7 @@ use Symfony\Component\Validator\ExecutionContextInterface;
|
|||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Thelia\Core\Translation\Translator;
|
use Thelia\Core\Translation\Translator;
|
||||||
|
|
||||||
class AttributeValueCreationForm extends BaseForm
|
class AttributeAvCreationForm extends BaseForm
|
||||||
{
|
{
|
||||||
protected function buildForm()
|
protected function buildForm()
|
||||||
{
|
{
|
||||||
@@ -57,6 +57,6 @@ class AttributeValueCreationForm extends BaseForm
|
|||||||
|
|
||||||
public function getName()
|
public function getName()
|
||||||
{
|
{
|
||||||
return "thelia_attribute_value_creation";
|
return "thelia_attributeav_creation";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,6 +43,10 @@ class AttributeModificationForm extends AttributeCreationForm
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
->add('attribute_values', 'collection', array(
|
||||||
|
'type' => 'text',
|
||||||
|
'options' => array('required' => false)
|
||||||
|
))
|
||||||
;
|
;
|
||||||
|
|
||||||
// Add standard description fields
|
// Add standard description fields
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace Thelia\Model;
|
namespace Thelia\Model;
|
||||||
|
|
||||||
use Thelia\Model\Base\AttributeAv as BaseAttributeAv;
|
use Thelia\Model\Base\AttributeAv as BaseAttributeAv;
|
||||||
use Thelia\Core\Event\AttributeValueEvent;
|
use Thelia\Core\Event\AttributeAvEvent;
|
||||||
use Propel\Runtime\Connection\ConnectionInterface;
|
use Propel\Runtime\Connection\ConnectionInterface;
|
||||||
use Thelia\Core\Event\TheliaEvents;
|
use Thelia\Core\Event\TheliaEvents;
|
||||||
use Propel\Runtime\ActiveQuery\Criteria;
|
use Propel\Runtime\ActiveQuery\Criteria;
|
||||||
@@ -11,21 +11,14 @@ use Propel\Runtime\ActiveQuery\Criteria;
|
|||||||
class AttributeAv extends BaseAttributeAv {
|
class AttributeAv extends BaseAttributeAv {
|
||||||
|
|
||||||
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
|
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the position of the next inserted object
|
* when dealing with position, be sure to work insite the current attribute.
|
||||||
*/
|
*/
|
||||||
public function getNextPosition($parent = null) {
|
protected function addCriteriaToPositionQuery($query) {
|
||||||
|
$query->filterByAttributeId($this->getAttributeId());
|
||||||
$last = $this->createQuery()
|
|
||||||
->filterByAttributeId($this->getAttributeId())
|
|
||||||
->orderByPosition(Criteria::DESC)
|
|
||||||
->limit(1)
|
|
||||||
->findOne()
|
|
||||||
;
|
|
||||||
|
|
||||||
return $last != null ? $last->getPosition() + 1 : 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,11 +26,11 @@ class AttributeAv extends BaseAttributeAv {
|
|||||||
*/
|
*/
|
||||||
public function preInsert(ConnectionInterface $con = null)
|
public function preInsert(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::BEFORE_CREATEATTRIBUTE_VALUE, new AttributeValueEvent($this));
|
|
||||||
|
|
||||||
// Set the current position for the new object
|
// Set the current position for the new object
|
||||||
$this->setPosition($this->getNextPosition());
|
$this->setPosition($this->getNextPosition());
|
||||||
|
|
||||||
|
$this->dispatchEvent(TheliaEvents::BEFORE_CREATEATTRIBUTE_AV, new AttributeAvEvent($this));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +39,7 @@ class AttributeAv extends BaseAttributeAv {
|
|||||||
*/
|
*/
|
||||||
public function postInsert(ConnectionInterface $con = null)
|
public function postInsert(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::AFTER_CREATEATTRIBUTE_VALUE, new AttributeValueEvent($this));
|
$this->dispatchEvent(TheliaEvents::AFTER_CREATEATTRIBUTE_AV, new AttributeAvEvent($this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +47,7 @@ class AttributeAv extends BaseAttributeAv {
|
|||||||
*/
|
*/
|
||||||
public function preUpdate(ConnectionInterface $con = null)
|
public function preUpdate(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATEATTRIBUTE_VALUE, new AttributeValueEvent($this));
|
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATEATTRIBUTE_AV, new AttributeAvEvent($this));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -64,7 +57,7 @@ class AttributeAv extends BaseAttributeAv {
|
|||||||
*/
|
*/
|
||||||
public function postUpdate(ConnectionInterface $con = null)
|
public function postUpdate(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::AFTER_UPDATEATTRIBUTE_VALUE, new AttributeValueEvent($this));
|
$this->dispatchEvent(TheliaEvents::AFTER_UPDATEATTRIBUTE_AV, new AttributeAvEvent($this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +65,7 @@ class AttributeAv extends BaseAttributeAv {
|
|||||||
*/
|
*/
|
||||||
public function preDelete(ConnectionInterface $con = null)
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::BEFORE_DELETEATTRIBUTE_VALUE, new AttributeValueEvent($this));
|
$this->dispatchEvent(TheliaEvents::BEFORE_DELETEATTRIBUTE_AV, new AttributeAvEvent($this));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -82,6 +75,6 @@ class AttributeAv extends BaseAttributeAv {
|
|||||||
*/
|
*/
|
||||||
public function postDelete(ConnectionInterface $con = null)
|
public function postDelete(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::AFTER_DELETEATTRIBUTE_VALUE, new AttributeValueEvent($this));
|
$this->dispatchEvent(TheliaEvents::AFTER_DELETEATTRIBUTE_AV, new AttributeAvEvent($this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,20 +45,26 @@ trait PositionManagementTrait {
|
|||||||
return $class->getConstant('DATABASE_NAME');
|
return $class->getConstant('DATABASE_NAME');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementors may add some search criteria (e.g., parent id) to the queries
|
||||||
|
* used to change/get position by overloading this method.
|
||||||
|
*/
|
||||||
|
protected function addCriteriaToPositionQuery($query) {
|
||||||
|
// Add required criteria here...
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the position of the next inserted object
|
* Get the position of the next inserted object
|
||||||
*/
|
*/
|
||||||
public function getNextPosition($parent = null) {
|
public function getNextPosition() {
|
||||||
|
|
||||||
$query = $this->createQuery()
|
$query = $this->createQuery()
|
||||||
->orderByPosition(Criteria::DESC)
|
->orderByPosition(Criteria::DESC)
|
||||||
->limit(1);
|
->limit(1);
|
||||||
|
|
||||||
if ($parent !== null) $query->filterByParent($parent);
|
$this->addCriteriaToPositionQuery($query);
|
||||||
|
|
||||||
$last = $query->findOne()
|
$last = $query->findOne();
|
||||||
;
|
|
||||||
|
|
||||||
return $last != null ? $last->getPosition() + 1 : 1;
|
return $last != null ? $last->getPosition() + 1 : 1;
|
||||||
}
|
}
|
||||||
@@ -67,7 +73,6 @@ trait PositionManagementTrait {
|
|||||||
* Move up a object
|
* Move up a object
|
||||||
*/
|
*/
|
||||||
public function movePositionUp() {
|
public function movePositionUp() {
|
||||||
echo "move up !";
|
|
||||||
$this->movePositionUpOrDown(true);
|
$this->movePositionUpOrDown(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +96,7 @@ trait PositionManagementTrait {
|
|||||||
// Find object to exchange position with
|
// Find object to exchange position with
|
||||||
$search = $this->createQuery();
|
$search = $this->createQuery();
|
||||||
|
|
||||||
if (method_exists($this, 'getParent')) $search->filterByParent($this->getParent());
|
$this->addCriteriaToPositionQuery($search);
|
||||||
|
|
||||||
// Up or down ?
|
// Up or down ?
|
||||||
if ($up === true) {
|
if ($up === true) {
|
||||||
@@ -152,7 +157,7 @@ trait PositionManagementTrait {
|
|||||||
// Find categories to offset
|
// Find categories to offset
|
||||||
$search = $this->createQuery();
|
$search = $this->createQuery();
|
||||||
|
|
||||||
if (method_exists($this, 'getParent')) $search->filterByParent($this->getParent());
|
$this->addCriteriaToPositionQuery($search);
|
||||||
|
|
||||||
if ($newPosition > $current_position) {
|
if ($newPosition > $current_position) {
|
||||||
// The new position is after the current position -> we will offset + 1 all categories located between us and the new position
|
// The new position is after the current position -> we will offset + 1 all categories located between us and the new position
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
{intl l='Attribute values'}
|
{intl l='Attribute values'}
|
||||||
|
|
||||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.attribute-values.create"}
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.attribute-av.create"}
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
<a data-toggle="modal" href="#creation_dialog" title="Add a new attribute value" class="btn btn-default btn-primary">
|
<a data-toggle="modal" href="#creation_dialog" title="Add a new attribute value" class="btn btn-default btn-primary">
|
||||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||||
@@ -125,8 +125,8 @@
|
|||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{admin_position_block
|
{admin_position_block
|
||||||
permission="admin.attributes.edit"
|
permission="admin.attributes.edit"
|
||||||
path="/admin/configuration/attributes/update-value-position"
|
path={url path='/admin/configuration/attributes-av/update-position' attribute_id=$attribute_id}
|
||||||
url_parameter="attribute_id"
|
url_parameter="attributeav_id"
|
||||||
in_place_edit_class="positionChange"
|
in_place_edit_class="positionChange"
|
||||||
position="$POSITION"
|
position="$POSITION"
|
||||||
id="$ID"
|
id="$ID"
|
||||||
@@ -137,7 +137,11 @@
|
|||||||
|
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="btn btn-default btn-xs value-delete" title="{intl l='Delete this value'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.attribute-av.delete"}
|
||||||
|
<a class="btn btn-default btn-xs value-delete" title="{intl l='Delete this value'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal">
|
||||||
|
<span class="glyphicon glyphicon-trash"></span>
|
||||||
|
</a>
|
||||||
|
{/loop}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -181,7 +185,7 @@
|
|||||||
|
|
||||||
{* Adding a new attribute *}
|
{* Adding a new attribute *}
|
||||||
|
|
||||||
{form name="thelia.admin.attribute-value.creation"}
|
{form name="thelia.admin.attributeav.creation"}
|
||||||
|
|
||||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||||
|
|
||||||
@@ -232,7 +236,7 @@
|
|||||||
|
|
||||||
dialog_ok_label = {intl l="Create this value"}
|
dialog_ok_label = {intl l="Create this value"}
|
||||||
|
|
||||||
form_action = {url path='/admin/configuration/attributes-av'}
|
form_action = {url path='/admin/configuration/attributes-av/create'}
|
||||||
form_enctype = {form_enctype form=$form}
|
form_enctype = {form_enctype form=$form}
|
||||||
form_error_message = $form_error_message
|
form_error_message = $form_error_message
|
||||||
}
|
}
|
||||||
@@ -241,7 +245,8 @@
|
|||||||
{* Delete value confirmation dialog *}
|
{* Delete value confirmation dialog *}
|
||||||
|
|
||||||
{capture "delete_dialog"}
|
{capture "delete_dialog"}
|
||||||
<input type="hidden" name="attribute_value_id" id="value_delete_id" value="" />
|
<input type="hidden" name="attribute_id" value="{$attribute_id}" />
|
||||||
|
<input type="hidden" name="attributeav_id" id="value_delete_id" value="" />
|
||||||
{/capture}
|
{/capture}
|
||||||
|
|
||||||
{include
|
{include
|
||||||
@@ -275,7 +280,7 @@
|
|||||||
{include
|
{include
|
||||||
file = "includes/generic-js-dialog.html"
|
file = "includes/generic-js-dialog.html"
|
||||||
dialog_id = "creation_dialog"
|
dialog_id = "creation_dialog"
|
||||||
form_name = "thelia.admin.attribute-value.creation"
|
form_name = "thelia.admin.attributeav.creation"
|
||||||
}
|
}
|
||||||
|
|
||||||
{* Inline editing of object position using bootstrap-editable *}
|
{* Inline editing of object position using bootstrap-editable *}
|
||||||
@@ -288,7 +293,7 @@
|
|||||||
placement : 'left',
|
placement : 'left',
|
||||||
success : function(response, newValue) {
|
success : function(response, newValue) {
|
||||||
// The URL template
|
// The URL template
|
||||||
var url = "{url path='/admin/configuration/attributes/update-value-position' attribute_value_id='__ID__' position='__POS__'}";
|
var url = "{url path='/admin/configuration/attributes-av/update-position' attributeav_id='__ID__' position='__POS__' attribute_id=$attribute_id}";
|
||||||
|
|
||||||
// Perform subtitutions
|
// Perform subtitutions
|
||||||
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
|
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
|
||||||
|
|||||||
Reference in New Issue
Block a user