Source for file CLIENT_DEP_TREE_NODE.phpclass
Documentation is available at CLIENT_DEP_TREE_NODE.phpclass
* Class file CLIENT_DEP_TREE_NODE.phpclass
* @project Open CSP-Management
* @author Peter Krebs (pk) <p.krebs@wpus.at>
* @copyright (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
* @copyright (c) 2005 by WURM & Parnter Unternehmensservice GmbH
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
require_once $GLOBALS['OCSP']['PHPINCPATH'].
'db/dbms_tree_node.phpclass';
* @var string $myGlobalTreeKey index in $GLOABLS['DBMS_TREE'][]
* @staticvar string $myTable
* @staticvar string $myIdFld id column = root
* @staticvar string $myParentFld name of the parent column
* @staticvar string $mySortFld name of the sort field
* @var string $myChildClass
* @var string $classSrcFile source file of the class
* wether getname should only return
* CDEP_NAME or CDEP_LONGNAME (CDEP_NAME)
* @var boolean $getFullName
// ~~~~~~~~~~~~~~~~~~~~~~~ constructor and objectvalue methodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* returns the client id CLI_ID
// we have the wrong client
$s_cmd=
"\$this->myCliObj=new ".
$s_className.
"(".
$this->getCliId().
");";
* inserts a new row to the table
* if a manager is set the mangers CDEP_ID is set to the new value
* @param string $gDBIDX Index of $GLOBALS to the db object
* @param bool $debug show debug info
* @return int returns the autoIncFld ID if exists or 1 on success
function dbInsert($gDBIDX=
"USRDB",$debug=
FALSE) {
if ($debug) echo
"<hr><p><b>DBMS_TABLEOBJ::dbInsert($gDBIDX,$debug)</b> (".
get_class($this).
")</p>";
if ($this->{$this->myIdFld} =
parent::dbInsert($gDBIDX,$debug)) {
if (intval($this->CDEP_MANGER)) {
$cmd =
"UPDATE T_CLI_STAFF SET CDEP_ID=".
$this->{$this->myIdFld};
$cmd.=
" WHERE CST_ID=".
intval($this->CDEP_MANAGER);
$cmd.=
" AND CLI_ID=".
intval($this->CLI_ID);
* echos the tree within a table
function writeTree($level=
1,&$rootPath,$link=
"index.php?",$debug=
FALSE) {
if ($debug) echo
"<p><b>CLIENT_DEP_TREE_NODE::writeTree($level,\$rootPath,$link,...)</b> (".
get_class($this).
")</p>";
$border=
($debug ?
"1" :
"0");
if (!is_object($rootPath[$level]) ||
$id !=
$rootPath[$level]->getId()) {
echo
"<tr><td class=\"treeIntend\" align=\"right\"><table width=\"95%\" border=\"$border\">";
$GLOBALS['DBMS_TREE'][$this->getGlobalTreeKey()][$id]->writeTree($level+
1,$rootPath,$link,$debug);
echo
"</table></td></tr>\n";
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* returns the name of a node
if ($debug) echo
"<p><b>CLIENT_DEP_TREE_NODE::getName(...)</b> (".
get_class($this).
")</p>";
return $this->CDEP_LONGNAME.
" (".
$this->CDEP_NAME.
")";
Documentation generated on Thu, 08 Jan 2009 17:37:52 +0100 by phpDocumentor 1.4.0a2