Skip to content

Commit 580fa7b

Browse files
Merge pull request #12 from Evarisk/develop
1.0.0
2 parents c84cb28 + 5424741 commit 580fa7b

28 files changed

+1585
-2
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig is awesome: https://editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 2
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
15+
[*.php]
16+
indent_size = 4
17+
18+
[*.md]
19+
trim_trailing_whitespace = false

.github/workflows/changelog.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Generate Auto Changelog'
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
master:
8+
name: 'build'
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
with:
13+
fetch-depth: 0
14+
- name: Generate Auto Changelog
15+
uses: Evarisk/action-auto-changelog@master
16+
with:
17+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated binaries
2+
/build/*.zip
3+
/bin/*.zip
4+
# Doxygen generated documentation
5+
/build/doxygen/doxygen_warnings.log
6+
/doc/code/doxygen
7+
# Composer managed dependencies
8+
/vendor
9+
/dev/bin
10+
# PHPdocumentor generated files
11+
/build/phpdoc
12+
/doc/code/phpdoc
13+
# Sphinx generated files
14+
/doc/user/build
15+
/.settings/
16+
/.buildpath
17+
/.project
18+
# Other
19+
*.back
20+
/.gitattributes
21+
node_modules
22+
package-lock.json

COPYING

Lines changed: 621 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
1-
# digiboard
2-
Tableau de bord pour les applications DigiRisk, DigiQuali et bien plus ...
1+
# DigiBoard sur [DOLIBARR ERP CRM](https://dolibarr.org)
2+
3+
## Informations
4+
5+
- Numéro du module : 436320
6+
- Dernière mise à jour : 11/10/2024
7+
- Éditeur : [Evarisk](https://evarisk.com)
8+
- Thème : Eldy Menu
9+
- Licence : GPLv3
10+
- Disponible sur : Windows - MacOS - Linux
11+
12+
### Version
13+
14+
- Version : 1.0.0
15+
- PHP : 7.4.33
16+
- Compatibilité : Dolibarr 19.0.3 - 20.0.0
17+
- Saturne Framework : 1.7.0
18+
19+
## Liens
20+
21+
- Support & Assistance : [Forum dolibarr.fr](https://dolibarr.fr) / Par mail à [email protected]
22+
- Demo : [Demo DigiBoard](https://demodoli.digirisk.com) - ID: demo - Password: demo
23+
- Documentation : [Wiki DigiBoard](https://wiki.dolibarr.org/index.php/Module_DigiBoard)
24+
- Projet Github : [Projet DigiBoard](https://github.com/Evarisk/digiboard/projects?query=is%3Aopen)
25+
- Saturne Framework : [Télécharger Saturne](https://dolistore.com/fr/modules/1906-Saturne.html)
26+
- D'autres modules développés par Evarisk disponibles sur [Dolistore.com](https://dolistore.com)
27+
28+
## Fonctionnalités
29+
30+
- Tableau de bord pour les applications DigiRisk, DigiQuali et bien plus ...
31+
32+
## Traductions
33+
34+
- Français
35+
- Anglais
36+
37+
## Installation
38+
39+
### Méthode 1 :
40+
41+
- Depuis le menu "Déployer/Installer un module externe" de Dolibarr :
42+
- Glisser l'archive ZIP 'module_digiboard-X.Y.Z' et cliquer sur "ENVOYER FICHIER"
43+
- Glisser l'archive ZIP 'module_saturne-X.Y.Z' et cliquer sur "ENVOYER FICHIER"
44+
- Activer le module dans la liste des Modules/Applications installés
45+
46+
### Méthode 2 :
47+
48+
- Dans le dossier "dolibarr/htdocs/custom" copier la ligne suivante :
49+
```
50+
git clone https://github.com/Evarisk/digiboard.git
51+
git clone https://github.com/Evarisk/saturne.git
52+
```
53+
- Activer le module dans la liste des Modules/Applications installés

admin/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
//Silence is golden

admin/setup.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
/* Copyright (C) 2024 EVARISK <[email protected]>
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
/**
19+
* \file admin/setup.php
20+
* \ingroup digiboard
21+
* \brief DigiBoard setup page
22+
*/
23+
24+
// Load DigiBoard environment
25+
if (file_exists('../digiboard.main.inc.php')) {
26+
require_once __DIR__ . '/../digiboard.main.inc.php';
27+
} elseif (file_exists('../../digiboard.main.inc.php')) {
28+
require_once __DIR__ . '/../../digiboard.main.inc.php';
29+
} else {
30+
die('Include of digiboard main fails');
31+
}
32+
33+
// Load DigiBoard libraries
34+
require_once __DIR__ . '/../lib/digiboard.lib.php';
35+
36+
// Global variables definitions
37+
global $conf, $db, $langs, $user;
38+
39+
// Load translation files required by the page
40+
saturne_load_langs();
41+
42+
// Get parameters
43+
$action = GETPOST('action', 'alpha');
44+
45+
// Security check - Protection if external user
46+
$permissionToRead = $user->hasRight('digiboard', 'adminpage', 'read');
47+
saturne_check_access($permissionToRead);
48+
49+
/*
50+
* View
51+
*/
52+
53+
$title = $langs->trans('ModuleSetup', 'DigiBoard');
54+
$help_url = 'FR:Module_DigiBoard';
55+
56+
saturne_header(0,'', $title, $help_url);
57+
58+
// Subheader
59+
$linkBack = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1' . '">' . $langs->trans('BackToModuleList') . '</a>';
60+
print load_fiche_titre($title, $linkBack, 'title_setup');
61+
62+
// Configuration header
63+
$head = digiboard_admin_prepare_head();
64+
print dol_get_fiche_head($head, 'settings', $title, -1, 'digiboard_color@digiboard');
65+
66+
$constArray['digiboard'] = [
67+
'DIGIBOARD_DIGIRISIK_STATS_LOAD_ACCIDENT' => [
68+
'name' => 'DigiRiskStatsLoadAccident',
69+
'description' => 'DigiRiskStatsLoadAccidentDescription',
70+
'code' => 'DIGIBOARD_DIGIRISIK_STATS_LOAD_ACCIDENT',
71+
]
72+
];
73+
require __DIR__ . '/../../saturne/core/tpl/admin/object/object_const_view.tpl.php';
74+
75+
// Page end
76+
print dol_get_fiche_end();
77+
$db->close();
78+
llxFooter();

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
### Changelog

class/actions_digiboard.class.php

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?php
2+
/* Copyright (C) 2024 EVARISK <[email protected]>
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
/**
19+
* \file class/actions_digiboard.class.php
20+
* \ingroup digiboard
21+
* \brief DigiBoard hook overload
22+
*/
23+
24+
/**
25+
* Class ActionsDigiboard
26+
*/
27+
class ActionsDigiboard
28+
{
29+
/**
30+
* @var DoliDB Database handler
31+
*/
32+
public DoliDB $db;
33+
34+
/**
35+
* @var string Error code (or message)
36+
*/
37+
public string $error = '';
38+
39+
/**
40+
* @var array Errors.
41+
*/
42+
public array $errors = [];
43+
44+
/**
45+
* @var array Hook results. Propagated to $hookmanager->resArray for later reuse
46+
*/
47+
public array $results = [];
48+
49+
/**
50+
* @var string|null String displayed by executeHook() immediately after return
51+
*/
52+
public ?string $resprints;
53+
54+
/**
55+
* Constructor
56+
*
57+
* @param DoliDB $db Database handler
58+
*/
59+
public function __construct(DoliDB $db)
60+
{
61+
$this->db = $db;
62+
}
63+
64+
/**
65+
* Overloading the addHtmlHeader function : replacing the parent's function with the one below
66+
*
67+
* @param array $parameters Hook metadata (context, etc...)
68+
* @return int 0 < on error, 0 on success, 1 to replace standard code
69+
*/
70+
public function addHtmlHeader(array $parameters): int
71+
{
72+
if (strpos($parameters['context'], 'digiboardindex') !== false) {
73+
$resourcesRequired = [
74+
'css' => '/custom/digiriskdolibarr/css/digiriskdolibarr.min.css',
75+
];
76+
77+
$out = '<!-- Includes CSS added by module digiriskdolibarr -->';
78+
$out .= '<link rel="stylesheet" type="text/css" href="' . dol_buildpath($resourcesRequired['css'], 1) . '">';
79+
80+
$this->resprints = $out;
81+
}
82+
83+
return 0; // or return 1 to replace standard code
84+
}
85+
86+
/**
87+
* Overloading the printUserListWhere function : replacing the parent's function with the one below
88+
*
89+
* @param array $parameters Hook metadata (context, etc...)
90+
* @return int 0 < on error, 0 on success, 1 to replace standard code
91+
*/
92+
public function printUserListWhere(array $parameters): int
93+
{
94+
if (strpos($parameters['context'], 'digiboardindex') !== false) {
95+
$this->resprints = ' WHERE 1 = 1';
96+
return 1;
97+
}
98+
99+
return 0; // or return 1 to replace standard code
100+
}
101+
}

0 commit comments

Comments
 (0)