show route of now
This commit is contained in:
parent
54d0dc1de7
commit
494b732fca
@ -9,42 +9,80 @@
|
||||
<div id="menu-dashboard">
|
||||
<ul class="nav nav-pills">
|
||||
<li>
|
||||
<a class="btn btn-default" href="{{ path('homepage') }}" title="accueil Caisse">
|
||||
<i class="fa fa-circle-o-notch fa-2x"></i>
|
||||
<a class="btn {% if app.request.attributes.get('_route') == 'homepage' %}
|
||||
btn-success
|
||||
{% else %}
|
||||
btn-default
|
||||
{% endif %}" href="{{ path('homepage') }}" title="accueil Caisse">
|
||||
<i class="fa fa-circle-o-notch "></i>
|
||||
{#(route actuelle: {{ app.request.attributes.get('_route') }})#}
|
||||
</a>
|
||||
<li>
|
||||
<li>
|
||||
<a class="btn btn-default" href="{{ path('dashboard') }}">
|
||||
<a class="btn {% if app.request.attributes.get('_route') == 'dashboard' %}
|
||||
btn-success
|
||||
{% else %}
|
||||
btn-default
|
||||
{% endif %}" href="{{ path('dashboard') }}">
|
||||
<i class="fa fa-list"></i>
|
||||
Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-default" href="{{ path('productcategory_index') }}">
|
||||
<a class="btn {% if app.request.attributes.get('_route') == 'productcategory_index' %}
|
||||
btn-success
|
||||
{% else %}
|
||||
btn-default
|
||||
{% endif %}" href="{{ path('productcategory_index') }}">
|
||||
<i class="fa fa-file-archive-o"></i>
|
||||
Catégories
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-default" href="{{ path('product_index') }}" data-toggle="tab">
|
||||
<a class="btn {% if app.request.attributes.get('_route') == 'product_index' %}
|
||||
btn-success
|
||||
{% else %}
|
||||
btn-default
|
||||
{% endif %}" href="{{ path('product_index') }}" data-toggle="tab">
|
||||
<i class="fa fa-gears"></i>
|
||||
Produits
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-default" href="{{ path('festival_index') }}"
|
||||
<a class="btn {% if app.request.attributes.get('_route') == 'festival_index' %}
|
||||
btn-success
|
||||
{% else %}
|
||||
btn-default
|
||||
{% endif %}" href="{{ path('festival_index') }}"
|
||||
data-toggle="tab">
|
||||
<i class="fa fa-th-large"></i>
|
||||
Festivals
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-default" href="{{ path('history') }}"
|
||||
<a class="btn {% if app.request.attributes.get('_route') == 'history' %}
|
||||
btn-success
|
||||
{% else %}
|
||||
btn-default
|
||||
{% endif %}" href="{{ path('history') }}"
|
||||
data-toggle="tab">
|
||||
<i class="fa fa-clock"></i>
|
||||
<i class="fa fa-clock-o"></i>
|
||||
Historique
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<a class="btn {% if app.request.attributes.get('_route') == 'import' %}
|
||||
btn-success
|
||||
{% else %}
|
||||
btn-default
|
||||
{% endif %}" href="{{ path('import') }}"
|
||||
data-toggle="tab">
|
||||
<i class="fa fa-arrow-circle-o-up"></i>
|
||||
Import
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
64
app/Resources/views/logged/import.html.twig
Normal file
64
app/Resources/views/logged/import.html.twig
Normal file
@ -0,0 +1,64 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
{% block body %}
|
||||
<h1>Importation, création en masse</h1>
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i>
|
||||
Fonctionnalité en cours de création
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 well">
|
||||
<h2>
|
||||
Création de produits en masse
|
||||
</h2>
|
||||
|
||||
<form action="{{ path('mass_create') }}" method="post">
|
||||
<label for="produits">
|
||||
Créez vos produits et leur catégorie en masse, un par ligne
|
||||
</label>
|
||||
<blockquote>
|
||||
<strong>Vous pouvez copier et adapter cet exemple: </strong>
|
||||
<pre>
|
||||
catégorie: livre
|
||||
mon livre 1;5€
|
||||
mon livre 2;6€
|
||||
mon livre 2;7€
|
||||
catégorie: poster
|
||||
super bannière A2;10€
|
||||
catégorie: dessin à la demande
|
||||
dessin;20€
|
||||
</pre>
|
||||
</blockquote>
|
||||
<textarea name="produits" id="produits" cols="30" rows="10" placeholder="catégorie et produits">
|
||||
|
||||
</textarea>
|
||||
<input class="btn btn-primary btn-block" type="submit" value="créer en masse">
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-6 well">
|
||||
<h2>
|
||||
|
||||
Importer votre historique de ventes
|
||||
</h2>
|
||||
1)
|
||||
<a class="btn btn-success" href="{{ asset('modele_import_caisse.csv') }}">
|
||||
<i class="fa fa-file-o fa-3x"></i>
|
||||
Télécharger le fichier de modèle
|
||||
</a>
|
||||
<hr>
|
||||
2) Remplir votre modèle avec vos ventes
|
||||
<hr>
|
||||
3)
|
||||
<form action="{{ path('import') }}" method="post">
|
||||
<fieldset>
|
||||
|
||||
Importer votre modèle rempli
|
||||
<input type="file" name="fichier_import">
|
||||
<input class="btn btn-primary btn-block" type="submit" value="importer votre historique">
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -363,4 +363,34 @@ class DefaultController extends Controller {
|
||||
// replace this example code with whatever you need
|
||||
return $this->redirectToRoute( 'dashboard' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/import", name="import")
|
||||
*/
|
||||
public function importAction() {
|
||||
$currentUser = $this->getUser();
|
||||
$m = $this->getDoctrine()->getManager();
|
||||
$sellingRepo = $m->getRepository( 'AppBundle:SellRecord' );
|
||||
$mySellings = $sellingRepo->findByUser( $currentUser->getId() );
|
||||
|
||||
return $this->render( 'logged/import.html.twig',
|
||||
[
|
||||
'base_dir' => '',
|
||||
] );
|
||||
}
|
||||
/**
|
||||
* @Route("/mass-create", name="mass_create")
|
||||
*/
|
||||
public function massCreateAction() {
|
||||
$currentUser = $this->getUser();
|
||||
$m = $this->getDoctrine()->getManager();
|
||||
$sellingRepo = $m->getRepository( 'AppBundle:SellRecord' );
|
||||
$mySellings = $sellingRepo->findByUser( $currentUser->getId() );
|
||||
|
||||
return $this->render( 'logged/import.html.twig',
|
||||
[
|
||||
'base_dir' => '',
|
||||
] );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class Product {
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=256)
|
||||
* @ORM\Column(type="string", length=256, nullable=true)
|
||||
*/
|
||||
private $image;
|
||||
|
||||
|
@ -17,6 +17,11 @@ class SellRecord {
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
/**
|
||||
* gender of the client
|
||||
* @ORM\Column( type = "string", nullable=true )
|
||||
*/
|
||||
private $gender;
|
||||
/**
|
||||
* liste des produits de la vente
|
||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductSold", mappedBy="sellRecords")
|
||||
@ -215,4 +220,28 @@ class SellRecord {
|
||||
public function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set gender.
|
||||
*
|
||||
* @param string|null $gender
|
||||
*
|
||||
* @return SellRecord
|
||||
*/
|
||||
public function setGender($gender = null)
|
||||
{
|
||||
$this->gender = $gender;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get gender.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getGender()
|
||||
{
|
||||
return $this->gender;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,11 @@ class SellRecord {
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
/**
|
||||
* gender of the client
|
||||
* @ORM\Column( type = "string", nullable=true )
|
||||
*/
|
||||
private $gender;
|
||||
/**
|
||||
* liste des produits de la vente
|
||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductSold", mappedBy="sellRecords")
|
||||
|
@ -283,4 +283,26 @@ class User extends BaseUser {
|
||||
public function getFestivals() {
|
||||
return $this->festivals;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set activeFestival.
|
||||
*
|
||||
* @param \AppBundle\Entity\Festival|null $activeFestival
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function setActiveFestival( \AppBundle\Entity\Festival $activeFestival = null ) {
|
||||
$this->activeFestival = $activeFestival;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get activeFestival.
|
||||
*
|
||||
* @return \AppBundle\Entity\Festival|null
|
||||
*/
|
||||
public function getActiveFestival() {
|
||||
return $this->activeFestival;
|
||||
}
|
||||
}
|
||||
|
1
web/.~lock.modele_import_caisse.csv#
Normal file
1
web/.~lock.modele_import_caisse.csv#
Normal file
@ -0,0 +1 @@
|
||||
,tykayn,ubuntu-P775DM3-G,19.04.2018 11:02,file:///home/tykayn/.config/libreoffice/4;
|
0
web/modele_import_caisse.csv
Normal file
0
web/modele_import_caisse.csv
Normal file
|
Loading…
Reference in New Issue
Block a user