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

This commit is contained in:
Laurent Destailleur 2023-10-01 15:53:36 +02:00
commit 5e76fea64d
6 changed files with 38 additions and 18 deletions

View file

@ -1745,6 +1745,8 @@ Following changes may create regressions for some external modules, but were nec
* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in
method executeCLI() available into core/class/utils.class.php
* the trigger "*_DELETE_CONTACT" inside "delete_contact()" function from commonobject.class.php is call before delete the object element
and a $object->context['contact_id'] is now available for this trigger
***** ChangeLog for 13.0.5 compared to 13.0.4 *****

View file

@ -2101,9 +2101,12 @@ if ($action == 'create') {
/*
* Show object in view mode
*/
$soc = new Societe($db);
$soc->fetch($object->socid);
$object->fetch_thirdparty();
if ($object->thirdparty) {
$soc = $object->thirdparty;
} else {
$soc = new Societe($db);
}
$head = propal_prepare_head($object);
print dol_get_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal');
@ -2351,9 +2354,9 @@ if ($action == 'create') {
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1);
// Thirdparty
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
$morehtmlref .= '<br><span class="hideonsmartphone">'.$langs->trans('ThirdParty').' : </span>'.$soc->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $soc->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
}
// Project
if (isModEnabled('project')) {

View file

@ -1941,6 +1941,8 @@ if (empty($reshook)) {
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_account = GETPOST('fk_account', 'int');
// Proprietes particulieres a facture de remplacement

View file

@ -1157,6 +1157,7 @@ class Facture extends CommonInvoice
$facture->origin = $this->origin;
$facture->origin_id = $this->origin_id;
$facture->fk_account = $this->fk_account;
$facture->lines = $this->lines; // Array of lines of invoice
$facture->situation_counter = $this->situation_counter;

View file

@ -1290,22 +1290,34 @@ abstract class CommonObject
// phpcs:enable
global $user;
$error = 0;
$this->db->begin();
$sql = "DELETE FROM ".$this->db->prefix()."element_contact";
$sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog(get_class($this)."::delete_contact", LOG_DEBUG);
if ($this->db->query($sql)) {
if (!$notrigger) {
$result = $this->call_trigger(strtoupper($this->element).'_DELETE_CONTACT', $user);
if ($result < 0) {
$this->db->rollback();
return -1;
}
if (!$error && empty($notrigger)) {
// Call trigger
$this->context['contact_id'] = ((int) $rowid);
$result = $this->call_trigger(strtoupper($this->element).'_DELETE_CONTACT', $user);
if ($result < 0) {
$error++;
}
// End call triggers
}
if (!$error) {
dol_syslog(get_class($this)."::delete_contact", LOG_DEBUG);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
$sql .= " WHERE rowid = ".((int) $rowid);
$result = $this->db->query($sql);
if (!$result) {
$error++;
$this->errors[] = $this->db->lasterror();
}
}
if (!$error) {
$this->db->commit();
return 1;
} else {

View file

@ -77,7 +77,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
$securekeyseed = '';
if ($type == 'proposal') {
$securekeyseed = isset($conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN : '';
$securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN');
$out = $urltouse.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {