diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index 92f9cca8..4ea21e68 100755 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -21,6 +21,7 @@ {% include 'default/header.html.twig' %} {% block body %} {% endblock %} + {% include 'default/footer.html.twig' %} {% block javascripts %} diff --git a/app/Resources/views/default/index.html.twig b/app/Resources/views/default/index.html.twig index f520e5c4..fe139d66 100755 --- a/app/Resources/views/default/index.html.twig +++ b/app/Resources/views/default/index.html.twig @@ -13,5 +13,4 @@ - {% include 'default/footer.html.twig' %} {% endblock %} diff --git a/app/Resources/views/default/login-choices.html.twig b/app/Resources/views/default/login-choices.html.twig index ca4a7642..06c89a44 100755 --- a/app/Resources/views/default/login-choices.html.twig +++ b/app/Resources/views/default/login-choices.html.twig @@ -74,7 +74,6 @@ Historique -
' . nl2br( $massLines . '' ) ); + $lines = preg_split( '/$\R?^/m', trim( $massLines ) ); + var_dump( count( $lines ) ); + foreach ( $lines as $line ) { - var_dump( nl2br($request->request->get( 'produits' )) ); + if ( strpos( $line,':' ) ) { + // manage catgegories + $boom = explode( ':', trim( $line ) ); + $firstPart = $boom[ 0 ]; + $value = $boom[ 1 ]; + echo "gérer une catégorie nommée: $value"; + if ( $firstPart === 'catégorie' && $value ) { + // look for category by name + if ( ! isset( $myCategoriesByName[ $value ] ) ) { + $newCateg = new ProductCategory(); + $newCateg + ->addUser( $currentUser ) + ->setName( $value ); + $currentUser->addCategory( $newCateg ); + $m->persist( $newCateg ); + $currentCategory = $newCateg; // associate further categories with the newly created one + }else{ + echo " la catégorie existe déjà"; + } + } + } else { + // manage product + echo "