Core  3.2
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  * @package FDL
5 */
6 /**
7  * Generated Header (not documented yet)
8  *
9  * @author Anakeen
10  * @version $Id: freedom_editimport.php,v 1.8 2008/08/14 09:59:14 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 // ---------------------------------------------------------------
17 include_once ("FDL/import_file.php");
18 include_once ("FDL/Lib.Dir.php");
19 // -----------------------------------
21 {
22 
23  $usage = new ActionUsage($action);
24  $usage->setDefinitionText("Import document interface");
25  $classid = $usage->addOptionalParameter("classid", "family used to view schema");
26  $dirid = $usage->addOptionalParameter("dirid", "directory to place imported doc");
27  $descr = ($usage->addOptionalParameter("descr", "view information", array(
28  "Y",
29  "N"
30  ) , "Y") == "Y");
31  $policy = ($usage->addOptionalParameter("policy", "view policy options", array(
32  "Y",
33  "N"
34  ) , "Y") == "Y");
35  $usage->setStrictMode(false);
36  $usage->verify();
37  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
38  $action->parent->addJsRef("lib/jquery/jquery.js");
39  $action->parent->addJsRef("lib/jquery-ui/js/jquery-ui.js");
40  $action->parent->addJsRef("FREEDOM:freedom_editimport.js");
41  $action->parent->addCssRef("css/dcp/jquery-ui.css");
42  $action->parent->addCssRef("FREEDOM:freedom_editimport.css");
43 
44  $dbaccess = $action->dbaccess;
45  // build list of class document
46  $query = new QueryDb($dbaccess, "Doc");
47  $query->AddQuery("doctype='C'");
48 
49  $selectclass = array();
50 
51  $tclassdoc = GetClassesDoc($dbaccess, $action->user->id, 0, "TABLE");
52 
53  foreach ($tclassdoc as $k => $cdoc) {
54  $selectclass[$k]["idcdoc"] = $cdoc["initid"];
55  $selectclass[$k]["classname"] = $cdoc["title"];
56  if ($cdoc["initid"] == $classid) $selectclass[$k]["selected"] = "selected";
57  else $selectclass[$k]["selected"] = "";
58  }
59 
60  $action->lay->SetBlockData("SELECTCLASS", $selectclass);
61 
62  $action->lay->set("mailaddr", getMailAddr($action->user->id));
63  $action->lay->set("separator", $action->getParam("FREEDOM_CSVSEPARATOR"));
64  $action->lay->set("enclosure", $action->getParam("FREEDOM_CSVENCLOSURE"));
65  $action->lay->set("linebreak", $action->getParam("FREEDOM_CSVLINEBREAK"));
66 
67  $action->lay->Set("descr", (bool)$descr);
68  $action->lay->Set("policy", (bool)$policy);
69 
70  $action->lay->eSet("dirid", $dirid);
71 }
freedom_editimport(Action &$action)
global $action
getMailAddr($userid, $full=false)
Definition: Lib.Common.php:133
Set($name, &$parent)
GetClassesDoc($dbaccess, $userid, $classid=0, $qtype="LIST", $extraFilters=array())
Definition: Lib.Dir.php:906
Verify arguments for action function.
getParam($name, $def="")
$dbaccess
Definition: checkVault.php:17
if(($docid!==0)&&(!is_numeric($docid))) $query
$usage
← centre documentaire © anakeen