Implement MAIN_DOC_USE_TIMING into project and order ODT
This commit is contained in:
parent
9ea1f2c4ed
commit
44712ea99a
@ -313,12 +313,22 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
{
|
{
|
||||||
//print "srctemplatepath=".$srctemplatepath; // Src filename
|
//print "srctemplatepath=".$srctemplatepath; // Src filename
|
||||||
$newfile=basename($srctemplatepath);
|
$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('/template_/i','',$newfiletmp);
|
||||||
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
|
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
|
||||||
$newfiletmp=$objectref.'_'.$newfiletmp;
|
$newfiletmp=$objectref.'_'.$newfiletmp;
|
||||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
//$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 "newdir=".$dir;
|
||||||
//print "newfile=".$newfile;
|
//print "newfile=".$newfile;
|
||||||
//print "file=".$file;
|
//print "file=".$file;
|
||||||
|
|||||||
@ -435,12 +435,22 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
{
|
{
|
||||||
//print "srctemplatepath=".$srctemplatepath; // Src filename
|
//print "srctemplatepath=".$srctemplatepath; // Src filename
|
||||||
$newfile=basename($srctemplatepath);
|
$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('/template_/i','',$newfiletmp);
|
||||||
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
|
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
|
||||||
$newfiletmp=$objectref.'_'.$newfiletmp;
|
$newfiletmp=$objectref.'_'.$newfiletmp;
|
||||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
//$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 "newdir=".$dir;
|
||||||
//print "newfile=".$newfile;
|
//print "newfile=".$newfile;
|
||||||
//print "file=".$file;
|
//print "file=".$file;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user