dolibarr 25.0.0-alpha
btn.inc.php
1<?php
2/* Copyright (C) 2024-2026 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}
35'
36@phan-var-force string $butactionbg
37@phan-var-force string $colortextlink
38@phan-var-force int<0,1> $dol_optimize_smallscreen
39@phan-var-force string $fontlist
40@phan-var-force string $left
41@phan-var-force int<0,max> $nbtopmenuentries
42@phan-var-force string $right
43@phan-var-force string $textbutaction
44';
45?>
46
47/* IDE Hack <style type="text/css"> */
48
49:root {
50 --btncolortext: rgb(<?php print $colortextlink; ?>);
51 --btncolorbg: #fbfbfb;
52 --btncolorborderhover: none;
53 --btncolorborder: #FFF;
54 --butactiondeletebg: rgb(234,228,225);
55 --butactioncancelbg: #e3e3e3;
56 --butactionbg: rgb(<?php print $butactionbg; ?>);
57 --textbutaction: rgb(<?php print $textbutaction; ?>);
58}
59
60<?php
61if (getDolGlobalInt('THEME_DARKMODEENABLED')) {
62 print "/* For dark mode */\n";
63 if (getDolGlobalInt('THEME_DARKMODEENABLED') != 2) {
64 print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
65 } else {
66 print "@media not print {";
67 }
68 print "
69 :root {
70
71 --btncolortext: ;
72 --btncolorbg: rgb(26,27,27);
73 --btncolorborderhover: #ffffff;
74 --btncolorborder: #2b2c2e;
75 --butactiondeletebg: rgb(252,84,91);
76 --butactionbg: rgb(173,140,79);
77 --textbutaction: rgb(255,255,255);
78
79 }\n";
80 print "}";
81}
82?>
83
84
85/* ============================================================================== */
86/* Buttons for actions */
87/* ============================================================================== */
88
89
90div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
91div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
92div.tabsAction > div.divButAction > span.butAction,
93div.tabsAction > div.divButAction > span.butActionDelete,
94div.tabsAction > div.divButAction > span.butActionRefused,
95div.tabsAction > div.divButAction > a.butAction,
96div.tabsAction > div.divButAction > a.butActionDelete,
97div.tabsAction > div.divButAction > a.butActionRefused,
98div.tabsAction > .dropdown > .dropdown-toggle {
99 margin-bottom: 1.4em !important;
100 margin-right: 0px !important;
101 /* box-shadow: 1px 1px 5px #d0d0d0; */
102}
103
104.divButAction {
105 padding: 0 !important;
106 margin: 0 !important;
107}
108div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
109 margin-bottom: 0 !important;
110}
111
112span.butAction, span.butActionDelete {
113 cursor: pointer;
114}
115.paginationafterarrows .butAction {
116 font-size: 0.9em;
117}
118.butAction {
119 background: var(--butactionbg);
120 color: var(--textbutaction) !important;
121 /* background: rgb(230, 232, 239); */
122}
123.butAction, .butActionRefused, .butActionDelete {
124 border-radius: 3px;
125}
126:not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
127 margin-<?php echo $right; ?>: 0px !important;
128}
129.butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active,
130.butActionRefused,
131.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active,
132.divButAction
133 {
134 text-decoration: none;
135 text-transform: uppercase;
136 font-weight: bold;
137
138 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '1'); ?>em;
139 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
140 display: inline-block;
141 text-align: center;
142 cursor: pointer;
143 color: #444;
144 border: 1px solid transparent; /* So for buttonRefused with a border, it will not have any flash effect */
145 min-width: 40px;
146
147 /* border: 1px solid #aaa; */
148 /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
149
150 /*border-top-right-radius: 0 !important;
151 border-bottom-right-radius: 0 !important;
152 border-top-left-radius: 0 !important;
153 border-bottom-left-radius: 0 !important;*/
154}
155.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
156 text-decoration: none;
157 text-transform: uppercase;
158 font-weight: normal;
159
160 margin: 0em 0.3em 0 0.3em !important;
161 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
162 font-family: <?php print $fontlist ?>;
163 display: inline-block;
164 /* text-align: center; New button are on right of screen */
165 cursor: pointer;
166}
167
168.tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
169.tableforfieldedit a.butActionNew>span.fa-plus-circle, .tableforfieldedit a.butActionNew>span.fa-plus-circle:hover,
170span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
171a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
172span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
173a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
174span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
175a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
176span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
177{
178 font-size: 1em;
179 padding-left: 0px;
180}
181
182a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
183span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
184a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
185span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
186{
187 padding-<?php echo $left; ?>: 6px;
188 font-size: 1.5em;
189 border: none;
190 box-shadow: none;
191 webkit-box-shadow: none;
192}
193
194.butAction:hover, .dropdown-holder.open > .butAction {
196 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 */
197}
198.butActionNew:hover {
199 text-decoration: underline;
200 box-shadow: unset !important;
201}
202
203.butActionDanger, .butActionDanger:link, .butActionDanger:visited, .butActionDanger:hover, .butActionDanger:active, .buttonDanger {
204 background: var(--butactiondeletebg) !important;
205 /* border: 1px solid #633; */
206 color: #633 !important;
207}
208
209.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
210 background: var(--butactiondeletebg) !important;
211 /* border: 1px solid #633; */
212 color: #633 !important;
213}
214.button.button-cancel:not(.buttongen), .button.button-cancel:link:not(.buttongen), .button.button-cancel:visited:not(.buttongen), .button.button-cancel:hover:not(.buttongen), .button.button-cancel:active:not(.buttongen), .button.button-cancel:not(.buttongen) {
215 background: var(--butactioncancelbg) !important;
216 border: none;
217 color: #333 !important;
218}
219
220.butActionDelete:hover {
221 box-shadow: 0px 0px 4px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
222}
223.button.button-cancel:hover:not(.buttongen) {
224 box-shadow: 0px 0px 4px 1px rgba(50, 50, 50, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
225}
226
227/* Button Clone */
228#action-clone .textbutton, .butAction.butActionClone .textbutton {
229 font-size: 0;
230 display: inline-block;
231}
232#action-clone .textbutton::before, .butAction.butActionClone .textbutton::before {
233 content: "\f24d"; /* fa-clone */
234 font-family: "Font Awesome 5 Free"; /* ou "Font Awesome 5 Free" selon votre version */
235 font-weight: 900; /* obligatoire pour la version "solid" */
236 font-size: 14px; /* using 1em does not work */
237 /* vertical-align: middle; */
238 display: inline-block; /* required for transform on a pseudo element */
239 transform: rotate(90deg);
240}
241
242
243/* Button Email */
244#action-email .textbutton, .butAction.butActionEmail .textbutton {
245 font-size: 0;
246 display: inline-block;
247}
248#action-email .textbutton::before, .butAction.butActionEmail .textbutton::before {
249 content: "\f0e0"; /* fas fa-envelope */
250 font-family: "Font Awesome 5 Free";
251 font-weight: 900; /* required for the "solid" version */
252 font-size: 14px; /* using 1em does not work */
253}
254
255/* Button Delete */
256#action-delete .textbutton, .butAction.butActionDelete .textbutton {
257 font-size: 0;
258 display: inline-block;
259}
260#action-delete .textbutton::before, .butAction.butActionDelete .textbutton::before {
261 content: "\f1f8"; /* fa-trash */
262 font-family: "Font Awesome 5 Free";
263 font-weight: 900; /* required for the "solid" version */
264 font-size: 14px; /* using 1em does not work */
265}
266
267.butActionRefused {
268 /* pointer-events: none; Removed as this break the use of title */
269 cursor: default;
270 opacity: 0.8;
271 box-shadow: none;
272
273 text-decoration: none !important;
274 text-transform: uppercase;
275 font-weight: bold !important;
276
277 cursor: not-allowed !important;
278 font-family: <?php print $fontlist ?> !important;
279 display: inline-block;
280 text-align: center;
281 cursor: pointer;
282 box-sizing: border-box;
283 -moz-box-sizing: border-box;
284 -webkit-box-sizing: border-box;
285 color: #999 !important;
286
287 border: 1px solid #ccc;
288}
289.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
290 text-decoration: none !important;
291 text-transform: uppercase;
292 font-weight: normal !important;
293
294 white-space: nowrap !important;
295 cursor: not-allowed !important;
296 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
297 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
298 font-family: <?php print $fontlist ?> !important;
299 display: inline-block;
300 /* text-align: center; New button are on right of screen */
301 cursor: pointer;
302 color: #999 !important;
303 padding-top: 0.2em;
304 box-shadow: none !important;
305}
306
307.butActionTransparent {
308 color: #222 ! important;
309 background-color: transparent ! important;
310}
311
312.butActionLogin, .butActionLogin:link, .butActionLogin:visited, .butActionLogin:hover, .butActionLogin:active {
313 background-color: var(--butactionbg);
314 padding: 1em 1em;
315}
316
317
318/*
319TITLE BUTTON
320 */
321
322.btnTitle, a.btnTitle {
323 display: inline-block;
324 padding: 6px;
325 font-weight: 400;
326 /* line-height: 1; */
327 text-align: center;
328 white-space: nowrap;
329 vertical-align: middle;
330 -ms-touch-action: manipulation;
331 touch-action: manipulation;
332 cursor: pointer;
333 -webkit-user-select: none;
334 -moz-user-select: none;
335 -ms-user-select: none;
336 user-select: none;
337 box-shadow: var(--btncolorbg);
338 text-decoration: none;
339 position: relative;
340 /* margin: 0 0 0 8px; */
341 min-width: 60px;
342 text-align: center;
343 color: var(--btncolortext);
344 font-size: 12px;
345 font-weight: 300;
346 /* background-color: var(--btncolorbg); */
347 border: 1px solid transparent;
348}
349
350a.btnTitle.btnTitleSelected {
351 border: 1px solid #ccc;
352 border-radius: 3px;
353}
354
355.btnTitle > .btnTitle-icon{
356
357}
358
359.btnTitle > .btnTitle-label{
360 color: #666666;
361}
362
363.btnTitle:hover, a.btnTitle:hover {
364 border: 1px solid #bbb;
365 border-radius: 3px;
366 position: relative;
367 text-align: center;
368 font-size: 12px;
369 text-decoration: none;
370 box-shadow: none;
371}
372/* The buttonplus is growing on hover (don't know why). This is to avoid to have the cell growing too */
373.btnTitlePlus:hover {
374 /* max-width: 24px; */ /* max width is a problem when the button has a text under */
375 max-height: 42px;
376}
377
378.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
379 color: #8a8a8a;
380 cursor: not-allowed;
381 background-color: #fbfbfb;
382 background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
383}
384
385.btnTitle:hover .btnTitle-label {
386 color: var(--btncolorborderhover);
387}
388.btnTitle.reposition:not(.btnTitleSelected) {
389 background-color: unset;
390 border: 1px solid transparent;
391}
392
393.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label {
394 color: #8a8a8a;
395}
396
397.btnTitle>.fa {
398 font-size: 2em;
399 display: block;
400}
401
402div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle,
403table.table-fiche-title tr.toptitle td.col-center div.nowraponall a.btnTitle,
404table.table-fiche-title tr.titre td.col-center div.nowraponall a.btnTitle,
405table.table-fiche-title tr.toptitle td.col-right a.btnTitle,
406table.table-fiche-title tr.titre td.col-right a.btnTitle {
407 margin-<?php echo $left; ?>: 10px;
408}
409
410.button-title-separator{
411 display: inline-block;
412 clear: both;
413 width: 20px;
414}
415
416.imgforviewmode {
417 color: #aaa;
418}
419
420
421/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
422@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 */
423{
424 .butAction, .butActionRefused, .butActionDelete {
425 font-size: 0.95em;
426 }
427}
428
429/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
430@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 */
431{
432 .butAction, .butActionRefused, .butActionDelete {
433 font-size: 0.9em;
434 }
435}
436
437/* smartphone */
438
439@media only screen and (max-width: 767px)
440{
441 .butAction, .butActionRefused, .butActionDelete {
442 font-size: 0.85em;
443 }
444
445 /* for small screen, we reduce the min with of button */
446 .btnTitle, a.btnTitle {
447 display: inline-block;
448 padding: 4px 4px 4px 4px;
449 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 */
450 }
451 .paginationafterarrows a.btnTitlePlus:hover span:before, .titre_right a.btnTitlePlus:hover span:before {
452 font-size: unset !important;
453 }
454}
455
456
457<?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
458.butActionRefused, .butActionNewRefused, .btnTitle.refused {
459 display: none !important;
460}
461<?php } ?>
462
463
464/*
465 * BTN LINK (used with <a/> tag in general but not with <button/>)
466 */
467
468.btn-link{
469 margin-right: 5px;
470 border: 1px solid #ddd;
471 color: #333;
472 padding: 5px 10px;
473 border-radius:1em;
474 text-decoration: none !important;
475}
476
477.btn-link:hover{
478 background-color: #ddd;
479 border: 1px solid #ddd;
480}
481
482
483/*
484 * BUTTON With Low emphasis
485 */
486
487button.btn-low-emphasis{
488 text-align: center;
489 display: inline-block;
490 border: none;
491 outline: none;
492 cursor: pointer;
493 margin: 0;
494 padding: 0;
495 width: auto;
496 min-width: 1.5em;
497 min-height: 1.5em;
498 line-height: 1.5em;
499
500 overflow: visible;
501 background: transparent;
502 background-position: center; /* used for hover ripple effect */
503 background-size: 0%;
504 color: var(--colortextlink, inherit);
505 font: inherit;
506 line-height: normal;
507
508 /* Corrects font smoothing for webkit */
509 -webkit-font-smoothing: inherit;
510 -moz-osx-font-smoothing: inherit;
511
512 /* Corrects inability to style clickable input types in iOS */
513 -webkit-appearance: none;
514
515
516 transition: background 0.8s;/* used for hover ripple effect */
517 background: transparent radial-gradient(circle, transparent 1%, hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1) 1%, transparent 10%) center/15000%;
518}
519
520button.btn-low-emphasis.--btn-icon{
521 border-radius: 100%;
522}
523
524button.btn-low-emphasis :is(.fa, .fas){
525 color: var(--colortextlink, inherit);
526 opacity: 0.4;
527}
528
529button.btn-low-emphasis:is(:focus,:hover) :is(.fa, .fas){
530 opacity: 0.8;
531}
532
533button.btn-low-emphasis.--btn-icon:active {
534 background-color: hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1);
535 background-size: 100%;
536 transition: background 0s;/* used for hover ripple effect */
537}
538
539
540input.button-save, input.button-cancel {
541 min-width: 110px;
542 margin-left: 8px !important;
543 margin-right: 8px !important;
544}
545
546/* smartphone */
547
548@media only screen and (max-width: 767px)
549{
550 input.button-save, input.button-cancel {
551 min-width: 90px;
552 margin-left: 4px !important;
553 margin-right: 4px !important;
554 }
555}
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.
$fontlist
Definition style.css.php:75
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:166
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