CRM Open Source Business & Social CRM Software

Results 1 to 4 of 4

Thread: hiding subpanel in SUgarCE

  1. #1
    vijay9948 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    56

    Default hiding subpanel in SUgarCE

    Hi every one,

    My requirement is (for custom module)
    i have a dropdown list for onchange event of dropdown list subpanels should be enabled.I have searched for this code and i got the below link
    http://developers.sugarcrm.com/tutor...Panels_5.1.pdf

    Whatever the code present in above link same code i put in custom/modules/<custom module name>/views/view.edit.php,view.detail.php


    but when am clicking on create<modulename> link
    it is showing php parse error (whatever the coding i have written everything is correct)

    how can i rectify this
    pls anyone tell me
    plsplspls

  2. #2
    genius786's Avatar
    genius786 is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Karachi, Pakistan
    Posts
    119

    Smile Re: hiding subpanel in SUgarCE

    For your answer click here


    Best regards,
    SARFARAZ AHMED KHAN
    Karachi, Pakistan
    skype: genius_crystal
    genius_crystal@hotmail.com
    92-314-2595624

  3. #3
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

  4. #4
    vijay9948 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    56

    Default Re: hiding subpanel in SUgarCE

    Quote Originally Posted by letrium View Post
    Hi!

    write your code please!




    Thank U for ur reply,
    Here the code for my custm modulename(DirecrDeposit)
    (custom/modules/T698_DirectDeposit\views\view.edit.php)

    view.edit.php

    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once(
    'include/json_config.php');
    require_once(
    'include/MVC/View/views/view.edit.php');
    class 
    T698_DirectDepositViewEdit extends ViewEdit{
    function 
    T698_DirectDepositViewEdit(){
    parent::ViewEdit();
    }
    function 
    display(){
    global 
    $app_list_strings;
    global 
    $mod_strings;
    $fieldName='transcation_type';
    $dropDownName='transcation_type_list';
    $e=$this->ev->defs['panels'];
    $panelArray=array();
    foreach(
    $e as $panel_label=>$panel_data ){
    if(
    $panel_label!=''&&$panel_data!='default')
    {
    $tempArray=array($panel_label,$mod_strings[strtoupper($panel_label)]);
    array_push($panelArray,$tempArray);
    }
    }
    $prePop='document.getElementById(\''.$fieldName.'\ ').onchange();';
    print'
    <script>types= new Array();
    sysName= new Array();
    lblName=new Array();';
    foreach($app_list_strings[$dropDownName] as $val)
    {
    if($val!='')
    {
    print"types.push(\"$val\");";
    }
    }
    $h=0;
    foreach($panelArray as $val)
    {
    print"sysName['
    $h']=\"$val[0]\";";
    print"lblName['
    $h']=\"$val[1]\";";
    $h++;
    }
    print'
    var fieldName=''.$fieldName.'\';';
    print
    '</script>';
    $js=<<<EOQ
    <script>
    document.getElementById(fieldName).onchange=functi on(){
    if(document.getElementByName(fieldName)[0].value)
    {
    var value=document.getElementByName(fieldName)[0].value;
    value=value.toUpperCase()+'INFO';
    }

    for(i=0;i<sysName.length;i++)
    {
    if(document.getElementById(sysName[i].toUpperCase()))
    {
    for(j=0;j<types.length;j++)
    {
    if(types[j].toUpperCase()+'INFO'==lblName[i])
    {
    document.getElementById(sysName[i].toUpperCase()).style.display="none";
    }
    }
    }
    }
    for(i=0;i<lblName.length;i++)
    {
    if(value==lblName[i])
    {
    document.getElementById(sysName[i].toUpperCase()).style.display="block";
    }

    }
    };
    $prePop;
    </script>
    EOQ;
    parent::display();
    echo 
    $js;
    }
    }
    ?>
    pls give me the reply
    pls
    pls
    Edit/Delete Message
    Last edited by clint; 2009-01-23 at 01:36 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hiding Field Labels
    By neopaulino in forum Developer Help
    Replies: 2
    Last Post: 2008-09-22, 06:10 PM
  2. Hiding subpanels
    By richardhakim in forum Help
    Replies: 2
    Last Post: 2006-11-27, 10:39 AM
  3. Help with hiding subpanels
    By stevec in forum Developer Help
    Replies: 1
    Last Post: 2006-07-14, 01:06 PM
  4. Hiding tabs
    By jobyraj in forum Help
    Replies: 1
    Last Post: 2006-06-27, 07:52 PM
  5. Hiding older projects
    By Karol in forum Project Management
    Replies: 0
    Last Post: 2006-03-26, 11:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •