Skip to content
Snippets Groups Projects
Commit 88358687 authored by Jean-François Ferry's avatar Jean-François Ferry
Browse files

Implement MAIN_DOC_USE_TIMING into project and order ODT

parent 8a958c31
No related branches found
No related tags found
No related merge requests found
......@@ -313,12 +313,22 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
//print "srctemplatepath=".$srctemplatepath; // Src filename
$newfile=basename($srctemplatepath);
$newfiletmp=preg_replace('/\.odt/i','',$newfile);
$newfiletmp=preg_replace('/\.od(t|s)/i','',$newfile);
$newfiletmp=preg_replace('/template_/i','',$newfiletmp);
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
$newfiletmp=$objectref.'_'.$newfiletmp;
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
$file=$dir.'/'.$newfiletmp.'.odt';
// Get extension (ods or odt)
$newfileformat=substr($newfile, strrpos($newfile, '.')+1);
if ( ! empty($conf->global->MAIN_DOC_USE_TIMING))
{
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat;
}
else
{
$filename=$newfiletmp.'.'.$newfileformat;
}
$file=$dir.'/'.$filename;
//print "newdir=".$dir;
//print "newfile=".$newfile;
//print "file=".$file;
......
......@@ -435,12 +435,22 @@ class doc_generic_project_odt extends ModelePDFProjects
{
//print "srctemplatepath=".$srctemplatepath; // Src filename
$newfile=basename($srctemplatepath);
$newfiletmp=preg_replace('/\.odt/i','',$newfile);
$newfiletmp=preg_replace('/\.od(t|s)/i','',$newfile);
$newfiletmp=preg_replace('/template_/i','',$newfiletmp);
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
$newfiletmp=$objectref.'_'.$newfiletmp;
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
$file=$dir.'/'.$newfiletmp.'.odt';
// Get extension (ods or odt)
$newfileformat=substr($newfile, strrpos($newfile, '.')+1);
if ( ! empty($conf->global->MAIN_DOC_USE_TIMING))
{
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat;
}
else
{
$filename=$newfiletmp.'.'.$newfileformat;
}
$file=$dir.'/'.$filename;
//print "newdir=".$dir;
//print "newfile=".$newfile;
//print "file=".$file;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment