mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 20.0
This commit is contained in:
commit
dce7ed780e
|
|
@ -3870,7 +3870,7 @@ class Facture extends CommonInvoice
|
|||
if (empty($fk_prev_id)) {
|
||||
$fk_prev_id = 'null';
|
||||
}
|
||||
if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') {
|
||||
if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '' || $situation_percent == null) {
|
||||
$situation_percent = 100;
|
||||
}
|
||||
if (empty($ref_ext)) {
|
||||
|
|
@ -4131,7 +4131,7 @@ class Facture extends CommonInvoice
|
|||
if (empty($special_code) || $special_code == 3) {
|
||||
$special_code = 0;
|
||||
}
|
||||
if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') {
|
||||
if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '' || $situation_percent == null) {
|
||||
$situation_percent = 100;
|
||||
}
|
||||
if (empty($ref_ext)) {
|
||||
|
|
|
|||
|
|
@ -10198,7 +10198,7 @@ abstract class CommonObject
|
|||
}
|
||||
|
||||
// Create lines
|
||||
if (!empty($this->table_element_line) && !empty($this->fk_element)) {
|
||||
if (!empty($this->table_element_line) && !empty($this->fk_element) && !empty($this->lines)) {
|
||||
foreach ($this->lines as $line) {
|
||||
$keyforparent = $this->fk_element;
|
||||
$line->$keyforparent = $this->id;
|
||||
|
|
|
|||
|
|
@ -6774,7 +6774,7 @@ class Form
|
|||
// Keep only the VAT qualified for $type_vat
|
||||
$arrayofvatrates = array();
|
||||
foreach ($this->cache_vatrates as $cachevalue) {
|
||||
if (empty($cachevalue['type_vat']) || $cachevalue['type_vat'] != $type_vat) {
|
||||
if (empty($cachevalue['type_vat']) || $cachevalue['type_vat'] == $type_vat) {
|
||||
$arrayofvatrates[] = $cachevalue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1562,7 +1562,9 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$ok = false; // to avoid false positive
|
||||
if (empty($nophperrors)) {
|
||||
$ok = false; // to avoid false positive
|
||||
}
|
||||
dol_syslog("No files to delete found", LOG_DEBUG);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -603,10 +603,7 @@ class modAgenda extends DolibarrModules
|
|||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
$sql = array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type='member' AND entity = ".((int) $conf->entity),
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".((int) $conf->entity).")"
|
||||
);
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql, $options);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2872,7 +2872,7 @@ class EmailCollector extends CommonObject
|
|||
$this->errors = $actioncomm->errors;
|
||||
} else {
|
||||
if ($fk_element_type == "ticket" && is_object($objectemail)) {
|
||||
if ($objectemail->status == Ticket::STATUS_CLOSED || $objectemail->status == Ticket::STATUS_CANCELED) {
|
||||
if ($objectemail->status == Ticket::STATUS_CLOSED || $objectemail->status == Ticket::STATUS_CANCELED || $objectemail->status == Ticket::STATUS_NEED_MORE_INFO || $objectemail->status == Ticket::STATUS_WAITING) {
|
||||
if ($objectemail->fk_user_assign != null) {
|
||||
$res = $objectemail->setStatut(Ticket::STATUS_ASSIGNED);
|
||||
} else {
|
||||
|
|
@ -3345,6 +3345,13 @@ class EmailCollector extends CommonObject
|
|||
$tickettocreate->context['actionmsg'] = $langs->trans("ActionAC_EMAIL_IN").' - '.$langs->trans("TICKET_CREATEInDolibarr");
|
||||
//$tickettocreate->email_fields_no_propagate_in_actioncomm = 0;
|
||||
|
||||
// Add sender to context array to make sure that confirmation e-mail can be sent by trigger script
|
||||
$sender_contact = new Contact($this->db);
|
||||
$sender_contact->fetch(0, null, '', $from);
|
||||
if (!empty($sender_contact->id)) {
|
||||
$tickettocreate->context['contactid'] = $sender_contact->id;
|
||||
}
|
||||
|
||||
$result = $tickettocreate->create($user);
|
||||
if ($result <= 0) {
|
||||
$errorforactions++;
|
||||
|
|
@ -3360,7 +3367,7 @@ class EmailCollector extends CommonObject
|
|||
foreach ($attachments as $attachment) {
|
||||
// $attachment->save($destdir.'/');
|
||||
$typeattachment = (string) $attachment->getDisposition();
|
||||
$filename = $attachment->getFilename();
|
||||
$filename = $attachment->getName();
|
||||
$content = $attachment->getContent();
|
||||
$this->saveAttachment($destdir, $filename, $content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ if (!getDolGlobalString('EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES')) {
|
|||
}
|
||||
print '<div class="photoref backgroundblank">';
|
||||
|
||||
print $thumbshown ? $thumbshown : img_mime($minifile);
|
||||
print $thumbshown ? $thumbshown : (empty($minifile) ? '' : img_mime($minifile));
|
||||
|
||||
print '</div>';
|
||||
if (empty($urlforhref) || empty($thumbshown)) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ if (($id > 0) || $ref) {
|
|||
}
|
||||
|
||||
|
||||
$upload_dir = $conf->holiday->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, '');
|
||||
$upload_dir = $conf->holiday->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, '');
|
||||
$modulepart = 'holiday';
|
||||
|
||||
// Protection if external user
|
||||
|
|
@ -293,7 +293,7 @@ if ($object->id) {
|
|||
$permissiontoadd = $user->hasRight('holiday', 'write');
|
||||
$permtoedit = $user->hasRight('holiday', 'write');
|
||||
$param = '&id='.$object->id;
|
||||
$relativepathwithnofile = dol_sanitizeFileName($object->ref).'/';
|
||||
$relativepathwithnofile = get_exdir(0, 0, 0, 1, $object, '').'/';
|
||||
$savingdocmask = dol_sanitizeFileName($object->ref).'-__file__';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
|
|
|
|||
|
|
@ -4135,7 +4135,7 @@ function migrate_delete_old_files($db, $langs, $conf)
|
|||
//print '<b>'DOL_DOCUMENT_ROOT.$filetodelete."</b><br>\n";
|
||||
if (preg_match('/\*/', $filetodelete) || file_exists(DOL_DOCUMENT_ROOT.$filetodelete)) {
|
||||
//print "Process file ".$filetodelete."\n";
|
||||
$result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, false);
|
||||
$result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, (preg_match('/\*/', $filetodelete) ? 1 : 0), 0, null, true, false); // nophperrors to avoid false positive with asterisk
|
||||
if (!$result) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans("Error").': '.$langs->trans("ErrorFailToDeleteFile", DOL_DOCUMENT_ROOT.$filetodelete);
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ if ($search_accountancy_code_buy_intra) {
|
|||
if ($search_accountancy_code_buy_export) {
|
||||
$sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_export', clean_account($search_accountancy_code_buy_export));
|
||||
}
|
||||
if (getDolGlobalString('PRODUCT_USE_UNITS') && $search_units) {
|
||||
if (getDolGlobalString('PRODUCT_USE_UNITS') && !empty($search_units) && $search_units !== 'none') {
|
||||
$sql .= natural_search('cu.rowid', $search_units);
|
||||
}
|
||||
// Add where from extra fields
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user