Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop_bug_restapi

This commit is contained in:
Regis Houssin 2017-06-17 18:29:38 +02:00
commit 88df5b6857
29 changed files with 87 additions and 123 deletions

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
@ -60,6 +61,9 @@ $urlpage = GETPOST('urlpage');
$key = GETPOST('key');
$value = GETPOST('value');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('admindefaultvalues','globaladmin'));
/*
* Actions

View File

@ -1,12 +1,12 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -75,11 +75,18 @@ if ($search_version) $param.='&search_version='.urlencode($search_version);
$dirins=DOL_DOCUMENT_ROOT.'/custom';
$urldolibarrmodules='https://www.dolistore.com/';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('adminmodules','globaladmin'));
/*
* Actions
*/
$parameters=array();
$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 (GETPOST('buttonreset','alpha'))
{
$search_keyword='';
@ -204,7 +211,7 @@ if ($action == 'set' && $user->admin)
setEventMessages($msg, null, 'warnings');
}
}
header("Location: modules.php?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
exit;
}
@ -212,7 +219,7 @@ if ($action == 'reset' && $user->admin)
{
$result=unActivateModule($value);
if ($result) setEventMessages($result, null, 'errors');
header("Location: modules.php?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
exit;
}
@ -476,10 +483,13 @@ if ($mode == 'common')
print $hookmanager->resPrint;
}
$moreforfilter='';
print '<div class="clearboth"></div><br>';
$moreforfilter='';
$parameters=array();
$reshook=$hookmanager->executeHooks('insertExtraHeader',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Show list of modules
@ -659,7 +669,7 @@ if ($mode == 'common')
}
else
{
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . $param . '">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . $param . '">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a>';
}
@ -755,7 +765,7 @@ if ($mode == 'common')
}
}
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . $param . '"';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . $param . '"';
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
print '>';
print img_picto($langs->trans("Disabled"),'switch_off');

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
@ -56,6 +56,9 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield='lang,transkey';
if (! $sortorder) $sortorder='ASC';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('admintranslation','globaladmin'));
/*
* Actions

View File

@ -3097,9 +3097,18 @@ abstract class CommonObject
$trueWeightUnit=pow(10, $weightUnit);
$totalWeight += $weight * $qty * $trueWeightUnit;
}
else
{
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
else {
if ($weight_units == 99) {
// conversion 1 Pound = 0.45359237 KG
$trueWeightUnit = 0.45359237;
$totalWeight += $weight * $qty * $trueWeightUnit;
} elseif ($weight_units == 98) {
// conversion 1 Ounce = 0.0283495 KG
$trueWeightUnit = 0.0283495;
$totalWeight += $weight * $qty * $trueWeightUnit;
}
else
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
}
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{

View File

@ -441,7 +441,8 @@ function measuring_units_string($unit,$measuring_style='')
$measuring_units[0] = $langs->transnoentitiesnoconv("WeightUnitkg");
$measuring_units[-3] = $langs->transnoentitiesnoconv("WeightUnitg");
$measuring_units[-6] = $langs->transnoentitiesnoconv("WeightUnitmg");
$measuring_units[99] = $langs->transnoentitiesnoconv("WeightUnitpound");
$measuring_units[98] = $langs->transnoentitiesnoconv("WeightUnitounce");
$measuring_units[99] = $langs->transnoentitiesnoconv("WeightUnitpound");
}
else if ($measuring_style == 'size')
{

View File

@ -385,12 +385,12 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='',$css
// We force the content charset
header("Content-type: text/html; charset=".$conf->file->character_set_client);
header("X-Content-Type-Options: nosniff");
print '<!DOCTYPE HTML>'."\n";
print '<html>'."\n";
print '<head>'."\n";
print '<meta charset='.$conf->file->character_set_client.'">'."\n";
print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
print '<link rel="stylesheet" type="text/css" href="default.css">'."\n";
print '<!-- Includes CSS for JQuery -->'."\n";
@ -453,7 +453,7 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0)
print '<div class="nextbutton" id="nextbutton">';
if ($nonext == '2')
{
print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'<br><br>';
print $langs->trans("ErrorFoundDuringMigration", isset($_SERVER["REQUEST_URI"])?$_SERVER["REQUEST_URI"].'&ignoreerrors=1':'').'<br><br>';
}
print '<input type="submit" '.($nonext == '2' ? 'disabled="disabled" ':'').'value="'.$langs->trans("NextStep").' ->"';

View File

@ -1,64 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 6.0.0 or higher.
--
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
-- To drop an index: -- VMYSQL4.0 DROP INDEX nomindex on llx_table
-- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- To make pk to be auto increment (postgres): -- VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL;
-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL;
-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
-- Note: fields with type BLOB/TEXT can't have default value.
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
-- Clean corrupted values for tms
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
-- Remove default not null on date_fin
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
-- Move real to numeric for more precision for storing monetary amounts (no rouding)
-- https://wiki.dolibarr.org/index.php/Langages_et_normes#Structure_des_tables_et_champs
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN debit numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN credit numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN montant numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN multicurrency_amount numeric(24,8);
ALTER TABLE llx_blockedlog MODIFY COLUMN amounts numeric(24,8);
ALTER TABLE llx_chargessociales MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN amount_ht numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN amount_ht numeric(24,8);
ALTER TABLE llx_don MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_capital numeric(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_insurance numeric(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_interest numeric(24,8);
ALTER TABLE llx_paiementcharge MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_paiementfourn MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_payment_donation MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_payment_expensereport MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_capital numeric(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_insurance numeric(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_interest numeric(24,8);
ALTER TABLE llx_payment_salary MODIFY COLUMN salary numeric(24,8);
ALTER TABLE llx_payment_salary MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_prelevement_bons MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_prelevement_lignes MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_societe MODIFY COLUMN capital numeric(24,8);
ALTER TABLE llx_tva MODIFY COLUMN amount numeric(24,8);

View File

@ -26,17 +26,17 @@ CREATE TABLE llx_accounting_bookkeeping
doc_ref varchar(300) NOT NULL, -- | facture_client/reglement_client/... reference number
fk_doc integer NOT NULL, -- | facture_client/reglement_client/... rowid
fk_docdet integer NOT NULL, -- | facture_client/reglement_client/... line rowid
thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug)
thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug)
subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account
subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account
numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number
label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
label_operation varchar(255), -- FEC:EcritureLib | label of the operation
debit numeric(24,8) NOT NULL, -- FEC:Debit
credit numeric(24,8) NOT NULL, -- FEC:Credit
montant numeric(24,8) NOT NULL, -- FEC:Montant (Not necessary)
debit double NOT NULL, -- FEC:Debit
credit double NOT NULL, -- FEC:Credit
montant double NOT NULL, -- FEC:Montant (Not necessary)
sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
multicurrency_amount numeric(24,8), -- FEC:Montantdevise
multicurrency_amount double, -- FEC:Montantdevise
multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet

View File

@ -4,7 +4,7 @@ CREATE TABLE llx_blockedlog
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
action varchar(50),
amounts numeric(24,8) NOT NULL,
amounts real NOT NULL,
signature varchar(100) NOT NULL,
signature_line varchar(100) NOT NULL,
element varchar(50),

View File

@ -34,7 +34,7 @@ create table llx_chargesociales
fk_type integer NOT NULL,
fk_account integer, -- bank account
fk_mode_reglement integer, -- mode de reglement
amount numeric(24,8) default 0 NOT NULL,
amount real default 0 NOT NULL,
paye smallint default 0 NOT NULL,
periode date,
fk_projet integer DEFAULT NULL,

View File

@ -42,7 +42,7 @@ create table llx_commande
fk_user_cloture integer, -- user closing
source smallint, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ?
fk_statut smallint default 0,
amount_ht numeric(24,8) default 0,
amount_ht real default 0,
remise_percent real default 0,
remise_absolue real default 0,
remise real default 0,

View File

@ -46,7 +46,7 @@ create table llx_commande_fournisseur
source smallint NOT NULL, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ?
fk_statut smallint default 0,
billed smallint default 0,
amount_ht numeric(24,8) default 0,
amount_ht real default 0,
remise_percent real default 0,
remise real default 0,
tva double(24,8) default 0,

View File

@ -28,7 +28,7 @@ create table llx_don
tms timestamp,
fk_statut smallint NOT NULL DEFAULT 0, -- Status of donation promise or validate
datedon datetime, -- Date of the donation/promise
amount numeric(24,8) DEFAULT 0,
amount real DEFAULT 0,
fk_payment integer,
paid smallint default 0 NOT NULL,
firstname varchar(50),

View File

@ -24,9 +24,9 @@ create table llx_loan_schedule
datec datetime, -- creation date
tms timestamp,
datep datetime, -- payment date
amount_capital numeric(24,8) DEFAULT 0,
amount_insurance numeric(24,8) DEFAULT 0,
amount_interest numeric(24,8) DEFAULT 0,
amount_capital real DEFAULT 0,
amount_insurance real DEFAULT 0,
amount_interest real DEFAULT 0,
fk_typepayment integer NOT NULL,
num_payment varchar(50),
note_private text,

View File

@ -23,7 +23,7 @@ create table llx_paiementcharge
datec datetime, -- date de creation
tms timestamp,
datep datetime, -- payment date
amount numeric(24,8) DEFAULT 0,
amount real DEFAULT 0,
fk_typepaiement integer NOT NULL,
num_paiement varchar(50),
note text,

View File

@ -25,7 +25,7 @@ create table llx_paiementfourn
tms timestamp,
datec datetime, -- date de creation de l'enregistrement
datep datetime, -- date de paiement
amount numeric(24,8) DEFAULT 0, -- montant
amount real DEFAULT 0, -- montant
multicurrency_amount double(24,8) DEFAULT 0, -- multicurrency amount
fk_user_author integer, -- auteur
fk_paiement integer NOT NULL, -- moyen de paiement

View File

@ -23,7 +23,7 @@ create table llx_payment_donation
datec datetime, -- date de creation
tms timestamp,
datep datetime, -- payment date
amount numeric(24,8) DEFAULT 0,
amount real DEFAULT 0,
fk_typepayment integer NOT NULL,
num_payment varchar(50),
note text,

View File

@ -23,7 +23,7 @@ create table llx_payment_expensereport
datec datetime, -- date de creation
tms timestamp,
datep datetime, -- payment date
amount numeric(24,8) DEFAULT 0,
amount real DEFAULT 0,
fk_typepayment integer NOT NULL,
num_payment varchar(50),
note text,

View File

@ -24,9 +24,9 @@ create table llx_payment_loan
datec datetime, -- creation date
tms timestamp,
datep datetime, -- payment date
amount_capital numeric(24,8) DEFAULT 0,
amount_insurance numeric(24,8) DEFAULT 0,
amount_interest numeric(24,8) DEFAULT 0,
amount_capital real DEFAULT 0,
amount_insurance real DEFAULT 0,
amount_interest real DEFAULT 0,
fk_typepayment integer NOT NULL,
num_payment varchar(50),
note_private text,

View File

@ -24,8 +24,8 @@ create table llx_payment_salary
fk_user integer NOT NULL,
datep date, -- date de paiement
datev date, -- date de valeur (this field should not be here, only into bank tables)
salary numeric(24,8), -- salary of user when payment was done
amount numeric(24,8) NOT NULL DEFAULT 0,
salary real, -- salary of user when payment was done
amount real NOT NULL DEFAULT 0,
fk_typepayment integer NOT NULL,
num_payment varchar(50), -- ref
label varchar(255),

View File

@ -29,7 +29,7 @@ create table llx_prelevement_bons
ref varchar(12), -- reference
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime, -- date de creation
amount numeric(24,8) DEFAULT 0, -- montant total du prelevement
amount real DEFAULT 0, -- montant total du prelevement
statut smallint DEFAULT 0, -- statut
credite smallint DEFAULT 0, -- indique si le prelevement a ete credite
note text,

View File

@ -21,7 +21,7 @@ create table llx_prelevement_facture_demande
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_facture integer NOT NULL,
amount numeric(24,8) NOT NULL,
amount real NOT NULL,
date_demande datetime NOT NULL,
traite smallint DEFAULT 0,
date_traite datetime,

View File

@ -24,7 +24,7 @@ create table llx_prelevement_lignes
statut smallint DEFAULT 0,
client_nom varchar(255),
amount numeric(24,8) DEFAULT 0,
amount real DEFAULT 0,
code_banque varchar(128),
code_guichet varchar(6),
number varchar(255),

View File

@ -64,7 +64,7 @@ create table llx_societe
idprof5 varchar(128), -- IDProf5: nu for france
idprof6 varchar(128), -- IDProf6: nu for france
tva_intra varchar(20), -- tva
capital numeric(24,8), -- capital de la societe
capital real, -- capital de la societe
fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut
note_private text, --
note_public text, --

View File

@ -24,11 +24,11 @@ create table llx_tva
datec datetime, -- Create date
datep date, -- date de paiement
datev date, -- date de valeur
amount numeric(24,8) NOT NULL DEFAULT 0,
amount real NOT NULL DEFAULT 0,
fk_typepayment integer NULL,
num_payment varchar(50),
label varchar(255),
entity integer DEFAULT 1 NOT NULL, -- multi company id
entity integer DEFAULT 1 NOT NULL, -- multi company id
note text,
fk_bank integer,
fk_user_creat integer, -- utilisateur who create record

View File

@ -124,6 +124,7 @@ WeightUnitkg=kg
WeightUnitg=g
WeightUnitmg=mg
WeightUnitpound=pound
WeightUnitounce=ounce
Length=Length
LengthUnitm=m
LengthUnitdm=dm

View File

@ -307,7 +307,7 @@ class FormProduct
$return='';
$measuring_units=array();
if ($measuring_style == 'weight') $measuring_units=array(-6=>1,-3=>1,0=>1,3=>1,99=>1);
if ($measuring_style == 'weight') $measuring_units=array(-6=>1,-3=>1,0=>1,3=>1,98=>1,99=>1);
else if ($measuring_style == 'size') $measuring_units=array(-3=>1,-2=>1,-1=>1,0=>1,98=>1,99=>1);
else if ($measuring_style == 'surface') $measuring_units=array(-6=>1,-4=>1,-2=>1,0=>1,98=>1,99=>1);
else if ($measuring_style == 'volume') $measuring_units=array(-9=>1,-6=>1,-3=>1,0=>1,88=>1,89=>1,97=>1,99=>1,/* 98=>1 */); // Liter is not used as already available with dm3

View File

@ -203,7 +203,7 @@ if ($resql)
print '</div>';
print "</form>\n";
$db->free();
$db->free($resql);
}
else
{

View File

@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@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