Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
Browse files Browse the repository at this point in the history
develop_dict
  • Loading branch information
hregis committed Jun 18, 2017
2 parents a029904 + 862b12a commit dcc152d
Show file tree
Hide file tree
Showing 36 changed files with 406 additions and 165 deletions.
6 changes: 5 additions & 1 deletion htdocs/admin/defaultvalues.php
@@ -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
Expand Down Expand Up @@ -60,6 +61,9 @@
$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
Expand Down
36 changes: 23 additions & 13 deletions htdocs/admin/modules.php
@@ -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
Expand Down Expand Up @@ -75,11 +75,18 @@
$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='';
Expand Down Expand Up @@ -204,15 +211,15 @@
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;
}

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;
}

Expand Down Expand Up @@ -476,10 +483,13 @@
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

Expand Down Expand Up @@ -659,7 +669,7 @@
}
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>';
}
Expand Down Expand Up @@ -755,7 +765,7 @@
}
}
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');
Expand Down
7 changes: 5 additions & 2 deletions htdocs/admin/translation.php
@@ -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
Expand Down Expand Up @@ -56,6 +56,9 @@
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
Expand Down
15 changes: 12 additions & 3 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -3097,9 +3097,18 @@ function getTotalWeightVolume()
$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)
{
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/lib/product.lib.php
Expand Up @@ -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')
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/inc.php
Expand Up @@ -458,7 +458,7 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0)
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],1 );
if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING']; }
}
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").' ->"';
Expand Down
64 changes: 0 additions & 64 deletions htdocs/install/mysql/migration/6.0.0-7.0.0.sql

This file was deleted.

10 changes: 5 additions & 5 deletions htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_blockedlog.sql
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_chargesociales.sql
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_commande.sql
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_commande_fournisseur.sql
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_don.sql
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions htdocs/install/mysql/tables/llx_loan_schedule.sql
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_paiementcharge.sql
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_paiementfourn.sql
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_payment_donation.sql
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_payment_expensereport.sql
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions htdocs/install/mysql/tables/llx_payment_loan.sql
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions htdocs/install/mysql/tables/llx_payment_salary.sql
Expand Up @@ -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),
Expand Down

0 comments on commit dcc152d

Please sign in to comment.