Skip to content

Commit

Permalink
fix : display specimen
Browse files Browse the repository at this point in the history
  • Loading branch information
grandoc committed Mar 14, 2014
1 parent 561a1a1 commit f9c48be
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions htdocs/core/modules/contract/doc/pdf_strato.modules.php
Expand Up @@ -116,15 +116,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$outputlangs->load("dict");
$outputlangs->load("companies");
$outputlangs->load("contracts");
$outputlangs->load("interventions");

if ($conf->contrat->dir_output)
{
$object->fetch_thirdparty();

$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->contrat->dir_output;
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
// Definition of $dir and $file
if ($object->specimen)
{
$dir = $conf->contrat->dir_output;
$file = $dir . "/SPECIMEN.pdf";
}
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->contrat->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
}

if (! file_exists($dir))
{
Expand Down

0 comments on commit f9c48be

Please sign in to comment.