dolibarr 24.0.0-beta
btn.inc.php
1<?php
2/* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
3 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18if (!defined('ISLOADEDBYSTEELSHEET')) {
19 die('Must be call by steelsheet');
20}
36'
37@phan-var-force string $butactionbg
38@phan-var-force string $colorbackhmenu1
39@phan-var-force string $colortextlink
40@phan-var-force int<0,1> $dol_optimize_smallscreen
41@phan-var-force string $fontlist
42@phan-var-force string $left
43@phan-var-force int<0,max> $nbtopmenuentries
44@phan-var-force string $right
45@phan-var-force string $textbutaction
46';
47?>
48
49/* IDE Hack <style type="text/css"> */
50
51:root {
52 --btncolortext: rgb(<?php print $colortextlink; ?>);
53 --btncolorbg: #fbfbfb;
54 --btncolorborderhover: none;
55 --btncolorborder: #FFF;
56 --butactiondeletebg: rgb(234,228,225);
57 --butactionbg: rgb(<?php print $butactionbg; ?>);
58 --textbutaction: rgb(<?php print $textbutaction; ?>);
59}
60
61<?php
62if (getDolGlobalInt('THEME_DARKMODEENABLED')) {
63 print "/* For dark mode */\n";
64 if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
65 print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
66 } else {
67 print "@media not print {";
68 }
69 print "
70 :root {
71
72 --btncolortext: ;
73 --btncolorbg: rgb(26,27,27);
74 --btncolorborderhover: #ffffff;
75 --btncolorborder: #2b2c2e;
76 --butactiondeletebg: rgb(252,84,91);
77 --butactionbg: rgb(173,140,79);
78 --textbutaction: rgb(255,255,255);
79
80 }\n";
81 print "}";
82}
83?>
84
85
86/* ============================================================================== */
87/* Buttons for actions */
88/* ============================================================================== */
89
90
91div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
92div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
93div.tabsAction > div.divButAction > span.butAction,
94div.tabsAction > div.divButAction > span.butActionDelete,
95div.tabsAction > div.divButAction > span.butActionRefused,
96div.tabsAction > div.divButAction > a.butAction,
97div.tabsAction > div.divButAction > a.butActionDelete,
98div.tabsAction > div.divButAction > a.butActionRefused,
99div.tabsAction > .dropdown > .dropdown-toggle {
100 margin-bottom: 1.4em !important;
101 margin-right: 0px !important;
102 /* box-shadow: 1px 1px 5px #d0d0d0; */
103}
104
105.divButAction {
106 padding: 0 !important;
107 margin: 0 !important;
108}
109div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
110 margin-bottom: 0 !important;
111}
112
113span.butAction, span.butActionDelete {
114 cursor: pointer;
115}
116.paginationafterarrows .butAction {
117 font-size: 0.9em;
118}
119.butAction {
120 background: var(--butactionbg);
121 color: var(--textbutaction) !important;
122 /* background: rgb(230, 232, 239); */
123}
124.butActionRefused, .butAction, .butActionDelete {
125 border-radius: 3px;
126}
127:not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
128 margin-<?php echo $right; ?>: 0px !important;
129}
130.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active,
131.divButAction
132 {
133 text-decoration: none;
134 text-transform: uppercase;
135 font-weight: bold;
136
137 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '1'); ?>em;
138 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
139 display: inline-block;
140 text-align: center;
141 cursor: pointer;
142 color: #444;
143 border: 1px solid transparent; /* So for buttonRefused with a border, it will not have any flash effect */
144
145 /* border: 1px solid #aaa; */
146 /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
147
148 /*border-top-right-radius: 0 !important;
149 border-bottom-right-radius: 0 !important;
150 border-top-left-radius: 0 !important;
151 border-bottom-left-radius: 0 !important;*/
152}
153.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
154 text-decoration: none;
155 text-transform: uppercase;
156 font-weight: normal;
157
158 margin: 0em 0.3em 0 0.3em !important;
159 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
160 font-family: <?php print $fontlist ?>;
161 display: inline-block;
162 /* text-align: center; New button are on right of screen */
163 cursor: pointer;
164}
165
166.tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
167.tableforfieldedit a.butActionNew>span.fa-plus-circle, .tableforfieldedit a.butActionNew>span.fa-plus-circle:hover,
168span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
169a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
170span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
171a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
172span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
173a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
174span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
175{
176 font-size: 1em;
177 padding-left: 0px;
178}
179
180a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
181span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
182a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
183span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
184{
185 padding-<?php echo $left; ?>: 6px;
186 font-size: 1.5em;
187 border: none;
188 box-shadow: none;
189 webkit-box-shadow: none;
190}
191
192.butAction:hover, .dropdown-holder.open > .butAction {
194 box-shadow: 0px 0px 6px rgba(50,50,50,0.4), inset 0px 0px 200px rgba(0,0,0,0.3); /* fix hover feedback : use "inset" background to easily darken background */
195}
196.butActionNew:hover {
197 text-decoration: underline;
198 box-shadow: unset !important;
199}
200
201.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
202 background: var(--butactiondeletebg) !important;
203 /* border: 1px solid #633; */
204 color: #633 !important;
205}
206
207.butActionDelete:hover {
208 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
209}
210
211/*
212.butActionDelete#action-delete::before {
213 content: "\f1f8";
214 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
215 font-weight: 600;
216 width: 20px;
217 visibility: visible;
218}
219.butActionDelete#action-delete span.textbutton {
220 display: none;
221}
222*/
223
224.butActionRefused {
225 text-decoration: none !important;
226 text-transform: uppercase;
227 font-weight: bold !important;
228
229 white-space: nowrap !important;
230 cursor: not-allowed !important;
231 font-family: <?php print $fontlist ?> !important;
232 display: inline-block;
233 text-align: center;
234 cursor: pointer;
235 box-sizing: border-box;
236 -moz-box-sizing: border-box;
237 -webkit-box-sizing: border-box;
238 color: #999 !important;
239
240 border: 1px solid #ccc;
241}
242.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
243 text-decoration: none !important;
244 text-transform: uppercase;
245 font-weight: normal !important;
246
247 white-space: nowrap !important;
248 cursor: not-allowed !important;
249 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
250 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
251 font-family: <?php print $fontlist ?> !important;
252 display: inline-block;
253 /* text-align: center; New button are on right of screen */
254 cursor: pointer;
255 color: #999 !important;
256 padding-top: 0.2em;
257 box-shadow: none !important;
258}
259
260.butActionTransparent {
261 color: #222 ! important;
262 background-color: transparent ! important;
263}
264
265.butActionLogin, .butActionLogin:link, .butActionLogin:visited, .butActionLogin:hover, .butActionLogin:active {
266 background-color: rgb(<?php echo $colorbackhmenu1; ?>);
267 padding: 1em 1em;
268}
269
270
271/*
272TITLE BUTTON
273 */
274
275.btnTitle, a.btnTitle {
276 display: inline-block;
277 padding: 6px;
278 font-weight: 400;
279 /* line-height: 1; */
280 text-align: center;
281 white-space: nowrap;
282 vertical-align: middle;
283 -ms-touch-action: manipulation;
284 touch-action: manipulation;
285 cursor: pointer;
286 -webkit-user-select: none;
287 -moz-user-select: none;
288 -ms-user-select: none;
289 user-select: none;
290 box-shadow: var(--btncolorbg);
291 text-decoration: none;
292 position: relative;
293 /* margin: 0 0 0 8px; */
294 min-width: 60px;
295 text-align: center;
296 color: var(--btncolortext);
297 font-size: 12px;
298 font-weight: 300;
299 /* background-color: var(--btncolorbg); */
300 border: 1px solid transparent;
301}
302
303a.btnTitle.btnTitleSelected {
304 border: 1px solid #ccc;
305 border-radius: 3px;
306}
307
308.btnTitle > .btnTitle-icon{
309
310}
311
312.btnTitle > .btnTitle-label{
313 color: #666666;
314}
315
316.btnTitle:hover, a.btnTitle:hover {
317 border: 1px solid #bbb;
318 border-radius: 3px;
319 position: relative;
320 text-align: center;
321 font-size: 12px;
322 text-decoration: none;
323 box-shadow: none;
324}
325/* The buttonplus is growing on hover (don't know why). This is to avoid to have the cell growing too */
326.btnTitlePlus:hover {
327 /* max-width: 24px; */ /* max width is a problem when the button has a text under */
328 max-height: 42px;
329}
330
331.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
332 color: #8a8a8a;
333 cursor: not-allowed;
334 background-color: #fbfbfb;
335 background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
336}
337
338.btnTitle:hover .btnTitle-label {
339 color: var(--btncolorborderhover);
340}
341.btnTitle.reposition:not(.btnTitleSelected) {
342 background-color: unset;
343 border: 1px solid transparent;
344}
345
346.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label {
347 color: #8a8a8a;
348}
349
350.btnTitle>.fa {
351 font-size: 2em;
352 display: block;
353}
354
355div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle,
356table.table-fiche-title tr.toptitle td.col-center div.nowraponall a.btnTitle,
357table.table-fiche-title tr.titre td.col-center div.nowraponall a.btnTitle,
358table.table-fiche-title tr.toptitle td.col-right a.btnTitle,
359table.table-fiche-title tr.titre td.col-right a.btnTitle {
360 margin-<?php echo $left; ?>: 10px;
361}
362
363.button-title-separator{
364 display: inline-block;
365 clear: both;
366 width: 20px;
367}
368
369.imgforviewmode {
370 color: #aaa;
371}
372
373
374/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
375@media only screen and (max-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC2') ? round($nbtopmenuentries * 69, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */
376{
377 .butAction, .butActionRefused, .butActionDelete {
378 font-size: 0.95em;
379 }
380}
381
382/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
383@media only screen and (max-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC3') ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
384{
385 .butAction, .butActionRefused, .butActionDelete {
386 font-size: 0.9em;
387 }
388}
389
390/* smartphone */
391
392@media only screen and (max-width: 767px)
393{
394 .butAction, .butActionRefused, .butActionDelete {
395 font-size: 0.85em;
396 }
397
398 /* for small screen, we reduce the min with of button */
399 .btnTitle, a.btnTitle {
400 display: inline-block;
401 padding: 4px 4px 4px 4px;
402 min-width: unset; /* if we unset the min-width here, we must also unset the font-size on .paginationafterarrows a.btnTitlePlus:hover span:before to avoid page content move */
403 }
404 .paginationafterarrows a.btnTitlePlus:hover span:before, .titre_right a.btnTitlePlus:hover span:before {
405 font-size: unset !important;
406 }
407}
408
409
410<?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
411.butActionRefused, .butActionNewRefused, .btnTitle.refused {
412 display: none !important;
413}
414<?php } ?>
415
416
417/*
418 * BTN LINK (used with <a/> tag in general but not with <button/>)
419 */
420
421.btn-link{
422 margin-right: 5px;
423 border: 1px solid #ddd;
424 color: #333;
425 padding: 5px 10px;
426 border-radius:1em;
427 text-decoration: none !important;
428}
429
430.btn-link:hover{
431 background-color: #ddd;
432 border: 1px solid #ddd;
433}
434
435
436/*
437 * BUTTON With Low emphasis
438 */
439
440button.btn-low-emphasis{
441 text-align: center;
442 display: inline-block;
443 border: none;
444 outline: none;
445 cursor: pointer;
446 margin: 0;
447 padding: 0;
448 width: auto;
449 min-width: 1.5em;
450 min-height: 1.5em;
451 line-height: 1.5em;
452
453 overflow: visible;
454 background: transparent;
455 background-position: center; /* used for hover ripple effect */
456 background-size: 0%;
457 color: var(--colortextlink, inherit);
458 font: inherit;
459 line-height: normal;
460
461 /* Corrects font smoothing for webkit */
462 -webkit-font-smoothing: inherit;
463 -moz-osx-font-smoothing: inherit;
464
465 /* Corrects inability to style clickable input types in iOS */
466 -webkit-appearance: none;
467
468
469 transition: background 0.8s;/* used for hover ripple effect */
470 background: transparent radial-gradient(circle, transparent 1%, hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1) 1%, transparent 10%) center/15000%;
471}
472
473button.btn-low-emphasis.--btn-icon{
474 border-radius: 100%;
475}
476
477button.btn-low-emphasis :is(.fa, .fas){
478 color: var(--colortextlink, inherit);
479 opacity: 0.4;
480}
481
482button.btn-low-emphasis:is(:focus,:hover) :is(.fa, .fas){
483 opacity: 0.8;
484}
485
486button.btn-low-emphasis.--btn-icon:active {
487 background-color: hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1);
488 background-size: 100%;
489 transition: background 0s;/* used for hover ripple effect */
490}
491
492
493input.button-save, input.button-cancel {
494 min-width: 110px;
495 margin-left: 5px !important;
496 margin-right: 5px !important;
497}
print $object position
Definition edit.php:206
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
treeview li table
No Email.
editval_textarea active
$fontlist
Definition style.css.php:75
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:134