Passed
Push — scrutinizer-code-quality ( 09f5a1...c4c5fb )
by Adam
56:05 queued 14:08
created

Jjwg_MapsViewQuick_Radius()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 2
eloc 7
c 1
b 1
f 1
nc 2
nop 0
dl 0
loc 10
ccs 0
cts 10
cp 0
crap 6
rs 9.4285
1
<?php
2
3
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4
5
class Jjwg_MapsViewQuick_Radius extends SugarView {
6
7
 	function __construct() {
8
 		parent::__construct();
9
 	}
10
11
    /**
12
     * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
13
     */
14
    function Jjwg_MapsViewQuick_Radius(){
15
        $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
16
        if(isset($GLOBALS['log'])) {
17
            $GLOBALS['log']->deprecated($deprecatedMessage);
18
        }
19
        else {
20
            trigger_error($deprecatedMessage, E_USER_DEPRECATED);
21
        }
22
        self::__construct();
23
    }
24
25
26
	function display() {
27
28
        if (!isset($_REQUEST['quick_address'])) $_REQUEST['quick_address'] = '';
29
?>
30
31
<div class="moduleTitle"><h2><?php echo $GLOBALS['mod_strings']['LBL_MAP_QUICK_RADIUS']; ?><div class="clear"></div></h2></div>
32
<div class="clear"></div>
33
34
<form name="quickradius" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
35
<input type="hidden" name="module" value="<?php echo $GLOBALS['currentModule']; ?>">
36
<input type="hidden" name="action" value="quick_radius_display" />
37
38
<table border="0">
39
    <tr>
40
        <td>
41
            <strong><?php echo $GLOBALS['mod_strings']['LBL_MAP_ADDRESS'].': '; ?> </strong>
42
        </td>
43
        <td>
44
            <input type="text" name="quick_address" id="quick_address"
45
            value="<?php echo htmlspecialchars($_REQUEST['quick_address']); ?>" title='' tabindex='101' size="40" maxlength="255">
46
        </td>
47
    </tr>
48
    <tr>
49
        <td>
50
            <strong><?php echo $GLOBALS['mod_strings']['LBL_MODULE_TYPE'].' '; ?> </strong>
51
        </td>
52
        <td>
53
            <select id="display_module" tabindex="111" title="<?php echo $GLOBALS['mod_strings']['LBL_MODULE_TYPE']; ?>" name="display_module">
54
                <?php foreach ($GLOBALS['jjwg_config']['valid_geocode_modules'] as $module) { ?>
55
                    <option value="<?php echo htmlspecialchars($module); ?>" <?php
56
                    if (!empty($_REQUEST['display_module']) && $module == $_REQUEST['display_module']) echo 'selected="selected"';
57
                    ?>><?php echo htmlspecialchars($GLOBALS['app_list_strings']['moduleList'][$module]); ?>
58
                <?php } ?>
59
            </select>
60
        </td>
61
    </tr>
62
    <tr>
63
        <td>
64
            <strong><?php echo $GLOBALS['mod_strings']['LBL_DISTANCE'].' '; ?> </strong>
65
        </td>
66
        <td>
67
            <input type="text" name="distance" id="distance"
68
            value="<?php echo htmlspecialchars($_REQUEST['distance']); ?>" title='' tabindex='121' size="10" maxlength="10">
69
            <select id="unit_type" tabindex="131" title="<?php echo $GLOBALS['mod_strings']['LBL_DISTANCE']; ?>" name="unit_type">
70
                <?php foreach ($GLOBALS['app_list_strings']['map_unit_type_list'] as $key=>$value) { ?>
71
                    <option value="<?php echo htmlspecialchars($key); ?>" <?php
72
                    if ($key == $_REQUEST['unit_type']) echo 'selected="selected"';
73
                    ?>><?php echo htmlspecialchars($value); ?>
74
                <?php } ?>
75
            </select>
76
        </td>
77
    </tr>
78
</table>
79
<br />
80
<input class="button" tabindex="211" type="submit" name="submit" value="<?php echo $GLOBALS['mod_strings']['LBL_MAP_PROCESS']; ?>" align="bottom">
81
</form>
82
83
<?php
84
  }
85
}
86