Fix: Removed deprecated function pdate()

This commit is contained in:
Laurent Destailleur 2010-04-20 19:00:17 +00:00
parent 3f4590e5b6
commit 93076fa3f1
8 changed files with 36 additions and 72 deletions

View File

@ -280,8 +280,8 @@ class Cotisation extends CommonObject
*/ */
function info($id) function info($id)
{ {
$sql = 'SELECT c.rowid, '.$this->db->pdate('c.datec').' as datec,'; $sql = 'SELECT c.rowid, c.datec,';
$sql.= ' '.$this->db->pdate('c.tms').' as datem'; $sql.= ' c.tms as datem';
$sql.= ' FROM '.MAIN_DB_PREFIX.'cotisation as c'; $sql.= ' FROM '.MAIN_DB_PREFIX.'cotisation as c';
$sql.= ' WHERE c.rowid = '.$id; $sql.= ' WHERE c.rowid = '.$id;
@ -293,8 +293,8 @@ class Cotisation extends CommonObject
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->date_creation = $obj->datec; $this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $obj->datem; $this->date_modification = $this->db->jdate($obj->datem);
} }
$this->db->free($result); $this->db->free($result);

View File

@ -146,8 +146,8 @@ if ($msg) print $msg.'<br>';
// Liste des cotisations // Liste des cotisations
$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe,"; $sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe,";
$sql.= " c.rowid as crowid, c.cotisation,"; $sql.= " c.rowid as crowid, c.cotisation,";
$sql.= " ".$db->pdate("c.dateadh")." as dateadh,"; $sql.= " c.dateadh,";
$sql.= " ".$db->pdate("c.datef")." as datef,"; $sql.= " c.datef,";
$sql.= " c.fk_bank as bank, c.note,"; $sql.= " c.fk_bank as bank, c.note,";
$sql.= " b.fk_account"; $sql.= " b.fk_account";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
@ -157,7 +157,7 @@ if (isset($date_select) && $date_select != '')
{ {
$sql.= " AND dateadh LIKE '$date_select%'"; $sql.= " AND dateadh LIKE '$date_select%'";
} }
$sql.= " ORDER BY $sortfield $sortorder"; $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset); $sql.= $db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql); $result = $db->query($sql);
@ -229,7 +229,7 @@ if ($result)
print '<td>'; print '<td>';
if ($allowinsertbankafter && $user->rights->banque->modifier && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation) if ($allowinsertbankafter && $user->rights->banque->modifier && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation)
{ {
print "<input name=\"label\" type=\"text\" class=\"flat\" size=\"30\" value=\"".$langs->trans("Subscriptions").' '.dol_print_date($objp->dateadh,"%Y")."\" >\n"; print "<input name=\"label\" type=\"text\" class=\"flat\" size=\"30\" value=\"".$langs->trans("Subscriptions").' '.dol_print_date($db->jdate($objp->dateadh),"%Y")."\" >\n";
// print "<td><input name=\"debit\" type=\"text\" size=8></td>"; // print "<td><input name=\"debit\" type=\"text\" size=8></td>";
// print "<td><input name=\"credit\" type=\"text\" size=8></td>"; // print "<td><input name=\"credit\" type=\"text\" size=8></td>";
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
@ -272,10 +272,10 @@ if ($result)
} }
// Date start // Date start
print '<td align="center">'.dol_print_date($objp->dateadh,'day')."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($objp->dateadh),'day')."</td>\n";
// Date end // Date end
print '<td align="center">'.dol_print_date($objp->datef,'day')."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
// Price // Price
print '<td align="right">'.price($objp->cotisation).'</td>'; print '<td align="right">'.price($objp->cotisation).'</td>';

View File

@ -46,14 +46,14 @@ if (! isset($cotis))
$sql = "SELECT d.login, d.pass, ".$db->pdate("d.datefin")." as datefin"; $sql = "SELECT d.login, d.pass, d.datefin";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d "; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
$sql .= " WHERE d.statut = $statut "; $sql .= " WHERE d.statut = $statut ";
if ($cotis==1) if ($cotis==1)
{ {
$sql .= " AND datefin > ".$db->idate(mktime()); $sql .= " AND datefin > ".$db->idate(mktime());
} }
$sql.= " ORDER BY $sortfield $sortorder"; $sql.= $db->order($sortfield,$sortorder);
//$sql.=$db->plimit($conf->liste_limit, $offset); //$sql.=$db->plimit($conf->liste_limit, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -189,11 +189,11 @@ print "<br>\n";
$max=5; $max=5;
$sql = "SELECT a.rowid, a.statut, a.nom, a.prenom,"; $sql = "SELECT a.rowid, a.statut, a.nom, a.prenom,";
$sql.= " ".$db->pdate("a.tms")." as datem, ".$db->pdate("datefin")." as date_end_subscription,"; $sql.= " a.tms as datem, datefin as date_end_subscription,";
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation"; $sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
$sql.= " WHERE a.fk_adherent_type = ta.rowid"; $sql.= " WHERE a.fk_adherent_type = ta.rowid";
$sql.= " ORDER BY a.tms DESC"; $sql.= $db->order("a.tms","DESC");
$sql.= $db->plimit($max, 0); $sql.= $db->plimit($max, 0);
$resql=$db->query($sql); $resql=$db->query($sql);
@ -219,8 +219,8 @@ if ($resql)
$statictype->libelle=$obj->libelle; $statictype->libelle=$obj->libelle;
print '<td>'.$staticmember->getNomUrl(1,24).'</td>'; print '<td>'.$staticmember->getNomUrl(1,24).'</td>';
print '<td>'.$statictype->getNomUrl(1,16).'</td>'; print '<td>'.$statictype->getNomUrl(1,16).'</td>';
print '<td>'.dol_print_date($obj->datem,'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->datem),'dayhour').'</td>';
print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$obj->date_end_subscription,5).'</td>'; print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }
@ -240,7 +240,7 @@ $Number=array();
$tot=0; $tot=0;
$numb=0; $numb=0;
$sql = "SELECT c.cotisation, ".$db->pdate("c.dateadh")." as dateadh"; $sql = "SELECT c.cotisation, c.dateadh";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
$sql.= " WHERE d.rowid = c.fk_adherent"; $sql.= " WHERE d.rowid = c.fk_adherent";
if(isset($date_select) && $date_select != '') if(isset($date_select) && $date_select != '')
@ -255,7 +255,7 @@ if ($result)
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$year=dol_print_date($objp->dateadh,"%Y"); $year=dol_print_date($db->jdate($objp->dateadh),"%Y");
$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->cotisation; $Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->cotisation;
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1; $Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
$tot+=$objp->cotisation; $tot+=$objp->cotisation;
@ -298,10 +298,6 @@ print '</td></tr>';
print '</table>'; print '</table>';
$db->close(); $db->close();
llxFooter('$Date$ - $Revision$'); llxFooter('$Date$ - $Revision$');

View File

@ -72,7 +72,7 @@ $form=new Form($db);
$membertypestatic=new AdherentType($db); $membertypestatic=new AdherentType($db);
$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, "; $sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, ";
$sql.= " ".$db->pdate("d.datefin")." as datefin,"; $sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation"; $sql.= " t.libelle as type, t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
@ -218,6 +218,8 @@ if ($resql)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$datefin=$db->jdate($objp->datefin);
$adh=new Adherent($db); $adh=new Adherent($db);
// Nom // Nom
@ -250,20 +252,20 @@ if ($resql)
// Statut // Statut
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
print $adh->LibStatut($objp->statut,$objp->cotisation,$objp->datefin,2); print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print "</td>"; print "</td>";
// Date fin cotisation // Date fin cotisation
if ($objp->datefin) if ($datefin)
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
if ($objp->datefin < time() && $objp->statut > 0) if ($datefin < time() && $objp->statut > 0)
{ {
print dol_print_date($objp->datefin,'day')." ".img_warning($langs->trans("SubscriptionLate")); print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
} }
else else
{ {
print dol_print_date($objp->datefin,'day'); print dol_print_date($datefin,'day');
} }
print '</td>'; print '</td>';
} }

View File

@ -333,7 +333,7 @@ if ($rowid > 0)
$membertypestatic=new AdherentType($db); $membertypestatic=new AdherentType($db);
$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, "; $sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, ";
$sql.= " ".$db->pdate("d.datefin")." as datefin,"; $sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation"; $sql.= " t.libelle as type, t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
@ -484,6 +484,8 @@ if ($rowid > 0)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$datefin=$db->jdate($objp->datefin);
$adh=new Adherent($db); $adh=new Adherent($db);
// Nom // Nom
@ -517,20 +519,20 @@ if ($rowid > 0)
// Statut // Statut
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
print $adh->LibStatut($objp->statut,$objp->cotisation,$objp->datefin,2); print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print "</td>"; print "</td>";
// Date fin cotisation // Date fin cotisation
if ($objp->datefin) if ($datefin)
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
if ($objp->datefin < time() && $objp->statut > 0) if ($datefin < time() && $objp->statut > 0)
{ {
print dol_print_date($objp->datefin,'day')." ".img_warning($langs->trans("SubscriptionLate")); print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
} }
else else
{ {
print dol_print_date($objp->datefin,'day'); print dol_print_date($datefin,'day');
} }
print '</td>'; print '</td>';
} }

View File

@ -243,7 +243,7 @@ class Menubase
$sql.= " t.perms,"; $sql.= " t.perms,";
$sql.= " t.enabled,"; $sql.= " t.enabled,";
$sql.= " t.usertype as user,"; $sql.= " t.usertype as user,";
$sql.= " ".$this->db->pdate('t.tms').""; $sql.= " t.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as t"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as t";
$sql.= " WHERE t.rowid = ".$id; $sql.= " WHERE t.rowid = ".$id;
@ -273,7 +273,7 @@ class Menubase
$this->perms = $obj->perms; $this->perms = $obj->perms;
$this->enabled = $obj->enabled; $this->enabled = $obj->enabled;
$this->user = $obj->user; $this->user = $obj->user;
$this->tms = $obj->tms; $this->tms = $this->db->jdate($obj->tms);
} }
$this->db->free($resql); $this->db->free($resql);

View File

@ -133,42 +133,6 @@ if (sizeof($import->array_import_code))
} }
print '</center>'; print '</center>';
/*
// Affiche les profils d'exports
$sql = "SELECT rowid, label, public, fk_user, ".$db->pdate("datec");
$sql .= " FROM ".MAIN_DB_PREFIX."export as e";
$result=$db->query($sql);
if ($result)
{
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ExportProfiles").'</td>';
print '<td align="right">'.$langs->trans("Public").'</td></tr>';
$num = $db->num_rows($result);
if ($num > 0)
{
$var = true;
$i = 0;
while ($i < $num )
{
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
print '<td>'.$obj->label.'</td>';
print '<td align="center">'.$yn($obj->public).'</td>';
print '</tr>';
$i++;
}
}
print "</table>";
}
*/
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';