btn.inc.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <?php
  2. if (!defined('ISLOADEDBYSTEELSHEET')) {
  3. die('Must be call by steelsheet');
  4. } ?>
  5. /* <style type="text/css" > */
  6. :root {
  7. --btncolortext:rgb(<?php print $colortextlink; ?>);
  8. --btncolorbg: #fbfbfb;
  9. --btncolorborderhover: none;
  10. --btncolorborder: #FFF;
  11. --butactiondeletebg: rgb(234,228,225);
  12. --butactionbg: rgb(<?php print $butactionbg; ?>);
  13. --textbutaction: rgb(<?php print $textbutaction; ?>);
  14. }
  15. <?php
  16. if (getDolGlobalString('THEME_DARKMODEENABLED')) {
  17. print "/* For dark mode */\n";
  18. if ($conf->global->THEME_DARKMODEENABLED != 2) {
  19. print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
  20. } else {
  21. print "@media not print {";
  22. }
  23. print "
  24. :root {
  25. --btncolortext: ;
  26. --btncolorbg: rgb(26,27,27);
  27. --btncolorborderhover: #ffffff;
  28. --btncolorborder: #2b2c2e;
  29. --butactiondeletebg: rgb(252,84,91);
  30. --butactionbg: rgb(173,140,79);
  31. --textbutaction: rgb(255,255,255);
  32. }\n";
  33. print "}";
  34. }
  35. ?>
  36. /* ============================================================================== */
  37. /* Buttons for actions */
  38. /* ============================================================================== */
  39. div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
  40. div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
  41. div.tabsAction > div.divButAction > span.butAction,
  42. div.tabsAction > div.divButAction > span.butActionDelete,
  43. div.tabsAction > div.divButAction > span.butActionRefused,
  44. div.tabsAction > div.divButAction > a.butAction,
  45. div.tabsAction > div.divButAction > a.butActionDelete,
  46. div.tabsAction > div.divButAction > a.butActionRefused {
  47. margin-bottom: 1.4em !important;
  48. margin-right: 0px !important;
  49. }
  50. div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
  51. margin-bottom: 0 !important;
  52. }
  53. span.butAction, span.butActionDelete {
  54. cursor: pointer;
  55. }
  56. .butAction {
  57. background: var(--butactionbg);
  58. color: var(--textbutaction) !important;
  59. /* background: rgb(230, 232, 239); */
  60. }
  61. .butActionRefused, .butAction, .butActionDelete {
  62. border-radius: 3px;
  63. }
  64. :not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
  65. margin-<?php echo $right; ?>: 0px !important;
  66. }
  67. .butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
  68. text-decoration: none;
  69. text-transform: uppercase;
  70. font-weight: bold;
  71. line-height: 1.8em;
  72. margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
  73. padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
  74. font-family: <?php print $fontlist ?>;
  75. display: inline-block;
  76. text-align: center;
  77. cursor: pointer;
  78. color: #444;
  79. /* border: 1px solid #aaa; */
  80. /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
  81. /*border-top-right-radius: 0 !important;
  82. border-bottom-right-radius: 0 !important;
  83. border-top-left-radius: 0 !important;
  84. border-bottom-left-radius: 0 !important;*/
  85. }
  86. .butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
  87. text-decoration: none;
  88. text-transform: uppercase;
  89. font-weight: normal;
  90. margin: 0em 0.3em 0 0.3em !important;
  91. padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
  92. font-family: <?php print $fontlist ?>;
  93. display: inline-block;
  94. /* text-align: center; New button are on right of screen */
  95. cursor: pointer;
  96. }
  97. .button {
  98. border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
  99. display: inline-block;
  100. padding: 0.4em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
  101. margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
  102. line-height: 20px;
  103. text-align: center;
  104. vertical-align: middle;
  105. cursor: pointer;
  106. color: #333333 !important;
  107. text-decoration: none !important;
  108. text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  109. background-color: #f5f5f5;
  110. background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
  111. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
  112. background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
  113. background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
  114. background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
  115. background-repeat: repeat-x;
  116. border-color: #e6e6e6 #e6e6e6 #bfbfbf;
  117. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  118. border: 1px solid #bbbbbb;
  119. border-bottom-color: #a2a2a2;
  120. -webkit-border-radius: 2px;
  121. border-radius: 2px;
  122. -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  123. box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  124. }
  125. .butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
  126. text-decoration: none;
  127. /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
  128. display: inline-block;
  129. padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
  130. margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
  131. line-height: 20px;
  132. /* text-align: center; New button are on right of screen */
  133. vertical-align: middle;
  134. cursor: pointer;
  135. /* color: #ffffff !important; */
  136. /* text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); */
  137. -webkit-border-radius: 2px;
  138. border-radius: 2px;
  139. /* -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  140. box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); */
  141. /* background-color: #006dcc;
  142. background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  143. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  144. background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  145. background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  146. background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  147. background-repeat: repeat-x; */
  148. }
  149. a.butActionNew>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
  150. a.butActionNewRefused>span.fa-plus-circle { padding-left: 6px; font-size: 1.5em; }
  151. .tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
  152. .tableforfieldedit a.butActionNew>span.fa-plus-circle, .tableforfieldedit a.butActionNew>span.fa-plus-circle:hover,
  153. span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
  154. a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
  155. span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
  156. a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
  157. span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
  158. a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
  159. span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
  160. {
  161. font-size: 1em;
  162. padding-left: 0px;
  163. }
  164. .button {
  165. color: #ffffff !important;
  166. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  167. background-color: #006dcc;
  168. background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  169. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  170. background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  171. background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  172. background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  173. background-repeat: repeat-x;
  174. border-color: #0044cc #0044cc #002a80;
  175. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  176. }
  177. .button:disabled {
  178. color: #666 !important;
  179. text-shadow: none;
  180. border-color: #555;
  181. cursor: not-allowed;
  182. background-color: #f5f5f5;
  183. background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
  184. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
  185. background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
  186. background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
  187. background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
  188. background-repeat: repeat-x
  189. }
  190. button.ui-button {
  191. padding-top: 5px;
  192. }
  193. a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
  194. span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
  195. a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
  196. span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
  197. {
  198. padding-<?php echo $left; ?>: 6px;
  199. font-size: 1.5em;
  200. border: none;
  201. box-shadow: none;
  202. -webkit-box-shadow: none;
  203. }
  204. .butAction:hover {
  205. -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  206. box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  207. }
  208. .butActionNew:hover {
  209. text-decoration: underline;
  210. box-shadow: unset !important;
  211. }
  212. .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
  213. background: var(--butactiondeletebg);
  214. /* border: 1px solid #633; */
  215. color: #633;
  216. /* vertical-align: middle; */
  217. }
  218. .butActionDelete:hover {
  219. -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  220. box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  221. }
  222. .butActionRefused {
  223. text-decoration: none !important;
  224. text-transform: uppercase;
  225. font-weight: bold !important;
  226. white-space: nowrap !important;
  227. cursor: not-allowed !important;
  228. margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
  229. padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
  230. font-family: <?php print $fontlist ?> !important;
  231. display: inline-block;
  232. text-align: center;
  233. cursor: pointer;
  234. color: #999 !important;
  235. border: 1px solid #ccc;
  236. box-sizing: border-box;
  237. -moz-box-sizing: border-box;
  238. -webkit-box-sizing: border-box;
  239. }
  240. .butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
  241. text-decoration: none !important;
  242. text-transform: uppercase;
  243. font-weight: normal !important;
  244. white-space: nowrap !important;
  245. cursor: not-allowed !important;
  246. margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
  247. padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
  248. font-family: <?php print $fontlist ?> !important;
  249. display: inline-block;
  250. /* text-align: center; New button are on right of screen */
  251. cursor: pointer;
  252. color: #999 !important;
  253. padding-top: 0.2em;
  254. box-shadow: none !important;
  255. -webkit-box-shadow: none !important;
  256. }
  257. .butActionTransparent {
  258. color: #222 ! important;
  259. background-color: transparent ! important;
  260. }
  261. /*
  262. TITLE BUTTON
  263. */
  264. div.pagination li:first-child a.btnTitle {
  265. margin-left: 10px;
  266. }
  267. .btnTitle, a.btnTitle {
  268. display: inline-block;
  269. padding: 4px 12px;
  270. font-size: 14px;
  271. font-weight: 400;
  272. line-height: 1.4;
  273. text-align: center;
  274. white-space: nowrap;
  275. vertical-align: middle;
  276. -ms-touch-action: manipulation;
  277. touch-action: manipulation;
  278. cursor: pointer;
  279. -webkit-user-select: none;
  280. -moz-user-select: none;
  281. -ms-user-select: none;
  282. user-select: none;
  283. box-shadow: none;
  284. text-decoration: none;
  285. position: relative;
  286. margin: 0 0 0 10px;
  287. min-width: 80px;
  288. text-align: center;
  289. color: rgb(<?php print $colortextlink; ?>);
  290. border: none;
  291. font-size: 12px;
  292. font-weight: 300;
  293. /* background-color: #fbfbfb; */
  294. }
  295. a.btnTitle.btnTitleSelected {
  296. border: 1px solid #ccc;
  297. border-radius: 3px;
  298. }
  299. .btnTitle > .btnTitle-icon{
  300. }
  301. .btnTitle > .btnTitle-label{
  302. color: #666666;
  303. }
  304. .btnTitle:hover, a.btnTitle:hover {
  305. border-radius: 3px;
  306. position: relative;
  307. margin: 0 0 0 10px;
  308. text-align: center;
  309. color: #000;
  310. background-color: #eee;
  311. font-size: 12px;
  312. text-decoration: none;
  313. box-shadow: none;
  314. }
  315. .btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
  316. color: #8a8a8a;
  317. cursor: not-allowed;
  318. background-color: #fbfbfb;
  319. background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
  320. }
  321. .btnTitle:hover .btnTitle-label{
  322. color:var(--btncolorborderhover);
  323. }
  324. div.pagination .btnTitle:hover .btnTitle-label{
  325. color: rgb(<?php print $colortextlink; ?>);
  326. }
  327. .btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
  328. color: #8a8a8a;
  329. }
  330. .btnTitle>.fa {
  331. font-size: 20px;
  332. display: block;
  333. }
  334. .paginationafterarrows a.btnTitlePlus, .titre_right a.btnTitlePlus {
  335. border: 1px solid var(--btncolorborder);
  336. }
  337. .paginationafterarrows a.btnTitlePlus:hover, .titre_right a.btnTitlePlus:hover {
  338. border-color: #ddd;
  339. }
  340. /* The buttonplus isgrowing on hover (dont know why). This is to avoid to have the cellegrowing too */
  341. .btnTitlePlus:hover {
  342. max-width: 24px;
  343. max-height: 40px;
  344. }
  345. /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
  346. @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 */
  347. {
  348. .butAction, .butActionRefused, .butActionDelete {
  349. font-size: 0.95em;
  350. }
  351. .btnTitle, a.btnTitle {
  352. display: inline-block;
  353. padding: 4px 4px 4px 4px;
  354. min-width: unset;
  355. }
  356. }
  357. /* rule to reduce top menu - 3rd reduction: The menu for user is on left */
  358. @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 */
  359. {
  360. .butAction, .butActionRefused, .butActionDelete {
  361. font-size: 0.9em;
  362. }
  363. }
  364. /* smartphone */
  365. @media only screen and (max-width: 767px)
  366. {
  367. .butAction, .butActionRefused, .butActionDelete {
  368. font-size: 0.85em;
  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. * BTN LINK
  378. */
  379. .btn-link{
  380. margin-right: 5px;
  381. border: 1px solid #ddd;
  382. color: #333;
  383. padding: 5px 10px;
  384. border-radius:1em;
  385. text-decoration: none !important;
  386. }
  387. .btn-link:hover{
  388. background-color: #ddd;
  389. border: 1px solid #ddd;
  390. }