Fix: strict mode

This commit is contained in:
Regis Houssin 2012-07-10 18:57:27 +02:00
parent b4617ee6cb
commit 4291db4a93
4 changed files with 18 additions and 11 deletions

View File

@ -74,7 +74,7 @@ if (! empty($consts) && $update == $langs->trans("Modify"))
{
foreach($consts as $const)
{
if ($const["check"])
if (! empty($const["check"]))
{
if (dolibarr_set_const($db, $const["name"],$const["value"],$const["type"],1,$const["note"],$const["entity"]) < 0)
{
@ -89,7 +89,7 @@ if (! empty($consts) && $delete == $langs->trans("Delete"))
{
foreach($consts as $const)
{
if ($const["check"]) // Is checkbox checked
if (! empty($const["check"])) // Is checkbox checked
{
if (dolibarr_del_const($db, $const["rowid"], -1) < 0)
{

View File

@ -38,8 +38,8 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php');
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php');
if ($conf->projet->enabled)
if (! empty($conf->commande->enabled)) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php');
if (! empty($conf->projet->enabled))
{
require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php');
@ -52,6 +52,9 @@ $langs->load('companies');
$langs->load('products');
$langs->load('main');
$mesg='';
$errors=array();
if (GETPOST('mesg','int',1) && isset($_SESSION['message'])) $mesg=$_SESSION['message'];
$sall=trim(GETPOST('sall'));
@ -82,7 +85,7 @@ $result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid);
// Nombre de ligne pour choix de produit/service predefinis
$NBLINES=4;
$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
$usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:0);
$object=new Facture($db);
@ -1286,7 +1289,7 @@ else if ($action == 'down' && $user->rights->facture->creer)
/*
* Add file in email form
*/
if ($_POST['addfile'])
if (GETPOST('addfile'))
{
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
@ -2372,7 +2375,7 @@ else if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%">';
print '<tr><td>'.$langs->trans('Company').'</td>';
print '</td><td colspan="5">';
if ($conf->global->FACTURE_CHANGE_THIRDPARTY && $action != 'editthirdparty' && $object->brouillon && $user->rights->facture->creer)
if (! empty($conf->global->FACTURE_CHANGE_THIRDPARTY) && $action != 'editthirdparty' && $object->brouillon && $user->rights->facture->creer)
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&amp;facid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
@ -3017,7 +3020,7 @@ else if ($id > 0 || ! empty($ref))
}
}
if ($conf->global->FACTURE_SHOW_SEND_REMINDER) // For backward compatibility
if (! empty($conf->global->FACTURE_SHOW_SEND_REMINDER)) // For backward compatibility
{
if (($object->statut == 1 || $object->statut == 2) && $resteapayer > 0)
{

View File

@ -531,7 +531,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
// Extract value for mask counter, mask raz and mask offset
if (! preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg)) return 'ErrorBadMask';
$masktri=$reg[1].$reg[2].$reg[3];
$masktri=$reg[1].(! empty($reg[2])?$reg[2]:'').(! empty($reg[3])?$reg[3]:'');
$maskcounter=$reg[1];
$maskraz=-1;
$maskoffset=0;
@ -558,7 +558,11 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$masktype_value=substr(preg_replace('/^TE_/','',$objsoc->typent_code),0,dol_strlen($regType[1]));//get n first characters of client code where n is length in mask
$masktype_value=str_pad($masktype_value,dol_strlen($regType[1]),"#",STR_PAD_RIGHT);
}
else $masktype='';
else
{
$masktype='';
$masktype_value='';
}
$maskwithonlyymcode=$mask;
$maskwithonlyymcode=preg_replace('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$maskcounter,$maskwithonlyymcode);

View File

@ -19,7 +19,7 @@
?>
<!-- BEGIN PHP TEMPLATE FOR JQUERY -->
<?php if (count($object->lines) > 1 && $_GET['action'] != 'editline') { ?>
<?php if (count($object->lines) > 1 && GETPOST('action') != 'editline') { ?>
<script>
$(document).ready(function(){
$(".imgup").hide();