forked from Wavyzz/dolibarr
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
@@ -147,8 +147,9 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
|
||||
|
||||
|
||||
# Compute md5 based on install file contents, and on db prefix
|
||||
# filefunc.inc.php holds the version, so include it"
|
||||
# shellcheck disable=2046
|
||||
sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | { LC_ALL=C sort ; echo "$DB_PREFIX" ;} | md5sum)
|
||||
sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f ; echo "${TRAVIS_BUILD_DIR}/filefunc.inc.php" ) | md5sum)
|
||||
# shellcheck disable=2046
|
||||
cnt=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | wc)
|
||||
echo "MD5SUM $sum COUNT:$cnt"
|
||||
@@ -219,12 +220,39 @@ if [ "$load_cache" != "1" ] ; then
|
||||
(
|
||||
cd "${TRAVIS_BUILD_DIR}/htdocs/install" || exit 1
|
||||
|
||||
# Get the target version from the filefunc.inc.php file
|
||||
target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9.]*\\).*/\\1/p" ../filefunc.inc.php) ; echo $target_version
|
||||
# Default in case that failed
|
||||
target_version=${target_version:=20.0.0}
|
||||
|
||||
# Sequence of versions for upgrade process (to be completed)
|
||||
VERSIONS=("3.5.0" "3.6.0" "3.7.0" "3.8.0" "3.9.0")
|
||||
VERSIONS+=("4.0.0")
|
||||
VERSIONS+=("5.0.0" "6.0.0" "7.0.0" "8.0.0" "9.0.0")
|
||||
VERSIONS+=("10.0.0" "11.0.0" "12.0.0" "13.0.0" "14.0.0")
|
||||
VERSIONS+=("15.0.0" "16.0.0" "18.0.0" "19.0.0" "20.0.0")
|
||||
VERSIONS+=("21.0.0")
|
||||
|
||||
# Append versions up to the current dolibarr version
|
||||
last_version=${VERSIONS[-1]}
|
||||
|
||||
target_major=${target_version%%.*}
|
||||
last_major=${last_version%%.*}
|
||||
|
||||
# Add versions up to target_version
|
||||
while (( last_major < target_major )); do
|
||||
((last_major++))
|
||||
VERSIONS+=("${last_major}.0.0")
|
||||
done
|
||||
|
||||
# Add target_version if it's not already in the list
|
||||
last_version=${VERSIONS[-1]}
|
||||
if [[ "${last_version}" != "${target_version}" ]]; then
|
||||
VERSIONS+=("$target_version")
|
||||
fi
|
||||
|
||||
last_version=${VERSIONS[-1]} # Keep last_version up-to-date
|
||||
|
||||
# Proceed with the upgrade process
|
||||
pVer=${VERSIONS[0]}
|
||||
for v in "${VERSIONS[@]:1}" ; do
|
||||
LOGNAME="${TRAVIS_BUILD_DIR}/upgrade${pVer//./}${v//./}"
|
||||
|
||||
@@ -337,7 +337,7 @@ class Facture extends CommonInvoice
|
||||
'datef' => array('type' => 'date', 'label' => 'DateInvoice', 'enabled' => 1, 'visible' => 1, 'position' => 20),
|
||||
'date_valid' => array('type' => 'date', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 22),
|
||||
'date_lim_reglement' => array('type' => 'date', 'label' => 'DateDue', 'enabled' => 1, 'visible' => 1, 'position' => 25),
|
||||
'date_closing' => array('type' => 'datetime', 'label' => 'Date closing', 'enabled' => 1, 'visible' => -1, 'position' => 30),
|
||||
'date_closing' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => -1, 'position' => 30),
|
||||
'paye' => array('type' => 'smallint(6)', 'label' => 'InvoicePaidCompletely', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 80),
|
||||
//'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85),
|
||||
//'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2024 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -1026,7 +1026,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
|
||||
$sql .= " WHERE sc.fk_soc = ".((int) $object->id);
|
||||
$sql .= " AND p.entity IN (".getEntity('project').")";
|
||||
$sql .= " AND tc.element = 'project'";
|
||||
$sql .= " AND tc.element = 'project' AND tc.source = 'external'";
|
||||
$sql .= " ORDER BY p.dateo DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
@@ -1567,7 +1567,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
||||
|
||||
// Delete
|
||||
if ($user->hasRight('societe', 'contact', 'delete')) {
|
||||
print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
|
||||
print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
@@ -6485,7 +6485,7 @@ function print_barre_liste($title, $page, $file, $options = '', $sortfield = '',
|
||||
do {
|
||||
if ($pagenavastextinput) {
|
||||
if ($cpt == $page) {
|
||||
$pagelist .= '<li class="pagination pageplusone"><input type="text" class="'.($totalnboflines > 100 ? 'width40' : 'width25').' center pageplusone" name="pageplusone" value="'.($page + 1).'"></li>';
|
||||
$pagelist .= '<li class="pagination pageplusone valignmiddle"><input type="text" class="'.($totalnboflines > 100 ? 'width40' : 'width25').' center pageplusone" name="pageplusone" value="'.($page + 1).'"></li>';
|
||||
$pagelist .= '/';
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -66,7 +66,8 @@ if (isset($totalarray['pos'])) {
|
||||
while ($i < $totalarray['nbfield']) {
|
||||
$i++;
|
||||
if (!empty($totalarray['pos'][$i])) {
|
||||
printTotalValCell($totalarray['type'][$i], $sumsarray[$totalarray['pos'][$i]]);
|
||||
$fieldname = preg_replace('/[^a-z0-9]/', '', $totalarray['pos'][$i]);
|
||||
printTotalValCell($totalarray['type'][$i], $sumsarray[$fieldname]);
|
||||
} else {
|
||||
if ($i == 1) {
|
||||
print '<td>';
|
||||
|
||||
@@ -1517,7 +1517,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
||||
|
||||
// SellBy / EatBy mandatory list
|
||||
if (!empty($sellOrEatByMandatoryList)) {
|
||||
print '<tr><td>'.$langs->trans('BatchSellOrEatByMandatoryList', $langs->trans('SellByDate'), $langs->trans('EatByDate')).'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).'</td><td>';
|
||||
print $form->selectarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, GETPOSTINT('sell_or_eat_by_mandatory'));
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -2142,7 +2142,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
||||
} else {
|
||||
$sellOrEatByMandatorySelectedId = $object->sell_or_eat_by_mandatory;
|
||||
}
|
||||
print '<tr><td>'.$langs->trans('BatchSellOrEatByMandatoryList', $langs->trans('SellByDate'), $langs->trans('EatByDate')).'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).'</td><td>';
|
||||
print $form->selectarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, $sellOrEatByMandatorySelectedId);
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -2594,7 +2594,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans('BatchSellOrEatByMandatoryList', $langs->trans('SellByDate'), $langs->trans('EatByDate')).'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).'</td><td>';
|
||||
print $object->getSellOrEatByMandatoryLabel();
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed
|
||||
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.fk_statut, p.datee, p.fk_opp_status, p.public, p.fk_user_creat,";
|
||||
$sql .= " s.nom, s.rowid,";
|
||||
$sql .= " t.datec, t.dateo, t.datee, t.tms,";
|
||||
$sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut as status";
|
||||
$sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut";
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
|
||||
@@ -377,10 +377,11 @@ $mesg = '';
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// First log into the dolibarr_payment.log file
|
||||
dol_syslog("--- newpayment.php action = ".$action." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_payment');
|
||||
|
||||
// Action dopayment is called after clicking/choosing the payment mode
|
||||
if ($action == 'dopayment') { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls)
|
||||
dol_syslog("--- newpayment.php Execute action = ".$action." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_payment');
|
||||
|
||||
if ($paymentmethod == 'paypal') {
|
||||
$PAYPAL_API_PRICE = price2num(GETPOST("newamount", 'alpha'), 'MT');
|
||||
$PAYPAL_PAYMENT_TYPE = 'Sale';
|
||||
@@ -872,7 +873,6 @@ $conf->dol_hide_leftmenu = 1;
|
||||
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
|
||||
|
||||
dol_syslog("--- newpayment.php action = ".$action, LOG_DEBUG, 0, '_payment');
|
||||
dol_syslog("newpayment.php show page source=".$source." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha')." ref=".$ref, LOG_DEBUG, 0, '_payment');
|
||||
dol_syslog("_SERVER[SERVER_NAME] = ".(empty($_SERVER["SERVER_NAME"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_NAME"])), LOG_DEBUG, 0, '_payment');
|
||||
dol_syslog("_SERVER[SERVER_ADDR] = ".(empty($_SERVER["SERVER_ADDR"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_ADDR"])), LOG_DEBUG, 0, '_payment');
|
||||
|
||||
@@ -141,19 +141,26 @@ if ($action == 'confirm_delete' && $user->hasRight('societe', 'contact', 'delete
|
||||
if (!empty($id) && $socid > 0) {
|
||||
$db->begin();
|
||||
|
||||
$sql = "DELETE t, et FROM ".MAIN_DB_PREFIX."socpeople AS t";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields AS et ON t.rowid = et.fk_object";
|
||||
$sql .= " WHERE t.fk_soc = ".((int) $socid);
|
||||
$sql .= " AND t.rowid = ".((int) $id);
|
||||
$sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople_extrafields";
|
||||
$sql .= " WHERE fk_object = ".((int) $socid);
|
||||
$sql .= " AND fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople as sp WHERE sp.rowid = ".((int) $socid);
|
||||
$sql .= " AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0))";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
$result1 = $db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople";
|
||||
$sql .= " WHERE fk_soc = ".((int) $socid);
|
||||
$sql .= " AND rowid = ".((int) $id);
|
||||
$sql .= " AND ((fk_user_creat = ".((int) $user->id)." AND priv = 1) OR priv = 0)";
|
||||
|
||||
$result2 = $db->query($sql);
|
||||
|
||||
if (!$result1 || !$result2) {
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
$db->rollback();
|
||||
} else {
|
||||
$db->commit();
|
||||
setEventMessages('ContactDeleted', null, 'mesgs');
|
||||
setEventMessages('RecordDeleted', null, 'mesgs');
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$socid);
|
||||
exit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user