diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2a3b6138a2c..bc873b2e2c2 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1009,8 +1009,10 @@ class Propal extends CommonObject $this->statut = $obj->fk_statut; $this->statut_libelle = $obj->statut_label; - $this->datec = $this->db->jdate($obj->datec); - $this->datev = $this->db->jdate($obj->datev); + $this->datec = $this->db->jdate($obj->datec); //TODO obsolete + $this->datev = $this->db->jdate($obj->datev); //TODO obsolete + $this->date_creation = $this->db->jdate($obj->datec); //Creation date + $this->date_validation = $this->db->jdate($obj->datev); //Validation date $this->date = $this->db->jdate($obj->dp); // Proposal date $this->datep = $this->db->jdate($obj->dp); $this->fin_validite = $this->db->jdate($obj->dfv); diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index e0898fc4930..588a084e158 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -233,87 +233,6 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, dol_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$dir.$file)); return -1; } - - - /* - // Positionne modele sur le nom du modele de propale a utiliser - $file = "pdf_".$modele.".modules.php"; - - // On verifie l'emplacement du modele - $file = dol_buildpath($dir.$file); - - if ($modele && file_exists($file)) $modelisok=1; - - // Si model pas encore bon - if (! $modelisok) - { - if ($conf->global->PROPALE_ADDON_PDF) $modele = $conf->global->PROPALE_ADDON_PDF; - $file = "pdf_".$modele.".modules.php"; - // On verifie l'emplacement du modele - $file = dol_buildpath($dir.$file); - if (file_exists($file)) $modelisok=1; - } - - // Si model pas encore bon - if (! $modelisok) - { - $liste=ModelePDFPropales::liste_modeles($db); - $modele=key($liste); // Renvoie premiere valeur de cle trouve dans le tableau - $file = "pdf_".$modele.".modules.php"; - $file = dol_buildpath($dir.$file); - if (file_exists($file)) $modelisok=1; - } - - - // Charge le modele - if ($modelisok) - { - $classname = "pdf_".$modele; - require_once($file); - - $obj = new $classname($db); - - // We save charset_output to restore it because write_file can change it if needed for - // output format that does not support UTF8. - $sav_charset_output=$outputlangs->charset_output; - if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $hookmanager) > 0) - { - $outputlangs->charset_output=$sav_charset_output; - - // we delete preview files - require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); - dol_delete_preview($object); - - // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); - $interface=new Interfaces($db); - $result=$interface->run_triggers('PROPAL_BUILDDOC',$object,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - - return 1; - } - else - { - $outputlangs->charset_output=$sav_charset_output; - dol_syslog("modules_propale::propale_pdf_create error"); - dol_print_error($db,$obj->error); - return 0; - } - } - else - { - if (! $conf->global->PROPALE_ADDON_PDF) - { - print $langs->trans("Error")." ".$langs->trans("Error_PROPALE_ADDON_PDF_NotDefined"); - } - else - { - print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); - } - return 0; - } - */ } ?> diff --git a/htdocs/install/doctemplates/proposals/template_proposal.odt b/htdocs/install/doctemplates/proposals/template_proposal.odt index 0fda0975446..d3779f546d4 100644 Binary files a/htdocs/install/doctemplates/proposals/template_proposal.odt and b/htdocs/install/doctemplates/proposals/template_proposal.odt differ