Skip to content

Commit

Permalink
fix language clean after change and still use expired date from custo…
Browse files Browse the repository at this point in the history
…mer attribute when it have
  • Loading branch information
ibnux committed Jun 21, 2024
1 parent 2218115 commit 04983e8
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 13 deletions.
28 changes: 22 additions & 6 deletions system/autoload/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,30 @@ public static function rechargeUser($id_customer, $router_name, $plan_id, $gatew
}
}

$day_exp = 20;
if ($p['prepaid'] == 'no') {
$day_exp = $p['expired_date'];
}
if (empty($day_exp)) {
$day_exp = 20;
if ($p['validity_unit'] == 'Period') {
// if customer has attribute Expired Date use it
$day_exp = User::getAttribute("Expired Date", $c['id']);
if (!$day_exp) {
$day_exp = 20;
$f = ORM::for_table('tbl_customers_fields')->create();
$f->customer_id = $c['id'];
$f->field_name = 'Expired Date';
$f->field_value = $day_exp;
$f->save();
}else{
// if customer no attribute Expired Date use plan expired date
$day_exp = 20;
if ($p['prepaid'] == 'no') {
$day_exp = $p['expired_date'];
}
if (empty($day_exp)) {
$day_exp = 20;
}
}
}



if ($router_name == 'balance') {
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
Expand Down
4 changes: 2 additions & 2 deletions system/controllers/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@
$d->value = $lan;
$d->save();
unset($_SESSION['Lang']);
_log('[' . $admin['username'] . ']: ' . Lang::T('Settings Saved Successfully'), $admin['user_type'], $admin['id']);
r2(U . 'settings/localisation', 's', Lang::T('Settings Saved Successfully'));
_log('[' . $admin['username'] . ']: ' . 'Settings Saved Successfully', $admin['user_type'], $admin['id']);
r2(U . 'settings/localisation', 's', 'Settings Saved Successfully');
}
break;

Expand Down
23 changes: 22 additions & 1 deletion system/lan/turkish.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,5 +368,26 @@
"Hotspot": "Hotspot",
"Monthly_Registered_Customers": "Monthly Registered Customers",
"Total_Monthly_Sales": "Total Monthly Sales",
"Active_Users": "Active Users"
"Active_Users": "Active Users",
"SuperAdmin": "S\u00fcper Y\u00f6netici",
"Lists": "Listeler",
"Vouchers": "Kuponlar",
"Refill_Customer": "M\u00fc\u015fteriyi Yeniden Doldurun",
"Recharge_Customer": "M\u00fc\u015fteriyi Yeniden \u015earj Edin",
"Internet_Plan": "\u0130nternet Plan\u0131",
"Bandwidth": "Bant geni\u015fli\u011fi",
"Customer_Balance": "M\u00fc\u015fteri Bakiyesi",
"Send_Message": "Mesaj g\u00f6nder",
"Single_Customer": "Tek M\u00fc\u015fteri",
"Bulk_Customers": "Toplu M\u00fc\u015fteriler",
"Radius": "Yar\u0131\u00e7ap",
"Radius_NAS": "Yar\u0131\u00e7ap NAS",
"Static_Pages": "Statik Sayfalar",
"Customer_Announcement": "M\u00fc\u015fteri Duyurusu",
"Privacy_Policy": "Gizlilik Politikas\u0131",
"Terms_and_Conditions": "\u015eartlar ve ko\u015fullar",
"Maintenance_Mode": "Bak\u0131m Modu",
"Logs": "K\u00fct\u00fckler",
"Language_Editor": "Dil Edit\u00f6r\u00fc",
"Change_title_in_user_Plan_order": "Kullan\u0131c\u0131 Plan\u0131 s\u0131ras\u0131ndaki ba\u015fl\u0131\u011f\u0131 de\u011fi\u015ftir"
}
2 changes: 1 addition & 1 deletion ui/ui/hotspot-add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<label class="col-md-2 control-label">{Lang::T('Expired Date')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Expired will be this date every month, 0 will be when customer buy internet plan">?</a>
data-content="Expired will be this date every month">?</a>
</label>
<div class="col-md-6">
<input type="number" class="form-control" name="expired_date" maxlength="2" value="20" min="1" max="28" step="1" >
Expand Down
2 changes: 1 addition & 1 deletion ui/ui/hotspot-edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<label class="col-md-3 control-label">{Lang::T('Expired Date')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Expired will be this date every month, 0 will be when customer buy internet plan">?</a>
data-content="Expired will be this date every month">?</a>
</label>
<div class="col-md-9">
<input type="number" class="form-control" name="expired_date" maxlength="2"
Expand Down
2 changes: 1 addition & 1 deletion ui/ui/pppoe-add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<label class="col-md-2 control-label">{Lang::T('Expired Date')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Expired will be this date every month, 0 will be when customer buy internet plan">?</a>
data-content="Expired will be this date every month">?</a>
</label>
<div class="col-md-6">
<input type="number" class="form-control" name="expired_date" maxlength="2" value="20" min="1" max="28" step="1" >
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2024.6.21"
"version": "2024.6.21.1"
}

0 comments on commit 04983e8

Please sign in to comment.