Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
9a04208150
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -60,6 +61,9 @@ $urlpage = GETPOST('urlpage');
|
|||||||
$key = GETPOST('key');
|
$key = GETPOST('key');
|
||||||
$value = GETPOST('value');
|
$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
|
* Actions
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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';
|
$dirins=DOL_DOCUMENT_ROOT.'/custom';
|
||||||
$urldolibarrmodules='https://www.dolistore.com/';
|
$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
|
* 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'))
|
if (GETPOST('buttonreset','alpha'))
|
||||||
{
|
{
|
||||||
$search_keyword='';
|
$search_keyword='';
|
||||||
@ -204,7 +211,7 @@ if ($action == 'set' && $user->admin)
|
|||||||
setEventMessages($msg, null, 'warnings');
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +219,7 @@ if ($action == 'reset' && $user->admin)
|
|||||||
{
|
{
|
||||||
$result=unActivateModule($value);
|
$result=unActivateModule($value);
|
||||||
if ($result) setEventMessages($result, null, 'errors');
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,10 +483,13 @@ if ($mode == 'common')
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$moreforfilter='';
|
||||||
|
|
||||||
print '<div class="clearboth"></div><br>';
|
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
|
// Show list of modules
|
||||||
|
|
||||||
@ -659,7 +669,7 @@ if ($mode == 'common')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value=' . $modName . '&mode=' . $mode . $param . '">';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value=' . $modName . '&mode=' . $mode . $param . '">';
|
||||||
print img_picto($langs->trans("Activated"),'switch_on');
|
print img_picto($langs->trans("Activated"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@ -755,7 +765,7 @@ if ($mode == 'common')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
||||||
print '<a class="reposition" href="modules.php?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value=' . $modName . '&mode=' . $mode . $param . '"';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value=' . $modName . '&mode=' . $mode . $param . '"';
|
||||||
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
||||||
print '>';
|
print '>';
|
||||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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 (! $sortfield) $sortfield='lang,transkey';
|
||||||
if (! $sortorder) $sortorder='ASC';
|
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
|
* Actions
|
||||||
|
|||||||
@ -3097,9 +3097,18 @@ abstract class CommonObject
|
|||||||
$trueWeightUnit=pow(10, $weightUnit);
|
$trueWeightUnit=pow(10, $weightUnit);
|
||||||
$totalWeight += $weight * $qty * $trueWeightUnit;
|
$totalWeight += $weight * $qty * $trueWeightUnit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
if ($weight_units == 99) {
|
||||||
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
|
// 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)
|
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -441,7 +441,8 @@ function measuring_units_string($unit,$measuring_style='')
|
|||||||
$measuring_units[0] = $langs->transnoentitiesnoconv("WeightUnitkg");
|
$measuring_units[0] = $langs->transnoentitiesnoconv("WeightUnitkg");
|
||||||
$measuring_units[-3] = $langs->transnoentitiesnoconv("WeightUnitg");
|
$measuring_units[-3] = $langs->transnoentitiesnoconv("WeightUnitg");
|
||||||
$measuring_units[-6] = $langs->transnoentitiesnoconv("WeightUnitmg");
|
$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')
|
else if ($measuring_style == 'size')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -124,6 +124,7 @@ WeightUnitkg=kg
|
|||||||
WeightUnitg=g
|
WeightUnitg=g
|
||||||
WeightUnitmg=mg
|
WeightUnitmg=mg
|
||||||
WeightUnitpound=pound
|
WeightUnitpound=pound
|
||||||
|
WeightUnitounce=ounce
|
||||||
Length=Length
|
Length=Length
|
||||||
LengthUnitm=m
|
LengthUnitm=m
|
||||||
LengthUnitdm=dm
|
LengthUnitdm=dm
|
||||||
|
|||||||
@ -307,7 +307,7 @@ class FormProduct
|
|||||||
$return='';
|
$return='';
|
||||||
|
|
||||||
$measuring_units=array();
|
$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 == '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 == '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
|
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
|
||||||
|
|||||||
@ -203,7 +203,7 @@ if ($resql)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
$db->free();
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user