Removed TODO and deprecated files

This commit is contained in:
Laurent Destailleur 2009-03-09 21:59:29 +00:00
parent 92464b40e7
commit cdc6493ba5
20 changed files with 250 additions and 298 deletions

View File

@ -1,4 +1,4 @@
#Mon Mar 09 12:23:31 CET 2009
#Mon Mar 09 21:45:56 CET 2009
eclipse.preferences.version=1
encoding//dev/initdemo/initdemo.sql=UTF-8
encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1
@ -640,6 +640,7 @@ encoding//htdocs/theme/yellow/yellow.css.php=ISO-8859-1
encoding//htdocs/user.class.php=ISO-8859-1
encoding//htdocs/user/modules/login.anakin.class.php=ISO-8859-1
encoding//htdocs/user/param_ihm.php=ISO-8859-1
encoding//htdocs/webservices/server.wsdl=UTF-8
encoding//mysql/data/data.sql=UTF-8
encoding//scripts/banque/graph-solde.php=ISO-8859-1
encoding//scripts/mailing/mailing-send.php=ISO-8859-1

View File

@ -24,7 +24,8 @@
*/
require("./pre.inc.php");
include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php";
include_once(DOL_DOCUMENT_ROOT."/lib/databases/".$conf->db->type.".lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
$langs->load("admin");
$langs->load("user");
@ -47,20 +48,16 @@ print info_admin($langs->trans("SystemInfoDesc")).'<br>';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">Dolibarr</td></tr>\n";
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>" . DOL_VERSION . "</td></tr>\n";
$dolversion=version_dolibarr();
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".$dolversion."</td></tr>\n";
print '</table>';
print "<br>\n";
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("OS")."</td></tr>\n";
// Récupère la version de l'OS
ob_start();
phpinfo();
$chaine = ob_get_contents();
ob_end_clean();
eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg);
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".$reg[1]."</td></tr>\n";
$phpversion=version_os();
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";
print '</table>';
print "<br>\n";
@ -68,7 +65,8 @@ print "<br>\n";
// Serveur web
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("WebServer")."</td></tr>\n";
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
$apacheversion=version_webserver();
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".$apacheversion."</td></tr>\n";
print '</table>';
print "<br>\n";
@ -76,7 +74,7 @@ print "<br>\n";
// Php
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Php")."</td></tr>\n";
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".phpversion()."</td></tr>\n";
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".version_php()."</td></tr>\n";
print "<tr $bc[1]><td>".$langs->trans("PhpWebLink")."</td><td>".php_sapi_name()."</td></tr>\n";
print '</table>';

View File

@ -1,160 +0,0 @@
<?php
/* Copyright (C) 2004-2008 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.
*/
/**
\file htdocs/comm/action/indexactions.php
\ingroup agenda
\brief Actions area
\version $Id$
\TODO This file is deprecated. Not more reach.
*/
require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/client.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/agenda.lib.php");
$langs->load("companies");
$langs->load("commercial");
$langs->load("agenda");
$page = $_GET["page"];
$sortfield=$_GET["sortfield"];
$sortorder=$_GET["sortorder"];
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="a.datep";
// Sécurité accés client
if ($user->societe_id > 0)
{
$action = '';
$socid = $user->societe_id;
}
/*
* Actions
*/
if ($_GET["action"] == 'builddoc')
{
$cat = new CommActionRapport($db, $_GET["month"], $_GET["year"]);
$result=$cat->generate($_GET["id"]);
}
if ($action=='delete_action')
{
$actioncomm = new ActionComm($db);
$actioncomm->fetch($actionid);
$result=$actioncomm->delete();
}
/*
* Affichage liste
*/
llxHeader();
print_fiche_titre($langs->trans("ActionsArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
// Search actions
/*
$var=false;
print '<table class="noborder" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/action/listactions.php">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAnAction").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Keyword").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '</tr>';
print "</form></table><br>\n";
*/
$var=true;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/action/listactions.php">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("ViewWithPredefinedFilters").'</td></tr>';
// All actions of everybody
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("AllActions").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php">';
print img_picto($langs->trans("ViewList"),'object_list').'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/index.php">';
print img_picto($langs->trans("ViewCal"),'object_calendar').'</a></td>';
print '</tr>';
// All my actions
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("AllMyActions").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?filter=mine">';
print img_picto($langs->trans("ViewList"),'object_list').'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/index.php?filter=mine">';
print img_picto($langs->trans("ViewCal"),'object_calendar').'</a></td>';
print '</tr>';
// Actions i asked
$var=!$var;
print '<tr '.$bc[$var].'><td> &nbsp; &nbsp; &nbsp; ';
print $langs->trans("MyActionsAsked").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?filtera='.$user->id.'">';
print img_picto($langs->trans("ViewList"),'object_list').'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/index.php?filtera='.$user->id.'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').'</a></td>';
print '</tr>';
// Actions affected to me
$var=!$var;
print '<tr '.$bc[$var].'><td> &nbsp; &nbsp; &nbsp; ';
print $langs->trans("MyActionsToDo").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?filtert='.$user->id.'">';
print img_picto($langs->trans("ViewList"),'object_list').'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/index.php?filtert='.$user->id.'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').'</a></td>';
print '</tr>';
// Actions done by me
$var=!$var;
print '<tr '.$bc[$var].'><td> &nbsp; &nbsp; &nbsp; ';
print $langs->trans("MyActionsDone").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?filterd='.$user->id.'">';
print img_picto($langs->trans("ViewList"),'object_list').'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/index.php?filterd='.$user->id.'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').'</a></td>';
print '</tr>';
print "</table></form><br>\n";
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
if ($conf->agenda->enabled) show_array_actions_to_do(10);
if ($conf->agenda->enabled) show_array_last_actions_done(10);
print '</td></tr></table>';
$db->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@ -210,7 +210,7 @@ if ($_GET["action"] == 'create')
print_fiche_titre($langs->trans("AddDonation"));
if ($mesg) print '<div class="error">'.$mesg.'</div>';
print '<form name="add" action="fiche.php" method="post">';
print '<table class="border" width="100%">';
@ -410,7 +410,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
print "</div>";
// \TODO G<EFBFBD>rer action <20>mettre paiement
// \TODO Gerer action emettre paiement
$resteapayer = 0;
@ -426,7 +426,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
print '<a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a>';
}
// \TODO G<EFBFBD>rer action <20>mettre paiement
// \TODO Gerer action emettre paiement
if ($don->statut == 1 && $resteapayer > 0)
{
print "<a class=\"butAction\" href=\"paiement.php?facid=$facid&action=create\">".$langs->trans("DoPayment")."</a>";

View File

@ -2863,7 +2863,7 @@ else
else
{
// TODO Select type (service or product)
print $html->select_type_of_lines($objp->fk_product_type,'type',1);
}
// Description - Editor wysiwyg

View File

@ -283,13 +283,13 @@ class RemiseCheque extends CommonObject
function Validate($user)
{
global $langs;
$this->errno = 0;
$this->db->begin();
$num=$this->getNextNumber();
if ($this->errno == 0 && $num)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
@ -411,9 +411,9 @@ class RemiseCheque extends CommonObject
function GeneratePdf($model='blochet', $outputlangs)
{
global $langs;
if (empty($model)) $model='blochet';
dol_syslog("RemiseCheque::GeneratePdf model=".$model, LOG_DEBUG);
$dir=DOL_DOCUMENT_ROOT ."/includes/modules/cheque/pdf/";
@ -608,7 +608,7 @@ class RemiseCheque extends CommonObject
*/
function getNomUrl($withpicto=0,$option='')
{
global $langs; // TODO Renvoyer le libell<EFBFBD> anglais et faire traduction a affichage
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
$result='';
@ -634,14 +634,14 @@ class RemiseCheque extends CommonObject
}
/**
* \brief Renvoi le libell<EFBFBD> d'un statut donne
* \brief Renvoi le libelle d'un statut donne
* \param status Statut
* \param mode 0=libell<EFBFBD> long, 1=libell<EFBFBD> court, 2=Picto + Libell<EFBFBD> court, 3=Picto, 4=Picto + Libell<EFBFBD> long, 5=Libell<EFBFBD> court + Picto
* \return string Libell<EFBFBD> du statut
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* \return string Libelle du statut
*/
function LibStatut($status,$mode=0)
{
global $langs; // TODO Renvoyer le libell<EFBFBD> anglais et faire traduction a affichage
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
$langs->load('compta');
if ($mode == 0)
{

View File

@ -186,12 +186,11 @@ print '<br>';
if ($conf->global->MAIN_MODULE_NOTIFICATION)
{
print_titre($langs->trans("Notifications"));
if ($user->rights->prelevement->bons->configurer)
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="30%">Nom</td>';
@ -199,7 +198,7 @@ if ($conf->global->MAIN_MODULE_NOTIFICATION)
if ($user->rights->prelevement->bons->configurer)
print '<td width="30%">Action</td>';
print "</tr>\n";
if ($user->rights->prelevement->bons->configurer)
{
print '<tr class="impair"><td align="left">';
@ -208,7 +207,7 @@ if ($conf->global->MAIN_MODULE_NOTIFICATION)
$sql = "SELECT rowid, name, firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."user";
$sql .= " ORDER BY name ASC";
if ($db->query($sql))
{
$num = $db->num_rows();
@ -221,26 +220,26 @@ if ($conf->global->MAIN_MODULE_NOTIFICATION)
}
$db->free();
}
print '</select></td>';
print '<td align="left">';
print '<select name="action">';
print '<option value="tr">Transmission du bon</option>';
print '<option value="em">Emission du bon</option>';
print '<option value="cr">Credit du bon</option>';
print '</select></td>';
print '<td align="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
}
$sql = "SELECT u.name, u.firstname, pn.action, pn.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_notifications as pn";
$sql .= " WHERE u.rowid = pn.fk_user";
$resql = $db->query($sql);
if ($resql)
{
@ -250,13 +249,13 @@ if ($conf->global->MAIN_MODULE_NOTIFICATION)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]>";
print '<td>'.$obj->firstname." ".$obj->name.'</td>';
print '<td>'.$obj->action.'</td>';
if ($user->rights->prelevement->bons->configurer)
{
print '<td><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&amp;notif='.$obj->rowid.'">'.img_delete().'</a></td></tr>';
@ -270,7 +269,7 @@ if ($conf->global->MAIN_MODULE_NOTIFICATION)
$db->free($resql);
}
print '</table>';
if ($user->rights->prelevement->bons->configurer)
print '</form>';
}

View File

@ -70,7 +70,7 @@ class Conf
/*
* Definition de toutes les Constantes globales d'environnement
* - En constante php (\TODO a virer)
* - En constante php (TODO a virer)
* - En $this->global->key=value
*/
$sql = "SELECT name, value FROM ".MAIN_DB_PREFIX."const";

View File

@ -430,7 +430,7 @@ class FactureFournisseur extends Facture
{
$mouvP = new MouvementStock($this->db);
// We increase stock for product
$entrepot_id = "1"; // TODO ajouter possibilité de choisir l'entrepot
$entrepot_id = "1"; // TODO ajouter possibilite de choisir l'entrepot
// TODO Add price of product in method or '' to update PMP
$result=$mouvP->reception($user, $this->lignes[$i]->fk_product, $entrepot_id, $this->lignes[$i]->qty);
if ($result < 0) { $error++; }

View File

@ -363,6 +363,50 @@ class Form
}
}
/**
* \brief Return list of types of lines (product or service)
* \param selected Preselected type
* \param htmlname Name of field in form
* \param showempty Add an empty field
*/
function select_type_of_lines($selected='',$htmlname='type',$showempty=0)
{
global $db,$langs,$user,$conf;
$langs->load("trips");
if ($conf->produit->enabled && $conf->service->enabled)
{
print $langs->trans("Type").': ';
print '<select class="flat" name="'.$htmlname.'">';
if ($showempty)
{
print '<option value="-1"';
if ($selected == -1) print ' selected="true"';
print '>&nbsp;</option>';
}
print '<option value="0"';
if (0 == $selected) print ' selected="true"';
print '>'.$langs->trans("Product");
print '<option value="1"';
if (1 == $selected) print ' selected="true"';
print '>'.$langs->trans("Service");
print '</select>';
//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
if (empty($conf->produit->enabled) && $conf->service->enabled)
{
print '<input type="hidden" name="'.$htmlname.'" value="1">';
}
if ($conf->produit->enabled && empty($conf->service->enabled))
{
print '<input type="hidden" name="'.$htmlname.'" value="0">';
}
}
/**
* \brief Return list of types of notes
* \param selected Preselected type

View File

@ -77,7 +77,7 @@ class pdf_crabe extends ModelePDFFactures
$this->option_escompte = 1; // Affiche si il y a eu escompte
$this->option_credit_note = 1; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;

View File

@ -75,8 +75,9 @@ class pdf_oursin extends ModelePDFFactures
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_credit_note = 1; // Gere les avoirs
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
$this->option_credit_note = 1; // Support credit note
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;

View File

@ -320,8 +320,6 @@ if ($_POST["action"] == "set")
// If values differs, we save conf file again
//if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('etape1: Value for character_set is not the one asked for database creation', LOG_WARNING);
//if ($check2 != $dolibarr_main_db_collation) dolibarr_install_syslog('etape1: Value for collation is not the one asked for database creation', LOG_WARNING);
// TODO
}
else
{

View File

@ -965,7 +965,7 @@ FCKeditorForUsers=Création/édition WYSIWIG de la description et note des utili
FCKeditorForCompany=Création/édition WYSIWIG de la description et note des tiers
FCKeditorForProduct=Création/édition WYSIWIG de la description et note des produits/services
FCKeditorForMembers=Création/édition WYSIWIG de la description et note des adhérents
FCKeditorForProductDetails=Création/édition WYSIWIG des lignes details produits (sur commandes, propales, factures, etc...)<br>Attention: L'utilisation de cette option est fortement non recommandé car peut poser des problèmes dans la gestion de caractères et mises en page des fichiers PDF générés.
FCKeditorForProductDetails=Création/édition WYSIWIG des lignes details produits (sur commandes, propales, factures, etc...)<br>Attention: L'utilisation de cette option est fortement déconseillé car peut poser des problèmes dans la gestion de caractères et mises en page des fichiers PDF générés.
FCKeditorForProductDetailsPerso=Création/édition WYSIWIG des lignes details produits personnalisées (sur commandes, propales, factures, etc...)
FCKeditorForMailing=Création/édition WYSIWIG des mailings
##### OSCommerce 1 #####

View File

@ -521,12 +521,12 @@ class DoliDb
/**
* \brief Formatage (par la base de donn<EFBFBD>es) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
* afin de retourner une donn<EFBFBD>e toujours au format universel date TMS unix.
* Fonction <EFBFBD> utiliser pour g<EFBFBD>n<EFBFBD>rer les SELECT.
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
* \brief Formatage (par la base de donnees) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
* afin de retourner une donnee toujours au format universel date TMS unix.
* Fonction a utiliser pour generer les SELECT.
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
* \return date Date au format TMS.
* \TODO Remove unix_timestamp functions
* \deprecated Remove unix_timestamp functions so use jdate instead
*/
function pdate($param)
{

View File

@ -513,12 +513,12 @@ class DoliDb
/**
* \brief Formatage (par la base de donnees) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
* afin de retourner une donnee toujours au format universel date TMS unix.
* Fonction a utiliser pour generer les SELECT.
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
* \return date Date au format TMS.
* \TODO Remove unix_timestamp functions so use jdate instead
* \brief Formatage (par la base de donnees) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
* afin de retourner une donnee toujours au format universel date TMS unix.
* Fonction a utiliser pour generer les SELECT.
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
* \return date Date au format TMS.
* \deprecated Remove unix_timestamp functions so use jdate instead
*/
function pdate($param)
{

View File

@ -527,12 +527,12 @@ class DoliDb
/**
* \brief Formatage (par la base de donnees) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
* afin de retourner une donnee toujours au format universel date TMS unix.
* Fonction a utiliser pour generer les SELECT.
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
* \return date Date au format TMS.
* \TODO Remove unix_timestamp functions so use jdate instead
* \brief Formatage (par la base de donnees) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
* afin de retourner une donnee toujours au format universel date TMS unix.
* Fonction a utiliser pour generer les SELECT.
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
* \return date Date au format TMS.
* \deprecated Remove unix_timestamp functions so use jdate instead
*/
function pdate($param)
{

View File

@ -753,3 +753,47 @@ function dol_print_reduction($reduction=0,$langs)
return $string;
}
/**
* \brief Return OS version
* \return string OS version
*/
function version_os()
{
// Get version of OS
ob_start();
phpinfo();
$chaine = ob_get_contents();
ob_end_clean();
eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg);
$phpversion=$reg[1];
return $phpversion;
}
/**
* \brief Return PHP version
* \return string PHP version
*/
function version_php()
{
return phpversion();
}
/**
* \brief Return Dolibarr version
* \return string Dolibarr version
*/
function version_dolibarr()
{
return DOL_VERSION;
}
/**
* \brief Return web server version
* \return string Web server version
*/
function version_webserver()
{
return $_SERVER["SERVER_SOFTWARE"];
}

View File

@ -33,9 +33,10 @@ accessforbidden();
$staticproduct=new Product($db);
/*
* Affichage page accueil
*
* View
*/
$transAreaType = $langs->trans("ProductsAndServicesArea");
@ -53,15 +54,24 @@ print '<tr><td valign="top" width="30%" class="notopnoleft">';
/*
* Zone recherche produit/service
*/
$rowspan=2;
if ($conf->barcode->enabled) $rowspan++;
print '<form method="post" action="'.DOL_URL_ROOT.'/product/liste.php">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="3">'.$langs->trans("Search").'</td></tr>';
print "<tr $bc[0]><td>";
print $langs->trans("Ref").':</td><td><input class="flat" type="text" size="18" name="sref"></td>';
print '<td rowspan="2"><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
print $langs->trans("Ref").':</td><td><input class="flat" type="text" size="14" name="sref"></td>';
print '<td rowspan="'.$rowspan.'"><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
if ($conf->barcode->enabled)
{
print "<tr $bc[0]><td>";
print $langs->trans("BarCode").':</td><td><input class="flat" type="text" size="14" name="sbarcode"></td>';
//print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td>';
print '</tr>';
}
print "<tr $bc[0]><td>";
print $langs->trans("Other").':</td><td><input class="flat" type="text" size="18" name="sall"></td>';
print $langs->trans("Other").':</td><td><input class="flat" type="text" size="14" name="sall"></td>';
//print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td>';
print '</tr>';
print "</table></form><br>";

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -31,15 +31,18 @@ if ($conf->categorie->enabled) require_once(DOL_DOCUMENT_ROOT."/categories/categ
$langs->load("products");
// Security check
if (!$user->rights->produit->lire)
accessforbidden();
accessforbidden();
$sref=isset($_GET["sref"])?$_GET["sref"]:$_POST["sref"];
$sbarcode=isset($_GET["sbarcode"])?$_GET["sbarcode"]:$_POST["sbarcode"];
$snom=isset($_GET["snom"])?$_GET["snom"]:$_POST["snom"];
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
$type=isset($_GET["type"])?$_GET["type"]:$_POST["type"];
$sref=trim($sref);
$sbarcode=trim($sbarcode);
$snom=trim($snom);
$sall=trim($sall);
$type=trim($type);
@ -52,15 +55,20 @@ $page = $_GET["page"];
$limit = $conf->liste_limit;
$offset = $limit * $page ;
/*
* Actions
*/
if (isset($_POST["button_removefilter_x"]))
{
$sref="";
$snom="";
$sref="";
$sbarcode="";
$snom="";
}
if ($conf->categorie->enabled && isset($_REQUEST['catid']))
{
$catid = $_REQUEST['catid'];
$catid = $_REQUEST['catid'];
}
@ -71,81 +79,76 @@ if ($conf->categorie->enabled && isset($_REQUEST['catid']))
if ($_GET["canvas"] <> '' && file_exists('canvas/product.'.$_GET["canvas"].'.class.php') )
{
$class = 'Product'.ucfirst($_GET["canvas"]);
include_once('canvas/product.'.$_GET["canvas"].'.class.php');
$class = 'Product'.ucfirst($_GET["canvas"]);
include_once('canvas/product.'.$_GET["canvas"].'.class.php');
$object = new $class($db);
$object->LoadListDatas($limit, $offset, $sortfield, $sortorder);
$object = new $class($db);
$object->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
else
{
$title=$langs->trans("ProductsAndServices");
$title=$langs->trans("ProductsAndServices");
if (isset($_GET["type"]) || isset($_POST["type"]))
{
if ($type==1) { $texte = $langs->trans("Services"); }
if (isset($_GET["type"]) || isset($_POST["type"]))
{
if ($type==1) { $texte = $langs->trans("Services"); }
else { $texte = $langs->trans("Products"); }
} else {
$texte = $langs->trans("ProductsAndServices");
}
} else {
$texte = $langs->trans("ProductsAndServices");
}
}
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.price, p.price_ttc, p.price_base_type,';
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,';
$sql.= ' p.fk_product_type, '.$db->pdate('p.tms').' as datem,';
$sql.= ' p.duration, p.envente as statut, p.seuil_stock_alerte';
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
if ($conf->categorie->enabled && ($catid || !$user->rights->categorie->voir))
{
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
}
if ($_GET["fourn_id"] > 0)
{
$fourn_id = $_GET["fourn_id"];
$sql .= ", ".MAIN_DB_PREFIX."product_fournisseur as pf";
$fourn_id = $_GET["fourn_id"];
$sql .= ", ".MAIN_DB_PREFIX."product_fournisseur as pf";
}
$sql .= " WHERE 1=1";
if ($sall)
{
$sql .= " AND (p.ref like '%".addslashes($sall)."%' OR p.label like '%".addslashes($sall)."%' OR p.description like '%".addslashes($sall)."%' OR p.note like '%".addslashes($sall)."%')";
$sql .= " AND (p.ref like '%".addslashes($sall)."%' OR p.label like '%".addslashes($sall)."%' OR p.description like '%".addslashes($sall)."%' OR p.note like '%".addslashes($sall)."%')";
}
# if the type is not 1, we show all products (type = 0,2,3)
if (strlen($_GET["type"]) || strlen($_POST["type"]))
{
if ($type==1) {
$sql .= " AND p.fk_product_type = '1'";
} else {
$sql .= " AND p.fk_product_type <> '1'";
}
}
if ($sref)
{
$sql .= " AND p.ref like '%".$sref."%'";
}
if ($snom)
{
$sql .= " AND p.label like '%".addslashes($snom)."%'";
if ($type==1) {
$sql .= " AND p.fk_product_type = '1'";
} else {
$sql .= " AND p.fk_product_type <> '1'";
}
}
if ($sref) $sql .= " AND p.ref like '%".$sref."%'";
if ($sbarcode) $sql .= " AND p.barcode like '%".$sbarcode."%'";
if ($snom) $sql .= " AND p.label like '%".addslashes($snom)."%'";
if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0)
{
$sql .= " AND p.envente = ".$_GET["envente"];
$sql .= " AND p.envente = ".$_GET["envente"];
}
if (isset($_GET["canvas"]) && strlen($_GET["canvas"]) > 0)
{
$sql .= " AND p.canvas = '".mysql_escape_string($_GET["canvas"])."'";
$sql .= " AND p.canvas = '".mysql_escape_string($_GET["canvas"])."'";
}
if($catid)
{
$sql .= " AND cp.fk_categorie = ".$catid;
$sql .= " AND cp.fk_categorie = ".$catid;
}
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql.= ' AND IFNULL(c.visible,1)=1';
$sql.= ' AND IFNULL(c.visible,1)=1';
}
if ($fourn_id > 0)
{
$sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id;
$sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id;
}
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit($limit + 1 ,$offset);
@ -157,7 +160,7 @@ if ($resql)
$i = 0;
if ($num == 1 && ($sall or $snom or $sref))
if ($num == 1 && ($sall || $snom || $sref || $sbarcode) && $_POST["action"] != 'list')
{
$objp = $db->fetch_object($resql);
Header("Location: fiche.php?id=$objp->rowid");
@ -168,17 +171,17 @@ if ($resql)
{
$envente = (isset($_GET["envente"])?$_GET["envente"]:$_POST["envente"]);
}
llxHeader("","",$texte);
// Displays product removal confirmation
if (!empty($_GET['delprod']))
{
print '<div class="warning">'.$langs->trans("ProductDeleted",$_GET['delprod']).'</div><br />';
}
// Displays product removal confirmation
if (!empty($_GET['delprod']))
{
print '<div class="warning">'.$langs->trans("ProductDeleted",$_GET['delprod']).'</div><br />';
}
$param="&amp;sref=".$sref."&amp;snom=".$snom."&amp;sall=".$sall."&amp;envente=".$_POST["envente"];
$param.="&amp;fourn_id=".$fourn_id;
$param="&amp;sref=".$sref.($sbarcode?"&amp;sbarcode=".$sbarcode:"")."&amp;snom=".$snom."&amp;sall=".$sall."&amp;envente=".$_POST["envente"];
$param.=($fourn_id?"&amp;fourn_id=".$fourn_id:"");
$param.=isset($type)?"&amp;type=".$type:"";
print_barre_liste($texte, $page, "liste.php", $param, $sortfield, $sortorder,'',$num);
@ -204,31 +207,39 @@ if ($resql)
else
{
print '<form action="liste.php" method="post" name="formulaire">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<table class="liste" width="100%">';
// Lignes des titres
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"),"liste.php", "p.ref",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),"liste.php", "p.label",$param,"","",$sortfield,$sortorder);
if ($conf->barcode->enabled) print_liste_field_titre($langs->trans("BarCode"),"liste.php", "p.barcode",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateModification"),"liste.php", "p.tms",$param,"",'align="center"',$sortfield,$sortorder);
if ($conf->service->enabled && $type != 0) print_liste_field_titre($langs->trans("Duration"),"liste.php", "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("SellingPrice"),"liste.php", "p.price",$param,"",'align="right"',$sortfield,$sortorder);
if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("Stock").'</td>';
print_liste_field_titre($langs->trans("Status"),"liste.php", "p.envente",$param,"",'align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="sref" value="'.$sref.'">';
print '<input class="flat" type="text" name="sref" size="8" value="'.$sref.'">';
print '</td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
print '<input class="flat" type="text" name="snom" size="12" value="'.$snom.'">';
print '</td>';
if ($conf->barcode->enabled)
{
print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" name="sbarcode" size="6" value="'.$sbarcode.'">';
print '</td>';
}
print '<td class="liste_titre">';
print '&nbsp;';
print '</td>';
@ -252,15 +263,15 @@ if ($resql)
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" alt="'.$langs->trans("RemoveFilter").'">';
print '</td>';
print '</tr>';
$product_static=new Product($db);
$var=True;
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
// Multilangs
if ($conf->global->MAIN_MULTILANGS) // si l'option est active
{
@ -274,10 +285,10 @@ if ($resql)
if ($objtp->label != '') $objp->label = $objtp->label;
}
}
$var=!$var;
print '<tr '.$bc[$var].'>';
// Ref
print '<td nowrap="nowrap">';
$product_static->id = $objp->rowid;
@ -288,12 +299,18 @@ if ($resql)
// Label
print '<td>'.dol_trunc($objp->label,40).'</td>';
// Barcode
if ($conf->barcode->enabled)
{
print '<td align="right">'.$objp->barcode.'</td>';
}
// Date
print '<td align="center">'.dol_print_date($objp->datem,'day')."</td>\n";
// Duration
if ($conf->service->enabled && $type != 0)
if ($conf->service->enabled && $type != 0)
{
print '<td align="center">';
if (eregi('([0-9]+)y',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear");
@ -331,17 +348,17 @@ if ($resql)
print '<td>&nbsp;</td>';
}
}
// Statut
print '<td align="right" nowrap="nowrap">'.$product_static->LibStatut($objp->statut,5).'</td>';
print "</tr>\n";
$i++;
}
if ($num > $conf->liste_limit)
{
if ($sref || $snom || $sall || $_POST["search"])
if ($sref || $snom || $sall || $sbarcode || $_POST["search"])
{
print_barre_liste('', $page, "liste.php", "&amp;sref=".$sref."&amp;snom=".$snom."&amp;sall=".$sall."&amp;envente=".$_POST["envente"], $sortfield, $sortorder,'',$num);
}
@ -350,11 +367,11 @@ if ($resql)
print_barre_liste('', $page, "liste.php", "&amp;sref=$sref&amp;snom=$snom&amp;fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":""), $sortfield, $sortorder,'',$num);
}
}
$db->free($resql);
print "</table>";
print '</form>';
print '</form>';
}
}
else