diff --git a/htdocs/fourn/product/fiche.php b/htdocs/fourn/product/fiche.php deleted file mode 100644 index 313d7aca724..00000000000 --- a/htdocs/fourn/product/fiche.php +++ /dev/null @@ -1,618 +0,0 @@ - - * Copyright (C) 2004-2005 Laurent Destailleur - * Copyright (C) 2005-2007 Regis Houssin - * - * 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$ - */ - -/** - \file htdocs/fourn/product/fiche.php - \ingroup product - \brief Page de la fiche produit - \version $Revision$ - */ - -require("./pre.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/product.class.php"); - -$langs->load("products"); - -$mesg = ''; - -if (!$user->rights->produit->lire) accessforbidden(); - - -/* - * - */ - -if ($_GET["action"] == 'fastappro') -{ - $product = new Product($db); - $product->fetch($_GET["id"]); - $result = $product->fastappro($user); - Header("Location: fiche.php?id=".$_GET["id"]); - exit; -} - - -// Action ajout d'un produit ou service -if ($_POST["action"] == 'add' && $user->rights->produit->creer) -{ - $product = new Product($db); - - $product->ref = $_POST["ref"]; - $product->libelle = $_POST["libelle"]; - $product->price = $_POST["price"]; - $product->catid = $_POST["catid"]; - $product->tva_tx = $_POST["tva_tx"]; - $product->type = $_POST["type"]; - $product->status = $_POST["statut"]; - $product->description = $_POST["desc"]; - $product->duration_value = $_POST["duration_value"]; - $product->duration_unit = $_POST["duration_unit"]; - $product->seuil_stock_alerte = $_POST["seuil_stock_alerte"]; - - $e_product = $product; - - $id = $product->create($user); - if ($id > 0) - { - Header("Location: fiche.php?id=$id"); - } - else - { - if ($id == -3) - { - $mesg='
'.$product->error.'
'; - $_error = 1; - $_GET["action"] = "create"; - $_GET["type"] = $_POST["type"]; - } - } -} - -// Action mise a jour d'un produit ou service -if ($_POST["action"] == 'update' && -$_POST["cancel"] <> $langs->trans("Cancel") && -$user->rights->produit->creer) -{ - $product = new Product($db); - if ($product->fetch($_POST["id"])) - { - $product->ref = $_POST["ref"]; - $product->libelle = $_POST["libelle"]; - $product->price = $_POST["price"]; - $product->description = $_POST["desc"]; - $product->seuil_stock_alerte = $_POST["seuil_stock_alerte"]; - $product->duration_value = $_POST["duration_value"]; - $product->duration_unit = $_POST["duration_unit"]; - - if ($product->check()) - { - if ($product->update($product->id, $user) > 0) - { - $_GET["action"] = ''; - $_GET["id"] = $_POST["id"]; - - Header("Location: fiche.php?id=".$_POST["id"]); - - } - else - { - $_GET["action"] = 're-edit'; - $_GET["id"] = $_POST["id"]; - $mesg = $product->mesg_error; - } - } - else - { - $_GET["action"] = 're-edit'; - $_GET["id"] = $_POST["id"]; - $mesg = $langs->trans("ErrorProductBadRefOrLabel"); - } - } -} - -if ($_POST["action"] == 'add_fourn' && $_POST["cancel"] <> $langs->trans("Cancel")) -{ - - $product = new Product($db); - if( $product->fetch($_GET["id"]) ) - { - if ($product->add_fournisseur($user, $_POST["id_fourn"], $_POST["ref_fourn"]) > 0) - { - $action = ''; - } - else - { - $action = ''; - } - } -} -if ($_GET["action"] == 'remove_fourn') -{ - $product = new ProductFournisseur($db); - if( $product->fetch($_GET["id"]) ) - { - if ($product->remove_fournisseur($_GET["id_fourn"]) > 0) - { - $_GET["action"] = ''; - $mesg = $langs->trans("SupplierRemoved"); - } - else - { - $_GET["action"] = ''; - } - } -} - - -if ($_POST["action"] == 'update_price' && -$_POST["cancel"] <> $langs->trans("Cancel") && $user->rights->produit->creer) -{ - $product = new Product($db); - - $result = $product->fetch($_GET["id"]); - - $product->price = ereg_replace(" ","",$_POST["price"]); - - if ( $product->update_price($product->id, $user) > 0 ) - - { - $_GET["action"] = ''; - $mesg = 'Fiche mise à jour'; - } - else - { - $_GET["action"] = 'edit_price'; - $mesg = 'Fiche non mise à jour !' . "
" . $product->mesg_error; - } -} - - -if ($_POST["cancel"] == $langs->trans("Cancel")) -{ - $action = ''; - Header("Location: fiche.php?id=".$_POST["id"]); -} - - - -/* - * View - */ - -llxHeader("","",$langs->trans("CardProduct0")); - -// Le produit n'est pas encore chargé a ce stade - -/* - * Création du produit - * - */ -if ($_GET["action"] == 'create' && $user->rights->produit->creer) -{ - $html = new Form($db); - $nbligne=0; - $product = new Product($db); - if ($_error == 1) - { - $product = $e_product; - } - - print '
'; - print ''; - print ''."\n"; - print ''."\n"; - - if ($_GET["type"]!=1) { $title=$langs->trans("NewProduct"); } - if ($_GET["type"]==1) { $title=$langs->trans("NewService"); } - print_fiche_titre($title); - - print ''; - - if ($mesg) print $mesg; - - if ($conf->categorie->enabled) - { - print ''; - } - - print ''; - print ''; - - if ($_GET["type"] != 1 && $conf->stock->enabled) - { - print "".''; - } - else - { - print ''; - } - print '"; - if ($_GET["type"] == 1) - { - print ''; - } - - print ''; - print '
'.$langs->trans("Categorie"); - print ''; - - if (isset($_REQUEST["catid"])) - { - $c = new Categorie ($db, $_REQUEST["catid"]); - $ways = $c->print_all_ways(' > ','fourn/product/liste.php'); - print $ways[0]."
\n"; - } - print '
'.$langs->trans("Ref").''; - if ($_error == 1) - { - print $langs->trans("RefAlreadyExists"); - } - print '
'.$langs->trans("Label").'
Seuil stock'; - print ''; - print '
'.$langs->trans("Description").''; - print '
'.$langs->trans("Duration").'  '; - print ''.$langs->trans("Day").' '; - print ''.$langs->trans("Week").' '; - print ''.$langs->trans("Month").' '; - print ''.$langs->trans("Year").' '; - print '
 
'; - print '
'; -} -else -{ - /* - * Fiche produit - */ - if ($_GET["id"]) - { - if ($_GET["action"] <> 're-edit') - { - $product = new Product($db); - $result = $product->fetch($_GET["id"]); - } - - if ( $product->id > 0 ) - { - if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') - { - /* - * En mode visu - */ - - $h=0; - - $head[$h][0] = DOL_URL_ROOT."/fourn/product/fiche.php?id=".$product->id; - $head[$h][1] = $langs->trans("Card"); - $hselected = $h; - $h++; - - if($product->isproduct()) - { - if ($conf->stock->enabled) - { - $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id; - $head[$h][1] = $langs->trans("Stock"); - $h++; - } - } - - $head[$h][0] = DOL_URL_ROOT."/fourn/product/photos.php?id=".$product->id; - $head[$h][1] = $langs->trans("Photos"); - $h++; - - //Affichage onglet Catégories - if ($conf->categorie->enabled){ - $head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id; - $head[$h][1] = $langs->trans('Categories'); - $h++; - } - - $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; - $head[$h][1] = $langs->trans("CommercialCard"); - $h++; - - dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); - - if ($mesg) print($mesg); - - print ''; - - if ($conf->categorie->enabled) - { - print ''; - print ''; - print ''; - } - - print ""; - print ''; - print ''; - print ''; - print ''; - - $nblignefour=2; - if ($product->isproduct() && $conf->stock->enabled) $nblignefour++; - if ($product->isservice()) $nblignefour++; - - print ''; - - // Description - print ''; - - // Stock - if ($product->isproduct() && $conf->stock->enabled) - { - print ''; - if ($product->no_stock) - { - print "'; - } - - // Duration - if ($product->isservice()) - { - print ''; - } - print "
'; - $cat = new Categorie ($db); - $way = $cat->print_primary_way($product->id," > ",'fourn/product/liste.php',"product"); - if ($way == "") - { - print "Ce produit n'appartient à aucune catégorie"; - } - else - { - print $langs->trans("Categorie")." : "; - print $way; - } - print '
'.$langs->trans("Ref").''.$product->ref.''; - print $product->getLibStatut(2); - print '
'.$langs->trans("Label").''.$product->libelle.'
'.$langs->trans("SellingPrice").''.price($product->price).''; - $product->show_photos($conf->produit->dir_output,1,1,0); - print '
'.$langs->trans("Description").''.nl2br($product->description).'
'.$langs->trans("Stock").'Pas de définition de stock pour ce produit"; - } - else - { - if ($product->stock_reel <= $product->seuil_stock_alerte) - { - print ''.img_warning().' '.$product->stock_reel.' Seuil : '.$product->seuil_stock_alerte; - } - else - { - print "".$product->stock_reel; - } - } - print '
'.$langs->trans("Duration").''.$product->duration_value.' '; - - if ($product->duration_value > 1) - { - $dur=array("d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); - } - else - { - $dur=array("d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); - } - print $langs->trans($dur[$product->duration_unit])." "; - - print '

\n"; - - // Liste des fournisseurs - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $sql = "SELECT s.nom, s.rowid as socid, pf.ref_fourn, pfp.price, pfp.quantity"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON s.rowid = pfp.fk_soc"; - $sql .= " AND pfp.fk_product =".$product->id; - $sql .= " WHERE pf.fk_soc = s.rowid AND pf.fk_product = ".$product->id; - $sql .= " ORDER BY pfp.price ASC, lower(s.nom)"; - - if ( $db->query($sql) ) - { - $num_fournisseur = $db->num_rows($resql); - $i = 0; - $var=True; - while ($i < $num_fournisseur) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print ""; - print ''; - print ''; - - print ''; - print ''; - $i++; - } - $db->free(); - } - print '
'; - print $langs->trans("Suppliers").''.$langs->trans("Ref").''.$langs->trans("BuiingPrice").''.$langs->trans("Quantity").'
'.$objp->nom.''; - print ''; - print img_edit($langs->trans("Modify")); - print ' '; - print $objp->ref_fourn.''; - print price($objp->price); - print ''.$objp->quantity.'
'; - print "\n"; - - - /* - * Ajouter un fournisseur - * - */ - if ($_GET["action"] == 'ajout_fourn' && $user->rights->produit->creer) - { - $langs->load("suppliers"); - - print_titre($langs->trans("AddSupplier")); - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("Suppliers").'
'.$langs->trans("SupplierRef").'
'; - print ' '; - print '
'; - print '
'; - } - } - - /* - * Fiche en mode edition - */ - if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && $user->rights->produit->creer) - { - - if ($product->isservice()) { - print_fiche_titre($langs->trans('Modify').' '.$langs->trans('Service').' : '.$product->ref, ""); - } else { - print_fiche_titre($langs->trans('Modify').' '.$langs->trans('Product').' : '.$product->ref, ""); - } - - if ($mesg) { - print '
'.$mesg.'

'; - } - - print "
\n"; - print ''; - print ''; - print ''; - print "".''; - print ''; - - - if ($product->isproduct() && $conf->stock->enabled) - { - print "".''; - } - else - { - print ''; - } - print '"; - - if ($product->isservice()) - { - print ''; - } - - print ''; - print '
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
Seuil stock'; - print ''; - print '
'.$langs->trans("Description").''; - print '
'.$langs->trans("Duration").''; - print '  '; - print 'duration_unit=='d'?' checked':'').'>'.$langs->trans("Day"); - print '  '; - print 'duration_unit=='w'?' checked':'').'>'.$langs->trans("Week"); - print '  '; - print 'duration_unit=='m'?' checked':'').'>'.$langs->trans("Month"); - print '  '; - print 'duration_unit=='y'?' checked':'').'>'.$langs->trans("Year"); - - print '
 '; - print '
'; - print '
'; - } - - - - - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - - print "\n
\n"; - - if ($_GET["action"] == '') - { - if ( $user->rights->produit->creer) - { - print ''.$langs->trans("Modify").''; - } - - if ($product->isproduct() && $conf->stock->enabled) - { - print ''.$langs->trans("CorrectStock").''; - } - - print ''.$langs->trans("AddSupplier").''; - - if ($product->isproduct() && $user->rights->commande->creer) - { - $langs->load('orders'); - print ''; - print $langs->trans("CreateOrder").''; - } - - } - - print "\n
\n"; - - } - else - { - print $langs->trans("BadId"); - } - } - else - { - print $langs->trans("BadId"); - } -} - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/lolix/cv/cv.class.php b/htdocs/lolix/cv/cv.class.php deleted file mode 100644 index aa4c78c2bc8..00000000000 --- a/htdocs/lolix/cv/cv.class.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * 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$ - * - */ - -class Cv { - var $db; - var $id; - - Function Cv($DB, $id=0) - { - $this->db = $DB; - $this->id = $id; - - return 1; - } - - /* - * - * - */ - Function fetch() - { - $sql = "SELECT c.idp, c.nom, c.prenom, c.email"; - $sql .= " FROM lolixfr.candidat as c"; - $sql .= " WHERE c.idp = ".$this->id; - - $result = $this->db->query($sql); - - if ($result) - { - if ($this->db->num_rows()) - { - $obj = $this->db->fetch_object(0); - - $this->id = $obj->idp; - $this->active = $obj->active; - $this->date_activation = $obj->da; - $this->nom = stripslashes($obj->nom); - $this->prenom = stripslashes($obj->prenom); - $this->email = stripslashes($obj->email); - - return 1; - - } - $this->db->free(); - } - else - { - print $this->db->error(); - } - } - - - Function deactivate() - { - $sql = "UPDATE lolixfr.candidat SET active=0,deacmeth='b',pubkey='$digest' WHERE idp=" . $this->id; - $result = $this->db->query($sql); - - $sql = "INSERT INTO lolixfr.res_statutlog (datel, fk_cand, fk_statut,author)"; - $sql .= " VALUES (".$this->db->idate(mktime()).",$this->id,0,'bots')"; - $result = $this->db->query($sql); - - $header = "From: webmaster@lolix.org\r\nReply-To: webmaster@lolix.org\r\nX-Mailer: Dolibarr"; - - $email = $this->email; - - $message = ' Bonjour, - - Le CV que vous avez déposé sur http://fr.lolix.org est arrivé à expiration, -celui-ci n\'est plus consultable en ligne, nous vous invitons à le réactiver si -vous êtes toujours à la recherche d\'un emploi. - - -Cordialement, - ---- -L\'équipe Lolix - http://fr.lolix.org/ -Le guide des prestataires logiciels libres - http://www.support-libre.com -'; - - - mail($email, "Desactivation de votre CV sur Lolix", $message, $header); - - print "mail sent to : $email"; - - } -} - -?> diff --git a/htdocs/lolix/cv/liste.php b/htdocs/lolix/cv/liste.php deleted file mode 100644 index da6d48bacd8..00000000000 --- a/htdocs/lolix/cv/liste.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * 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("","","Lolix, liste des candidats"); - -if ($_GET["action"] == 'deac') -{ - $cv = new Cv($db); - $cv->id = $_GET["id"]; - $cv->fetch(); - $cv->deactivate(); -} - - -/* - * Sécurité accés client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -if ($page == -1) { $page = 0 ; } - -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - -$sql = "SELECT c.idp, c.nom, c.prenom"; -$sql .= ",".$db->pdate("c.datea")." as da"; -$sql .= " FROM lolixfr.candidat as c"; -$sql .= " WHERE c.active = 1"; - -$sortfield = "c.datea"; -$sortorder = "ASC"; - -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows(); - - - print_barre_liste("Liste des CV", $page, $PHP_SELF,"",$sortfield,$sortorder,'',$num); - - $i = 0; - - if ($sortorder == "DESC") - { - $sortorder="ASC"; - } - else - { - $sortorder="DESC"; - } - print ''; - print ''; - print ""; - print ""; - print "\n"; - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object( $i); - - $var=!$var; - - print "'; - print '\n"; print "\n"; - - print '\n"; - print ''; - print "\n"; - $i++; - } - print "
id"; - print_liste_field_titre("Nom",$PHP_SELF,"c.nom","","",'valign="center"',$sortfield,$sortorder); - print ""; - print_liste_field_titre("Prénom",$PHP_SELF,"c.prenom","","",'valign="center"',$sortfield,$sortorder); - print ""; - print_liste_field_titre("Activé le",$PHP_SELF,"s.fk_departement","","",'valign="center"',$sortfield,$sortorder); - print "
".($i+1).''; - print img_file(); - print " idp\">$obj->nom".$obj->prenom." '.dolibarr_print_date($obj->da,'day')."Deac
"; - $db->free(); -} -else -{ - print $db->error() . ' ' . $sql; -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/lolix/cv/pre.inc.php b/htdocs/lolix/cv/pre.inc.php deleted file mode 100644 index 384be95d31d..00000000000 --- a/htdocs/lolix/cv/pre.inc.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * 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("../../main.inc.php"); -require("./cv.class.php"); - -function llxHeader($head = "", $urlp = "", $title="") -{ - global $user, $conf, $db; - - /* - * - * - */ - top_menu($head, $title); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/lolix/index.php", "Lolix"); - - $menu->add_submenu(DOL_URL_ROOT."/lolix/cv/liste.php", "Liste des CV"); - left_menu($menu->liste); -} - -Function fiche_header($id) -{ - $h = 0; - $head[0][0] = DOL_URL_ROOT.'/lolix/offre.php?id='.$id; - $head[0][1] = "Offre"; - $h++; - - for($i = 0 ; $i < sizeof($head) ; $i++) - { - if (strstr($head[$i][0], $GLOBALS["SCRIPT_URL"]) ) - { - $a = $i; - // sort de la boucle - $i = sizeof($head); - } - } - - dolibarr_fiche_head($head, $a); -} -?> diff --git a/htdocs/lolix/index.php b/htdocs/lolix/index.php deleted file mode 100644 index 881dbae12d6..00000000000 --- a/htdocs/lolix/index.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * 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"); - -if ($user->societe_id > 0) -{ - $socid = $user->societe_id; -} - - - -llxHeader("","","Lolix"); - -print_titre("Espace Lolix"); - -print ''; -print ''; -print '
'; -/* - * - * - */ -$sql = "SELECT count(*) as cc, o.active"; -$sql .= " FROM lolixfr.offre as o "; -$sql .= " GROUP BY o.active DESC"; - -$active[1] = "Active"; -$active[0] = "Inactive"; -$active[-2] = "Inactive"; -$active[-3] = "Inactive (désactivée robots)"; -$active[-4] = "Inactive (???)"; - -if ( $db->query($sql) ) -{ - $num = $db->num_rows(); - $i = 0; - if ($num > 0 ) - { - print ''; - print ''; - print ''; - - while ($i < $num) - { - $obj = $db->fetch_object(); - $var=!$var; - print ""; - print '"; - $i++; - } - print "
Offres
rowid."\">".$active[$obj->active]."'.$obj->cc."

"; - } -} - -/* - * - * - */ -print '
'; -/* - * - * - */ -$sql = "SELECT count(*) as cc, o.active"; -$sql .= " FROM lolixfr.candidat as o "; -$sql .= " GROUP BY o.active DESC"; - -$active[1] = "Active"; -$active[0] = "Inactive"; -$active[-2] = "Inactive"; -$active[-3] = "Inactive (désactivée robots)"; -$active[-4] = "Inactive (???)"; - -if ( $db->query($sql) ) -{ - $num = $db->num_rows(); - $i = 0; - if ($num > 0 ) - { - print ''; - print ''; - print ''; - - while ($i < $num) - { - $obj = $db->fetch_object(); - $var=!$var; - print ""; - print '"; - $i++; - } - print "
Candidats
rowid."\">".$active[$obj->active]."'.$obj->cc."

"; - } -} - - -print '
'; - -$db->close(); - - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/lolix/lolix.societe.class.php b/htdocs/lolix/lolix.societe.class.php deleted file mode 100644 index 024b79f1b89..00000000000 --- a/htdocs/lolix/lolix.societe.class.php +++ /dev/null @@ -1,139 +0,0 @@ - - * - * 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$ - * - */ - -class LolixSociete { - var $db; - - var $id; - var $nom; - var $adresse; - var $cp; - var $ville; - var $tel; - var $fax; - var $url; - var $siren; - var $client; - var $note; - var $fournisseur; - - - Function LolixSociete($DB, $id=0) - { - global $config; - - $this->db = $DB; - $this->id = $id; - - return 1; - } - /* - * - * - * - */ - Function update($id) - { - $sql = "SELECT short_desc"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe_details as sd"; - $sql .= " WHERE sd.fk_soc = ".$this->id; - - if ($this->db->query($sql)) - { - if ($this->db->num_rows() == 0) - { - $this->db->free(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_details (fk_soc) VALUES ($id)"; - $result = $this->db->query($sql); - } - } - - $sql = "UPDATE ".MAIN_DB_PREFIX."societe_details "; - $sql .= " SET short_desc = '" . trim($this->short_desc) ."'"; - $sql .= ", long_desc = '" . trim($this->long_desc) ."'"; - $sql .= ", contact_nom = '" . trim($this->contact_nom) ."'"; - $sql .= ", contact_email = '" . trim($this->contact_email) ."'"; - $sql .= ", date_creation = ',".$this->db->idate($this->date_creation). "'"; - $sql .= " WHERE fk_soc = " . $id .";"; - - if ($this->db->query($sql)) - { - - } - else - { - print $this->db->error(); - } - } - - /* - * - * - */ - Function fetch($socid) - { - $this->id = $socid; - - $sql = "SELECT s.nom,s.active,s.siren,s.tel,s.url,s.fax,"; - $sql .= $this->db->pdate("s.datec")." as dc"; - $sql .= " FROM lolixfr.societe as s"; - $sql .= " WHERE s.rowid = ".$this->id; - - if ($this->db->query($sql)) - { - if ($this->db->num_rows()) - { - $obj = $this->db->fetch_object(); - - $this->nom = $obj->nom; - $this->active = $obj->active; - $this->tel = $obj->tel; - $this->fax = $obj->fax; - $this->url = $obj->url; - - $this->date_creation = $obj->dc; - - $this->siren = $obj->siren; - - - return 1; - - } - else - { - print "Error"; - } - $this->db->free(); - } - else - { - print $this->db->error(); - } - } - /* - * - * - */ - -} - -?> diff --git a/htdocs/lolix/pre.inc.php b/htdocs/lolix/pre.inc.php deleted file mode 100644 index d551caeb20e..00000000000 --- a/htdocs/lolix/pre.inc.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * 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("../main.inc.php"); -require_once DOL_DOCUMENT_ROOT."/lolix/lolix.societe.class.php"; - -function llxHeader($head = "", $urlp = "", $title="") -{ - global $user, $conf, $db; - - /* - * - * - */ - top_menu($head, $title); - - $menu = new Menu(); - - - - $menu->add(DOL_URL_ROOT."/lolix/index.php", "Lolix"); - - $menu->add_submenu(DOL_URL_ROOT."/lolix/liste.php", "Liste des offres"); - $menu->add_submenu(DOL_URL_ROOT."/lolix/cv/liste.php", "Liste des CV"); - - $menu->add(DOL_URL_ROOT."/lolix/societe/", "Sociétés"); - - $menu->add_submenu(DOL_URL_ROOT."/lolix/societe/activation.php", "Activation"); - $menu->add_submenu(DOL_URL_ROOT."/lolix/societe/liste.php", "Liste"); - - - $menu->add(DOL_URL_ROOT."/lolix/tode.php", "Offres à désactiver"); - - - $menu->add(DOL_URL_ROOT."/lolix/linuxmag.php", "Linux Mag"); - left_menu($menu->liste); -} - -Function fiche_header($id) -{ - $h = 0; - $head[0][0] = DOL_URL_ROOT.'/lolix/offre.php?id='.$id; - $head[0][1] = "Offre"; - $h++; - - for($i = 0 ; $i < sizeof($head) ; $i++) - { - if (strstr($head[$i][0], $GLOBALS["SCRIPT_URL"]) ) - { - $a = $i; - // sort de la boucle - $i = sizeof($head); - } - } - - dolibarr_fiche_head($head, $a); -} -?> diff --git a/htdocs/lolix/societe/activation.php b/htdocs/lolix/societe/activation.php deleted file mode 100644 index 1b89840c6f0..00000000000 --- a/htdocs/lolix/societe/activation.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * 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"); - -$langs->load("companies"); - -llxHeader("","","Lolix - Société a activer"); - -/* - * Sécurité accés client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -if ($page == -1) { $page = 0 ; } - -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - -$sql = "SELECT s.idp,s.nom, s.ville,".$db->pdate("datec") ." as da"; -$sql .= " FROM lolixfr.societe as s"; -$sql .= " WHERE active = 0"; - -$sortfield = "s.datec"; -$sortorder = "DESC"; - -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows(); - - - print_barre_liste("Societe a activer", $page, "activation.php","",$sortfield,$sortorder,'',$num); - - $i = 0; - - if ($sortorder == "DESC") - { - $sortorder="ASC"; - } - else - { - $sortorder="DESC"; - } - print ''; - print ''; - print_liste_field_titre($langs->trans("Company"),$PHP_SELF,"s.nom","","",'valign="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$PHP_SELF,"s.ville","","",'valign="center"',$sortfield,$sortorder); - print ""; - - print "\n"; - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object(); - - $var=!$var; - - print ""; - print ''; - - - print " idp\">$obj->ref\n"; - print "\n"; - - print '\n"; - - print "\n"; - $i++; - } - print "
 
'; - print img_file(); - print " ".$obj->nom.'".$obj->ville." '.dolibarr_print_date($obj->da,'day')."
"; - $db->free(); -} -else -{ - print $db->error() . ' ' . $sql; -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/lolix/societe/fiche.php b/htdocs/lolix/societe/fiche.php deleted file mode 100644 index e6b032ce83e..00000000000 --- a/htdocs/lolix/societe/fiche.php +++ /dev/null @@ -1,181 +0,0 @@ - - * - * 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"); - -/* - * Sécurité accés client - */ - -$socid = $_GET["id"]; - -/* - * - * - */ -llxHeader(); -$form = new Form($db); - -$soc = new LolixSociete($db); -$soc->fetch($_GET["id"]); - -fiche_header($soc->id); - -/* - * - */ - -if ($_GET["action"] == 'edit') -{ - print_titre("Edition de la société"); - - if ($socid) - { - $soc = new Societe($db); - $soc->id = $socid; - $soc->fetch($socid); - - print '
'; - print ''; - - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - - - print ''; - - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - print ''; - print '
'.$langs->trans("Name").'
Adresse'.$langs->trans("Zip").' '; - print $langs->trans("Town").' 
'.$langs->trans("State").''; - print $form->select_departement($soc->departement_id); - print ''.$langs->trans("Country").''; - print $form->select_pays($soc->pays_id); - print '
'.$langs->trans("Phone").''.$langs->trans("Fax").'
'.$langs->trans("web").'http://
'.$langs->transcountry("ProfId1",$soc->pays_code).''.$langs->transcountry("ProfId2",$soc->pays_code).'
'.$langs->transcountry("ProfId3",$soc->pays_code).''.$langs->trans("Capital").' '.$langs->trans("Currency".$conf->monnaie).'
Forme juridique'; - $html = new Form($db); - print $html->select_array("forme_juridique_id",$form->forme_juridique_array(), $soc->forme_juridique_id,0,1); - print '
'.$langs->trans("Type").''; - $form->select_array("typent_id",$form->typent_array(), $soc->typent_id); - print ''.$langs->trans("Staff").''; - $form->select_array("effectif_id",$form->effectif_array(), $soc->effectif_id); - print '
'; - print '
'; - - } -} -else -{ - - print ''; - print ''; - print ''; - - - print ''; - - - print ''; - print ''; - print ''; - - print ''; - - print ''; - - print ''; - print ''; - - print ''; - print ''; - - $file = DOL_DOCUMENT_ROOT . "/document/sl/catalogue-".$soc->id.".pdf"; - - print ''; - - if (file_exists($file)) - { - print ''; - print ''; - print ''; - } - print ''; -/* - * - */ - - -print '
Nom'.$soc->nom.'Mise à jour'.dolibarr_print_date($socdet->date_fiche_update,'dayhour').' '; - print '
Adresse'.nl2br($soc->adresse).' '; - print '
'.$soc->cp.' '.$soc->ville.'
'.$soc->pays.'
Téléphone'.dolibarr_print_phone($soc->tel).'Fax'.dolibarr_print_phone($soc->fax).'
Web'; - if ($soc->url) { print 'http://'.$soc->url.''; } - print 'Siren'.$soc->siren.' 
Forme juridique'.$soc->forme_juridique.'
'.$langs->trans("Staff").''.$soc->effectif.'Création'.dolibarr_print_date($soc->date_creation,'day').'
Contact'.$socdet->contact_nom.' '.$socdet->contact_email.'  
'.img_file_new().''.img_pdf().''.filesize($file). ' bytes'.dolibarr_print_date(filemtime($file),'dayhour').'
'; -print '
'; -/* - * - */ - -} - -print '
'; - -if ($soc->active == 0) -{ - print 'Activer'; -} - - - -print '
'; -/* - * - */ - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/lolix/societe/index.php b/htdocs/lolix/societe/index.php deleted file mode 100644 index 2c82fcb6a9d..00000000000 --- a/htdocs/lolix/societe/index.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * 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$ - */ -require("./pre.inc.php"); - -if ($user->societe_id > 0) -{ - $socid = $user->societe_id; -} - - - -llxHeader("","","Lolix"); - -print_titre("Espace Lolix"); - -print ''; -print ''; -print '
'; -/* - * - * - */ -$sql = "SELECT count(*) as cc, o.active"; -$sql .= " FROM lolixfr.offre as o "; -$sql .= " GROUP BY o.active DESC"; - -$active[1] = "Active"; -$active[0] = "Inactive"; -$active[-2] = "Inactive"; -$active[-3] = "Inactive (désactivée robots)"; -$active[-4] = "Inactive (???)"; - -if ( $db->query($sql) ) -{ - $num = $db->num_rows(); - $i = 0; - if ($num > 0 ) - { - print ''; - print ''; - print ''; - - while ($i < $num) - { - $obj = $db->fetch_object(); - $var=!$var; - print ""; - print '"; - $i++; - } - print "
Offres
rowid."\">".$active[$obj->active]."'.$obj->cc."

"; - } -} - -/* - * - * - */ -print '
'; -/* - * - * - */ -$sql = "SELECT count(*) as cc, o.active"; -$sql .= " FROM lolixfr.candidat as o "; -$sql .= " GROUP BY o.active DESC"; - -$active[1] = "Active"; -$active[0] = "Inactive"; -$active[-2] = "Inactive"; -$active[-3] = "Inactive (désactivée robots)"; -$active[-4] = "Inactive (???)"; - -if ( $db->query($sql) ) -{ - $num = $db->num_rows(); - $i = 0; - if ($num > 0 ) - { - print ''; - print ''; - print ''; - - while ($i < $num) - { - $obj = $db->fetch_object(); - $var=!$var; - print ""; - print '"; - $i++; - } - print "
Candidats
rowid."\">".$active[$obj->active]."'.$obj->cc."

"; - } -} - - -print '
'; - -$db->close(); - - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/lolix/societe/liste.php b/htdocs/lolix/societe/liste.php deleted file mode 100644 index 854bd350484..00000000000 --- a/htdocs/lolix/societe/liste.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * 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("","","Lolix, liste des offres"); - -/* - * Sécurité accés client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -if ($page == -1) { $page = 0 ; } - -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - -$sql = "SELECT s.nom, s.ville,".$db->pdate("datea") ." as da"; -$sql .= " FROM lolixfr.societe as s"; - - -$sortfield = "s.nom"; -$sortorder = "DESC"; - -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows(); - - - print_barre_liste("Liste des offres", $page, $PHP_SELF,"",$sortfield,$sortorder,'',$num); - - $i = 0; - - if ($sortorder == "DESC") - { - $sortorder="ASC"; - } - else - { - $sortorder="DESC"; - } - print ''; - print ''; - print ""; - - print "\n"; - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($result); - - $var=!$var; - - print ""; - print ''; - - - print " idp\">$obj->ref\n"; - print "\n"; - - print '\n"; - - print "\n"; - $i++; - } - print "
"; - print_liste_field_titre("Société",$PHP_SELF,"s.nom","","",'valign="center"',$sortfield,$sortorder); - print ""; - print_liste_field_titre("Ville",$PHP_SELF,"s.ville"); - print " 
'; - print img_file(); - print " ".$obj->nom.'".$obj->ville." '.dolibarr_print_date($obj->da,'day')."
"; - $db->free(); -} -else -{ - print $db->error() . ' ' . $sql; -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/lolix/societe/pre.inc.php b/htdocs/lolix/societe/pre.inc.php deleted file mode 100644 index 178f015c0b8..00000000000 --- a/htdocs/lolix/societe/pre.inc.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * 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("../../main.inc.php"); -require_once DOL_DOCUMENT_ROOT."/lolix/lolix.societe.class.php"; - -function llxHeader($head = "", $urlp = "", $title="") -{ - global $user, $conf, $db; - - /* - * - * - */ - top_menu($head, $title); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/lolix/index.php", "Lolix"); - - $menu->add(DOL_URL_ROOT."/lolix/societe/", "Sociétés"); - - $menu->add_submenu(DOL_URL_ROOT."/lolix/societe/activation.php", "Activation"); - $menu->add_submenu(DOL_URL_ROOT."/lolix/societe/liste.php", "Liste"); - - $menu->add(DOL_URL_ROOT."/lolix/tode.php", "Offres à désactiver"); - - - $menu->add(DOL_URL_ROOT."/lolix/linuxmag.php", "Linux Mag"); - left_menu($menu->liste); -} - -Function fiche_header($id) -{ - $h = 0; - $head[0][0] = DOL_URL_ROOT.'/lolix/societe/fiche.php?id='.$id; - $head[0][1] = "Societe"; - $h++; - - for($i = 0 ; $i < sizeof($head) ; $i++) - { - if (strstr($head[$i][0], $GLOBALS["SCRIPT_URL"]) ) - { - $a = $i; - // sort de la boucle - $i = sizeof($head); - } - } - - dolibarr_fiche_head($head, $a); -} -?>