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
e6663c8f
Commit
e6663c8f
authored
13 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Bad order on documents pages
parent
e2b18d56
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/core/class/html.formfile.class.php
+3
-3
3 additions, 3 deletions
htdocs/core/class/html.formfile.class.php
htdocs/ecm/index.php
+7
-5
7 additions, 5 deletions
htdocs/ecm/index.php
htdocs/lib/functions.lib.php
+16
-11
16 additions, 11 deletions
htdocs/lib/functions.lib.php
with
26 additions
and
19 deletions
htdocs/core/class/html.formfile.class.php
+
3
−
3
View file @
e6663c8f
...
...
@@ -22,7 +22,7 @@
* \file htdocs/core/class/html.formfile.class.php
* \ingroup core
* \brief File of class to offer components to list and upload files
* \version $Id: html.formfile.class.php,v 1.4
5
2011/07/06
17:44:56
eldy Exp $
* \version $Id: html.formfile.class.php,v 1.4
6
2011/07/06
21:12:34
eldy Exp $
*/
...
...
@@ -623,8 +623,8 @@ class FormFile
}
// Delete or view link
print
'<td align="right">'
;
if
(
!
empty
(
$useinecm
))
print
'<a href="'
.
DOL_URL_ROOT
.
'/ecm/docfile.php?
section='
.
$_REQUEST
[
"section"
]
.
'&
urlfile='
.
urlencode
(
$file
[
'name'
])
.
'">'
.
img_view
()
.
'</a> '
;
if
(
$permtodelete
)
print
'<a href="'
.
$url
.
'?id='
.
$object
->
id
.
'&
section='
.
$_REQUEST
[
"section"
]
.
'&
action=delete&urlfile='
.
urlencode
(
$file
[
'name'
])
.
'">'
.
img_delete
()
.
'</a>'
;
if
(
!
empty
(
$useinecm
))
print
'<a href="'
.
DOL_URL_ROOT
.
'/ecm/docfile.php?urlfile='
.
urlencode
(
$file
[
'name'
])
.
$param
.
'">'
.
img_view
()
.
'</a> '
;
if
(
$permtodelete
)
print
'<a href="'
.
$url
.
'?id='
.
$object
->
id
.
'&action=delete&urlfile='
.
urlencode
(
$file
[
'name'
])
.
$param
.
'">'
.
img_delete
()
.
'</a>'
;
else
print
' '
;
print
"</td>"
;
print
"</tr>
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/ecm/index.php
+
7
−
5
View file @
e6663c8f
...
...
@@ -21,7 +21,7 @@
* \file htdocs/ecm/index.php
* \ingroup ecm
* \brief Main page for ECM section area
* \version $Id: index.php,v 1.10
0
2011/07/06 2
0:56:49
eldy Exp $
* \version $Id: index.php,v 1.10
1
2011/07/06 2
1:12:34
eldy Exp $
* \author Laurent Destailleur
*/
...
...
@@ -800,6 +800,8 @@ else
$formfile
=
new
FormFile
(
$db
);
$param
=
(
$sortfield
?
'&sortfield='
.
$sortfield
:
''
)
.
(
$sortorder
?
'&sortorder='
.
$sortorder
:
''
);
// Right area
if
(
$module
==
'invoice_supplier'
)
// Auto area for suppliers invoices
{
...
...
@@ -807,7 +809,7 @@ if ($module == 'invoice_supplier') // Auto area for suppliers invoices
$upload_dir
=
$conf
->
fournisseur
->
dir_output
.
'/'
.
$relativepath
;
$filearray
=
dol_dir_list
(
$upload_dir
,
"files"
,
1
,
''
,
array
(
'^SPECIMEN\.pdf$'
,
'^\.'
,
'\.meta$'
,
'^temp$'
,
'^CVS$'
),
$sortfield
,(
strtolower
(
$sortorder
)
==
'desc'
?
SORT_DESC
:
SORT_ASC
),
1
);
$param
=
'&
amp;
module='
.
$module
;
$param
.
=
'&module='
.
$module
;
$textifempty
=
(
$section
?
$langs
->
trans
(
"NoFileFound"
)
:
(
$showonrightsize
==
'featurenotyetavailable'
?
$langs
->
trans
(
"FeatureNotYetAvailable"
)
:
$langs
->
trans
(
"ECMSelectASection"
)));
$formfile
->
list_of_autoecmfiles
(
$upload_dir
,
$filearray
,
$module
,
$param
,
1
,
''
,
$user
->
rights
->
ecm
->
upload
,
1
,
$textifempty
,
40
);
...
...
@@ -817,7 +819,7 @@ else if ($module == 'invoice') // Auto area for suppliers invoices
$upload_dir
=
$conf
->
facture
->
dir_output
;
$filearray
=
dol_dir_list
(
$upload_dir
,
"files"
,
1
,
''
,
array
(
'^SPECIMEN\.pdf$'
,
'^\.'
,
'\.meta$'
,
'^temp$'
,
'^payments$'
,
'^CVS$'
),
$sortfield
,(
strtolower
(
$sortorder
)
==
'desc'
?
SORT_DESC
:
SORT_ASC
),
1
);
$param
=
'&
amp;
module='
.
$module
;
$param
.
=
'&module='
.
$module
;
$textifempty
=
(
$section
?
$langs
->
trans
(
"NoFileFound"
)
:
(
$showonrightsize
==
'featurenotyetavailable'
?
$langs
->
trans
(
"FeatureNotYetAvailable"
)
:
$langs
->
trans
(
"ECMSelectASection"
)));
$formfile
->
list_of_autoecmfiles
(
$upload_dir
,
$filearray
,
$module
,
$param
,
1
,
''
,
$user
->
rights
->
ecm
->
upload
,
1
,
$textifempty
,
40
);
...
...
@@ -828,7 +830,7 @@ else // Manual area
$upload_dir
=
$conf
->
ecm
->
dir_output
.
'/'
.
$relativepath
;
$filearray
=
dol_dir_list
(
$upload_dir
,
"files"
,
0
,
''
,
array
(
'^\.'
,
'\.meta$'
),
$sortfield
,(
strtolower
(
$sortorder
)
==
'desc'
?
SORT_DESC
:
SORT_ASC
),
1
);
$param
=
'&
amp;
section='
.
$section
;
$param
.
=
'§ion='
.
$section
;
$textifempty
=
(
$section
?
$langs
->
trans
(
"NoFileFound"
)
:
(
$showonrightsize
==
'featurenotyetavailable'
?
$langs
->
trans
(
"FeatureNotYetAvailable"
)
:
$langs
->
trans
(
"ECMSelectASection"
)));
$formfile
->
list_of_documents
(
$filearray
,
''
,
'ecm'
,
$param
,
1
,
$relativepath
,
$user
->
rights
->
ecm
->
upload
,
1
,
$textifempty
,
40
);
...
...
@@ -887,5 +889,5 @@ else
// End of page
$db
->
close
();
llxFooter
(
'$Date: 2011/07/06 2
0:56:49
$ - $Revision: 1.10
0
$'
);
llxFooter
(
'$Date: 2011/07/06 2
1:12:34
$ - $Revision: 1.10
1
$'
);
?>
This diff is collapsed.
Click to expand it.
htdocs/lib/functions.lib.php
+
16
−
11
View file @
e6663c8f
...
...
@@ -29,7 +29,7 @@
* \file htdocs/lib/functions.lib.php
* \brief A set of functions for Dolibarr
* This file contains all frequently used functions.
* \version $Id: functions.lib.php,v 1.54
0
2011/07/06
17:43
:33 eldy Exp $
* \version $Id: functions.lib.php,v 1.54
1
2011/07/06
21:12
:33 eldy Exp $
*/
// For compatibility during upgrade
...
...
@@ -2542,12 +2542,12 @@ function dol_print_error_email()
* @param file Url used when we click on sort picto
* @param field Field to use for new sorting
* @param begin ("" by defaut)
* @param
options
("" by defaut)
* @param
moreparam Add more parameters on sort url links
("" by defau
l
t)
* @param td Options of attribute td ("" by defaut)
* @param sortfield Current field used to sort
* @param sortorder Current sort order
*/
function
print_liste_field_titre
(
$name
,
$file
=
""
,
$field
=
""
,
$begin
=
""
,
$
options
=
""
,
$td
=
""
,
$sortfield
=
""
,
$sortorder
=
""
)
function
print_liste_field_titre
(
$name
,
$file
=
""
,
$field
=
""
,
$begin
=
""
,
$
moreparam
=
""
,
$td
=
""
,
$sortfield
=
""
,
$sortorder
=
""
)
{
global
$conf
;
//print "$name, $file, $field, $begin, $options, $td, $sortfield, $sortorder<br>\n";
...
...
@@ -2567,29 +2567,34 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $options
// If this is a sort field
if
(
$field
)
{
$options
=
preg_replace
(
'/sortfield=([a-zA-Z0-9,\s\.]+)/i'
,
''
,
$moreparam
);
$options
=
preg_replace
(
'/sortorder=([a-zA-Z0-9,\s\.]+)/i'
,
''
,
$options
);
$options
=
preg_replace
(
'/&+/i'
,
'&'
,
$options
);
if
(
!
preg_match
(
'/^&/'
,
$options
))
$options
=
'&'
.
$options
;
//print " ";
print
'<img width="2" src="'
.
DOL_URL_ROOT
.
'/theme/common/transparent.png" alt="">'
;
if
(
!
$sortorder
)
{
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=asc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=desc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=asc&begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=desc&begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
0
)
.
'</a>'
;
}
else
{
if
(
$field
!=
$sortfield
)
{
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=asc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=desc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=asc&begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=desc&begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
0
)
.
'</a>'
;
}
else
{
$sortorder
=
strtoupper
(
$sortorder
);
if
(
$sortorder
==
'DESC'
)
{
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=asc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=desc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
1
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=asc&begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=desc&begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
1
)
.
'</a>'
;
}
if
(
$sortorder
==
'ASC'
)
{
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=asc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
1
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&
amp;
sortorder=desc&
amp;
begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
0
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=asc&begin='
.
$begin
.
$options
.
'">'
.
img_down
(
"A-Z"
,
1
)
.
'</a>'
;
print
'<a href="'
.
$file
.
'?sortfield='
.
$field
.
'&sortorder=desc&begin='
.
$begin
.
$options
.
'">'
.
img_up
(
"Z-A"
,
0
)
.
'</a>'
;
}
}
}
...
...
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