From 4a2e901657791b17d9bade5daeca40eddbed1b56 Mon Sep 17 00:00:00 2001 From: leiyong Date: Fri, 26 Jan 2024 05:33:51 +0000 Subject: [PATCH] * Fix bug #45347. --- module/datatable/control.php | 20 ++++++++++++++++++-- module/datatable/lang/de.php | 4 +++- module/datatable/lang/en.php | 4 +++- module/datatable/lang/fr.php | 4 +++- module/datatable/lang/vi.php | 4 +++- module/datatable/lang/zh-cn.php | 18 ++++++++++-------- 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/module/datatable/control.php b/module/datatable/control.php index 6ec6ad52d9..b3c4044fcf 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -190,11 +190,19 @@ class datatable extends control * @param string $module * @param string $method * @param int $system + * @param string $confirm * @access public * @return void */ - public function ajaxReset(string $module, string $method, int $system = 0) + public function ajaxReset(string $module, string $method, int $system = 0, string $confirm = 'no') { + if($confirm != 'yes') + { + $confirmURL = $this->createLink('datatable', 'ajaxreset', "module={$module}&method={$method}&system={$system}&confirm=yes"); + $tip = (int)$system ? $this->lang->datatable->confirmGlobalReset : $this->lang->datatable->confirmReset; + return $this->send(array('result' => 'fail', 'callback' => "zui.Modal.confirm({message: '{$tip}', icon: 'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((res) => {if(res) $.ajaxSubmit({url: '$confirmURL'});});")); + } + $account = !$system ? $this->app->user->account : 'system'; $target = $module . ucfirst($method); @@ -218,11 +226,19 @@ class datatable extends control * @param string $module * @param string $method * @param string $extra + * @param string $confirm * @access public * @return void */ - public function ajaxSaveGlobal(string $module, string $method, string $extra = '') + public function ajaxSaveGlobal(string $module, string $method, string $extra = '', string $confirm = 'no') { + if($confirm != 'yes') + { + $confirmURL = $this->createLink('datatable', 'ajaxsaveglobal', "module={$module}&method={$method}&extra={$extra}&confirm=yes"); + $tip = $this->lang->datatable->confirmSetGlobal; + return $this->send(array('result' => 'fail', 'callback' => "zui.Modal.confirm({message: '{$tip}', icon: 'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((res) => {if(res) $.ajaxSubmit({url: '$confirmURL'});});")); + } + $target = $module . ucfirst($method); if(strpos(',product-browse,execution-story,', ",$module-$method,") !== false && strpos(',story,requirement', ",$extra,") !== false) $target .= ucfirst($extra); diff --git a/module/datatable/lang/de.php b/module/datatable/lang/de.php index 97c64cdef5..8b649e4202 100644 --- a/module/datatable/lang/de.php +++ b/module/datatable/lang/de.php @@ -11,9 +11,11 @@ $lang->datatable->customTip = 'Prüfe Spalten zur Anzeige, Verschieben $lang->datatable->switchToTable = 'Zur Standard Tabelle wechseln'; $lang->datatable->switchToDatatable = 'Zur Erweiterten Tabelle wechseln'; $lang->datatable->required = 'Pflicht'; -$lang->datatable->confirmReset = 'Möchten Sie die Einstellungen zurücksetzen?'; +$lang->datatable->confirmReset = 'Restoring to default will clear the relevant settings of the list. Are you sure you want to restore to default?'; $lang->datatable->setGlobal = 'Global'; $lang->datatable->resetGlobal = 'Globalen Standard zurücksetzen'; +$lang->datatable->confirmSetGlobal = 'After applying it globally, the list of all individuals in the system will default to this rule for display. Are you sure you want to apply it globally?'; +$lang->datatable->confirmGlobalReset = 'After restoring to default globally, all individual list settings in the system will be cleared. Are you sure you want to restore to default?'; $lang->datatable->branch = 'Branch'; $lang->datatable->platform = 'Platform'; diff --git a/module/datatable/lang/en.php b/module/datatable/lang/en.php index fbf07e6f86..b9776979ee 100644 --- a/module/datatable/lang/en.php +++ b/module/datatable/lang/en.php @@ -11,9 +11,11 @@ $lang->datatable->customTip = 'Check columns to display and drag column $lang->datatable->switchToTable = 'Common Table'; $lang->datatable->switchToDatatable = 'Advanced Table'; $lang->datatable->required = 'Required'; -$lang->datatable->confirmReset = 'Do you want to restore the default settings?'; +$lang->datatable->confirmReset = 'Restoring to default will clear the relevant settings of the list. Are you sure you want to restore to default?'; $lang->datatable->setGlobal = 'Set Global'; $lang->datatable->resetGlobal = 'Global Reset'; +$lang->datatable->confirmSetGlobal = 'After applying it globally, the list of all individuals in the system will default to this rule for display. Are you sure you want to apply it globally?'; +$lang->datatable->confirmGlobalReset = 'After restoring to default globally, all individual list settings in the system will be cleared. Are you sure you want to restore to default?'; $lang->datatable->branch = 'Branch'; $lang->datatable->platform = 'Platform'; diff --git a/module/datatable/lang/fr.php b/module/datatable/lang/fr.php index d9163e32c7..cce20bf34a 100644 --- a/module/datatable/lang/fr.php +++ b/module/datatable/lang/fr.php @@ -11,9 +11,11 @@ $lang->datatable->customTip = "Cochez les colonnes à afficher et dépl $lang->datatable->switchToTable = 'Basculer vers le Tableau Commun'; $lang->datatable->switchToDatatable = 'Basculer vers le Tableau Avancé'; $lang->datatable->required = 'Obligatoire'; -$lang->datatable->confirmReset = 'Voulez-vous restaurer les paramétres par défaut ?'; +$lang->datatable->confirmReset = 'Restoring to default will clear the relevant settings of the list. Are you sure you want to restore to default?'; $lang->datatable->setGlobal = 'Paramétrage Global'; $lang->datatable->resetGlobal = 'Réinitialisation Globale'; +$lang->datatable->confirmSetGlobal = 'After applying it globally, the list of all individuals in the system will default to this rule for display. Are you sure you want to apply it globally?'; +$lang->datatable->confirmGlobalReset = 'After restoring to default globally, all individual list settings in the system will be cleared. Are you sure you want to restore to default?'; $lang->datatable->branch = 'Branche'; $lang->datatable->platform = 'Plateforme'; diff --git a/module/datatable/lang/vi.php b/module/datatable/lang/vi.php index 8961d6219d..64339eadbe 100644 --- a/module/datatable/lang/vi.php +++ b/module/datatable/lang/vi.php @@ -11,9 +11,11 @@ $lang->datatable->customTip = 'Kiểm tra cột để hiển thị và $lang->datatable->switchToTable = 'Chuyển sang bảng chung'; $lang->datatable->switchToDatatable = 'Chuyển sang bảng nâng cao'; $lang->datatable->required = 'Bắt buộc'; -$lang->datatable->confirmReset = 'Bạn có muốn khôi phục lại thiết lập mặc định?'; +$lang->datatable->confirmReset = 'Restoring to default will clear the relevant settings of the list. Are you sure you want to restore to default?'; $lang->datatable->setGlobal = 'Thiết lập toàn cục'; $lang->datatable->resetGlobal = 'Thiết lập lại toàn cục'; +$lang->datatable->confirmSetGlobal = 'After applying it globally, the list of all individuals in the system will default to this rule for display. Are you sure you want to apply it globally?'; +$lang->datatable->confirmGlobalReset = 'After restoring to default globally, all individual list settings in the system will be cleared. Are you sure you want to restore to default?'; $lang->datatable->branch = 'Nhánh'; $lang->datatable->platform = 'Platform'; diff --git a/module/datatable/lang/zh-cn.php b/module/datatable/lang/zh-cn.php index 9b4c4e35c9..edcd6a8aec 100644 --- a/module/datatable/lang/zh-cn.php +++ b/module/datatable/lang/zh-cn.php @@ -6,14 +6,16 @@ $lang->datatable->show = '显示'; $lang->datatable->hide = '隐藏'; $lang->datatable->reset = '恢复默认'; -$lang->datatable->custom = '自定义列'; -$lang->datatable->customTip = '勾选需要显示的列,拖动列名进行排序。'; -$lang->datatable->switchToTable = '切换到简单表格'; -$lang->datatable->switchToDatatable = '切换到高级表格'; -$lang->datatable->required = '必选'; -$lang->datatable->confirmReset = '是否恢复默认设置?'; -$lang->datatable->setGlobal = '应用到全局'; -$lang->datatable->resetGlobal = '全局恢复默认'; +$lang->datatable->custom = '自定义列'; +$lang->datatable->customTip = '勾选需要显示的列,拖动列名进行排序。'; +$lang->datatable->switchToTable = '切换到简单表格'; +$lang->datatable->switchToDatatable = '切换到高级表格'; +$lang->datatable->required = '必选'; +$lang->datatable->confirmReset = '恢复默认后,列表的相关设置将被清空,您确定要恢复默认吗?'; +$lang->datatable->setGlobal = '应用到全局'; +$lang->datatable->resetGlobal = '全局恢复默认'; +$lang->datatable->confirmSetGlobal = '应用到全局后,系统内所有人的列表将默认按该规则进行显示,您确定要应用到全局吗?'; +$lang->datatable->confirmGlobalReset = '全局恢复默认后,系统内所有人的列表设置将被清空,您确定要恢复默认吗?'; $lang->datatable->branch = '分支'; $lang->datatable->platform = '平台';