* * 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. */ /** * \file htdocs/ecm/docfile.php * \ingroup ecm * \brief Card of a file for ECM module * \version $Id$ * \author Laurent Destailleur */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/class/htmlecm.form.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php"); // Load traductions files $langs->load("ecm"); $langs->load("companies"); $langs->load("other"); $langs->load("users"); $langs->load("orders"); $langs->load("propal"); $langs->load("bills"); $langs->load("contracts"); $langs->load("categories"); // Load permissions $user->getrights('ecm'); if (!$user->rights->ecm->setup) accessforbidden(); // Get parameters $socid = isset($_GET["socid"])?$_GET["socid"]:''; $section=$_GET["section"]; if (! $section) $section='misc'; $upload_dir = $conf->ecm->dir_output.'/'.$section; $page=$_GET["page"]; $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"]; $limit = $conf->liste_limit; $offset = $limit * $page ; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="label"; $fileid=$_REQUEST["fileid"]; if (! $fileid) { dol_print_error('',"ErrorParamNotDefined"); exit; } $section=$_REQUEST["section"]; if (! $section) { dol_print_error('',"ErrorSectionParamNotDefined"); exit; } /* $ecmfile = new ECMFile($db); if (! empty($_GET["fileid"])) { $result=$ecmfile->fetch($_GET["fileid"]); if (! $result > 0) { dol_print_error($db,$ecmfile->error); exit; } } */ /******************************************************************* * ACTIONS * * Put here all code to do according to value of "action" parameter ********************************************************************/ /******************************************************************* * PAGE * * Put here all code to do according to value of "action" parameter ********************************************************************/ llxHeader(); $form=new Form($db); $formecm=new FormEcm($db); $head = ecm_prepare_head($ecmdir); dol_fiche_head($head, 'card', $langs->trans("ECMSectionManual")); if ($_GET["action"] == 'edit') { print '
'; print ''; print ''; print ''; } print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; if ($_GET["action"] == 'edit') { print ''; } print '
'.$langs->trans("Ref").''; $s=''; $tmpecmdir=new ECMDirectory($db); // Need to create a new one $tmpecmdir->fetch($ecmdir->id); $result = 1; $i=0; while ($tmpecmdir && $result > 0) { $tmpecmdir->ref=$tmpecmdir->label; if ($i == 0 && $_GET["action"] == 'edit') { $s=''; } else $s=$tmpecmdir->getNomUrl(1).$s; if ($tmpecmdir->fk_parent) { $s=' -> '.$s; $result=$tmpecmdir->fetch($tmpecmdir->fk_parent); } else { $tmpecmdir=0; } $i++; } print img_picto('','object_dir').' '.$langs->trans("ECMRoot").' -> '; print $s; print '
'.$langs->trans("Description").''; if ($_GET["action"] == 'edit') { print ''; } else print dol_nl2br($ecmdir->description); print '
'.$langs->trans("ECMCreationUser").''; $userecm=new User($db); $userecm->fetch($ecmdir->fk_user_c); print $userecm->getNomUrl(1); print '
'.$langs->trans("ECMCreationDate").''; print dol_print_date($ecmdir->date_c,'dayhour'); print '
'.$langs->trans("ECMDirectoryForFiles").''; //print $conf->ecm->dir_output; print '/ecm/'.$relativepath; print '
'.$langs->trans("ECMNbOfDocs").''; print sizeof($filearray); print '
'.$langs->trans("TotalSizeOfAttachedFiles").''; print dol_print_size($totalsize); print '
'; print ''; print '     '; print ''; print '
'; if ($_GET["action"] == 'edit') { print '
'; } print ''; if (! $_GET["action"] || $_GET["action"] == 'delete_section') { // Confirmation de la suppression d'une ligne categorie if ($_GET['action'] == 'delete_section') { $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); if ($ret == 'html') print '
'; } if ($mesg) { print $mesg."
"; } // Construit fiche rubrique // Actions buttons print '
'; if ($user->rights->ecm->setup) { print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } print '
'; } // End of page $db->close(); llxFooter('$Date$ - $Revision$'); ?>