Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [3.1.0] - Compatibility 14.0.x - 21.0.x (2024/12/30)

### Fixed
- CSS
### [3.1.0] - Compatibility 18.0.x - 23.0.x (2025/11/08)

### Added
- Option to change the Dolibarr font family
- In admin, new tab "Icons". If you want to use other FontAwesome Pack Free Or Pro, you can select easily your new pack to apply
- In admin, add possibility to disable thumb production (MRP) on the dashboard (v23+)
- Compatibility v21 / v22 / v23

### Fixed
- CSS
- Menu (Remove categories/tags in v22 -> move to tools)

### Changed
- Move ChangeLog to format 1.1.0 of "Keep a changelog"
- Separate the option to change the text color of line titles and the main title
- Remove Cashdesk CSS
- Move to version v18 minimum

### [3.0.6] - Compatibility 14.0.x - 20.0.x (2024/09/30)
- Fix CSS badges
Expand Down
6 changes: 3 additions & 3 deletions admin/colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,13 @@

// View *****************************************
$page_name = $langs->trans('OblyonColorsTitle');
llxHeader('', $page_name, '', '', 0, 0, array('/oblyon/js/jscolor.js', '/oblyon/js/jquery.ui.touch-punch.min.js'), '');
llxHeader('', $page_name, '', '', 0, 0, array('/oblyon/js/jscolor.js', '/oblyon/js/jquery.ui.touch-punch.min.js'), '', 'mod-oblyon page-admin-colors');
$linkback = '<a href = "'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans('BackToModuleList').'</a>';
print load_fiche_titre($page_name, $linkback);
print load_fiche_titre($page_name, $linkback, 'object_inovea.png@oblyon');

// Configuration header *************************
$head = oblyon_admin_prepare_head();
print dol_get_fiche_head($head, 'colors', $langs->trans('Module432573Name'), 0, 'inovea@oblyon');
print dol_get_fiche_head($head, 'colors', $page_name, -1);

// setup page goes here *************************
print ' <script type = "text/javascript">
Expand Down
4 changes: 2 additions & 2 deletions admin/customcss.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
'/includes/ace/src/ace.js',
'/includes/ace/src/ext-statusbar.js',
'/includes/ace/src/ext-language_tools.js',
), array());
), array(), 'mod-oblyon page-admin-customcss');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans('BackToModuleList').'</a>';
print load_fiche_titre($page_name, $linkback);
print load_fiche_titre($page_name, $linkback, 'object_inovea.png@oblyon');

// Configuration header *************************
$head = oblyon_admin_prepare_head();
Expand Down
2 changes: 2 additions & 0 deletions admin/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
'OBLYON_INFOXBOX_EXPENSEREPORT_COLOR', // #79633F EXPENSES
'OBLYON_INFOXBOX_HOLIDAY_COLOR', // #755114 HOLIDAYS
'OBLYON_INFOXBOX_TICKET_COLOR', // #755114 TICKETS
'OBLYON_INFOXBOX_MRP_COLOR', // #212529 MRP
);

// Actions **************************************
Expand Down Expand Up @@ -160,6 +161,7 @@
oblyon_print_input('MAIN_DISABLE_BLOCK_EXPENSEREPORT', 'on_off', $langs->trans('DashboardDisableBlockExpenseReport'), '', $metas, 2, 1); // expenses block
oblyon_print_input('MAIN_DISABLE_BLOCK_HOLIDAY', 'on_off', $langs->trans('DashboardDisableBlockHoliday'), '', $metas, 2, 1); // holidays block
oblyon_print_input('MAIN_DISABLE_BLOCK_TICKET', 'on_off', $langs->trans('DashboardDisableBlockTicket'), '', $metas, 2, 1); // tickets block
if ((float) DOL_VERSION >= 23.0) oblyon_print_input('MAIN_DISABLE_BLOCK_MRP', 'on_off', $langs->trans('DashboardDisableBlockMrp'), '', $metas, 2, 1); // mrp block
oblyon_print_input('OBLYON_INFOXBOX_SINGLE_WIDTH', 'on_off', $langs->trans('OblyonInfoboxSingleWidth'), 'OblyonInfoboxSingleWidthHelp', $metas, 2, 1); // Single width for all info boxes
}
}
Expand Down
302 changes: 204 additions & 98 deletions admin/icons.php
Original file line number Diff line number Diff line change
@@ -1,99 +1,205 @@
<?php
/************************************************
* Copyright (C) 2015-2023 Alexandre Spangaro <[email protected]>
* Copyright (C) 2022-2025 Sylvain Legrand <[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 ../oblyon/admin/icons.php
* \ingroup oblyon
* \brief Options Page < Oblyon Theme Configurator >
************************************************/

// Dolibarr environment *************************
require '../config.php';

// Libraries ************************************
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once '../lib/oblyon.lib.php';

// Translations *********************************
$langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon'));

// Access control *******************************
if (! $user->admin) accessforbidden();

// init variables *******************************
$list = array ('fas' => '900', 'far' => '400', 'fal' => '300', 'fat' => '100', 'fad' => '900');

// Actions **************************************
$action = GETPOST('action','alpha');
$result = '';
// Sauvegarde / Restauration
if ($action == 'bkupParams') $result = oblyon_bkup_module ('oblyon');
if ($action == 'restoreParams') $result = oblyon_restore_module ('oblyon');
// links management
if (preg_match('/set_(.*)/', $action, $reg)) {
$confkey = $reg[1];
$result = dolibarr_set_const($db, 'MAIN_FONTAWESOME_ICON_STYLE', $confkey, 'chaine', 0, 'Oblyon module', $conf->entity);
$result = dolibarr_set_const($db, 'MAIN_FONTAWESOME_WEIGHT', $list[$confkey], 'chaine', 0, 'Oblyon module', $conf->entity);
}
// Retour => message Ok ou Ko
if ($result == 1) setEventMessages($langs->trans('IconApplied').' : '.$langs->trans('Icon'.$confkey), null, 'mesgs');
if ($result == -1) setEventMessages($langs->trans('Error'), null, 'errors');
$_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); // Reset cache

// View *****************************************
$page_name = $langs->trans('OblyonIconsTitle');
llxHeader('', $page_name);
$linkback = '<a href = "'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans('BackToModuleList').'</a>';
print load_fiche_titre($page_name, $linkback);

// Configuration header *************************
$head = oblyon_admin_prepare_head();
print dol_get_fiche_head($head, 'icons', $langs->trans('Module432573Name'), 0, 'inovea@oblyon');

// setup page goes here *************************
print ' <form action = "'.$_SERVER['PHP_SELF'].'" method = "POST">
<input type = "hidden" name = "token" value = "'.newToken().'" />';
// Sauvegarde / Restauration
oblyon_print_backup_restore();
clearstatcache();
print ' <div class = "div-table-responsive-no-min">
<table summary = "edit" class = "noborder centpercent editmode tableforfield">';
$larg = !empty($list) && count($list) > 0 ? 100 / count($list) : 100;
$metas = array();
for ($i = 0; $i < count($list); $i++) $metas[] = $larg.'%';
oblyon_print_colgroup($metas);
$metas = array(array(count($list)), 'IconsStyle');
oblyon_print_liste_titre($metas);
print ' <tr>';
foreach ($list as $name => $weight)
print ' <td class = "center">
<a title = "'.$langs->trans('Icon'.$name).'" href = "'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=set_'.$name.'">'.img_picto($langs->trans('Icon'.$name), 'icon'.$name.'.png@oblyon', 'width = "50%"').'
<br/>'.$langs->trans('Icon'.$name).'
</a>
</td>';
print ' </tr>
</table>
</div>';
print dol_get_fiche_end();
print ' </form>
<br/>';
// End of page
llxFooter();
$db->close();
/************************************************
* Copyright (C) 2015-2025 Alexandre Spangaro <[email protected]>
* Copyright (C) 2022-2025 Sylvain Legrand <[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 ../oblyon/admin/icons.php
* \ingroup oblyon
* \brief Options Page < Oblyon Theme Configurator >
*/

require '../config.php';

// Libraries
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once '../lib/oblyon.lib.php';

/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Societe $mysoc
* @var Translate $langs
* @var User $user
*/

// Translations
$langs->loadLangs(array('admin', 'oblyon@oblyon', 'inovea@oblyon'));

// Access control *******************************
if (! $user->admin) accessforbidden();

// init variables
$style_weights = array(
'fas' => '900',
'far' => '400',
'fal' => '300',
'fat' => '100',
'fad' => '900'
);

// Actions
$backtopage = GETPOST('backtopage', 'alpha');
$action = GETPOST('action','alpha');
$result = '';

// Sauvegarde / Restauration
if ($action == 'bkupParams') {
$result = oblyon_bkup_module ('oblyon');
}
if ($action == 'restoreParams') {
$result = oblyon_restore_module ('oblyon');
}

if (!empty($_POST['select_fa'])) {
$selected_dir = GETPOST('selected_version', 'alpha');
$selected_family = GETPOST('selected_family_' . $selected_dir, 'alpha');
$selected_style = GETPOST('selected_style_' . $selected_dir, 'alpha');

if ($selected_dir && $selected_family && $selected_style) {
$full_dir_path = '/theme/common/' . $selected_dir;
$weight = $style_weights[$selected_style] ?? '900';

dolibarr_set_const($db, 'MAIN_FONTAWESOME_DIRECTORY', $full_dir_path, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'MAIN_FONTAWESOME_FAMILY', $selected_family, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'MAIN_FONTAWESOME_ICON_STYLE', $selected_style, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'MAIN_FONTAWESOME_WEIGHT', $weight, 'chaine', 0, '', $conf->entity);

setEventMessages($langs->trans("FontAwesomeSuccessMessage", $selected_family, $selected_style, $weight, $full_dir_path), null, 'mesgs');
$_SESSION['dol_resetcache'] = dol_print_date(dol_now(), 'dayhourlog'); // Reset cache
}
}

/*
* View
*/
$help_url = '';
$title = $langs->trans("OblyonSetupIcons");

llxHeader('', $title, $help_url, '', 0, 0, '', '', 'mod-oblyon page-admin-icons');

// Lecture des dossiers
$theme_dir = DOL_DOCUMENT_ROOT.'/theme/common/';
$fa_dirs = [];

if (is_dir($theme_dir)) {
foreach (scandir($theme_dir) as $entry) {
if (preg_match('/^fontawesome-(.+)$/', $entry) && is_dir($theme_dir . $entry)) {
$version = 'Unknown';
$family = 'Font Awesome 5 Free'; // par défaut
$css_path = $theme_dir . $entry . '/css/all.css';
if (file_exists($css_path)) {
$css = file_get_contents($css_path);
if (preg_match('/Font Awesome (Free|Pro) ([\d\.]+)/', $css, $ver_match)) {
$family = 'Font Awesome ' . intval($ver_match[2]) . ' ' . $ver_match[1];
$version = $ver_match[2];
}
}

$fa_dirs[] = array(
'dir' => $entry,
'version' => $version,
'family' => $family
);
}
}
}

$current_dir = $conf->global->MAIN_FONTAWESOME_DIRECTORY ?? '/theme/common/fontawesome-5';
$current_style = $conf->global->MAIN_FONTAWESOME_ICON_STYLE ?? 'fas';
$current_family = $conf->global->MAIN_FONTAWESOME_FAMILY ?? 'Font Awesome 5 Free';

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

$head = oblyon_admin_prepare_head();
print dol_get_fiche_head($head, 'icons', $title, -1);

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

// Sauvegarde / Restauration
oblyon_print_backup_restore();
clearstatcache();

print '</br>';
print $langs->trans("FontAwesomeSelectPack");
print '</br></br>';

print '<div class = "div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th>' . $langs->trans("FontAwesomeAction") . '</th>';
print '<th>' . $langs->trans("FontAwesomeFolder") . '</th>';
print '<th>' . $langs->trans("FontAwesomeVersion") . '</th>';
print '<th>' . $langs->trans("FontAwesomeLicence") . '</th>';
print '<th>' . $langs->trans("FontAwesomeAvailableStyles") . '</th>';
print '</tr>';

foreach ($fa_dirs as $fa) {
$dir = $fa['dir'];
$full_path = '/theme/common/' . $dir;
$selected = ($full_path === $current_dir) ? 'checked' : '';
$is_pro = (strpos($fa['family'], 'Pro') !== false);
$styles = $is_pro ? ['fas', 'far', 'fal', 'fat', 'fad'] : ['fas'];

print '<tr>';
print '<td><input type="radio" name="selected_version" value="' . dol_escape_htmltag($dir) . '" ' . $selected . '></td>';
print '<td>' . dol_escape_htmltag($dir) . '</td>';
print '<td>' . dol_escape_htmltag($fa['version']) . '</td>';
print '<td>';
print '<input type="hidden" name="selected_family_' . $dir . '" value="' . dol_escape_htmltag($fa['family']) . '">';
print dol_escape_htmltag($fa['family']);
print '</td>';
print '<td>';
print '<select name="selected_style_' . $dir . '">';
$style_labels = array(
'fas' => 'Solid',
'far' => 'Regular',
'fal' => 'Light',
'fat' => 'Thin',
'fad' => 'Duotone'
);

foreach ($styles as $style) {
$sel = ($style === $current_style && $selected) ? 'selected' : '';
$label = $style_labels[$style] ?? $style;
print '<option value="' . $style . '" ' . $sel . '>' . $label . '</option>';
}
print '</select>';
print '</td>';
print '</tr>';
}

print '</table>';
print '</div>';
print '</br>';
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans("FontAwesomeSaveButton") . '"></div>';
print '</form>';

print '<br><br><div>'.$langs->trans("FontAwesomeDirectoryDownload").'</div><br>';

print '<img src="../img/example_FAdownload.png">';

// End of page
llxFooter();
$db->close();
Loading