Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 5b4bc51b

Přidáno uživatelem Ondřej Anděl před více než 3 roky(ů)

bugfix: email removal

Zobrazit rozdíly:

application/view/modals/editUserModal.html
23 23
                            <input type="password" class="min-wdth" id="password"/>
24 24
                        </div>
25 25
                    </div>
26
                    <div class="row my-1">
27
                        <div class="col-xs-12 col-sm-4">
28
                            <label for="email">Email:  <b class="required">*</b></label>
29
                        </div>
30
                        <div class="col-xs-12 col-sm-8">
31
                            <input class="min-wdth" id="email"/>
32
                        </div>
33
                    </div>
34 26
                    <div class="row my-1">
35 27
                        <div class="col-xs-12 col-sm-4">
36 28
                            <label for="rights">Práva:  <b class="required">*</b></label>
......
70 62
            modal.find('#submit-but').click(() => createData(modal));
71 63

  
72 64
            enableSubmit(modal, true);
73
            modal.find("#email").change(() => enableSubmit(modal, true));
74 65
            modal.find("#rights").change(() => enableSubmit(modal, true));
75 66
            modal.find("#username").change(() => enableSubmit(modal, true));
76 67
        } else {
......
82 73
            prefill(modal, data_obj);
83 74

  
84 75
            enableSubmit(modal, false);
85
            modal.find("#email").change(() => enableSubmit(modal, true));
86 76
            modal.find("#rights").change(() => enableSubmit(modal, true));
87 77
            modal.find("#username").change(() => enableSubmit(modal, true));
88 78
        }
......
90 80

  
91 81
    function enableSubmit(modal, createNew){
92 82
        if(
93
            modal.find("#email")[0].value === "" ||
94 83
            modal.find("#rights")[0].value === "" ||
95 84
            (modal.find("#username")[0].value === "" && !createNew)
96 85
        ){
......
103 92
    function prefill(modal, data = null){
104 93
        modal.find("#username").val("");
105 94
        modal.find("#password").val("");
106
        modal.find("#email").val("");
107 95
        modal.find("#rights").val("");
108 96

  
109 97
        if(data !== null){
110
            modal.find("#email").val(data.email);
111 98
            modal.find("#rights").val(data.role);
112 99
        }
113 100
    }
......
127 114
    function prepareFormData(modal) {
128 115
        const formData = new FormData();
129 116
        formData.append("role", modal.find("#rights")[0].value);
130
        formData.append("email", modal.find("#email")[0].value);
131 117

  
132 118
        return formData;
133 119
    }
application/view/userContent.php
12 12
            <thead>
13 13
            <tr>
14 14
                <th scope=\"col\">Uživatel</th>
15
                <th scope=\"col\">Email</th>
16 15
                <th scope=\"col\">Práva</th>
17 16
                <th scope=\"col\"><button class=\"btn ml-1\" title=\"Přidat\"  data-toggle=\"modal\" data-target=\"#edit-modal\"  data-title=\"Nový uživatel\"><i class=\"fa fa-plus\"></i></button></th>
18 17
            </tr>
......
42 41
                        users.forEach((item,id) => {
43 42
                            result += \"<tr>\";
44 43
                            result += \"<td>\" + item.username + \"</td>\";
45
                            result += \"<td>\" + ((item.email !== undefined && item.email !== null) ? item.email : \"-\") + \"</td>\";
46 44
                            result += \"<td>\" + item.role + \"</td>\";
47 45
                            (item.role !== \"admin\") ? (result += \"<td class='action-td'>\" +
48 46
                                \"<button class='btn ml-1' title='Upravit'  data-toggle='modal' data-target='#edit-modal' data-pseudo-id='\" + id + \"' data-title='Upravit uživatele'><i class='fa fa-pencil'></i></button>\" +

Také k dispozici: Unified diff