Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
92e65291e6
@ -1,140 +1,142 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet');
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
}
|
||||
?>
|
||||
/* Badge style is based on boostrap framework */
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: .1em .35em;
|
||||
font-size: 80%;
|
||||
font-weight: 700 !important;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25rem;
|
||||
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: rgba(255,255,255,0);
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
padding: .1em .35em;
|
||||
font-size: 80%;
|
||||
font-weight: 700 !important;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25rem;
|
||||
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: rgba(255,255,255,0);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.badge-status {
|
||||
font-size: 0.95em;
|
||||
padding: .19em .35em; /* more than 0.19 generate a change into heigth of lines */
|
||||
font-size: 0.95em;
|
||||
padding: .19em .35em; /* more than 0.19 generate a change into heigth of lines */
|
||||
}
|
||||
.tabBar .arearef .statusref .badge-status, .tabBar .arearefnobottom .statusref .badge-status {
|
||||
font-size: 1.1em;
|
||||
padding: .4em .4em;
|
||||
font-size: 1.1em;
|
||||
padding: .4em .4em;
|
||||
}
|
||||
/* Force values for small screen 767 */
|
||||
@media only screen and (max-width: 767px)
|
||||
{
|
||||
.tabBar .arearef .statusref .badge-status, .tabBar .arearefnobottom .statusref .badge-status {
|
||||
font-size: 0.95em;
|
||||
padding: .3em .2em;
|
||||
font-size: 0.95em;
|
||||
padding: .3em .2em;
|
||||
}
|
||||
}
|
||||
|
||||
.badge-pill, .tabs .badge {
|
||||
padding-right: .5em;
|
||||
padding-left: .5em;
|
||||
border-radius: 0.25rem;
|
||||
padding-right: .5em;
|
||||
padding-left: .5em;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.badge-dot {
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
padding: 0.45em;
|
||||
vertical-align: text-top;
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
padding: 0.45em;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
a.badge:focus, a.badge:hover {
|
||||
text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.liste_titre .badge:not(.nochangebackground) {
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
color: #fff;
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
span.badgeneutral {
|
||||
padding: 2px 7px 2px 7px;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
padding: 2px 7px 2px 7px;
|
||||
background-color: #e4e4e4;
|
||||
color: #666;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* PRIMARY */
|
||||
.badge-primary{
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgePrimary; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgePrimary; ?>;
|
||||
}
|
||||
a.badge-primary.focus, a.badge-primary:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgePrimary, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgePrimary, 0.5); ?>;
|
||||
}
|
||||
a.badge-primary:focus, a.badge-primary:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgePrimary, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgePrimary, 10); ?>;
|
||||
}
|
||||
|
||||
/* SECONDARY */
|
||||
.badge-secondary, .tabs .badge {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
}
|
||||
a.badge-secondary.focus, a.badge-secondary:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSecondary, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSecondary, 0.5); ?>;
|
||||
}
|
||||
a.badge-secondary:focus, a.badge-secondary:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSecondary, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSecondary, 10); ?>;
|
||||
}
|
||||
|
||||
/* SUCCESS */
|
||||
.badge-success {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSuccess; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSuccess; ?>;
|
||||
}
|
||||
a.badge-success.focus, a.badge-success:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSuccess, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSuccess, 0.5); ?>;
|
||||
}
|
||||
a.badge-success:focus, a.badge-success:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSuccess, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSuccess, 10); ?>;
|
||||
}
|
||||
|
||||
/* DANGER */
|
||||
.badge-danger {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDanger; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDanger; ?>;
|
||||
}
|
||||
a.badge-danger.focus, a.badge-danger:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDanger, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDanger, 0.5); ?>;
|
||||
}
|
||||
a.badge-danger:focus, a.badge-danger:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDanger, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDanger, 10); ?>;
|
||||
}
|
||||
|
||||
/* WARNING */
|
||||
.badge-warning {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeWarning; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeWarning; ?>;
|
||||
}
|
||||
a.badge-warning.focus, a.badge-warning:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeWarning, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeWarning, 0.5); ?>;
|
||||
}
|
||||
a.badge-warning:focus, a.badge-warning:hover {
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeWarning, 10); ?>;
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeWarning, 10); ?>;
|
||||
}
|
||||
|
||||
/* WARNING colorblind */
|
||||
@ -150,53 +152,53 @@ body[class*="colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
|
||||
|
||||
/* INFO */
|
||||
.badge-info {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeInfo; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeInfo; ?>;
|
||||
}
|
||||
a.badge-info.focus, a.badge-info:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeInfo, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeInfo, 0.5); ?>;
|
||||
}
|
||||
a.badge-info:focus, a.badge-info:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeInfo, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeInfo, 10); ?>;
|
||||
}
|
||||
|
||||
/* LIGHT */
|
||||
.badge-light {
|
||||
color: #212529 !important;
|
||||
background-color: <?php print $badgeLight; ?>;
|
||||
color: #212529 !important;
|
||||
background-color: <?php print $badgeLight; ?>;
|
||||
}
|
||||
a.badge-light.focus, a.badge-light:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeLight, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeLight, 0.5); ?>;
|
||||
}
|
||||
a.badge-light:focus, a.badge-light:hover {
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeLight, 10); ?>;
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeLight, 10); ?>;
|
||||
}
|
||||
|
||||
/* DARK */
|
||||
.badge-dark {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDark; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDark; ?>;
|
||||
}
|
||||
a.badge-dark.focus, a.badge-dark:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDark, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDark, 0.5); ?>;
|
||||
}
|
||||
a.badge-dark:focus, a.badge-dark:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (max-width: 570px)
|
||||
{
|
||||
span.badge.badge-status {
|
||||
overflow: hidden;
|
||||
max-width: 130px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
max-width: 130px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
@ -246,8 +248,12 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL
|
||||
$thisBadgeBackgroundColor = "#fff";
|
||||
}
|
||||
|
||||
if (in_array((string) $statusName, array('0', '5', '9'))) $thisBadgeTextColor = '#999999';
|
||||
if (in_array((string) $statusName, array('6'))) $thisBadgeTextColor = '#777777';
|
||||
if (in_array((string) $statusName, array('0', '5', '9'))) {
|
||||
$thisBadgeTextColor = '#999999';
|
||||
}
|
||||
if (in_array((string) $statusName, array('6'))) {
|
||||
$thisBadgeTextColor = '#777777';
|
||||
}
|
||||
|
||||
print $cssPrefix.".badge-status".$statusName." {\n";
|
||||
print " color: ".$thisBadgeTextColor." !important;\n";
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
:root {
|
||||
--btncolortext:rgb(<?php print $colortextlink; ?>);
|
||||
--btncolorbg: #fbfbfb;
|
||||
--btncolorborderhover: none;
|
||||
--btncolorborder: #FFF;
|
||||
/* --butactionbg:rgba(150, 110, 162, 0.95); */
|
||||
--butactionbg:rgb(118, 145, 225);
|
||||
--butactionbg:rgba(150, 110, 162, 0.95);
|
||||
--butactiondeletebg: rgb(234,228,225);
|
||||
/* tertiary color */
|
||||
/* --butactionbg:rgb(218, 235, 225); */
|
||||
/* --butactionbg:rgb(228, 218, 235); */
|
||||
--btncolortext:rgb(<?php print $colortextlink; ?>);
|
||||
--btncolorbg: #fbfbfb;
|
||||
--btncolorborderhover: none;
|
||||
--btncolorborder: #FFF;
|
||||
/* --butactionbg:rgba(150, 110, 162, 0.95); */
|
||||
--butactionbg:rgb(118, 145, 225);
|
||||
--butactionbg:rgba(150, 110, 162, 0.95);
|
||||
--butactiondeletebg: rgb(234,228,225);
|
||||
/* tertiary color */
|
||||
/* --butactionbg:rgb(218, 235, 225); */
|
||||
/* --butactionbg:rgb(228, 218, 235); */
|
||||
}
|
||||
|
||||
<?php
|
||||
@ -45,60 +47,60 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) {
|
||||
/* ============================================================================== */
|
||||
|
||||
div.divButAction {
|
||||
margin-bottom: 1.4em;
|
||||
margin-bottom: 1.4em;
|
||||
}
|
||||
div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
|
||||
div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete {
|
||||
margin-bottom: 1.4em !important;
|
||||
margin-bottom: 1.4em !important;
|
||||
}
|
||||
div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
|
||||
margin-bottom: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
span.butAction, span.butActionDelete {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
.paginationafterarrows .butAction {
|
||||
font-size: 0.9em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.butAction {
|
||||
background: var(--butactionbg);
|
||||
color: #FFF !important;
|
||||
border-radius: 3px;
|
||||
/* background: rgb(230, 232, 239); */
|
||||
background: var(--butactionbg);
|
||||
color: #FFF !important;
|
||||
border-radius: 3px;
|
||||
/* background: rgb(230, 232, 239); */
|
||||
}
|
||||
.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
/* color: #fff; */
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
color: #444;
|
||||
/* border: 1px solid #aaa; */
|
||||
/* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
/* color: #fff; */
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
color: #444;
|
||||
/* border: 1px solid #aaa; */
|
||||
/* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
|
||||
|
||||
/*border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;*/
|
||||
/*border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;*/
|
||||
}
|
||||
.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal;
|
||||
|
||||
margin: 0em 0.3em 0 0.3em !important;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
margin: 0em 0.3em 0 0.3em !important;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
|
||||
@ -127,66 +129,66 @@ span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
|
||||
}
|
||||
|
||||
.butAction:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
.butActionNew:hover {
|
||||
text-decoration: underline;
|
||||
box-shadow: unset !important;
|
||||
text-decoration: underline;
|
||||
box-shadow: unset !important;
|
||||
}
|
||||
|
||||
.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
|
||||
background: var(--butactiondeletebg);
|
||||
/* border: 1px solid #633; */
|
||||
color: #633;
|
||||
background: var(--butactiondeletebg);
|
||||
/* border: 1px solid #633; */
|
||||
color: #633;
|
||||
}
|
||||
|
||||
.butActionDelete:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
|
||||
.butActionRefused {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold !important;
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal !important;
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
padding-top: 0.2em;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
padding-top: 0.2em;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
}
|
||||
|
||||
.butActionTransparent {
|
||||
color: #222 ! important;
|
||||
background-color: transparent ! important;
|
||||
color: #222 ! important;
|
||||
background-color: transparent ! important;
|
||||
}
|
||||
|
||||
|
||||
@ -195,37 +197,37 @@ TITLE BUTTON
|
||||
*/
|
||||
|
||||
.btnTitle, a.btnTitle {
|
||||
display: inline-block;
|
||||
padding: 4px 4px 4px 4px;
|
||||
font-weight: 400;
|
||||
/* line-height: 1; */
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
box-shadow: var(--btncolorbg);
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
/* margin: 0 0 0 8px; */
|
||||
min-width: 72px;
|
||||
text-align: center;
|
||||
color: var(--btncolortext);
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
background-color: var(--btncolorbg);
|
||||
display: inline-block;
|
||||
padding: 4px 4px 4px 4px;
|
||||
font-weight: 400;
|
||||
/* line-height: 1; */
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
box-shadow: var(--btncolorbg);
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
/* margin: 0 0 0 8px; */
|
||||
min-width: 72px;
|
||||
text-align: center;
|
||||
color: var(--btncolortext);
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
background-color: var(--btncolorbg);
|
||||
border: 1px solid var(--btncolorborder);
|
||||
}
|
||||
|
||||
a.btnTitle.btnTitleSelected {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.btnTitle > .btnTitle-icon{
|
||||
@ -233,43 +235,43 @@ a.btnTitle.btnTitleSelected {
|
||||
}
|
||||
|
||||
.btnTitle > .btnTitle-label{
|
||||
color: #666666;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.btnTitle:hover, a.btnTitle:hover {
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
/* color: #ffffff;
|
||||
background-color: rgb(<?php print $colortextlink; ?>); */
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
box-shadow: none;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
/* color: #ffffff;
|
||||
background-color: rgb(<?php print $colortextlink; ?>); */
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
|
||||
color: #8a8a8a;
|
||||
cursor: not-allowed;
|
||||
background-color: #fbfbfb;
|
||||
background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
|
||||
color: #8a8a8a;
|
||||
cursor: not-allowed;
|
||||
background-color: #fbfbfb;
|
||||
background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
|
||||
}
|
||||
|
||||
.btnTitle:hover .btnTitle-label{
|
||||
color: var(--btncolorborderhover);
|
||||
color: var(--btncolorborderhover);
|
||||
}
|
||||
|
||||
.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
|
||||
color: #8a8a8a;
|
||||
color: #8a8a8a;
|
||||
}
|
||||
|
||||
.btnTitle>.fa {
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.pagination li:first-child a.btnTitle{
|
||||
margin-left: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
@ -284,15 +286,15 @@ div.pagination li:first-child a.btnTitle{
|
||||
font-size: 0.95em;
|
||||
}
|
||||
.btnTitle, a.btnTitle {
|
||||
display: inline-block;
|
||||
padding: 4px 4px 4px 4px;
|
||||
display: inline-block;
|
||||
padding: 4px 4px 4px 4px;
|
||||
min-width: unset;
|
||||
}
|
||||
}
|
||||
|
||||
<?php if (!empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?>
|
||||
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
|
||||
display: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@ -1,63 +1,65 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > dont remove this line it's an ide hack */
|
||||
/*
|
||||
* Dropdown of user popup
|
||||
*/
|
||||
|
||||
button.dropdown-item.global-search-item {
|
||||
outline: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-quickadd, .open>.dropdown-menu, .dropdown dd ul.open {
|
||||
display: block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-search {
|
||||
border-color: #eee;
|
||||
border-color: #eee;
|
||||
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
}
|
||||
.dropdown-bookmark {
|
||||
border-color: #eee;
|
||||
border-color: #eee;
|
||||
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
}
|
||||
.dropdown-quickadd {
|
||||
border-color: #eee;
|
||||
@ -83,107 +85,107 @@ button.dropdown-item.global-search-item {
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
}
|
||||
.dropdown-menu {
|
||||
border-color: #eee;
|
||||
border-color: #eee;
|
||||
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
}
|
||||
|
||||
|
||||
.dropdown-toggle{
|
||||
text-decoration: none !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.dropdown-toggle::after {
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-size: 0.7em;
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin: auto 3px;
|
||||
display: inline-block;
|
||||
content: "\f078";
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-size: 0.7em;
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin: auto 3px;
|
||||
display: inline-block;
|
||||
content: "\f078";
|
||||
|
||||
-webkit-transition: -webkit-transform .2s ease-in-out;
|
||||
-ms-transition: -ms-transform .2s ease-in-out;
|
||||
transition: transform .2s ease-in-out;
|
||||
-webkit-transition: -webkit-transform .2s ease-in-out;
|
||||
-ms-transition: -ms-transform .2s ease-in-out;
|
||||
transition: transform .2s ease-in-out;
|
||||
}
|
||||
|
||||
.open>.dropdown-toggle::after {
|
||||
transform: rotate(180deg);
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/*
|
||||
* MENU Dropdown
|
||||
*/
|
||||
.login_block.usedropdown .logout-btn{
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tmenu .open.dropdown, .tmenu .open.dropdown {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.tmenu .dropdown-menu, .login_block .dropdown-menu, .topnav .dropdown-menu {
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
<?php echo $left; ?>: auto;
|
||||
line-height:1.3em;
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
<?php echo $left; ?>: auto;
|
||||
line-height:1.3em;
|
||||
}
|
||||
.tmenu .dropdown-menu, .login_block .dropdown-menu .user-body {
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
.user-body {
|
||||
color: #333;
|
||||
color: #333;
|
||||
}
|
||||
.side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu {
|
||||
border-top-right-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
padding: 1px 0 0 0;
|
||||
border-top-width: 0;
|
||||
width: 300px;
|
||||
border-top-right-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
padding: 1px 0 0 0;
|
||||
border-top-width: 0;
|
||||
width: 300px;
|
||||
}
|
||||
.topnav .user-menu .dropdown-menu {
|
||||
top: 50px;
|
||||
}
|
||||
.side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu {
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.side-nav-vert .user-menu .dropdown-menu > .user-header, .topnav .user-menu .dropdown-menu > .user-header {
|
||||
min-height: 100px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
white-space: normal;
|
||||
min-height: 100px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
#topmenu-global-search-dropdown .dropdown-menu{
|
||||
width: 300px;
|
||||
max-width: 100%;
|
||||
width: 300px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown, div#topmenu-quickadd-dropdown {
|
||||
@ -192,184 +194,184 @@ div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown, div#topmenu-q
|
||||
<?php } ?>
|
||||
}
|
||||
a.top-menu-dropdown-link {
|
||||
padding: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.dropdown-user-image {
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
z-index: 5;
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
border: 3px solid;
|
||||
border-color: transparent;
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
max-width: 100%;
|
||||
max-height :100%;
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
z-index: 5;
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
border: 3px solid;
|
||||
border-color: transparent;
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
max-width: 100%;
|
||||
max-height :100%;
|
||||
}
|
||||
|
||||
.dropdown-menu > .user-header{
|
||||
background: var(--colorbackhmenu1);
|
||||
background: var(--colorbackhmenu1);
|
||||
}
|
||||
|
||||
.dropdown-menu .dropdown-header{
|
||||
padding: 8px 8px 8px 8px;
|
||||
padding: 8px 8px 8px 8px;
|
||||
}
|
||||
|
||||
.dropdown-menu > .user-footer {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.user-footer:after {
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.dropdown-menu > .bookmark-footer{
|
||||
border-top: 1px solid #f0f0f0;
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-menu > .user-body, .dropdown-body{
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
border-top: 1px solid #dddddd;
|
||||
white-space: normal;
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
border-top: 1px solid #dddddd;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.dropdown-menu > .bookmark-body, .dropdown-body{
|
||||
overflow-y: auto;
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 110px) ;
|
||||
overflow-y: auto;
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 110px) ;
|
||||
white-space: normal;
|
||||
}
|
||||
#topmenu-bookmark-dropdown .dropdown-menu > .bookmark-body, #topmenu-bookmark-dropdown .dropdown-body{
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 200px) ;
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 200px) ;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-body::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
width: 8px;
|
||||
}
|
||||
.dropdown-body::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
background: #aaa;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
background: #aaa;
|
||||
}
|
||||
.dropdown-body::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
#topmenu-login-dropdown, #topmenu-bookmark-dropdown, #topmenu-global-search-dropdown {
|
||||
padding: 0 5px 0 5px;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
#topmenu-login-dropdown a:hover{
|
||||
text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#topmenuloginmoreinfo-btn{
|
||||
display: block;
|
||||
text-aling: right;
|
||||
color:#666;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
text-aling: right;
|
||||
color:#666;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#topmenuloginmoreinfo{
|
||||
display: none;
|
||||
clear: both;
|
||||
font-size: 0.95em;
|
||||
display: none;
|
||||
clear: both;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
.button-top-menu-dropdown {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin-bottom: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin-bottom: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.user-footer .button-top-menu-dropdown {
|
||||
color: #666666;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-width: 1px;
|
||||
background-color: #f4f4f4;
|
||||
border-color: #ddd;
|
||||
color: #666666;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-width: 1px;
|
||||
background-color: #f4f4f4;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.dropdown-menu a.top-menu-dropdown-link {
|
||||
color: rgb(<?php print $colortextlink; ?>) !important;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
display: block;
|
||||
margin: 5px 0px;
|
||||
color: rgb(<?php print $colortextlink; ?>) !important;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
display: block;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
display: block !important;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: .3em 1.5em .4em 1em;
|
||||
clear: both;
|
||||
font-weight: 400;
|
||||
color: #212529 !important;
|
||||
text-align: inherit;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
display: block !important;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: .3em 1.5em .4em 1em;
|
||||
clear: both;
|
||||
font-weight: 400;
|
||||
color: #212529 !important;
|
||||
text-align: inherit;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.dropdown-item::before {
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin-right: 5px;
|
||||
display: inline-block;
|
||||
content: "\f0da";
|
||||
/* color: rgba(0,0,0,0.3); */
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin-right: 5px;
|
||||
display: inline-block;
|
||||
content: "\f0da";
|
||||
/* color: rgba(0,0,0,0.3); */
|
||||
}
|
||||
.dropdown-item.bookmark-item-external::before {
|
||||
content: "\f35d";
|
||||
}
|
||||
|
||||
.dropdown-item.active, .dropdown-item:hover, .dropdown-item:focus {
|
||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||
text-decoration: none;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||
text-decoration: none;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -377,34 +379,34 @@ a.top-menu-dropdown-link {
|
||||
*/
|
||||
|
||||
.dropdown-search-input {
|
||||
width: 100%;
|
||||
padding: 10px 35px 10px 20px;
|
||||
width: 100%;
|
||||
padding: 10px 35px 10px 20px;
|
||||
|
||||
background-color: transparent;
|
||||
/*font-size: 14px;
|
||||
line-height: 16px;*/
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
/*font-size: 14px;
|
||||
line-height: 16px;*/
|
||||
box-sizing: border-box;
|
||||
|
||||
color: #575756;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
background-position: 95% center;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #c4c4c2 !important;
|
||||
transition: all 250ms ease-in-out;
|
||||
backface-visibility: hidden;
|
||||
transform-style: preserve-3d;
|
||||
color: #575756;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
background-position: 95% center;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #c4c4c2 !important;
|
||||
transition: all 250ms ease-in-out;
|
||||
backface-visibility: hidden;
|
||||
transform-style: preserve-3d;
|
||||
|
||||
}
|
||||
|
||||
.dropdown-search-input::placeholder {
|
||||
color: color(#575756 a(0.8));
|
||||
letter-spacing: 1.5px;
|
||||
color: color(#575756 a(0.8));
|
||||
letter-spacing: 1.5px;
|
||||
}
|
||||
|
||||
.hidden-search-result{
|
||||
display: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -468,11 +470,11 @@ div.quickaddblock:focus {
|
||||
@media only screen and (max-width: 767px)
|
||||
{
|
||||
.dropdown-search-input {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tmenu .dropdown-menu, .login_block .dropdown-menu, .topnav .dropdown-menu {
|
||||
margin-left: 5px;
|
||||
right: 0;
|
||||
}
|
||||
margin-left: 5px;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
/*
|
||||
@ -8,33 +10,33 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
*/
|
||||
|
||||
.info-box-module-external span.info-box-icon-version {
|
||||
background: #bbb;
|
||||
background: #bbb;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
display: block;
|
||||
position: relative;
|
||||
position: relative;
|
||||
min-height: 90px;
|
||||
/* background: #fff; */
|
||||
width: 100%;
|
||||
box-shadow: 1px 1px 15px rgba(192, 192, 192, 0.2);
|
||||
border-radius: 2px;
|
||||
border: 1px solid #e9e9e9;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #e9e9e9;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.info-box.info-box-sm {
|
||||
min-height: 80px;
|
||||
margin-bottom: 10px;
|
||||
/* background: #fff; */
|
||||
min-height: 80px;
|
||||
margin-bottom: 10px;
|
||||
/* background: #fff; */
|
||||
}
|
||||
.opened-dash-board-wrap .info-box.info-box-sm {
|
||||
border-radius: 0 0 0 20px;
|
||||
border-radius: 0 0 0 20px;
|
||||
}
|
||||
.info-box-more {
|
||||
float: right;
|
||||
top: 5px;
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
float: right;
|
||||
top: 5px;
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
.info-box small {
|
||||
@ -71,7 +73,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
@ -82,20 +84,20 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
}
|
||||
|
||||
.info-box-module .info-box-icon {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.info-box-sm .info-box-icon {
|
||||
height: 80px;
|
||||
width: 78px;
|
||||
font-size: 25px;
|
||||
line-height: 92px;
|
||||
height: 80px;
|
||||
width: 78px;
|
||||
font-size: 25px;
|
||||
line-height: 92px;
|
||||
}
|
||||
.opened-dash-board-wrap .info-box-sm .info-box-icon {
|
||||
border-radius: 0 0 0 20px;
|
||||
border-radius: 0 0 0 20px;
|
||||
}
|
||||
.opened-dash-board-wrap .info-box-sm .info-box-icon {
|
||||
line-height: 80px;
|
||||
line-height: 80px;
|
||||
}
|
||||
.info-box-module .info-box-icon {
|
||||
height: 98px;
|
||||
@ -104,75 +106,75 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
max-width: 100%;
|
||||
}
|
||||
.info-box-module .info-box-icon > img {
|
||||
max-width: 60%;
|
||||
max-width: 60%;
|
||||
}
|
||||
|
||||
a.info-box-text.info-box-text-a {
|
||||
display: table-cell;
|
||||
display: table-cell;
|
||||
}
|
||||
a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
font-size: 0.9em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.info-box-icon-text{
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
|
||||
font-size: 10px;
|
||||
line-height: 15px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
font-size: 10px;
|
||||
line-height: 15px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
}
|
||||
|
||||
.info-box-icon-version {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
|
||||
font-size: 10px;
|
||||
line-height: 22px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
font-size: 10px;
|
||||
line-height: 22px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
}
|
||||
.box-flex-item.info-box-module.info-box-module-disabled {
|
||||
/* opacity: 0.6; */
|
||||
/* opacity: 0.6; */
|
||||
}
|
||||
|
||||
.info-box-actions {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
<?php if (empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)) { ?>
|
||||
.info-box-icon-text{
|
||||
opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
.info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version{
|
||||
overflow: hidden;
|
||||
width: 80px;
|
||||
overflow: hidden;
|
||||
width: 80px;
|
||||
}
|
||||
.info-box:hover .info-box-icon-text{
|
||||
opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.info-box-content {
|
||||
@ -180,11 +182,11 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
margin-left: 84px;
|
||||
}
|
||||
.info-box-sm .info-box-content{
|
||||
margin-left: 80px;
|
||||
margin-left: 80px;
|
||||
}
|
||||
.info-box-sm .info-box-module-enabled {
|
||||
/* background: linear-gradient(0.35turn, #fff, #fff, #f6faf8, #e4efe8) */
|
||||
background: linear-gradient(0.4turn, #fff, #fff, #fff, #e4efe8);
|
||||
/* background: linear-gradient(0.35turn, #fff, #fff, #f6faf8, #e4efe8) */
|
||||
background: linear-gradient(0.4turn, #fff, #fff, #fff, #e4efe8);
|
||||
}
|
||||
.info-box-content-warning span.font-status4 {
|
||||
color: #bc9526 !important;
|
||||
@ -193,7 +195,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
background: #ffd7a3;
|
||||
}*/
|
||||
/*.info-box-icon.info-box-icon-module-enabled {
|
||||
background: #e4f0e4 !important;
|
||||
background: #e4f0e4 !important;
|
||||
}*/
|
||||
|
||||
.info-box-number {
|
||||
@ -240,20 +242,26 @@ a.info-box-text{ text-decoration: none;}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$prefix = '';
|
||||
if (!empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) $prefix = 'background-';
|
||||
if (!empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) {
|
||||
$prefix = 'background-';
|
||||
}
|
||||
|
||||
if (!isset($conf->global->THEME_SATURATE_RATIO)) $conf->global->THEME_SATURATE_RATIO = 0.7;
|
||||
if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = GETPOST('THEME_SATURATE_RATIO', 'int');
|
||||
if (!isset($conf->global->THEME_SATURATE_RATIO)) {
|
||||
$conf->global->THEME_SATURATE_RATIO = 0.7;
|
||||
}
|
||||
if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
||||
$conf->global->THEME_SATURATE_RATIO = GETPOST('THEME_SATURATE_RATIO', 'int');
|
||||
}
|
||||
|
||||
?>
|
||||
.info-box-icon {
|
||||
<?php if ($prefix) { ?>
|
||||
color: #fff !important;
|
||||
<?php } ?>
|
||||
opacity: 0.95;
|
||||
<?php if (isset($conf->global->THEME_SATURATE_RATIO)) { ?>
|
||||
filter: saturate(<?php echo $conf->global->THEME_SATURATE_RATIO; ?>);
|
||||
<?php } ?>
|
||||
opacity: 0.95;
|
||||
<?php if (isset($conf->global->THEME_SATURATE_RATIO)) { ?>
|
||||
filter: saturate(<?php echo $conf->global->THEME_SATURATE_RATIO; ?>);
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
.customer-back {
|
||||
@ -435,13 +443,13 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
|
||||
}
|
||||
.info-box-module {
|
||||
min-width: 350px;
|
||||
max-width: 350px;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1740px) {
|
||||
.info-box-module {
|
||||
min-width: 315px;
|
||||
max-width: 315px;
|
||||
min-width: 315px;
|
||||
max-width: 315px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,8 +471,8 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
|
||||
@media only screen and (max-width: 767px)
|
||||
{
|
||||
.box-flex-container {
|
||||
margin: 0 0 0 0px !important;
|
||||
width: 100% !important;
|
||||
margin: 0 0 0 0px !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
.info-box-module {
|
||||
width: 100%;
|
||||
|
||||
@ -1,23 +1,25 @@
|
||||
<?php if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
<?php if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
.mainmenu::before{
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
line-height: 23px;
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
line-height: 23px;
|
||||
font-size: <?php echo $topMenuFontSize; ?>;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
color: #<?php echo $colortextbackhmenu; ?>;
|
||||
}
|
||||
|
||||
.fa-15x {
|
||||
font-size: 1.5em;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
div.mainmenu.menu {
|
||||
@ -34,116 +36,116 @@ div.mainmenu.home::before{
|
||||
}
|
||||
|
||||
div.mainmenu.billing::before {
|
||||
content: "\f51e";
|
||||
content: "\f51e";
|
||||
}
|
||||
|
||||
div.mainmenu.accountancy::before {
|
||||
content: "\f53d";
|
||||
content: "\f53d";
|
||||
}
|
||||
|
||||
div.mainmenu.agenda::before {
|
||||
content: "\f073";
|
||||
content: "\f073";
|
||||
}
|
||||
|
||||
div.mainmenu.bank::before {
|
||||
content: "\f19c";
|
||||
content: "\f19c";
|
||||
}
|
||||
|
||||
<?php if ($conf->global->MAIN_FEATURES_LEVEL == 2) { ?>
|
||||
/* TESTING USAGE OF SVG WITHOUT FONT */
|
||||
div.mainmenu.cashdesk {
|
||||
line-height: 26px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
div.mainmenu.cashdesk .tmenuimage {
|
||||
line-height: 26px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
height: <?php echo $topMenuFontSize; ?>;
|
||||
line-height: 26px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
height: <?php echo $topMenuFontSize; ?>;
|
||||
background-color: #<?php echo $colortextbackhmenu; ?>;
|
||||
width: 100%;
|
||||
-webkit-mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%; /* for old webkit browser */
|
||||
mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%;
|
||||
width: 100%;
|
||||
-webkit-mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%; /* for old webkit browser */
|
||||
mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%;
|
||||
}
|
||||
|
||||
<?php } else { ?>
|
||||
div.mainmenu.cashdesk::before {
|
||||
content: "\f788";
|
||||
content: "\f788";
|
||||
}
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
div.mainmenu.takepos::before {
|
||||
content: "\f788";
|
||||
content: "\f788";
|
||||
}
|
||||
|
||||
div.mainmenu.companies::before {
|
||||
content: "\f1ad";
|
||||
content: "\f1ad";
|
||||
}
|
||||
|
||||
div.mainmenu.commercial::before {
|
||||
content: "\f0f2";
|
||||
content: "\f0f2";
|
||||
}
|
||||
|
||||
div.mainmenu.ecm::before {
|
||||
content: "\f07c";
|
||||
content: "\f07c";
|
||||
}
|
||||
|
||||
div.mainmenu.externalsite::before {
|
||||
content: "\f360";
|
||||
content: "\f360";
|
||||
}
|
||||
|
||||
div.mainmenu.ftp::before {
|
||||
content: "\f362";
|
||||
content: "\f362";
|
||||
}
|
||||
|
||||
div.mainmenu.hrm::before {
|
||||
content: "\f508";
|
||||
content: "\f508";
|
||||
}
|
||||
|
||||
div.mainmenu.members::before {
|
||||
content: "\f007";
|
||||
content: "\f007";
|
||||
}
|
||||
|
||||
div.mainmenu.products::before {
|
||||
content: "\f1b2";
|
||||
content: "\f1b2";
|
||||
}
|
||||
|
||||
div.mainmenu.mrp::before {
|
||||
content: "\f1b3";
|
||||
content: "\f1b3";
|
||||
}
|
||||
|
||||
div.mainmenu.project::before {
|
||||
content: "\f0e8";
|
||||
content: "\f0e8";
|
||||
}
|
||||
|
||||
div.mainmenu.ticket::before {
|
||||
content: "\f3ff";
|
||||
content: "\f3ff";
|
||||
}
|
||||
|
||||
div.mainmenu.tools::before {
|
||||
content: "\f0ad";
|
||||
content: "\f0ad";
|
||||
}
|
||||
|
||||
div.mainmenu.website::before {
|
||||
content: "\f57d";
|
||||
content: "\f57d";
|
||||
}
|
||||
|
||||
div.mainmenu.generic1::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
div.mainmenu.generic2::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
div.mainmenu.generic3::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
div.mainmenu.generic4::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
/* Define color of some picto */
|
||||
|
||||
@ -25,16 +25,36 @@
|
||||
* \brief File for The Web App
|
||||
*/
|
||||
|
||||
if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
|
||||
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
|
||||
if (!defined('NOLOGIN')) define('NOLOGIN', '1');
|
||||
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOSESSION')) define('NOSESSION', '1');
|
||||
if (!defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
}
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
}
|
||||
if (!defined('NOREQUIRETRAN')) {
|
||||
define('NOREQUIRETRAN', '1');
|
||||
}
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define('NOCSRFCHECK', '1');
|
||||
}
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
define('NOTOKENRENEWAL', '1');
|
||||
}
|
||||
if (!defined('NOLOGIN')) {
|
||||
define('NOLOGIN', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
define('NOREQUIREMENU', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
if (!defined('NOSESSION')) {
|
||||
define('NOSESSION', '1');
|
||||
}
|
||||
|
||||
require_once __DIR__.'/../../main.inc.php';
|
||||
|
||||
@ -45,8 +65,7 @@ if (empty($dolibarr_nocache)) {
|
||||
header('Cache-Control: max-age=10800, public, must-revalidate');
|
||||
// For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
header('Cache-Control: no-cache');
|
||||
}
|
||||
|
||||
@ -55,7 +74,9 @@ $manifest = new stdClass();
|
||||
|
||||
|
||||
$manifest->name = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $manifest->name = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
$manifest->name = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
}
|
||||
|
||||
|
||||
$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR:'#F05F40';
|
||||
@ -64,21 +85,23 @@ $manifest->display = "standalone";
|
||||
$manifest->splash_pages = null;
|
||||
$manifest->icons = array();
|
||||
|
||||
if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)){
|
||||
if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) {
|
||||
$icon = new stdClass();
|
||||
$icon->src = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL;
|
||||
if ($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE) { $icon->sizes = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE."x".$conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE; }
|
||||
else { $icon->sizes = "512x512"; }
|
||||
if ($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE) {
|
||||
$icon->sizes = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE."x".$conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE;
|
||||
} else {
|
||||
$icon->sizes = "512x512";
|
||||
}
|
||||
$icon->type = "image/png";
|
||||
$manifest->icons[] = $icon;
|
||||
}
|
||||
elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)){
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)){
|
||||
} elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) {
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)) {
|
||||
$iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI;
|
||||
$iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath;
|
||||
if (is_readable($iconPath)) {
|
||||
$imgSize = getimagesize($iconPath);
|
||||
if ($imgSize){
|
||||
if ($imgSize) {
|
||||
$icon = new stdClass();
|
||||
$icon->src = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
|
||||
$icon->sizes = $imgSize[0]."x".$imgSize[1];
|
||||
@ -88,12 +111,12 @@ elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)){
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)){
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)) {
|
||||
$iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL;
|
||||
$iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath;
|
||||
if (is_readable($iconPath)) {
|
||||
$imgSize = getimagesize($iconPath);
|
||||
if ($imgSize){
|
||||
if ($imgSize) {
|
||||
$icon = new stdClass();
|
||||
$icon->src = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
|
||||
$icon->sizes = $imgSize[0]."x".$imgSize[1];
|
||||
@ -103,12 +126,12 @@ elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)){
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)){
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) {
|
||||
$iconRelativePath = 'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED;
|
||||
$iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath;
|
||||
if (is_readable($iconPath)) {
|
||||
$imgSize = getimagesize($iconPath);
|
||||
if ($imgSize){
|
||||
if ($imgSize) {
|
||||
$icon = new stdClass();
|
||||
$icon->src = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
|
||||
$icon->sizes = $imgSize[0]."x".$imgSize[1];
|
||||
@ -120,7 +143,7 @@ elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)){
|
||||
}
|
||||
|
||||
// Add Dolibarr std icon
|
||||
if (empty($manifest->icons)){
|
||||
if (empty($manifest->icons)) {
|
||||
$icon = new stdClass();
|
||||
$icon->src = DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png';
|
||||
$icon->sizes = "256x256";
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
/*
|
||||
progress style is based on boostrap and admin lte framework
|
||||
@ -12,183 +14,183 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
*/
|
||||
|
||||
.progress * {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
background-color: #f5f5f5;
|
||||
background-color: rgba(128, 128, 128, 0.1);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
background-color: #f5f5f5;
|
||||
background-color: rgba(128, 128, 128, 0.1);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.progress.spaced{
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
float: left;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: #337ab7;
|
||||
-webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
|
||||
box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
|
||||
-webkit-transition: width .6s ease;
|
||||
-o-transition: width .6s ease;
|
||||
transition: width .6s ease;
|
||||
float: left;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: #337ab7;
|
||||
-webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
|
||||
box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
|
||||
-webkit-transition: width .6s ease;
|
||||
-o-transition: width .6s ease;
|
||||
transition: width .6s ease;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.progress-group > .progress{
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.progress,
|
||||
.progress > .progress-bar {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.progress,
|
||||
.progress > .progress-bar,
|
||||
.progress .progress-bar,
|
||||
.progress > .progress-bar .progress-bar {
|
||||
border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
/* size variation */
|
||||
.progress.sm,
|
||||
.progress-sm {
|
||||
height: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
.progress.sm,
|
||||
.progress-sm,
|
||||
.progress.sm .progress-bar,
|
||||
.progress-sm .progress-bar {
|
||||
border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.progress.xs,
|
||||
.progress-xs {
|
||||
height: 7px;
|
||||
height: 7px;
|
||||
}
|
||||
.progress.xs,
|
||||
.progress-xs,
|
||||
.progress.xs .progress-bar,
|
||||
.progress-xs .progress-bar {
|
||||
border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.progress.xxs,
|
||||
.progress-xxs {
|
||||
height: 3px;
|
||||
height: 3px;
|
||||
}
|
||||
.progress.xxs,
|
||||
.progress-xxs,
|
||||
.progress.xxs .progress-bar,
|
||||
.progress-xxs .progress-bar {
|
||||
border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
|
||||
/* Vertical bars */
|
||||
.progress.vertical {
|
||||
position: relative;
|
||||
width: 30px;
|
||||
height: 200px;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
position: relative;
|
||||
width: 30px;
|
||||
height: 200px;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.progress.vertical > .progress-bar {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
.progress.vertical.sm,
|
||||
.progress.vertical.progress-sm {
|
||||
width: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
.progress.vertical.xs,
|
||||
.progress.vertical.progress-xs {
|
||||
width: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.progress.vertical.xxs,
|
||||
.progress.vertical.progress-xxs {
|
||||
width: 3px;
|
||||
width: 3px;
|
||||
}
|
||||
.progress-group .progress-text {
|
||||
/* font-weight: 600; */
|
||||
/* font-weight: 600; */
|
||||
}
|
||||
.progress-group .progress-number {
|
||||
float: right;
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Remove margins from progress bars when put in a table */
|
||||
.table tr > td .progress {
|
||||
margin: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.progress-bar-light-blue,
|
||||
.progress-bar-primary {
|
||||
background-color: #3c8dbc;
|
||||
background-color: #3c8dbc;
|
||||
}
|
||||
.progress-striped .progress-bar-light-blue,
|
||||
.progress-striped .progress-bar-primary {
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
}
|
||||
.progress-bar-green, .progress-bar-success {
|
||||
background-color: <?php echo $badgeSuccess ?>;
|
||||
background-color: <?php echo $badgeSuccess ?>;
|
||||
}
|
||||
.progress-striped .progress-bar-green, .progress-striped .progress-bar-success {
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
}
|
||||
body[class*="colorblind-"] .progress-bar-green, body[class*="colorblind-"] .progress-bar-success {
|
||||
background-color: <?php echo $colorblind_deuteranopes_badgeSuccess ?>;
|
||||
background-color: <?php echo $colorblind_deuteranopes_badgeSuccess ?>;
|
||||
}
|
||||
body[class*="colorblind-"] .progress-bar-red, body[class*="colorblind-"] .progress-bar-danger {
|
||||
background-color: <?php echo $colorblind_deuteranopes_badgeDanger ?>;
|
||||
background-color: <?php echo $colorblind_deuteranopes_badgeDanger ?>;
|
||||
}
|
||||
|
||||
.progress-bar-aqua,
|
||||
.progress-bar-info {
|
||||
background-color: #00c0ef;
|
||||
background-color: #00c0ef;
|
||||
}
|
||||
.progress-striped .progress-bar-aqua,
|
||||
.progress-striped .progress-bar-info {
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
}
|
||||
.progress-bar-yellow,
|
||||
.progress-bar-warning {
|
||||
background-color: <?php echo $badgeWarning ?>;
|
||||
background-color: <?php echo $badgeWarning ?>;
|
||||
}
|
||||
.progress-striped .progress-bar-yellow,
|
||||
.progress-striped .progress-bar-warning {
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
}
|
||||
.progress-bar-red,
|
||||
.progress-bar-danger {
|
||||
background-color: <?php echo $badgeDanger ?>;
|
||||
background-color: <?php echo $badgeDanger ?>;
|
||||
}
|
||||
.progress-striped .progress-bar-red,
|
||||
.progress-striped .progress-bar-danger {
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
||||
}
|
||||
.progress-bar-consumed {
|
||||
background-color: rgb(0, 0, 0, 0.15);
|
||||
|
||||
@ -27,21 +27,35 @@
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
}
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
|
||||
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
|
||||
if (!defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login.
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define('NOCSRFCHECK', 1);
|
||||
}
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
define('NOTOKENRENEWAL', 1);
|
||||
}
|
||||
if (!defined('NOLOGIN')) {
|
||||
define('NOLOGIN', 1); // File must be accessed by logon page so without login.
|
||||
}
|
||||
//if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We load menu manager class (note that object loaded may have wrong content because NOLOGIN is set and some values depends on login)
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', 1);
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
|
||||
|
||||
define('ISLOADEDBYSTEELSHEET', '1');
|
||||
|
||||
|
||||
require __DIR__.'/theme_vars.inc.php';
|
||||
if (defined('THEME_ONLY_CONSTANT')) return;
|
||||
if (defined('THEME_ONLY_CONSTANT')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
session_cache_limiter('public');
|
||||
@ -51,8 +65,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined)
|
||||
// and permission, so we can later calculate number of top menu ($nbtopmenuentries) according to user profile.
|
||||
if (empty($user->id) && !empty($_SESSION['dol_login']))
|
||||
{
|
||||
if (empty($user->id) && !empty($_SESSION['dol_login'])) {
|
||||
$user->fetch('', $_SESSION['dol_login'], '', 1);
|
||||
$user->getrights();
|
||||
|
||||
@ -65,12 +78,21 @@ if (empty($user->id) && !empty($_SESSION['dol_login']))
|
||||
// Define css type
|
||||
top_httphead('text/css');
|
||||
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
|
||||
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
|
||||
else header('Cache-Control: no-cache');
|
||||
if (empty($dolibarr_nocache)) {
|
||||
header('Cache-Control: max-age=10800, public, must-revalidate');
|
||||
} else {
|
||||
header('Cache-Control: no-cache');
|
||||
}
|
||||
|
||||
if (GETPOST('theme', 'alpha')) $conf->theme = GETPOST('theme', 'alpha'); // If theme was forced on URL
|
||||
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
|
||||
if (GETPOST('THEME_DARKMODEENABLED', 'int')) $conf->global->THEME_DARKMODEENABLED = GETPOST('THEME_DARKMODEENABLED', 'int'); // If darkmode was forced on URL
|
||||
if (GETPOST('theme', 'alpha')) {
|
||||
$conf->theme = GETPOST('theme', 'alpha'); // If theme was forced on URL
|
||||
}
|
||||
if (GETPOST('lang', 'aZ09')) {
|
||||
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
|
||||
}
|
||||
if (GETPOST('THEME_DARKMODEENABLED', 'int')) {
|
||||
$conf->global->THEME_DARKMODEENABLED = GETPOST('THEME_DARKMODEENABLED', 'int'); // If darkmode was forced on URL
|
||||
}
|
||||
|
||||
$langs->load("main", 0, 1);
|
||||
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
||||
@ -78,7 +100,9 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
||||
|
||||
$path = ''; // This value may be used in future for external module to overwrite theme
|
||||
$theme = 'eldy'; // Value of theme
|
||||
if (!empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path = '/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme = $conf->global->MAIN_OVERWRITE_THEME_RES; }
|
||||
if (!empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
|
||||
$path = '/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme = $conf->global->MAIN_OVERWRITE_THEME_RES;
|
||||
}
|
||||
|
||||
// Define image path files and other constants
|
||||
$fontlist = 'arial,tahoma,verdana,helvetica'; //$fontlist='helvetica, verdana, arial, sans-serif';
|
||||
@ -98,19 +122,36 @@ $useboldtitle = (isset($conf->global->THEME_ELDY_USEBOLDTITLE) ? $conf->global->
|
||||
$borderwidth = 1;
|
||||
|
||||
// Case of option always editable
|
||||
if (!isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY = $colorbackbody;
|
||||
if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
|
||||
if (!isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1;
|
||||
if (!isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1;
|
||||
if (!isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover;
|
||||
if (!isset($conf->global->THEME_ELDY_USE_CHECKED)) $conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked;
|
||||
if (!isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak;
|
||||
if (!isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab;
|
||||
if (!isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK = $colortextlink;
|
||||
if (!isset($conf->global->THEME_ELDY_BACKBODY)) {
|
||||
$conf->global->THEME_ELDY_BACKBODY = $colorbackbody;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
|
||||
$conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_VERMENU_BACK1)) {
|
||||
$conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_BACKTITLE1)) {
|
||||
$conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_USE_HOVER)) {
|
||||
$conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_USE_CHECKED)) {
|
||||
$conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_LINEBREAK)) {
|
||||
$conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) {
|
||||
$conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab;
|
||||
}
|
||||
if (!isset($conf->global->THEME_ELDY_TEXTLINK)) {
|
||||
$conf->global->THEME_ELDY_TEXTLINK = $colortextlink;
|
||||
}
|
||||
|
||||
// Case of option editable only if option THEME_ELDY_ENABLE_PERSONALIZED is on
|
||||
if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
|
||||
{
|
||||
if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) {
|
||||
$conf->global->THEME_ELDY_BACKTABCARD1 = '255,255,255'; // card
|
||||
$conf->global->THEME_ELDY_BACKTABACTIVE = '234,234,234';
|
||||
$conf->global->THEME_ELDY_TEXT = '0,0,0';
|
||||
@ -142,8 +183,7 @@ $fontsizesmaller = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (emp
|
||||
// Hover color
|
||||
$colorbacklinepairhover = ((!isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '255,255,255') ? '' : ($conf->global->THEME_ELDY_USE_HOVER === '1' ? 'e6edf0' : $conf->global->THEME_ELDY_USE_HOVER));
|
||||
$colorbacklinepairchecked = ((!isset($conf->global->THEME_ELDY_USE_CHECKED) || (string) $conf->global->THEME_ELDY_USE_CHECKED === '255,255,255') ? '' : ($conf->global->THEME_ELDY_USE_CHECKED === '1' ? 'e6edf0' : $conf->global->THEME_ELDY_USE_CHECKED));
|
||||
if (!empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED))
|
||||
{
|
||||
if (!empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) {
|
||||
$colorbacklinepairhover = ((!isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0') ? '' : ($user->conf->THEME_ELDY_USE_HOVER === '1' ? 'e6edf0' : $user->conf->THEME_ELDY_USE_HOVER));
|
||||
$colorbacklinepairchecked = ((!isset($user->conf->THEME_ELDY_USE_CHECKED) || $user->conf->THEME_ELDY_USE_CHECKED === '0') ? '' : ($user->conf->THEME_ELDY_USE_CHECKED === '1' ? 'e6edf0' : $user->conf->THEME_ELDY_USE_CHECKED));
|
||||
}
|
||||
@ -153,26 +193,42 @@ if (!empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED))
|
||||
$colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
|
||||
$tmppart = explode(',', $colorbackhmenu1);
|
||||
$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) $colortextbackhmenu = 'FFFFFF';
|
||||
else $colortextbackhmenu = '000000';
|
||||
if ($tmpval <= 460) {
|
||||
$colortextbackhmenu = 'FFFFFF';
|
||||
} else {
|
||||
$colortextbackhmenu = '000000';
|
||||
}
|
||||
|
||||
$colorbackvmenu1 = join(',', colorStringToArray($colorbackvmenu1)); // Normalize value to 'x,y,z'
|
||||
$tmppart = explode(',', $colorbackvmenu1);
|
||||
$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) { $colortextbackvmenu = 'FFFFFF'; } else { $colortextbackvmenu = '000000'; }
|
||||
if ($tmpval <= 460) {
|
||||
$colortextbackvmenu = 'FFFFFF';
|
||||
} else {
|
||||
$colortextbackvmenu = '000000';
|
||||
}
|
||||
|
||||
$colorbacktitle1 = join(',', colorStringToArray($colorbacktitle1)); // Normalize value to 'x,y,z'
|
||||
$tmppart = explode(',', $colorbacktitle1);
|
||||
if ($colortexttitle == '')
|
||||
{
|
||||
if ($colortexttitle == '') {
|
||||
$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) { $colortexttitle = 'FFFFFF'; $colorshadowtitle = '888888'; } else { $colortexttitle = '000000'; $colorshadowtitle = 'FFFFFF'; }
|
||||
} else $colorshadowtitle = '888888';
|
||||
if ($tmpval <= 460) {
|
||||
$colortexttitle = 'FFFFFF'; $colorshadowtitle = '888888';
|
||||
} else {
|
||||
$colortexttitle = '000000'; $colorshadowtitle = 'FFFFFF';
|
||||
}
|
||||
} else {
|
||||
$colorshadowtitle = '888888';
|
||||
}
|
||||
|
||||
$colorbacktabcard1 = join(',', colorStringToArray($colorbacktabcard1)); // Normalize value to 'x,y,z'
|
||||
$tmppart = explode(',', $colorbacktabcard1);
|
||||
$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
|
||||
if ($tmpval <= 460) { $colortextbacktab = 'FFFFFF'; } else { $colortextbacktab = '000000'; }
|
||||
if ($tmpval <= 460) {
|
||||
$colortextbacktab = 'FFFFFF';
|
||||
} else {
|
||||
$colortextbacktab = '000000';
|
||||
}
|
||||
|
||||
|
||||
// Format color value to match expected format (may be 'FFFFFF' or '255,255,255')
|
||||
@ -185,8 +241,12 @@ $colorbacklineimpair1 = join(',', colorStringToArray($colorbacklineimpair1));
|
||||
$colorbacklineimpair2 = join(',', colorStringToArray($colorbacklineimpair2));
|
||||
$colorbacklinepair1 = join(',', colorStringToArray($colorbacklinepair1));
|
||||
$colorbacklinepair2 = join(',', colorStringToArray($colorbacklinepair2));
|
||||
if ($colorbacklinepairhover != '') $colorbacklinepairhover = join(',', colorStringToArray($colorbacklinepairhover));
|
||||
if ($colorbacklinepairchecked != '') $colorbacklinepairchecked = join(',', colorStringToArray($colorbacklinepairchecked));
|
||||
if ($colorbacklinepairhover != '') {
|
||||
$colorbacklinepairhover = join(',', colorStringToArray($colorbacklinepairhover));
|
||||
}
|
||||
if ($colorbacklinepairchecked != '') {
|
||||
$colorbacklinepairchecked = join(',', colorStringToArray($colorbacklinepairchecked));
|
||||
}
|
||||
$colorbackbody = join(',', colorStringToArray($colorbackbody));
|
||||
$colortexttitlenotab = join(',', colorStringToArray($colortexttitlenotab));
|
||||
$colortexttitle = join(',', colorStringToArray($colortexttitle));
|
||||
@ -195,7 +255,9 @@ $colortextlink = join(',', colorStringToArray($colortextlink));
|
||||
|
||||
$nbtopmenuentries = $menumanager->showmenu('topnb');
|
||||
|
||||
if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 10);
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
$nbtopmenuentries = max($nbtopmenuentries, 10);
|
||||
}
|
||||
|
||||
|
||||
$minwidthtmenu = 66; /* minimum width for one top menu entry */
|
||||
@ -203,11 +265,19 @@ $heightmenu = 50; /* height of top menu, part with image */
|
||||
$heightmenu2 = 49; /* height of top menu, part with login */
|
||||
$disableimages = 0;
|
||||
$maxwidthloginblock = 180;
|
||||
if (!empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = $maxwidthloginblock + 50; $minwidthtmenu = 0; }
|
||||
if (!empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) {
|
||||
$disableimages = 1; $maxwidthloginblock = $maxwidthloginblock + 50; $minwidthtmenu = 0;
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; }
|
||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; }
|
||||
if (!empty($conf->bookmark->enabled)) { $maxwidthloginblock = $maxwidthloginblock + 55; }
|
||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) {
|
||||
$maxwidthloginblock = $maxwidthloginblock + 55;
|
||||
}
|
||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) {
|
||||
$maxwidthloginblock = $maxwidthloginblock + 55;
|
||||
}
|
||||
if (!empty($conf->bookmark->enabled)) {
|
||||
$maxwidthloginblock = $maxwidthloginblock + 55;
|
||||
}
|
||||
|
||||
|
||||
print '/*'."\n";
|
||||
@ -247,4 +317,6 @@ print '*/'."\n";
|
||||
require __DIR__.'/global.inc.php';
|
||||
|
||||
|
||||
if (is_object($db)) $db->close();
|
||||
if (is_object($db)) {
|
||||
$db->close();
|
||||
}
|
||||
|
||||
@ -33,12 +33,9 @@
|
||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
|
||||
$theme_bordercolor = array(235, 235, 224);
|
||||
$theme_datacolor = array(array(137, 86, 161), array(60, 147, 183), array(250, 190, 80), array(80, 166, 90), array(190, 190, 100), array(91, 115, 247), array(140, 140, 220), array(190, 120, 120), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150));
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php page, not by the style sheet, if the constant is not defined.
|
||||
{
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by dolgraph.class.php
|
||||
{
|
||||
if ($conf->global->MAIN_OPTIMIZEFORCOLORBLIND == 'flashy')
|
||||
{
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) { // File is run after an include of a php page, not by the style sheet, if the constant is not defined.
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) { // user is loaded by dolgraph.class.php
|
||||
if ($conf->global->MAIN_OPTIMIZEFORCOLORBLIND == 'flashy') {
|
||||
$theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250, 190, 30), array(221, 75, 57), array(0, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150));
|
||||
} else {
|
||||
// for now we use the same configuration for all types of color blind
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*!
|
||||
Source :
|
||||
Source :
|
||||
* AdminLTE v2.4.8
|
||||
* Author: Almsaeed Studio
|
||||
* Website: Almsaeed Studio <https://adminlte.io>
|
||||
@ -8,7 +8,9 @@
|
||||
* Please visit http://opensource.org/licenses/MIT for more information
|
||||
*/
|
||||
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
|
||||
@ -17,68 +19,68 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
* -------------------
|
||||
*/
|
||||
.timeline {
|
||||
position: relative;
|
||||
margin: 0 0 30px 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
position: relative;
|
||||
margin: 0 0 30px 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.timeline:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 4px;
|
||||
background: #ddd;
|
||||
left: 31px;
|
||||
margin: 0;
|
||||
border-radius: 2px;
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 4px;
|
||||
background: #ddd;
|
||||
left: 31px;
|
||||
margin: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.timeline > li {
|
||||
position: relative;
|
||||
margin-right: 0;
|
||||
margin-bottom: 15px;
|
||||
position: relative;
|
||||
margin-right: 0;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.timeline > li:before,
|
||||
.timeline > li:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.timeline > li:after {
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
.timeline > li > .timeline-item {
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border:1px solid #d2d2d2;
|
||||
border-radius: 3px;
|
||||
margin-top: 0;
|
||||
background: #fff;
|
||||
color: #444;
|
||||
margin-left: 60px;
|
||||
margin-right: 0px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border:1px solid #d2d2d2;
|
||||
border-radius: 3px;
|
||||
margin-top: 0;
|
||||
background: #fff;
|
||||
color: #444;
|
||||
margin-left: 60px;
|
||||
margin-right: 0px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.timeline > li.timeline-code-ticket_msg_private > .timeline-item {
|
||||
background: #fffbe5;
|
||||
border-color: #d0cfc0;
|
||||
border-color: #d0cfc0;
|
||||
}
|
||||
|
||||
|
||||
.timeline > li > .timeline-item > .time{
|
||||
color: #6f6f6f;
|
||||
float: right;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
color: #6f6f6f;
|
||||
float: right;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
.timeline > li > .timeline-item > .timeline-header-action{
|
||||
color: #6f6f6f;
|
||||
float: right;
|
||||
padding: 7px;
|
||||
font-size: 12px;
|
||||
color: #6f6f6f;
|
||||
float: right;
|
||||
padding: 7px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
@ -87,43 +89,43 @@ a.timeline-btn:visited,
|
||||
a.timeline-btn:hover,
|
||||
a.timeline-btn:active
|
||||
{
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
padding: 1px 5px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
text-decoration: none;
|
||||
background-color: #f4f4f4;
|
||||
color: #444;
|
||||
border: 1px solid #ddd;
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
padding: 1px 5px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
text-decoration: none;
|
||||
background-color: #f4f4f4;
|
||||
color: #444;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
a.timeline-btn:hover
|
||||
{
|
||||
background-color: #e7e7e7;
|
||||
color: #333;
|
||||
border-color: #adadad;
|
||||
background-color: #e7e7e7;
|
||||
color: #333;
|
||||
border-color: #adadad;
|
||||
}
|
||||
|
||||
|
||||
.timeline > li > .timeline-item > .timeline-header {
|
||||
margin: 0;
|
||||
color: #333;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
line-height: 1.1;
|
||||
margin: 0;
|
||||
color: #333;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.timeline > li > .timeline-item > .timeline-footer {
|
||||
@ -131,74 +133,74 @@ a.timeline-btn:hover
|
||||
}
|
||||
|
||||
.timeline > li.timeline-code-ticket_msg_private > .timeline-item > .timeline-header, .timeline > li.timeline-code-ticket_msg_private > .timeline-item > .timeline-footer {
|
||||
border-color: #ecebda;
|
||||
border-color: #ecebda;
|
||||
}
|
||||
|
||||
.timeline > li > .timeline-item > .timeline-header > a {
|
||||
font-weight: 600;
|
||||
font-weight: 600;
|
||||
}
|
||||
.timeline > li > .timeline-item > .timeline-body,
|
||||
.timeline > li > .timeline-item > .timeline-footer {
|
||||
padding: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
.timeline > li > .fa,
|
||||
.timeline > li > .glyphicon,
|
||||
.timeline > li > .ion {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 15px;
|
||||
line-height: 30px;
|
||||
position: absolute;
|
||||
color: #666;
|
||||
background: #d2d6de;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
left: 18px;
|
||||
top: 5px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 15px;
|
||||
line-height: 30px;
|
||||
position: absolute;
|
||||
color: #666;
|
||||
background: #d2d6de;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
left: 18px;
|
||||
top: 5px;
|
||||
}
|
||||
.timeline > .time-label > span {
|
||||
font-weight: 600;
|
||||
padding: 5px;
|
||||
display: inline-block;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
font-weight: 600;
|
||||
padding: 5px;
|
||||
display: inline-block;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.timeline-inverse > li > .timeline-item {
|
||||
background: #f0f0f0;
|
||||
border: 1px solid #ddd;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background: #f0f0f0;
|
||||
border: 1px solid #ddd;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.timeline-inverse > li > .timeline-item > .timeline-header {
|
||||
border-bottom-color: #ddd;
|
||||
border-bottom-color: #ddd;
|
||||
}
|
||||
|
||||
.timeline-icon-todo,
|
||||
.timeline-icon-in-progress,
|
||||
.timeline-icon-done{
|
||||
color: #fff !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.timeline-icon-not-applicble{
|
||||
color: #000;
|
||||
background-color: #f7f7f7;
|
||||
color: #000;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
|
||||
.timeline-icon-todo{
|
||||
background-color: #dd4b39 !important;
|
||||
background-color: #dd4b39 !important;
|
||||
}
|
||||
|
||||
.timeline-icon-in-progress{
|
||||
background-color: #00c0ef !important;
|
||||
background-color: #00c0ef !important;
|
||||
}
|
||||
.timeline-icon-done{
|
||||
background-color: #00a65a !important;
|
||||
background-color: #00a65a !important;
|
||||
}
|
||||
|
||||
|
||||
.timeline-badge-date{
|
||||
background-color: #0073b7 !important;
|
||||
color: #fff !important;
|
||||
background-color: #0073b7 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.timeline-documents-container{
|
||||
|
||||
@ -1,135 +1,137 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
/*
|
||||
Badge style is based on boostrap framework
|
||||
*/
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: .1em .35em;
|
||||
font-size: 80%;
|
||||
font-weight: 700 !important;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25rem;
|
||||
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: rgba(255,255,255,0);
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
padding: .1em .35em;
|
||||
font-size: 80%;
|
||||
font-weight: 700 !important;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
border-radius: .25rem;
|
||||
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: rgba(255,255,255,0);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.badge-status {
|
||||
font-size: 1em;
|
||||
padding: .19em .35em; /* more than 0.19 generate a change into heigth of lines */
|
||||
font-size: 1em;
|
||||
padding: .19em .35em; /* more than 0.19 generate a change into heigth of lines */
|
||||
}
|
||||
.tabBar .arearef .statusref .badge-status, .tabBar .arearefnobottom .statusref .badge-status {
|
||||
font-size: 1.1em;
|
||||
padding: .4em .4em;
|
||||
font-size: 1.1em;
|
||||
padding: .4em .4em;
|
||||
}
|
||||
/* Force values for small screen 767 */
|
||||
@media only screen and (max-width: 767px)
|
||||
{
|
||||
.tabBar .arearef .statusref .badge-status, .tabBar .arearefnobottom .statusref .badge-status {
|
||||
font-size: 0.95em;
|
||||
padding: .3em .2em;
|
||||
font-size: 0.95em;
|
||||
padding: .3em .2em;
|
||||
}
|
||||
}
|
||||
|
||||
.badge-pill, .tabs .badge {
|
||||
padding-right: .5em;
|
||||
padding-left: .5em;
|
||||
border-radius: 0.25rem;
|
||||
padding-right: .5em;
|
||||
padding-left: .5em;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.badge-dot {
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
padding: 0.45em;
|
||||
vertical-align: unset;
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
padding: 0.45em;
|
||||
vertical-align: unset;
|
||||
}
|
||||
|
||||
a.badge:focus, a.badge:hover {
|
||||
text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.liste_titre .badge:not(.nochangebackground) {
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
color: #fff;
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
/* PRIMARY */
|
||||
.badge-primary{
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgePrimary; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgePrimary; ?>;
|
||||
}
|
||||
a.badge-primary.focus, a.badge-primary:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgePrimary, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgePrimary, 0.5); ?>;
|
||||
}
|
||||
a.badge-primary:focus, a.badge-primary:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgePrimary, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgePrimary, 10); ?>;
|
||||
}
|
||||
|
||||
/* SECONDARY */
|
||||
.badge-secondary, .tabs .badge {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSecondary; ?>;
|
||||
}
|
||||
a.badge-secondary.focus, a.badge-secondary:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSecondary, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSecondary, 0.5); ?>;
|
||||
}
|
||||
a.badge-secondary:focus, a.badge-secondary:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSecondary, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSecondary, 10); ?>;
|
||||
}
|
||||
|
||||
/* SUCCESS */
|
||||
.badge-success {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSuccess; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeSuccess; ?>;
|
||||
}
|
||||
a.badge-success.focus, a.badge-success:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSuccess, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeSuccess, 0.5); ?>;
|
||||
}
|
||||
a.badge-success:focus, a.badge-success:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSuccess, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeSuccess, 10); ?>;
|
||||
}
|
||||
|
||||
/* DANGER */
|
||||
.badge-danger {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDanger; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDanger; ?>;
|
||||
}
|
||||
a.badge-danger.focus, a.badge-danger:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDanger, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDanger, 0.5); ?>;
|
||||
}
|
||||
a.badge-danger:focus, a.badge-danger:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDanger, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDanger, 10); ?>;
|
||||
}
|
||||
|
||||
/* WARNING */
|
||||
.badge-warning {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeWarning; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeWarning; ?>;
|
||||
}
|
||||
a.badge-warning.focus, a.badge-warning:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeWarning, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeWarning, 0.5); ?>;
|
||||
}
|
||||
a.badge-warning:focus, a.badge-warning:hover {
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeWarning, 10); ?>;
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeWarning, 10); ?>;
|
||||
}
|
||||
|
||||
/* WARNING colorblind */
|
||||
@ -145,44 +147,44 @@ body[class*="colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
|
||||
|
||||
/* INFO */
|
||||
.badge-info {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeInfo; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeInfo; ?>;
|
||||
}
|
||||
a.badge-info.focus, a.badge-info:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeInfo, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeInfo, 0.5); ?>;
|
||||
}
|
||||
a.badge-info:focus, a.badge-info:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeInfo, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeInfo, 10); ?>;
|
||||
}
|
||||
|
||||
/* LIGHT */
|
||||
.badge-light {
|
||||
color: #212529 !important;
|
||||
background-color: <?php print $badgeLight; ?>;
|
||||
color: #212529 !important;
|
||||
background-color: <?php print $badgeLight; ?>;
|
||||
}
|
||||
a.badge-light.focus, a.badge-light:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeLight, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeLight, 0.5); ?>;
|
||||
}
|
||||
a.badge-light:focus, a.badge-light:hover {
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeLight, 10); ?>;
|
||||
color: #212529 !important;
|
||||
background-color: <?php print colorDarker($badgeLight, 10); ?>;
|
||||
}
|
||||
|
||||
/* DARK */
|
||||
.badge-dark {
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDark; ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print $badgeDark; ?>;
|
||||
}
|
||||
a.badge-dark.focus, a.badge-dark:focus {
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDark, 0.5); ?>;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem <?php print colorHexToRgb($badgeDark, 0.5); ?>;
|
||||
}
|
||||
a.badge-dark:focus, a.badge-dark:hover {
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
||||
color: #fff !important;
|
||||
background-color: <?php print colorDarker($badgeDark, 10); ?>;
|
||||
}
|
||||
|
||||
|
||||
@ -231,8 +233,12 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL
|
||||
$thisBadgeBackgroundColor = "#fff";
|
||||
}
|
||||
|
||||
if (in_array((string) $statusName, array('0', '5', '9'))) $thisBadgeTextColor = '#999999';
|
||||
if (in_array((string) $statusName, array('6'))) $thisBadgeTextColor = '#777777';
|
||||
if (in_array((string) $statusName, array('0', '5', '9'))) {
|
||||
$thisBadgeTextColor = '#999999';
|
||||
}
|
||||
if (in_array((string) $statusName, array('6'))) {
|
||||
$thisBadgeTextColor = '#777777';
|
||||
}
|
||||
|
||||
print $cssPrefix.".badge-status".$statusName." {\n";
|
||||
print " color: ".$thisBadgeTextColor." !important;\n";
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
:root {
|
||||
--btncolortext:rgb(<?php print $colortextlink; ?>);
|
||||
--btncolorbg: #fbfbfb;
|
||||
--btncolorborderhover: none;
|
||||
--btncolorborder: #FFF;
|
||||
--butactiondeletebg: rgb(234,228,225);
|
||||
/* tertiary color */
|
||||
/* --butactionbg:rgb(218, 235, 225); */
|
||||
/* --butactionbg:rgb(228, 218, 235); */
|
||||
--butactionbg:rgb(118, 145, 225);
|
||||
--btncolortext:rgb(<?php print $colortextlink; ?>);
|
||||
--btncolorbg: #fbfbfb;
|
||||
--btncolorborderhover: none;
|
||||
--btncolorborder: #FFF;
|
||||
--butactiondeletebg: rgb(234,228,225);
|
||||
/* tertiary color */
|
||||
/* --butactionbg:rgb(218, 235, 225); */
|
||||
/* --butactionbg:rgb(228, 218, 235); */
|
||||
--butactionbg:rgb(118, 145, 225);
|
||||
}
|
||||
|
||||
<?php
|
||||
@ -50,7 +52,7 @@ div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tab
|
||||
margin-bottom: 1.4em !important;
|
||||
}
|
||||
div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
|
||||
margin-bottom: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
span.butAction, span.butActionDelete {
|
||||
@ -58,44 +60,44 @@ span.butAction, span.butActionDelete {
|
||||
}
|
||||
|
||||
.butAction {
|
||||
background: var(--butactionbg);
|
||||
color: #FFF !important;
|
||||
border-radius: 3px;
|
||||
/* background: rgb(230, 232, 239); */
|
||||
background: var(--butactionbg);
|
||||
color: #FFF !important;
|
||||
border-radius: 3px;
|
||||
/* background: rgb(230, 232, 239); */
|
||||
}
|
||||
.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
/* color: #fff; */
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
color: #444;
|
||||
/* border: 1px solid #aaa; */
|
||||
/* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
/* color: #fff; */
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
color: #444;
|
||||
/* border: 1px solid #aaa; */
|
||||
/* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
|
||||
|
||||
/*border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;*/
|
||||
/*border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;*/
|
||||
}
|
||||
.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal;
|
||||
|
||||
margin: 0em 0.3em 0 0.3em !important;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
margin: 0em 0.3em 0 0.3em !important;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.button {
|
||||
@ -211,61 +213,61 @@ span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
|
||||
}
|
||||
|
||||
.butAction:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
.butActionNew:hover {
|
||||
text-decoration: underline;
|
||||
box-shadow: unset !important;
|
||||
text-decoration: underline;
|
||||
box-shadow: unset !important;
|
||||
}
|
||||
|
||||
.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
|
||||
background: var(--butactiondeletebg);
|
||||
/* border: 1px solid #633; */
|
||||
color: #633;
|
||||
background: var(--butactiondeletebg);
|
||||
/* border: 1px solid #633; */
|
||||
color: #633;
|
||||
}
|
||||
|
||||
.butActionDelete:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
|
||||
.butActionRefused {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold !important;
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal !important;
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
padding-top: 0.2em;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
padding-top: 0.2em;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
}
|
||||
|
||||
.butActionTransparent {
|
||||
@ -279,41 +281,41 @@ TITLE BUTTON
|
||||
*/
|
||||
|
||||
div.pagination li:first-child a.btnTitle {
|
||||
margin-left: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.btnTitle, a.btnTitle {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
font-size: 14px
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
margin: 0 0 0 10px;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
color: rgb(<?php print $colortextlink; ?>);
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
background-color: #fbfbfb;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
font-size: 14px
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
margin: 0 0 0 10px;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
color: rgb(<?php print $colortextlink; ?>);
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
a.btnTitle.btnTitleSelected {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.btnTitle > .btnTitle-icon{
|
||||
@ -321,42 +323,42 @@ a.btnTitle.btnTitleSelected {
|
||||
}
|
||||
|
||||
.btnTitle > .btnTitle-label{
|
||||
color: #666666;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.btnTitle:hover, a.btnTitle:hover {
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
margin: 0 0 0 10px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background-color: rgb(<?php print $colortextlink; ?>);
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
box-shadow: none;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
margin: 0 0 0 10px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background-color: rgb(<?php print $colortextlink; ?>);
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
|
||||
color: #8a8a8a;
|
||||
cursor: not-allowed;
|
||||
background-color: #fbfbfb;
|
||||
background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
|
||||
color: #8a8a8a;
|
||||
cursor: not-allowed;
|
||||
background-color: #fbfbfb;
|
||||
background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
|
||||
}
|
||||
|
||||
.btnTitle:hover .btnTitle-label{
|
||||
color: #ffffff;
|
||||
color: #ffffff;
|
||||
}
|
||||
div.pagination .btnTitle:hover .btnTitle-label{
|
||||
color: rgb(<?php print $colortextlink; ?>);
|
||||
}
|
||||
|
||||
.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
|
||||
color: #8a8a8a;
|
||||
color: #8a8a8a;
|
||||
}
|
||||
|
||||
.btnTitle>.fa {
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
|
||||
@ -366,15 +368,15 @@ div.pagination .btnTitle:hover .btnTitle-label{
|
||||
font-size: 0.95em;
|
||||
}
|
||||
.btnTitle, a.btnTitle {
|
||||
display: inline-block;
|
||||
padding: 4px 4px 4px 4px;
|
||||
display: inline-block;
|
||||
padding: 4px 4px 4px 4px;
|
||||
min-width: unset;
|
||||
}
|
||||
}
|
||||
|
||||
<?php if (!empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?>
|
||||
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
|
||||
display: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
|
||||
/* <style type="text/css" > dont remove this line it's an ide hack */
|
||||
/*
|
||||
@ -7,15 +9,15 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
*/
|
||||
|
||||
.bookmark-footer a.top-menu-dropdown-link {
|
||||
white-space: normal;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
button.dropdown-item.global-search-item {
|
||||
outline: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu, .dropdown dd ul.open {
|
||||
display: block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@ -23,9 +25,9 @@ button.dropdown-item.global-search-item {
|
||||
color: #fff;
|
||||
}
|
||||
div#topmenu-bookmark-dropdown {
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
top: 0px;
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
#topmenu-login-dropdown .dropdown-toggle:after {
|
||||
@ -33,347 +35,347 @@ div#topmenu-bookmark-dropdown {
|
||||
}
|
||||
|
||||
#topmenu-bookmark-dropdown .dropdown-menu {
|
||||
width: 300px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
button.dropdown-item.global-search-item {
|
||||
outline: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu{
|
||||
display: block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-search {
|
||||
border-color: #eee;
|
||||
border-color: #eee;
|
||||
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
}
|
||||
.dropdown-bookmark {
|
||||
border-color: #eee;
|
||||
border-color: #eee;
|
||||
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
}
|
||||
.dropdown-menu {
|
||||
border-color: #eee;
|
||||
border-color: #eee;
|
||||
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
box-shadow: 0 6px 12px rgba(0,0,0,.175);
|
||||
}
|
||||
|
||||
|
||||
.dropdown-toggle{
|
||||
text-decoration: none !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.dropdown-toggle::after {
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-size: 0.7em;
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin: auto 3px;
|
||||
display: inline-block;
|
||||
content: "\f078";
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-size: 0.7em;
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin: auto 3px;
|
||||
display: inline-block;
|
||||
content: "\f078";
|
||||
|
||||
-webkit-transition: -webkit-transform .2s ease-in-out;
|
||||
-ms-transition: -ms-transform .2s ease-in-out;
|
||||
transition: transform .2s ease-in-out;
|
||||
-webkit-transition: -webkit-transform .2s ease-in-out;
|
||||
-ms-transition: -ms-transform .2s ease-in-out;
|
||||
transition: transform .2s ease-in-out;
|
||||
}
|
||||
|
||||
.open>.dropdown-toggle::after {
|
||||
transform: rotate(180deg);
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/*
|
||||
* MENU Dropdown
|
||||
*/
|
||||
.login_block.usedropdown .logout-btn{
|
||||
/* display: none; */
|
||||
/* display: none; */
|
||||
}
|
||||
|
||||
.tmenu .open.dropdown, .tmenu .open.dropdown {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.tmenu .dropdown-menu, .login_block .dropdown-menu {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
<?php echo $left; ?>: auto;
|
||||
line-height:1.3em;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
<?php echo $left; ?>: auto;
|
||||
line-height:1.3em;
|
||||
}
|
||||
.tmenu .dropdown-menu, .login_block .dropdown-menu .user-body {
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
.user-body {
|
||||
color: #333;
|
||||
color: #333;
|
||||
}
|
||||
.side-nav-vert .user-menu .dropdown-menu {
|
||||
border-top-right-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
padding: 1px 0 0 0;
|
||||
border-top-width: 0;
|
||||
width: 300px;
|
||||
border-top-right-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
padding: 1px 0 0 0;
|
||||
border-top-width: 0;
|
||||
width: 300px;
|
||||
}
|
||||
.side-nav-vert .user-menu .dropdown-menu {
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.side-nav-vert .user-menu .dropdown-menu > .user-header {
|
||||
min-height: 100px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
white-space: normal;
|
||||
min-height: 100px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
#topmenu-global-search-dropdown .dropdown-menu{
|
||||
width: 300px;
|
||||
max-width: 100%;
|
||||
width: 300px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown {
|
||||
line-height: 46px;
|
||||
line-height: 46px;
|
||||
}
|
||||
a.top-menu-dropdown-link {
|
||||
padding: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.dropdown-user-image {
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
z-index: 5;
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
border: 3px solid;
|
||||
border-color: transparent;
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
max-width: 100%;
|
||||
max-height :100%;
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
z-index: 5;
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
border: 3px solid;
|
||||
border-color: transparent;
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
max-width: 100%;
|
||||
max-height :100%;
|
||||
}
|
||||
|
||||
.dropdown-menu > .user-header{
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.dropdown-menu .dropdown-header{
|
||||
padding: 8px 10px 10px 10px;
|
||||
padding: 8px 10px 10px 10px;
|
||||
}
|
||||
|
||||
.dropdown-menu > .user-footer {
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.user-footer:after {
|
||||
clear: both;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-menu > .bookmark-footer{
|
||||
border-top: 1px solid #f0f0f0;
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-menu > .user-body, .dropdown-body{
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
border-top: 1px solid #dddddd;
|
||||
white-space: normal;
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
border-top: 1px solid #dddddd;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.dropdown-menu > .bookmark-body, .dropdown-body{
|
||||
padding: 10px 0;
|
||||
overflow-y: auto;
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 110px) ;
|
||||
padding: 10px 0;
|
||||
overflow-y: auto;
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 110px) ;
|
||||
white-space: normal;
|
||||
}
|
||||
#topmenu-bookmark-dropdown .dropdown-menu > .bookmark-body, #topmenu-bookmark-dropdown .dropdown-body{
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 200px) ;
|
||||
max-height: 60vh ; /* fallback for browsers without support for calc() */
|
||||
max-height: calc(90vh - 200px) ;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-body::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
width: 8px;
|
||||
}
|
||||
.dropdown-body::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
background: #aaa;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
background: #aaa;
|
||||
}
|
||||
.dropdown-body::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
#topmenu-login-dropdown, #topmenu-bookmark-dropdown, #topmenu-global-search-dropdown {
|
||||
padding: 0 5px 0 5px;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
#topmenu-login-dropdown a:hover{
|
||||
text-decoration: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#topmenuloginmoreinfo-btn{
|
||||
display: block;
|
||||
text-aling: right;
|
||||
color:#666;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
text-aling: right;
|
||||
color:#666;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#topmenuloginmoreinfo{
|
||||
display: none;
|
||||
clear: both;
|
||||
font-size: 0.95em;
|
||||
display: none;
|
||||
clear: both;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
.button-top-menu-dropdown {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin-bottom: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin-bottom: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.user-footer .button-top-menu-dropdown {
|
||||
color: #666666;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-width: 1px;
|
||||
background-color: #f4f4f4;
|
||||
border-color: #ddd;
|
||||
color: #666666;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-width: 1px;
|
||||
background-color: #f4f4f4;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.dropdown-menu a.top-menu-dropdown-link {
|
||||
color: rgb(<?php print $colortextlink; ?>) !important;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
display: block;
|
||||
margin: 5px 0px;
|
||||
color: rgb(<?php print $colortextlink; ?>) !important;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
display: block;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
display: block !important;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: .25rem 1.5rem .25rem 1rem;
|
||||
clear: both;
|
||||
font-weight: 400;
|
||||
color: #212529 !important;
|
||||
text-align: inherit;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
display: block !important;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: .25rem 1.5rem .25rem 1rem;
|
||||
clear: both;
|
||||
font-weight: 400;
|
||||
color: #212529 !important;
|
||||
text-align: inherit;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.dropdown-item::before {
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin-right: 5px;
|
||||
display: inline-block;
|
||||
content: "\f0da";
|
||||
color: rgba(0,0,0,0.3);
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
margin-right: 5px;
|
||||
display: inline-block;
|
||||
content: "\f0da";
|
||||
color: rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
|
||||
.dropdown-item.active, .dropdown-item:hover, .dropdown-item:focus {
|
||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||
text-decoration: none;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||
text-decoration: none;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -381,26 +383,26 @@ a.top-menu-dropdown-link {
|
||||
*/
|
||||
|
||||
.dropdown-search-input {
|
||||
width: 100%;
|
||||
padding: 10px 35px 10px 20px;
|
||||
width: 100%;
|
||||
padding: 10px 35px 10px 20px;
|
||||
|
||||
background-color: transparent;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
color: #575756;
|
||||
background-color: transparent;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
background-position: 95% center;
|
||||
border-radius: 50px;
|
||||
border: 1px solid #c4c4c2 !important;
|
||||
transition: all 250ms ease-in-out;
|
||||
backface-visibility: hidden;
|
||||
transform-style: preserve-3d;
|
||||
color: #575756;
|
||||
background-color: transparent;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
background-position: 95% center;
|
||||
border-radius: 50px;
|
||||
border: 1px solid #c4c4c2 !important;
|
||||
transition: all 250ms ease-in-out;
|
||||
backface-visibility: hidden;
|
||||
transform-style: preserve-3d;
|
||||
|
||||
}
|
||||
|
||||
@ -421,11 +423,11 @@ a.top-menu-dropdown-link {
|
||||
}
|
||||
|
||||
div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown {
|
||||
line-height: unset;
|
||||
line-height: unset;
|
||||
}
|
||||
|
||||
ul.tmenu {
|
||||
margin-right: 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -450,10 +452,10 @@ a.top-menu-dropdown-link {
|
||||
|
||||
|
||||
.dropdown-search-input::placeholder {
|
||||
color: color(#575756 a(0.8));
|
||||
letter-spacing: 1.5px;
|
||||
color: color(#575756 a(0.8));
|
||||
letter-spacing: 1.5px;
|
||||
}
|
||||
|
||||
.hidden-search-result{
|
||||
display: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
|
||||
@ -12,10 +14,16 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$prefix = '';
|
||||
if (!empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) $prefix = 'background-';
|
||||
if (!empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) {
|
||||
$prefix = 'background-';
|
||||
}
|
||||
|
||||
if (!isset($conf->global->THEME_SATURATE_RATIO)) $conf->global->THEME_SATURATE_RATIO = 0.7;
|
||||
if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = GETPOST('THEME_SATURATE_RATIO', 'int');
|
||||
if (!isset($conf->global->THEME_SATURATE_RATIO)) {
|
||||
$conf->global->THEME_SATURATE_RATIO = 0.7;
|
||||
}
|
||||
if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
||||
$conf->global->THEME_SATURATE_RATIO = GETPOST('THEME_SATURATE_RATIO', 'int');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -112,14 +120,14 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
|
||||
|
||||
|
||||
.info-box-module-external span.info-box-icon-version {
|
||||
background: #bbb;
|
||||
background: #bbb;
|
||||
}
|
||||
|
||||
a.info-box-text.info-box-text-a {
|
||||
display: table-cell;
|
||||
display: table-cell;
|
||||
}
|
||||
a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
font-size: 0.9em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
@ -134,14 +142,14 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
border: 1px solid #e9e9e9;
|
||||
}
|
||||
.info-box.info-box-sm{
|
||||
min-height: 80px;
|
||||
margin-bottom: 10px;
|
||||
min-height: 80px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.info-box-more {
|
||||
float: right;
|
||||
top: 4px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
float: right;
|
||||
top: 4px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.info-box small {
|
||||
@ -182,17 +190,17 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
font-size: 45px;
|
||||
line-height: 90px;
|
||||
background: #eee;
|
||||
<?php if (isset($conf->global->THEME_SATURATE_RATIO)) { ?>
|
||||
filter: saturate(<?php echo $conf->global->THEME_SATURATE_RATIO; ?>);
|
||||
<?php } ?>
|
||||
<?php if (isset($conf->global->THEME_SATURATE_RATIO)) { ?>
|
||||
filter: saturate(<?php echo $conf->global->THEME_SATURATE_RATIO; ?>);
|
||||
<?php } ?>
|
||||
}
|
||||
.info-box-sm .info-box-icon {
|
||||
width: 80px;
|
||||
font-size: 25px;
|
||||
line-height: 92px;
|
||||
width: 80px;
|
||||
font-size: 25px;
|
||||
line-height: 92px;
|
||||
}
|
||||
.opened-dash-board-wrap .info-box-sm .info-box-icon {
|
||||
line-height: 80px;
|
||||
line-height: 80px;
|
||||
}
|
||||
.info-box-module .info-box-icon {
|
||||
height: 98px;
|
||||
@ -201,69 +209,69 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
max-width: 100%;
|
||||
}
|
||||
.info-box-module .info-box-icon > img {
|
||||
max-width: 55%;
|
||||
max-width: 55%;
|
||||
}
|
||||
|
||||
.info-box-icon-text{
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
|
||||
font-size: 10px;
|
||||
line-height: 15px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
font-size: 10px;
|
||||
line-height: 15px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
}
|
||||
|
||||
.info-box-icon-version {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 90px;
|
||||
bottom: 0px;
|
||||
color: #ffffff;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
cursor: default;
|
||||
|
||||
font-size: 10px;
|
||||
line-height: 22px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
font-size: 10px;
|
||||
line-height: 22px;
|
||||
padding: 0px 3px;
|
||||
text-align: center;
|
||||
opacity: 1;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
}
|
||||
|
||||
.box-flex-item.info-box-module.info-box-module-disabled {
|
||||
/* opacity: 0.6; */
|
||||
/* opacity: 0.6; */
|
||||
}
|
||||
|
||||
.info-box-actions {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
<?php if (empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)) { ?>
|
||||
.info-box-icon-text{
|
||||
opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
.info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version{
|
||||
overflow: hidden;
|
||||
width: 80px;
|
||||
overflow: hidden;
|
||||
width: 80px;
|
||||
}
|
||||
.info-box:hover .info-box-icon-text{
|
||||
opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.info-box-content {
|
||||
@ -291,7 +299,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.info-box-title {
|
||||
width: calc(100% - 20px);
|
||||
width: calc(100% - 20px);
|
||||
}
|
||||
.info-box-text{
|
||||
font-size: 0.92em;
|
||||
@ -315,8 +323,12 @@ a.info-box-text{ text-decoration: none;}
|
||||
}
|
||||
<?php
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
if (!isset($conf->global->THEME_SATURATE_RATIO)) $conf->global->THEME_SATURATE_RATIO = 0.7;
|
||||
if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = GETPOST('THEME_SATURATE_RATIO', 'int');
|
||||
if (!isset($conf->global->THEME_SATURATE_RATIO)) {
|
||||
$conf->global->THEME_SATURATE_RATIO = 0.7;
|
||||
}
|
||||
if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
||||
$conf->global->THEME_SATURATE_RATIO = GETPOST('THEME_SATURATE_RATIO', 'int');
|
||||
}
|
||||
?>
|
||||
.bg-infobox-project i.fa{
|
||||
color: #605ca8 !important;
|
||||
@ -471,7 +483,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
|
||||
|
||||
.info-box-module {
|
||||
min-width: 350px;
|
||||
max-width: 350px;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
.info-box-module .info-box-content {
|
||||
@ -481,8 +493,8 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
|
||||
|
||||
@media only screen and (max-width: 1740px) {
|
||||
.info-box-module {
|
||||
min-width: 315px;
|
||||
max-width: 315px;
|
||||
min-width: 315px;
|
||||
max-width: 315px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 767px) {
|
||||
|
||||
@ -1,48 +1,50 @@
|
||||
<?php if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
<?php if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
.mainmenu::before{
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
line-height: 26px;
|
||||
/* font part */
|
||||
font-family: "Font Awesome 5 Free";
|
||||
font-weight: 900;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
line-height: 26px;
|
||||
font-size: 1.5em;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-align:center;
|
||||
text-decoration:none;
|
||||
color: #<?php echo $colortextbackhmenu; ?>;
|
||||
}
|
||||
|
||||
.fa-15x {
|
||||
font-size: 1.5em;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
div.mainmenu.ticket::before {
|
||||
content: "\f3ff";
|
||||
content: "\f3ff";
|
||||
}
|
||||
div.mainmenu.ticket {
|
||||
background-image: none !important;
|
||||
background-image: none !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
div.mainmenu.generic1::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
div.mainmenu.generic2::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
div.mainmenu.generic3::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
div.mainmenu.generic4::before {
|
||||
content: "\f249";
|
||||
content: "\f249";
|
||||
}
|
||||
|
||||
/* Define color of some picto */
|
||||
|
||||
@ -25,22 +25,46 @@
|
||||
* \brief File for The Web App
|
||||
*/
|
||||
|
||||
if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
|
||||
if (!defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
|
||||
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
|
||||
if (!defined('NOLOGIN')) define('NOLOGIN', '1');
|
||||
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOSESSION')) define('NOSESSION', '1');
|
||||
if (!defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREDB')) {
|
||||
define('NOREQUIREDB', '1');
|
||||
}
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
}
|
||||
if (!defined('NOREQUIRETRAN')) {
|
||||
define('NOREQUIRETRAN', '1');
|
||||
}
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define('NOCSRFCHECK', '1');
|
||||
}
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
define('NOTOKENRENEWAL', '1');
|
||||
}
|
||||
if (!defined('NOLOGIN')) {
|
||||
define('NOLOGIN', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
define('NOREQUIREMENU', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
if (!defined('NOSESSION')) {
|
||||
define('NOSESSION', '1');
|
||||
}
|
||||
|
||||
require_once __DIR__.'/../../main.inc.php';
|
||||
|
||||
$appli = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
$appli = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
}
|
||||
|
||||
top_httphead('text/json');
|
||||
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
|
||||
@ -48,22 +72,21 @@ if (empty($dolibarr_nocache)) {
|
||||
header('Cache-Control: max-age=10800, public, must-revalidate');
|
||||
// For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
header('Cache-Control: no-cache');
|
||||
}
|
||||
|
||||
?>
|
||||
{
|
||||
"name": "<?php echo $appli; ?>",
|
||||
"icons": [
|
||||
{
|
||||
"src": "<?php echo DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; ?>",
|
||||
"sizes": "256x256",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
"name": "<?php echo $appli; ?>",
|
||||
"icons": [
|
||||
{
|
||||
"src": "<?php echo DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; ?>",
|
||||
"sizes": "256x256",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet');
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
}
|
||||
|
||||
include dol_buildpath($path.'/theme/eldy/progress.inc.php', 0); // actually md use same style as eldy theme
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -29,12 +29,9 @@
|
||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
|
||||
$theme_bordercolor = array(235, 235, 224);
|
||||
$theme_datacolor = array(array(137, 86, 161), array(60, 147, 183), array(250, 190, 80), array(191, 75, 57), array(80, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150));
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php page, not by the style sheet, if the constant is not defined.
|
||||
{
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by dolgraph.class.php
|
||||
{
|
||||
if ($conf->global->MAIN_OPTIMIZEFORCOLORBLIND == 'flashy')
|
||||
{
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) { // File is run after an include of a php page, not by the style sheet, if the constant is not defined.
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) { // user is loaded by dolgraph.class.php
|
||||
if ($conf->global->MAIN_OPTIMIZEFORCOLORBLIND == 'flashy') {
|
||||
$theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250, 190, 30), array(221, 75, 57), array(0, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150));
|
||||
} else {
|
||||
// for now we use the same configuration for all types of color blind
|
||||
|
||||
@ -46,16 +46,21 @@ $sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = is_numeric($page) ? $page : 0;
|
||||
$page = $page == -1 ? 0 : $page;
|
||||
if (!$sortfield) $sortfield = "a.datep,a.id";
|
||||
if (!$sortorder) $sortorder = "DESC";
|
||||
if (!$sortfield) {
|
||||
$sortfield = "a.datep,a.id";
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = "DESC";
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
if (GETPOST('actioncode', 'array'))
|
||||
{
|
||||
if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
if (!count($actioncode)) $actioncode = '0';
|
||||
if (!count($actioncode)) {
|
||||
$actioncode = '0';
|
||||
}
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||
}
|
||||
@ -83,8 +88,7 @@ if (!$user->rights->ticket->read) {
|
||||
accessforbidden();
|
||||
}
|
||||
// restrict access for externals users
|
||||
if ($user->socid > 0 && ($object->fk_soc != $user->socid))
|
||||
{
|
||||
if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
|
||||
accessforbidden();
|
||||
}
|
||||
// or for unauthorized internals users
|
||||
@ -100,17 +104,17 @@ if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object-
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($reshook)) {
|
||||
// Set view style
|
||||
$_SESSION['ticket-view-type'] = "list";
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||
$actioncode = '';
|
||||
$search_agenda_label = '';
|
||||
}
|
||||
@ -126,7 +130,9 @@ $userstat = new User($db);
|
||||
$formticket = new FormTicket($db);
|
||||
|
||||
$title = $langs->trans("Ticket").' - '.$object->ref.' '.$object->name;
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");
|
||||
}
|
||||
$help_url = 'FR:DocumentationModuleTicket';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
@ -167,8 +173,7 @@ if (!empty($object->origin_email)) {
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($conf->societe->enabled))
|
||||
{
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
|
||||
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
@ -182,12 +187,10 @@ if (!empty($conf->societe->enabled))
|
||||
}
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project');
|
||||
if ($user->rights->ticket->write)
|
||||
{
|
||||
if ($user->rights->ticket->write) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
@ -225,11 +228,14 @@ print dol_get_fiche_end();
|
||||
print '<br>';
|
||||
|
||||
|
||||
if (!empty($object->id))
|
||||
{
|
||||
if (!empty($object->id)) {
|
||||
$param = '&id='.$object->id;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.$contextpage;
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.$limit;
|
||||
}
|
||||
|
||||
$morehtmlright = '';
|
||||
|
||||
|
||||
@ -60,7 +60,9 @@ $sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
|
||||
if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
if (!count($actioncode)) $actioncode = '0';
|
||||
if (!count($actioncode)) {
|
||||
$actioncode = '0';
|
||||
}
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||
}
|
||||
@ -80,12 +82,15 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST("search_all", 'alpha');
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha')) {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($action) && empty($id) && empty($ref)) $action = 'view';
|
||||
if (empty($action) && empty($id) && empty($ref)) {
|
||||
$action = 'view';
|
||||
}
|
||||
|
||||
//Select mail models is same action as add_message
|
||||
if (GETPOST('modelselected', 'alpha')) {
|
||||
@ -96,8 +101,7 @@ if (GETPOST('modelselected', 'alpha')) {
|
||||
//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
if ($id || $track_id || $ref) {
|
||||
$res = $object->fetch($id, $ref, $track_id);
|
||||
if ($res >= 0)
|
||||
{
|
||||
if ($res >= 0) {
|
||||
$id = $object->id;
|
||||
$track_id = $object->track_id;
|
||||
}
|
||||
@ -125,13 +129,14 @@ $now = dol_now();
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
if (empty($reshook)) {
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers{
|
||||
{
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers{
|
||||
$actioncode = '';
|
||||
$search_agenda_label = '';
|
||||
}
|
||||
@ -159,7 +164,9 @@ if (empty($reshook)) {
|
||||
$action = 'create';
|
||||
}
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
@ -289,7 +296,9 @@ if (empty($reshook)) {
|
||||
array_push($object->errors, $langs->trans('ErrorFieldRequired', $langs->transnoentities('Subject')));
|
||||
}
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -301,7 +310,9 @@ if (empty($reshook)) {
|
||||
$object->severity_code = GETPOST('severity_code', 'alpha');
|
||||
|
||||
$ret = $object->update($user);
|
||||
if ($ret <= 0) $error++;
|
||||
if ($ret <= 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
@ -354,11 +365,12 @@ if (empty($reshook)) {
|
||||
|
||||
if (!$error) {
|
||||
$ret = $object->assignUser($user, $usertoassign);
|
||||
if ($ret < 0) $error++;
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) // Update list of contacts
|
||||
{
|
||||
if (!$error) { // Update list of contacts
|
||||
// Si déjà un user assigné on le supprime des contacts
|
||||
if ($useroriginassign > 0) {
|
||||
$internal_contacts = $object->listeContact(-1, 'internal');
|
||||
@ -373,7 +385,9 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($usertoassign > 0) $object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0);
|
||||
if ($usertoassign > 0) {
|
||||
$object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -517,16 +531,16 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Categorisation dans projet
|
||||
elseif ($action == 'classin' && $user->rights->ticket->write) {
|
||||
} elseif ($action == 'classin' && $user->rights->ticket->write) {
|
||||
// Categorisation dans projet
|
||||
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
$url = 'card.php?action=view&track_id='.$object->track_id;
|
||||
header("Location: ".$url);
|
||||
exit();
|
||||
}
|
||||
} // Categorisation dans contrat
|
||||
elseif ($action == 'setcontract' && $user->rights->ticket->write) {
|
||||
} elseif ($action == 'setcontract' && $user->rights->ticket->write) {
|
||||
// Categorisation dans contrat
|
||||
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$object->setContract(GETPOST('contractid', 'int'));
|
||||
$url = 'card.php?action=view&track_id='.$object->track_id;
|
||||
@ -557,8 +571,8 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
$action = 'view';
|
||||
} // Reopen ticket
|
||||
elseif ($action == 'confirm_set_status' && $user->rights->ticket->write && !GETPOST('cancel')) {
|
||||
} elseif ($action == 'confirm_set_status' && $user->rights->ticket->write && !GETPOST('cancel')) {
|
||||
// Reopen ticket
|
||||
if ($object->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$new_status = GETPOST('new_status', 'int');
|
||||
$old_status = $object->fk_statut;
|
||||
@ -582,11 +596,15 @@ if (empty($reshook)) {
|
||||
$object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha'));
|
||||
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
if ($ret < 0) $error++;
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user);
|
||||
if ($result < 0) { $error++; }
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
@ -634,7 +652,9 @@ if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
// Set $action to correct value for the case we used presend action to add a message
|
||||
if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage';
|
||||
if (GETPOSTISSET('actionbis') && $action == 'presend') {
|
||||
$action = 'presend_addmessage';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -645,15 +665,16 @@ if (empty($reshook)) {
|
||||
$userstat = new User($db);
|
||||
$form = new Form($db);
|
||||
$formticket = new FormTicket($db);
|
||||
if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db);
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$formproject = new FormProjets($db);
|
||||
}
|
||||
|
||||
$help_url = 'FR:DocumentationModuleTicket';
|
||||
$page_title = $actionobject->getTitle($action);
|
||||
|
||||
llxHeader('', $page_title, $help_url);
|
||||
|
||||
if ($action == 'create' || $action == 'presend')
|
||||
{
|
||||
if ($action == 'create' || $action == 'presend') {
|
||||
$formticket = new FormTicket($db);
|
||||
|
||||
print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket');
|
||||
@ -725,12 +746,9 @@ if ($action == 'create' || $action == 'presend')
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink')
|
||||
{
|
||||
if ($res > 0)
|
||||
{
|
||||
} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') {
|
||||
if ($res > 0) {
|
||||
// or for unauthorized internals users
|
||||
if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
||||
accessforbidden('', 0, 1);
|
||||
@ -774,8 +792,8 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
||||
print dol_get_fiche_head($head, 'ticket', $langs->trans("Project"), 0, ($projectstat->public ? 'projectpub' : 'project'));
|
||||
|
||||
/*
|
||||
* Projet synthese pour rappel
|
||||
*/
|
||||
* Projet synthese pour rappel
|
||||
*/
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
@ -878,19 +896,20 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->ticket->write) {
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref .= ' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
@ -1010,8 +1029,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
||||
print '</tr>';
|
||||
|
||||
// Timing (Duration sum of linked fichinter)
|
||||
if ($conf->fichinter->enabled)
|
||||
{
|
||||
if ($conf->fichinter->enabled) {
|
||||
$object->fetchObjectLinked();
|
||||
$num = count($object->linkedObjects);
|
||||
$timing = 0;
|
||||
@ -1120,8 +1138,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
||||
}
|
||||
|
||||
|
||||
if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
|
||||
print load_fiche_titre($langs->trans('Contacts'), '', 'title_companies.png');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -1245,10 +1262,11 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
||||
print '<div class="tabsAction">'."\n";
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($reshook)) {
|
||||
// Show link to add a message (if read and not closed)
|
||||
if ($object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") {
|
||||
print '<div class="inline-block divButAction"><a class="butAction reposition" href="card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init">'.$langs->trans('TicketAddMessage').'</a></div>';
|
||||
@ -1292,11 +1310,12 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
||||
$action = 'presend';
|
||||
}
|
||||
// Set $action to correct value for the case we used presend action to add a message
|
||||
if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage';
|
||||
if (GETPOSTISSET('actionbis') && $action == 'presend') {
|
||||
$action = 'presend_addmessage';
|
||||
}
|
||||
|
||||
// add a message
|
||||
if ($action == 'presend' || $action == 'presend_addmessage')
|
||||
{
|
||||
if ($action == 'presend' || $action == 'presend_addmessage') {
|
||||
$action = 'add_message'; // action to use to post the message
|
||||
$modelmail = 'ticket_send';
|
||||
|
||||
@ -1375,10 +1394,18 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
|
||||
// Show messages on card (Note: this is a duplicate of the view Events/Agenda but on the main tab)
|
||||
if (!empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
|
||||
$param = '&id='.$object->id;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
||||
if ($actioncode) $param .= '&actioncode='.urlencode($actioncode);
|
||||
if ($search_agenda_label) $param .= '&search_agenda_label='.urlencode($search_agenda_label);
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.$contextpage;
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.$limit;
|
||||
}
|
||||
if ($actioncode) {
|
||||
$param .= '&actioncode='.urlencode($actioncode);
|
||||
}
|
||||
if ($search_agenda_label) {
|
||||
$param .= '&search_agenda_label='.urlencode($search_agenda_label);
|
||||
}
|
||||
|
||||
$morehtmlright = '';
|
||||
|
||||
|
||||
@ -262,14 +262,15 @@ class ActionsTicket
|
||||
|
||||
// Load logs in cache
|
||||
$ret = $this->dao->loadCacheMsgsTicket();
|
||||
if ($ret < 0) dol_print_error($this->dao->db);
|
||||
if ($ret < 0) {
|
||||
dol_print_error($this->dao->db);
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$this->viewTicketOriginalMessage($user, $action, $object);
|
||||
|
||||
if (is_array($this->dao->cache_msgs_ticket) && count($this->dao->cache_msgs_ticket) > 0)
|
||||
{
|
||||
if (is_array($this->dao->cache_msgs_ticket) && count($this->dao->cache_msgs_ticket) > 0) {
|
||||
print '<table class="border" style="width:100%;">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -114,8 +114,7 @@ class Tickets extends DolibarrApi
|
||||
{
|
||||
try {
|
||||
return $this->getCommon(0, '', $ref);
|
||||
} catch (Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@ -410,7 +410,9 @@ class Ticket extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
$this->datec = dol_now();
|
||||
if (empty($this->track_id)) $this->track_id = generate_random_id(16);
|
||||
if (empty($this->track_id)) {
|
||||
$this->track_id = generate_random_id(16);
|
||||
}
|
||||
|
||||
// Check more parameters
|
||||
// If error, this->errors[] is filled
|
||||
@ -581,8 +583,7 @@ class Ticket extends CommonObject
|
||||
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
@ -991,7 +992,9 @@ class Ticket extends CommonObject
|
||||
if (!$error) {
|
||||
// Delete linked object
|
||||
$res = $this->deleteObjectLinked();
|
||||
if ($res < 0) $error++;
|
||||
if ($res < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Removed extrafields
|
||||
@ -1319,7 +1322,9 @@ class Ticket extends CommonObject
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
global $menumanager;
|
||||
|
||||
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||
if (!empty($conf->dol_no_mouse_hover)) {
|
||||
$notooltip = 1; // Force disable tooltips
|
||||
}
|
||||
|
||||
$result = '';
|
||||
|
||||
@ -1332,33 +1337,40 @@ class Ticket extends CommonObject
|
||||
|
||||
$url = dol_buildpath('/ticket/card.php', 1).'?id='.$this->id;
|
||||
|
||||
if ($option != 'nolink')
|
||||
{
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
|
||||
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
}
|
||||
}
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
if (empty($notooltip)) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$label = $langs->trans("ShowTicket");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
||||
} else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||
} else {
|
||||
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart .= $linkclose.'>';
|
||||
$linkend = '</a>';
|
||||
|
||||
$result .= $linkstart;
|
||||
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
if ($withpicto != 2) $result .= $this->ref;
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
if ($withpicto != 2) {
|
||||
$result .= $this->ref;
|
||||
}
|
||||
$result .= $linkend;
|
||||
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||
|
||||
@ -1437,8 +1449,7 @@ class Ticket extends CommonObject
|
||||
$this->oldcopy = dol_clone($this);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."ticket";
|
||||
if ($id_assign_user > 0)
|
||||
{
|
||||
if ($id_assign_user > 0) {
|
||||
$sql .= " SET fk_user_assign=".$id_assign_user.", fk_statut = ".Ticket::STATUS_ASSIGNED;
|
||||
} else {
|
||||
$sql .= " SET fk_user_assign=null, fk_statut = ".Ticket::STATUS_READ;
|
||||
@ -1447,8 +1458,7 @@ class Ticket extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::assignUser sql=".$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$this->fk_user_assign = $id_assign_user; // May be used by trigger
|
||||
|
||||
if (!$notrigger) {
|
||||
@ -1588,29 +1598,29 @@ class Ticket extends CommonObject
|
||||
|
||||
// TODO Read the table llx_actioncomm
|
||||
/*
|
||||
$sql = "SELECT rowid, fk_user_create, datec, message";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket_logs";
|
||||
$sql .= " WHERE fk_track_id ='" . $this->db->escape($this->track_id) . "'";
|
||||
$sql .= " ORDER BY datec DESC";
|
||||
$sql = "SELECT rowid, fk_user_create, datec, message";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket_logs";
|
||||
$sql .= " WHERE fk_track_id ='" . $this->db->escape($this->track_id) . "'";
|
||||
$sql .= " ORDER BY datec DESC";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$this->cache_logs_ticket[$i]['id'] = $obj->rowid;
|
||||
$this->cache_logs_ticket[$i]['fk_user_create'] = $obj->fk_user_create;
|
||||
$this->cache_logs_ticket[$i]['datec'] = $this->db->jdate($obj->datec);
|
||||
$this->cache_logs_ticket[$i]['message'] = $obj->message;
|
||||
$i++;
|
||||
}
|
||||
return $num;
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::loadCacheLogsTicket " . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}*/
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$this->cache_logs_ticket[$i]['id'] = $obj->rowid;
|
||||
$this->cache_logs_ticket[$i]['fk_user_create'] = $obj->fk_user_create;
|
||||
$this->cache_logs_ticket[$i]['datec'] = $this->db->jdate($obj->datec);
|
||||
$this->cache_logs_ticket[$i]['message'] = $obj->message;
|
||||
$i++;
|
||||
}
|
||||
return $num;
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::loadCacheLogsTicket " . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1669,14 +1679,12 @@ class Ticket extends CommonObject
|
||||
$actioncomm->attachedfiles = $attachedfiles;
|
||||
}
|
||||
|
||||
if (!empty($mimefilename_list) && is_array($mimefilename_list))
|
||||
{
|
||||
if (!empty($mimefilename_list) && is_array($mimefilename_list)) {
|
||||
$actioncomm->note_private = dol_concatdesc($actioncomm->note_private, "\n".$langs->transnoentities("AttachedFiles").': '.join(';', $mimefilename_list));
|
||||
}
|
||||
|
||||
$actionid = $actioncomm->create($user);
|
||||
if ($actionid <= 0)
|
||||
{
|
||||
if ($actionid <= 0) {
|
||||
$error++;
|
||||
$this->error = $actioncomm->error;
|
||||
$this->errors = $actioncomm->errors;
|
||||
@ -1760,8 +1768,7 @@ class Ticket extends CommonObject
|
||||
if (!empty($conf->ficheinter->enabled) && !empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) {
|
||||
dol_syslog("We have closed the ticket, so we close all linked interventions");
|
||||
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
|
||||
if ($this->linkedObjectsIds)
|
||||
{
|
||||
if ($this->linkedObjectsIds) {
|
||||
foreach ($this->linkedObjectsIds['fichinter'] as $fichinter_id) {
|
||||
$fichinter = new Fichinter($this->db);
|
||||
$fichinter->fetch($fichinter_id);
|
||||
@ -2148,8 +2155,7 @@ class Ticket extends CommonObject
|
||||
$sendto = $obj->firstname." ".$obj->lastname." <".$obj->email.">";
|
||||
$actiondefid = $obj->adid;
|
||||
|
||||
if (dol_strlen($sendto))
|
||||
{
|
||||
if (dol_strlen($sendto)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$application = ($conf->global->MAIN_APPLICATION_TITLE ? $conf->global->MAIN_APPLICATION_TITLE : 'Dolibarr ERP/CRM');
|
||||
|
||||
@ -2465,8 +2471,7 @@ class Ticket extends CommonObject
|
||||
foreach ($filename as $i => $val) {
|
||||
$destfile = $destdir.'/'.$filename[$i];
|
||||
// If destination file already exists, we add a suffix to avoid to overwrite
|
||||
if (is_file($destfile))
|
||||
{
|
||||
if (is_file($destfile)) {
|
||||
$pathinfo = pathinfo($filename[$i]);
|
||||
$now = dol_now();
|
||||
$destfile = $destdir.'/'.$pathinfo['filename'].' - '.dol_print_date($now, 'dayhourlog').'.'.$pathinfo['extension'];
|
||||
@ -2626,11 +2631,10 @@ class Ticket extends CommonObject
|
||||
$this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Private area
|
||||
*/
|
||||
else {
|
||||
} else {
|
||||
/*
|
||||
* Private area
|
||||
*/
|
||||
/*
|
||||
* Send emails to internal users (linked contacts)
|
||||
*/
|
||||
@ -2670,7 +2674,9 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if ($info_sendto['email'] != '') {
|
||||
if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
|
||||
if (!empty($info_sendto['email'])) {
|
||||
$sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
|
||||
}
|
||||
|
||||
//Contact type
|
||||
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
|
||||
@ -2686,7 +2692,9 @@ class Ticket extends CommonObject
|
||||
|
||||
// Add global email address recipient
|
||||
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
|
||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) {
|
||||
$sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||
}
|
||||
}
|
||||
|
||||
// altairis: dont try to send email if no recipient
|
||||
@ -2744,7 +2752,9 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
if ($info_sendto['email'] != '' && $info_sendto['email'] != $object->origin_email) {
|
||||
if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
|
||||
if (!empty($info_sendto['email'])) {
|
||||
$sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
|
||||
}
|
||||
|
||||
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
|
||||
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'<br>' : '');
|
||||
@ -2769,12 +2779,16 @@ class Ticket extends CommonObject
|
||||
if ($object->fk_soc > 0 && !in_array($object->origin_email, $sendto)) {
|
||||
$object->socid = $object->fk_soc;
|
||||
$object->fetch_thirdparty();
|
||||
if (!empty($object->thirdparty->email)) $sendto[] = $object->thirdparty->email;
|
||||
if (!empty($object->thirdparty->email)) {
|
||||
$sendto[] = $object->thirdparty->email;
|
||||
}
|
||||
}
|
||||
|
||||
// altairis: Add global email address reciepient
|
||||
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
|
||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) {
|
||||
$sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||
}
|
||||
}
|
||||
|
||||
// altairis: dont try to send email when no recipient
|
||||
@ -2787,8 +2801,7 @@ class Ticket extends CommonObject
|
||||
}
|
||||
|
||||
// Set status to "answered" if not set yet, but only if internal user
|
||||
if ($object->fk_statut < 3 && !$user->socid)
|
||||
{
|
||||
if ($object->fk_statut < 3 && !$user->socid) {
|
||||
$object->setStatut(3);
|
||||
}
|
||||
|
||||
@ -2842,8 +2855,7 @@ class Ticket extends CommonObject
|
||||
|
||||
$from = $conf->global->TICKET_NOTIFICATION_EMAIL_FROM;
|
||||
if (is_array($array_receiver) && count($array_receiver) > 0) {
|
||||
foreach ($array_receiver as $key => $receiver)
|
||||
{
|
||||
foreach ($array_receiver as $key => $receiver) {
|
||||
$deliveryreceipt = 0;
|
||||
$filepath = $filename_list;
|
||||
$filename = $mimefilename_list;
|
||||
@ -2903,19 +2915,21 @@ class Ticket extends CommonObject
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.datec as datec";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as p";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid)
|
||||
{
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".$user->id;
|
||||
$clause = " AND";
|
||||
}
|
||||
$sql .= $clause." p.entity IN (".getEntity('ticket').")";
|
||||
if ($mode == 'opened') $sql .= " AND p.fk_statut NOT IN (".Ticket::STATUS_CLOSED.", ".Ticket::STATUS_CANCELED.")";
|
||||
if ($user->socid) $sql .= " AND p.fk_soc = ".$user->socid;
|
||||
if ($mode == 'opened') {
|
||||
$sql .= " AND p.fk_statut NOT IN (".Ticket::STATUS_CLOSED.", ".Ticket::STATUS_CANCELED.")";
|
||||
}
|
||||
if ($user->socid) {
|
||||
$sql .= " AND p.fk_soc = ".$user->socid;
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$label = $labelShort = '';
|
||||
$status = '';
|
||||
if ($mode == 'opened') {
|
||||
@ -2934,14 +2948,11 @@ class Ticket extends CommonObject
|
||||
$response->img = img_object('', "ticket");
|
||||
|
||||
// This assignment in condition is not a bug. It allows walking the results.
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$response->nbtodo++;
|
||||
if ($mode == 'opened')
|
||||
{
|
||||
if ($mode == 'opened') {
|
||||
$datelimit = $this->db->jdate($obj->datefin);
|
||||
if ($datelimit < ($now - $delay_warning))
|
||||
{
|
||||
if ($datelimit < ($now - $delay_warning)) {
|
||||
//$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -2970,8 +2981,7 @@ class Ticket extends CommonObject
|
||||
$sql = "SELECT count(p.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as p";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid)
|
||||
{
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
$sql .= " WHERE sc.fk_user = ".$user->id;
|
||||
$clause = "AND";
|
||||
@ -2979,11 +2989,9 @@ class Ticket extends CommonObject
|
||||
$sql .= " ".$clause." p.entity IN (".getEntity('ticket').")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
// This assignment in condition is not a bug. It allows walking the results.
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$this->nb["ticket"] = $obj->nb;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -78,8 +78,7 @@ class Diff
|
||||
}
|
||||
|
||||
$end2 = ($compareCharacters ? strlen($sequence1) : count($sequence1));
|
||||
for ($index = $end1 + 1; $index < $end2; $index++)
|
||||
{
|
||||
for ($index = $end1 + 1; $index < $end2; $index++) {
|
||||
$diff[] = array($sequence1[$index], self::UNMODIFIED);
|
||||
}
|
||||
|
||||
@ -313,12 +312,12 @@ class Diff
|
||||
self::DELETED
|
||||
);
|
||||
$rightCell = self::getCellContent(
|
||||
$diff,
|
||||
$indentation,
|
||||
$separator,
|
||||
$index,
|
||||
self::INSERTED
|
||||
);
|
||||
$diff,
|
||||
$indentation,
|
||||
$separator,
|
||||
$index,
|
||||
self::INSERTED
|
||||
);
|
||||
break;
|
||||
|
||||
// display the inserted content on the right
|
||||
|
||||
@ -124,8 +124,7 @@ $contactstatic = new Contact($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
if ($id > 0 || !empty($track_id) || !empty($ref)) {
|
||||
if ($object->fetch($id, $ref, $track_id) > 0)
|
||||
{
|
||||
if ($object->fetch($id, $ref, $track_id) > 0) {
|
||||
if ($socid > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$head = societe_prepare_head($object->thirdparty);
|
||||
@ -161,12 +160,11 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($conf->societe->enabled))
|
||||
{
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
|
||||
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
}*/
|
||||
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
}*/
|
||||
$morehtmlref .= ' : ';
|
||||
if ($action == 'editcustomer') {
|
||||
$morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1);
|
||||
@ -176,12 +174,10 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->ticket->write)
|
||||
{
|
||||
if ($user->rights->ticket->write) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
|
||||
@ -22,14 +22,26 @@
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
}
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
|
||||
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
|
||||
if (!defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define('NOCSRFCHECK', 1);
|
||||
}
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
define('NOTOKENRENEWAL', 1);
|
||||
}
|
||||
if (!defined('NOLOGIN')) {
|
||||
define('NOLOGIN', 1); // File must be accessed by logon page so without login
|
||||
}
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', 1);
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
|
||||
session_cache_limiter('public');
|
||||
|
||||
@ -39,13 +51,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
// Define css type
|
||||
top_httphead('text/css');
|
||||
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
|
||||
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
|
||||
else header('Cache-Control: no-cache');
|
||||
if (empty($dolibarr_nocache)) {
|
||||
header('Cache-Control: max-age=3600, public, must-revalidate');
|
||||
} else {
|
||||
header('Cache-Control: no-cache');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
html {
|
||||
min-height: 100%; height: 100%;
|
||||
min-height: 100%; height: 100%;
|
||||
}
|
||||
|
||||
html {
|
||||
@ -58,49 +73,49 @@ if (!empty($conf->global->TICKET_SHOW_MODULE_LOGO)) {
|
||||
|
||||
|
||||
div.ticketform {
|
||||
font-family: arial;
|
||||
position: static;
|
||||
padding: 2em 1em;
|
||||
overflow-x: auto;
|
||||
border: 2px solid rgb(153, 153, 153);
|
||||
background-color: rgb(255, 255, 255);
|
||||
box-shadow: 2px 2px 2px rgb(245, 245, 245);
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
margin: 1.5em;
|
||||
background : #ffffff;
|
||||
font-family: arial;
|
||||
position: static;
|
||||
padding: 2em 1em;
|
||||
overflow-x: auto;
|
||||
border: 2px solid rgb(153, 153, 153);
|
||||
background-color: rgb(255, 255, 255);
|
||||
box-shadow: 2px 2px 2px rgb(245, 245, 245);
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
margin: 1.5em;
|
||||
background : #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.ticketform .index_create, .index_display {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
height: 45px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
margin: 20px;
|
||||
text-transform: uppercase;
|
||||
width: 200px;
|
||||
height: 45px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
margin: 20px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#form_create_ticket, #form_view_ticket
|
||||
{
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
padding-left:1em;
|
||||
padding-right:1em;
|
||||
padding-top:1.5em;
|
||||
padding-bottom:12px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
padding-left:1em;
|
||||
padding-right:1em;
|
||||
padding-top:1.5em;
|
||||
padding-bottom:12px;
|
||||
|
||||
border: 1px solid #C0C0C0;
|
||||
background-color: #E0E0E0;
|
||||
border: 1px solid #C0C0C0;
|
||||
background-color: #E0E0E0;
|
||||
|
||||
-moz-box-shadow: 4px 4px 4px #DDD;
|
||||
-webkit-box-shadow: 4px 4px 4px #DDD;
|
||||
box-shadow: 4px 4px 4px #DDD;
|
||||
-moz-box-shadow: 4px 4px 4px #DDD;
|
||||
-webkit-box-shadow: 4px 4px 4px #DDD;
|
||||
box-shadow: 4px 4px 4px #DDD;
|
||||
|
||||
border-radius: 8px;
|
||||
border:solid 1px rgba(168,168,168,.4);
|
||||
border-top:solid 1px f8f8f8;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 8px;
|
||||
border:solid 1px rgba(168,168,168,.4);
|
||||
border-top:solid 1px f8f8f8;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
#form_create_ticket input.text, #form_create_ticket textarea { width:450px;}
|
||||
|
||||
@ -52,12 +52,18 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (!$sortorder) $sortorder = "ASC";
|
||||
if (!$sortfield) $sortfield = "position_name";
|
||||
if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if (!$sortfield) {
|
||||
$sortfield = "position_name";
|
||||
}
|
||||
|
||||
$object = new Ticket($db);
|
||||
$result = $object->fetch($id, $ref, $track_id);
|
||||
@ -86,8 +92,7 @@ $form = new Form($db);
|
||||
$help_url = '';
|
||||
llxHeader('', $langs->trans("TicketDocumentsLinked").' - '.$langs->trans("Files"), $help_url);
|
||||
|
||||
if ($object->id)
|
||||
{
|
||||
if ($object->id) {
|
||||
/*
|
||||
* Show tabs
|
||||
*/
|
||||
@ -126,12 +131,11 @@ if ($object->id)
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($conf->societe->enabled))
|
||||
{
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
|
||||
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
}*/
|
||||
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
}*/
|
||||
$morehtmlref .= ' : ';
|
||||
if ($action == 'editcustomer') {
|
||||
$morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1);
|
||||
@ -141,12 +145,10 @@ if ($object->id)
|
||||
}
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->ticket->write)
|
||||
{
|
||||
if ($user->rights->ticket->write) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
@ -190,11 +192,11 @@ if ($object->id)
|
||||
|
||||
//$object->ref = $object->track_id; // For compatibility we use track ID for directory
|
||||
$modulepart = 'ticket';
|
||||
$permission = $user->rights->ticket->write;
|
||||
$permtoedit = $user->rights->ticket->write;
|
||||
$param = '&id='.$object->id;
|
||||
$permission = $user->rights->ticket->write;
|
||||
$permtoedit = $user->rights->ticket->write;
|
||||
$param = '&id='.$object->id;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -72,7 +72,9 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -81,32 +83,44 @@ $pagenext = $page + 1;
|
||||
$object = new Ticket($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->ticket->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket'));
|
||||
elseif ($projectid > 0) $hookmanager->initHooks(array('projectticket'));
|
||||
else $hookmanager->initHooks(array('ticketlist'));
|
||||
if ($socid > 0) {
|
||||
$hookmanager->initHooks(array('thirdpartyticket'));
|
||||
} elseif ($projectid > 0) {
|
||||
$hookmanager->initHooks(array('projectticket'));
|
||||
} else {
|
||||
$hookmanager->initHooks(array('ticketlist'));
|
||||
}
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (!$sortfield) $sortfield = "t.datec";
|
||||
if (!$sortorder) $sortorder = "DESC";
|
||||
if (!$sortfield) {
|
||||
$sortfield = "t.datec";
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = "DESC";
|
||||
}
|
||||
|
||||
if (GETPOST('search_fk_status', 'alpha') == 'non_closed') $_GET['search_fk_statut'][] = 'openall'; // For backward compatibility
|
||||
if (GETPOST('search_fk_status', 'alpha') == 'non_closed') {
|
||||
$_GET['search_fk_statut'][] = 'openall'; // For backward compatibility
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = trim(GETPOSTISSET("search_all") ?GETPOSTISSET("search_all", 'alpha') : GETPOST('sall'));
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha')) {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
}
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label'];
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if ($val['searchall']) {
|
||||
$fieldstosearchall['t.'.$key] = $val['label'];
|
||||
}
|
||||
}
|
||||
$fieldstosearchall['s.name_alias'] = "AliasNameShort";
|
||||
$fieldstosearchall['s.zip'] = "Zip";
|
||||
@ -114,10 +128,11 @@ $fieldstosearchall['s.town'] = "Town";
|
||||
|
||||
// Definition of fields for list
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||
if (!empty($val['visible'])) {
|
||||
$arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
@ -136,8 +151,7 @@ if (!$user->rights->ticket->read) {
|
||||
// Store current page url
|
||||
$url_page_current = dol_buildpath('/ticket/list.php', 1);
|
||||
|
||||
if ($project_ref)
|
||||
{
|
||||
if ($project_ref) {
|
||||
$tmpproject = new Project($db);
|
||||
$tmpproject->fetch(0, $project_ref);
|
||||
$projectid = $tmpproject->id;
|
||||
@ -155,25 +169,32 @@ $error = 0;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list'; $massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
if ($socid > 0) $parameters['socid'] = $socid;
|
||||
if ($projectid > 0) $parameters['projectid'] = $projectid;
|
||||
if ($socid > 0) {
|
||||
$parameters['socid'] = $socid;
|
||||
}
|
||||
if ($projectid > 0) {
|
||||
$parameters['projectid'] = $projectid;
|
||||
}
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($reshook)) {
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$search[$key] = '';
|
||||
}
|
||||
$toselect = '';
|
||||
@ -186,8 +207,7 @@ if (empty($reshook))
|
||||
$search_dateclose_end = '';
|
||||
}
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
|
||||
{
|
||||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
|
||||
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
||||
}
|
||||
|
||||
@ -198,26 +218,23 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
// Close records
|
||||
if (!$error && $massaction == 'close' && $permissiontoadd)
|
||||
{
|
||||
if (!$error && $massaction == 'close' && $permissiontoadd) {
|
||||
$objecttmp = new $objectclass($db);
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid)
|
||||
{
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
$result = $objecttmp->close($user);
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
} else $nbok++;
|
||||
} else {
|
||||
$nbok++;
|
||||
}
|
||||
} else {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
@ -225,10 +242,12 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
if (!$error) {
|
||||
if ($nbok > 1) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
}
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
@ -238,27 +257,24 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Reopen records
|
||||
if (!$error && $massaction == 'reopen' && $permissiontoadd)
|
||||
{
|
||||
if (!$error && $massaction == 'reopen' && $permissiontoadd) {
|
||||
$objecttmp = new $objectclass($db);
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid)
|
||||
{
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) {
|
||||
$result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED);
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
} else $nbok++;
|
||||
} else {
|
||||
$nbok++;
|
||||
}
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorObjectMustHaveStatusClosedToBeReOpened", $objecttmp->ref), null, 'errors');
|
||||
@ -272,10 +288,12 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
if (!$error) {
|
||||
if ($nbok > 1) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||
}
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
@ -307,34 +325,37 @@ $title = $langs->trans('TicketList');
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = 'SELECT ';
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$sql .= 't.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']))
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/, $/', '', $sql);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)";
|
||||
$sql .= " WHERE t.entity IN (".getEntity($object->element).")";
|
||||
if ($socid > 0)
|
||||
{
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND t.fk_soc = ".$socid;
|
||||
}
|
||||
|
||||
foreach ($search as $key => $val)
|
||||
{
|
||||
if ($key == 'fk_statut' && !empty($search['fk_statut']))
|
||||
{
|
||||
foreach ($search as $key => $val) {
|
||||
if ($key == 'fk_statut' && !empty($search['fk_statut'])) {
|
||||
$newarrayofstatus = array();
|
||||
foreach ($search['fk_statut'] as $key2 => $val2) {
|
||||
if (in_array($val2, array('openall', 'closeall'))) continue;
|
||||
if (in_array($val2, array('openall', 'closeall'))) {
|
||||
continue;
|
||||
}
|
||||
$newarrayofstatus[] = $val2;
|
||||
}
|
||||
if ($search['fk_statut'] == 'openall' || in_array('openall', $search['fk_statut'])) {
|
||||
@ -349,31 +370,54 @@ foreach ($search as $key => $val)
|
||||
$newarrayofstatus[] = Ticket::STATUS_CLOSED;
|
||||
$newarrayofstatus[] = Ticket::STATUS_CANCELED;
|
||||
}
|
||||
if (count($newarrayofstatus)) $sql .= natural_search($key, join(',', $newarrayofstatus), 2);
|
||||
if (count($newarrayofstatus)) {
|
||||
$sql .= natural_search($key, join(',', $newarrayofstatus), 2);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project')
|
||||
{
|
||||
if ($search[$key] > 0) $sql .= natural_search($key, $search[$key], 2);
|
||||
if ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project') {
|
||||
if ($search[$key] > 0) {
|
||||
$sql .= natural_search($key, $search[$key], 2);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||
if ($search[$key] != '') $sql .= natural_search($key, $search[$key], $mode_search);
|
||||
if ($search[$key] != '') {
|
||||
$sql .= natural_search($key, $search[$key], $mode_search);
|
||||
}
|
||||
}
|
||||
if ($search_all) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
}
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||
//if ($search_fk_project) $sql .= natural_search('fk_project', $search_fk_project, 2);
|
||||
if ($search_date_start) $sql .= " AND t.datec >= '".$db->idate($search_date_start)."'";
|
||||
if ($search_date_end) $sql .= " AND t.datec <= '".$db->idate($search_date_end)."'";
|
||||
if ($search_dateread_start) $sql .= " AND t.date_read >= '".$db->idate($search_dateread_start)."'";
|
||||
if ($search_dateread_end) $sql .= " AND t.date_read <= '".$db->idate($search_dateread_end)."'";
|
||||
if ($search_dateclose_start) $sql .= " AND t.date_close >= '".$db->idate($search_dateclose_start)."'";
|
||||
if ($search_dateclose_end) $sql .= " AND t.date_close <= '".$db->idate($search_dateclose_end)."'";
|
||||
if ($search_date_start) {
|
||||
$sql .= " AND t.datec >= '".$db->idate($search_date_start)."'";
|
||||
}
|
||||
if ($search_date_end) {
|
||||
$sql .= " AND t.datec <= '".$db->idate($search_date_end)."'";
|
||||
}
|
||||
if ($search_dateread_start) {
|
||||
$sql .= " AND t.date_read >= '".$db->idate($search_dateread_start)."'";
|
||||
}
|
||||
if ($search_dateread_end) {
|
||||
$sql .= " AND t.date_read <= '".$db->idate($search_dateread_end)."'";
|
||||
}
|
||||
if ($search_dateclose_start) {
|
||||
$sql .= " AND t.date_close >= '".$db->idate($search_dateclose_start)."'";
|
||||
}
|
||||
if ($search_dateclose_end) {
|
||||
$sql .= " AND t.date_close <= '".$db->idate($search_dateclose_end)."'";
|
||||
}
|
||||
|
||||
|
||||
if (!$user->socid && ($mode == "mine" || (!$user->admin && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY))) {
|
||||
$sql .= " AND (t.fk_user_assign = ".$user->id;
|
||||
if (empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) $sql .= " OR t.fk_user_create = ".$user->id;
|
||||
if (empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
|
||||
$sql .= " OR t.fk_user_create = ".$user->id;
|
||||
}
|
||||
$sql .= ")";
|
||||
}
|
||||
|
||||
@ -388,26 +432,22 @@ $sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
|
||||
{
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
}
|
||||
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
|
||||
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
{
|
||||
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
|
||||
$num = $nbtotalofrecords;
|
||||
} else {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
@ -416,8 +456,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
}
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
|
||||
{
|
||||
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".DOL_URL_ROOT.'/ticket/card.php?id='.$id);
|
||||
@ -449,30 +488,30 @@ if ($socid && !$projectid && !$project_ref && $user->rights->societe->lire) {
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Customer code
|
||||
if ($socstat->client && !empty($socstat->code_client)) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('CustomerCode').'</td><td>';
|
||||
print $socstat->code_client;
|
||||
$tmpcheck = $socstat->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
// Supplier code
|
||||
if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('SupplierCode').'</td><td>';
|
||||
print $socstat->code_fournisseur;
|
||||
$tmpcheck = $socstat->check_codefournisseur();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
// Customer code
|
||||
if ($socstat->client && !empty($socstat->code_client)) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('CustomerCode').'</td><td>';
|
||||
print $socstat->code_client;
|
||||
$tmpcheck = $socstat->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
// Supplier code
|
||||
if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('SupplierCode').'</td><td>';
|
||||
print $socstat->code_fournisseur;
|
||||
$tmpcheck = $socstat->check_codefournisseur();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
@ -506,15 +545,13 @@ if ($projectid > 0 || $project_ref) {
|
||||
// Title
|
||||
$morehtmlref .= $object->title;
|
||||
// Thirdparty
|
||||
if ($object->thirdparty->id > 0)
|
||||
{
|
||||
if ($object->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (!$user->rights->projet->all->lire)
|
||||
{
|
||||
if (!$user->rights->projet->all->lire) {
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$object->next_prev_filter = " rowid in (".(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
@ -549,39 +586,75 @@ if ($projectid > 0 || $project_ref) {
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
foreach ($search as $key => $val)
|
||||
{
|
||||
if (is_array($search[$key]) && count($search[$key])) foreach ($search[$key] as $skey) $param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
else $param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
} else {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
if ($socid) $param .= '&socid='.urlencode($socid);
|
||||
if ($projectid) $param .= '&projectid='.urlencode($projectid);
|
||||
if ($socid) {
|
||||
$param .= '&socid='.urlencode($socid);
|
||||
}
|
||||
if ($projectid) {
|
||||
$param .= '&projectid='.urlencode($projectid);
|
||||
}
|
||||
|
||||
if ($search_date_start) $param .= '&search_date_start='.urlencode($search_date_start);
|
||||
if ($search_date_end) $param .= '&search_date_end='.urlencode($search_date_end);
|
||||
if ($search_dateread_start) $param .= '&search_dateread_start='.urlencode($search_dateread_start);
|
||||
if ($search_dateread_end) $param .= '&search_dateread_end='.urlencode($search_dateread_end);
|
||||
if ($search_dateclose_start) $param .= '&search_dateclose_start='.urlencode($search_dateclose_start);
|
||||
if ($search_dateclose_end) $param .= '&search_dateclose_end='.urlencode($search_dateclose_end);
|
||||
if ($search_date_start) {
|
||||
$param .= '&search_date_start='.urlencode($search_date_start);
|
||||
}
|
||||
if ($search_date_end) {
|
||||
$param .= '&search_date_end='.urlencode($search_date_end);
|
||||
}
|
||||
if ($search_dateread_start) {
|
||||
$param .= '&search_dateread_start='.urlencode($search_dateread_start);
|
||||
}
|
||||
if ($search_dateread_end) {
|
||||
$param .= '&search_dateread_end='.urlencode($search_dateread_end);
|
||||
}
|
||||
if ($search_dateclose_start) {
|
||||
$param .= '&search_dateclose_start='.urlencode($search_dateclose_start);
|
||||
}
|
||||
if ($search_dateclose_end) {
|
||||
$param .= '&search_dateclose_end='.urlencode($search_dateclose_end);
|
||||
}
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->ticket->write) $arrayofmassactions['close'] = $langs->trans("Close");
|
||||
if ($user->rights->ticket->write) $arrayofmassactions['reopen'] = $langs->trans("ReOpen");
|
||||
if ($user->rights->ticket->delete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
|
||||
if ($user->rights->ticket->write) {
|
||||
$arrayofmassactions['close'] = $langs->trans("Close");
|
||||
}
|
||||
if ($user->rights->ticket->write) {
|
||||
$arrayofmassactions['reopen'] = $langs->trans("ReOpen");
|
||||
}
|
||||
if ($user->rights->ticket->delete) {
|
||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
@ -589,15 +662,23 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'" >';
|
||||
if ($socid) print '<input type="hidden" name="socid" value="'.$socid.'" >';
|
||||
if ($projectid) print '<input type="hidden" name="projectid" value="'.$projectid.'" >';
|
||||
if ($socid) {
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'" >';
|
||||
}
|
||||
if ($projectid) {
|
||||
print '<input type="hidden" name="projectid" value="'.$projectid.'" >';
|
||||
}
|
||||
|
||||
$url = DOL_URL_ROOT.'/ticket/card.php?action=create'.($socid ? '&socid='.$socid : '').($projectid ? '&origin=projet_project&originid='.$projectid : '');
|
||||
if (!empty($socid)) $url .= '&socid='.$socid;
|
||||
if (!empty($socid)) {
|
||||
$url .= '&socid='.$socid;
|
||||
}
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', $url, '', $user->rights->ticket->write);
|
||||
|
||||
$picto = 'ticket';
|
||||
if ($socid > 0) $picto = '';
|
||||
if ($socid > 0) {
|
||||
$picto = '';
|
||||
}
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
@ -611,9 +692,10 @@ $objecttmp = new Ticket($db);
|
||||
$trackid = 'tic'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($search_all)
|
||||
{
|
||||
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
|
||||
if ($search_all) {
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
}
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
@ -624,11 +706,13 @@ $moreforfilter.= '</div>';*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||
else $moreforfilter = $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
$moreforfilter .= $hookmanager->resPrint;
|
||||
} else {
|
||||
$moreforfilter = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
if (!empty($moreforfilter))
|
||||
{
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
print '</div>';
|
||||
@ -645,13 +729,17 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
if ($key == 'fk_statut') $cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
elseif (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
if ($key == 'fk_statut') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
if ($key == 'type_code') {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
@ -672,23 +760,26 @@ foreach ($object->fields as $key => $val)
|
||||
} elseif ($key == 'fk_statut') {
|
||||
$arrayofstatus = array();
|
||||
$arrayofstatus['openall'] = '-- '.$langs->trans('OpenAll').' --';
|
||||
foreach ($object->statuts_short as $key2 => $val2)
|
||||
{
|
||||
if ($key2 == Ticket::STATUS_CLOSED) $arrayofstatus['closeall'] = '-- '.$langs->trans('ClosedAll').' --';
|
||||
foreach ($object->statuts_short as $key2 => $val2) {
|
||||
if ($key2 == Ticket::STATUS_CLOSED) {
|
||||
$arrayofstatus['closeall'] = '-- '.$langs->trans('ClosedAll').' --';
|
||||
}
|
||||
$arrayofstatus[$key2] = $val2;
|
||||
}
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
//var_dump($arrayofstatus);var_dump($search['fk_statut']);var_dump(array_values($search[$key]));
|
||||
$selectedarray = null;
|
||||
if ($search[$key]) $selectedarray = array_values($search[$key]);
|
||||
if ($search[$key]) {
|
||||
$selectedarray = array_values($search[$key]);
|
||||
}
|
||||
print Form::multiselectarray('search_fk_statut', $arrayofstatus, $selectedarray, 0, 0, 'minwidth150', 1, 0, '', '', '');
|
||||
print '</td>';
|
||||
} elseif ($key == "fk_soc") {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
} elseif ($key == "datec" || $key == 'date_read' || $key == 'date_close'){
|
||||
} elseif ($key == "datec" || $key == 'date_read' || $key == 'date_close') {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
switch ($key){
|
||||
switch ($key) {
|
||||
case 'datec':
|
||||
print $form->selectDate($search_date_start ?: -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
break;
|
||||
@ -700,7 +791,7 @@ foreach ($object->fields as $key => $val)
|
||||
}
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
switch ($key){
|
||||
switch ($key) {
|
||||
case 'datec':
|
||||
print $form->selectDate($search_date_end ?: -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
break;
|
||||
@ -712,13 +803,15 @@ foreach ($object->fields as $key => $val)
|
||||
}
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
elseif (strpos($val['type'], 'integer:') === 0) {
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
} elseif (strpos($val['type'], 'integer:') === 0) {
|
||||
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||
} elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||
} elseif (!preg_match('/^(date|timestamp)/', $val['type'])) {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
@ -741,15 +834,18 @@ print '</tr>'."\n";
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
if ($key == 'fk_statut' || $key == 'severity_code') $cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
elseif (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
if (!empty($arrayfields['t.'.$key]['checked']))
|
||||
{
|
||||
if ($key == 'fk_statut' || $key == 'severity_code') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, '', $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
}
|
||||
}
|
||||
@ -765,11 +861,11 @@ print '</tr>'."\n";
|
||||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine = 0;
|
||||
if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0)
|
||||
{
|
||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val)
|
||||
{
|
||||
if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
||||
if (preg_match('/\$object/', $val)) {
|
||||
$needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -779,70 +875,83 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$cacheofoutputfield = array();
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) break; // Should not happen
|
||||
if (empty($obj)) {
|
||||
break; // Should not happen
|
||||
}
|
||||
|
||||
// Store properties in $object
|
||||
$object->id = $obj->rowid;
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
if (property_exists($obj, $key)) $object->$key = $obj->$key;
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (property_exists($obj, $key)) {
|
||||
$object->$key = $obj->$key;
|
||||
}
|
||||
}
|
||||
$langs->load("ticket");
|
||||
|
||||
// Show here line of result
|
||||
print '<tr class="oddeven">';
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = '';
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
if (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
if (in_array($key, array('ref', 'fk_project'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
||||
if ($key == 'fk_statut' || $key == 'severity_code') $cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
if (!empty($arrayfields['t.'.$key]['checked']))
|
||||
{
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
}
|
||||
if (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
if (in_array($key, array('ref', 'fk_project'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
||||
}
|
||||
if ($key == 'fk_statut' || $key == 'severity_code') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td';
|
||||
if ($cssforfield || $val['css']) print ' class="';
|
||||
if ($cssforfield || $val['css']) {
|
||||
print ' class="';
|
||||
}
|
||||
print $cssforfield;
|
||||
if ($cssforfield && $val['css']) print ' ';
|
||||
if ($cssforfield && $val['css']) {
|
||||
print ' ';
|
||||
}
|
||||
print $val['css'];
|
||||
if ($cssforfield || $val['css']) print '"';
|
||||
if ($cssforfield || $val['css']) {
|
||||
print '"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'fk_statut') print $object->getLibStatut(5);
|
||||
elseif ($key == 'subject') {
|
||||
if ($key == 'fk_statut') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'subject') {
|
||||
$s = $obj->subject;
|
||||
print '<span title="'.$s.'">';
|
||||
print $s;
|
||||
print '</span>';
|
||||
}
|
||||
elseif ($key == 'type_code') {
|
||||
} elseif ($key == 'type_code') {
|
||||
$s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
|
||||
print '<span title="'.$s.'">';
|
||||
print $s;
|
||||
print '</span>';
|
||||
}
|
||||
elseif ($key == 'category_code') {
|
||||
} elseif ($key == 'category_code') {
|
||||
$s = $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
|
||||
print '<span title="'.$s.'">';
|
||||
print $s;
|
||||
print '</span>';
|
||||
}
|
||||
elseif ($key == 'severity_code') {
|
||||
} elseif ($key == 'severity_code') {
|
||||
$s = $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
|
||||
print '<span title="'.$s.'">';
|
||||
print $s;
|
||||
print '</span>';
|
||||
}
|
||||
elseif ($key == 'tms') print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
|
||||
elseif ($key == 'fk_user_create') {
|
||||
} elseif ($key == 'tms') {
|
||||
print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
|
||||
} elseif ($key == 'fk_user_create') {
|
||||
if ($object->fk_user_create > 0) {
|
||||
$user_create->fetch($object->fk_user_create);
|
||||
print $user_create->getNomUrl(-1);
|
||||
}
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), '');
|
||||
else { // Example: key=fk_soc, obj->key=123 val=array('type'=>'integer', ...
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
print $object->showOutputField($val, $key, $db->jdate($obj->$key), '');
|
||||
} else { // Example: key=fk_soc, obj->key=123 val=array('type'=>'integer', ...
|
||||
$tmp = explode(':', $val['type']);
|
||||
if ($tmp[0] == 'integer' && !empty($tmp[1]) && class_exists($tmp[1])) {
|
||||
// It is a type of an foreign field. We will try to reduce the number of fetch that the showOutputField is making.
|
||||
@ -860,10 +969,13 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if (!empty($val['isameasure']))
|
||||
{
|
||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($val['isameasure'])) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
$totalarray['val']['t.'.$key] += $obj->$key;
|
||||
}
|
||||
}
|
||||
@ -876,14 +988,17 @@ while ($i < min($num, $limit))
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
|
||||
if (in_array($obj->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -895,10 +1010,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||
|
||||
|
||||
// If no record found
|
||||
if ($num == 0)
|
||||
{
|
||||
if ($num == 0) {
|
||||
$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
|
||||
@ -916,10 +1034,11 @@ print '</form>'."\n";
|
||||
|
||||
|
||||
|
||||
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords))
|
||||
{
|
||||
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
|
||||
$hidegeneratedfilelistifempty = 1;
|
||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
|
||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
|
||||
$hidegeneratedfilelistifempty = 0;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
@ -46,16 +46,21 @@ $sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = is_numeric($page) ? $page : 0;
|
||||
$page = $page == -1 ? 0 : $page;
|
||||
if (!$sortfield) $sortfield = "a.datep,a.id";
|
||||
if (!$sortorder) $sortorder = "desc";
|
||||
if (!$sortfield) {
|
||||
$sortfield = "a.datep,a.id";
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = "desc";
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
if (GETPOST('actioncode', 'array'))
|
||||
{
|
||||
if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
if (!count($actioncode)) $actioncode = '0';
|
||||
if (!count($actioncode)) {
|
||||
$actioncode = '0';
|
||||
}
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||
}
|
||||
@ -82,8 +87,7 @@ if (!$user->rights->ticket->read) {
|
||||
accessforbidden();
|
||||
}
|
||||
// restrict access for externals users
|
||||
if ($user->socid > 0 && ($object->fk_soc != $user->socid))
|
||||
{
|
||||
if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
|
||||
accessforbidden();
|
||||
}
|
||||
// or for unauthorized internals users
|
||||
@ -99,17 +103,17 @@ if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object-
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($reshook)) {
|
||||
// Set view style
|
||||
$_SESSION['ticket-view-type'] = "messaging";
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||
$actioncode = '';
|
||||
$search_agenda_label = '';
|
||||
}
|
||||
@ -125,7 +129,9 @@ $userstat = new User($db);
|
||||
$formticket = new FormTicket($db);
|
||||
|
||||
$title = $langs->trans("Ticket").' - '.$object->ref.' '.$object->name;
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");
|
||||
}
|
||||
$help_url = 'FR:DocumentationModuleTicket';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
@ -166,8 +172,7 @@ if (!empty($object->origin_email)) {
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($conf->societe->enabled))
|
||||
{
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty');
|
||||
/*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $url_page_current . '?action=editcustomer&track_id=' . $object->track_id . '">' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '</a>';
|
||||
@ -181,12 +186,10 @@ if (!empty($conf->societe->enabled))
|
||||
}
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project');
|
||||
if ($user->rights->ticket->write)
|
||||
{
|
||||
if ($user->rights->ticket->write) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
@ -224,11 +227,14 @@ print dol_get_fiche_end();
|
||||
print '<br>';
|
||||
|
||||
|
||||
if (!empty($object->id))
|
||||
{
|
||||
if (!empty($object->id)) {
|
||||
$param = '&id='.$object->id;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.$contextpage;
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.$limit;
|
||||
}
|
||||
|
||||
$morehtmlright = '';
|
||||
|
||||
|
||||
@ -30,15 +30,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||
|
||||
if (!$user->rights->ticket->read) accessforbidden();
|
||||
if (!$user->rights->ticket->read) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
// Security check
|
||||
if ($user->socid > 0)
|
||||
{
|
||||
if ($user->socid > 0) {
|
||||
$action = '';
|
||||
$socid = $user->socid;
|
||||
}
|
||||
@ -70,7 +71,9 @@ print load_fiche_titre($title, '', 'ticket');
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new TicketStats($db, $socid, ($userid > 0 ? $userid : 0));
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND fk_statut IN ('.$db->sanitize($db->escape($object_status)).')';
|
||||
if ($object_status != '' && $object_status >= -1) {
|
||||
$stats->where .= ' AND fk_statut IN ('.$db->sanitize($db->escape($object_status)).')';
|
||||
}
|
||||
|
||||
|
||||
// Build graphic number of object
|
||||
@ -80,8 +83,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
// $data = array(array('Lib',val1,val2,val3),...)
|
||||
|
||||
|
||||
if (!$user->rights->societe->client->voir || $user->socid)
|
||||
{
|
||||
if (!$user->rights->societe->client->voir || $user->socid) {
|
||||
$filenamenb = $dir.'/ticketsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
} else {
|
||||
@ -91,12 +93,10 @@ if (!$user->rights->societe->client->voir || $user->socid)
|
||||
|
||||
$px1 = new DolGraph();
|
||||
$mesg = $px1->isGraphKo();
|
||||
if (!$mesg)
|
||||
{
|
||||
if (!$mesg) {
|
||||
$px1->SetData($data);
|
||||
$i = $startyear; $legend = array();
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
while ($i <= $endyear) {
|
||||
$legend[] = $i;
|
||||
$i++;
|
||||
}
|
||||
@ -119,8 +119,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear);
|
||||
//var_dump($data);
|
||||
// $data = array(array('Lib',val1,val2,val3),...)
|
||||
|
||||
if (!$user->rights->societe->client->voir || $user->socid)
|
||||
{
|
||||
if (!$user->rights->societe->client->voir || $user->socid) {
|
||||
$filenameamount = $dir.'/ticketsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
} else {
|
||||
@ -130,12 +129,10 @@ if (!$user->rights->societe->client->voir || $user->socid)
|
||||
|
||||
$px2 = new DolGraph();
|
||||
$mesg = $px2->isGraphKo();
|
||||
if (!$mesg)
|
||||
{
|
||||
if (!$mesg) {
|
||||
$px2->SetData($data);
|
||||
$i = $startyear; $legend = array();
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
while ($i <= $endyear) {
|
||||
$legend[] = $i;
|
||||
$i++;
|
||||
}
|
||||
@ -156,8 +153,7 @@ if (!$mesg)
|
||||
|
||||
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||
|
||||
if (!$user->rights->societe->client->voir || $user->socid)
|
||||
{
|
||||
if (!$user->rights->societe->client->voir || $user->socid) {
|
||||
$filename_avg = $dir.'/ticketsaverage-'.$user->id.'-'.$year.'.png';
|
||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsaverage-'.$user->id.'-'.$year.'.png';
|
||||
} else {
|
||||
@ -167,12 +163,10 @@ if (!$user->rights->societe->client->voir || $user->socid)
|
||||
|
||||
$px3 = new DolGraph();
|
||||
$mesg = $px3->isGraphKo();
|
||||
if (!$mesg)
|
||||
{
|
||||
if (!$mesg) {
|
||||
$px3->SetData($data);
|
||||
$i = $startyear; $legend = array();
|
||||
while ($i <= $endyear)
|
||||
{
|
||||
while ($i <= $endyear) {
|
||||
$legend[] = $i;
|
||||
$i++;
|
||||
}
|
||||
@ -200,7 +194,9 @@ foreach ($data as $val) {
|
||||
$arrayyears[$val['year']] = $val['year'];
|
||||
}
|
||||
}
|
||||
if (!count($arrayyears)) $arrayyears[$nowyear] = $nowyear;
|
||||
if (!count($arrayyears)) {
|
||||
$arrayyears[$nowyear] = $nowyear;
|
||||
}
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
@ -239,8 +235,12 @@ print $form->selectarray('object_status', $liststatus, GETPOST('object_status',
|
||||
print '</td></tr>';
|
||||
// Year
|
||||
print '<tr><td class="left">'.$langs->trans("Year").'</td><td class="left">';
|
||||
if (!in_array($year, $arrayyears)) $arrayyears[$year] = $year;
|
||||
if (!in_array($nowyear, $arrayyears)) $arrayyears[$nowyear] = $nowyear;
|
||||
if (!in_array($year, $arrayyears)) {
|
||||
$arrayyears[$year] = $year;
|
||||
}
|
||||
if (!in_array($nowyear, $arrayyears)) {
|
||||
$arrayyears[$nowyear] = $nowyear;
|
||||
}
|
||||
arsort($arrayyears);
|
||||
print $form->selectarray('year', $arrayyears, $year, 0);
|
||||
print '</td></tr>';
|
||||
@ -263,11 +263,9 @@ print '<td class="right">%</td>';
|
||||
print '</tr>';
|
||||
|
||||
$oldyear = 0;
|
||||
foreach ($data as $val)
|
||||
{
|
||||
foreach ($data as $val) {
|
||||
$year = $val['year'];
|
||||
while (!empty($year) && $oldyear > $year + 1)
|
||||
{ // If we have empty year
|
||||
while (!empty($year) && $oldyear > $year + 1) { // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
@ -303,7 +301,9 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
// Show graphs
|
||||
print '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
|
||||
if ($mesg) { print $mesg; } else {
|
||||
if ($mesg) {
|
||||
print $mesg;
|
||||
} else {
|
||||
print $px1->show();
|
||||
print "<br>\n";
|
||||
//print $px2->show();
|
||||
|
||||
@ -16,8 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf))
|
||||
{
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
@ -38,52 +37,54 @@ $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'datec', 'desc', 0, 0, 1
|
||||
|
||||
$total = 0;
|
||||
$ilink = 0;
|
||||
foreach ($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
$ilink++;
|
||||
|
||||
$trclass = 'oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
|
||||
$trclass .= ' liste_sub_total';
|
||||
}
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" >
|
||||
<td class="linkedcol-element" ><?php echo $langs->trans("Ticket"); ?>
|
||||
<?php if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
|
||||
</td>
|
||||
<td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref center"><?php echo $objectlink->ref_client; ?></td>
|
||||
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->datec, 'day'); ?></td>
|
||||
<?php
|
||||
<tr class="<?php echo $trclass; ?>" >
|
||||
<td class="linkedcol-element" ><?php echo $langs->trans("Ticket"); ?>
|
||||
<?php if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
|
||||
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
|
||||
} ?>
|
||||
</td>
|
||||
<td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref center"><?php echo $objectlink->ref_client; ?></td>
|
||||
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->datec, 'day'); ?></td>
|
||||
<?php
|
||||
//$objectlink->socid = $objectlink->fk_soc;
|
||||
//$objectlink->fetch_thirdparty();
|
||||
?>
|
||||
<td class="linkedcol-amount right"><?php //echo $objectlink->thirdparty->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="linkedcol-action right">
|
||||
<?php
|
||||
<td class="linkedcol-amount right"><?php //echo $objectlink->thirdparty->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="linkedcol-action right">
|
||||
<?php
|
||||
// For now, shipments must stay linked to order, so link is not deletable
|
||||
if ($object->element != 'shipping') {
|
||||
?>
|
||||
<a class="reposition" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a>
|
||||
<?php
|
||||
<a class="reposition" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
if (count($linkedObjectBlock) > 1) {
|
||||
?>
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
print "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -38,13 +38,17 @@ $form = new Form($db);
|
||||
// List of supported format
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
foreach ($tmptype2label as $key => $val) {
|
||||
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$attrname = GETPOST('attrname', 'alpha');
|
||||
$elementtype = 'usergroup'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -79,8 +83,7 @@ print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
@ -93,8 +96,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
@ -106,8 +108,7 @@ if ($action == 'create')
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && !empty($attrname))
|
||||
{
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
|
||||
@ -37,13 +37,17 @@ $form = new Form($db);
|
||||
// List of supported format
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
foreach ($tmptype2label as $key => $val) {
|
||||
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$attrname = GETPOST('attrname', 'alpha');
|
||||
$elementtype = 'user'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -78,8 +82,7 @@ print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
@ -92,8 +95,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
@ -105,8 +107,7 @@ if ($action == 'create')
|
||||
/* Editing an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && !empty($attrname))
|
||||
{
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
|
||||
@ -41,7 +41,9 @@ $actiontest = GETPOST('test', 'alpha');
|
||||
$actionsave = GETPOST('save', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'useragenda'; // To manage different context of search
|
||||
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB = 5;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) {
|
||||
$conf->global->AGENDA_EXT_NB = 5;
|
||||
}
|
||||
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
|
||||
|
||||
// List of available colors
|
||||
@ -55,14 +57,17 @@ $object->getrights();
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
|
||||
// If user is not user that read and no permission to read other users, we stop
|
||||
if (($object->id != $user->id) && (!$user->rights->user->user->lire))
|
||||
accessforbidden();
|
||||
if (($object->id != $user->id) && (!$user->rights->user->user->lire)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('usercard', 'useragenda', 'globalcard'));
|
||||
@ -73,7 +78,9 @@ $hookmanager->initHooks(array('usercard', 'useragenda', 'globalcard'));
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($actionsave) {
|
||||
@ -168,7 +175,11 @@ print '<span class="opacitymedium">'.$langs->trans("AgendaExtSitesDesc")."</span
|
||||
print "<br>\n";
|
||||
|
||||
$selectedvalue = $conf->global->AGENDA_DISABLE_EXT;
|
||||
if ($selectedvalue == 1) $selectedvalue = 0; else $selectedvalue = 1;
|
||||
if ($selectedvalue == 1) {
|
||||
$selectedvalue = 0;
|
||||
} else {
|
||||
$selectedvalue = 1;
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
@ -183,8 +194,7 @@ print '<td class="right">'.$langs->trans("Color").'</td>';
|
||||
print "</tr>";
|
||||
|
||||
$i = 1;
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
while ($i <= $MAXAGENDA) {
|
||||
$key = $i;
|
||||
$name = 'AGENDA_EXT_NAME_'.$id.'_'.$key;
|
||||
$src = 'AGENDA_EXT_SRC_'.$id.'_'.$key;
|
||||
|
||||
@ -32,9 +32,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php';
|
||||
if (!empty($conf->holiday->enabled)) require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
if (!empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
if (!empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
|
||||
if (!empty($conf->holiday->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
}
|
||||
if (!empty($conf->expensereport->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
}
|
||||
if (!empty($conf->salaries->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array('companies', 'commercial', 'banks', 'bills', 'trips', 'holiday', 'salaries'));
|
||||
@ -47,35 +53,44 @@ $cancel = GETPOST('cancel', 'alpha');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
// Ok if user->rights->salaries->read or user->rights->hrm->read
|
||||
//$result = restrictedArea($user, 'salaries|hrm', $id, 'user&user', $feature2);
|
||||
$ok = false;
|
||||
if ($user->id == $id) $ok = true; // A user can always read its own card
|
||||
if (!empty($user->rights->salaries->read)) $ok = true;
|
||||
if (!empty($user->rights->hrm->read)) $ok = true;
|
||||
if (!empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) $ok = true;
|
||||
if (!$ok)
|
||||
{
|
||||
if ($user->id == $id) {
|
||||
$ok = true; // A user can always read its own card
|
||||
}
|
||||
if (!empty($user->rights->salaries->read)) {
|
||||
$ok = true;
|
||||
}
|
||||
if (!empty($user->rights->hrm->read)) {
|
||||
$ok = true;
|
||||
}
|
||||
if (!empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) {
|
||||
$ok = true;
|
||||
}
|
||||
if (!$ok) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$object = new User($db);
|
||||
if ($id > 0 || !empty($ref))
|
||||
{
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$result = $object->fetch($id, $ref, '', 1);
|
||||
$object->getrights();
|
||||
}
|
||||
|
||||
$account = new UserBankAccount($db);
|
||||
if (!$bankid)
|
||||
{
|
||||
if (!$bankid) {
|
||||
$account->fetch(0, '', $id);
|
||||
} else {
|
||||
$account->fetch($bankid);
|
||||
}
|
||||
if (empty($account->userid)) $account->userid = $object->id;
|
||||
if (empty($account->userid)) {
|
||||
$account->userid = $object->id;
|
||||
}
|
||||
|
||||
$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer));
|
||||
|
||||
@ -84,8 +99,7 @@ $permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty(
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'add' && !$cancel)
|
||||
{
|
||||
if ($action == 'add' && !$cancel) {
|
||||
$account->userid = $object->id;
|
||||
|
||||
$account->bank = GETPOST('bank', 'alpha');
|
||||
@ -103,8 +117,7 @@ if ($action == 'add' && !$cancel)
|
||||
|
||||
$result = $account->create($user);
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
if (!$result) {
|
||||
setEventMessages($account->error, $account->errors, 'errors');
|
||||
$action = 'edit'; // Force chargement page edition
|
||||
} else {
|
||||
@ -113,52 +126,51 @@ if ($action == 'add' && !$cancel)
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update' && !$cancel)
|
||||
{
|
||||
if ($action == 'update' && !$cancel) {
|
||||
$account->userid = $object->id;
|
||||
|
||||
/*
|
||||
if ($action == 'update' && !$cancel)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
if ($action == 'update' && !$cancel)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
if ($canedituser) // Case we can edit all field
|
||||
{
|
||||
$error = 0;
|
||||
if ($canedituser) // Case we can edit all field
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$objectuser->fetch($id);
|
||||
if (!$error)
|
||||
{
|
||||
$objectuser->fetch($id);
|
||||
|
||||
$objectuser->oldcopy = clone $objectuser;
|
||||
$objectuser->oldcopy = clone $objectuser;
|
||||
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
|
||||
$objectuser->default_range = GETPOST('default_range');
|
||||
$objectuser->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat');
|
||||
$objectuser->default_range = GETPOST('default_range');
|
||||
$objectuser->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat');
|
||||
|
||||
if (!$error) {
|
||||
$ret = $objectuser->update($user);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $objectuser->login), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($objectuser->error, $objectuser->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$error) {
|
||||
$ret = $objectuser->update($user);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $objectuser->login), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($objectuser->error, $objectuser->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !count($objectuser->errors)) {
|
||||
setEventMessages($langs->trans("UserModified"), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if (!$error && !count($objectuser->errors)) {
|
||||
setEventMessages($langs->trans("UserModified"), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
$account->bank = GETPOST('bank', 'alpha');
|
||||
$account->label = GETPOST('label', 'alpha');
|
||||
@ -188,28 +200,36 @@ if ($action == 'update' && !$cancel)
|
||||
if ($action == 'setpersonal_email') {
|
||||
$object->personal_email = (string) GETPOST('personal_email', 'alphanohtml');
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// update personal mobile
|
||||
if ($action == 'setpersonal_mobile') {
|
||||
$object->personal_mobile = (string) GETPOST('personal_mobile', 'alphanohtml');
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// update default_c_exp_tax_cat
|
||||
if ($action == 'setdefault_c_exp_tax_cat') {
|
||||
$object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat', 'int');
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// update default range
|
||||
if ($action == 'setdefault_range') {
|
||||
$object->default_range = GETPOST('default_range', 'int');
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -226,16 +246,14 @@ llxHeader(null, $langs->trans("BankAccounts"));
|
||||
|
||||
$head = user_prepare_head($object);
|
||||
|
||||
if ($id && $bankid && $action == 'edit' && $user->rights->user->user->creer)
|
||||
{
|
||||
if ($id && $bankid && $action == 'edit' && $user->rights->user->user->creer) {
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.GETPOST("id", 'int').'">';
|
||||
print '<input type="hidden" name="bankid" value="'.$bankid.'">';
|
||||
}
|
||||
if ($id && $action == 'create' && $user->rights->user->user->creer)
|
||||
{
|
||||
if ($id && $action == 'create' && $user->rights->user->user->creer) {
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
@ -244,8 +262,7 @@ if ($id && $action == 'create' && $user->rights->user->user->creer)
|
||||
|
||||
|
||||
// View
|
||||
if ($action != 'edit' && $action != 'create') // If not bank account yet, $account may be empty
|
||||
{
|
||||
if ($action != 'edit' && $action != 'create') { // If not bank account yet, $account may be empty
|
||||
$title = $langs->trans("User");
|
||||
print dol_get_fiche_head($head, 'bank', $title, -1, 'user');
|
||||
|
||||
@ -283,8 +300,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
||||
print '<tr class="nowrap">';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("DefaultCategoryCar", 'default_c_exp_tax_cat', $object->default_c_exp_tax_cat, $object, $user->rights->user->user->creer);
|
||||
@ -338,8 +354,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
// Latest payments of salaries
|
||||
if (!empty($conf->salaries->enabled) &&
|
||||
$user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id)
|
||||
)
|
||||
{
|
||||
) {
|
||||
$salary = new PaymentSalary($db);
|
||||
|
||||
$sql = "SELECT ps.rowid, ps.datesp, ps.dateep, ps.amount";
|
||||
@ -349,20 +364,18 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$sql .= " ORDER BY ps.datesp DESC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/salaries/list.php?search_user='.$object->login.'">'.$langs->trans("AllSalaries").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/salaries/list.php?search_user='.$object->login.'">'.$langs->trans("AllSalaries").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
while ($i < $num && $i < $MAXLIST) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -381,7 +394,9 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
if ($num <= 0) print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
if ($num <= 0) {
|
||||
print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
}
|
||||
print "</table>";
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
@ -393,8 +408,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
*/
|
||||
if (!empty($conf->holiday->enabled) &&
|
||||
($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))
|
||||
)
|
||||
{
|
||||
) {
|
||||
$holiday = new Holiday($db);
|
||||
|
||||
$sql = "SELECT h.rowid, h.statut as status, h.fk_type, h.date_debut, h.date_fin, h.halfday";
|
||||
@ -404,20 +418,18 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$sql .= " ORDER BY h.date_debut DESC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastHolidays", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/holiday/list.php?id='.$object->id.'">'.$langs->trans("AllHolidays").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
print '<td colspan="4"><table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastHolidays", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/holiday/list.php?id='.$object->id.'">'.$langs->trans("AllHolidays").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
while ($i < $num && $i < $MAXLIST) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$holiday->id = $objp->rowid;
|
||||
@ -436,7 +448,9 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
if ($num <= 0) print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
if ($num <= 0) {
|
||||
print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
}
|
||||
print "</table>";
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
@ -448,8 +462,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
*/
|
||||
if (!empty($conf->expensereport->enabled) &&
|
||||
($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id))
|
||||
)
|
||||
{
|
||||
) {
|
||||
$exp = new ExpenseReport($db);
|
||||
|
||||
$sql = "SELECT e.rowid, e.ref, e.fk_statut as status, e.date_debut, e.total_ttc";
|
||||
@ -459,20 +472,18 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$sql .= " ORDER BY e.date_debut DESC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastExpenseReports", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expensereport/list.php?id='.$object->id.'">'.$langs->trans("AllExpenseReports").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
print '<td colspan="4"><table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastExpenseReports", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expensereport/list.php?id='.$object->id.'">'.$langs->trans("AllExpenseReports").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
while ($i < $num && $i < $MAXLIST) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$exp->id = $objp->rowid;
|
||||
@ -490,7 +501,9 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
if ($num <= 0) print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
if ($num <= 0) {
|
||||
print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
}
|
||||
print "</table>";
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
@ -589,8 +602,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
|
||||
|
||||
if ($account->id == 0)
|
||||
{
|
||||
if ($account->id == 0) {
|
||||
$colspan = 6;
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoBANRecord").'</td></tr>';
|
||||
}
|
||||
@ -600,8 +612,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
|
||||
// Edit
|
||||
if ($id && ($action == 'edit' || $action == 'create') && $user->rights->user->user->creer)
|
||||
{
|
||||
if ($id && ($action == 'edit' || $action == 'create') && $user->rights->user->user->creer) {
|
||||
$title = $langs->trans("User");
|
||||
print dol_get_fiche_head($head, 'bank', $title, 0, 'user');
|
||||
|
||||
@ -679,9 +690,13 @@ if ($id && ($action == 'edit' || $action == 'create') && $user->rights->user->us
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($id && $action == 'edit' && $user->rights->user->user->creer) print '</form>';
|
||||
if ($id && $action == 'edit' && $user->rights->user->user->creer) {
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
if ($id && $action == 'create' && $user->rights->user->user->creer) print '</form>';
|
||||
if ($id && $action == 'create' && $user->rights->user->user->creer) {
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -96,10 +96,8 @@ class UserBankAccount extends Account
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_rib (fk_user, datec)";
|
||||
$sql .= " VALUES (".$this->userid.", '".$this->db->idate($now)."')";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->affected_rows($resql))
|
||||
{
|
||||
if ($resql) {
|
||||
if ($this->db->affected_rows($resql)) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."user_rib");
|
||||
|
||||
return $this->update($user);
|
||||
@ -121,8 +119,7 @@ class UserBankAccount extends Account
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (!$this->id)
|
||||
{
|
||||
if (!$this->id) {
|
||||
$this->create();
|
||||
}
|
||||
|
||||
@ -138,14 +135,15 @@ class UserBankAccount extends Account
|
||||
$sql .= ",proprio = '".$this->db->escape($this->proprio)."'";
|
||||
$sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'";
|
||||
|
||||
if (trim($this->label) != '')
|
||||
if (trim($this->label) != '') {
|
||||
$sql .= ",label = '".$this->db->escape($this->label)."'";
|
||||
else $sql .= ",label = NULL";
|
||||
} else {
|
||||
$sql .= ",label = NULL";
|
||||
}
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
return 1;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -163,20 +161,26 @@ class UserBankAccount extends Account
|
||||
*/
|
||||
public function fetch($id, $ref = '', $userid = 0)
|
||||
{
|
||||
if (empty($id) && empty($ref) && empty($userid)) return -1;
|
||||
if (empty($id) && empty($ref) && empty($userid)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid, fk_user, entity, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,";
|
||||
$sql .= " owner_address, label, datec, tms as datem";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user_rib";
|
||||
if ($id) $sql .= " WHERE rowid = ".$id;
|
||||
if ($ref) $sql .= " WHERE label = '".$this->db->escape($ref)."'";
|
||||
if ($userid) $sql .= " WHERE fk_user = ".((int) $userid);
|
||||
if ($id) {
|
||||
$sql .= " WHERE rowid = ".$id;
|
||||
}
|
||||
if ($ref) {
|
||||
$sql .= " WHERE label = '".$this->db->escape($ref)."'";
|
||||
}
|
||||
if ($userid) {
|
||||
$sql .= " WHERE fk_user = ".((int) $userid);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
|
||||
@ -28,7 +28,9 @@
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
if (!empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
|
||||
if (!empty($conf->ldap->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -154,8 +156,7 @@ class UserGroup extends CommonObject
|
||||
global $conf;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
if (!empty($groupname))
|
||||
{
|
||||
if (!empty($groupname)) {
|
||||
$result = $this->fetchCommon(0, '', ' AND nom = \''.$this->db->escape($groupname).'\'');
|
||||
} else {
|
||||
$result = $this->fetchCommon($id);
|
||||
@ -163,10 +164,8 @@ class UserGroup extends CommonObject
|
||||
|
||||
$this->name = $this->nom; // For compatibility with field name
|
||||
|
||||
if ($result)
|
||||
{
|
||||
if ($load_members)
|
||||
{
|
||||
if ($result) {
|
||||
if ($load_members) {
|
||||
$this->members = $this->listUsersForGroup();
|
||||
}
|
||||
|
||||
@ -196,8 +195,7 @@ class UserGroup extends CommonObject
|
||||
$sql .= " ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql .= " WHERE ug.fk_usergroup = g.rowid";
|
||||
$sql .= " AND ug.fk_user = ".$userid;
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
$sql .= " AND g.entity IS NOT NULL";
|
||||
} else {
|
||||
$sql .= " AND g.entity IN (0,".$conf->entity.")";
|
||||
@ -206,12 +204,9 @@ class UserGroup extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::listGroupsForUser", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($result))
|
||||
{
|
||||
if (!array_key_exists($obj->rowid, $ret))
|
||||
{
|
||||
if ($result) {
|
||||
while ($obj = $this->db->fetch_object($result)) {
|
||||
if (!array_key_exists($obj->rowid, $ret)) {
|
||||
$newgroup = new UserGroup($this->db);
|
||||
$newgroup->fetch($obj->rowid, '', $load_members);
|
||||
$ret[$obj->rowid] = $newgroup;
|
||||
@ -243,37 +238,43 @@ class UserGroup extends CommonObject
|
||||
$ret = array();
|
||||
|
||||
$sql = "SELECT u.rowid";
|
||||
if (!empty($this->id)) $sql .= ", ug.entity as usergroup_entity";
|
||||
if (!empty($this->id)) {
|
||||
$sql .= ", ug.entity as usergroup_entity";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
if (!empty($this->id)) $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
if (!empty($this->id)) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
}
|
||||
$sql .= " WHERE 1 = 1";
|
||||
if (!empty($this->id)) $sql .= " AND ug.fk_user = u.rowid";
|
||||
if (!empty($this->id)) $sql .= " AND ug.fk_usergroup = ".$this->id;
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity)
|
||||
{
|
||||
if (!empty($this->id)) {
|
||||
$sql .= " AND ug.fk_user = u.rowid";
|
||||
}
|
||||
if (!empty($this->id)) {
|
||||
$sql .= " AND ug.fk_usergroup = ".$this->id;
|
||||
}
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
$sql .= " AND u.entity IS NOT NULL";
|
||||
} else {
|
||||
$sql .= " AND u.entity IN (0,".$conf->entity.")";
|
||||
}
|
||||
if (!empty($excludefilter)) $sql .= ' AND ('.$excludefilter.')';
|
||||
if (!empty($excludefilter)) {
|
||||
$sql .= ' AND ('.$excludefilter.')';
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::listUsersForGroup", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
if (!array_key_exists($obj->rowid, $ret))
|
||||
{
|
||||
if ($mode != 1)
|
||||
{
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if (!array_key_exists($obj->rowid, $ret)) {
|
||||
if ($mode != 1) {
|
||||
$newuser = new User($this->db);
|
||||
$newuser->fetch($obj->rowid);
|
||||
$ret[$obj->rowid] = $newuser;
|
||||
} else $ret[$obj->rowid] = $obj->rowid;
|
||||
} else {
|
||||
$ret[$obj->rowid] = $obj->rowid;
|
||||
}
|
||||
}
|
||||
if ($mode != 1 && !empty($obj->usergroup_entity))
|
||||
{
|
||||
if ($mode != 1 && !empty($obj->usergroup_entity)) {
|
||||
$ret[$obj->rowid]->usergroup_entity[] = $obj->usergroup_entity;
|
||||
}
|
||||
}
|
||||
@ -308,8 +309,7 @@ class UserGroup extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!empty($rid))
|
||||
{
|
||||
if (!empty($rid)) {
|
||||
$module = $perms = $subperms = '';
|
||||
|
||||
// Si on a demande ajout d'un droit en particulier, on recupere
|
||||
@ -335,25 +335,27 @@ class UserGroup extends CommonObject
|
||||
// Where pour la liste des droits a ajouter
|
||||
$whereforadd = "id=".((int) $rid);
|
||||
// Find also rights that are herited to add them too
|
||||
if ($subperms) $whereforadd .= " OR (module='".$this->db->escape($module)."' AND perms='".$this->db->escape($perms)."' AND (subperms='lire' OR subperms='read'))";
|
||||
elseif ($perms) $whereforadd .= " OR (module='".$this->db->escape($module)."' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
|
||||
if ($subperms) {
|
||||
$whereforadd .= " OR (module='".$this->db->escape($module)."' AND perms='".$this->db->escape($perms)."' AND (subperms='lire' OR subperms='read'))";
|
||||
} elseif ($perms) {
|
||||
$whereforadd .= " OR (module='".$this->db->escape($module)."' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
|
||||
}
|
||||
} else {
|
||||
// Where pour la liste des droits a ajouter
|
||||
if (!empty($allmodule))
|
||||
{
|
||||
if ($allmodule == 'allmodules')
|
||||
{
|
||||
if (!empty($allmodule)) {
|
||||
if ($allmodule == 'allmodules') {
|
||||
$whereforadd = 'allmodules';
|
||||
} else {
|
||||
$whereforadd = "module='".$this->db->escape($allmodule)."'";
|
||||
if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'";
|
||||
if (!empty($allperms)) {
|
||||
$whereforadd .= " AND perms='".$this->db->escape($allperms)."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add permission of the list $whereforadd
|
||||
if (!empty($whereforadd))
|
||||
{
|
||||
if (!empty($whereforadd)) {
|
||||
//print "$module-$perms-$subperms";
|
||||
$sql = "SELECT id";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def";
|
||||
@ -363,19 +365,21 @@ class UserGroup extends CommonObject
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$nid = $obj->id;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_rights WHERE fk_usergroup = $this->id AND fk_id=".$nid." AND entity = ".$entity;
|
||||
if (!$this->db->query($sql)) $error++;
|
||||
if (!$this->db->query($sql)) {
|
||||
$error++;
|
||||
}
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."usergroup_rights (entity, fk_usergroup, fk_id) VALUES (".$entity.", ".$this->id.", ".$nid.")";
|
||||
if (!$this->db->query($sql)) $error++;
|
||||
if (!$this->db->query($sql)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -384,14 +388,15 @@ class UserGroup extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$langs->load("other");
|
||||
$this->context = array('audit'=>$langs->trans("PermissionsAdd").($rid ? ' (id='.$rid.')' : ''));
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('USERGROUP_MODIFY', $user);
|
||||
if ($result < 0) { $error++; }
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
@ -426,8 +431,7 @@ class UserGroup extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!empty($rid))
|
||||
{
|
||||
if (!empty($rid)) {
|
||||
$module = $perms = $subperms = '';
|
||||
|
||||
// Si on a demande supression d'un droit en particulier, on recupere
|
||||
@ -453,29 +457,32 @@ class UserGroup extends CommonObject
|
||||
// Where pour la liste des droits a supprimer
|
||||
$wherefordel = "id=".$this->db->escape($rid);
|
||||
// Suppression des droits induits
|
||||
if ($subperms == 'lire' || $subperms == 'read') $wherefordel .= " OR (module='".$this->db->escape($module)."' AND perms='".$this->db->escape($perms)."' AND subperms IS NOT NULL)";
|
||||
if ($perms == 'lire' || $perms == 'read') $wherefordel .= " OR (module='".$this->db->escape($module)."')";
|
||||
if ($subperms == 'lire' || $subperms == 'read') {
|
||||
$wherefordel .= " OR (module='".$this->db->escape($module)."' AND perms='".$this->db->escape($perms)."' AND subperms IS NOT NULL)";
|
||||
}
|
||||
if ($perms == 'lire' || $perms == 'read') {
|
||||
$wherefordel .= " OR (module='".$this->db->escape($module)."')";
|
||||
}
|
||||
|
||||
// Pour compatibilite, si lowid = 0, on est en mode suppression de tout
|
||||
// TODO A virer quand sera gere par l'appelant
|
||||
//if (substr($rid,-1,1) == 0) $wherefordel="module='$module'";
|
||||
} else {
|
||||
// Add permission of the list $wherefordel
|
||||
if (!empty($allmodule))
|
||||
{
|
||||
if ($allmodule == 'allmodules')
|
||||
{
|
||||
if (!empty($allmodule)) {
|
||||
if ($allmodule == 'allmodules') {
|
||||
$wherefordel = 'allmodules';
|
||||
} else {
|
||||
$wherefordel = "module='".$this->db->escape($allmodule)."'";
|
||||
if (!empty($allperms)) $wherefordel .= " AND perms='".$this->db->escape($allperms)."'";
|
||||
if (!empty($allperms)) {
|
||||
$wherefordel .= " AND perms='".$this->db->escape($allperms)."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suppression des droits de la liste wherefordel
|
||||
if (!empty($wherefordel))
|
||||
{
|
||||
if (!empty($wherefordel)) {
|
||||
//print "$module-$perms-$subperms";
|
||||
$sql = "SELECT id";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def";
|
||||
@ -485,12 +492,10 @@ class UserGroup extends CommonObject
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$nid = 0;
|
||||
|
||||
$obj = $this->db->fetch_object($result);
|
||||
@ -501,7 +506,9 @@ class UserGroup extends CommonObject
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_rights";
|
||||
$sql .= " WHERE fk_usergroup = $this->id AND fk_id=".$nid;
|
||||
$sql .= " AND entity = ".$entity;
|
||||
if (!$this->db->query($sql)) $error++;
|
||||
if (!$this->db->query($sql)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -510,14 +517,15 @@ class UserGroup extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$langs->load("other");
|
||||
$this->context = array('audit'=>$langs->trans("PermissionsDelete").($rid ? ' (id='.$rid.')' : ''));
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('USERGROUP_MODIFY', $user);
|
||||
if ($result < 0) { $error++; }
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
@ -542,14 +550,12 @@ class UserGroup extends CommonObject
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag])
|
||||
{
|
||||
if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag]) {
|
||||
// Rights for this module are already loaded, so we leave
|
||||
return;
|
||||
}
|
||||
|
||||
if (!empty($this->all_permissions_are_loaded))
|
||||
{
|
||||
if (!empty($this->all_permissions_are_loaded)) {
|
||||
// We already loaded all rights for this group, so we leave
|
||||
return;
|
||||
}
|
||||
@ -564,16 +570,16 @@ class UserGroup extends CommonObject
|
||||
$sql .= " AND u.entity = ".$conf->entity;
|
||||
$sql .= " AND u.fk_usergroup = ".$this->id;
|
||||
$sql .= " AND r.perms IS NOT NULL";
|
||||
if ($moduletag) $sql .= " AND r.module = '".$this->db->escape($moduletag)."'";
|
||||
if ($moduletag) {
|
||||
$sql .= " AND r.module = '".$this->db->escape($moduletag)."'";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this).'::getrights', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
if ($obj) {
|
||||
@ -581,17 +587,25 @@ class UserGroup extends CommonObject
|
||||
$perms = $obj->perms;
|
||||
$subperms = $obj->subperms;
|
||||
|
||||
if ($perms)
|
||||
{
|
||||
if (!isset($this->rights)) $this->rights = new stdClass(); // For avoid error
|
||||
if (!isset($this->rights->$module) || !is_object($this->rights->$module)) $this->rights->$module = new stdClass();
|
||||
if ($subperms)
|
||||
{
|
||||
if (!isset($this->rights->$module->$perms) || !is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = new stdClass();
|
||||
if (empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++;
|
||||
if ($perms) {
|
||||
if (!isset($this->rights)) {
|
||||
$this->rights = new stdClass(); // For avoid error
|
||||
}
|
||||
if (!isset($this->rights->$module) || !is_object($this->rights->$module)) {
|
||||
$this->rights->$module = new stdClass();
|
||||
}
|
||||
if ($subperms) {
|
||||
if (!isset($this->rights->$module->$perms) || !is_object($this->rights->$module->$perms)) {
|
||||
$this->rights->$module->$perms = new stdClass();
|
||||
}
|
||||
if (empty($this->rights->$module->$perms->$subperms)) {
|
||||
$this->nb_rights++;
|
||||
}
|
||||
$this->rights->$module->$perms->$subperms = 1;
|
||||
} else {
|
||||
if (empty($this->rights->$module->$perms)) $this->nb_rights++;
|
||||
if (empty($this->rights->$module->$perms)) {
|
||||
$this->nb_rights++;
|
||||
}
|
||||
$this->rights->$module->$perms = 1;
|
||||
}
|
||||
}
|
||||
@ -602,8 +616,7 @@ class UserGroup extends CommonObject
|
||||
$this->db->free($resql);
|
||||
}
|
||||
|
||||
if ($moduletag == '')
|
||||
{
|
||||
if ($moduletag == '') {
|
||||
// Si module etait non defini, alors on a tout charge, on peut donc considerer
|
||||
// que les droits sont en cache (car tous charges) pour cet instance de group
|
||||
$this->all_permissions_are_loaded = 1;
|
||||
@ -641,7 +654,9 @@ class UserGroup extends CommonObject
|
||||
$this->nom = $this->name; // Field for 'name' is called 'nom' in database
|
||||
}
|
||||
|
||||
if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value
|
||||
if (!isset($this->entity)) {
|
||||
$this->entity = $conf->entity; // If not defined, we use default value
|
||||
}
|
||||
|
||||
return $this->createCommon($user, $notrigger);
|
||||
}
|
||||
@ -708,7 +723,9 @@ class UserGroup extends CommonObject
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
global $menumanager;
|
||||
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpicto) $withpicto = 0;
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpicto) {
|
||||
$withpicto = 0;
|
||||
}
|
||||
|
||||
$result = ''; $label = '';
|
||||
|
||||
@ -720,19 +737,20 @@ class UserGroup extends CommonObject
|
||||
|
||||
$url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id;
|
||||
|
||||
if ($option != 'nolink')
|
||||
{
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
|
||||
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
}
|
||||
}
|
||||
|
||||
$linkclose = "";
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
if (empty($notooltip)) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$langs->load("users");
|
||||
$label = $langs->trans("ShowGroup");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"';
|
||||
@ -753,16 +771,23 @@ class UserGroup extends CommonObject
|
||||
$linkend = '</a>';
|
||||
|
||||
$result = $linkstart;
|
||||
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
if ($withpicto != 2) $result .= $this->name;
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
if ($withpicto != 2) {
|
||||
$result .= $this->name;
|
||||
}
|
||||
$result .= $linkend;
|
||||
|
||||
global $action;
|
||||
$hookmanager->initHooks(array('groupdao'));
|
||||
$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
|
||||
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) $result = $hookmanager->resPrint;
|
||||
else $result .= $hookmanager->resPrint;
|
||||
if ($reshook > 0) {
|
||||
$result = $hookmanager->resPrint;
|
||||
} else {
|
||||
$result .= $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -783,9 +808,15 @@ class UserGroup extends CommonObject
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$dn = '';
|
||||
if ($mode == 0) $dn = $conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS].",".$conf->global->LDAP_GROUP_DN;
|
||||
if ($mode == 1) $dn = $conf->global->LDAP_GROUP_DN;
|
||||
if ($mode == 2) $dn = $conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS];
|
||||
if ($mode == 0) {
|
||||
$dn = $conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS].",".$conf->global->LDAP_GROUP_DN;
|
||||
}
|
||||
if ($mode == 1) {
|
||||
$dn = $conf->global->LDAP_GROUP_DN;
|
||||
}
|
||||
if ($mode == 2) {
|
||||
$dn = $conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS];
|
||||
}
|
||||
return $dn;
|
||||
}
|
||||
|
||||
@ -808,14 +839,16 @@ class UserGroup extends CommonObject
|
||||
$info["objectclass"] = explode(',', $conf->global->LDAP_GROUP_OBJECT_CLASS);
|
||||
|
||||
// Champs
|
||||
if ($this->name && !empty($conf->global->LDAP_GROUP_FIELD_FULLNAME)) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->name;
|
||||
if ($this->name && !empty($conf->global->LDAP_GROUP_FIELD_FULLNAME)) {
|
||||
$info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->name;
|
||||
}
|
||||
//if ($this->name && ! empty($conf->global->LDAP_GROUP_FIELD_NAME)) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->name;
|
||||
if ($this->note && !empty($conf->global->LDAP_GROUP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = dol_string_nohtmltag($this->note, 2);
|
||||
if (!empty($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS))
|
||||
{
|
||||
if ($this->note && !empty($conf->global->LDAP_GROUP_FIELD_DESCRIPTION)) {
|
||||
$info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = dol_string_nohtmltag($this->note, 2);
|
||||
}
|
||||
if (!empty($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)) {
|
||||
$valueofldapfield = array();
|
||||
foreach ($this->members as $key=>$val) // This is array of users for group into dolibarr database.
|
||||
{
|
||||
foreach ($this->members as $key => $val) { // This is array of users for group into dolibarr database.
|
||||
$muser = new User($this->db);
|
||||
$muser->fetch($val->id);
|
||||
$info2 = $muser->_load_ldap_info();
|
||||
@ -875,10 +908,8 @@ class UserGroup extends CommonObject
|
||||
$langs->load("user");
|
||||
|
||||
// Positionne le modele sur le nom du modele a utiliser
|
||||
if (!dol_strlen($modele))
|
||||
{
|
||||
if (!empty($conf->global->USERGROUP_ADDON_PDF))
|
||||
{
|
||||
if (!dol_strlen($modele)) {
|
||||
if (!empty($conf->global->USERGROUP_ADDON_PDF)) {
|
||||
$modele = $conf->global->USERGROUP_ADDON_PDF;
|
||||
} else {
|
||||
$modele = 'grass';
|
||||
|
||||
@ -33,7 +33,9 @@ $id = (int) GETPOST('id', 'int');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
@ -47,7 +49,9 @@ $hookmanager->initHooks(array('usercard', 'globalcard'));
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($action == 'update' && !GETPOST('cancel', 'alpha')) {
|
||||
@ -76,8 +80,7 @@ $form = new Form($db);
|
||||
llxHeader("", "ClickToDial");
|
||||
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
if ($id > 0) {
|
||||
$object = new User($db);
|
||||
$object->fetch($id, '', '', 1);
|
||||
$object->getrights();
|
||||
@ -107,17 +110,14 @@ if ($id > 0)
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// Edit mode
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($action == 'edit') {
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if ($user->admin)
|
||||
{
|
||||
if ($user->admin) {
|
||||
print '<tr><td class="titlefield fieldrequired">ClickToDial URL</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input name="url" value="'.(!empty($object->clicktodial_url) ? $object->clicktodial_url : '').'" size="92">';
|
||||
if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url))
|
||||
{
|
||||
if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url)) {
|
||||
$langs->load("errors");
|
||||
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).'</font>';
|
||||
} else {
|
||||
@ -147,14 +147,14 @@ if ($id > 0)
|
||||
{
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
if (!empty($user->admin))
|
||||
{
|
||||
if (!empty($user->admin)) {
|
||||
print '<tr><td class="titlefield">ClickToDial URL</td>';
|
||||
print '<td class="valeur">';
|
||||
$url = $conf->global->CLICKTODIAL_URL;
|
||||
if (!empty($object->clicktodial_url)) $url = $object->clicktodial_url;
|
||||
if (empty($url))
|
||||
{
|
||||
if (!empty($object->clicktodial_url)) {
|
||||
$url = $object->clicktodial_url;
|
||||
}
|
||||
if (empty($url)) {
|
||||
$langs->load("errors");
|
||||
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).'</font>';
|
||||
} else {
|
||||
@ -181,8 +181,7 @@ if ($id > 0)
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($action == 'edit') {
|
||||
print '<br>';
|
||||
print '<div class="center"><input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
@ -194,12 +193,11 @@ if ($id > 0)
|
||||
print '</form>';
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*/
|
||||
* Barre d'actions
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (!empty($user->admin) && $action <> 'edit')
|
||||
{
|
||||
if (!empty($user->admin) && $action <> 'edit') {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
|
||||
@ -47,14 +47,12 @@ $canedituser = (!empty($user->admin) || $user->rights->user->user->creer);
|
||||
$candisableuser = (!empty($user->admin) || $user->rights->user->user->supprimer);
|
||||
$canreadgroup = $canreaduser;
|
||||
$caneditgroup = $canedituser;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$canreadgroup = (!empty($user->admin) || $user->rights->user->group_advance->read);
|
||||
$caneditgroup = (!empty($user->admin) || $user->rights->user->group_advance->write);
|
||||
}
|
||||
// Define value to know what current user can do on properties of edited user
|
||||
if ($id)
|
||||
{
|
||||
if ($id) {
|
||||
// $user est le user qui edite, $id est l'id de l'utilisateur edite
|
||||
$caneditfield = ((($user->id == $id) && $user->rights->user->self->creer)
|
||||
|| (($user->id != $id) && $user->rights->user->user->creer));
|
||||
@ -64,28 +62,37 @@ if ($id)
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = 'user';
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
|
||||
if ($user->id <> $id && !$canreaduser) accessforbidden();
|
||||
if ($user->id <> $id && !$canreaduser) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Get parameters
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (!$sortorder) $sortorder = "ASC";
|
||||
if (!$sortfield) $sortfield = "position_name";
|
||||
if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if (!$sortfield) {
|
||||
$sortfield = "position_name";
|
||||
}
|
||||
|
||||
$object = new User($db);
|
||||
if ($id > 0 || !empty($ref))
|
||||
{
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$result = $object->fetch($id, $ref, '', 1);
|
||||
$object->getrights();
|
||||
//$upload_dir = $conf->user->multidir_output[$object->entity] . "/" . $object->id ;
|
||||
@ -103,7 +110,9 @@ $hookmanager->initHooks(array('usercard', 'userdoc', 'globalcard'));
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
@ -118,12 +127,13 @@ $form = new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("UserCard").' - '.$langs->trans("Files"));
|
||||
|
||||
if ($object->id)
|
||||
{
|
||||
if ($object->id) {
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
if (!empty($conf->notification->enabled)) $langs->load("mails");
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
$head = user_prepare_head($object);
|
||||
|
||||
$form = new Form($db);
|
||||
@ -143,8 +153,7 @@ if ($object->id)
|
||||
// Build file list
|
||||
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||
$totalsize = 0;
|
||||
foreach ($filearray as $key => $file)
|
||||
{
|
||||
foreach ($filearray as $key => $file) {
|
||||
$totalsize += $file['size'];
|
||||
}
|
||||
|
||||
|
||||
@ -38,8 +38,7 @@ $candisableperms = ($user->admin || $user->rights->user->user->supprimer);
|
||||
$feature2 = 'user';
|
||||
|
||||
// Advanced permissions
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$canreadperms = ($user->admin || $user->rights->user->group_advance->read);
|
||||
$caneditperms = ($user->admin || $user->rights->user->group_advance->write);
|
||||
$candisableperms = ($user->admin || $user->rights->user->group_advance->delete);
|
||||
@ -62,8 +61,7 @@ $userid = GETPOST('user', 'int');
|
||||
$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2);
|
||||
|
||||
// Users/Groups management only in master entity if transverse mode
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -87,29 +85,31 @@ $hookmanager->initHooks(array('groupcard', 'globalcard'));
|
||||
|
||||
$parameters = array('id' => $id, 'userid' => $userid, 'caneditperms' => $caneditperms);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
$backurlforlist = DOL_URL_ROOT.'/user/group/list.php';
|
||||
|
||||
if (empty($backtopage) || ($cancel && empty($id))) {
|
||||
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
|
||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist;
|
||||
else $backtopage = dol_buildpath('/user/group/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
|
||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
|
||||
$backtopage = $backurlforlist;
|
||||
} else {
|
||||
$backtopage = dol_buildpath('/user/group/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
if ($cancel) {
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Action remove group
|
||||
if ($action == 'confirm_delete' && $confirm == "yes")
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($action == 'confirm_delete' && $confirm == "yes") {
|
||||
if ($caneditperms) {
|
||||
$object->fetch($id);
|
||||
$object->delete($user);
|
||||
header("Location: ".DOL_URL_ROOT."/user/group/list.php?restore_lastsearch_values=1");
|
||||
@ -121,10 +121,8 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Action add group
|
||||
if ($action == 'add')
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($action == 'add') {
|
||||
if ($caneditperms) {
|
||||
if (!GETPOST("nom", "nohtml")) {
|
||||
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
|
||||
$action = "create"; // Go back to create page
|
||||
@ -134,17 +132,21 @@ if (empty($reshook)) {
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $object->entity = 0;
|
||||
else $object->entity = $_POST["entity"];
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$object->entity = 0;
|
||||
} else {
|
||||
$object->entity = $_POST["entity"];
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
$id = $object->create();
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
if ($id > 0) {
|
||||
$db->commit();
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
@ -164,22 +166,22 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Add/Remove user into group
|
||||
if ($action == 'adduser' || $action == 'removeuser')
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($userid > 0)
|
||||
{
|
||||
if ($action == 'adduser' || $action == 'removeuser') {
|
||||
if ($caneditperms) {
|
||||
if ($userid > 0) {
|
||||
$object->fetch($id);
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$edituser = new User($db);
|
||||
$edituser->fetch($userid);
|
||||
if ($action == 'adduser') $result = $edituser->SetInGroup($object->id, $object->entity);
|
||||
if ($action == 'removeuser') $result = $edituser->RemoveFromGroup($object->id, $object->entity);
|
||||
if ($action == 'adduser') {
|
||||
$result = $edituser->SetInGroup($object->id, $object->entity);
|
||||
}
|
||||
if ($action == 'removeuser') {
|
||||
$result = $edituser->RemoveFromGroup($object->id, $object->entity);
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
} else {
|
||||
@ -193,10 +195,8 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($action == 'update') {
|
||||
if ($caneditperms) {
|
||||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
@ -208,15 +208,19 @@ if (empty($reshook)) {
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $object->entity = 0;
|
||||
else $object->entity = $_POST["entity"];
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$object->entity = 0;
|
||||
} else {
|
||||
$object->entity = $_POST["entity"];
|
||||
}
|
||||
|
||||
$ret = $object->update();
|
||||
|
||||
if ($ret >= 0 && !count($object->errors))
|
||||
{
|
||||
if ($ret >= 0 && !count($object->errors)) {
|
||||
setEventMessages($langs->trans("GroupModified"), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
@ -247,8 +251,7 @@ $fuserstatic = new User($db);
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("NewGroup"), '', 'object_group');
|
||||
|
||||
print dol_set_focus('#nom');
|
||||
@ -263,10 +266,8 @@ if ($action == 'create')
|
||||
print '<table class="border centpercent tableforfieldcreate">';
|
||||
|
||||
// Multicompany
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc))
|
||||
{
|
||||
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
|
||||
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
print "<tr>".'<td class="tdtop">'.$langs->trans("Entity").'</td>';
|
||||
print "<td>".$mc->select_entities($conf->entity);
|
||||
print "</td></tr>\n";
|
||||
@ -292,17 +293,13 @@ if ($action == 'create')
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Visu et edition */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
else {
|
||||
if ($id)
|
||||
{
|
||||
} else {
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Visu et edition */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($id) {
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = group_prepare_head($object);
|
||||
@ -311,8 +308,7 @@ else {
|
||||
/*
|
||||
* Confirmation suppression
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("DeleteAGroup"), $langs->trans("ConfirmDeleteGroup", $object->name), "confirm_delete", '', 0, 1);
|
||||
}
|
||||
|
||||
@ -320,8 +316,7 @@ else {
|
||||
* Fiche en mode visu
|
||||
*/
|
||||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
if ($action != 'edit') {
|
||||
print dol_get_fiche_head($head, 'group', $title, -1, 'group');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/group/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
@ -335,20 +330,17 @@ else {
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Name (already in dol_banner, we keep it to have the GlobalGroup picto, but we should move it in dol_banner)
|
||||
if (!empty($conf->mutlicompany->enabled))
|
||||
{
|
||||
if (!empty($conf->mutlicompany->enabled)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Name").'</td>';
|
||||
print '<td class="valeur">'.dol_escape_htmltag($object->name);
|
||||
if (empty($object->entity))
|
||||
{
|
||||
if (empty($object->entity)) {
|
||||
print img_picto($langs->trans("GlobalGroup"), 'redstar');
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Multicompany
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
$mc->getInfo($object->entity);
|
||||
print "<tr>".'<td class="titlefield">'.$langs->trans("Entity").'</td>';
|
||||
print '<td class="valeur">'.dol_escape_htmltag($mc->label);
|
||||
@ -381,15 +373,15 @@ else {
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
if ($candisableperms)
|
||||
{
|
||||
if ($candisableperms) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'&token='.newToken().'">'.$langs->trans("DeleteGroup").'</a>';
|
||||
}
|
||||
|
||||
@ -402,10 +394,8 @@ else {
|
||||
// On selectionne les users qui ne sont pas deja dans le groupe
|
||||
$exclude = array();
|
||||
|
||||
if (!empty($object->members))
|
||||
{
|
||||
foreach ($object->members as $useringroup)
|
||||
{
|
||||
if (!empty($object->members)) {
|
||||
foreach ($object->members as $useringroup) {
|
||||
$exclude[] = $useringroup->id;
|
||||
}
|
||||
}
|
||||
@ -415,10 +405,8 @@ else {
|
||||
$reshook = $hookmanager->executeHooks('formAddUserToGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if (empty($reshook)) {
|
||||
if ($caneditperms) {
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="adduser">';
|
||||
@ -447,10 +435,8 @@ else {
|
||||
print '<td class="liste_titre right" width="5"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (!empty($object->members))
|
||||
{
|
||||
foreach ($object->members as $useringroup)
|
||||
{
|
||||
if (!empty($object->members)) {
|
||||
foreach ($object->members as $useringroup) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login');
|
||||
@ -484,8 +470,8 @@ else {
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
* Documents generes
|
||||
*/
|
||||
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->usergroup->dir_output."/".dol_sanitizeFileName($object->ref);
|
||||
@ -510,11 +496,10 @@ else {
|
||||
}
|
||||
|
||||
/*
|
||||
* Fiche en mode edition
|
||||
*/
|
||||
* Fiche en mode edition
|
||||
*/
|
||||
|
||||
if ($action == 'edit' && $caneditperms)
|
||||
{
|
||||
if ($action == 'edit' && $caneditperms) {
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="updategroup" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
@ -526,10 +511,8 @@ else {
|
||||
print '<table class="border centpercent tableforfieldedit">'."\n";
|
||||
|
||||
// Multicompany
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc))
|
||||
{
|
||||
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
|
||||
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) {
|
||||
print "<tr>".'<td class="tdtop">'.$langs->trans("Entity").'</td>';
|
||||
print "<td>".$mc->select_entities($object->entity);
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -34,14 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
|
||||
$langs->loadLangs(array('companies', 'ldap', 'users', 'admin'));
|
||||
|
||||
// Users/Groups management only in master entity if transverse mode
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$canreadperms = true;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$canreadperms = ($user->admin || $user->rights->user->group_advance->read);
|
||||
}
|
||||
|
||||
@ -49,7 +47,9 @@ $id = GETPOST('id', 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$object = new Usergroup($db);
|
||||
$object->fetch($id);
|
||||
@ -60,13 +60,11 @@ $object->getrights();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'dolibarr2ldap')
|
||||
{
|
||||
if ($action == 'dolibarr2ldap') {
|
||||
$ldap = new Ldap();
|
||||
$result = $ldap->connect_bind();
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
$info = $object->_load_ldap_info();
|
||||
|
||||
// Get a gid number for objectclass PosixGroup
|
||||
@ -80,8 +78,7 @@ if ($action == 'dolibarr2ldap')
|
||||
$result = $ldap->update($dn, $info, $user, $olddn);
|
||||
}
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
if ($result >= 0) {
|
||||
setEventMessages($langs->trans("GroupSynchronized"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
@ -111,12 +108,10 @@ print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Name (already in dol_banner, we keep it to have the GlobalGroup picto, but we should move it in dol_banner)
|
||||
if (!empty($conf->mutlicompany->enabled))
|
||||
{
|
||||
if (!empty($conf->mutlicompany->enabled)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Name").'</td>';
|
||||
print '<td class="valeur">'.$object->name;
|
||||
if (!$object->entity)
|
||||
{
|
||||
if (!$object->entity) {
|
||||
print img_picto($langs->trans("GlobalGroup"), 'redstar');
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
@ -153,14 +148,15 @@ print dol_get_fiche_end();
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "<br>\n";
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') {
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -177,8 +173,7 @@ print '</tr>';
|
||||
// Lecture LDAP
|
||||
$ldap = new Ldap();
|
||||
$result = $ldap->connect_bind();
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
$info = $object->_load_ldap_info();
|
||||
$dn = $object->_load_ldap_dn($info, 1);
|
||||
$search = "(".$object->_load_ldap_dn($info, 2).")";
|
||||
@ -188,10 +183,8 @@ if ($result > 0)
|
||||
//var_dump($records);
|
||||
|
||||
// Show tree
|
||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0))
|
||||
{
|
||||
if (!is_array($records))
|
||||
{
|
||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
||||
if (!is_array($records)) {
|
||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
|
||||
} else {
|
||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||
|
||||
@ -28,15 +28,14 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!$user->rights->user->group_advance->read && !$user->admin)
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
if (!$user->rights->user->group_advance->read && !$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
// Users/Groups management only in master entity if transverse mode
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -50,8 +49,7 @@ $optioncss = GETPOST('optioncss', 'alpha');
|
||||
// Defini si peux lire/modifier utilisateurs et permisssions
|
||||
$caneditperms = ($user->admin || $user->rights->user->user->creer);
|
||||
// Advanced permissions
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$caneditperms = ($user->admin || $user->rights->user->group_advance->write);
|
||||
}
|
||||
|
||||
@ -60,13 +58,19 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
if (!$sortfield) $sortfield = "g.nom";
|
||||
if (!$sortorder) $sortorder = "ASC";
|
||||
if (!$sortfield) {
|
||||
$sortfield = "g.nom";
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
@ -79,21 +83,25 @@ $fieldstosearchall = array(
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction = ''; }
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list'; $massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($reshook)) {
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||
$search_label = "";
|
||||
$search_date_creation = "";
|
||||
$search_date_update = "";
|
||||
@ -113,20 +121,22 @@ $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, COUNT(DISTINCT
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid";
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity)))
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity))) {
|
||||
$sql .= " WHERE g.entity IS NOT NULL";
|
||||
} else {
|
||||
$sql .= " WHERE g.entity IN (0,".$conf->entity.")";
|
||||
}
|
||||
if (!empty($search_group)) natural_search(array("g.nom", "g.note"), $search_group);
|
||||
if ($sall) $sql .= natural_search(array("g.nom", "g.note"), $sall);
|
||||
if (!empty($search_group)) {
|
||||
natural_search(array("g.nom", "g.note"), $search_group);
|
||||
}
|
||||
if ($sall) {
|
||||
$sql .= natural_search(array("g.nom", "g.note"), $sall);
|
||||
}
|
||||
$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec";
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$nbtotalofrecords = $num;
|
||||
@ -134,18 +144,21 @@ if ($resql)
|
||||
$i = 0;
|
||||
|
||||
$param = "&search_group=".urlencode($search_group)."&sall=".urlencode($sall);
|
||||
if ($optioncss != '') $param .= '&optioncss='.$optioncss;
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.$optioncss;
|
||||
}
|
||||
|
||||
$text = $langs->trans("ListOfGroups");
|
||||
|
||||
$newcardbutton = '';
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewGroup'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu=');
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
@ -155,9 +168,10 @@ if ($resql)
|
||||
|
||||
print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
|
||||
if ($sall) {
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
}
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
@ -172,8 +186,7 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Group", $_SERVER["PHP_SELF"], "g.nom", $param, "", "", $sortfield, $sortorder);
|
||||
//multicompany
|
||||
if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) {
|
||||
print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], "g.entity", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", $param, "", '', $sortfield, $sortorder, 'center ');
|
||||
@ -184,8 +197,7 @@ if ($resql)
|
||||
|
||||
$grouptemp = new UserGroup($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$grouptemp->id = $obj->rowid;
|
||||
@ -195,14 +207,12 @@ if ($resql)
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $grouptemp->getNomUrl(1);
|
||||
if (!$obj->entity)
|
||||
{
|
||||
if (!$obj->entity) {
|
||||
print img_picto($langs->trans("GlobalGroup"), 'redstar');
|
||||
}
|
||||
print "</td>";
|
||||
//multicompany
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) {
|
||||
$mc->getInfo($obj->entity);
|
||||
print '<td class="center">'.$mc->label.'</td>';
|
||||
}
|
||||
|
||||
@ -47,14 +47,15 @@ $canreadperms = ($user->admin || $user->rights->user->user->lire);
|
||||
$caneditperms = ($user->admin || $user->rights->user->user->creer);
|
||||
// Advanced permissions
|
||||
$advancedpermsactive = false;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$advancedpermsactive = true;
|
||||
$canreadperms = ($user->admin || ($user->rights->user->group_advance->read && $user->rights->user->group_advance->readperms));
|
||||
$caneditperms = ($user->admin || $user->rights->user->group_advance->write);
|
||||
}
|
||||
|
||||
if (!$canreadperms) accessforbidden();
|
||||
if (!$canreadperms) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$object = new Usergroup($db);
|
||||
$object->fetch($id);
|
||||
@ -71,7 +72,9 @@ $hookmanager->initHooks(array('groupperms', 'globalcard'));
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($action == 'addrights' && $caneditperms) {
|
||||
@ -110,8 +113,7 @@ $form = new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("Permissions"));
|
||||
|
||||
if ($object->id > 0)
|
||||
{
|
||||
if ($object->id > 0) {
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
@ -127,32 +129,24 @@ if ($object->id > 0)
|
||||
|
||||
$db->begin();
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
foreach ($modulesdir as $dir) {
|
||||
$handle = @opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle)) !== false)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
||||
{
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
if ($modName) {
|
||||
include_once $dir.$file;
|
||||
$objMod = new $modName($db);
|
||||
// Load all lang files of module
|
||||
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
||||
{
|
||||
foreach ($objMod->langfiles as $domain)
|
||||
{
|
||||
if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
|
||||
foreach ($objMod->langfiles as $domain) {
|
||||
$langs->load($domain);
|
||||
}
|
||||
}
|
||||
// Load all permissions
|
||||
if ($objMod->rights_class)
|
||||
{
|
||||
if ($objMod->rights_class) {
|
||||
$ret = $objMod->insert_permissions(0, $entity);
|
||||
$modules[$objMod->rights_class] = $objMod;
|
||||
}
|
||||
@ -176,15 +170,14 @@ if ($object->id > 0)
|
||||
|
||||
dol_syslog("get user perms", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
if (!isset($permsgroupbyentity[$obj->entity]))
|
||||
if (!isset($permsgroupbyentity[$obj->entity])) {
|
||||
$permsgroupbyentity[$obj->entity] = array();
|
||||
}
|
||||
array_push($permsgroupbyentity[$obj->entity], $obj->id);
|
||||
$i++;
|
||||
}
|
||||
@ -207,12 +200,10 @@ if ($object->id > 0)
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Name (already in dol_banner, we keep it to have the GlobalGroup picto, but we should move it in dol_banner)
|
||||
if (!empty($conf->mutlicompany->enabled))
|
||||
{
|
||||
if (!empty($conf->mutlicompany->enabled)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Name").'</td>';
|
||||
print '<td colspan="2">'.$object->name.'';
|
||||
if (!$object->entity)
|
||||
{
|
||||
if (!$object->entity) {
|
||||
print img_picto($langs->trans("GlobalGroup"), 'redstar');
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
@ -227,19 +218,22 @@ if ($object->id > 0)
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('insertExtraHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
print "\n";
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Module").'</td>';
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td class="center nowrap">';
|
||||
print '<a class="reposition commonlink" title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&module=allmodules">'.$langs->trans("All")."</a>";
|
||||
print '/';
|
||||
@ -248,36 +242,36 @@ if ($object->id > 0)
|
||||
}
|
||||
print '<td class="center" width="24"> </td>';
|
||||
print '<td>'.$langs->trans("Permissions").'</td>';
|
||||
if ($user->admin) print '<td class="right">'.$langs->trans("ID").'</td>';
|
||||
if ($user->admin) {
|
||||
print '<td class="right">'.$langs->trans("ID").'</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$sql = "SELECT r.id, r.libelle as label, r.module";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
|
||||
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
|
||||
$sql .= " AND r.entity = ".$entity;
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable
|
||||
}
|
||||
$sql .= " ORDER BY r.module, r.id";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$oldmod = '';
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
// If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it
|
||||
if (empty($modules[$obj->module]))
|
||||
{
|
||||
if (empty($modules[$obj->module])) {
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($oldmod <> $obj->module)
|
||||
{
|
||||
if ($oldmod <> $obj->module) {
|
||||
$oldmod = $obj->module;
|
||||
|
||||
// Break detected, we get objMod
|
||||
@ -290,8 +284,7 @@ if ($object->id > 0)
|
||||
print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName();
|
||||
print '<a name="'.$objMod->getName().'"></a>';
|
||||
print '</td>';
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td class="center nowrap">';
|
||||
print '<a class="reposition" title='.$langs->trans("All").' alt='.$langs->trans("All").' href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&module='.$obj->module.'">'.$langs->trans("All")."</a>";
|
||||
print '/';
|
||||
@ -303,7 +296,9 @@ if ($object->id > 0)
|
||||
print '<td colspan="2"> </td>';
|
||||
|
||||
// Permission id
|
||||
if ($user->admin) print '<td class="right"></td>';
|
||||
if ($user->admin) {
|
||||
print '<td class="right"></td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
@ -316,13 +311,10 @@ if ($object->id > 0)
|
||||
//print img_object('', $picto, 'class="inline-block pictoobjectwidth"').' '.$objMod->getName();
|
||||
print '</td>';
|
||||
|
||||
if (is_array($permsgroupbyentity[$entity]))
|
||||
{
|
||||
if (in_array($obj->id, $permsgroupbyentity[$entity]))
|
||||
{
|
||||
if (is_array($permsgroupbyentity[$entity])) {
|
||||
if (in_array($obj->id, $permsgroupbyentity[$entity])) {
|
||||
// Own permission by group
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delrights&entity='.$entity.'&rights='.$obj->id.'">';
|
||||
//print img_edit_remove($langs->trans("Remove"));
|
||||
print img_picto($langs->trans("Remove"), 'switch_on');
|
||||
@ -333,8 +325,7 @@ if ($object->id > 0)
|
||||
print '</td>';
|
||||
} else {
|
||||
// Do not own permission
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'">';
|
||||
//print img_edit_add($langs->trans("Add"));
|
||||
print img_picto($langs->trans("Add"), 'switch_off');
|
||||
@ -344,8 +335,7 @@ if ($object->id > 0)
|
||||
}
|
||||
} else {
|
||||
// Do not own permission
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'">';
|
||||
//print img_edit_add($langs->trans("Add"));
|
||||
print img_picto($langs->trans("Add"), 'switch_off');
|
||||
@ -358,7 +348,9 @@ if ($object->id > 0)
|
||||
print '<td class="maxwidthonsmartphone">'.$permlabel.'</td>';
|
||||
|
||||
// Permission id
|
||||
if ($user->admin) print '<td class="right"><span class="opacitymedium">'.$obj->id.'</span></td>';
|
||||
if ($user->admin) {
|
||||
print '<td class="right"><span class="opacitymedium">'.$obj->id.'</span></td>';
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
@ -372,7 +364,9 @@ if ($object->id > 0)
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
@ -29,16 +29,18 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
||||
|
||||
if (!$user->rights->user->user->lire && !$user->admin)
|
||||
if (!$user->rights->user->user->lire && !$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array('users', 'companies'));
|
||||
|
||||
// Security check (for external users)
|
||||
$socid = 0;
|
||||
if ($user->socid > 0)
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$search_user = GETPOST('search_user', 'alpha');
|
||||
@ -49,10 +51,11 @@ $mode = GETPOST("mode", 'alpha');
|
||||
$userstatic = new User($db);
|
||||
$search_statut = GETPOST('search_statut', 'int');
|
||||
|
||||
if ($search_statut == '') $search_statut = '1';
|
||||
if ($search_statut == '') {
|
||||
$search_statut = '1';
|
||||
}
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
|
||||
$search_statut = "";
|
||||
}
|
||||
|
||||
@ -79,8 +82,7 @@ llxHeader('', $langs->trans("ListOfUsers").' - '.$langs->trans("HierarchicView")
|
||||
// Load hierarchy of users
|
||||
$user_arbo = $userstatic->get_full_tree(0, ($search_statut != '' && $search_statut >= 0) ? "statut = ".$search_statut : '');
|
||||
|
||||
if (!is_array($user_arbo) && $user_arbo < 0)
|
||||
{
|
||||
if (!is_array($user_arbo) && $user_arbo < 0) {
|
||||
setEventMessages($userstatic->error, $userstatic->errors, 'warnings');
|
||||
} else {
|
||||
// Define fulltree array
|
||||
@ -89,8 +91,7 @@ if (!is_array($user_arbo) && $user_arbo < 0)
|
||||
// Define data (format for treeview)
|
||||
$data = array();
|
||||
$data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>'');
|
||||
foreach ($fulltree as $key => $val)
|
||||
{
|
||||
foreach ($fulltree as $key => $val) {
|
||||
$userstatic->id = $val['id'];
|
||||
$userstatic->ref = $val['label'];
|
||||
$userstatic->login = $val['login'];
|
||||
@ -108,10 +109,8 @@ if (!is_array($user_arbo) && $user_arbo < 0)
|
||||
$entitystring = '';
|
||||
|
||||
// TODO Set of entitystring should be done with a hook
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc))
|
||||
{
|
||||
if (empty($entity))
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
|
||||
if (empty($entity)) {
|
||||
$entitystring = $langs->trans("AllEntities");
|
||||
} else {
|
||||
$mc->getInfo($entity);
|
||||
@ -120,11 +119,9 @@ if (!is_array($user_arbo) && $user_arbo < 0)
|
||||
}
|
||||
|
||||
$li = $userstatic->getNomUrl(-1, '', 0, 1);
|
||||
if (!empty($conf->multicompany->enabled) && $userstatic->admin && !$userstatic->entity)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $userstatic->admin && !$userstatic->entity) {
|
||||
$li .= img_picto($langs->trans("SuperAdministrator"), 'redstar');
|
||||
} elseif ($userstatic->admin)
|
||||
{
|
||||
} elseif ($userstatic->admin) {
|
||||
$li .= img_picto($langs->trans("Administrator"), 'star');
|
||||
}
|
||||
$li .= ' ('.$val['login'].($entitystring ? ' - '.$entitystring : '').')';
|
||||
@ -155,7 +152,9 @@ if (!is_array($user_arbo) && $user_arbo < 0)
|
||||
print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton, 'user');
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
@ -188,8 +187,7 @@ if (!is_array($user_arbo) && $user_arbo < 0)
|
||||
|
||||
$nbofentries = (count($data) - 1);
|
||||
|
||||
if ($nbofentries > 0)
|
||||
{
|
||||
if ($nbofentries > 0) {
|
||||
print '<tr><td colspan="3">';
|
||||
tree_recur($data, $data[0], 0);
|
||||
print '</td>';
|
||||
|
||||
@ -27,8 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userhome'; // To manage different context of search
|
||||
|
||||
if (!$user->rights->user->user->lire && !$user->admin)
|
||||
{
|
||||
if (!$user->rights->user->user->lire && !$user->admin) {
|
||||
// Redirection vers la page de l'utilisateur
|
||||
header("Location: card.php?id=".$user->id);
|
||||
exit;
|
||||
@ -38,14 +37,15 @@ if (!$user->rights->user->user->lire && !$user->admin)
|
||||
$langs->load("users");
|
||||
|
||||
$canreadperms = true;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$canreadperms = ($user->admin || $user->rights->user->group_advance->read);
|
||||
}
|
||||
|
||||
// Security check (for external users)
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
$fuserstatic = new User($db);
|
||||
@ -77,8 +77,7 @@ print '<tr><td>';
|
||||
print $langs->trans("User").':</td><td><input class="flat inputsearch" type="text" name="search_user" size="18"></td></tr>';
|
||||
|
||||
// Search Group
|
||||
if ($canreadperms)
|
||||
{
|
||||
if ($canreadperms) {
|
||||
print '<tr><td>';
|
||||
print $langs->trans("Group").':</td><td><input class="flat inputsearch" type="text" name="search_group" size="18"></td></tr>';
|
||||
}
|
||||
@ -115,13 +114,14 @@ if ($reshook > 0) {
|
||||
} else {
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
}
|
||||
if (!empty($socid)) $sql .= " AND u.fk_soc = ".$socid;
|
||||
if (!empty($socid)) {
|
||||
$sql .= " AND u.fk_soc = ".$socid;
|
||||
}
|
||||
$sql .= $db->order("u.datec", "DESC");
|
||||
$sql .= $db->plimit($max);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -131,8 +131,7 @@ if ($resql)
|
||||
print '</tr>'."\n";
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num && $i < $max)
|
||||
{
|
||||
while ($i < $num && $i < $max) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$fuserstatic->id = $obj->rowid;
|
||||
@ -153,34 +152,28 @@ if ($resql)
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowraponall">';
|
||||
print $fuserstatic->getNomUrl(-1);
|
||||
if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity)
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) {
|
||||
print img_picto($langs->trans("SuperAdministrator"), 'redstar');
|
||||
} elseif ($obj->admin)
|
||||
{
|
||||
} elseif ($obj->admin) {
|
||||
print img_picto($langs->trans("Administrator"), 'star');
|
||||
}
|
||||
print "</td>";
|
||||
print '<td>'.$obj->login.'</td>';
|
||||
print "<td>";
|
||||
if ($obj->fk_soc)
|
||||
{
|
||||
if ($obj->fk_soc) {
|
||||
print $companystatic->getNomUrl(1);
|
||||
} else {
|
||||
print $langs->trans("InternalUser");
|
||||
}
|
||||
if ($obj->ldap_sid)
|
||||
{
|
||||
if ($obj->ldap_sid) {
|
||||
print ' ('.$langs->trans("DomainUser").')';
|
||||
}
|
||||
|
||||
$entity = $obj->entity;
|
||||
$entitystring = '';
|
||||
// TODO Set of entitystring should be done with a hook
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc))
|
||||
{
|
||||
if (empty($entity))
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
|
||||
if (empty($entity)) {
|
||||
$entitystring = $langs->trans("AllEntities");
|
||||
} else {
|
||||
$mc->getInfo($entity);
|
||||
@ -210,14 +203,12 @@ if ($resql)
|
||||
/*
|
||||
* Last groups created
|
||||
*/
|
||||
if ($canreadperms)
|
||||
{
|
||||
if ($canreadperms) {
|
||||
$max = 5;
|
||||
|
||||
$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g";
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity)))
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity))) {
|
||||
$sql .= " WHERE g.entity IS NOT NULL";
|
||||
} else {
|
||||
$sql .= " WHERE g.entity IN (0,".$conf->entity.")";
|
||||
@ -226,10 +217,11 @@ if ($canreadperms)
|
||||
$sql .= $db->plimit($max);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$colspan = 1;
|
||||
if (!empty($conf->multicompany->enabled)) $colspan++;
|
||||
if (!empty($conf->multicompany->enabled)) {
|
||||
$colspan++;
|
||||
}
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -241,8 +233,7 @@ if ($canreadperms)
|
||||
|
||||
$grouptemp = new UserGroup($db);
|
||||
|
||||
while ($i < $num && (!$max || $i < $max))
|
||||
{
|
||||
while ($i < $num && (!$max || $i < $max)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$grouptemp->id = $obj->rowid;
|
||||
@ -252,13 +243,11 @@ if ($canreadperms)
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $grouptemp->getNomUrl(1);
|
||||
if (!$obj->entity)
|
||||
{
|
||||
if (!$obj->entity) {
|
||||
print img_picto($langs->trans("GlobalGroup"), 'redstar');
|
||||
}
|
||||
print "</td>";
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc))
|
||||
{
|
||||
if (!empty($conf->multicompany->enabled) && is_object($mc)) {
|
||||
$mc->getInfo($obj->entity);
|
||||
print '<td>';
|
||||
print $mc->label;
|
||||
|
||||
@ -33,22 +33,24 @@ $langs->load("users");
|
||||
// Security check
|
||||
$id = GETPOST('id', 'int');
|
||||
$object = new User($db);
|
||||
if ($id > 0 || !empty($ref))
|
||||
{
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$result = $object->fetch($id, $ref, '', 1);
|
||||
$object->getrights();
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
|
||||
// If user is not user that read and no permission to read other users, we stop
|
||||
if (($object->id != $user->id) && (!$user->rights->user->user->lire))
|
||||
accessforbidden();
|
||||
if (($object->id != $user->id) && (!$user->rights->user->user->lire)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -35,7 +35,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'use
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
@ -55,17 +57,16 @@ $hookmanager->initHooks(array('usercard', 'userldap', 'globalcard'));
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($_GET["action"] == 'dolibarr2ldap')
|
||||
{
|
||||
if (empty($reshook)) {
|
||||
if ($_GET["action"] == 'dolibarr2ldap') {
|
||||
$ldap = new Ldap();
|
||||
$result = $ldap->connect_bind();
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
$info = $object->_load_ldap_info();
|
||||
$dn = $object->_load_ldap_dn($info);
|
||||
$olddn = $dn; // We can say that old dn = dn as we force synchro
|
||||
@ -109,20 +110,17 @@ print '<table class="border centpercent">';
|
||||
|
||||
// Login
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
|
||||
if ($object->ldap_sid)
|
||||
{
|
||||
if ($object->ldap_sid) {
|
||||
print '<td class="warning">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
|
||||
} else {
|
||||
print '<td>'.$object->login.'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
if ($conf->global->LDAP_SERVER_TYPE == "activedirectory")
|
||||
{
|
||||
if ($conf->global->LDAP_SERVER_TYPE == "activedirectory") {
|
||||
$ldap = new Ldap();
|
||||
$result = $ldap->connect_bind();
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
$userSID = $ldap->getObjectSid($object->login);
|
||||
}
|
||||
print '<tr><td class="valigntop">'.$langs->trans("SID").'</td>';
|
||||
@ -155,14 +153,15 @@ print dol_get_fiche_end();
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "<br>\n";
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') {
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -179,8 +178,7 @@ print '</tr>';
|
||||
// Lecture LDAP
|
||||
$ldap = new Ldap();
|
||||
$result = $ldap->connect_bind();
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
$info = $object->_load_ldap_info();
|
||||
$dn = $object->_load_ldap_dn($info, 1);
|
||||
$search = "(".$object->_load_ldap_dn($info, 2).")";
|
||||
@ -190,10 +188,8 @@ if ($result > 0)
|
||||
//print_r($records);
|
||||
|
||||
// Affichage arbre
|
||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0))
|
||||
{
|
||||
if (!is_array($records))
|
||||
{
|
||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
||||
if (!is_array($records)) {
|
||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
|
||||
} else {
|
||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -24,17 +24,24 @@
|
||||
*/
|
||||
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Uncomment creates pb to relogon after a disconnect
|
||||
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
define('NOREQUIREMENU', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // We need company to get correct logo onto home page
|
||||
if (!defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) define('EVEN_IF_ONLY_LOGIN_ALLOWED', '1');
|
||||
if (!defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) {
|
||||
define('EVEN_IF_ONLY_LOGIN_ALLOWED', '1');
|
||||
}
|
||||
|
||||
require_once '../main.inc.php';
|
||||
|
||||
// This can happen only with a bookmark or forged url call.
|
||||
if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuser' || $_SESSION["dol_authmode"] == 'http'))
|
||||
{
|
||||
if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuser' || $_SESSION["dol_authmode"] == 'http')) {
|
||||
unset($_SESSION["dol_login"]);
|
||||
die("Applicative disconnection should be useless when connection was made in mode ".$_SESSION["dol_authmode"]);
|
||||
}
|
||||
@ -43,7 +50,9 @@ global $conf, $langs, $user;
|
||||
|
||||
// Call trigger
|
||||
$result = $user->call_trigger('USER_LOGOUT', $user);
|
||||
if ($result < 0) $error++;
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
// Hooks on logout
|
||||
@ -51,26 +60,41 @@ $action = '';
|
||||
$hookmanager->initHooks(array('logout'));
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('afterLogout', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) { $error++; }
|
||||
if ($reshook < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Define url to go after disconnect
|
||||
$urlfrom = empty($_SESSION["urlfrom"]) ? '' : $_SESSION["urlfrom"];
|
||||
|
||||
// Define url to go
|
||||
$url = DOL_URL_ROOT."/index.php"; // By default go to login page
|
||||
if ($urlfrom) $url = DOL_URL_ROOT.$urlfrom;
|
||||
if (!empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url = $conf->global->MAIN_LOGOUT_GOTO_URL;
|
||||
if ($urlfrom) {
|
||||
$url = DOL_URL_ROOT.$urlfrom;
|
||||
}
|
||||
if (!empty($conf->global->MAIN_LOGOUT_GOTO_URL)) {
|
||||
$url = $conf->global->MAIN_LOGOUT_GOTO_URL;
|
||||
}
|
||||
|
||||
if (GETPOST('dol_hide_topmenu')) $url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_hide_topmenu=1';
|
||||
if (GETPOST('dol_hide_leftmenu')) $url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_hide_leftmenu=1';
|
||||
if (GETPOST('dol_optimize_smallscreen')) $url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_optimize_smallscreen=1';
|
||||
if (GETPOST('dol_no_mouse_hover')) $url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_no_mouse_hover=1';
|
||||
if (GETPOST('dol_use_jmobile')) $url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_use_jmobile=1';
|
||||
if (GETPOST('dol_hide_topmenu')) {
|
||||
$url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_hide_topmenu=1';
|
||||
}
|
||||
if (GETPOST('dol_hide_leftmenu')) {
|
||||
$url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_hide_leftmenu=1';
|
||||
}
|
||||
if (GETPOST('dol_optimize_smallscreen')) {
|
||||
$url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_optimize_smallscreen=1';
|
||||
}
|
||||
if (GETPOST('dol_no_mouse_hover')) {
|
||||
$url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_no_mouse_hover=1';
|
||||
}
|
||||
if (GETPOST('dol_use_jmobile')) {
|
||||
$url .= (preg_match('/\?/', $url) ? '&' : '?').'dol_use_jmobile=1';
|
||||
}
|
||||
|
||||
// Destroy session
|
||||
dol_syslog("End of session ".session_id());
|
||||
if (session_status() === PHP_SESSION_ACTIVE)
|
||||
{
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
session_destroy();
|
||||
}
|
||||
|
||||
@ -80,5 +104,7 @@ unset($_SESSION['dol_login']);
|
||||
unset($_SESSION['dol_entity']);
|
||||
unset($_SESSION['urlfrom']);
|
||||
|
||||
if (GETPOST('noredirect')) return;
|
||||
if (GETPOST('noredirect')) {
|
||||
return;
|
||||
}
|
||||
header("Location: ".$url); // Default behaviour is redirect to index.php page
|
||||
|
||||
@ -39,11 +39,15 @@ $object->fetch($id, '', '', 1);
|
||||
$object->getrights();
|
||||
|
||||
// If user is not user read and no permission to read other users, we stop
|
||||
if (($object->id != $user->id) && (!$user->rights->user->user->lire)) accessforbidden();
|
||||
if (($object->id != $user->id) && (!$user->rights->user->user->lire)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
@ -58,7 +62,9 @@ $hookmanager->initHooks(array('usercard', 'usernote', 'globalcard'));
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($action == 'update' && $user->rights->user->user->creer && !$_POST["cancel"]) {
|
||||
@ -83,8 +89,7 @@ llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($id)
|
||||
{
|
||||
if ($id) {
|
||||
$head = user_prepare_head($object);
|
||||
|
||||
$title = $langs->trans("User");
|
||||
@ -114,8 +119,7 @@ if ($id)
|
||||
// Note
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Note").'</td>';
|
||||
print '<td class="'.($editenabled ? '' : 'sensiblehtmlcontent').'">';
|
||||
if ($editenabled)
|
||||
{
|
||||
if ($editenabled) {
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
print "<input type=\"hidden\" name=\"id\" value=\"".$object->id."\">";
|
||||
// Editeur wysiwyg
|
||||
@ -132,8 +136,7 @@ if ($id)
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($action == 'edit') {
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button button-save" name="update" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
@ -143,13 +146,12 @@ if ($id)
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
* Actions
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($user->rights->user->user->creer && $action != 'edit')
|
||||
{
|
||||
if ($user->rights->user->user->creer && $action != 'edit') {
|
||||
print "<a class=\"butAction\" href=\"note.php?id=".$object->id."&action=edit\">".$langs->trans('Modify')."</a>";
|
||||
}
|
||||
|
||||
|
||||
@ -39,16 +39,24 @@ $action = GETPOST('action', 'aZ09');
|
||||
$actionid = GETPOST('actionid');
|
||||
|
||||
// Security check
|
||||
if ($user->socid) $id = $user->socid;
|
||||
if ($user->socid) {
|
||||
$id = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'societe', '', '');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (!$sortorder) $sortorder = "DESC";
|
||||
if (!$sortfield) $sortfield = "n.daten";
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
if (!$sortorder) {
|
||||
$sortorder = "DESC";
|
||||
}
|
||||
if (!$sortfield) {
|
||||
$sortfield = "n.daten";
|
||||
}
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -61,29 +69,24 @@ $now = dol_now();
|
||||
*/
|
||||
|
||||
// Add a notification
|
||||
if ($action == 'add')
|
||||
{
|
||||
if ($action == 'add') {
|
||||
$error = 0;
|
||||
|
||||
if ($actionid <= 0)
|
||||
{
|
||||
if ($actionid <= 0) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||
$sql .= " WHERE fk_user=".$id." AND fk_action=".$actionid;
|
||||
if ($db->query($sql))
|
||||
{
|
||||
if ($db->query($sql)) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_user, fk_action)";
|
||||
$sql .= " VALUES ('".$db->idate($now)."',".$id.",".$actionid.")";
|
||||
|
||||
if (!$db->query($sql))
|
||||
{
|
||||
if (!$db->query($sql)) {
|
||||
$error++;
|
||||
dol_print_error($db);
|
||||
}
|
||||
@ -91,8 +94,7 @@ if ($action == 'add')
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
@ -101,8 +103,7 @@ if ($action == 'add')
|
||||
}
|
||||
|
||||
// Remove a notification
|
||||
if ($action == 'delete')
|
||||
{
|
||||
if ($action == 'delete') {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".GETPOST("actid", "int");
|
||||
$db->query($sql);
|
||||
}
|
||||
@ -120,13 +121,14 @@ $result = $object->fetch($id, '', '', 1);
|
||||
$object->getrights();
|
||||
|
||||
$title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.' - '.$langs->trans("Notification");
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->name.' - '.$langs->trans("Notification");
|
||||
}
|
||||
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result > 0) {
|
||||
$langs->load("other");
|
||||
|
||||
$head = user_prepare_head($object);
|
||||
@ -144,8 +146,7 @@ if ($result > 0)
|
||||
|
||||
// Login
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
|
||||
if (!empty($object->ldap_sid) && $object->statut == 0)
|
||||
{
|
||||
if (!empty($object->ldap_sid) && $object->statut == 0) {
|
||||
print '<td class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
|
||||
} else {
|
||||
print '<td>'.$object->login.'</td>';
|
||||
@ -153,16 +154,16 @@ if ($result > 0)
|
||||
print '</tr>'."\n";
|
||||
|
||||
/*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
|
||||
print '<td colspan="3">';
|
||||
$nbofrecipientemails=0;
|
||||
$notify=new Notify($db);
|
||||
$tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
|
||||
foreach($tmparray as $tmpkey => $tmpval)
|
||||
{
|
||||
$nbofrecipientemails++;
|
||||
}
|
||||
print $nbofrecipientemails;
|
||||
print '</td></tr>';*/
|
||||
print '<td colspan="3">';
|
||||
$nbofrecipientemails=0;
|
||||
$notify=new Notify($db);
|
||||
$tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
|
||||
foreach($tmparray as $tmpkey => $tmpval)
|
||||
{
|
||||
$nbofrecipientemails++;
|
||||
}
|
||||
print $nbofrecipientemails;
|
||||
print '</td></tr>';*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -203,23 +204,20 @@ if ($result > 0)
|
||||
|
||||
|
||||
// $listofemails=$object->thirdparty_and_contact_email_array();
|
||||
if ($object->email)
|
||||
{
|
||||
if ($object->email) {
|
||||
$actions = array();
|
||||
|
||||
// Load array of available notifications
|
||||
$notificationtrigger = new InterfaceNotification($db);
|
||||
$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
|
||||
|
||||
foreach ($listofnotifiedevents as $notifiedevent)
|
||||
{
|
||||
$label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
|
||||
foreach ($listofnotifiedevents as $notifiedevent) {
|
||||
$label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
|
||||
$actions[$notifiedevent['rowid']] = $label;
|
||||
}
|
||||
print '<tr class="oddeven nohover"><td>';
|
||||
print $object->getNomUrl(1);
|
||||
if (isValidEmail($object->email))
|
||||
{
|
||||
if (isValidEmail($object->email)) {
|
||||
print ' <'.$object->email.'>';
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
@ -258,8 +256,7 @@ if ($result > 0)
|
||||
$sql .= " AND c.rowid = ".$object->id;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
@ -280,24 +277,20 @@ if ($result > 0)
|
||||
$langs->load("errors");
|
||||
$langs->load("other");
|
||||
|
||||
if ($num)
|
||||
{
|
||||
if ($num) {
|
||||
$i = 0;
|
||||
|
||||
$userstatic = new user($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$userstatic->id = $obj->userid;
|
||||
$userstatic->lastname = $obj->lastname;
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
print '<tr class="oddeven"><td>'.$userstatic->getNomUrl(1);
|
||||
if ($obj->type == 'email')
|
||||
{
|
||||
if (isValidEmail($obj->email))
|
||||
{
|
||||
if ($obj->type == 'email') {
|
||||
if (isValidEmail($obj->email)) {
|
||||
print ' <'.$obj->email.'>';
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
@ -310,8 +303,12 @@ if ($result > 0)
|
||||
print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($obj->type == 'email') print $langs->trans("Email");
|
||||
if ($obj->type == 'sms') print $langs->trans("SMS");
|
||||
if ($obj->type == 'email') {
|
||||
print $langs->trans("Email");
|
||||
}
|
||||
if ($obj->type == 'sms') {
|
||||
print $langs->trans("SMS");
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
|
||||
print '</tr>';
|
||||
@ -322,8 +319,8 @@ if ($result > 0)
|
||||
|
||||
// List of notifications enabled for fixed email
|
||||
/*
|
||||
foreach($conf->global as $key => $val) {
|
||||
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
|
||||
foreach($conf->global as $key => $val) {
|
||||
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
|
||||
print '<tr class="oddeven"><td>';
|
||||
$listtmp=explode(',',$val);
|
||||
$first=1;
|
||||
@ -332,7 +329,7 @@ if ($result > 0)
|
||||
if (! $first) print ', ';
|
||||
$first=0;
|
||||
$valemail=trim($valemail);
|
||||
//print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
|
||||
//print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
|
||||
if (isValidEmail($valemail, 1))
|
||||
{
|
||||
if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
|
||||
@ -359,14 +356,14 @@ if ($result > 0)
|
||||
print '</td>';
|
||||
print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
|
||||
print '</tr>';
|
||||
}*/
|
||||
}*/
|
||||
/*if ($user->admin)
|
||||
{
|
||||
$var = ! $var;
|
||||
{
|
||||
$var = ! $var;
|
||||
print '<tr class="oddeven"><td colspan="4">';
|
||||
print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
|
||||
print '</td></tr>';
|
||||
}*/
|
||||
}*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -387,12 +384,10 @@ if ($result > 0)
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
{
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
@ -401,19 +396,24 @@ if ($result > 0)
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$param = '&id='.$object->id;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.$contextpage;
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.$limit;
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
@ -434,19 +434,16 @@ if ($result > 0)
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
print '</tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
if ($num) {
|
||||
$i = 0;
|
||||
|
||||
$userstatic = new User($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($obj->id > 0)
|
||||
{
|
||||
if ($obj->id > 0) {
|
||||
$userstatic->id = $obj->id;
|
||||
$userstatic->lastname = $obj->lastname;
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
@ -461,18 +458,22 @@ if ($result > 0)
|
||||
print $label;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($obj->type == 'email') print $langs->trans("Email");
|
||||
if ($obj->type == 'sms') print $langs->trans("Sms");
|
||||
if ($obj->type == 'email') {
|
||||
print $langs->trans("Email");
|
||||
}
|
||||
if ($obj->type == 'sms') {
|
||||
print $langs->trans("Sms");
|
||||
}
|
||||
print '</td>';
|
||||
// TODO Add link to object here for other types
|
||||
/*print '<td>';
|
||||
if ($obj->object_type == 'order')
|
||||
{
|
||||
if ($obj->object_type == 'order')
|
||||
{
|
||||
$orderstatic->id=$obj->object_id;
|
||||
$orderstatic->ref=...
|
||||
print $orderstatic->getNomUrl(1);
|
||||
}
|
||||
print '</td>';*/
|
||||
}
|
||||
print '</td>';*/
|
||||
// print
|
||||
print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
@ -486,7 +487,9 @@ if ($result > 0)
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
} else dol_print_error('', 'RecordNotFound');
|
||||
} else {
|
||||
dol_print_error('', 'RecordNotFound');
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@ -38,8 +38,7 @@ $id = GETPOST('id', 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userihm'; // To manage different context of search
|
||||
|
||||
if ($id)
|
||||
{
|
||||
if ($id) {
|
||||
// $user est le user qui edite, $id est l'id de l'utilisateur edite
|
||||
$caneditfield = ((($user->id == $id) && $user->rights->user->self->creer)
|
||||
|| (($user->id != $id) && $user->rights->user->user->creer));
|
||||
@ -47,11 +46,15 @@ if ($id)
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
if ($user->id <> $id && !$canreaduser) accessforbidden();
|
||||
if ($user->id <> $id && !$canreaduser) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$dirtop = "../core/menus/standard";
|
||||
$dirleft = "../core/menus/standard";
|
||||
@ -81,7 +84,9 @@ $hookmanager->initHooks(array('usercard', 'userihm', 'globalcard'));
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($action == 'update' && ($caneditfield || !empty($user->admin))) {
|
||||
@ -122,16 +127,20 @@ if (empty($reshook)) {
|
||||
if ($val == '') {
|
||||
$tabparam['THEME_ELDY_TOPMENU_BACK1'] = '';
|
||||
} else {
|
||||
$tabparam['THEME_ELDY_TOPMENU_BACK1'] = join(',',
|
||||
colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array()));
|
||||
$tabparam['THEME_ELDY_TOPMENU_BACK1'] = join(
|
||||
',',
|
||||
colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array())
|
||||
);
|
||||
}
|
||||
|
||||
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array()))));
|
||||
if ($val == '') {
|
||||
$tabparam['THEME_ELDY_BACKTITLE1'] = '';
|
||||
} else {
|
||||
$tabparam['THEME_ELDY_BACKTITLE1'] = join(',',
|
||||
colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array()));
|
||||
$tabparam['THEME_ELDY_BACKTITLE1'] = join(
|
||||
',',
|
||||
colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array())
|
||||
);
|
||||
}
|
||||
|
||||
if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') {
|
||||
@ -174,21 +183,36 @@ llxHeader();
|
||||
|
||||
// List of possible landing pages
|
||||
$tmparray = array('index.php'=>'Dashboard');
|
||||
if (!empty($conf->societe->enabled)) $tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea';
|
||||
if (!empty($conf->projet->enabled)) $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
|
||||
if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
|
||||
if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
|
||||
if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) $tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea';
|
||||
if (!empty($conf->adherent->enabled)) $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
|
||||
if (!empty($conf->agenda->enabled)) $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
$tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea';
|
||||
}
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
|
||||
}
|
||||
if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) {
|
||||
$tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
|
||||
}
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
$tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
|
||||
}
|
||||
if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) {
|
||||
$tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
|
||||
}
|
||||
if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) {
|
||||
$tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea';
|
||||
}
|
||||
if (!empty($conf->adherent->enabled)) {
|
||||
$tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
|
||||
}
|
||||
if (!empty($conf->agenda->enabled)) {
|
||||
$tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
|
||||
}
|
||||
|
||||
$head = user_prepare_head($object);
|
||||
|
||||
$title = $langs->trans("User");
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($action == 'edit') {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
@ -196,8 +220,7 @@ if ($action == 'edit')
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($action == 'edit') {
|
||||
print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
|
||||
|
||||
$linkback = '';
|
||||
@ -208,22 +231,20 @@ if ($action == 'edit')
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
|
||||
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
{/*
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
$("#main_lang_default").change(function() {
|
||||
$("#check_MAIN_LANG_DEFAULT").prop("checked", true);
|
||||
});
|
||||
$("#main_size_liste_limit").keyup(function() {
|
||||
if ($(this).val().length) $("#check_SIZE_LISTE_LIMIT").prop("checked", true);
|
||||
else $("#check_SIZE_LISTE_LIMIT").prop("checked", false);
|
||||
});
|
||||
});
|
||||
</script>';*/
|
||||
if (!empty($conf->use_javascript_ajax)) {/*
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
$("#main_lang_default").change(function() {
|
||||
$("#check_MAIN_LANG_DEFAULT").prop("checked", true);
|
||||
});
|
||||
$("#main_size_liste_limit").keyup(function() {
|
||||
if ($(this).val().length) $("#check_SIZE_LISTE_LIMIT").prop("checked", true);
|
||||
else $("#check_SIZE_LISTE_LIMIT").prop("checked", false);
|
||||
});
|
||||
});
|
||||
</script>';*/
|
||||
}
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
{
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
@ -357,10 +378,11 @@ if ($action == 'edit')
|
||||
print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
|
||||
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
||||
print '<td>';
|
||||
if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE]))
|
||||
{
|
||||
if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
|
||||
print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
|
||||
} else print $object->conf->MAIN_LANDING_PAGE;
|
||||
} else {
|
||||
print $object->conf->MAIN_LANDING_PAGE;
|
||||
}
|
||||
//print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -371,7 +393,9 @@ if ($action == 'edit')
|
||||
print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||
print '<td>'."\n";
|
||||
$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
||||
if (!empty($object->conf->AGENDA_DEFAULT_VIEW)) print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
|
||||
if (!empty($object->conf->AGENDA_DEFAULT_VIEW)) {
|
||||
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Max size for lists
|
||||
@ -390,12 +414,10 @@ if ($action == 'edit')
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
if (empty($user->admin) && !empty($dolibarr_main_demo))
|
||||
{
|
||||
if (empty($user->admin) && !empty($dolibarr_main_demo)) {
|
||||
print "<a class=\"butActionRefused classfortooltip\" title=\"".$langs->trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify")."</a>";
|
||||
} else {
|
||||
if ($caneditfield || !empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin
|
||||
{
|
||||
if ($caneditfield || !empty($user->admin)) { // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
|
||||
} else {
|
||||
print "<a class=\"butActionRefused classfortooltip\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify")."</a>";
|
||||
@ -405,8 +427,7 @@ if ($action == 'edit')
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
if ($action == 'edit') {
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -29,21 +29,24 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
if (!empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||
if (!empty($conf->ldap->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array('errors', 'users', 'companies', 'ldap', 'other'));
|
||||
|
||||
// Security check
|
||||
if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) {
|
||||
header("Location: ".DOL_URL_ROOT.'/');
|
||||
exit;
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$mode = $dolibarr_main_authentication;
|
||||
if (!$mode) $mode = 'http';
|
||||
if (!$mode) {
|
||||
$mode = 'http';
|
||||
}
|
||||
|
||||
$username = GETPOST('username', 'alphanohtml');
|
||||
$passwordhash = GETPOST('passwordhash', 'alpha');
|
||||
@ -53,11 +56,21 @@ $conf->entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : 1);
|
||||
$hookmanager->initHooks(array('passwordforgottenpage'));
|
||||
|
||||
|
||||
if (GETPOST('dol_hide_leftmenu', 'alpha') || !empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu = 1;
|
||||
if (GETPOST('dol_hide_topmenu', 'alpha') || !empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu = 1;
|
||||
if (GETPOST('dol_optimize_smallscreen', 'alpha') || !empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen = 1;
|
||||
if (GETPOST('dol_no_mouse_hover', 'alpha') || !empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover = 1;
|
||||
if (GETPOST('dol_use_jmobile', 'alpha') || !empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile = 1;
|
||||
if (GETPOST('dol_hide_leftmenu', 'alpha') || !empty($_SESSION['dol_hide_leftmenu'])) {
|
||||
$conf->dol_hide_leftmenu = 1;
|
||||
}
|
||||
if (GETPOST('dol_hide_topmenu', 'alpha') || !empty($_SESSION['dol_hide_topmenu'])) {
|
||||
$conf->dol_hide_topmenu = 1;
|
||||
}
|
||||
if (GETPOST('dol_optimize_smallscreen', 'alpha') || !empty($_SESSION['dol_optimize_smallscreen'])) {
|
||||
$conf->dol_optimize_smallscreen = 1;
|
||||
}
|
||||
if (GETPOST('dol_no_mouse_hover', 'alpha') || !empty($_SESSION['dol_no_mouse_hover'])) {
|
||||
$conf->dol_no_mouse_hover = 1;
|
||||
}
|
||||
if (GETPOST('dol_use_jmobile', 'alpha') || !empty($_SESSION['dol_use_jmobile'])) {
|
||||
$conf->dol_use_jmobile = 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -67,96 +80,86 @@ if (GETPOST('dol_use_jmobile', 'alpha') || !empty($_SESSION['dol_use_jmobile']))
|
||||
$parameters = array('username' => $username);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$message = $hookmanager->error;
|
||||
$message = $hookmanager->error;
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Validate new password
|
||||
if ($action == 'validatenewpassword' && $username && $passwordhash)
|
||||
{
|
||||
$edituser = new User($db);
|
||||
$result = $edituser->fetch('', $_GET["username"]);
|
||||
if ($result < 0)
|
||||
{
|
||||
$message = '<div class="error">'.dol_escape_htmltag($langs->trans("ErrorLoginDoesNotExists", $username)).'</div>';
|
||||
} else {
|
||||
if (dol_verifyHash($edituser->pass_temp, $passwordhash))
|
||||
{
|
||||
// Clear session
|
||||
unset($_SESSION['dol_login']);
|
||||
$_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page
|
||||
// Validate new password
|
||||
if ($action == 'validatenewpassword' && $username && $passwordhash) {
|
||||
$edituser = new User($db);
|
||||
$result = $edituser->fetch('', $_GET["username"]);
|
||||
if ($result < 0) {
|
||||
$message = '<div class="error">'.dol_escape_htmltag($langs->trans("ErrorLoginDoesNotExists", $username)).'</div>';
|
||||
} else {
|
||||
if (dol_verifyHash($edituser->pass_temp, $passwordhash)) {
|
||||
// Clear session
|
||||
unset($_SESSION['dol_login']);
|
||||
$_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page
|
||||
|
||||
$newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0);
|
||||
dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database");
|
||||
header("Location: ".DOL_URL_ROOT.'/');
|
||||
exit;
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Action modif mot de passe
|
||||
if ($action == 'buildnewpassword' && $username)
|
||||
{
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||
$newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0);
|
||||
dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database");
|
||||
header("Location: ".DOL_URL_ROOT.'/');
|
||||
exit;
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Action modif mot de passe
|
||||
if ($action == 'buildnewpassword' && $username) {
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||
|
||||
// Verify code
|
||||
if (!$ok)
|
||||
{
|
||||
$message = '<div class="error">'.$langs->trans("ErrorBadValueForCode").'</div>';
|
||||
} else {
|
||||
$isanemail = preg_match('/@/', $username);
|
||||
// Verify code
|
||||
if (!$ok) {
|
||||
$message = '<div class="error">'.$langs->trans("ErrorBadValueForCode").'</div>';
|
||||
} else {
|
||||
$isanemail = preg_match('/@/', $username);
|
||||
|
||||
$edituser = new User($db);
|
||||
$result = $edituser->fetch('', $username, '', 1);
|
||||
if ($result == 0 && $isanemail)
|
||||
{
|
||||
$result = $edituser->fetch('', '', '', 1, -1, $username);
|
||||
}
|
||||
$edituser = new User($db);
|
||||
$result = $edituser->fetch('', $username, '', 1);
|
||||
if ($result == 0 && $isanemail) {
|
||||
$result = $edituser->fetch('', '', '', 1, -1, $username);
|
||||
}
|
||||
|
||||
if ($result <= 0 && $edituser->error == 'USERNOTFOUND')
|
||||
{
|
||||
$message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">';
|
||||
if (!$isanemail) {
|
||||
$message .= $langs->trans("IfLoginExistPasswordRequestSent");
|
||||
} else {
|
||||
$message .= $langs->trans("IfEmailExistPasswordRequestSent");
|
||||
}
|
||||
$message .= '</div>';
|
||||
$username = '';
|
||||
} else {
|
||||
if (!$edituser->email)
|
||||
{
|
||||
$message = '<div class="error">'.$langs->trans("ErrorLoginHasNoEmail").'</div>';
|
||||
} else {
|
||||
$newpassword = $edituser->setPassword($user, '', 1);
|
||||
if ($newpassword < 0)
|
||||
{
|
||||
// Failed
|
||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToChangePassword").'</div>';
|
||||
} else {
|
||||
// Success
|
||||
if ($edituser->send_password($user, $newpassword, 1) > 0)
|
||||
{
|
||||
$message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">';
|
||||
if (!$isanemail) {
|
||||
$message .= $langs->trans("IfLoginExistPasswordRequestSent");
|
||||
} else {
|
||||
$message .= $langs->trans("IfEmailExistPasswordRequestSent");
|
||||
}
|
||||
//$message .= $langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email));
|
||||
$message .= '</div>';
|
||||
$username = '';
|
||||
} else {
|
||||
$message .= '<div class="error">'.$edituser->error.'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($result <= 0 && $edituser->error == 'USERNOTFOUND') {
|
||||
$message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">';
|
||||
if (!$isanemail) {
|
||||
$message .= $langs->trans("IfLoginExistPasswordRequestSent");
|
||||
} else {
|
||||
$message .= $langs->trans("IfEmailExistPasswordRequestSent");
|
||||
}
|
||||
$message .= '</div>';
|
||||
$username = '';
|
||||
} else {
|
||||
if (!$edituser->email) {
|
||||
$message = '<div class="error">'.$langs->trans("ErrorLoginHasNoEmail").'</div>';
|
||||
} else {
|
||||
$newpassword = $edituser->setPassword($user, '', 1);
|
||||
if ($newpassword < 0) {
|
||||
// Failed
|
||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToChangePassword").'</div>';
|
||||
} else {
|
||||
// Success
|
||||
if ($edituser->send_password($user, $newpassword, 1) > 0) {
|
||||
$message = '<div class="warning paddingtopbottom'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">';
|
||||
if (!$isanemail) {
|
||||
$message .= $langs->trans("IfLoginExistPasswordRequestSent");
|
||||
} else {
|
||||
$message .= $langs->trans("IfEmailExistPasswordRequestSent");
|
||||
}
|
||||
//$message .= $langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email));
|
||||
$message .= '</div>';
|
||||
$username = '';
|
||||
} else {
|
||||
$message .= '<div class="error">'.$edituser->error.'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -168,46 +171,49 @@ $dol_url_root = DOL_URL_ROOT;
|
||||
|
||||
// Title
|
||||
$title = 'Dolibarr '.DOL_VERSION;
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
$title = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
}
|
||||
|
||||
// Select templates
|
||||
if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php"))
|
||||
{
|
||||
if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php")) {
|
||||
$template_dir = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/";
|
||||
} else {
|
||||
$template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
|
||||
}
|
||||
|
||||
if (!$username) $focus_element = 'username';
|
||||
else $focus_element = 'password';
|
||||
if (!$username) {
|
||||
$focus_element = 'username';
|
||||
} else {
|
||||
$focus_element = 'password';
|
||||
}
|
||||
|
||||
// Send password button enabled ?
|
||||
$disabled = 'disabled';
|
||||
if (preg_match('/dolibarr/i', $mode)) $disabled = '';
|
||||
if (!empty($conf->global->MAIN_SECURITY_ENABLE_SENDPASSWORD)) $disabled = ''; // To force button enabled
|
||||
if (preg_match('/dolibarr/i', $mode)) {
|
||||
$disabled = '';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_SECURITY_ENABLE_SENDPASSWORD)) {
|
||||
$disabled = ''; // To force button enabled
|
||||
}
|
||||
|
||||
// Show logo (search in order: small company logo, large company logo, theme logo, common logo)
|
||||
$width = 0;
|
||||
$rowspan = 2;
|
||||
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
|
||||
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
|
||||
{
|
||||
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
|
||||
} elseif (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))
|
||||
{
|
||||
} elseif (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo);
|
||||
$width = 128;
|
||||
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg'))
|
||||
{
|
||||
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg')) {
|
||||
$urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg';
|
||||
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg'))
|
||||
{
|
||||
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
|
||||
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
|
||||
}
|
||||
|
||||
// Security graphical code
|
||||
if (function_exists("imagecreatefrompng") && !$disabled)
|
||||
{
|
||||
if (function_exists("imagecreatefrompng") && !$disabled) {
|
||||
$captcha = 1;
|
||||
$captcha_refresh = img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"');
|
||||
}
|
||||
|
||||
@ -26,7 +26,9 @@
|
||||
* \brief Page to set permission of a user record
|
||||
*/
|
||||
|
||||
if (!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
|
||||
if (!defined('CSRFCHECK_WITH_TOKEN')) {
|
||||
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
|
||||
}
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||
@ -43,15 +45,16 @@ $module = GETPOST('module', 'alpha');
|
||||
$rights = GETPOST('rights', 'int');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userperms'; // To manage different context of search
|
||||
|
||||
if (!isset($id) || empty($id)) accessforbidden();
|
||||
if (!isset($id) || empty($id)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Define if user can read permissions
|
||||
$canreaduser = ($user->admin || $user->rights->user->user->lire);
|
||||
// Define if user can modify other users and permissions
|
||||
$caneditperms = ($user->admin || $user->rights->user->user->creer);
|
||||
// Advanced permissions
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$canreaduser = ($user->admin || ($user->rights->user->user->lire && $user->rights->user->user_advance->readperms));
|
||||
$caneditselfperms = ($user->id == $id && $user->rights->user->self_advance->writeperms);
|
||||
$caneditperms = (($caneditperms || $caneditselfperms) ? 1 : 0);
|
||||
@ -59,16 +62,19 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if (isset($user->socid) && $user->socid > 0) $socid = $user->socid;
|
||||
if (isset($user->socid) && $user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
||||
// A user can always read its own card if not advanced perms enabled, or if he has advanced perms, except for admin
|
||||
if ($user->id == $id && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms) && empty($user->admin)))
|
||||
{
|
||||
if ($user->id == $id && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms) && empty($user->admin))) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
if ($user->id <> $id && !$canreaduser) accessforbidden();
|
||||
if ($user->id <> $id && !$canreaduser) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$object = new User($db);
|
||||
$object->fetch($id, '', '', 1);
|
||||
@ -86,15 +92,16 @@ $hookmanager->initHooks(array('usercard', 'userperms', 'globalcard'));
|
||||
|
||||
$parameters = array('id'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($action == 'addrights' && $caneditperms && $confirm == 'yes') {
|
||||
$edituser = new User($db);
|
||||
$edituser->fetch($object->id);
|
||||
$result = $edituser->addrights($rights, $module, '', $entity);
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
setEventMessages($edituser->error, $edituser->errors, 'errors');
|
||||
}
|
||||
|
||||
@ -113,8 +120,7 @@ if (empty($reshook)) {
|
||||
$edituser = new User($db);
|
||||
$edituser->fetch($object->id);
|
||||
$result = $edituser->delrights($rights, $module, '', $entity);
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
setEventMessages($edituser->error, $edituser->errors, 'errors');
|
||||
}
|
||||
|
||||
@ -151,33 +157,25 @@ $db->begin();
|
||||
$modules = array();
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
foreach ($modulesdir as $dir) {
|
||||
$handle = @opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle)) !== false)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
||||
{
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
if ($modName) {
|
||||
include_once $dir.$file;
|
||||
$objMod = new $modName($db);
|
||||
|
||||
// Load all lang files of module
|
||||
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
||||
{
|
||||
foreach ($objMod->langfiles as $domain)
|
||||
{
|
||||
if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
|
||||
foreach ($objMod->langfiles as $domain) {
|
||||
$langs->load($domain);
|
||||
}
|
||||
}
|
||||
// Load all permissions
|
||||
if ($objMod->rights_class)
|
||||
{
|
||||
if ($objMod->rights_class) {
|
||||
$ret = $objMod->insert_permissions(0, $entity);
|
||||
$modules[$objMod->rights_class] = $objMod;
|
||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||
@ -200,12 +198,10 @@ $sql .= " AND ur.fk_user = ".$object->id;
|
||||
|
||||
dol_syslog("get user perms", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
array_push($permsuser, $obj->fk_id);
|
||||
$i++;
|
||||
@ -227,15 +223,14 @@ $sql .= " AND gu.fk_user = ".$object->id;
|
||||
|
||||
dol_syslog("get user perms", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
if (!isset($permsgroupbyentity[$obj->entity]))
|
||||
if (!isset($permsgroupbyentity[$obj->entity])) {
|
||||
$permsgroupbyentity[$obj->entity] = array();
|
||||
}
|
||||
array_push($permsgroupbyentity[$obj->entity], $obj->fk_id);
|
||||
$i++;
|
||||
}
|
||||
@ -260,13 +255,19 @@ dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $use
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
|
||||
}
|
||||
// Show warning about external users
|
||||
if (empty($user->socid)) print info_admin(showModulesExludedForExternal($modules))."\n";
|
||||
if (empty($user->socid)) {
|
||||
print info_admin(showModulesExludedForExternal($modules))."\n";
|
||||
}
|
||||
|
||||
$parameters = array('permsgroupbyentity'=>$permsgroupbyentity);
|
||||
$reshook = $hookmanager->executeHooks('insertExtraHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
print "\n";
|
||||
@ -275,10 +276,8 @@ print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Module").'</td>';
|
||||
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin))
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
|
||||
if ($caneditperms) {
|
||||
print '<td class="center nowrap">';
|
||||
print '<a class="reposition commonlink" title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&module=allmodules&confirm=yes&token='.newToken().'">'.$langs->trans("All")."</a>";
|
||||
print ' / ';
|
||||
@ -288,7 +287,9 @@ if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->ad
|
||||
print '<td class="center" width="24"> </td>';
|
||||
}
|
||||
print '<td>'.$langs->trans("Permissions").'</td>';
|
||||
if ($user->admin) print '<td class="right">'.$langs->trans("ID").'</td>';
|
||||
if ($user->admin) {
|
||||
print '<td class="right">'.$langs->trans("ID").'</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
//print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS;
|
||||
@ -296,32 +297,29 @@ $sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
|
||||
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
|
||||
$sql .= " AND r.entity = ".$entity;
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
|
||||
}
|
||||
$sql .= " ORDER BY r.family_position, r.module_position, r.module, r.id";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$oldmod = '';
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
// If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it
|
||||
if (empty($modules[$obj->module]))
|
||||
{
|
||||
if (empty($modules[$obj->module])) {
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Save field module_position in database if value is still zero
|
||||
if (empty($obj->module_position))
|
||||
{
|
||||
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0))
|
||||
{
|
||||
if (empty($obj->module_position)) {
|
||||
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) {
|
||||
// TODO Define familyposition
|
||||
$family = $modules[$obj->module]->family_position;
|
||||
$familyposition = 0;
|
||||
@ -332,8 +330,7 @@ if ($result)
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($obj->module) && ($oldmod <> $obj->module))
|
||||
{
|
||||
if (isset($obj->module) && ($oldmod <> $obj->module)) {
|
||||
$oldmod = $obj->module;
|
||||
|
||||
// Break detected, we get objMod
|
||||
@ -346,10 +343,8 @@ if ($result)
|
||||
print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName();
|
||||
print '<a name="'.$objMod->getName().'"></a>';
|
||||
print '</td>';
|
||||
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin))
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
|
||||
if ($caneditperms) {
|
||||
print '<td class="center nowrap">';
|
||||
print '<a class="reposition" title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&module='.$obj->module.'&confirm=yes&token='.newToken().'">'.$langs->trans("All")."</a>";
|
||||
print ' / ';
|
||||
@ -358,8 +353,7 @@ if ($result)
|
||||
}
|
||||
print '<td> </td>';
|
||||
} else {
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td> </td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
@ -367,7 +361,9 @@ if ($result)
|
||||
print '<td> </td>';
|
||||
|
||||
// Permission id
|
||||
if ($user->admin) print '<td class="right"></td>';
|
||||
if ($user->admin) {
|
||||
print '<td class="right"></td>';
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
@ -381,19 +377,15 @@ if ($result)
|
||||
print '</td>';
|
||||
|
||||
// Permission and tick
|
||||
if (!empty($object->admin) && !empty($objMod->rights_admin_allowed)) // Permission granted because admin
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if (!empty($object->admin) && !empty($objMod->rights_admin_allowed)) { // Permission granted because admin
|
||||
if ($caneditperms) {
|
||||
print '<td class="center">'.img_picto($langs->trans("Administrator"), 'star').'</td>';
|
||||
}
|
||||
print '<td class="center nowrap">';
|
||||
print img_picto($langs->trans("Active"), 'tick');
|
||||
print '</td>';
|
||||
} elseif (in_array($obj->id, $permsuser)) // Permission granted by user
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
} elseif (in_array($obj->id, $permsuser)) { // Permission granted by user
|
||||
if ($caneditperms) {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
|
||||
//print img_edit_remove($langs->trans("Remove"));
|
||||
print img_picto($langs->trans("Remove"), 'switch_on');
|
||||
@ -402,12 +394,9 @@ if ($result)
|
||||
print '<td class="center nowrap">';
|
||||
print img_picto($langs->trans("Active"), 'tick');
|
||||
print '</td>';
|
||||
} elseif (is_array($permsgroupbyentity[$entity]))
|
||||
{
|
||||
if (in_array($obj->id, $permsgroupbyentity[$entity])) // Permission granted by group
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
} elseif (is_array($permsgroupbyentity[$entity])) {
|
||||
if (in_array($obj->id, $permsgroupbyentity[$entity])) { // Permission granted by group
|
||||
if ($caneditperms) {
|
||||
print '<td class="center">';
|
||||
print $form->textwithtooltip($langs->trans("Inherited"), $langs->trans("PermissionInheritedFromAGroup"));
|
||||
print '</td>';
|
||||
@ -417,8 +406,7 @@ if ($result)
|
||||
print '</td>';
|
||||
} else {
|
||||
// Do not own permission
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
|
||||
//print img_edit_add($langs->trans("Add"));
|
||||
print img_picto($langs->trans("Add"), 'switch_off');
|
||||
@ -428,8 +416,7 @@ if ($result)
|
||||
}
|
||||
} else {
|
||||
// Do not own permission
|
||||
if ($caneditperms)
|
||||
{
|
||||
if ($caneditperms) {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
|
||||
//print img_edit_add($langs->trans("Add"));
|
||||
print img_picto($langs->trans("Add"), 'switch_off');
|
||||
@ -450,19 +437,25 @@ if ($result)
|
||||
print '</td>';
|
||||
|
||||
// Permission id
|
||||
if ($user->admin) print '<td class="right"><span class="opacitymedium">'.$obj->id.'</span></td>';
|
||||
if ($user->admin) {
|
||||
print '<td class="right"><span class="opacitymedium">'.$obj->id.'</span></td>';
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
} else dol_print_error($db);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -36,14 +36,15 @@ $id = GETPOST('id', 'int');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) $socid = $user->socid;
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$feature2 = 'user';
|
||||
$result = restrictedArea($user, 'user', $id, 'user', $feature2);
|
||||
|
||||
|
||||
$result = $user2->fetch($id);
|
||||
if ($result <= 0)
|
||||
{
|
||||
if ($result <= 0) {
|
||||
dol_print_error($user2->error);
|
||||
exit;
|
||||
}
|
||||
@ -51,8 +52,7 @@ if ($result <= 0)
|
||||
$physicalperson = 1;
|
||||
|
||||
$company = new Societe($db);
|
||||
if ($user2->socid)
|
||||
{
|
||||
if ($user2->socid) {
|
||||
$result = $company->fetch($user2->socid);
|
||||
}
|
||||
|
||||
@ -79,33 +79,32 @@ $v->setNote($user2->note);
|
||||
$v->setTitle($user2->poste);
|
||||
|
||||
// Data from linked company
|
||||
if ($company->id)
|
||||
{
|
||||
if ($company->id) {
|
||||
$v->setURL($company->url, "TYPE=WORK");
|
||||
if (!$user2->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
|
||||
if (!$user2->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
|
||||
if (!$user2->zip) $v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL");
|
||||
if (!$user2->phone_pro) {
|
||||
$v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
|
||||
}
|
||||
if (!$user2->fax) {
|
||||
$v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
|
||||
}
|
||||
if (!$user2->zip) {
|
||||
$v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL");
|
||||
}
|
||||
|
||||
// when company e-mail is empty, use only user e-mail
|
||||
if (empty(trim($company->email)))
|
||||
{
|
||||
if (empty(trim($company->email))) {
|
||||
// was set before, don't set twice
|
||||
}
|
||||
// when user e-mail is empty, use only company e-mail
|
||||
elseif (empty(trim($user2->email)))
|
||||
{
|
||||
} elseif (empty(trim($user2->email))) {
|
||||
// when user e-mail is empty, use only company e-mail
|
||||
$v->setEmail($company->email);
|
||||
}
|
||||
// when e-mail domain of user and company are the same, use user e-mail at first (and company e-mail at second)
|
||||
elseif (strtolower(end(explode("@", $user2->email))) == strtolower(end(explode("@", $company->email))))
|
||||
{
|
||||
} elseif (strtolower(end(explode("@", $user2->email))) == strtolower(end(explode("@", $company->email)))) {
|
||||
// when e-mail domain of user and company are the same, use user e-mail at first (and company e-mail at second)
|
||||
$v->setEmail($user2->email);
|
||||
|
||||
// support by Microsoft Outlook (2019 and possible earlier)
|
||||
$v->setEmail($company->email, 'INTERNET');
|
||||
}
|
||||
// when e-mail of user and company complete different use company e-mail at first (and user e-mail at second)
|
||||
else {
|
||||
} else {
|
||||
// when e-mail of user and company complete different use company e-mail at first (and user e-mail at second)
|
||||
$v->setEmail($company->email);
|
||||
|
||||
// support by Microsoft Outlook (2019 and possible earlier)
|
||||
@ -113,12 +112,16 @@ if ($company->id)
|
||||
}
|
||||
|
||||
// Si user lie a un tiers non de type "particulier"
|
||||
if ($user2->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);
|
||||
if ($user2->typent_code != 'TE_PRIVATE') {
|
||||
$v->setOrg($company->name);
|
||||
}
|
||||
}
|
||||
|
||||
// Personal informations
|
||||
$v->setPhoneNumber($user2->phone_perso, "TYPE=HOME;VOICE");
|
||||
if ($user2->birth) $v->setBirthday($user2->birth);
|
||||
if ($user2->birth) {
|
||||
$v->setBirthday($user2->birth);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -488,6 +488,8 @@ class ProductCombination
|
||||
|
||||
$child->price_autogen = $parent->price_autogen;
|
||||
$child->weight = $parent->weight;
|
||||
$child->status = $parent->status;
|
||||
|
||||
if ($this->variation_weight) { // If we must add a delta on weight
|
||||
$child->weight = ($child->weight ? $child->weight : 0) + $this->variation_weight;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user