Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
createfam.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Display interface to create a new family
8  *
9  * @author Anakeen
10  * @version $Id: createfam.php,v 1.1 2006/03/31 12:29:30 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/Lib.Dir.php");
18 include_once ("FDL/Class.Doc.php");
19 include_once ("FDL/Class.DocAttr.php");
20 
22 {
23  $dbaccess = $action->dbaccess;
24  $docid = GetHttpVars("id", 0);
25  $classid = GetHttpVars("classid", 0); // use when new doc or change class
26  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/geometry.js");
27 
29  $action->lay->Set("docid", $doc->id);
30 
31  $action->lay->eSet("TITLE", _("creation of document family"));
32  $action->lay->eSet("ftitle", _("untitle family"));
33  // when modification
34  if (($classid == 0) && ($docid != 0)) $classid = $doc->fromid;
35  else
36  // to show inherit attributes
37  if (($docid == 0) && ($classid > 0)) $doc = new_Doc($dbaccess, $classid); // the doc inherit from chosen class
38  $selectclass = array();
39  $tclassdoc = GetClassesDoc($dbaccess, $action->user->id, $classid, "TABLE");
40  foreach ($tclassdoc as $k => $cdoc) {
41  $selectclass[$k]["idcdoc"] = $cdoc["id"];
42  $selectclass[$k]["classname"] = $cdoc["title"];
43  $selectclass[$k]["selected"] = "";
44  }
45 
46  $nbattr = 0; // if new document
47  // display current values
48  $newelem = array();
49  if ($docid > 0) {
50  // control if user can update
51  $err = $doc->CanLockFile();
52  if ($err != "") $action->ExitError($err);
53  $action->lay->Set("TITLE", $doc->title);
54  }
55  if (($classid > 0) || ($doc->doctype = 'C')) {
56  // selected the current class document
57  foreach ($selectclass as $k => $cdoc) {
58 
59  if ($classid == $selectclass[$k]["idcdoc"]) {
60 
61  $selectclass[$k]["selected"] = "selected";
62  }
63  }
64 
65  $action->lay->SetBlockData("SELECTCLASS", $selectclass);
66  }
67 }
createfam(Action &$action)
Definition: createfam.php:21
global $action
Set($name, &$parent)
$docid
Definition: cleanFamily.php:13
GetClassesDoc($dbaccess, $userid, $classid=0, $qtype="LIST", $extraFilters=array())
Definition: Lib.Dir.php:906
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen