';
+ // Re-open
+ if ($permissiontoadd && $object->statut == $object::STATUS_CANCELED)
+ {
+ print '
'.$langs->trans("ReOpen").'';
+ }
+
print '
';
- if ($object->statut == 0)
+ if ($object->statut == $object::STATUS_DRAFT)
{
print '
';
}
- if (($object->statut == 0 || $object->statut == 1) && $totalpaid == 0 && $object->paid == 0)
+ if (($object->statut == $object::STATUS_DRAFT || $object->statut == $object::STATUS_VALIDATED) && $totalpaid == 0 && $object->paid == 0)
{
print '
";
}
// Create payment
- if ($object->statut == 1 && $object->paid == 0 && $user->rights->don->creer)
+ if ($object->statut == $object::STATUS_VALIDATED && $object->paid == 0 && $user->rights->don->creer)
{
if ($remaintopay == 0)
{
@@ -808,7 +852,7 @@ if (!empty($id) && $action != 'edit')
}
// Classify 'paid'
- if ($object->statut == 1 && round($remaintopay) == 0 && $object->paid == 0 && $user->rights->don->creer)
+ if ($object->statut == $object::STATUS_VALIDATED && round($remaintopay) == 0 && $object->paid == 0 && $user->rights->don->creer)
{
print '
";
}
@@ -816,7 +860,7 @@ if (!empty($id) && $action != 'edit')
// Delete
if ($user->rights->don->supprimer)
{
- if ($object->statut == -1 || $object->statut == 0)
+ if ($object->statut == $object::STATUS_CANCELED || $object->statut == $object::STATUS_DRAFT)
{
print '
";
} else {
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index 7479dd3ce7c..bb4f0717a5a 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -818,6 +818,31 @@ class Don extends CommonObject
}
}
+ /**
+ * Set cancel status
+ *
+ * @param User $user Object user that modify
+ * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
+ * @return int <0 if KO, 0=Nothing done, >0 if OK
+ */
+ public function reopen($user, $notrigger = 0)
+ {
+ // Protection
+ if ($this->statut != self::STATUS_CANCELED)
+ {
+ return 0;
+ }
+
+ /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate))))
+ {
+ $this->error='Permission denied';
+ return -1;
+ }*/
+
+ return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'DON_REOPEN');
+ }
+
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Sum of donations
@@ -900,6 +925,7 @@ class Don extends CommonObject
$label = img_picto('', $this->picto).'
'.$langs->trans("Donation").'';
if (!empty($this->id)) {
$label .= '
'.$langs->trans('Ref').': '.$this->id;
+ $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day');
}
if ($moretitle) $label .= ' - '.$moretitle;
diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php
index fdfe177f9eb..710e21f76b7 100644
--- a/htdocs/don/class/paymentdonation.class.php
+++ b/htdocs/don/class/paymentdonation.class.php
@@ -622,8 +622,8 @@ class PaymentDonation extends CommonObject
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
- * @param int $maxlen Longueur max libelle
- * @return string Chaine avec URL
+ * @param int $maxlen Max length
+ * @return string String with URL
*/
public function getNomUrl($withpicto = 0, $maxlen = 0)
{
@@ -631,7 +631,9 @@ class PaymentDonation extends CommonObject
$result = '';
- $label = $langs->trans("ShowPayment").': '.$this->ref;
+ $label = '
'.$langs->trans("DonationPayment").'';
+ $label .= '
';
+ $label .= '
'.$langs->trans('Ref').': '.$this->ref;
if (!empty($this->id))
{
diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php
index 9d4bc3ac268..c7c16ee970b 100644
--- a/htdocs/don/payment/card.php
+++ b/htdocs/don/payment/card.php
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("bills", "banks", "companies"));
+$langs->loadLangs(array("bills", "banks", "companies", "donations"));
// Security check
$id = GETPOST('rowid') ? GETPOST('rowid', 'int') : GETPOST('id', 'int');
@@ -70,6 +70,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp
}
+
/*
* View
*/
@@ -81,6 +82,7 @@ $form = new Form($db);
$h = 0;
+$head = array();
$head[$h][0] = DOL_URL_ROOT.'/don/payment/card.php?id='.$id;
$head[$h][1] = $langs->trans("DonationPayment");
$hselected = $h;
@@ -111,7 +113,7 @@ print '
| '.$langs->trans('Date').' | '.dol_print_
print ' |
| '.$langs->trans('Mode').' | '.$langs->trans("PaymentType".$object->type_code).' |
';
// Number
-print '
| '.$langs->trans('Number').' | '.$object->num_payment.' |
';
+print '
| '.$langs->trans('Numero').' | '.$object->num_payment.' |
';
// Amount
print '
| '.$langs->trans('Amount').' | '.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).' |
';
diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php
index 0a50ed00718..6aee986396b 100644
--- a/htdocs/salaries/class/paymentsalary.class.php
+++ b/htdocs/salaries/class/paymentsalary.class.php
@@ -578,9 +578,19 @@ class PaymentSalary extends CommonObject
$result = '';
- $label = '
'.$langs->trans("ShowSalaryPayment").'';
- $label .= '
';
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
+ $label = img_picto('', $this->picto).'
'.$langs->trans("SalaryPayment").'';
+ $label .= '
'.$langs->trans('Ref').': '.$this->ref;
+ if (!empty($this->label)) {
+ $labeltoshow = $this->label;
+ $reg = array();
+ if (preg_match('/^\((.*)\)$/i', $this->label, $reg))
+ {
+ // Label generique car entre parentheses. On l'affiche en le traduisant
+ if ($reg[1] == 'paiement') $reg[1] = 'Payment';
+ $labeltoshow = $langs->trans($reg[1]);
+ }
+ $label .= '
'.$langs->trans('Label').': '.$labeltoshow;
+ }
$url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id;