From 75e2e0ecfe57c84755f8cbf1f0742741a1e7970b Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Wed, 8 Feb 2023 17:11:23 +0800 Subject: [PATCH] trans increment bulk page --- app/Console/Commands/InviteAddTemporary.php | 4 +- lang/chs/lang_increment-bulk.php | 27 ++++++++++++ lang/cht/lang_increment-bulk.php | 27 ++++++++++++ lang/en/lang_increment-bulk.php | 27 ++++++++++++ public/increment-bulk.php | 47 +++++++++------------ public/take-increment-bulk.php | 9 +--- 6 files changed, 105 insertions(+), 36 deletions(-) create mode 100644 lang/chs/lang_increment-bulk.php create mode 100644 lang/cht/lang_increment-bulk.php create mode 100644 lang/en/lang_increment-bulk.php diff --git a/app/Console/Commands/InviteAddTemporary.php b/app/Console/Commands/InviteAddTemporary.php index 3956be1e..cb237a93 100644 --- a/app/Console/Commands/InviteAddTemporary.php +++ b/app/Console/Commands/InviteAddTemporary.php @@ -31,7 +31,9 @@ class InviteAddTemporary extends Command $uid = $this->argument('uid'); $days = $this->argument('days'); $count = $this->argument('count'); - $this->info("uid: $uid, days: $days, count: $count"); + $log = "uid: $uid, days: $days, count: $count"; + $this->info($log); + do_log($log); $uidArr = preg_split('/[\s,]+/', $uid); GenerateTemporaryInvite::dispatch($uidArr, $days, $count); return Command::SUCCESS; diff --git a/lang/chs/lang_increment-bulk.php b/lang/chs/lang_increment-bulk.php new file mode 100644 index 00000000..c1b4c800 --- /dev/null +++ b/lang/chs/lang_increment-bulk.php @@ -0,0 +1,27 @@ + '批量添加魔力/补签卡/邀请/上传量/临时邀请', + 'sent_success' => ' 已经成功增加并发送了私信', + 'types' => [ + 'seedbonus' => '魔力', + 'attendance_card' => '补签卡', + 'invites' => '邀请', + 'uploaded' => '上传量', + 'tmp_invites' => '临时邀请', + ], + 'labels' => [ + 'type' => '类型', + 'amount' => '数量', + 'duration' => '有效期', + 'duration_help' => '仅当类型为 [临时邀请] 时需要,单位:天', + 'user_class' => '用户等级', + 'roles' => '角色', + 'msg_subject' => '私信主题', + 'msg_body' => '私信内容', + 'operator' => '操作者', + ], +); + +?> diff --git a/lang/cht/lang_increment-bulk.php b/lang/cht/lang_increment-bulk.php new file mode 100644 index 00000000..5293b384 --- /dev/null +++ b/lang/cht/lang_increment-bulk.php @@ -0,0 +1,27 @@ + '批量添加魔力/補簽卡/邀請/上傳量/臨時邀請', + 'sent_success' => ' 已經成功增加並發送了私信', + 'types' => [ + 'seedbonus' => '魔力', + 'attendance_card' => '補簽卡', + 'invites' => '邀請', + 'uploaded' => '上傳量', + 'tmp_invites' => '臨時邀請', + ], + 'labels' => [ + 'type' => '類型', + 'amount' => '數量', + 'duration' => '有效期', + 'duration_help' => '僅當類型為 [臨時邀請] 時需要,單位:天', + 'user_class' => '用戶等級', + 'roles' => '角色', + 'msg_subject' => '私信主題', + 'msg_body' => '私信內容', + 'operator' => '操作者', + ], +); + +?> diff --git a/lang/en/lang_increment-bulk.php b/lang/en/lang_increment-bulk.php new file mode 100644 index 00000000..8c2db01f --- /dev/null +++ b/lang/en/lang_increment-bulk.php @@ -0,0 +1,27 @@ + 'Batch add bonus/attendance card/invite/uploaded/temporary invite', + 'sent_success' => ' has been added and inform message has been sent', + 'types' => [ + 'seedbonus' => 'bonus', + 'attendance_card' => 'attendance card', + 'invites' => 'invite', + 'uploaded' => 'upload', + 'tmp_invites' => 'temporary invite', + ], + 'labels' => [ + 'type' => 'Type', + 'amount' => 'Amount', + 'duration' => 'Duration', + 'duration_help' => 'Required only if type is [Temporary Invitation], in days', + 'user_class' => 'User class', + 'roles' => 'Roles', + 'msg_subject' => 'message subject', + 'msg_body' => 'message content', + 'operator' => 'Operator', + ], +); + +?> diff --git a/public/increment-bulk.php b/public/increment-bulk.php index 14d1fea5..4c5fab2b 100644 --- a/public/increment-bulk.php +++ b/public/increment-bulk.php @@ -1,24 +1,19 @@ 'Bonus', - 'attendance_card' => 'Attend card', - 'invites' => 'Invite', - 'uploaded' => 'Upload', - 'tmp_invites' => 'Temporary invite', -]; +$validTypeMap = $lang_increment_bulk['types']; $type = $_REQUEST['type'] ?? ''; -stdhead("Add Bonus/Attend card/Invite/upload", false); -$classes = array_chunk(\App\Models\User::$classes, 4, true); +stdhead($lang_increment_bulk['page_title'], false); +$classes = array_chunk(\App\Models\User::listClass(), 4, true); ?> '; + echo ''; } ?> - + - - + + - - - - + + + - - +
-

Add Bonus/Attend card/Invite/upload to all staff members and users:

+

'. ($validTypeMap[$type] ?? '') .' has been added and inform message has been sent.
'. ($validTypeMap[$type] ?? '') . $lang_increment_bulk['sent_success'] .'
Type $text) { $desc = ''; if ($name == 'uploaded') { - $desc = ' (in GB)'; + $desc = ' (GB)'; } printf('', $name, $text, $desc); } ?>
Amount
Duration Only required when Type = 'Temporary invite', Unit: Day
Add to Class + '); foreach ($chunk as $class => $info) { - printf('', $class, $info['text']); + printf('', $class, $info); } printf(''); } @@ -66,23 +61,19 @@ $classes = array_chunk(\App\Models\User::$classes, 4, true);
Subject
Reason
Operator:   - - -   System - +
:   + +  
> -
- NOTE: Do not user BB codes. (NO HTML) 'Bonus', - 'attendance_card' => 'Attend card', - 'invites' => 'Invite', - 'uploaded' => 'Upload', - 'tmp_invites' => 'Temporary invite', -]; +$validTypeMap = $lang_increment_bulk['types']; $sender_id = ($_POST['sender'] == 'system' ? 0 : (int)$CURUSER['id']); $dt = sqlesc(date("Y-m-d H:i:s")); $msg = trim($_POST['msg']);