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