22require_once __DIR__ .
'/abstractdocument.controller.class.php';
23include_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
47 return parent::checkAccess();
59 if (!
$context->controllerInstance->checkAccess()) {
63 $langs->loadLangs(array(
'other',
'webportal@webportal'));
64 $context->title = $langs->trans(
'MyDocuments');
65 $context->desc = $langs->trans(
'ListOfMyDocuments');
66 $context->menu_active[] =
'document_list';
80 if (!
$context->controllerInstance->checkAccess()) {
89 print
'<main class="container">';
91 $thirdparty =
$context->logged_thirdparty;
93 if (!empty($thirdparty) && $thirdparty->id) {
95 require_once DOL_DOCUMENT_ROOT .
'/core/lib/functions.lib.php';
96 $client_dir_name = $thirdparty->id;
97 $dir_ged_tiers =
$conf->societe->multidir_output[$thirdparty->entity ??
$conf->entity].
"/".$client_dir_name;
98 $fileList =
dol_dir_list($dir_ged_tiers,
'files', 0,
'',
'',
'date', SORT_DESC, 1);
107 $linkBuilder =
static function (array $file) use ($client_dir_name) {
108 return DOL_URL_ROOT .
'/document.php?modulepart=societe&attachment=1&file=' . urlencode($client_dir_name .
'/' . $file[
'name']);
112 $linkBuilderArray = [
113 'file' => $linkBuilder
118 $langs->trans(
'MyDocuments'),
120 $langs->trans(
'NoDocumentAvailable'),
displayDocumentTable($title, $itemList, $emptyMessage, array $linkBuilder)
Renders an HTML file browser table for a given list of files and directories.
static getInstance()
Singleton method to create one instance of this object.
display404()
Display error template.
loadTemplate($templateName, $vars=false)
Load a template .tpl file.
Class for DocumentListController.
action()
Action method is called before HTML output.
display()
Build and display the page.
checkAccess()
Check access rights for this page.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
$context
@method int call_trigger(string $triggerName, ?User $user)