code to handle group fees add and remove profile case better, a=chris
code to handle group fees add and remove profile case better, a=chris
diff --git a/src/controllers/components/SystemComponent.php b/src/controllers/components/SystemComponent.php
index 6dc36205e..3fc5db0e2 100755
--- a/src/controllers/components/SystemComponent.php
+++ b/src/controllers/components/SystemComponent.php
@@ -581,24 +581,27 @@ class SystemComponent extends Component
'manageCredits');
if (isset($data['MONETIZATION_TYPE']) &&
in_array($data['MONETIZATION_TYPE'],
- ['no_advertisements', 'external_advertisements'])) {
+ ['no_monetization', 'external_advertisements'])) {
if ($business_id) {
$role_model->deleteActivityRole($business_id,
$ad_id);
$role_model->deleteActivityRole($business_id,
$credit_id);
}
- $role_model->deleteActivityRole(C\ADMIN_ROLE, $ad_id);
- $role_model->deleteActivityRole(C\ADMIN_ROLE,
- $credit_id);
+ } else if (isset($data['MONETIZATION_TYPE']) &&
+ in_array($data['MONETIZATION_TYPE'],['group_fees'])) {
+ if ($business_id) {
+ $role_model->deleteActivityRole($business_id,
+ $ad_id);
+ $role_model->addActivityRole($business_id,
+ $credit_id);
+ }
} else {
if ($business_id) {
$role_model->addActivityRole($business_id, $ad_id);
$role_model->addActivityRole($business_id,
$credit_id);
}
- $role_model->addActivityRole(C\ADMIN_ROLE, $ad_id);
- $role_model->addActivityRole(C\ADMIN_ROLE, $credit_id);
}
}
$db_problem = false;
@@ -697,11 +700,6 @@ class SystemComponent extends Component
['email_registration', 'admin_activation'])) {
$data['show_mail_info'] = "true";
}
- $data['show_ad_info'] = "false";
- if (isset($data['MONETIZATION_TYPE']) &&
- $data['MONETIZATION_TYPE'] != 'external_advertisements') {
- $data['show_ad_info'] = "true";
- }
$data['no_mail_php'] = ($data["USE_MAIL_PHP"]) ? "false" :"true";
$data['SCRIPT'] .= <<< EOD
elt('account-registration').onchange = function () {
diff --git a/src/views/elements/ActivityElement.php b/src/views/elements/ActivityElement.php
index 82f6c1189..86ec168b6 100755
--- a/src/views/elements/ActivityElement.php
+++ b/src/views/elements/ActivityElement.php
@@ -150,7 +150,7 @@ class ActivityElement extends Element
}
if (isset($data['RESULTS_PER_PAGE'])) {
$other_base_query .=
- "&num=".$data['RESULTS_PER_PAGE'];
+ "&num=" . $data['RESULTS_PER_PAGE'];
}
if (isset($data['MODE']) && $data['MODE'] == 'grouped') {
$other_base_query .= "&v=grouped";
diff --git a/src/views/elements/ManageusersElement.php b/src/views/elements/ManageusersElement.php
index 15a92daf2..1ea1b75fa 100644
--- a/src/views/elements/ManageusersElement.php
+++ b/src/views/elements/ManageusersElement.php
@@ -98,8 +98,8 @@ class ManageusersElement extends Element
echo "<tr>";
foreach ($out_columns as $colname) {
$user_column = $user[$colname];
- if ($colname == "USER_ID" || (
- $_SERVER["MOBILE"] && !in_array($colname, $mobile_columns))) {
+ if ($colname == "USER_ID" || ($_SERVER["MOBILE"] &&
+ !in_array($colname, $mobile_columns))) {
continue;
}
if (strlen($user_column) > $stretch * C\NAME_TRUNCATE_LEN) {