28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ecm.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmdirectory.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmfiles.class.php';
35 $langs->loadLangs(array(
'ecm'));
39 $socid =
GETPOST(
'socid',
'int');
40 $action =
GETPOST(
'action',
'aZ09');
43 $socid =
GETPOST(
"socid",
"int");
45 if ($user->socid > 0) {
47 $socid = $user->socid;
50 $backtopage =
GETPOST(
'backtopage',
'alpha');
52 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
53 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
54 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
56 if (empty($page) || $page == -1) {
59 $offset = $limit * $page;
60 $pageprev = $page - 1;
61 $pagenext = $page + 1;
69 $section =
GETPOST(
"section",
'alpha');
82 $result = $ecmdir->fetch(
GETPOST(
"section",
'alpha'));
87 $relativepath = $ecmdir->getRelativePath();
88 $upload_dir = $conf->ecm->dir_output.
'/'.$relativepath;
90 $fullpath = $conf->ecm->dir_output.
'/'.$relativepath.$urlfile;
92 $relativetodocument =
'ecm/'.$relativepath;
93 $filepath = $relativepath.$urlfile;
94 $filepathtodocument = $relativetodocument.$urlfile;
97 $object =
new ECMFiles($db);
100 $extrafields->fetch_name_optionals_label($object->table_element);
102 $result = $object->fetch(0,
'', $filepathtodocument);
108 $permissionnote = $user->rights->ecm->setup;
110 $permtoread = $user->rights->ecm->read;
121 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
128 llxHeader(
'', $langs->trans(
'EcmFiles'));
132 $object->section_id = $ecmdir->id;
133 $object->label = $urlfile;
140 $tmpecmdir->fetch($ecmdir->id);
143 while ($tmpecmdir && $result > 0) {
144 $tmpecmdir->ref = $tmpecmdir->label;
145 $s = $tmpecmdir->getNomUrl(1).$s;
146 if ($tmpecmdir->fk_parent) {
148 $result = $tmpecmdir->fetch($tmpecmdir->fk_parent);
155 $urlfiletoshow = preg_replace(
'/\.noexe$/',
'', $urlfile);
157 $s =
img_picto(
'',
'object_dir').
' <a href="'.DOL_URL_ROOT.
'/ecm/index.php">'.$langs->trans(
"ECMRoot").
'</a> -> '.$s.
' -> ';
158 if ($action ==
'edit') {
159 $s .=
'<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfiletoshow.
'">';
161 $s .= $urlfiletoshow;
166 $linkback =
'<a href="'.$backtopage.
'">'.$langs->trans(
"BackToTree").
'</a>';
174 print
'<div class="fichecenter">';
175 print
'<div class="underbanner clearboth"></div>';
178 $cssclass =
"titlefield";
179 $moreparam =
'&section='.$section.
'&urlfile='.$urlfile;
180 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizePathName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a path name.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
ecm_file_prepare_head($object)
Prepare array with list of tabs.
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.
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.
Class to manage ECM directories.