PointRetrait : création et suppression OK, il reste un peu de boulot sur l'enregistrement.
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
<forms>
|
<forms>
|
||||||
<form name="pdr-place-main-update" class="PointRetrait\Form\MainForm"/>
|
<form name="pdr-place-main-update" class="PointRetrait\Form\MainForm"/>
|
||||||
|
<form name="pointretrait.place.create" class="PointRetrait\Form\CreateForm"/>
|
||||||
</forms>
|
</forms>
|
||||||
|
|
||||||
</config>
|
</config>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||||
|
|
||||||
<route id="pointretrait.places.list" path="/admin/module/PointRetrait">
|
<route id="pointretrait.places.list" path="/admin/module/PointRetrait" methods="get">
|
||||||
<default key="_controller">PointRetrait\Controller\backOffice\ListController::viewAction</default>
|
<default key="_controller">PointRetrait\Controller\backOffice\ListController::viewAction</default>
|
||||||
</route>
|
</route>
|
||||||
<route id="pointretrait.toggle.active" path="/admin/module/PointRetrait/toggle-online/{id}" methods="post">
|
<route id="pointretrait.toggle.active" path="/admin/module/PointRetrait/toggle-online/{id}" methods="post">
|
||||||
@@ -19,5 +19,12 @@
|
|||||||
<default key="_controller">PointRetrait\Controller\backOffice\PlaceController::editPlace</default>
|
<default key="_controller">PointRetrait\Controller\backOffice\PlaceController::editPlace</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
<route id="pointretrait.place.create" path="/admin/module/PointRetrait" methods="post">
|
||||||
|
<default key="_controller">PointRetrait\Controller\backOffice\PlaceController::createPlace</default>
|
||||||
|
</route>
|
||||||
|
|
||||||
|
<route id="pointretrait.place.delete" path="/admin/module/PointRetrait/delete" methods="post">
|
||||||
|
<default key="_controller">PointRetrait\Controller\backOffice\PlaceController::deletePlace</default>
|
||||||
|
</route>
|
||||||
|
|
||||||
</routes>
|
</routes>
|
||||||
|
|||||||
@@ -2,14 +2,18 @@
|
|||||||
|
|
||||||
namespace PointRetrait\Controller\backOffice;
|
namespace PointRetrait\Controller\backOffice;
|
||||||
|
|
||||||
|
use PointRetrait\Model\PdrPlaces;
|
||||||
use PointRetrait\Model\PdrPlacesQuery;
|
use PointRetrait\Model\PdrPlacesQuery;
|
||||||
use PointRetrait\PointRetrait;
|
use PointRetrait\PointRetrait;
|
||||||
|
use Propel\Runtime\ActiveQuery\Criteria;
|
||||||
use Propel\Runtime\Map\TableMap;
|
use Propel\Runtime\Map\TableMap;
|
||||||
use Propel\Runtime\Propel;
|
use Propel\Runtime\Propel;
|
||||||
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Thelia\Controller\Admin\BaseAdminController;
|
use Thelia\Controller\Admin\BaseAdminController;
|
||||||
use Thelia\Core\Security\AccessManager;
|
use Thelia\Core\Security\AccessManager;
|
||||||
use Thelia\Core\Security\Resource\AdminResources;
|
use Thelia\Core\Security\Resource\AdminResources;
|
||||||
use Thelia\Form\Exception\FormValidationException;
|
use Thelia\Form\Exception\FormValidationException;
|
||||||
|
use Thelia\Tools\URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PlaceController
|
* Class PlaceController
|
||||||
@@ -62,4 +66,63 @@ class PlaceController extends BaseAdminController
|
|||||||
return $this->render("places-list");
|
return $this->render("places-list");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function createPlace()
|
||||||
|
{
|
||||||
|
// Check current user authorization
|
||||||
|
if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::VIEW))
|
||||||
|
return $response;
|
||||||
|
|
||||||
|
$con = Propel::getConnection();
|
||||||
|
$con->beginTransaction();
|
||||||
|
|
||||||
|
$error_msg = "";
|
||||||
|
$createForm = $this->createForm("pointretrait.place.create", "form");
|
||||||
|
|
||||||
|
try {
|
||||||
|
$form = $this->validateForm($createForm, "POST");
|
||||||
|
$data = $form->getData();
|
||||||
|
|
||||||
|
$newPlace = new PdrPlaces();
|
||||||
|
$newPlace->fromArray($data, TableMap::TYPE_FIELDNAME);
|
||||||
|
$newPlace->save();
|
||||||
|
$con->commit();
|
||||||
|
|
||||||
|
} catch (FormValidationException $ex) {
|
||||||
|
$error_msg = $this->createStandardFormValidationErrorMessage($ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->getRequest()->request->get("success_url") == null) {
|
||||||
|
return new RedirectResponse(URL::getInstance()->absoluteUrl(PointRetrait::MODULE_URL));
|
||||||
|
} else {
|
||||||
|
return new RedirectResponse(URL::getInstance()->absoluteUrl($this->getRequest()->request->get("success_url")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function deletePlace()
|
||||||
|
{
|
||||||
|
// Check current user authorization
|
||||||
|
if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::VIEW))
|
||||||
|
return $response;
|
||||||
|
|
||||||
|
$placeId = $this->getRequest()->get('attr-place-id');
|
||||||
|
$query = PdrPlacesQuery::create()->findById($placeId);
|
||||||
|
if ($query === null)
|
||||||
|
$error_msg = "Place not found by Id";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$con = Propel::getConnection();
|
||||||
|
$con->beginTransaction();
|
||||||
|
$query->delete($con);
|
||||||
|
$con->commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->getRequest()->request->get("success_url") == null) {
|
||||||
|
return new RedirectResponse(URL::getInstance()->absoluteUrl(PointRetrait::MODULE_URL));
|
||||||
|
} else {
|
||||||
|
return new RedirectResponse(URL::getInstance()->absoluteUrl($this->getRequest()->request->get("success_url")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
96
local/modules/PointRetrait/Form/CreateForm.php
Normal file
96
local/modules/PointRetrait/Form/CreateForm.php
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PointRetrait\Form;
|
||||||
|
|
||||||
|
use PointRetrait\PointRetrait;
|
||||||
|
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
||||||
|
use Thelia\Form\BaseForm;
|
||||||
|
use Symfony\Component\Validator\Constraints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class CreateForm
|
||||||
|
* @package PointRetrait\Form
|
||||||
|
*/
|
||||||
|
class CreateForm extends BaseForm
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
protected function buildForm()
|
||||||
|
{
|
||||||
|
$this->formBuilder
|
||||||
|
->add(
|
||||||
|
"title",
|
||||||
|
"text",
|
||||||
|
[
|
||||||
|
"required" => true,
|
||||||
|
"constraints" => [new Constraints\NotBlank()],
|
||||||
|
"label" => $this->translator->trans('Place name', [], PointRetrait::DOMAIN_NAME),
|
||||||
|
"label_attr" => ['for' => 'title']
|
||||||
|
])
|
||||||
|
->add(
|
||||||
|
"price",
|
||||||
|
"number",
|
||||||
|
[
|
||||||
|
"required" => true,
|
||||||
|
"constraints" => [new GreaterThanOrEqual(["value" => 0])],
|
||||||
|
"label" => $this->translator->trans('Withdrawal price', [], PointRetrait::DOMAIN_NAME),
|
||||||
|
"label_attr" => ['for' => 'price']
|
||||||
|
])
|
||||||
|
->add(
|
||||||
|
"minimum_amount",
|
||||||
|
"number",
|
||||||
|
[
|
||||||
|
"required" => true,
|
||||||
|
"constraints" => [new GreaterThanOrEqual(["value" => 0])],
|
||||||
|
"label" => $this->translator->trans('Minimum amount', [], PointRetrait::DOMAIN_NAME),
|
||||||
|
"label_attr" => ['for' => 'minimum_amount']
|
||||||
|
])
|
||||||
|
->add(
|
||||||
|
"address1","text",
|
||||||
|
[
|
||||||
|
"required" => true,
|
||||||
|
"constraints" => [new Constraints\NotBlank()],
|
||||||
|
"label" => $this->translator->trans('Address1', [], PointRetrait::DOMAIN_NAME),
|
||||||
|
"label_attr" => ['for' => 'address1']
|
||||||
|
])
|
||||||
|
->add(
|
||||||
|
"address2","text",
|
||||||
|
[
|
||||||
|
"required" => false,
|
||||||
|
"label" => $this->translator->trans('Address2', [], PointRetrait::DOMAIN_NAME),
|
||||||
|
"label_attr" => ['for' => 'address2']
|
||||||
|
])
|
||||||
|
->add(
|
||||||
|
"zipcode","text",
|
||||||
|
[
|
||||||
|
"required" => true,
|
||||||
|
"constraints" => [new Constraints\NotBlank()],
|
||||||
|
"label" => $this->translator->trans('Zipcode', [], PointRetrait::DOMAIN_NAME),
|
||||||
|
"label_attr" => ['for' => 'zipcode']
|
||||||
|
])
|
||||||
|
->add(
|
||||||
|
"city","text",
|
||||||
|
[
|
||||||
|
"required" => true,
|
||||||
|
"constraints" => [new Constraints\NotBlank()],
|
||||||
|
"label" => $this->translator->trans('City', [], PointRetrait::DOMAIN_NAME),
|
||||||
|
"label_attr" => ['for' => 'city']
|
||||||
|
])
|
||||||
|
->add(
|
||||||
|
"active",
|
||||||
|
"number",
|
||||||
|
[
|
||||||
|
"required" => true
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return "place_create";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,24 +6,28 @@ return array(
|
|||||||
'Address1' => 'Adresse',
|
'Address1' => 'Adresse',
|
||||||
'Address2' => 'Complément d\'adresse',
|
'Address2' => 'Complément d\'adresse',
|
||||||
'City' => 'Commune',
|
'City' => 'Commune',
|
||||||
|
'Create a new place' => 'Créer un nouveau point de retrait',
|
||||||
|
'Do you really want to remove this place ?' => 'Voulez-vous réellement supprimer ce point de retrait ?',
|
||||||
|
'Delete a place' => 'Supprimer un point de retrait',
|
||||||
'Delivery delay' => 'Délai avant retrait',
|
'Delivery delay' => 'Délai avant retrait',
|
||||||
'Edit a place' => 'Modifier un lieu de retrait',
|
'Edit a place' => 'Modifier un lieu de retrait',
|
||||||
'Location set' => 'Coordonnées GPS présentes ?',
|
'Location set' => 'Coordonnées GPS présentes ?',
|
||||||
'Main' => 'Généralités',
|
'Main' => 'Généralités',
|
||||||
'Message no location' => 'Ce point de retrait ne possède pas de coordonnées GPS : il est conseillé de localiser l\'adresse, pour les clients',
|
'Message no location' => 'Ce point de retrait ne possède pas de coordonnées GPS : pour vos clients, il est conseillé de géolocaliser l\'adresse.',
|
||||||
'Minimum amount' => 'Minimum de commande',
|
'Minimum amount' => 'Minimum de commande',
|
||||||
'Module name' => 'Point de Retrait AuxBieauxLegumes',
|
'Module name' => 'Point de Retrait AuxBieauxLegumes',
|
||||||
'My places' => 'Point de retrait AuxBieauxLegumes',
|
'My places' => 'Point de retrait AuxBieauxLegumes',
|
||||||
'My withdrawal places' => 'Mes points de retrait AuxBieauxLegumes',
|
'My withdrawal places' => 'Mes points de retrait AuxBieauxLegumes',
|
||||||
'Order number' => 'N° de commande',
|
'Order number' => 'N° de commande',
|
||||||
'Place' => 'Point de retrait',
|
'Place name' => 'Nom du point de retrait',
|
||||||
'Recenter map' => 'Recentrer la carte sur l\'adresse',
|
'Recenter map' => 'Géolocaliser l\'adresse',
|
||||||
'Revert origin position' => 'Revenir à la position d\'origine',
|
'Revert origin position' => 'Revenir à la position d\'origine',
|
||||||
'Schedule' => 'Horaires de retrait',
|
'Schedule' => 'Horaires de retrait',
|
||||||
'Scheduled date' => 'Date de retrait prévue',
|
'Scheduled date' => 'Date de retrait prévue',
|
||||||
'Scheduled withdrawals' => 'Commandes à retirer en Point Retrait',
|
'Scheduled withdrawals' => 'Commandes à retirer en Point Retrait',
|
||||||
'Title of config view' => 'Point retrait AuxBieauxLegumes - Configuration',
|
'Title of config view' => 'Point retrait AuxBieauxLegumes - Configuration',
|
||||||
'There is no order to withdraw' => 'Aucune commande à retirer en Point Retrait',
|
'There is no order to withdraw' => 'Aucune commande à retirer en Point Retrait',
|
||||||
|
'There is no schedule for this place' => 'Aucun créneau de retrait sur ce point de retrait',
|
||||||
'Withdrawal days' => 'Jours de retrait',
|
'Withdrawal days' => 'Jours de retrait',
|
||||||
'Withdrawal price' => 'Coût du retrait',
|
'Withdrawal price' => 'Coût du retrait',
|
||||||
'Zipcode' => 'Code postal',
|
'Zipcode' => 'Code postal',
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class PointRetrait extends AbstractDeliveryModule
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
const DOMAIN_NAME = 'pointretrait';
|
const DOMAIN_NAME = 'pointretrait';
|
||||||
const MESSAGE_DOMAIN = 'pointretrait';
|
const MESSAGE_DOMAIN = 'pointretrait';
|
||||||
|
const MODULE_URL = '/admin/module/PointRetrait';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
{form name=$form_name}
|
||||||
|
{form_hidden_fields form=$form}
|
||||||
|
|
||||||
|
{render_form_field form=$form field="success_url" value={$success_url|default:{url path='/admin/module/PointRetrait'}}}
|
||||||
|
|
||||||
|
{form_field form=$form field="title"}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
|
{intl l=$label d="pointretrait"}
|
||||||
|
{if $required}<span class="required">*</span>{/if}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
{form_error form=$form field="title"}{$message}{/form_error}
|
||||||
|
<input type="text" class="form-control" name="{$name}" id="{$label_attr.for}" {if $required}required{/if} />
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field="price"}
|
||||||
|
<div class="form-group form-inline">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
|
{intl l=$label d="pointretrait"}
|
||||||
|
{if $required}<span class="required">*</span>{/if}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" {if $required}required{/if} /> €
|
||||||
|
</div>
|
||||||
|
{form_error form=$form field="price"}{$message}{/form_error}
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field="minimum_amount"}
|
||||||
|
<div class="form-group form-inline">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
|
{intl l=$label d="pointretrait"}
|
||||||
|
{if $required}<span class="required">*</span>{/if}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" {if $required}required{/if} /> €
|
||||||
|
</div>
|
||||||
|
{form_error form=$form field="minimum_amount"}{$message}{/form_error}
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field="address1"}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
|
{intl l=$label d="pointretrait"}
|
||||||
|
{if $required}<span class="required">*</span>{/if}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="control-input">
|
||||||
|
<input type="text" id="{$label_attr.for}" class="form-control" name="{$name}" maxlength="100" {if $required}required{/if} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{form_error form=$form field="address1"}{$message}{/form_error}
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field="address2"}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
|
{intl l=$label d="pointretrait"}
|
||||||
|
{if $required}<span class="required">*</span>{/if}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="control-input">
|
||||||
|
<input type="text" id="{$label_attr.for}" class="form-control" name="{$name}" maxlength="100" {if $required}required{/if} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{form_error form=$form field="address2"}{$message}{/form_error}
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field="zipcode"}
|
||||||
|
<div class="form-group form-inline">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
|
{intl l=$label d="pointretrait"}
|
||||||
|
{if $required}<span class="required">*</span>{/if}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="control-input">
|
||||||
|
<input type="text" id="{$label_attr.for}" class="form-control" name="{$name}" maxlength="10" {if $required}required{/if} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{form_error form=$form field="zipcode"}{$message}{/form_error}
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field="city"}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">
|
||||||
|
{intl l=$label d="pointretrait"}
|
||||||
|
{if $required}<span class="required">*</span>{/if}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="control-input">
|
||||||
|
<input type="text" id="{$label_attr.for}" class="form-control" name="{$name}" maxlength="100" {if $required}required{/if} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{form_error form=$form field="city"}{$message}{/form_error}
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field="active"}
|
||||||
|
<input type="hidden" id="{$label_attr.for}" name="{$name}" value="1"/>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{/form}
|
||||||
@@ -28,7 +28,7 @@ mais{extends file="admin-layout.tpl"}
|
|||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{intl l="Place" d='pointretrait'}</th>
|
<th>{intl l="Place name" d='pointretrait'}</th>
|
||||||
<th class="col-md-1">{intl l="Active" d='pointretrait'}</th>
|
<th class="col-md-1">{intl l="Active" d='pointretrait'}</th>
|
||||||
<th>{intl l="Address" d='pointretrait'}</th>
|
<th>{intl l="Address" d='pointretrait'}</th>
|
||||||
<th>{intl l="Withdrawal days" d='pointretrait'}</th>
|
<th>{intl l="Withdrawal days" d='pointretrait'}</th>
|
||||||
@@ -38,10 +38,22 @@ mais{extends file="admin-layout.tpl"}
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
<caption class="clearfix">
|
||||||
|
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.pdr.main" access="CREATE" module="PointRetrait"}
|
||||||
|
<div class="pull-right">
|
||||||
|
<a class="btn btn-default btn-primary"
|
||||||
|
title="{intl l='Add a new place' d='pointretrait'}"
|
||||||
|
data-target="#place-create-modal" data-toggle="modal">
|
||||||
|
<i class="glyphicon glyphicon-plus-sign"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{/loop}
|
||||||
|
</caption>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{loop name="places" type="pdr_places"}
|
{loop name="places" type="pdr_places"}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{url path='/admin/module/PointRetrait/edit' place_id=$ID}">{$TITLE}</a></td>
|
<td><a href="{url path="/admin/module/PointRetrait/edit?place_id=$ID"}">{$TITLE}</a></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="make-switch switch-small toggle-visible" data-id="{$ID}" data-on="success"
|
<div class="make-switch switch-small toggle-visible" data-id="{$ID}" data-on="success"
|
||||||
data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>"
|
data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>"
|
||||||
@@ -55,7 +67,7 @@ mais{extends file="admin-layout.tpl"}
|
|||||||
<td>{$MINIMUM_AMOUNT} €</td>
|
<td>{$MINIMUM_AMOUNT} €</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
<a class="btn btn-info btn-responsive" title="{intl l='Edit this place'}" href="{url path='/admin/module/PointRetrait/edit' place_id=$ID}">
|
<a class="btn btn-info btn-responsive" title="{intl l='Edit this place'}" href="{url path="/admin/module/PointRetrait/edit?place_id=$ID"}">
|
||||||
<i class="glyphicon glyphicon-edit"></i>
|
<i class="glyphicon glyphicon-edit"></i>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-danger btn-responsive place-delete" title="{intl l='Delete this place'}" data-target="#place-delete" data-toggle="modal" data-id="{$ID}">
|
<a class="btn btn-danger btn-responsive place-delete" title="{intl l='Delete this place'}" data-target="#place-delete" data-toggle="modal" data-id="{$ID}">
|
||||||
@@ -71,6 +83,40 @@ mais{extends file="admin-layout.tpl"}
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{* CREATE Modal *}
|
||||||
|
{form name="pointretrait.place.create"}
|
||||||
|
{capture "place_create"}
|
||||||
|
{include file="form/place-create.html" form_name="pointretrait.place.create"}
|
||||||
|
{/capture}
|
||||||
|
|
||||||
|
{include file="includes/generic-create-dialog.html"
|
||||||
|
dialog_id = "place-create-modal"
|
||||||
|
dialog_title = {intl l="Create a new place" d="pointretrait"}
|
||||||
|
dialog_body = {$smarty.capture.place_create nofilter}
|
||||||
|
dialog_ok_label = {intl l="Create"}
|
||||||
|
dialog_cancel_label = {intl l="Cancel"}
|
||||||
|
form_action = {$current_url}
|
||||||
|
form_enctype = {form_enctype form=$form}
|
||||||
|
}
|
||||||
|
{/form}
|
||||||
|
|
||||||
|
{* DELETE modal *}
|
||||||
|
{capture "place_delete"}
|
||||||
|
{intl l="Do you really want to remove this place ?" d="pointretrait"}
|
||||||
|
<input type="hidden" name="attr-place-id" id="attr-place-id" value="999"/>
|
||||||
|
<input type="hidden" name="success_url" value="{url path='/admin/module/PointRetrait'}"/>
|
||||||
|
{/capture}
|
||||||
|
|
||||||
|
{include file="includes/generic-confirm-dialog.html"
|
||||||
|
dialog_id = "place-delete"
|
||||||
|
dialog_title = {intl l="Delete a place" d="pointretrait"}
|
||||||
|
dialog_message = {$smarty.capture.place_delete nofilter}
|
||||||
|
dialog_ok_label = {intl l="Delete"}
|
||||||
|
dialog_cancel_label = {intl l="Cancel"}
|
||||||
|
form_action = {token_url path='/admin/module/PointRetrait/delete'}
|
||||||
|
}
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="javascript-initialization"}
|
{block name="javascript-initialization"}
|
||||||
@@ -78,8 +124,8 @@ mais{extends file="admin-layout.tpl"}
|
|||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$('a.area-delete').click(function(ev) {
|
$('a.place-delete').click(function(ev) {
|
||||||
$('#area_delete_id').val($(this).data('id'));
|
$('#attr-place-id').val($(this).data('id'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".toggle-visible").on('switch-change', function (event, data) {
|
$(".toggle-visible").on('switch-change', function (event, data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user