Skip to content

Commit

Permalink
Merge pull request #304 from Evarisk/develop
Browse files Browse the repository at this point in the history
1.2.0
  • Loading branch information
nicolas-eoxia authored Sep 27, 2024
2 parents 2d52605 + 74f399a commit e7e0c1a
Show file tree
Hide file tree
Showing 72 changed files with 3,580 additions and 7,970 deletions.
23 changes: 0 additions & 23 deletions .gitattributes

This file was deleted.

26 changes: 21 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Generated binaries
/build/*.zip
/bin/*.zip
# Doxygen generated documentation
/build/doxygen/doxygen_warnings.log
/doc/code/doxygen
# Composer managed dependencies
/vendor
/dev/bin
# PHPdocumentor generated files
/build/phpdoc
/doc/code/phpdoc
# Sphinx generated files
/doc/user/build
/.settings/
/.buildpath
/.project
# Other
*.back
/.editorconfig
/.gitattributes
node_modules
npm-debug.log
.idea
vendor
.editorconfig
.gitattributes
package-lock.json
9 changes: 0 additions & 9 deletions .tx/config

This file was deleted.

11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
## Informations

- Numéro du module : 436380
- Version : 1.1.1
- Dernière mise à jour : 15/11/2023
- Dernière mise à jour : 27/09/2023
- Éditeur : [Evarisk](https://evarisk.com)
- Thème : Eldy Menu
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux

### Version

- Version : 1.1.1
- Compatibilité : Dolibarr 16.0.0 - 17.0.2
- Saturne Framework : 1.1.1
- Version : 1.2.0
- PHP : 7.4.33
- Compatibilité : Dolibarr 19.0.0 - 20.0.0
- Saturne Framework : 1.6.1

## Liens

Expand Down Expand Up @@ -50,3 +50,4 @@ Gérez la facturation de vos prestations de réparation et de maintenance de vé
git clone https://github.com/Evarisk/dolicar.git
git clone https://github.com/Evarisk/saturne.git
```
- Activer le module dans la liste des Modules/Applications installés
88 changes: 0 additions & 88 deletions admin/about.php

This file was deleted.

129 changes: 129 additions & 0 deletions admin/publicinterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php
/* Copyright (C) 2024 EVARISK <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
* \file admin/publicinterface.php
* \ingroup dolicar
* \brief DoliCar publicinterface config page
*/

// Load DoliCar environment
if (file_exists('../dolicar.main.inc.php')) {
require_once __DIR__ . '/../dolicar.main.inc.php';
} elseif (file_exists('../../dolicar.main.inc.php')) {
require_once __DIR__ . '/../../dolicar.main.inc.php';
} else {
die('Include of dolicar main fails');
}

// Load Dolibarr libraries
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';

// Load DoliCar libraries
require_once __DIR__ . '/../lib/dolicar.lib.php';

// Global variables definitions
global $conf, $db, $hookmanager, $langs, $moduleName, $moduleNameLowerCase, $user;

// Load translation files required by the page
saturne_load_langs();

// Get parameters
$action = GETPOST('action', 'alpha');

// Initialize view objects
$form = new Form($db);

$hookmanager->initHooks(['publicinterfaceadmin', 'globalcard']); // Note that conf->hooks_modules contains array

// Security check - Protection if external user
$permissiontoread = $user->rights->$moduleNameLowerCase->adminpage->read;
saturne_check_access($permissiontoread);

/*
* Actions
*/

if ($action == 'set_public_interface_config') {
dolibarr_set_const($db, 'DOLICAR_PUBLIC_MAX_ARRIVAL_MILEAGE', GETPOST('max_arrival_mileage'), 'integer', 0, '', $conf->entity);

setEventMessage('SavedConfig');
header('Location: ' . $_SERVER['PHP_SELF']);
exit;
}

/*
* View
*/

$title = $langs->trans('ModuleSetup', $moduleName);
$helpUrl = 'FR:Module_DoliCar';

saturne_header(0,'', $title, $helpUrl);

// Subheader
$linkBack = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1' . '">' . $langs->trans('BackToModuleList') . '</a>';
print load_fiche_titre($title, $linkBack, 'title_setup');

// Configuration header
$head = dolicar_admin_prepare_head();
print dol_get_fiche_head($head, 'publicinterface', $title, -1, 'dolicar_color@dolicar');

$publicInterfaceUrl = dol_buildpath('custom/dolicar/public/agenda/public_vehicle_logbook.php?entity=' . $conf->entity, 3);
print '<a class="marginrightonly" href="' . $publicInterfaceUrl . '" target="_blank">' . img_picto('', 'url', 'class="pictofixedwidth"') . $langs->trans('PublicInterfaceObject', $langs->transnoentities('OfPublicVehicleLogBook')) . '</a>';
print showValueWithClipboardCPButton($publicInterfaceUrl, 0, 'none');

print load_fiche_titre($langs->trans('Config'), '', '');

print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '" name="public_interface_config">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="set_public_interface_config">';

print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans('Parameters') . '</td>';
print '<td>' . $langs->trans('Description') . '</td>';
print '<td>' . $langs->trans('Value') . '</td>';
print '</tr>';

// Public Interface UseSignatoryUse signatory
print '<tr class="oddeven"><td>';
print $langs->transnoentities('Signature');
print '</td><td>';
print $langs->transnoentities('PublicInterfaceUseSignatoryDescription');
print '</td>';
print '<td>';
print ajax_constantonoff('DOLICAR_PUBLIC_INTERFACE_USE_SIGNATORY');
print '</td></tr>';

print '<tr class="oddeven"><td>';
print $langs->transnoentities('MaxArrivalMileage');
print '</td><td>';
print $langs->transnoentities('MaxArrivalMileageDescription');
print '</td>';
print '<td>';
print img_picto('', 'fontawesome_fa-sort-numeric-up-alt', 'class="pictofixedwidth"') . '<input type="number" name="max_arrival_mileage" min="0" value="' . getDolGlobalInt('DOLICAR_PUBLIC_MAX_ARRIVAL_MILEAGE', 1000) . '"></td>';
print '</td></tr>';

print '</table>';
print $form->buttonsSaveCancel('Save', '');
print '</form>';

// Page end
print dol_get_fiche_end();
llxFooter();
$db->close();
Loading

0 comments on commit e7e0c1a

Please sign in to comment.