Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0
This commit is contained in:
commit
5018bf1baf
@ -61,7 +61,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/del_(.*)/',$action,$reg))
|
if (preg_match('/del_(.*)/',$action,$reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
@ -79,7 +79,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
|||||||
if ($action == 'add_currency')
|
if ($action == 'add_currency')
|
||||||
{
|
{
|
||||||
$langs->loadCacheCurrencies('');
|
$langs->loadCacheCurrencies('');
|
||||||
|
|
||||||
$code = GETPOST('code', 'alpha');
|
$code = GETPOST('code', 'alpha');
|
||||||
$rate = GETPOST('rate', 'alpha');
|
$rate = GETPOST('rate', 'alpha');
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
@ -96,23 +96,23 @@ if ($action == 'add_currency')
|
|||||||
elseif ($action == 'update_currency')
|
elseif ($action == 'update_currency')
|
||||||
{
|
{
|
||||||
$submit = GETPOST('submit', 'alpha');
|
$submit = GETPOST('submit', 'alpha');
|
||||||
|
|
||||||
if ($submit == $langs->trans('Modify'))
|
if ($submit == $langs->trans('Modify'))
|
||||||
{
|
{
|
||||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||||
$rate = GETPOST('rate', 'float');
|
$rate = price2num(GETPOST('rate', 'alpha'));
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
|
|
||||||
if ($currency->fetch($fk_multicurrency) > 0)
|
if ($currency->fetch($fk_multicurrency) > 0)
|
||||||
{
|
{
|
||||||
$currency->updateRate($rate);
|
$currency->updateRate($rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($submit == $langs->trans('Delete'))
|
elseif ($submit == $langs->trans('Delete'))
|
||||||
{
|
{
|
||||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
|
|
||||||
if ($currency->fetch($fk_multicurrency) > 0)
|
if ($currency->fetch($fk_multicurrency) > 0)
|
||||||
{
|
{
|
||||||
if ($currency->delete() > 0) setEventMessages($langs->trans('RecordDeleted'), array());
|
if ($currency->delete() > 0) setEventMessages($langs->trans('RecordDeleted'), array());
|
||||||
@ -120,14 +120,14 @@ elseif ($action == 'update_currency')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($action == 'synchronize')
|
elseif ($action == 'synchronize')
|
||||||
{
|
{
|
||||||
$response = GETPOST('response');
|
$response = GETPOST('response');
|
||||||
$response = json_decode($response);
|
$response = json_decode($response);
|
||||||
|
|
||||||
if ($response->success)
|
if ($response->success)
|
||||||
{
|
{
|
||||||
MultiCurrency::syncRates($response);
|
MultiCurrency::syncRates($response);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -226,7 +226,7 @@ print '</form>';
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO uncomment when the functionality will integrated
|
/* TODO uncomment when the functionality will integrated
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").'</td>';
|
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").'</td>';
|
||||||
@ -259,8 +259,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print $langs->trans("Value").' <input type="button" id="bt_sync" class="button" onclick="javascript:getRates();" value="'.$langs->trans('Synchronize').'" />';
|
print $langs->trans("Value").' <input type="button" id="bt_sync" class="button" onclick="javascript:getRates();" value="'.$langs->trans('Synchronize').'" />';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td><a target="_blank" href="https://currencylayer.com">'.$langs->transnoentitiesnoconv("multicurrency_appId").'</a></td>';
|
print '<td><a target="_blank" href="https://currencylayer.com">'.$langs->transnoentitiesnoconv("multicurrency_appId").'</a></td>';
|
||||||
@ -273,7 +273,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").'</td>';
|
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").'</td>';
|
||||||
@ -286,7 +286,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").'</td>';
|
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").'</td>';
|
||||||
@ -299,7 +299,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
|||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ print '</td></form></tr>';
|
|||||||
foreach ($TCurrency as &$currency)
|
foreach ($TCurrency as &$currency)
|
||||||
{
|
{
|
||||||
if($currency->code == $conf->currency) continue;
|
if($currency->code == $conf->currency) continue;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$currency->code.' - '.$currency->name.'</td>';
|
print '<td>'.$currency->code.' - '.$currency->name.'</td>';
|
||||||
@ -363,7 +363,7 @@ print '
|
|||||||
{
|
{
|
||||||
$("#bt_sync").attr("disabled", true);
|
$("#bt_sync").attr("disabled", true);
|
||||||
var url_sync = "http://apilayer.net/api/live?access_key='.$conf->global->MULTICURRENCY_APP_ID.'&format=1'.(!empty($conf->global->MULTICURRENCY_APP_SOURCE) ? '&source='.$conf->global->MULTICURRENCY_APP_SOURCE : '').'";
|
var url_sync = "http://apilayer.net/api/live?access_key='.$conf->global->MULTICURRENCY_APP_ID.'&format=1'.(!empty($conf->global->MULTICURRENCY_APP_SOURCE) ? '&source='.$conf->global->MULTICURRENCY_APP_SOURCE : '').'";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url_sync,
|
url: url_sync,
|
||||||
dataType: "jsonp"
|
dataType: "jsonp"
|
||||||
|
|||||||
@ -2541,7 +2541,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
if (! empty($conf->expedition->enabled)) {
|
if (! empty($conf->expedition->enabled)) {
|
||||||
$numshipping = $object->nb_expedition();
|
$numshipping = $object->nb_expedition();
|
||||||
|
|
||||||
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfProductsLines() > 0) {
|
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||||
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
|
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
|
||||||
if ($user->rights->expedition->creer) {
|
if ($user->rights->expedition->creer) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/expedition/shipment.php?id=' . $object->id . '">' . $langs->trans('CreateShipment') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/expedition/shipment.php?id=' . $object->id . '">' . $langs->trans('CreateShipment') . '</a></div>';
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
-- when current version is 4.0.0 or higher.
|
-- when current version is 4.0.0 or higher.
|
||||||
--
|
--
|
||||||
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
||||||
|
-- -- VPGSQL8.2 ALTER SEQUENCE IF EXISTS llx_table_rowid_seq RENAME TO llx_table_new_rowid_seq;
|
||||||
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
-- 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 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 drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
||||||
@ -120,6 +121,8 @@ create table llx_expensereport_extrafields
|
|||||||
ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafields (fk_object);
|
ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafields (fk_object);
|
||||||
|
|
||||||
ALTER TABLE llx_cotisation RENAME TO llx_subscription;
|
ALTER TABLE llx_cotisation RENAME TO llx_subscription;
|
||||||
|
-- VPGSQL8.2 ALTER SEQUENCE IF EXISTS llx_cotisation_rowid_seq RENAME TO llx_subscription_rowid_seq;
|
||||||
|
|
||||||
ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh);
|
ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh);
|
||||||
ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real;
|
ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real;
|
||||||
ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1';
|
ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user