Merge pull request #2875 from fappels/develop
Qual: Remove unused pages
This commit is contained in:
commit
9e344bf267
@ -1,175 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/fourn/product/categorie.php
|
||||
* \ingroup product
|
||||
* \brief Page of products categories
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
$langs->load("categories");
|
||||
|
||||
$mesg = '';
|
||||
|
||||
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
|
||||
|
||||
/*
|
||||
* Creation de l'objet produit correspondant a l'id
|
||||
*/
|
||||
if ($_GET["id"])
|
||||
{
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
}
|
||||
|
||||
llxHeader("","",$langs->trans("CardProduct0"));
|
||||
|
||||
/*
|
||||
* Fiche produit
|
||||
*/
|
||||
if ($_GET["id"])
|
||||
{
|
||||
//on veut supprimer une cat<61>gorie
|
||||
if ($_REQUEST["cat"])
|
||||
{
|
||||
$cat = new Categorie($db);
|
||||
$cat->del_product($product);
|
||||
}
|
||||
|
||||
//on veut ajouter une cat<61>gorie
|
||||
if (isset($_REQUEST["add_cat"]) && $_REQUEST["add_cat"]>=0)
|
||||
{
|
||||
$cat = new Categorie($db);
|
||||
$cat->add_product($product);
|
||||
}
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
|
||||
/*
|
||||
* En mode visu
|
||||
*/
|
||||
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/fourn/product/card.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$h++;
|
||||
|
||||
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Stock");
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Suppliers");
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Photos");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/card.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans('Statistics');
|
||||
$h++;
|
||||
|
||||
//affichage onglet cat<61>gorie
|
||||
if (! empty($conf->categorie->enabled)){
|
||||
$head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans('Categories');
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
|
||||
print($mesg);
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("Ref").'</td><td>'.$product->ref.'</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->label.'</td>';
|
||||
print "</table><br>\n";
|
||||
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($_REQUEST['id'],0);
|
||||
|
||||
if (count($cats) > 0)
|
||||
{
|
||||
print "Vous avez stock<63> le produit dans les cat<61>gorie suivantes:<br/><br/>";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("AllWays").'</td></tr>';
|
||||
|
||||
|
||||
foreach ($cats as $cat)
|
||||
{
|
||||
|
||||
$ways = $cat->print_all_ways();
|
||||
foreach ($ways as $way)
|
||||
{
|
||||
$i = !$i;
|
||||
print "<tr ".$bc[$i]."><td>".$way."</td>";
|
||||
print "<td><a href= '".DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id."&cat=".$cat->id."'>".$langs->trans("DeleteFromCat")."</a></td></tr>\n";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
print "</table><br/><br/>\n";
|
||||
}
|
||||
else if($cats < 0)
|
||||
{
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
print $langs->trans("NoCat")."<br/><br/>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print $langs->trans("AddProductToCat")."<br/><br/>";
|
||||
print '<table class="border" width="100%">';
|
||||
print '<form method="POST" action="'.DOL_URL_ROOT.'/fourn/product/categorie.php?id='.$product->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<tr><td><select name='add_cat'><option value='-1'>".$langs->trans("Choose")."</option>";
|
||||
$cat = new Categorie($db);
|
||||
foreach ($cat->get_all_categories() as $categorie)
|
||||
{
|
||||
print "<option value='".$categorie->id."'>".$categorie->label."</option>\n";
|
||||
}
|
||||
print "</select></td><td><input type='submit' value='".$langs->trans("Select")."'></td></tr>";
|
||||
print "</form></table><br/>";
|
||||
|
||||
}
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter();
|
||||
@ -1,153 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/product/index.php
|
||||
* \ingroup product
|
||||
* \brief Page accueil des produits et services
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader("","",$langs->trans("ProductsAndServices"));
|
||||
|
||||
print_fiche_titre($langs->trans("ProductsAndServicesArea"));
|
||||
|
||||
print '<table border="0" width="100%">';
|
||||
|
||||
print '<tr><td valign="top" width="30%">';
|
||||
|
||||
/*
|
||||
* Zone recherche produit/service
|
||||
*/
|
||||
print '<form method="post" action="list.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print "<tr ".$bc[false]."><td>";
|
||||
print $langs->trans("Ref").' :</td><td><input class="flat" type="text" size="20" name="sf_ref"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||
print "<tr ".$bc[false]."><td>";
|
||||
print $langs->trans("Label").' :</td><td><input class="flat" type="text" size="20" name="snom"></td><td><input class="button" type="submit" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print "</table></form><br>\n";
|
||||
|
||||
/*
|
||||
* Nombre de produits et/ou services
|
||||
*/
|
||||
$prodser = array();
|
||||
$sql = "SELECT count(*), p.fk_product_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " GROUP BY p.fk_product_type";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$prodser[$row[1]] = $row[0];
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
|
||||
if (! empty($conf->product->enabled))
|
||||
{
|
||||
print "<tr $bc[0]>";
|
||||
print '<td><a href="list.php?type=0">'.$langs->trans("Products").'</a></td><td>'.round($prodser[0]).'</td>';
|
||||
print "</tr>";
|
||||
}
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
print "<tr $bc[1]>";
|
||||
print '<td><a href="list.php?type=1">'.$langs->trans("Services").'</a></td><td>'.round($prodser[1]).'</td>';
|
||||
print "</tr>";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '</td><td valign="top" width="70%">';
|
||||
|
||||
|
||||
/*
|
||||
* Derniers produits en vente
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p ";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " AND p.fk_product_type <> 1";
|
||||
$sql.= " ORDER BY p.datec DESC ";
|
||||
$sql.= $db->plimit(15, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("LastProducts").'</td></tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td><a href=\"card.php?id=$objp->rowid\">";
|
||||
if ($objp->fk_product_type==1) print img_object($langs->trans("ShowService"),"service");
|
||||
else print img_object($langs->trans("ShowProduct"),"product");
|
||||
print "</a> <a href=\"card.php?id=$objp->rowid\">$objp->ref</a></td>\n";
|
||||
print "<td>$objp->label</td>";
|
||||
print "<td>";
|
||||
if ($objp->fk_product_type==1) print $langs->trans('ShowService');
|
||||
else print $langs->trans('ShowProduct');
|
||||
print "</td></tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error();
|
||||
}
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
@ -1,215 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/fourn/product/photos.php
|
||||
* \ingroup product
|
||||
* \brief Page de la fiche produit
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
|
||||
|
||||
$object = new Product($db);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($id)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$object->add_photo($conf->product->multidir_output[$object->entity], $_FILES['photofile']);
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*/
|
||||
llxHeader("","",$langs->trans("CardProduct0"));
|
||||
|
||||
/*
|
||||
* Fiche produit
|
||||
*/
|
||||
if ($id)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
/*
|
||||
* En mode visu
|
||||
*/
|
||||
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/fourn/product/card.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$h++;
|
||||
|
||||
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("Stock");
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/fourn/product/photos.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("Photos");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
//Affichage onglet Categories
|
||||
if (! empty($conf->categorie->enabled)){
|
||||
$head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans('Categories');
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("CommercialCard");
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("CardProduct".$object->type).' : '.$object->ref);
|
||||
|
||||
print($mesg);
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("Ref").'</td><td>'.$object->ref.'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $object->getLibStatut(2);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td>';
|
||||
print '<td>'.$langs->trans("SellingPrice").'</td><td>'.price($object->price).'</td></tr>';
|
||||
print "</table><br>\n";
|
||||
|
||||
/*
|
||||
* Ajouter une photo
|
||||
*
|
||||
*/
|
||||
if ($action == 'ajout_photo' && ($user->rights->produit->creer || $user->rights->service->creer) && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
print_titre($langs->trans("AddPhoto"));
|
||||
|
||||
print '<form name="userfile" action="photos.php?id='.$object->id.'" enctype="multipart/form-data" METHOD="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
|
||||
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td>'.$langs->trans("File").'</td>';
|
||||
print '<td><input type="file" name="photofile"></td></tr>';
|
||||
|
||||
print '<tr><td colspan="4" align="center">';
|
||||
print '<input type="submit" name="sendit" value="'.$langs->trans("Save").'"> ';
|
||||
|
||||
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form><br>';
|
||||
}
|
||||
|
||||
|
||||
// Affiche photos
|
||||
if ($action != 'ajout_photo')
|
||||
{
|
||||
$nbphoto=0;
|
||||
$nbbyrow=5;
|
||||
|
||||
$pdir = get_exdir($object->id,2,0,0,$object,'product') . $object->id ."/photos/";
|
||||
$dir = $conf->product->multidir_output[$object->entity] . '/'. $pdir;
|
||||
|
||||
print '<br><table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
|
||||
|
||||
foreach ($object->liste_photos($dir) as $obj)
|
||||
{
|
||||
$nbphoto++;
|
||||
|
||||
// if ($nbbyrow && $nbphoto == 1) print '<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
|
||||
|
||||
if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print '<tr align=center valign=middle border=1>';
|
||||
if ($nbbyrow) print '<td width="'.ceil(100/$nbbyrow).'%" class="photo">';
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$obj['photo']).'" alt="Taille origine" target="_blank">';
|
||||
|
||||
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
|
||||
if ($obj['photo_vignette']) $filename=$obj['photo_vignette'];
|
||||
else $filename=$obj['photo'];
|
||||
print '<img border="0" height="120" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$filename).'">';
|
||||
|
||||
print '</a>';
|
||||
print '<br>'.$langs->trans("File").': '.dol_trunc($filename,16);
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||
{
|
||||
print '<br><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&file='.urlencode($pdir.$filename).'">'.img_delete().'</a>';
|
||||
}
|
||||
if ($nbbyrow) print '</td>';
|
||||
if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print '</tr>';
|
||||
}
|
||||
|
||||
// Ferme tableau
|
||||
while ($nbphoto % $nbbyrow)
|
||||
{
|
||||
print '<td width="'.ceil(100/$nbbyrow).'%"> </td>';
|
||||
$nbphoto++;
|
||||
}
|
||||
|
||||
if ($nbphoto < 1)
|
||||
{
|
||||
print '<tr align=center valign=middle border=1><td class="photo">';
|
||||
print "<br>".$langs->trans("NoPhotoYet")."<br><br>";
|
||||
print '</td></tr></table>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
}
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($action == '')
|
||||
{
|
||||
if (($user->rights->produit->creer || $user->rights->service->creer) && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=ajout_photo&id='.$object->id.'">';
|
||||
print $langs->trans("AddPhoto").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
Loading…
Reference in New Issue
Block a user