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