Rev 15759 | Rev 15858 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?php// $acl = $this->viewModel()->getRoot()->getVariable('acl');// $currentUser = $this->currentUserHelper();// $roleName = $currentUser->getUserTypeId();// $routeAdd = $this->url('discovery-contacts/add');// $routeDatatable = $this->url('discovery-contacts');// $routeUpload = $this->url('discovery-contacts/upload');// $allowInteractionAdd = $acl->isAllowed($roleName, 'discovery-contacts/interactions/add') ? 1 : 0;// $allowAdd = $acl->isAllowed($roleName, 'discovery-contacts/add') ? 1 : 0;// $allowEdit = $acl->isAllowed($roleName, 'discovery-contacts/edit') ? 1 : 0;// $allowDelete = $acl->isAllowed($roleName, 'discovery-contacts/delete',) ? 1 : 0;// $allowView = $acl->isAllowed($roleName, 'discovery-contacts/view',) ? 1 : 0;// $allowUpload = $acl->isAllowed($roleName, 'discovery-contacts/upload') ? 1 : 0;$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));$this->headLink()->appendStylesheet($this->basePath('plugins/intl-tel-input/build/css/intlTelInput.css'));$this->inlineScript()->appendFile($this->basePath('plugins/intl-tel-input/build/js/intlTelInput-jquery.js'));$utilsScript = $this->basePath('plugins/intl-tel-input/build/js/utils.js');$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fa/theme.js'));$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fa/theme.js'));$this->headStyle()->captureStart();echo <<<CSSCSS;$this->headStyle()->captureEnd();$this->inlineScript()->captureStart();echo <<<JSjQuery( document ).ready(function( $ ) {var gridTable = $('#gridTable').dataTable( {'processing': true,'serverSide': true,'searching': true,'order': [[ 0, 'asc' ]],'ordering': true,'ordenable' : true,'responsive': true,'select' : false,'paging': true,'pagingType': 'simple_numbers','ajax': {'url' : '$routeDatatable','type' : 'get','beforeSend': function (request) {NProgress.start();},'dataFilter': function(response) {var response = jQuery.parseJSON( response );var json = {};json.recordsTotal = 0;json.recordsFiltered = 0;json.data = [];if(response.success) {json.recordsTotal = response.data.total;json.recordsFiltered = response.data.total;json.data = response.data.items;} else {$.fn.showError(response.data)}return JSON.stringify( json );}},'language' : {'sProcessing': 'LABEL_DATATABLE_SPROCESSING','sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU','sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS','sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE','sInfo': 'LABEL_DATATABLE_SINFO','sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY','sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED','sInfoPostFix': '','sSearch': 'LABEL_DATATABLE_SSEARCH','sUrl': '','sInfoThousands': ',','sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS','oPaginate': {'sFirst': 'LABEL_DATATABLE_SFIRST','sLast': 'LABEL_DATATABLE_SLAST','sNext': 'LABEL_DATATABLE_SNEXT','sPrevious': 'LABEL_DATATABLE_SPREVIOUS'},'oAria': {'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING','sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'},},'drawCallback': function( settings ) {NProgress.done();$('button.btn-delete').confirmation({rootSelector: 'button.btn-delete',title : 'LABEL_ARE_YOU_SURE',singleton : true,btnOkLabel: 'LABEL_YES',btnCancelLabel: 'LABEL_NO',onConfirm: function(value) {action = $(this).data('href');NProgress.start();$.ajax({'dataType' : 'json','accept' : 'application/json','method' : 'post','url' : action,}).done(function(response) {if(response['success']) {$.fn.showSuccess(response['data']);gridTable.api().ajax.reload(null, false);} else {$.fn.showError(response['data']);}}).fail(function( jqXHR, textStatus, errorThrown) {$.fn.showError(textStatus);}).always(function() {NProgress.done();});},});},'aoColumns': [{ 'mDataProp': 'first_name' },{ 'mDataProp': 'last_name' },{ 'mDataProp': 'corporate_email' },{ 'mDataProp': 'company' },{ 'mDataProp': 'country' },{ 'mDataProp': 'sector' },{ 'mDataProp': 'actions' },],'columnDefs': [{'targets': -1,'orderable': false,'render' : function ( data, type, row ) {s = '';if(allowEdit && data['link_edit']) {s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button> ';}if(allowDelete && data['link_delete']) {s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button> ';}if(allowView && data['link_view']) {s = s + '<button class="btn btn-default btn-view" data-href="' + data['link_view']+ '" data-toggle="tooltip" title="LABEL_VIEW"><i class="fa fa-external-link"></i> LABEL_VIEW </button> ';}return s;}}],});});JS;$this->inlineScript()->captureEnd();?><section class="content" id="listing-row"><div class="container-fluid"><div class="row"><div class="col-12"><div class="card"><div class="card-header"><h2>LABEL_CONTACTS_PROGRESS_BY_DAY</h2></div><div class="card-body"><table id="gridTable" class="table table-striped table-hover"><thead><tr><th>LABEL_FIRST_NAME</th><th>LABEL_LAST_NAME</th><th>LABEL_CORPORATE_EMAIL</th><th>LABEL_COMPANY</th><th>LABEL_COUNTRY</th><th>LABEL_SECTOR</th><th>LABEL_ACTIONS</th></tr></thead><tbody></tbody></table></div><!-- <div class="card-footer clearfix"><div style="float:right;"><button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button><?php if ($allowUpload) : ?><button type="button" class="btn btn-primary btn-upload"><i class="fa fa-upload"></i> LABEL_UPLOAD </button><?php endif; ?><?php if ($allowAdd) : ?><button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button><?php endif; ?></div></div> --></div></div></div></div></section>