diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index cac6deb194b..565895e3066 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -273,7 +273,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') $hselected=$h; $h++; - dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").": ".$_GET["rowid"]); + dolibarr_fiche_head($head, $hselected, $langs->trans("Ref")); print '
'; print ''; @@ -281,16 +281,24 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') print ''; print ''; + // Ref + print "".''; + print ''; + + // Date print "".''; - - $nbrows=12; + + $nbrows=12; if ($conf->projet->enabled) $nbrows++; print '"; + // Project if ($conf->projet->enabled) { print "\n"; } - + print ""; @@ -370,16 +378,24 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit') print ""; print '
'.$langs->trans("Ref").''; + print $don->getNomUrl(); + print '
'.$langs->trans("Date").''; $html->select_date($don->date,'','','','',"update"); print ''.$langs->trans("Comments").' :
'; print "
".$langs->trans("Project")."
"; print "
".$langs->trans("PublicDonation").""; print $html->selectyesno("public",1,1); print "
'; + // Ref + print "".''; + print ''; + + // Date print ""; - + $nbrows=12; if ($conf->projet->enabled) $nbrows++; print ''; + // Project if ($conf->projet->enabled) { print "".''; diff --git a/htdocs/don.class.php b/htdocs/don.class.php index 4a0ffdf0c9e..5d17a237dbb 100644 --- a/htdocs/don.class.php +++ b/htdocs/don.class.php @@ -24,12 +24,14 @@ * \version $Id$ */ +require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php"); + /** * \class Don * \brief Classe permettant la gestion des dons */ -class Don +class Don extends CommonObject { var $db; var $error; @@ -358,18 +360,18 @@ class Don if ( $this->db->query( $sql) ) { if ( $this->db->affected_rows() ) - { - return 1; - } - else - { - return -1; - } + { + return 1; + } + else + { + return -1; + } } else { dolibarr_print_error($this->db); - return -1; + return -1; } } @@ -539,5 +541,29 @@ class Don return $result; } + + /** + * \brief Return clicable name (with picto eventually) + * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0) + { + global $langs; + + $result=''; + + $lien = ''; + $lienfin=''; + + $picto='generic'; + + $label=$langs->trans("ShowDonation").': '.$this->ref; + + if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; + return $result; + } } ?>
'.$langs->trans("Ref").''; + print $don->getNomUrl(); + print '
".$langs->trans("Date").""; print dolibarr_print_date($don->date,"day"); print "'.$langs->trans("Comments").' :
'; print nl2br($don->note).'
'.$langs->trans("Project").''.$don->projet.'