NEW Save user of last modification in donation record
This commit is contained in:
parent
c9fc17efae
commit
036c1410c7
@ -741,7 +741,7 @@ if (! empty($id) && $action != 'edit')
|
|||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0; $total = 0;
|
$i = 0; $total = 0;
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder paymenttable centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||||
print '<td>'.$langs->trans("Date").'</td>';
|
print '<td>'.$langs->trans("Date").'</td>';
|
||||||
|
|||||||
@ -123,10 +123,11 @@ class Don extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $labelstatutshort;
|
public $labelstatutshort;
|
||||||
|
|
||||||
/**
|
|
||||||
* Draft
|
|
||||||
*/
|
|
||||||
const STATUS_DRAFT = 0;
|
const STATUS_DRAFT = 0;
|
||||||
|
const STATUS_VALIDATED = 1;
|
||||||
|
const STATUS_PAID = 2;
|
||||||
|
const STATUS_CANCELED = -1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -155,11 +156,11 @@ class Don extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return the label of a given status
|
* Return the label of a given status
|
||||||
*
|
*
|
||||||
* @param int $statut Id statut
|
* @param int $status Id statut
|
||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle du statut
|
* @return string Libelle du statut
|
||||||
*/
|
*/
|
||||||
public function LibStatut($statut, $mode = 0)
|
public function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (empty($this->labelstatut) || empty($this->labelstatutshort))
|
if (empty($this->labelstatut) || empty($this->labelstatutshort))
|
||||||
@ -176,49 +177,11 @@ class Don extends CommonObject
|
|||||||
$this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort");
|
$this->labelstatutshort[2]=$langs->trans("DonationStatusPaidShort");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 0)
|
$statusType = 'status'.$status;
|
||||||
{
|
if ($status == self::STATUS_CANCELED) $statusType = 'status5';
|
||||||
return $this->labelstatut[$statut];
|
if ($status == self::STATUS_PAID) $statusType = 'status6';
|
||||||
}
|
|
||||||
elseif ($mode == 1)
|
return dolGetStatus($this->labelstatut[$status], $this->labelstatutshort[$status], '', $statusType, $mode);
|
||||||
{
|
|
||||||
return $this->labelstatutshort[$statut];
|
|
||||||
}
|
|
||||||
elseif ($mode == 2)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return img_picto($this->labelstatut[$statut], 'statut5').' '.$this->labelstatutshort[$statut];
|
|
||||||
elseif ($statut == 0) return img_picto($this->labelstatut[$statut], 'statut0').' '.$this->labelstatutshort[$statut];
|
|
||||||
elseif ($statut == 1) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatutshort[$statut];
|
|
||||||
elseif ($statut == 2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatutshort[$statut];
|
|
||||||
}
|
|
||||||
elseif ($mode == 3)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return img_picto($this->labelstatut[$statut], 'statut5');
|
|
||||||
elseif ($statut == 0) return img_picto($this->labelstatut[$statut], 'statut0');
|
|
||||||
elseif ($statut == 1) return img_picto($this->labelstatut[$statut], 'statut1');
|
|
||||||
elseif ($statut == 2) return img_picto($this->labelstatut[$statut], 'statut6');
|
|
||||||
}
|
|
||||||
elseif ($mode == 4)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return img_picto($this->labelstatut[$statut], 'statut5').' '.$this->labelstatut[$statut];
|
|
||||||
elseif ($statut == 0) return img_picto($this->labelstatut[$statut], 'statut0').' '.$this->labelstatut[$statut];
|
|
||||||
elseif ($statut == 1) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut];
|
|
||||||
elseif ($statut == 2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut];
|
|
||||||
}
|
|
||||||
elseif ($mode == 5)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut5');
|
|
||||||
elseif ($statut == 0) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut0');
|
|
||||||
elseif ($statut == 1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1');
|
|
||||||
elseif ($statut == 2) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6');
|
|
||||||
}
|
|
||||||
elseif ($mode == 6)
|
|
||||||
{
|
|
||||||
if ($statut == -1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut5');
|
|
||||||
elseif ($statut == 0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut0');
|
|
||||||
elseif ($statut == 1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1');
|
|
||||||
elseif ($statut == 2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,8 @@ UPDATE llx_c_units SET label = 'SurfaceUnitm2' WHERE code IN ('M2');
|
|||||||
|
|
||||||
-- For v11
|
-- For v11
|
||||||
|
|
||||||
|
ALTER TABLE llx_don ADD COLUMN fk_user_modif integer;
|
||||||
|
|
||||||
ALTER TABLE llx_expeditiondet ADD INDEX idx_expeditiondet_fk_origin_line (fk_origin_line);
|
ALTER TABLE llx_expeditiondet ADD INDEX idx_expeditiondet_fk_origin_line (fk_origin_line);
|
||||||
|
|
||||||
ALTER TABLE llx_rights_def ADD COLUMN module_position INTEGER NOT NULL DEFAULT 0;
|
ALTER TABLE llx_rights_def ADD COLUMN module_position INTEGER NOT NULL DEFAULT 0;
|
||||||
|
|||||||
@ -47,6 +47,7 @@ create table llx_don
|
|||||||
fk_projet integer NULL, -- Donation is given for a project ?
|
fk_projet integer NULL, -- Donation is given for a project ?
|
||||||
datec datetime, -- Create date
|
datec datetime, -- Create date
|
||||||
fk_user_author integer NOT NULL,
|
fk_user_author integer NOT NULL,
|
||||||
|
fk_user_modif integer,
|
||||||
date_valid datetime, -- date de validation
|
date_valid datetime, -- date de validation
|
||||||
fk_user_valid integer NULL,
|
fk_user_valid integer NULL,
|
||||||
note_private text,
|
note_private text,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user