/** * Static function to display form for the field type * @param string $name * @param string $value * @param integer $idmodule * @return html for the form containing the field */ public static function display_field($name, $value = '', $idmodule = 0) { $html = ''; $organization_style = ''; $contact_style = 'style="display:none;"'; $contact_selected = ''; $organization_selected = ''; $organization_val = ''; $contact_val = ''; if ($value != '' && (int) $idmodule > 0) { $value = (int) $value; $mid = (int) $idmodule; switch ($mid) { case 4: $contact_style = 'style="display:block;"'; $organization_style = 'style="display:none;"'; $contact_selected = "SELECTED"; $contact_val = $value; break; case 6: $contact_style = 'style="display:none;"'; $organization_style = 'style="display:block;"'; $organization_selected = "SELECTED"; $organization_val = $value; break; } } else { $mid = 6; } $html .= '<select class="form-control input-sm" name="related_to_opt" id="related_to_opt">'; $html .= '<option value="6" ' . $organization_selected . '>' . _('Organization') . '</option>'; $html .= '<option value="4" ' . $contact_selected . '>' . _('Contacts') . '</option>'; $html .= '</select>'; $html .= '<input type="hidden" name = "' . $name . '" id= "' . $name . '" value="' . $value . '">'; $html .= '<div id="related_to_organization" ' . $organization_style . '>'; $html .= FieldType131::display_field('organization_field:::' . $name, $organization_val); $html .= '</div>'; $html .= '<div id="related_to_contacts" ' . $contact_style . '>'; $html .= FieldType130::display_field('contacts_field:::' . $name, $contact_val); $html .= '</div>'; $html .= "\n" . '<script> $(\'#related_to_opt\').change( function() { var mid = $(\'#related_to_opt\').val() ; if(mid == 4) { $("#related_to_contacts").show(); $("#related_to_organization").hide(); } if(mid == 6) { $("#related_to_organization").show(); $("#related_to_contacts").hide(); } }); </script>' . "\n"; echo $html; }
/** * Static function to display form for the field type * @param string $name * @param string $value * @param integer $idmodule * @return html for the form containing the field */ public static function display_field($name, $value = '', $idmodule = 0) { $module_selectors = array(3, 4, 5, 6); $html = ''; $leads_style = ''; $organization_style = 'style="display:none;"'; $contact_style = 'style="display:none;"'; $potential_style = 'style="display:none;"'; $leads_val = ''; $organization_val = ''; $contact_val = ''; $potential_val = ''; if ($value != '' && (int) $idmodule > 0) { $value = (int) $value; $mid = (int) $idmodule; switch ($mid) { case 3: $leads_style = 'style="display:block;"'; $contact_style = 'style="display:none;"'; $organization_style = 'style="display:none;"'; $potential_style = 'style="display:none;"'; $leads_val = $value; break; case 4: $contact_style = 'style="display:block;"'; $organization_style = 'style="display:none;"'; $leads_style = 'style="display:none;"'; $potential_style = 'style="display:none;"'; $contact_val = $value; break; case 5: $potential_style = 'style="display:block;"'; $contact_style = 'style="display:none;"'; $leads_style = 'style="display:none;"'; $organization_style = 'style="display:none;"'; $potential_val = $value; break; case 6: $organization_style = 'style="display:block;"'; $contact_style = 'style="display:none;"'; $leads_style = 'style="display:none;"'; $potential_style = 'style="display:none;"'; $organization_val = $value; break; } } else { $mid = 3; } $html .= '<div style="float:left;">'; $html .= '<select class="form-control input-sm" name="related_to_opt" id="related_to_opt">'; foreach ($module_selectors as $module_selectors) { $select = ''; if ($module_selectors == $mid) { $select = 'SELECTED'; } $html .= '<option value= "' . $module_selectors . '" ' . $select . '>' . $_SESSION["do_module"]->modules_full_details[$module_selectors]["name"] . '</option>' . "\n"; } $html .= '</select>'; $html .= '<input type="hidden" name = "' . $name . '" id= "' . $name . '" value="' . $value . '">'; $html .= '<div id="related_to_leads" ' . $leads_style . '>'; $html .= FieldType132::display_field('lead_field:::' . $name, $leads_val); $html .= '</div>'; $html .= '<div id="related_to_contacts" ' . $contact_style . '>'; $html .= FieldType130::display_field('contacts_field:::' . $name, $contact_val); $html .= '</div>'; $html .= '<div id="related_to_organization" ' . $organization_style . '>'; $html .= FieldType131::display_field('organization_field:::' . $name, $organization_val); $html .= '</div>'; $html .= '<div id="related_to_potentials" ' . $potential_style . '>'; $html .= FieldType133::display_field('potentials_field:::' . $name, $potential_val); $html .= '</div>'; $html .= '</div>'; $html .= "\n" . '<script> $(\'#related_to_opt\').change( function(){ var mid = $(\'#related_to_opt\').val() ; if(mid == 3){ $("#related_to_leads").show(); $("#related_to_contacts").hide(); $("#related_to_organization").hide(); $("#related_to_potentials").hide(); } if(mid == 4){ $("#related_to_leads").hide(); $("#related_to_contacts").show(); $("#related_to_organization").hide(); $("#related_to_potentials").hide(); } if(mid == 5){ $("#related_to_leads").hide(); $("#related_to_contacts").hide(); $("#related_to_organization").hide(); $("#related_to_potentials").show(); } if(mid == 6){ $("#related_to_leads").hide(); $("#related_to_contacts").hide(); $("#related_to_organization").show(); $("#related_to_potentials").hide(); } }); </script>' . "\n"; echo $html; }
</label> <div class="controls"> <input type = "text" class="form-control input-sm" name="email" id="email" value="<?php echo $leads_obj->email; ?> "> </div><br /> </div> <div style="margin-left:30px;margin-top:20px;"> <input type="radio" name="select_cnt" id="select_cnt"> <?php echo _('Select Contact'); ?> </div> <div id="cnt_select" style="margin-left:30px;margin-top:20px;display:none;"> <?php echo FieldType130::display_field("idcontacts"); ?> </div> </div> </div> <!--/Contact section ends--> <hr class="form_hr"> <!--Potential section--> <div class="box_content" id="pot"> <input type="checkbox" name="pot_convertion" id="pot_convertion" CHECKED> <?php echo _('Prospect'); ?> <div id="pot_section" style=""> <div id="pot_fields" style="margin-left:30px;margin-top:20px;"> <label class="control-label" for="potential_name">* <?php