Look: Ajout du picto de status sur les dons.
This commit is contained in:
parent
b9cdbb9d23
commit
80e1eba1d8
@ -226,7 +226,7 @@ if ($_GET["action"] == 'create')
|
||||
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print "<tr>".'<td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
print "<tr>".'<td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,12 +29,19 @@
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/don.class.php");
|
||||
|
||||
$langs->load("donations");
|
||||
|
||||
|
||||
/*
|
||||
* Affichage
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$donstatic=new Don($db);
|
||||
|
||||
$sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql.= " GROUP BY d.fk_statut";
|
||||
@ -81,7 +88,7 @@ for ($i = 0 ; $i < 3 ; $i++)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="liste.php?statut='.$i.'">'.$libelle[$i].'</a></td>';
|
||||
print '<td><a href="liste.php?statut='.$i.'">'.$donstatic->LibStatut($i,4).'</a></td>';
|
||||
print '<td align="right">'.$nb[$i].'</td>';
|
||||
print '<td align="right">'.($nb[$i]?price($somme[$i]):' ').'</td>';
|
||||
print '<td align="right">'.($nb[$i]?(price($somme[$i])/$nb[$i]):' ').'</td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,29 +29,38 @@
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/don.class.php");
|
||||
|
||||
$langs->load("donations");
|
||||
|
||||
llxHeader();
|
||||
|
||||
$sortorder=$_GET["sortorder"];
|
||||
$sortfield=$_GET["sortfield"];
|
||||
$statut=isset($_GET["statut"])?$_GET["statut"]:"-1";
|
||||
$page=$_GET["page"];
|
||||
|
||||
if ($sortorder == "") { $sortorder="DESC"; }
|
||||
if ($sortfield == "") { $sortfield="d.datedon"; }
|
||||
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="d.datedon"; }
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
|
||||
/*
|
||||
* Affichage
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$donstatic=new Don($db);
|
||||
|
||||
// Genere requete de liste des dons
|
||||
$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."don as d left join ".MAIN_DB_PREFIX."don_projet as p";
|
||||
$sql .= " ON p.rowid = d.fk_don_projet WHERE 1 = 1";
|
||||
$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe,";
|
||||
$sql.= " d.amount, d.fk_statut as statut, ";
|
||||
$sql.= " p.libelle as projet";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."don_projet AS p";
|
||||
$sql.= " ON p.rowid = d.fk_don_projet WHERE 1 = 1";
|
||||
if ($statut >= 0)
|
||||
{
|
||||
$sql .= " AND d.fk_statut = ".$statut;
|
||||
@ -79,13 +88,13 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("Firstname"),"liste.php","d.prenom","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Name"),"liste.php","d.nom","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Company"),"liste.php","d.societe","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Date"),"liste.php","d.datedon","&page=$page&statut=$statut","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Date"),"liste.php","d.datedon","&page=$page&statut=$statut","",'align="center"',$sortfield);
|
||||
if ($conf->projet->enabled) {
|
||||
$langs->load("projects");
|
||||
print_liste_field_titre($langs->trans("Project"),"liste.php","projet","&page=$page&statut=$statut","","",$sortfield);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Amount"),"liste.php","d.amount","&page=$page&statut=$statut","",'align="right"',$sortfield);
|
||||
print '<td> </td>';
|
||||
print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut","&page=$page&statut=$statut","",'align="right"',$sortfield);
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
@ -98,11 +107,12 @@ if ($result)
|
||||
print "<td>".stripslashes($objp->prenom)."</td>\n";
|
||||
print "<td>".stripslashes($objp->nom)."</td>\n";
|
||||
print "<td>".stripslashes($objp->societe)."</td>\n";
|
||||
print "<td>".dolibarr_print_date($objp->datedon).'</td>';
|
||||
print '<td align="center">'.dolibarr_print_date($objp->datedon).'</td>';
|
||||
if ($conf->projet->enabled) {
|
||||
print "<td>$objp->projet</td>\n";
|
||||
}
|
||||
print '<td align="right">'.price($objp->amount).'</td><td> </td>';
|
||||
print '<td align="right">'.price($objp->amount).'</td>';
|
||||
print '<td align="right">'.$donstatic->LibStatut($objp->statut,5).'</td>';
|
||||
|
||||
print "</tr>";
|
||||
$i++;
|
||||
|
||||
@ -1975,7 +1975,7 @@ else
|
||||
$var=true;
|
||||
|
||||
print '<br>';
|
||||
$html->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$conf->global->FACTURE_ADDON_PDF);
|
||||
$somethingshown=$html->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$conf->global->FACTURE_ADDON_PDF);
|
||||
|
||||
/*
|
||||
* Propales rattachées
|
||||
@ -1990,7 +1990,8 @@ else
|
||||
if ($num)
|
||||
{
|
||||
$i = 0; $total = 0;
|
||||
print '<br>';
|
||||
if ($somethingshown) print '<br>';
|
||||
$somethingshown=1;
|
||||
print_titre($langs->trans('RelatedCommercialProposals'));
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -2035,7 +2036,8 @@ else
|
||||
if ($num)
|
||||
{
|
||||
$i = 0; $total = 0;
|
||||
print '<br>';
|
||||
if ($somethingshown) print '<br>';
|
||||
$somethingshown=1;
|
||||
print_titre($langs->trans('RelatedOrders'));
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -75,16 +75,68 @@ class Don
|
||||
$this->labelstatut[2]=$langs->trans("DonationStatusPayed");
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourne le libellé du statut d'une propale (brouillon, validée, ...)
|
||||
* \return string Libellé
|
||||
*/
|
||||
function getLibStatut()
|
||||
{
|
||||
return $this->labelstatut[$this->statut];
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Retourne le libellé du statut d'un don (brouillon, validée, abandonnée, payée)
|
||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
|
||||
* \return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libellé d'un statut donné
|
||||
* \param statut Id statut
|
||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
|
||||
* \return string Libellé du statut
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
$prefix='';
|
||||
return $this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
$prefix='Short';
|
||||
return $this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatut[$statut];
|
||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0');
|
||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1');
|
||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatut[$statut];
|
||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($statut == 0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut0');
|
||||
if ($statut == 1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
||||
if ($statut == 2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
function print_error_list()
|
||||
|
||||
@ -2219,6 +2219,7 @@ class Form
|
||||
* \param forcenomultilang N'affiche pas option langue meme si MAIN_MULTILANGS défini
|
||||
* \remarks Le fichier de facture détaillée est de la forme
|
||||
* REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse
|
||||
* \return int <0 si ko, nbre de fichiers affichés si ok
|
||||
*/
|
||||
function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0)
|
||||
{
|
||||
@ -2229,6 +2230,7 @@ class Form
|
||||
|
||||
$filename = sanitize_string($filename);
|
||||
$headershown=0;
|
||||
$i=0;
|
||||
|
||||
// Affiche en-tete tableau
|
||||
if ($genallowed)
|
||||
@ -2342,8 +2344,6 @@ class Form
|
||||
// Affiche lignes
|
||||
if (is_dir($filedir))
|
||||
{
|
||||
$i=0;
|
||||
|
||||
$handle=opendir($filedir);
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
@ -2408,6 +2408,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
return $i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ PublicDonation=Public donation
|
||||
DonationsNumber=Donation number
|
||||
DonationsArea=Donations area
|
||||
DonationStatusPromessNotValidated=Draft promess
|
||||
DonationStatusPromessNotValidated=Validated promess
|
||||
DonationStatusPromessValidated=Validated promess
|
||||
DonationStatusPayed=Donation received
|
||||
ValidPromess=Validate promess
|
||||
BuildDonationReceipt=Build receipt
|
||||
|
||||
@ -14,7 +14,7 @@ PublicDonation=Don public
|
||||
DonationsNumber=Nombre de dons
|
||||
DonationsArea=Espace Dons
|
||||
DonationStatusPromessNotValidated=Promesse non validée
|
||||
DonationStatusPromessNotValidated=Promesse validée
|
||||
DonationStatusPromessValidated=Promesse validée
|
||||
DonationStatusPayed=Don payé
|
||||
ValidPromess=Valider promesse
|
||||
BuildDonationReceipt=Créer reçu
|
||||
Loading…
Reference in New Issue
Block a user