modifié : SRC/app/Http/Controllers/ReferentController.php
modifié : SRC/public/js/ListeOeuvre.js modifié : SRC/resources/views/referent.blade.php
This commit is contained in:
parent
4fac5f8726
commit
1ecdc1b3ff
@ -97,14 +97,15 @@ class ReferentController extends Controller {
|
||||
|
||||
public function setListOeuvres ()
|
||||
{
|
||||
|
||||
$idListeOeuvre = Input::get('idListeOeuvre');
|
||||
$idconcats = Input::get('oeuvres');
|
||||
$list_oeuvres_id = explode("-", $idconcats);
|
||||
|
||||
|
||||
$ListeOeuvre = ListeOeuvre::find($idListeOeuvre);
|
||||
$ListeOeuvre->oeuvres()->detach();
|
||||
$ListeOeuvre->oeuvres()->attach($list_oeuvres_id);
|
||||
return Response::json(array('sucess' => 'true', ));
|
||||
return Response::json(array());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,16 +28,18 @@ $('.listeoeuvre').click(function() {
|
||||
|
||||
//Enregistrement d'une liste d'ouevre
|
||||
$('#enregistrer').click(function() {
|
||||
url = "/setListOeuvres/" + $(this).children('.idListeOeuvre').val();
|
||||
dataSend = { idListeOeuvre : 1,
|
||||
url = "setListOeuvres";
|
||||
dataSend = {
|
||||
_token : $('#_token').val(),
|
||||
idListeOeuvre : "1",
|
||||
oeuvres : "1-2-3-4"};
|
||||
$.post(url,
|
||||
dataSend,
|
||||
function( data ) {
|
||||
;
|
||||
})
|
||||
}, "json")
|
||||
.done(function() {
|
||||
$("#oeuvrePic").append('<div class="alert alert-sucess">'
|
||||
$("#oeuvrePic").append('<div class="alert alert-success">'
|
||||
+'<ul>'
|
||||
+'<li>Sauvegarde validée</li>'
|
||||
+'</ul>'
|
||||
|
@ -24,7 +24,7 @@
|
||||
<form method="POST" role="form" action="deleteListeOeuvre">
|
||||
<input type="hidden" name="idUser" value="{{ $me->id }}">
|
||||
<input type="hidden" class="idListeOeuvre" name="idListeOeuvre" value="{{ $listeoeuvre->id }}">
|
||||
<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
|
||||
<input type="hidden" name="_token" id="_token" value="{{{ csrf_token() }}}" />
|
||||
<td>{{$listeoeuvre->nom}}</td>
|
||||
<td><button type="submit" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user