", {id: "loading_div", "class": "loading_overlay"}).append(message_b);
- $("body").append(message);
- } else if (action === "hide") {
- this.removeClass("loading_blur");
- this.addClass("loading_no_blur");
- setTimeout(() => {
- this.removeClass("loading_no_blur");
- }, 1000);
- $("#loading_div").remove();
- }
-};
-
-$.fn.loading.defaults = {
- message: "Loading..."
-};
-
-console.log("Commit: " + process.env.GIT_VERSION);
-console.log("Date: " + process.env.GIT_AUTHOR_DATE);
-console.log("Bundle mode: " + process.env.BUNDLE_MODE);
-console.log("Bundle date: " + new Date(process.env.BUNDLE_DATE).toISOString());
-
-$(document).pjax("a:not(.pjax_disable)", "#content", { timeout: 100000 });
-$(document).on("pjax:start", function () {
- if (document.getElementById("topNavBar") !== undefined) {
- document.getElementById("topNavBar").className = "topnav";
- }
- oldData = "null";
- fillTable = undefined;
- tableEngine = "datatables";
- if (loadTableInterval !== undefined) {
- clearInterval(loadTableInterval);
- loadTableInterval = undefined;
- }
-});
-
-// Cookie functions from w3schools
-function setCookie (cname, cvalue, exdays) {
- const d = new Date();
- d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
- const expires = "expires=" + d.toUTCString();
- document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
-}
-function getCookie (cname) {
- const name = cname + "=";
- const decodedCookie = decodeURIComponent(document.cookie);
- const ca = decodedCookie.split(";");
- for (let i = 0; i < ca.length; i++) {
- let c = ca[i];
- while (c.charAt(0) === " ") {
- c = c.substring(1);
- }
- if (c.indexOf(name) === 0) {
- return c.substring(name.length, c.length);
- }
- }
- return "";
-}
-
-$(document).ajaxError(function (event, xhr, settings, error) {
- console.error("Error requesting content: " + error + " - status code " + xhr.status);
- console.log(event);
- console.log(xhr);
- console.log(settings);
-});
-
-if (getCookie("authenticated")) {
- var installServiceWorker = true;
- if (window.skipServiceWorkerInstallation !== undefined) { // if you want to disable SW for example via GreasyFork userscript
- installServiceWorker = false;
- }
- if (getCookie("disableServiceWorkerInstallation")) {
- console.log("Skipping ServiceWorker installation because cookie 'disableServiceWorkerInstallation' exists");
- installServiceWorker = false;
- }
- if ("serviceWorker" in navigator) {
- if ("connection" in navigator && navigator.connection.saveData && !getCookie("forceServiceWorkerInstallation")) {
- console.log("Skipping ServiceWorker installation because saveData is enabled");
- installServiceWorker = false;
- }
- if ("storage" in navigator && "estimate" in navigator.storage && !getCookie("forceServiceWorkerInstallation")) {
- navigator.storage.estimate().then((quota) => {
- const requiredMemory = 3 * 1e+6;
- if (quota < requiredMemory) {
- console.log("Skipping ServiceWorker installation because memory is low. memory=" + quota);
- installServiceWorker = false;
- }
- });
- }
- } else {
- installServiceWorker = false;
- }
-}
-if (installServiceWorker) {
- window.addEventListener("load", () => {
- navigator.serviceWorker.register("sw.js").then((registration) => {
- console.log("SW registered: ", registration);
- }).catch((registrationError) => {
- console.log("SW registration failed: ", registrationError);
- });
- });
-}
-
-var offline = false;
-var loadTableInterval = undefined;
-var oldData = "null";
-var tableEngine = "datatables";
-var fillTable = undefined;
-var fillTableLoaded = undefined;
-
-window.addEventListener("securitypolicyviolation", console.error.bind(console));
-
-$(function() {
- if(getCookie("JSless")){
- location.href="?JSless=0";
- }
- $("#topNavBar").show();
- $("#content").show();
- $("#footer").show();
- if ($("#frontend_version") !== undefined) {
- $("#frontend_version").append(process.env.GIT_VERSION + " aggiornamento " + new Date(process.env.BUNDLE_DATE).toLocaleString());
- }
- $("#menuButton").on("click", function() {
- const topNavBar = document.getElementById("topNavBar");
- if (topNavBar.className === "topnav") {
- topNavBar.className += " responsive";
- } else {
- topNavBar.className = "topnav";
- }
- });
- $("#logout-text").on("click", function(){ location.href='logout.php'; });
-});
-
-export var lastTableLoadConfig = {
- tablePage: undefined,
- setTableRefreshInterval: true,
- interval: 10000,
- onlineReload: false,
- useCustomTableEngine: false,
- callback: false
-}
-
-export async function loadTable ({ tablePage, setTableRefreshInterval = true, interval = 10000, onlineReload = false, useCustomTableEngine = false, callbackRepeat = false, callback = false, saveFuncParam = true }) {
- if(loadTableInterval !== undefined) {
- clearInterval(loadTableInterval);
- loadTableInterval = undefined;
- }
- if (typeof fillTable === "undefined") {
- if (useCustomTableEngine !== false) {
- tableEngine = useCustomTableEngine;
- } else {
- tableEngine = "datatables";
- }
- fillTableLoaded = await import(/* webpackChunkName: `[request]` */ `./table_engine_${tableEngine}.js`)
- .then(({ default: _ }) => {
- return _;
- });
- }
- if ("getBattery" in navigator) {
- navigator.getBattery().then((level, charging) => {
- if (!charging && level < 0.2) {
- return;
- }
- });
- }
- if ("deviceMemory" in navigator && navigator.deviceMemory < 0.2) {
- return;
- }
- if(saveFuncParam){
- lastTableLoadConfig = {
- tablePage: tablePage,
- setTableRefreshInterval: setTableRefreshInterval,
- interval: interval,
- onlineReload: onlineReload,
- useCustomTableEngine: useCustomTableEngine,
- callback: callback
- }
- }
- const replaceLatLngWithMap = tablePage === "services" || tablePage === "trainings";
- $.getJSON({
- url: "resources/ajax/ajax_" + tablePage + ".php",
- data: { oldData: oldData },
- success: function (data, status, xhr) {
- oldData = xhr.getResponseHeader("data"); // TODO: refactoring and adding comments
- console.log(data);
- if (data.length > 0) {
- fillTableLoaded({ data, replaceLatLngWithMap, callback });
- if(typeof(Headers) == "function"){
- const headers = new Headers();
- headers.append("date", Date.now());
- caches.open("tables-1").then((cache) => {
- cache.put("/table_" + tablePage + ".json", new Response(xhr.responseText, { headers: headers }));
- });
- }
- }
- if (offline) { // if xhr request successful, client is online
- console.log(onlineReload);
- if (onlineReload) {
- location.reload(); // for offline page
- } else {
- $("#offline_alert").hide(400);
- offline = false;
- }
- }
- }
- }).fail(function (data, status) {
- if (status === "parsererror") {
- if ($("#table_body").children().length === 0) { // this is a server-side authentication error on some cheap hosting providers
- loadTable(tablePage, setTableRefreshInterval, interval); // retry
- } // else nothing
- } else {
- caches.open("tables-1").then((cache) => {
- cache.match("/table_" + tablePage + ".json").then((response) => {
- response.json().then((data) => {
- fillTableLoaded({ data, replaceLatLngWithMap, callback });
- console.log("Table loaded from cache");
- $("#offline_update").text(new Date(parseInt(response.headers.get("date"), 10)).toLocaleString());
- });
- });
- });
- if (!offline) { // if xhr request fails, client is offline
- $("#offline_alert").show(400);
- offline = true;
- }
- }
- });
- if (setTableRefreshInterval) {
- if ("connection" in navigator && navigator.connection.saveData) {
- interval += 5000;
- }
- console.log("table_load interval " + interval);
- loadTableInterval = setInterval(function () {
- loadTable({ tablePage, setTableRefreshInterval: false, interval, onlineReload, useCustomTableEngine, callback: callbackRepeat ? callback : false, saveFuncParam: false });
- }, interval);
- }
-}
-
-export function reloadTable(){
- allertaJS.main.loadTable({
- tablePage: lastTableLoadConfig.tablePage,
- setTableRefreshInterval: lastTableLoadConfig.setTableRefreshInterval,
- interval: lastTableLoadConfig.interval,
- onlineReload: lastTableLoadConfig.onlineReload,
- useCustomTableEngine: lastTableLoadConfig.useCustomTableEngine,
- callback: lastTableLoadConfig.callback,
- });
- if (loadTableInterval !== undefined) {
- clearInterval(loadTableInterval);
- loadTableInterval = undefined;
- }
-}
-
-export function activate(id, token_list) {
- fetch("resources/ajax/ajax_change_availability.php", {
- method: 'POST',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- body: objectToURLParams([
- ["change_id", id],
- ["dispo", 1],
- ["token_list", token_list]
- ])
- }).then(r => {
- displayResponseMessage(r);
- allertaJS.main.reloadTable();
- });
-}
-
-export function deactivate(id, token_list) {
- fetch("resources/ajax/ajax_change_availability.php", {
- method: 'POST',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- body: objectToURLParams([
- ["change_id", id],
- ["dispo", 0],
- ["token_list", token_list]
- ])
- }).then(r => {
- displayResponseMessage(r);
- allertaJS.main.reloadTable();
- });
-}
-
-export function loadListListCallback(){
- $("tbody tr").on("click", function(event) {
- let targetElem = event.target;
- let userInfoElem = event.currentTarget.querySelector("[data-user]");
- let userId = userInfoElem.dataset.user;
- if(
- targetElem.hasAttribute("data-clickable") ||
- targetElem.parentElement.hasAttribute("data-clickable") ||
- (targetElem.childElementCount > 0 && targetElem.firstElementChild.hasAttribute("data-clickable"))
- ){
- if(userInfoElem.dataset.userAvailable === "1") {
- allertaJS.main.deactivate(userId,0);
- } else {
- allertaJS.main.activate(userId,0);
- }
- }
- });
-}
diff --git a/old_version/resources/src/maps.css b/old_version/resources/src/maps.css
deleted file mode 100644
index 3e0c7e1..0000000
--- a/old_version/resources/src/maps.css
+++ /dev/null
@@ -1,33 +0,0 @@
-div#map {
- width: 100%;
- height: 500px;
-}
-
-.map {
- width: 100%;
- height: 500px;
-}
-
-div#search {
- background-color: rgba(255, 255, 255, 0.4);
- bottom: 40px;
- left: 40px;
- width: auto;
- height: auto;
- padding: 10px;
-}
-
-div#results {
- font-style: sans-serif;
- color: black;
- font-size: 75%;
-}
-
-.fa.fa-map-marker-alt,
-.fa.fa-spinner.fa-spin {
- line-height: inherit;
-}
-
-.leaflet-pane.leaflet-shadow-pane {
- display: none;
-}
diff --git a/old_version/resources/src/maps.js b/old_version/resources/src/maps.js
deleted file mode 100644
index 13a848e..0000000
--- a/old_version/resources/src/maps.js
+++ /dev/null
@@ -1,283 +0,0 @@
-import L from "leaflet";
-import "leaflet.locatecontrol";
-import "../node_modules/leaflet.locatecontrol/dist/L.Control.Locate.min.css";
-import "../node_modules/leaflet/dist/leaflet.css";
-import "./maps.css";
-
-const iconRetinaUrl = "resources/dist/marker-icon-2x.png";
-const iconUrl = "resources/dist/marker-icon.png";
-const shadowUrl = "resources/dist/marker-shadow.png";
-const iconDefault = new L.Icon({
- iconRetinaUrl,
- iconUrl,
- shadowUrl,
- iconSize: [25, 41],
- iconAnchor: [12, 41],
- popupAnchor: [1, -34],
- tooltipAnchor: [16, -28],
- shadowSize: [41, 41]
-});
-
-var marker;
-var feature;
-var map;
-
-export function setMarker (LatLng, move=false) {
- if (marker) {
- console.log("Marker exists");
- // console.log(marker);
- marker.remove();
- }
- console.log(LatLng);
- if ($("input[name='place']").val() !== undefined) {
- $("input[name='place']").val(LatLng.lat + ";" + LatLng.lng);
- }
- console.log(map);
- marker = L.marker(LatLng, { icon: iconDefault }).addTo(map);
- if(move){
- map.setView(LatLng, 17);
- }
-}
-
-var mapsList = [];
-
-export function loadMap (lat = undefined, lng = undefined, selectorId = undefined, select = true, removeMap = false) {
- console.log("Loading map...", [lat, lng, selectorId, select]);
- console.trace();
- if (lat === undefined && lng === undefined) {
- lat = 45.5285; // TODO: replace hard-coded into cookie reading
- lng = 10.2956;
- }
- if (selectorId === undefined) {
- selectorId = "map";
- }
- let container = L.DomUtil.get(selectorId);
- console.log(container);
- try{
- if(container._leaflet_id){
- console.log(mapsList);
- if(removeMap){
- mapsList[0].off();
- mapsList[0].remove();
- mapsList.splice(0, 1);
- } else {
- console.log("Skipping map loading because already loaded...");
- return true;
- }
- }
- } catch(e){
- //console.log(e);
- console.log("Skipping map loading...");
- return true;
- }
- const zoom = select ? 10 : 17;
- const latLng = new L.LatLng(lat, lng);
- L.Map.addInitHook(function () {
- mapsList.push(this); // Use whatever global scope variable you like.
- });
- map = new L.Map(selectorId, { zoomControl: true });
-
- const osmUrl = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
- const osmAttribution = '©
OpenStreetMap contributors';
- const osm = new L.TileLayer(osmUrl, { maxZoom: 20, attribution: osmAttribution });
-
- map.setView(latLng, zoom).addLayer(osm);
-
- if (select) {
- map.on("click", function (e) {
- setMarker(e.latlng);
- });
-
- L.Control.CustomLocate = L.Control.Locate.extend({
- _drawMarker: function () {
- setMarker(this._event.latlng);
- },
- _onDrag: function () {},
- _onZoom: function () {},
- _onZoomEnd: function () {}
- });
-
- const lc = new L.Control.CustomLocate({
- icon: "fa fa-map-marker",
- cacheLocation: false, // disabled for privacy reasons
- initialZoomLevel: 16
- }).addTo(map);
-
- if ($("#addr").val() !== undefined) {
- document.getElementById("addr").addEventListener("keydown", function (event) {
- if (event.key === "Enter") {
- event.preventDefault();
- $("#search > button").trigger("click");
- }
- });
- }
- window.addEventListener("focus", function (event) {
- if ($("#addr").val() === "") {
- console.log("Loading location from clipboard");
- try {
- navigator.clipboard.readText().then((text) => {
- $("#addr").val(text);
- if (!addrSearch()) {
- $("#addr").val("");
- }
- }).catch((err) => {
- console.error("Failed to read clipboard contents: ", err);
- });
- } catch(error) {
- console.error(error);
- }
- }
- });
- } else {
- setMarker(latLng);
- }
- map.invalidateSize();
-}
-
-// from unknown source in the Internet
-export function chooseAddr (addrLat, addrLng, zoom = undefined, lat1 = undefined, lng1 = undefined, lat2 = undefined, lng2 = undefined, osmType = undefined) {
- addrLat = addrLat.replace(",", ".");
- addrLng = addrLng.replace(",", ".");
- if (lat1 !== undefined && lng1 !== undefined && lat2 !== undefined && lng2 !== undefined && osmType !== undefined) {
- const loc1 = new L.LatLng(lat1, lng1);
- const loc2 = new L.LatLng(lat2, lng2);
- const bounds = new L.LatLngBounds(loc1, loc2);
- console.log(lat1, lng1, lat2, lng2, osmType);
- setMarker(new L.LatLng(addrLat, addrLng));
- if (feature) {
- map.removeLayer(feature);
- }
- if (osmType === "node") {
- map.fitBounds(bounds);
- map.setZoom(16);
- } else {
- const loc3 = new L.LatLng(lat1, lng2);
- const loc4 = new L.LatLng(lat2, lng1);
- feature = L.polyline([loc1, loc4, loc2, loc3, loc1], { color: "red" }).addTo(map);
- map.fitBounds(bounds);
- map.setZoom(16);
- }
- } else if (addrLat !== undefined && addrLng !== undefined) {
- const loc = new L.LatLng(addrLat, addrLng);
- console.log(loc);
- setMarker(loc);
- if (zoom !== undefined) {
- map.setView(loc, zoom);
- } else {
- map.setView(loc);
- }
- }
-}
-
-// started from https://derickrethans.nl/leaflet-and-nominatim.html
-export function addrSearch (stringResultsFound= undefined, stringResultsNotFound = undefined) {
- function searchError (error, checkClipboard) {
- if (!checkClipboard) {
- $("#results").empty();
- $("
", { html: stringResultsNotFound }).appendTo("#results");
- console.error(error);
- }
- return false;
- }
- let inp = document.getElementById("addr").value;
- // if translation strings are not defined, skip the nominatim step and don't log errors (no console.error)
- const checkClipboard = stringResultsFound=== undefined && stringResultsNotFound === undefined;
- $("#results").empty();
-
- if (inp.match("\@(-?[\d\.]*)")) { // Google Maps
- try {
- inp = inp.split("@")[1].split(",");
- chooseAddr(inp[0], inp[1]);
- return true;
- } catch (error) {
- searchError(error, checkClipboard);
- }
- } else if (inp.includes("#map=")) { // OpenStreetMap website
- try {
- inp = inp.split("#map=")[1].split("/");
- chooseAddr(inp[1], inp[2], inp[0]);
- return true;
- } catch (error) {
- searchError(error, checkClipboard);
- }
- } else if (inp.match(/[0-9]+,\s[0-9]+/)) { // Bing
- try {
- inp = inp.split(", ");
- chooseAddr(inp[0], inp[1]);
- return true;
- } catch (error) {
- searchError(error, checkClipboard);
- }
- } else if (inp.match(/[0-9]+;[0-9]+/)) { // DB dump
- try {
- inp = inp.split(";");
- chooseAddr(inp[0], inp[1]);
- return true;
- } catch (error) {
- searchError(error, checkClipboard);
- }
- } else if (!checkClipboard) {
- $.getJSON("https://nominatim.openstreetmap.org/search?format=json&limit=5&q=" + inp, function (data) {
- console.log(data);
- var list = document.createElement('ul');
- list.classList.add("results-list");
-
- $.each(data, function (key, val) {
- var item_a = document.createElement('a');
- item_a.href = "#";
- item_a.textContent = val.display_name;
-
- item_a.dataset.addrLat = val.lat;
- item_a.dataset.addrLng = val.lon;
- item_a.dataset.zoom = undefined;
- item_a.dataset.lat1 = val.boundingbox[0];
- item_a.dataset.lng1 = val.boundingbox[2];
- item_a.dataset.lat2 = val.boundingbox[1];
- item_a.dataset.lng2 = val.boundingbox[3];
- item_a.dataset.osmType = val.osm_type;
-
- var item = document.createElement('li');
- item.appendChild(item_a);
-
- list.appendChild(item);
- });
-
- console.log(list);
-
- if (data.length !== 0) {
- $("#results").empty();
- $("
", { html: stringResultsFound+ ":" }).appendTo("#results");
- $(list).appendTo("#results");
-
- $("#results li").on("click",function(e){
- e.preventDefault()
- var row = e.target;
- console.log(row);
- console.log(row.dataset);
- allertaJS.maps.chooseAddr(
- row.dataset.addrLat,
- row.dataset.addrLng,
- row.dataset.zoom,
- row.dataset.lat1,
- row.dataset.lng1,
- row.dataset.lat2,
- row.dataset.lng2,
- row.dataset.osmType
- );
- })
- } else {
- $("#results").empty();
- $("
", { html: stringResultsNotFound }).appendTo("#results");
- }
- });
- } else {
- return false;
- }
-}
-
-$(function () {
- if(typeof loadMapOnScriptLoad !== undefined){
- console.log("Loading map...");
- allertaJS.maps.loadMap();
- }
-});
diff --git a/old_version/resources/src/players.js b/old_version/resources/src/players.js
deleted file mode 100644
index f2a3e1a..0000000
--- a/old_version/resources/src/players.js
+++ /dev/null
@@ -1 +0,0 @@
-import { Howl, Howler } from "howler";
diff --git a/old_version/resources/src/polyfills.js b/old_version/resources/src/polyfills.js
deleted file mode 100644
index 9749707..0000000
--- a/old_version/resources/src/polyfills.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import Promise from 'promise-polyfill';
-import {fetch as fetchPolyfill} from 'whatwg-fetch'
-
-export {
- Promise,
- fetchPolyfill as fetch
-};
\ No newline at end of file
diff --git a/old_version/resources/src/sentry.js b/old_version/resources/src/sentry.js
deleted file mode 100644
index 7923dc0..0000000
--- a/old_version/resources/src/sentry.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import * as Sentry from "@sentry/browser";
-import { Integrations } from "@sentry/tracing";
-
-if (process.env.config && process.env.config.sentryEnabled) {
- if ("connection" in navigator && navigator.connection.saveData) {
- console.log("Skipping Sentry init because data save is enabled");
- } else {
- Sentry.init({
- dsn: process.env.config.sentryDsn,
- integrations: [new Integrations.BrowserTracing()],
- tracesSampleRate: 0.6,
- release: "allerta-vvf-frontend@" + process.env.GIT_VERSION,
- environment: process.env.config.sentryEnvironment
- });
- }
-}
diff --git a/old_version/resources/src/table_engine_datatables.js b/old_version/resources/src/table_engine_datatables.js
deleted file mode 100644
index c9b41d8..0000000
--- a/old_version/resources/src/table_engine_datatables.js
+++ /dev/null
@@ -1,159 +0,0 @@
-import jsZip from "jszip";
-window.JSZip = jsZip;
-import pdfMake from "pdfmake/build/pdfmake";
-pdfMake.vfs = pdfFonts.pdfMake.vfs;
-import pdfFonts from "pdfmake/build/vfs_fonts";
-import "datatables.net-bs4/js/dataTables.bootstrap4.min.js";
-import "datatables.net-bs4/css/dataTables.bootstrap4.min.css";
-import "datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js";
-import "datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css";
-import "datatables.net-buttons";
-import "datatables.net-buttons-bs4/js/buttons.bootstrap4.js";
-import "datatables.net-buttons-bs4/css/buttons.bootstrap4.css";
-import "datatables.net-buttons/js/buttons.html5.js";
-import "datatables.net-buttons/js/buttons.print.js";
-
-export default async function fillTable ({ data, replaceLatLngWithMap = false, callback = false }) {
- $("#table_body").empty();
- $.each(data, function (rowNum, item) {
- const row = document.createElement("tr");
- row.id = "row-" + rowNum;
- $.each(item, function (cellNum, i) {
- if (i !== null) {
- if (replaceLatLngWithMap && i.match(/[+-]?\d+([.]\d+)?[;][+-]?\d+([.]\d+)?/gm)) { /* credits to @visoom https://github.com/visoom */
- let lat = i.split(";")[0];
- let lng = i.split(";")[1];
- let mapImageID = undefined;
- if(lng.includes("#")){
- lng = lng.split("#")[0];
- mapImageID = i.split("#")[1];
- }
- const mapDiv = document.createElement("div");
- mapDiv.id = "map-" + rowNum;
- const mapModal = document.createElement("div");
- mapModal.id = "map-modal-" + rowNum;
- mapModal.classList.add("modal");
- mapModal.classList.add("map-modal");
- mapModal.setAttribute("role", "dialog");
- mapModal.setAttribute("tabindex", "-1");
- mapModal.innerHTML = `
`;
- document.body.appendChild(mapModal);
-
- if(mapImageID !== undefined){
- const mapPreview = document.createElement("figure");
-
- const mapPreviewImage = document.createElement("img");
- console.log("Adding map image", [lat, lng, mapImageID, mapDiv.id]);
- mapPreviewImage.src = "resources/images/map_cache/" + mapImageID + ".png";
- mapPreview.appendChild(mapPreviewImage);
-
- const mapPreviewCaption = document.createElement("figcaption");
-
- const mapPreviewModalOpener = document.createElement("a");
- mapPreviewCaption.style.cursor = "pointer";
- mapPreviewModalOpener.id = "map-opener-" + rowNum;
- mapPreviewModalOpener.classList.add("map-opener");
- mapPreviewModalOpener.classList.add("pjax_disable");
- mapPreviewModalOpener.innerText = "Premi qui per aprire la mappa interattiva";
- mapPreviewCaption.appendChild(mapPreviewModalOpener);
-
- mapPreview.appendChild(mapPreviewCaption);
-
- mapDiv.appendChild(mapPreview);
- } else {
- const mapModalOpener = document.createElement("a");
- mapModalOpener.id = "map-opener-" + rowNum;
- mapModalOpener.href = "#";
- mapModalOpener.classList.add("map-opener");
- mapModalOpener.classList.add("pjax_disable");
- mapModalOpener.innerText = "Premi qui per aprire la mappa interattiva";
- mapDiv.appendChild(mapModalOpener);
- }
- const cell = document.createElement("td");
- cell.appendChild(mapDiv);
- row.appendChild(cell);
- } else {
- const cell = document.createElement("td");
- cell.innerHTML = i;
- row.appendChild(cell);
- }
- }
- });
- document.getElementById("table_body").appendChild(row);
- });
- let loadedLanguage = {};
- try {
- let language = navigator.language || navigator.userLanguage;
- language = language.toLowerCase().replace("_", "-");
- language = "it_it";
- loadedLanguage = await import(`datatables.net-plugins/i18n/${language}.json`)
- .then(({ default: _ }) => {
- return _;
- });
- } catch (error) {
- console.error("Error loading DataTables translation:");
- console.log(error);
- loadedLanguage = {};
- }
- if (!$.fn.DataTable.isDataTable("#table")) {
- var tableDt = $("#table").DataTable({
- responsive: true,
- responsive: {
- details: {
- display: $.fn.dataTable.Responsive.display.childRowImmediate,
- type: 'none',
- target: ''
- }
- },
- language: loadedLanguage,
- buttons: ["excel", "pdf", "csv"],
- info: false //TODO: fix info string
- });
- tableDt.buttons().container()
- .appendTo("#table_wrapper :nth-child(1):eq(0)");
-
- if (callback !== false) {
- callback(tableDt);
- }
- } else {
- tableDt.rows().invalidate();
- }
- window.tableDt = tableDt;
-}
-
-$(function() {
- document.querySelector("tbody").addEventListener('click', function(e) {
- if(e.target.classList.contains("map-opener")) {
- console.log(e);
- let id = e.target.id.replace("map-opener-", "");
- console.log(id);
- $("#map-modal-"+id).modal('show');
- }
- });
- $('body').on('shown.bs.modal', function (e) {
- console.log(e);
- if(e.target.classList.contains("map-modal")) {
- let id = e.target.id.replace("map-modal-", "");
- console.log(id);
- let lat = $("#map-"+id+"-lat").text();
- let lng = $("#map-"+id+"-lng").text();
- console.log(lat);
- console.log(lng);
- allertaJS.maps.loadMap(lat, lng, "map-container-"+id, false, true);
- }
- });
-});
diff --git a/old_version/resources/src/table_engine_default.js b/old_version/resources/src/table_engine_default.js
deleted file mode 100644
index 30ec87f..0000000
--- a/old_version/resources/src/table_engine_default.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default async function fillTable ({ data, replaceLatLngWithMap = false, callback = false }) {
- $("#table_body").empty();
- $.each(data, function (rowNum, item) {
- const row = document.createElement("tr");
- row.id = "row-" + rowNum;
- $.each(item, function (cellNum, i) {
- if (i !== null) {
- const cell = document.createElement("td");
- cell.innerHTML = i;
- row.appendChild(cell);
- }
- });
- document.getElementById("table_body").appendChild(row);
- });
- if (callback !== false) {
- callback();
- }
-}
diff --git a/old_version/resources/webpack.common.js b/old_version/resources/webpack.common.js
deleted file mode 100644
index f9b7eda..0000000
--- a/old_version/resources/webpack.common.js
+++ /dev/null
@@ -1,113 +0,0 @@
-const path = require("path");
-const CopyPlugin = require("copy-webpack-plugin");
-const WebpackAssetsManifest = require("webpack-assets-manifest");
-const { CleanWebpackPlugin } = require("clean-webpack-plugin");
-var webpack = require("webpack");
-
-module.exports = {
- entry: {
- main: path.resolve(__dirname, "./src/main.js"),
- maps: path.resolve(__dirname, "./src/maps.js"),
- players: path.resolve(__dirname, "./src/players.js"),
- sw: path.resolve(__dirname, "./src/sw.js"),
- games: path.resolve(__dirname, "./src/games.js"),
- },
- output: {
- filename: (pathData) => {
- return pathData.chunk.name === "sw" ? "../../sw.js": "[name].[contenthash].js";
- },
- path: path.resolve(__dirname, "dist"),
- publicPath: "resources/dist/",
- chunkFilename: "[name].bundle.js?h=[chunkhash]",
- library: ["allertaJS", "[name]"]
- },
- resolve: {
- alias: {
- // Force all modules to use the same jquery version.
- "jquery": path.join(__dirname, "node_modules/jquery/src/jquery")
- }
- },
- module: {
- rules: [
- {
- test: require.resolve("jquery"),
- loader: "expose-loader",
- options: {
- exposes: ["$", "jQuery"],
- },
- },
- {
- test: /\.css$/i,
- use: ["style-loader", "css-loader"],
- },
- {
- test: /\.s(a|c)ss$/,
- use: ["style-loader", "css-loader", "sass-loader"],
- },
- {
- test: /\.(gif|png|jpg)(\?v=\d+\.\d+\.\d+)?$/,
- use: [
- {
- loader: "file-loader",
- options: {
- name: "[name].[ext]",
- outputPath: "./"
- }
- }
- ]
- },
- {
- test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
- use: [{
- loader: "file-loader",
- options: {
- name: "[name].[ext]",
- outputPath: "fonts/",
- publicPath: "resources/dist/fonts"
- }
- }]
- },
- {
- test: /\.(gz|wasm|js_resource|data)(\?v=\d+\.\d+\.\d+)?$/,
- use: [
- {
- loader: "file-loader",
- options: {
- name: "[name].[ext]",
- outputPath: "./"
- }
- }
- ],
- type: "asset/resource"
- }
- ],
- },
- plugins: [
- new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
- new CleanWebpackPlugin(),
- new CopyPlugin({
- patterns: [
- { from: "node_modules/leaflet/dist/images", to: ".", noErrorOnMissing: true }
- ],
- }),
- new WebpackAssetsManifest({
- writeToDisk: true,
- integrity: true,
- entrypointsUseAssets: true,
- customize(entry, original, manifest, asset) {
- if(asset.name.includes("table_engine")){
- return entry;
- }
- allowed_entries = ["main.js", "maps.js", "players.js", "games.js"]
- if (entry.key.includes("table_engine") || allowed_entries.includes(entry.key)) {
- entry.key = entry.key.split("?")[0];
- return entry;
- }
- return false;
- }
- })
- ],
- optimization: {
- mergeDuplicateChunks: true
- }
-};
\ No newline at end of file
diff --git a/old_version/resources/webpack.debug_bundle.js b/old_version/resources/webpack.debug_bundle.js
deleted file mode 100644
index 0f3789f..0000000
--- a/old_version/resources/webpack.debug_bundle.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const { merge } = require("webpack-merge");
-const prod = require("./webpack.prod.js");
-const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
-const smp = new SpeedMeasurePlugin();
-const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
-
-module.exports = smp.wrap(merge(prod, {
- plugins: [
- new BundleAnalyzerPlugin({
- analyzerMode: "static",
- openAnalyzer: true,
- generateStatsFile: true
- })
- ]
-}));
\ No newline at end of file
diff --git a/old_version/resources/webpack.dev.js b/old_version/resources/webpack.dev.js
deleted file mode 100644
index 91a787c..0000000
--- a/old_version/resources/webpack.dev.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const { merge } = require("webpack-merge");
-const common = require("./webpack.common.js");
-var webpack = require("webpack");
-
-module.exports = merge(common, {
- mode: "development",
- devtool: false,
- devServer: {
- contentBase: "./dist",
- },
- plugins: [
- new webpack.EnvironmentPlugin({
- GIT_VERSION: null,
- GIT_AUTHOR_DATE: null,
- BUNDLE_DATE: Date.now(),
- BUNDLE_MODE: "development"
- })
- ]
-});
\ No newline at end of file
diff --git a/old_version/resources/webpack.prod.js b/old_version/resources/webpack.prod.js
deleted file mode 100644
index c651b80..0000000
--- a/old_version/resources/webpack.prod.js
+++ /dev/null
@@ -1,140 +0,0 @@
-const { merge } = require("webpack-merge");
-const common = require("./webpack.common.js");
-const TerserPlugin = require("terser-webpack-plugin");
-const SentryWebpackPlugin = require("@sentry/webpack-plugin");
-const AfterBuildPlugin = require("@fiverr/afterbuild-webpack-plugin");
-const childProcess = require("child_process");
-const InjectPlugin = require("webpack-inject-plugin").default;
-const colors = require("colors/safe");
-const fs = require("fs");
-const glob = require("glob");
-
-function git(command) {
- return childProcess.execSync(`git ${command}`, { encoding: "utf8" }).trim();
-}
-var webpack = require("webpack");
-
-if (!fs.existsSync("config.json")) {
- fs.copyFileSync("config_sample.json", "config.json");
-}
-
-const removeSourceMapUrlAfterBuild = () => {
- //based on @rbarilani https://github.com/rbarilani/remove-source-map-url-webpack-plugin
-
- glob("./dist/*.js", function (er, files) {
- let countMatchAssets = 0;
- files.push("../sw.js");
- //console.log(files);
- files.forEach((key) => {
- countMatchAssets += 1;
- let asset = fs.readFileSync(key, "utf8");
- let source = asset.split("//# sourceMappingURL=")[0].replace(/\n$/, "");
- fs.writeFileSync(key, source);
- });
-
- if (countMatchAssets) {
- console.log(colors.green(`remove-source-map-url: ${countMatchAssets} asset(s) processed`));
- }
- });
- glob("./dist/*.js.map", function (er, files) {
- files.push("../sw.js.map");
- files.forEach((key) => {
- fs.unlinkSync(key);
- });
- });
-};
-
-var configFile = require("./config.json");
-const sentryEnabled = configFile.sentryEnabled &&
- configFile.sentryAuthToken &&
- configFile.sentryOrganization &&
- configFile.sentryProject;
-
-var prodConfig = {
- mode: "production",
- devtool: false,
- module: {
- rules: [
- {
- test: /\.m?js$/,
- exclude: /(node_modules|bower_components)/,
- use: {
- loader: "babel-loader",
- options: {
- presets: [
- ['@babel/preset-env', {
- useBuiltIns: 'usage',
- corejs: 3
- }]
- ],
- plugins: ["@babel/plugin-transform-runtime"],
- sourceType: "unambiguous"
- }
- }
- }
- ]
- },
- plugins: [],
- optimization: {
- mergeDuplicateChunks: true,
- minimize: true,
- minimizer: [new TerserPlugin({
- parallel: true,
- extractComments: true,
- terserOptions: {
- compress: {
- drop_console: true
- }
- }
- })]
- }
-};
-
-module.exports = (env) => {
- //run webpack build with "--env sentryEnvironment=custom-sentry-env" to replace Sentry environment
- if(env.sentryEnvironment){
- console.log(colors.green("INFO using custom sentryEnvironment "+env.sentryEnvironment));
- configFile.sentryEnvironment = env.sentryEnvironment;
- }
- if(!configFile.sentryEnvironment){
- configFile.sentryEnvironment = "prod";
- }
-
- if(sentryEnabled){
- prodConfig.plugins.push(
- new webpack.SourceMapDevToolPlugin({
- filename: "[file].map"
- }),
-
- new SentryWebpackPlugin({
- authToken: configFile.sentryAuthToken,
- org: configFile.sentryOrganization,
- project: configFile.sentryProject,
- urlPrefix: "~/dist",
- include: "./dist",
- setCommits: {
- auto: true
- },
- release: "allerta-vvf-frontend@"+git("describe --always")
- }),
-
- new AfterBuildPlugin(removeSourceMapUrlAfterBuild),
-
- new InjectPlugin(function() {
- return "import './src/sentry.js';";
- },{ entryName: "main" })
- );
- console.log(colors.green("INFO Sentry Webpack plugins enabled"));
- }
-
- prodConfig.plugins.push(
- new webpack.EnvironmentPlugin({
- GIT_VERSION: git("describe --always"),
- GIT_AUTHOR_DATE: git("log -1 --format=%aI"),
- BUNDLE_DATE: Date.now(),
- BUNDLE_MODE: "production",
- config: configFile
- })
- );
- return merge(common, prodConfig);
-};
diff --git a/old_version/services.php b/old_version/services.php
deleted file mode 100644
index 99ad2b6..0000000
--- a/old_version/services.php
+++ /dev/null
@@ -1,10 +0,0 @@
-online_time_update();
- $query_results = $db->select("SELECT * FROM `".DB_PREFIX."_services` ORDER BY date DESC, beginning DESC");
-} else {
- $query_results = null;
-}
-loadtemplate('services.html', ['title' => t('Services', false), 'query_results' => $query_results]);
-?>
diff --git a/old_version/telegram_bot.php b/old_version/telegram_bot.php
deleted file mode 100644
index acd0878..0000000
--- a/old_version/telegram_bot.php
+++ /dev/null
@@ -1,24 +0,0 @@
-addErrorHandler(function ($e) {
- print('Caught '.get_class($e).' exception from general handler'.PHP_EOL);
- print($e.PHP_EOL);
-});
-
-$Bot->onCommand('start', function (Message $message, array $args = []) {
- var_dump($message, $args);
- $message->reply('Hey! Nice to meet you. Use /info to know more about me.');
-});
-
-$Bot->onCommand('info', function (Message $message) {
- $message->reply('Well, I\'m just an example, but you can learn more about NovaGram at docs.novagram.ga');
-});
-
-$Bot->start();
diff --git a/old_version/templates/JSless/base.html b/old_version/templates/JSless/base.html
deleted file mode 100644
index 315c1cb..0000000
--- a/old_version/templates/JSless/base.html
+++ /dev/null
@@ -1,110 +0,0 @@
-{% apply minimize %}
-
-
-
- {% block head %}
-
{{ title }} - ALLERTA sistema gestionale {{ owner }}
-
-
-
-
- {% endblock %}
-
-
-{% if show_menu %}
- {% block menu %}
- {# Menu #}
-
-
- {# /Menu #}
- {% endblock %}
-{% endif %}
-
- {# Content #}
-
-{% block pjax_content %}
-{% if message %}
-
- {{ message|raw }}
-
-{% endif %}
-{% block content %}{% endblock %}
-{% endblock %}
-
- {# /Content #}
-{% if show_footer %}
- {% block footer %}
- {# Footer #}
-
- {# /Footer #}
- {% endblock %}
-{% endif %}
-{{ script('main.js') }}
-
-
-{% endapply %}
diff --git a/old_version/templates/JSless/edit_service.html b/old_version/templates/JSless/edit_service.html
deleted file mode 100644
index affacf8..0000000
--- a/old_version/templates/JSless/edit_service.html
+++ /dev/null
@@ -1,212 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
-TODO
- {% if service.modalità == "edit" or service.modalità == "add" %}
-
-
- {% endif %}
- {% if service.modalità == "delete" %}
-
-
{{ 'Are you sure you want to delete the service?'|t }}
-
-
-
-
- {{ 'Submit'|t }}
-
-
-
- {% endif %}
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/edit_training.html b/old_version/templates/JSless/edit_training.html
deleted file mode 100644
index 76e499e..0000000
--- a/old_version/templates/JSless/edit_training.html
+++ /dev/null
@@ -1,136 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
-TODO
- {% if training.modalità == "edit" or training.modalità == "add" %}
-
-
-
- {{ 'Training day'|t }}
-
-
-
- {{ 'Name'|t }}
-
-
-
- {{ 'Start time'|t }}
-
-
-
- {{ 'End time'|t }}
-
-
-
-
-
- {% if option('use_location_picker') %}
-
{{ 'Training place'|t }}
-
-
-
- {% else %}
-
- {{ 'Training place'|t }}
-
-
-
- {% endif %}
-
- {{ 'Others notes (ex. others infos)'|t }}
-
-
-
-
-
-
-
{{ 'Submit'|t }}
-
-
-
- {% endif %}
- {% if training.modalità == "delete" %}
-
-
{{ 'Are you sure you want to delete the training?'|t }}
-
-
-
-
- {{ 'Submit'|t }}
-
-
-
- {% endif %}
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/edit_user.html b/old_version/templates/JSless/edit_user.html
deleted file mode 100644
index a45492a..0000000
--- a/old_version/templates/JSless/edit_user.html
+++ /dev/null
@@ -1,72 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
- {% if modalità == "edit" or modalità == "add" %}
-
-
-
- {% endif %}
- {% if modalità == "delete" %}
-
-
{{ 'Are you sure you want to delete the user?'|t }}
-
-
-
-
- {{ 'Submit'|t }}
-
-
- {% endif %}
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/index.html b/old_version/templates/JSless/index.html
deleted file mode 100644
index c42185e..0000000
--- a/old_version/templates/JSless/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
-
-
-
-
-
-
-
-
-
- {% if option('force_remember_cookie') %}
-
- {% else %}
-
- {% endif %}
-
-
- {% if error %}
-
-
{{ error.text|t }}
-
{{ 'Error'|t}} {{ 'code'|t}} {{ error.code }}. {{ 'Check the entered credentials and make sure they are correct'|t }}.
-
-
- {% endif %}
-
-
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/list.html b/old_version/templates/JSless/list.html
deleted file mode 100644
index b3b57b8..0000000
--- a/old_version/templates/JSless/list.html
+++ /dev/null
@@ -1,82 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
-
{{ 'Are you available in case of alert?'|t }}
-
-
-
-
- {{ 'Activate'|t }}
-
-
-
-
-
- {{ 'Deactivate'|t }}
-
-
-
-
-
-
-
-
-
- {{ 'Name'|t }}
- {{ 'Available'|t }}
- {% if user.full_viewer %}
- {{ 'Driver'|t }}
- {{ 'Call'|t }}
- {{ 'Write'|t }}
- {{ 'Services'|t }}
- {{ 'Availability Minutes'|t }}
- {# {{ 'Other'|t }} TODO: fix "Other" page #}
- {% endif %}
-
-{% for row in query_results %}
-
- {% if (date().timestamp-row.online_time) <= 30 %}
- {{ username(row.id) }}
- {% else %}
- {{ username(row.id) }}
- {% endif %}
-
- {{ yesOrNo(row.available) }}
- {% set function = row.available ? "deactivate" : "activate" %}
-
-
-
-
- {{ 'Change'|t }}
-
-
- {% if user.full_viewer %}
- {{ yesOrNo(row.driver) }}
- {% if row.phone_number %}
- Chiama
- {% else %}
-
- {% endif %}
- {% if row.phone_number %}
- Manda un messaggio
- {% else %}
-
- {% endif %}
- {{ row.services }}
- {{ row.availability_minutes }}
- {# {{ 'Other'|t }} TODO: fix "Other" page #}
- {% endif %}
-
-{% endfor %}
-
-
-
-
- {{ 'Add user'|t }}
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/log.html b/old_version/templates/JSless/log.html
deleted file mode 100644
index 72f4e94..0000000
--- a/old_version/templates/JSless/log.html
+++ /dev/null
@@ -1,26 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
-
-
-
- {{ 'Action'|t }}
- {{ 'Interested'|t }}
- {{ 'Made by'|t }}
- {{ 'Datetime'|t }}
-
-{% for row in query_results %}
-
- {{ row.action }}
- {{ username(row.changed) }}
- {{ username(row.editor) }}
- {{ row.timestamp }}
-
-{% endfor %}
-
-
-
- {% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/offline.html b/old_version/templates/JSless/offline.html
deleted file mode 100644
index 7157235..0000000
--- a/old_version/templates/JSless/offline.html
+++ /dev/null
@@ -1 +0,0 @@
-If you are using an old browser that doesn't support JS, you can't use Service Workers, so this page is useless.
\ No newline at end of file
diff --git a/old_version/templates/JSless/services.html b/old_version/templates/JSless/services.html
deleted file mode 100644
index d8692de..0000000
--- a/old_version/templates/JSless/services.html
+++ /dev/null
@@ -1,66 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
-
-
- {{ 'Add service'|t }}
-
-
-
-
- {{ 'Date'|t }}
- {{ 'code'|t|capitalize }}
- {{ 'Start time'|t }}
- {{ 'End time'|t }}
- {{ 'Chief'|t }}
- {{ 'Drivers'|t }}
- {{ 'Crew'|t }}
- {{ 'Place'|t }}
- {{ 'Notes'|t }}
- {{ 'Type'|t }}
- {% if option('service_edit') %}
- {{ 'Edit'|t }}
- {% endif %}
- {% if option('service_remove') %}
- {{ 'Remove'|t }}
- {% endif %}
-
-{% for row in query_results %}
-
- {{ row.date }}
- {{ row.code }}
- {{ row.beginning }}
- {{ row.end }}
- {{ username(row.chief) }}
- {{ username_list(row.drivers) }}
- {{ username_list(row.crew) }}
-
- {% if "#" in row.place %}
- {% set mapImageID = row.place|split('#')[1] %}
- {% set place = row.place|split('#')[0] %}
- {% set place_lat = place|split(';')[0] %}
- {% set place_lng = place|split(';')[1] %}
-
- {% endif %}
- Apri la mappa in Google Maps
- Apri la mappa in OpenStreetMap
- Lat: {{ place_lat }}
- Lng: {{ place_lng }}
-
- {{ row.notes }}
- {{ row.type }}
- {% if option('service_edit') %}
- Modifica
- {% endif %}
- {% if option('service_remove') %}
- Rimuovi
- {% endif %}
-
-{% endfor %}
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/trainings.html b/old_version/templates/JSless/trainings.html
deleted file mode 100644
index 366a235..0000000
--- a/old_version/templates/JSless/trainings.html
+++ /dev/null
@@ -1,62 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
-
-
- {{ 'Add training'|t }}
-
-
-
-
- {{ 'Date'|t }}
- {{ 'Name'|t }}
- {{ 'Start time'|t }}
- {{ 'End time'|t }}
- {{ 'Chief'|t }}
- {{ 'Crew'|t }}
- {{ 'Place'|t }}
- {{ 'Notes'|t }}
- {% if option('training_edit') %}
- {{ 'Edit'|t }}
- {% endif %}
- {% if option('training_remove') %}
- {{ 'Remove'|t }}
- {% endif %}
-
-{% for row in query_results %}
-
- {{ row.date }}
- {{ row.name }}
- {{ row.beginning }}
- {{ row.end }}
- {{ username(row.chief) }}
- {{ username_list(row.crew) }}
-
- {% if "#" in row.place %}
- {% set mapImageID = row.place|split('#')[1] %}
- {% set place = row.place|split('#')[0] %}
- {% set place_lat = place|split(';')[0] %}
- {% set place_lng = place|split(';')[1] %}
-
- {% endif %}
- Apri la mappa in Google Maps
- Apri la mappa in OpenStreetMap
- Lat: {{ place_lat }}
- Lng: {{ place_lng }}
-
- {{ row.notes }}
- {% if option('training_edit') %}
- Modifica
- {% endif %}
- {% if option('training_remove') %}
- Rimuovi
- {% endif %}
-
-{% endfor %}
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/JSless/user_details.html b/old_version/templates/JSless/user_details.html
deleted file mode 100644
index a6f261b..0000000
--- a/old_version/templates/JSless/user_details.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
- TEST - TODO
- {{ user.id }}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/base.html b/old_version/templates/base.html
deleted file mode 100644
index 9d79d2e..0000000
--- a/old_version/templates/base.html
+++ /dev/null
@@ -1,103 +0,0 @@
-{% apply minimize %}
-
-
-
- {% block head %}
-
{{ title }} - ALLERTA sistema gestionale {{ owner }}
-
-
-
-
-
- {% if delete_caches %}
-
- {% endif %}
- {% if delete_service_workers %}
-
- {% endif %}
- {{ script('main.js') }}
-
- {% endblock %}
- {% if enable_debug_bar %}{{ debug_bar_head|raw }}{% endif %}
-
-
-{% if show_menu %}
- {% block menu %}
- {# Menu #}
-
- {# /Menu #}
- {% endblock %}
-{% endif %}
-
-
{{ 'You are offline'|t }}. {{ 'Last update'|t }}:
-
-
-
{{ "JavaScript is disabled or it's not supported in your browser but it's required for using Allerta-VVF. If you want to continue, please enable JS or use the JS-less version ."|t|raw }}
-
- {# Content #}
-
-{% block pjax_content %}
-{% if message %}
-
- {{ message|raw }}
-
-{% endif %}
-{% if pjax_requested %}
{{ title }} - ALLERTA sistema gestionale {{ owner }} {% endif %}
-{% block content %}{% endblock %}
-{% endblock %}
-
- {# /Content #}
- {% if enable_debug_bar %}{{ debug_bar|raw }}{% endif %}
-{% if show_footer %}
- {% block footer %}
- {# Footer #}
-
- {# /Footer #}
- {% endblock %}
-{% endif %}
-
-
-{% endapply %}
\ No newline at end of file
diff --git a/old_version/templates/edit_service.html b/old_version/templates/edit_service.html
deleted file mode 100644
index 9a6b2a9..0000000
--- a/old_version/templates/edit_service.html
+++ /dev/null
@@ -1,220 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
- {% if service.modalità == "edit" or service.modalità == "add" %}
-
-
-
- {{ 'Service day'|t }}
-
-
-
- {{ 'code'|t|capitalize }}
-
-
-
- {{ 'Start time'|t }}
-
-
-
- {{ 'End time'|t }}
-
-
-
-
-
-
- {% if option('use_location_picker') %}
-
{{ 'Service place'|t }}
-
-
-
-
- {{ script('maps.js') }}
- {% else %}
-
- {{ 'Service place'|t }}
-
-
-
- {% endif %}
-
- {{ 'Others notes (ex. others infos)'|t }}
-
-
-
-
- {{ 'Service type'|t }}
-
-
- {% for type in service.types %}
- {{ type.name }}
- {% endfor %}
- {% if service.types is empty %}
-
- {% endif %}
- {{ 'Add type...'|t }}
-
-
-
-
-
-
-
{{ 'Submit'|t }}
-
-
-
- {% endif %}
- {% if service.modalità == "delete" %}
-
-
{{ 'Are you sure you want to delete the service?'|t }}
-
-
-
-
- {{ 'Submit'|t }}
-
-
-
- {% endif %}
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
diff --git a/old_version/templates/edit_training.html b/old_version/templates/edit_training.html
deleted file mode 100644
index d0cf6e0..0000000
--- a/old_version/templates/edit_training.html
+++ /dev/null
@@ -1,144 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
- {% if training.modalità == "edit" or training.modalità == "add" %}
-
-
-
- {{ 'Training day'|t }}
-
-
-
- {{ 'Name'|t }}
-
-
-
- {{ 'Start time'|t }}
-
-
-
- {{ 'End time'|t }}
-
-
-
-
-
- {% if option('use_location_picker') %}
-
{{ 'Training place'|t }}
-
-
-
-
- {{ script('maps.js') }}
- {% else %}
-
- {{ 'Training place'|t }}
-
-
-
- {% endif %}
-
- {{ 'Others notes (ex. others infos)'|t }}
-
-
-
-
-
-
-
{{ 'Submit'|t }}
-
-
-
- {% endif %}
- {% if training.modalità == "delete" %}
-
-
{{ 'Are you sure you want to delete the training?'|t }}
-
-
-
-
- {{ 'Submit'|t }}
-
-
-
- {% endif %}
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/edit_user.html b/old_version/templates/edit_user.html
deleted file mode 100644
index 4f822df..0000000
--- a/old_version/templates/edit_user.html
+++ /dev/null
@@ -1,83 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
- {% if modalità == "edit" or modalità == "add" %}
-
-
-
- {% endif %}
- {% if modalità == "delete" %}
-
-
{{ 'Are you sure you want to delete the user?'|t }}
-
-
-
-
- {{ 'Submit'|t }}
-
-
-
- {% endif %}
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/index.html b/old_version/templates/index.html
deleted file mode 100644
index de5f10a..0000000
--- a/old_version/templates/index.html
+++ /dev/null
@@ -1,60 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
-{% if error %}
-
-
{{ error.text|t }}
-
{{ 'Error'|t}} {{ 'code'|t}} {{ error.code }}. {{ 'Check the entered credentials and make sure they are correct'|t }}.
-
-
-
-{% endif %}
-
-
-
-{% block footer %}
-{% endblock %}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/list.html b/old_version/templates/list.html
deleted file mode 100644
index 28cd3e8..0000000
--- a/old_version/templates/list.html
+++ /dev/null
@@ -1,89 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
-
-
{{ 'Are you available in case of alert?'|t }}
-
{{ 'Activate'|t }}
-
{{ 'Deactivate'|t }}
-
-
- {{ 'Edit availability schedules'|t }}
-
-
-
-
-
-
-
-
-
-
-
- {{ 'Name'|t }}
- {{ 'Available'|t }}
- {% if user.full_viewer %}
- {{ 'Driver'|t }}
- {{ 'Call'|t }}
- {{ 'Write'|t }}
- {{ 'Services'|t }}
- {{ 'Availability Minutes'|t }}
- {# {{ 'Other'|t }} TODO: fix "Other" page #}
- {% endif %}
-
-
-
-
-
-
-
-{% if hasRole("SUPER_ADMIN") %}
-
-
- {{ 'Add user'|t }}
-
-{% endif %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/log.html b/old_version/templates/log.html
deleted file mode 100644
index 2eafec4..0000000
--- a/old_version/templates/log.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
-
-
-
-
-
- {{ 'Action'|t }}
- {{ 'Interested'|t }}
- {{ 'Made by'|t }}
- {{ 'Datetime'|t }}
-
-
-
-
-
-
-
-
- {% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/offline.html b/old_version/templates/offline.html
deleted file mode 100644
index d713297..0000000
--- a/old_version/templates/offline.html
+++ /dev/null
@@ -1,66 +0,0 @@
-{% extends "base.html" %}
-
-{% block menu %}
-{% endblock %}
-
-{% block content %}
-
-
-
-
-
-
-
-
- {{ 'Name'|t }}
- {{ 'Available'|t }}
- {% if user.full_viewer %}
- {{ 'Driver'|t }}
- {{ 'Call'|t }}
- {{ 'Write'|t }}
- {{ 'Services'|t }}
- {{ 'Availability Minutes'|t }}
- {# {{ 'Other'|t }} TODO: fix "Other" page #}
- {% endif %}
-
-
-
-
-
-
-
-
-
-
- {{ 'Delete the offline version of Allerta-VVF from this device.'|t }}
-
-
-
-
{{ 'You have cleared the cache; the table will be loaded when the device is connected to the Internet.'|t }}
-
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/services.html b/old_version/templates/services.html
deleted file mode 100644
index 0c278eb..0000000
--- a/old_version/templates/services.html
+++ /dev/null
@@ -1,44 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-{{ script('maps.js') }}
-
-
-
-
- {{ 'Add service'|t }}
-
-
-
-
-
-
- {{ 'Date'|t }}
- {{ 'code'|t|capitalize }}
- {{ 'Start time'|t }}
- {{ 'End time'|t }}
- {{ 'Chief'|t }}
- {{ 'Drivers'|t }}
- {{ 'Crew'|t }}
- {{ 'Place'|t }}
- {{ 'Notes'|t }}
- {{ 'Type'|t }}
- {% if option('service_edit') %}
- {{ 'Edit'|t }}
- {% endif %}
- {% if option('service_remove') %}
- {{ 'Remove'|t }}
- {% endif %}
-
-
-
-
-
-
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/trainings.html b/old_version/templates/trainings.html
deleted file mode 100644
index 2f67407..0000000
--- a/old_version/templates/trainings.html
+++ /dev/null
@@ -1,42 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-{{ script('maps.js') }}
-
-
-
-
- {{ 'Add training'|t }}
-
-
-
-
-
-
- {{ 'Date'|t }}
- {{ 'Name'|t }}
- {{ 'Start time'|t }}
- {{ 'End time'|t }}
- {{ 'Chief'|t }}
- {{ 'Crew'|t }}
- {{ 'Place'|t }}
- {{ 'Notes'|t }}
- {% if option('training_edit') %}
- {{ 'Edit'|t }}
- {% endif %}
- {% if option('training_remove') %}
- {{ 'Remove'|t }}
- {% endif %}
-
-
-
-
-
-
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/templates/user_details.html b/old_version/templates/user_details.html
deleted file mode 100644
index a6f261b..0000000
--- a/old_version/templates/user_details.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}
-
-
- TEST - TODO
- {{ user.id }}
-
-{% endblock %}
\ No newline at end of file
diff --git a/old_version/trainings.php b/old_version/trainings.php
deleted file mode 100644
index 1b94073..0000000
--- a/old_version/trainings.php
+++ /dev/null
@@ -1,10 +0,0 @@
-online_time_update();
- $query_results = $db->select("SELECT * FROM `".DB_PREFIX."_trainings` ORDER BY date DESC, beginning desc");
-} else {
- $query_results = null;
-}
-loadtemplate('trainings.html', ['title' => t('Trainings', false), 'query_results' => $query_results]);
-?>
diff --git a/old_version/translations/en/base.php b/old_version/translations/en/base.php
deleted file mode 100644
index 79e0be1..0000000
--- a/old_version/translations/en/base.php
+++ /dev/null
@@ -1,136 +0,0 @@
- "Personal data",
- "service" => "service",
- "training" => "training",
- "user" => "user",
- "Login" => "Login",
- "Profile page" => "Profile page",
- "Availability List" => "Availability List",
- "Services" => "Services",
- "Trainings" => "Trainings",
- "Logs" => "Logs",
- "Technical Support" => "Technical Support",
- "Hi, %s." => "Hi, %s.",
- "Logout" => "Logout",
- "Name" => "Name",
- "Available" => "Available",
- "Chief" => "Chief",
- "Driver" => "Driver",
- "Drivers" => "Drivers",
- "Crew" => "Crew",
- "Date" => "Date",
- "code" => "code",
- "Start time" => "Start time",
- "End time" => "End time",
- "Edit" => "Edit",
- "Remove" => "Remove",
- "Notes" => "Notes",
- "Place" => "Place",
- "Type" => "Type",
- "The code has been detected as incorrect, do you want to add the service anyway?" => "The code has been detected as incorrect, do you want to add the service anyway?",
- "Are you sure you want to delete the service?" => "Are you sure you want to delete the service?",
- "Are you sure you want to delete the training?" => "Are you sure you want to delete the training?",
- "Are you sure you want to delete the user?" => "Are you sure you want to delete the user?",
- "The action cannot be canceled. Are you sure you want to continue?" => "The action cannot be canceled. Are you sure you want to continue?",
- "Submit" => "Submit",
- "Phone number" => "Phone number",
- "Availability Minutes" => "Availability Minutes",
- "This month" => "This month",
- "Call" => "Call",
- "Write" => "Write",
- "Other" => "Other",
- "Others infos" => "Others infos",
- "Action" => "Action",
- "Interested" => "Interested",
- "Made by" => "Made by",
- "Datetime" => "Datetime",
- "Service day" => "Service day",
- "Service place" => "Service place",
- "Service type" => "Service type",
- "Training day" => "Training day",
- "Training place" => "Training place",
- "Others notes (ex. others infos)" => "Others notes (ex. others infos)",
- "E-mail" => "E-mail",
- "user@provider-email-domain.com" => "user@provider-email-domain.com",
- "Username" => "Username",
- "Name Surname" => "Name Surname",
- "name.surname" => "name.surname",
- "Password" => "Password",
- "Birthday" => "Birthday",
- "Visible" => "Visible",
- "Enabled" => "Enabled",
- "username" => "username",
- "password" => "password",
- "Stay connected" => "Stay connected",
- "Are you available in case of alert?" => "Are you available in case of alert?",
- "Activate" => "Activate",
- "Deactivate" => "Deactivate",
- "your availability" => "your availability",
- "%s availability" => "%s availability",
- "Thanks, %s, you have given %s in case of alert." => "Thanks, %s, you have given %s in case of alert.",
- "Thanks, %s, you have removed %s in case of alert." => "Thanks, %s, you have removed %s in case of alert.",
- "Add service" => "Add service",
- "Add training" => "Add training",
- "Add user" => "Add user",
- "Edit service" => "Edit service",
- "Edit training" => "Edit training",
- "Edit user" => "Edit user",
- "Delete service" => "Delete service",
- "Delete training" => "Delete training",
- "Delete user" => "Delete user",
- "You are offline" => "You are offline",
- "Last update" => "Last update",
- "Search" => "Search",
- "Search results" => "Search results",
- "No results found" => "No results found",
- "Error" => "Error",
- "Check the entered credentials and make sure they are correct" => "Check the entered credentials and make sure they are correct",
- "Wrong email address" => "Wrong email address",
- "Wrong password" => "Wrong password",
- "Email not verified" => "Email not verified",
- "Wrong username" => "Wrong username",
- "Too many requests" => "Too many requests",
- "Add type..." => "Add type...",
- "Insert type name:" => "Insert type name:",
- "Added service type" => "Added service type",
- "Type '%s' added successfully." => "Type '%s' added successfully.",
- "You must select a valid service type!" => "You must select a valid service type!",
- "Status changed to 'available'" => "Status changed to 'available'",
- "Status changed to 'not available'" => "Status changed to 'not available'",
- "Service added" => "Service added",
- "Service edited" => "Service edited",
- "Service removed" => "Service removed",
- "Training added" => "Training added",
- "Training edited" => "Training edited",
- "Training removed" => "Training removed",
- "User added" => "User added",
- "User edited" => "User edited",
- "User removed" => "User removed",
- "Loading..." => "Loading...",
- "Schedules updated successfully" => "Schedules updated successfully",
- "Edit availability schedules" => "Edit availability schedules",
- "Save changes" => "Save changes",
- "Close" => "Close",
- "Mon" => "Mon",
- "Tue" => "Tue",
- "Wed" => "Wed",
- "Thu" => "Thu",
- "Fri" => "Fri",
- "Sat" => "Sat",
- "Sun" => "Sun",
- "Do you want to exclude holidays from schedules?" => "Do you want to exclude holidays from schedules?",
- "Select all" => "Select all",
- "Remove selections" => "Remove selections",
- "JavaScript is disabled or it's not supported in your browser but it's required for using Allerta-VVF. If you want to continue, please enable JS
or use the JS-less version ." => "JavaScript is disabled or it's not supported in your browser but it's required for using Allerta-VVF. If you want to continue, please enable JS
or use the JS-less version .",
- "yes" => "yes",
- "no" => "no",
- "You are not authorized to perform this action." => "You are not authorized to perform this action.",
- "Bad request." => "Bad request.",
- "User not exists." => "User not exists.",
- "Change" => "Change",
- "Delete the offline version of Allerta-VVF from this device." => "Delete the offline version of Allerta-VVF from this device.",
- "You have cleared the cache; the table will be loaded when the device is connected to the Internet." => "You have cleared the cache; the table will be loaded when the device is connected to the Internet."
-];
diff --git a/old_version/translations/it/base.php b/old_version/translations/it/base.php
deleted file mode 100644
index 83e5030..0000000
--- a/old_version/translations/it/base.php
+++ /dev/null
@@ -1,136 +0,0 @@
- "Dati anagrafici",
- "service" => "intervento",
- "training" => "esercitazione",
- "user" => "utente",
- "Login" => "Login",
- "Profile page" => "Pagina di profilo",
- "Availability List" => "Lista disponibilità",
- "Services" => "Interventi",
- "Trainings" => "Esercitazioni",
- "Logs" => "Logs",
- "Technical Support" => "Supporto Tecnico",
- "Hi, %s." => "Ciao, %s.",
- "Logout" => "Logout",
- "Name" => "Nome",
- "Available" => "Disponibile",
- "Chief" => "Caposquadra",
- "Driver" => "Autista",
- "Drivers" => "Autisti",
- "Crew" => "Altre persone",
- "Date" => "Data",
- "code" => "codice",
- "Start time" => "Tempo inizio",
- "End time" => "Tempo fine",
- "Edit" => "Modifica",
- "Remove" => "Rimuovi",
- "Notes" => "Note",
- "Place" => "Luogo",
- "Type" => "Tipo",
- "The code has been detected as incorrect, do you want to add the service anyway?" => "Il codice è stato rilevato come non corretto, vuoi inserire l'intervento comunque?",
- "Are you sure you want to delete the service?" => "Sei sicuro di voler rimuovere l'intervento?",
- "Are you sure you want to delete the training?" => "Sei sicuro di voler rimuovere l'esercitazione?",
- "Are you sure you want to delete the user?" => "Sei sicuro di voler rimuovere l'utente?",
- "The action cannot be canceled. Are you sure you want to continue?" => "L'azione non potrà essere annullata. Sei sicuro di voler continuare?",
- "Submit" => "Invia",
- "Phone number" => "Numero di telefono",
- "Availability Minutes" => "Minuti di Disponibilità",
- "This month" => "Questo mese",
- "Call" => "Chiama",
- "Write" => "Scrivi",
- "Other" => "Altro",
- "Others infos" => "Altri dettagli",
- "Action" => "Azione",
- "Interested" => "Interessato",
- "Made by" => "Fatto da",
- "Datetime" => "Data e ora",
- "Service day" => "Giorno dell'intervento",
- "Service place" => "Luogo dell'intervento",
- "Service type" => "Tipologia dell'intervento",
- "Training day" => "Giorno dell'addestramento",
- "Training place" => "Luogo dell'addestramento",
- "Others notes (ex. others infos)" => "Altre note (es. altre informazioni)",
- "E-mail" => "E-mail",
- "user@provider-email-domain.com" => "utente@provider-email-dominio.com",
- "Username" => "Username",
- "Name Surname" => "Nome Cognome",
- "name.surname" => "nome.cognome",
- "Password" => "Password",
- "Birthday" => "Data di nascita",
- "Visible" => "Visibile",
- "Enabled" => "Attiva",
- "username" => "username",
- "password" => "password",
- "Stay connected" => "Rimani connesso",
- "Are you available in case of alert?" => "Sei disponibile in caso di allerta?",
- "Activate" => "Attiva",
- "Deactivate" => "Disattiva",
- "your availability" => "la tua disponibilità",
- "%s availability" => "la disponibilità di %s",
- "Thanks, %s, you have given %s in case of alert." => "Grazie, %s, hai dato %s in caso di allerta.",
- "Thanks, %s, you have removed %s in case of alert." => "Grazie, %s, hai rimosso %s in caso di allerta.",
- "Add service" => "Aggiungi intervento",
- "Add training" => "Aggiungi esercitazione",
- "Add user" => "Aggiungi utente",
- "Edit service" => "Modifica intervento",
- "Edit training" => "Modifica esercitazione",
- "Edit user" => "Modifica utente",
- "Delete service" => "Rimuovi intervento",
- "Delete training" => "Rimuovi esercitazione",
- "Delete user" => "Rimuovi utente",
- "You are offline" => "Sei offline",
- "Last update" => "Ultimo aggiornamento",
- "Search" => "Cerca",
- "Search results" => "Risultati della ricerca",
- "No results found" => "Nessun risultato trovato",
- "Error" => "Errore",
- "Check the entered credentials and make sure they are correct" => "Controlla le credenziali inserite e accertati che siano corrette",
- "Wrong email address" => "Indirizzo email errato",
- "Wrong password" => "Password errata",
- "Email not verified" => "Indirizzo email non verificato",
- "Wrong username" => "Username errato",
- "Too many requests" => "Troppi tentativi effettuati",
- "Add type..." => "Aggiungi tipologia...",
- "Insert type name:" => "Inserisci nome della tipologia:",
- "Added service type" => "Aggiunta tipologia intervento",
- "Type '%s' added successfully." => "Tipologia '%s' aggiunta con successo.",
- "You must select a valid service type!" => "Devi selezionare una tipologia di intervento valida!",
- "Status changed to 'available'" => "Attivazione disponibilita'",
- "Status changed to 'not available'" => "Rimozione disponibilita'",
- "Service added" => "Intervento aggiunto",
- "Service edited" => "Intervento modificato",
- "Service removed" => "Intervento rimosso",
- "Training added" => "Esercitazione aggiunta",
- "Training edited" => "Esercitazione modificata",
- "Training removed" => "Esercitazione rimossa",
- "User added" => "Utente aggiunto",
- "User edited" => "Utente modificato",
- "User removed" => "Utente rimosso",
- "Loading..." => "Caricamento...",
- "Schedules updated successfully" => "Orari aggiornati con successo",
- "Edit availability schedules" => "Modifica orari disponibilità",
- "Save changes" => "Salva le modifiche",
- "Close" => "Chiudi",
- "Mon" => "Lun",
- "Tue" => "Mar",
- "Wed" => "Mer",
- "Thu" => "Gio",
- "Fri" => "Ven",
- "Sat" => "Sab",
- "Sun" => "Dom",
- "Do you want to exclude holidays from schedules?" => "Vuoi escudere giorni festivi dalla programmazione degli orari?",
- "Select all" => "Seleziona tutti",
- "Remove selections" => "Rimuovi selezioni",
- "JavaScript is disabled or it's not supported in your browser but it's required for using Allerta-VVF. If you want to continue, please enable JS
or use the JS-less version ." => "JavaScript è disabilitato o non è supportato dal tuo browser, ma è richiesto per utilizzare Allerta-VVF. Per continuare, abilita JS
o usa la versione senza JS .",
- "yes" => "si",
- "no" => "no",
- "You are not authorized to perform this action." => "Non sei autorizzato ad eseguire questa azione.",
- "Bad request." => "Errore nella richiesta.",
- "User not exists." => "L'utente non esiste.",
- "Change" => "Cambia",
- "Delete the offline version of Allerta-VVF from this device." => "Cancella la versione offline di Allerta-VVF da questo dispositivo.",
- "You have cleared the cache; the table will be loaded when the device is connected to the Internet." => "Hai svuotato la cache; la tabella verrà caricata quando il dispositivo sarà connesso ad Internet."
-];
diff --git a/old_version/ui.php b/old_version/ui.php
deleted file mode 100644
index becb938..0000000
--- a/old_version/ui.php
+++ /dev/null
@@ -1,220 +0,0 @@
-script_nonce;
-
-if(!is_null($debugbar)){
- $enable_debugbar = true;
- $debugbarRenderer = $debugbar->getJavascriptRenderer("./vendor/maximebf/debugbar/src/DebugBar/Resources");
- $debugbarRenderer->disableVendor("jquery");
- $debugbarRenderer->setEnableJqueryNoConflict(false);
- $debugbarRenderer->setOpenHandlerUrl('debug_open.php');
- $debugbarRenderer->setJSNonce($nonce);
-} else {
- $enable_debugbar = false;
-}
-
-$url_software = get_option("web_url");
-
-p_start("Load Twig");
-$webpack_manifest = json_decode(
- file_get_contents(realpath("resources/dist/assets-manifest.json")),
- true
-);
-
-if(isset($_COOKIE["JSless"]) && $_COOKIE["JSless"]){
- $templates_dir = $_COOKIE["JSless"] ? "templates/JSless" : "templates";
- $JSless = true;
-} else {
- $templates_dir = "templates";
- $JSless = false;
-}
-
-if(isset($_GET["JSless"])){
- if($_GET["JSless"]){
- setcookie("JSless", true, time() + (86400 * 365));
- $templates_dir = "templates/JSless";
- $JSless = true;
- } else {
- setcookie("JSless", null, time() - 3600);
- $templates_dir = "templates";
- $JSless = false;
- }
-}
-
-try {
- $loader = new \Twig\Loader\FilesystemLoader($templates_dir);
-} catch (Exception $e) {
- $loader = new \Twig\Loader\FilesystemLoader('../'.$templates_dir);
-}
-$twig = new \Twig\Environment(
- $loader, [
- //'cache' => 'compilation'
- ]
-);
-
-$filter_translate = new \Twig\TwigFilter(
- 't', function ($string) {
- global $translations;
- return $translations->translate($string);
- }
-);
-$twig->addFilter($filter_translate);
-
-$function_option = new \Twig\TwigFunction(
- 'option', "get_option"
-);
-$twig->addFunction($function_option);
-
-$function_username = new \Twig\TwigFunction(
- 'username', function ($id) {
- global $user;
- return $user->nameById($id);
- }
-);
-$twig->addFunction($function_username);
-
-$function_username_list = new \Twig\TwigFunction(
- 'username_list', function ($id_list) {
- global $user;
- $user_list = [];
- foreach (explode(",", $id_list) as $id) {
- $user_list[] = $user->nameById($id);
- }
- return implode(", ", $user_list);
- }
-);
-$twig->addFunction($function_username_list);
-
-$function_resource = new \Twig\TwigFunction(
- 'resource', function ($file) {
- global $webpack_manifest;
- return $webpack_manifest[$file]["src"];
- }
-);
-$twig->addFunction($function_resource);
-
-$function_script = new \Twig\TwigFunction(
- 'script', function ($context, $file) {
- global $nonce, $url_software, $webpack_manifest;
- $script_url = $url_software . "/resources/dist/" . $webpack_manifest[$file]["src"];
- $script_integrity = $webpack_manifest[$file]["integrity"];
-
- $script_tag = "