This commit is contained in:
Frédéric FRANCE 2019-10-20 11:59:21 +02:00
parent 9af0995cfa
commit 7581275316
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
46 changed files with 429 additions and 430 deletions

View File

@ -186,7 +186,7 @@
<!-- Check indent are done with spaces and with correct number --> <!-- Check indent are done with spaces and with correct number -->
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- TODO Enable this
<arg name="tab-width" value="4"/> <arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"> <rule ref="Generic.WhiteSpace.ScopeIndent">
<properties> <properties>
@ -194,7 +194,6 @@
<property name="tabIndent" value="true"/> <property name="tabIndent" value="true"/>
</properties> </properties>
</rule> </rule>
-->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" /> <rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />

View File

@ -113,7 +113,7 @@ dol_fiche_head('');
<tr><td><?php echo $langs->trans("SellingPrice"); ?></td> <tr><td><?php echo $langs->trans("SellingPrice"); ?></td>
<td><input name="price" size="10" value="<?php echo $object->price; ?>"> <td><input name="price" size="10" value="<?php echo $object->price; ?>">
<?php echo $object->price_base_type; ?> <?php echo $object->price_base_type; ?>
</td></tr> </td></tr>
<tr><td><?php echo $langs->trans("MinPrice"); ?></td> <tr><td><?php echo $langs->trans("MinPrice"); ?></td>
@ -121,7 +121,7 @@ dol_fiche_head('');
</td></tr> </td></tr>
<tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td> <tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td>
<?php echo $object->tva_tx; ?> <?php echo $object->tva_tx; ?>
</td></tr> </td></tr>
</table> </table>

View File

@ -57,7 +57,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
<?php if ($object->photos) { ?> <?php if ($object->photos) { ?>
<td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>"> <td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>">
<?php echo $object->photos; ?> <?php echo $object->photos; ?>
</td> </td>
<?php } ?> <?php } ?>

View File

@ -85,7 +85,7 @@ dol_fiche_head('');
<tr><td><?php echo $langs->trans("SellingPrice"); ?></td> <tr><td><?php echo $langs->trans("SellingPrice"); ?></td>
<td><input name="price" size="10" value="<?php echo $object->price; ?>"> <td><input name="price" size="10" value="<?php echo $object->price; ?>">
<?php echo $object->price_base_type; ?> <?php echo $object->price_base_type; ?>
</td></tr> </td></tr>
<tr><td><?php echo $langs->trans("MinPrice"); ?></td> <tr><td><?php echo $langs->trans("MinPrice"); ?></td>
@ -93,7 +93,7 @@ dol_fiche_head('');
</td></tr> </td></tr>
<tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td> <tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td>
<?php echo $object->tva_tx; ?> <?php echo $object->tva_tx; ?>
</td></tr> </td></tr>
</table> </table>

View File

@ -57,7 +57,7 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
<?php if ($object->photos) { ?> <?php if ($object->photos) { ?>
<td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>"> <td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>">
<?php echo $object->photos; ?> <?php echo $object->photos; ?>
</td> </td>
<?php } ?> <?php } ?>

View File

@ -6,8 +6,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$get = GETPOST('get', 'alpha'); $get = GETPOST('get', 'alpha');
$put = GETPOST('put', 'alpha'); $put = GETPOST('put', 'alpha');
switch ($put) switch ($put)
{ {
case 'qty': case 'qty':
if (empty($user->rights->stock->creer)) { echo -1; exit; } if (empty($user->rights->stock->creer)) { echo -1; exit; }
@ -47,4 +47,4 @@ $put = GETPOST('put', 'alpha');
} }
break; break;
} }

View File

@ -68,8 +68,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object // Load object
if ($id > 0 || ! empty($ref)) { if ($id > 0 || ! empty($ref)) {
$ret = $object->fetch($id, $ref); $ret = $object->fetch($id, $ref);
// if ($ret > 0) // if ($ret > 0)
// $ret = $object->fetch_thirdparty(); // $ret = $object->fetch_thirdparty();
if ($ret <= 0) { if ($ret <= 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';

View File

@ -369,7 +369,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) if (empty($reshook))
{ {
/*TODO if ($user->rights->stock->lire) /*TODO if ($user->rights->stock->lire)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'."\n"; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
} }
@ -378,7 +378,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n"; print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
} }
*/ */
} }
print '</div>'."\n"; print '</div>'."\n";

View File

@ -492,7 +492,7 @@ if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alph
$filters .= '&mode=' . $mode; $filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot; $filters .= '&fk_entrepot=' . $fk_entrepot;
print_barre_liste( print_barre_liste(
$texte, $texte,
$page, $page,
'replenish.php', 'replenish.php',
@ -511,7 +511,7 @@ print_barre_liste(
$filters .= '&mode=' . $mode; $filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier; $filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot; $filters .= '&fk_entrepot=' . $fk_entrepot;
print_barre_liste( print_barre_liste(
$texte, $texte,
$page, $page,
'replenish.php', 'replenish.php',

View File

@ -66,8 +66,8 @@ if (empty($conf) || ! is_object($conf)) {
// Warehouse or product // Warehouse or product
print '<tr>'; print '<tr>';
if ($object->element == 'product') if ($object->element == 'product')
{ {
print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>'; print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
print '<td>'; print '<td>';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
@ -76,9 +76,9 @@ if (empty($conf) || ! is_object($conf)) {
print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>'; print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>';
print '</select>'; print '</select>';
print '</td>'; print '</td>';
} }
if ($object->element == 'stock') if ($object->element == 'stock')
{ {
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>'; print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>'; print '<td>';
print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500'); print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
@ -87,7 +87,7 @@ if (empty($conf) || ! is_object($conf)) {
print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>'; print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>';
print '</select>'; print '</select>';
print '</td>'; print '</td>';
} }
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>'; print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
print '<td><input name="nbpiece" id="nbpiece" size="10" value="'.GETPOST("nbpiece").'"></td>'; print '<td><input name="nbpiece" id="nbpiece" size="10" value="'.GETPOST("nbpiece").'"></td>';
print '</tr>'; print '</tr>';
@ -96,21 +96,21 @@ if (empty($conf) || ! is_object($conf)) {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("UnitPurchaseValue").'</td>'; print '<td>'.$langs->trans("UnitPurchaseValue").'</td>';
print '<td colspan="'.(!empty($conf->projet->enabled) ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>'; print '<td colspan="'.(!empty($conf->projet->enabled) ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>';
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled))
{ {
print '<td>'.$langs->trans('Project').'</td>'; print '<td>'.$langs->trans('Project').'</td>';
print '<td>'; print '<td>';
$formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300'); $formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
print '</td>'; print '</td>';
} }
print '</tr>'; print '</tr>';
// Serial / Eat-by date // Serial / Eat-by date
if (! empty($conf->productbatch->enabled) && if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch()) (($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock')) || ($object->element == 'stock'))
) )
{ {
print '<tr>'; print '<tr>';
print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">'; print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
print '<input type="text" name="batch_number" size="40" value="'.GETPOST("batch_number").'">'; print '<input type="text" name="batch_number" size="40" value="'.GETPOST("batch_number").'">';
@ -126,7 +126,7 @@ if (empty($conf) || ! is_object($conf)) {
print $form->selectDate($sellbyselected, 'sellby', '', '', 1, ""); print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Label of mouvement of id of inventory // Label of mouvement of id of inventory
$valformovementlabel=((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref)); $valformovementlabel=((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref));

View File

@ -40,8 +40,8 @@ if (empty($conf) || ! is_object($conf)) {
$pdluo = new Productbatch($db); $pdluo = new Productbatch($db);
if ($pdluoid > 0) if ($pdluoid > 0)
{ {
$result=$pdluo->fetch($pdluoid); $result=$pdluo->fetch($pdluoid);
if ($result > 0) if ($result > 0)
{ {
@ -51,7 +51,7 @@ if (empty($conf) || ! is_object($conf)) {
{ {
dol_print_error($db, $pdluo->error, $pdluo->errors); dol_print_error($db, $pdluo->error, $pdluo->errors);
} }
} }
print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic'); print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic');
@ -62,28 +62,28 @@ if (empty($conf) || ! is_object($conf)) {
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="transfert_stock">'; print '<input type="hidden" name="action" value="transfert_stock">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($pdluoid) if ($pdluoid)
{ {
print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">'; print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Source warehouse or product // Source warehouse or product
print '<tr>'; print '<tr>';
if ($object->element == 'product') if ($object->element == 'product')
{ {
print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>'; print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
print '<td>'; print '<td>';
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1); print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid", 'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot', 'int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
print '</td>'; print '</td>';
} }
if ($object->element == 'stock') if ($object->element == 'stock')
{ {
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>'; print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>'; print '<td>';
print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500'); print $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
print '</td>'; print '</td>';
} }
print '<td class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td>'; print '<td class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td>';
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1); print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
@ -92,11 +92,11 @@ if (empty($conf) || ! is_object($conf)) {
print '</tr>'; print '</tr>';
// Serial / Eat-by date // Serial / Eat-by date
if (! empty($conf->productbatch->enabled) && if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch()) (($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock')) || ($object->element == 'stock'))
) )
{ {
print '<tr>'; print '<tr>';
print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">'; print '<td'.($object->element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
if ($pdluoid > 0) if ($pdluoid > 0)
@ -120,7 +120,7 @@ if (empty($conf) || ! is_object($conf)) {
print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Label // Label
$valformovementlabel=(GETPOST("label")?GETPOST("label"):$langs->trans("MovementTransferStock", $productref)); $valformovementlabel=(GETPOST("label")?GETPOST("label"):$langs->trans("MovementTransferStock", $productref));

View File

@ -108,7 +108,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
unset($data1); unset($data1);
if ($nocolor) if ($nocolor)
$px->SetDataColor(array ( $px->SetDataColor(array (
array ( array (
220, 220,
220, 220,

View File

@ -645,7 +645,7 @@ elseif ($id > 0 || ! empty($ref))
print '<br>'; print '<br>';
// Link to create task // Link to create task
$linktocreatetaskParam = array(); $linktocreatetaskParam = array();
$linktocreatetaskUserRight = false; $linktocreatetaskUserRight = false;
if ($user->rights->projet->all->creer || $user->rights->projet->creer) { if ($user->rights->projet->all->creer || $user->rights->projet->creer) {

View File

@ -356,7 +356,7 @@ if ($id > 0 || ! empty($ref))
/* /*
* Lines of contacts * Lines of contacts
*/ */
/* /*
// Contacts lines (modules that overwrite templates must declare this into descriptor) // Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
foreach($dirtpls as $reldir) foreach($dirtpls as $reldir)
@ -364,7 +364,7 @@ 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;
} }
*/ */
/* /*
* Add a new contact line * Add a new contact line

View File

@ -173,7 +173,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
* @depends testBonPrelevementOther * @depends testBonPrelevementOther
* The depends says test is run only if previous is ok * The depends says test is run only if previous is ok
*/ */
/* public function testBonPrelevementDelete($id) /* public function testBonPrelevementDelete($id)
{ {
global $conf,$user,$langs,$db; global $conf,$user,$langs,$db;
$conf=$this->savconf; $conf=$this->savconf;
@ -189,5 +189,5 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
return $result; return $result;
} }
*/ */
} }

View File

@ -265,7 +265,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
public function testExportPersonalizedWithFilter() public function testExportPersonalizedWithFilter()
{ {
global $conf,$user,$langs,$db; global $conf,$user,$langs,$db;
/* /*
$sql = "SELECT f.ref as f_ref, f.total as f_total, f.tva as f_tva FROM ".MAIN_DB_PREFIX."facture f"; $sql = "SELECT f.ref as f_ref, f.total as f_total, f.tva as f_tva FROM ".MAIN_DB_PREFIX."facture f";
$objexport=new Export($db); $objexport=new Export($db);
@ -303,7 +303,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, $array_filtervalue, $sql); $result=$objexport->build_file($user, $model, $datatoexport, $array_selected, $array_filtervalue, $sql);
$expectedresult=1; $expectedresult=1;
$this->assertEquals($expectedresult,$result); $this->assertEquals($expectedresult,$result);
*/ */
return true; return true;
} }

View File

@ -67,14 +67,14 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
), ),
// Geckodriver does not keep the session at the moment?! // Geckodriver does not keep the session at the moment?!
// XPath selectors also don't seem to work // XPath selectors also don't seem to work
// array( //array(
// 'browser' => 'Mozilla Firefox on Linux', // 'browser' => 'Mozilla Firefox on Linux',
// 'browserName' => 'firefox', // 'browserName' => 'firefox',
// 'sessionStrategy' => 'shared', // 'sessionStrategy' => 'shared',
// 'desiredCapabilities' => array( // 'desiredCapabilities' => array(
// 'marionette' => true // 'marionette' => true
// ) // )
// ) //)
); );
/** /**