Platform  3.1
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  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Display interface to create a new family
9  *
10  * @author Anakeen 2006
11  * @version $Id: createfam.php,v 1.1 2006/03/31 12:29:30 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/Lib.Dir.php");
20 include_once ("FDL/Class.Doc.php");
21 include_once ("FDL/Class.DocAttr.php");
22 
23 function createfam(&$action)
24 {
25  $dbaccess = $action->GetParam("FREEDOM_DB");
26  $docid = GetHttpVars("id", 0);
27  $classid = GetHttpVars("classid", 0); // use when new doc or change class
28  $dirid = GetHttpVars("dirid", 0); // directory to place doc if new doc
29  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/geometry.js");
30 
31  $action->lay->Set("docid", $docid);
32  $action->lay->Set("dirid", $dirid);
33 
35 
36  $action->lay->Set("TITLE", _("creation of document family"));
37  $action->lay->Set("ftitle", _("untitle family"));
38  // when modification
39  if (($classid == 0) && ($docid != 0)) $classid = $doc->fromid;
40  else
41  // to show inherit attributes
42  if (($docid == 0) && ($classid > 0)) $doc = new_Doc($dbaccess, $classid); // the doc inherit from chosen class
43  $selectclass = array();
44  $tclassdoc = GetClassesDoc($dbaccess, $action->user->id, $classid, "TABLE");
45  while (list($k, $cdoc) = each($tclassdoc)) {
46  $selectclass[$k]["idcdoc"] = $cdoc["id"];
47  $selectclass[$k]["classname"] = $cdoc["title"];
48  $selectclass[$k]["selected"] = "";
49  }
50 
51  $nbattr = 0; // if new document
52  // display current values
53  $newelem = array();
54  if ($docid > 0) {
55  // control if user can update
56  $err = $doc->CanLockFile();
57  if ($err != "") $action->ExitError($err);
58  $action->lay->Set("TITLE", $doc->title);
59  }
60  if (($classid > 0) || ($doc->doctype = 'C')) {
61  // selected the current class document
62  while (list($k, $cdoc) = each($selectclass)) {
63 
64  if ($classid == $selectclass[$k]["idcdoc"]) {
65 
66  $selectclass[$k]["selected"] = "selected";
67  }
68  }
69 
70  $action->lay->SetBlockData("SELECTCLASS", $selectclass);
71  }
72 }
73 ?>
← centre documentaire © anakeen - published under CC License - Dynacase