forked from Wavyzz/dolibarr
PSR2 space after comma in function call
This commit is contained in:
@@ -35,10 +35,10 @@ $langs->load('other');
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$value=GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type='reception';
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ $type='reception';
|
||||
if (! empty($conf->reception->enabled) && empty($conf->global->MAIN_SUBMODULE_RECEPTION))
|
||||
{
|
||||
// This option should always be set to on when module is on.
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_RECEPTION", "1",'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_RECEPTION", "1", 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if (empty($conf->global->RECEPTION_ADDON_NUMBER))
|
||||
@@ -66,10 +66,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconst=GETPOST('maskconstreception','alpha');
|
||||
$maskvalue=GETPOST('maskreception','alpha');
|
||||
$maskconst=GETPOST('maskconstreception', 'alpha');
|
||||
$maskvalue=GETPOST('maskreception', 'alpha');
|
||||
if (! empty($maskconst))
|
||||
$res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (isset($res))
|
||||
{
|
||||
@@ -82,16 +82,16 @@ if ($action == 'updateMask')
|
||||
|
||||
else if ($action == 'set_param')
|
||||
{
|
||||
$freetext=GETPOST('RECEPTION_FREE_TEXT','none'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
$freetext=GETPOST('RECEPTION_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
if ($res <= 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
|
||||
$draft=GETPOST('RECEPTION_DRAFT_WATERMARK','alpha');
|
||||
$res = dolibarr_set_const($db, "RECEPTION_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
$draft=GETPOST('RECEPTION_DRAFT_WATERMARK', 'alpha');
|
||||
$res = dolibarr_set_const($db, "RECEPTION_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
if ($res <= 0)
|
||||
{
|
||||
$error++;
|
||||
@@ -106,17 +106,17 @@ else if ($action == 'set_param')
|
||||
|
||||
else if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module','alpha');
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
$exp = new Reception($db);
|
||||
$exp->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$file=dol_buildpath($reldir."core/modules/reception/doc/pdf_".$modele.".modules.php",0);
|
||||
$file=dol_buildpath($reldir."core/modules/reception/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
@@ -131,7 +131,7 @@ else if ($action == 'specimen')
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($exp,$langs) > 0)
|
||||
if ($module->write_file($exp, $langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=reception&file=SPECIMEN.pdf");
|
||||
return;
|
||||
@@ -160,14 +160,14 @@ else if ($action == 'del')
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->RECEPTION_ADDON_PDF == "$value") dolibarr_del_const($db, 'RECEPTION_ADDON_PDF',$conf->entity);
|
||||
if ($conf->global->RECEPTION_ADDON_PDF == "$value") dolibarr_del_const($db, 'RECEPTION_ADDON_PDF', $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "RECEPTION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
if (dolibarr_set_const($db, "RECEPTION_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
@@ -184,7 +184,7 @@ else if ($action == 'setdoc')
|
||||
|
||||
else if ($action == 'setmodel')
|
||||
{
|
||||
dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -194,14 +194,14 @@ else if ($action == 'setmodel')
|
||||
* View
|
||||
*/
|
||||
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
llxHeader("",$langs->trans("ReceptionsSetup"));
|
||||
llxHeader("", $langs->trans("ReceptionsSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("ReceptionsSetup"),$linkback,'title_setup');
|
||||
print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup');
|
||||
print '<br>';
|
||||
$head = reception_admin_prepare_head();
|
||||
|
||||
@@ -255,7 +255,7 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) {
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
}
|
||||
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
|
||||
@@ -265,12 +265,12 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td align="center">';
|
||||
if ($conf->global->RECEPTION_ADDON_NUMBER == "$file")
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$file.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
@@ -281,11 +281,11 @@ foreach ($dirmodels as $reldir)
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$nextval=$module->getNextValue($mysoc,$reception);
|
||||
$nextval=$module->getNextValue($mysoc, $reception);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
if ($nextval) {
|
||||
if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
|
||||
if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured')
|
||||
$nextval = $langs->trans($nextval);
|
||||
$htmltooltip.=$nextval.'<br>';
|
||||
} else {
|
||||
@@ -294,7 +294,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@@ -372,7 +372,7 @@ foreach ($dirmodels as $reldir)
|
||||
|
||||
foreach($filelist as $file)
|
||||
{
|
||||
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
|
||||
{
|
||||
|
||||
if (file_exists($dir.'/'.$file))
|
||||
@@ -392,7 +392,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<tr><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module,'info')) print $module->info($langs);
|
||||
if (method_exists($module, 'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
print '</td>';
|
||||
|
||||
@@ -401,14 +401,14 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -416,11 +416,11 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td align="center">';
|
||||
if ($conf->global->RECEPTION_ADDON_PDF == $name)
|
||||
{
|
||||
print img_picto($langs->trans("Default"),'on');
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@@ -432,25 +432,25 @@ foreach ($dirmodels as $reldir)
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
}
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td align="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'reception').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_object($langs->trans("PreviewNotAvailable"),'generic');
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user