Bug 40933

Work time in new bugs + remind


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@292 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2009-08-25 17:21:51 +00:00
parent 3262737810
commit 42080e8f05
7 changed files with 97 additions and 4 deletions

View File

@ -68,6 +68,7 @@ sub SETTINGS {
# 2008-12-22 vfilippov@custis.ru -- Custis Bug 17481
remind_me_about_worktime => { options => ['on', 'off'], default => 'on' },
remind_me_about_flags => { options => ['on', 'off'], default => 'on' },
remind_me_about_worktime_newbug => { options => ['on', 'off'], default => 'off' },
}
};

View File

@ -65,6 +65,13 @@ my $vars = {};
# All pages point to the same part of the documentation.
$vars->{'doc_section'} = 'bugreports.html';
$vars->{remind_about_worktime_newbug} =
$user->is_timetracker && # user is timetracker
$user->settings->{remind_me_about_worktime_newbug} && # user wants to be reminded about worktime
$user->settings->{remind_me_about_worktime_newbug}->{value} &&
lc $user->settings->{remind_me_about_worktime_newbug}->{value} ne 'off'
? 1 : 0;
my $product_name = trim($cgi->param('product') || '');
# Will contain the product object the bug is created in.
my $product;

View File

@ -13,7 +13,10 @@ delete from bugs_activity where attach_id=13950;
delete from series_data where series_id in (647, 648, 649, 650, 651, 652, 681, 694, 695, 696, 697);
delete from category_group_map where group_id in (17, 45, 30, 23, 21, 14, 15, 27, 49, 16, 10, 18, 19, 22, 35, 31);
-- Убираем старые юзерские настройки
delete from profile_setting where setting_name in ('go_to_next_bug', 'remind_me_about_worktime_newbug', 'remind_me_about_requests', 'create_bug_resolved');
delete from profile_setting where setting_name in ('go_to_next_bug', 'remind_me_about_flags', 'create_bug_resolved');
update profile_settings set setting_name='remind_me_about_flags' where setting_name='remind_me_about_requests';
delete from setting_value where name in ('go_to_next_bug', 'remind_me_about_requests', 'create_bug_resolved');
delete from setting where name in ('go_to_next_bug', 'remind_me_about_requests', 'create_bug_resolved');
-- Дальше ДОЛЖНО уже быть создано поле cf_agreement (договор) зависимое от продукта
-- Наполняем значениями поле "Договор"
insert into cf_agreement (value, sortkey, isactive, visibility_value_id)

View File

@ -77,6 +77,22 @@ var flags = new Array([% product.components.size %]);
[% count = count + 1 %]
[%- END %]
function Create_onsubmit()
{
wt = parseFloat(document.Create.work_time.value);
if ([% remind_about_worktime_newbug %] && (!wt || wt == NaN || wt <= 0))
{
wt = prompt("Please, verify working time:", "0");
if (wt == null || wt == undefined || (""+wt).length <= 0)
{
document.Create.work_time.focus();
return false;
}
document.Create.work_time.value = wt;
}
return true;
}
function set_assign_to() {
// Based on the selected component, fill the "Assign To:" field
// with the default component owner, and the "QA Contact:" field
@ -182,7 +198,7 @@ TUI_hide_default('expert_fields');
[% END %]
<form name="Create" id="Create" method="post" action="post_bug.cgi"
enctype="multipart/form-data">
enctype="multipart/form-data" onsubmit="return Create_onsubmit()">
<input type="hidden" name="product" value="[% product.name FILTER html %]">
<input type="hidden" name="token" value="[% token FILTER html %]">

View File

@ -465,6 +465,9 @@
[% ELSIF error == "invalid_remind_me_about_worktime" %]
Invalid setting for remind_me_about_worktime
[% ELSIF error == "invalid_remind_me_about_worktime_newbug" %]
Invalid setting for remind_me_about_worktime_newbug
[% ELSIF error == "invalid_remind_me_about_flags" %]
Invalid setting for remind_me_about_flags

View File

@ -47,6 +47,7 @@
"timezone" => "Timezone used to display dates and times",
"local" => "Same as the server",
"remind_me_about_worktime" => "Remind me about worktime",
"remind_me_about_worktime_newbug" => "Remind me about worktime for new bugs",
"remind_me_about_flags" => "Remind me about flag requests",
"redirect_me_to_my_bugzilla" => "Redirect me to my bugzilla",
}

View File

@ -371,6 +371,58 @@ Ext.onReady(function(){
failure: testopiaError
});
});
var edit_wiki_btn = new Ext.Button({
applyTo: 'plan_wiki_edit_btn',
template: button_16x_tmpl,
id:'edit_plan_wiki_btn',
icon: 'testopia/img/edit.png',
iconCls: 'img_button_16x',
tooltip: 'Edit Plan Wiki Category',
handler: function(){
Ext.getCmp('plan_wiki_edt').startEdit(Ext.get('plan_wiki'));
}
});
var plan_wiki_edt = new Ext.Editor(
new Ext.form.TextField({
width: Ext.get('plan_wiki').getWidth() < 200 ? 200 : Ext.get('plan_wiki').getWidth(),
name: 'plan_wiki'
}),{
alignment: 'tl-tl',
id: 'plan_wiki_edt',
ignoreNoChange: true,
updateEl: true,
completeOnEnter: true,
cancelOnEsc: true
});
plan_wiki_edt.on('complete', function(e,v,sv){
testopia_form.submit({
url: 'tr_process_plan.cgi',
params: {action: 'edit', wiki: v, plan_id: plan.plan_id},
success: function(){
TestopiaUtil.notify.msg('Plan updated', 'Plan {0} was updated successfully', 'wiki');
},
failure: testopiaError
});
});
var sync_wiki_btn = new Ext.Button({
applyTo: 'plan_wiki_sync_btn',
text: 'Synchronize',
id: 'edit_plan_wiki_btn',
tooltip: 'Synchronize Test Plan with Wiki Category',
handler: function(){
var w = Ext.get('plan_wiki').dom.innerHTML;
if (!w.match(/^\s*$/))
{
var l = window.location.href;
var m;
if (m = l.match(/^(.*?)\?/))
l = m[1];
window.location.href = l + '?wikisync=1&plan_id=' + plan.plan_id;
}
}
});
[% END %]
Ext.getCmp('dashboardpanel').on('render', function(){
Ext.getCmp('dashboardpanel').getTopToolbar().add({
@ -400,10 +452,11 @@ Ext.onReady(function(){
<table border="0" cellpadding="1" width="100%" id="plan_overview_table">
<tbody align="left">
<tr class="bz_row_header">
<th colspan="3">Plan Name</th>
<th>Plan Name</th>
<th colspan="2">Wiki category</th>
</tr>
<tr class="bz_row_data">
<td colspan="3">
<td>
<table>
<tr>
<td><div id="plan_name">[% plan.name FILTER html %]</div></td>
@ -412,6 +465,15 @@ Ext.onReady(function(){
</tr>
</table>
</td>
<td colspan="2">
<table>
<tr>
<td><div id="plan_wiki">[% plan.wiki FILTER html %]</div></td>
<td><div id="plan_wiki_edit_btn"></div></td>
<td><div id="plan_wiki_sync_btn"></div></td>
</tr>
</table>
</td>
</tr>
<tr class="bz_row_header">
<th>Product</th>