Qual: Factorize code. Removed useless code.

This commit is contained in:
Laurent Destailleur 2009-05-04 18:45:56 +00:00
parent b4e1d642b7
commit 70d0017798
5 changed files with 23 additions and 23 deletions

View File

@ -236,7 +236,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
elseif ($conf->global->MAIN_MAIL_SENDMODE == 'smtps') $text = 'SMTPS library';
else { $text = $langs->trans("Undefined"); }
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $html->textwithpicto($text,$htmltext,1,0,'superadmin');
print $html->textwithpicto($text,$htmltext,1,'superadmin');
}
print '</td></tr>';
@ -263,7 +263,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
{
$text = $conf->global->MAIN_MAIL_SMTP_SERVER ? $conf->global->MAIN_MAIL_SMTP_SERVER : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $html->textwithpicto($text,$htmltext,1,0,'superadmin');
print $html->textwithpicto($text,$htmltext,1,'superadmin');
}
}
print '</td></tr>';
@ -291,7 +291,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
{
$text = $conf->global->MAIN_MAIL_SMTP_PORT ? $conf->global->MAIN_MAIL_SMTP_PORT : $smtpport;
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $html->textwithpicto($text,$htmltext,1,0,'superadmin');
print $html->textwithpicto($text,$htmltext,1,'superadmin');
}
}
print '</td></tr>';
@ -309,7 +309,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
else
{
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $html->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID,$htmltext,1,0,'superadmin');
print $html->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID,$htmltext,1,'superadmin');
}
print '</td></tr>';
}
@ -327,7 +327,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
else
{
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $html->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW,$htmltext,1,0,'superadmin');
print $html->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW,$htmltext,1,'superadmin');
}
print '</td></tr>';
}

View File

@ -203,7 +203,7 @@ if (function_exists("imagecreatefrompng"))
else
{
$html = new Form($db);
$desc = $html->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,0,'warning');
$desc = $html->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,'warning');
print $desc;
}
print "</td>";
@ -246,7 +246,7 @@ if (function_exists("cl_scanfile")) // Clamav
else
{
$html = new Form($db);
$desc = $html->textwithpicto('',$langs->transnoentities("EnablePhpAVModuleDesc"),1,0,'warning');
$desc = $html->textwithpicto('',$langs->transnoentities("EnablePhpAVModuleDesc"),1,'warning');
print $desc;
}
print "</td>";

View File

@ -128,7 +128,7 @@ else
}
if ($show==0) print $row[1];
if ($show==1) print $html->textwithhelp($row[1],$text);
if ($show==2) print $html->textwithpicto($row[1],$text,1,0,'warning');
if ($show==2) print $html->textwithpicto($row[1],$text,1,'warning');
print '</td>';
print "</tr>\n";
}

View File

@ -171,7 +171,7 @@ class Form
{
global $conf;
$alt='';
if ($type == 'help') $img=img_help($alt);
if ($type == 'help') $img=img_help(1,$alt);
if ($type == 'warning') $img=img_warning($alt);
if ($type == 'superadmin') $img=img_redstar($alt);
if (empty($conf->use_javascript_ajax)) $alt='Help disabled (javascript disabled)';

View File

@ -1090,24 +1090,24 @@ else
// On selectionne les groups
$grouplistid = array();
$uss = array();
$sql = "SELECT ug.fk_usergroup";
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= ", ".MAIN_DB_PREFIX."usergroup as u";
$sql.= " WHERE ug.fk_user = ".$fuser->id;
$sql.= " AND ug.fk_usergroup = u.rowid";
$sql.= " AND u.entity IN (0,".$conf->entity.")";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$grouplistid[]=$obj->fk_usergroup;
$i++;
}
@ -1115,9 +1115,9 @@ else
else {
dol_print_error($db);
}
$idList = implode(",",$grouplistid);
if (!empty($idList))
{
$sql = "SELECT ug.rowid, ug.nom ";
@ -1125,17 +1125,17 @@ else
$sql.= " WHERE ug.entity IN (0,".$conf->entity.")";
$sql.= " AND ug.rowid NOT IN (".$idList.")";
$sql.= " ORDER BY ug.nom";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$uss[$obj->rowid] = $obj->nom;
$i++;
}
@ -1150,17 +1150,17 @@ else
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as ug ";
$sql.= " WHERE ug.entity IN (0,".$conf->entity.")";
$sql.= " ORDER BY ug.nom";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$uss[$obj->rowid] = $obj->nom;
$i++;
}
@ -1337,7 +1337,7 @@ else
$text='<input size="12" maxlength="32" type="text" class="flat" name="password" value="'.$fuser->pass.'">';
if ($dolibarr_main_authentication && $dolibarr_main_authentication == 'http')
{
$text=$html->textwithpicto($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication),1,0,'warning');
$text=$html->textwithpicto($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication),1,'warning');
}
}
else
@ -1366,7 +1366,7 @@ else
{
$yn = yn($fuser->admin);
print '<input type="hidden" name="admin" value="'.$fuser->admin.'">';
print $html->textwithpicto($yn,$langs->trans("DontChangeSuperAdmin"),1,0,'warning');
print $html->textwithpicto($yn,$langs->trans("DontChangeSuperAdmin"),1,'warning');
}
print '</td></tr>';
}