Achievo Community
https://www.atk-framework.com/forum/

dispatch_url calling another node how to remove addfilters
https://www.atk-framework.com/forum/viewtopic.php?f=2&t=36701
Page 1 of 1

Author:  dgangal [ Wed Apr 17, 2019 3:47 am ]
Post subject:  dispatch_url calling another node how to remove addfilters

Topic : dispatch_url calling another node how to remove addfilters
from one node (Node-A) i am calling another node (Node-B) specific record in view mode thru a button using dispatch url like below ...... Node-B has no of addfilters in it .... but i wish to remove all those addfilters dynamically in this call. Is there any way?

Code:
            $pparams = array();
            $atkselector = "gen_favou.id = '$this_vou_id'";
            $pparams["atkselector"] = $atkselector;
            $pparams["atknodetype"] = $node;
            $pparams["atkprevlevel"] = -1 ; //admin //does NOT work
            $pparams["atklevel"] = 1 ;     //edit
            $pparams["atkstackid"] = atkStackID();
            //Sat.06.Apr.2019 remove addfilt so that admin when in Mumbai store can c Trp V-vou if New w/o error
//--            $pparams["atkfilter"] = "1=1"; //DOES NOT WORK

  $nodeLaunch = dispatch_url( $node, "view",$pparams, 'dispatch.php');
        $url = session_url($nodeLaunch); //Thu.03.Mar.2016  this change done otherwise hangs
          $content = "javascript:NewWindow('".$url."','printWindow', 1200, 400, 'yes', 'no','no','yes' )";
        $temp = '<input type="button" value="V" onClick="' . $content .'" />';
   return $temp;





Full code
Code:

      :
      $ref_doc =&$this->add(new atkDummyAttribute("ref_doc","Voucher",0));//AF_READONLY
      $ref_doc->setLabel('Voucher');
      :


   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

//introduced here on Wed.17.Apr.2019 from class.gen_ledger_screen_dtl.inc
//      $ref_doc =&$this->add(new atkDummyAttribute("ref_doc","Voucher",0));//AF_READONLY
//      $ref_doc->setLabel('Voucher');
function ref_doc_display($record,$mode="list")
   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  {
    $page = &$this->getPage();
    $page->register_script(atkconfig("atkroot")."atk/javascript/newwindow.js");

    global $ATK_VARS;   //NOT used - in case reqd
    $session = &atkSessionManager::getSession();  //NOT used - in case reqd
     $user = getuser();
        $db = &atkGetDb();
        $this_vou_id = $this->m_postvars['id'];

        //$pparams[$this->primary_field] = $record[$this->primary_field];
        //$pparams["atkselector"] = $this->node.".".$this->primary_field."='".$record[$this->primary_field]."'";
        //$pparams["atkfilter"] = $this->primary_field."=".$record[$this->primary_field]."";
            $pparams = array();
            $atkselector = "gen_favou.id = '$this_vou_id'";
            $pparams["atkselector"] = $atkselector;
            $pparams["atknodetype"] = $node;
            $pparams["atkprevlevel"] = -1 ; //admin //does NOT work
            $pparams["atklevel"] = 1 ;     //edit
            $pparams["atkstackid"] = atkStackID();
            //Sat.06.Apr.2019 remove addfilt so that admin when in Mumbai store can c Trp V-vou if New w/o error
//--            $pparams["atkfilter"] = "1=1"; //DOES NOT WORK

  $nodeLaunch = dispatch_url( $node, "view",$pparams, 'dispatch.php');


        $url = session_url($nodeLaunch); //Thu.03.Mar.2016  this change done otherwise hangs

          $content = "javascript:NewWindow('".$url."','printWindow', 1200, 400, 'yes', 'no','no','yes' )";



        $temp = '<input type="button" value="V" onClick="' . $content .'" />';
   return $temp;
  }
 
 

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/