Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0
Conflicts: htdocs/compta/facture/invoicetemplate_list.php
This commit is contained in:
commit
8e3620fce1
@ -1903,6 +1903,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||
}
|
||||
else{
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
|
||||
@ -1965,7 +1968,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position';
|
||||
|
||||
$fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'';
|
||||
|
||||
if ($fieldlist[$field]=='sortorder')
|
||||
{
|
||||
$fieldlist[$field]='position';
|
||||
}
|
||||
|
||||
$classtd=''; $class='';
|
||||
if ($fieldlist[$field]=='code') $classtd='width100';
|
||||
@ -1982,7 +1991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
}
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
|
||||
$langs->load("bills");
|
||||
$transkey="PaymentCondition".strtoupper($obj->code);
|
||||
$transkey="PaymentConditionShort".strtoupper($obj->code);
|
||||
}
|
||||
if ($transkey && $langs->trans($transkey) != $transkey)
|
||||
{
|
||||
@ -1992,8 +2001,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
}
|
||||
if (! $transfound)
|
||||
{
|
||||
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.dol_escape_htmltag(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.dol_escape_htmltag($fieldValue).'" name="'.$fieldlist[$field].'">';
|
||||
}
|
||||
else{
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -252,7 +253,10 @@ if ($action == 'add')
|
||||
{
|
||||
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n";
|
||||
}
|
||||
else $object->label = $cactioncomm->libelle;
|
||||
else {
|
||||
$cactioncomm->fetch($object->type_code);
|
||||
$object->label = $cactioncomm->label;
|
||||
}
|
||||
}
|
||||
}
|
||||
$object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
|
||||
|
||||
@ -261,7 +261,7 @@ if ($search_month_date_when > 0)
|
||||
if ($search_year_date_when > 0 && empty($search_day_date_when))
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when, $search_month_date_when, false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when, $search_month_date_when, false))."'";
|
||||
elseif ($search_year_date_when > 0 && ! empty($search_day_date_when))
|
||||
$sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'";
|
||||
}
|
||||
|
||||
@ -34,6 +34,15 @@ if ($resql) // This can fail when class is used on old database (during migra
|
||||
case 'boolean':
|
||||
$typeFilter="Boolean";
|
||||
break;
|
||||
case 'select':
|
||||
if (! empty($conf->global->EXPORT_LABEL_FOR_SELECT))
|
||||
{
|
||||
$tmpparam=unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...)
|
||||
if ($tmpparam['options'] && is_array($tmpparam['options'])) {
|
||||
$typeFilter="Select:".$obj->param;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'sellist':
|
||||
$tmp='';
|
||||
$tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null
|
||||
|
||||
@ -242,7 +242,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
||||
// We ask to move a qty
|
||||
if (GETPOST($qty) != 0) {
|
||||
if (! (GETPOST($ent, 'int') > 0)) {
|
||||
dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed');
|
||||
dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.');
|
||||
$text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline);
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors');
|
||||
$error ++;
|
||||
@ -279,7 +279,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
||||
// We ask to move a qty
|
||||
if (GETPOST($qty) > 0) {
|
||||
if (! (GETPOST($ent, 'int') > 0)) {
|
||||
dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed');
|
||||
dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.');
|
||||
$text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline) . '-' . ($reg[1] + 1);
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors');
|
||||
$error ++;
|
||||
|
||||
@ -245,12 +245,12 @@ if ($action == 'set')
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
|
||||
if ($action == 'other')
|
||||
{
|
||||
$value = GETPOST('activate_units', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
//if ($action == 'other')
|
||||
//{
|
||||
// $value = GETPOST('activate_units', 'alpha');
|
||||
// $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity);
|
||||
// if (! $res > 0) $error++;
|
||||
//}
|
||||
|
||||
if ($action)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user