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