Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/core/boxes/box_services_contracts.php htdocs/expensereport/class/expensereport.class.php
This commit is contained in:
commit
efce53abd1
@ -126,7 +126,6 @@ class box_services_contracts extends ModeleBoxes
|
|||||||
$contractlinestatic->product_id = $objp->product_id;
|
$contractlinestatic->product_id = $objp->product_id;
|
||||||
$contractlinestatic->product_ref = $objp->product_ref;
|
$contractlinestatic->product_ref = $objp->product_ref;
|
||||||
$contractlinestatic->product_type = $objp->product_type;
|
$contractlinestatic->product_type = $objp->product_type;
|
||||||
|
|
||||||
$contractlinestatic->statut = $objp->contractline_status;
|
$contractlinestatic->statut = $objp->contractline_status;
|
||||||
|
|
||||||
$contractstatic->id = $objp->rowid;
|
$contractstatic->id = $objp->rowid;
|
||||||
|
|||||||
@ -8039,6 +8039,18 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete llx_ecm_files
|
||||||
|
if (!$error) {
|
||||||
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".$this->id;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (!$resql)
|
||||||
|
{
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error && !empty($this->isextrafieldmanaged))
|
if (!$error && !empty($this->isextrafieldmanaged))
|
||||||
{
|
{
|
||||||
$result = $this->deleteExtraFields();
|
$result = $this->deleteExtraFields();
|
||||||
|
|||||||
@ -307,7 +307,7 @@ class EcmFiles extends CommonObject
|
|||||||
* @param string $relativepath Relative path of file from document directory. Example: 'path/path2/file' or 'path/path2/*'
|
* @param string $relativepath Relative path of file from document directory. Example: 'path/path2/file' or 'path/path2/*'
|
||||||
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
|
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
|
||||||
* @param string $hashforshare Hash of file sharing.
|
* @param string $hashforshare Hash of file sharing.
|
||||||
* @param string $src_object_type src_object_type to search
|
* @param string $src_object_type src_object_type to search (value of object->table_element)
|
||||||
* @param string $src_object_id src_object_id to search
|
* @param string $src_object_id src_object_id to search
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1083,30 +1083,51 @@ class ExpenseReport extends CommonObject
|
|||||||
{
|
{
|
||||||
global $user, $langs, $conf;
|
global $user, $langs, $conf;
|
||||||
|
|
||||||
if (!$rowid) $rowid = $this->id;
|
$rowid = $this->id;
|
||||||
|
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element_line.' WHERE '.$this->fk_element.' = '.$rowid;
|
$error = 0;
|
||||||
if ($this->db->query($sql))
|
|
||||||
{
|
// Delete lines
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid = '.$rowid;
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element_line.' WHERE '.$this->fk_element.' = '.$rowid;
|
||||||
$resql = $this->db->query($sql);
|
if (!$error && !$this->db->query($sql))
|
||||||
if ($resql)
|
{
|
||||||
{
|
$this->error = $this->db->error()." sql=".$sql;
|
||||||
$this->db->commit();
|
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
||||||
return 1;
|
$error++;
|
||||||
} else {
|
}
|
||||||
$this->error = $this->db->error()." sql=".$sql;
|
|
||||||
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
// Delete llx_ecm_files
|
||||||
$this->db->rollback();
|
if (!$error) {
|
||||||
return -6;
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".$this->id;
|
||||||
}
|
$resql = $this->db->query($sql);
|
||||||
} else {
|
if (!$resql)
|
||||||
$this->error = $this->db->error()." sql=".$sql;
|
{
|
||||||
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
$this->error = $this->db->lasterror();
|
||||||
$this->db->rollback();
|
$this->errors[] = $this->error;
|
||||||
return -4;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete main record
|
||||||
|
if (!$error) {
|
||||||
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid = '.$rowid;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (!$resql)
|
||||||
|
{
|
||||||
|
$this->error = $this->db->error()." sql=".$sql;
|
||||||
|
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit or rollback
|
||||||
|
if ($error) {
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to status validate
|
* Set to status validate
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user