Fix: Solve phpcodesniffer errors and warning

This commit is contained in:
Laurent Destailleur 2011-09-14 21:50:17 +00:00
parent 8dd3dd52c2
commit cc9a014a98
2 changed files with 33 additions and 32 deletions

View File

@ -208,11 +208,9 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'sendhtml')
$body=make_substitutions($body,$substitutionarrayfortest);
require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
$mailfile = new CMailFile(
$subject, $sendto, $email_from, $body,
$filepath, $mimetype, $filename,
$sendtocc, $sendtoccc, $deliveryreceipt, $msgishtml, $errors_to
);
$mailfile = new CMailFile($subject, $sendto, $email_from, $body,
$filepath, $mimetype, $filename,
$sendtocc, $sendtoccc, $deliveryreceipt, $msgishtml, $errors_to);
$result=$mailfile->sendfile();
@ -272,10 +270,10 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
{
$html=new Form($db);
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
function initfields()
{
if (jQuery("#MAIN_MAIL_SENDMODE").val()==\'mail\')
@ -284,12 +282,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
jQuery("#MAIN_MAIL_EMAIL_TLS").val(0);
jQuery("#MAIN_MAIL_EMAIL_TLS").attr(\'disabled\', \'disabled\');
';
if ($linuxlike)
{
print ' jQuery("#MAIN_MAIL_SMTP_SERVER").attr(\'disabled\', \'disabled\');';
print ' jQuery("#MAIN_MAIL_SMTP_PORT").attr(\'disabled\', \'disabled\');';
}
print '
if ($linuxlike)
{
print ' jQuery("#MAIN_MAIL_SMTP_SERVER").attr(\'disabled\', \'disabled\');';
print ' jQuery("#MAIN_MAIL_SMTP_PORT").attr(\'disabled\', \'disabled\');';
}
print '
}
if (jQuery("#MAIN_MAIL_SENDMODE").val()==\'smtps\')
{
@ -305,8 +303,8 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
initfields();
});
})';
print '</script>'."\n";
}
print '</script>'."\n";
}
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -359,8 +357,8 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
else
{
$smtpserver = ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver);
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver);
print '</td><td>';
// SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity))
@ -592,15 +590,15 @@ else
print '</table>';
if ($linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
$sendmailoption=ini_get('mail.force_extra_parameters');
//print 'x'.$sendmailoption;
if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption))
{
print '<br>'.info_admin($langs->trans("SendmailOptionNotComplete"));
}
}
if ($linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
$sendmailoption=ini_get('mail.force_extra_parameters');
//print 'x'.$sendmailoption;
if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption))
{
print '<br>'.info_admin($langs->trans("SendmailOptionNotComplete"));
}
}
// Boutons actions
@ -713,8 +711,8 @@ else
$formmail->withfrom=1;
$formmail->witherrorsto=1;
$formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
$formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
$formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
$formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
$formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
$formmail->withtopicreadonly=0;
$formmail->withfile=2;

View File

@ -134,8 +134,11 @@ if ($action== 'del')
$type='company';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE nom='".$db->escape($value)."' AND type='".$type."' AND entity=".$conf->entity;
$resql=$db->query($sql);
if (! $resql) dol_print_error($db);
if ($db->query($sql))
{
}
else dol_print_error($db);
}
// Define default generator