Debug module ECM.

This commit is contained in:
Laurent Destailleur 2016-11-28 12:03:33 +01:00
parent e59edca855
commit 5e5ce0043e
4 changed files with 46 additions and 21 deletions

View File

@ -935,7 +935,8 @@ class FormFile
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="modulepart" value="'.$modulepart.'">';
}
print '<table width="100%" class="'.($useinecm?'nobordernopadding':'liste').'">';
print '<table width="100%" class="'.($useinecm?'nobordernopadding':'liste').'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Documents2"),$url,"name","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
@ -971,6 +972,7 @@ class FormFile
$editline=0;
print '<!-- Line list_of_documents '.$key.' -->'."\n";
print '<tr '.$bc[$var].'>';
print '<td class="tdoverflow">';
@ -1131,7 +1133,7 @@ class FormFile
// Show list of documents
if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles"));
if (empty($url)) $url=$_SERVER["PHP_SELF"];
print '<table width="100%" class="nobordernopadding">';
print '<table width="100%" class="nobordernopadding">'."\n";
print '<tr class="liste_titre">';
$sortref="fullname";
if ($modulepart == 'invoice_supplier') $sortref='level1name';
@ -1140,7 +1142,7 @@ class FormFile
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$url,"date","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('','','');
print '</tr>';
print '</tr>'."\n";
// To show ref or specific information according to view to show (defined by $module)
if ($modulepart == 'company')
@ -1276,6 +1278,7 @@ class FormFile
if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files
$var=!$var;
print '<!-- Line list_of_autoecmfiles '.$key.' -->'."\n";
print '<tr '.$bc[$var].'>';
print '<td>';
if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document');

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2016 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
@ -159,14 +159,13 @@ llxHeader();
$form=new Form($db);
$fullpath=$conf->ecm->dir_output.'/'.$ecmdir->label.'/'.$urlfile;
$fullpath=$conf->ecm->dir_output.'/'.$relativepath.$urlfile;
$file = new stdClass();
$file->section_id=$ecmdir->id;
$file->label=$urlfile;
$head = ecm_file_prepare_head($file);
dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic');
if ($_GET["action"] == 'edit')
{
@ -177,8 +176,10 @@ if ($_GET["action"] == 'edit')
print '<input type="hidden" name="action" value="update">';
}
dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic');
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
$s='';
$tmpecmdir=new EcmDirectory($db); // Need to create a new one
$tmpecmdir->fetch($ecmdir->id);
@ -203,7 +204,7 @@ while ($tmpecmdir && $result > 0)
print img_picto('','object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> ';
print $s;
print ' -> ';
if (GETPOST('action') == 'edit') print '<input type="text" name="label" size="64" value="'.$urlfile.'">';
if (GETPOST('action') == 'edit') print '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfile.'">';
else print $urlfile;
print '</td></tr>';
/*print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
@ -234,20 +235,39 @@ print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>';
print dol_print_size($totalsize);
print '</td></tr>';
*/
if ($_GET["action"] == 'edit')
{
print '<tr><td colspan="2" align="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
}
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<tr><td>'.$langs->trans("DirectDownloadLink").'</td><td>';
$modulepart='ecm';
$forcedownload=1;
$rellink='/document.php?modulepart='.$modulepart;
if ($forcedownload) $rellink.='&attachment=1';
if (! empty($object->entity)) $rellink.='&entity='.$object->entity;
$filepath=$relativepath.$file->label;
$rellink.='&file='.urlencode($filepath);
$fulllink=$urlwithroot.$rellink;
print img_picto('','object_globe.png').' ';
print '<input type="text" class="quatrevingtpercent" name="downloadlink" value="'.dol_escape_htmltag($fulllink).'">';
print ' <a data-ajax="false" href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
print '</td></tr>';
print '</table>';
dol_fiche_end();
if ($_GET["action"] == 'edit')
{
print '</form>';
print '<div class="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
}
print '</div>';
// Confirmation de la suppression d'une ligne categorie

View File

@ -222,7 +222,7 @@ if ($action == 'edit')
}
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
$s='';
$tmpecmdir=new EcmDirectory($db); // Need to create a new one
$tmpecmdir->fetch($ecmdir->id);
@ -233,7 +233,7 @@ while ($tmpecmdir && $result > 0)
$tmpecmdir->ref=$tmpecmdir->label;
if ($i == 0 && $action == 'edit')
{
$s='<input type="text" name="label" size="40" maxlength="32" value="'.$tmpecmdir->label.'">';
$s='<input type="text" name="label" class="minwidth300" maxlength="32" value="'.$tmpecmdir->label.'">';
}
else $s=$tmpecmdir->getNomUrl(1).$s;
if ($tmpecmdir->fk_parent)
@ -251,7 +251,7 @@ while ($tmpecmdir && $result > 0)
print img_picto('','object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> ';
print $s;
print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
if ($action == 'edit')
{
print '<textarea class="flat" name="description" cols="80">';

View File

@ -750,6 +750,8 @@ GroupBy=Group by...
ViewFlatList=View flat list
RemoveString=Remove string '%s'
SomeTranslationAreUncomplete=Some languages may be partially translated or may contains errors. If you detect some, you can fix language files registering to <a href="https://transifex.com/projects/p/dolibarr/" target="_blank">http://transifex.com/projects/p/dolibarr/</a>.
DirectDownloadLink=Direct download link
Download=Download
# Week day
Monday=Monday
Tuesday=Tuesday