diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php
index 5e57da5a39f..22e09339f3f 100644
--- a/htdocs/admin/tools/eaccelerator.php
+++ b/htdocs/admin/tools/eaccelerator.php
@@ -27,19 +27,19 @@ require("../../main.inc.php");
$langs->load("admin");
if (!$user->admin)
- accessforbidden();
+accessforbidden();
/*
-* View
-*/
+ * View
+ */
llxHeader();
if (!function_exists('eaccelerator_info'))
{
- print 'eAccelerator is not installed.';
+ print 'eAccelerator is not installed.';
llxfooter('$Date$ - $Revision$');
exit;
}
@@ -47,23 +47,23 @@ if (!function_exists('eaccelerator_info'))
$info = eaccelerator_info();
if (isset($_POST['caching'])) {
- if ($info['cache']) {
- eaccelerator_caching(false);
- } else {
- eaccelerator_caching(true);
- }
+ if ($info['cache']) {
+ eaccelerator_caching(false);
+ } else {
+ eaccelerator_caching(true);
+ }
} else if (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
- if ($info['optimizer']) {
- eaccelerator_optimizer(false);
- } else {
- eaccelerator_optimizer(true);
- }
+ if ($info['optimizer']) {
+ eaccelerator_optimizer(false);
+ } else {
+ eaccelerator_optimizer(true);
+ }
} else if (isset($_POST['clear'])) {
- eaccelerator_clear();
+ eaccelerator_clear();
} else if (isset($_POST['clean'])) {
- eaccelerator_clean();
+ eaccelerator_clean();
} else if (isset($_POST['purge'])) {
- eaccelerator_purge();
+ eaccelerator_purge();
}
$info = eaccelerator_info();
if (!is_array($info)) {
@@ -75,31 +75,31 @@ if (!is_array($info)) {
function compare($x, $y)
{
- global $sortby;
+ global $sortby;
- if ( $x[$sortby] == $y[$sortby] )
- return 0;
- else if ( $x[$sortby] < $y[$sortby] )
- return -1;
- else
- return 1;
+ if ( $x[$sortby] == $y[$sortby] )
+ return 0;
+ else if ( $x[$sortby] < $y[$sortby] )
+ return -1;
+ else
+ return 1;
}
function revcompare($x, $y)
{
- global $sortby, $langs;
+ global $sortby, $langs;
- if ( $x[$sortby] == $y[$sortby] )
- return 0;
- else if ( $x[$sortby] < $y[$sortby] )
- return 1;
- else
- return -1;
+ if ( $x[$sortby] == $y[$sortby] )
+ return 0;
+ else if ( $x[$sortby] < $y[$sortby] )
+ return 1;
+ else
+ return -1;
}
- function create_script_table($list)
+function create_script_table($list)
{
global $sortby,$bc,$langs;
$var=true;
@@ -112,54 +112,60 @@ function revcompare($x, $y)
if (isset($_GET['sort'])) {
switch ($_GET['sort']) {
- case "mtime":
- case "size":
- case "reloads":
- case "hits":
- $sortby = $_GET['sort'];
- ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
- break;
- default:
- $sortby = "file";
- ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
+ case "mtime":
+ case "size":
+ case "reloads":
+ case "hits":
+ $sortby = $_GET['sort'];
+ ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
+ break;
+ default:
+ $sortby = "file";
+ ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
}
}
?>
-
-
+ >
+ |
+ |
+
+ KB |
+ () |
+ |
+
+
+
+
-
-
- | Name |
- Created |
- trans("Size"); ?> |
- ttl |
-
-
- >
- |
- |
- KB |
- |
-
-
-
-
+
+
+ | Name |
+ Created |
+ trans("Size"); ?> |
+ ttl |
+
+
+ >
+ |
+ |
+
+ KB |
+ |
+
+
+
+
-| Information |
->
- | Caching enabled |
- |
-
->
- | Optimizer enabled |
- |
-
->
- | Memory usage |
- %
- ( MB /
- MB) |
-
->
- | Free memory in reserved cache |
- MB |
-
->
- | Cached scripts |
- |
-
->
- | Removed scripts |
- |
-
->
- | Cached keys |
- |
-
+
+ | Information |
+
+ >
+ | Caching enabled |
+ |
+
+ >
+ | Optimizer enabled |
+ |
+
+ >
+ | Memory usage |
+ %
+ (
+ MB /
+ MB) |
+
+ >
+ | Free memory in reserved cache |
+ MB |
+
+ >
+ | Cached scripts |
+ |
+
+ >
+ | Removed scripts |
+ |
+
+ >
+ | Cached keys |
+ |
+
';
print '";
}
-
- if (is_array($resCached))
- {
- print "
";
- print "Cached scripts
";
- create_script_table($resCached);
- }
-
- if (is_array($resRemoved))
- {
- print "
";
- print "Removed scripts
";
- create_script_table($resRemoved);
- }
+
+ if (is_array($resCached))
+ {
+ print "
";
+ print "Cached scripts
";
+ create_script_table($resCached);
+ }
+
+ if (is_array($resRemoved))
+ {
+ print "
";
+ print "Removed scripts
";
+ create_script_table($resRemoved);
+ }
}
else
{
@@ -318,7 +328,7 @@ if (function_exists('eaccelerator_get'))
{
print '
';
print 'Cached keys
';
- $res=eaccelerator_list_keys();
+ $res=eaccelerator_list_keys();
create_key_table($res);
}
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 8ff69ff1148..c7d62c68278 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -841,14 +841,14 @@ class Form
*/
function select_produits_do($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$ajaxkeysearch='',$status=1,$finished=2)
{
- global $langs,$conf,$user;
+ global $langs,$conf,$user,$db;
$sql = "SELECT ";
$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 ";
$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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+ if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
if($finished == 0)
{
@@ -865,8 +865,8 @@ class Form
}
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";
- if ($limit) $sql.= " LIMIT $limit";
+ $sql.= $db->order("p.ref");
+ $sql.= $db->plimit($limit);
dol_syslog("Form::select_produits_do sql=".$sql, LOG_DEBUG);
$result=$this->db->query($sql);
diff --git a/htdocs/includes/boxes/box_produits.php b/htdocs/includes/boxes/box_produits.php
index 42f0170d3da..5a123603823 100644
--- a/htdocs/includes/boxes/box_produits.php
+++ b/htdocs/includes/boxes/box_produits.php
@@ -74,8 +74,8 @@ class box_produits extends ModeleBoxes {
$sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.envente";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+ if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
$sql.= $db->order('p.datec', 'DESC');
diff --git a/htdocs/includes/boxes/box_services_vendus.php b/htdocs/includes/boxes/box_services_vendus.php
index e770a10439d..2add8d16db2 100644
--- a/htdocs/includes/boxes/box_services_vendus.php
+++ b/htdocs/includes/boxes/box_services_vendus.php
@@ -81,8 +81,8 @@ class box_services_vendus extends ModeleBoxes {
$sql.= ")";
$sql.= " WHERE s.rowid = c.fk_soc";
$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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+ if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND c.rowid = cd.fk_contrat";
$sql.= " AND cd.fk_product = p.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
diff --git a/htdocs/product.class.php b/htdocs/product.class.php
index b7861292be7..1563a9bc253 100644
--- a/htdocs/product.class.php
+++ b/htdocs/product.class.php
@@ -2677,8 +2677,8 @@ class Product extends CommonObject
$sql = "SELECT count(p.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$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)';
+ if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+ if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND p.entity = ".$conf->entity;
$resql=$this->db->query($sql);
diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index 31ed7fcd84a..281c690677c 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -127,6 +127,7 @@ if ($_POST["action"] == 'add' && ($user->rights->produit->creer || $user->rights
$product->volume_units = $_POST["volume_units"];
$product->finished = $_POST["finished"];
$product->hidden = $_POST["hidden"]=='yes'?1:0;
+
// MultiPrix
if($conf->global->PRODUIT_MULTIPRICES)
{
@@ -732,7 +733,13 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ
|| ($_GET["type"] == 1 && $user->rights->service->hidden))
{
print '| '.$langs->trans("Hidden").' | ';
- print $html->selectyesno($product->hidden);
+ print $html->selectyesno('hidden',$product->hidden);
+ print ' |
';
+ }
+ else
+ {
+ print '| '.$langs->trans("Hidden").' | ';
+ print yn("No");
print ' |
';
}
@@ -1105,6 +1112,12 @@ if ($_GET["id"] || $_GET["ref"])
print yn($product->hidden);
print "\n";
}
+ else
+ {
+ print '| '.$langs->trans("Hidden").' | ';
+ print yn("No");
+ print ' |
';
+ }
// Note
print '| '.$langs->trans("Note").' | '.nl2br($product->note).' |
';
@@ -1244,6 +1257,12 @@ if ($_GET["id"] || $_GET["ref"])
print $html->selectyesno('hidden',$product->hidden);
print '';
}
+ else
+ {
+ print '| '.$langs->trans("Hidden").' | ';
+ print yn("No");
+ print ' |
';
+ }
// Note
print '| '.$langs->trans("NoteNotVisibleOnBill").' | ';
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index dd0c73aa38e..0b82e05bb59 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -165,8 +165,8 @@ $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 (!$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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+if (!$user->rights->service->hidden) $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);
diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php
index 2a1fda48663..ab067f5ccaa 100644
--- a/htdocs/product/liste.php
+++ b/htdocs/product/liste.php
@@ -111,8 +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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+if (!$user->rights->service->hidden) $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)."%')";
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index 87e9f9d8e8d..9ef1ca4ccb4 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -92,8 +92,8 @@ $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd";
$sql.= ", ".MAIN_DB_PREFIX."product as p";
$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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
if (isset($_GET['type'])) $sql.= " AND fk_product_type = ".$_GET['type'];
$sql.= " GROUP BY (p.rowid)";
$sql.= $db->order($sortfield,$sortorder);
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index e2bf5d018ad..c42b0912452 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -86,8 +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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+if (!$user->rights->service->hidden) $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)."%')";
diff --git a/htdocs/product/stats/index.php b/htdocs/product/stats/index.php
index c15d6d97086..ae4b6ad9a69 100644
--- a/htdocs/product/stats/index.php
+++ b/htdocs/product/stats/index.php
@@ -42,8 +42,8 @@ $mesg = '';
$sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$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)';
+if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND p.entity = ".$conf->entity;
if ($db->query($sql))
@@ -57,8 +57,8 @@ $db->free();
$sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$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)';
+if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND p.fk_product_type <> '1'";
$sql.= " AND p.entity = ".$conf->entity;
@@ -103,8 +103,8 @@ if ($conf->service->enabled)
$sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$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)';
+ if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+ if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND p.entity = ".$conf->entity;
if ($db->query($sql))
@@ -117,8 +117,8 @@ if ($conf->service->enabled)
$sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$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)';
+ if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+ if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND p.fk_product_type = '1'";
$sql.= " AND p.entity = ".$conf->entity;
diff --git a/htdocs/service.class.php b/htdocs/service.class.php
index 87b1df12081..8ffd02a199c 100644
--- a/htdocs/service.class.php
+++ b/htdocs/service.class.php
@@ -67,8 +67,8 @@ class Service extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.fk_product_type = 1";
$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 (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+ if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$resql=$this->db->query($sql);
if ($resql)
|