Merge pull request #886 from jfefe/doc_ods
Using of MAIN_DOC_USE_TIMING on ODT
This commit is contained in:
commit
0a282c018a
@ -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;
|
||||
|
||||
@ -336,12 +336,24 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
{
|
||||
//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;
|
||||
|
||||
// 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;
|
||||
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
||||
$file=$dir.'/'.$newfiletmp.'.odt';
|
||||
//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;
|
||||
|
||||
@ -275,16 +275,27 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
{
|
||||
//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;
|
||||
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
|
||||
//print "conf->propal->dir_temp=".$conf->propal->dir_temp;
|
||||
|
||||
dol_mkdir($conf->propal->dir_temp);
|
||||
|
||||
|
||||
@ -215,7 +215,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
|
||||
// Get extension (ods or odt)
|
||||
$newfileformat=substr($newfile, strrpos($newfile, '.')+1);
|
||||
if ( ! empty($conf->global->MAIN_ODT_USE_TIMING))
|
||||
if ( ! empty($conf->global->MAIN_DOC_USE_TIMING))
|
||||
{
|
||||
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user