Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_insertfld.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * insert the documents of $dirid in folder $id
8  *
9  * @author Anakeen
10  * @version $Id: freedom_insertfld.php,v 1.8 2005/06/28 08:37:46 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/Lib.Dir.php");
18 include_once ("FDL/freedom_util.php");
19 // -----------------------------------
21 {
22  // -----------------------------------
23  // insert the documents of $dirid in folder $id
24  // PrintAllHttpVars();
25  // Get all the params
26  $dirid = GetHttpVars("dirid"); // source folder
27  $docid = GetHttpVars("id"); // destination folder
28  $mode = GetHttpVars("mode", "latest");
29  $clean = GetHttpVars("clean", "N") == "Y"; // if want to clean source folder
30  $folio = GetHttpVars("folio", "N") == "Y"; // return in folio
31  $dbaccess = $action->dbaccess;
32  /*
33  * @var Dir $doc
34  */
36 
37  $err = "";
38 
39  if (!method_exists($doc, "addfile")) $action->exitError(sprintf(_("the document %s is not a container") , $doc->title));
40  if ($dirid > 0) {
41  $ldoc = internalGetDocCollection($dbaccess, $dirid, 0, "ALL", array() , 1, "TABLE");
42  $err = $doc->InsertMDoc($ldoc, $mode);
43  }
44  if ($err != "") $action->addWarningMsg($err);
45 
46  if ($clean) {
47  /*
48  * @var Dir $sfld
49  */
50  $sfld = new_Doc($dbaccess, $dirid);
51  $sfld->Clear();
52  }
53 
54  if ($folio) redirect($action, "FREEDOM", "FOLIOLIST&dirid=" . $doc->initid);
55  else redirect($action, "FREEDOM", "FREEDOM_VIEW&dirid=" . $doc->initid);
56 }
addWarningMsg($msg)
global $action
freedom_insertfld(Action &$action)
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
internalGetDocCollection($dbaccess, $dirid, $start="0", $slice="ALL", $sqlfilters=array(), $userid=1, $qtype="LIST", $fromid="", $distinct=false, $orderby="title", $latest=true, $trash="", &$debug=null, $folderRecursiveLevel=2, $join= '',\SearchDoc &$searchDoc=null)
Definition: Lib.Dir.php:428
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen