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'));
41$action =
GETPOST(
'action',
'aZ09');
46if ($user->socid > 0) {
48 $socid = $user->socid;
51$backtopage =
GETPOST(
'backtopage',
'alpha');
54$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
55$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
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->hasRight(
'ecm',
'setup');
111$permissiontoread = $user->hasRight(
'ecm',
'read');
113if (!$permissiontoread) {
122include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
129llxHeader(
'', $langs->trans(
'EcmFiles'),
'',
'', 0, 0,
'',
'',
'',
'mod-ecm page-file_note');
131$form =
new Form($db);
133$object->section_id = $ecmdir->id;
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>';
171dol_banner_tab($object,
'', $linkback, 0,
'',
'', $s);
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( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage ECM directories.
Class to manage ECM files.
ecm_file_prepare_head($object)
Prepare array with list of tabs.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.