2
0
forked from Wavyzz/dolibarr

FIX Picto of project on dol_banner and box

Conflicts:
	htdocs/core/boxes/box_project.php
This commit is contained in:
Laurent Destailleur
2017-03-21 13:01:32 +01:00
parent ea6daeb58b
commit 36630b9404
2 changed files with 11 additions and 9 deletions

View File

@@ -78,7 +78,7 @@ class box_project extends ModeleBoxes
// list the summary of the orders // list the summary of the orders
if ($user->rights->projet->lire) { if ($user->rights->projet->lire) {
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut "; $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc"; if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
$sql.= " WHERE p.entity = ".$conf->entity; $sql.= " WHERE p.entity = ".$conf->entity;
@@ -98,7 +98,7 @@ class box_project extends ModeleBoxes
$tooltip = $langs->trans('Project') . ': ' . $objp->ref; $tooltip = $langs->trans('Project') . ': ' . $objp->ref;
$this->info_box_contents[$i][0] = array( $this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"', 'td' => 'align="left" width="16"',
'logo' => 'object_project', 'logo' => 'object_project'.($objp->public?'pub':''),
'tooltip' => $tooltip, 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid, 'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid,
); );
@@ -123,13 +123,13 @@ class box_project extends ModeleBoxes
if ($resultTask) { if ($resultTask) {
$objTask = $db->fetch_object($resultTask); $objTask = $db->fetch_object($resultTask);
$this->info_box_contents[$i][3] = array( $this->info_box_contents[$i][3] = array(
'td' => 'align="right"', 'td' => 'class="right"',
'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"), 'text' => $objTask->nb." ".$langs->trans("Tasks"),
); );
if ($objTask->nb > 0 ) if ($objTask->nb > 0)
$this->info_box_contents[$i][4] = array( $this->info_box_contents[$i][4] = array(
'td' => 'align="right"', 'td' => 'class="right"',
'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%", 'text' => round($objTask->totprogress/$objTask->nb, 0)."%",
); );
else else
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");

View File

@@ -1024,7 +1024,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$morehtmlleft.='</div>'; $morehtmlleft.='</div>';
} }
} }
elseif ($conf->browser->layout != 'phone') // Show no photo link elseif ($conf->browser->layout != 'phone') // Show No photo link (picto of pbject)
{ {
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'; $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
if ($object->element == 'action') if ($object->element == 'action')
@@ -1036,7 +1036,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
else else
{ {
$width=14; $cssclass='photorefcenter'; $width=14; $cssclass='photorefcenter';
$nophoto=img_picto('', 'object_'.$object->picto, '', false, 1); $picto = $object->picto;
if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub
$nophoto=img_picto('', 'object_'.$picto, '', false, 1);
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.$nophoto.'"></div></div>'; $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.$nophoto.'"></div></div>';
} }
$morehtmlleft.='</div>'; $morehtmlleft.='</div>';