Uniformize look and feels

This commit is contained in:
Laurent Destailleur 2017-03-07 18:34:57 +01:00
parent 4e4045d18a
commit 8ac1aab45a
3 changed files with 39 additions and 12 deletions

View File

@ -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();

View File

@ -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> &nbsp; ';
//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> &nbsp; ';
//if ($permtodelete) print '<a href="'.$url.'?id='.$object->id.'&section='.$_REQUEST["section"].'&action=delete&urlfile='.urlencode($file['name']).'">'.img_delete().'</a>';
//else print '&nbsp;';
print "</td></tr>\n";

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2017 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&section='.$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&section='.$section.'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=cancel&section='.$section.'&urlfile='.urlencode($urlfile).'&backtourl='.urlencode($backtourl).'">'.$langs->trans('Cancel').'</a>';
}
/*
if ($user->rights->ecm->setup)