Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16845 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 16845 Rev 16932
Línea 3... Línea 3...
3
$currentUser    = $this->currentUserHelper();
3
$currentUser    = $this->currentUserHelper();
Línea 4... Línea 4...
4
 
4
 
5
$roleName = $currentUser->getUserTypeId();
5
$roleName = $currentUser->getUserTypeId();
Línea 6... Línea 6...
6
$routeDatatable = $this->url('reports/users-blocked');
6
$routeDatatable = $this->url('reports/users-blocked');
Línea 7... Línea 7...
7
 
7
 
8
$allowDownload  = $acl->isAllowed($roleName, 'reports/users-blocked/excel') ? 1 : 0;
8
$allowDownload  = $acl->isAllowed($roleName, 'reports/users-blocked/download') ? 1 : 0;
9
 
9
 
Línea 82... Línea 82...
82
                        $( "#itemEmptyRowTemplate" ).render([])
82
                        $( "#itemEmptyRowTemplate" ).render([])
83
                    );
83
                    );
Línea 84... Línea 84...
84
 
84
 
Línea 85... Línea -...
85
                }
-
 
86
 
-
 
87
                if(response['data']['link_download']) {
-
 
Línea 88... Línea -...
88
                    $('button.btn-download').data('href', response['data']['link_download']);
-
 
89
                    $('button.btn-download').show();
-
 
90
 
-
 
Línea 91... Línea 85...
91
                } else {
85
                }
92
                     $('button.btn-download').hide();
86
 
93
                }
87
 
94
 
88
 
Línea 138... Línea 132...
138
                    json.recordsFiltered    = 0;
132
                    json.recordsFiltered    = 0;
139
                    json.data               = [];
133
                    json.data               = [];
Línea 140... Línea 134...
140
                    
134
                    
-
 
135
                    
-
 
136
                    if(response.success) {
-
 
137
 
-
 
138
                        $('button.btn-download').attr('href', response.data.link_download);
-
 
139
                        if(response.data.total == 0) {
-
 
140
                            $('button.btn-download').hide();
-
 
141
                        } else {
-
 
142
                            $('button.btn-download').show();
141
                    
143
                        }
142
                    if(response.success) {
144
 
143
                        json.recordsTotal       = response.data.total;
145
                        json.recordsTotal       = response.data.total;
144
                        json.recordsFiltered    = response.data.total;
146
                        json.recordsFiltered    = response.data.total;
-
 
147
                        json.data               = response.data.items;
-
 
148
                    } else {
-
 
149
                        $('button.btn-download').hide();
145
                        json.data               = response.data.items;
150
                
146
                    } else {
151
 
Línea 147... Línea 152...
147
                        $.fn.showError(response.data)
152
                        $.fn.showError(response.data)
148
                    }
153
                    }
Línea 181... Línea 186...
181
            'aoColumns': [
186
            'aoColumns': [
182
                { 'mDataProp': 'first_name' },
187
                { 'mDataProp': 'first_name' },
183
                { 'mDataProp': 'last_name' },
188
                { 'mDataProp': 'last_name' },
184
                { 'mDataProp': 'email' },
189
                { 'mDataProp': 'email' },
185
                { 'mDataProp': 'last_activity_on' },
190
                { 'mDataProp': 'last_activity_on' },
186
                { 'mDataProp': 'actions' },
-
 
-
 
191
 
Línea 187... Línea 192...
187
 
192
 
188
 
193
 
189
    	    ],
194
    	    ],
Línea 197... Línea 202...
197
                    'orderable': false,
202
                    'orderable': false,
198
                    'className' : 'text-vertical-middle',
203
                    'className' : 'text-vertical-middle',
Línea 199... Línea 204...
199
 
204
 
Línea 200... Línea -...
200
                },
-
 
201
 
-
 
202
                {
-
 
203
                    'targets': -1,
-
 
204
                    'orderable': false,
-
 
Línea 205... Línea -...
205
                    'render' : function ( data, type, row ) {
-
 
206
                        s = ' ';
-
 
207
 
-
 
208
                        return s;
205
                },
209
                    }
206
 
Línea 210... Línea 207...
210
                }
207
 
211
              ],
208
              ],
212
        });
-
 
213
 
209
        });
-
 
210
 
Línea 214... Línea 211...
214
 
211
 
Línea -... Línea 212...
-
 
212
    $('button.btn-refresh').click(function(e) {
-
 
213
        e.preventDefault();
-
 
214
 
-
 
215
        gridTable.api().ajax.reload(null, false);
-
 
216
 
-
 
217
    });
-
 
218
 
-
 
219
 
-
 
220
   
-
 
221
   $('body').on('click', 'button.btn-download', function(e) {
-
 
222
        e.preventDefault();
-
 
223
        var action   = $(this).attr('href');
-
 
224
 
-
 
225
 
-
 
226
        NProgress.start(); 
-
 
227
        $.ajax({
-
 
228
            'dataType'  : 'json',
-
 
229
            'method'    : 'get',
-
 
230
            'url'       :  action,
-
 
231
        }).done(function(response) {
-
 
232
            if(response['success']) {
-
 
233
                var anchor = window.document.createElement("a");
-
 
234
                anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['content'] ;
-
 
235
                anchor.download = response['data']['basename'];
-
 
236
                document.body.appendChild(anchor);
-
 
237
                anchor.click();  // IE: "Access is denied"; see: https://connect.microsoft.com/IE/feedback/details/797361/ie-10-treats-blob-url-as-cross-origin-and-denies-access
-
 
238
                document.body.removeChild(anchor);
-
 
239
            } else {
-
 
240
                $.fn.showError(response['data']);
-
 
241
            }
-
 
242
        }).fail(function( jqXHR, textStatus, errorThrown) {
Línea 215... Línea -...
215
    $('button.btn-refresh').click(function(e) {
-
 
216
        e.preventDefault();
-
 
Línea 217... Línea 243...
217
        $.fn.loadData();
243
            $.fn.showError(textStatus);
218
    
244
        }).always(function() {
219
 
245
            NProgress.done();
220
    });
246
        });
Línea 242... Línea 268...
242
                                <tr>
268
                                <tr>
243
                                    <th style="width: 25%">LABEL_FIRST_NAME</th>
269
                                    <th style="width: 25%">LABEL_FIRST_NAME</th>
244
                                    <th style="width: 25%">LABEL_LAST_NAME</th>
270
                                    <th style="width: 25%">LABEL_LAST_NAME</th>
245
                                    <th style="width: 30%">LABEL_EMAIL</th>
271
                                    <th style="width: 30%">LABEL_EMAIL</th>
246
                                    <th style="width: 20%">LABEL_REPORTS_LAST_ACTIVITY</th>
272
                                    <th style="width: 20%">LABEL_REPORTS_LAST_ACTIVITY</th>
247
                                    <th>LABEL_ACTIONS</th>
-
 
248
                                </tr>
273
                                </tr>
249
                            </thead>
274
                            </thead>
250
                            <tbody>
275
                            <tbody>
251
                            </tbody>
276
                            </tbody>
252
                        </table>
277
                        </table>
Línea 255... Línea 280...
255
	 	     </div>
280
	 	     </div>
256
	 	</div>
281
	 	</div>
257
	 	<div class="card-footer text-right">
282
	 	<div class="card-footer text-right">
258
	 		<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
283
	 		<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
259
      		<?php if ($allowDownload) :  ?>
284
      		<?php if ($allowDownload) :  ?>
260
			<button type="button" class="btn btn-info btn-download"><i class="fa fa-download"></i> LABEL_DOWNLOAD </button>
285
			<button type="button" class="btn btn-info btn-download" style="display: none"><i class="fa fa-download"></i> LABEL_DOWNLOAD </button>
261
    		<?php endif; ?>
286
    		<?php endif; ?>
262
	 	</div>
287
	 	</div>
263
	</div>
288
	</div>
264
</div>
289
</div>
Línea 265... Línea -...
265
 
-
 
266
 
-
 
267
 
-
 
268
 
-
 
269
<script id="itemRowTemplate" type="text/x-jsrender">
-
 
270
    <tr>
-
 
271
        <td style="width: 25%">
-
 
272
            {{>first_name}}
-
 
273
        </td>
-
 
274
        <td style="width: 25%">
-
 
275
             {{>last_name}}
-
 
276
        </td>
-
 
277
        <td style="width: 30%">
-
 
278
            {{>email}}
-
 
279
        </td>
-
 
280
        <td style="width: 30%">
-
 
281
            {{>last_activity_on}}
-
 
282
        </td>
-
 
283
 
-
 
284
       
-
 
285
 
-
 
286
    </tr> 
-
 
287
</script>
-
 
288
 
-
 
289
 
-
 
290
<script id="itemEmptyRowTemplate" type="text/x-jsrender">
-
 
291
    <tr>
-
 
292
        <td colspan="4">
-
 
293
            LABEL_NOT_RECORDS_FOUND
290