From 3e5c5fc0f6a71696ab8ca44bdb6f7ca49bc590ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2011 21:50:18 +0000 Subject: [PATCH] Fix: Solve phpcodesniffer errors and warning --- htdocs/admin/mails.php | 58 +++++++++++++++++++++------------------- htdocs/admin/societe.php | 7 ++--- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 8dafcfd9218..091be0c5e3c 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -208,9 +208,11 @@ 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(); @@ -270,10 +272,10 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') { $html=new Form($db); - if ($conf->use_javascript_ajax) - { - print "\n".''."\n"; - } + print ''."\n"; + } print '
'; print ''; @@ -357,8 +359,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 ''; // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) @@ -590,15 +592,15 @@ else print ''; - 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 '
'.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 '
'.info_admin($langs->trans("SendmailOptionNotComplete")); + } + } // Boutons actions @@ -711,8 +713,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; diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index 83d008eb63a..1333ae4003e 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -134,11 +134,8 @@ 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; - if ($db->query($sql)) - { - - } - else dol_print_error($db); + $resql=$db->query($sql); + if (! $resql) dol_print_error($db); } // Define default generator