NEW: Link on user in leave context reach to leave tab.

This commit is contained in:
Laurent Destailleur 2016-05-19 13:25:16 +02:00
parent fd38db388a
commit 9c3b9a8494
11 changed files with 84 additions and 35 deletions

View File

@ -441,8 +441,14 @@ function actions_prepare_head($object)
// Tab to link resources
if ($conf->resource->enabled)
{
include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
$resource=new DolResource($db);
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id;
$listofresourcelinked = $resource->getElementResources($object->element, $object->id);
$nbResources=count($listofresourcelinked);
$head[$h][1] = $langs->trans("Resources");
if ($nbResources > 0) $head[$h][1].= ' <span class="badge">'.($nbResources).'</span>';
$head[$h][2] = 'resources';
$h++;
}

View File

@ -128,7 +128,7 @@ function print_start_menu_entry_auguria($idsel,$classname,$showmode)
if ($showmode)
{
print '<li '.$classname.' id="mainmenutd_'.$idsel.'">';
print '<div class="tmenuleft"></div><div class="tmenucenter">';
print '<div class="tmenuleft tmenusep"></div><div class="tmenucenter">';
}
}

View File

@ -358,7 +358,7 @@ function print_start_menu_entry($idsel,$classname,$showmode)
if ($showmode)
{
print '<li '.$classname.' id="mainmenutd_'.$idsel.'">';
print '<div class="tmenuleft"></div><div class="tmenucenter">';
print '<div class="tmenuleft tmenusep"></div><div class="tmenucenter">';
}
}

View File

@ -304,7 +304,7 @@ function print_start_menu_entry_empty($idsel,$classname,$showmode)
if ($showmode)
{
print '<li '.$classname.' id="mainmenutd_'.$idsel.'">';
print '<div class="tmenuleft"></div><div class="tmenucenter">';
print '<div class="tmenuleft tmenusep"></div><div class="tmenucenter">';
}
}

View File

@ -1005,7 +1005,7 @@ else
print '<td>'.$langs->trans("User").'</td>';
print '<td>';
print $userRequest->getNomUrl(1);
print $userRequest->getNomUrl(1, 'leave');
print '</td></tr>';
// Type

View File

@ -288,7 +288,7 @@ print '<table class="noborder" width="100%;">';
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cp.rowid","",'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreateCP"),$_SERVER["PHP_SELF"],"cp.date_create","",'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Employe"),$_SERVER["PHP_SELF"],"cp.fk_user","",'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"cp.fk_user","",'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder);
@ -405,7 +405,7 @@ if (! empty($holiday->holiday))
print $holidaystatic->getNomUrl(1);
print '</td>';
print '<td style="text-align: center;">'.dol_print_date($date,'day').'</td>';
print '<td>'.$userstatic->getNomUrl('1').'</td>';
print '<td>'.$userstatic->getNomUrl('1', 'leave').'</td>';
print '<td>'.$approbatorstatic->getNomUrl('1').'</td>';
print '<td>';
$label=$alltypeleaves[$infos_CP['fk_type']]['label'];

View File

@ -189,7 +189,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
$userstatic->firstname=$obj->firstname;
print '<tr '.$bc[$var].'>';
print '<td>'.$holidaystatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(1, 'leave').'</td>';
print '<td>'.$typeleaves[$obj->fk_type]['label'].'</td>';
$starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';

View File

@ -757,14 +757,16 @@ class Dolresource extends CommonObject
}
/*
/**
* Return an array with resources linked to the element
*
*
*
* @param string $element Element
* @param int $element_id Id
* @param string $resource_type Type
* @return array Aray of resources
*/
function getElementResources($element,$element_id,$resource_type='')
{
// Links beetween objects are stored in this table
$sql = 'SELECT rowid, resource_id, resource_type, busy, mandatory';
$sql.= ' FROM '.MAIN_DB_PREFIX.'element_resources';

View File

@ -792,12 +792,12 @@ img.photoref {
/* ============================================================================== */
<?php
$minwidthtmenu=66; /* minimul widht for one top menu entry */
$minwidthtmenu=66; /* minimum width for one top menu entry */
$heightmenu=46; /* height of top menu, part with image */
$heightmenu2=48; /* height of top menu, part with login */
$disableimages = 0;
$maxwidthloginblock = 110;
if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; }
if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; }
?>
div#id-top {
@ -814,7 +814,7 @@ div#id-top {
background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) );
<?php } ?>
<?php if ($disableimages) { ?>
height: 28px;
height: 34px;
<?php } else { ?>
height: <?php print $heightmenu2; ?>px;
<?php } ?>
@ -829,6 +829,12 @@ div#tmenu_tooltip {
<?php } ?>
}
div.tmenusep {
<?php if ($disableimages) { ?>
display: none;
<? } ?>
}
div.tmenudiv {
<?php if (GETPOST("optioncss") == 'print') { ?>
display:none;
@ -933,12 +939,13 @@ div.tmenuleft
}
div.tmenucenter
{
padding-top: <?php print $disableimages?'4':'2'; ?>px;
padding-left: 0px;
padding-right: 0px;
<?php if ($disableimages) { ?>
height: 24px;
padding-top: 8px;
height: 26px;
<?php } else { ?>
padding-top: 2px;
height: <?php print $heightmenu; ?>px;
<?php } ?>
width: 100%;
@ -948,7 +955,12 @@ div.menu_titre {
}
.mainmenuaspan
{
<?php if ($disableimages) { ?>
padding-left: 4px;
padding-right: 2px;
<?php } else { ?>
padding-right: 4px;
<?php } ?>
}
div.mainmenu {
@ -1185,7 +1197,7 @@ div.login_block {
position: absolute;
text-align: right;
<?php print $right; ?>: 5px;
top: 3px;
top: 2px;
font-weight: bold;
max-width: <?php echo $maxwidthloginblock; ?>px;
<?php if (GETPOST("optioncss") == 'print') { ?>
@ -4229,8 +4241,11 @@ img.demothumb {
}
}
/* rule to reduce top menu - 2nd reduction */
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 4.5, 0) + 8; ?>px)
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 4.7, 0) + 8; ?>px)
{
div.mainmenu {
height: 23px;
}
div.tmenucenter {
max-width: <?php echo round($fontsize * 2); ?>px; /* size of viewport */
text-overflow: clip;
@ -4245,12 +4260,17 @@ img.demothumb {
}
}
/* rule to reduce top menu - 3rd reduction */
@media only screen and (max-width: 570px)
@media only screen and (max-width: 605px)
{
/* Reduce login top right info */
.usertextatoplogin {
display: none;
}
.help {
<?php if ($disableimages) { ?>
display: none;
<?php } ?>
}
div#tmenu_tooltip {
<?php if (GETPOST("optioncss") == 'print') { ?>
display:none;
@ -4259,13 +4279,19 @@ img.demothumb {
<?php } ?>
}
div.login_block {
top: 4px;
max-width: 82px;
top: 2px;
<?php if ($disableimages) { ?>
max-width: 100px;
<?php } else { ?>
max-width: 82px;
<?php } ?>
}
li.tmenu, li.tmenusel {
min-width: 30px;
}
div.mainmenu {
height: 23px;
}
div.tmenucenter {
text-overflow: clip;
}

View File

@ -843,12 +843,12 @@ img.photoref {
/* ============================================================================== */
<?php
$minwidthtmenu=66;
$minwidthtmenu=66; /* minimum width for one top menu entry */
$heightmenu=48; /* height of top menu, part with image */
$heightmenu2=48; /* height of top menu, ârt with login */
$disableimages = 0;
$maxwidthloginblock = 110;
if (! empty($conf->global->THEME_MD_DISABLE_IMAGE)) { $heightmenu = 30; $disableimages = 1; $maxwidthloginblock = 180; }
if (! empty($conf->global->THEME_MD_DISABLE_IMAGE)) { $heightmenu = 30; $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; }
?>
div#tmenu_tooltip {
@ -875,6 +875,12 @@ div#tmenu_tooltip {
<?php } ?>
}
div.tmenusep {
<?php if ($disableimages) { ?>
display: none;
<? } ?>
}
div.tmenudiv {
<?php if (GETPOST("optioncss") == 'print') { ?>
display:none;
@ -972,7 +978,10 @@ li.tmenusel, li.tmenu:hover {
opacity: .50; /* show only a slight shadow */
}
.tmenuend .tmenuleft { width: 0px; }
/* .tmenuend { display: none; } */
/* .tmenuend { display: none; } We keep tmenuend it to show background for rest of line */
.tmenuend .tmenucenter {
width: 1px;
}
div.tmenuleft
{
float: <?php print $left; ?>;
@ -987,10 +996,15 @@ div.tmenuleft
}
div.tmenucenter
{
padding-top: <?php echo $disableimages?'10':'2'; ?>px;
padding-left: 0px;
padding-right: 0px;
<?php if ($disableimages) { ?>
padding-top: 10px;
height: 26px;
<?php } else { ?>
padding-top: 2px;
height: <?php print $heightmenu; ?>px;
<?php } ?>
width: 100%;
}
div.menu_titre {
@ -998,7 +1012,12 @@ div.menu_titre {
}
.mainmenuaspan
{
<?php if ($disableimages) { ?>
padding-left: 4px;
padding-right: 2px;
<?php } else { ?>
padding-right: 4px;
<?php } ?>
}
div.mainmenu {
@ -4072,6 +4091,7 @@ img.demothumb {
/* nboftopmenuentries = <?php echo $nbtopmenuentries ?>, fontsize=<?php echo $fontsize ?> */
/* disableimages = <?php echo $disableimages; ?> */
/* rule to reduce top menu - 1st reduction */
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 7, 0) + 200; ?>px)
{
@ -4119,10 +4139,6 @@ img.demothumb {
/* rule to reduce top menu - 3rd reduction */
@media only screen and (max-width: 570px)
{
/* Reduce login top right info */
.usertextatoplogin {
display: none;
}
div#tmenu_tooltip {
<?php if (GETPOST("optioncss") == 'print') { ?>
display:none;
@ -4130,10 +4146,6 @@ img.demothumb {
/* padding-<?php echo $right; ?>: 78px; */
<?php } ?>
}
div.login_block {
top: 9px;
}
li.tmenu, li.tmenusel {
min-width: 30px;
}

View File

@ -1991,7 +1991,10 @@ class User extends CommonObject
if (! empty($_SESSION["disablemodules"])) $label.= '<br><b>'.$langs->trans("DisabledModules").':</b> <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
}
$link.= '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'"';
if ($option == 'leave') $link.= '<a href="'.DOL_URL_ROOT.'/holiday/list.php?id='.$this->id.'"';
else $link.= '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'"';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))