Skip to content

Commit

Permalink
#224 [ODT] add: missing ref object on filename
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Feb 22, 2023
1 parent fb170e9 commit 7ed73cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function write_file(SessionDocument $objectDocument, Translate $outputlan

$objectDocument->fetch($objectDocumentID);

$objectref = dol_sanitizeFileName($objectDocument->ref);
$objectDocumentRef = dol_sanitizeFileName($objectDocument->ref);
if ($moreparam['specimen'] == 0 || $moreparam['zone'] == 'private') {
$dir = $conf->dolimeet->multidir_output[$object->entity ?? 1] . '/' . $object->type . 'document/' . $object->ref;
} else {
Expand All @@ -221,10 +221,9 @@ public function write_file(SessionDocument $objectDocument, Translate $outputlan
$societyname = preg_replace('/\./', '_', $conf->global->MAIN_INFO_SOCIETE_NOM);

$date = dol_print_date(dol_now(),'dayxcard');
if ($moreparam['specimen'] == 0) {
$newfiletmp = $objectref . '_' . $date . '_' . $newfiletmp . '_' . $societyname;
} else {
$newfiletmp = $newfiletmp . '_specimen';
$newfiletmp = $date . '_' . $object->ref . '_' . $objectDocumentRef .'_' . $newfiletmp . '_' . $societyname;
if ($moreparam['specimen'] == 1) {
$newfiletmp .= '_specimen';
}

$objectDocument->last_main_doc = $newfiletmp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function write_file(SessionDocument $objectDocument, Translate $outputlan

$objectDocument->fetch($objectDocumentID);

$objectref = dol_sanitizeFileName($objectDocument->ref);
$objectDocumentRef = dol_sanitizeFileName($objectDocument->ref);
if ($moreparam['specimen'] == 0 || $moreparam['zone'] == 'private') {
$dir = $conf->dolimeet->multidir_output[$object->entity ?? 1] . '/' . $object->type . 'document/' . $object->ref;
} else {
Expand All @@ -227,10 +227,9 @@ public function write_file(SessionDocument $objectDocument, Translate $outputlan
}

$date = dol_print_date(dol_now(),'dayxcard');
if ($moreparam['specimen'] == 0) {
$newfiletmp = $objectref . '_' . $date . '_' . $newfiletmp . '_' . $attandent . '_' . $societyname;
} else {
$newfiletmp = $newfiletmp . '_' . $attandent . '_specimen';
$newfiletmp = $date . '_' . $object->ref . '_' . $objectDocumentRef .'_' . $newfiletmp . '_' . $societyname;
if ($moreparam['specimen'] == 1) {
$newfiletmp .= '_specimen';
}

$objectDocument->last_main_doc = $newfiletmp;
Expand Down

0 comments on commit 7ed73cf

Please sign in to comment.