17 include_once (
"FDL/Class.DocFam.php");
18 include_once (
"FDL/Class.DocSearch.php");
19 include_once (
"FDL/Class.Dir.php");
20 include_once (
"FDL/Class.QueryDir.php");
21 include_once (
"FDL/Lib.Attr.php");
22 include_once (
"FDL/Class.DocAttrLDAP.php");
23 require_once (
"WHAT/Lib.FileMime.php");
25 define(
"ALTSEPCHAR",
' --- ');
26 define(
"SEPCHAR",
';');
32 $dirid = GetHttpVars(
"dirid", 0);
35 $analyze = (GetHttpVars(
"analyze",
"N") ==
"Y");
36 $policy = GetHttpVars(
"policy",
"update");
37 $reinit = GetHttpVars(
"reinitattr");
38 $reset = GetHttpVars(
"reset");
39 $comma = GetHttpVars(
"comma",
SEPCHAR);
42 $if->setImportDirectory(
$dirid);
45 $if->reinitAttribute(
$reinit ==
"yes");
47 $if->setComma($comma);
66 ) , $prevalues = array() , $torder = array())
70 if ($tkey)
$o->setKey($tkey);
71 if ($torder)
$o->setOrder($torder);
76 if ($prevalues)
$o->setPreValues($prevalues);
77 return $o->import(
$data)->getImportResult();
84 $tmsg = $action->lay->GetBlockData(
"MSG");
88 $action->lay->SetBlockData(
"MSG", $tmsg);
99 return array_map(
"strtolower", array_map(
"trim", array_slice($orderdata, 4)));
104 global $importedFiles;
109 if (isset($importedFiles[
$path])) {
110 $vid = $importedFiles[
$path];
117 $err =
$vf->Store($path,
false, $vid);
124 $base = basename($path);
125 $importedFiles[
$path] =
"$mime|$vid|$base";
126 $vid =
"$mime|$vid|$base";
134 if (preg_match(
'/\.ods$/',
$filename))
return true;
135 $sys = trim(shell_exec(sprintf(
"file -bi %s", escapeshellarg(
$filename))));
136 if ($sys ==
"application/x-zip")
return true;
137 if ($sys ==
"application/vnd.oasis.opendocument.spreadsheet")
return true;
151 if (
$err ===
false)
return false;
newFreeVaultFile($dbaccess)
add_import_file(Action &$action, $fimport, $dirid=0)
getSysMimeFile($f, $fn="")
getOrder(array $orderdata)
foreach($argv as $arg) $cmd
getWshCmd($nice=false, $userid=0, $sudo=false)
AddVaultFile($dbaccess, $path, $analyze, &$vid)
setMaxExecutionTimeTo($limit)
csvAddDoc($dbaccess, $data, $dirid=0, $analyze=false, $ldir= '', $policy="add", $tkey=array("title"), $prevalues=array(), $torder=array())
if($file) if($subject==""&&$file) if($subject=="") $err