';
+
+ // Valid
+ if ($propal->statut == 0)
{
- print '
';
-
- // Valid
- if ($propal->statut == 0)
- {
- if ($user->rights->propale->valider)
- {
- print '
'.$langs->trans('Valid').'';
- }
- }
-
- // Save
- if ($propal->statut == 1)
- {
- if ($user->rights->propale->creer)
- {
- print '
'.$langs->trans('Edit').'';
- }
- }
-
- // Build PDF
- if ($propal->statut < 2 && $user->rights->propale->creer)
- {
- print '
'.$langs->trans('BuildPDF').'';
- }
-
- // Send
- if ($propal->statut == 1)
- {
- if ($user->rights->propale->envoyer)
- {
- $propref = sanitize_string($obj->ref);
- $file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf';
- if (file_exists($file))
- {
- print '
'.$langs->trans('Send').'';
- }
- }
- }
-
- // Close
- if ($propal->statut != 0)
- {
- if ($propal->statut == 1 && $user->rights->propale->cloturer)
- {
- print '
'.$langs->trans('Close').'';
- }
- }
-
- // Delete
- if ($propal->statut == 0)
- {
- if ($user->rights->propale->supprimer)
- {
- print '
'.$langs->trans('Delete').'';
- }
- }
-
- print '
';
+ if ($user->rights->propale->valider)
+ {
+ print '
'.$langs->trans('Valid').'';
+ }
}
+
+ // Save
+ if ($propal->statut == 1)
+ {
+ if ($user->rights->propale->creer)
+ {
+ print '
'.$langs->trans('Edit').'';
+ }
+ }
+
+ // Build PDF
+ if ($user->rights->propale->creer)
+ {
+ if ($propal->statut < 2)
+ {
+ print '
'.$langs->trans("BuildPDF").'';
+ }
+ else
+ {
+ print '
'.$langs->trans("RebuildPDF").'';
+ }
+ }
+
+ // Send
+ if ($propal->statut == 1)
+ {
+ if ($user->rights->propale->envoyer)
+ {
+ $propref = sanitize_string($obj->ref);
+ $file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf';
+ if (file_exists($file))
+ {
+ print '
'.$langs->trans('Send').'';
+ }
+ }
+ }
+
+ // Close
+ if ($propal->statut != 0)
+ {
+ if ($propal->statut == 1 && $user->rights->propale->cloturer)
+ {
+ print '
'.$langs->trans('Close').'';
+ }
+ }
+
+ // Delete
+ if ($propal->statut == 0)
+ {
+ if ($user->rights->propale->supprimer)
+ {
+ print '
'.$langs->trans('Delete').'';
+ }
+ }
+
+ print '
';
+
print '