mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
W3C
This commit is contained in:
parent
6e129e1ce0
commit
58c1a8aafa
|
|
@ -613,7 +613,7 @@ if ($action == 'edit')
|
|||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Member"));
|
||||
|
||||
$rowspan=14;
|
||||
$rowspan=15;
|
||||
$rowspan+=sizeof($adho->attribute_label);
|
||||
if ($conf->societe->enabled) $rowspan++;
|
||||
|
||||
|
|
@ -643,17 +643,10 @@ if ($action == 'edit')
|
|||
|
||||
// Photo
|
||||
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||
if (file_exists($conf->adherent->dir_output."/".$adh->id.".jpg"))
|
||||
{
|
||||
print '<img width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=memberphoto&file='.$adh->id.'.jpg">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
|
||||
}
|
||||
print $html->showphoto('member',$adh);
|
||||
if ($caneditfieldmember)
|
||||
{
|
||||
print '<br><br><table class="noborder"><tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<br><br><table class="nobordernopadding"><tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td>';
|
||||
print '<input type="file" class="flat" name="photo">';
|
||||
print '</td></tr></table>';
|
||||
|
|
@ -1042,14 +1035,7 @@ if ($rowid && $action != 'edit')
|
|||
// Login
|
||||
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur">'.$adh->login.' </td>';
|
||||
print '<td rowspan="'.$rowspan.'" align="center" valign="middle" width="25%">';
|
||||
if (file_exists($conf->adherent->dir_output."/".$adh->id.".jpg"))
|
||||
{
|
||||
print '<img width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=memberphoto&file='.$adh->id.'.jpg">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img width="100" src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
|
||||
}
|
||||
print $html->showphoto('member',$adh);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -2775,6 +2775,49 @@ class Form
|
|||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return HTML code to output a photo
|
||||
* \param modulepart Id to define module concerned
|
||||
* \param object Object containing data to retreive file name
|
||||
* \param width Width of photo
|
||||
* \return string HTML code to output photo
|
||||
*/
|
||||
function showphoto($modulepart,$object,$width=100)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$ret='';$dir='';$file='';
|
||||
|
||||
if ($modulepart=='userphoto')
|
||||
{
|
||||
$dir=$conf->user->dir_output;
|
||||
$file=$object->id.".jpg";
|
||||
}
|
||||
if ($modulepart=='member')
|
||||
{
|
||||
$dir=$conf->adherent->dir_output;
|
||||
$file=$object->id.".jpg";
|
||||
}
|
||||
|
||||
if ($dir && $file)
|
||||
{
|
||||
if (file_exists($dir."/".$file))
|
||||
{
|
||||
$ret.='<img alt="Photo" width="'.$width.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($file).'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.='<img alt="No photo" width="'.$width.'" src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error('','Call to showrefnav with wrong parameters');
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1105,7 +1105,7 @@ function img_delete($alt = "default")
|
|||
/**
|
||||
* \brief Affiche logo help avec curseur "?"
|
||||
* \param usehelpcursor
|
||||
* \param usealttitle
|
||||
* \param usealttitle Texte to use as alt title
|
||||
* \return string Retourne tag img
|
||||
*/
|
||||
function img_help($usehelpcursor=1,$usealttitle=1)
|
||||
|
|
@ -1119,6 +1119,7 @@ function img_help($usehelpcursor=1,$usealttitle=1)
|
|||
if (is_string($usealttitle)) $s.=' alt="'.$usealttitle.'" title="'.$usealttitle.'"';
|
||||
else $s.=' alt="'.$langs->trans("Info").'" title="'.$langs->trans("Info").'"';
|
||||
}
|
||||
else $s.=' alt=""';
|
||||
$s.='>';
|
||||
return $s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -846,15 +846,9 @@ else
|
|||
{
|
||||
print '<td width="50%">'.$fuser->login.'</td>';
|
||||
}
|
||||
// Photo
|
||||
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||
if (file_exists($conf->user->dir_output."/".$fuser->id.".jpg"))
|
||||
{
|
||||
print '<img width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=userphoto&file='.$fuser->id.'.jpg">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img width="100" src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
|
||||
}
|
||||
print $html->showphoto('userphoto',$fuser);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -892,7 +886,7 @@ else
|
|||
}
|
||||
print "</tr>\n";
|
||||
|
||||
// Administrateur
|
||||
// Administrator
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Administrator").'</td>';
|
||||
print '<td>'.yn($fuser->admin);
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $fuser->admin && ! $fuser->entity)
|
||||
|
|
@ -1324,18 +1318,13 @@ else
|
|||
print $fuser->login;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Photo
|
||||
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
|
||||
if (file_exists($conf->user->dir_output."/".$fuser->id.".jpg"))
|
||||
{
|
||||
print '<img width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=userphoto&file='.$fuser->id.'.jpg">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<img src="'.DOL_URL_ROOT.'/theme/common/nophoto.jpg">';
|
||||
}
|
||||
print $html->showphoto('userphoto',$fuser);
|
||||
if ($caneditfield)
|
||||
{
|
||||
print '<br><br><table class="noborder"><tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<br><br><table class="nobordernopadding"><tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td>';
|
||||
print '<input type="file" class="flat" name="photo">';
|
||||
print '</td></tr></table>';
|
||||
|
|
@ -1365,7 +1354,7 @@ else
|
|||
print $text;
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Administrateur
|
||||
// Administrator
|
||||
print "<tr>".'<td valign="top">'.$langs->trans("Administrator").'</td>';
|
||||
if ($fuser->societe_id > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -20,11 +20,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/viewimage.php
|
||||
\brief Wrapper permettant l'affichage de fichiers images Dolibarr
|
||||
\remarks L'appel est viewimage.php?file=pathrelatifdufichier&modulepart=repfichierconcerne
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/viewimage.php
|
||||
* \brief Wrapper permettant l'affichage de fichiers images Dolibarr
|
||||
* \remarks L'appel est viewimage.php?file=pathrelatifdufichier&modulepart=repfichierconcerne
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
// Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$action = isset($_GET["action"])?$_GET["action"]:'';
|
||||
|
|
@ -55,6 +55,7 @@ else
|
|||
require("./main.inc.php");
|
||||
// master.inc.php is included in main.inc.php
|
||||
}
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
|
||||
|
||||
// C'est un wrapper, donc header vierge
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user