New: Gestion des aperçus sur les propales (patch de Christophe)
This commit is contained in:
parent
5992673635
commit
161f61d6ff
@ -398,6 +398,10 @@ if ($_GET['propalid'])
|
|||||||
$head[$h][1] = $langs->trans('AccountancyCard');
|
$head[$h][1] = $langs->trans('AccountancyCard');
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
|
||||||
|
$head[$h][1] = $langs->trans("Preview");
|
||||||
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
||||||
$head[$h][1] = $langs->trans('Note');
|
$head[$h][1] = $langs->trans('Note');
|
||||||
$h++;
|
$h++;
|
||||||
@ -529,8 +533,8 @@ if ($_GET['propalid'])
|
|||||||
|
|
||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled)
|
||||||
{
|
{
|
||||||
|
$langs->load("projects");
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td>';
|
print '<tr><td>'.$langs->trans('Project').'</td>';
|
||||||
$langs->load('projects');
|
|
||||||
$numprojet = $societe->has_projects();
|
$numprojet = $societe->has_projects();
|
||||||
if (! $numprojet)
|
if (! $numprojet)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -103,6 +103,10 @@ if ($propalid > 0)
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/propal.php?propalid='.$propal->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/propal.php?propalid='.$propal->id;
|
||||||
$head[$h][1] = $langs->trans('AccountancyCard');
|
$head[$h][1] = $langs->trans('AccountancyCard');
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
|
||||||
|
$head[$h][1] = $langs->trans("Preview");
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
||||||
|
|||||||
@ -63,6 +63,10 @@ if ($_GET['propalid'])
|
|||||||
$head[$h][1] = $langs->trans('AccountancyCard');
|
$head[$h][1] = $langs->trans('AccountancyCard');
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
|
||||||
|
$head[$h][1] = $langs->trans("Preview");
|
||||||
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
||||||
$head[$h][1] = $langs->trans('Note');
|
$head[$h][1] = $langs->trans('Note');
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -81,6 +81,10 @@ if ($_GET['propalid'])
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/propal.php?propalid='.$propal->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/propal.php?propalid='.$propal->id;
|
||||||
$head[$h][1] = $langs->trans('AccountancyCard');
|
$head[$h][1] = $langs->trans('AccountancyCard');
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
|
||||||
|
$head[$h][1] = $langs->trans("Preview");
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
||||||
|
|||||||
@ -107,6 +107,10 @@ if ($_GET["propalid"])
|
|||||||
$hselected=$h;
|
$hselected=$h;
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
|
||||||
|
$head[$h][1] = $langs->trans("Preview");
|
||||||
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
|
||||||
$head[$h][1] = $langs->trans('Note');
|
$head[$h][1] = $langs->trans('Note');
|
||||||
$h++;
|
$h++;
|
||||||
@ -221,9 +225,9 @@ if ($_GET["propalid"])
|
|||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td>';
|
print '<tr><td>'.$langs->trans('Project').'</td>';
|
||||||
$numprojet = $societe->has_projects();
|
$numprojet = $societe->has_projects();
|
||||||
print '<td colspan="2">';
|
|
||||||
if (! $numprojet)
|
if (! $numprojet)
|
||||||
{
|
{
|
||||||
|
print '<td colspan="2">';
|
||||||
print $langs->trans("NoProject").'</td><td>';
|
print $langs->trans("NoProject").'</td><td>';
|
||||||
print '<a href=../projet/fiche.php?socidp='.$societe->id.'&action=create>'.$langs->trans('AddProject').'</a>';
|
print '<a href=../projet/fiche.php?socidp='.$societe->id.'&action=create>'.$langs->trans('AddProject').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -232,10 +236,11 @@ if ($_GET["propalid"])
|
|||||||
{
|
{
|
||||||
if ($propal->statut == 0 && $user->rights->propale->creer)
|
if ($propal->statut == 0 && $user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
print '<td colspan="3">';
|
print '<td colspan="2">';
|
||||||
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
||||||
print '<input type="hidden" name="action" value="set_project">';
|
print '<input type="hidden" name="action" value="set_project">';
|
||||||
$form->select_projects($societe->id, $propal->projetidp, 'projetidp');
|
$form->select_projects($societe->id, $propal->projetidp, 'projetidp');
|
||||||
|
print '</td><td>';
|
||||||
print '<input type="submit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -265,7 +270,8 @@ if ($_GET["propalid"])
|
|||||||
{
|
{
|
||||||
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
||||||
print '<input type="hidden" name="action" value="setremise">';
|
print '<input type="hidden" name="action" value="setremise">';
|
||||||
print '<td colspan="3"><input type="text" name="remise" size="3" value="'.$propal->remise_percent.'">% ';
|
print '<td colspan="2"><input type="text" name="remise" size="3" value="'.$propal->remise_percent.'">% ';
|
||||||
|
print '</td><td>';
|
||||||
print '<input type="submit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" value="'.$langs->trans('Modify').'">';
|
||||||
print ' <a href="propal/aideremise.php?propalid='.$propal->id.'">?</a>';
|
print ' <a href="propal/aideremise.php?propalid='.$propal->id.'">?</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -127,6 +127,8 @@ function propale_pdf_create($db, $facid, $modele='')
|
|||||||
|
|
||||||
if ( $obj->write_pdf_file($facid) > 0)
|
if ( $obj->write_pdf_file($facid) > 0)
|
||||||
{
|
{
|
||||||
|
// on supprime l'image correspondant au preview
|
||||||
|
propale_delete_preview($db, $facid);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -142,4 +144,33 @@ function propale_pdf_create($db, $facid, $modele='')
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
\brief Supprime l'image de prévisualitation, pour le cas de régénération de propal
|
||||||
|
\param db objet base de donnée
|
||||||
|
\param propalid id de la propal à effacer
|
||||||
|
*/
|
||||||
|
function propale_delete_preview($db, $propalid)
|
||||||
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
|
$propal = new Propal($db,"",$propalid);
|
||||||
|
$propal->fetch($propalid);
|
||||||
|
$propal->fetch_client();
|
||||||
|
|
||||||
|
if ($conf->propal->dir_output)
|
||||||
|
{
|
||||||
|
$propalref = sanitize_string($propal->ref);
|
||||||
|
$dir = $conf->propal->dir_output . "/" . $propalref ;
|
||||||
|
$file = $dir . "/" . $propalref . ".pdf.png";
|
||||||
|
|
||||||
|
if ( file_exists( $file ) && is_writable( $file ) )
|
||||||
|
{
|
||||||
|
if ( ! unlink($file) )
|
||||||
|
{
|
||||||
|
$this->error=$langs->trans("ErrorFailedToOpenFile",$file);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -58,3 +58,4 @@ ClassifyBilled=Classer factur
|
|||||||
BuildBill=Créer facture
|
BuildBill=Créer facture
|
||||||
RelatedBill=Facture associée
|
RelatedBill=Facture associée
|
||||||
RelatedBills=Factures associées
|
RelatedBills=Factures associées
|
||||||
|
ErrorPropalNotFound=Propal %s inexistante
|
||||||
|
|||||||
@ -70,6 +70,17 @@ if ($modulepart)
|
|||||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrapping pour les apercu propal
|
||||||
|
if ($modulepart == 'apercupropal')
|
||||||
|
{
|
||||||
|
$user->getrights('propale');
|
||||||
|
if ($user->rights->propale->lire)
|
||||||
|
{
|
||||||
|
$accessallowed=1;
|
||||||
|
}
|
||||||
|
$original_file=$conf->propal->dir_output.'/'.$original_file;
|
||||||
|
}
|
||||||
|
|
||||||
// Wrapping pour les images des stats propales
|
// Wrapping pour les images des stats propales
|
||||||
if ($modulepart == 'propalstats')
|
if ($modulepart == 'propalstats')
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user