mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX On object validation, ecm index are not updated for uploaded files
This commit is contained in:
parent
a0c5dffacb
commit
74e1ec4099
|
|
@ -987,6 +987,12 @@ class BOM extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'bom/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'bom/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -588,6 +588,12 @@ class Availabilities extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'availabilities/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'availabilities/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -582,6 +582,12 @@ class Calendar extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'calendar/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'calendar/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -2045,6 +2045,12 @@ class Propal extends CommonObject
|
|||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'propale/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'propale/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -1319,7 +1319,9 @@ if (empty($reshook)) {
|
|||
|
||||
if (!$error) {
|
||||
$locationTarget = '';
|
||||
|
||||
$db->begin();
|
||||
|
||||
$result = $object->valid($user, $idwarehouse);
|
||||
if ($result >= 0) {
|
||||
$error = 0;
|
||||
|
|
|
|||
|
|
@ -569,6 +569,12 @@ class Commande extends CommonOrder
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'commande/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -3493,6 +3493,12 @@ class Facture extends CommonInvoice
|
|||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'facture/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'facture/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -556,6 +556,12 @@ class Contrat extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'contract/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'contract/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -527,6 +527,12 @@ class TimeSpent extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'timespent/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'timespent/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -478,6 +478,12 @@ class Delivery extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'expedition/receipt/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'expedition/receipt/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -608,6 +608,12 @@ class ConferenceOrBoothAttendee extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'conferenceorboothattendee/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'conferenceorboothattendee/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -788,6 +788,12 @@ class Expedition extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'expedition/sending/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'expedition/sending/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -1308,6 +1308,12 @@ class ExpenseReport extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'expensereport/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'expensereport/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -622,6 +622,12 @@ class Fichinter extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'ficheinter/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -705,6 +705,12 @@ class CommandeFournisseur extends CommonOrder
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -1897,6 +1897,12 @@ class FactureFournisseur extends CommonInvoice
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'fournisseur/facture/".get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'fournisseur/facture/".get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -227,10 +227,16 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$result = $object->validate($user, '', $idwarehouse);
|
||||
if ($result < 0) {
|
||||
$db->rollback();
|
||||
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
|
|||
|
|
@ -787,6 +787,12 @@ class Holiday extends CommonObject
|
|||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'holiday/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'holiday/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -583,6 +583,12 @@ class Evaluation extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'evaluation/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'evaluation/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -563,6 +563,12 @@ class EvaluationLine extends CommonObjectLine
|
|||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'evaluationline/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'evaluationline/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -560,6 +560,12 @@ class Job extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'job/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'job/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -571,6 +571,12 @@ class Position extends CommonObject
|
|||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'position/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'position/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -628,6 +628,12 @@ class Skill extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'skill/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'skill/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -551,6 +551,12 @@ class Skilldet extends CommonObjectLine
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'skilldet/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'skilldet/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -590,6 +590,12 @@ class SkillRank extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'skillrank/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'skillrank/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -601,6 +601,12 @@ class KnowledgeRecord extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'knowledgerecord/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'knowledgerecord/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -640,6 +640,12 @@ class MyObject extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'myobject/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'myobject/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -1072,6 +1072,12 @@ class Mo extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'mrp/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'mrp/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -634,6 +634,12 @@ class Partnership extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'partnership/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'partnership/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
@ -758,6 +764,12 @@ class Partnership extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'partnership/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'partnership/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -466,7 +466,15 @@ class ProductFournisseurPrice extends CommonObject
|
|||
$sql = 'UPDATE '.$this->db->prefix()."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'productfournisseurprice/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'productfournisseurprice/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->error = $this->db->lasterror(); }
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'productfournisseurprice/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'productfournisseurprice/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -582,7 +582,15 @@ class StockTransfer extends CommonObject
|
|||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'stocktransfer/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'stocktransfer/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->error = $this->db->lasterror(); }
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'stocktransfer/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'stocktransfer/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -577,7 +577,15 @@ class StockTransferLine extends CommonObjectLine
|
|||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'stocktransferline/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'stocktransferline/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->error = $this->db->lasterror(); }
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'stocktransferline/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'stocktransferline/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -658,6 +658,12 @@ class Reception extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'reception/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'reception/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -559,6 +559,12 @@ class RecruitmentCandidature extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'recruitmentcandidature/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'recruitmentcandidature/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -574,6 +574,12 @@ class RecruitmentJobPosition extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'recruitmentjobposition/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'recruitmentjobposition/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -1442,6 +1442,12 @@ class SupplierProposal extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'supplier_proposal/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'supplier_proposal/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
|
|
@ -569,6 +569,12 @@ class Target extends CommonObject
|
|||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'target/".$this->db->escape($this->newref)."'";
|
||||
$sql .= " WHERE filepath = 'target/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user