From 8980d9acc21f28e040f6a7fe87e614e659c6b97b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Mar 2010 23:40:39 +0000 Subject: [PATCH] Move permission "see hidden categories" into "see hidden products/services". --- ChangeLog | 6 +- htdocs/bookmarks/liste.php | 3 +- htdocs/comm/bookmark.php | 3 +- htdocs/comm/clients.php | 3 +- htdocs/comm/contact.php | 3 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/liste.php | 6 +- htdocs/html.form.class.php | 20 +-- htdocs/html.formproduct.class.php | 21 ++- htdocs/includes/boxes/box_produits.php | 15 +- htdocs/includes/boxes/box_services_vendus.php | 17 +- .../includes/modules/modCategorie.class.php | 23 +-- htdocs/includes/modules/modProduit.class.php | 12 +- htdocs/includes/modules/modService.class.php | 7 + .../install/mysql/migration/2.8.0-2.9.0.sql | 5 + htdocs/install/mysql/tables/llx_product.sql | 4 + htdocs/install/upgrade2.php | 90 +++++----- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/other.lang | 12 +- htdocs/langs/fr_FR/main.lang | 1 + htdocs/langs/fr_FR/other.lang | 12 +- htdocs/lib/product.lib.php | 25 ++- htdocs/product.class.php | 53 ++++-- htdocs/product/fiche.php | 162 +++++++++++++----- htdocs/product/fournisseurs.php | 2 +- htdocs/product/index.php | 9 +- htdocs/product/liste.php | 11 +- htdocs/product/popuprop.php | 19 +- htdocs/product/reassort.php | 15 +- htdocs/product/stats/index.php | 40 ++--- htdocs/product/stock/entrepot.class.php | 15 +- htdocs/product/stock/fiche.php | 17 +- htdocs/product/stock/index.php | 11 +- htdocs/product/stock/mouvement.php | 11 +- htdocs/product/stock/product.php | 2 +- htdocs/product/stock/user.php | 2 +- htdocs/projet/liste.php | 3 +- htdocs/public/members/public_list.php | 4 +- htdocs/service.class.php | 15 +- htdocs/societe/ajaxcountries.php | 2 +- htdocs/societe/lien.php | 3 +- htdocs/societe/notify/index.php | 3 +- htdocs/webcal/webcal.class.php | 2 +- .../members/sync_members_ldap2dolibarr.php | 2 +- 44 files changed, 378 insertions(+), 316 deletions(-) diff --git a/ChangeLog b/ChangeLog index 681f96b61ef..af90978b7a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,17 +3,21 @@ English Dolibarr ChangeLog ***** ChangeLog for 2.9 compared to 2.8 ***** For users: +- New: Support products property length and area. - New: Add "payment due before" field in invoice exports - New: Add feature to resize or crop image files (for products photos) - New: task #10113 : Show list of emailing on clicking on "number of mass emailing received" - New: Add default language for third parties and use it when multilang is enabled to define default language for document generation. - New: Can reopen a closed supplier invoice. +- New: Move permission "see hidden categories" into "see hidden products/services". - Fix: Format number was wrong for ar_AR language. - Fix: Can change password if has only permission change password. For developers: -- More comments in code +- More comments in code. +- Uniformize some code. +- First delete of useless pre.inc.php files. ***** ChangeLog for 2.8 compared to 2.7 ***** diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php index 74c707c5c8e..8f1efd7c3e6 100644 --- a/htdocs/bookmarks/liste.php +++ b/htdocs/bookmarks/liste.php @@ -77,7 +77,8 @@ $sql.= " u.login, u.name, u.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid"; $sql.= " WHERE 1=1"; if (! $user->admin) $sql.= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL OR b.fk_user = 0)"; -$sql.= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit( $limit, $offset); $resql=$db->query($sql); if ($resql) diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php index 63ce58902c7..c09d1a4eb22 100644 --- a/htdocs/comm/bookmark.php +++ b/htdocs/comm/bookmark.php @@ -92,7 +92,8 @@ $sql = "SELECT s.rowid, s.nom, ".$db->pdate("b.dateb")." as dateb, b.rowid as bi $sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE b.fk_soc = s.rowid AND b.fk_user=u.rowid"; if (! $user->admin) $sql.= " AND b.fk_user = ".$user->id; -$sql.= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit( $limit, $offset); $resql=$db->query($sql); if ($resql) diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php index 79177505b38..9cd7c8acca9 100644 --- a/htdocs/comm/clients.php +++ b/htdocs/comm/clients.php @@ -84,7 +84,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $nbtotalofrecords = $db->num_rows($result); } -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index a744cd46157..4bcc433416f 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -119,7 +119,8 @@ if ($_GET["contactname"]) // acces a partir du module de recherche $sortorder = "ASC"; } -$sql.= " ORDER BY $sortfield $sortorder " . $db->plimit($limit+1, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 72aef1079a9..64d35c935a4 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -357,7 +357,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0) if ($search_nom) $sql.= " AND mc.nom like '%".addslashes($search_nom)."%'"; if ($search_prenom) $sql.= " AND mc.prenom like '%".addslashes($search_prenom)."%'"; if ($search_email) $sql.= " AND mc.email like '%".addslashes($search_email)."%'"; - if ($sortfield) { $sql .= " ORDER BY $sortfield $sortorder"; } + $sql .= $db->order($sortfield,$sortorder); $sql .= $db->plimit($conf->liste_limit+1, $offset); $resql=$db->query($sql); diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php index 5303ca2298d..de79ddb4287 100644 --- a/htdocs/comm/mailing/liste.php +++ b/htdocs/comm/mailing/liste.php @@ -72,7 +72,8 @@ if ($filteremail) if ($sall) $sql.= " AND (m.titre like '%".$sall."%' OR m.sujet like '%".$sall."%' OR m.body like '%".$sall."%')"; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="m.rowid"; - $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); + $sql.= $db->order($sortfield,$sortorder); + $sql.= $db->plimit($conf->liste_limit +1, $offset); } else { @@ -83,7 +84,8 @@ else if ($sall) $sql.= " AND (m.titre like '%".$sall."%' OR m.sujet like '%".$sall."%' OR m.body like '%".$sall."%')"; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="m.rowid"; - $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); + $sql.= $db->order($sortfield,$sortorder); + $sql.= $db->plimit($conf->liste_limit +1, $offset); } dol_syslog("sql=".$sql); diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 41393c904ec..8ff69ff1148 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -800,7 +800,7 @@ class Form if ($conf->global->MAIN_USE_JQUERY) { print ajax_autocompleter2('','keysearch',DOL_URL_ROOT.'/product/ajaxproducts.php','&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished,''); - + print '
'; print ''; print ''; @@ -821,7 +821,7 @@ class Form print ajax_updater($htmlname,'keysearch',DOL_URL_ROOT.'/product/ajaxproducts.php','&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished,''); // Indicator is '' to disable it as it is alreay output print ''; print ''; - } + } } else { @@ -844,18 +844,11 @@ class Form global $langs,$conf,$user; $sql = "SELECT "; - if ($conf->categorie->enabled && ! $user->rights->categorie->voir) - { - $sql.="DISTINCT"; - } $sql.= " p.rowid, p.label, p.ref, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.duration, p.stock"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p "; - if ($conf->categorie->enabled && ! $user->rights->categorie->voir) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; - } $sql.= " WHERE p.entity = ".$conf->entity; + if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; + if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; if($finished == 0) { @@ -870,11 +863,6 @@ class Form { $sql.= " AND p.envente = ".$status; } - - if ($conf->categorie->enabled && ! $user->rights->categorie->voir) - { - $sql.= ' AND COALESCE(c.visible,1)=1'; - } if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; if ($ajaxkeysearch && $ajaxkeysearch != '') $sql.=" AND (p.ref like '%".$ajaxkeysearch."%' OR p.label like '%".$ajaxkeysearch."%')"; $sql.= " ORDER BY p.ref"; diff --git a/htdocs/html.formproduct.class.php b/htdocs/html.formproduct.class.php index dd7d47f5108..77ae6cd2ec7 100644 --- a/htdocs/html.formproduct.class.php +++ b/htdocs/html.formproduct.class.php @@ -138,13 +138,6 @@ class FormProduct $measuring_units[-3] = $langs->trans("WeightUnitg"); $measuring_units[-6] = $langs->trans("WeightUnitmg"); } - else if ($measuring_style == 'volume') - { - $measuring_units[0] = $langs->trans("VolumeUnitm3"); - $measuring_units[-3] = $langs->trans("VolumeUnitdm3"); - $measuring_units[-6] = $langs->trans("VolumeUnitcm3"); - $measuring_units[-9] = $langs->trans("VolumeUnitmm3"); - } else if ($measuring_style == 'size') { $measuring_units[0] = $langs->trans("SizeUnitm"); @@ -152,6 +145,20 @@ class FormProduct $measuring_units[-2] = $langs->trans("SizeUnitcm"); $measuring_units[-3] = $langs->trans("SizeUnitmm"); } + else if ($measuring_style == 'surface') + { + $measuring_units[0] = $langs->trans("SurfaceUnitm2"); + $measuring_units[-2] = $langs->trans("SurfaceUnitdm2"); + $measuring_units[-4] = $langs->trans("SurfaceUnitcm2"); + $measuring_units[-6] = $langs->trans("SurfaceUnitmm2"); + } + else if ($measuring_style == 'volume') + { + $measuring_units[0] = $langs->trans("VolumeUnitm3"); + $measuring_units[-3] = $langs->trans("VolumeUnitdm3"); + $measuring_units[-6] = $langs->trans("VolumeUnitcm3"); + $measuring_units[-9] = $langs->trans("VolumeUnitmm3"); + } print ''; + print ''.$langs->trans("Ref").''; if ($_error == 1) { print $langs->trans("RefAlreadyExists"); @@ -629,7 +644,7 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ print ''; // Label - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; // Status print ''.$langs->trans("Status").''; @@ -641,7 +656,7 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ if ($_GET["type"] != 1 && $conf->stock->enabled) { print ''.$langs->trans("StockLimit").''; - print ''; + print ''; print ''; } else @@ -655,12 +670,13 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('desc','',160,'dolibarr_notes','',false); + $doleditor=new DolEditor('desc',$_POST["desc"],160,'dolibarr_notes','',false); $doleditor->Create(); } else { print ''; } @@ -687,31 +703,51 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ print ''; } - // Weight - Volume - if ($_GET["type"] != 1) + if ($_GET["type"] != 1) // Le poids et le volume ne concerne que les produits et pas les services { - // Le poids et le volume ne concerne que les produits et pas les services + // Weight print ''.$langs->trans("Weight").''; - print ''; + print ''; print $formproduct->select_measuring_units("weight_units","weight"); print ''; + // Length + print ''.$langs->trans("Length").''; + print ''; + print $formproduct->select_measuring_units("size_units","size"); + print ''; + // Surface + print ''.$langs->trans("Surface").''; + print ''; + print $formproduct->select_measuring_units("surface_units","surface"); + print ''; + // Volume print ''.$langs->trans("Volume").''; - print ''; + print ''; print $formproduct->select_measuring_units("volume_units","volume"); print ''; } + // Hidden + if (($_GET["type"] != 1 && $user->rights->produit->hidden) + || ($_GET["type"] == 1 && $user->rights->service->hidden)) + { + print ''.$langs->trans("Hidden").''; + print $html->selectyesno($product->hidden); + print ''; + } + // Note (invisible sur facture, propales...) print ''.$langs->trans("NoteNotVisibleOnBill").''; if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note','',180,'dolibarr_notes','',false); + $doleditor=new DolEditor('note',$_POST["note"],180,'dolibarr_notes','',false); $doleditor->Create(); } else { print ''; } print ""; @@ -719,14 +755,15 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ print '
'; - print ''; - if($conf->global->PRODUIT_MULTIPRICES) + if ($conf->global->PRODUIT_MULTIPRICES) { // We do no show price array on create when multiprices enabled. // We must set them on prices tab. } else { + print '
'; + // PRIX print ''; print ''; + + print '
'.$langs->trans("SellingPrice").''; @@ -742,22 +779,20 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ print '
'.$langs->trans("VATRate").''; print $html->select_tva("tva_tx",$conf->defaulttx,$mysoc,''); print '
'; + + print '
'; } - print ''; - - print '
'; - print '
'; print ''; } else { - //RODO // On assigne les valeurs meme en creation car elles sont definies si // on revient en erreur - // $smarty->template_dir = DOL_DOCUMENT_ROOT.'/product/templates/'.$_GET["canvas"].'/'; $tvaarray = load_tva($db,"tva_tx",$conf->defaulttx,$mysoc,''); $smarty->assign('tva_taux_value', $tvaarray['value']); @@ -1016,7 +1051,7 @@ if ($_GET["id"] || $_GET["ref"]) } else { - // Weight / Volume + // Weight print ''.$langs->trans("Weight").''; if ($product->weight != '') { @@ -1027,7 +1062,29 @@ if ($_GET["id"] || $_GET["ref"]) print ' '; } print "\n"; - + // Length + print ''.$langs->trans("Length").''; + if ($product->length != '') + { + print $product->length." ".measuring_units_string($product->length_units,"size"); + } + else + { + print ' '; + } + print "\n"; + // Surface + print ''.$langs->trans("Surface").''; + if ($product->surface != '') + { + print $product->surface." ".measuring_units_string($product->surface_units,"surface"); + } + else + { + print ' '; + } + print "\n"; + // Volume print ''.$langs->trans("Volume").''; if ($product->volume != '') { @@ -1040,6 +1097,15 @@ if ($_GET["id"] || $_GET["ref"]) print "\n"; } + // Hidden + if ((! $product->isservice() && $user->rights->produit->hidden) + || ($product->isservice() && $user->rights->service->hidden)) + { + print ''.$langs->trans("Hidden").''; + print yn($product->hidden); + print "\n"; + } + // Note print ''.$langs->trans("Note").''.nl2br($product->note).''; @@ -1148,18 +1214,37 @@ if ($_GET["id"] || $_GET["ref"]) } else { - // Weight / Volume + // Weight print ''.$langs->trans("Weight").''; print ' '; print $formproduct->select_measuring_units("weight_units", "weight", $product->weight_units); print ''; - + // Length + print ''.$langs->trans("Length").''; + print ' '; + print $formproduct->select_measuring_units("size_units", "size", $product->length_units); + print ''; + // Surface + print ''.$langs->trans("Surface").''; + print ' '; + print $formproduct->select_measuring_units("surface_units", "surface", $product->surface_units); + print ''; + // Volume print ''.$langs->trans("Volume").''; print ' '; print $formproduct->select_measuring_units("volume_units", "volume", $product->volume_units); print ''; } + // Hidden + if ((! $product->isservice() && $user->rights->produit->hidden) + || ($product->isservice() && $user->rights->service->hidden)) + { + print ''.$langs->trans("Hidden").''; + print $html->selectyesno('hidden',$product->hidden); + print ''; + } + // Note print ''.$langs->trans("NoteNotVisibleOnBill").''; if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) @@ -1175,10 +1260,13 @@ if ($_GET["id"] || $_GET["ref"]) print ""; } print ""; - - print ' '; - print ''; print ''; + + print '
'; + + print '
    '; + print '
'; + print ''; print "\n"; } @@ -1233,22 +1321,6 @@ if ($_GET["action"] == '') print ''.$langs->trans("ToClone").''; } - /* - if ($product->isproduct() && $user->rights->commande->creer) - { - $langs->load('orders'); - print ''; - print $langs->trans("CreateCustomerOrder").''; - } - - if ($product->isproduct() && $user->rights->fournisseur->commande->creer) - { - $langs->load('orders'); - print ''; - print $langs->trans("CreateSupplierOrder").''; - } - */ - $product_is_used = $product->verif_prod_use($product->id); if ($user->rights->produit->supprimer) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index e419c443ee1..87510889cf9 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -365,7 +365,7 @@ if ($_GET["id"] || $_GET["ref"]) $sql.= " WHERE pf.fk_soc = s.rowid"; $sql.= " AND s.entity = ".$conf->entity; $sql.= " AND pf.fk_product = ".$product->id; - $sql.= " ORDER BY lower(s.nom), pfp.quantity"; + $sql.= " ORDER BY s.nom, pfp.quantity"; $resql=""; $resql=$db->query($sql); diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 9f6fd278662..dd0c73aa38e 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -165,15 +165,12 @@ $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_subproduct as sp ON p.rowid = sp.fk_product_subproduct"; $sql.= " WHERE sp.fk_product_subproduct IS NULL"; $sql.= " AND p.entity = ".$conf->entity; -/*if ($conf->categorie->enabled && !$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.= " AND COALESCE(c.visible,1)=1 "; -}*/ +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; if ($type != '') $sql.= " AND p.fk_product_type = ".$type; $sql.= $db->order("p.tms","DESC"); $sql.= $db->plimit($max,0); + //print $sql; $result = $db->query($sql) ; if ($result) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index e82ca753a7d..2a1fda48663 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -104,11 +104,6 @@ $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc $sql.= ' p.fk_product_type, 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"; -} if ($_GET["fourn_id"] > 0) { @@ -116,6 +111,8 @@ if ($_GET["fourn_id"] > 0) $sql.= ", ".MAIN_DB_PREFIX."product_fournisseur as pf"; } $sql.= " WHERE p.entity = ".$conf->entity; +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 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)."%')"; @@ -144,10 +141,6 @@ if($catid) { $sql.= " AND cp.fk_categorie = ".$catid; } -if ($conf->categorie->enabled && !$user->rights->categorie->voir) -{ - $sql.= ' AND COALESCE(c.visible,1)=1'; -} if ($fourn_id > 0) { $sql.= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id; diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 805bd0b11f1..87e9f9d8e8d 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -73,7 +73,7 @@ if (isset($_GET['type'])) $param = '&type='.$_GET['type']; $title = $langs->trans("ListProductByPopularity"); if ($_GET['type'] == 1) $title = $langs->trans("ListServiceByPopularity"); -} +} print_barre_liste($title, $page, "popuprop.php",$param,"","","",$num); @@ -90,21 +90,14 @@ print "\n"; $sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type as type, count(*) as c"; $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; -if ($conf->categorie->enabled && !$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.= " WHERE p.rowid = pd.fk_product"; $sql.= " AND p.entity = ".$conf->entity; +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; if (isset($_GET['type'])) $sql.= " AND fk_product_type = ".$_GET['type']; -if ($conf->categorie->enabled && !$user->rights->categorie->voir) -{ - $sql.= ' AND COALESCE(c.visible,1)=1'; -} $sql.= " GROUP BY (p.rowid)"; -$sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit( $limit ,$offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit ,$offset); $result=$db->query($sql) ; if ($result) @@ -125,7 +118,7 @@ if ($result) $sql.= " WHERE fk_product=".$objp->rowid; $sql.= " AND lang='". $langs->getDefaultLang() ."'"; $sql.= " LIMIT 1"; - + $resultp = $db->query($sql); if ($resultp) { diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index eb5c2254157..e2bf5d018ad 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -78,11 +78,6 @@ $sql.= ' p.duration, p.envente as statut, p.seuil_stock_alerte,'; $sql.= ' SUM(s.reel) as stock_physique'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product_stock as s,'; $sql.= ' '.MAIN_DB_PREFIX.'product as p'; -if ($catid || ($conf->categorie->enabled && ! $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"; -} if ($_GET["fourn_id"] > 0) { @@ -91,6 +86,8 @@ if ($_GET["fourn_id"] > 0) } $sql.= " WHERE p.rowid = s.fk_product"; $sql.= " AND p.entity = ".$conf->entity; +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 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)."%')"; @@ -119,16 +116,12 @@ if($catid) { $sql.= " AND cp.fk_categorie = ".$catid; } -if ($conf->categorie->enabled && !$user->rights->categorie->voir) -{ - $sql.= ' AND COALESCE(c.visible,1)=1'; -} if ($fourn_id > 0) { $sql.= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id; } $sql.= " GROUP BY p.rowid"; -$sql.= " ORDER BY $sortfield $sortorder "; +$sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1 ,$offset); $resql = $db->query($sql) ; @@ -237,7 +230,7 @@ if ($resql) $sql.= " WHERE fk_product=".$objp->rowid; $sql.= " AND lang='". $langs->getDefaultLang() ."'"; $sql.= " LIMIT 1"; - + $result = $db->query($sql); if ($result) { diff --git a/htdocs/product/stats/index.php b/htdocs/product/stats/index.php index 5b04d0a50b7..c15d6d97086 100644 --- a/htdocs/product/stats/index.php +++ b/htdocs/product/stats/index.php @@ -41,14 +41,10 @@ $mesg = ''; */ $sql = "SELECT count(*)"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; -if ($conf->categorie->enabled && !$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.= " WHERE p.fk_product_type <> 1"; +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; $sql.= " AND p.entity = ".$conf->entity; -if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= ' AND COALESCE(c.visible,1)=1'; if ($db->query($sql)) { @@ -60,15 +56,11 @@ $db->free(); $sql = "SELECT count(*)"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; -if ($conf->categorie->enabled && !$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.= " WHERE p.envente = 0"; +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; $sql.= " AND p.fk_product_type <> '1'"; $sql.= " AND p.entity = ".$conf->entity; -if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= ' AND COALESCE(c.visible,1)=1'; if ($db->query($sql)) { @@ -77,14 +69,18 @@ if ($db->query($sql)) } $db->free(); -if ($conf->service->enabled) +if ($conf->produit->enabled && $conf->service->enabled) { print_fiche_titre($langs->trans("ProductsAndServicesStatistics"), $mesg); } -else +elseif ($conf->produit->enabled) { print_fiche_titre($langs->trans("ProductsStatistics"), $mesg); } +elseif ($conf->service->enabled) +{ + print_fiche_titre($langs->trans("ServicesStatistics"), $mesg); +} print '
'; print ''; @@ -106,14 +102,10 @@ if ($conf->service->enabled) { $sql = "SELECT count(*)"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->categorie->enabled && !$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.= " WHERE p.fk_product_type = '1'"; + if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; + if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; $sql.= " AND p.entity = ".$conf->entity; - if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= ' AND COALESCE(c.visible,1)=1'; if ($db->query($sql)) { @@ -124,15 +116,11 @@ if ($conf->service->enabled) $sql = "SELECT count(*)"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->categorie->enabled && !$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.= " WHERE p.envente = 0"; + if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; + if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; $sql.= " AND p.fk_product_type = '1'"; $sql.= " AND p.entity = ".$conf->entity; - if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= ' AND COALESCE(c.visible,1)=1'; if ($db->query($sql)) { diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php index f14c9c3977f..d2fcf8c779f 100644 --- a/htdocs/product/stock/entrepot.class.php +++ b/htdocs/product/stock/entrepot.class.php @@ -357,17 +357,10 @@ class Entrepot extends CommonObject $ret=array(); $sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * ps.pmp) as value"; - $sql .= " FROM llx_product_stock as ps"; - if ($conf->categorie->enabled && !$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 .= " WHERE ps.fk_entrepot = ".$this->id; - if ($conf->categorie->enabled && !$user->rights->categorie->voir) - { - $sql.= ' AND COALESCE(c.visible,1)=1'; - } + $sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p"; + $sql .= " WHERE ps.fk_entrepot = ".$this->id." AND ps.fk_product=p.rowid"; + if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; + if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; //print $sql; $result = $this->db->query($sql) ; diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index f01aa23cdb4..f1fde37d2e1 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -65,7 +65,7 @@ if ($_POST["action"] == 'add' && $user->rights->stock->creer) if ($entrepot->libelle) { $id = $entrepot->create($user); - if ($id > 0) + if ($id > 0) { header("Location: fiche.php?id=".$id); exit; @@ -89,7 +89,7 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && if ($result > 0) { header("Location: ".DOL_URL_ROOT.'/product/stock/liste.php'); - exit; + exit; } else { @@ -241,7 +241,7 @@ else $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$entrepot->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$entrepot->libelle),"confirm_delete",'',0,2); if ($ret == 'html') print '
'; } - + print '
'; // Ref @@ -355,18 +355,11 @@ else $sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.fk_product_type as type,"; $sql.= " ps.pmp, ps.reel as value"; $sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p"; - if ($conf->categorie->enabled && !$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 .= " WHERE ps.fk_product = p.rowid"; $sql .= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) $sql .= " AND ps.fk_entrepot = ".$entrepot->id; - if ($conf->categorie->enabled && !$user->rights->categorie->voir) - { - $sql.= ' AND COALESCE(c.visible,1)=1'; - } + if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; + if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; $sql.= " ORDER BY " . $sortfield . " " . $sortorder; //$sql .= $db->plimit($limit + 1 ,$offset); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 8962840f0dc..4085a3f42e0 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -114,18 +114,11 @@ $sql.= " m.value, ".$db->pdate("m.datem")." as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as s"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; -if ($conf->categorie->enabled && !$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.= " WHERE m.fk_product = p.rowid"; $sql.= " AND m.fk_entrepot = s.rowid"; $sql.= " AND s.entity = ".$conf->entity; -if ($conf->categorie->enabled && !$user->rights->categorie->voir) -{ - $sql.= " AND COALESCE(c.visible,1)=1"; -} +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; $sql.= " ORDER BY datem DESC"; $sql.= $db->plimit($max,0); diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index abc6f3532d5..463a228a566 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -82,22 +82,15 @@ $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as s,"; $sql.= " ".MAIN_DB_PREFIX."stock_mouvement as m,"; $sql.= " ".MAIN_DB_PREFIX."product as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON p.fk_user_author = u.rowid"; -if ($conf->categorie->enabled && !$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.= " WHERE m.fk_product = p.rowid"; $sql.= " AND m.fk_entrepot = s.rowid"; $sql.= " AND s.entity = ".$conf->entity; +if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; +if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; if ($_GET["id"]) { $sql.= " AND s.rowid ='".$_GET["id"]."'"; } -if ($conf->categorie->enabled && !$user->rights->categorie->voir) -{ - $sql.= " AND COALESCE(c.visible,1)=1"; -} if ($month > 0) { if ($year > 0) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 18117b0be3e..f679342739d 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -407,7 +407,7 @@ $sql.= " WHERE ps.reel != 0"; $sql.= " AND ps.fk_entrepot = e.rowid"; $sql.= " AND e.entity = ".$conf->entity; $sql.= " AND ps.fk_product = ".$product->id; -$sql.= " ORDER BY lower(e.label)"; +$sql.= " ORDER BY e.label"; $entrepotstatic=new Entrepot($db); $total=0; diff --git a/htdocs/product/stock/user.php b/htdocs/product/stock/user.php index 1c4c84f143f..2223a79caea 100644 --- a/htdocs/product/stock/user.php +++ b/htdocs/product/stock/user.php @@ -141,7 +141,7 @@ if ($_GET["id"]) $sql .= " WHERE ue.fk_user = u.rowid "; $sql .= " AND ue.fk_entrepot = ".$entrepot->id; - //$sql .= " ORDER BY " . $sortfield . " " . $sortorder; + //$sql .= $db->order($sortfield,$sortorder); //$sql .= $db->plimit($limit + 1 ,$offset); $resql = $db->query($sql) ; diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index d277865f291..2143087dffe 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -93,7 +93,8 @@ if ($_GET["search_societe"]) { $sql.= " AND s.nom LIKE '%".addslashes($_GET["search_societe"])."%'"; } -$sql.= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($conf->liste_limit+1, $offset); $var=true; $resql = $db->query($sql); diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index d8c9c9db704..bc2da6b0a20 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -85,8 +85,8 @@ $sql = "SELECT rowid, prenom, nom, societe, cp, ville, email, naiss, photo"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent"; $sql.= " WHERE statut = 1"; $sql.= " AND public = 1"; -$sql.= " ORDER BY $sortfield $sortorder"; -$sql.= " ".$db->plimit($conf->liste_limit+1, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($conf->liste_limit+1, $offset); //$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, cp, ville, d.email, t.libelle as type, d.morphy, d.statut, t.cotisation"; //$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; //$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = $statut"; diff --git a/htdocs/service.class.php b/htdocs/service.class.php index 427ded52595..87b1df12081 100644 --- a/htdocs/service.class.php +++ b/htdocs/service.class.php @@ -23,13 +23,14 @@ * \brief Fichier de la classe des services predefinis * \version $Id$ */ +require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php"); /** * \class Service * \brief Classe permettant la gestion des services predefinis */ -class Service +class Service extends CommonObject { var $db; @@ -64,17 +65,11 @@ class Service $sql = "SELECT count(p.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->categorie->enabled && !$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.= " WHERE p.fk_product_type = 1"; $sql.= " AND p.entity = ".$conf->entity; - if ($conf->categorie->enabled && !$user->rights->categorie->voir) - { - $sql.= " AND COALESCE(c.visible,1)=1"; - } + if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; + if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; + $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/societe/ajaxcountries.php b/htdocs/societe/ajaxcountries.php index f4d079eb023..0dbb41f58db 100644 --- a/htdocs/societe/ajaxcountries.php +++ b/htdocs/societe/ajaxcountries.php @@ -44,7 +44,7 @@ if(isset($_POST['pays']) && !empty($_POST['pays'])) $sql = "SELECT rowid, code, libelle, active"; $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " WHERE active = 1 AND libelle LIKE '%" . utf8_decode($_POST['pays']) . "%'"; - $sql.= " ORDER BY libelle ASC;"; + $sql.= " ORDER BY libelle ASC"; $resql=$db->query($sql); if ($resql) diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php index 391d8f3643c..b87a7a0beb6 100644 --- a/htdocs/societe/lien.php +++ b/htdocs/societe/lien.php @@ -189,7 +189,8 @@ if($_GET["socid"]) { $sql .= " AND s.nom LIKE '%".$_GET["search_nom"]."%'"; } - $sql .= " ORDER BY s.nom ASC " . $db->plimit($conf->liste_limit+1, $offset); + $sql.= $db->order("s.nom","ASC"); + $sql.= $db->plimit($conf->liste_limit+1, $offset); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index ef3878f2f27..802f7759cd0 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -66,7 +66,8 @@ if ($socid > 0) { $sql .= " AND s.rowid = " . $user->societe_id; } -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); +$sql .= $db->order($sortfield,$sortorder); +$sql .= $db->plimit($conf->liste_limit, $offset); $result = $db->query($sql); if ($result) diff --git a/htdocs/webcal/webcal.class.php b/htdocs/webcal/webcal.class.php index 3910e4dd88e..34234738f53 100644 --- a/htdocs/webcal/webcal.class.php +++ b/htdocs/webcal/webcal.class.php @@ -221,7 +221,7 @@ class Webcal { $sql.= " cal_date, cal_time, cal_mod_date,"; $sql.= " cal_mod_time, cal_duration, cal_priority, cal_type, cal_access, cal_name, cal_description"; $sql.= " FROM webcal_entry"; - $sql.= " order by cal_date"; + $sql.= " ORDER BY cal_date"; dol_syslog("Webcal::build_vcal select events sql=".$sql); $resql=$this->localdb->query($sql); diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index c5ab386bc4c..ec8f9ca807d 100644 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -98,7 +98,7 @@ $countries=array(); $sql = "SELECT rowid, code, libelle, active"; $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " WHERE active = 1"; -$sql.= " ORDER BY code ASC;"; +$sql.= " ORDER BY code ASC"; $resql=$db->query($sql); if ($resql) {