Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_editimport.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  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: freedom_editimport.php,v 1.8 2008/08/14 09:59:14 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/import_file.php");
20 include_once ("FDL/Lib.Dir.php");
21 // -----------------------------------
23 {
24  // -----------------------------------
25  // Get all the params
26  $classid = GetHttpVars("classid", 0); // doc familly
27  $dirid = GetHttpVars("dirid", 10); // directory to place imported doc (default unclassed folder)
28  $descr = (GetHttpVars("descr", "Y") == "Y"); // view info
29  $policy = (GetHttpVars("policy", "Y") == "Y"); // view policy
30  $dbaccess = $action->GetParam("FREEDOM_DB");
31 
32  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
33  // build list of class document
34  $query = new QueryDb($dbaccess, "Doc");
35  $query->AddQuery("doctype='C'");
36 
37  $selectclass = array();
38 
39  $doc = new_Doc($dbaccess, $classid);
40  $tclassdoc = GetClassesDoc($dbaccess, $action->user->id, $classid, "TABLE");
41 
42  while (list($k, $cdoc) = each($tclassdoc)) {
43  $selectclass[$k]["idcdoc"] = $cdoc["initid"];
44  $selectclass[$k]["classname"] = $cdoc["title"];
45  if ($cdoc["initid"] == $classid) $selectclass[$k]["selected"] = "selected";
46  else $selectclass[$k]["selected"] = "";
47  }
48 
49  $action->lay->SetBlockData("SELECTCLASS", $selectclass);
50 
51  $lattr = $doc->GetImportAttributes();
52  $format = "DOC;" . (($doc->name != "") ? $doc->name : $doc->id) . ";<special id>;<special dirid> ";
53 
54  $ttemp = explode(";", $format);
55  while (list($k, $v) = each($ttemp)) {
56  $tformat[$k]["labeltext"] = htmlentities($v, ENT_COMPAT, "UTF-8");
57  }
58 
59  while (list($k, $attr) = each($lattr)) {
60  $format.= "; " . $attr->getLabel();
61  $tformat[$k]["labeltext"] = $attr->getLabel();
62  }
63 
64  $action->lay->set("mailaddr", getMailAddr($action->user->id));
65 
66  $action->lay->SetBlockData("TFORMAT", $tformat);
67 
68  $action->lay->Set("cols", count($tformat));
69  $action->lay->Set("descr", $descr);
70  $action->lay->Set("policy", $policy);
71 
72  $action->lay->Set("dirid", $dirid);
73 
74  $action->lay->Set("format", $format);
75 }
76 ?>
← centre documentaire © anakeen - published under CC License - Dynacase