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