by Variance InfoTech Pvt Ltd

Need to show or hide fields or panels based on the value of another field? For this requirement Dynamic Panels is the perfect solution. The advanced configuration tools allow you to clearly define what should happen whenever a field value changes.

Cancel at any time!
Free Trial

#5404 - Plugin doesn't select correct layout

In Progress Bug? created by t Verified Purchase 3 months ago

My colleague has stated that Dynamic Panels is not providing the correct list of fields for the layout which would be used by the selected Security Group and that the fields that appear in Dynamic Panels are the ones found within the default layout for the selected module.

I'll look into how the vi_dynamicpanelseditview works and will provide any code changes I make if required so they can be reviewed by your team.

  1. varianceinfotech member avatar

    Variance InfoTech Pvt Ltd Provider

    3 months ago

    Hello,

    Thank you for reaching out with us.

    Can you please share more detail about the fields which are not display.

    Also one more thing if you change anything in the vi_dynamicpanelseditview file then we're not responsible for it if it's not work.

    Regards,
    Variance Infotech PVT LTD

  2. t member avatar

    t Verified Purchase

    3 months ago

    Hi,

    Within the CRM it is possible to create different layouts for different security groups containing different fields. Currently when using dynamic panels no matter which security group is selected, the UI will always return the fields and panels that are defined in the default layout.

    We would like the list of fields and panels from the layout that would be active with the selected security group.

    Screenshot from 2024-07-04 14-20-56.png

  3. t member avatar

    t Verified Purchase

    3 months ago

    I am already aware that you are not responsible for any changes I make that break the plugin these changes are for your benefit if you wish to include them with your plugin

    • varianceinfotech member avatar

      Variance InfoTech Pvt Ltd Provider

      3 months ago

      Hello,

      Thank you for the suggestion.

      Our Extension build on the Generalized for all Customers. So We have to check what kind of customization you have implemented in your CRM for the Custom Layout than we can decide it's possible to add fields and panels of the custom layout in Dynamic Panels or not.

      Regards,
      Variance Infotech PVT LTD

  4. t member avatar

    t Verified Purchase

    3 months ago

    So far I have made modifications to the JavaScript to send the id of the selected Security Group during the calls to the backend. if no security group is selected it will send null for this parameter.

    The PHP code will then be able to use this id to select the correct layout for the view and return the panels and fields within it. first the following needs to be addressed.

    the function

    function getEditDetailViewFields($view,$module)
    

    makes use of the ParserFactory. SecuritySuite does not override the ParserFactory to make it possible to select the correct layout for a view.

    I have reached out to SecurtiySuite to see if they have plans to override the ParserFactory. For the moment until this is addressed, I'll use the ParserFactory if no security group id is returned or if the CRM system is not using the full version of Security Suite otherwise, I will use another method for obtaining a views metadata,

  5. t member avatar

    t Verified Purchase

    3 months ago

    delimiter*

  6. varianceinfotech member avatar

    Variance InfoTech Pvt Ltd Provider

    3 months ago

    Hello,

    We have added you our communication channel.

    Please share the requested information there so we can review your point.

    Regards,
    Variance Infotech PVT LTD

  7. t member avatar

    t Verified Purchase

    3 months ago

    I have added the following method to both

    custom/VIDynamicPanels/VIDynamicPanelsAllModuleFields.php
    

    and

    custom/VIDynamicPanels/VIDynamicPanelsAllModulePanels.php
    
            function getViewPanels($view, $module)
            {
                    require_once 'ModuleInstall/PackageManager/PackageManager.php';
                    $lView = strtolower($view);
                    $secsuiteproInstalled = false;
                    $pm = new PackageManager();
                    $installedModulesInfo = $pm->getinstalledPackages();
                    foreach ($installedModulesInfo as $installedModuleInfo) {
                            if ($installedModuleInfo['name'] === "SecuritySuite - Enhanced, Professional, and Enterprise") {
                                    $secsuiteproInstalled = true;
                                    break;
                            }
                    }
    
                    if ($secsuiteproInstalled) {
                            $moduleDirectory = BeanFactory::newBean($module)->module_dir;
    //                      $moduleDirectory = (new $module())->module_dir;
                            include "custom/modules/$moduleDirectory/metadata/$securityGroupID/{$lView}defs.php";
                            $editViewPanelArray = $viewdefs[$module][$view]["panels"];
                            $panelArray = $editViewPanelArray;
                            return $panelArray;
                    } else {
                            $view_array = ParserFactory::getParser($lView, $module);
                            $panelArray = $view_array->_viewdefs['panels'];
                            return $panelArray;
                    }
            }
    

    This function replaces the parts of the code which gets the panels metadata. it will check if the full version of security suite is installed. if it is then it will use an alternate method to get the view metadata, otherwise it will use the standard method.

    I may need to tweak this slightly after battle testing. not sure if I need to do extra handling for default layouts.

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating
  • "The dynamic panel plugin is a great plugin, but it doesn't meet our requirements and we can't use it correctly. After disabling and deleting the plugi..." - shifang

    Read More Reviews