From c8a10010ae2b81bc89cfd06d7733d442e23a06c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2011 21:50:17 +0000 Subject: [PATCH] Fix: Solve phpcodesniffer errors and warning --- htdocs/admin/mails.php | 58 +++++++++++++++++++--------------------- htdocs/admin/societe.php | 7 +++-- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 091be0c5e3c..8dafcfd9218 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -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".''."\n"; - } + print ''."\n"; + } print '
'; print ''; @@ -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 ''; // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) @@ -592,15 +590,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 @@ -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; diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index 1333ae4003e..83d008eb63a 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -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