multicompany.css.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <?php
  2. /* Copyright (C) 2011-2022 Regis Houssin <regis.houssin@inodbox.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. /**
  19. * \file /multicompany/css/multicompany.css.php
  20. * \brief Fichier de style CSS complementaire du module Multi-Company
  21. */
  22. //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
  23. //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
  24. if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
  25. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
  26. if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
  27. if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
  28. if (! defined('NOLOGIN')) define('NOLOGIN',1);
  29. if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
  30. if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
  31. if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
  32. if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks
  33. define('ISLOADEDBYSTEELSHEET', '1');
  34. session_cache_limiter(FALSE);
  35. $res=@include '../../main.inc.php'; // For "root" directory
  36. if (empty($res) && file_exists($_SERVER['DOCUMENT_ROOT']."/main.inc.php"))
  37. $res=@include($_SERVER['DOCUMENT_ROOT']."/main.inc.php"); // Use on dev env only
  38. if (empty($res)) $res=@include '../../../main.inc.php'; // For "custom" directory
  39. // Define css type
  40. header('Content-type: text/css');
  41. // Important: Following code is to avoid page request by browser and PHP CPU at
  42. // each Dolibarr page access.
  43. if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
  44. else header('Cache-Control: no-cache');
  45. $dol_optimize_smallscreen=$conf->dol_optimize_smallscreen;
  46. ?>
  47. .minwidth180 { min-width: 175px !important; }
  48. div.login_block_other { max-width: unset; }
  49. <?php if (empty($conf->twofactorauth->enabled)) { ?>
  50. #login_right #entity {
  51. min-width: 190px !important;
  52. }
  53. <?php } ?>
  54. #login_right .multicompany-trinputlogin .select2-container {
  55. padding-left: inherit;
  56. }
  57. #login_right .nowrap {
  58. white-space: nowrap!important;
  59. }
  60. #login_right .multicompany-trinputlogin {
  61. padding-top: 10px
  62. }
  63. .icon-multicompany-blue {
  64. background-image: url(<?php echo dol_buildpath('/multicompany/img/object_multicompany.png',1); ?>);
  65. background-repeat: no-repeat;
  66. background-position: left center;
  67. }
  68. .icon-multicompany-white {
  69. background-image: url(<?php echo dol_buildpath('/multicompany/img/object_multicompany_eldy.png',1); ?>);
  70. background-repeat: no-repeat;
  71. background-position: left center;
  72. }
  73. .icon-multicompany-black {
  74. background-image: url(<?php echo dol_buildpath('/multicompany/img/object_multicompany_md.png',1); ?>);
  75. background-repeat: no-repeat;
  76. background-position: left center;
  77. }
  78. .topmenu-mc-header-label {
  79. font-weight: bold;
  80. font-size: large;
  81. }
  82. .multicompany_select {
  83. font-family: roboto,arial,tahoma,verdana,helvetica !important;
  84. }
  85. #multicompany_title .opacityhigh {
  86. opacity: 0.8 !important;
  87. }
  88. .multicompany_block .fa-globe,
  89. .modify-entity {
  90. cursor:pointer;
  91. }
  92. .modify-entity-disabled {
  93. cursor:not-allowed!important;
  94. }
  95. div.entity_box {
  96. margin-top: 10px;
  97. }
  98. <?php if (empty($conf->twofactorauth->enabled)) { ?>
  99. div#login_right {
  100. min-width:0!important;
  101. }
  102. <?php } ?>
  103. #changeentity, #entitythirdparty, #entitycontact, #referring_entity {
  104. width: 200px;
  105. }
  106. #select2-changeentity-container {
  107. color: #444!important;
  108. }
  109. #entity_box #entity, #search_entity {
  110. width: 135px;
  111. }
  112. #entity_box .select2-container {
  113. margin-left: 8px!important;
  114. }
  115. .padding-left5 {
  116. padding-left: 5px;
  117. }
  118. .padding-top3 {
  119. padding-top: 3px;
  120. }
  121. .padding-left15 {
  122. padding-left: 15px!important;
  123. }
  124. .fifty-percent {
  125. width: 50%;
  126. }
  127. .seventy-percent {
  128. width: 70%;
  129. }
  130. .float-right {
  131. float: right;
  132. }
  133. .float-left {
  134. float: left;
  135. }
  136. .valign-middle {
  137. vertical-align: middle;
  138. }
  139. .text-align-right {
  140. text-align: right;
  141. }
  142. .text-align-center {
  143. text-align: center;
  144. }
  145. .text-align-left {
  146. text-align: left;
  147. }
  148. .button-align-right {
  149. text-align: right;
  150. padding-right: 30px;
  151. }
  152. .button-not-allowed {
  153. cursor: not-allowed !important;
  154. opacity: 0.6;
  155. }
  156. div.mc-upgrade-alert {
  157. color: #302020;
  158. padding: 0.5em 0.5em 0.5em 0.5em;
  159. margin: 0.5em 1.5em 0.5em 1.5em;
  160. border: 1px solid #e0d0b0;
  161. -moz-border-radius: 4px;
  162. -webkit-border-radius: 4px;
  163. border-radius: 4px;
  164. background: #EFCFCF;
  165. text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  166. }
  167. .dataTables_length select {
  168. font-size: unset;
  169. }
  170. table.dataTable thead tr {
  171. background-color: rgb(220,220,223)!important;
  172. }
  173. table.dataTable tbody tr.odd {
  174. background-color: #f8f8f8!important;
  175. border-bottom: 1px solid #ddd;
  176. }
  177. table.dataTable tbody tr.even {
  178. background-color: #ffffff!important;
  179. border-bottom: 1px solid #ddd;
  180. }
  181. table.dataTable tbody tr:hover {
  182. background-color: #edf4fb!important;
  183. }
  184. .multicompany-entity-container {
  185. font-size: smaller;
  186. background: #e1e7e1;
  187. padding: 2px;
  188. margin-right: 10px;
  189. margin-bottom: 5px;
  190. border-radius: 10px;
  191. display: inline-block;
  192. }
  193. .multicompany-entity-card-container {
  194. background: #e1e7e1;
  195. padding-left: 4px!important;
  196. padding-right: 5px!important;
  197. padding-bottom: 2px!important;
  198. margin-top: 5px!important;
  199. border-radius: 10px;
  200. display: inline-block;
  201. }
  202. .multicompany-entity-container:hover,
  203. .multicompany-entity-card-container:hover {
  204. background: #d5dbd5;
  205. }
  206. .multicompany-button-disabled,
  207. .multicompany-switch-disabled,
  208. .multicompany-switch-on-not-allowed,
  209. .multicompany-switch-off-not-allowed {
  210. margin: 5px;
  211. cursor: not-allowed;
  212. opacity: 0.5;
  213. }
  214. .multicompany-switch-on,
  215. .multicompany-switch-off,
  216. .multicompany-button-active-on,
  217. .multicompany-button-active-off,
  218. .multicompany-button-visible-on,
  219. .multicompany-button-visible-off {
  220. margin: 5px;
  221. cursor: pointer;
  222. }
  223. .multicompany-button-template,
  224. .multicompany-button-lock-on {
  225. margin: 5px;
  226. }
  227. .multicompany-button-template {
  228. color: rgb(59, 91, 152);
  229. }
  230. .multicompany-button-setup {
  231. margin: 7px;
  232. cursor: pointer;
  233. }
  234. .multicompany-button-clonerights {
  235. cursor: pointer;
  236. }
  237. .multicompany-button-delete {
  238. margin: 5px;
  239. cursor: pointer;
  240. }
  241. .multicompany-flag-language,
  242. .multicompany-flag-country {
  243. margin-top: 5px;
  244. }
  245. .multicompany-remove-from-link {
  246. padding-left: 10px;
  247. padding-right: 5px;
  248. }
  249. #dialog-duplicate {
  250. overflow-x: hidden;
  251. }
  252. .multiselect-title {
  253. padding-left: 5px;
  254. }
  255. .multiselect-available-title, .multiselect-selected-title {
  256. padding-bottom: 5px;
  257. color: #73808c;
  258. }
  259. .multiselect-available-title-text, .multiselect-selected-title-text {
  260. padding-left: 5px;
  261. }
  262. .multiselect-menu {
  263. /*padding-top: 23px;*/
  264. padding-top: 20px;
  265. }
  266. .multiselect-menu-btn-color {
  267. background-color: #e2e2e2!important;
  268. }
  269. .multiselect-menu-btn-color:hover {
  270. background-color: #f2f2f2!important;
  271. }
  272. .multiselect-select {
  273. overflow-y:auto;
  274. padding: 6px 6px!important;
  275. }
  276. .multiselect-option {
  277. background-color: #f2f2f2!important;
  278. cursor: pointer;
  279. border: 5px;
  280. }
  281. .multiselect-min-height {
  282. min-height: 140px;
  283. }
  284. .multiselect-byelement-min-height {
  285. min-height: 190px;
  286. }
  287. .multicompany-margin-right-5 {
  288. margin-right: 5px;
  289. }
  290. tr.multiselect-separator td {
  291. padding: 1px!important;
  292. line-height: 1px!important;
  293. height: 10px!important;
  294. }
  295. [data-tooltip]:before {
  296. content: attr(data-tooltip);
  297. }
  298. [data-tooltip] {
  299. display: inline-block;
  300. position: relative;
  301. cursor: pointer;
  302. /*padding: 4px;*/
  303. }
  304. /* Tooltip styling */
  305. [data-tooltip]:before {
  306. content: attr(data-tooltip);
  307. display: none;
  308. position: absolute;
  309. background: #fff;
  310. color: #444;
  311. border-top: solid 1px #BBBBBB;
  312. border-left: solid 1px #BBBBBB;
  313. border-right: solid 1px #BBBBBB;
  314. border-bottom: solid 1px #BBBBBB;
  315. padding: 4px 10px;
  316. border-radius: 0;
  317. box-shadow: 0 0 4px grey;
  318. margin: 2px;
  319. font-stretch: condensed;
  320. min-width: 320px;
  321. }
  322. /* Dynamic horizontal centering */
  323. [data-tooltip-position="top"]:before,
  324. [data-tooltip-position="bottom"]:before {
  325. left: 50%;
  326. -ms-transform: translateX(-50%);
  327. -moz-transform: translateX(-50%);
  328. -webkit-transform: translateX(-50%);
  329. transform: translateX(-50%);
  330. }
  331. /* Dynamic vertical centering */
  332. [data-tooltip-position="right"]:before,
  333. [data-tooltip-position="left"]:before {
  334. top: 50%;
  335. -ms-transform: translateY(-50%);
  336. -moz-transform: translateY(-50%);
  337. -webkit-transform: translateY(-50%);
  338. transform: translateY(-50%);
  339. }
  340. [data-tooltip-position="top"]:before {
  341. bottom: 100%;
  342. margin-bottom: 6px;
  343. }
  344. [data-tooltip-position="right"]:before {
  345. left: 100%;
  346. margin-left: 6px;
  347. }
  348. [data-tooltip-position="bottom"]:before {
  349. top: 100%;
  350. margin-top: 6px;
  351. }
  352. [data-tooltip-position="left"]:before {
  353. right: 100%;
  354. margin-right: 6px;
  355. }
  356. /* Show the tooltip when hovering */
  357. [data-tooltip]:hover:before,
  358. [data-tooltip]:hover:after {
  359. display: block;
  360. z-index: 3000;
  361. }
  362. <?php
  363. if (($conf->global->MAIN_THEME === 'eldy' && empty($conf->global->MULTICOMPANY_DROPDOWN_MENU_DISABLED) && ! GETPOSTISSET('theme')) || (GETPOSTISSET('theme') && GETPOST('theme', 'aZ', 1) === 'eldy')) {
  364. include dol_buildpath('/multicompany/css/dropdown.inc.php');
  365. }
  366. if (isset($conf->global->MAIN_CSS_COLORS) && $conf->global->MAIN_CSS_COLORS){
  367. $colors = explode(";",str_replace([',',';',' '],[";",";",";"],$conf->global->MAIN_CSS_COLORS));
  368. $colors[1] = (isset($colors[1]))?$colors[1]:$colors[0];
  369. $colors[2] = (isset($colors[2]))?$colors[2]:'fff';
  370. $colors[3] = (isset($colors[3]))?$colors[3]:'fff';
  371. # $colors[1] = (isset($colors[1]))?$colors[1]:$colors[0];
  372. echo '
  373. #id-top{
  374. background: #'.$colors[0].' !important;
  375. color: silver !important;
  376. }
  377. #blockvmenusearch{
  378. background: #'.$colors[1].' !important;
  379. }
  380. .side-nav{
  381. background: #'.$colors[1].' !important;
  382. }
  383. a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active,
  384. .mainmenu::before {
  385. color: #'.$colors[2].' !important;
  386. }
  387. a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active{
  388. color: #'.$colors[3].' !important;
  389. }
  390. ';
  391. }
  392. $usedropdownmenu = false;
  393. if (empty($conf->global->MULTICOMPANY_DROPDOWN_MENU_DISABLED)) {
  394. // For theme test link
  395. if (GETPOSTISSET('theme')) {
  396. if (GETPOST('theme', 'aZ', 1) === 'eldy') {
  397. $usedropdownmenu = true;
  398. }
  399. } else {
  400. // For user theme
  401. if (!empty($user->conf->MAIN_THEME)) {
  402. if ($user->conf->MAIN_THEME === 'eldy') {
  403. $usedropdownmenu = true;
  404. }
  405. // For global theme
  406. } elseif ($conf->global->MAIN_THEME === 'eldy') {
  407. $usedropdownmenu = true;
  408. }
  409. }
  410. }
  411. if ($usedropdownmenu) {
  412. include dol_buildpath('/multicompany/css/dropdown.inc.php');
  413. }