Publier Globinours 1.0.0-rc.3

This commit is contained in:
Alexandre NOEL 2026-09-03 12:39:15 +02:00
commit 9a2b4068da
325 changed files with 38230 additions and 20 deletions

16
public/.htaccess Normal file
View file

@ -0,0 +1,16 @@
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L,QSA]
</IfModule>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<FilesMatch "^\.">
Require all denied
</FilesMatch>

5
public/.user.ini Normal file
View file

@ -0,0 +1,5 @@
upload_max_filesize = 250M
post_max_size = 260M
max_execution_time = 600
max_input_time = 600
memory_limit = 512M

View file

@ -0,0 +1,16 @@
document.addEventListener('DOMContentLoaded',()=>{
if(location.pathname!=='/accounting')return;
const filterForm=document.querySelector('form[action="/accounting"]');
const invoiceForm=document.querySelector('form[action="/accounting/save"]');
if(filterForm&&invoiceForm)invoiceForm.closest('.card')?.after(filterForm);
const structuresTitle=[...document.querySelectorAll('.card-title')].find(node=>node.textContent.trim()==='Coût et paiements par structure');
structuresTitle?.closest('.col-xl-7')?.classList.add('accounting-dashboard-structures');
const canvas=document.getElementById('accountingAnnualChart');
if(canvas&&window.Chart){const rows=JSON.parse(canvas.dataset.series||'[]');new Chart(canvas,{type:'bar',data:{labels:rows.map(r=>r.year),datasets:[{label:'Payé',data:rows.map(r=>(r.billed-r.due)/100),backgroundColor:'rgba(47,179,68,.72)'},{label:'Reste dû',data:rows.map(r=>r.due/100),backgroundColor:'rgba(245,159,0,.75)'}]},options:{responsive:true,maintainAspectRatio:false,scales:{x:{stacked:true},y:{stacked:true,beginAtZero:true,ticks:{callback:v=>v.toLocaleString('fr-FR')+' €'}}},plugins:{tooltip:{callbacks:{label:c=>c.dataset.label+' : '+c.parsed.y.toLocaleString('fr-FR',{minimumFractionDigits:2})+' €'}}}}});}
document.querySelectorAll('.table tbody tr').forEach(row=>{
const reference=row.cells[1]?.textContent.trim();if(!reference)return;
row.classList.add('cursor-pointer');row.tabIndex=0;
const open=event=>{if(event.target.closest('a,button,input,select'))return;if(event.type==='keydown'&&!['Enter',' '].includes(event.key))return;location.href='/accounting/edit-by-reference?reference='+encodeURIComponent(reference);};
row.addEventListener('click',open);row.addEventListener('keydown',open);
});
});

251
public/assets/app-shell.css Normal file
View file

@ -0,0 +1,251 @@
/* Globinours — structure visuelle commune */
.coat-swatch {
display:inline-block;
width:1rem;
height:1rem;
flex:0 0 1rem;
border:1px solid rgba(98,105,118,.35);
border-radius:50%;
box-shadow:inset 0 0 0 1px rgba(255,255,255,.25);
vertical-align:-.15rem;
}
body,
.page {
background:
radial-gradient(circle at 10% 10%, rgba(205, 167, 98, .14), transparent 32rem),
radial-gradient(circle at 90% 90%, rgba(180, 139, 78, .09), transparent 28rem),
#f7f3eb;
background-attachment: fixed;
}
.page > .navbar {
position: relative;
z-index: 1050;
overflow: visible;
background: transparent;
border: 0;
box-shadow: none;
padding-top: .75rem;
}
.topbar-surface {
height: 80px;
background: rgba(255, 255, 255, .94);
border: 1px solid rgba(98, 105, 118, .14);
border-radius: .75rem;
box-shadow: 0 3px 14px rgba(31, 42, 68, .06);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
padding-left: 1rem;
padding-right: 1rem;
overflow: visible;
}
.settings-dropdown {
position: relative;
z-index: 1060;
}
.search-trigger-wrap {
display: inline-flex;
align-items: center;
margin-right: .65rem;
}
.search-trigger {
width: 42px;
height: 42px;
padding: 0;
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--tblr-secondary, #626976);
background: rgba(98, 105, 118, .06);
border: 0;
border-radius: 50%;
transition: color .15s ease, background-color .15s ease, transform .15s ease;
}
.search-trigger:hover,
.search-trigger:focus-visible {
color: var(--tblr-primary, #206bc4);
background: rgba(32, 107, 196, .12);
transform: translateY(-1px);
}
.search-trigger .icon {
width: 21px;
height: 21px;
margin: 0;
}
.settings-trigger {
width: 48px;
height: 48px;
min-height: 48px;
padding: 0;
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--tblr-dark, #1d273b);
background: transparent;
border-color: var(--tblr-dark, #1d273b);
}
.settings-trigger:focus {
color: var(--tblr-dark, #1d273b);
background: transparent;
border-color: var(--tblr-dark, #1d273b);
}
.settings-trigger:hover,
.settings-trigger.show,
.settings-trigger.show:focus {
color: #fff;
background: var(--tblr-dark, #1d273b);
border-color: var(--tblr-dark, #1d273b);
}
.settings-dropdown .dropdown-menu {
z-index: 2000;
min-width: 220px;
}
.settings-dropdown .dropdown-menu.settings-menu-wide {
width: min(560px, calc(100vw - 1.5rem));
}
.settings-menu-columns {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0;
padding: .25rem .5rem;
}
.settings-menu-column {
min-width: 0;
padding: 0 .35rem;
}
.settings-menu-column + .settings-menu-column {
border-left: 1px solid rgba(98,105,118,.16);
padding-left: .85rem;
}
.settings-menu-group + .settings-menu-group {
margin-top: .65rem;
padding-top: .55rem;
border-top: 1px solid rgba(98,105,118,.12);
}
.settings-menu-group .dropdown-header {
padding-inline: .65rem;
}
.settings-menu-group .dropdown-item {
border-radius: var(--tblr-border-radius);
white-space: normal;
}
.settings-section-nav .btn {
min-height: 48px;
display: inline-flex;
align-items: center;
justify-content: center;
padding-inline: 1rem;
}
.settings-nav-group{padding-right:1rem;border-right:1px solid rgba(98,105,118,.16)}.settings-nav-group:last-child{padding-right:0;border-right:0}
.paw-footer {
height: 130px;
flex: 0 0 130px;
margin-top: 1.5rem;
pointer-events: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='84' viewBox='0 0 120 84'%3E%3Cg fill='%23a97f45' opacity='.22' transform='translate(12 9) rotate(-12 22 22)'%3E%3Cellipse cx='21' cy='31' rx='13' ry='10'/%3E%3Cellipse cx='8' cy='17' rx='5' ry='7'/%3E%3Cellipse cx='19' cy='10' rx='5' ry='7'/%3E%3Cellipse cx='31' cy='12' rx='5' ry='7'/%3E%3Cellipse cx='39' cy='23' rx='5' ry='7'/%3E%3C/g%3E%3Cg fill='%23a97f45' opacity='.14' transform='translate(72 43) rotate(14 18 18) scale(.78)'%3E%3Cellipse cx='21' cy='31' rx='13' ry='10'/%3E%3Cellipse cx='8' cy='17' rx='5' ry='7'/%3E%3Cellipse cx='19' cy='10' rx='5' ry='7'/%3E%3Cellipse cx='31' cy='12' rx='5' ry='7'/%3E%3Cellipse cx='39' cy='23' rx='5' ry='7'/%3E%3C/g%3E%3C/svg%3E");
background-repeat: repeat;
background-position: center bottom;
-webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%, #000);
mask-image: linear-gradient(to bottom, transparent, #000 45%, #000);
}
.globinours-footer { margin-top: 2rem; }
.footer-surface { position: relative; z-index: 1; padding: .85rem 1rem; border: 1px solid rgba(169,127,69,.2); border-radius: .8rem; background: rgba(255,255,255,.78); box-shadow: 0 .2rem .8rem rgba(75,57,36,.05); backdrop-filter: blur(5px); }
.globinours-footer .paw-footer { margin-top: -1.5rem; }
.footer-meta { font-size: .78rem; color: var(--tblr-secondary); }
.footer-version { background: rgba(169,127,69,.12); color: #76552d; border: 1px solid rgba(169,127,69,.2); }
.footer-source { display: inline-flex; align-items: center; gap: .3rem; color: inherit; text-decoration: none; }
.footer-source:hover { color: var(--tblr-primary); text-decoration: none; }
.footer-source .icon { width: 16px; height: 16px; margin: 0; }
.breton-flag { position: relative; display: inline-block; width: 23px; height: 15px; overflow: hidden; border: 1px solid rgba(0,0,0,.3); border-radius: 2px; vertical-align: middle; box-shadow: 0 1px 2px rgba(0,0,0,.12); background: repeating-linear-gradient(to bottom,#111 0,#111 1.66px,#fff 1.66px,#fff 3.32px); }
.breton-flag::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 9px; height: 8.3px; background-color: #fff; background-image: radial-gradient(circle,#111 0,#111 .8px,transparent .9px); background-size: 3px 3px; }
.page-header {
position: relative;
isolation: isolate;
}
.page-header::before {
content: "";
position: absolute;
inset: -.35rem 0 -.75rem;
z-index: -1;
pointer-events: none;
opacity: .42;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='84' viewBox='0 0 120 84'%3E%3Cg fill='%23a97f45' opacity='.22' transform='translate(12 9) rotate(-12 22 22)'%3E%3Cellipse cx='21' cy='31' rx='13' ry='10'/%3E%3Cellipse cx='8' cy='17' rx='5' ry='7'/%3E%3Cellipse cx='19' cy='10' rx='5' ry='7'/%3E%3Cellipse cx='31' cy='12' rx='5' ry='7'/%3E%3Cellipse cx='39' cy='23' rx='5' ry='7'/%3E%3C/g%3E%3Cg fill='%23a97f45' opacity='.14' transform='translate(72 43) rotate(14 18 18) scale(.78)'%3E%3Cellipse cx='21' cy='31' rx='13' ry='10'/%3E%3Cellipse cx='8' cy='17' rx='5' ry='7'/%3E%3Cellipse cx='19' cy='10' rx='5' ry='7'/%3E%3Cellipse cx='31' cy='12' rx='5' ry='7'/%3E%3Cellipse cx='39' cy='23' rx='5' ry='7'/%3E%3C/g%3E%3C/svg%3E");
background-repeat: repeat;
background-position: 37px top;
-webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.page-header > .container-xl {
position: relative;
z-index: 1;
}
/* pins custom façon “pastille” */
.twix-pin{
width:18px; height:18px;
border-radius:50%;
border:3px solid #fff;
box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.twix-pin.rescue{ background:#1e88e5; } /* bleu */
.twix-pin.current{ background:#43a047; } /* vert */
.leaflet-div-icon{
background: transparent;
border: none;
}
/* petite légende dans la carte */
.twix-map-legend{
background: rgba(255,255,255,.92);
border-radius: 10px;
padding: 8px 10px;
box-shadow: 0 2px 10px rgba(0,0,0,.12);
font-size: 12px;
}
.twix-map-legend .row{
display:flex; align-items:center; gap:8px; margin:4px 0;
}
.twix-map-legend .dot{
width:20px; height:20px; border-radius:50%;
border:2px solid #fff;
box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.twix-map-legend .dot.rescue{ background:#1e88e5; }
.twix-map-legend .dot.current{ background:#43a047; }
.twix-map-legend .line{
width:18px; height:0; border-top:3px dashed #1e88e5;
opacity:.8;
}
/****** CUSTOM *****/
.nav-tabs-alt .nav-link {
font-weight: 500;
padding: 0.75rem 1.1rem;
}
.nav-tabs-alt .nav-link.active {
border-bottom: 3px solid var(--tblr-primary);
background: #fff;
}
/****** END CUSTOM *****/

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7 KiB

View file

@ -0,0 +1,61 @@
(() => {
const modal = document.getElementById('globalSearchModal');
const input = document.getElementById('globalSearchInput');
const results = document.getElementById('globalSearchResults');
if (!modal || !input || !results) return;
const labels = modal.dataset;
let groups = {};
try { groups = JSON.parse(labels.groups || '{}'); } catch {}
let timer;
let request;
const escapeText = value => {
const node = document.createElement('span');
node.textContent = String(value ?? '');
return node.innerHTML;
};
const notice = (message, danger = false) =>
'<div class="' + (danger ? 'text-danger' : 'text-muted') + ' text-center py-4">' + escapeText(message) + '</div>';
document.addEventListener('keydown', event => {
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'k') {
event.preventDefault();
bootstrap.Modal.getOrCreateInstance(modal).show();
}
});
modal.addEventListener('shown.bs.modal', () => input.focus());
input.addEventListener('input', () => {
clearTimeout(timer);
const query = input.value.trim();
if (query.length < 2) {
results.innerHTML = notice(labels.hint);
return;
}
timer = setTimeout(async () => {
request?.abort();
request = new AbortController();
results.innerHTML = notice(labels.loading);
try {
const response = await fetch('/search.json?q=' + encodeURIComponent(query), {
signal: request.signal,
headers: {Accept: 'application/json'}
});
if (!response.ok) throw new Error('Search failed');
const data = await response.json();
const entries = Object.entries(data.groups || {});
if (!entries.length) {
results.innerHTML = notice(labels.none);
return;
}
results.innerHTML = entries.map(([group, items]) =>
'<div class="mb-3"><div class="subheader mb-1">' + escapeText(groups[group] || group) + '</div>' +
items.map(item => '<a class="list-group-item list-group-item-action" href="' + escapeText(item.url) + '"><strong>' + escapeText(item.title) + '</strong><div class="text-muted small">' + escapeText(item.detail) + '</div></a>').join('') +
'</div>'
).join('') + '<a class="btn btn-outline-primary" href="/search?q=' + encodeURIComponent(query) + '">' + escapeText(labels.allResults) + '</a>';
} catch (error) {
if (error.name !== 'AbortError') results.innerHTML = notice(labels.error, true);
}
}, 220);
});
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

5
public/assets/mobile.css Normal file
View file

@ -0,0 +1,5 @@
html{scroll-padding-top:1rem}img{max-width:100%}.table-responsive{overscroll-behavior-inline:contain}.nav-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.nav-tabs .nav-link{white-space:nowrap}.modal-dialog-scrollable{max-height:calc(100dvh - 1rem)}
@media(max-width:991.98px){.page>.navbar{padding:.5rem}.topbar-surface{height:auto;min-height:72px;padding:.55rem;gap:.5rem}.topbar-surface>.navbar-brand{flex:0 0 auto}.topbar-surface>.navbar-nav{min-width:0;overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:.2rem}.topbar-surface>.navbar-nav>.btn,.topbar-surface>.navbar-nav>.dropdown{flex:0 0 auto}.page-header{padding-top:.5rem}.page-body{margin-top:.75rem}.settings-section-nav{flex-wrap:nowrap!important;overflow-x:auto;padding-bottom:.35rem}.footer-surface{align-items:flex-start!important}.page-title{font-size:1.15rem}}
@media(max-width:767.98px){body,.page{background-attachment:scroll}.container-xl{padding-left:.75rem;padding-right:.75rem}.topbar-surface .navbar-brand img{width:42px;height:44px}.topbar-surface .navbar-brand span span:last-child{display:none}.topbar-surface>.navbar-nav{gap:.25rem}.topbar-surface>.navbar-nav>.btn{min-width:44px;height:46px;padding:.45rem;white-space:nowrap;margin-right:.25rem!important}.settings-trigger{width:46px;height:46px;margin-right:0!important}.settings-dropdown .dropdown-menu{position:fixed!important;inset:auto .75rem .75rem .75rem!important;width:auto!important;max-height:75dvh;overflow-y:auto;transform:none!important}.settings-menu-columns{grid-template-columns:1fr}.settings-menu-column{padding:.15rem .35rem}.settings-menu-column+.settings-menu-column{border-left:0;border-top:1px solid rgba(98,105,118,.16);margin-top:.65rem;padding-top:.65rem;padding-left:.35rem}.card-header,.card-body,.card-footer{padding-left:.85rem;padding-right:.85rem}.btn{min-height:44px}.btn-sm{min-height:40px}input.form-control,select.form-select,textarea.form-control{font-size:16px}.modal-dialog{margin:.5rem}.modal-content{max-height:calc(100dvh - 1rem)}.modal-body{overflow-y:auto}.footer-meta{gap:.65rem!important}.paw-footer{height:80px;flex-basis:80px}}
@media(max-width:420px){.topbar-surface .navbar-brand span{display:none}.topbar-surface .navbar-brand img{margin-right:0!important}.footer-surface{font-size:.9rem}}
@media(display-mode:standalone){body{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}.page>.navbar{position:sticky;top:env(safe-area-inset-top);background:#f7f3eb;z-index:1050}}

2
public/assets/pwa.js Normal file
View file

@ -0,0 +1,2 @@
if('serviceWorker'in navigator&&location.protocol==='https:')window.addEventListener('load',()=>navigator.serviceWorker.register('/service-worker.js',{scope:'/'}).catch(()=>{}));
document.addEventListener('DOMContentLoaded',()=>{const logout=document.querySelector('.settings-dropdown form[action="/logout"]');if(!logout||logout.parentElement.querySelector('[href="/account/devices"]'))return;const link=document.createElement('a');link.className='dropdown-item';link.href='/account/devices';link.textContent=(document.documentElement.lang==='en'?'📱 Trusted devices':'📱 Appareils connectés');logout.before(link);});

View file

@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2014-2022 Chart.js Contributors
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.

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Gregory Petrosyan
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.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,75 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.fr = {}));
}(this, (function (exports) { 'use strict';
var fp = typeof window !== "undefined" && window.flatpickr !== undefined
? window.flatpickr
: {
l10ns: {},
};
var French = {
firstDayOfWeek: 1,
weekdays: {
shorthand: ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"],
longhand: [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi",
],
},
months: {
shorthand: [
"janv",
"févr",
"mars",
"avr",
"mai",
"juin",
"juil",
"août",
"sept",
"oct",
"nov",
"déc",
],
longhand: [
"janvier",
"février",
"mars",
"avril",
"mai",
"juin",
"juillet",
"août",
"septembre",
"octobre",
"novembre",
"décembre",
],
},
ordinal: function (nth) {
if (nth > 1)
return "";
return "er";
},
rangeSeparator: " au ",
weekAbbreviation: "Sem",
scrollTitle: "Défiler pour augmenter la valeur",
toggleTitle: "Cliquer pour basculer",
time_24hr: true,
};
fp.l10ns.fr = French;
var fr = fp.l10ns;
exports.French = French;
exports.default = fr;
Object.defineProperty(exports, '__esModule', { value: true });
})));

26
public/assets/vendor/leaflet/LICENSE vendored Normal file
View file

@ -0,0 +1,26 @@
BSD 2-Clause License
Copyright (c) 2010-2023, Volodymyr Agafonkin
Copyright (c) 2010-2011, CloudMade
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

661
public/assets/vendor/leaflet/leaflet.css vendored Normal file
View file

@ -0,0 +1,661 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
max-width: none !important;
max-height: none !important;
}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
width: auto;
padding: 0;
}
.leaflet-container img.leaflet-tile {
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
mix-blend-mode: plus-lighter;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
svg.leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline-offset: 1px;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px;
font-size: 0.75rem;
line-height: 1.5;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
font-size: 13px;
font-size: 1.08333em;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.8);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
line-height: 1.4;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
text-decoration: underline;
}
.leaflet-attribution-flag {
display: inline !important;
vertical-align: baseline !important;
width: 1em;
height: 0.6669em;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
white-space: nowrap;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.8);
text-shadow: 1px 1px #fff;
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 24px 13px 20px;
line-height: 1.3;
font-size: 13px;
font-size: 1.08333em;
min-height: 1px;
}
.leaflet-popup-content p {
margin: 17px 0;
margin: 1.3em 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-top: -1px;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
pointer-events: auto;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
border: none;
text-align: center;
width: 24px;
height: 24px;
font: 16px/24px Tahoma, Verdana, sans-serif;
color: #757575;
text-decoration: none;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
color: #585858;
}
.leaflet-popup-scrolled {
overflow: auto;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
-ms-zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-interactive {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}
/* Printing */
@media print {
/* Prevent printers from removing background-images of controls. */
.leaflet-control {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

263
public/index.php Normal file
View file

@ -0,0 +1,263 @@
<?php
declare(strict_types=1);
umask(0077);
require_once __DIR__ . '/../app/Services/DB.php';
require_once __DIR__ . '/../app/Services/Migrations.php';
require_once __DIR__ . '/../app/Services/Ids.php';
require_once __DIR__ . '/../app/Services/IcadService.php';
require_once __DIR__ . '/../app/Services/DocumentsService.php';
require_once __DIR__ . '/../app/Services/Auth.php';
require_once __DIR__ . '/../app/Services/TrustedDeviceService.php';
require_once __DIR__ . '/../app/Services/PermissionService.php';
require_once __DIR__ . '/../app/Services/AuditService.php';
require_once __DIR__ . '/../app/Services/BackupService.php';
require_once __DIR__ . '/../app/Services/AppSettings.php';
require_once __DIR__ . '/../app/Services/InstallationService.php';
require_once __DIR__ . '/../app/Services/SystemHealthService.php';
require_once __DIR__ . '/../app/Services/NotificationService.php';
require_once __DIR__ . '/../app/Services/PrivacyService.php';
require_once __DIR__ . '/../app/Services/I18n.php';
require_once __DIR__ . '/../app/Services/PricingService.php';
require_once __DIR__ . '/../app/Services/ImageService.php';
require_once __DIR__ . '/../app/Services/PrivateMediaService.php';
require_once __DIR__ . '/../app/Services/SecurityService.php';
require_once __DIR__ . '/../app/Services/ExportService.php';
require_once __DIR__ . '/../app/Services/AssociationBrand.php';
require_once __DIR__ . '/../app/Services/GrantService.php';
require_once __DIR__ . '/../app/Services/StatisticsService.php';
require_once __DIR__ . '/../app/Services/LocationHistoryService.php';
require_once __DIR__ . '/../app/Services/GeoService.php';
require_once __DIR__ . '/../app/Services/Asm3Analyzer.php';
require_once __DIR__ . '/../app/Services/Asm3MigrationPlanner.php';
require_once __DIR__ . '/../app/Services/Asm3AnimalImporter.php';
require_once __DIR__ . '/../app/Services/Asm3ContactPlanner.php';
require_once __DIR__ . '/../app/Services/Asm3ContactImporter.php';
require_once __DIR__ . '/../app/Services/Asm3MovementImporter.php';
require_once __DIR__ . '/../app/Services/Asm3ClinicalImporter.php';
require_once __DIR__ . '/../app/Services/Asm3LitterImporter.php';
require_once __DIR__ . '/../app/Services/Asm3ResetService.php';
require_once __DIR__ . '/../app/Services/DemoDataService.php';
require_once __DIR__ . '/../app/Services/SpeciesService.php';
require_once __DIR__ . '/../app/Services/ShelterRoomService.php';
require_once __DIR__ . '/../app/Services/LabReferenceService.php';
require_once __DIR__ . '/../app/Services/InventoryService.php';
require_once __DIR__ . '/../app/Services/AgendaService.php';
require_once __DIR__ . '/../app/Services/CalendarFeedService.php';
require_once __DIR__ . '/../app/Services/GlobalSearchService.php';
require_once __DIR__ . '/../app/Controllers/AnimalsController.php';
require_once __DIR__ . '/../app/Controllers/DevController.php';
require_once __DIR__ . '/../app/Controllers/DashboardController.php';
require_once __DIR__ . '/../app/Controllers/AdminController.php';
require_once __DIR__ . '/../app/Controllers/AdoptionsController.php';
require_once __DIR__ . '/../app/Controllers/DirectoryController.php';
require_once __DIR__ . '/../app/Controllers/CareRoundsController.php';
require_once __DIR__ . '/../app/Controllers/DocumentsController.php';
require_once __DIR__ . '/../app/Controllers/AuthController.php';
require_once __DIR__ . '/../app/Controllers/SettingsController.php';
require_once __DIR__ . '/../app/Controllers/DeathController.php';
require_once __DIR__ . '/../app/Controllers/ProjectController.php';
require_once __DIR__ . '/../app/Controllers/GrantsController.php';
require_once __DIR__ . '/../app/Controllers/StatisticsController.php';
require_once __DIR__ . '/../app/Controllers/PlacementsController.php';
require_once __DIR__ . '/../app/Controllers/Asm3ImportController.php';
require_once __DIR__ . '/../app/Controllers/DewormingController.php';
require_once __DIR__ . '/../app/Controllers/MedicalDocumentsController.php';
require_once __DIR__ . '/../app/Controllers/PublicSiteController.php';
require_once __DIR__ . '/../app/Controllers/PrivacyController.php';
require_once __DIR__ . '/../app/Controllers/InventoryController.php';
require_once __DIR__ . '/../app/Controllers/AgendaController.php';
require_once __DIR__ . '/../app/Controllers/DevicesController.php';
require_once __DIR__ . '/../app/Controllers/SurgeriesController.php';
require_once __DIR__ . '/../app/Controllers/AccountingController.php';
require_once __DIR__ . '/../app/Controllers/SearchController.php';
require_once __DIR__ . '/../app/Views/_helpers.php';
function loadEnv(string $path): void
{
if (!file_exists($path)) {
return;
}
foreach (file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line) {
if (str_starts_with(trim($line), '#')) {
continue;
}
[$name, $value] = array_map('trim', explode('=', $line, 2));
if (!array_key_exists($name, $_ENV)) {
putenv("$name=$value");
$_ENV[$name] = $value;
}
}
}
loadEnv(__DIR__ . '/../.env');
$applicationLogDir = dirname(__DIR__) . '/storage/logs';
if (!is_dir($applicationLogDir)) {
@mkdir($applicationLogDir, 0775, true);
}
if (is_dir($applicationLogDir) && is_writable($applicationLogDir)) {
ini_set('log_errors', '1');
ini_set('error_log', $applicationLogDir . '/php-errors.log');
}
if (PHP_SAPI !== 'cli' && is_file(dirname(__DIR__) . '/storage/maintenance.flag')) {
http_response_code(503);
header('Retry-After: 120');
header('Content-Type: text/html; charset=utf-8');
echo '<!doctype html><html lang="fr"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Maintenance — Globinours</title><body style="font:18px system-ui;max-width:700px;margin:12vh auto;padding:24px"><h1>Globinours fait une petite pause 🐾</h1><p>Une mise à jour sécurisée est en cours. Réessayez dans quelques instants.</p></body></html>';
exit();
}
$bootstrapPath = rtrim((string) (parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/'), '/') ?: '/';
$bootstrapIssues = InstallationService::blockingRuntimeIssues();
if ($bootstrapIssues) {
I18n::setLocale('fr');
Auth::start();
if ($bootstrapPath !== '/setup') {
header('Location: /setup');
exit();
}
AuthController::setupUnavailable(InstallationService::runtimeChecks(true));
exit();
}
function render(string $view, array $vars = []): void
{
extract($vars, EXTR_SKIP);
$viewFile = __DIR__ . '/../app/Views/' . $view;
require __DIR__ . '/../app/Views/layout.php';
}
Migrations::run(__DIR__ . '/../migrations');
PrivateMediaService::migrateLegacy();
SecurityService::hardenRuntimeFiles();
I18n::setLocale(AppSettings::get('app_language'));
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/';
$path = rtrim($path, '/') ?: '/';
Auth::start();
header_remove('X-Powered-By');
header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: DENY');
header('Referrer-Policy: strict-origin-when-cross-origin');
header('Permissions-Policy: camera=(self), geolocation=(self), microphone=()');
header(
"Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://tile.openstreetmap.org https://*.tile.openstreetmap.org; font-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'; manifest-src 'self'; worker-src 'self'",
);
header('Cross-Origin-Opener-Policy: same-origin');
header('Cross-Origin-Resource-Policy: same-origin');
if (Auth::isSecureRequest()) {
header('Strict-Transport-Security: max-age=31536000; includeSubDomains');
}
if ($path === '/gestion') {
header('Location: ' . (Auth::user() ? '/dashboard' : '/login?next=%2Fdashboard'));
exit();
}
if (PublicSiteController::handles($path)) {
PublicSiteController::dispatch($path);
exit();
}
if ($path === '/auth/logo') {
AuthController::logo();
exit();
}
if ($path === '/pwa-icon-192.png') {
AuthController::pwaIcon(192);
exit();
}
if ($path === '/pwa-icon-512.png') {
AuthController::pwaIcon(512);
exit();
}
if ($path === '/setup') {
AuthController::setup();
exit();
}
if ($path === '/login') {
AuthController::login();
exit();
}
if ($path === '/logout') {
AuthController::logout();
exit();
}
if ($path === '/agenda/feed.ics') {
AgendaController::feed();
exit();
}
if (Auth::countUsers() === 0) {
header('Location: /setup');
exit();
}
if (!Auth::user()) {
header('Location: /login?next=' . rawurlencode($_SERVER['REQUEST_URI'] ?? '/dashboard'));
exit();
}
header('Cache-Control: private, no-store');
if ($path === '/account/devices') {
DevicesController::index();
exit();
}
if ($path === '/account/devices/revoke') {
DevicesController::revoke();
exit();
}
if ($path === '/account/devices/revoke-all') {
DevicesController::revokeAll();
exit();
}
if ($path === '/agenda/feed/regenerate') {
AgendaController::regenerateFeed();
exit();
}
if ($path === '/agenda/feed/revoke') {
AgendaController::revokeFeed();
exit();
}
if ($path === '/' && !PermissionService::can('dashboard')) {
header('Location: ' . PermissionService::firstAllowedPath());
exit();
}
PermissionService::enforce($path, (string) ($_SERVER['REQUEST_METHOD'] ?? 'GET'));
if (str_starts_with($path, '/dev/')) {
$remote = (string) ($_SERVER['REMOTE_ADDR'] ?? '');
if (getenv('APP_ENV') !== 'development' || !in_array($remote, ['127.0.0.1', '::1'], true) || !Auth::is('admin')) {
http_response_code(404);
echo 'Page introuvable.';
exit();
}
}
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') === 'POST') {
if (!Auth::validCsrf($_POST['csrf'] ?? null)) {
http_response_code(419);
echo 'Session expirée. Rechargez la page puis réessayez.';
exit();
}
if (!Auth::canWrite($path)) {
http_response_code(403);
echo 'Votre rôle ne permet pas cette action.';
exit();
}
if (!in_array($path, ['/settings/users/save', '/settings/backups/restore'], true)) {
$entityId = (int) ($_POST['animal_id'] ?? ($_POST['id'] ?? 0)) ?: null;
$fields = implode(',', array_keys($_POST));
register_shutdown_function(static function () use ($path, $entityId, $fields): void {
$error = error_get_last();
if ($error && in_array($error['type'], [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR], true)) {
return;
}
$code = http_response_code();
if ($code === false || $code < 400) {
AuditService::log('post', $path, 'Action effectuée', $entityId ? 'animal' : null, $entityId, [
'fields' => $fields,
]);
}
});
}
}
require __DIR__ . '/../app/Routes/web.php';

View file

@ -0,0 +1 @@
{"id":"/gestion","name":"Globinours","short_name":"Globinours","description":"Gestion quotidienne dun refuge animalier","start_url":"/gestion","scope":"/","display":"standalone","background_color":"#f7f3eb","theme_color":"#d87945","icons":[{"src":"/pwa-icon-192.png","sizes":"192x192","type":"image/png","purpose":"any"},{"src":"/pwa-icon-512.png","sizes":"512x512","type":"image/png","purpose":"any maskable"}]}

20
public/router.php Normal file
View file

@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
// Routeur destiné uniquement au serveur PHP intégré pour les démonstrations.
$requestPath = rawurldecode((string) (parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/'));
$publicRoot = realpath(__DIR__);
$requestedFile = realpath(__DIR__ . $requestPath);
if (
$requestPath !== '/' &&
$publicRoot !== false &&
$requestedFile !== false &&
str_starts_with($requestedFile, $publicRoot . DIRECTORY_SEPARATOR) &&
is_file($requestedFile)
) {
return false;
}
require __DIR__ . '/index.php';

5
public/service-worker.js Normal file
View file

@ -0,0 +1,5 @@
const CACHE = 'globinours-shell-v2';
const SHELL = ['/manifest.webmanifest','/favicon.ico','/pwa-icon-192.png','/pwa-icon-512.png','/assets/logo-globinours-64.png','/assets/mobile.css','/assets/pwa.js'];
self.addEventListener('install', event => event.waitUntil(caches.open(CACHE).then(cache => cache.addAll(SHELL)).then(() => self.skipWaiting())));
self.addEventListener('activate', event => event.waitUntil(caches.keys().then(keys => Promise.all(keys.filter(key => key !== CACHE).map(key => caches.delete(key)))).then(() => self.clients.claim())));
self.addEventListener('fetch', event => {const request=event.request;if(request.method!=='GET')return;const url=new URL(request.url);if(url.origin!==location.origin||request.mode==='navigate'||!SHELL.includes(url.pathname))return;event.respondWith(caches.match(request).then(cached=>cached||fetch(request)));});