var DetailsCtrl = function (FilmSvc, $state, $ionicModal, $scope, $ionicPopup) {
    this.film = FilmSvc.getDetailsFilm($state.params.idFilm);
    $scope.film = this.film;

    $ionicModal.fromTemplateUrl('templates/planning-film-modal.html', {
        scope: $scope
    }).then(function (modal) {
        $scope.modal = modal;
    });

    this.ouvrirModalPlanification = function () {
        $scope.modal.show();
    };

    $scope.enregistrerPlanification = function () {
        // Traitement métier à implémenter
        $scope.modal.hide();
    };

    $scope.fermerModale = function () {
        $scope.modal.hide();
    };

    $scope.$on('$destroy', function () {
        $scope.modal.remove();
    });

    this.ajouterFavoris = function() {
		$ionicPopup.confirm({
                	title: "Ajouter aux favoris",
                	template: "Ajouter ce film aux favoris ?",
                	okText: "Oui",
                	cancelText: "Non"
		})
		.then(function(result) {
			if (result) {
                		console.log("Ajouté aux favoris");
			}
		});
	};
};