Integracion de la lista tarifaacabado sacada del Mac.Comit antes del merge para que nacho lo coja y meta el vuexy

This commit is contained in:
Jaime Jiménez
2023-05-05 13:38:24 +02:00
parent e9e6421b50
commit 80016b57f5
26 changed files with 2442 additions and 35 deletions

View File

@ -0,0 +1,81 @@
<?php
// Open-Source License Information:
/*
The MIT License (MIT)
Copyright (c) 2020 Ozar (https://www.ozar.net/)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
$errorMessage = $errorMessage ?? session('errorMessage');
$warningMessage = session('warningMessage');
if (session()->has('message')) {
$successMessage = session('message');
}
if (session()->has('error')) {
$errorMessage = is_array(session('error')) ? implode(session('error')) : session('error');
} /* // Uncomment this block if you want the errors listed line by line in the alert
elseif (session()->has('errors')) {
$errorMessage = '<ul class="text-start">';
foreach (session('errors') as $error) :
$errorMessage .= '<li>' . $error . '</li>';
endforeach;
$errorMessage .= '</ul>';
}
*/
?>
<?php if (isset($successMessage) && $successMessage): ?>
<div class="alert alert-success" role="alert">
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Success:"><use xlink:href="#check-circle-fill"/></svg>
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
<div>
<h4><?=lang('Basic.global.Success')?>!</h4>
<?= $successMessage; ?>
</div>
</div>
<?php endif; ?>
<?php if (isset($errorMessage) && $errorMessage): ?>
<div class="alert alert-danger" role="alert">
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Error:"><use xlink:href="#exclamation-triangle-fill"/></svg>
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
<div>
<h4><?=lang('Basic.global.Error')?>!</h4>
<?= $errorMessage; ?>
</div>
</div>
<?php endif; ?>
<?php if (isset($warningMessage) && $warningMessage): ?>
<div class="alert alert-warning" role="alert">
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Error:"><use xlink:href="#exclamation-triangle-fill"/></svg>
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
<div>
<h4 class="text-start"><?=lang('Basic.global.Warning')?></h4>
<?= $warningMessage ?>
</div>
</div>
<?php endif; ?>

View File

@ -0,0 +1,17 @@
<div class="modal fade" id="confirm2delete" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="confirm2deleteLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirm2deleteLabel">Confirm to delete record</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Are you sure you want to delete this record?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
<a class="btn btn-danger btn-confirm"> Yes, Delete It! </a>
</div><!--//.modal-footer -->
</div><!--//.modal-content -->
</div><!--//.modal-dialog -->
</div><!--//.modal -->

View File

@ -0,0 +1,35 @@
<?php if (config('Basics')->theme['name'] == 'Bootstrap5') { ?>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="exclamation-triangle-fill" fill="currentColor" viewBox="0 0 16 16">
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</symbol>
</svg>
<div class="alert alert-warning" role="alert">
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Success:"><use xlink:href="#exclamation-triangle-fill"/></svg>
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
<div class="fdfs">
<h4>Please correct the errors below:</h4>
<ul>
<?php foreach ($errors as $error) : ?>
<li><?= esc($error) ?></li>
<?php endforeach ?>
</ul>
</div>
</div>
<?php } else { ?>
<div class="row">
<div class="col-md-12">
<div class="alert alert-dismissible alert-warning">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fas fa-exclamation-triangle"></i> Please correct the errors below:</h4>
<ul>
<?php foreach ($errors as $error) : ?>
<li><?= esc($error) ?></li>
<?php endforeach ?>
</ul>
</div><!--//.alert-->
</div><!--//.col-->
</div><!--//.row -->
<?php } ?>

View File

@ -0,0 +1,184 @@
<!-- Push section css -->
<?= $this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.4/css/dataTables.bootstrap5.min.css">
<?= $this->endSection() ?>
<?= $this->section('footerAdditions') ?>
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
<?= $this->endSection() ?>
<!-- Push additional js -->
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/min/moment-with-locales.min.js"></script>
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.12.1/js/dataTables.bootstrap5.min.js"></script>
<?= $this->endSection() ?>
<?= $this->section('additionalInlineJs') ?>
moment.locale('<?= $currentLocale ?? config('App')->defaultLocale ?>');
<?php if (isset($usingServerSideDataTable) && $usingServerSideDataTable) : ?>
// Pipelining function for DataTables. To be used to the `ajax` option of DataTables
$.fn.dataTable.pipeline = function (opts) {
// Configuration options
let conf = $.extend({
pages: 5, // number of pages to cache
url: '',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'}
}, opts);
// Private variables for storing the cache
let cacheLower = -1;
let cacheUpper = null;
let cacheLastRequest = null;
let cacheLastJson = null;
return function (request, drawCallback, settings) {
let ajax = false;
let requestStart = request.start;
let drawStart = request.start;
let requestLength = request.length;
let requestEnd = requestStart + requestLength;
if (settings.clearCache) {
// API requested that the cache be cleared
ajax = true;
settings.clearCache = false;
} else if (cacheLower < 0 || requestStart < cacheLower || requestEnd > cacheUpper) {
// outside cached data - need to make a request
ajax = true;
} else if (JSON.stringify(request.order) !== JSON.stringify(cacheLastRequest.order) ||
JSON.stringify(request.columns) !== JSON.stringify(cacheLastRequest.columns) ||
JSON.stringify(request.search) !== JSON.stringify(cacheLastRequest.search)
) {
// properties changed (ordering, columns, searching)
ajax = true;
}
// Store the request for checking next time around
cacheLastRequest = $.extend(true, {}, request);
if (ajax) {
// Need data from the server
if (requestStart < cacheLower) {
requestStart = requestStart - (requestLength * (conf.pages - 1));
if (requestStart < 0) {
requestStart = 0;
}
}
cacheLower = requestStart;
cacheUpper = requestStart + (requestLength * conf.pages);
request.start = requestStart;
request.length = requestLength * conf.pages;
// Provide the same `data` options as DataTables.
if (typeof conf.data === 'function') {
// As a function it is executed with the data object as an arg
// for manipulation. If an object is returned, it is used as the
// data object to submit
let d = conf.data(request);
if (d) {
$.extend(request, d);
}
} else if ($.isPlainObject(conf.data)) {
// As an object, the data given extends the default
$.extend(request, conf.data);
}
request.<?=csrf_token()?> = <?=csrf_token()?>v;
return $.ajax({
"type": conf.method,
"url": conf.url,
"data": request,
"dataType": "json",
"cache": false,
"success": function (json) {
cacheLastJson = $.extend(true, {}, json);
if (cacheLower != drawStart) {
json.data.splice(0, drawStart - cacheLower);
}
if (requestLength >= -1) {
json.data.splice(requestLength, json.data.length);
}
drawCallback(json);
yeniden(json.token);
},
error: function (jqXHR, textStatus, errorThrown) {
$('.dataTables_processing').hide();
const theData = jqXHR.responseJSON;
drawCallback(theData);
Toast.fire({
icon: 'error',
title: errorThrown,
});
}
});
} else {
let json = $.extend(true, {}, cacheLastJson);
json.draw = request.draw; // Update the echo for each response
json.data.splice(0, requestStart - cacheLower);
json.data.splice(requestLength, json.data.length);
drawCallback(json);
}
}
};
// Register an API method that will empty the pipelined data, forcing an Ajax
// fetch on the next draw (i.e. `table.clearPipeline().draw()`)
$.fn.dataTable.Api.register('clearPipeline()', function () {
return this.iterator('table', function (settings) {
settings.clearCache = true;
});
});
<?php endif; ?>
<?php if (isset($usingClientSideDataTable) && $usingClientSideDataTable) { ?>
let lastColNr = $(".using-data-table").find("tr:first th").length - 1;
theTable = $('.using-data-table').DataTable({
"responsive": true,
"paging": true,
"lengthMenu": [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
"pageLength": 10,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true,
"scrollX": true,
"stateSave": true,
"language": {
url: "//cdn.datatables.net/plug-ins/1.10.25/i18n/languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
},
"columnDefs": [
{
orderable: false,
searchable: false,
targets: [0,lastColNr]
}
]
});
<?php } ?>
$('#confirm2delete').on('show.bs.modal', function (e) {
$(this).find('.btn-confirm').attr('href', $(e.relatedTarget).data('href'));
});
function toggleAllCheckboxes($cssClass, $io=null) {
$('.'+$cssClass).prop('checked', $io);
}
<?= $this->endSection() ?>

View File

@ -0,0 +1,19 @@
<!-- Push section css -->
<?= $this->section('css') ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.1.1/dist/select2-bootstrap-5-theme.min.css" />
<?= $this->endSection() ?>
<!-- Push additional js -->
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.full.min.js"></script>
<?= $this->endSection() ?>
<?= $this->section('additionalInlineJs') ?>
$('.select2bs').select2({
theme: "bootstrap-5",
allowClear: false,
});
<?= $this->endSection() ?>

View File

@ -0,0 +1,48 @@
<!-- Push section css -->
<?= $this->section('css') ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@9.7.2/dist/sweetalert2.min.css">
<?= $this->endSection() ?>
<!-- Push section js -->
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9.7.2/dist/sweetalert2.all.min.js"></script>
<?= $this->endSection() ?>
<?= $this->section('additionalInlineJs') ?>
var Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 6000,
timerProgressBar: true,
onOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
});
<?php if (session('sweet-success')) { ?>
Toast.fire({
icon: 'success',
title: '<?= session('sweet-success.') ?>'
});
<?php } ?>
<?php if (session('sweet-warning')) { ?>
Toast.fire({
icon: 'warning',
title: '<?= session('sweet-warning.') ?>'
});
<?php } ?>
<?php if (session('sweet-error')) { ?>
Toast.fire({
icon: 'error',
title: '<?= session('sweet-error.') ?>'
});
<?php } ?>
<?= $this->endSection() ?>