From e99556eab5ec51f60bfb488530faef5bfd46da34 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Fri, 7 Jul 2023 19:10:51 +0800 Subject: [PATCH] * Finish create managecontacts zin page. --- module/index/config.php | 1 - module/my/css/managecontacts.ui.css | 1 + module/my/js/managecontacts.ui.js | 12 +++ module/my/lang/de.php | 2 + module/my/lang/en.php | 2 + module/my/lang/fr.php | 2 + module/my/lang/zh-cn.php | 2 + module/my/ui/managecontacts.html.php | 139 +++++++++++++++++++++++++++ module/user/lang/zh-cn.php | 2 +- 9 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 module/my/css/managecontacts.ui.css create mode 100644 module/my/js/managecontacts.ui.js create mode 100644 module/my/ui/managecontacts.html.php diff --git a/module/index/config.php b/module/index/config.php index 2eb1b61bd5..125241b5e4 100644 --- a/module/index/config.php +++ b/module/index/config.php @@ -24,7 +24,6 @@ $config->index->appGroup['user'] = 'admin'; $config->index->oldPages = array(); $config->index->oldPages[] = 'my-dynamic'; -$config->index->oldPages[] = 'my-managecontacts'; $config->index->oldPages[] = 'product-roadmap'; $config->index->oldPages[] = 'program-kanban'; $config->index->oldPages[] = 'project-kanban'; diff --git a/module/my/css/managecontacts.ui.css b/module/my/css/managecontacts.ui.css new file mode 100644 index 0000000000..7c693e119b --- /dev/null +++ b/module/my/css/managecontacts.ui.css @@ -0,0 +1 @@ +#mainContent .panel-body {padding: 0;} diff --git a/module/my/js/managecontacts.ui.js b/module/my/js/managecontacts.ui.js new file mode 100644 index 0000000000..a39cead65c --- /dev/null +++ b/module/my/js/managecontacts.ui.js @@ -0,0 +1,12 @@ +function getCreateForm(event) +{ + const url = $.createLink('my', 'manageContacts', 'listID=&mode=new'); + loadPage(url, '#dataForm'); +} + +function getEditForm(event) +{ + const listID = '3'; + const url = $.createLink('my', 'manageContacts', 'listID=' + listID + '&mode=edit'); + loadPage(url, '#dataForm'); +} diff --git a/module/my/lang/de.php b/module/my/lang/de.php index f8d8795e8b..661526528b 100644 --- a/module/my/lang/de.php +++ b/module/my/lang/de.php @@ -48,6 +48,8 @@ $lang->my->alert = 'You can click on your profile at the top right and $lang->my->assignedToMe = 'AssignedToMe'; $lang->my->byQuery = 'Search'; $lang->my->contactList = 'Contact List'; +$lang->my->myContact = 'My Contact'; +$lang->my->publicContact = 'Public Contact'; $lang->my->indexAction = 'My Index'; $lang->my->calendarAction = 'My Calendar'; diff --git a/module/my/lang/en.php b/module/my/lang/en.php index f8d8795e8b..661526528b 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -48,6 +48,8 @@ $lang->my->alert = 'You can click on your profile at the top right and $lang->my->assignedToMe = 'AssignedToMe'; $lang->my->byQuery = 'Search'; $lang->my->contactList = 'Contact List'; +$lang->my->myContact = 'My Contact'; +$lang->my->publicContact = 'Public Contact'; $lang->my->indexAction = 'My Index'; $lang->my->calendarAction = 'My Calendar'; diff --git a/module/my/lang/fr.php b/module/my/lang/fr.php index f8d8795e8b..661526528b 100644 --- a/module/my/lang/fr.php +++ b/module/my/lang/fr.php @@ -48,6 +48,8 @@ $lang->my->alert = 'You can click on your profile at the top right and $lang->my->assignedToMe = 'AssignedToMe'; $lang->my->byQuery = 'Search'; $lang->my->contactList = 'Contact List'; +$lang->my->myContact = 'My Contact'; +$lang->my->publicContact = 'Public Contact'; $lang->my->indexAction = 'My Index'; $lang->my->calendarAction = 'My Calendar'; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 80a48cb13d..a119e6d8ee 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -48,6 +48,8 @@ $lang->my->alert = '后续您可以点击右上方的头像,选择 $lang->my->assignedToMe = '指派给我'; $lang->my->byQuery = '搜索'; $lang->my->contactList = '联系人列表'; +$lang->my->myContact = '我的联系人'; +$lang->my->publicContact = '公共联系人'; $lang->my->indexAction = '地盘仪表盘'; $lang->my->calendarAction = '我的日程'; diff --git a/module/my/ui/managecontacts.html.php b/module/my/ui/managecontacts.html.php new file mode 100644 index 0000000000..c3a6188343 --- /dev/null +++ b/module/my/ui/managecontacts.html.php @@ -0,0 +1,139 @@ + + * @package my + * @link https://www.zentao.net + */ +namespace zin; + +formPanel +( + set::actions(array()), + on::click('#createContact', 'getCreateForm'), + on::click('.editContact', 'getEditForm'), + div + ( + set::id('manageContacts'), + set::class('w-full flex'), + cell + ( + set::width('180px'), + set::class('border-r'), + div + ( + set::class('border-b py-4 pr-4'), + div(span(set::class('text-gray'), $lang->my->contactList)), + div + ( + set::class('pt-2'), + a + ( + set::id('createContact'), + set::class('btn secondary-pale btn-secondary w-full'), + set::href('javascript:;'), + icon('plus'), + $lang->user->contacts->createList + ) + ) + ), + div + ( + tabs + ( + tabPane + ( + set::key('my'), + set::title($lang->my->myContact), + set::active(true), + ul + ( + li(set::class('active'), a(set::href('123'), 123)), + li(a(set::href('123'), 456)) + ) + ), + tabPane + ( + set::key('public'), + set::title($lang->my->publicContact), + ul + ( + li(set::class('active'), 123), + li(456) + ) + ) + ) + ) + ), + cell + ( + set::id('dataForm'), + set::class('flex-1 px-8'), + div + ( + set('class', 'panel-title text-lg flex w-full py-6'), + '创建联系人' + ), + div + ( + input(set::class('hidden'), set::name('mode'), set::value($mode)), + formRow + ( + set::class('py-2'), + formGroup + ( + set::width('1/2'), + set::label('名称'), + input + ( + set::name('newList'), + set::value() + ) + ) + ), + formRow + ( + set::class('py-2'), + formGroup + ( + set::label('选择用户'), + select + ( + set::multiple(true), + set::name('users[]'), + set::items($users), + set::value() + ) + ) + ), + formRow + ( + formGroup + ( + set::label(''), + set::width('1/1'), + checkbox + ( + set::name('public'), + set::text('公开联系人'), + ) + ) + ), + formRow + ( + formGroup + ( + set::label(''), + set::class('form-actions justify-start'), + button(set::class('btn primary'), set::type('submit'), $lang->save) + ) + ) + ) + ) + ) +); + +render(); diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php index ab66e10cfc..f2090da3f2 100644 --- a/module/user/lang/zh-cn.php +++ b/module/user/lang/zh-cn.php @@ -285,7 +285,7 @@ $lang->user->contacts->manage = '维护列表'; $lang->user->contacts->contactsList = '已有列表'; $lang->user->contacts->selectedUsers = '选择用户'; $lang->user->contacts->selectList = '选择列表'; -$lang->user->contacts->createList = '创建新列表'; +$lang->user->contacts->createList = '创建联系人'; $lang->user->contacts->noListYet = '还没有创建任何列表,请先创建联系人列表。'; $lang->user->contacts->confirmDelete = '您确定要删除这个列表吗?'; $lang->user->contacts->or = ' 或者 ';