From 7a8c7b6f64ac14d555d866f93300e64c47b74a98 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 20 Apr 2010 04:13:34 +0000 Subject: [PATCH] communigate (phase 2): Account Preferences (& Domain::Account Defaults:Preferences): ProntoSkinName RT#7514 --- FS/FS/Schema.pm | 50 +++++++++++++-------------- FS/FS/part_export/communigate_pro.pm | 33 +++++++++--------- FS/FS/svc_acct.pm | 10 ++++-- FS/FS/svc_domain.pm | 10 ++++-- httemplate/edit/svc_acct.cgi | 9 ++++- httemplate/edit/svc_domain.cgi | 8 ++++- httemplate/view/svc_acct/basics.html | 5 ++- httemplate/view/svc_domain/acct_defaults.html | 6 +++- 8 files changed, 82 insertions(+), 49 deletions(-) diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 67cf606fe..318b9e0f3 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1675,13 +1675,13 @@ sub tables_hashref { 'cgp_addmailtrailer', 'char', 'NULL', 1, '', '', #AddMailTrailer #XXX archive messages, mailing lists #preferences - 'cgp_deletemode', 'varchar', 'NULL', $char_d, '', '', #DeleteMode - 'cgp_emptytrash', 'varchar', 'NULL', $char_d, '', '', #EmptyTrash - 'cgp_language', 'varchar', 'NULL', $char_d, '', '', #Language - 'cgp_timezone', 'varchar', 'NULL', $char_d, '', '', #TimeZone - 'cgp_skinname', 'varchar', 'NULL', $char_d, '', '', #SkinName - #XXX pronto style? - 'cgp_sendmdnmode', 'varchar', 'NULL', $char_d, '', '', #SendMDNMode + 'cgp_deletemode', 'varchar', 'NULL', $char_d, '', '',#DeleteMode + 'cgp_emptytrash', 'varchar', 'NULL', $char_d, '', '',#EmptyTrash + 'cgp_language', 'varchar', 'NULL', $char_d, '', '',#Language + 'cgp_timezone', 'varchar', 'NULL', $char_d, '', '',#TimeZone + 'cgp_skinname', 'varchar', 'NULL', $char_d, '', '',#SkinName + 'cgp_prontoskinname', 'varchar', 'NULL', $char_d, '', '',#ProntoSkinName + 'cgp_sendmdnmode', 'varchar', 'NULL', $char_d, '', '',#SendMDNMode #mail #vacation message, redirect all mail, mail rules #XXX RPOP settings @@ -1734,26 +1734,26 @@ sub tables_hashref { 'cgp_aliases', 'varchar', 'NULL', 255, '', '', 'cgp_accessmodes','varchar','NULL', 255, '', '', #DomainAccessModes #settings - 'acct_def_password_selfchange','char', 'NULL', 1, '', '', - 'acct_def_password_recover', 'char', 'NULL', 1, 'Y', '', - 'acct_def_cgp_accessmodes', 'varchar', 'NULL', 255, '', '', - 'acct_def_quota', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_file_quota', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_file_maxnum', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_file_maxsize', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_cgp_rulesallowed','varchar', 'NULL', $char_d, '', '', - 'acct_def_cgp_rpopallowed', 'char', 'NULL', 1, '', '', - 'acct_def_cgp_mailtoall', 'char', 'NULL', 1, '', '', - 'acct_def_cgp_addmailtrailer', 'char', 'NULL', 1, '', '', + 'acct_def_password_selfchange', 'char', 'NULL', 1, '', '', + 'acct_def_password_recover', 'char', 'NULL', 1, 'Y', '', + 'acct_def_cgp_accessmodes', 'varchar', 'NULL', 255, '', '', + 'acct_def_quota', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_file_quota', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_file_maxnum', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_file_maxsize', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_rulesallowed', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_rpopallowed', 'char', 'NULL', 1, '', '', + 'acct_def_cgp_mailtoall', 'char', 'NULL', 1, '', '', + 'acct_def_cgp_addmailtrailer', 'char', 'NULL', 1, '', '', #XXX archive messages #preferences - 'acct_def_cgp_deletemode', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_cgp_emptytrash', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_cgp_language', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_cgp_timezone', 'varchar', 'NULL', $char_d, '', '', - 'acct_def_cgp_skinname', 'varchar', 'NULL', $char_d, '', '', - #XXX pronto style? - 'acct_def_cgp_sendmdnmode', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_deletemode', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_emptytrash', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_language', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_timezone', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_skinname', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_prontoskinname', 'varchar', 'NULL', $char_d, '', '', + 'acct_def_cgp_sendmdnmode', 'varchar', 'NULL', $char_d, '', '', #mail #XXX rules, archive rule, spam foldering rule(s) ], diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm index 8148b5a33..07281f140 100644 --- a/FS/FS/part_export/communigate_pro.pm +++ b/FS/FS/part_export/communigate_pro.pm @@ -112,7 +112,7 @@ sub _export_insert_svc_acct { $prefs{'Language'} = $svc_acct->cgp_language if $svc_acct->cgp_language; $prefs{'TimeZone'} = $svc_acct->cgp_timezone if $svc_acct->cgp_timezone; $prefs{'SkinName'} = $svc_acct->cgp_skinname if $svc_acct->cgp_skinname; - #XXX pronto style + $prefs{'ProntoSkinName'} = $svc_acct->cgp_prontoskinname if $svc_acct->cgp_prontoskinname; $prefs{'SendMDNMode'} = $svc_acct->cgp_sendmdnmode if $svc_acct->cgp_sendmdnmode; if ( keys %prefs ) { my $pref_err = $self->communigate_pro_queue( $svc_acct->svcnum, @@ -193,13 +193,13 @@ sub _export_insert_svc_domain { my $pref_err = $self->communigate_pro_queue( $svc_domain->svcnum, 'SetAccountDefaultPrefs', $svc_domain->domain, - 'DeleteMode' => $svc_domain->acct_def_cgp_deletemode, - 'EmptyTrash' => $svc_domain->acct_def_cgp_emptytrash, - 'Language' => $svc_domain->acct_def_cgp_language, - 'TimeZone' => $svc_domain->acct_def_cgp_timezone, - 'SkinName' => $svc_domain->acct_def_cgp_skinname, - #XXX pronto style? - 'SendMDNMode' => $svc_domain->acct_def_cgp_sendmdnmode, + 'DeleteMode' => $svc_domain->acct_def_cgp_deletemode, + 'EmptyTrash' => $svc_domain->acct_def_cgp_emptytrash, + 'Language' => $svc_domain->acct_def_cgp_language, + 'TimeZone' => $svc_domain->acct_def_cgp_timezone, + 'SkinName' => $svc_domain->acct_def_cgp_skinname, + 'ProntoSkinName' => $svc_domain->acct_def_cgp_prontoskinname, + 'SendMDNMode' => $svc_domain->acct_def_cgp_sendmdnmode, ); warn "WARNING: error queueing SetAccountDefaultPrefs job: $pref_err" if $pref_err; @@ -325,7 +325,8 @@ sub _export_replace_svc_acct { if $old->cgp_timezone ne $new->cgp_timezone; $prefs{'SkinName'} = $new->cgp_skinname if $old->cgp_skinname ne $new->cgp_skinname; - #XXX pronto style + $prefs{'ProntoSkinName'} = $new->cgp_prontoskinname + if $old->cgp_prontoskinname ne $new->cgp_prontoskinname; $prefs{'SendMDNMode'} = $new->cgp_sendmdnmode if $old->cgp_sendmdnmode ne $new->cgp_sendmdnmode; if ( keys %prefs ) { @@ -417,13 +418,13 @@ sub _export_replace_svc_domain { my $pref_err = $self->communigate_pro_queue( $new->svcnum, 'SetAccountDefaultPrefs', $new->domain, - 'DeleteMode' => $new->acct_def_cgp_deletemode, - 'EmptyTrash' => $new->acct_def_cgp_emptytrash, - 'Language' => $new->acct_def_cgp_language, - 'TimeZone' => $new->acct_def_cgp_timezone, - 'SkinName' => $new->acct_def_cgp_skinname, - #XXX Pronto style - 'SendMDNMode' => $new->acct_def_cgp_sendmdnmode, + 'DeleteMode' => $new->acct_def_cgp_deletemode, + 'EmptyTrash' => $new->acct_def_cgp_emptytrash, + 'Language' => $new->acct_def_cgp_language, + 'TimeZone' => $new->acct_def_cgp_timezone, + 'SkinName' => $new->acct_def_cgp_skinname, + 'ProntoSkinName' => $new->acct_def_cgp_prontoskinname, + 'SendMDNMode' => $new->acct_def_cgp_sendmdnmode, ); warn "WARNING: error queueing SetAccountDefaultPrefs job: $pref_err" if $pref_err; diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 666a56ab9..509384170 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -538,7 +538,13 @@ sub table_info { disable_inventory => 1, disable_select => 1, }, - #XXX pronto style? + 'cgp_prontoskinname' => { + label => 'Communigate Pronto style', + type => 'select', + select_list => [ '', 'Pronto', 'Pronto-darkflame', 'Pronto-steel', 'Pronto-twilight', ], + disable_inventory => 1, + disable_select => 1, + }, 'cgp_sendmdnmode' => { label => 'Communigate send read receipts', type => 'select', @@ -1239,7 +1245,7 @@ sub check { || $self->ut_alphan('cgp_language') || $self->ut_textn('cgp_timezone') || $self->ut_textn('cgp_skinname') - #XXX pronto style? + || $self->ut_textn('cgp_prontoskinname') || $self->ut_alphan('cgp_sendmdnmode') #XXX vacation message, redirect all mail, mail rules #XXX RPOP settings diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm index 46605f4a0..2a24da427 100644 --- a/FS/FS/svc_domain.pm +++ b/FS/FS/svc_domain.pm @@ -295,7 +295,13 @@ sub table_info { disable_inventory => 1, disable_select => 1, }, - #XXX pronto style? + 'acct_def_cgp_prontoskinname' => { + label => 'Acct. default Pronto style', + type => 'select', + select_list => [ '', 'Pronto', 'Pronto-darkflame', 'Pronto-steel', 'Pronto-twilight', ], + disable_inventory => 1, + disable_select => 1, + }, 'acct_def_cgp_sendmdnmode' => { label => 'Acct. default send read receipts', type => 'select', @@ -552,7 +558,7 @@ sub check { || $self->ut_alphan('acct_def_cgp_language') || $self->ut_textn('acct_def_cgp_timezone') || $self->ut_textn('acct_def_cgp_skinname') - #XXX pronto style? + || $self->ut_textn('acct_def_cgp_prontoskinname') || $self->ut_alphan('acct_def_cgp_sendmdnmode') #mail #XXX rules, archive rule, spam foldering rule(s) diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index bed0aaac1..5c2d5f495 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -492,7 +492,14 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
) %> -%#XXX pronto style + <% include('/elements/tr-select.html', + 'label' => 'Pronto style', + 'field' => 'cgp_prontoskinname', + 'options' => [ '', 'Pronto', 'Pronto-darkflame', 'Pronto-steel', 'Pronto-twilight', ], + + 'curr_value' => $svc_acct->cgp_prontoskinname, + ) + %> <% include('/elements/tr-select.html', 'label' => 'Send read receipts', diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi index 4f780d68b..b19e9ee15 100755 --- a/httemplate/edit/svc_domain.cgi +++ b/httemplate/edit/svc_domain.cgi @@ -320,7 +320,13 @@ Account defaults ) %> -%#XXX pronto style + <% include('/elements/tr-select.html', + 'label' => 'Pronto style', + 'field' => 'acct_def_cgp_prontoskinname', + 'options' => [ '', 'Pronto', 'Pronto-darkflame', 'Pronto-steel', 'Pronto-twilight', ], + 'curr_value' => $svc_domain->acct_def_cgp_prontoskinname, + ) + %> <% include('/elements/tr-select.html', 'label' => 'Send read receipts', diff --git a/httemplate/view/svc_acct/basics.html b/httemplate/view/svc_acct/basics.html index db7abe48b..7beb88a81 100644 --- a/httemplate/view/svc_acct/basics.html +++ b/httemplate/view/svc_acct/basics.html @@ -116,7 +116,10 @@ value=>$svc_acct->cgp_timezone || 'default (HostOS)' ) %> <% include('/view/elements/tr.html', label=>'Layout', value=>$svc_acct->cgp_skinname || 'default (***)' ) %> -%#XXX pronto style + + <% include('/view/elements/tr.html', label=>'Pronto style', + value=>$svc_acct->cgp_prontoskinname ) %> + <% include('/view/elements/tr.html', label=>'Send read receipts', value=>$svc_acct->cgp_sendmdnmode ) %> diff --git a/httemplate/view/svc_domain/acct_defaults.html b/httemplate/view/svc_domain/acct_defaults.html index 635158002..b6d03e2df 100644 --- a/httemplate/view/svc_domain/acct_defaults.html +++ b/httemplate/view/svc_domain/acct_defaults.html @@ -103,7 +103,11 @@ ) %> -%#XXX pronto style + <% include('/view/elements/tr.html', + label=>'Pronto style', + value=>$svc_domain->acct_def_cgp_prontoskinname + ) + %> <% include('/view/elements/tr.html', label=>'Send read receipts', -- 2.11.0