Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0

This commit is contained in:
ldestailleur
2025-06-19 10:48:18 +02:00
16 changed files with 122 additions and 76 deletions

View File

@@ -1,3 +1,11 @@
# Action to prepare the github action
# Go on Dolibarr - Settings - Developer settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account
# Click on generate the private keys
# Click on Install application - choose user of the Organization
# Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Choose the repository access to "Repository Dolibarr".
# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr".
#
name: Set reviewer for v18
on:
pull_request:
@@ -17,38 +25,21 @@ jobs:
# GH_TOKENS: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.PR18_APP_ID }}
private-key: ${{ secrets.PR18_SECRET_KEY }}
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
#- name: Install GitHub CLI
# run: |
# sudo apt update
# sudo apt install gh -y
- name: Assign reviewer method 1
- name: Assign reviewer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
url: ${{ github.event.pull_request.html_url }}
run: |
gh pr edit "$url" --add-assignee rycks --add-reviewer rycks
gh pr merge "$url" --merge --auto
continue-on-error: true
gh pr edit "$url" --add-reviewer rycks
gh pr edit "$url" --add-reviewer lvessiller-opendsi
- name: Assign reviewer method 2
env:
#REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
run: |
echo "Run action by ${{ github.actor }}"
echo "github.token=${{ github.token }}"
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
echo Get the pr_number
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
echo "pr_number=$pr_number"
echo Authenticate login gh
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
gh auth setup-git
echo Set the reviewer
gh pr edit $pr_number --add-reviewer "$REVIEWER"
continue-on-error: true

View File

@@ -2,7 +2,7 @@
# from Dolibarr GitHub repository.
# For syntax, see https://docs.travis-ci.com/user/languages/php/
# We use dist: bionic = 18.04, focal = 20.04
# We use dist: focal = 20.04, jammy = 22.04
os: linux
dist: jammy

View File

@@ -21,6 +21,9 @@ $PROJECT="dolibarr";
$PUBLISHBETARC="$ENV{'DESTIASSOLOGIN'}\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
$PUBLISHSTABLE="$ENV{'DESTISFLOGIN'}\@frs.sourceforge.net:/home/frs/project/dolibarr";
# due to implicit origin on git commands, example
# implicit origin, lionel upstream, eric dolibarr
$GITREMOTENAME="$ENV{'GITREMOTENAME'}";
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
%REQUIREMENTPUBLISH=(
@@ -97,6 +100,13 @@ if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"})
exit 1;
}
if (! $ENV{"GITREMOTENAME"})
{
print "Error: environment variable GITREMOTENAME does not exist. You can set it to 'origin' or any other git remote name.\n";
print "$PROG.$Extension aborted.\n";
sleep 2;
exit 1;
}
# Detect OS type
# --------------
if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; }
@@ -442,15 +452,15 @@ if ($nboftargetok) {
{
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
print 'Run git push -f --tags'."\n";
$ret=`git push -f --tags`;
print 'Run git push $GITREMOTENAME -f --tags'."\n";
$ret=`git push $GITREMOTENAME -f --tags`;
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
}
}
else
{
print 'Run git push --tags'."\n";
$ret=`git push --tags`;
print 'Run git push $GITREMOTENAME --tags'."\n";
$ret=`git push $GITREMOTENAME --tags`;
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
}
chdir("$olddir");

View File

@@ -586,7 +586,7 @@ class Lettering extends BookKeeping
$grouped_lines = array();
foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
if (!is_array($bookkeeping_lines_by_type[$doc_type])) {
if (empty($bookkeeping_lines_by_type[$doc_type]) || !is_array($bookkeeping_lines_by_type[$doc_type])) {
continue;
}

View File

@@ -53,6 +53,9 @@ if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
$object = new ActionComm($db);
$object->fetch($id);
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create'));
@@ -65,8 +68,6 @@ $form = new Form($db);
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
llxHeader('', $langs->trans("Agenda"), $help_url);
$object = new ActionComm($db);
$object->fetch($id);
$object->info($object->id);
$head = actions_prepare_head($object);

View File

@@ -51,7 +51,7 @@ $charge = new ChargeSociales($db);
* Actions
*/
if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'yes')) {
if ($action == 'add_payment') {
$error = 0;
if ($cancel) {
@@ -89,7 +89,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
}
}
if (count($amounts) <= 0) {
if (empty($amounts)) {
$error++;
setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors');
$action = 'create';
@@ -119,9 +119,9 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
if (!$error) {
$result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOST('accountid', 'int'), '', '');
if (!($result > 0)) {
if ($result <= 0) {
$error++;
setEventMessages($paiement->error, null, 'errors');
setEventMessages($paiement->error, $paiement->errors, 'errors');
$action = 'create';
}
}

View File

@@ -472,7 +472,7 @@ while ($i < $imaxinloop) {
print '<td>';
print $line->LibStatut($obj->statut_ligne, 2);
print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.($type == 'bank-transfer' ? '&type=bank-transfer' : '').'">';
print substr('000000'.$obj->rowid_ligne, -6);
print '</a></td>';

View File

@@ -598,7 +598,6 @@ class PaymentSocialContribution extends CommonObject
$result = $this->update_fk_bank($bank_line_id);
if ($result <= 0) {
$error++;
dol_print_error($this->db);
}
// Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
@@ -610,7 +609,7 @@ class PaymentSocialContribution extends CommonObject
$result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
if ($result <= 0) {
$error++;
dol_print_error($this->db);
$this->setErrorsFromObject($acc);
}
}
@@ -622,7 +621,8 @@ class PaymentSocialContribution extends CommonObject
$socialcontrib->fetch($key);
$result = $acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_label.(($socialcontrib->lib && $socialcontrib->lib != $socialcontrib->type_label) ? ' ('.$socialcontrib->lib.')' : ''), 'sc');
if ($result <= 0) {
dol_print_error($this->db);
$this->setErrorsFromObject($acc);
$error++;
}
if ($socialcontrib->fk_user) {
@@ -639,14 +639,14 @@ class PaymentSocialContribution extends CommonObject
);
if ($result <= 0) {
$this->error = $acc->error;
$this->setErrorsFromObject($acc);
$error++;
}
}
}
}
} else {
$this->error = $acc->error;
$this->setErrorsFromObject($acc);
$error++;
}
}

View File

@@ -7337,7 +7337,7 @@ abstract class CommonObject
}
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1)) {
if ((!isset($this->fields[$key]['default'])) || empty($this->fields[$key]['notnull']) || ($this->fields[$key]['notnull'] != 1)) {
$out .= '<option value="0">&nbsp;</option>';
}
foreach ($param['options'] as $keyb => $valb) {

View File

@@ -2645,7 +2645,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file = $dolibarr_main_data_root.'/doctemplates/'.$original_file;
} elseif ($modulepart == 'doctemplateswebsite' && !empty($dolibarr_main_data_root)) {
// Wrapping for doctemplates of websites
$accessallowed = ($fuser->rights->website->write && preg_match('/\.jpg$/i', basename($original_file)));
$accessallowed = ($fuser->hasRight('website', 'write') && preg_match('/\.jpg$/i', basename($original_file)));
$original_file = $dolibarr_main_data_root.'/doctemplates/websites/'.$original_file;
} elseif ($modulepart == 'packages' && !empty($dolibarr_main_data_root)) {
// Wrapping for *.zip package files, like when used with url http://.../document.php?modulepart=packages&file=module_myfile.zip
@@ -2902,7 +2902,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file = $conf->fckeditor->dir_output.'/'.$original_file;
} elseif ($modulepart == 'user' && !empty($conf->user->dir_output)) {
// Wrapping for users
$canreaduser = (!empty($fuser->admin) || $fuser->rights->user->user->{$lire});
$canreaduser = (!empty($fuser->admin) || $fuser->hasRight('user', 'user', $lire));
if ($fuser->id == (int) $refname) {
$canreaduser = 1;
} // A user can always read its own card
@@ -3174,11 +3174,11 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
} elseif ($modulepart == 'export' && !empty($conf->export->dir_temp)) {
// Wrapping for export module
// Note that a test may not be required because we force the dir of download on the directory of the user that export
$accessallowed = $user->rights->export->lire;
$accessallowed = $user->hasRight('export', 'lire');
$original_file = $conf->export->dir_temp.'/'.$fuser->id.'/'.$original_file;
} elseif ($modulepart == 'import' && !empty($conf->import->dir_temp)) {
// Wrapping for import module
$accessallowed = $user->rights->import->run;
$accessallowed = $user->hasRight('import', 'run');
$original_file = $conf->import->dir_temp.'/'.$original_file;
} elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_output)) {
// Wrapping for recruitment module
@@ -3288,7 +3288,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
exit;
}
// Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read
// Check fuser->hasRight('modulepart', 'myobject', 'read') and fuser->hasRight('modulepart', 'read')
$partsofdirinoriginalfile = explode('/', $original_file);
if (!empty($partsofdirinoriginalfile[1])) { // If original_file is xxx/filename (xxx is a part we will use)
$partofdirinoriginalfile = $partsofdirinoriginalfile[0];

View File

@@ -10439,7 +10439,9 @@ function printCommonFooter($zone = 'private')
print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
print '// required on a select works only if key is "", so we add the required attributes but also we reset the key -1 or 0 to an empty string'."\n";
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
print 'if (jQuery("select[name=\''.$paramkey.'\']").is(\':visible\')===true) {'."\n";
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // can set focus only if this element is visible
print '}'."\n";
print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'-1\']").prop(\'value\', \'\');'."\n";
print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'0\']").prop(\'value\', \'\');'."\n";

View File

@@ -392,7 +392,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -509,7 +511,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -620,7 +624,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -736,7 +742,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -852,7 +860,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -966,7 +976,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1005,7 +1017,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1034,7 +1048,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1262,7 +1278,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1354,7 +1372,9 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);

View File

@@ -44,6 +44,12 @@ $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
// Protection
$socid = 0;
if ($user->socid > 0) {
$socid = $user->socid;
}
if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) {
@@ -84,7 +90,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->mrp->multidir_output[$object->entity]."/".$object->id;
$upload_dir = (empty($conf->mrp->multidir_output[$object->entity]) ? $conf->mrp->dir_output : $conf->mrp->multidir_output[$object->entity])."/".$object->id;
}
// Security check - Protection if external user
@@ -229,7 +235,10 @@ if ($object->id > 0) {
print '</div>';
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
$param = '&id='.$object->id.'&socid='.$socid;
$param = '&id='.$object->id;
if (!empty($socid)) {
$param .= '&socid='.$socid;
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}

View File

@@ -88,7 +88,8 @@ if (empty($reshook)) {
$object->fetch($id);
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
}
// Add translation
@@ -119,7 +120,8 @@ if (empty($reshook)) {
}
if ($result > 0) {
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
} else {
$action = 'add';
setEventMessages($object->error, $object->errors, 'errors');
@@ -148,7 +150,8 @@ if (empty($reshook)) {
$result = $object->setMultiLangs($user);
if ($result > 0) {
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
@@ -163,7 +166,8 @@ if (empty($reshook)) {
$result = $object->delMultiLangs($langtodelete, $user);
if ($result > 0) {
$action = '';
header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id);
exit;
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2023 Charlene Benke <charlene@patas_monkey.com>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2025 Benjamin Falière <benjamin@faliere.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
@@ -1606,13 +1607,17 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Buttons Create
if (!getDolGlobalString('PROJECT_HIDE_CREATE_OBJECT_BUTTON')) {
// We check the type of thirdparty
$is_customer_or_prospect = (!empty($object->thirdparty->prospect) || !empty($object->thirdparty->client));
$is_supplier_only= (!empty($object->thirdparty->fournisseur) && $is_customer_or_prospect == false);
$arrayforbutaction = array(
10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
10 => array('lang'=>'propal', 'enabled'=>(isModEnabled("propal") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
20 => array('lang'=>'orders', 'enabled'=>(isModEnabled("commande") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
30 => array('lang'=>'bills', 'enabled'=>(isModEnabled("facture") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&amp;projectid='.$object->id.($is_supplier_only == true ? '&amp;socid='.$object->socid : '')),
50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&amp;projectid='.$object->id.($is_supplier_only == true ? '&amp;socid='.$object->socid : '')),
60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&amp;projectid='.$object->id.($is_supplier_only == true ? '&amp;socid='.$object->socid : '')),
70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("ficheinter"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contrat"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
90 => array('lang'=>'trips', 'enabled'=>isModEnabled("expensereport"), 'perm'=>$user->hasRight('expensereport', 'creer'), 'label' => 'AddTrip', 'url'=>'/expensereport/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),

View File

@@ -1603,6 +1603,8 @@ class Reception extends CommonObject
if ($resql) {
// Set order billed if 100% of order is received (qty in reception lines match qty in order lines)
if ($this->origin == 'order_supplier' && $this->origin_id > 0) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$order = new CommandeFournisseur($this->db);
$order->fetch($this->origin_id);
@@ -1863,6 +1865,8 @@ class Reception extends CommonObject
}
if (!$error && $this->origin == 'order_supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$commande = new CommandeFournisseur($this->db);
$commande->fetch($this->origin_id);
$result = $commande->setStatus($user, 4);