29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/ecm.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmdirectory.class.php';
33require_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");
46if ($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');
56$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
57if (empty($page) || $page == -1) {
60$offset = $limit * $page;
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;
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;
113if (!$permissiontoread) {
122include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
131$form =
new Form($db);
133$object->section_id = $ecmdir->id;
134$object->label = $urlfile;
141$tmpecmdir->fetch($ecmdir->id);
144while ($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.
' -> ';
159if ($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>';
175print
'<div class="fichecenter">';
176print
'<div class="underbanner clearboth"></div>';
179$cssclass =
"titlefield";
180$moreparam =
'&section='.$section.
'&urlfile='.$urlfile;
181include 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.
Class to manage ECM files.
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='', $dragdropfile=0)
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.
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.