diff --git a/SRC/app/Http/Controllers/ReferentController.php b/SRC/app/Http/Controllers/ReferentController.php index 7d827ce..e7937af 100755 --- a/SRC/app/Http/Controllers/ReferentController.php +++ b/SRC/app/Http/Controllers/ReferentController.php @@ -161,7 +161,13 @@ class ReferentController extends Controller { } public function addItemsToList() { - ; + + $idListeOeuvre = Session::get('listeoeuvre_current'); + $ListeOeuvre = ListeOeuvre::find($idListeOeuvre); + + $oeuvresToAdd = Input::get('oeuvres'); + $ListeOeuvre->oeuvres()->attach($oeuvresToAdd); + return Response::json(array()); } public function updateAssoGames() { diff --git a/SRC/public/js/ListeOeuvre.js b/SRC/public/js/ListeOeuvre.js index 398b6a6..70d65a4 100755 --- a/SRC/public/js/ListeOeuvre.js +++ b/SRC/public/js/ListeOeuvre.js @@ -123,6 +123,34 @@ $('#removeFromSelection').click(function() { +// Add to my favorites list +$('#addIntoMyList').click(function() { + + url = "addItemsToList"; + dataSend = { + _token : $('#_tokenRes').val(), + oeuvres : $('#my_researches').val()}; + $.post(url, + dataSend, + function( data ) { + ; + }, "json") + .done(function() { + $('#oeuvreRes').empty(); + }) + .fail(function() { + $("#oeuvreRes").append('
' + +'Oouups! Il y a un problème.

' + +'' + +'
' + ); + }); +}); + + + // Afficher résultat de recherche d'oeuvre $('#search_button, #previous, #next').click(function(event) { event.preventDefault(); diff --git a/SRC/resources/views/referent.blade.php b/SRC/resources/views/referent.blade.php index e101809..d72905e 100755 --- a/SRC/resources/views/referent.blade.php +++ b/SRC/resources/views/referent.blade.php @@ -168,10 +168,11 @@ Résultat de ma recherche Sélectionner tout -- Annuler sélection
-
- - - +
+
+ +
+
-