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 $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 (getDolGlobalString('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/*div.divButAction {
91 margin-bottom: 1.4em;
92}*/
93div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
94div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
95div.tabsAction > div.divButAction > span.butAction,
96div.tabsAction > div.divButAction > span.butActionDelete,
97div.tabsAction > div.divButAction > span.butActionRefused,
98div.tabsAction > div.divButAction > a.butAction,
99div.tabsAction > div.divButAction > a.butActionDelete,
100div.tabsAction > div.divButAction > a.butActionRefused,
101div.tabsAction > .dropdown > .dropdown-toggle {
102 margin-bottom: 1.4em !important;
103 margin-right: 0px !important;
104 /* box-shadow: 1px 1px 5px #d0d0d0; */
105}
106
107.divButAction {
108 padding: 0 !important;
109 margin: 0 !important;
110}
111div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
112 margin-bottom: 0 !important;
113}
114
115span.butAction, span.butActionDelete {
116 cursor: pointer;
117}
118.paginationafterarrows .butAction {
119 font-size: 0.9em;
120}
121.butAction {
122 background: var(--butactionbg);
123 color: var(--textbutaction) !important;
124 /* background: rgb(230, 232, 239); */
125}
126.butActionRefused, .butAction, .butActionDelete {
127 border-radius: 3px;
128}
129:not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
130 margin-<?php echo $right; ?>: 0px !important;
131}
132.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active,
133.divButAction
134 {
135 text-decoration: none;
136 text-transform: uppercase;
137 font-weight: bold;
138
139 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.6' : '1'); ?>em;
140 padding: 0.6em <?php echo($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
141 display: inline-block;
142 text-align: center;
143 cursor: pointer;
144 color: #444;
145 border: 1px solid transparent; /* So for buttonRefused with a border, it will not have any flash effect */
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; 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
208.butActionDelete:hover {
209 box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
210}
211
212/*
213.butActionDelete#action-delete::before {
214 content: "\f1f8";
215 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
216 font-weight: 600;
217 width: 20px;
218 visibility: visible;
219}
220.butActionDelete#action-delete span.textbutton {
221 display: none;
222}
223*/
224
225.butActionRefused {
226 text-decoration: none !important;
227 text-transform: uppercase;
228 font-weight: bold !important;
229
230 white-space: nowrap !important;
231 cursor: not-allowed !important;
232 font-family: <?php print $fontlist ?> !important;
233 display: inline-block;
234 text-align: center;
235 cursor: pointer;
236 box-sizing: border-box;
237 -moz-box-sizing: border-box;
238 -webkit-box-sizing: border-box;
239 color: #999 !important;
240
241 border: 1px solid #ccc;
242}
243.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
244 text-decoration: none !important;
245 text-transform: uppercase;
246 font-weight: normal !important;
247
248 white-space: nowrap !important;
249 cursor: not-allowed !important;
250 margin: 0em <?php echo($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
251 padding: 0.2em <?php echo($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
252 font-family: <?php print $fontlist ?> !important;
253 display: inline-block;
254 /* text-align: center; New button are on right of screen */
255 cursor: pointer;
256 color: #999 !important;
257 padding-top: 0.2em;
258 box-shadow: none !important;
259}
260
261.butActionTransparent {
262 color: #222 ! important;
263 background-color: transparent ! important;
264}
265
266.butActionLogin, .butActionLogin:link, .butActionLogin:visited, .butActionLogin:hover, .butActionLogin:active {
267 background-color: rgb(<?php echo $colorbackhmenu1; ?>);
268 padding: 1em 1em;
269}
270
271
272/*
273TITLE BUTTON
274 */
275
276.btnTitle, a.btnTitle {
277 display: inline-block;
278 padding: 6px;
279 font-weight: 400;
280 /* line-height: 1; */
281 text-align: center;
282 white-space: nowrap;
283 vertical-align: middle;
284 -ms-touch-action: manipulation;
285 touch-action: manipulation;
286 cursor: pointer;
287 -webkit-user-select: none;
288 -moz-user-select: none;
289 -ms-user-select: none;
290 user-select: none;
291 box-shadow: var(--btncolorbg);
292 text-decoration: none;
293 position: relative;
294 /* margin: 0 0 0 8px; */
295 min-width: 60px;
296 text-align: center;
297 color: var(--btncolortext);
298 border: none;
299 font-size: 12px;
300 font-weight: 300;
301 /* background-color: var(--btncolorbg); */
302 border: 1px solid var(--btncolorborder);
303}
304
305a.btnTitle.btnTitleSelected {
306 border: 1px solid #ccc;
307 border-radius: 3px;
308}
309
310.btnTitle > .btnTitle-icon{
311
312}
313
314.btnTitle > .btnTitle-label{
315 color: #666666;
316}
317
318.btnTitle:hover, a.btnTitle:hover {
319 border: 1px solid #bbb;
320 border-radius: 3px;
321 position: relative;
322 text-align: center;
323 font-size: 12px;
324 text-decoration: none;
325 box-shadow: none;
326}
327/* The buttonplus is growing on hover (don't know why). This is to avoid to have the cell growing too */
328.btnTitlePlus:hover {
329 /* max-width: 24px; */ /* max width is a problem when the button has a text under */
330 max-height: 42px;
331}
332
333.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
334 color: #8a8a8a;
335 cursor: not-allowed;
336 background-color: #fbfbfb;
337 background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
338}
339
340.btnTitle:hover .btnTitle-label {
341 color: var(--btncolorborderhover);
342}
343.btnTitle.reposition:not(.btnTitleSelected) {
344 background-color: unset;
345 border: unset;
346}
347
348.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label {
349 color: #8a8a8a;
350}
351
352.btnTitle>.fa {
353 font-size: 2em;
354 display: block;
355}
356
357div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle,
358table.table-fiche-title tr.toptitle td.col-center div.nowraponall a.btnTitle,
359table.table-fiche-title tr.titre td.col-center div.nowraponall a.btnTitle,
360table.table-fiche-title tr.toptitle td.col-right a.btnTitle,
361table.table-fiche-title tr.titre td.col-right a.btnTitle {
362 margin-<?php echo $left; ?>: 10px;
363}
364
365.button-title-separator{
366 display: inline-block;
367 clear: both;
368 width: 20px;
369}
370
371.imgforviewmode {
372 color: #aaa;
373}
374
375
376/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
377@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 */
378{
379 .butAction, .butActionRefused, .butActionDelete {
380 font-size: 0.95em;
381 }
382}
383
384/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
385@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 */
386{
387 .butAction, .butActionRefused, .butActionDelete {
388 font-size: 0.9em;
389 }
390}
391
392/* smartphone */
393
394@media only screen and (max-width: 767px)
395{
396 .butAction, .butActionRefused, .butActionDelete {
397 font-size: 0.85em;
398 }
399
400 /* for small screen, we reduce the min with of button */
401 .btnTitle, a.btnTitle {
402 display: inline-block;
403 padding: 4px 4px 4px 4px;
404 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 */
405 }
406 .paginationafterarrows a.btnTitlePlus:hover span:before, .titre_right a.btnTitlePlus:hover span:before {
407 font-size: unset !important;
408 }
409}
410
411
412<?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
413.butActionRefused, .butActionNewRefused, .btnTitle.refused {
414 display: none !important;
415}
416<?php } ?>
417
418
419/*
420 * BTN LINK (used with <a/> tag in general but not with <button/>)
421 */
422
423.btn-link{
424 margin-right: 5px;
425 border: 1px solid #ddd;
426 color: #333;
427 padding: 5px 10px;
428 border-radius:1em;
429 text-decoration: none !important;
430}
431
432.btn-link:hover{
433 background-color: #ddd;
434 border: 1px solid #ddd;
435}
436
437
438/*
439 * BUTTON With Low emphasis
440 */
441
442button.btn-low-emphasis{
443 text-align: center;
444 display: inline-block;
445 border: none;
446 outline: none;
447 cursor: pointer;
448 margin: 0;
449 padding: 0;
450 width: auto;
451 min-width: 1.5em;
452 min-height: 1.5em;
453 line-height: 1.5em;
454
455 overflow: visible;
456 background: transparent;
457 background-position: center; /* used for hover ripple effect */
458 background-size: 0%;
459 color: var(--colortextlink, inherit);
460 font: inherit;
461 line-height: normal;
462
463 /* Corrects font smoothing for webkit */
464 -webkit-font-smoothing: inherit;
465 -moz-osx-font-smoothing: inherit;
466
467 /* Corrects inability to style clickable input types in iOS */
468 -webkit-appearance: none;
469
470
471 transition: background 0.8s;/* used for hover ripple effect */
472 background: transparent radial-gradient(circle, transparent 1%, hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1) 1%, transparent 10%) center/15000%;
473}
474
475button.btn-low-emphasis.--btn-icon{
476 border-radius: 100%;
477}
478
479button.btn-low-emphasis :is(.fa, .fas){
480 color: var(--colortextlink, inherit);
481 opacity: 0.4;
482}
483
484button.btn-low-emphasis:is(:focus,:hover) :is(.fa, .fas){
485 opacity: 0.8;
486}
487
488button.btn-low-emphasis.--btn-icon:active {
489 background-color: hsla(var(--colortextlink-h),var(--colortextlink-s) ,var(--colortextlink-l) , 0.1);
490 background-size: 100%;
491 transition: background 0s;/* used for hover ripple effect */
492}
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.
editval_textarea active
$fontlist
Definition style.css.php:77
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:129