Passed
Push — scrutinizer-code-quality ( 27193c...09f5a1 )
by Adam
51:28
created
modules/ProspectLists/ProspectList.php 4 patches
Braces   +42 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -122,19 +124,21 @@  discard block
 block discarded – undo
122 124
 			$where_auto = '1=1';
123 125
 				if($show_deleted == 0){
124 126
                 	$where_auto = "$this->table_name.deleted=0";
125
-				}else if($show_deleted == 1){
127
+				} else if($show_deleted == 1){
126 128
                 	$where_auto = "$this->table_name.deleted=1";
127 129
 				}
128 130
 
129
-		if($where != "")
130
-			$query .= "where $where AND ".$where_auto;
131
-		else
132
-			$query .= "where ".$where_auto;
131
+		if($where != "") {
132
+					$query .= "where $where AND ".$where_auto;
133
+		} else {
134
+					$query .= "where ".$where_auto;
135
+		}
133 136
 
134
-		if($order_by != "")
135
-			$query .= " ORDER BY $order_by";
136
-		else
137
-			$query .= " ORDER BY prospect_lists.name";
137
+		if($order_by != "") {
138
+					$query .= " ORDER BY $order_by";
139
+		} else {
140
+					$query .= " ORDER BY prospect_lists.name";
141
+		}
138 142
 
139 143
 		return $query;
140 144
 	}
@@ -152,15 +156,17 @@  discard block
 block discarded – undo
152 156
 
153 157
 		$where_auto = " prospect_lists.deleted=0";
154 158
 
155
-        if($where != "")
156
-                $query .= " WHERE $where AND ".$where_auto;
157
-        else
158
-                $query .= " WHERE ".$where_auto;
159
-
160
-        if($order_by != "")
161
-                $query .= " ORDER BY $order_by";
162
-        else
163
-                $query .= " ORDER BY prospect_lists.name";
159
+        if($where != "") {
160
+                        $query .= " WHERE $where AND ".$where_auto;
161
+        } else {
162
+                        $query .= " WHERE ".$where_auto;
163
+        }
164
+
165
+        if($order_by != "") {
166
+                        $query .= " ORDER BY $order_by";
167
+        } else {
168
+                        $query .= " ORDER BY prospect_lists.name";
169
+        }
164 170
         return $query;
165 171
     }
166 172
 
@@ -287,12 +293,15 @@  discard block
 block discarded – undo
287 293
 	function save_relationship_changes($is_update, $exclude = array())
288 294
     {
289 295
     	parent::save_relationship_changes($is_update, $exclude);
290
-		if($this->lead_id != "")
291
-	   		$this->set_prospect_relationship($this->id, $this->lead_id, "lead");
292
-    	if($this->contact_id != "")
293
-    		$this->set_prospect_relationship($this->id, $this->contact_id, "contact");
294
-    	if($this->prospect_id != "")
295
-    		$this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
296
+		if($this->lead_id != "") {
297
+			   		$this->set_prospect_relationship($this->id, $this->lead_id, "lead");
298
+		}
299
+    	if($this->contact_id != "") {
300
+    	    		$this->set_prospect_relationship($this->id, $this->contact_id, "contact");
301
+    	}
302
+    	if($this->prospect_id != "") {
303
+    	    		$this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
304
+    	}
296 305
     }
297 306
 
298 307
 	function set_prospect_relationship($prospect_list_id, &$link_ids, $link_name)
@@ -350,10 +359,11 @@  discard block
 block discarded – undo
350 359
 		
351 360
 		$row = $this->db->fetchByAssoc($result);
352 361
 
353
-		if($row)
354
-			return $row['num'];
355
-		else
356
-			return 0;
362
+		if($row) {
363
+					return $row['num'];
364
+		} else {
365
+					return 0;
366
+		}
357 367
 	}
358 368
 		
359 369
 		
@@ -375,7 +385,9 @@  discard block
 block discarded – undo
375 385
 		$the_where = "";
376 386
 		foreach($where_clauses as $clause)
377 387
 		{
378
-			if($the_where != "") $the_where .= " or ";
388
+			if($the_where != "") {
389
+			    $the_where .= " or ";
390
+			}
379 391
 			$the_where .= $clause;
380 392
 		}
381 393
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -295,6 +295,10 @@
 block discarded – undo
295 295
     		$this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
296 296
     }
297 297
 
298
+	/**
299
+	 * @param string $prospect_list_id
300
+	 * @param string $link_name
301
+	 */
298 302
 	function set_prospect_relationship($prospect_list_id, &$link_ids, $link_name)
299 303
 	{
300 304
 		$link_field = sprintf("%s_id", $link_name);
Please login to merge, or discard this patch.
Indentation   +201 added lines, -201 removed lines patch added patch discarded remove patch
@@ -50,107 +50,107 @@  discard block
 block discarded – undo
50 50
 
51 51
 
52 52
 class ProspectList extends SugarBean {
53
-	var $field_name_map;
54
-
55
-	// Stored fields
56
-	var $id;
57
-	var $date_entered;
58
-	var $date_modified;
59
-	var $modified_user_id;
60
-	var $assigned_user_id;
61
-	var $created_by;
62
-	var $created_by_name;
63
-	var $modified_by_name;
64
-	var $list_type;
65
-	var $domain_name;
66
-
67
-	var $name;
68
-	var $description;
69
-
70
-	// These are related
71
-	var $assigned_user_name;
72
-	var $prospect_id;
73
-	var $contact_id;
74
-	var $lead_id;
75
-
76
-	// module name definitions and table relations
77
-	var $table_name = "prospect_lists";
78
-	var $module_dir = 'ProspectLists';
79
-	var $rel_prospects_table = "prospect_lists_prospects";
80
-	var $object_name = "ProspectList";
81
-
82
-	// This is used to retrieve related fields from form posts.
83
-	var $additional_column_fields = array(
84
-		'assigned_user_name', 'assigned_user_id', 'campaign_id',
85
-	);
86
-	var $relationship_fields = array(
87
-		'campaign_id'=>'campaigns',
88
-		'prospect_list_prospects' => 'prospects',
89
-	);
53
+    var $field_name_map;
54
+
55
+    // Stored fields
56
+    var $id;
57
+    var $date_entered;
58
+    var $date_modified;
59
+    var $modified_user_id;
60
+    var $assigned_user_id;
61
+    var $created_by;
62
+    var $created_by_name;
63
+    var $modified_by_name;
64
+    var $list_type;
65
+    var $domain_name;
66
+
67
+    var $name;
68
+    var $description;
69
+
70
+    // These are related
71
+    var $assigned_user_name;
72
+    var $prospect_id;
73
+    var $contact_id;
74
+    var $lead_id;
75
+
76
+    // module name definitions and table relations
77
+    var $table_name = "prospect_lists";
78
+    var $module_dir = 'ProspectLists';
79
+    var $rel_prospects_table = "prospect_lists_prospects";
80
+    var $object_name = "ProspectList";
81
+
82
+    // This is used to retrieve related fields from form posts.
83
+    var $additional_column_fields = array(
84
+        'assigned_user_name', 'assigned_user_id', 'campaign_id',
85
+    );
86
+    var $relationship_fields = array(
87
+        'campaign_id'=>'campaigns',
88
+        'prospect_list_prospects' => 'prospects',
89
+    );
90 90
 
91 91
     var $entry_count;
92 92
 
93 93
     public function __construct() {
94
-		global $sugar_config;
95
-		parent::__construct();
94
+        global $sugar_config;
95
+        parent::__construct();
96 96
 
97
-	}
97
+    }
98 98
 
99
-	var $new_schema = true;
99
+    var $new_schema = true;
100 100
 
101
-	function get_summary_text()
102
-	{
103
-		return "$this->name";
104
-	}
101
+    function get_summary_text()
102
+    {
103
+        return "$this->name";
104
+    }
105 105
 
106
-	function create_list_query($order_by, $where, $show_deleted = 0)
107
-	{
106
+    function create_list_query($order_by, $where, $show_deleted = 0)
107
+    {
108 108
         $custom_join = $this->getCustomJoin();
109 109
 
110
-		$query = "SELECT ";
111
-		$query .= "users.user_name as assigned_user_name, ";
112
-		$query .= "prospect_lists.*";
110
+        $query = "SELECT ";
111
+        $query .= "users.user_name as assigned_user_name, ";
112
+        $query .= "prospect_lists.*";
113 113
 
114 114
         $query .= $custom_join['select'];
115
-		$query .= " FROM prospect_lists ";
115
+        $query .= " FROM prospect_lists ";
116 116
 
117
-		$query .= "LEFT JOIN users
117
+        $query .= "LEFT JOIN users
118 118
 					ON prospect_lists.assigned_user_id=users.id ";
119 119
 
120 120
         $query .= $custom_join['join'];
121 121
 
122
-			$where_auto = '1=1';
123
-				if($show_deleted == 0){
124
-                	$where_auto = "$this->table_name.deleted=0";
125
-				}else if($show_deleted == 1){
126
-                	$where_auto = "$this->table_name.deleted=1";
127
-				}
122
+            $where_auto = '1=1';
123
+                if($show_deleted == 0){
124
+                    $where_auto = "$this->table_name.deleted=0";
125
+                }else if($show_deleted == 1){
126
+                    $where_auto = "$this->table_name.deleted=1";
127
+                }
128 128
 
129
-		if($where != "")
130
-			$query .= "where $where AND ".$where_auto;
131
-		else
132
-			$query .= "where ".$where_auto;
129
+        if($where != "")
130
+            $query .= "where $where AND ".$where_auto;
131
+        else
132
+            $query .= "where ".$where_auto;
133 133
 
134
-		if($order_by != "")
135
-			$query .= " ORDER BY $order_by";
136
-		else
137
-			$query .= " ORDER BY prospect_lists.name";
134
+        if($order_by != "")
135
+            $query .= " ORDER BY $order_by";
136
+        else
137
+            $query .= " ORDER BY prospect_lists.name";
138 138
 
139
-		return $query;
140
-	}
139
+        return $query;
140
+    }
141 141
 
142 142
 
143
-	function create_export_query($order_by, $where)
144
-	{
143
+    function create_export_query($order_by, $where)
144
+    {
145 145
 
146 146
                                 $query = "SELECT
147 147
                                 prospect_lists.*,
148 148
                                 users.user_name as assigned_user_name ";
149
-	                            $query .= "FROM prospect_lists ";
150
-		$query .= 				"LEFT JOIN users
149
+                                $query .= "FROM prospect_lists ";
150
+        $query .= 				"LEFT JOIN users
151 151
                                 ON prospect_lists.assigned_user_id=users.id ";
152 152
 
153
-		$where_auto = " prospect_lists.deleted=0";
153
+        $where_auto = " prospect_lists.deleted=0";
154 154
 
155 155
         if($where != "")
156 156
                 $query .= " WHERE $where AND ".$where_auto;
@@ -164,47 +164,47 @@  discard block
 block discarded – undo
164 164
         return $query;
165 165
     }
166 166
 
167
-	function create_export_members_query($record_id)
168
-	{
169
-		$members = array(	'Accounts' 	=> array('has_custom_fields' => false, 'fields' => array()),
170
-					'Contacts' 	=> array('has_custom_fields' => false, 'fields' => array()),
171
-					'Users' 	=> array('has_custom_fields' => false, 'fields' => array()),
172
-					'Prospects' 	=> array('has_custom_fields' => false, 'fields' => array()),
173
-					'Leads' 	=> array('has_custom_fields' => false, 'fields' => array())
174
-				);
175
-
176
-		// query all custom fields in the fields_meta_data table for the modules which are being exported
177
-		$db = DBManagerFactory::getInstance();
178
-		$result = $db->query("select name, custom_module from fields_meta_data where custom_module in ('" .
179
-					implode("', '", array_keys($members)) . "')",
180
-					true,
181
-					"ProspectList::create_export_members_query() : error querying custom fields");
182
-
183
-		// cycle through the custom fields and put them in the members array according to
184
-		// what module the field belongs
185
-		// take into account that the same custom field may exist in more modules
186
-		while($val = $db->fetchByAssoc($result, false))
187
-		{
188
-			$fieldname = $val['name'];
189
-
190
-			foreach($members as $membername => &$memberarr)
191
-			{
192
-				// if the field belongs to this module, then query it in the cstm table
193
-				if ($membername == $val['custom_module'])
194
-				{
195
-					$memberarr['has_custom_fields'] = true;
196
-					$memberarr['fields'][$fieldname] =
197
-						strtolower($membername) . '_cstm.'.$fieldname . ' AS ' . $fieldname;
198
-				}
199
-				// else, only if for this module no entry exists for this field, query an empty string
200
-				else if (!isset($memberarr['fields'][$val['name']]))
201
-				{
202
-					$memberarr['fields'][$fieldname] = "'' AS " . $fieldname;
203
-				}
204
-			}
205
-		}
206
-
207
-		$leads_query = "SELECT l.id AS id, 'Leads' AS related_type, '' AS \"name\", l.first_name AS first_name, l.last_name AS last_name, l.title AS title, l.salutation AS salutation,
167
+    function create_export_members_query($record_id)
168
+    {
169
+        $members = array(	'Accounts' 	=> array('has_custom_fields' => false, 'fields' => array()),
170
+                    'Contacts' 	=> array('has_custom_fields' => false, 'fields' => array()),
171
+                    'Users' 	=> array('has_custom_fields' => false, 'fields' => array()),
172
+                    'Prospects' 	=> array('has_custom_fields' => false, 'fields' => array()),
173
+                    'Leads' 	=> array('has_custom_fields' => false, 'fields' => array())
174
+                );
175
+
176
+        // query all custom fields in the fields_meta_data table for the modules which are being exported
177
+        $db = DBManagerFactory::getInstance();
178
+        $result = $db->query("select name, custom_module from fields_meta_data where custom_module in ('" .
179
+                    implode("', '", array_keys($members)) . "')",
180
+                    true,
181
+                    "ProspectList::create_export_members_query() : error querying custom fields");
182
+
183
+        // cycle through the custom fields and put them in the members array according to
184
+        // what module the field belongs
185
+        // take into account that the same custom field may exist in more modules
186
+        while($val = $db->fetchByAssoc($result, false))
187
+        {
188
+            $fieldname = $val['name'];
189
+
190
+            foreach($members as $membername => &$memberarr)
191
+            {
192
+                // if the field belongs to this module, then query it in the cstm table
193
+                if ($membername == $val['custom_module'])
194
+                {
195
+                    $memberarr['has_custom_fields'] = true;
196
+                    $memberarr['fields'][$fieldname] =
197
+                        strtolower($membername) . '_cstm.'.$fieldname . ' AS ' . $fieldname;
198
+                }
199
+                // else, only if for this module no entry exists for this field, query an empty string
200
+                else if (!isset($memberarr['fields'][$val['name']]))
201
+                {
202
+                    $memberarr['fields'][$fieldname] = "'' AS " . $fieldname;
203
+                }
204
+            }
205
+        }
206
+
207
+        $leads_query = "SELECT l.id AS id, 'Leads' AS related_type, '' AS \"name\", l.first_name AS first_name, l.last_name AS last_name, l.title AS title, l.salutation AS salutation,
208 208
 				l.primary_address_street AS primary_address_street,l.primary_address_city AS primary_address_city, l.primary_address_state AS primary_address_state, l.primary_address_postalcode AS primary_address_postalcode, l.primary_address_country AS primary_address_country,
209 209
 				l.account_name AS account_name,
210 210
 				ea.email_address AS primary_email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 				AND l.deleted=0
220 220
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
221 221
 
222
-		$users_query = "SELECT u.id AS id, 'Users' AS related_type, '' AS \"name\", u.first_name AS first_name, u.last_name AS last_name,u.title AS title, '' AS salutation,
222
+        $users_query = "SELECT u.id AS id, 'Users' AS related_type, '' AS \"name\", u.first_name AS first_name, u.last_name AS last_name,u.title AS title, '' AS salutation,
223 223
 				u.address_street AS primary_address_street,u.address_city AS primary_address_city, u.address_state AS primary_address_state,  u.address_postalcode AS primary_address_postalcode, u.address_country AS primary_address_country,
224 224
 				'' AS account_name,
225 225
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 				AND u.deleted=0
235 235
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
236 236
 
237
-		$contacts_query = "SELECT c.id AS id, 'Contacts' AS related_type, '' AS \"name\", c.first_name AS first_name, c.last_name AS last_name,c.title AS title, c.salutation AS salutation,
237
+        $contacts_query = "SELECT c.id AS id, 'Contacts' AS related_type, '' AS \"name\", c.first_name AS first_name, c.last_name AS last_name,c.title AS title, c.salutation AS salutation,
238 238
 				c.primary_address_street AS primary_address_street,c.primary_address_city AS primary_address_city, c.primary_address_state AS primary_address_state,  c.primary_address_postalcode AS primary_address_postalcode, c.primary_address_country AS primary_address_country,
239 239
 				a.name AS account_name,
240 240
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 				AND c.deleted=0
251 251
                 AND (ear.deleted=0 OR ear.deleted IS NULL)";
252 252
 
253
-		$prospects_query = "SELECT p.id AS id, 'Prospects' AS related_type, '' AS \"name\", p.first_name AS first_name, p.last_name AS last_name,p.title AS title, p.salutation AS salutation,
253
+        $prospects_query = "SELECT p.id AS id, 'Prospects' AS related_type, '' AS \"name\", p.first_name AS first_name, p.last_name AS last_name,p.title AS title, p.salutation AS salutation,
254 254
 				p.primary_address_street AS primary_address_street,p.primary_address_city AS primary_address_city, p.primary_address_state AS primary_address_state,  p.primary_address_postalcode AS primary_address_postalcode, p.primary_address_country AS primary_address_country,
255 255
 				p.account_name AS account_name,
256 256
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 				AND p.deleted=0
266 266
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
267 267
 
268
-		$accounts_query = "SELECT a.id AS id, 'Accounts' AS related_type, a.name AS \"name\", '' AS first_name, '' AS last_name,'' AS title, '' AS salutation,
268
+        $accounts_query = "SELECT a.id AS id, 'Accounts' AS related_type, a.name AS \"name\", '' AS first_name, '' AS last_name,'' AS title, '' AS salutation,
269 269
 				a.billing_address_street AS primary_address_street,a.billing_address_city AS primary_address_city, a.billing_address_state AS primary_address_state, a.billing_address_postalcode AS primary_address_postalcode, a.billing_address_country AS primary_address_country,
270 270
 				'' AS account_name,
271 271
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
@@ -279,115 +279,115 @@  discard block
 block discarded – undo
279 279
 				WHERE plp.prospect_list_id = $record_id  AND plp.deleted=0
280 280
 				AND a.deleted=0
281 281
 				AND (ear.deleted=0 OR ear.deleted IS NULL)";
282
-		$order_by = "ORDER BY related_type, id, primary_address DESC";
283
-		$query = "$leads_query UNION ALL $users_query UNION ALL $contacts_query UNION ALL $prospects_query UNION ALL $accounts_query $order_by";
284
-		return $query;
285
-	}
282
+        $order_by = "ORDER BY related_type, id, primary_address DESC";
283
+        $query = "$leads_query UNION ALL $users_query UNION ALL $contacts_query UNION ALL $prospects_query UNION ALL $accounts_query $order_by";
284
+        return $query;
285
+    }
286 286
 
287
-	function save_relationship_changes($is_update, $exclude = array())
287
+    function save_relationship_changes($is_update, $exclude = array())
288 288
     {
289
-    	parent::save_relationship_changes($is_update, $exclude);
290
-		if($this->lead_id != "")
291
-	   		$this->set_prospect_relationship($this->id, $this->lead_id, "lead");
292
-    	if($this->contact_id != "")
293
-    		$this->set_prospect_relationship($this->id, $this->contact_id, "contact");
294
-    	if($this->prospect_id != "")
295
-    		$this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
289
+        parent::save_relationship_changes($is_update, $exclude);
290
+        if($this->lead_id != "")
291
+                $this->set_prospect_relationship($this->id, $this->lead_id, "lead");
292
+        if($this->contact_id != "")
293
+            $this->set_prospect_relationship($this->id, $this->contact_id, "contact");
294
+        if($this->prospect_id != "")
295
+            $this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
296 296
     }
297 297
 
298
-	function set_prospect_relationship($prospect_list_id, &$link_ids, $link_name)
299
-	{
300
-		$link_field = sprintf("%s_id", $link_name);
298
+    function set_prospect_relationship($prospect_list_id, &$link_ids, $link_name)
299
+    {
300
+        $link_field = sprintf("%s_id", $link_name);
301 301
 
302
-		foreach($link_ids as $link_id)
303
-		{
304
-			$this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
305
-		}
306
-	}
302
+        foreach($link_ids as $link_id)
303
+        {
304
+            $this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
305
+        }
306
+    }
307 307
 
308
-	function set_prospect_relationship_single($prospect_list_id, $link_id, $link_name)
309
-	{
310
-		$link_field = sprintf("%s_id", $link_name);
308
+    function set_prospect_relationship_single($prospect_list_id, $link_id, $link_name)
309
+    {
310
+        $link_field = sprintf("%s_id", $link_name);
311 311
 
312
-		$this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
313
-	}
312
+        $this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
313
+    }
314 314
 
315 315
 
316
-	function clear_prospect_relationship($prospect_list_id, $link_id, $link_name)
317
-	{
318
-		$link_field = sprintf("%s_id", $link_name);
319
-		$where_clause = " AND $link_field = '$link_id' ";
316
+    function clear_prospect_relationship($prospect_list_id, $link_id, $link_name)
317
+    {
318
+        $link_field = sprintf("%s_id", $link_name);
319
+        $where_clause = " AND $link_field = '$link_id' ";
320 320
 
321
-		$query = sprintf("DELETE FROM prospect_lists_prospects WHERE prospect_list_id='%s' AND deleted = '0' %s", $prospect_list_id, $where_clause);
321
+        $query = sprintf("DELETE FROM prospect_lists_prospects WHERE prospect_list_id='%s' AND deleted = '0' %s", $prospect_list_id, $where_clause);
322 322
 
323
-		$this->db->query($query, true, "Error clearing prospect/prospect_list relationship: ");
324
-	}
323
+        $this->db->query($query, true, "Error clearing prospect/prospect_list relationship: ");
324
+    }
325 325
 
326 326
 
327
-	function mark_relationships_deleted($id)
328
-	{
329
-	}
327
+    function mark_relationships_deleted($id)
328
+    {
329
+    }
330 330
 
331
-	function fill_in_additional_list_fields()
332
-	{
333
-	}
331
+    function fill_in_additional_list_fields()
332
+    {
333
+    }
334 334
 
335
-	function fill_in_additional_detail_fields()
336
-	{
337
-		parent::fill_in_additional_detail_fields();
335
+    function fill_in_additional_detail_fields()
336
+    {
337
+        parent::fill_in_additional_detail_fields();
338 338
         $this->entry_count = $this->get_entry_count();
339
-	}
339
+    }
340 340
 
341 341
 
342
-	function update_currency_id($fromid, $toid){
343
-	}
342
+    function update_currency_id($fromid, $toid){
343
+    }
344 344
 
345 345
 
346
-	function get_entry_count()
347
-	{
348
-		$query = "SELECT count(*) AS num FROM prospect_lists_prospects WHERE prospect_list_id='$this->id' AND deleted = '0'";
349
-		$result = $this->db->query($query, true, "Grabbing prospect_list entry count");
346
+    function get_entry_count()
347
+    {
348
+        $query = "SELECT count(*) AS num FROM prospect_lists_prospects WHERE prospect_list_id='$this->id' AND deleted = '0'";
349
+        $result = $this->db->query($query, true, "Grabbing prospect_list entry count");
350 350
 
351
-		$row = $this->db->fetchByAssoc($result);
351
+        $row = $this->db->fetchByAssoc($result);
352 352
 
353
-		if($row)
354
-			return $row['num'];
355
-		else
356
-			return 0;
357
-	}
353
+        if($row)
354
+            return $row['num'];
355
+        else
356
+            return 0;
357
+    }
358 358
 
359 359
 
360
-	function get_list_view_data(){
361
-		$temp_array = $this->get_list_view_array();
362
-		$temp_array["ENTRY_COUNT"] = $this->get_entry_count();
363
-		return $temp_array;
364
-	}
365
-	/**
360
+    function get_list_view_data(){
361
+        $temp_array = $this->get_list_view_array();
362
+        $temp_array["ENTRY_COUNT"] = $this->get_entry_count();
363
+        return $temp_array;
364
+    }
365
+    /**
366 366
 		builds a generic search based on the query string using or
367 367
 		do not include any $this-> because this is called on without having the class instantiated
368
-	*/
369
-	function build_generic_where_clause ($the_query_string)
370
-	{
371
-		$where_clauses = Array();
372
-		$the_query_string = $GLOBALS['db']->quote($the_query_string);
373
-		array_push($where_clauses, "prospect_lists.name like '$the_query_string%'");
368
+     */
369
+    function build_generic_where_clause ($the_query_string)
370
+    {
371
+        $where_clauses = Array();
372
+        $the_query_string = $GLOBALS['db']->quote($the_query_string);
373
+        array_push($where_clauses, "prospect_lists.name like '$the_query_string%'");
374 374
 
375
-		$the_where = "";
376
-		foreach($where_clauses as $clause)
377
-		{
378
-			if($the_where != "") $the_where .= " or ";
379
-			$the_where .= $clause;
380
-		}
375
+        $the_where = "";
376
+        foreach($where_clauses as $clause)
377
+        {
378
+            if($the_where != "") $the_where .= " or ";
379
+            $the_where .= $clause;
380
+        }
381 381
 
382 382
 
383
-		return $the_where;
384
-	}
383
+        return $the_where;
384
+    }
385 385
 
386
-	function save($check_notify = FALSE) {
386
+    function save($check_notify = FALSE) {
387 387
 
388
-		return parent::save($check_notify);
388
+        return parent::save($check_notify);
389 389
 
390
-	}
390
+    }
391 391
 
392 392
     function mark_deleted($id){
393 393
         $query = "UPDATE prospect_lists_prospects SET deleted = 1 WHERE prospect_list_id = '{$id}' ";
@@ -395,12 +395,12 @@  discard block
 block discarded – undo
395 395
         return parent::mark_deleted($id);
396 396
     }
397 397
 
398
-	 function bean_implements($interface){
399
-		switch($interface){
400
-			case 'ACL':return true;
401
-		}
402
-		return false;
403
-	}
398
+        function bean_implements($interface){
399
+        switch($interface){
400
+            case 'ACL':return true;
401
+        }
402
+        return false;
403
+    }
404 404
 
405 405
 }
406 406
 
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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.
@@ -120,18 +120,18 @@  discard block
 block discarded – undo
120 120
         $query .= $custom_join['join'];
121 121
 
122 122
 			$where_auto = '1=1';
123
-				if($show_deleted == 0){
123
+				if ($show_deleted == 0) {
124 124
                 	$where_auto = "$this->table_name.deleted=0";
125
-				}else if($show_deleted == 1){
125
+				} else if ($show_deleted == 1) {
126 126
                 	$where_auto = "$this->table_name.deleted=1";
127 127
 				}
128 128
 
129
-		if($where != "")
129
+		if ($where != "")
130 130
 			$query .= "where $where AND ".$where_auto;
131 131
 		else
132 132
 			$query .= "where ".$where_auto;
133 133
 
134
-		if($order_by != "")
134
+		if ($order_by != "")
135 135
 			$query .= " ORDER BY $order_by";
136 136
 		else
137 137
 			$query .= " ORDER BY prospect_lists.name";
@@ -147,17 +147,17 @@  discard block
 block discarded – undo
147 147
                                 prospect_lists.*,
148 148
                                 users.user_name as assigned_user_name ";
149 149
 	                            $query .= "FROM prospect_lists ";
150
-		$query .= 				"LEFT JOIN users
150
+		$query .= "LEFT JOIN users
151 151
                                 ON prospect_lists.assigned_user_id=users.id ";
152 152
 
153 153
 		$where_auto = " prospect_lists.deleted=0";
154 154
 
155
-        if($where != "")
155
+        if ($where != "")
156 156
                 $query .= " WHERE $where AND ".$where_auto;
157 157
         else
158 158
                 $query .= " WHERE ".$where_auto;
159 159
 
160
-        if($order_by != "")
160
+        if ($order_by != "")
161 161
                 $query .= " ORDER BY $order_by";
162 162
         else
163 163
                 $query .= " ORDER BY prospect_lists.name";
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
 	function create_export_members_query($record_id)
168 168
 	{
169
-		$members = array(	'Accounts' 	=> array('has_custom_fields' => false, 'fields' => array()),
169
+		$members = array('Accounts' 	=> array('has_custom_fields' => false, 'fields' => array()),
170 170
 					'Contacts' 	=> array('has_custom_fields' => false, 'fields' => array()),
171 171
 					'Users' 	=> array('has_custom_fields' => false, 'fields' => array()),
172 172
 					'Prospects' 	=> array('has_custom_fields' => false, 'fields' => array()),
@@ -175,31 +175,31 @@  discard block
 block discarded – undo
175 175
 
176 176
 		// query all custom fields in the fields_meta_data table for the modules which are being exported
177 177
 		$db = DBManagerFactory::getInstance();
178
-		$result = $db->query("select name, custom_module from fields_meta_data where custom_module in ('" .
179
-					implode("', '", array_keys($members)) . "')",
178
+		$result = $db->query("select name, custom_module from fields_meta_data where custom_module in ('".
179
+					implode("', '", array_keys($members))."')",
180 180
 					true,
181 181
 					"ProspectList::create_export_members_query() : error querying custom fields");
182 182
 
183 183
 		// cycle through the custom fields and put them in the members array according to
184 184
 		// what module the field belongs
185 185
 		// take into account that the same custom field may exist in more modules
186
-		while($val = $db->fetchByAssoc($result, false))
186
+		while ($val = $db->fetchByAssoc($result, false))
187 187
 		{
188 188
 			$fieldname = $val['name'];
189 189
 
190
-			foreach($members as $membername => &$memberarr)
190
+			foreach ($members as $membername => &$memberarr)
191 191
 			{
192 192
 				// if the field belongs to this module, then query it in the cstm table
193 193
 				if ($membername == $val['custom_module'])
194 194
 				{
195 195
 					$memberarr['has_custom_fields'] = true;
196 196
 					$memberarr['fields'][$fieldname] =
197
-						strtolower($membername) . '_cstm.'.$fieldname . ' AS ' . $fieldname;
197
+						strtolower($membername).'_cstm.'.$fieldname.' AS '.$fieldname;
198 198
 				}
199 199
 				// else, only if for this module no entry exists for this field, query an empty string
200 200
 				else if (!isset($memberarr['fields'][$val['name']]))
201 201
 				{
202
-					$memberarr['fields'][$fieldname] = "'' AS " . $fieldname;
202
+					$memberarr['fields'][$fieldname] = "'' AS ".$fieldname;
203 203
 				}
204 204
 			}
205 205
 		}
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 				l.account_name AS account_name,
210 210
 				ea.email_address AS primary_email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
211 211
 				l.do_not_call AS do_not_call, l.phone_fax AS phone_fax, l.phone_other AS phone_other, l.phone_home AS phone_home, l.phone_mobile AS phone_mobile, l.phone_work AS phone_work
212
-				".(count($members['Leads']['fields']) ? ', ' : '') . implode(', ', $members['Leads']['fields'])."
212
+				".(count($members['Leads']['fields']) ? ', ' : '').implode(', ', $members['Leads']['fields'])."
213 213
 				FROM prospect_lists_prospects plp
214 214
 				INNER JOIN leads l ON plp.related_id=l.id
215 215
 				".($members['Leads']['has_custom_fields'] ? 'LEFT join leads_cstm ON l.id = leads_cstm.id_c' : '')."
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 				'' AS account_name,
225 225
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
226 226
 				0 AS do_not_call, u.phone_fax AS phone_fax, u.phone_other AS phone_other, u.phone_home AS phone_home, u.phone_mobile AS phone_mobile, u.phone_work AS phone_work
227
-				".(count($members['Users']['fields']) ? ', ' : '') . implode(', ', $members['Users']['fields'])."
227
+				".(count($members['Users']['fields']) ? ', ' : '').implode(', ', $members['Users']['fields'])."
228 228
 				FROM prospect_lists_prospects plp
229 229
 				INNER JOIN users u ON plp.related_id=u.id
230 230
 				".($members['Users']['has_custom_fields'] ? 'LEFT join users_cstm ON u.id = users_cstm.id_c' : '')."
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 				a.name AS account_name,
240 240
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
241 241
 				c.do_not_call AS do_not_call, c.phone_fax AS phone_fax, c.phone_other AS phone_other, c.phone_home AS phone_home, c.phone_mobile AS phone_mobile, c.phone_work AS phone_work
242
-				".(count($members['Contacts']['fields']) ? ', ' : '') . implode(', ', $members['Contacts']['fields'])."
242
+				".(count($members['Contacts']['fields']) ? ', ' : '').implode(', ', $members['Contacts']['fields'])."
243 243
 FROM prospect_lists_prospects plp
244 244
 				INNER JOIN contacts c ON plp.related_id=c.id LEFT JOIN accounts_contacts ac ON ac.contact_id=c.id
245 245
 				LEFT JOIN accounts a ON ac.account_id=a.id AND ac.deleted=0
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 				p.account_name AS account_name,
256 256
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
257 257
 				p.do_not_call AS do_not_call, p.phone_fax AS phone_fax, p.phone_other AS phone_other, p.phone_home AS phone_home, p.phone_mobile AS phone_mobile, p.phone_work AS phone_work
258
-				".(count($members['Prospects']['fields']) ? ', ' : '') . implode(', ', $members['Prospects']['fields'])."
258
+				".(count($members['Prospects']['fields']) ? ', ' : '').implode(', ', $members['Prospects']['fields'])."
259 259
 				FROM prospect_lists_prospects plp
260 260
 				INNER JOIN prospects p ON plp.related_id=p.id
261 261
 				".($members['Prospects']['has_custom_fields'] ? 'LEFT join prospects_cstm ON p.id = prospects_cstm.id_c' : '')."
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 				'' AS account_name,
271 271
 				ea.email_address AS email_address, ea.invalid_email AS invalid_email, ea.opt_out AS opt_out, ea.deleted AS ea_deleted, ear.deleted AS ear_deleted, ear.primary_address AS primary_address,
272 272
 				0 AS do_not_call, a.phone_fax as phone_fax, a.phone_alternate AS phone_other, '' AS phone_home, '' AS phone_mobile, a.phone_office AS phone_office
273
-				".(count($members['Accounts']['fields']) ? ', ' : '') . implode(', ', $members['Accounts']['fields'])."
273
+				".(count($members['Accounts']['fields']) ? ', ' : '').implode(', ', $members['Accounts']['fields'])."
274 274
 				FROM prospect_lists_prospects plp
275 275
 				INNER JOIN accounts a ON plp.related_id=a.id
276 276
 				".($members['Accounts']['has_custom_fields'] ? 'LEFT join accounts_cstm ON a.id = accounts_cstm.id_c' : '')."
@@ -287,11 +287,11 @@  discard block
 block discarded – undo
287 287
 	function save_relationship_changes($is_update, $exclude = array())
288 288
     {
289 289
     	parent::save_relationship_changes($is_update, $exclude);
290
-		if($this->lead_id != "")
290
+		if ($this->lead_id != "")
291 291
 	   		$this->set_prospect_relationship($this->id, $this->lead_id, "lead");
292
-    	if($this->contact_id != "")
292
+    	if ($this->contact_id != "")
293 293
     		$this->set_prospect_relationship($this->id, $this->contact_id, "contact");
294
-    	if($this->prospect_id != "")
294
+    	if ($this->prospect_id != "")
295 295
     		$this->set_prospect_relationship($this->id, $this->contact_id, "prospect");
296 296
     }
297 297
 
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
 	{
300 300
 		$link_field = sprintf("%s_id", $link_name);
301 301
 
302
-		foreach($link_ids as $link_id)
302
+		foreach ($link_ids as $link_id)
303 303
 		{
304
-			$this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
304
+			$this->set_relationship('prospect_lists_prospects', array($link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id));
305 305
 		}
306 306
 	}
307 307
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	{
310 310
 		$link_field = sprintf("%s_id", $link_name);
311 311
 
312
-		$this->set_relationship('prospect_lists_prospects', array( $link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id ));
312
+		$this->set_relationship('prospect_lists_prospects', array($link_field=>$link_id, 'prospect_list_id'=>$prospect_list_id));
313 313
 	}
314 314
 
315 315
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	}
340 340
 
341 341
 
342
-	function update_currency_id($fromid, $toid){
342
+	function update_currency_id($fromid, $toid) {
343 343
 	}
344 344
 
345 345
 
@@ -350,14 +350,14 @@  discard block
 block discarded – undo
350 350
 
351 351
 		$row = $this->db->fetchByAssoc($result);
352 352
 
353
-		if($row)
353
+		if ($row)
354 354
 			return $row['num'];
355 355
 		else
356 356
 			return 0;
357 357
 	}
358 358
 
359 359
 
360
-	function get_list_view_data(){
360
+	function get_list_view_data() {
361 361
 		$temp_array = $this->get_list_view_array();
362 362
 		$temp_array["ENTRY_COUNT"] = $this->get_entry_count();
363 363
 		return $temp_array;
@@ -366,16 +366,16 @@  discard block
 block discarded – undo
366 366
 		builds a generic search based on the query string using or
367 367
 		do not include any $this-> because this is called on without having the class instantiated
368 368
 	*/
369
-	function build_generic_where_clause ($the_query_string)
369
+	function build_generic_where_clause($the_query_string)
370 370
 	{
371 371
 		$where_clauses = Array();
372 372
 		$the_query_string = $GLOBALS['db']->quote($the_query_string);
373 373
 		array_push($where_clauses, "prospect_lists.name like '$the_query_string%'");
374 374
 
375 375
 		$the_where = "";
376
-		foreach($where_clauses as $clause)
376
+		foreach ($where_clauses as $clause)
377 377
 		{
378
-			if($the_where != "") $the_where .= " or ";
378
+			if ($the_where != "") $the_where .= " or ";
379 379
 			$the_where .= $clause;
380 380
 		}
381 381
 
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
 
390 390
 	}
391 391
 
392
-    function mark_deleted($id){
392
+    function mark_deleted($id) {
393 393
         $query = "UPDATE prospect_lists_prospects SET deleted = 1 WHERE prospect_list_id = '{$id}' ";
394 394
         $this->db->query($query);
395 395
         return parent::mark_deleted($id);
396 396
     }
397 397
 
398
-	 function bean_implements($interface){
399
-		switch($interface){
398
+	 function bean_implements($interface) {
399
+		switch ($interface) {
400 400
 			case 'ACL':return true;
401 401
 		}
402 402
 		return false;
Please login to merge, or discard this patch.
modules/ProspectLists/SubPanelView.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 $button  = "<form action='index.php' method='post' name='ProspectListForm' id='ProspectListForm'>\n";
68 68
 $button .= "<input type='hidden' name='module' value='ProspectLists'>\n";
69 69
 if ($currentModule == 'Campaigns') {
70
-	$button .= "<input type='hidden' name='campaign_id' value='$focus->id'>\n";
71
-	$button .= "<input type='hidden' name='record' value='$focus->id'>\n";
72
-	$button .= "<input type='hidden' name='campaign_name' value=\"$focus->name\">\n";
70
+    $button .= "<input type='hidden' name='campaign_id' value='$focus->id'>\n";
71
+    $button .= "<input type='hidden' name='record' value='$focus->id'>\n";
72
+    $button .= "<input type='hidden' name='campaign_name' value=\"$focus->name\">\n";
73 73
 }
74 74
 $button .= "<input type='hidden' name='prospect_list_id' value=''>\n";
75 75
 $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
 $button .= "<input title='".$app_strings['LBL_NEW_BUTTON_TITLE']."' accessyKey='".$app_strings['LBL_NEW_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView'\" type='submit' name='New' value='  ".$app_strings['LBL_NEW_BUTTON_LABEL']."  '>\n";
81 81
 if ($currentModule == 'Campaigns')
82 82
 {
83
-	///////////////////////////////////////
84
-	///
85
-	/// SETUP PARENT POPUP
83
+    ///////////////////////////////////////
84
+    ///
85
+    /// SETUP PARENT POPUP
86 86
 	
87
-	$popup_request_data = array(
88
-		'call_back_function' => 'set_return_prospect_list_and_save',
89
-		'form_name' => 'ProspectListForm',
90
-		'field_to_name_array' => array(
91
-			'id' => 'prospect_list_id',
92
-			),
93
-		);
87
+    $popup_request_data = array(
88
+        'call_back_function' => 'set_return_prospect_list_and_save',
89
+        'form_name' => 'ProspectListForm',
90
+        'field_to_name_array' => array(
91
+            'id' => 'prospect_list_id',
92
+            ),
93
+        );
94 94
 	
95
-	$json = getJSONobj();
96
-	$encoded_popup_request_data = $json->encode($popup_request_data);
95
+    $json = getJSONobj();
96
+    $encoded_popup_request_data = $json->encode($popup_request_data);
97 97
 	
98
-	//
99
-	///////////////////////////////////////
98
+    //
99
+    ///////////////////////////////////////
100 100
 	
101
-	$button .= "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']
102
-		." 'accessyKey='".$app_strings['LBL_SELECT_BUTTON_KEY']
103
-		."' type='button' class='button' value='  ".$app_strings['LBL_SELECT_BUTTON_LABEL']
104
-		."  ' name='button' onclick='open_popup(\"ProspectLists\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
101
+    $button .= "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']
102
+        ." 'accessyKey='".$app_strings['LBL_SELECT_BUTTON_KEY']
103
+        ."' type='button' class='button' value='  ".$app_strings['LBL_SELECT_BUTTON_LABEL']
104
+        ."  ' name='button' onclick='open_popup(\"ProspectLists\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
105 105
 //		."  ' name='button' onclick='window.open(\"index.php?module=ProspectLists&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'>\n";
106 106
 }
107 107
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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.
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
 $ListView->initNewXTemplate('modules/ProspectLists/SubPanelView.html', $current_module_strings);
112 112
 
113 113
 $ListView->xTemplateAssign("CAMPAIGN_RECORD", $focus->id);
114
-$ListView->xTemplateAssign("EDIT_INLINE_PNG",  SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_EDIT']));
115
-$ListView->xTemplateAssign("REMOVE_INLINE_PNG",  SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_REMOVE']));
114
+$ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
115
+$ListView->xTemplateAssign("REMOVE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_REMOVE']));
116 116
 
117 117
 $ListView->xTemplateAssign("RETURN_URL", "&return_module=".$currentModule."&return_action=DetailView&return_id=".$focus->id);
118
-$ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME'] );
118
+$ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME']);
119 119
 $ListView->setHeaderText($button);
120 120
 $ListView->processListView($focus_list, "main", "PROSPECT_LIST");
121 121
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/AOS_Products/metadata/subpaneldefs.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -40,24 +40,24 @@
 block discarded – undo
40 40
 
41 41
 
42 42
 $layout_defs['AOS_Products'] = array(
43
-	// list of what Subpanels to show in the DetailView
44
-	'subpanel_setup' => array(
43
+    // list of what Subpanels to show in the DetailView
44
+    'subpanel_setup' => array(
45 45
 
46
-		'aos_products_purchases' => array(
47
-			'order' => 100,
48
-			'module' => 'AOS_Quotes',
49
-			'subpanel_name' => 'ForProductPurchases',
50
-			'sort_order' => 'asc',
51
-			'sort_by' => 'id',
52
-			'title_key' => 'LBL_CUSTOMERS_PURCHASED_PRODUCTS_SUBPANEL_TITLE',
53
-			//'get_subpanel_data' => 'aos_products_aos_quotes_1',
54
-			'get_subpanel_data' => 'function:getCustomersPurchasedProductsQuery',
55
-			'top_buttons' =>
56
-			array(
57
-			),
58
-		),
46
+        'aos_products_purchases' => array(
47
+            'order' => 100,
48
+            'module' => 'AOS_Quotes',
49
+            'subpanel_name' => 'ForProductPurchases',
50
+            'sort_order' => 'asc',
51
+            'sort_by' => 'id',
52
+            'title_key' => 'LBL_CUSTOMERS_PURCHASED_PRODUCTS_SUBPANEL_TITLE',
53
+            //'get_subpanel_data' => 'aos_products_aos_quotes_1',
54
+            'get_subpanel_data' => 'function:getCustomersPurchasedProductsQuery',
55
+            'top_buttons' =>
56
+            array(
57
+            ),
58
+        ),
59 59
 
60
-	),
60
+    ),
61 61
 );
62 62
 
63 63
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/AOS_Products/metadata/dashletviewdefs.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,27 +30,27 @@
 block discarded – undo
30 30
 global $current_user;
31 31
 
32 32
 $dashletData['AOS_ProductsDashlet']['searchFields'] = array('date_entered'     => array('default' => ''),
33
-                                                          'date_modified'    => array('default' => ''),
33
+                                                            'date_modified'    => array('default' => ''),
34 34
 
35 35
 
36 36
 
37
-                                                          'assigned_user_id' => array('type'    => 'assigned_user_name', 
38
-                                                                                      'default' => $current_user->name));
37
+                                                            'assigned_user_id' => array('type'    => 'assigned_user_name', 
38
+                                                                                        'default' => $current_user->name));
39 39
 $dashletData['AOS_ProductsDashlet']['columns'] =  array(   'name' => array('width'   => '40', 
40
-                                                                      'label'   => 'LBL_LIST_NAME',
41
-                                                                      'link'    => true,
42
-                                                                      'default' => true), 
43
-                                                      'date_entered' => array('width'   => '15', 
44
-                                                                              'label'   => 'LBL_DATE_ENTERED',
45
-                                                                              'default' => true),
46
-                                                      'date_modified' => array('width'   => '15', 
47
-                                                                              'label'   => 'LBL_DATE_MODIFIED'),    
48
-                                                      'created_by' => array('width'   => '8', 
40
+                                                                        'label'   => 'LBL_LIST_NAME',
41
+                                                                        'link'    => true,
42
+                                                                        'default' => true), 
43
+                                                        'date_entered' => array('width'   => '15', 
44
+                                                                                'label'   => 'LBL_DATE_ENTERED',
45
+                                                                                'default' => true),
46
+                                                        'date_modified' => array('width'   => '15', 
47
+                                                                                'label'   => 'LBL_DATE_MODIFIED'),    
48
+                                                        'created_by' => array('width'   => '8', 
49 49
                                                                             'label'   => 'LBL_CREATED'),
50
-                                                      'assigned_user_name' => array('width'   => '8', 
51
-                                                                                     'label'   => 'LBL_LIST_ASSIGNED_USER'),
50
+                                                        'assigned_user_name' => array('width'   => '8', 
51
+                                                                                        'label'   => 'LBL_LIST_ASSIGNED_USER'),
52 52
 
53 53
 
54 54
 
55 55
 
56
-                                               );
56
+                                                );
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
  * Products, Quotations & Invoices modules.
5 5
  * Extensions to SugarCRM
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
                                                           'assigned_user_id' => array('type'    => 'assigned_user_name', 
38 38
                                                                                       'default' => $current_user->name));
39
-$dashletData['AOS_ProductsDashlet']['columns'] =  array(   'name' => array('width'   => '40', 
39
+$dashletData['AOS_ProductsDashlet']['columns'] = array('name' => array('width'   => '40', 
40 40
                                                                       'label'   => 'LBL_LIST_NAME',
41 41
                                                                       'link'    => true,
42 42
                                                                       'default' => true), 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/AOS_Products/metadata/editviewdefs.php 2 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -2,129 +2,129 @@
 block discarded – undo
2 2
 $module_name = 'AOS_Products';
3 3
 $viewdefs [$module_name] = 
4 4
 array (
5
-  'EditView' => 
6
-  array (
5
+    'EditView' => 
6
+    array (
7 7
     'templateMeta' => 
8 8
     array (
9
-      'maxColumns' => '2',
10
-      'widths' => 
11
-      array (
9
+        'maxColumns' => '2',
10
+        'widths' => 
11
+        array (
12 12
         0 => 
13 13
         array (
14
-          'label' => '10',
15
-          'field' => '30',
14
+            'label' => '10',
15
+            'field' => '30',
16 16
         ),
17 17
         1 => 
18 18
         array (
19
-          'label' => '10',
20
-          'field' => '30',
19
+            'label' => '10',
20
+            'field' => '30',
21
+        ),
21 22
         ),
22
-      ),
23
-      'form' => 
24
-      array (
23
+        'form' => 
24
+        array (
25 25
         'enctype' => 'multipart/form-data',
26 26
         'headerTpl' => 'modules/AOS_Products/tpls/EditViewHeader.tpl',
27
-      ),
28
-      'includes' => 
29
-      array (
27
+        ),
28
+        'includes' => 
29
+        array (
30 30
         0 => 
31 31
         array (
32
-          'file' => 'modules/AOS_Products/js/products.js',
32
+            'file' => 'modules/AOS_Products/js/products.js',
33 33
         ),
34
-      ),
35
-      'useTabs' => false,
36
-      'tabDefs' => 
37
-      array (
34
+        ),
35
+        'useTabs' => false,
36
+        'tabDefs' => 
37
+        array (
38 38
         'DEFAULT' => 
39 39
         array (
40
-          'newTab' => false,
41
-          'panelDefault' => 'expanded',
40
+            'newTab' => false,
41
+            'panelDefault' => 'expanded',
42
+        ),
42 43
         ),
43
-      ),
44 44
     ),
45 45
     'panels' => 
46 46
     array (
47
-      'default' => 
48
-      array (
47
+        'default' => 
48
+        array (
49 49
         0 => 
50 50
         array (
51
-          0 => 
52
-          array (
51
+            0 => 
52
+            array (
53 53
             'name' => 'name',
54 54
             'label' => 'LBL_NAME',
55
-          ),
56
-          1 => 
57
-          array (
55
+            ),
56
+            1 => 
57
+            array (
58 58
             'name' => 'part_number',
59 59
             'label' => 'LBL_PART_NUMBER',
60
-          ),
60
+            ),
61 61
         ),
62 62
         1 => 
63 63
         array (
64
-          0 => 
65
-          array (
64
+            0 => 
65
+            array (
66 66
             'name' => 'aos_product_category_name',
67 67
             'label' => 'LBL_AOS_PRODUCT_CATEGORYS_NAME',
68
-          ),
69
-          1 => 
70
-          array (
68
+            ),
69
+            1 => 
70
+            array (
71 71
             'name' => 'type',
72 72
             'label' => 'LBL_TYPE',
73
-          ),
73
+            ),
74 74
         ),
75 75
         2 => 
76 76
         array (
77
-          0 => 
78
-          array (
77
+            0 => 
78
+            array (
79 79
             'name' => 'currency_id',
80 80
             'studio' => 'visible',
81 81
             'label' => 'LBL_CURRENCY',
82
-          ),
82
+            ),
83 83
         ),
84 84
         3 => 
85 85
         array (
86
-          0 => 
87
-          array (
86
+            0 => 
87
+            array (
88 88
             'name' => 'cost',
89 89
             'label' => 'LBL_COST',
90
-          ),
91
-          1 => 
92
-          array (
90
+            ),
91
+            1 => 
92
+            array (
93 93
             'name' => 'price',
94 94
             'label' => 'LBL_PRICE',
95
-          ),
95
+            ),
96 96
         ),
97 97
         4 => 
98 98
         array (
99
-          0 => 
100
-          array (
99
+            0 => 
100
+            array (
101 101
             'name' => 'contact',
102 102
             'label' => 'LBL_CONTACT',
103
-          ),
104
-          1 => 
105
-          array (
103
+            ),
104
+            1 => 
105
+            array (
106 106
             'name' => 'url',
107 107
             'label' => 'LBL_URL',
108
-          ),
108
+            ),
109 109
         ),
110 110
         5 => 
111 111
         array (
112
-          0 => 
113
-          array (
112
+            0 => 
113
+            array (
114 114
             'name' => 'description',
115 115
             'label' => 'LBL_DESCRIPTION',
116
-          ),
116
+            ),
117 117
         ),
118 118
         6 => 
119 119
         array (
120
-          0 => 
121
-          array (
120
+            0 => 
121
+            array (
122 122
             'name' => 'product_image',
123 123
             'customCode' => '{$PRODUCT_IMAGE}',
124
-          ),
124
+            ),
125
+        ),
125 126
         ),
126
-      ),
127 127
     ),
128
-  ),
128
+    ),
129 129
 );
130 130
 ?>
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,124 +1,124 @@
 block discarded – undo
1 1
 <?php
2 2
 $module_name = 'AOS_Products';
3 3
 $viewdefs [$module_name] = 
4
-array (
4
+array(
5 5
   'EditView' => 
6
-  array (
6
+  array(
7 7
     'templateMeta' => 
8
-    array (
8
+    array(
9 9
       'maxColumns' => '2',
10 10
       'widths' => 
11
-      array (
11
+      array(
12 12
         0 => 
13
-        array (
13
+        array(
14 14
           'label' => '10',
15 15
           'field' => '30',
16 16
         ),
17 17
         1 => 
18
-        array (
18
+        array(
19 19
           'label' => '10',
20 20
           'field' => '30',
21 21
         ),
22 22
       ),
23 23
       'form' => 
24
-      array (
24
+      array(
25 25
         'enctype' => 'multipart/form-data',
26 26
         'headerTpl' => 'modules/AOS_Products/tpls/EditViewHeader.tpl',
27 27
       ),
28 28
       'includes' => 
29
-      array (
29
+      array(
30 30
         0 => 
31
-        array (
31
+        array(
32 32
           'file' => 'modules/AOS_Products/js/products.js',
33 33
         ),
34 34
       ),
35 35
       'useTabs' => false,
36 36
       'tabDefs' => 
37
-      array (
37
+      array(
38 38
         'DEFAULT' => 
39
-        array (
39
+        array(
40 40
           'newTab' => false,
41 41
           'panelDefault' => 'expanded',
42 42
         ),
43 43
       ),
44 44
     ),
45 45
     'panels' => 
46
-    array (
46
+    array(
47 47
       'default' => 
48
-      array (
48
+      array(
49 49
         0 => 
50
-        array (
50
+        array(
51 51
           0 => 
52
-          array (
52
+          array(
53 53
             'name' => 'name',
54 54
             'label' => 'LBL_NAME',
55 55
           ),
56 56
           1 => 
57
-          array (
57
+          array(
58 58
             'name' => 'part_number',
59 59
             'label' => 'LBL_PART_NUMBER',
60 60
           ),
61 61
         ),
62 62
         1 => 
63
-        array (
63
+        array(
64 64
           0 => 
65
-          array (
65
+          array(
66 66
             'name' => 'aos_product_category_name',
67 67
             'label' => 'LBL_AOS_PRODUCT_CATEGORYS_NAME',
68 68
           ),
69 69
           1 => 
70
-          array (
70
+          array(
71 71
             'name' => 'type',
72 72
             'label' => 'LBL_TYPE',
73 73
           ),
74 74
         ),
75 75
         2 => 
76
-        array (
76
+        array(
77 77
           0 => 
78
-          array (
78
+          array(
79 79
             'name' => 'currency_id',
80 80
             'studio' => 'visible',
81 81
             'label' => 'LBL_CURRENCY',
82 82
           ),
83 83
         ),
84 84
         3 => 
85
-        array (
85
+        array(
86 86
           0 => 
87
-          array (
87
+          array(
88 88
             'name' => 'cost',
89 89
             'label' => 'LBL_COST',
90 90
           ),
91 91
           1 => 
92
-          array (
92
+          array(
93 93
             'name' => 'price',
94 94
             'label' => 'LBL_PRICE',
95 95
           ),
96 96
         ),
97 97
         4 => 
98
-        array (
98
+        array(
99 99
           0 => 
100
-          array (
100
+          array(
101 101
             'name' => 'contact',
102 102
             'label' => 'LBL_CONTACT',
103 103
           ),
104 104
           1 => 
105
-          array (
105
+          array(
106 106
             'name' => 'url',
107 107
             'label' => 'LBL_URL',
108 108
           ),
109 109
         ),
110 110
         5 => 
111
-        array (
111
+        array(
112 112
           0 => 
113
-          array (
113
+          array(
114 114
             'name' => 'description',
115 115
             'label' => 'LBL_DESCRIPTION',
116 116
           ),
117 117
         ),
118 118
         6 => 
119
-        array (
119
+        array(
120 120
           0 => 
121
-          array (
121
+          array(
122 122
             'name' => 'product_image',
123 123
             'customCode' => '{$PRODUCT_IMAGE}',
124 124
           ),
Please login to merge, or discard this patch.
modules/AOS_Products/metadata/popupdefs.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -4,94 +4,94 @@
 block discarded – undo
4 4
     'varName' => 'AOS_Products',
5 5
     'orderBy' => 'aos_products.name',
6 6
     'whereClauses' => array (
7
-  'name' => 'aos_products.name',
8
-  'part_number' => 'aos_products.part_number',
9
-  'cost' => 'aos_products.cost',
10
-  'price' => 'aos_products.price',
11
-  'created_by' => 'aos_products.created_by',
7
+    'name' => 'aos_products.name',
8
+    'part_number' => 'aos_products.part_number',
9
+    'cost' => 'aos_products.cost',
10
+    'price' => 'aos_products.price',
11
+    'created_by' => 'aos_products.created_by',
12 12
 ),
13 13
     'searchInputs' => array (
14
-  1 => 'name',
15
-  4 => 'part_number',
16
-  5 => 'cost',
17
-  6 => 'price',
18
-  7 => 'created_by',
14
+    1 => 'name',
15
+    4 => 'part_number',
16
+    5 => 'cost',
17
+    6 => 'price',
18
+    7 => 'created_by',
19 19
 ),
20 20
     'searchdefs' => array (
21
-  'name' => 
22
-  array (
21
+    'name' => 
22
+    array (
23 23
     'name' => 'name',
24 24
     'width' => '10%',
25
-  ),
26
-  'part_number' => 
27
-  array (
25
+    ),
26
+    'part_number' => 
27
+    array (
28 28
     'name' => 'part_number',
29 29
     'width' => '10%',
30
-  ),
31
-  'cost' => 
32
-  array (
30
+    ),
31
+    'cost' => 
32
+    array (
33 33
     'name' => 'cost',
34 34
     'width' => '10%',
35
-  ),
36
-  'price' => 
37
-  array (
35
+    ),
36
+    'price' => 
37
+    array (
38 38
     'name' => 'price',
39 39
     'width' => '10%',
40
-  ),
41
-  'created_by' => 
42
-  array (
40
+    ),
41
+    'created_by' => 
42
+    array (
43 43
     'name' => 'created_by',
44 44
     'label' => 'LBL_CREATED',
45 45
     'type' => 'enum',
46 46
     'function' => 
47 47
     array (
48
-      'name' => 'get_user_array',
49
-      'params' => 
50
-      array (
48
+        'name' => 'get_user_array',
49
+        'params' => 
50
+        array (
51 51
         0 => false,
52
-      ),
52
+        ),
53 53
     ),
54 54
     'width' => '10%',
55
-  ),
55
+    ),
56 56
 ),
57 57
     'listviewdefs' => array (
58
-  'NAME' => 
59
-  array (
58
+    'NAME' => 
59
+    array (
60 60
     'width' => '25%',
61 61
     'label' => 'LBL_NAME',
62 62
     'default' => true,
63 63
     'link' => true,
64 64
     'name' => 'name',
65
-  ),
66
-  'PART_NUMBER' => 
67
-  array (
65
+    ),
66
+    'PART_NUMBER' => 
67
+    array (
68 68
     'width' => '10%',
69 69
     'label' => 'LBL_PART_NUMBER',
70 70
     'default' => true,
71 71
     'name' => 'part_number',
72
-  ),
73
-  'COST' => 
74
-  array (
72
+    ),
73
+    'COST' => 
74
+    array (
75 75
     'width' => '10%',
76 76
     'label' => 'LBL_COST',
77 77
     'default' => true,
78 78
     'name' => 'cost',
79
-  ),
80
-  'PRICE' => 
81
-  array (
79
+    ),
80
+    'PRICE' => 
81
+    array (
82 82
     'width' => '10%',
83 83
     'label' => 'LBL_PRICE',
84 84
     'default' => true,
85 85
     'name' => 'price',
86
-  ),
87
-  'CURRENCY_ID' =>
88
-  array (
86
+    ),
87
+    'CURRENCY_ID' =>
88
+    array (
89 89
     'type' => 'id',
90 90
     'studio' => 'visible',
91 91
     'label' => 'LBL_CURRENCY',
92 92
     'width' => '10%',
93 93
     'default' => false,
94 94
     'name' => 'currency_id',
95
-  ),
95
+    ),
96 96
 ),
97 97
 );
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,62 +1,62 @@  discard block
 block discarded – undo
1 1
 <?php
2
-$popupMeta = array (
2
+$popupMeta = array(
3 3
     'moduleMain' => 'AOS_Products',
4 4
     'varName' => 'AOS_Products',
5 5
     'orderBy' => 'aos_products.name',
6
-    'whereClauses' => array (
6
+    'whereClauses' => array(
7 7
   'name' => 'aos_products.name',
8 8
   'part_number' => 'aos_products.part_number',
9 9
   'cost' => 'aos_products.cost',
10 10
   'price' => 'aos_products.price',
11 11
   'created_by' => 'aos_products.created_by',
12 12
 ),
13
-    'searchInputs' => array (
13
+    'searchInputs' => array(
14 14
   1 => 'name',
15 15
   4 => 'part_number',
16 16
   5 => 'cost',
17 17
   6 => 'price',
18 18
   7 => 'created_by',
19 19
 ),
20
-    'searchdefs' => array (
20
+    'searchdefs' => array(
21 21
   'name' => 
22
-  array (
22
+  array(
23 23
     'name' => 'name',
24 24
     'width' => '10%',
25 25
   ),
26 26
   'part_number' => 
27
-  array (
27
+  array(
28 28
     'name' => 'part_number',
29 29
     'width' => '10%',
30 30
   ),
31 31
   'cost' => 
32
-  array (
32
+  array(
33 33
     'name' => 'cost',
34 34
     'width' => '10%',
35 35
   ),
36 36
   'price' => 
37
-  array (
37
+  array(
38 38
     'name' => 'price',
39 39
     'width' => '10%',
40 40
   ),
41 41
   'created_by' => 
42
-  array (
42
+  array(
43 43
     'name' => 'created_by',
44 44
     'label' => 'LBL_CREATED',
45 45
     'type' => 'enum',
46 46
     'function' => 
47
-    array (
47
+    array(
48 48
       'name' => 'get_user_array',
49 49
       'params' => 
50
-      array (
50
+      array(
51 51
         0 => false,
52 52
       ),
53 53
     ),
54 54
     'width' => '10%',
55 55
   ),
56 56
 ),
57
-    'listviewdefs' => array (
57
+    'listviewdefs' => array(
58 58
   'NAME' => 
59
-  array (
59
+  array(
60 60
     'width' => '25%',
61 61
     'label' => 'LBL_NAME',
62 62
     'default' => true,
@@ -64,28 +64,28 @@  discard block
 block discarded – undo
64 64
     'name' => 'name',
65 65
   ),
66 66
   'PART_NUMBER' => 
67
-  array (
67
+  array(
68 68
     'width' => '10%',
69 69
     'label' => 'LBL_PART_NUMBER',
70 70
     'default' => true,
71 71
     'name' => 'part_number',
72 72
   ),
73 73
   'COST' => 
74
-  array (
74
+  array(
75 75
     'width' => '10%',
76 76
     'label' => 'LBL_COST',
77 77
     'default' => true,
78 78
     'name' => 'cost',
79 79
   ),
80 80
   'PRICE' => 
81
-  array (
81
+  array(
82 82
     'width' => '10%',
83 83
     'label' => 'LBL_PRICE',
84 84
     'default' => true,
85 85
     'name' => 'price',
86 86
   ),
87 87
   'CURRENCY_ID' =>
88
-  array (
88
+  array(
89 89
     'type' => 'id',
90 90
     'studio' => 'visible',
91 91
     'label' => 'LBL_CURRENCY',
Please login to merge, or discard this patch.
modules/AOS_Products/metadata/searchdefs.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -2,71 +2,71 @@
 block discarded – undo
2 2
 $module_name = 'AOS_Products';
3 3
 $searchdefs [$module_name] = 
4 4
 array (
5
-  'layout' => 
6
-  array (
5
+    'layout' => 
6
+    array (
7 7
     'basic_search' => 
8 8
     array (
9
-      0 => 'name',
10
-      1 => 
11
-      array (
9
+        0 => 'name',
10
+        1 => 
11
+        array (
12 12
         'name' => 'current_user_only',
13 13
         'label' => 'LBL_CURRENT_USER_FILTER',
14 14
         'type' => 'bool',
15
-      ),
15
+        ),
16 16
         'favorites_only' => array ('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',),
17 17
     ),
18 18
     'advanced_search' => 
19 19
     array (
20
-      'name' => 
21
-      array (
20
+        'name' => 
21
+        array (
22 22
         'name' => 'name',
23 23
         'default' => true,
24 24
         'width' => '10%',
25
-      ),
26
-      'part_number' => 
27
-      array (
25
+        ),
26
+        'part_number' => 
27
+        array (
28 28
         'name' => 'part_number',
29 29
         'default' => true,
30 30
         'width' => '10%',
31
-      ),
32
-      'cost' => 
33
-      array (
31
+        ),
32
+        'cost' => 
33
+        array (
34 34
         'name' => 'cost',
35 35
         'default' => true,
36 36
         'width' => '10%',
37
-      ),
38
-      'price' => 
39
-      array (
37
+        ),
38
+        'price' => 
39
+        array (
40 40
         'name' => 'price',
41 41
         'default' => true,
42 42
         'width' => '10%',
43
-      ),
44
-      'created_by' => 
45
-      array (
43
+        ),
44
+        'created_by' => 
45
+        array (
46 46
         'name' => 'created_by',
47 47
         'label' => 'LBL_CREATED',
48 48
         'type' => 'enum',
49 49
         'function' => 
50 50
         array (
51
-          'name' => 'get_user_array',
52
-          'params' => 
53
-          array (
51
+            'name' => 'get_user_array',
52
+            'params' => 
53
+            array (
54 54
             0 => false,
55
-          ),
55
+            ),
56 56
         ),
57 57
         'default' => true,
58 58
         'width' => '10%',
59
-      ),
59
+        ),
60
+    ),
60 61
     ),
61
-  ),
62
-  'templateMeta' => 
63
-  array (
62
+    'templateMeta' => 
63
+    array (
64 64
     'maxColumns' => '3',
65 65
     'widths' => 
66 66
     array (
67
-      'label' => '10',
68
-      'field' => '30',
67
+        'label' => '10',
68
+        'field' => '30',
69
+    ),
69 70
     ),
70
-  ),
71 71
 );
72 72
 ?>
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,56 +1,56 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $module_name = 'AOS_Products';
3 3
 $searchdefs [$module_name] = 
4
-array (
4
+array(
5 5
   'layout' => 
6
-  array (
6
+  array(
7 7
     'basic_search' => 
8
-    array (
8
+    array(
9 9
       0 => 'name',
10 10
       1 => 
11
-      array (
11
+      array(
12 12
         'name' => 'current_user_only',
13 13
         'label' => 'LBL_CURRENT_USER_FILTER',
14 14
         'type' => 'bool',
15 15
       ),
16
-        'favorites_only' => array ('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',),
16
+        'favorites_only' => array('name' => 'favorites_only', 'label' => 'LBL_FAVORITES_FILTER', 'type' => 'bool',),
17 17
     ),
18 18
     'advanced_search' => 
19
-    array (
19
+    array(
20 20
       'name' => 
21
-      array (
21
+      array(
22 22
         'name' => 'name',
23 23
         'default' => true,
24 24
         'width' => '10%',
25 25
       ),
26 26
       'part_number' => 
27
-      array (
27
+      array(
28 28
         'name' => 'part_number',
29 29
         'default' => true,
30 30
         'width' => '10%',
31 31
       ),
32 32
       'cost' => 
33
-      array (
33
+      array(
34 34
         'name' => 'cost',
35 35
         'default' => true,
36 36
         'width' => '10%',
37 37
       ),
38 38
       'price' => 
39
-      array (
39
+      array(
40 40
         'name' => 'price',
41 41
         'default' => true,
42 42
         'width' => '10%',
43 43
       ),
44 44
       'created_by' => 
45
-      array (
45
+      array(
46 46
         'name' => 'created_by',
47 47
         'label' => 'LBL_CREATED',
48 48
         'type' => 'enum',
49 49
         'function' => 
50
-        array (
50
+        array(
51 51
           'name' => 'get_user_array',
52 52
           'params' => 
53
-          array (
53
+          array(
54 54
             0 => false,
55 55
           ),
56 56
         ),
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
     ),
61 61
   ),
62 62
   'templateMeta' => 
63
-  array (
63
+  array(
64 64
     'maxColumns' => '3',
65 65
     'widths' => 
66
-    array (
66
+    array(
67 67
       'label' => '10',
68 68
       'field' => '30',
69 69
     ),
Please login to merge, or discard this patch.
modules/AOS_Products/metadata/SearchFields.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -2,87 +2,87 @@
 block discarded – undo
2 2
 // created: 2013-05-07 12:48:58
3 3
 global $current_user;
4 4
 $searchFields['AOS_Products'] = array (
5
-  'name' => 
6
-  array (
5
+    'name' => 
6
+    array (
7 7
     'query_type' => 'default',
8
-  ),
9
-  'current_user_only' => 
10
-  array (
8
+    ),
9
+    'current_user_only' => 
10
+    array (
11 11
     'query_type' => 'default',
12 12
     'db_field' => 
13 13
     array (
14
-      0 => 'created_by',
14
+        0 => 'created_by',
15 15
     ),
16 16
     'my_items' => true,
17 17
     'vname' => 'LBL_CURRENT_USER_FILTER',
18 18
     'type' => 'bool',
19
-  ),
20
-  'range_price' => 
21
-  array (
19
+    ),
20
+    'range_price' => 
21
+    array (
22 22
     'query_type' => 'default',
23 23
     'enable_range_search' => true,
24
-  ),
25
-  'start_range_price' => 
26
-  array (
24
+    ),
25
+    'start_range_price' => 
26
+    array (
27 27
     'query_type' => 'default',
28 28
     'enable_range_search' => true,
29
-  ),
30
-  'end_range_price' => 
31
-  array (
29
+    ),
30
+    'end_range_price' => 
31
+    array (
32 32
     'query_type' => 'default',
33 33
     'enable_range_search' => true,
34
-  ),
35
-  'range_cost' => 
36
-  array (
34
+    ),
35
+    'range_cost' => 
36
+    array (
37 37
     'query_type' => 'default',
38 38
     'enable_range_search' => true,
39
-  ),
40
-  'start_range_cost' => 
41
-  array (
39
+    ),
40
+    'start_range_cost' => 
41
+    array (
42 42
     'query_type' => 'default',
43 43
     'enable_range_search' => true,
44
-  ),
45
-  'end_range_cost' => 
46
-  array (
44
+    ),
45
+    'end_range_cost' => 
46
+    array (
47 47
     'query_type' => 'default',
48 48
     'enable_range_search' => true,
49
-  ),
50
-  'range_date_entered' => 
51
-  array (
49
+    ),
50
+    'range_date_entered' => 
51
+    array (
52 52
     'query_type' => 'default',
53 53
     'enable_range_search' => true,
54 54
     'is_date_field' => true,
55
-  ),
56
-  'start_range_date_entered' => 
57
-  array (
55
+    ),
56
+    'start_range_date_entered' => 
57
+    array (
58 58
     'query_type' => 'default',
59 59
     'enable_range_search' => true,
60 60
     'is_date_field' => true,
61
-  ),
62
-  'end_range_date_entered' => 
63
-  array (
61
+    ),
62
+    'end_range_date_entered' => 
63
+    array (
64 64
     'query_type' => 'default',
65 65
     'enable_range_search' => true,
66 66
     'is_date_field' => true,
67
-  ),
68
-  'range_date_modified' => 
69
-  array (
67
+    ),
68
+    'range_date_modified' => 
69
+    array (
70 70
     'query_type' => 'default',
71 71
     'enable_range_search' => true,
72 72
     'is_date_field' => true,
73
-  ),
74
-  'start_range_date_modified' => 
75
-  array (
73
+    ),
74
+    'start_range_date_modified' => 
75
+    array (
76 76
     'query_type' => 'default',
77 77
     'enable_range_search' => true,
78 78
     'is_date_field' => true,
79
-  ),
80
-  'end_range_date_modified' => 
81
-  array (
79
+    ),
80
+    'end_range_date_modified' => 
81
+    array (
82 82
     'query_type' => 'default',
83 83
     'enable_range_search' => true,
84 84
     'is_date_field' => true,
85
-  ),
85
+    ),
86 86
     'favorites_only' => array(
87 87
         'query_type'=>'format',
88 88
         'operator' => 'subquery',
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
modules/AOS_Products/metadata/detailviewdefs.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -2,127 +2,127 @@
 block discarded – undo
2 2
 $module_name = 'AOS_Products';
3 3
 $viewdefs [$module_name] = 
4 4
 array (
5
-  'DetailView' => 
6
-  array (
5
+    'DetailView' => 
6
+    array (
7 7
     'templateMeta' => 
8 8
     array (
9
-      'form' => 
10
-      array (
9
+        'form' => 
10
+        array (
11 11
         'buttons' => 
12 12
         array (
13
-          0 => 'EDIT',
14
-          1 => 'DUPLICATE',
15
-          2 => 'DELETE',
13
+            0 => 'EDIT',
14
+            1 => 'DUPLICATE',
15
+            2 => 'DELETE',
16
+        ),
16 17
         ),
17
-      ),
18
-      'maxColumns' => '2',
19
-      'widths' => 
20
-      array (
18
+        'maxColumns' => '2',
19
+        'widths' => 
20
+        array (
21 21
         0 => 
22 22
         array (
23
-          'label' => '10',
24
-          'field' => '30',
23
+            'label' => '10',
24
+            'field' => '30',
25 25
         ),
26 26
         1 => 
27 27
         array (
28
-          'label' => '10',
29
-          'field' => '30',
28
+            'label' => '10',
29
+            'field' => '30',
30
+        ),
30 31
         ),
31
-      ),
32
-      'useTabs' => true,
33
-      'tabDefs' => 
34
-      array (
32
+        'useTabs' => true,
33
+        'tabDefs' => 
34
+        array (
35 35
         'DEFAULT' => 
36 36
         array (
37
-          'newTab' => true,
38
-          'panelDefault' => 'expanded',
37
+            'newTab' => true,
38
+            'panelDefault' => 'expanded',
39
+        ),
39 40
         ),
40
-      ),
41 41
     ),
42 42
     'panels' => 
43 43
     array (
44
-      'default' => 
45
-      array (
44
+        'default' => 
45
+        array (
46 46
         0 => 
47 47
         array (
48
-          0 => 
49
-          array (
48
+            0 => 
49
+            array (
50 50
             'name' => 'name',
51 51
             'label' => 'LBL_NAME',
52
-          ),
53
-          1 => 
54
-          array (
52
+            ),
53
+            1 => 
54
+            array (
55 55
             'name' => 'part_number',
56 56
             'label' => 'LBL_PART_NUMBER',
57
-          ),
57
+            ),
58 58
         ),
59 59
         1 => 
60 60
         array (
61
-          0 => 
62
-          array (
61
+            0 => 
62
+            array (
63 63
             'name' => 'aos_product_category_name',
64 64
             'label' => 'LBL_AOS_PRODUCT_CATEGORYS_NAME',
65
-          ),
66
-          1 => 
67
-          array (
65
+            ),
66
+            1 => 
67
+            array (
68 68
             'name' => 'type',
69 69
             'label' => 'LBL_TYPE',
70
-          ),
70
+            ),
71 71
         ),
72 72
         2 => 
73 73
         array (
74
-          0 => 
75
-          array (
74
+            0 => 
75
+            array (
76 76
             'name' => 'currency_id',
77 77
             'studio' => 'visible',
78 78
             'label' => 'LBL_CURRENCY',
79
-          ),
79
+            ),
80 80
         ),
81 81
         3 => 
82 82
         array (
83
-          0 => 
84
-          array (
83
+            0 => 
84
+            array (
85 85
             'name' => 'cost',
86 86
             'label' => 'LBL_COST',
87
-          ),
88
-          1 => 
89
-          array (
87
+            ),
88
+            1 => 
89
+            array (
90 90
             'name' => 'price',
91 91
             'label' => 'LBL_PRICE',
92
-          ),
92
+            ),
93 93
         ),
94 94
         4 => 
95 95
         array (
96
-          0 => 
97
-          array (
96
+            0 => 
97
+            array (
98 98
             'name' => 'contact',
99 99
             'label' => 'LBL_CONTACT',
100
-          ),
101
-          1 => 
102
-          array (
100
+            ),
101
+            1 => 
102
+            array (
103 103
             'name' => 'url',
104 104
             'label' => 'LBL_URL',
105
-          ),
105
+            ),
106 106
         ),
107 107
         5 => 
108 108
         array (
109
-          0 => 
110
-          array (
109
+            0 => 
110
+            array (
111 111
             'name' => 'description',
112 112
             'label' => 'LBL_DESCRIPTION',
113
-          ),
113
+            ),
114 114
         ),
115 115
         6 => 
116 116
         array (
117
-          0 => 
118
-          array (
117
+            0 => 
118
+            array (
119 119
             'name' => 'product_image',
120 120
             'label' => 'LBL_PRODUCT_IMAGE',
121 121
             'customCode' => '<img src="{$fields.product_image.value}"/>',
122
-          ),
122
+            ),
123 123
         ),
124
-      ),
124
+        ),
125
+    ),
125 126
     ),
126
-  ),
127 127
 );
128 128
 ?>
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $module_name = 'AOS_Products';
3 3
 $viewdefs [$module_name] = 
4
-array (
4
+array(
5 5
   'DetailView' => 
6
-  array (
6
+  array(
7 7
     'templateMeta' => 
8
-    array (
8
+    array(
9 9
       'form' => 
10
-      array (
10
+      array(
11 11
         'buttons' => 
12
-        array (
12
+        array(
13 13
           0 => 'EDIT',
14 14
           1 => 'DUPLICATE',
15 15
           2 => 'DELETE',
@@ -17,105 +17,105 @@  discard block
 block discarded – undo
17 17
       ),
18 18
       'maxColumns' => '2',
19 19
       'widths' => 
20
-      array (
20
+      array(
21 21
         0 => 
22
-        array (
22
+        array(
23 23
           'label' => '10',
24 24
           'field' => '30',
25 25
         ),
26 26
         1 => 
27
-        array (
27
+        array(
28 28
           'label' => '10',
29 29
           'field' => '30',
30 30
         ),
31 31
       ),
32 32
       'useTabs' => true,
33 33
       'tabDefs' => 
34
-      array (
34
+      array(
35 35
         'DEFAULT' => 
36
-        array (
36
+        array(
37 37
           'newTab' => true,
38 38
           'panelDefault' => 'expanded',
39 39
         ),
40 40
       ),
41 41
     ),
42 42
     'panels' => 
43
-    array (
43
+    array(
44 44
       'default' => 
45
-      array (
45
+      array(
46 46
         0 => 
47
-        array (
47
+        array(
48 48
           0 => 
49
-          array (
49
+          array(
50 50
             'name' => 'name',
51 51
             'label' => 'LBL_NAME',
52 52
           ),
53 53
           1 => 
54
-          array (
54
+          array(
55 55
             'name' => 'part_number',
56 56
             'label' => 'LBL_PART_NUMBER',
57 57
           ),
58 58
         ),
59 59
         1 => 
60
-        array (
60
+        array(
61 61
           0 => 
62
-          array (
62
+          array(
63 63
             'name' => 'aos_product_category_name',
64 64
             'label' => 'LBL_AOS_PRODUCT_CATEGORYS_NAME',
65 65
           ),
66 66
           1 => 
67
-          array (
67
+          array(
68 68
             'name' => 'type',
69 69
             'label' => 'LBL_TYPE',
70 70
           ),
71 71
         ),
72 72
         2 => 
73
-        array (
73
+        array(
74 74
           0 => 
75
-          array (
75
+          array(
76 76
             'name' => 'currency_id',
77 77
             'studio' => 'visible',
78 78
             'label' => 'LBL_CURRENCY',
79 79
           ),
80 80
         ),
81 81
         3 => 
82
-        array (
82
+        array(
83 83
           0 => 
84
-          array (
84
+          array(
85 85
             'name' => 'cost',
86 86
             'label' => 'LBL_COST',
87 87
           ),
88 88
           1 => 
89
-          array (
89
+          array(
90 90
             'name' => 'price',
91 91
             'label' => 'LBL_PRICE',
92 92
           ),
93 93
         ),
94 94
         4 => 
95
-        array (
95
+        array(
96 96
           0 => 
97
-          array (
97
+          array(
98 98
             'name' => 'contact',
99 99
             'label' => 'LBL_CONTACT',
100 100
           ),
101 101
           1 => 
102
-          array (
102
+          array(
103 103
             'name' => 'url',
104 104
             'label' => 'LBL_URL',
105 105
           ),
106 106
         ),
107 107
         5 => 
108
-        array (
108
+        array(
109 109
           0 => 
110
-          array (
110
+          array(
111 111
             'name' => 'description',
112 112
             'label' => 'LBL_DESCRIPTION',
113 113
           ),
114 114
         ),
115 115
         6 => 
116
-        array (
116
+        array(
117 117
           0 => 
118
-          array (
118
+          array(
119 119
             'name' => 'product_image',
120 120
             'label' => 'LBL_PRODUCT_IMAGE',
121 121
             'customCode' => '<img src="{$fields.product_image.value}"/>',
Please login to merge, or discard this patch.