Fix phpcs

This commit is contained in:
Laurent Destailleur 2018-12-15 14:12:39 +01:00
parent 4ff28d4580
commit 1bce3f6c6b
7 changed files with 33 additions and 42 deletions

View File

@ -31,7 +31,6 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
*/ */
class modReception extends DolibarrModules class modReception extends DolibarrModules
{ {
/** /**
* Constructor. Define names, constants, directories, boxes, permissions * Constructor. Define names, constants, directories, boxes, permissions
* *
@ -181,11 +180,27 @@ class modReception extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Receptions'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='Receptions'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("reception","reception","export")); $this->export_permission[$r]=array(array("reception","reception","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'ThirdParty','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','d.nom'=>'State','co.label'=>'Country','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_supplier'=>"RefSupplier",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateDeliveryPlanned",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note_public'=>"NotePublic",'ed.rowid'=>'LineId','ed.comment'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.weight'=>'ProductWeight','p.weight_units'=>'WeightUnits','p.volume'=>'ProductVolume','p.volume_units'=>'VolumeUnits'); $this->export_fields_array[$r]=array(
's.rowid'=>"IdCompany",'s.nom'=>'ThirdParty','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town',
'd.nom'=>'State','co.label'=>'Country','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6',
'c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_supplier'=>"RefSupplier",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateDeliveryPlanned",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note_public'=>"NotePublic",'ed.rowid'=>'LineId',
'ed.comment'=>'Description','ed.qty'=>"Qty",
'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.weight'=>'ProductWeight','p.weight_units'=>'WeightUnits','p.volume'=>'ProductVolume','p.volume_units'=>'VolumeUnits'
);
if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) $this->export_fields_array[$r]+=array('sp.rowid'=>'IdContact','sp.lastname'=>'Lastname','sp.firstname'=>'Firstname','sp.note_public'=>'NotePublic'); if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) $this->export_fields_array[$r]+=array('sp.rowid'=>'IdContact','sp.lastname'=>'Lastname','sp.firstname'=>'Firstname','sp.note_public'=>'NotePublic');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text"); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_supplier'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Numeric",'c.height'=>"Numeric",'c.width'=>"Numeric",'c.weight'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'ed.qty'=>"Numeric",'d.nom'=>'Text'); $this->export_TypeFields_array[$r]=array(
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','d.nom'=>'company','co.label'=>'company','co.code'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"reception",'c.ref'=>"reception",'c.ref_supplier'=>"reception",'c.fk_soc'=>"reception",'c.date_creation'=>"reception",'c.date_delivery'=>"reception",'c.tracking_number'=>'reception','c.height'=>"reception",'c.width'=>"reception",'c.size'=>'reception','c.size_units'=>'reception','c.weight'=>"reception",'c.weight_units'=>'reception','c.fk_statut'=>"reception",'c.note_public'=>"reception",'ed.rowid'=>'reception_line','ed.comment'=>'reception_line','ed.qty'=>"reception_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product','p.weight'=>'product','p.weight_units'=>'product','p.volume'=>'product','p.volume_units'=>'product'); 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text',
'co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text',
'c.ref'=>"Text",'c.ref_supplier'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Numeric",'c.height'=>"Numeric",'c.width'=>"Numeric",'c.weight'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",
'ed.qty'=>"Numeric",'d.nom'=>'Text'
);
$this->export_entities_array[$r]=array(
's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company',
'd.nom'=>'company','co.label'=>'company','co.code'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company',
'c.rowid'=>"reception",'c.ref'=>"reception",'c.ref_supplier'=>"reception",'c.fk_soc'=>"reception",'c.date_creation'=>"reception",'c.date_delivery'=>"reception",'c.tracking_number'=>'reception','c.height'=>"reception",'c.width'=>"reception",'c.size'=>'reception','c.size_units'=>'reception','c.weight'=>"reception",'c.weight_units'=>'reception','c.fk_statut'=>"reception",'c.note_public'=>"reception",'ed.rowid'=>'reception_line','ed.comment'=>'reception_line','ed.qty'=>"reception_line",
'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product','p.weight'=>'product','p.weight_units'=>'product','p.volume'=>'product','p.volume_units'=>'product'
);
if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) $this->export_entities_array[$r]+=array('sp.rowid'=>'contact','sp.lastname'=>'contact','sp.firstname'=>'contact','sp.note_public'=>'contact'); if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) $this->export_entities_array[$r]+=array('sp.rowid'=>'contact','sp.lastname'=>'contact','sp.firstname'=>'contact','sp.note_public'=>'contact');
$this->export_dependencies_array[$r]=array('reception_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('reception_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT))

View File

@ -551,7 +551,7 @@ class pdf_squille extends ModelePdfReception
} }
// Affiche zone totaux // Affiche zone totaux
$posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs,$totalOrdered); $posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs, $totalOrdered);
// Pied de page // Pied de page
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
@ -594,9 +594,10 @@ class pdf_squille extends ModelePdfReception
* @param int $deja_regle Montant deja regle * @param int $deja_regle Montant deja regle
* @param int $posy Position depart * @param int $posy Position depart
* @param Translate $outputlangs Objet langs * @param Translate $outputlangs Objet langs
* @param int $totalOrdered Total ordered
* @return int Position pour suite * @return int Position pour suite
*/ */
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs,$totalOrdered) function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $totalOrdered)
{ {
// phpcs:enable // phpcs:enable
global $conf,$mysoc; global $conf,$mysoc;
@ -631,8 +632,6 @@ class pdf_squille extends ModelePdfReception
$totalToShip=$tmparray['toship']; $totalToShip=$tmparray['toship'];
// Set trueVolume and volume_units not currently stored into database // Set trueVolume and volume_units not currently stored into database
if ($object->trueWidth && $object->trueHeight && $object->trueDepth) if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
{ {
@ -772,7 +771,6 @@ class pdf_squille extends ModelePdfReception
} }
} }
} }
/** /**

View File

@ -121,6 +121,7 @@ class mod_reception_moonstone extends ModelNumRefReception
return $numFinal; return $numFinal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return next free value * Return next free value
* *
@ -130,6 +131,7 @@ class mod_reception_moonstone extends ModelNumRefReception
*/ */
function reception_get_num($objsoc,$objforref) function reception_get_num($objsoc,$objforref)
{ {
// phpcs:enable
return $this->getNextValue($objsoc,$objforref); return $this->getNextValue($objsoc,$objforref);
} }
} }

View File

@ -304,13 +304,9 @@ if (empty($reshook))
// Extrafields // Extrafields
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i); $array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i);
} }
if ($totalqty > 0) // There is at least one thing to ship if ($totalqty > 0) // There is at least one thing to ship
{ {
//var_dump($_POST);exit; //var_dump($_POST);exit;
@ -392,7 +388,6 @@ if (empty($reshook))
} }
} }
else if ($action == 'confirm_valid' && $confirm == 'yes' && else if ($action == 'confirm_valid' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->reception->creer)) ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->reception->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->reception->reception_advance->validate))) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->reception->reception_advance->validate)))
@ -949,14 +944,13 @@ if ($action == 'create')
$pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount $pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount
$fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2]; $fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2];
$dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int')); $dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'));
} }
// with batch module enabled // with batch module enabled
if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg))
{ {
$numAsked++;
$numAsked ++;
// eat-by date dispatch // eat-by date dispatch
// $numline=$reg[2] + 1; // line of product // $numline=$reg[2] + 1; // line of product
$numline = $numAsked; $numline = $numAsked;
@ -969,7 +963,6 @@ $numAsked ++;
$dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1].'_'.$reg[2].'month'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'day'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'year']); $dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1].'_'.$reg[2].'month'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'day'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'year']);
$fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2];
$dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'),'DLC'=> $dDLC,'DLUO'=> $dDLUO,'lot'=> GETPOST($lot, 'alpha')); $dispatchLines[$numAsked]=array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'),'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'),'DLC'=> $dDLC,'DLUO'=> $dDLUO,'lot'=> GETPOST($lot, 'alpha'));
} }
} }
@ -2176,14 +2169,11 @@ else if ($id || $ref)
print $formfile->showdocuments('reception',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); print $formfile->showdocuments('reception',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
// Show links to link elements // Show links to link elements
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('order')); //$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
$somethingshown = $form->showLinkedObjectBlock($object, ''); $somethingshown = $form->showLinkedObjectBlock($object, '');
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
} }
if ($action == 'presend') if ($action == 'presend')
@ -2296,9 +2286,6 @@ else if ($id || $ref)
print $formmail->get_form(); print $formmail->get_form();
dol_fiche_end(); dol_fiche_end();
} }
} }

View File

@ -59,7 +59,6 @@ if ($id > 0 || ! empty($ref))
$object->fetch_origin(); $object->fetch_origin();
$typeobject = $object->origin; $typeobject = $object->origin;
} }
// Linked documents // Linked documents
@ -268,8 +267,6 @@ if ($id > 0 || ! empty($ref))
$res=@include dol_buildpath($reldir.'/contacts.tpl.php'); $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break; if ($res) break;
} }
} }
llxFooter(); llxFooter();

View File

@ -193,12 +193,8 @@ if (empty($reshook))
$object->add_object_linked('order_supplier', $value); // add supplier order linked object $object->add_object_linked('order_supplier', $value); // add supplier order linked object
} }
} }
} }
else { else {
$object->socid = $rcp->socid; $object->socid = $rcp->socid;
$object->type = FactureFournisseur::TYPE_STANDARD; $object->type = FactureFournisseur::TYPE_STANDARD;
$object->cond_reglement_id = $rcp->thirdparty->cond_reglement_supplier_id; $object->cond_reglement_id = $rcp->thirdparty->cond_reglement_supplier_id;
@ -408,13 +404,9 @@ if (empty($reshook))
$error++; $error++;
} }
} }
} }
/* /*
* View * View
*/ */