Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
editdfld.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: editdfld.php,v 1.8 2008/11/27 14:18:33 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 // ---------------------------------------------------------------
17 // $Id: editdfld.php,v 1.8 2008/11/27 14:18:33 eric Exp $
18 // $Source: /home/cvsroot/anakeen/freedom/freedom/Action/Freedom/editdfld.php,v $
19 // ---------------------------------------------------------------
20 include_once ("FDL/Lib.Dir.php");
21 
22 function editdfld(Action & $action)
23 {
24  $dbaccess = $action->dbaccess;
25  $docid = GetHttpVars("id", 0);
26  $firstfld = (GetHttpVars("current", "N") == "Y");
27 
28  $action->lay->eSet("TITLE", _("change root folder"));
29  /*
30  * @var DocFam $doc
31  */
33  $action->lay->rSet("docid", $doc->id);
34 
35  $action->lay->eSet("doctitle", $doc->getTitle());
36  $sqlfilters = array();
37  if ($firstfld) {
38  $fldid = $doc->cfldid;
39  $action->lay->eSet("TITLE", _("Change default search"));
40  $action->lay->rSet("current", "Y");
41 
42  $tclassdoc = internalGetDocCollection($dbaccess, $doc->dfldid, "0", "ALL", $sqlfilters, $action->user->id, "TABLE", 5);
43  //$tclassdoc = array_merge($tclassdoc,getChildDoc($dbaccess,$doc->dfldid,"0","ALL",$sqlfilters, $action->user->id, "TABLE",2));
44 
45  } else {
46  $fldid = $doc->dfldid;
47  $action->lay->eSet("TITLE", _("change root folder"));
48  $action->lay->rSet("current", "N");
49  $sqlfilters[] = "doctype='D'";
50  $tclassdoc = internalGetDocCollection($dbaccess, 0, "0", "ALL", $sqlfilters, $action->user->id, "TABLE", 2);
51  }
52 
53  $selectclass = array();
54  if (is_array($tclassdoc)) {
55  foreach ($tclassdoc as $k => $pdoc) {
56 
57  $selectclass[$k]["idpdoc"] = $pdoc["id"];
58  $selectclass[$k]["profname"] = $pdoc["title"];
59 
60  $selectclass[$k]["selected"] = ($pdoc["id"] == $fldid) ? "selected" : "";
61  }
62  }
63 
64  $action->lay->rSet("autodisabled", $firstfld || ($fldid > 0) ? "disabled" : "");
65  $action->lay->rSet("ROOTFOLDER", (!$firstfld));
66 
67  $action->lay->eSetBlockData("SELECTFLD", $selectclass);
68 }
global $action
$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)
editdfld(Action &$action)
Definition: editdfld.php:22
$dbaccess
Definition: checkVault.php:17
← centre documentaire © anakeen