diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index ae69461ff9f..f9edc272dea 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -17,15 +17,13 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
*/
/**
\file htdocs/commande/document.php
- \ingroup facture
- \brief Page de gestion des documents attachées à une facture
- \version $Revision$
+ \ingroup order
+ \brief Page de gestion des documents attachees a une commande
+ \version $Id$
*/
require('./pre.inc.php');
diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php
index 40fdb89fa3b..efff4eefd06 100644
--- a/htdocs/ecm/docmine.php
+++ b/htdocs/ecm/docmine.php
@@ -28,6 +28,7 @@ require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php");
// Load traductions files
@@ -65,6 +66,7 @@ if (! empty($_REQUEST["section"]))
exit;
}
}
+
$upload_dir = $conf->ecm->dir_output.'/'.$ecmdir->label;
@@ -128,29 +130,6 @@ llxHeader();
$form=new Form($db);
-print_fiche_titre($langs->trans("ECMManualOrg"));
-print '
';
-
-$ecmdir->ref=$ecmdir->label;
-print $langs->trans("ECMSection").': ';
-print img_picto('','object_dir').' ';
-print ''.$langs->trans("ECMRoot").'';
-print ' -> '.$ecmdir->getNomUrl(1).'';
-print "
";
-
-
-//$head = societe_prepare_head($societe);
-//dolibarr_fiche_head($head, 'document', $societe->nom);
-
-
-/*
-* Confirmation de la suppression d'une ligne produit
-*/
-if ($_GET['action'] == 'delete_file')
-{
- $form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
- print '
';
-}
// Construit liste des fichiers
clearstatcache();
@@ -182,23 +161,63 @@ else
}
-/*
+$head = ecm_prepare_head($ecmdir);
+dolibarr_fiche_head($head, 'card', $langs->trans("ECMManualOrg"));
-print '
';
-
-// Nbre fichiers
-print '| '.$langs->trans("NbOfAttachedFiles").' | '.sizeof($filearray).' |
';
-
-//Total taille
-print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' |
';
+print '';
+print '| '.$langs->trans("Ref").' | ';
+$s='';
+$tmpecmdir=$ecmdir;
+$result = 1;
+while ($tmpecmdir && $result > 0)
+{
+ $tmpecmdir->ref=$tmpecmdir->label;
+ $s=' -> '.$tmpecmdir->getNomUrl(1).$s;
+ if ($tmpecmdir->fk_parent)
+ {
+ $result=$tmpecmdir->fetch($tmpecmdir->fk_parent);
+ }
+ else
+ {
+ $tmpecmdir=0;
+ }
+}
+print img_picto('','object_dir').' '.$langs->trans("ECMRoot").'';
+print $s;
+print ' |
';
+print '| '.$langs->trans("Description").' | ';
+print dol_nl2br($ecmdir->description);
+print ' |
';
+print '| '.$langs->trans("ECMCreationUser").' | ';
+$user=new User($db,$ecmdir->fk_user_c);
+$user->fetch();
+print $user->getNomUrl(1);
+print ' |
';
+print '| '.$langs->trans("ECMCreationDate").' | ';
+print dolibarr_print_date($ecmdir->date_c,'dayhour');
+print ' |
';
+print '| '.$langs->trans("ECMNbOfDocs").' | ';
+print sizeof($filearray);
+print ' |
';
+print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | ';
+print $totalsize;
+print ' |
';
print '
';
print '';
-*/
+/*
+* Confirmation de la suppression d'une ligne produit
+*/
+if ($_GET['action'] == 'delete_file')
+{
+ $form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
+ print '
';
+}
+
if ($mesg) { print $mesg."
"; }
// Affiche formulaire upload
diff --git a/htdocs/ecm/ecmdirectory.class.php b/htdocs/ecm/ecmdirectory.class.php
index 40aac5e7adb..618a005191a 100644
--- a/htdocs/ecm/ecmdirectory.class.php
+++ b/htdocs/ecm/ecmdirectory.class.php
@@ -216,10 +216,9 @@ class EcmDirectory // extends CommonObject
/*
* \brief Load object in memory from database
* \param id id object
- * \param user User that load
* \return int <0 if KO, >0 if OK
*/
- function fetch($id, $user=0)
+ function fetch($id)
{
global $langs;
$sql = "SELECT";
@@ -230,8 +229,8 @@ class EcmDirectory // extends CommonObject
$sql.= " t.cachenbofdoc,";
$sql.= " t.fk_user_c,";
$sql.= " t.fk_user_m,";
- $sql.= " ".$this->db->pdate('t.date_c').",";
- $sql.= " ".$this->db->pdate('t.date_m')."";
+ $sql.= " ".$this->db->pdate('t.date_c')." as date_c,";
+ $sql.= " ".$this->db->pdate('t.date_m')." as date_m";
$sql.= " FROM ".MAIN_DB_PREFIX."ecm_directories as t";
$sql.= " WHERE t.rowid = ".$id;
diff --git a/htdocs/ecm/pre.inc.php b/htdocs/ecm/pre.inc.php
index 96c9ecda6bc..c061bc4370a 100644
--- a/htdocs/ecm/pre.inc.php
+++ b/htdocs/ecm/pre.inc.php
@@ -41,11 +41,11 @@ function llxHeader($head = "", $title="", $help_url='')
$menu->add(DOL_URL_ROOT."/ecm/index.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("MenuECM"),0,$user->rights->ecm->read);
//$menu->add_submenu(DOL_URL_ROOT."/ecm/docdir.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("List"),1,$user->rights->ecm->read);
$menu->add_submenu(DOL_URL_ROOT."/ecm/index.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("List"),1,$user->rights->ecm->read);
- $menu->add_submenu(DOL_URL_ROOT."/ecm/index?mainmenu=ecm&action=create&idmenu=".$_SESSION["idmenu"], $langs->trans("ECMNewDocument"),1,$user->rights->ecm->create);
+ //$menu->add_submenu(DOL_URL_ROOT."/ecm/index?mainmenu=ecm&action=create&idmenu=".$_SESSION["idmenu"], $langs->trans("ECMNewDocument"),1,$user->rights->ecm->create);
$menu->add_submenu(DOL_URL_ROOT."/ecm/docdir?mainmenu=ecm&action=create&idmenu=".$_SESSION["idmenu"], $langs->trans("ECMNewSection"),1,$user->rights->ecm->setup);
-/*
- if ($conf->societe->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsThirdParties"),2);
+
+/* if ($conf->societe->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsThirdParties"),2);
if ($conf->contrat->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsContracts"),2);
if ($conf->propal->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsProposals"),2);
if ($conf->commande->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsOrders"),2);
diff --git a/htdocs/lib/ecm.lib.php b/htdocs/lib/ecm.lib.php
new file mode 100644
index 00000000000..235fdb9ecbd
--- /dev/null
+++ b/htdocs/lib/ecm.lib.php
@@ -0,0 +1,41 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * or see http://www.gnu.org/
+ */
+
+/**
+ \file htdocs/lib/ecm.lib.php
+ \brief Ensemble de fonctions de base pour le module ecm
+ \ingroup ecm
+ \version $Id$
+*/
+
+function ecm_prepare_head($obj)
+{
+ global $langs, $conf, $user;
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$obj->id;
+ $head[$h][1] = $langs->trans("Card");
+ $head[$h][2] = 'card';
+ $h++;
+
+ return $head;
+}
+
+?>