Skip to content

Commit

Permalink
Dev configuration du parking :
Browse files Browse the repository at this point in the history
- Ajout d'un display_name React à la map du parking (facilite le debug)
- Prise en compte de l'id parking et niveau pour la création de la map
- Modif de l'url de la requête AJAX de récup des infos parking pour pointer vers la nouvelle ressource niveau

Dev model de données :
- Création des modèles Eloquent correspondant aux tables utilisés pour la configuration
- Ajout des relations ORM entre ces tables
- Création des controllers pour ces modèles
- Création des ressources REST (routes) pour ces modèles

Principe de filtre sur les droits d'un parking:
- Toutes les ressources situés sous la table parking dans l'arborescence de la base de données doivent être filtrées pour bloquer des tentatives sur un parking interdit.
- Pour cela, il faut :
    - déclarer les Routes de ces ressources dans le groupe de route adapté
    - Développer le filtre auth.parking pour remonter jusqu'au parking en fonction de la ressource et des paramètres
    - Autoriser ou non l'aboutissement de la requête
  • Loading branch information
YannPl committed Mar 27, 2015
1 parent 00f0fb9 commit 7ede00d
Show file tree
Hide file tree
Showing 21 changed files with 774 additions and 51 deletions.
2 changes: 2 additions & 0 deletions app/assets/js/mods/composants/maps/admin_parking_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ var Button = ReactB.Button;
* @param calibre : nombre de cm/deg sur cette carte
*/
var parkingMap = React.createClass({
displayName: 'admin_parking_map',

mixins: [Reflux.ListenerMixin, ReactB.OverlayMixin],
/**
* Définition du type des props du composant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var Page = React.createClass({
// Affiche la carte
_carte: function () {
var url = BASE_URI + 'public/images/test_carte_bis_2.svg';
return <AdminMap imgUrl={url} divId="div_carte"/>;
return <AdminMap imgUrl={url} divId="div_carte" parkingId={1} niveauId={1}/>;
},

render: function () {
Expand Down
7 changes: 2 additions & 5 deletions app/assets/js/mods/stores/admin_parking_map_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,16 @@ var store = Reflux.createStore({
onMap_initialized: function (map, calibre, parkingInfos) {

console.log('Calibre au niveau du store : ' + calibre);
console.log('Infos du parking au niveau du store : %o', parkingInfos);
this._inst.calibre = calibre;

// Récupération en BDD des données du parking sélectionné
$.ajax({
method: 'GET',
url: BASE_URI + 'configuration_parking/infos_parking/' + parkingInfos.parkingId, /* TODO */
url: BASE_URI + 'niveau/' + parkingInfos.niveauId, /* TODO */
dataType: 'json',
context: this,
async: true,
data: {
parkingId: parkingInfos.parkingId,
niveauId: parkingInfos.niveauId
},
success: function (data) {
console.log('Retour AJAX init map : %o', data);
},
Expand Down
86 changes: 86 additions & 0 deletions app/controllers/AfficheursController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

class AfficheursController extends \BaseController {

/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
}


/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
}


/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
}


/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}


/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}


/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}


/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}


}
86 changes: 86 additions & 0 deletions app/controllers/AlleesController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

class AlleesController extends \BaseController {

/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
}


/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
}


/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
}


/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}


/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}


/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}


/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}


}
86 changes: 86 additions & 0 deletions app/controllers/CapteursController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

class CapteursController extends \BaseController {

/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
}


/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
}


/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
}


/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}


/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}


/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}


/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}


}
2 changes: 1 addition & 1 deletion app/controllers/ConfigurationParkingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function destroy($id)
*/
public function parkingInfos($id)
{
return array('test' => 'Infos parking');
return Parking::find($id);
}


Expand Down
86 changes: 86 additions & 0 deletions app/controllers/NiveauxController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

class NiveauxController extends \BaseController {

/**
* Display a listing of the resource.
* GET /niveaus
*
* @return Response
*/
public function index()
{
//
}

/**
* Show the form for creating a new resource.
* GET /niveaus/create
*
* @return Response
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
* POST /niveaus
*
* @return Response
*/
public function store()
{
//
}

/**
* Display the specified resource.
* GET /niveaus/{id}
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}

/**
* Show the form for editing the specified resource.
* GET /niveaus/{id}/edit
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}

/**
* Update the specified resource in storage.
* PUT /niveaus/{id}
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}

/**
* Remove the specified resource from storage.
* DELETE /niveaus/{id}
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}

}

0 comments on commit 7ede00d

Please sign in to comment.