diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php
index 2b4f6814717..796ced332ab 100644
--- a/htdocs/core/ajax/ajaxdirtree.php
+++ b/htdocs/core/ajax/ajaxdirtree.php
@@ -199,12 +199,12 @@ if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE
// Edit link
print '
'.img_view($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle"').' | ';
// Add link
- //print ''.img_edit_add().' | ';
+ //print ''.img_edit_add().' | ';
//print ' | ';
// Info
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 919e77a539f..ec1d74d4115 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1152,7 +1152,7 @@ class FormFile
print '';
if ($useinecm == 1)
{
- print ''.img_view('default', 0, 'class="paddingrightonly"').'';
+ print ''.img_view('default', 0, 'class="paddingrightonly"').'';
}
if (! $useinecm || $useinecm == 2)
{
diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php
index 9d518dd5892..05f16e767ba 100644
--- a/htdocs/core/lib/ecm.lib.php
+++ b/htdocs/core/lib/ecm.lib.php
@@ -80,14 +80,14 @@ function ecm_prepare_head($object, $module='ecm', $section='')
if ($module == 'ecm')
{
- $head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$object->id;
+ $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
}
else
{
- $head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$section.'&module='.$module;
+ $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
@@ -108,7 +108,7 @@ function ecm_file_prepare_head($object)
$h = 0;
$head = array();
- $head[$h][0] = DOL_URL_ROOT.'/ecm/docfile.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
+ $head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php
index f9cce6866c1..d47853cbe5a 100644
--- a/htdocs/core/tpl/filemanager.tpl.php
+++ b/htdocs/core/tpl/filemanager.tpl.php
@@ -66,7 +66,7 @@ print '';
if ($permtoadd)
{
- print ' ';
+ print '';
print ' ';
print '';
}
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index 1dab8884f74..019a749b6ef 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -425,7 +425,7 @@ class EcmDirectory // extends CommonObject
$label=$langs->trans("ShowECMSection").': '.$newref;
$linkclose='"'.($more?' '.$more:'').' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
- $linkstart = ' id.$linkclose;
if ($option == 'index') $linkstart = 'id.'§ionexpand=false'.$linkclose;
if ($option == 'indexnotexpanded') $linkstart = ''.$langs->trans("ECMRoot").'';
+ print ' '.$langs->trans("ECMRoot").'';
//print ' -> '.$ecmdir->getNomUrl(1).'';
print " ";
*/
diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/dir_card.php
similarity index 97%
rename from htdocs/ecm/docmine.php
rename to htdocs/ecm/dir_card.php
index 2e1295ccdb0..ce403469107 100644
--- a/htdocs/ecm/docmine.php
+++ b/htdocs/ecm/dir_card.php
@@ -17,7 +17,7 @@
/**
- * \file htdocs/ecm/docmine.php
+ * \file htdocs/ecm/dir_card.php
* \ingroup ecm
* \brief Card of a directory for ECM module
* \author Laurent Destailleur
@@ -373,7 +373,7 @@ if ($action != 'edit' && $action != 'delete')
if ($user->rights->ecm->setup)
{
- print ' '.$langs->trans('ECMAddSection').'';
+ print ' '.$langs->trans('ECMAddSection').'';
}
else
{
@@ -418,7 +418,7 @@ $formfile=new FormFile($db);
// Display upload form
if ($user->rights->ecm->upload)
{
- $formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/docmine.php','',0,$section);
+ $formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/dir_card.php','',0,$section);
}
// List of document
diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php
deleted file mode 100644
index addf559e01c..00000000000
--- a/htdocs/ecm/docother.php
+++ /dev/null
@@ -1,171 +0,0 @@
-
- */
-
-/**
- * \file htdocs/ecm/docother.php
- * \ingroup ecm
- * \brief Main ecm page
- * \author Laurent Destailleur
- */
-
-require '../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-
-// Load traductions files
-$langs->load("ecm");
-$langs->load("companies");
-$langs->load("other");
-
-// Get parameters
-$socid = GETPOST("socid","int");
-
-// Security check
-if ($user->societe_id > 0)
-{
- $action = '';
- $socid = $user->societe_id;
-}
-
-$section=$_GET["section"];
-if (! $section) $section='misc';
-$upload_dir = $conf->ecm->dir_output.'/'.$section;
-
-
-
-/*******************************************************************
- * ACTIONS
- *
- * Put here all code to do according to value of "action" parameter
- ********************************************************************/
-
-// Envoie fichier
-if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
-{
- if (dol_mkdir($upload_dir) >= 0)
- {
- $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
- if (is_numeric($resupload) && $resupload > 0)
- {
- $result=$ecmdir->changeNbOfFiles('+');
- }
- else
- {
- $langs->load("errors");
- if ($resupload < 0) // Unknown error
- {
- setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
- }
- else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
- {
- setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
- }
- else // Known error
- {
- setEventMessages($langs->trans($resupload), null, 'errors');
- }
- }
- }
- else
- {
- // Echec transfert (fichier depassant la limite ?)
- $langs->load("errors");
- $mesg = ' '.$langs->trans("ErrorFailToCreateDir",$upload_dir).' ';
- }
-}
-
-// Suppression fichier
-if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
-{
- $langs->load("other");
- $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
- $ret=dol_delete_file($file);
- if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
- else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
-}
-
-
-
-
-
-/*******************************************************************
- * PAGE
- *
- * Put here all code to do according to value of "action" parameter
- ********************************************************************/
-
-llxHeader();
-
-$form=new Form($db);
-
-print load_fiche_titre($langs->trans("ECMAutoOrg"));
-
-//$head = societe_prepare_head($societe);
-
-
-
-/*
- * Confirmation of deleting a product line
- */
-if ($_GET['action'] == 'delete_file')
-{
- print $form->formconfirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
-
-}
-
-// Construct files list
-clearstatcache();
-$totalsize=0;
-$filearray=array();
-$errorlevel=error_reporting();
-error_reporting(0);
-$handle=opendir($upload_dir);
-error_reporting($errorlevel);
-if (is_resource($handle))
-{
- $i=0;
- while (($file = readdir($handle))!==false)
- {
- if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
- {
- $filearray[$i]->name=$file;
- $filearray[$i]->size=dol_filesize($upload_dir."/".$file);
- $filearray[$i]->date=dol_filemtime($upload_dir."/".$file);
- $totalsize+=$filearray[$i]->size;
- $i++;
- }
- }
- closedir($handle);
-}
-else
-{
- // print ' '.$langs->trans("ErrorCanNotReadDir",$upload_dir).' ';
-}
-
-
-/*
-
-print ' ';
-
-// Nbre fichiers
-print '| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' | ';
-
-//Total taille
-print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' | ';
-
-print ' ';
-
-print ' ';
-
-*/
-
-
-if ($mesg) { print $mesg." "; }
-
-
-print $langs->trans("FeatureNotYetAvailable");
-
-// End of page
-llxFooter();
-$db->close();
diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/file_card.php
similarity index 97%
rename from htdocs/ecm/docfile.php
rename to htdocs/ecm/file_card.php
index 60bc44ac743..8c62cbe18f2 100644
--- a/htdocs/ecm/docfile.php
+++ b/htdocs/ecm/file_card.php
@@ -16,7 +16,7 @@
*/
/**
- * \file htdocs/ecm/docfile.php
+ * \file htdocs/ecm/file_card.php
* \ingroup ecm
* \brief Card of a file for ECM module
*/
@@ -123,7 +123,7 @@ if ($cancel)
}
else
{
- header("Location: ".DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($urlfile).'§ion='.urlencode($section).($module?'&module='.urlencode($module):''));
+ header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section).($module?'&module='.urlencode($module):''));
exit;
}
}
@@ -216,7 +216,7 @@ if ($action == 'update')
$db->commit();
$urlfile=$newlabel;
- header("Location: ".DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($urlfile).'§ion='.urlencode($section));
+ header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section));
exit;
}
else
|