19 include_once (
"FREEDOM/freedom_import_tar.php");
25 if (intval(ini_get(
"max_execution_time")) < 300) ini_set(
"max_execution_time", 300);
30 if ($handle = opendir(
$ldir)) {
31 while (
false !== (
$file = readdir($handle))) {
32 if (
$file[0] !=
".") {
45 $ttar[0][
"selected"] =
"selected";
46 $selfile = $ttar[0][
"filename"];
57 $action->lay->set(
"huge", (
$action->Read(
"navigator",
"") ==
"EXPLORER") ?
"" :
"huge");
59 $action->lay->Set(
"nbdoc",
"$nbdoc");
60 $action->lay->Set(
"importtext", sprintf(_(
"proceed background import of %d documents") , $nbdoc));
73 $selectclass = array();
78 foreach ($tclassdoc as $k => $cdoc) {
79 $selectclass[$k][
"idcdoc"] = $cdoc[
"initid"];
80 $selectclass[$k][
"classname"] = $cdoc[
"title"];
81 if ($cdoc[
"initid"] ==
$famid) $selectclass[$k][
"selected"] =
"selected";
82 else $selectclass[$k][
"selected"] =
"";
84 $action->lay->SetBlockData(
"SELECTCLASS", $selectclass);
87 foreach ($tclassdoc as $k => $cdoc) {
88 $selectfld[$k][
"idcdoc"] = $cdoc[
"initid"];
89 $selectfld[$k][
"classname"] = $cdoc[
"title"];
90 if ($cdoc[
"initid"] == $dfldid) $selectfld[$k][
"selected"] =
"selected";
91 else $selectfld[$k][
"selected"] =
"";
94 $action->lay->SetBlockData(
"SELECTDFLD", $selectfld);
99 $dirtitle =
$dir->title;
100 if (!method_exists(
$dir,
"addfile")) {
101 $action->AddWarningMsg(sprintf(_(
"The document <%s> is not a folder") , $dirtitle));
104 $dirtitle =
$dir->title;
106 $action->AddWarningMsg(sprintf(_(
"Use your home folder instead <%s>") , $dirtitle));
120 $dirtitle = $dirtitle .
"/" . $pdir->title;
124 else $onlycsv = ($onlycsv !=
"2");
128 foreach ($tr as $k => $v) {
129 if ($v[
"familyid"] > 0) {
131 $tr[$k][
"familyname"] = $f->title;
132 $tr[$k][
"foldername"] = $dirtitle .
'/' . substr($v[
"foldername"],
strposn($v[
"foldername"],
'/', 6));
134 $tr[$k][
"familyname"] =
"";
135 $tr[$k][
"foldername"] =
"";
140 $action->lay->Set(
"dirid", $dirid);
141 $action->lay->SetBlockCorresp(
"ADDEDDOC",
"filename");
142 $action->lay->SetBlockCorresp(
"ADDEDDOC",
"err");
143 $action->lay->SetBlockCorresp(
"ADDEDDOC",
"anaclass");
144 $action->lay->SetBlockData(
"ADDEDDOC", $tr);
145 $action->lay->Set(
"selfile", stripslashes($selfile));
146 $action->lay->Set(
"oselected", $onlycsv ?
"checked" :
"");
147 $action->lay->Set(
"notoselected", $onlycsv ?
"" :
"checked");
148 $action->lay->Set(
"tselected", $topfld ?
"checked" :
"");
149 $action->lay->Set(
"fdisabled", $onlycsv ?
"disabled" :
"");
151 $action->lay->Set(
"bgdisabled", (count($tr) > 0) ?
"" :
"disabled");
161 for ($j = 0; $j < $i; $j++) {
162 $p = strpos(
$s,
$c, $p);
165 if ($p == 0) $p = strlen(
$s);
171 $found = file_exists(
"$dir/fdl.csv");
173 if ($handle = opendir(
$dir)) {
174 while ((!$found) && (
false !== (
$file = readdir($handle)))) {
175 if (is_dir(
"$dir/$file")) {
176 $found = file_exists(
"$dir/$file/fdl.csv");