Fix: Debug on donation module
This commit is contained in:
parent
df65583749
commit
7d7f7223b0
@ -225,7 +225,7 @@ if ($_GET["action"] == 'create')
|
||||
if ($conf->projet->enabled) $nbrows++;
|
||||
|
||||
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\"></textarea></td></tr>";
|
||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$_POST["comment"]."</textarea></td></tr>";
|
||||
|
||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
||||
$html->select_types_paiements('', 'modepaiement', 'CRDT', 0);
|
||||
@ -235,23 +235,23 @@ if ($_GET["action"] == 'create')
|
||||
{
|
||||
// Si module projet actif
|
||||
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
||||
select_projects('','','',"projetid");
|
||||
select_projects('',$_POST["projetid"],"projetid");
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
||||
print $html->selectyesno("public",1,1);
|
||||
print $html->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.$_POST["societe"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" value="'.$_POST["prenom"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" value="'.$_POST["nom"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="adresse" wrap="soft" cols="40" rows="3"></textarea></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" size="8"> <input type="text" name="ville" size="40"></td></tr>';
|
||||
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 '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$_POST["adresse"].'</textarea></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" value="'.$_POST["cp"].'" size="8"> <input type="text" name="ville" value="'.$_POST["ville"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="pays" value="'.$_POST["pays"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.$_POST["email"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.$_POST["amount"].'" size="10"> '.$langs->trans("Currency".$conf->monnaie).'</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";
|
||||
@ -357,11 +357,11 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
||||
|
||||
$h=0;
|
||||
$head[$h][0] = DOL_URL_ROOT."/compta/dons/fiche.php?rowid=".$_GET["rowid"];
|
||||
$head[$h][1] = $langs->trans("Donation");
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Ref").": ".$_GET["rowid"]);
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Donation"));
|
||||
|
||||
print "<form action=\"fiche.php\" method=\"post\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -391,7 +391,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
||||
}
|
||||
|
||||
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
||||
print $yn[$don->public];
|
||||
print yn($don->public);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>';
|
||||
@ -455,7 +455,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||
|
||||
/*
|
||||
* Documents g<EFBFBD>n<EFBFBD>r<EFBFBD>s
|
||||
* Documents generes
|
||||
*/
|
||||
$filename=dol_sanitizeFileName($don->id);
|
||||
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2);
|
||||
|
||||
@ -308,8 +308,8 @@ class Don extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Mise <EFBFBD> jour du don
|
||||
* \param user Objet utilisateur qui met <EFBFBD> jour le don
|
||||
* \brief Mise a jour du don
|
||||
* \param user Objet utilisateur qui met a jour le don
|
||||
* \return int >0 si ok, <0 si ko
|
||||
*/
|
||||
function update($user)
|
||||
@ -329,7 +329,7 @@ class Don extends CommonObject
|
||||
$sql .= ",pays='".$this->pays."'";
|
||||
$sql .= ",public=".$this->public;
|
||||
$sql .= ",fk_don_projet=".($this->projetid>0?$this->projetid:'null');
|
||||
$sql .= ",note='".$this->note."'";
|
||||
$sql .= ",note='".addslashes($this->note)."'";
|
||||
$sql .= ",datedon='".$this->date."'";
|
||||
$sql .= ",email='".$this->email."'";
|
||||
$sql .= ",fk_statut=".$this->statut;
|
||||
@ -386,40 +386,41 @@ class Don extends CommonObject
|
||||
$sql = "SELECT d.rowid, ".$this->db->pdate("d.datec")." as datec,";
|
||||
$sql.= " ".$this->db->pdate("d.datedon")." as datedon,";
|
||||
$sql.= " d.prenom, d.nom, d.societe, d.amount, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet,";
|
||||
$sql.= " p.title as projet";
|
||||
$sql.= " p.title as projet";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."don as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " ON p.rowid = d.fk_don_projet";
|
||||
$sql.= " WHERE cp.id = d.fk_paiement AND d.rowid = ".$rowid;
|
||||
|
||||
dol_syslog("Don::fetch sql=".$sql);
|
||||
if ( $this->db->query( $sql) )
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
|
||||
$obj = $this->db->fetch_object();
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->datec = $obj->datec;
|
||||
$this->date = $obj->datedon;
|
||||
$this->prenom = stripslashes($obj->prenom);
|
||||
$this->nom = stripslashes($obj->nom);
|
||||
$this->societe = stripslashes($obj->societe);
|
||||
$this->prenom = $obj->prenom;
|
||||
$this->nom = $obj->nom;
|
||||
$this->societe = $obj->societe;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->adresse = stripslashes($obj->adresse);
|
||||
$this->cp = stripslashes($obj->cp);
|
||||
$this->ville = stripslashes($obj->ville);
|
||||
$this->email = stripslashes($obj->email);
|
||||
$this->pays = stripslashes($obj->pays);
|
||||
$this->adresse = $obj->adresse;
|
||||
$this->cp = $obj->cp;
|
||||
$this->ville = $obj->ville;
|
||||
$this->email = $obj->email;
|
||||
$this->pays = $obj->pays;
|
||||
$this->projet = $obj->projet;
|
||||
$this->projetid = $obj->fk_don_projet;
|
||||
$this->public = $obj->public;
|
||||
$this->modepaiementid = $obj->fk_paiement;
|
||||
$this->modepaiement = $obj->libelle;
|
||||
$this->amount = $obj->amount;
|
||||
$this->commentaire = stripslashes($obj->note);
|
||||
$this->note = $obj->note;
|
||||
$this->commentaire = $obj->note; // deprecated
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -544,7 +545,7 @@ class Don extends CommonObject
|
||||
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
|
||||
@ -567,6 +568,6 @@ class Don extends CommonObject
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user