diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index f268691a5cd..64fc5caee00 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -274,7 +274,7 @@ print "\n"; print " ".$langs->trans("Name")."\n"; print " ".$langs->trans("Value")."\n"; print "\n"; -print "\n ".$langs->trans("Directory")."\n ".$conf->propale->dir_output."\n\n"; +print "\n ".$langs->trans("Directory")."\n ".$conf->propal->dir_output."\n\n"; print "\n
"; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 2722d687db2..ef196f3d624 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -117,9 +117,9 @@ if ($_POST["action"] == 'add') if ($_GET["action"] == 'pdf') { - $propal = new Propal($db); - $propal->fetch($_GET["propalid"]); - propale_pdf_create($db, $_GET["propalid"], $propal->modelpdf); + $propal = new Propal($db); + $propal->fetch($_GET["propalid"]); + propale_pdf_create($db, $_GET["propalid"], $propal->modelpdf); } if ($_POST["action"] == 'setstatut' && $user->rights->propale->cloturer) @@ -568,14 +568,13 @@ if ($_GET["propalid"]) // Send if ($propal->statut == 1) { - $file = PROPALE_OUTPUTDIR. "/$obj->ref/$obj->ref.pdf"; - if (file_exists($file)) - { if ($user->rights->propale->envoyer) { - print "id&action=presend\">Envoyer la proposition"; - } - + $file = $conf->propal->dir_output . "/$obj->ref/$obj->ref.pdf"; + if (file_exists($file)) + { + print "id&action=presend\">".$langs->trans("Send").""; + } } } @@ -584,7 +583,7 @@ if ($_GET["propalid"]) { if ($user->rights->propale->supprimer) { - print "id&action=delete\">".$langs->trans("Delete").""; + print "id&action=delete\">".$langs->trans("Delete").""; } } @@ -609,7 +608,7 @@ if ($_GET["propalid"]) */ if ($_GET["action"] == 'send') { - $file = PROPALE_OUTPUTDIR . "/$propal->ref/$propal->ref.pdf"; + $file = $conf->propal->dir_output . "/$propal->ref/$propal->ref.pdf"; if (file_exists($file)) { @@ -655,7 +654,7 @@ if ($_GET["propalid"]) print '
'; print ''; } - print '
'; + print '\n"; if ($objp->client == 1) { - $url ='fiche.php?socid='.$objp->idp; + $url = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->idp; } else { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 51c75972a8c..cf71aee1133 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -39,10 +39,10 @@ $stats = new PropaleStats($db); $year = strftime("%Y", time()); $data = $stats->getNbByMonthWithPrevYear($year); -if (! is_dir($conf->propale->dir_images)) { mkdir($conf->propale->dir_images); } +if (! is_dir($conf->propal->dir_images)) { mkdir($conf->propal->dir_images); } -$filename = $conf->propale->dir_images."/nbpropale2year-$year.png"; -$fileurl = $conf->propale->url_images."/nbpropale2year-$year.png"; +$filename = $conf->propal->dir_images."/nbpropale2year-$year.png"; +$fileurl = $conf->propal->url_images."/nbpropale2year-$year.png"; $px = new BarGraph($data); $mesg = $px->isGraphKo(); diff --git a/htdocs/comm/propal/stats/month.php b/htdocs/comm/propal/stats/month.php index 9b935258b9f..1d9ab61cc46 100644 --- a/htdocs/comm/propal/stats/month.php +++ b/htdocs/comm/propal/stats/month.php @@ -49,10 +49,10 @@ print_fiche_titre('Statistiques des propositions commerciales', $mesg); $stats = new PropaleStats($db); $data = $stats->getNbByMonth($year); -if (! is_dir($conf->propale->dir_images)) { mkdir($conf->propale->dir_images); } +if (! is_dir($conf->propal->dir_images)) { mkdir($conf->propal->dir_images); } -$filename = $conf->propale->dir_images."/propale$year.png"; -$fileurl = $conf->propale->url_images."/propale$year.png"; +$filename = $conf->propal->dir_images."/propale$year.png"; +$fileurl = $conf->propal->url_images."/propale$year.png"; $px = new BarGraph($data); $mesg = $px->isGraphKo(); @@ -72,8 +72,8 @@ for ($i = 1 ; $i < 13 ; $i++) $data[$i-1] = array(strftime("%b",mktime(12,12,12,$i,1,$year)), $res[$i]); } -$filename_amount = $conf->propale->dir_images."/propaleamount$year.png"; -$fileurl_amount = $conf->propale->url_images."/propaleamount$year.png"; +$filename_amount = $conf->propal->dir_images."/propaleamount$year.png"; +$fileurl_amount = $conf->propal->url_images."/propaleamount$year.png"; $px = new BarGraph($data); $mesg = $px->isGraphKo(); @@ -93,8 +93,8 @@ for ($i = 1 ; $i < 13 ; $i++) $data[$i-1] = array(strftime("%b",mktime(12,12,12,$i,1,$year)), $res[$i]); } -$filename_avg = $conf->propale->dir_images."/propalaverage$year.png"; -$fileurl_avg = $conf->propale->url_images."/propalaverage$year.png"; +$filename_avg = $conf->propal->dir_images."/propalaverage$year.png"; +$fileurl_avg = $conf->propal->url_images."/propalaverage$year.png"; $px = new BarGraph($data); $mesg = $px->isGraphKo(); diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 6715dbc4e70..721cd33d4dd 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -306,10 +306,10 @@ if (defined("MAIN_MODULE_FACTURE")) if (defined("MAIN_MODULE_PROPALE")) { $conf->propal->enabled=MAIN_MODULE_PROPALE; - $conf->propale->dir_output=DOL_DATA_ROOT."/propale"; - if (defined(PROPALE_OUTPUTDIR) && PROPALE_OUTPUTDIR) { $conf->propale->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par défaut - $conf->propale->dir_images=DOL_DOCUMENT_ROOT."/images/propale"; - $conf->propale->url_images=DOL_URL_ROOT."/images/propale"; + $conf->propal->dir_output=DOL_DATA_ROOT."/propale"; + if (defined(PROPALE_OUTPUTDIR) && PROPALE_OUTPUTDIR) { $conf->propal->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par défaut + $conf->propal->dir_images=DOL_DOCUMENT_ROOT."/images/propale"; + $conf->propal->url_images=DOL_URL_ROOT."/images/propale"; require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); if (!defined("PROPALE_NEW_FORM_NB_PRODUCT"))
'; print_titre(''.$langs->trans("Document").''); @@ -665,7 +664,7 @@ if ($_GET["propalid"]) print ''; - $file = PROPALE_OUTPUTDIR . "/$propal->ref/$propal->ref.pdf"; + $file = $conf->propal->dir_output . "/$propal->ref/$propal->ref.pdf"; if (file_exists($file)) { print ""; @@ -765,7 +764,7 @@ if ($_GET["propalid"]) } else { - print $db->error(); + dolibarr_print_error($db); } /* * @@ -797,11 +796,12 @@ if ($_GET["propalid"]) print ''; print_titre("Envoyer la propale par mail"); + $form=new Form($db); // Formulaire envoi mail print '
PDF
'; // Destinataire - print ""; + print ""; print ""; // CC @@ -809,6 +809,7 @@ if ($_GET["propalid"]) print ''; // Sender +/* print ""; print ""; print ""; @@ -816,6 +817,8 @@ if ($_GET["propalid"]) print ""; print "
Destinataire
Destinatairefirstname)) . " " . ucfirst(strtolower($obj->name)) . " <$obj->email>\">
Expediteur$from_name$from_mail
Reply-to$replytoname$replytomail
Message
"; +*/ +$form->mail_topicmessagefile(0,1,1,$message); print "trans("Send")."\">"; print ""; @@ -916,7 +919,7 @@ else print " propalid\">$objp->ref