} else { dol_syslog("Failed to create directory " . $ecmdirtmp->label, LOG_ERR); } } else { $txt = "Parent of " . $dirdesc['fullname'] . " not found"; dol_syslog($txt); //print $txt."<br>\n"; } } } // Loop now on each sql tree to check if dir exists foreach ($sqltree as $dirdesc) { $dirtotest = $conf->ecm->dir_output . '/' . $dirdesc['fullrelativename']; if (!dol_is_dir($dirtotest)) { $ecmdirtmp->id = $dirdesc['id']; $ecmdirtmp->delete($user, 'databaseonly'); //exit; } } $sql = "UPDATE " . MAIN_DB_PREFIX . "ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown" dol_syslog("sql = " . $sql); $db->query($sql); // If a directory was added, the fulltree array is not correctly completed and sorted, so we clean // it to be sure that fulltree array is not used without reloading it. if ($adirwascreated) { $sqltree = null; } } /* * View
} if ($ok) { $id = $ecmdir->create($user); if ($id > 0) { header("Location: " . DOL_URL_ROOT . '/ecm/index.php?action=file_manager'); exit; } else { $langs->load("errors"); setEventMessage($langs->trans($ecmdir->error), 'errors'); setEventMessage($ecmdir->errors, 'errors'); $action = 'create'; } } } else { if ($action == 'confirm_deletesection' && $confirm == 'yes') { $result = $ecmdir->delete($user); setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label)); } } /* * View */ llxHeader(); $form = new Form($db); $formecm = new FormEcm($db); if ($action == 'create') { //*********************** // Create //*********************** print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';