示例#1
0
    /**
     * 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;
    }
示例#2
0
    /**
     * 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;
    }
示例#3
0
							<div class="controls">
							<?php 
FieldType5::display_field("industry", 34, $leads_obj->industry);
?>
							</div>
						</div>
					
						<div style="margin-left:30px;margin-top:20px;">
							<input type="radio" name="select_org" id="select_org">&nbsp;&nbsp;<?php 
echo _('Select Organization');
?>
						</div>
					
						<div id="org_select" style="margin-left:30px;margin-top:20px;display:none;">
							<?php 
echo FieldType131::display_field("idorganization");
?>
						</div>
					</div>
				</div>
				<!--/Organization section ends-->
				<hr class="form_hr">
				<!--Contact section-->
				<div class="box_content" id="cont">
					<input type="checkbox" name="cnt_convertion" id="cnt_convertion">
					<?php 
echo _('Contact');
?>
					<div id="cnt_section" style="display:none;">
						<div style="margin-left:30px;margin-top:20px;">
							<input type="radio" name="create_cnt" id="create_cnt" CHECKED>&nbsp;&nbsp;<?php