diff --git a/htdocs/accountancy/class/accountancyaccount.class.php b/htdocs/accountancy/class/accountancyaccount.class.php index cd6b3af500d..dd757d5a816 100644 --- a/htdocs/accountancy/class/accountancyaccount.class.php +++ b/htdocs/accountancy/class/accountancyaccount.class.php @@ -40,21 +40,21 @@ class AccountancyAccount /** - * \brief Constructeur de la classe - * \param DB handler acces base de donnees - * \param id id compte (0 par defaut) + * Constructor + * + * @param $DoliDB $DB Database handler */ - function AccountancyAccount($DB, $id=0) + function AccountancyAccount($DB) { $this->db = $DB; - $this->id = $id ; } /** - * \brief Ins�re le compte en base - * \param user Utilisateur qui effectue l'insertion - * \return int <0 si ko, Id ligne ajout�e si ok + * Insert account into database + * + * @param User $user User making add + * @return int <0 if KO, Id line added if OK */ function create($user) { diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 8e986327700..3d2d4ef62e9 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -108,9 +108,7 @@ if ($action == 'set') $sql.= ($label?"'".$db->escape($label)."'":'null').", "; $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); $sql.= ")"; - if ($db->query($sql)) - { - } + $resql=$db->query($sql); } if ($action == 'del') 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/modules.php b/htdocs/admin/modules.php index eeb785b8e3f..82c110aecbe 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -310,22 +310,16 @@ if ($mode != 4) if ($objMod->special == $mode) { $atleastoneforfamily++; - $var=!$var; - print '\n"; - - //print ' '; if ($family!=$oldfamily) { $familytext=empty($familylib[$family])?$family:$familylib[$family]; //print $familytext; $oldfamily=$family; } - else - { - //print ' '; - } - //print "\n"; + + $var=!$var; + print '\n"; // Picto print ' '; diff --git a/htdocs/admin/osc-languages.php b/htdocs/admin/osc-languages.php index 0646e7aaf9b..b6e9bb5c848 100644 --- a/htdocs/admin/osc-languages.php +++ b/htdocs/admin/osc-languages.php @@ -53,14 +53,13 @@ $offset = $limit * $page ; print_barre_liste("Liste des langues oscommerce", $page, "osc-languages.php"); $sql = "SELECT l.languages_id, l.name, l.code FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."languages as l"; - -$sql .= $db->plimit( $limit ,$offset); +$sql.= $db->plimit($limit, $offset); print "

"; -print ""; +print ""; print ""; print ""; -print ""; +print ""; print "\n"; $resql=$db->query($sql); diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 08ea5ea56d9..a15a70797e4 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -162,9 +162,9 @@ if ($result) // Check if permission is inside module definition // TODO If not, we remove it - foreach($objMod->rights as $key => $val) + /*foreach($objMod->rights as $key => $val) { - } + }*/ // Break found, it's a new module to catch if ($old <> $obj->module) diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index 26c95ece302..e837687884f 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -107,10 +107,7 @@ if ($action == 'set') $sql.= ($label?"'".$db->escape($label)."'":'null').", "; $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); $sql.= ")"; - if ($db->query($sql)) - { - - } + $resql=$db->query($sql); } if ($action == 'del') diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index 2d80a71b387..ab2c42c46d3 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -184,10 +184,7 @@ if ($action == 'set') $sql.= ($label?"'".$db->escape($label)."'":'null').", "; $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); $sql.= ")"; - if ($db->query($sql)) - { - - } + $resql=$db->query($sql); } if ($action == 'del') { diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 2a657b82f04..1885090998b 100755 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -161,7 +161,7 @@ if ($action == 'edit') { $html=new Form($db); - if (! sizeof($listofmethods)) print '
'.$langs->trans("NoSmsEngine").'
'; + if (! count($listofmethods)) print '
'.$langs->trans("NoSmsEngine").'
'; print ''; print ''; @@ -205,7 +205,7 @@ if ($action == 'edit') print '
idNameCodeCode
'; print '

'; - print ''; + print ''; print '     '; print ''; print '
'; 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 diff --git a/htdocs/admin/societe_extrafields.php b/htdocs/admin/societe_extrafields.php index 92cdb593354..acefc0f05bb 100755 --- a/htdocs/admin/societe_extrafields.php +++ b/htdocs/admin/societe_extrafields.php @@ -138,7 +138,7 @@ if ($action == 'update') } } -# Suppression attribut +// Suppression attribut if ($action == 'delete') { if(isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_GET["attrname"])) diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 41213c954a0..8b2693ee743 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -61,7 +61,6 @@ else if ($conf->db->type == 'pgsql') } else if ($conf->db->type == 'mssql') { - //TODO: recuperer les infos du serveur //$sqls[0] = ""; //$base=3; } diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index c5183dde566..8e3e5c82fc9 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -111,7 +111,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S { $var=!$var; print ''.$key.''; - print ''.sizeof($val).''; + print ''.count($val).''; print ''.dol_getshmopaddress($key).''; print ''."\n"; } @@ -180,13 +180,12 @@ $var=!$var; print '=> dol_get_first_day(1970,1,false)'.dol_get_first_day(1970,1,false).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')'; $var=!$var; print '=> dol_get_first_day(1970,1,true)'.dol_get_first_day(1970,1,true).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')'; -# Parent company +// Parent company $var=!$var; print ''.$langs->trans("CompanyTZ").''.$langs->trans("FeatureNotYetAvailable").''."\n"; $var=!$var; -#print "=> ".$langs->trans("CompanyHour")."".dol_print_date(dol_now('tzuser'),'dayhour')."\n"; print '=> '.$langs->trans("CompanyHour").''.$langs->trans("FeatureNotYetAvailable").''."\n"; -# Client +// Client $var=!$var; print ''.$langs->trans("ClientTZ").''.($_SESSION['dol_tz']!=''?($_SESSION['dol_tz']>=0?'+':'').$_SESSION['dol_tz']:'').' ('.($_SESSION['dol_tz']>=0?'+':'').($_SESSION['dol_tz']*60*60).')'."\n"; //$var=!$var; @@ -195,7 +194,6 @@ $var=!$var; print ''.$langs->trans("DaylingSavingTime").''.($_SESSION['dol_dst']>=0?yn(1):yn(0)).' ('.($_SESSION['dol_dst']>=0?'+':'').($_SESSION['dol_dst']*60*60).')'."\n"; $var=!$var; print '=> '.$langs->trans("ClientHour").''.dol_print_date(dol_now(),'dayhour','tzuser').''."\n"; -#print "=> ".$langs->trans("ClientHour")."".$langs->trans("FeatureNotYetAvailable")."\n"; $var=!$var; $filesystemencoding=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0 diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index 68ea1e1f4cb..28f488a5f90 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -83,7 +83,13 @@ function compare($x, $y) return 1; } - +/** + * Compare revisions + * + * @param array $x Parts of version 1 + * @param array $y Parts of version 2 + * @return int 1 if 1<2, 0 if 1=2, -1 if 1>2 + */ function revcompare($x, $y) { global $sortby, $langs; @@ -96,7 +102,12 @@ function revcompare($x, $y) return -1; } - +/** + * Output table + * + * @param array $list Array of records + * @return void + */ function create_script_table($list) { global $sortby,$bc,$langs; @@ -127,15 +138,15 @@ function create_script_table($list) + href="?sort=file&order=">trans("Filename"); ?>  + href="?sort=mtime&order=">trans("Date"); ?>  + href="?sort=size&order=">trans("Size"); ?>  + href="?sort=reloads&order=">trans("Reloads"); ?>  + href="?sort=hits&order=">trans("Hits"); ?> '; } @@ -197,7 +197,7 @@ else if ($savehandler == 'files') { - if (sizeof($listofsessions)) + if (count($listofsessions)) { print ''.$langs->trans("PurgeSessions").''; } diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 0a2d32f6dd7..6a581eee154 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -71,7 +71,7 @@ if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice } $count=0; - if (sizeof($filesarray)) + if (count($filesarray)) { foreach($filesarray as $key => $value) diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 3b78cecb4f7..4de48203702 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -111,7 +111,7 @@ print $langs->trans("UnpackPackageInDolibarrRoot",$dolibarrroot).'
'; print ''.$langs->trans("StepNb",3).': '; print $langs->trans("RemoveLock",$dolibarrroot.'install.lock').'
'; print ''.$langs->trans("StepNb",4).': '; -$fullurl=''.DOL_URL_ROOT.'/install/'.''; +$fullurl=''.DOL_URL_ROOT.'/install/'; print $langs->trans("CallUpdatePage",$fullurl).'
'; print ''.$langs->trans("StepNb",5).': '; print $langs->trans("RestoreLock",$dolibarrroot.'install.lock').'
'; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index c0554e0cf93..0344c2c033c 100755 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -97,7 +97,7 @@ if ($conf->propal->enabled && $conf->commande->enabled) $workflowcodes['WORKFLOW //if ($conf->contrat->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_CONTRACT_AUTOCREATE_INVOICE']='WORKFLOW_CONTRACT_AUTOCREATE_INVOICE'; if ($conf->commande->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_ORDER_AUTOCREATE_INVOICE']='WORKFLOW_ORDER_AUTOCREATE_INVOICE'; -if (sizeof($workflowcodes) > 0) +if (count($workflowcodes) > 0) { foreach($workflowcodes as $code) {
">trans("Filename"); ?>  ">trans("Date"); ?>  ">trans("Size"); ?>  ">trans("Reloads"); ?>  ">trans("Hits"); ?> 
'.$langs->trans("NoSessionFound",$savepath,$openbasedir).'