Skip to content

Commit

Permalink
Merge pull request #269 from nicolas-eoxia/clean_code_and_files
Browse files Browse the repository at this point in the history
#268 [Mod] clean: all files with PSR-12 - PHPCS
  • Loading branch information
nicolas-eoxia authored Sep 12, 2024
2 parents 97b52da + cb7ee78 commit 9e107aa
Show file tree
Hide file tree
Showing 51 changed files with 2,715 additions and 7,839 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.

2 changes: 0 additions & 2 deletions .tx/index.php

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 : 17/07/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 16.0.0 - 20.0.0
- Saturne Framework : 1.5.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.

75 changes: 23 additions & 52 deletions admin/quickcreation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <[email protected]>
* Copyright (C) 2022 SuperAdmin <[email protected]>
/* Copyright (C) 2023-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
Expand All @@ -17,82 +16,57 @@
*/

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

// Load DoliCar environment
if (file_exists('../dolicar.main.inc.php')) {
require_once __DIR__ . '/../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';
require_once __DIR__ . '/../../dolicar.main.inc.php';
} else {
die('Include of dolicar main fails');
die('Include of dolicar main fails');
}

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

// Libraries
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";

// Load DoliCar libraries
require_once __DIR__ . '/../lib/dolicar.lib.php';
require_once __DIR__ . '/../lib/dolicar_functions.lib.php';
require_once __DIR__ . '/../lib/dolicar_registrationcertificatefr.lib.php';
//require_once "../class/myclass.class.php";

// Translations
saturne_load_langs(['admin', 'categories']);

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('dolicarsetup', 'globalsetup'));

// Access control
$permissiontoread = $user->rights->dolicar->adminpage->read;
saturne_check_access($permissiontoread);

// Parameters
$action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
// Global variables definitions
global $conf, $db, $langs, $user;

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

include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
// Security check - Protection if external user
$permissionToRead = $user->rights->dolicar->adminpage->read && isModEnabled('easycrm');
saturne_check_access($permissionToRead);

/*
* View
*/

$form = new Form($db);

$help_url = '';
$page_name = $langs->transnoentities('DolicarSetup');
$title = $langs->trans('ModuleSetup', 'DoliCar');
$helpUrl = 'FR:Module_DoliCar';

saturne_header(0, '', $langs->trans($page_name), $help_url);
saturne_header(0, '', $title, $helpUrl);

// Subheader
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
$linkBack = '<a href="'. DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1' . '">' . $langs->trans('BackToModuleList') . '</a>';

print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
print load_fiche_titre($title, $linkBack, 'title_setup');

// Configuration header
$head = dolicar_admin_prepare_head();
print dol_get_fiche_head($head, 'quickcreation', $langs->trans($page_name), -1, "dolicar_color@dolicar");
print dol_get_fiche_head($head, 'quickcreation', $title, -1, 'dolicar_color@dolicar');

print load_fiche_titre($langs->transnoentities("QuickCreationConfiguration"), '', '');
print load_fiche_titre($langs->transnoentities('Config'), '', '');

print '<div class="div-table-responsive-no-min">';
print '<form id="APIUsername">';
print '<input hidden name="action" value="setAPIUsername">';
print '<input hidden name="token" value="'. newToken() .'">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>' . $langs->transnoentities("Parameters") . '</td>';
print '<td class="center">' . $langs->transnoentities("Value") . '</td>';
print '<td>' . $langs->transnoentities('Parameters') . '</td>';
print '<td class="center">' . $langs->transnoentities('Status') . '</td>';
print '</tr>';

print '<tr class="oddeven">';
Expand Down Expand Up @@ -124,11 +98,8 @@
print '</tr>';

print '</table>';
print '</form>';
print '</div>';

// Page end
print dol_get_fiche_end();

llxFooter();
$db->close();
Loading

0 comments on commit 9e107aa

Please sign in to comment.