Fix remove warnings

This commit is contained in:
Laurent Destailleur 2017-07-09 20:31:27 +02:00
parent e3943155f3
commit 10cb7b2524
10 changed files with 74 additions and 46 deletions

View File

@ -55,7 +55,7 @@ if ($action == 'setvalue' && $user->admin)
$result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
if ($result < 0) $error++;
if (! $error)
if (! $error && is_array($_POST))
{
//var_dump($_POST);
foreach($_POST as $key => $val)
@ -172,7 +172,7 @@ $var=true;
$i=0;
foreach($listofnotifiedevents as $notifiedevent)
{
$label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
@ -183,7 +183,7 @@ foreach($listofnotifiedevents as $notifiedevent)
if ($i) print ', ';
print $label;
$i++;
}
print '</td></tr>';
@ -213,7 +213,7 @@ $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
$var=true;
foreach($listofnotifiedevents as $notifiedevent)
{
$label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');

View File

@ -53,11 +53,13 @@ function printBookmarksList($aDb, $aLangs)
// No urlencode, all param $url will be urlencoded later
if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield;
if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder;
foreach($_POST as $key => $val)
if (is_array($_POST))
{
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
foreach($_POST as $key => $val)
{
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
}
}
$url.=($tmpurl?'?'.$tmpurl:'');
}

View File

@ -129,10 +129,13 @@ $hookmanager->initHooks(array('agenda'));
if (GETPOST("viewlist") || $action == 'show_list')
{
$param='';
foreach($_POST as $key => $val)
if (is_array($_POST))
{
if ($key=='token') continue;
$param.='&'.$key.'='.urlencode($val);
foreach($_POST as $key => $val)
{
if ($key=='token') continue;
$param.='&'.$key.'='.urlencode($val);
}
}
//print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/listactions.php?'.$param);
@ -142,10 +145,13 @@ if (GETPOST("viewlist") || $action == 'show_list')
if (GETPOST("viewperuser") || $action == 'show_peruser')
{
$param='';
foreach($_POST as $key => $val)
if (is_array($_POST))
{
if ($key=='token') continue;
$param.='&'.$key.'='.urlencode($val);
foreach($_POST as $key => $val)
{
if ($key=='token') continue;
$param.='&'.$key.'='.urlencode($val);
}
}
//print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/peruser.php?'.$param);

View File

@ -120,10 +120,13 @@ $hookmanager->initHooks(array('agendalist'));
if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday"))
{
$param='';
foreach($_POST as $key => $val)
{
$param.='&'.$key.'='.urlencode($val);
}
if (is_array($_POST))
{
foreach($_POST as $key => $val)
{
$param.='&'.$key.'='.urlencode($val);
}
}
//print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/index.php?'.$param);
exit;

View File

@ -32,16 +32,19 @@ if ($action == 'setModuleOptions')
$db->begin();
// Process common param fields
foreach($_POST as $key => $val)
if (is_array($_POST))
{
if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ...
foreach($_POST as $key => $val)
{
$param=GETPOST("param".$reg[1],'alpha');
$value=GETPOST("value".$reg[1],'alpha');
if ($param)
if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ...
{
$res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
$param=GETPOST("param".$reg[1],'alpha');
$value=GETPOST("value".$reg[1],'alpha');
if ($param)
{
$res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
}
}

View File

@ -345,11 +345,14 @@ if (! $error && $db->connected)
if (! $error && $db->connected && $action == "set")
{
umask(0);
foreach($_POST as $key => $value)
if (is_array($_POST))
{
if (! preg_match('/^db_pass/i', $key)) {
dolibarr_install_syslog("step1: choice for " . $key . " = " . $value);
}
foreach($_POST as $key => $value)
{
if (! preg_match('/^db_pass/i', $key)) {
dolibarr_install_syslog("step1: choice for " . $key . " = " . $value);
}
}
}
// Show title of step

View File

@ -1498,10 +1498,12 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
{
$qs=dol_escape_htmltag($_SERVER["QUERY_STRING"]);
foreach($_POST as $key=>$value) {
if ($key!=='action' && !is_array($value)) $qs.='&'.$key.'='.urlencode($value);
}
if (is_array($_POST))
{
foreach($_POST as $key=>$value) {
if ($key!=='action' && !is_array($value)) $qs.='&'.$key.'='.urlencode($value);
}
}
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
$text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
//$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');

View File

@ -200,22 +200,25 @@ if ($action == 'addtime' && $user->rights->projet->lire)
{
$timespent_duration=array();
foreach($_POST as $key => $time)
if (is_array($_POST))
{
if (intval($time) > 0)
foreach($_POST as $key => $time)
{
// Hours or minutes of duration
if (preg_match("/([0-9]+)duration(hour|min)/",$key,$matches))
if (intval($time) > 0)
{
$id = $matches[1];
if ($id > 0)
{
// We store HOURS in seconds
if($matches[2]=='hour') $timespent_duration[$id] += $time*60*60;
// Hours or minutes of duration
if (preg_match("/([0-9]+)duration(hour|min)/",$key,$matches))
{
$id = $matches[1];
if ($id > 0)
{
// We store HOURS in seconds
if($matches[2]=='hour') $timespent_duration[$id] += $time*60*60;
// We store MINUTES in seconds
if($matches[2]=='min') $timespent_duration[$id] += $time*60;
}
// We store MINUTES in seconds
if($matches[2]=='min') $timespent_duration[$id] += $time*60;
}
}
}
}
}

View File

@ -25,7 +25,10 @@ CKEDITOR.editorConfig = function( config )
config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';
//config.contentsCss = '/css/mysitestyles.css';
config.image_previewText=' '; // Must no be empty
//config.autoParagraph = false;
//config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules
//config.forcePasteAsPlainText = true;
config.toolbar_Full =
[
['Templates','NewPage'],

View File

@ -25,7 +25,10 @@ CKEDITOR.editorConfig = function( config )
config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';
//config.contentsCss = '/css/mysitestyles.css';
config.image_previewText=' '; // Must no be empty
//config.autoParagraph = false;
//config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules
//config.forcePasteAsPlainText = true;
config.toolbar_Full =
[
['Templates','NewPage'],