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
8ac1aab4
Commit
8ac1aab4
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Uniformize look and feels
parent
4e4045d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/core/ajax/ajaxdirpreview.php
+2
-1
2 additions, 1 deletion
htdocs/core/ajax/ajaxdirpreview.php
htdocs/core/class/html.formfile.class.php
+15
-4
15 additions, 4 deletions
htdocs/core/class/html.formfile.class.php
htdocs/ecm/docfile.php
+22
-7
22 additions, 7 deletions
htdocs/ecm/docfile.php
with
39 additions
and
12 deletions
htdocs/core/ajax/ajaxdirpreview.php
+
2
−
1
View file @
8ac1aab4
...
...
@@ -192,6 +192,7 @@ if ($type == 'directory')
// Auto area for expense report
else
if
(
$module
==
'expensereport'
)
$upload_dir
=
$conf
->
expensereport
->
dir_output
;
// Automatic list
if
(
in_array
(
$module
,
$automodules
))
{
$param
.
=
'&module='
.
$module
;
...
...
@@ -200,7 +201,7 @@ if ($type == 'directory')
$filearray
=
dol_dir_list
(
$upload_dir
,
"files"
,
1
,
''
,
$excludefiles
,
$sortfield
,
$sorting
,
1
);
$formfile
->
list_of_autoecmfiles
(
$upload_dir
,
$filearray
,
$module
,
$param
,
1
,
''
,
$user
->
rights
->
ecm
->
upload
,
1
,
$textifempty
,
$maxlengthname
,
$url
);
}
//Manual
area
//
Manual
list
else
{
$relativepath
=
$ecmdir
->
getRelativePath
();
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/class/html.formfile.class.php
+
15
−
4
View file @
8ac1aab4
...
...
@@ -1115,6 +1115,7 @@ class FormFile
print
"</td>
\n
"
;
print
'<td align="right" width="80px">'
.
dol_print_size
(
$file
[
'size'
],
1
,
1
)
.
'</td>'
;
print
'<td align="center" width="130px">'
.
dol_print_date
(
$file
[
'date'
],
"dayhour"
,
"tzuser"
)
.
'</td>'
;
// Preview
if
(
empty
(
$useinecm
))
{
...
...
@@ -1420,6 +1421,13 @@ class FormFile
print
'<td>'
;
if
(
$found
>
0
&&
is_object
(
$this
->
cache_objects
[
$modulepart
.
'_'
.
$id
.
'_'
.
$ref
]))
print
$this
->
cache_objects
[
$modulepart
.
'_'
.
$id
.
'_'
.
$ref
]
->
getNomUrl
(
1
,
'document'
);
else
print
$langs
->
trans
(
"ObjectDeleted"
,(
$id
?
$id
:
$ref
));
$filename
=
dol_sanitizeFileName
(
$ref
);
//$filedir=$conf->$modulepart->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$filedir
=
$file
[
'path'
];
//$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
//print $formfile->getDocumentsLink($modulepart, $filename, $filedir);
print
'</td>'
;
print
'<td>'
;
//print "XX".$file['name']; //$file['name'] must be utf8
...
...
@@ -1429,14 +1437,17 @@ class FormFile
print
img_mime
(
$file
[
'name'
],
$file
[
'name'
]
.
' ('
.
dol_print_size
(
$file
[
'size'
],
0
,
0
)
.
')'
)
.
' '
;
print
dol_trunc
(
$file
[
'name'
],
$maxlength
,
'middle'
);
print
'</a>'
;
print
$this
->
getDocumentsLink
(
$modulepart
,
$filename
,
$filedir
);
print
"</td>
\n
"
;
print
'<td align="right">'
.
dol_print_size
(
$file
[
'size'
],
1
,
1
)
.
'</td>'
;
print
'<td align="center">'
.
dol_print_date
(
$file
[
'date'
],
"dayhour"
)
.
'</td>'
;
print
'<td align="right">'
;
if
(
!
empty
(
$useinecm
))
print
'<a data-ajax="false" href="'
.
DOL_URL_ROOT
.
'/document.php?modulepart='
.
$modulepart
;
if
(
$forcedownload
)
print
'&attachment=1'
;
print
'&file='
.
urlencode
(
$relativefile
)
.
'">'
;
print
img_view
()
.
'</a> '
;
//
if (! empty($useinecm)) print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
//
if ($forcedownload) print '&attachment=1';
//
print '&file='.urlencode($relativefile).'">';
//
print img_view().'</a> ';
//if ($permtodelete) print '<a href="'.$url.'?id='.$object->id.'§ion='.$_REQUEST["section"].'&action=delete&urlfile='.urlencode($file['name']).'">'.img_delete().'</a>';
//else print ' ';
print
"</td></tr>
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/ecm/docfile.php
+
22
−
7
View file @
8ac1aab4
<?php
/* Copyright (C) 2008-201
6
Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-201
7
Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -61,6 +61,8 @@ $pagenext = $page + 1;
if
(
!
$sortorder
)
$sortorder
=
"ASC"
;
if
(
!
$sortfield
)
$sortfield
=
"label"
;
$cancel
=
GETPOST
(
'cancel'
);
$action
=
GETPOST
(
'action'
);
$section
=
GETPOST
(
"section"
);
if
(
!
$section
)
{
...
...
@@ -107,8 +109,23 @@ if (! empty($_GET["fileid"]))
* Put here all code to do according to value of "action" parameter
********************************************************************/
if
(
$action
==
'cancel'
)
{
$action
=
''
;
if
(
$backtourl
)
{
header
(
"Location: "
.
$backtourl
);
exit
;
}
else
{
header
(
"Location: "
.
DOL_URL_ROOT
.
'/ecm/index.php?action=file_manager§ion='
.
$section
);
exit
;
}
}
// Rename file
if
(
GETPOST
(
'
action
'
)
==
'update'
&&
!
GETPOST
(
'cancel'
)
)
if
(
$
action
==
'update'
)
{
$error
=
0
;
...
...
@@ -131,7 +148,7 @@ if (GETPOST('action') == 'update' && ! GETPOST('cancel'))
if
(
!
$result
)
{
$langs
->
load
(
'errors'
);
$mesg
=
'<div class="error">'
.
$langs
->
trans
(
'ErrorFailToRenameFile'
,
$oldfile
,
$newfile
)
.
'</div>'
;
setEventMessages
(
$langs
->
trans
(
'ErrorFailToRenameFile'
,
$oldfile
,
$newfile
)
,
null
,
'errors'
)
;
$error
++
;
}
}
...
...
@@ -279,16 +296,14 @@ if ($_GET['action'] == 'delete_file')
if
(
$_GET
[
"action"
]
!=
'edit'
)
{
if
(
$mesg
)
{
print
$mesg
.
"<br>"
;
}
// Actions buttons
print
'<div class="tabsAction">'
;
if
(
$user
->
rights
->
ecm
->
setup
)
{
print
'<a class="butAction" href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=edit§ion='
.
$section
.
'&urlfile='
.
urlencode
(
$urlfile
)
.
'">'
.
$langs
->
trans
(
'Edit'
)
.
'</a>'
;
print
'<a class="butAction" href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?action=cancel§ion='
.
$section
.
'&urlfile='
.
urlencode
(
$urlfile
)
.
'&backtourl='
.
urlencode
(
$backtourl
)
.
'">'
.
$langs
->
trans
(
'Cancel'
)
.
'</a>'
;
}
/*
if ($user->rights->ecm->setup)
...
...
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