Skip to content
Snippets Groups Projects
Commit 79306a55 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Some enhancements in ecm module

parent 24bb2ca1
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
*/
/**
\file htdoc/ecm/index.php
\file htdoc/ecm/docdir.php
\ingroup ecm
\brief Main page for ECM section area
\version $Id$
......@@ -44,6 +44,7 @@ $langs->load("categories");
// Load permissions
$user->getrights('ecm');
// Get parameters
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
......@@ -81,16 +82,27 @@ if (! empty($_GET["section"]))
// Action ajout d'un produit ou service
if ($_POST["action"] == 'add' && $user->rights->ecm->setup)
{
$ecmdir->ref = $_POST["ref"];
$ecmdir->label = $_POST["label"];
$ecmdir->description = $_POST["desc"];
$ecmdir->ref = trim($_POST["ref"]);
$ecmdir->label = trim($_POST["label"]);
$ecmdir->description = trim($_POST["desc"]);
$ecmdir->fk_parent = $_POST["catParent"];
$ok=true;
if (! $ecmdir->label)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>';
$_GET["action"] = "create";
$ok=false;
}
if ($ok)
{
$id = $ecmdir->create($user);
if ($id > 0)
{
Header("Location: ".DOL_URL_ROOT.'/ecm/docmine.php?section='.$id);
Header("Location: ".DOL_URL_ROOT.'/ecm/index.php');
exit;
}
else
......@@ -99,6 +111,7 @@ if ($_POST["action"] == 'add' && $user->rights->ecm->setup)
$_GET["action"] = "create";
}
}
}
// Suppression fichier
if ($_POST['action'] == 'confirm_deletesection' && $_POST['confirm'] == 'yes')
......@@ -186,7 +199,7 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
// Construit fiche rubrique
print $user->rights->ecm->setup;
// Actions buttons
print '<div class="tabsAction">';
if ($user->rights->ecm->setup)
......
......@@ -39,6 +39,7 @@ $langs->load("other");
// Load permissions
$user->getrights('ecm');
// Security check
if ($user->societe_id > 0)
{
......@@ -99,9 +100,8 @@ if ( $_POST["sendit"] && $conf->upload != 0)
$result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']);
if ($result == 1)
{
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else if (!$result)
......@@ -118,7 +118,7 @@ if ( $_POST["sendit"] && $conf->upload != 0)
}
}
// Suppression fichier
// Remove file
if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
{
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
......@@ -129,7 +129,21 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
$result=$ecmdir->changeNbOfFiles('-');
}
// Remove dir
if ($_POST['action'] == 'confirm_deletedir' && $_POST['confirm'] == 'yes')
{
$result=$ecmdir->delete($user);
header("Location: ".DOL_URL_ROOT."/ecm/index.php");
exit;
// $mesg = '<div class="ok">'.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'</div>';
}
// Remove dir
if ($_POST['action'] == 'update' && ! $_POST['cancel'])
{
$ecmdir->description = $_POST["description"];
$result=$ecmdir->update($user);
}
......@@ -151,6 +165,12 @@ $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolowe
$head = ecm_prepare_head($ecmdir);
dolibarr_fiche_head($head, 'card', $langs->trans("ECMManualOrg"));
if ($_GET["action"] == 'edit')
{
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="section" value="'.$section.'">';
print '<input type="hidden" name="action" value="update">';
}
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
......@@ -174,13 +194,19 @@ 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>'.$langs->trans("Description").'</td><td>';
print dol_nl2br($ecmdir->description);
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
if ($_GET["action"] == 'edit')
{
print '<textarea class="flat" name="description" cols="80">';
print $ecmdir->description;
print '</textarea>';
}
else print dol_nl2br($ecmdir->description);
print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMCreationUser").'</td><td>';
$user=new User($db,$ecmdir->fk_user_c);
$user->fetch();
print $user->getNomUrl(1);
$userecm=new User($db,$ecmdir->fk_user_c);
$userecm->fetch();
print $userecm->getNomUrl(1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMCreationDate").'</td><td>';
print dolibarr_print_date($ecmdir->date_c,'dayhour');
......@@ -200,22 +226,67 @@ foreach($filearray as $key => $file)
}
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>';
}
print '</table>';
if ($_GET["action"] == 'edit')
{
print '</form>';
}
print '</div>';
// Actions buttons
if ($_GET["action"] != 'edit' && $_GET['action'] != 'delete_dir' && $_GET['action'] != 'delete_file')
{
print '<div class="tabsAction">';
if ($user->rights->ecm->setup)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&section='.$section.'">'.$langs->trans('Edit').'</a>';
}
if (sizeof($filearray) == 0)
{
if ($user->rights->ecm->setup)
{
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete_dir&section='.$section.'">'.$langs->trans('Delete').'</a>';
}
else
{
print '<a class="butActionDeleteRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
}
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("CannotRemoveDirectoryContainsFiles").'">'.$langs->trans('Delete').'</a>';
}
print '</div>';
}
if ($mesg) { print $mesg.'<br>'; }
/*
* Confirmation de la suppression d'une ligne produit
*/
// Confirm remove file
if ($_GET['action'] == 'delete_file')
{
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>';
}
if ($mesg) { print $mesg."<br>"; }
// Confirm remove file
if ($_GET['action'] == 'delete_dir')
{
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection'), 'confirm_deletedir');
print '<br>';
}
// Affiche formulaire upload
$formfile=new FormFile($db);
......@@ -250,11 +321,13 @@ foreach($filearray as $key => $file)
print "</td>\n";
print '<td align="right">'.dol_print_size($file['size']).'</td>';
print '<td align="center">'.dolibarr_print_date($file['date'],"dayhour").'</td>';
print '<td align="center">';
echo '<a href="'.$url.'?section='.$_REQUEST["section"].'&amp;action=delete_file&urlfile='.urlencode($file['name']).'">'.img_delete().'</a>';
print '<td align="right">';
//print '&nbsp;';
print '<a href="'.$url.'?section='.$_REQUEST["section"].'&amp;action=delete_file&urlfile='.urlencode($file['name']).'">'.img_delete().'</a>';
print "</td></tr>\n";
}
}
if (sizeof($filearray) == 0) print '<tr '.$bc[$var].'><td colspan="4">'.$langs->trans("ECMNoFileFound").'</td></tr>';
print "</table>";
// Fin de zone Ajax
......
......@@ -100,7 +100,7 @@ class EcmDirectory // extends CommonObject
$sql.= " '".$this->fk_user_c."'";
$sql.= ")";
dolibarr_syslog("Ecm_directories::create sql=".$sql, LOG_DEBUG);
dolibarr_syslog("EcmDirectories::create sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
......@@ -120,7 +120,7 @@ class EcmDirectory // extends CommonObject
else
{
$this->error="Error ".$this->db->lasterror();
dolibarr_syslog("Ecm_directories::create ".$this->error, LOG_ERR);
dolibarr_syslog("EcmDirectories::create ".$this->error, LOG_ERR);
return -1;
}
}
......@@ -136,13 +136,10 @@ class EcmDirectory // extends CommonObject
global $conf, $langs;
// Clean parameters
$this->label=trim($this->label);
$this->fk_parent=trim($this->fk_parent);
$this->description=trim($this->description);
// Check parameters
// Put here code to add control on parameters values
......@@ -151,18 +148,15 @@ class EcmDirectory // extends CommonObject
$sql.= " label='".addslashes($this->label)."',";
$sql.= " fk_parent='".$this->fk_parent."',";
$sql.= " description='".addslashes($this->description)."',";
$sql.= " tms=".$this->db->idate($this->tms)."";
$sql.= " description='".addslashes($this->description)."'";
$sql.= " WHERE rowid=".$this->id;
dolibarr_syslog("Ecm_directories::update sql=".$sql, LOG_DEBUG);
dolibarr_syslog("EcmDirectories::update sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dolibarr_syslog("Ecm_directories::update ".$this->error, LOG_ERR);
dolibarr_syslog("EcmDirectories::update ".$this->error, LOG_ERR);
return -1;
}
......@@ -195,12 +189,12 @@ class EcmDirectory // extends CommonObject
$sql.= " cachenbofdoc = cachenbofdoc ".$sign." 1";
$sql.= " WHERE rowid = ".$this->id;
dolibarr_syslog("Ecm_directories::changeNbOfFiles sql=".$sql, LOG_DEBUG);
dolibarr_syslog("EcmDirectories::changeNbOfFiles sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dolibarr_syslog("Ecm_directories::changeNbOfFiles ".$this->error, LOG_ERR);
dolibarr_syslog("EcmDirectories::changeNbOfFiles ".$this->error, LOG_ERR);
return -1;
}
......@@ -211,11 +205,10 @@ class EcmDirectory // extends CommonObject
/**
* \brief Load object in memory from database
* \param id id object
* \return int <0 if KO, >0 if OK
* \return int <0 if KO, 0 if not found, >0 if OK
*/
function fetch($id)
{
global $langs;
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.label,";
......@@ -229,14 +222,13 @@ class EcmDirectory // extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."ecm_directories as t";
$sql.= " WHERE t.rowid = ".$id;
dolibarr_syslog("Ecm_directories::fetch sql=".$sql, LOG_DEBUG);
dolibarr_syslog("EcmDirectories::fetch sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object($resql);
if ($obj)
{
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
......@@ -249,14 +241,15 @@ class EcmDirectory // extends CommonObject
$this->date_c = $obj->date_c;
$this->date_m = $obj->date_m;
}
$this->db->free($resql);
return 1;
return $obj?1:0;
}
else
{
$this->error="Error ".$this->db->lasterror();
dolibarr_syslog("Ecm_directories::fetch ".$this->error, LOG_ERR);
dolibarr_syslog("EcmDirectories::fetch ".$this->error, LOG_ERR);
return -1;
}
}
......@@ -274,12 +267,12 @@ class EcmDirectory // extends CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_directories";
$sql.= " WHERE rowid=".$this->id;
dolibarr_syslog("Ecm_directories::delete sql=".$sql);
dolibarr_syslog("EcmDirectories::delete sql=".$sql);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dolibarr_syslog("Ecm_directories::delete ".$this->error, LOG_ERR);
dolibarr_syslog("EcmDirectories::delete ".$this->error, LOG_ERR);
return -1;
}
......@@ -329,11 +322,12 @@ class EcmDirectory // extends CommonObject
//$picto=DOL_URL_ROOT.'/theme/common/treemenu/folder.gif';
$picto='dir';
$label=$langs->trans("ShowECMSection").': '.$this->ref;
$newref=eregi_replace('_',' ',$this->ref);
$newlabel=$langs->trans("ShowECMSection").': '.$newref;
if ($withpicto) $result.=($lien.img_object($label,$picto,'',1).$lienfin);
if ($withpicto) $result.=($lien.img_object($newlabel,$picto,'',1).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$lien.$newref.$lienfin;
return $result;
}
......@@ -387,7 +381,7 @@ class EcmDirectory // extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."ecm_directories";
$sql.= " WHERE fk_parent != 0";
dolibarr_syslog("ECMDirectory::get_full_arbo sql=".$sql);
dolibarr_syslog("EcmDirectory::get_full_arbo sql=".$sql);
$resql = $this->db->query($sql);
if ($resql)
{
......@@ -415,10 +409,16 @@ class EcmDirectory // extends CommonObject
* label = nom de la categorie
* fulllabel = nom avec chemin complet de la categorie
* fullpath = chemin complet compose des id
* \param force Force reload of full arbo even if already loaded
* \return array Tableau de array
*/
function get_full_arbo()
function get_full_arbo($force=0)
{
if (empty($force) && $this->full_arbo_loaded)
{
return $this->cats;
}
// Init this->motherof array
$this->load_motherof();
......@@ -435,7 +435,7 @@ class EcmDirectory // extends CommonObject
$sql.= " WHERE c.fk_user_c = u.rowid";
$sql.= " ORDER BY c.label, c.rowid";
dolibarr_syslog("ECMDirectory::get_full_arbo sql=".$sql);
dolibarr_syslog("EcmDirectory::get_full_arbo sql=".$sql);
$resql = $this->db->query ($sql);
if ($resql)
{
......@@ -484,8 +484,7 @@ class EcmDirectory // extends CommonObject
}
$this->cats=dol_sort_array($this->cats, 'fulllabel', 'asc', true, false);
//$this->debug_cats();
$this->full_arbo_loaded=1;
return $this->cats;
}
......@@ -525,7 +524,40 @@ class EcmDirectory // extends CommonObject
}
}
return;
return 1;
}
/**
* \brief refresh cachenboffile
* \param directory Directory to scan
* \return int <0 if ko, >0 if OK
*/
function refreshcachenboffile()
{
global $conf;
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$dir=$conf->ecm->dir_output.'/'.$this->getRelativePath();
$filelist=dol_dir_list($dir,'files',0,'','\.meta$');
// Test if filelist is in database
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET";
$sql.= " cachenbofdoc='".sizeof($filelist)."'";
$sql.= " WHERE rowid=".$this->id;
dolibarr_syslog("EcmDirectories::refreshcachenboffile sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dolibarr_syslog("EcmDirectories::refreshcachenboffile ".$this->error, LOG_ERR);
return -1;
}
return 1;
}
}
?>
<?php
/* Copyright (C) 2008 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
* 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.
*/
/**
......@@ -103,8 +117,6 @@ $form=new Form($db);
$ecmdirstatic = new ECMDirectory($db);
$userstatic = new User($db);
if (! $_GET["action"] || $_GET["action"] == 'delete_section')
{
//***********************
// List
//***********************
......@@ -159,15 +171,6 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
print_fiche_titre($langs->trans("ECMSectionOfDocuments"));
//print '<br>';
/*
$ecmdir->ref=$ecmdir->label;
print $langs->trans("ECMSection").': ';
print img_picto('','object_dir').' ';
print '<a href="'.DOL_URL_ROOT.'/ecm/docdir.php">'.$langs->trans("ECMRoot").'</a>';
//print ' -> <b>'.$ecmdir->getNomUrl(1).'</b><br>';
print "<br><br>";
*/
// Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section')
{
......@@ -195,10 +198,10 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">'.$langs->trans("ECMSectionAuto").'</td>';
print '<td class="liste_titre" align="left">'.$langs->trans("Description").'</td>';
print '<td class="liste_titre" align="left">'.$langs->trans("ECMCreationUser").'</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">'.$langs->trans("ECMNbOfDocs").'</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">'.$langs->trans("ECMNbOfDocsSmall").'</td>';
print '<td class="liste_titre">';
print '&nbsp;';
print '</td>';
print '</tr>';
$sectionauto=dol_sort_array($sectionauto,'label',$sortorder,true,false);
......@@ -222,10 +225,13 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
// Description
print '<td align="left">'.$val['desc'].'</td>';
print '<td align="left">'.$langs->trans("ECMTypeAuto").'</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">?</td>';
print '<td align="right">&nbsp;</td>';
print '<td align="right">';
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMAutoOrg").'<br>';
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto");
print $form->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print "</tr>\n";
}
}
......@@ -239,10 +245,12 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
print '<td class="liste_titre" align="left">'.$langs->trans("ECMSectionManual").'</td>';
print '<td class="liste_titre" align="left">'.$langs->trans("Description").'</td>';
print '<td class="liste_titre" align="left">'.$langs->trans("ECMCreationUser").'</td>';
print '<td class="liste_titre" align="center">'.$langs->trans("ECMCreationDate").'</td>';
print '<td class="liste_titre" align="right">'.$langs->trans("ECMNbOfDocs").'</td>';
print '<td class="liste_titre" align="center">&nbsp;</td>';
print '<td class="liste_titre" align="right">'.$langs->trans("ECMNbOfDocsSmall");
print '<a href="'.$_SERVER["PHP_SELF"].'?action=refreshauto">'.img_picto($langs->trans("Refresh"),'refresh').'</a>';
print '</td>';
print '<td class="liste_titre" align="right">';
print '<a href="'.DOL_URL_ROOT.'/ecm/docdir?action=create">'.img_picto($langs->trans("ECMNewSection"),'edit_add').'</a>';
print '</td>';
print '</tr>';
$ecmdirstatic = new ECMDirectory($db);
......@@ -259,6 +267,16 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
$ecmdirstatic->id=$val['id'];
$ecmdirstatic->ref=$val['label'];
// Refresh cache
if ($_GET['action'] == 'refreshauto')
{
$result=$ecmdirstatic->fetch($val['id']);
$result=$ecmdirstatic->refreshcachenboffile();
$ecmdirstatic->ref=$ecmdirstatic->label;
}
print '<tr '.$bc[$var].'>';
// Section
......@@ -269,24 +287,19 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
// Description
print '<td align="left">'.dolibarr_trunc($val['description'],32).'</td>';
$userstatic->id=$val['fk_user_c'];
$userstatic->nom=$val['login_c'];
print '<td align="left">'.$userstatic->getNomUrl(1).'</td>';
print '<td align="center">'.dolibarr_print_date($val['date_c'],"dayhour").'</td>';
// Nb of docs
//print '<td align="right">'.$obj->cachenbofdoc.'</td>';
print '<td align="right">'.$val['cachenbofdoc'].'</td>';
print '<td align="right">';
if ($val['cachenbofdoc'] == 0 && $val['level'] >= $rub[$key+1]['level'])
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete_section&section='.urlencode($val['id']).'">'.img_delete().'</a>';
}
else
{
print '&nbsp;';
}
$userstatic->id=$val['fk_user_c'];
$userstatic->nom=$val['login_c'];
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMManualOrg").'<br>';
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1).'<br>';
$htmltooltip.='<b>'.$langs->trans("ECMCreationDate").'</b>: '.dolibarr_print_date($val['date_c'],"dayhour");
print $form->textwithhelp('',$htmltooltip,1,0);
print "</td></tr>\n";
$nbofentries++;
......@@ -315,7 +328,6 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
}
print '</div>';
*/
}
// End of page
......
......@@ -39,7 +39,6 @@ function llxHeader($head = "", $title="", $help_url='')
$menu = new Menu();
$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);
......
......@@ -8,7 +8,8 @@ DocsContracts=Documents contracts
DocsProposals=Documents proposals
DocsOrders=Documents orders
DocsInvoices=Documents invoices
ECMNbOfDocs=Nb doc
ECMNbOfDocs=Nb of documents in directory
ECMNbOfDocsSmall=Nb of doc.
ECMSection=Directory
ECMSectionManual=Manual directory
ECMSectionAuto=Automatic directory
......@@ -42,3 +43,5 @@ ShowECMSection=Show directory
DeleteSection=Remove directory
ConfirmDeleteSection=Can you confirm you want to delete the directory <b>%s</b> ?
ECMDirectoryForFiles=Relative directory for files
CannotRemoveDirectoryContainsFiles=Removed not possible because it contains some files
ECMNoFileFound=No documents saved in this directory
\ No newline at end of file
......@@ -8,7 +8,8 @@ DocsContracts=Documents contrats
DocsProposals=Documents propositions
DocsOrders=Documents commandes
DocsInvoices=Documents factures
ECMNbOfDocs=Nb doc
ECMNbOfDocs=Nb de documents de la rubrique
ECMNbOfDocsSmall=Nb de doc.
ECMSection=Rubrique
ECMSectionManual=Rubriques manuelles
ECMSectionAuto=Rubriques automatique
......@@ -22,7 +23,7 @@ ECMCreationDate=Date cr
ECMCreationUser=Créateur
ECMArea=Espace GED
ECMAreaDesc=L'espace GED (Gestion Electronique de Documents) vous permet de stocker dans Dolibarr et retrouver rapidement tout type de documents.
ECMAreaDesc2=* Les rubriques automatiques sont alimentées automatiquement lors de l'ajout d'un document depuis une fiche objet (propal, facture, commande...).<br>* Les rubriques manuelles peuvent etre utilisées pour stocker des documents divers, non liés à un objet particulier.
ECMAreaDesc2=* Les rubriques automatiques sont alimentées automatiquement lors de l'ajout d'un document depuis une fiche objet (propal, facture...).<br>* Les rubriques manuelles peuvent etre utilisées pour stocker des documents divers, non liés à un objet particulier.
ECMSectionWasRemoved=La rubrique <b>%s</b> a été effacée.
ECMDocumentsSection=Document de la section
ECMSearchByKeywords=Recherche par mots clés
......@@ -40,5 +41,7 @@ ECMAutoOrg=Rubrique automatique
ECMNoDirecotyYet=Aucune rubrique créée
ShowECMSection=Afficher rubrique
DeleteSection=Suppression rubrique
ConfirmDeleteSection=Confirmez-vous la suppression de la rubique <b>%s</b> ?
ConfirmDeleteSection=Confirmez-vous la suppression de la rubrique <b>%s</b> ?
ECMDirectoryForFiles=Répertoire relatif pour les fichiers
CannotRemoveDirectoryContainsFiles=Suppression impossible car des fichiers sont présents
ECMNoFileFound=Pas de documents stockés dans cette rubrique
\ No newline at end of file
......@@ -32,7 +32,7 @@
\param $exludefilter Regex for exclude filter (example: '\.meta$')
\param $sortcriteria Sort criteria ("name","date","size")
\param $sortorder Sort order (SORT_ASC, SORT_DESC)
\param $mode 0=Return array of key need, 1=Force all key to be loaded
\param $mode 0=Return array with only keys needed, 1=Force all keys to be loaded
\return array Array of array('name'=>xxx,'date'=>yyy,'size'=>zzz)
*/
function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0)
......
......@@ -252,6 +252,7 @@ alter table llx_tva modify fk_bank integer;
delete from llx_const where name='MAIN_USE_PREVIEW_TABS';
drop table if exists llx_ecm_directories;
create table llx_ecm_directories
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
......@@ -259,8 +260,8 @@ create table llx_ecm_directories
fk_parent integer,
description varchar(255) NOT NULL,
cachenbofdoc integer NOT NULL DEFAULT 0,
date_c timestamp,
date_m datetime,
date_c datetime,
date_m timestamp,
fk_user_c integer,
fk_user_m integer
) type=innodb;
......
......@@ -27,8 +27,8 @@ create table llx_ecm_directories
fk_parent integer,
description varchar(255) NOT NULL,
cachenbofdoc integer NOT NULL DEFAULT 0,
date_c timestamp,
date_m datetime,
date_c datetime,
date_m timestamp,
fk_user_c integer,
fk_user_m integer
) type=innodb;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment