Skip to content

Commit a9b42e8

Browse files
committed
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
2 parents a2c0e41 + b16b462 commit a9b42e8

46 files changed

Lines changed: 969 additions & 318 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev/translation/ignore_translation_keys.lst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ YourTicketSuccessfullySaved
9191
........
9292
AADE_WEBSERVICE_KEY
9393
AADE_WEBSERVICE_USER
94-
APCCacheInstalledButDisabled
95-
APCInstalled
9694
API
9795
Accept
9896
AccountancyErrorMismatchLetteringCode

htdocs/admin/system/constall.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
* @var Translate $langs
3535
* @var User $user
3636
*
37-
* @var string $conffile
38-
* @var string $dolibarr_main_url_root_alt
39-
* @var string $dolibarr_main_document_root_alt
37+
* @var string $conffile
38+
* @var string $dolibarr_main_document_root_alt
39+
* @var string $dolibarr_main_url_root_alt
4040
*/
4141

4242
// Load translation files required by the page

htdocs/admin/system/database.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
55
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
66
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
7-
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
7+
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
88
*
99
* This program is free software; you can redistribute it and/or modify
1010
* it under the terms of the GNU General Public License as published by
@@ -35,9 +35,9 @@
3535
* @var Translate $langs
3636
* @var User $user
3737
*
38-
* @var string $dolibarr_main_db_pass
39-
* @var string $dolibarr_main_db_character_set
40-
* @var string $dolibarr_main_db_collation
38+
* @var string $dolibarr_main_db_pass
39+
* @var string $dolibarr_main_db_collation
40+
* @var string $dolibarr_main_db_character_set
4141
*/
4242

4343
$langs->load("admin");

htdocs/admin/system/filecheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php.
191191

192192
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
193-
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
193+
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != 400 && $xmlarray['http_code'] != 404) {
194194
$xmlfile = $xmlarray['content'];
195195
//print "xmlfilestart".$xmlfile."xmlfileend";
196196
if (LIBXML_VERSION < 20900) {

htdocs/admin/system/perf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/* Copyright (C) 2013-2019 Laurent Destailleur <eldy@users.sourceforge.net>
3-
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
3+
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -172,7 +172,7 @@
172172
//var_dump(apc_cache_info());
173173
if (ini_get('apc.enabled')) {
174174
$foundcache++;
175-
print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("APCInstalled");
175+
print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "APCCache");
176176
} else {
177177
print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("APCCacheInstalledButDisabled");
178178
}

htdocs/admin/tools/ui/class/documentation.class.php

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class Documentation
5353
*/
5454
public $db;
5555

56+
/**
57+
* @var string
58+
*/
59+
public $baseUrl = 'admin/tools/ui';
5660

5761
/**
5862
* Constructor
@@ -82,8 +86,6 @@ private function setMenu()
8286

8387
$hookmanager->initHooks(array('uidocumentation'));
8488

85-
$baseUrl = 'admin/tools/ui';
86-
8789
// Go back to Dolibarr
8890
$this->menu['BackToDolibarr'] = array(
8991
'url' => DOL_URL_ROOT,
@@ -93,18 +95,18 @@ private function setMenu()
9395

9496
// Home for Ui documentation
9597
$this->menu['DocumentationHome'] = array(
96-
'url' => dol_buildpath($baseUrl.'/index.php', 1),
98+
'url' => dol_buildpath($this->baseUrl.'/index.php', 1),
9799
'icon' => 'fas fa-book',
98100
'submenu' => array(),
99101
);
100102

101103
// Components
102104
$this->menu['Components'] = array(
103-
'url' => dol_buildpath($baseUrl.'/components/index.php', 1),
105+
'url' => dol_buildpath($this->baseUrl.'/components/index.php', 1),
104106
'icon' => 'fas fa-th-large',
105107
'submenu' => array(
106108
'Badges' => array(
107-
'url' => dol_buildpath($baseUrl.'/components/badges.php', 1),
109+
'url' => dol_buildpath($this->baseUrl.'/components/badges.php', 1),
108110
'icon' => 'fas fa-certificate pictofixedwidth',
109111
'submenu' => array(),
110112
'summary' => array(
@@ -118,7 +120,7 @@ private function setMenu()
118120
),
119121
),
120122
'Buttons' => array(
121-
'url' => dol_buildpath($baseUrl.'/components/buttons.php', 1),
123+
'url' => dol_buildpath($this->baseUrl.'/components/buttons.php', 1),
122124
'icon' => 'fas fa-mouse pictofixedwidth',
123125
'submenu' => array(),
124126
'summary' => array(
@@ -128,7 +130,7 @@ private function setMenu()
128130
),
129131
),
130132
'Icons' => array(
131-
'url' => dol_buildpath($baseUrl.'/components/icons.php', 1),
133+
'url' => dol_buildpath($this->baseUrl.'/components/icons.php', 1),
132134
'icon' => 'far fa-flag pictofixedwidth',
133135
'submenu' => array(),
134136
'summary' => array(
@@ -137,7 +139,7 @@ private function setMenu()
137139
),
138140
),
139141
'Progress' => array(
140-
'url' => dol_buildpath($baseUrl.'/components/progress-bars.php', 1),
142+
'url' => dol_buildpath($this->baseUrl.'/components/progress-bars.php', 1),
141143
'icon' => 'fas fa-battery-half pictofixedwidth',
142144
'submenu' => array(),
143145
'summary' => array(
@@ -147,7 +149,7 @@ private function setMenu()
147149
),
148150
),
149151
'Event Message' => array(
150-
'url' => dol_buildpath($baseUrl.'/components/event-message.php', 1),
152+
'url' => dol_buildpath($this->baseUrl.'/components/event-message.php', 1),
151153
'icon' => 'fas fa-comments pictofixedwidth',
152154
'submenu' => array(),
153155
'summary' => array(
@@ -156,12 +158,13 @@ private function setMenu()
156158
)
157159
),
158160
'Inputs' => array(
159-
'url' => dol_buildpath($baseUrl.'/components/inputs.php', 1),
161+
'url' => dol_buildpath($this->baseUrl.'/components/inputs.php', 1),
160162
'icon' => 'fas fa-comments pictofixedwidth',
161163
'submenu' => array(),
162164
'summary' => array(
163165
'DocBasicUsage' => '#setinputssection-basicusage',
164166
'DocHelperFunctionsInputUsage' => '#setinputssection-helperfunctions',
167+
'DocHelperFunctionsGetSearchFilterToolInput' => '#setinputssection-getSearchFilterToolInput',
165168
)
166169
),
167170
),
@@ -172,7 +175,7 @@ private function setMenu()
172175

173176
// Elements
174177
$this->menu['Content'] = array(
175-
'url' => dol_buildpath($baseUrl.'/content/index.php', 1),
178+
'url' => dol_buildpath($this->baseUrl.'/content/index.php', 1),
176179
'icon' => 'fas fa-th-large',
177180
'submenu' => array(
178181
'Tables' => array(
@@ -181,14 +184,16 @@ private function setMenu()
181184
'submenu' => array(),
182185
'summary' => array(
183186
'DocBasicUsage' => '#tablesection-basicusage',
184-
'DocTableWithFilters' => '#tablesection-withfilters'
187+
'DocTableWithFilters' => '#tablesection-withfilters',
188+
'DocTableBeforeFilters' => '#tablesection-beforefilters',
189+
'DocTableCSSClass' => '#tablesection-cssclasses',
185190
),
186191
),
187192
)
188193
);
189194

190195
$parameters = array(
191-
'baseUrl' => $baseUrl,
196+
'baseUrl' => $this->baseUrl,
192197
);
193198
$action = '';
194199

@@ -413,6 +418,13 @@ public function showCode($lines = array(), $option = 'html')
413418
{
414419
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
415420
print '<div class="documentation-code">';
421+
422+
if (isset($lines[0])) {
423+
if ($option === 'html' && strpos(strtolower($lines[0]), '<!doctype') === false) {
424+
array_unshift($lines, '<!DOCTYPE html>', '');
425+
}
426+
}
427+
416428
$content = implode("\n", $lines) . "\n";
417429
$doleditor = new DolEditor(md5($content), $content, '', 0, 'Basic', 'In', true, false, 'ace', 0, '99%', 1);
418430
print $doleditor->Create(1, '', false, '', $option);

htdocs/admin/tools/ui/components/badges.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@
292292
</div>
293293
<?php
294294
$lines = array(
295+
"<?php ",
295296
"/**",
296297
" * Function dolGetBadge",
297298
" *",
@@ -301,12 +302,13 @@
301302
" * @param string \$mode Default '' , 'pill', 'dot'",
302303
" * @param string \$url the url for link",
303304
" * ... See more: core/lib/functions.lib.php ",
305+
"*/",
304306
"",
305-
"<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'primary'); ?>",
306-
"<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'danger', 'pill'); ?>",
307-
"<?php print dolGetBadge('your label for accessibility', 'your label', 'warning', 'dot'); ?>",
307+
"print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'primary');",
308+
"print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'danger', 'pill');",
309+
"print dolGetBadge('your label for accessibility', 'your label', 'warning', 'dot');",
308310
);
309-
echo $documentation->showCode($lines); ?>
311+
echo $documentation->showCode($lines, 'php'); ?>
310312
</div>
311313

312314
<!-- -->

htdocs/admin/tools/ui/components/event-message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@
163163
<?php
164164
$lines = array(
165165
'<?php',
166-
'setEventMessages("message", null)',
167-
'setEventMessages("message", null, "warnings")',
168-
'setEventMessages("message", null, "errors")'
166+
'setEventMessages("message", null);',
167+
'setEventMessages("message", null, "warnings");',
168+
'setEventMessages("message", null, "errors");'
169169
);
170170
echo $documentation->showCode($lines, 'php'); ?>
171171
</div>

htdocs/admin/tools/ui/components/icons.php

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,19 @@
4242
$documentation = new Documentation($db);
4343

4444
// Output html head + body - Param is Title
45-
$documentation->docHeader('Icons');
45+
$documentation->docHeader('Icons', [], ['admin/tools/ui/css/doc-icons.css']);
4646

4747
// Set view for menu and breadcrumb
4848
// Menu must be set in constructor of documentation class
4949
$documentation->view = array('Components','Icons');
50+
$form = new Form($db);
51+
52+
53+
$displayMode = GETPOST('displayMode') == 'kanban' ? 'kanban' : 'icon-only';
54+
$revertDisplayMode = $displayMode == 'kanban' ? 'icon-only' : 'kanban';
55+
$revertDisplayName = $displayMode == 'kanban' ? $langs->trans('ViewList') : $langs->trans('ViewKanban');
56+
$switchDisplayLink = dol_buildpath($documentation->baseUrl . '/components/icons.php', 1) . '?displayMode=' . $revertDisplayMode;
57+
$switchDisplayLinkIcon = $displayMode == 'kanban' ? 'fa fa-th' : 'fa fa-th-list';
5058

5159
// Output sidebar
5260
$documentation->showSidebar(); ?>
@@ -85,13 +93,30 @@
8593

8694
<h2 class="documentation-title"><?php echo $langs->trans('DocIconsListImgPicto'); ?></h2>
8795
<?php /* <p class="documentation-text"><?php echo $langs->trans('DocDocIconsListDescription'); ?></p>*/ ?>
96+
97+
<?php print $form->getSearchFilterToolInput(
98+
'.documentation-img-picto-icon-list .info-box, .documentation-img-picto-icon-list .doc-icon-list-item',
99+
'search-tools-input',
100+
'',
101+
['attr' => [
102+
'data-no-item-target' => '#img-picto-section-list .search-tool-no-results',
103+
],
104+
]
105+
); ?>
106+
107+
<div class="right">
108+
<?php print dolGetButtonTitle($revertDisplayName, '', $switchDisplayLinkIcon, $switchDisplayLink.'#img-picto-section-list', '', 1, ['forcenohideoftext'=>1]); ?>
109+
</div>
110+
88111
<div class="documentation-example">
89-
<div class="documentation-fontawesome-icon-list">
112+
<div class="documentation-img-picto-icon-list">
90113
<?php
91114
foreach (getImgPictoNameList() as $iconName) {
92115
$labelAlt = 'Text on title tag for tooltip';
93-
$iconCode = img_picto($iconName, $iconName);
94-
print '<div class="info-box ">
116+
117+
if ($displayMode == 'kanban') {
118+
$iconCode = img_picto($iconName, $iconName);
119+
print '<div class="info-box ">
95120
<span class="info-box-icon bg-infobox-expensereport">
96121
'.$iconCode.'
97122
</span>
@@ -106,9 +131,16 @@
106131
</div><!-- /.info-box-lines -->
107132
</div><!-- /.info-box-content -->
108133
</div>';
134+
} else {
135+
$tooltip = $iconName.'<br>img_picto(\''.$labelAlt.'\', \''.$iconName.'\')';
136+
$iconCode = img_picto($tooltip, $iconName, '', 0, 0, 0, '', 'classfortooltip');
137+
print '<span class="doc-icon-list-item">'.$iconCode.'<span class="doc-icon-hidden-name-for-search">'.$iconName.'</span></span>';
138+
}
109139
}
110140
?>
111141
</div>
142+
143+
<div class="search-tool-no-results center hidden-search-result" ><?php print $langs->trans('NoResults') ?></div>
112144
</div>
113145
</div>
114146
<!-- -->
@@ -135,10 +167,22 @@
135167

136168
<h2 class="documentation-title"><?php echo $langs->trans('DocIconsListFontAwesome'); ?></h2>
137169
<?php /* <p class="documentation-text"><?php echo $langs->trans('DocDocIconsListDescription'); ?></p>*/ ?>
138-
<div class="documentation-example">
139170

140-
<div class="documentation-fontawesome-icon-list">
171+
<?php print $form->getSearchFilterToolInput('.documentation-fontawesome-icon-list .info-box, .documentation-fontawesome-icon-list .doc-icon-list-item',
172+
'search-tools-input',
173+
'',
174+
['attr' => [
175+
'data-no-item-target' => '#icon-section-list .search-tool-no-results',
176+
],
177+
]
178+
); ?>
179+
180+
<div class="right">
181+
<?php print dolGetButtonTitle($revertDisplayName, '', $switchDisplayLinkIcon, $switchDisplayLink.'#icon-section-list', '', 1, ['forcenohideoftext'=>1]); ?>
182+
</div>
141183

184+
<div class="documentation-example">
185+
<div class="documentation-fontawesome-icon-list">
142186
<?php
143187
$alreadyDisplay = [];
144188
if ($fontAwesomeIcons && is_array($fontAwesomeIcons)) {
@@ -157,26 +201,32 @@
157201
$alreadyDisplay[] = $class;
158202
$iconCode = '<span class="'.$class.'" ></span>';
159203

160-
161-
print '<div class="info-box ">
204+
if ($displayMode == 'kanban') {
205+
print '<div class="info-box ">
162206
<span class="info-box-icon bg-infobox-expensereport">
163-
'.$iconCode.'
207+
' . $iconCode . '
164208
</span>
165209
<div class="info-box-content">
166-
<div class="info-box-title" >'. ($iconData[2]??($iconData[0]??'')) .'</div>
210+
<div class="info-box-title" >' . ($iconData[2] ?? ($iconData[0] ?? '')) . '</div>
167211
<div class="info-box-lines">
168212
<div class="info-box-line spanoverflow nowrap">
169213
<div class="inline-block nowraponall">
170-
<div class="documentation-code"><pre>'.dol_htmlentities($iconCode).'</pre></div>
214+
<div class="documentation-code"><pre>' . dol_htmlentities($iconCode) . '</pre></div>
171215
</div>
172216
</div>
173217
</div><!-- /.info-box-lines -->
174218
</div><!-- /.info-box-content -->
175219
</div>';
220+
} else {
221+
$tooltip = $class;
222+
print '<span class="doc-icon-list-item classfortooltip" title="'.dol_escape_htmltag($tooltip).'">'.$iconCode.'<span class="doc-icon-hidden-name-for-search">'.$class.'</span></span>';
223+
}
176224
}
177225
}
178226
?>
179227
</div>
228+
229+
<div class="search-tool-no-results center hidden-search-result" ><?php print $langs->trans('NoResults') ?></div>
180230
</div>
181231
</div>
182232
<!-- -->

0 commit comments

Comments
 (0)