fix travcis

This commit is contained in:
florian HENRY 2019-02-13 10:28:08 +01:00
parent e2d13c0e1f
commit de87321c15
5 changed files with 86 additions and 62 deletions

View File

@ -166,7 +166,6 @@ class CMeasuringUnits // extends CommonObject
* @param int $id Id object * @param int $id Id object
* @param string $unit_type unit type * @param string $unit_type unit type
* @param string $code Code * @param string $code Code
* @param string $label Label
* @param string $short_label Short Label * @param string $short_label Short Label
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */

View File

@ -474,7 +474,11 @@ function measuring_units_string($unit, $measuring_style = '')
global $langs, $db; global $langs, $db;
require_once DOL_DOCUMENT_ROOT.'/core/class/cmeasuringunits.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/cmeasuringunits.class.php';
$measuringUnits= new CMeasuringUnits($db); $measuringUnits= new CMeasuringUnits($db);
$result=$measuringUnits->fetchAll('','', 0, 0, array('t.code'=> $unit,'t.unit_type'=>$measuring_style,'t.active'=>1)); $result = $measuringUnits->fetchAll('', '', 0, 0, array(
't.code' => $unit,
't.unit_type' => $measuring_style,
't.active' => 1
));
if ($result<0) { if ($result<0) {
return -1; return -1;

View File

@ -320,19 +320,21 @@ class FormProduct
require_once DOL_DOCUMENT_ROOT . '/core/class/cmeasuringunits.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/cmeasuringunits.class.php';
$measuringUnits = new CMeasuringUnits($db); $measuringUnits = new CMeasuringUnits($db);
$result=$measuringUnits->fetchAll('','', 0, 0, array('t.unit_type'=>$measuring_style,'t.active'=>1)); $result = $measuringUnits->fetchAll('', '', 0, 0, array(
't.unit_type' => $measuring_style,
't.active' => 1
));
if ($result < 0) { if ($result < 0) {
dol_print_error($db); dol_print_error($db);
return - 1; return - 1;
} else { } else {
$return .= '<select class="flat" name="' . $name . '">'; $return .= '<select class="flat" name="' . $name . '">';
if ($adddefault) $return.= '<option value="0">'.$langs->trans("Default").'</option>'; if ($adddefault)
$return .= '<option value="0">' . $langs->trans("Default") . '</option>';
foreach ($measuringUnits->records as $lines) foreach ( $measuringUnits->records as $lines ) {
{
$return .= '<option value="' . $lines->code . '"'; $return .= '<option value="' . $lines->code . '"';
if ($key == $default) if ($key == $default) {
{
$return .= ' selected'; $return .= ' selected';
} }
// $return.= '>'.$value.'</option>'; // $return.= '>'.$value.'</option>';

View File

@ -131,7 +131,8 @@ if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $mass
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
@ -203,7 +204,9 @@ if ($action == "correct_stock")
GETPOST("mouvement"), GETPOST("mouvement"),
GETPOST("label", 'san_alpha'), GETPOST("label", 'san_alpha'),
GETPOST('unitprice'), GETPOST('unitprice'),
$eatby,$sellby,$batch, $eatby,
$sellby,
$batch,
GETPOST('inventorycode'), GETPOST('inventorycode'),
$origin_element, $origin_element,
$origin_id $origin_id
@ -909,21 +912,36 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if (! empty($arrayfields['m.rowid']['checked'])) print_liste_field_titre($arrayfields['m.rowid']['label'],$_SERVER["PHP_SELF"],'m.rowid','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['m.rowid']['checked']))
if (! empty($arrayfields['m.datem']['checked'])) print_liste_field_titre($arrayfields['m.datem']['label'],$_SERVER["PHP_SELF"],'m.datem','',$param,'',$sortfield,$sortorder); print_liste_field_titre($arrayfields['m.rowid']['label'], $_SERVER["PHP_SELF"], 'm.rowid', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['m.datem']['checked']))
if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'],$_SERVER["PHP_SELF"],'p.label','',$param,'',$sortfield,$sortorder); print_liste_field_titre($arrayfields['m.datem']['label'], $_SERVER["PHP_SELF"], 'm.datem', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['p.ref']['checked']))
if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['p.label']['checked']))
if (! empty($arrayfields['e.ref']['checked'])) print_liste_field_titre($arrayfields['e.ref']['label'],$_SERVER["PHP_SELF"], "e.ref","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.batch']['checked']))
if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); print_liste_field_titre($arrayfields['m.batch']['label'], $_SERVER["PHP_SELF"], 'm.batch', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['pl.eatby']['checked']))
if (! empty($arrayfields['m.type_mouvement']['checked'])) print_liste_field_titre($arrayfields['m.type_mouvement']['label'],$_SERVER["PHP_SELF"], "m.type_mouvement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($arrayfields['pl.eatby']['label'], $_SERVER["PHP_SELF"], 'pl.eatby', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['origin']['checked'])) print_liste_field_titre($arrayfields['origin']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['pl.sellby']['checked']))
if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($arrayfields['m.value']['label'],$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($arrayfields['pl.sellby']['label'], $_SERVER["PHP_SELF"], 'pl.sellby', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['m.price']['checked'])) print_liste_field_titre($arrayfields['m.price']['label'],$_SERVER["PHP_SELF"], "m.price","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['e.ref']['checked']))
print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); // We are on a specific warehouse card, no filter on other should be possible
if (! empty($arrayfields['m.fk_user_author']['checked']))
print_liste_field_titre($arrayfields['m.fk_user_author']['label'], $_SERVER["PHP_SELF"], "m.fk_user_author", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['m.inventorycode']['checked']))
print_liste_field_titre($arrayfields['m.inventorycode']['label'], $_SERVER["PHP_SELF"], "m.inventorycode", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['m.label']['checked']))
print_liste_field_titre($arrayfields['m.label']['label'], $_SERVER["PHP_SELF"], "m.label", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['m.type_mouvement']['checked']))
print_liste_field_titre($arrayfields['m.type_mouvement']['label'], $_SERVER["PHP_SELF"], "m.type_mouvement", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['origin']['checked']))
print_liste_field_titre($arrayfields['origin']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['m.value']['checked']))
print_liste_field_titre($arrayfields['m.value']['label'], $_SERVER["PHP_SELF"], "m.value", "", $param, 'align="right"', $sortfield, $sortorder);
if (! empty($arrayfields['m.price']['checked']))
print_liste_field_titre($arrayfields['m.price']['label'], $_SERVER["PHP_SELF"], "m.price", "", $param, 'align="right"', $sortfield, $sortorder);
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@ -1054,7 +1072,8 @@ if ($resql)
if (! empty($arrayfields['m.type_mouvement']['checked'])) if (! empty($arrayfields['m.type_mouvement']['checked']))
{ {
// Type of movement // Type of movement
switch($objp->type_mouvement){ switch($objp->type_mouvement)
{
case "0": case "0":
print '<td align="center">'.$langs->trans('StockIncreaseAfterCorrectTransfer').'</td>'; print '<td align="center">'.$langs->trans('StockIncreaseAfterCorrectTransfer').'</td>';
break; break;