Task #838 : retieve extension to work with ods document
This commit is contained in:
parent
fcf1eeba20
commit
83028b958a
@ -210,16 +210,20 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
{
|
{
|
||||||
//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(s|t)/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);
|
||||||
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
|
// Get extension (ods or odt)
|
||||||
|
$newfileformat=substr($newfile, strrpos($newfile, '.')+1);
|
||||||
|
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat;
|
||||||
$file=$dir.'/'.$filename;
|
$file=$dir.'/'.$filename;
|
||||||
$object->builddoc_filename=$filename; // For triggers
|
$object->builddoc_filename=$filename; // For triggers
|
||||||
|
//print "newfileformat=".$newfileformat;
|
||||||
//print "newdir=".$dir;
|
//print "newdir=".$dir;
|
||||||
//print "newfile=".$newfile;
|
//print "newfile=".$newfile;
|
||||||
//print "file=".$file;
|
//print "file=".$file;
|
||||||
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
|
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
|
||||||
|
//exit;
|
||||||
|
|
||||||
dol_mkdir($conf->societe->multidir_temp[$object->entity]);
|
dol_mkdir($conf->societe->multidir_temp[$object->entity]);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user