%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/bbw/farmaci/kritik-portale/public/js/backend/user/
Upload File :
Create Path :
Current File : //var/www/html/bbw/farmaci/kritik-portale/public/js/backend/user/edituser.js

var edituser = {
    options: {
    },
    init: function() {
        $(".edit").unbind("click");
        $(".edit").click(this.openForm);
        $("#add_user").unbind("click");
        $("#add_user").click(this.saveUser);

        $("#remove_user").unbind("click");
        $("#remove_user").click(function(e) {
            $.SmartMessageBox({
                title : "Soll der Benutzer gelöscht werden?",
                content : "Sind Sie sicher?",
                buttons : '[Nein][Ja]'
            }, function(ButtonPressed) {
                if (ButtonPressed === "Ja") {
                    edituser.removeUser();
                }
                if (ButtonPressed === "No") {

                }
            });
            e.preventDefault();
        });

        $("#reset_password").click(function(e) {
            $.SmartMessageBox({
                title : "Soll das Passwort zurückgesetzt werden?",
                content : "Sind Sie sicher?",
                buttons : '[Nein][Ja]'
            }, function(ButtonPressed) {
                if (ButtonPressed === "Ja") {
                    edituser.resetPassword();
                }
                if (ButtonPressed === "No") {

                }
            });
            e.preventDefault();
        });
    },
    openForm: function() {
        var entityId = $(this).attr("data-entityid");
        window.location = "#/backend/user/form/user/" + entityId;
    },
    saveUser: function() {
        var xhr = $.post("/backend/user/save", $("#form_user").serialize(), function(data){
                $('#content').html(data.html);
        }, 'json');
    },
    removeUser: function() {
        var xhr = $.post("/backend/user/removeuser", {'userid': $('[name=id]').val()}, function(data){
            $(location).attr('href',"/backend#/backend/user/usertable");
                   }, 'json');
    },
    resetPassword: function() {
        var xhr = $.post("/login/password/reset", {'email': $('[name=email]').val()}, function(data){
            location.reload();
        }, 'json');
    }
};

$(document).ready(function(){
    modal.init();
    edituser.init();
});

Zerion Mini Shell 1.0