Qual: Factorize code. Removed useless code.
This commit is contained in:
parent
b4e1d642b7
commit
70d0017798
@ -236,7 +236,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
elseif ($conf->global->MAIN_MAIL_SENDMODE == 'smtps') $text = 'SMTPS library';
|
elseif ($conf->global->MAIN_MAIL_SENDMODE == 'smtps') $text = 'SMTPS library';
|
||||||
else { $text = $langs->trans("Undefined"); }
|
else { $text = $langs->trans("Undefined"); }
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
print $html->textwithpicto($text,$htmltext,1,0,'superadmin');
|
print $html->textwithpicto($text,$htmltext,1,'superadmin');
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
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;
|
$text = $conf->global->MAIN_MAIL_SMTP_SERVER ? $conf->global->MAIN_MAIL_SMTP_SERVER : $smtpserver;
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
print $html->textwithpicto($text,$htmltext,1,0,'superadmin');
|
print $html->textwithpicto($text,$htmltext,1,'superadmin');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
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;
|
$text = $conf->global->MAIN_MAIL_SMTP_PORT ? $conf->global->MAIN_MAIL_SMTP_PORT : $smtpport;
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
print $html->textwithpicto($text,$htmltext,1,0,'superadmin');
|
print $html->textwithpicto($text,$htmltext,1,'superadmin');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -309,7 +309,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$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>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$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>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -203,7 +203,7 @@ if (function_exists("imagecreatefrompng"))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$desc = $html->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,0,'warning');
|
$desc = $html->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,'warning');
|
||||||
print $desc;
|
print $desc;
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -246,7 +246,7 @@ if (function_exists("cl_scanfile")) // Clamav
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$desc = $html->textwithpicto('',$langs->transnoentities("EnablePhpAVModuleDesc"),1,0,'warning');
|
$desc = $html->textwithpicto('',$langs->transnoentities("EnablePhpAVModuleDesc"),1,'warning');
|
||||||
print $desc;
|
print $desc;
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|||||||
@ -128,7 +128,7 @@ else
|
|||||||
}
|
}
|
||||||
if ($show==0) print $row[1];
|
if ($show==0) print $row[1];
|
||||||
if ($show==1) print $html->textwithhelp($row[1],$text);
|
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 '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,7 +171,7 @@ class Form
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$alt='';
|
$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 == 'warning') $img=img_warning($alt);
|
||||||
if ($type == 'superadmin') $img=img_redstar($alt);
|
if ($type == 'superadmin') $img=img_redstar($alt);
|
||||||
if (empty($conf->use_javascript_ajax)) $alt='Help disabled (javascript disabled)';
|
if (empty($conf->use_javascript_ajax)) $alt='Help disabled (javascript disabled)';
|
||||||
|
|||||||
@ -1090,24 +1090,24 @@ else
|
|||||||
// On selectionne les groups
|
// On selectionne les groups
|
||||||
$grouplistid = array();
|
$grouplistid = array();
|
||||||
$uss = array();
|
$uss = array();
|
||||||
|
|
||||||
$sql = "SELECT ug.fk_usergroup";
|
$sql = "SELECT ug.fk_usergroup";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup_user as ug";
|
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup as u";
|
$sql.= ", ".MAIN_DB_PREFIX."usergroup as u";
|
||||||
$sql.= " WHERE ug.fk_user = ".$fuser->id;
|
$sql.= " WHERE ug.fk_user = ".$fuser->id;
|
||||||
$sql.= " AND ug.fk_usergroup = u.rowid";
|
$sql.= " AND ug.fk_usergroup = u.rowid";
|
||||||
$sql.= " AND u.entity IN (0,".$conf->entity.")";
|
$sql.= " AND u.entity IN (0,".$conf->entity.")";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
$grouplistid[]=$obj->fk_usergroup;
|
$grouplistid[]=$obj->fk_usergroup;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -1115,9 +1115,9 @@ else
|
|||||||
else {
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$idList = implode(",",$grouplistid);
|
$idList = implode(",",$grouplistid);
|
||||||
|
|
||||||
if (!empty($idList))
|
if (!empty($idList))
|
||||||
{
|
{
|
||||||
$sql = "SELECT ug.rowid, ug.nom ";
|
$sql = "SELECT ug.rowid, ug.nom ";
|
||||||
@ -1125,17 +1125,17 @@ else
|
|||||||
$sql.= " WHERE ug.entity IN (0,".$conf->entity.")";
|
$sql.= " WHERE ug.entity IN (0,".$conf->entity.")";
|
||||||
$sql.= " AND ug.rowid NOT IN (".$idList.")";
|
$sql.= " AND ug.rowid NOT IN (".$idList.")";
|
||||||
$sql.= " ORDER BY ug.nom";
|
$sql.= " ORDER BY ug.nom";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$uss[$obj->rowid] = $obj->nom;
|
$uss[$obj->rowid] = $obj->nom;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -1150,17 +1150,17 @@ else
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as ug ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as ug ";
|
||||||
$sql.= " WHERE ug.entity IN (0,".$conf->entity.")";
|
$sql.= " WHERE ug.entity IN (0,".$conf->entity.")";
|
||||||
$sql.= " ORDER BY ug.nom";
|
$sql.= " ORDER BY ug.nom";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$uss[$obj->rowid] = $obj->nom;
|
$uss[$obj->rowid] = $obj->nom;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -1337,7 +1337,7 @@ else
|
|||||||
$text='<input size="12" maxlength="32" type="text" class="flat" name="password" value="'.$fuser->pass.'">';
|
$text='<input size="12" maxlength="32" type="text" class="flat" name="password" value="'.$fuser->pass.'">';
|
||||||
if ($dolibarr_main_authentication && $dolibarr_main_authentication == 'http')
|
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
|
else
|
||||||
@ -1366,7 +1366,7 @@ else
|
|||||||
{
|
{
|
||||||
$yn = yn($fuser->admin);
|
$yn = yn($fuser->admin);
|
||||||
print '<input type="hidden" name="admin" value="'.$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>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user