@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // created: 2013-05-07 12:48:58 |
3 | 3 | global $current_user; |
4 | -$searchFields['AOS_Products'] = array ( |
|
4 | +$searchFields['AOS_Products'] = array( |
|
5 | 5 | 'name' => |
6 | - array ( |
|
6 | + array( |
|
7 | 7 | 'query_type' => 'default', |
8 | 8 | ), |
9 | 9 | 'current_user_only' => |
10 | - array ( |
|
10 | + array( |
|
11 | 11 | 'query_type' => 'default', |
12 | 12 | 'db_field' => |
13 | - array ( |
|
13 | + array( |
|
14 | 14 | 0 => 'created_by', |
15 | 15 | ), |
16 | 16 | 'my_items' => true, |
@@ -18,67 +18,67 @@ discard block |
||
18 | 18 | 'type' => 'bool', |
19 | 19 | ), |
20 | 20 | 'range_price' => |
21 | - array ( |
|
21 | + array( |
|
22 | 22 | 'query_type' => 'default', |
23 | 23 | 'enable_range_search' => true, |
24 | 24 | ), |
25 | 25 | 'start_range_price' => |
26 | - array ( |
|
26 | + array( |
|
27 | 27 | 'query_type' => 'default', |
28 | 28 | 'enable_range_search' => true, |
29 | 29 | ), |
30 | 30 | 'end_range_price' => |
31 | - array ( |
|
31 | + array( |
|
32 | 32 | 'query_type' => 'default', |
33 | 33 | 'enable_range_search' => true, |
34 | 34 | ), |
35 | 35 | 'range_cost' => |
36 | - array ( |
|
36 | + array( |
|
37 | 37 | 'query_type' => 'default', |
38 | 38 | 'enable_range_search' => true, |
39 | 39 | ), |
40 | 40 | 'start_range_cost' => |
41 | - array ( |
|
41 | + array( |
|
42 | 42 | 'query_type' => 'default', |
43 | 43 | 'enable_range_search' => true, |
44 | 44 | ), |
45 | 45 | 'end_range_cost' => |
46 | - array ( |
|
46 | + array( |
|
47 | 47 | 'query_type' => 'default', |
48 | 48 | 'enable_range_search' => true, |
49 | 49 | ), |
50 | 50 | 'range_date_entered' => |
51 | - array ( |
|
51 | + array( |
|
52 | 52 | 'query_type' => 'default', |
53 | 53 | 'enable_range_search' => true, |
54 | 54 | 'is_date_field' => true, |
55 | 55 | ), |
56 | 56 | 'start_range_date_entered' => |
57 | - array ( |
|
57 | + array( |
|
58 | 58 | 'query_type' => 'default', |
59 | 59 | 'enable_range_search' => true, |
60 | 60 | 'is_date_field' => true, |
61 | 61 | ), |
62 | 62 | 'end_range_date_entered' => |
63 | - array ( |
|
63 | + array( |
|
64 | 64 | 'query_type' => 'default', |
65 | 65 | 'enable_range_search' => true, |
66 | 66 | 'is_date_field' => true, |
67 | 67 | ), |
68 | 68 | 'range_date_modified' => |
69 | - array ( |
|
69 | + array( |
|
70 | 70 | 'query_type' => 'default', |
71 | 71 | 'enable_range_search' => true, |
72 | 72 | 'is_date_field' => true, |
73 | 73 | ), |
74 | 74 | 'start_range_date_modified' => |
75 | - array ( |
|
75 | + array( |
|
76 | 76 | 'query_type' => 'default', |
77 | 77 | 'enable_range_search' => true, |
78 | 78 | 'is_date_field' => true, |
79 | 79 | ), |
80 | 80 | 'end_range_date_modified' => |
81 | - array ( |
|
81 | + array( |
|
82 | 82 | 'query_type' => 'default', |
83 | 83 | 'enable_range_search' => true, |
84 | 84 | 'is_date_field' => true, |
@@ -89,6 +89,6 @@ discard block |
||
89 | 89 | 'subquery' => "SELECT favorites.parent_id FROM favorites |
90 | 90 | WHERE favorites.deleted = 0 |
91 | 91 | and favorites.parent_type = '".$module_name."' |
92 | - and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
|
92 | + and favorites.assigned_user_id = '" .$current_user->id."') OR NOT ({0}", |
|
93 | 93 | 'db_field'=>array('id')), |
94 | 94 | ); |
95 | 95 | \ No newline at end of file |
@@ -2,79 +2,79 @@ discard block |
||
2 | 2 | // created: 2015-02-17 15:14:28 |
3 | 3 | global $current_user; |
4 | 4 | $module_name = "Documents"; |
5 | -$searchFields['Documents'] = array ( |
|
5 | +$searchFields['Documents'] = array( |
|
6 | 6 | 'document_name' => |
7 | - array ( |
|
7 | + array( |
|
8 | 8 | 'query_type' => 'default', |
9 | 9 | ), |
10 | 10 | 'category_id' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'query_type' => 'default', |
13 | 13 | 'options' => 'document_category_dom', |
14 | 14 | 'template_var' => 'CATEGORY_OPTIONS', |
15 | 15 | ), |
16 | 16 | 'subcategory_id' => |
17 | - array ( |
|
17 | + array( |
|
18 | 18 | 'query_type' => 'default', |
19 | 19 | 'options' => 'document_subcategory_dom', |
20 | 20 | 'template_var' => 'SUBCATEGORY_OPTIONS', |
21 | 21 | ), |
22 | 22 | 'active_date' => |
23 | - array ( |
|
23 | + array( |
|
24 | 24 | 'query_type' => 'default', |
25 | 25 | ), |
26 | 26 | 'exp_date' => |
27 | - array ( |
|
27 | + array( |
|
28 | 28 | 'query_type' => 'default', |
29 | 29 | ), |
30 | 30 | 'assigned_user_id' => |
31 | - array ( |
|
31 | + array( |
|
32 | 32 | 'query_type' => 'default', |
33 | 33 | ), |
34 | 34 | 'filename' => |
35 | - array ( |
|
35 | + array( |
|
36 | 36 | 'query_type' => 'format', |
37 | 37 | 'operator' => 'subquery', |
38 | 38 | 'subquery' => 'SELECT document_revisions.id FROM document_revisions |
39 | 39 | WHERE document_revisions.deleted=0 |
40 | 40 | AND document_revisions.filename LIKE \'{0}\'', |
41 | 41 | 'db_field' => |
42 | - array ( |
|
42 | + array( |
|
43 | 43 | 0 => 'document_revision_id', |
44 | 44 | ), |
45 | 45 | ), |
46 | 46 | 'range_date_entered' => |
47 | - array ( |
|
47 | + array( |
|
48 | 48 | 'query_type' => 'default', |
49 | 49 | 'enable_range_search' => true, |
50 | 50 | 'is_date_field' => true, |
51 | 51 | ), |
52 | 52 | 'start_range_date_entered' => |
53 | - array ( |
|
53 | + array( |
|
54 | 54 | 'query_type' => 'default', |
55 | 55 | 'enable_range_search' => true, |
56 | 56 | 'is_date_field' => true, |
57 | 57 | ), |
58 | 58 | 'end_range_date_entered' => |
59 | - array ( |
|
59 | + array( |
|
60 | 60 | 'query_type' => 'default', |
61 | 61 | 'enable_range_search' => true, |
62 | 62 | 'is_date_field' => true, |
63 | 63 | ), |
64 | 64 | 'range_date_modified' => |
65 | - array ( |
|
65 | + array( |
|
66 | 66 | 'query_type' => 'default', |
67 | 67 | 'enable_range_search' => true, |
68 | 68 | 'is_date_field' => true, |
69 | 69 | ), |
70 | 70 | 'start_range_date_modified' => |
71 | - array ( |
|
71 | + array( |
|
72 | 72 | 'query_type' => 'default', |
73 | 73 | 'enable_range_search' => true, |
74 | 74 | 'is_date_field' => true, |
75 | 75 | ), |
76 | 76 | 'end_range_date_modified' => |
77 | - array ( |
|
77 | + array( |
|
78 | 78 | 'query_type' => 'default', |
79 | 79 | 'enable_range_search' => true, |
80 | 80 | 'is_date_field' => true, |
@@ -85,6 +85,6 @@ discard block |
||
85 | 85 | 'subquery' => "SELECT favorites.parent_id FROM favorites |
86 | 86 | WHERE favorites.deleted = 0 |
87 | 87 | and favorites.parent_type = '".$module_name."' |
88 | - and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
|
88 | + and favorites.assigned_user_id = '" .$current_user->id."') OR NOT ({0}", |
|
89 | 89 | 'db_field'=>array('id')), |
90 | 90 | ); |
91 | 91 | \ No newline at end of file |
@@ -40,42 +40,42 @@ |
||
40 | 40 | global $current_user; |
41 | 41 | $module_name = "Meetings"; |
42 | 42 | $searchFields['Meetings'] = |
43 | - array ( |
|
44 | - 'name' => array( 'query_type'=>'default'), |
|
43 | + array ( |
|
44 | + 'name' => array( 'query_type'=>'default'), |
|
45 | 45 | 'contact_name' => array( 'query_type'=>'default','db_field'=>array('contacts.first_name','contacts.last_name')), |
46 | 46 | 'date_start' => array( 'query_type'=>'default'), |
47 | 47 | 'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
48 | 48 | 'assigned_user_id'=> array('query_type'=>'default'), |
49 | 49 | 'status'=> array('query_type'=>'default', 'options' => 'meeting_status_dom', 'template_var' => 'STATUS_FILTER'), |
50 | 50 | |
51 | - 'open_only' => array( |
|
52 | - 'query_type'=>'default', |
|
53 | - 'db_field'=>array('status'), |
|
54 | - 'operator'=>'not in', |
|
55 | - 'closed_values' => array('Held', 'Not Held'), |
|
56 | - 'type'=>'bool', |
|
57 | - ), |
|
51 | + 'open_only' => array( |
|
52 | + 'query_type'=>'default', |
|
53 | + 'db_field'=>array('status'), |
|
54 | + 'operator'=>'not in', |
|
55 | + 'closed_values' => array('Held', 'Not Held'), |
|
56 | + 'type'=>'bool', |
|
57 | + ), |
|
58 | 58 | 'favorites_only' => array( |
59 | 59 | 'query_type'=>'format', |
60 | 60 | 'operator' => 'subquery', |
61 | - 'subquery' => "SELECT favorites.parent_id FROM favorites |
|
61 | + 'subquery' => "SELECT favorites.parent_id FROM favorites |
|
62 | 62 | WHERE favorites.deleted = 0 |
63 | 63 | and favorites.parent_type = '".$module_name."' |
64 | 64 | and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
65 | 65 | 'db_field'=>array('id')), |
66 | - //Range Search Support |
|
67 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
69 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
70 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
71 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
72 | - 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
73 | - 'range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
74 | - 'start_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
75 | - 'end_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
76 | - 'range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
77 | - 'start_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
78 | - 'end_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
79 | - //Range Search Support |
|
80 | - ); |
|
66 | + //Range Search Support |
|
67 | + 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | + 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
69 | + 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
70 | + 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
71 | + 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
72 | + 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
73 | + 'range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
74 | + 'start_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
75 | + 'end_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
76 | + 'range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
77 | + 'start_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
78 | + 'end_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
79 | + //Range Search Support |
|
80 | + ); |
|
81 | 81 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | global $current_user; |
41 | 41 | $module_name = "Meetings"; |
42 | 42 | $searchFields['Meetings'] = |
43 | - array ( |
|
44 | - 'name' => array( 'query_type'=>'default'), |
|
45 | - 'contact_name' => array( 'query_type'=>'default','db_field'=>array('contacts.first_name','contacts.last_name')), |
|
46 | - 'date_start' => array( 'query_type'=>'default'), |
|
47 | - 'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
43 | + array( |
|
44 | + 'name' => array('query_type'=>'default'), |
|
45 | + 'contact_name' => array('query_type'=>'default', 'db_field'=>array('contacts.first_name', 'contacts.last_name')), |
|
46 | + 'date_start' => array('query_type'=>'default'), |
|
47 | + 'current_user_only'=> array('query_type'=>'default', 'db_field'=>array('assigned_user_id'), 'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
48 | 48 | 'assigned_user_id'=> array('query_type'=>'default'), |
49 | 49 | 'status'=> array('query_type'=>'default', 'options' => 'meeting_status_dom', 'template_var' => 'STATUS_FILTER'), |
50 | 50 | |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | 'subquery' => "SELECT favorites.parent_id FROM favorites |
62 | 62 | WHERE favorites.deleted = 0 |
63 | 63 | and favorites.parent_type = '".$module_name."' |
64 | - and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
|
64 | + and favorites.assigned_user_id = '" .$current_user->id."') OR NOT ({0}", |
|
65 | 65 | 'db_field'=>array('id')), |
66 | 66 | //Range Search Support |
67 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
69 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
70 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
71 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
72 | - 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
73 | - 'range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
74 | - 'start_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
75 | - 'end_range_date_start' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
76 | - 'range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
77 | - 'start_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
78 | - 'end_range_date_end' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | + 'range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | + 'start_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
69 | + 'end_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
70 | + 'range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
71 | + 'start_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
72 | + 'end_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
73 | + 'range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
74 | + 'start_range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
75 | + 'end_range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
76 | + 'range_date_end' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
77 | + 'start_range_date_end' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
78 | + 'end_range_date_end' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
79 | 79 | //Range Search Support |
80 | 80 | ); |
81 | 81 | ?> |
@@ -45,22 +45,22 @@ discard block |
||
45 | 45 | 'last_name'=> array('query_type'=>'default'), |
46 | 46 | 'search_name'=> array('query_type'=>'default','db_field'=>array('first_name','last_name'),'force_unifiedsearch'=>true), |
47 | 47 | 'account_name'=> array('query_type'=>'default','db_field'=>array('leads.account_name')), |
48 | - /*'acc_name_from_accounts' => array('query_type'=>'default','related_field'=>'account_name'),*/ |
|
48 | + /*'acc_name_from_accounts' => array('query_type'=>'default','related_field'=>'account_name'),*/ |
|
49 | 49 | 'lead_source'=> array('query_type'=>'default','operator'=>'=', 'options'=>'lead_source_dom', 'template_var' => 'LEAD_SOURCE_OPTIONS'), |
50 | 50 | 'do_not_call'=> array('query_type'=>'default', 'operator'=>'=', 'input_type' => 'checkbox'), |
51 | 51 | 'phone'=> array('query_type'=>'default','db_field'=>array('phone_mobile','phone_work','phone_other','phone_fax','phone_home')), |
52 | - 'email'=> array( |
|
53 | - 'query_type' => 'default', |
|
54 | - 'operator' => 'subquery', |
|
55 | - 'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE', |
|
56 | - 'db_field' => array( |
|
57 | - 'id', |
|
58 | - ), |
|
59 | - ), |
|
52 | + 'email'=> array( |
|
53 | + 'query_type' => 'default', |
|
54 | + 'operator' => 'subquery', |
|
55 | + 'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE', |
|
56 | + 'db_field' => array( |
|
57 | + 'id', |
|
58 | + ), |
|
59 | + ), |
|
60 | 60 | 'favorites_only' => array( |
61 | 61 | 'query_type'=>'format', |
62 | 62 | 'operator' => 'subquery', |
63 | - 'subquery' => "SELECT favorites.parent_id FROM favorites |
|
63 | + 'subquery' => "SELECT favorites.parent_id FROM favorites |
|
64 | 64 | WHERE favorites.deleted = 0 |
65 | 65 | and favorites.parent_type = '".$module_name."' |
66 | 66 | and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
@@ -75,20 +75,20 @@ discard block |
||
75 | 75 | 'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
76 | 76 | 'assigned_user_id'=> array('query_type'=>'default'), |
77 | 77 | 'status'=> array('query_type'=>'default', 'options'=>'lead_status_dom', 'template_var' => 'STATUS_OPTIONS'), |
78 | - 'open_only' => array( |
|
79 | - 'query_type'=>'default', |
|
80 | - 'db_field'=>array('status'), |
|
81 | - 'operator'=>'not in', |
|
82 | - 'closed_values' => array('Dead', 'Recycled', 'Converted'), |
|
83 | - 'type'=>'bool', |
|
84 | - ), |
|
85 | - //Range Search Support |
|
86 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
87 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
88 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
89 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
90 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
78 | + 'open_only' => array( |
|
79 | + 'query_type'=>'default', |
|
80 | + 'db_field'=>array('status'), |
|
81 | + 'operator'=>'not in', |
|
82 | + 'closed_values' => array('Dead', 'Recycled', 'Converted'), |
|
83 | + 'type'=>'bool', |
|
84 | + ), |
|
85 | + //Range Search Support |
|
86 | + 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
87 | + 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
88 | + 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
89 | + 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
90 | + 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
91 | 91 | 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
92 | - //Range Search Support |
|
92 | + //Range Search Support |
|
93 | 93 | ); |
94 | 94 | ?> |
95 | 95 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | global $current_user; |
41 | 41 | $module_name = "Leads"; |
42 | 42 | $searchFields['Leads'] = |
43 | - array ( |
|
44 | - 'first_name' => array( 'query_type'=>'default'), |
|
43 | + array( |
|
44 | + 'first_name' => array('query_type'=>'default'), |
|
45 | 45 | 'last_name'=> array('query_type'=>'default'), |
46 | - 'search_name'=> array('query_type'=>'default','db_field'=>array('first_name','last_name'),'force_unifiedsearch'=>true), |
|
47 | - 'account_name'=> array('query_type'=>'default','db_field'=>array('leads.account_name')), |
|
46 | + 'search_name'=> array('query_type'=>'default', 'db_field'=>array('first_name', 'last_name'), 'force_unifiedsearch'=>true), |
|
47 | + 'account_name'=> array('query_type'=>'default', 'db_field'=>array('leads.account_name')), |
|
48 | 48 | /*'acc_name_from_accounts' => array('query_type'=>'default','related_field'=>'account_name'),*/ |
49 | - 'lead_source'=> array('query_type'=>'default','operator'=>'=', 'options'=>'lead_source_dom', 'template_var' => 'LEAD_SOURCE_OPTIONS'), |
|
49 | + 'lead_source'=> array('query_type'=>'default', 'operator'=>'=', 'options'=>'lead_source_dom', 'template_var' => 'LEAD_SOURCE_OPTIONS'), |
|
50 | 50 | 'do_not_call'=> array('query_type'=>'default', 'operator'=>'=', 'input_type' => 'checkbox'), |
51 | - 'phone'=> array('query_type'=>'default','db_field'=>array('phone_mobile','phone_work','phone_other','phone_fax','phone_home')), |
|
51 | + 'phone'=> array('query_type'=>'default', 'db_field'=>array('phone_mobile', 'phone_work', 'phone_other', 'phone_fax', 'phone_home')), |
|
52 | 52 | 'email'=> array( |
53 | 53 | 'query_type' => 'default', |
54 | 54 | 'operator' => 'subquery', |
@@ -63,16 +63,16 @@ discard block |
||
63 | 63 | 'subquery' => "SELECT favorites.parent_id FROM favorites |
64 | 64 | WHERE favorites.deleted = 0 |
65 | 65 | and favorites.parent_type = '".$module_name."' |
66 | - and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
|
66 | + and favorites.assigned_user_id = '" .$current_user->id."') OR NOT ({0}", |
|
67 | 67 | 'db_field'=>array('id')), |
68 | 68 | 'assistant'=> array('query_type'=>'default'), |
69 | 69 | 'website'=> array('query_type'=>'default'), |
70 | - 'address_street'=> array('query_type'=>'default','db_field'=>array('primary_address_street','alt_address_street')), |
|
71 | - 'address_city'=> array('query_type'=>'default','db_field'=>array('primary_address_city','alt_address_city')), |
|
72 | - 'address_state'=> array('query_type'=>'default','db_field'=>array('primary_address_state','alt_address_state')), |
|
73 | - 'address_postalcode'=> array('query_type'=>'default','db_field'=>array('primary_address_postalcode','alt_address_postalcode')), |
|
74 | - 'address_country'=> array('query_type'=>'default','db_field'=>array('primary_address_country','alt_address_country')), |
|
75 | - 'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
70 | + 'address_street'=> array('query_type'=>'default', 'db_field'=>array('primary_address_street', 'alt_address_street')), |
|
71 | + 'address_city'=> array('query_type'=>'default', 'db_field'=>array('primary_address_city', 'alt_address_city')), |
|
72 | + 'address_state'=> array('query_type'=>'default', 'db_field'=>array('primary_address_state', 'alt_address_state')), |
|
73 | + 'address_postalcode'=> array('query_type'=>'default', 'db_field'=>array('primary_address_postalcode', 'alt_address_postalcode')), |
|
74 | + 'address_country'=> array('query_type'=>'default', 'db_field'=>array('primary_address_country', 'alt_address_country')), |
|
75 | + 'current_user_only'=> array('query_type'=>'default', 'db_field'=>array('assigned_user_id'), 'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
76 | 76 | 'assigned_user_id'=> array('query_type'=>'default'), |
77 | 77 | 'status'=> array('query_type'=>'default', 'options'=>'lead_status_dom', 'template_var' => 'STATUS_OPTIONS'), |
78 | 78 | 'open_only' => array( |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | 'type'=>'bool', |
84 | 84 | ), |
85 | 85 | //Range Search Support |
86 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
87 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
88 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
89 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
90 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
91 | - 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
86 | + 'range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
87 | + 'start_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
88 | + 'end_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
89 | + 'range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
90 | + 'start_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
91 | + 'end_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
92 | 92 | //Range Search Support |
93 | 93 | ); |
94 | 94 | ?> |
95 | 95 | \ No newline at end of file |
@@ -46,25 +46,25 @@ |
||
46 | 46 | 'favorites_only' => array( |
47 | 47 | 'query_type'=>'format', |
48 | 48 | 'operator' => 'subquery', |
49 | - 'subquery' => "SELECT favorites.parent_id FROM favorites |
|
49 | + 'subquery' => "SELECT favorites.parent_id FROM favorites |
|
50 | 50 | WHERE favorites.deleted = 0 |
51 | 51 | and favorites.parent_type = '".$module_name."' |
52 | 52 | and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
53 | 53 | 'db_field'=>array('id')), |
54 | - //Range Search Support |
|
55 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | - 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
54 | + //Range Search Support |
|
55 | + 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | + 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | + 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | + 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | + 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | + 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
61 | 61 | |
62 | - 'range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | - 'start_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | - 'end_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | - 'range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | - 'start_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | - 'end_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | - //Range Search Support |
|
62 | + 'range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | + 'start_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | + 'end_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | + 'range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | + 'start_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | + 'end_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | + //Range Search Support |
|
69 | 69 | ); |
70 | 70 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -40,31 +40,31 @@ discard block |
||
40 | 40 | global $current_user; |
41 | 41 | $module_name = "Project"; |
42 | 42 | $searchFields['Project'] = |
43 | - array ( |
|
44 | - 'name' => array( 'query_type'=>'default'), |
|
45 | - 'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
43 | + array( |
|
44 | + 'name' => array('query_type'=>'default'), |
|
45 | + 'current_user_only'=> array('query_type'=>'default', 'db_field'=>array('assigned_user_id'), 'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'), |
|
46 | 46 | 'favorites_only' => array( |
47 | 47 | 'query_type'=>'format', |
48 | 48 | 'operator' => 'subquery', |
49 | 49 | 'subquery' => "SELECT favorites.parent_id FROM favorites |
50 | 50 | WHERE favorites.deleted = 0 |
51 | 51 | and favorites.parent_type = '".$module_name."' |
52 | - and favorites.assigned_user_id = '" .$current_user->id . "') OR NOT ({0}", |
|
52 | + and favorites.assigned_user_id = '" .$current_user->id."') OR NOT ({0}", |
|
53 | 53 | 'db_field'=>array('id')), |
54 | 54 | //Range Search Support |
55 | - 'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | - 'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | - 'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | - 'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | - 'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | - 'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
55 | + 'range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
56 | + 'start_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
57 | + 'end_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
58 | + 'range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
59 | + 'start_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
60 | + 'end_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
61 | 61 | |
62 | - 'range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | - 'start_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | - 'end_range_estimated_start_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | - 'range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | - 'start_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | - 'end_range_estimated_end_date' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
62 | + 'range_estimated_start_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
63 | + 'start_range_estimated_start_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
64 | + 'end_range_estimated_start_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
65 | + 'range_estimated_end_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
66 | + 'start_range_estimated_end_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
67 | + 'end_range_estimated_end_date' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true), |
|
68 | 68 | //Range Search Support |
69 | 69 | ); |
70 | 70 | ?> |
@@ -3,143 +3,143 @@ discard block |
||
3 | 3 | class EmployeeTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | 5 | |
6 | - public function testEmployee() { |
|
6 | + public function testEmployee() { |
|
7 | 7 | |
8 | - //execute the contructor and check for the Object type and attributes |
|
9 | - $employee = new Employee(); |
|
10 | - $this->assertInstanceOf('Employee',$employee); |
|
11 | - $this->assertInstanceOf('Person',$employee); |
|
12 | - $this->assertInstanceOf('SugarBean',$employee); |
|
8 | + //execute the contructor and check for the Object type and attributes |
|
9 | + $employee = new Employee(); |
|
10 | + $this->assertInstanceOf('Employee',$employee); |
|
11 | + $this->assertInstanceOf('Person',$employee); |
|
12 | + $this->assertInstanceOf('SugarBean',$employee); |
|
13 | 13 | |
14 | - $this->assertAttributeEquals('Employees', 'module_dir', $employee); |
|
15 | - $this->assertAttributeEquals('Employee', 'object_name', $employee); |
|
16 | - $this->assertAttributeEquals('users', 'table_name', $employee); |
|
17 | - $this->assertAttributeEquals(true, 'new_schema', $employee); |
|
14 | + $this->assertAttributeEquals('Employees', 'module_dir', $employee); |
|
15 | + $this->assertAttributeEquals('Employee', 'object_name', $employee); |
|
16 | + $this->assertAttributeEquals('users', 'table_name', $employee); |
|
17 | + $this->assertAttributeEquals(true, 'new_schema', $employee); |
|
18 | 18 | |
19 | - } |
|
19 | + } |
|
20 | 20 | |
21 | 21 | |
22 | - public function testget_summary_text() { |
|
22 | + public function testget_summary_text() { |
|
23 | 23 | |
24 | - error_reporting(E_ERROR | E_PARSE); |
|
24 | + error_reporting(E_ERROR | E_PARSE); |
|
25 | 25 | |
26 | - $employee = new Employee(); |
|
26 | + $employee = new Employee(); |
|
27 | 27 | |
28 | - //test without setting name |
|
29 | - $this->assertEquals(' ',$employee->get_summary_text()); |
|
28 | + //test without setting name |
|
29 | + $this->assertEquals(' ',$employee->get_summary_text()); |
|
30 | 30 | |
31 | - //test with name set |
|
32 | - $employee->retrieve(1); |
|
33 | - $this->assertEquals('Administrator',$employee->get_summary_text()); |
|
31 | + //test with name set |
|
32 | + $employee->retrieve(1); |
|
33 | + $this->assertEquals('Administrator',$employee->get_summary_text()); |
|
34 | 34 | |
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | - public function testfill_in_additional_list_fields() { |
|
39 | - |
|
40 | - $employee = new Employee(); |
|
38 | + public function testfill_in_additional_list_fields() { |
|
41 | 39 | |
42 | - //execute the method and test if it works and does not throws an exception. |
|
43 | - try { |
|
44 | - $employee->fill_in_additional_list_fields(); |
|
45 | - $this->assertTrue(true); |
|
46 | - } |
|
47 | - catch (Exception $e) { |
|
48 | - $this->fail(); |
|
49 | - } |
|
40 | + $employee = new Employee(); |
|
50 | 41 | |
51 | - } |
|
42 | + //execute the method and test if it works and does not throws an exception. |
|
43 | + try { |
|
44 | + $employee->fill_in_additional_list_fields(); |
|
45 | + $this->assertTrue(true); |
|
46 | + } |
|
47 | + catch (Exception $e) { |
|
48 | + $this->fail(); |
|
49 | + } |
|
52 | 50 | |
53 | - public function testfill_in_additional_detail_fields() |
|
54 | - { |
|
55 | - $employee = new Employee(); |
|
51 | + } |
|
56 | 52 | |
53 | + public function testfill_in_additional_detail_fields() |
|
54 | + { |
|
55 | + $employee = new Employee(); |
|
57 | 56 | |
58 | - //test with a empty employee bean |
|
59 | - $employee->fill_in_additional_detail_fields(); |
|
60 | - $this->assertEquals("", $employee->reports_to_name); |
|
61 | 57 | |
58 | + //test with a empty employee bean |
|
59 | + $employee->fill_in_additional_detail_fields(); |
|
60 | + $this->assertEquals("", $employee->reports_to_name); |
|
62 | 61 | |
63 | - //test with a valid employee bean |
|
64 | - $employee->retrieve(1); |
|
65 | - $employee->fill_in_additional_detail_fields(); |
|
66 | - $this->assertEquals("", $employee->reports_to_name); |
|
67 | 62 | |
68 | - } |
|
63 | + //test with a valid employee bean |
|
64 | + $employee->retrieve(1); |
|
65 | + $employee->fill_in_additional_detail_fields(); |
|
66 | + $this->assertEquals("", $employee->reports_to_name); |
|
69 | 67 | |
70 | - public function testretrieve_employee_id() |
|
71 | - { |
|
72 | - $employee = new Employee(); |
|
73 | - //$this->assertEquals('1' ,$employee->retrieve_employee_id('admin')); |
|
68 | + } |
|
74 | 69 | |
75 | - $this->markTestSkipped('Bug in query: employee_name parameter is wrongly used as user_name'); |
|
70 | + public function testretrieve_employee_id() |
|
71 | + { |
|
72 | + $employee = new Employee(); |
|
73 | + //$this->assertEquals('1' ,$employee->retrieve_employee_id('admin')); |
|
76 | 74 | |
77 | - } |
|
75 | + $this->markTestSkipped('Bug in query: employee_name parameter is wrongly used as user_name'); |
|
78 | 76 | |
77 | + } |
|
79 | 78 | |
80 | - public function testverify_data() |
|
81 | - { |
|
82 | - $employee = new Employee(); |
|
83 | - $this->assertEquals(true ,$employee->verify_data() ); |
|
84 | 79 | |
85 | - } |
|
80 | + public function testverify_data() |
|
81 | + { |
|
82 | + $employee = new Employee(); |
|
83 | + $this->assertEquals(true ,$employee->verify_data() ); |
|
86 | 84 | |
87 | - public function testget_list_view_data(){ |
|
85 | + } |
|
88 | 86 | |
89 | - $employee = new Employee(); |
|
87 | + public function testget_list_view_data(){ |
|
90 | 88 | |
91 | - $expected = array ( |
|
92 | - 'SUGAR_LOGIN' => '1', |
|
93 | - 'FULL_NAME' => ' ', |
|
94 | - 'NAME' => ' ', |
|
95 | - 'IS_ADMIN' => '0', |
|
96 | - 'EXTERNAL_AUTH_ONLY' => '0', |
|
97 | - 'RECEIVE_NOTIFICATIONS' => '1', |
|
98 | - 'DELETED' => 0, |
|
99 | - 'PORTAL_ONLY' => '0', |
|
100 | - 'SHOW_ON_EMPLOYEES' => '1', |
|
101 | - 'ENCODED_NAME' => ' ', |
|
102 | - 'EMAIL1' => '', |
|
103 | - 'EMAIL1_LINK' => '<a href=\'javascript:void(0);\' onclick=\'SUGAR.quickCompose.init({"fullComposeUrl":"contact_id=\\u0026parent_type=Employees\\u0026parent_id=\\u0026parent_name=+\\u0026to_addrs_ids=\\u0026to_addrs_names=\\u0026to_addrs_emails=\\u0026to_email_addrs=+%26nbsp%3B%26lt%3B%26gt%3B\\u0026return_module=Employees\\u0026return_action=ListView\\u0026return_id=","composePackage":{"contact_id":"","parent_type":"Employees","parent_id":"","parent_name":" ","to_addrs_ids":"","to_addrs_names":"","to_addrs_emails":"","to_email_addrs":" \\u003C\\u003E","return_module":"Employees","return_action":"ListView","return_id":""}});\' class=\'\'>', |
|
104 | - 'MESSENGER_TYPE' => '', |
|
105 | - 'REPORTS_TO_NAME' => NULL, |
|
106 | - ); |
|
89 | + $employee = new Employee(); |
|
107 | 90 | |
108 | - $actual = $employee->get_list_view_data(); |
|
109 | - $this->assertSame($expected, $actual); |
|
91 | + $expected = array ( |
|
92 | + 'SUGAR_LOGIN' => '1', |
|
93 | + 'FULL_NAME' => ' ', |
|
94 | + 'NAME' => ' ', |
|
95 | + 'IS_ADMIN' => '0', |
|
96 | + 'EXTERNAL_AUTH_ONLY' => '0', |
|
97 | + 'RECEIVE_NOTIFICATIONS' => '1', |
|
98 | + 'DELETED' => 0, |
|
99 | + 'PORTAL_ONLY' => '0', |
|
100 | + 'SHOW_ON_EMPLOYEES' => '1', |
|
101 | + 'ENCODED_NAME' => ' ', |
|
102 | + 'EMAIL1' => '', |
|
103 | + 'EMAIL1_LINK' => '<a href=\'javascript:void(0);\' onclick=\'SUGAR.quickCompose.init({"fullComposeUrl":"contact_id=\\u0026parent_type=Employees\\u0026parent_id=\\u0026parent_name=+\\u0026to_addrs_ids=\\u0026to_addrs_names=\\u0026to_addrs_emails=\\u0026to_email_addrs=+%26nbsp%3B%26lt%3B%26gt%3B\\u0026return_module=Employees\\u0026return_action=ListView\\u0026return_id=","composePackage":{"contact_id":"","parent_type":"Employees","parent_id":"","parent_name":" ","to_addrs_ids":"","to_addrs_names":"","to_addrs_emails":"","to_email_addrs":" \\u003C\\u003E","return_module":"Employees","return_action":"ListView","return_id":""}});\' class=\'\'>', |
|
104 | + 'MESSENGER_TYPE' => '', |
|
105 | + 'REPORTS_TO_NAME' => NULL, |
|
106 | + ); |
|
107 | + |
|
108 | + $actual = $employee->get_list_view_data(); |
|
109 | + $this->assertSame($expected, $actual); |
|
110 | 110 | |
111 | - } |
|
111 | + } |
|
112 | 112 | |
113 | - public function testlist_view_parse_additional_sections(){ |
|
113 | + public function testlist_view_parse_additional_sections(){ |
|
114 | 114 | |
115 | - $employee = new Employee(); |
|
115 | + $employee = new Employee(); |
|
116 | 116 | |
117 | - //execute the method and test if it works and does not throws an exception. |
|
118 | - try { |
|
119 | - $employee->list_view_parse_additional_sections(new Sugar_Smarty(), $xTemplateSection); |
|
120 | - $this->assertTrue(true); |
|
121 | - } |
|
122 | - catch (Exception $e) { |
|
123 | - $this->fail(); |
|
124 | - } |
|
117 | + //execute the method and test if it works and does not throws an exception. |
|
118 | + try { |
|
119 | + $employee->list_view_parse_additional_sections(new Sugar_Smarty(), $xTemplateSection); |
|
120 | + $this->assertTrue(true); |
|
121 | + } |
|
122 | + catch (Exception $e) { |
|
123 | + $this->fail(); |
|
124 | + } |
|
125 | 125 | |
126 | - } |
|
126 | + } |
|
127 | 127 | |
128 | 128 | |
129 | - public function testcreate_export_query() { |
|
129 | + public function testcreate_export_query() { |
|
130 | 130 | |
131 | - $employee = new Employee(); |
|
131 | + $employee = new Employee(); |
|
132 | 132 | |
133 | - //test with empty string params |
|
134 | - $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE users.deleted = 0 ORDER BY users.user_name"; |
|
135 | - $actual = $employee->create_export_query('',''); |
|
136 | - $this->assertSame($expected,$actual); |
|
133 | + //test with empty string params |
|
134 | + $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE users.deleted = 0 ORDER BY users.user_name"; |
|
135 | + $actual = $employee->create_export_query('',''); |
|
136 | + $this->assertSame($expected,$actual); |
|
137 | 137 | |
138 | 138 | |
139 | - //test with valid string params |
|
140 | - $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE users.user_name=\"\" AND users.deleted = 0 ORDER BY users.id"; |
|
141 | - $actual = $employee->create_export_query('users.id','users.user_name=""'); |
|
142 | - $this->assertSame($expected,$actual); |
|
139 | + //test with valid string params |
|
140 | + $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE users.user_name=\"\" AND users.deleted = 0 ORDER BY users.id"; |
|
141 | + $actual = $employee->create_export_query('users.id','users.user_name=""'); |
|
142 | + $this->assertSame($expected,$actual); |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | $this->fail(); |
159 | 159 | } |
160 | 160 | |
161 | - } |
|
161 | + } |
|
162 | 162 | |
163 | 163 | /** |
164 | 164 | * @todo: NEEDS FIXING! |
165 | 165 | */ |
166 | - public function testcreate_new_list_query() |
|
166 | + public function testcreate_new_list_query() |
|
167 | 167 | { |
168 | 168 | /* |
169 | 169 | $employee = new Employee(); |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | |
186 | 186 | public function testhasCustomFields() |
187 | 187 | { |
188 | - $employee = new Employee(); |
|
189 | - $result = $employee->hasCustomFields(); |
|
190 | - $this->assertEquals(false,$result); |
|
188 | + $employee = new Employee(); |
|
189 | + $result = $employee->hasCustomFields(); |
|
190 | + $this->assertEquals(false,$result); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | } |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | |
8 | 8 | //execute the contructor and check for the Object type and attributes |
9 | 9 | $employee = new Employee(); |
10 | - $this->assertInstanceOf('Employee',$employee); |
|
11 | - $this->assertInstanceOf('Person',$employee); |
|
12 | - $this->assertInstanceOf('SugarBean',$employee); |
|
10 | + $this->assertInstanceOf('Employee', $employee); |
|
11 | + $this->assertInstanceOf('Person', $employee); |
|
12 | + $this->assertInstanceOf('SugarBean', $employee); |
|
13 | 13 | |
14 | 14 | $this->assertAttributeEquals('Employees', 'module_dir', $employee); |
15 | 15 | $this->assertAttributeEquals('Employee', 'object_name', $employee); |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | $employee = new Employee(); |
27 | 27 | |
28 | 28 | //test without setting name |
29 | - $this->assertEquals(' ',$employee->get_summary_text()); |
|
29 | + $this->assertEquals(' ', $employee->get_summary_text()); |
|
30 | 30 | |
31 | 31 | //test with name set |
32 | 32 | $employee->retrieve(1); |
33 | - $this->assertEquals('Administrator',$employee->get_summary_text()); |
|
33 | + $this->assertEquals('Administrator', $employee->get_summary_text()); |
|
34 | 34 | |
35 | 35 | } |
36 | 36 | |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | public function testverify_data() |
81 | 81 | { |
82 | 82 | $employee = new Employee(); |
83 | - $this->assertEquals(true ,$employee->verify_data() ); |
|
83 | + $this->assertEquals(true, $employee->verify_data()); |
|
84 | 84 | |
85 | 85 | } |
86 | 86 | |
87 | - public function testget_list_view_data(){ |
|
87 | + public function testget_list_view_data() { |
|
88 | 88 | |
89 | 89 | $employee = new Employee(); |
90 | 90 | |
91 | - $expected = array ( |
|
91 | + $expected = array( |
|
92 | 92 | 'SUGAR_LOGIN' => '1', |
93 | 93 | 'FULL_NAME' => ' ', |
94 | 94 | 'NAME' => ' ', |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | } |
112 | 112 | |
113 | - public function testlist_view_parse_additional_sections(){ |
|
113 | + public function testlist_view_parse_additional_sections() { |
|
114 | 114 | |
115 | 115 | $employee = new Employee(); |
116 | 116 | |
@@ -132,14 +132,14 @@ discard block |
||
132 | 132 | |
133 | 133 | //test with empty string params |
134 | 134 | $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE users.deleted = 0 ORDER BY users.user_name"; |
135 | - $actual = $employee->create_export_query('',''); |
|
136 | - $this->assertSame($expected,$actual); |
|
135 | + $actual = $employee->create_export_query('', ''); |
|
136 | + $this->assertSame($expected, $actual); |
|
137 | 137 | |
138 | 138 | |
139 | 139 | //test with valid string params |
140 | 140 | $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE users.user_name=\"\" AND users.deleted = 0 ORDER BY users.id"; |
141 | - $actual = $employee->create_export_query('users.id','users.user_name=""'); |
|
142 | - $this->assertSame($expected,$actual); |
|
141 | + $actual = $employee->create_export_query('users.id', 'users.user_name=""'); |
|
142 | + $this->assertSame($expected, $actual); |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | $employee->preprocess_fields_on_save(); |
155 | 155 | $this->assertTrue(TRUE); |
156 | - } catch(Exception $e) |
|
156 | + }catch (Exception $e) |
|
157 | 157 | { |
158 | 158 | $this->fail(); |
159 | 159 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | { |
188 | 188 | $employee = new Employee(); |
189 | 189 | $result = $employee->hasCustomFields(); |
190 | - $this->assertEquals(false,$result); |
|
190 | + $this->assertEquals(false, $result); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | } |