Work on finishing

This commit is contained in:
Laurent Destailleur 2015-05-31 17:31:15 +02:00
parent 3588d73c8e
commit 523b04a315
5 changed files with 15 additions and 11 deletions

View File

@ -4794,9 +4794,10 @@ class Form
* @param int $width Width of photo
* @param int $height Height of photo (auto if 0)
* @param int $caneditfield Add edit fields
* @param string $photologo CSS name to use on img for photo
* @return string HTML code to output photo
*/
static function showphoto($modulepart,$object,$width=100,$height=0,$caneditfield=0)
static function showphoto($modulepart,$object,$width=100,$height=0,$caneditfield=0,$cssclass='photowithmargin')
{
global $conf,$langs;
@ -4839,13 +4840,13 @@ class Form
{
// TODO Link to large image
$ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="photologo" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='</a>';
}
else if ($altfile && file_exists($dir."/".$altfile))
{
$ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="photologo" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
$ret.='</a>';
}
else

View File

@ -1439,7 +1439,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
// User photo
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem" style="padding: 0px;">';
$toprightmenu.=$user->getPhotoUrl(16,16);
$toprightmenu.=$user->getPhotoUrl(16,16,'loginphoto');
$toprightmenu.='</div></div>';
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem" style="padding: 0px;">';

View File

@ -482,7 +482,7 @@ if ($id > 0 || $ref)
print '</td></tr>';
}
// Stock
// Stock alert threshold
print '<tr><td>'.$form->editfieldkey("StockLimit",'stocklimit',$product->seuil_stock_alerte,$product,$user->rights->produit->creer).'</td><td colspan="2">';
print $form->editfieldval("StockLimit",'stocklimit',$product->seuil_stock_alerte,$product,$user->rights->produit->creer);
print '</td></tr>';
@ -502,7 +502,7 @@ if ($id > 0 || $ref)
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'<br>':'');
print '<tr><td>';
print $form->textwithtooltip($langs->trans("PhysicalStock"),$text_stock_options,2,1,img_picto('', 'info'),'',0);
print $form->textwithtooltip($langs->trans("PhysicalStock") ,$text_stock_options, 2, 1, img_picto('', 'info'), '', 2);
print '</td>';
print '<td>'.$product->stock_reel;
if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit"));

View File

@ -995,7 +995,9 @@ img.login, img.printer, img.entity {
color: white;
font-weight: bold;
}
img.loginphoto {
border-radius: 2px;
}
.span-icon-user {
background: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/object_user.png',1); ?>) no-repeat scroll 7px 7px;
}
@ -2435,13 +2437,13 @@ div.dolgraph div.legend table tbody tr { height: auto; }
margin-bottom: 2px;
margin-top: 2px;
}
.photointooltip, .photologo {
.photowithmargin {
-webkit-box-shadow: 0px 0px 3px #777;
-moz-box-shadow: 0px 0px 3px #777;
box-shadow: 0px 0px 3px #777;
margin-top: 6px;
}
.photointoolitp {
margin-top: 6px;
float: left;
/*text-align: center; */
}

View File

@ -1786,14 +1786,15 @@ class User extends CommonObject
*
* @param int $width Width of image
* @param int $height Height of image
* @param string $cssclass Force a css class
* @return string String with URL link
*/
function getPhotoUrl($width, $height)
function getPhotoUrl($width, $height, $cssclass='')
{
$result='';
$result.='<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">';
$result.=Form::showphoto('userphoto', $this, $width, $height);
$result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass);
$result.='</a>';
return $result;