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

New: Navigation in ECM module is done like in a file manager.

parent 1249eac5
Branches
Tags
No related merge requests found
...@@ -431,7 +431,7 @@ class EcmDirectory // extends CommonObject ...@@ -431,7 +431,7 @@ class EcmDirectory // extends CommonObject
} }
/** /**
* \brief Load this->motherof array * \brief Load this->motherof that is array(id_son=>id_parent, ...)
* \return int <0 if KO, >0 if OK * \return int <0 if KO, >0 if OK
*/ */
function load_motherof() function load_motherof()
...@@ -469,8 +469,13 @@ class EcmDirectory // extends CommonObject ...@@ -469,8 +469,13 @@ class EcmDirectory // extends CommonObject
* id_mere = id de la categorie mere * id_mere = id de la categorie mere
* id_children = tableau des id enfant * id_children = tableau des id enfant
* label = nom de la categorie * label = nom de la categorie
* fulllabel = nom avec chemin complet de la categorie * cachenbofdoc = nb of documents
* fullpath = chemin complet compose des id * date_c = date creation
* fk_user_c = user creation
* login_c = login creation
* fullpath Full path (Added by build_path_from_id_categ call)
* fulllabel Full label (Added by build_path_from_id_categ call)
* level Level of line (Added by build_path_from_id_categ call)
* \param force Force reload of full arbo even if already loaded * \param force Force reload of full arbo even if already loaded
* \return array Tableau de array * \return array Tableau de array
*/ */
...@@ -481,7 +486,7 @@ class EcmDirectory // extends CommonObject ...@@ -481,7 +486,7 @@ class EcmDirectory // extends CommonObject
return $this->cats; return $this->cats;
} }
// Init this->motherof array // Init this->motherof that is array(id_son=>id_parent, ...)
$this->load_motherof(); $this->load_motherof();
// Charge tableau des categories // Charge tableau des categories
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php");
require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php");
...@@ -46,9 +47,9 @@ $user->getrights('ecm'); ...@@ -46,9 +47,9 @@ $user->getrights('ecm');
// Get parameters // Get parameters
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
$action = isset($_GET["action"])?$_GET["action"]:$_POST['action']; $action = isset($_GET["action"])?$_GET["action"]:$_POST['action'];
$section=isset($_GET["section"])?$_GET["section"]:$_POST['section'];
if (! $section) $section=0;
$section=$_GET["section"];
if (! $section) $section='misc';
$upload_dir = $conf->ecm->dir_output.'/'.$section; $upload_dir = $conf->ecm->dir_output.'/'.$section;
$page=$_GET["page"]; $page=$_GET["page"];
...@@ -78,6 +79,75 @@ if (! empty($_REQUEST["section"])) ...@@ -78,6 +79,75 @@ if (! empty($_REQUEST["section"]))
* Put here all code to do according to value of "action" parameter * Put here all code to do according to value of "action" parameter
********************************************************************/ ********************************************************************/
// Envoie fichier
if ( $_POST["sendit"] && $conf->upload != 0)
{
$result=$ecmdir->fetch($_REQUEST["section"]);
if (! $result > 0)
{
dolibarr_print_error($db,$ecmdir->error);
exit;
}
$relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
if (! is_dir($upload_dir))
{
$result=create_exdir($upload_dir);
}
if (is_dir($upload_dir))
{
$result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
if ($result > 0)
{
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
// print_r($_FILES);
}
else
{
// File infected by a virus
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>';
}
}
else
{
// Echec transfert (fichier depassant la limite ?)
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
}
}
// Remove file
if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
{
$result=$ecmdir->fetch($_REQUEST["section"]);
if (! $result > 0)
{
dolibarr_print_error($db,$ecmdir->error);
exit;
}
$relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
$result=dol_delete_file($file);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
$result=$ecmdir->changeNbOfFiles('-');
$action='file_manager';
}
// Action ajout d'un produit ou service // Action ajout d'un produit ou service
if ($_POST["action"] == 'add' && $user->rights->ecm->setup) if ($_POST["action"] == 'add' && $user->rights->ecm->setup)
{ {
...@@ -143,11 +213,14 @@ print $langs->trans("ECMAreaDesc")."<br>"; ...@@ -143,11 +213,14 @@ print $langs->trans("ECMAreaDesc")."<br>";
print $langs->trans("ECMAreaDesc2")."<br>"; print $langs->trans("ECMAreaDesc2")."<br>";
print "<br>\n"; print "<br>\n";
// Confirm remove file
if ($_GET['action'] == 'delete')
{
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>';
}
print '<table class="notopnoleftnoright" width="100%"><tr><td width="50%">'; if ($mesg) { print $mesg."<br>"; }
// Left area
// Tool bar // Tool bar
$selected='file_manager'; $selected='file_manager';
...@@ -155,14 +228,18 @@ if (eregi('search',$action)) $selected='search_form'; ...@@ -155,14 +228,18 @@ if (eregi('search',$action)) $selected='search_form';
$head = ecm_prepare_head_fm($fac); $head = ecm_prepare_head_fm($fac);
dolibarr_fiche_head($head, $selected, '', 1); dolibarr_fiche_head($head, $selected, '', 1);
print '<table class="noborder" width="100%"><tr><td>';
print '<table class="border" width="100%"><tr><td width="40%">';
// Left area
print '<table class="nobordernopadding" width="100%"><tr><td>';
if (eregi('search',$action)) if (eregi('search',$action))
{ {
//print_fiche_titre($langs->trans("ECMManualOrg")); //print_fiche_titre($langs->trans("ECMManualOrg"));
print '<form method="post" action="'.DOL_URL_ROOT.'/ecm/search.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/ecm/search.php">';
print '<table class="noborder" width="100%">'; print '<table class="nobordernopadding" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td colspan="3">'.$langs->trans("ECMSearchByKeywords").'</td></tr>'; print '<td colspan="3">'.$langs->trans("ECMSearchByKeywords").'</td></tr>';
print "<tr ".$bc[false]."><td>".$langs->trans("Ref").':</td><td><input type="text" name="search_ref" class="flat" size="18"></td>'; print "<tr ".$bc[false]."><td>".$langs->trans("Ref").':</td><td><input type="text" name="search_ref" class="flat" size="18"></td>';
...@@ -202,8 +279,11 @@ if (eregi('search',$action)) ...@@ -202,8 +279,11 @@ if (eregi('search',$action))
} }
if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $action == 'delete')
{ {
$userstatic = new User($db);
$ecmdirstatic = new ECMDirectory($db);
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section') if ($_GET['action'] == 'delete_section')
{ {
...@@ -211,14 +291,12 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -211,14 +291,12 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
print '<br>'; print '<br>';
} }
if ($mesg) { print $mesg."<br>"; }
// Construit liste des rpertoires // Construit liste des rpertoires
print '<table width="100%" class="nobordernopadding">'; print '<table width="100%" class="nobordernopadding">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre" colspan="5" align="right">'; print '<td class="liste_titre" align="left">'.$langs->trans("ECMSections").'</td>';
print '<td class="liste_titre" colspan="4" align="right">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=refreshmanual">'.$langs->trans("Refresh").' '.img_picto($langs->trans("Refresh"),'refresh').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=refreshmanual">'.$langs->trans("Refresh").' '.img_picto($langs->trans("Refresh"),'refresh').'</a>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
...@@ -226,13 +304,15 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -226,13 +304,15 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
if (sizeof($sectionauto)) if (sizeof($sectionauto))
{ {
// Automatic sections title line // Automatic sections title line
print '<tr '.$bc[false].'><td>'; print '<tr>';
print '<td>';
print '<table class="nobordernopadding"><tr class="nobordernopadding">'; print '<table class="nobordernopadding"><tr class="nobordernopadding">';
print '<td align="left" width="24px">'; print '<td align="left" width="24px">';
print img_picto_common('','treemenu/base.gif'); print img_picto_common('','treemenu/base.gif');
print '</td><td align="left">'.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionAuto").')'; print '</td><td align="left">'.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionAuto").')';
print '</td>'; print '</td>';
print '</tr></table></td>'; print '</tr></table>';
print '</td>';
print '<td align="right">&nbsp;</td>'; print '<td align="right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>'; print '<td align="right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>'; print '<td align="right">&nbsp;</td>';
...@@ -243,7 +323,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -243,7 +323,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
//print '<td align="right">'.$langs->trans("ECMNbOfDocsSmall").' <a href="'.$_SERVER["PHP_SELF"].'?action=refreshauto">'.img_picto($langs->trans("Refresh"),'refresh').'</a></td>'; //print '<td align="right">'.$langs->trans("ECMNbOfDocsSmall").' <a href="'.$_SERVER["PHP_SELF"].'?action=refreshauto">'.img_picto($langs->trans("Refresh"),'refresh').'</a></td>';
print '</tr>'; print '</tr>';
$sectionauto=dol_sort_array($sectionauto,'label',$sortorder,true,false); $sectionauto=dol_sort_array($sectionauto,'label','ASC',true,false);
$nbofentries=0; $nbofentries=0;
$oldvallevel=0; $oldvallevel=0;
...@@ -253,7 +333,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -253,7 +333,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
{ {
$var=false; $var=false;
print '<tr '.$bc[$var].'>'; print '<tr>';
// Section // Section
print '<td align="left">'; print '<td align="left">';
...@@ -261,8 +341,8 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -261,8 +341,8 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
print tree_showpad($sectionauto,$key); print tree_showpad($sectionauto,$key);
print '</td><td valign="top">'; print '</td><td valign="top">';
print img_picto('','object_dir'); print img_picto('','object_dir');
print '</td><td>'; print '</td><td valign="middle">&nbsp;';
print '&nbsp; <a href="'.DOL_URL_ROOT.'/ecm/docother.php">'; print '<a href="'.DOL_URL_ROOT.'/ecm/docother.php">';
print $val['label']; print $val['label'];
print '</a></td></tr></table>'; print '</a></td></tr></table>';
print "</td>\n"; print "</td>\n";
...@@ -294,7 +374,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -294,7 +374,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
} }
// Manual sections title line // Manual sections title line
print '<tr '.$bc[false].'><td>'; print '<tr><td>';
print '<table class="nobordernopadding"><tr class="nobordernopadding">'; print '<table class="nobordernopadding"><tr class="nobordernopadding">';
print '<td align="left" width="24px">'; print '<td align="left" width="24px">';
print img_picto_common('','treemenu/base.gif'); print img_picto_common('','treemenu/base.gif');
...@@ -304,22 +384,33 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -304,22 +384,33 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
print '<td align="right">'; print '<td align="right">';
print '</td>'; print '</td>';
print '<td align="right">&nbsp;</td>'; print '<td align="right">&nbsp;</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create">'.img_edit_add().'</a></td>'; //print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create">'.img_edit_add().'</a></td>';
print '<td align="right">&nbsp;</td>';
print '<td align="center">'; print '<td align="center">';
$htmltooltip=$langs->trans("ECMAreaDesc2"); $htmltooltip=$langs->trans("ECMAreaDesc2");
print $form->textwithhelp('',$htmltooltip,1,0); print $form->textwithhelp('',$htmltooltip,1,0);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
$ecmdirstatic = new ECMDirectory($db); $fulltree=$ecmdirstatic->get_full_arbo();
$rub=$ecmdirstatic->get_full_arbo();
$userstatic = new User($db); // Define fullpathselected ( _x_y_z )
$fullpathselected='';
foreach($fulltree as $key => $val)
{
//print $val['id']."-".$section."<br>";
if ($val['id'] == $section)
{
$fullpathselected=$val['fullpath'];
break;
}
}
//print "fullpathselected=".$fullpathselected."<br>";
$nbofentries=0; $nbofentries=0;
$oldvallevel=0; $oldvallevel=0;
$var=true; $var=true;
foreach($rub as $key => $val) foreach($fulltree as $key => $val)
{ {
$var=false; $var=false;
...@@ -336,17 +427,46 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -336,17 +427,46 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
$val['cachenbofdoc']=$result; $val['cachenbofdoc']=$result;
} }
// Show line if level 1 or level selected
$showline=0;
$fullpathparent=eregi_replace('_[^_]+$','',$val['fullpath']);
// If directory is son of selected directory, we show line
if ($val['id_mere'] == $section) $showline=5;
// If directory is brother of selected directory, we show line
elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) $showline=4;
// If directory is parent of selected directory or is selected directory, we show line
elseif (eregi($val['fullpath'].'_',$fullpathselected.'_')) $showline=3;
// If parent directory is in a same path than selected directory
elseif (eregi($fullpathparent.'_',$fullpathselected.'_')) $showline=2;
// If we are level one we show line
elseif ($val['level'] < 2) $showline=1;
if ($showline)
{
print '<tr>';
print '<tr '.$bc[$var].'>'; // Show tree graph pictos
// Section
print '<td align="left">'; print '<td align="left">';
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>'; print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
print tree_showpad($rub,$key); print tree_showpad($fulltree,$key);
print '</td><td valign="top">'; print '</td>';
print $ecmdirstatic->getNomUrl(1,'index'); // Show picto
print '</td><td>'; print '<td valign="top">';
print '&nbsp;</td></tr></table>'; //print $fullpathparent.'-'.$val['fullpath']."(".$showline.")";
if ($showline == 5) print img_picto('','/theme/common/treemenu/plustop2.gif','',1).img_picto('','/theme/common/treemenu/folder.gif','',1);
elseif ($showline == 4) print img_picto('','/theme/common/treemenu/plustop2.gif','',1).img_picto('','/theme/common/treemenu/folder.gif','',1);
elseif ($showline == 3) print img_picto('','/theme/common/treemenu/minustop2.gif','',1).img_picto('','/theme/common/treemenu/folder-expanded.gif','',1);
elseif ($showline == 2) print img_picto('','/theme/common/treemenu/plustop2.gif','',1).img_picto('','/theme/common/treemenu/folder.gif','',1);
elseif ($showline == 1) print img_picto('','/theme/common/treemenu/plustop2.gif','',1).img_picto('','/theme/common/treemenu/folder.gif','',1);
print '</td>';
// Show link
print '<td valign="middle">';
if ($section == $val['id']) print ' <u>';
print $ecmdirstatic->getNomUrl(0,'index');
if ($section == $val['id']) print '</u>';
print '</td>';
print '<td>&nbsp;</td>';
print '</tr></table>';
print "</td>\n"; print "</td>\n";
// Nb of docs // Nb of docs
...@@ -356,7 +476,8 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -356,7 +476,8 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$val['id'].'">'.img_edit().'</a></td>'; print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$val['id'].'">'.img_edit().'</a></td>';
// Add link // Add link
print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>'; //print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>';
print '<td align="right">&nbsp;</td>';
// Info // Info
print '<td align="center">'; print '<td align="center">';
...@@ -371,6 +492,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -371,6 +492,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
print "</td>"; print "</td>";
print "</tr>\n"; print "</tr>\n";
}
$oldvallevel=$val['level']; $oldvallevel=$val['level'];
$nbofentries++; $nbofentries++;
...@@ -385,32 +507,49 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) ...@@ -385,32 +507,49 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
print "</table>"; print "</table>";
// Fin de zone Ajax // Fin de zone Ajax
// Actions buttons
print '<div class="tabsAction">';
if ($user->rights->ecm->setup)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create">'.$langs->trans('ECMAddSection').'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>';
}
print '</div>';
} }
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td>'; print '</td><td valign="top">';
// Right area // Right area
$relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_ASC:SORT_DESC),1);
$formfile=new FormFile($db);
$param='&amp;section='.$section;
$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->create,1);
// print '<table width="100%" class="border">';
// print '<tr><td> </td></tr></table>';
print '</td></tr></table>';
print '</td></tr>';
// Actions buttons
print '<tr height="22"><td align="center">';
if ($user->rights->ecm->setup)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create">'.$langs->trans('ECMAddSection').'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>';
}
print '</td><td>';
if ($user->rights->ecm->create && ! empty($section))
{
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/index.php','',0,$section,1);
}
else print '&nbsp;';
print '</td></tr>';
print '</table>';
print '<br>'; print '<br>';
......
...@@ -46,7 +46,7 @@ class FormFile ...@@ -46,7 +46,7 @@ class FormFile
/** /**
* \brief Affiche formulaire ajout fichier * \brief Show file add form
* \param url Url * \param url Url
* \param titre Titre zone * \param titre Titre zone
* \param addcancel 1=Ajoute un bouton 'Annuler' * \param addcancel 1=Ajoute un bouton 'Annuler'
...@@ -98,7 +98,7 @@ class FormFile ...@@ -98,7 +98,7 @@ class FormFile
print "</table>"; print "</table>";
print '</form>'; print '</form>';
print '<br>'; if (empty($sectionid)) print '<br>';
print "\n<!-- End form attach new file -->\n\n"; print "\n<!-- End form attach new file -->\n\n";
} }
...@@ -384,17 +384,18 @@ class FormFile ...@@ -384,17 +384,18 @@ class FormFile
* \param forcedownload Mime type is forced to 'application/binary' to have a download * \param forcedownload Mime type is forced to 'application/binary' to have a download
* \param relativepath Relative path of docs (autodefined if not provided) * \param relativepath Relative path of docs (autodefined if not provided)
* \param permtodelete Permission to delete * \param permtodelete Permission to delete
* \param useinecm Change output for use in ecm module
* \return int <0 if KO, nb of files shown if OK * \return int <0 if KO, nb of files shown if OK
*/ */
function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1) function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0)
{ {
global $user, $conf, $langs; global $user, $conf, $langs;
global $bc; global $bc;
global $sortfield, $sortorder; global $sortfield, $sortorder;
// Affiche liste des documents existant // Affiche liste des documents existant
print_titre($langs->trans("AttachedFiles")); if (empty($useinecm)) print_titre($langs->trans("AttachedFiles"));
else { $bc[true]=''; $bc[false]=''; };
$url=$_SERVER["PHP_SELF"]; $url=$_SERVER["PHP_SELF"];
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
......
...@@ -24,13 +24,14 @@ ...@@ -24,13 +24,14 @@
* \version $Id$ * \version $Id$
*/ */
/** /**
* Show picto of a tree view * Show picto of a tree view
* *
* @param unknown_type $tab Array of entries in correct order * @param unknown_type $tab Array of entries in correct order
* @param unknown_type $key Key of value * @param unknown_type $key Key of value to show picto
*/ */
function tree_showpad(&$tab,$key) function tree_showpad(&$tab,$key,$selected=0)
{ {
$pos=1; $pos=1;
while ($pos <= $tab[$key]['level'] && $tab[$key]['level'] > 0) while ($pos <= $tab[$key]['level'] && $tab[$key]['level'] > 0)
...@@ -54,8 +55,6 @@ function tree_showpad(&$tab,$key) ...@@ -54,8 +55,6 @@ function tree_showpad(&$tab,$key)
// ------------------------------- Used by enu editor ----------------- // ------------------------------- Used by enu editor -----------------
/** /**
......
htdocs/theme/common/treemenu/branch.gif

70 B | W: | H:

htdocs/theme/common/treemenu/branch.gif

70 B | W: | H:

htdocs/theme/common/treemenu/branch.gif
htdocs/theme/common/treemenu/branch.gif
htdocs/theme/common/treemenu/branch.gif
htdocs/theme/common/treemenu/branch.gif
  • 2-up
  • Swipe
  • Onion skin
htdocs/theme/common/treemenu/branchbottom.gif

72 B | W: | H:

htdocs/theme/common/treemenu/branchbottom.gif

66 B | W: | H:

htdocs/theme/common/treemenu/branchbottom.gif
htdocs/theme/common/treemenu/branchbottom.gif
htdocs/theme/common/treemenu/branchbottom.gif
htdocs/theme/common/treemenu/branchbottom.gif
  • 2-up
  • Swipe
  • Onion skin
htdocs/theme/common/treemenu/branchtop.gif

67 B | W: | H:

htdocs/theme/common/treemenu/branchtop.gif

67 B | W: | H:

htdocs/theme/common/treemenu/branchtop.gif
htdocs/theme/common/treemenu/branchtop.gif
htdocs/theme/common/treemenu/branchtop.gif
htdocs/theme/common/treemenu/branchtop.gif
  • 2-up
  • Swipe
  • Onion skin
htdocs/theme/common/treemenu/line.gif

63 B | W: | H:

htdocs/theme/common/treemenu/line.gif

67 B | W: | H:

htdocs/theme/common/treemenu/line.gif
htdocs/theme/common/treemenu/line.gif
htdocs/theme/common/treemenu/line.gif
htdocs/theme/common/treemenu/line.gif
  • 2-up
  • Swipe
  • Onion skin
htdocs/theme/common/treemenu/minus.gif

91 B | W: | H:

htdocs/theme/common/treemenu/minus.gif

130 B | W: | H:

htdocs/theme/common/treemenu/minus.gif
htdocs/theme/common/treemenu/minus.gif
htdocs/theme/common/treemenu/minus.gif
htdocs/theme/common/treemenu/minus.gif
  • 2-up
  • Swipe
  • Onion skin
htdocs/theme/common/treemenu/minustop2.gif

127 B

htdocs/theme/common/treemenu/plus.gif

94 B | W: | H:

htdocs/theme/common/treemenu/plus.gif

134 B | W: | H:

htdocs/theme/common/treemenu/plus.gif
htdocs/theme/common/treemenu/plus.gif
htdocs/theme/common/treemenu/plus.gif
htdocs/theme/common/treemenu/plus.gif
  • 2-up
  • Swipe
  • Onion skin
htdocs/theme/common/treemenu/plusbottom.gif

93 B | W: | H:

htdocs/theme/common/treemenu/plusbottom.gif

133 B | W: | H:

htdocs/theme/common/treemenu/plusbottom.gif
htdocs/theme/common/treemenu/plusbottom.gif
htdocs/theme/common/treemenu/plusbottom.gif
htdocs/theme/common/treemenu/plusbottom.gif
  • 2-up
  • Swipe
  • Onion skin
htdocs/theme/common/treemenu/plustop2.gif

133 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment