Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/127/upgrade from 17.0 #526

Open
wants to merge 83 commits into
base: 17.0_koesio
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
22dddb8
FIX: Backport page inventory.php from v18 to fix pagination bugs caus…
atm-florianm May 15, 2024
f3460ea
FIX REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710)
IC-Mathieu May 21, 2024
a9cb586
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy May 21, 2024
659830b
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy May 21, 2024
26e09f8
FIX: Unsigned propal having signing date (#29825)
YannisHoareau Jun 4, 2024
a3e7151
fix restrictedArea on selectobject (#29882)
Kazimir42 Jun 7, 2024
72a2a96
Fix travis
eldy Jun 7, 2024
040e908
Fix : expense report reapproval email, wrong date format + missing pa…
atm-maxime Jun 7, 2024
b0e825c
FIX: PHP 8 warning on output of successful cronjob (#29922)
marc-dll Jun 8, 2024
956d1b0
Fix : product price by quantity was removing default price (#29899)
atm-maxime Jun 8, 2024
c5bb185
FIX modification date from label in accounting bookkeeping list (#30038)
lvessiller-opendsi Jun 15, 2024
70799e3
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Jun 29, 2024
300fd7c
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Jun 29, 2024
00b58c9
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Jun 29, 2024
6031f84
FIX: pos: invoice date incorrectly set beacause of timezome mismatche…
marc-dll Jun 30, 2024
75f853f
Fix date of invoice. We want the date of the user.
eldy Jul 1, 2024
ca39809
Fix #30256
eldy Jul 4, 2024
8636259
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Jul 6, 2024
0a88dc9
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Jul 6, 2024
05cfd3d
FIX #30274 : Add the include before executing dolibarr_set_const (#30…
ksar-ksar Jul 10, 2024
eca8735
Fix les lien de téléchargement de facture fournisseur sur la page vue…
MaximilienR-easya Jul 13, 2024
609b842
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Jul 14, 2024
193faf6
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Jul 18, 2024
6c7bc18
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Jul 18, 2024
30f1d4f
Backport fix from develop (#30421)
MaximilienR-easya Jul 20, 2024
0982220
FIX: Supplier Order search on date valid (#30448)
FHenry Jul 24, 2024
d500425
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Jul 25, 2024
c1b8197
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Jul 25, 2024
385d98b
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Jul 25, 2024
2c92e57
FIX : Display the real_PMP on inventory when its value is equal to 0 …
atm-adrien Aug 1, 2024
a5cba32
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Aug 1, 2024
163e623
FIX: on change ref for bank account attachement are lost (#30529)
FHenry Aug 7, 2024
e7e96f6
FIX #30768 allocate the correct invoice_line_id to the element timesp…
evarisk-micka Aug 27, 2024
9f5ef68
fix replenish with multicurrency (#30832)
thomas-Ngr Sep 5, 2024
d17890f
FIX: purge files cron: php warnings when rest module enabled (#30919)
marc-dll Sep 12, 2024
65e5899
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Sep 12, 2024
61c5a61
fix: better error reporting in CMailFile (#31058)
FHenry Sep 20, 2024
171494d
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Sep 23, 2024
ad154a3
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Sep 23, 2024
1594afd
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Sep 23, 2024
bb40a43
FIX Add same security test whe nuploading files from API than from GU…
thomas-Ngr Sep 26, 2024
16a0d1d
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Sep 26, 2024
65c9bd7
Merge remote-tracking branch 'origin/15.0' into 16.0
eldy Sep 26, 2024
4ea503f
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Sep 26, 2024
a8cb076
Fix move
eldy Sep 26, 2024
c0f5e31
fix: DOL_DATA_ROOT do not have last / by defaut, and last_main_doc no…
FHenry Sep 26, 2024
c727bbb
FIX: when qty is not an integer, apply price() (#31138)
atm-florianm Sep 26, 2024
6678902
Merge remote-tracking branch 'origin/10.0' into 11.0
eldy Sep 26, 2024
644f365
Merge remote-tracking branch 'origin/11.0' into 12.0
eldy Sep 26, 2024
c1889af
Merge remote-tracking branch 'origin/12.0' into 13.0
eldy Sep 26, 2024
eef0d0b
Merge branch '13.0' of [email protected]:Dolibarr/dolibarr.git into 14.0
eldy Sep 26, 2024
8a330ec
Merge remote-tracking branch 'origin/14.0' into 15.0
eldy Sep 26, 2024
b517e06
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Sep 26, 2024
df7fffc
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Sep 26, 2024
231fc6c
FIX: if you call fetchLines several times, your $object->lines contai…
atm-florianm Sep 29, 2024
74b67eb
FIX - use price() to display qty on a product's stats tab to avoid sh…
atm-florianm Sep 29, 2024
32646cb
Merge branch '10.0' of [email protected]:Dolibarr/dolibarr.git into 11.0
eldy Sep 29, 2024
a621032
Merge branch '11.0' of [email protected]:Dolibarr/dolibarr.git into 11.0
eldy Sep 29, 2024
385927f
FIX: box_actions.php still uses fk_user_done which no longer exists (…
atm-florianm Sep 29, 2024
a27538f
Merge branch '11.0' of [email protected]:Dolibarr/dolibarr.git into 12.0
eldy Sep 29, 2024
5213837
Merge branch '12.0' of [email protected]:Dolibarr/dolibarr.git into 12.0
eldy Sep 29, 2024
6eddee9
Merge branch '12.0' of [email protected]:Dolibarr/dolibarr.git into 13.0
eldy Sep 29, 2024
624493f
Merge branch '13.0' of [email protected]:Dolibarr/dolibarr.git into 14.0
eldy Sep 29, 2024
d0fb08a
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Sep 29, 2024
2c67c8b
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Sep 29, 2024
f5fbbcf
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Sep 29, 2024
25ea797
Fix not default template for BOM
eldy Sep 30, 2024
e71631a
fix : missing update for extrafields on holidays (#31256)
thomas-Ngr Oct 3, 2024
336d3ad
finish fix (#31203)
thomas-Ngr Oct 3, 2024
f287d10
Use <= 0 instead of ! because delete method returns -1 or 1 (#31268)
atm-irvine Oct 4, 2024
9509929
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Oct 7, 2024
3391d3d
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Oct 7, 2024
40965b6
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Oct 7, 2024
1e64870
NEW - Add a new hook on order list (#31315)
atm-lucasmantegari Oct 11, 2024
70a453a
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm re…
thomas-Ngr Oct 14, 2024
793e77b
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Oct 14, 2024
fa22ebd
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Oct 14, 2024
278eea6
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Oct 14, 2024
111e3fc
Revert "NEW - Add a new hook on order list (#31315)"
eldy Oct 16, 2024
352bdaf
FIX : Extrafield following between rec invoice and classic invoice (#…
atm-irvine Oct 18, 2024
abefce7
FIX 17.0: supplier invoice template card: buyer and seller swapped in…
atm-florianm Oct 18, 2024
1d197e4
fix shippable tooltip value overwritten (#31468)
frederic34 Oct 19, 2024
49a1267
Merge branch '17.0' of https://github.com/Dolibarr/dolibarr into 17.0…
atm-florianm Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@
print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
Expand Down
20 changes: 17 additions & 3 deletions htdocs/accountancy/journal/bankjournal.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
// one line tabpay = line into bank
// one line for bank record = tabbq
// one line for thirdparty record = tabtp
// Note: tabcompany is used to store the subledger account
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($result);
Expand Down Expand Up @@ -263,7 +264,8 @@
);

// Set accountancy code for user
// $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists)
// $obj->accountancy_code is the accountancy_code of table u=user (but it is defined only if
// a link with type 'user' exists and user as a subledger account)
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');

$tabuser[$obj->rowid] = array(
Expand Down Expand Up @@ -364,13 +366,25 @@
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
$userstatic->statut = $tabuser[$obj->rowid]['status'];
$userstatic->accountancy_code = $tabuser[$obj->rowid]['accountancy_code'];
// For a payment of social contribution, we have a link sc + user.
// but we already fill the $tabpay[$obj->rowid]["soclib"] in the line 'sc'.
// If we fill it here to, we must concat
if ($userstatic->id > 0) {
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
if ($is_sc) {
$tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(1, 'accountancy', 0);
} else {
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
}
} else {
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
}

if ($compta_user) {
$tabtp[$obj->rowid][$compta_user] += $amounttouse;
if ($is_sc) {
//$tabcompany[$obj->rowid][$compta_user] += $amounttouse;
} else {
$tabtp[$obj->rowid][$compta_user] += $amounttouse;
}
}
} elseif ($links[$key]['type'] == 'sc') {
$chargestatic->id = $links[$key]['url_id'];
Expand Down
47 changes: 45 additions & 2 deletions htdocs/api/class/api_documents.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,52 @@ public function post($filename, $modulepart, $ref = '', $subdir = '', $fileconte
throw new RestException(500, "Failed to open file '".$destfiletmp."' for write");
}

$result = dol_move($destfiletmp, $destfile, 0, $overwriteifexists, 1, 1);
$disablevirusscan = 0;
$src_file = $destfiletmp;
$dest_file = $destfile;

// Security:
// If we need to make a virus scan
if (empty($disablevirusscan) && file_exists($src_file)) {
$checkvirusarray = dolCheckVirus($src_file);
if (count($checkvirusarray)) {
dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: errors='.join(',', $checkvirusarray), LOG_WARNING);
throw new RestException(500, 'ErrorFileIsInfectedWithAVirus: '.join(',', $checkvirusarray));
}
}

// Security:
// Disallow file with some extensions. We rename them.
// Because if we put the documents directory into a directory inside web root (very bad), this allows to execute on demand arbitrary code.
if (isAFileWithExecutableContent($dest_file) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED)) {
// $upload_dir ends with a slash, so be must be sure the medias dir to compare to ends with slash too.
$publicmediasdirwithslash = $conf->medias->multidir_output[$conf->entity];
if (!preg_match('/\/$/', $publicmediasdirwithslash)) {
$publicmediasdirwithslash .= '/';
}

if (strpos($upload_dir, $publicmediasdirwithslash) !== 0 || !getDolGlobalInt("MAIN_DOCUMENT_DISABLE_NOEXE_IN_MEDIAS_DIR")) { // We never add .noexe on files into media directory
$dest_file .= '.noexe';
}
}

// Security:
// We refuse cache files/dirs, upload using .. and pipes into filenames.
if (preg_match('/^\./', basename($src_file)) || preg_match('/\.\./', $src_file) || preg_match('/[<>|]/', $src_file)) {
dol_syslog("Refused to deliver file ".$src_file, LOG_WARNING);
throw new RestException(500, "Refused to deliver file ".$src_file);
}

// Security:
// We refuse cache files/dirs, upload using .. and pipes into filenames.
if (preg_match('/^\./', basename($dest_file)) || preg_match('/\.\./', $dest_file) || preg_match('/[<>|]/', $dest_file)) {
dol_syslog("Refused to deliver file ".$dest_file, LOG_WARNING);
throw new RestException(500, "Refused to deliver file ".$dest_file);
}

$result = dol_move($destfiletmp, $dest_file, 0, $overwriteifexists, 1, 1);
if (!$result) {
throw new RestException(500, "Failed to move file into '".$destfile."'");
throw new RestException(500, "Failed to move file into '".$dest_file."'");
}

return dol_basename($destfile);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/categories/class/api_categories.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function delete($id)
}

if ($this->category->delete(DolibarrApiAccess::$user) <= 0) {
throw new RestException(500, 'Error when delete category ' . $this->category->error);
throw new RestException(500, 'Error when delete category : ' . $this->category->error);
}

return array(
Expand Down
1 change: 1 addition & 0 deletions htdocs/comm/action/class/actioncomm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,7 @@ public function sendEmailsReminder()

// Load event
$res = $this->fetch($actionCommReminder->fk_actioncomm);
if ($res > 0) $res = $this->fetch_thirdparty();
if ($res > 0) {
// PREPARE EMAIL
$errormesg = '';
Expand Down
5 changes: 4 additions & 1 deletion htdocs/comm/propal/class/propal.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2651,7 +2651,10 @@ public function closeProposal($user, $status, $note = '', $notrigger = 0)
}

$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($date_signature)."', fk_user_signature=".$fk_user_signature;
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."'";
if ($status == self::STATUS_SIGNED) {
$sql .= ", date_signature='".$this->db->idate($now)."', fk_user_signature = ".($fk_user_signature);
}
$sql .= " WHERE rowid = ".((int) $this->id);

$resql = $this->db->query($sql);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,7 @@
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
}

if ($reliquat > $generic_product->stock_reel) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/bank/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@

$result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);


/*
* Actions
*/
Expand Down Expand Up @@ -222,6 +221,7 @@
$object = new Account($db);
$object->fetch(GETPOST("id", 'int'));

$object->oldref = $object->ref;
$object->ref = dol_string_nospecial(trim(GETPOST('ref', 'alpha')));
$object->label = trim(GETPOST("label", 'alphanohtml'));
$object->courant = GETPOST("type");
Expand Down
27 changes: 27 additions & 0 deletions htdocs/compta/bank/class/account.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ class Account extends CommonObject
*/
public $ics_transfer;

/**
* @var string The previous ref in case of rename on update to rename attachment folders
*/
public $oldref;



/**
Expand Down Expand Up @@ -897,6 +902,28 @@ public function update(User $user, $notrigger = 0)
}
}

if (!$error && !empty($this->oldref) && $this->oldref !== $this->ref) {
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'bank/".$this->db->escape($this->ref)."'";
$sql .= " WHERE filepath = 'bank/".$this->db->escape($this->oldref)."' and src_object_type='bank_account' and entity = ".((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->error = $this->db->lasterror();
}

// We rename directory in order not to lose the attachments
$oldref = dol_sanitizeFileName($this->oldref);
$newref = dol_sanitizeFileName($this->ref);
$dirsource = $conf->bank->dir_output.'/'.$oldref;
$dirdest = $conf->bank->dir_output.'/'.$newref;
if (file_exists($dirsource)) {
dol_syslog(get_class($this)."::update rename dir ".$dirsource." into ".$dirdest, LOG_DEBUG);
if (@rename($dirsource, $dirdest)) {
dol_syslog("Rename ok", LOG_DEBUG);
}
}
}

if (!$error && !$notrigger) {
// Call trigger
$result = $this->call_trigger('BANKACCOUNT_MODIFY', $user);
Expand Down
1 change: 0 additions & 1 deletion htdocs/compta/facture/class/facture-rec.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,6 @@ public function createRecurringInvoices($restrictioninvoiceid = 0, $forcevalidat
$facture->multicurrency_tx = $facturerec->multicurrency_tx;
}

// Backported from 17.0 standard
if (isset($facture->array_options) && isset($facturerec->array_options)) {
foreach ($facturerec->array_options as $key => $value) {
if (isset($facture->array_options[$key])) {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/facture/class/facture.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5602,9 +5602,9 @@ public function sendEmailsRemindersOnInvoiceDueDate($nbdays = 0, $paymentmode =
$joinFileName = [];
$joinFileMime = [];
if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
$joinFile[] = DOL_DATA_ROOT.$tmpinvoice->last_main_doc;
$joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc;
$joinFileName[] = basename($tmpinvoice->last_main_doc);
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.$tmpinvoice->last_main_doc);
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc);
}

// Mail Creation
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/stats/cabyprodserv.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@

// Quantity
print '<td class="right">';
print $qty[$key];
print price($qty[$key], 1, $langs, 0, 0);
print '</td>';

// Percent;
Expand Down
6 changes: 5 additions & 1 deletion htdocs/core/ajax/selectobject.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@
$searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : ''));

// Add a security test to avoid to get content of all tables
restrictedArea($user, $objecttmp->element, $id);
if (!empty($objecttmp->module)) {
restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element);
} else {
restrictedArea($user, $objecttmp->element, $id);
}

$arrayresult = $form->selectForFormsList($objecttmp, $htmlname, '', 0, $searchkey, '', '', '', 0, 1, 0, '', $filter);

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/boxes/box_actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function loadBox($max = 5)
$sql .= " AND s.rowid = ".((int) $user->socid);
}
if (empty($user->rights->agenda->allactions->read)) {
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id).")";
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id).")";
}
$sql .= " ORDER BY a.datep ASC";
$sql .= $this->db->plimit($max, 0);
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/class/CMailFile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ public function sendfile()
}
} elseif ($this->sendmode == 'smtps') {
if (!is_object($this->smtps)) {
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>Constructor of object CMailFile was not initialized without errors.";
$this->error = "Failed to send mail with smtps lib to HOST=".ini_get('SMTP').", PORT=".$conf->global->$keyforsmtpport."<br>Constructor of object CMailFile was not initialized without errors.";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
return false;
}
Expand Down Expand Up @@ -1165,9 +1165,10 @@ public function sendfile()
$res = true;
if (!empty($this->error) || !empty($this->errors) || !$result) {
if (!empty($failedRecipients)) {
$this->errors[] = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
$this->error = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
$this->errors[] = $this->error;
}
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
dol_syslog("CMailFile::sendfile: mail end error=". join(' ', $this->errors), LOG_ERR);
$res = false;

if (!empty($conf->global->MAIN_MAIL_DEBUG)) {
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3196,7 +3196,7 @@ public function getChildrenOfLine($id, $includealltree = 0)
while ($row = $this->db->fetch_row($resql)) {
$rows[] = $row[0];
if (!empty($includealltree)) {
$rows = array_merge($rows, $this->getChildrenOfLine($row[0]), $includealltree);
$rows = array_merge($rows, $this->getChildrenOfLine($row[0], $includealltree));
}
}
}
Expand Down Expand Up @@ -4917,8 +4917,8 @@ public function formAddObjectLine($dateSelector, $seller, $buyer, $defaulttpldir
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
* @param string $action Action code
* @param string $seller Object of seller third party
* @param string $buyer Object of buyer third party
* @param Societe $seller Object of seller third party
* @param Societe $buyer Object of buyer third party
* @param int $selected Object line selected
* @param int $dateSelector 1=Show also date range input fields
* @param string $defaulttpldir Directory where to find the template
Expand Down Expand Up @@ -9460,6 +9460,7 @@ public function fetchLinesCommon($morewhere = '')
if ($resql) {
$num_rows = $this->db->num_rows($resql);
$i = 0;
$this->lines = array();
while ($i < $num_rows) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/class/conf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public function __construct()
$this->mailing = new stdClass();
$this->expensereport = new stdClass();
$this->productbatch = new stdClass();
$this->api = new stdClass();
}

/**
Expand Down
8 changes: 7 additions & 1 deletion htdocs/core/class/utils.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ public function purgeFiles($choices = 'tempfilesold+logfiles', $nbsecondsold = 8

$result = dol_delete_dir_recursive($filesarray[$key]['fullname'], $startcount, 1, 0, $tmpcountdeleted);

if (!in_array($filesarray[$key]['fullname'], array($conf->api->dir_temp, $conf->user->dir_temp))) { // The 2 directories $conf->api->dir_temp and $conf->user->dir_temp are recreated at end, so we do not count them
$recreatedDirs = array($conf->user->dir_temp);

if (isModEnabled('api')) {
$recreatedDirs[] = $conf->api->dir_temp;
}

if (!in_array($filesarray[$key]['fullname'], $recreatedDirs)) { // The 2 directories $conf->api->dir_temp and $conf->user->dir_temp are recreated at end, so we do not count them
$count += $result;
$countdeleted += $tmpcountdeleted;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/files.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
$publicmediasdirwithslash .= '/';
}

if (strpos($upload_dir, $publicmediasdirwithslash) !== 0) { // We never add .noexe on files into media directory
if (strpos($upload_dir, $publicmediasdirwithslash) !== 0 || !getDolGlobalInt("MAIN_DOCUMENT_DISABLE_NOEXE_IN_MEDIAS_DIR")) { // We never add .noexe on files into media directory
$file_name .= '.noexe';
$successcode = 2;
}
Expand Down
Loading
Loading