Date index for Mar 2003


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug with relations?



Hi

When using an atkManyToOneRelation, the AddPage() outputs faulty html-code. Using the code below, the input-field for userid looks like this:

<input type="hidden" name="userid" value="employee.userid='t'">

where 't' is the first letter in the userid. The html-code above should have read

<input type="hidden" name="userid" value="employee.userid='test'">

What have I done wrong?

/Jonas


userelation("atkmanytoonerelation");

include_once "achievotools.inc";

class vacation extends atkNode {

 function vacation() {
   global $atkaction;
   $this->atkNode("vacation", NF_NO_EDIT);

$this->add(new atkAttribute("id", AF_PRIMARY|AF_HIDE|AF_AUTO_INCREMENT));
$this->add(new atkDateAttribute("entrydate",AF_HIDE));
$this->add(new atkDateAttribute("vacationdatestart","F d Y","d F Y", 0, 0, AF_OBLIGATORY));
$this->add(new atkDummyAttribute("descr_text", text('until'), AF_NO_LABEL|AF_HIDE_LIST));
$this->add(new atkDateAttribute("vacationdateend","F d Y","d F Y", 0, 0, AF_OBLIGATORY));


$this->add(new atkDummyAttribute("descr_text2", text('vacation_warning'), AF_NO_LABEL|AF_HIDE_LIST));

$this->addAttribute(new atkManyToOneRelation("userid","employee",AF_HIDE_ADD));
// $this->add(new atkAttribute("userid", AF_HIDE_ADD));


$this->add(new atkRadioAttribute("status", Array(text('undecided'),text('allowed'),text('declined')), Array(0,1,2), AF_HIDE_ADD));

   $this->setTable("vacation");
   $this->setOrder("vacation.userid");

   if ($atkaction != "admin") {
     $this->addFilter("vacation.status = 0");
   }

 }

 function initial_values()
 {
    global $g_user;
    return array("userid"=>$g_user["name"],
                 "entrydate"=>Array("year"=>date("Y"),
                    "month"=>date("m"),
                    "day"=>date("d")));
 }



http://www.achievo.org/lists achievo.org - ©1999-2002 ibuildings.nl BV