Jump to content

Add javascript to recordActions

From NusaATK
Revision as of 19:13, 27 August 2009 by Jgarifuna (talk | contribs) (New page: Actually I just got this working by digging into the code of class.atkrecordlist.inc. If the keyword "javascript:" is preappended to the url, a javascript function is automatically creat...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Actually I just got this working by digging into the code of class.atkrecordlist.inc.

If the keyword "javascript:" is preappended to the url, a javascript function is automatically created.

Below is my working code to create popup from recordActions():


function recordActions($record, &$actions, &$mra)
       {
               // if($this->user["name"]=="administrator" || $this->mySecurity->allowed($this->module.".".$this->node,"duplicate")){
           $url = session_url("dispatch.php?major_step_id=".$record[$this->primary_field][$this->primary_field]."&atknodetype=".$this->module.".steps&atkaction=duplicate&atkfilter=".$this->primary_field.".".$this->primary_field.urlencode("=").$record[$this->primary_field][$this->primary_field], SESSION_NESTED);
                   $actions["duplicate"] = 'javascript:window.open ("'.$url.'","split","location=0,status=0,scrollbars=1,width=600,height=600")';
              // }
       }// end  function recordActions