Skip to content

Commit

Permalink
Merge branch '20.0' into 20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
daGrumpf-bxp authored Nov 13, 2024
2 parents f931528 + 85108b9 commit 4e68a29
Show file tree
Hide file tree
Showing 166 changed files with 1,457 additions and 1,399 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci-on-pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "CI"

on: [pull_request]
jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
secrets: inherit
with:
gh_event: ${{ github.event_name }}
phan:
uses: ./.github/workflows/phan.yml
secrets: inherit
with:
gh_event: ${{ github.event_name }}
phpstan:
uses: ./.github/workflows/phpstan.yml
secrets: inherit
needs: [pre-commit, phan]
with:
gh_event: ${{ github.event_name }}
#windows-ci:
# needs: [pre-commit, phan]
# secrets: inherit
# uses: ./.github/workflows/windows-ci.yml
# with:
# gh_event: ${{ github.event_name }}
gh-travis: # Runs travis script on github runner (not on travis)
if: false
# needs: [pre-commit, phan]
# needs: [windows-ci]
secrets: inherit
uses: ./.github/workflows/gh-travis.yml
with:
gh_event: ${{ github.event_name }}

# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one failes, the following action may help
# - if: "failure()"
# uses: "andymckay/[email protected]"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "CI"

on: [push, pull_request]
on: [push]
jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
Expand Down Expand Up @@ -33,7 +33,6 @@ jobs:
with:
gh_event: ${{ github.event_name }}


# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one failes, the following action may help
# - if: "failure()"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
name: Travis
# Controls when the workflow will run
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:

concurrency:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/phan.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
---
on:
# pull_request:
# push:
# schedule:
# # execute once a day, the 1st
# - cron: 10 9 * * *
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:

concurrency:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
name: PHPStan
# Controls when the workflow will run
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:

concurrency:
group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
}}
group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
gh_event: ${{ inputs.gh_event || github.event_name }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: pre-commit
on:
# pull_request:
# push:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
name: Win CI
# yamllint disable-line rule:truthy
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:

concurrency:
Expand Down
251 changes: 247 additions & 4 deletions ChangeLog

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion build/makepack-dolibarr.pl
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
print "Clean $BUILDROOT\n";
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.git*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
Expand All @@ -484,8 +484,11 @@
$ret=`rm -fr $BUILDROOT/$PROJECT/.stickler.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.pre-commit-config.yaml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.phan`;
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
$ret=`rm -fr $BUILDROOT/$PROJECT/phpstan.neon.dist`;
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;

Expand Down
35 changes: 30 additions & 5 deletions dev/setup/phpunit/setup_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,9 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
echo "MySQL flush"
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'FLUSH PRIVILEGES;'

sum=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | LC_ALL=C sort | md5sum)
cnt=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | wc)
echo "OLDSUM $sum COUNT:$cnt"

# shellcheck disable=2046
sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | LC_ALL=C sort | md5sum)
# filefunc.inc.php holds the version, so include it"
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 "NEWSUM $sum COUNT:$cnt"
Expand Down Expand Up @@ -200,11 +197,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")

# 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//./}"
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/categories_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@
// Active
print '<td class="center" class="nowrap">';
if ($canbedisabled) {
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
print '<a class="reposition" href="'.$url.'action='.urlencode($acts[$obj->active]).'&token='.newToken().'">'.$actl[$obj->active].'</a>';
} else {
print $langs->trans("AlwaysActive");
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/accountancy/journal/bankjournal.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@
$resultmid = $db->query($sqlmid);
if ($resultmid) {
$objmid = $db->fetch_object($resultmid);
$tabtp[$obj->rowid][$objmid->accountancy_account_capital] = isset($tabtp[$obj->rowid][$objmid->accountancy_account_capital]) ? $tabtp[$obj->rowid][$objmid->accountancy_account_capital] - $objmid->amount_capital : $amounttouse;
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] = isset($tabtp[$obj->rowid][$objmid->accountancy_account_insurance]) ? $tabtp[$obj->rowid][$objmid->accountancy_account_insurance] - $objmid->amount_insurance : $amounttouse;
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] = isset($tabtp[$obj->rowid][$objmid->accountancy_account_interest]) ? $tabtp[$obj->rowid][$objmid->accountancy_account_interest] - $objmid->amount_interes : $amounttouse;
$tabtp[$obj->rowid][$objmid->accountancy_account_capital] = isset($objmid->amount_capital) ? $tabtp[$obj->rowid][$objmid->accountancy_account_capital] - $objmid->amount_capital : 0;
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] = isset($objmid->amount_insurance) ? $tabtp[$obj->rowid][$objmid->accountancy_account_insurance] - $objmid->amount_insurance : 0;
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] = isset($objmid->amount_interest) ? $tabtp[$obj->rowid][$objmid->accountancy_account_interest] - $objmid->amount_interest : 0;
}
} elseif ($links[$key]['type'] == 'banktransfert') {
$accountLinestatic->fetch($links[$key]['url_id']);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/emailcollector_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
} else {
$keyforprovider = '';
}
$keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
$keyforsupportedoauth2array = preg_replace('/-.*$/', '', strtoupper($keyforsupportedoauth2array));
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';

if (!empty($supportedoauth2array)) {
Expand Down
46 changes: 18 additions & 28 deletions htdocs/admin/expedition.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,42 +418,30 @@
}

print '</table>';
print load_fiche_titre($langs->trans('CreationOptions'), '', '');

print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans('Name').'</td>';
print '<td></td>';
print '<td class="center" width="60">'.$langs->trans('Status').'</td>';

print "</tr>\n";

print '<tr class="oddeven">';
print '<td>'.$langs->trans('SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
print '</td>';
print '<td class="center" width="20">&nbsp;</td>';
print '<td class="center" >';
print ajax_constantonoff('SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
print '</td></tr>';

print '</table><br>';
print '<br>';


/*
* Other options
*
*/

print load_fiche_titre($langs->trans("OtherOptions"), '', '');

print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="set_param">';

print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print "<td>".$langs->trans("Parameter")."</td>\n";
print "</tr>";
print "<td></td>\n";
print '</tr>';

print '<tr class="oddeven">';
print '<td>'.$langs->trans('SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
print '</td>';
print '<td>';
print ajax_constantonoff('SHIPPING_DISPLAY_STOCK_ENTRY_DATE');
print '</td></tr>';

$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
Expand All @@ -463,7 +451,7 @@
}
$htmltext .= '</i>';

print '<tr><td>';
print '<tr><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnShippings"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
$variablename = 'SHIPPING_FREE_TEXT';
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
Expand All @@ -476,14 +464,16 @@
print "</td></tr>\n";

print '<tr><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip');
print '</td><td>';
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('SHIPPING_DRAFT_WATERMARK')).'">';
print "</td></tr>\n";

// Allow OnLine Sign
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowOnLineSign").'</td>';
print '<td class="center">';
print '<td>'.$langs->trans("AllowOnLineSign");
print '</td>';
print '<td>';
print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1);
print '</td></tr>';

Expand Down
8 changes: 1 addition & 7 deletions htdocs/admin/invoice_situation.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,11 @@

$item = $formSetup->newItem('INVOICE_USE_RETAINED_WARRANTY');
$item->nameText = $langs->trans('AllowedInvoiceForRetainedWarranty');

$arrayAvailableType = array(
Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation"),
Facture::TYPE_STANDARD.'+'.Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation").' + '.$langs->trans("InvoiceStandard"),
);

if ($action == 'edit') {
$item->fieldInputOverride = $form->selectarray('INVOICE_USE_RETAINED_WARRANTY', $arrayAvailableType, $conf->global->INVOICE_USE_RETAINED_WARRANTY, 1);
} else {
$item->fieldOutputOverride= isset($arrayAvailableType[getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')]) ? $arrayAvailableType[getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')] : '';
}
$item->setAsSelect($arrayAvailableType);

//$item = $formSetup->newItem('INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION')->setAsYesNo();
//$item->nameText = $langs->trans('RetainedWarrantyOnlyForSituation');
Expand Down
19 changes: 18 additions & 1 deletion htdocs/admin/limits.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
// Show examples
print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');

print '<span class="opacitymedium">'.$langs->trans("Format").':</span> '.price(price2num(1234.56789, 'MT'), 0, $langs, 1, -1, -1, $currencycode)."<br>\n";
print '<span class="opacitymedium">'.$langs->trans("NumberFormatForATotalPrice", '1234.56789').':</span> '.price(price2num(1234.56789, 'MT'), 0, $langs, 1, -1, -1, $currencycode)."<br>\n";

// Always show vat rates with vat 0
$s = 2 / 3;
Expand Down Expand Up @@ -303,6 +303,23 @@
print $tmparray[0].' / '.$tmparray[1].($tmparray[9] ? '+'.$tmparray[9] : '').($tmparray[10] ? '+'.$tmparray[10] : '').' / '.$tmparray[2];
print "<br>\n";
}

if (getDolGlobalString('MAIN_ADD_MORE_EXAMPLE_IN_ACCURANCY_SETUP')) {
$qty = '1.234';
$vattxt = $vat.($vatarray['code'] ? ' ('.$vatarray['code'].')' : '');

$localtax_array = getLocalTaxesFromRate($vattxt, 0, $mysoc, $mysoc);

$s = 10 / 3;
$tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
print ' x <span class="opacitymedium">'.$langs->trans("Quantity").":</span> ".$qty;
print ' - <span class="opacitymedium">'.$langs->trans("VAT").':</span> '.$vat.'%';
print($vatarray['code'] ? ' ('.$vatarray['code'].')' : '');
print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ";
print $tmparray[0].' / '.$tmparray[1].($tmparray[9] ? '+'.$tmparray[9] : '').($tmparray[10] ? '+'.$tmparray[10] : '').' / '.$tmparray[2];
print "<br>\n";
}
}
} else {
// More examples if not specific vat rate found
Expand Down
Loading

0 comments on commit 4e68a29

Please sign in to comment.