New: Ajout fonction cloturer contrat
This commit is contained in:
parent
7d728bd165
commit
abd5cd499e
@ -183,11 +183,11 @@ if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes' && $user->
|
|||||||
$result = $contrat->validate($user);
|
$result = $contrat->validate($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'confirm_cancel' && $_POST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
if ($_POST["action"] == 'confirm_close' && $_POST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$contrat = new Contrat($db);
|
||||||
$contrat->fetch($_GET["id"]);
|
$contrat->fetch($_GET["id"]);
|
||||||
$result = $contrat->cancel($user);
|
$result = $contrat->cloture($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
||||||
@ -488,11 +488,12 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de l'annulation
|
* Confirmation de la fermeture
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'annuler')
|
if ($_GET["action"] == 'close')
|
||||||
{
|
{
|
||||||
$html->form_confirm("fiche.php?id=$id",$langs->trans("Cancel"),"Etes-vous sûr de vouloir annuler cette contrat ?","confirm_cancel");
|
$html->form_confirm("fiche.php?id=$id",$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close");
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -633,7 +634,7 @@ else
|
|||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print '<td colspan="2"> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
if ($contrat->statut == 0 && $user->rights->contrat->creer)
|
if ($contrat->statut == 0 && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
@ -834,7 +835,14 @@ else
|
|||||||
print '<a class="butAction" href="fiche.php?id='.$id.'&action=valid">'.$langs->trans("Valid").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$id.'&action=valid">'.$langs->trans("Valid").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->contrat->supprimer)
|
// \todo Mettre bouton cloturer que si tous les services sont clos
|
||||||
|
$numclos=$num;
|
||||||
|
if ($contrat->statut == 1 && $num == $numclos)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="fiche.php?id='.$id.'&action=close">'.$langs->trans("Close").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($contrat->statut == 0 && $user->rights->contrat->supprimer)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?id='.$id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?id='.$id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,10 @@ NewContract=New contract
|
|||||||
AddContract=Add contract
|
AddContract=Add contract
|
||||||
SearchAContract=Search a contract
|
SearchAContract=Search a contract
|
||||||
DeleteAContract=Delete a contract
|
DeleteAContract=Delete a contract
|
||||||
|
CloseAContract=Close a contract
|
||||||
ConfirmDeleteAContract=Are you sure you want to delete this contract ?
|
ConfirmDeleteAContract=Are you sure you want to delete this contract ?
|
||||||
ConfirmValidateContract=Are you sure you want to validate this contract ?
|
ConfirmValidateContract=Are you sure you want to validate this contract ?
|
||||||
|
ConfirmCloseContract=Are you sure you want to close this contract ?
|
||||||
ConfirmCloseService=Are you sure you want to close this service ?
|
ConfirmCloseService=Are you sure you want to close this service ?
|
||||||
ValidateAContract=Validate a contract
|
ValidateAContract=Validate a contract
|
||||||
ActivateService=Activate service
|
ActivateService=Activate service
|
||||||
|
|||||||
@ -26,8 +26,10 @@ NewContract=Nouveau contrat
|
|||||||
AddContract=Créer contrat
|
AddContract=Créer contrat
|
||||||
SearchAContract=Rechercher un contrat
|
SearchAContract=Rechercher un contrat
|
||||||
DeleteAContract=Supprimer un contract
|
DeleteAContract=Supprimer un contract
|
||||||
|
CloseAContract=Cloturer un contract
|
||||||
ConfirmDeleteAContract=Etes-vous sûr de vouloir supprimer ce contrat ?
|
ConfirmDeleteAContract=Etes-vous sûr de vouloir supprimer ce contrat ?
|
||||||
ConfirmValidateContract=Etes-vous sûr de vouloir valider cet contrat ?
|
ConfirmValidateContract=Etes-vous sûr de vouloir valider ce contrat ?
|
||||||
|
ConfirmCloseContract=Etes-vous sûr de vouloir cloturer ce contrat ?
|
||||||
ConfirmCloseService=Etes-vous sûr de vouloir fermer ce service ?
|
ConfirmCloseService=Etes-vous sûr de vouloir fermer ce service ?
|
||||||
ValidateAContract=Valider un contrat
|
ValidateAContract=Valider un contrat
|
||||||
ActivateService=Activer le service
|
ActivateService=Activer le service
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user