Qual: Remove deprecated files and code

This commit is contained in:
Laurent Destailleur
2009-09-29 17:39:50 +00:00
parent 7cd5e0b021
commit 76721ad2a1
10 changed files with 1 additions and 624 deletions

View File

@@ -1,176 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
require("./reduc.class.php");
llxHeader();
if ($action == 'add') {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) ";
$sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reduc);";
$result = $db->query($sql);
if ($result) {
$rowid = $db->last_insert_id(MAIN_DB_PREFIX."voyage");
} else {
print $db->error();
print "<p>$sql";
}
}
if ($action == 'del') {
/* $sql = "DELETE FROM ".MAIN_DB_PREFIX."voyage WHERE rowid = $rowid";
*$result = $db->query($sql);
*/
}
if ($vline) {
$viewline = $vline;
} else {
$viewline = 20;
}
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."voyage_reduc;";
$result = $db->query($sql);
if ($result) {
$var=True;
$num = $db->num_rows();
$i = 0;
$options = "<option value=\"0\" selected=\"true\"></option>";
while ($i < $num) {
$obj = $db->fetch_object($result);
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
}
$db->free();
}
print_titre("Bilan des reductions");
/*
* Cartes
*
*/
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."voyage_reduc";
$result = $db->query($sql);
if ($result) {
$cartes= array();
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($result);
$cartes[$i] = $obj->rowid;
$i++;
}
$db->free;
}
/*
*
*/
for ($j = 0 ; $j < sizeof($cartes) ; $j++) {
$reduc = new Reduc($db);
$reduc->fetch($cartes[$j]);
print "<table class=\border\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
print "<tr>";
print '<td colspan="2">'.$langs->trans("Description").'</td>';
print '<td align="right">Montant</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
print '<tr><td colspan="2">'.$reduc->label.'</td><td align="right">'.$reduc->price.'</td>';
print '<td>&nbsp;</TD></tr>';
/*
*
*/
$sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.depart, b.arrivee , b.reduction";
$sql .= " FROM ".MAIN_DB_PREFIX."voyage as b WHERE fk_reduc=".$reduc->id." ORDER BY b.date_depart ASC";
$result = $db->query($sql);
if ($result) {
print "<tr class=\"liste_titre\">";
print '<td>Date</td><td>'.$langs->trans("Description").'</td>';
print "<td align=\"right\">Montant</td>";
print "<td align=\"right\">R<>duction</td>";
print "</tr>\n";
$var=True;
$num = $db->num_rows();
$i = 0;
$total = 0;
$total_reduc = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$total = $total + $objp->amount;
$total_reduc = $total_reduc + $objp->reduction;
$time = time();
$var=!$var;
print "<tr $bc[$var]>";
print "<td>".strftime("%d&nbsp;%b&nbsp;%y&nbsp;%H:%M",$objp->date_depart)."<br>\n";
print "".strftime("%d %b %y %H:%M",$objp->date_arrivee)."</TD>\n";
print "<td>$objp->depart<br>$objp->arrivee</td>";
print "<td align=\"right\">".price($objp->amount)."</TD>\n";
print "<td align=\"right\">".price($objp->reduction)."</TD>\n";
print "</tr>";
$i++;
}
$db->free();
print "<tr><td align=\"right\" colspan=\"2\">Total :</td>";
print "<td align=\"right\"><b>".price($total)."</b></td><td align=\"right\">".price($total_reduc)."</td></tr>\n";
print "<tr><td align=\"right\" colspan=\"3\">Carte :</td>";
print "<td align=\"right\">".price($reduc->price)."</td></tr>\n";
print "<tr><td align=\"right\" colspan=\"3\">Gain :</td>";
print "<td align=\"right\">".price($total_reduc - $reduc->price)."</td></tr>\n";
print "</table>";
} else {
print "<p>".$db->error();
}
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@@ -1,147 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
llxHeader();
if ($action == 'add') {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc, reduction) ";
$sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reducid, $reduc);";
$result = $db->query($sql);
if ($result) {
$rowid = $db->last_insert_id(MAIN_DB_PREFIX."voyage");
} else {
print $db->error();
print "<p>$sql";
}
}
if ($action == 'del') {
/* $sql = "DELETE FROM ".MAIN_DB_PREFIX."voyage WHERE rowid = $rowid";
*$result = $db->query($sql);
*/
}
if ($vline) {
$viewline = $vline;
} else {
$viewline = 20;
}
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."voyage_reduc;";
$result = $db->query($sql);
if ($result) {
$var=True;
$num = $db->num_rows();
$i = 0;
$options = "<option value=\"0\" selected=\"true\"></option>";
while ($i < $num) {
$obj = $db->fetch_object($result);
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n"; $i++;
}
$db->free();
}
print_titre("Voyages");
$sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.reduction,b.depart, b.arrivee ";
$sql .= " FROM ".MAIN_DB_PREFIX."voyage as b ORDER BY b.date_depart ASC";
$result = $db->query($sql);
if ($result) {
print "<form method=\"post\" action=\"index.php?viewall=$viewall&vline=$vline&account=$account\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
print "<table class=\"border\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
print "<tr class=\"liste_titre\">";
print '<td>Date</td><td>'.$langs->trans("Description").'</td>';
print "<td align=\"right\">Montant</td>";
print "<td align=\"right\">R<>duction</td>";
print "</tr>\n";
$var=True;
$num = $db->num_rows();
$i = 0; $total = 0;
$sep = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$total = $total + $objp->amount;
$time = time();
$var=!$var;
print "<tr $bc[$var]>";
print "<td>".strftime("%d&nbsp;%b&nbsp;%y&nbsp;%H:%M",$objp->date_depart)."<br>\n";
print "".strftime("%d %b %y %H:%M",$objp->date_arrivee)."</TD>\n";
print "<td>$objp->depart - $objp->arrivee</td>";
print "<td align=\"right\">".price($objp->amount)."</TD>\n";
print "<td align=\"right\">".price($objp->reduction)."</TD>\n";
print "<td align=\"center\"><a href=\"index.php?action=del&rowid=$objp->rowid\">[Del]</a></td>";
print "</tr>";
$i++;
}
$db->free();
print "<tr>";
print "<td><input name=\"date_depart\" type=\"text\" size=16 maxlength=16><br>";
print "<input name=\"date_arrivee\" type=\"text\" size=16 maxlength=16></td>";
print "<td><input name=\"depart\" type=\"text\" size=40><br>";
print "<input name=\"arrivee\" type=\"text\" size=40></td>";
print "<td><input name=\"amount\" type=\"text\" size=8></td>";
print "<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"".$langs->trans("Add")."\"</td>";
print "</tr><tr><td colspan=\"1\">R<>duction</td>";
print "<td><select name=\"reducid\">$options";
print "</select></td>";
print '<td><input name="reduc" type="text" size="6" value="0.00">'.$langs->trans("Currency".$conf->monnaie).'</td><td>&nbsp;</td>';
print '</tr>';
print "</table></form>";
} else {
print "<p>".$db->error();
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@@ -1,52 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* $Id$
* $Source$
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require("../../main.inc.php");
function llxHeader($head = "") {
global $user, $conf, $langs;
/*
*
*
*/
top_menu($head);
$menu = new Menu();
$menu->add("index.php",$langs->trans("Trips"));
$menu->add_submenu("index.php",$langs->trans("Trips"));
$menu->add_submenu("bilan.php","Bilan");
$menu->add_submenu("reduc.php","Reduc");
$menu->add_submenu("voyage.php",$langs->trans("Trip"));
$menu->add("/compta/facture.php",$langs->trans("Bills"));
$menu->add("/compta/bank/index.php",$langs->trans("Bank"));
left_menu($menu->liste);
}
?>

View File

@@ -1,58 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
class Reduc {
var $id;
var $price;
var $label;
function Reduc($DB, $rowid=0) {
global $config;
$this->db = $DB;
$this->rowid = $rowid;
return 1;
}
function fetch($id) {
$sql = "SELECT b.rowid,".$this->db->pdate("b.date_debut")." as debut,".$this->db->pdate("b.date_fin")." as fin, b.amount, b.label ";
$sql .= " FROM ".MAIN_DB_PREFIX."voyage_reduc as b WHERE rowid = $id";
$result = $this->db->query($sql);
if ($result) {
if ($this->db->num_rows()) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->price = $obj->amount;
$this->label = $obj->label;
}
$this->db->free();
}
}
}
?>

View File

@@ -1,76 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
llxHeader();
print_titre ("Abonnement de r<>duction");
print "<table class=\"border\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";
print "<tr class=\"liste_titre\">";
print '<td>Date</td><td>'.$langs->trans("Description").'</td>';
print "<td align=\"right\"><a href=\"reduc.php?vue=credit\">Montant</a></td>";
print "</tr>\n";
$sql = "SELECT b.rowid,".$db->pdate("b.date_debut")." as debut,".$db->pdate("b.date_fin")." as fin, b.amount, b.label ";
$sql .= " FROM ".MAIN_DB_PREFIX."voyage_reduc as b ";
$result = $db->query($sql);
if ($result) {
$var=True;
$num = $db->num_rows();
$i = 0; $total = 0;
$sep = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$total = $total + $objp->amount;
$time = time();
$var=!$var;
print "<tr $bc[$var]>";
print "<td>".strftime("%d %b %y",$objp->debut)." au ".strftime("%d %b %y",$objp->fin)."</TD>\n";
print "<td>$objp->label</td>";
print "<td align=\"right\">".price($objp->amount)."</TD>\n";
print "</tr>";
$i++;
}
$db->free();
}
print "<tr><td align=\"right\" colspan=\"2\">".$langs->trans("TotalHT").":</td>";
print "<td align=\"right\"><b>".price($total)."</b></td></tr>\n";
print "</table>";
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@@ -1,28 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
llxHeader();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@@ -260,14 +260,12 @@ class Conf
$this->mantis->db->name=defined('PHPMANTIS_DBNAME')?PHPMANTIS_DBNAME:''; $this->mantis->db->name=defined('PHPMANTIS_DBNAME')?PHPMANTIS_DBNAME:'';
// Module propal // Module propal
if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4); if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
// Module voyage
$this->voyage->enabled=0;
// Module oscommerce 1 // Module oscommerce 1
$this->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0; $this->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0;
$this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0; $this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
/* /*
* Modification de quelques variable de conf en fonction des Constantes * Set some default values
*/ */
// System tools // System tools

View File

@@ -111,13 +111,6 @@ function llxHeader($head = '', $title='', $help_url='')
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
} }
if (! empty($conf->voyage->enabled) && $user->societe_id == 0)
{
$menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages");
$menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages",1);
$menu->add(DOL_URL_ROOT."/compta/voyage/reduc.php","Reduc",1);
}
if (! empty($conf->domaine->enabled)) if (! empty($conf->domaine->enabled))
{ {
$menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines"); $menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines");

View File

@@ -1,44 +0,0 @@
-- ===================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc)
-- values ('2002-04-21 12:05','2002-04-21 15:25',26.8,'Paris','Auray',1)
-- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc)
-- values ('2002-04-23 15:42','2002-04-23 19:10',26.8,'Auray','Paris',1)
--
-- $Id$
-- ===================================================================
create table llx_voyage
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
dateo date, -- date operation
date_depart datetime, -- date du voyage
date_arrivee datetime, -- date du voyage
amount real NOT NULL DEFAULT 0, -- prix du billet
reduction real NOT NULL DEFAULT 0, -- montant de la reduction obtenue
depart varchar(255),
arrivee varchar(255),
fk_type smallint, -- Train, Avion, Bateaux
fk_reduc integer,
distance integer, -- distance en kilometre
dossier varchar(50), -- numero de dossier
note text
)type=innodb;

View File

@@ -1,33 +0,0 @@
-- ===================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- ===================================================================
create table llx_voyage_reduc
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
datev date, -- date de valeur
date_debut date, -- date operation
date_fin date,
amount real NOT NULL DEFAULT 0,
label varchar(255),
numero varchar(255),
fk_type smallint, -- Train, Avion, Bateaux
note text
)type=innodb;