Fix: Corrections de quelques bugs
This commit is contained in:
parent
9583cb2d39
commit
f8b6625bcb
@ -275,28 +275,26 @@ function formCategory($db,$object,$type,$typeid)
|
||||
}
|
||||
|
||||
// Formulaire ajout dans une categorie
|
||||
if ($user->rights->societe->creer)
|
||||
print '<br>';
|
||||
print_fiche_titre($title);
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/categories/categorie.php?'.$nameId.'='.$object->id.'">';
|
||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>';
|
||||
print $langs->trans("ClassifyInCategory").' ';
|
||||
print $html->select_all_categories($typeid).' <input type="submit" class="button" value="'.$langs->trans("Classify").'"></td>';
|
||||
if ($user->rights->categorie->creer)
|
||||
{
|
||||
print '<br>';
|
||||
print_fiche_titre($title);
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/categories/categorie.php?'.$nameId.'='.$object->id.'">';
|
||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>';
|
||||
print $langs->trans("ClassifyInCategory").' ';
|
||||
print $html->select_all_categories($typeid).' <input type="submit" class="button" value="'.$langs->trans("Classify").'"></td>';
|
||||
if ($user->rights->categorie->creer)
|
||||
{
|
||||
print '<td align="right">';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/categories/fiche.php?action=create&origin='.$object->id.'&type='.$typeid.'">'.$langs->trans("NewCat").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br/>';
|
||||
print '<td align="right">';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/categories/fiche.php?action=create&origin='.$object->id.'&type='.$typeid.'">'.$langs->trans("NewCat").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br/>';
|
||||
|
||||
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($object->id,$type,$typeid);
|
||||
|
||||
@ -346,7 +344,11 @@ function formCategory($db,$object,$type,$typeid)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("CompanyHasNoCategory")."<br/>";
|
||||
if ($typeid == 0) $title=$langs->trans("ProductHasNoCategory");
|
||||
if ($typeid == 1) $title=$langs->trans("CompanyHasNoCategory");
|
||||
if ($typeid == 2) $title=$langs->trans("CompanyHasNoCategory");
|
||||
print $title;
|
||||
print "<br/>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2007 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
|
||||
@ -15,16 +15,13 @@
|
||||
* 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/comm/prospect/fiche.php
|
||||
\ingroup prospect
|
||||
\brief Page de la fiche prospect
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require_once("./pre.inc.php");
|
||||
@ -146,61 +143,64 @@ if ($socid > 0)
|
||||
$tableaushown=0;
|
||||
|
||||
|
||||
$propal_static=new Propal($db);
|
||||
|
||||
/*
|
||||
* Dernieres propales
|
||||
*
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
$sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.fk_statut, p.price, p.ref, p.remise, ";
|
||||
$sql.= " ".$db->pdate("p.datep")." as dp, ".$db->pdate("p.fin_validite")." as datelimite,";
|
||||
$sql.= " c.label as statut, c.id as statutid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
$sql.= " AND s.rowid = ".$societe->id;
|
||||
$sql.= " ORDER BY p.datep DESC";
|
||||
if ($conf->propal->enabled)
|
||||
{
|
||||
$propal_static=new Propal($db);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$var=true;
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num > 0)
|
||||
{
|
||||
$tableaushown=1;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="noborder"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$societe->id.'">'.$langs->trans("AllPropals").' ('.$num.')</a></td></tr></table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<table class="noborder" width="100%">';
|
||||
$sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.fk_statut, p.price, p.ref, p.remise, ";
|
||||
$sql.= " ".$db->pdate("p.datep")." as dp, ".$db->pdate("p.fin_validite")." as datelimite,";
|
||||
$sql.= " c.label as statut, c.id as statutid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
$sql.= " AND s.rowid = ".$societe->id;
|
||||
$sql.= " ORDER BY p.datep DESC";
|
||||
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"../propal.php?propalid=$objp->propalid\">";
|
||||
print img_object($langs->trans("ShowPropal"),"propal");
|
||||
print " $objp->ref</a>\n";
|
||||
if ( ($objp->dp < time() - $conf->propal->cloture->warning_delay) && $objp->fk_statut == 1 )
|
||||
{
|
||||
print " ".img_warning();
|
||||
}
|
||||
print "</td><td align=\"right\">".dolibarr_print_date($objp->dp,"day")."</td>\n";
|
||||
print "<td align=\"right\">".price($objp->price)."</td>\n";
|
||||
print "<td align=\"right\">".$propal_static->LibStatut($objp->fk_statut,5)."</td></tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$var=true;
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num > 0)
|
||||
{
|
||||
$tableaushown=1;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="noborder"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$societe->id.'">'.$langs->trans("AllPropals").' ('.$num.')</a></td></tr></table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"../propal.php?propalid=$objp->propalid\">";
|
||||
print img_object($langs->trans("ShowPropal"),"propal");
|
||||
print " $objp->ref</a>\n";
|
||||
if ( ($objp->dp < time() - $conf->propal->cloture->warning_delay) && $objp->fk_statut == 1 )
|
||||
{
|
||||
print " ".img_warning();
|
||||
}
|
||||
print "</td><td align=\"right\">".dolibarr_print_date($objp->dp,"day")."</td>\n";
|
||||
print "<td align=\"right\">".price($objp->price)."</td>\n";
|
||||
print "<td align=\"right\">".$propal_static->LibStatut($objp->fk_statut,5)."</td></tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
print "</td></tr>";
|
||||
print "</table>\n</div>\n";
|
||||
|
||||
|
||||
@ -19,15 +19,13 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/facture.php
|
||||
\ingroup facture
|
||||
\brief Page de création d'une facture
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require('./pre.inc.php');
|
||||
|
||||
@ -2918,11 +2918,14 @@ class FactureLigne
|
||||
{
|
||||
global $langs;
|
||||
|
||||
// Nettoyage parametres
|
||||
dolibarr_syslog("FactureLigne::Insert rang=".$this->rang, LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
$this->desc=trim($this->desc);
|
||||
if (! $this->subprice) $this->subprice=0;
|
||||
if (! $this->price) $this->price=0;
|
||||
|
||||
dolibarr_syslog("FactureLigne::Insert rang=".$this->rang, LOG_DEBUG);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$rangtouse=$this->rang;
|
||||
@ -3060,7 +3063,11 @@ class FactureLigne
|
||||
*/
|
||||
function update()
|
||||
{
|
||||
$this->db->begin();
|
||||
// Clean parameters
|
||||
$this->desc=trim($this->desc);
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Mise a jour ligne en base
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET";
|
||||
|
||||
@ -85,6 +85,8 @@ class Form
|
||||
// Sanitize tooltip
|
||||
$htmltext=ereg_replace("'","\'",$htmltext);
|
||||
$htmltext=ereg_replace("'","\'",$htmltext);
|
||||
$htmltext=ereg_replace("\r","",$htmltext);
|
||||
$htmltext=ereg_replace("\n","<br>",$htmltext);
|
||||
|
||||
if ($conf->use_javascript_ajax && $tooltipon == 4)
|
||||
{
|
||||
|
||||
@ -117,7 +117,7 @@ class modFournisseur extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 1183;
|
||||
$this->rights[$r][1] = 'Cr<EFBFBD>er une commande fournisseur';
|
||||
$this->rights[$r][1] = 'Creer une commande fournisseur';
|
||||
$this->rights[$r][2] = 'w';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'commande';
|
||||
@ -149,7 +149,7 @@ class modFournisseur extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 1187;
|
||||
$this->rights[$r][1] = 'R<EFBFBD>ceptionner les commandes fournisseur';
|
||||
$this->rights[$r][1] = 'Receptionner les commandes fournisseur';
|
||||
$this->rights[$r][2] = 'd';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'commande';
|
||||
@ -157,7 +157,7 @@ class modFournisseur extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 1188;
|
||||
$this->rights[$r][1] = 'Clot<EFBFBD>rer les commandes fournisseur';
|
||||
$this->rights[$r][1] = 'Cloturer les commandes fournisseur';
|
||||
$this->rights[$r][2] = 'd';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'commande';
|
||||
@ -181,7 +181,7 @@ class modFournisseur extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 1232;
|
||||
$this->rights[$r][1] = 'Cr<EFBFBD>er une facture fournisseur';
|
||||
$this->rights[$r][1] = 'Creer une facture fournisseur';
|
||||
$this->rights[$r][2] = 'w';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'facture';
|
||||
@ -205,7 +205,7 @@ class modFournisseur extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 1236;
|
||||
$this->rights[$r][1] = 'Exporter les factures fournisseurs, attributs et r<EFBFBD>glements';
|
||||
$this->rights[$r][1] = 'Exporter les factures fournisseurs, attributs et reglements';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'facture';
|
||||
|
||||
@ -80,14 +80,14 @@ class modSociete extends DolibarrModules
|
||||
$this->const[$r][0] = "SOCIETE_FISCAL_MONTH_START";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "0";
|
||||
$this->const[$r][3] = "Mettre le num<EFBFBD>ro du mois du d<>but d\'ann<6E>e fiscale, ex: 9 pour septembre";
|
||||
$this->const[$r][3] = "Mettre le numero du mois du debut d\'annee fiscale, ex: 9 pour septembre";
|
||||
$this->const[$r][4] = 1;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "MAIN_SEARCHFORM_SOCIETE";
|
||||
$this->const[$r][1] = "yesno";
|
||||
$this->const[$r][2] = "1";
|
||||
$this->const[$r][3] = "Affichage formulaire de recherche des Soci<EFBFBD>t<EFBFBD>s dans la barre de gauche";
|
||||
$this->const[$r][3] = "Affichage formulaire de recherche des Societes dans la barre de gauche";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
@ -115,21 +115,21 @@ class modSociete extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 122; // id de la permission
|
||||
$this->rights[$r][1] = 'Cr<EFBFBD>er modifier les societes'; // libelle de la permission
|
||||
$this->rights[$r][1] = 'Creer modifier les societes'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'w'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par d<>faut
|
||||
$this->rights[$r][4] = 'creer';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 125; // id de la permission
|
||||
$this->rights[$r][1] = 'Supprimer les soci<EFBFBD>t<EFBFBD>s'; // libelle de la permission
|
||||
$this->rights[$r][1] = 'Supprimer les societes'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'd'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par d<>faut
|
||||
$this->rights[$r][4] = 'supprimer';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 126; // id de la permission
|
||||
$this->rights[$r][1] = 'Exporter les soci<EFBFBD>t<EFBFBD>s'; // libelle de la permission
|
||||
$this->rights[$r][1] = 'Exporter les societes'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'r'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par d<>faut
|
||||
$this->rights[$r][4] = 'export';
|
||||
@ -144,7 +144,7 @@ class modSociete extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 282; // id de la permission
|
||||
$this->rights[$r][1] = 'Cr<EFBFBD>er modifier les contacts'; // libelle de la permission
|
||||
$this->rights[$r][1] = 'Creer modifier les contacts'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'w'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par d<>faut
|
||||
$this->rights[$r][4] = 'contact';
|
||||
|
||||
@ -9,6 +9,7 @@ HTMLCharset=Charset for HTML pages
|
||||
DBStoringCharset=Database charset to store data
|
||||
DBSortingCharset=Database charset to sort data
|
||||
WarningModuleNotActive=Module <b>%s</b> must be enabled
|
||||
WarningOnlyPermissionOfActivatedModules=Only permissions related to activated modules are shown here. You can activate other modules on Setup - Module page.
|
||||
DolibarrSetup=Dolibarr setup
|
||||
DolibarrUser=Dolibarr user
|
||||
InternalUser=Internal user
|
||||
@ -305,6 +306,7 @@ Permission116=Transfers between acounts
|
||||
Permission121=Read companies
|
||||
Permission122=Create/modify companies
|
||||
Permission125=Delete companies
|
||||
Permission126=Export companies
|
||||
Permission151=Read standing orders
|
||||
Permission152=Setup standing orders
|
||||
Permission153=Read standing orders receipts
|
||||
@ -346,6 +348,7 @@ Permission262=Read all companies (Internal users only. Externals are always limi
|
||||
Permission281=Read contacts
|
||||
Permission282=Create/modify contacts
|
||||
Permission283=Delete contacts
|
||||
Permission286=Export contacts
|
||||
Permission300=Read bar codes
|
||||
Permission301=Create/modify bar codes
|
||||
Permission302=Delete bar codes
|
||||
|
||||
@ -9,6 +9,7 @@ HTMLCharset=Charset des pages HTML
|
||||
DBStoringCharset=Charset base pour stockage données
|
||||
DBSortingCharset=Charset base pour tri données
|
||||
WarningModuleNotActive=Module <b>%s</b> non actif
|
||||
WarningOnlyPermissionOfActivatedModules=Attention, seuls les permissions en rapport avec les modules activés sont affichées ici. Vous pouvez activer les autres modules sur la page Configuration - Modules
|
||||
DolibarrSetup=Installation de Dolibarr
|
||||
DolibarrUser=Utilisateur Dolibarr
|
||||
InternalUser=Utilisateur interne
|
||||
@ -304,6 +305,7 @@ Permission116=Saisir virements entre comptes
|
||||
Permission121=Consulter les sociétés
|
||||
Permission122=Créer/modifier les sociétés
|
||||
Permission125=Supprimer les sociétés
|
||||
Permission126=Exporter les societes
|
||||
Permission151=Consulter les prélèvements
|
||||
Permission152=Configurer les prélèvements
|
||||
Permission153=Consulter les bons de prélèvements
|
||||
@ -345,6 +347,7 @@ Permission262=Consulter toutes les soci
|
||||
Permission281=Consulter les contacts
|
||||
Permission282=Créer/modifier les contacts
|
||||
Permission283=Supprimer les contacts
|
||||
Permission286=Exporter les contacts
|
||||
Permission300=Consulter les codes barres
|
||||
Permission301=Créer/modifier les codes barres
|
||||
Permission302=Supprimer les codes barres
|
||||
|
||||
@ -1346,7 +1346,7 @@ function info_admin($texte,$infoonimgalt=0)
|
||||
\brief Vérifie les droits de l'utilisateur
|
||||
\param user Utilisateur courant
|
||||
\param module Module a vérifier
|
||||
\param objectid ID du document
|
||||
\param objectid ID de l'element (optionnel)
|
||||
\param dbtable Table de la base correspondant au module (optionnel)
|
||||
\param list Défini si la page sert de liste et donc ne fonctionne pas avec un id
|
||||
*/
|
||||
|
||||
@ -16,19 +16,16 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/societe.php
|
||||
\ingroup societe
|
||||
\brief Page des societes
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require_once("./pre.inc.php");
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||
|
||||
$langs->load("companies");
|
||||
@ -36,11 +33,13 @@ $langs->load("customers");
|
||||
$langs->load("suppliers");
|
||||
|
||||
// Sécurité d'accès client et commerciaux
|
||||
if (! $user->rights->societe->lire && ! $user->rights->fournisseur->lire) accessforbidden();
|
||||
|
||||
$socid = restrictedArea($user, 'societe','','',1);
|
||||
//print 'socid '.$socid;
|
||||
|
||||
$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"];
|
||||
$search_ville=isset($_GET["search_ville"])?$_GET["search_ville"]:$_POST["search_ville"];
|
||||
|
||||
$socname=isset($_GET["socname"])?$_GET["socname"]:$_POST["socname"];
|
||||
$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||
$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
@ -80,7 +79,11 @@ if ($mode == 'search')
|
||||
$sql.= " OR s.url like '%".addslashes($socname)."%'";
|
||||
$sql.= ")";
|
||||
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
|
||||
if (! $user->rights->societe->lire || ! $user->rights->fournisseur->lire)
|
||||
{
|
||||
if (! $user->rights->fournisseur->lire) $sql.=" AND s.fourn != 1";
|
||||
}
|
||||
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@ -112,12 +115,16 @@ if (isset($_POST["button_removefilter_x"]))
|
||||
$search_ville="";
|
||||
}
|
||||
|
||||
if ($socname)
|
||||
{
|
||||
$search_nom=$socname;
|
||||
}
|
||||
|
||||
// Affiche la confirmation de suppression d'un tiers
|
||||
if ($_GET['delsoc']) print '<div class="warning">'.$langs->trans("CompanyDeleted",$_GET['delsoc']).'</div><br>';
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*/
|
||||
/*
|
||||
REM: Regle sur droits "Voir tous les clients"
|
||||
@ -138,22 +145,21 @@ if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PR
|
||||
$sql.= " WHERE s.fk_stcomm = st.id";
|
||||
if ($socid)
|
||||
{
|
||||
$sql .= " AND s.rowid = ".$socid;
|
||||
$sql .= " AND s.rowid = ".$socid;
|
||||
}
|
||||
|
||||
if ($socname)
|
||||
if (strlen($stcomm))
|
||||
{
|
||||
$search_nom=$socname;
|
||||
$sql .= " AND s.fk_stcomm=".$stcomm;
|
||||
}
|
||||
|
||||
if (strlen($stcomm)) {
|
||||
$sql .= " AND s.fk_stcomm=".$stcomm;
|
||||
}
|
||||
|
||||
if (!$user->rights->commercial->client->voir && !$socid) //restriction
|
||||
if (! $user->rights->commercial->client->voir && ! $socid) //restriction
|
||||
{
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if (! $user->rights->societe->lire || ! $user->rights->fournisseur->lire)
|
||||
{
|
||||
if (! $user->rights->fournisseur->lire) $sql.=" AND s.fournisseur != 1";
|
||||
}
|
||||
|
||||
if ($search_nom)
|
||||
{
|
||||
@ -165,12 +171,14 @@ if ($search_nom)
|
||||
$sql.= ")";
|
||||
}
|
||||
|
||||
if ($search_ville) {
|
||||
$sql .= " AND s.ville LIKE '%".addslashes($search_ville)."%'";
|
||||
if ($search_ville)
|
||||
{
|
||||
$sql .= " AND s.ville LIKE '%".addslashes($search_ville)."%'";
|
||||
}
|
||||
|
||||
if ($_POST["search_siren"]) {
|
||||
$sql .= " AND s.siren LIKE '%".$_POST["search_siren"]."%'";
|
||||
if ($_POST["search_siren"])
|
||||
{
|
||||
$sql .= " AND s.siren LIKE '%".$_POST["search_siren"]."%'";
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
@ -17,20 +17,19 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/user/perms.php
|
||||
\brief Onglet user et permissions de la fiche utilisateur
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php");
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("admin");
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@ -206,6 +205,7 @@ print "</tr>\n";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user