Close #4512
This commit is contained in:
parent
5b9ac2a7a9
commit
521d61c5ef
@ -1577,7 +1577,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
if ($action != 'editdescription' && ($action != 'presend')) {
|
if ($action != 'editdescription' && ($action != 'presend')) {
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == 0 && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) {
|
if ($object->statut == Fichinter::STATUS_DRAFT && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) {
|
||||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) {
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id=' . $object->id . '&action=validate"';
|
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id=' . $object->id . '&action=validate"';
|
||||||
print '>' . $langs->trans("Validate") . '</a></div>';
|
print '>' . $langs->trans("Validate") . '</a></div>';
|
||||||
@ -1585,7 +1585,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if ($object->statut == 1 && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->unvalidate)))
|
if ($object->statut == Fichinter::STATUS_VALIDATED && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->unvalidate)))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=modify">';
|
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=modify">';
|
||||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) print $langs->trans("Modify");
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) print $langs->trans("Modify");
|
||||||
@ -1594,7 +1594,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
if ($object->statut > 0)
|
if ($object->statut > Fichinter::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send)
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send)
|
||||||
{
|
{
|
||||||
@ -1606,10 +1606,10 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
// Event agenda
|
// Event agenda
|
||||||
if (! empty($conf->global->FICHINTER_ADDLINK_TO_EVENT))
|
if (! empty($conf->global->FICHINTER_ADDLINK_TO_EVENT))
|
||||||
{
|
{
|
||||||
if (! empty($conf->agenda->enabled) && $object->statut > 0)
|
if (! empty($conf->agenda->enabled) && $object->statut > Fichinter::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
$langs->load("agenda");
|
$langs->load("agenda");
|
||||||
if ($object->statut < 2)
|
if ($object->statut < Fichinter::STATUS_BILLED)
|
||||||
{
|
{
|
||||||
if ($user->rights->agenda->myactions->create) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("AddEvent").'</a></div>';
|
if ($user->rights->agenda->myactions->create) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("AddEvent").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddEvent").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddEvent").'</a></div>';
|
||||||
@ -1618,10 +1618,10 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Proposal
|
// Proposal
|
||||||
if (! empty($conf->propal->enabled) && $object->statut > 0)
|
if (! empty($conf->propal->enabled) && $object->statut > Fichinter::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
if ($object->statut < 2)
|
if ($object->statut < Fichinter::STATUS_BILLED)
|
||||||
{
|
{
|
||||||
if ($user->rights->propal->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddProp").'</a></div>';
|
if ($user->rights->propal->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddProp").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddProp").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddProp").'</a></div>';
|
||||||
@ -1629,10 +1629,10 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Invoicing
|
// Invoicing
|
||||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
if (! empty($conf->facture->enabled) && $object->statut > Fichinter::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
if ($object->statut < 2)
|
if ($object->statut < Fichinter::STATUS_BILLED)
|
||||||
{
|
{
|
||||||
if ($user->rights->facture->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddBill").'</a></div>';
|
if ($user->rights->facture->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddBill").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddBill").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddBill").'</a></div>';
|
||||||
@ -1640,7 +1640,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
if (! empty($conf->global->FICHINTER_CLASSIFY_BILLED)) // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
|
if (! empty($conf->global->FICHINTER_CLASSIFY_BILLED)) // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
|
||||||
{
|
{
|
||||||
if ($object->statut != 2)
|
if ($object->statut != Fichinter::STATUS_BILLED)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("InterventionClassifyBilled").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("InterventionClassifyBilled").'</a></div>';
|
||||||
}
|
}
|
||||||
@ -1652,7 +1652,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
if (empty($conf->global->FICHINTER_CLASSIFY_BILLED) && $object->statut > 0 && $object->statut < 3)
|
if (empty($conf->global->FICHINTER_CLASSIFY_BILLED) && $object->statut > Fichinter::STATUS_DRAFT && $object->statut < Fichinter::STATUS_CLOSED)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifydone">'.$langs->trans("InterventionClassifyDone").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifydone">'.$langs->trans("InterventionClassifyDone").'</a></div>';
|
||||||
}
|
}
|
||||||
@ -1663,7 +1663,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if (($object->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer)
|
if (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete"';
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete"';
|
||||||
print '>'.$langs->trans('Delete').'</a></div>';
|
print '>'.$langs->trans('Delete').'</a></div>';
|
||||||
|
|||||||
@ -62,6 +62,23 @@ class Fichinter extends CommonObject
|
|||||||
|
|
||||||
var $lines = array();
|
var $lines = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draft status
|
||||||
|
*/
|
||||||
|
const STATUS_DRAFT = 0;
|
||||||
|
/**
|
||||||
|
* Validated status
|
||||||
|
*/
|
||||||
|
const STATUS_VALIDATED = 1;
|
||||||
|
/**
|
||||||
|
* Billed
|
||||||
|
*/
|
||||||
|
const STATUS_BILLED = 2;
|
||||||
|
/**
|
||||||
|
* Closed
|
||||||
|
*/
|
||||||
|
const STATUS_CLOSED = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user