Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
ab094f4a
Commit
ab094f4a
authored
19 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Affiche le libellé du type de produit dans page produit
parent
c9b12560
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/product/index.php
+15
-14
15 additions, 14 deletions
htdocs/product/index.php
htdocs/product/popuprop.php
+24
-29
24 additions, 29 deletions
htdocs/product/popuprop.php
with
39 additions
and
43 deletions
htdocs/product/index.php
+
15
−
14
View file @
ab094f4a
...
@@ -28,10 +28,13 @@
...
@@ -28,10 +28,13 @@
*/
*/
require
(
"./pre.inc.php"
);
require
(
"./pre.inc.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/product.class.php'
);
if
(
!
$user
->
rights
->
produit
->
lire
)
if
(
!
$user
->
rights
->
produit
->
lire
)
accessforbidden
();
accessforbidden
();
$staticproduct
=
new
Product
(
$db
);
/*
/*
* Affichage page accueil
* Affichage page accueil
...
@@ -70,13 +73,14 @@ $prodser = array();
...
@@ -70,13 +73,14 @@ $prodser = array();
$prodser
[
0
][
0
]
=
$prodser
[
0
][
1
]
=
$prodser
[
1
][
0
]
=
$prodser
[
1
][
1
]
=
0
;
$prodser
[
0
][
0
]
=
$prodser
[
0
][
1
]
=
$prodser
[
1
][
0
]
=
$prodser
[
1
][
1
]
=
0
;
$sql
=
"SELECT count(*), fk_product_type, envente FROM "
.
MAIN_DB_PREFIX
.
"product as p GROUP BY fk_product_type, envente"
;
$sql
=
"SELECT count(*), fk_product_type, envente FROM "
.
MAIN_DB_PREFIX
.
"product as p GROUP BY fk_product_type, envente"
;
if
(
$db
->
query
(
$sql
))
$result
=
$db
->
query
(
$sql
);
if
(
$result
)
{
{
$num
=
$db
->
num_rows
();
$num
=
$db
->
num_rows
(
$result
);
$i
=
0
;
$i
=
0
;
while
(
$i
<
$num
)
while
(
$i
<
$num
)
{
{
$row
=
$db
->
fetch_row
(
$
i
);
$row
=
$db
->
fetch_row
(
$
result
);
$prodser
[
$row
[
1
]][
$row
[
2
]]
=
$row
[
0
];
$prodser
[
$row
[
1
]][
$row
[
2
]]
=
$row
[
0
];
$i
++
;
$i
++
;
}
}
...
@@ -120,13 +124,10 @@ $result = $db->query($sql) ;
...
@@ -120,13 +124,10 @@ $result = $db->query($sql) ;
if
(
$result
)
if
(
$result
)
{
{
$num
=
$db
->
num_rows
();
$num
=
$db
->
num_rows
(
$result
);
$i
=
0
;
$i
=
0
;
$typeprodser
[
0
]
=
$langs
->
trans
(
"Product"
);
$typeprodser
[
1
]
=
$langs
->
trans
(
"Service"
);
if
(
$num
>
0
)
if
(
$num
>
0
)
{
{
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
...
@@ -136,7 +137,7 @@ if ($result)
...
@@ -136,7 +137,7 @@ if ($result)
$var
=
True
;
$var
=
True
;
while
(
$i
<
$num
)
while
(
$i
<
$num
)
{
{
$objp
=
$db
->
fetch_object
(
$i
);
$objp
=
$db
->
fetch_object
(
$result
);
$var
=!
$var
;
$var
=!
$var
;
print
"<tr
$bc[$var]
>"
;
print
"<tr
$bc[$var]
>"
;
print
'<td nowrap="nowrap"><a href="fiche.php?id='
.
$objp
->
rowid
.
'">'
;
print
'<td nowrap="nowrap"><a href="fiche.php?id='
.
$objp
->
rowid
.
'">'
;
...
@@ -144,7 +145,7 @@ if ($result)
...
@@ -144,7 +145,7 @@ if ($result)
else
print
img_object
(
$langs
->
trans
(
"ShowProduct"
),
"product"
);
else
print
img_object
(
$langs
->
trans
(
"ShowProduct"
),
"product"
);
print
"</a> <a href=
\"
fiche.php?id=
$objp->rowid
\"
>
$objp->ref
</a></td>
\n
"
;
print
"</a> <a href=
\"
fiche.php?id=
$objp->rowid
\"
>
$objp->ref
</a></td>
\n
"
;
print
"<td>
$objp->label
</td>"
;
print
"<td>
$objp->label
</td>"
;
print
"<td>"
.
$typeprodser
[
$objp
->
fk_product_type
]
.
"</td>"
;
print
"<td>"
.
$
staticproduct
->
typeprodser
[
$objp
->
fk_product_type
]
.
"</td>"
;
print
'<td align="center" nowrap="nowrap">'
.
(
$objp
->
envente
?
$langs
->
trans
(
"OnSell"
)
:
$langs
->
trans
(
"NotOnSell"
))
.
"</td>"
;
print
'<td align="center" nowrap="nowrap">'
.
(
$objp
->
envente
?
$langs
->
trans
(
"OnSell"
)
:
$langs
->
trans
(
"NotOnSell"
))
.
"</td>"
;
print
"</tr>
\n
"
;
print
"</tr>
\n
"
;
$i
++
;
$i
++
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/popuprop.php
+
24
−
29
View file @
ab094f4a
<?php
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004
-2005
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*
*
* $Id$
* $Id$
* $Source$
* $Source$
*
*/
*/
/** \file htdocs/product/popuprop.php
/** \file htdocs/product/popuprop.php
...
@@ -29,46 +28,41 @@
...
@@ -29,46 +28,41 @@
*/
*/
require
(
"./pre.inc.php"
);
require
(
"./pre.inc.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/product.class.php'
);
$sortfield
=
isset
(
$_GET
[
"sortfield"
])
?
$_GET
[
"sortfield"
]
:
$_POST
[
"sortfield"
];
$sortfield
=
isset
(
$_GET
[
"sortfield"
])
?
$_GET
[
"sortfield"
]
:
$_POST
[
"sortfield"
];
$sortorder
=
isset
(
$_GET
[
"sortorder"
])
?
$_GET
[
"sortorder"
]
:
$_POST
[
"sortorder"
];
$sortorder
=
isset
(
$_GET
[
"sortorder"
])
?
$_GET
[
"sortorder"
]
:
$_POST
[
"sortorder"
];
$page
=
$_GET
[
"page"
];
$page
=
$_GET
[
"page"
];
if
(
$page
<
0
)
{
if
(
$page
<
0
)
$page
=
0
;
$page
=
0
;
}
if
(
!
$sortfield
)
$sortfield
=
"c"
;
if
(
!
$sortorder
)
$sortorder
=
"DESC"
;
if
(
$sortfield
==
""
)
{
$sortfield
=
"c"
;
}
if
(
$sortorder
==
""
)
{
$sortorder
=
"DESC"
;
}
if
(
$page
==
-
1
)
{
$page
=
0
;
}
if
(
$page
==
-
1
)
{
$page
=
0
;
}
$limit
=
$conf
->
liste_limit
;
$limit
=
$conf
->
liste_limit
;
$offset
=
$limit
*
$page
;
$offset
=
$limit
*
$page
;
$staticproduct
=
new
Product
(
$db
);
llxHeader
();
llxHeader
();
//On n'affiche le lien page suivante que s'il y a une page suivante ...
//On n'affiche le lien page suivante que s'il y a une page suivante ...
$sql
=
"select count(*) as c from "
.
MAIN_DB_PREFIX
.
"product"
;
$sql
=
"select count(*) as c from "
.
MAIN_DB_PREFIX
.
"product"
;
if
(
$db
->
query
(
$sql
)
)
$result
=
$db
->
query
(
$sql
);
if
(
$result
)
{
{
$d
=
$db
->
fetch_object
(
0
);
$obj
=
$db
->
fetch_object
(
$result
);
$num
=
$d
->
c
;
$num
=
$obj
->
c
;
if
(
$num
<
(
$offset
+
$offset
))
$afficher_pagesuivante
=
0
;
else
$afficher_pagesuivante
=
-
1
;
}
}
print_barre_liste
(
"Liste des produits et services par popularit"
,
$page
,
"popuprop.php"
,
""
,
""
,
""
,
""
,
$
afficher_pagesuivante
);
print_barre_liste
(
"Liste des produits et services par popularit"
,
$page
,
"popuprop.php"
,
""
,
""
,
""
,
""
,
$
num
);
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
print
"<tr class=
\"
liste_titre
\"
>"
;
print
"<tr class=
\"
liste_titre
\"
>"
;
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
"popuprop.php"
,
"p.ref"
,
""
,
""
,
""
,
$sortfield
);
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
"popuprop.php"
,
"p.ref"
,
""
,
""
,
""
,
$sortfield
);
print_liste_field_titre
(
$langs
->
trans
(
"Type"
),
"popuprop.php"
,
"p.type"
,
""
,
""
,
""
,
$sortfield
);
print_liste_field_titre
(
$langs
->
trans
(
"Label"
),
"popuprop.php"
,
"p.label"
,
""
,
""
,
""
,
$sortfield
);
print_liste_field_titre
(
$langs
->
trans
(
"Label"
),
"popuprop.php"
,
"p.label"
,
""
,
""
,
""
,
$sortfield
);
print_liste_field_titre
(
"Nb. de proposition"
,
"popuprop.php"
,
"c"
,
""
,
""
,
'align="right"'
,
$sortfield
);
print_liste_field_titre
(
"Nb. de proposition"
,
"popuprop.php"
,
"c"
,
""
,
""
,
'align="right"'
,
$sortfield
);
print
"</tr>
\n
"
;
print
"</tr>
\n
"
;
...
@@ -79,24 +73,25 @@ $sql .= " WHERE p.rowid = pd.fk_product group by (p.rowid)";
...
@@ -79,24 +73,25 @@ $sql .= " WHERE p.rowid = pd.fk_product group by (p.rowid)";
$sql
.
=
" ORDER BY
$sortfield
$sortorder
"
;
$sql
.
=
" ORDER BY
$sortfield
$sortorder
"
;
$sql
.
=
$db
->
plimit
(
$limit
,
$offset
);
$sql
.
=
$db
->
plimit
(
$limit
,
$offset
);
$result
=
$db
->
query
(
$sql
)
;
if
(
$db
->
query
(
$sql
)
)
if
(
$result
)
{
{
$num
=
$db
->
num_rows
();
$num
=
$db
->
num_rows
(
$result
);
$i
=
0
;
$i
=
0
;
$var
=
True
;
$var
=
True
;
while
(
$i
<
$num
)
while
(
$i
<
$num
)
{
{
$objp
=
$db
->
fetch_object
(
$i
);
$objp
=
$db
->
fetch_object
(
$result
);
$var
=!
$var
;
$var
=!
$var
;
print
"<tr
$bc[$var]
>"
;
print
"<tr
$bc[$var]
>"
;
print
"
<td><a href=
\
"
fiche.php?id=
$objp->rowid
\
"
>
"
;
print
'
<td><a href="
'
.
DOL_URL_ROOT
.
'/product/stats/
fiche.php?id=
'
.
$objp
->
rowid
.
'
">
'
;
if
(
$objp
->
fk_product_type
)
print
img_object
(
$langs
->
trans
(
"ShowService"
),
"service"
);
if
(
$objp
->
fk_product_type
)
print
img_object
(
$langs
->
trans
(
"ShowService"
),
"service"
);
else
print
img_object
(
$langs
->
trans
(
"ShowProduct"
),
"product"
);
else
print
img_object
(
$langs
->
trans
(
"ShowProduct"
),
"product"
);
print
" "
;
print
" "
;
print
"
$objp->ref
</a></td>
\n
"
;
print
$objp
->
ref
.
'</a></td>'
;
print
"<td>
$objp->label
</td>
\n
"
;
print
'<td>'
.
$staticproduct
->
typeprodser
[
$objp
->
fk_product_type
]
.
'</td>'
;
print
'<td>'
.
$objp
->
label
.
'</td>'
;
print
'<td align="right">'
.
$objp
->
c
.
'</td>'
;
print
'<td align="right">'
.
$objp
->
c
.
'</td>'
;
print
"</tr>
\n
"
;
print
"</tr>
\n
"
;
$i
++
;
$i
++
;
...
@@ -107,5 +102,5 @@ print "</table>";
...
@@ -107,5 +102,5 @@ print "</table>";
$db
->
close
();
$db
->
close
();
llxFooter
(
"<em>Dernière modification
$Date
$ révision
$Revision
$
</em>"
);
llxFooter
(
'$Date$ -
$Revision$
'
);
?>
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment