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
d5b1097d
Commit
d5b1097d
authored
15 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Qual: Mutualize common code
parent
c5e01667
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/product/fiche.php
+4
-4
4 additions, 4 deletions
htdocs/product/fiche.php
htdocs/product/photos.php
+4
-65
4 additions, 65 deletions
htdocs/product/photos.php
htdocs/product/price.php
+18
-10
18 additions, 10 deletions
htdocs/product/price.php
with
26 additions
and
79 deletions
htdocs/product/fiche.php
+
4
−
4
View file @
d5b1097d
...
...
@@ -844,12 +844,12 @@ if ($_GET["id"] || $_GET["ref"])
// En mode visu
print
'<table class="border" width="100%"><tr>'
;
// Ref
erence
// Ref
print
'<td width="15%">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td>'
;
print
$html
->
showrefnav
(
$product
,
'ref'
,
''
,
1
,
'ref'
);
print
'</td>'
;
$nblignes
=
4
;
$nblignes
=
3
;
if
(
!
empty
(
$conf
->
global
->
PRODUIT_MULTIPRICES_LIMIT
)
&&
empty
(
$socid
))
$nblignes
+=
$conf
->
global
->
PRODUIT_MULTIPRICES_LIMIT
;
else
$nblignes
+=
3
;
...
...
@@ -862,7 +862,7 @@ if ($_GET["id"] || $_GET["ref"])
}
print
'</tr>'
;
// L
i
bel
le
// L
a
bel
print
'<tr><td>'
.
$langs
->
trans
(
"Label"
)
.
'</td><td>'
.
$product
->
libelle
.
'</td></tr>'
;
// MultiPrix
...
...
@@ -988,7 +988,7 @@ if ($_GET["id"] || $_GET["ref"])
print
'</td></tr>'
;
// Description
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Description"
)
.
'</td><td>'
.
nl2br
(
$product
->
description
)
.
'</td></tr>'
;
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Description"
)
.
'</td><td
colspan="2"
>'
.
nl2br
(
$product
->
description
)
.
'</td></tr>'
;
// Nature
if
(
$product
->
type
!=
1
)
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/photos.php
+
4
−
65
View file @
d5b1097d
...
...
@@ -189,80 +189,19 @@ if ($_GET["id"] || $_GET["ref"])
$maxWidth
=
160
;
$maxHeight
=
120
;
$pdir
=
get_exdir
(
$product
->
id
,
2
)
.
$product
->
id
.
"/photos/"
;
$dir
=
$conf
->
produit
->
dir_output
.
'/'
.
$pdir
;
print
'<br>'
;
print
'<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">'
;
foreach
(
$product
->
liste_photos
(
$dir
)
as
$key
=>
$obj
)
{
$nbphoto
++
;
// if ($nbbyrow && $nbphoto == 1) print '<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
// Do not use show_photo because there is more information to show
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="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"OriginalSize"
))
.
'" target="_blank">'
;
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
if
(
$obj
[
'photo_vignette'
])
{
$filename
=
'thumbs/'
.
$obj
[
'photo_vignette'
];
}
else
{
$filename
=
$obj
[
'photo'
];
}
// Nom affiche
$viewfilename
=
$obj
[
'photo'
];
// Taille de l'image
$product
->
get_image_size
(
$dir
.
$filename
);
$imgWidth
=
(
$product
->
imgWidth
<
$maxWidth
)
?
$product
->
imgWidth
:
$maxWidth
;
$imgHeight
=
(
$product
->
imgHeight
<
$maxHeight
)
?
$product
->
imgHeight
:
$maxHeight
;
print
'<img class="photo" border="0" width="'
.
$imgWidth
.
'" height="'
.
$imgHeight
.
'" src="'
.
DOL_URL_ROOT
.
'/viewimage.php?modulepart=product&file='
.
urlencode
(
$pdir
.
$filename
)
.
'">'
;
print
'</a>'
;
print
'<br>'
.
$viewfilename
;
print
'<br>'
;
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
if
(
!
$obj
[
'photo_vignette'
]
&&
preg_match
(
'/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i'
,
$obj
[
'photo'
])
&&
(
$product
->
imgWidth
>
$maxWidth
||
$product
->
imgHeight
>
$maxHeight
))
{
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$_GET
[
"id"
]
.
'&action=addthumb&file='
.
urlencode
(
$pdir
.
$viewfilename
)
.
'">'
.
img_refresh
(
$langs
->
trans
(
'GenerateThumb'
))
.
' </a>'
;
}
if
(
$user
->
rights
->
produit
->
creer
||
$user
->
rights
->
service
->
creer
)
{
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$_GET
[
"id"
]
.
'&action=delete&file='
.
urlencode
(
$pdir
.
$viewfilename
)
.
'">'
;
print
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
++
;
}
$nbphoto
=
$product
->
show_photos
(
$conf
->
produit
->
dir_output
,
1
,
1000
,
$nbbyrow
,
1
,
1
);
if
(
$nbphoto
<
1
)
{
print
'<tr align=center valign=middle border=1><td class="photo">'
;
print
'<br>'
;
print
'<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">'
;
print
'<tr align=center valign=middle border=1><td class="photo">'
;
print
"<br>"
.
$langs
->
trans
(
"NoPhotoYet"
)
.
"<br><br>"
;
print
'</td></tr>'
;
}
print
'</table>'
;
}
}
}
}
else
{
print
$langs
->
trans
(
"ErrorUnknown"
);
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/price.php
+
18
−
10
View file @
d5b1097d
...
...
@@ -23,7 +23,7 @@
/**
* \file htdocs/product/price.php
* \ingroup product
* \brief Page
de la fiche produit
* \brief Page
to show product prices
* \version $Id$
*/
...
...
@@ -126,17 +126,26 @@ dol_fiche_head($head, 'price', $titre, 0, $picto);
print
'<table class="border" width="100%">'
;
// Reference
print
'<tr>'
;
print
'<td width="15%">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td colspan="2">'
;
// Ref
print
'<td width="15%">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td>'
;
print
$html
->
showrefnav
(
$product
,
'ref'
,
''
,
1
,
'ref'
);
print
'</td>'
;
print
'</tr>'
;
// Libelle
print
'<tr><td>'
.
$langs
->
trans
(
"Label"
)
.
'</td><td colspan="2">'
.
$product
->
libelle
.
'</td>'
;
$nblignes
=
3
;
if
(
!
empty
(
$conf
->
global
->
PRODUIT_MULTIPRICES_LIMIT
)
&&
empty
(
$socid
))
$nblignes
+=
$conf
->
global
->
PRODUIT_MULTIPRICES_LIMIT
;
else
$nblignes
+=
3
;
if
(
$product
->
is_photo_available
(
$conf
->
produit
->
dir_output
))
{
// Photo
print
'<td valign="middle" align="center" width="30%" rowspan="'
.
$nblignes
.
'">'
;
$nbphoto
=
$product
->
show_photos
(
$conf
->
produit
->
dir_output
,
1
,
1
,
0
);
print
'</td>'
;
}
print
'</tr>'
;
// Label
print
'<tr><td>'
.
$langs
->
trans
(
"Label"
)
.
'</td><td>'
.
$product
->
libelle
.
'</td></tr>'
;
// MultiPrix
if
(
$conf
->
global
->
PRODUIT_MULTIPRICES
)
...
...
@@ -252,12 +261,11 @@ else
print
'</td></tr>'
;
// TVA
print
'<tr><td>'
.
$langs
->
trans
(
"VATRate"
)
.
'</td><td colspan="2">'
.
vatrate
(
$product
->
tva_tx
,
true
)
.
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"VATRate"
)
.
'</td><td>'
.
vatrate
(
$product
->
tva_tx
,
true
)
.
'</td></tr>'
;
}
// Statut
print
'<tr><td>'
.
$langs
->
trans
(
"Status"
)
.
'</td><td
colspan="2"
>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Status"
)
.
'</td><td>'
;
print
$product
->
getLibStatut
(
2
);
print
'</td></tr>'
;
...
...
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