29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ecm.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmdirectory.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmfiles.class.php';
36 $langs->loadLangs(array(
'ecm'));
40 $socid =
GETPOST(
'socid',
'int');
41 $action =
GETPOST(
'action',
'aZ09');
44 $socid =
GETPOST(
"socid",
"int");
46 if ($user->socid > 0) {
48 $socid = $user->socid;
51 $backtopage =
GETPOST(
'backtopage',
'alpha');
53 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
54 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
55 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
57 if (empty($page) || $page == -1) {
60 $offset = $limit * $page;
61 $pageprev = $page - 1;
62 $pagenext = $page + 1;
70 $section =
GETPOST(
"section",
'alpha');
83 $result = $ecmdir->fetch(
GETPOST(
"section",
'alpha'));
88 $relativepath = $ecmdir->getRelativePath();
89 $upload_dir = $conf->ecm->dir_output.
'/'.$relativepath;
91 $fullpath = $conf->ecm->dir_output.
'/'.$relativepath.$urlfile;
93 $relativetodocument =
'ecm/'.$relativepath;
94 $filepath = $relativepath.$urlfile;
95 $filepathtodocument = $relativetodocument.$urlfile;
98 $object =
new ECMFiles($db);
101 $extrafields->fetch_name_optionals_label($object->table_element);
103 $result = $object->fetch(0,
'', $filepathtodocument);
109 $permissionnote = $user->rights->ecm->setup;
111 $permissiontoread = $user->rights->ecm->read;
113 if (!$permissiontoread) {
122 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
129 llxHeader(
'', $langs->trans(
'EcmFiles'));
133 $object->section_id = $ecmdir->id;
134 $object->label = $urlfile;
141 $tmpecmdir->fetch($ecmdir->id);
144 while ($tmpecmdir && $result > 0) {
145 $tmpecmdir->ref = $tmpecmdir->label;
146 $s = $tmpecmdir->getNomUrl(1).$s;
147 if ($tmpecmdir->fk_parent) {
149 $result = $tmpecmdir->fetch($tmpecmdir->fk_parent);
156 $urlfiletoshow = preg_replace(
'/\.noexe$/',
'', $urlfile);
158 $s =
img_picto(
'',
'object_dir').
' <a href="'.DOL_URL_ROOT.
'/ecm/index.php">'.$langs->trans(
"ECMRoot").
'</a> -> '.$s.
' -> ';
159 if ($action ==
'edit') {
160 $s .=
'<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfiletoshow.
'">';
162 $s .= $urlfiletoshow;
167 $linkback =
'<a href="'.$backtopage.
'">'.$langs->trans(
"BackToTree").
'</a>';
175 print
'<div class="fichecenter">';
176 print
'<div class="underbanner clearboth"></div>';
179 $cssclass =
"titlefield";
180 $moreparam =
'&section='.$section.
'&urlfile='.$urlfile;
181 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage ECM directories.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
ecm_file_prepare_head($object)
Prepare array with list of tabs.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
dol_sanitizePathName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a path name.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.