Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
editexport.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Export edition
8  *
9  * @author Anakeen
10  * @version $Id: editexport.php,v 1.4 2008/11/13 17:25:29 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Doc.php");
18 include_once ("FDL/Lib.Dir.php");
19 include_once ("GENERIC/generic_util.php");
20 
22 {
23  $dbaccess = $action->dbaccess;
24  $docid = GetHttpVars("id", 0);
25  $action->parent->addJsRef("lib/jquery/jquery.js");
26  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
27  $action->parent->AddJsRef("FDL:editexport.js", true);
29  $exportId = uniqid("export");
30  $action->lay->Set("dirid", $doc->id);
31  $action->lay->Set("title", $doc->getHTMLTitle());
32  $action->lay->Set("exportid", $exportId);
33  $famid = 0;
34  $tclassdoc = GetClassesDoc($dbaccess, $action->user->id, $famid, "TABLE");
35  $selectclass = array();
36  $pref = getFamilyParameters($action, "FREEDOM_EXPORTCOLS");
37  $tfam = array_keys($pref);
38  foreach ($tclassdoc as $k => $cdoc) {
39  $selectclass[$k]["idcdoc"] = $cdoc["id"];
40  $selectclass[$k]["classname"] = getFamTitle($cdoc);
41  $selectclass[$k]["pref"] = in_array($cdoc["id"], $tfam);
42  }
43  $action->lay->setBlockData("coptions", $selectclass);
44 
45  $csvSeparator = $action->getParam("EXPORT_CSVSEPARATOR");
46  $csvEnclosure = $action->getParam("EXPORT_CSVENCLOSURE");
47 
48  $action->lay->set("selectDoubleQuote", false);
49  $action->lay->set("selectSimpleQuote", false);
50  $action->lay->set("customEnclosure", false);
51  $action->lay->set("customSeparator", false);
52  $action->lay->set("selectComma", false);
53 
54  if ($csvSeparator === ",") {
55  $action->lay->set("selectComma", true);
56  } elseif ($csvSeparator !== ";") {
57  $action->lay->set("customSeparator", $csvSeparator);
58  }
59 
60  if ($csvEnclosure === '"') {
61  $action->lay->set("selectDoubleQuote", true);
62  } elseif ($csvEnclosure === "'") {
63  $action->lay->set("selectSimpleQuote", true);
64  } elseif ($csvEnclosure !== "") {
65  $action->lay->set("customEnclosure", $csvEnclosure);
66  }
67 
68  if ($action->canExecute("EXPORTFOLDER", "DOCADMIN") == "" && preg_match('/\\/admin.php$/', $_SERVER["SCRIPT_NAME"])) {
69  $action->lay->set("exportaction", "EXPORTFOLDER");
70  $action->lay->set("exportapp", "DOCADMIN");
71  $action->lay->set("viewinfo", true);
72  } else {
73  $action->lay->set("exportaction", "EXPORTFLD");
74  $action->lay->set("exportapp", "FDL");
75  $action->lay->set("viewinfo", false);
76  }
77 }
global $action
$csvEnclosure
Set($name, &$parent)
getFamilyParameters(&$action, $key)
$docid
Definition: cleanFamily.php:13
GetClassesDoc($dbaccess, $userid, $classid=0, $qtype="LIST", $extraFilters=array())
Definition: Lib.Dir.php:906
canExecute($actname, $appid="")
getFamTitle(&$tdoc)
$csvSeparator
editexport(Action &$action)
Definition: editexport.php:21
global $_SERVER
new_Doc($dbaccess, $id= '', $latest=false)
getParam($name, $def="")
$dbaccess
Definition: checkVault.php:17
← centre documentaire © anakeen