Platform  3.1
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  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * insert the documents of $dirid in folder $id
9  *
10  * @author Anakeen 2000
11  * @version $Id: freedom_insertfld.php,v 1.8 2005/06/28 08:37:46 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage GED
15  */
16 /**
17  */
18 
19 include_once ("FDL/Lib.Dir.php");
20 include_once ("FDL/freedom_util.php");
21 // -----------------------------------
23 {
24  // -----------------------------------
25  // insert the documents of $dirid in folder $id
26  // PrintAllHttpVars();
27  // Get all the params
28  $dirid = GetHttpVars("dirid"); // source folder
29  $docid = GetHttpVars("id"); // destination folder
30  $mode = GetHttpVars("mode", "latest");
31  $clean = GetHttpVars("clean", "N") == "Y"; // if want to clean source folder
32  $folio = GetHttpVars("folio", "N") == "Y"; // return in folio
33  $dbaccess = $action->GetParam("FREEDOM_DB");
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 = getChildDoc($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  $sfld = new_Doc($dbaccess, $dirid);
48  $sfld->Clear();
49  }
50 
51  if ($folio) redirect($action, "FREEDOM", "FOLIOLIST&dirid=" . $doc->initid);
52  else redirect($action, "FREEDOM", "FREEDOM_VIEW&dirid=" . $doc->initid);
53 }
54 ?>
← centre documentaire © anakeen - published under CC License - Dynacase