Fix: Error management
This commit is contained in:
parent
aba2a51fa2
commit
7df981b7e6
@ -952,8 +952,8 @@ class Adherent extends CommonObject
|
|||||||
if ($ref) $sql.= " AND d.rowid='".$ref."'";
|
if ($ref) $sql.= " AND d.rowid='".$ref."'";
|
||||||
elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'";
|
elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'";
|
||||||
else $sql.= " AND d.rowid=".$rowid;
|
else $sql.= " AND d.rowid=".$rowid;
|
||||||
dol_syslog("Adherent::fetch sql=".$sql);
|
|
||||||
|
|
||||||
|
dol_syslog("Adherent::fetch sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -1016,7 +1016,8 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Adherent::fetch ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -200,7 +200,8 @@ class AdherentType extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Adherent_type::fetch ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -992,11 +992,14 @@ if ($rowid && $action != 'edit')
|
|||||||
|
|
||||||
$adh = new Adherent($db);
|
$adh = new Adherent($db);
|
||||||
$adh->id = $rowid;
|
$adh->id = $rowid;
|
||||||
$adh->fetch($rowid);
|
$res=$adh->fetch($rowid);
|
||||||
$adh->fetch_optionals($rowid);
|
if ($res < 0) dol_print_error($db);
|
||||||
|
$res=$adh->fetch_optionals($rowid);
|
||||||
|
if ($res < 0) dol_print_error($db);
|
||||||
|
|
||||||
$adht = new AdherentType($db);
|
$adht = new AdherentType($db);
|
||||||
$adht->fetch($adh->typeid);
|
$res=$adht->fetch($adh->typeid);
|
||||||
|
if ($res < 0) dol_print_error($db);
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -128,11 +128,8 @@ llxHeader('',$langs->trans("MembersTypeSetup"),'EN:Module_Foundations|FR:Module_
|
|||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
/* ************************************************************************** */
|
|
||||||
/* */
|
// Liste of members type
|
||||||
/* Liste des types d'adh<64>rents */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
if (! $rowid && $_GET["action"] != 'create' && $_GET["action"] != 'edit')
|
if (! $rowid && $_GET["action"] != 'create' && $_GET["action"] != 'edit')
|
||||||
{
|
{
|
||||||
@ -217,7 +214,7 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||||
print $htmls->selectyesno("cotisation",1,1);
|
print $htmls->selectyesno("cotisation",1,1);
|
||||||
@ -245,11 +242,13 @@ if ($_GET["action"] == 'create')
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="2" align="center"><input type="submit" name="button" class="button" value="'.$langs->trans("Add").'"> ';
|
print "</table>\n";
|
||||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></td></tr>';
|
|
||||||
|
print '<br>';
|
||||||
|
print '<center><input type="submit" name="button" class="button" value="'.$langs->trans("Add").'"> ';
|
||||||
|
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
print "</table>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user