Fix: Uniformisation du rpertoire de gnration des propales.

This commit is contained in:
Laurent Destailleur 2004-12-23 17:53:27 +00:00
parent 79a694a546
commit 0d9d363b51
5 changed files with 34 additions and 31 deletions

View File

@ -274,7 +274,7 @@ print "<tr class=\"liste_titre\">\n";
print " <td>".$langs->trans("Name")."</td>\n";
print " <td>".$langs->trans("Value")."</td>\n";
print "</tr>\n";
print "<tr ".$bc[True].">\n <td width=\"140\">".$langs->trans("Directory")."</td>\n <td>".$conf->propale->dir_output."</td>\n</tr>\n";
print "<tr ".$bc[True].">\n <td width=\"140\">".$langs->trans("Directory")."</td>\n <td>".$conf->propal->dir_output."</td>\n</tr>\n";
print "</table>\n<br>";

View File

@ -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 "<a class=\"tabAction\" href=\"propal.php?propalid=$propal->id&amp;action=presend\">Envoyer la proposition</a>";
}
$file = $conf->propal->dir_output . "/$obj->ref/$obj->ref.pdf";
if (file_exists($file))
{
print "<a class=\"tabAction\" href=\"propal.php?propalid=$propal->id&amp;action=presend\">".$langs->trans("Send")."</a>";
}
}
}
@ -584,7 +583,7 @@ if ($_GET["propalid"])
{
if ($user->rights->propale->supprimer)
{
print "<a class=\"tabAction\" href=\"propal.php?propalid=$propal->id&amp;action=delete\">".$langs->trans("Delete")."</a>";
print "<a class=\"butDelete\" href=\"propal.php?propalid=$propal->id&amp;action=delete\">".$langs->trans("Delete")."</a>";
}
}
@ -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 '<form action="propal.php?propalid='.$propal->id.'" method="post">';
print '<input type="hidden" name="action" value="setpdfmodel">';
}
print '<table width="100%" cellspacing="2"><tr><td width="50%" valign="top">';
print '<table width="100%"><tr><td width="50%" valign="top">';
print_titre('<a href="propal/document.php?id='.$propal->id.'">'.$langs->trans("Document").'</a>');
@ -665,7 +664,7 @@ if ($_GET["propalid"])
print '<table class="border" width="100%">';
$file = PROPALE_OUTPUTDIR . "/$propal->ref/$propal->ref.pdf";
$file = $conf->propal->dir_output . "/$propal->ref/$propal->ref.pdf";
if (file_exists($file))
{
print "<tr $bc[0]><td>PDF</td>";
@ -765,7 +764,7 @@ if ($_GET["propalid"])
}
else
{
print $db->error();
dolibarr_print_error($db);
}
/*
*
@ -797,11 +796,12 @@ if ($_GET["propalid"])
print '<input type="hidden" name="max_file_size" value="2000000">';
print_titre("Envoyer la propale par mail");
$form=new Form($db);
// Formulaire envoi mail
print '<table class="border" width="100%">';
// Destinataire
print "<tr><td width=\"180Â\">Destinataire</td>";
print "<tr><td width=\"180\">Destinataire</td>";
print "<td colspan=\"6\" align=\"left\"><input size=\"50\" name=\"sendto\" value=\"" . ucfirst(strtolower($obj->firstname)) . " " . ucfirst(strtolower($obj->name)) . " <$obj->email>\"></td></tr>";
// CC
@ -809,6 +809,7 @@ if ($_GET["propalid"])
print '<td colspan="6" align="left"><input size="50" name="sendtocc"></td></tr>';
// Sender
/*
print "<tr><td>Expediteur</td><td colspan=\"5\">$from_name</td><td>$from_mail</td></tr>";
print "<tr><td>Reply-to</td><td colspan=\"5\">$replytoname</td>";
print "<td>$replytomail</td></tr>";
@ -816,6 +817,8 @@ if ($_GET["propalid"])
print "<tr><td valign=\"top\">Message</td><td colspan=\"6\"><textarea rows=\"5\" cols=\"40\" name=\"message\">$message</textarea></td></tr>";
print "</table>";
*/
$form->mail_topicmessagefile(0,1,1,$message);
print "<input type=\"submit\" value=\"".$langs->trans("Send")."\">";
print "</form>";
@ -916,7 +919,7 @@ else
print "</a>&nbsp;<a href=\"propal.php?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
if ($objp->client == 1)
{
$url ='fiche.php?socid='.$objp->idp;
$url = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->idp;
}
else
{

View File

@ -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();

View File

@ -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();

View File

@ -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"))