Beispiel #1
0
print '<!-- Page called with mode=' . $mode . ' url=' . $_SERVER["PHP_SELF"] . '?' . $_SERVER["QUERY_STRING"] . ' -->' . "\n";
$param = '';
$param .= ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '');
$url = DOL_URL_ROOT . '/ecm/index.php';
// Dir scan
if ($type == 'directory') {
    $formfile = new FormFile($db);
    $maxlengthname = 40;
    // Right area. If module is defined, we are in automatic ecm.
    if ($module == 'company') {
        $upload_dir = $conf->societe->dir_output;
        // TODO change for multicompany sharing
        $filearray = dol_dir_list($upload_dir, "files", 1, '', array('^SPECIMEN\\.pdf$', '^\\.', '\\.meta$', '^temp$', '^payments$', '^CVS$', '^thumbs$'), $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
        $param .= '&module=' . $module;
        $textifempty = $section ? $langs->trans("NoFileFound") : ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("NoFileFound"));
        $formfile->list_of_autoecmfiles($upload_dir, $filearray, $module, $param, 1, '', $user->rights->ecm->upload, 1, $textifempty, $maxlengthname, $url);
    } else {
        if ($module == 'invoice') {
            $upload_dir = $conf->facture->dir_output;
            $filearray = dol_dir_list($upload_dir, "files", 1, '', array('^SPECIMEN\\.pdf$', '^\\.', '\\.meta$', '^temp$', '^payments$', '^CVS$', '^thumbs$'), $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
            $param .= '&module=' . $module;
            $textifempty = $section ? $langs->trans("NoFileFound") : ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("NoFileFound"));
            $formfile->list_of_autoecmfiles($upload_dir, $filearray, $module, $param, 1, '', $user->rights->ecm->upload, 1, $textifempty, $maxlengthname, $url);
        } else {
            if ($module == 'invoice_supplier') {
                $relativepath = 'facture';
                $upload_dir = $conf->fournisseur->dir_output . '/' . $relativepath;
                $filearray = dol_dir_list($upload_dir, "files", 1, '', array('^SPECIMEN\\.pdf$', '^\\.', '\\.meta$', '^temp$', '^CVS$', '^thumbs$'), $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
                $param .= '&module=' . $module;
                $textifempty = $section ? $langs->trans("NoFileFound") : ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("NoFileFound"));
                $formfile->list_of_autoecmfiles($upload_dir, $filearray, $module, $param, 1, '', $user->rights->ecm->upload, 1, $textifempty, $maxlengthname, $url);