RSS

trunk : 5441

lpsolit%gmail.com
2008-01-27 23:14:14
Revision ID: cvs-1:lpsolitgmail.com-20080128051414-2yv396bj7ybtinpg
Bug 325487: Admin pages should require less "clicks" (remove useless confirmation pages) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=justdave r=mkanat a=LpSolit

collapse all collapse all

added added

removed removed

17
#
17
#
18
# Contributor(s): Albert Ting <alt@sonic.net>
18
# Contributor(s): Albert Ting <alt@sonic.net>
19
#                 Max Kanat-Alexander <mkanat@bugzilla.org>
19
#                 Max Kanat-Alexander <mkanat@bugzilla.org>
20
#
20
#                 Frédéric Buclin <LpSolit@gmail.com>
21
# Direct any questions on this source code to mozilla.org
21
 
22
 
22
 
23
use strict;
23
use strict;
24
use lib qw(. lib);
24
use lib qw(. lib);
39
    my $action = shift;
39
    my $action = shift;
40
    my $cgi = Bugzilla->cgi;
40
    my $cgi = Bugzilla->cgi;
41
    my $template = Bugzilla->template;
41
    my $template = Bugzilla->template;
 
 
42
 
 
 
43
    $vars->{'classifications'} = [Bugzilla::Classification::get_all_classifications()]
 
 
44
      if ($action eq 'select');
42
    # There is currently only one section about classifications,
45
    # There is currently only one section about classifications,
43
    # so all pages point to it. Let's define it here.
46
    # so all pages point to it. Let's define it here.
44
    $vars->{'doc_section'} = 'classifications.html';
47
    $vars->{'doc_section'} = 'classifications.html';
77
#
80
#
78
# action='' -> Show nice list of classifications
81
# action='' -> Show nice list of classifications
79
#
82
#
80
 
83
LoadTemplate('select') unless $action;
81
unless ($action) {
 
 
82
    my @classifications =
 
 
83
        Bugzilla::Classification::get_all_classifications();
 
 
84
 
 
 
85
    $vars->{'classifications'} = \@classifications;
 
 
86
    LoadTemplate("select");
 
 
87
}
 
 
88
 
84
 
89
#
85
#
90
# action='add' -> present form for parameters for new classification
86
# action='add' -> present form for parameters for new classification
129
    $dbh->do("INSERT INTO classifications (name, description, sortkey)
125
    $dbh->do("INSERT INTO classifications (name, description, sortkey)
130
              VALUES (?, ?, ?)", undef, ($class_name, $description, $sortkey));
126
              VALUES (?, ?, ?)", undef, ($class_name, $description, $sortkey));
131
 
127
 
132
    $vars->{'classification'} = $class_name;
 
 
133
 
 
 
134
    delete_token($token);
128
    delete_token($token);
135
    LoadTemplate($action);
129
 
 
 
130
    $vars->{'message'} = 'classification_created';
 
 
131
    $vars->{'classification'} = new Bugzilla::Classification({name => $class_name});
 
 
132
    $vars->{'classifications'} = [Bugzilla::Classification::get_all_classifications];
 
 
133
    $vars->{'token'} = issue_session_token('reclassify_classifications');
 
 
134
    LoadTemplate('reclassify');
136
}
135
}
137
 
136
 
138
#
137
#
177
    # lock the tables before we start to change everything:
176
    # lock the tables before we start to change everything:
178
    $dbh->bz_start_transaction();
177
    $dbh->bz_start_transaction();
179
 
178
 
 
 
179
    # update products just in case
 
 
180
    $dbh->do("UPDATE products SET classification_id = 1
 
 
181
              WHERE classification_id = ?", undef, $classification->id);
 
 
182
 
180
    # delete
183
    # delete
181
    $dbh->do("DELETE FROM classifications WHERE id = ?", undef,
184
    $dbh->do("DELETE FROM classifications WHERE id = ?", undef,
182
             $classification->id);
185
             $classification->id);
183
 
186
 
184
    # update products just in case
 
 
185
    $dbh->do("UPDATE products SET classification_id = 1
 
 
186
              WHERE classification_id = ?", undef, $classification->id);
 
 
187
 
 
 
188
    $dbh->bz_commit_transaction();
187
    $dbh->bz_commit_transaction();
189
 
188
 
190
    $vars->{'classification'} = $classification;
189
    $vars->{'message'} = 'classification_deleted';
191
 
190
    $vars->{'classification'} = $class_name;
192
    delete_token($token);
191
    delete_token($token);
193
    LoadTemplate($action);
192
    LoadTemplate('select');
194
}
193
}
195
 
194
 
196
#
195
#
267
 
266
 
268
    $dbh->bz_commit_transaction();
267
    $dbh->bz_commit_transaction();
269
 
268
 
 
 
269
    $vars->{'message'} = 'classification_updated';
 
 
270
    $vars->{'classification'} = $class_name;
270
    delete_token($token);
271
    delete_token($token);
271
    LoadTemplate($action);
272
    LoadTemplate('select');
272
}
273
}
273
 
274
 
274
#
275
#
137
                                    initialqacontact => $default_qa_contact,
137
                                    initialqacontact => $default_qa_contact,
138
                                    initial_cc       => \@initial_cc });
138
                                    initial_cc       => \@initial_cc });
139
 
139
 
 
 
140
    $vars->{'message'} = 'component_created';
140
    $vars->{'comp'} = $component;
141
    $vars->{'comp'} = $component;
141
    $vars->{'product'} = $product;
142
    $vars->{'product'} = $product;
142
    delete_token($token);
143
    delete_token($token);
143
 
144
 
144
    $template->process("admin/components/created.html.tmpl", $vars)
145
    $template->process("admin/components/list.html.tmpl", $vars)
145
      || ThrowTemplateError($template->error());
146
      || ThrowTemplateError($template->error());
146
    exit;
147
    exit;
147
}
148
}
174
 
175
 
175
    $component->remove_from_db;
176
    $component->remove_from_db;
176
 
177
 
 
 
178
    $vars->{'message'} = 'component_deleted';
177
    $vars->{'comp'} = $component;
179
    $vars->{'comp'} = $component;
178
    $vars->{'product'} = $product;
180
    $vars->{'product'} = $product;
 
 
181
    $vars->{'no_edit_component_link'} = 1;
179
    delete_token($token);
182
    delete_token($token);
180
 
183
 
181
    $template->process("admin/components/deleted.html.tmpl", $vars)
184
    $template->process("admin/components/list.html.tmpl", $vars)
182
      || ThrowTemplateError($template->error());
185
      || ThrowTemplateError($template->error());
183
    exit;
186
    exit;
184
}
187
}
234
    $component->set_cc_list(\@initial_cc);
237
    $component->set_cc_list(\@initial_cc);
235
    my $changes = $component->update();
238
    my $changes = $component->update();
236
 
239
 
 
 
240
    $vars->{'message'} = 'component_updated';
237
    $vars->{'comp'} = $component;
241
    $vars->{'comp'} = $component;
238
    $vars->{'product'} = $product;
242
    $vars->{'product'} = $product;
239
    $vars->{'changes'} = $changes;
243
    $vars->{'changes'} = $changes;
240
    delete_token($token);
244
    delete_token($token);
241
 
245
 
242
    $template->process("admin/components/updated.html.tmpl", $vars)
246
    $template->process("admin/components/list.html.tmpl", $vars)
243
      || ThrowTemplateError($template->error());
247
      || ThrowTemplateError($template->error());
244
    exit;
248
    exit;
245
}
249
}
332
 
332
 
333
    $dbh->bz_commit_transaction();
333
    $dbh->bz_commit_transaction();
334
 
334
 
335
    $vars->{'name'} = $cgi->param('name');
335
    $vars->{'name'} = $name;
336
    $vars->{'message'} = "flag_type_created";
336
    $vars->{'message'} = "flag_type_created";
337
    delete_token($token);
337
    delete_token($token);
338
 
338
 
 
 
339
    $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'});
 
 
340
    $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'});
 
 
341
 
339
    # Return the appropriate HTTP response headers.
342
    # Return the appropriate HTTP response headers.
340
    print $cgi->header();
343
    print $cgi->header();
341
 
344
 
342
    # Generate and return the UI (HTML page) from the appropriate template.
345
    $template->process("admin/flag-type/list.html.tmpl", $vars)
343
    $template->process("global/message.html.tmpl", $vars)
 
 
344
      || ThrowTemplateError($template->error());
346
      || ThrowTemplateError($template->error());
345
}
347
}
346
 
348
 
427
                 undef, $id);
429
                 undef, $id);
428
    }
430
    }
429
 
431
 
430
    $vars->{'name'} = $cgi->param('name');
432
    $vars->{'name'} = $name;
431
    $vars->{'message'} = "flag_type_changes_saved";
433
    $vars->{'message'} = "flag_type_changes_saved";
432
    delete_token($token);
434
    delete_token($token);
433
 
435
 
 
 
436
    $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'});
 
 
437
    $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'});
 
 
438
 
434
    # Return the appropriate HTTP response headers.
439
    # Return the appropriate HTTP response headers.
435
    print $cgi->header();
440
    print $cgi->header();
436
 
441
 
437
    # Generate and return the UI (HTML page) from the appropriate template.
442
    $template->process("admin/flag-type/list.html.tmpl", $vars)
438
    $template->process("global/message.html.tmpl", $vars)
 
 
439
      || ThrowTemplateError($template->error());
443
      || ThrowTemplateError($template->error());
440
}
444
}
441
 
445
 
484
    $vars->{'message'} = "flag_type_deleted";
488
    $vars->{'message'} = "flag_type_deleted";
485
    delete_token($token);
489
    delete_token($token);
486
 
490
 
 
 
491
    $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'});
 
 
492
    $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'});
 
 
493
 
487
    # Return the appropriate HTTP response headers.
494
    # Return the appropriate HTTP response headers.
488
    print $cgi->header();
495
    print $cgi->header();
489
 
496
 
490
    # Generate and return the UI (HTML page) from the appropriate template.
497
    $template->process("admin/flag-type/list.html.tmpl", $vars)
491
    $template->process("global/message.html.tmpl", $vars)
 
 
492
      || ThrowTemplateError($template->error());
498
      || ThrowTemplateError($template->error());
493
}
499
}
494
 
500
 
509
    $vars->{'flag_type'} = $flag_type;
515
    $vars->{'flag_type'} = $flag_type;
510
    delete_token($token);
516
    delete_token($token);
511
 
517
 
 
 
518
    $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'});
 
 
519
    $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'});
 
 
520
 
512
    # Return the appropriate HTTP response headers.
521
    # Return the appropriate HTTP response headers.
513
    print $cgi->header();
522
    print $cgi->header();
514
 
523
 
515
    # Generate and return the UI (HTML page) from the appropriate template.
524
    # Generate and return the UI (HTML page) from the appropriate template.
516
    $template->process("global/message.html.tmpl", $vars)
525
    $template->process("admin/flag-type/list.html.tmpl", $vars)
517
      || ThrowTemplateError($template->error());
526
      || ThrowTemplateError($template->error());
518
}
527
}
519
 
528
 
257
              VALUES (?, ?, 1, ?, ?, ?)',
257
              VALUES (?, ?, 1, ?, ?, ?)',
258
              undef, ($name, $desc, $regexp, $isactive, $icon_url));
258
              undef, ($name, $desc, $regexp, $isactive, $icon_url));
259
 
259
 
260
    my $gid = $dbh->bz_last_key('groups', 'id');
260
    my $group = new Bugzilla::Group({name => $name});
261
    my $admin = Bugzilla::Group->new({name => 'admin'})->id();
261
    my $admin = Bugzilla::Group->new({name => 'admin'})->id();
262
    # Since we created a new group, give the "admin" group all privileges
262
    # Since we created a new group, give the "admin" group all privileges
263
    # initially.
263
    # initially.
265
                             (member_id, grantor_id, grant_type)
265
                             (member_id, grantor_id, grant_type)
266
                             VALUES (?, ?, ?)');
266
                             VALUES (?, ?, ?)');
267
 
267
 
268
    $sth->execute($admin, $gid, GROUP_MEMBERSHIP);
268
    $sth->execute($admin, $group->id, GROUP_MEMBERSHIP);
269
    $sth->execute($admin, $gid, GROUP_BLESS);
269
    $sth->execute($admin, $group->id, GROUP_BLESS);
270
    $sth->execute($admin, $gid, GROUP_VISIBLE);
270
    $sth->execute($admin, $group->id, GROUP_VISIBLE);
271
 
271
 
272
    # Permit all existing products to use the new group if makeproductgroups.
272
    # Permit all existing products to use the new group if makeproductgroups.
273
    if ($cgi->param('insertnew')) {
273
    if ($cgi->param('insertnew')) {
275
                  (group_id, product_id, entry, membercontrol,
275
                  (group_id, product_id, entry, membercontrol,
276
                   othercontrol, canedit)
276
                   othercontrol, canedit)
277
                  SELECT ?, products.id, 0, ?, ?, 0 FROM products',
277
                  SELECT ?, products.id, 0, ?, ?, 0 FROM products',
278
                  undef, ($gid, CONTROLMAPSHOWN, CONTROLMAPNA));
278
                  undef, ($group->id, CONTROLMAPSHOWN, CONTROLMAPNA));
279
    }
279
    }
280
    Bugzilla::Group::RederiveRegexp($regexp, $gid);
280
    Bugzilla::Group::RederiveRegexp($regexp, $group->id);
281
    delete_token($token);
281
    delete_token($token);
282
 
282
 
 
 
283
    $vars->{'message'} = 'group_created';
 
 
284
    $vars->{'group'} = $group;
 
 
285
    get_current_and_available($group, $vars);
 
 
286
    $vars->{'token'} = issue_session_token('edit_group');
 
 
287
 
283
    print $cgi->header();
288
    print $cgi->header();
284
    $template->process("admin/groups/created.html.tmpl", $vars)
289
    $template->process("admin/groups/edit.html.tmpl", $vars)
285
      || ThrowTemplateError($template->error());
290
      || ThrowTemplateError($template->error());
286
    exit;
291
    exit;
287
}
292
}
454
 
459
 
455
    delete_token($token);
460
    delete_token($token);
456
 
461
 
 
 
462
    $vars->{'message'} = 'group_deleted';
 
 
463
    $vars->{'groups'} = [Bugzilla::Group->get_all];
 
 
464
 
457
    print $cgi->header();
465
    print $cgi->header();
458
    $template->process("admin/groups/deleted.html.tmpl", $vars)
466
    $template->process("admin/groups/list.html.tmpl", $vars)
459
      || ThrowTemplateError($template->error());
467
      || ThrowTemplateError($template->error());
460
 
 
 
461
    exit;
468
    exit;
462
}
469
}
463
 
470
 
521
    $vars->{'users'}  = \@deleted;
528
    $vars->{'users'}  = \@deleted;
522
    $vars->{'regexp'} = $regexp;
529
    $vars->{'regexp'} = $regexp;
523
    delete_token($token);
530
    delete_token($token);
524
    
531
 
 
 
532
    $vars->{'message'} = 'group_membership_removed';
 
 
533
    $vars->{'group'} = $group->name;
 
 
534
    $vars->{'groups'} = [Bugzilla::Group->get_all];
 
 
535
 
525
    print $cgi->header();
536
    print $cgi->header();
526
    $template->process("admin/groups/remove.html.tmpl", $vars)
537
    $template->process("admin/groups/list.html.tmpl", $vars)
527
      || ThrowTemplateError($template->error());
538
      || ThrowTemplateError($template->error());
528
 
539
 
529
    exit;
540
    exit;
92
 
92
 
93
    print $cgi->header();
93
    print $cgi->header();
94
 
94
 
 
 
95
    $vars->{'message'} = 'keyword_created';
95
    $vars->{'name'} = $keyword->name;
96
    $vars->{'name'} = $keyword->name;
96
    $template->process("admin/keywords/created.html.tmpl", $vars)
97
    $vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count();
 
 
98
 
 
 
99
    $template->process("admin/keywords/list.html.tmpl", $vars)
97
      || ThrowTemplateError($template->error());
100
      || ThrowTemplateError($template->error());
98
 
 
 
99
    exit;
101
    exit;
100
}
102
}
101
 
103
 
102
    
 
 
103
 
104
 
104
#
105
#
105
# action='edit' -> present the edit keywords from
106
# action='edit' -> present the edit keywords from
132
 
133
 
133
    $keyword->set_name($cgi->param('name'));
134
    $keyword->set_name($cgi->param('name'));
134
    $keyword->set_description($cgi->param('description'));
135
    $keyword->set_description($cgi->param('description'));
135
    $keyword->update();
136
    my $changes = $keyword->update();
136
 
137
 
137
    delete_token($token);
138
    delete_token($token);
138
 
139
 
139
    print $cgi->header();
140
    print $cgi->header();
140
 
141
 
 
 
142
    $vars->{'message'} = 'keyword_updated';
141
    $vars->{'keyword'} = $keyword;
143
    $vars->{'keyword'} = $keyword;
142
    $template->process("admin/keywords/rebuild-cache.html.tmpl", $vars)
144
    $vars->{'changes'} = $changes;
 
 
145
    $vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count();
 
 
146
 
 
 
147
    $template->process("admin/keywords/list.html.tmpl", $vars)
143
      || ThrowTemplateError($template->error());
148
      || ThrowTemplateError($template->error());
144
 
 
 
145
    exit;
149
    exit;
146
}
150
}
147
 
151
 
173
 
177
 
174
    print $cgi->header();
178
    print $cgi->header();
175
 
179
 
176
    $template->process("admin/keywords/rebuild-cache.html.tmpl", $vars)
180
    $vars->{'message'} = 'keyword_deleted';
 
 
181
    $vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count();
 
 
182
 
 
 
183
    $template->process("admin/keywords/list.html.tmpl", $vars)
177
      || ThrowTemplateError($template->error());
184
      || ThrowTemplateError($template->error());
178
 
 
 
179
    exit;
185
    exit;
180
}
186
}
181
 
187
 
1
#!/usr/bin/perl -wT
1
#!/usr/bin/perl -wT
2
# -*- Mode: perl; indent-tabs-mode: nil -*-
2
# -*- Mode: perl; indent-tabs-mode: nil -*-
3
 
3
#
4
#
4
# The contents of this file are subject to the Mozilla Public
5
# This is a script to edit the target milestones. It is largely a copy of
5
# License Version 1.1 (the "License"); you may not use this file
6
# the editversions.cgi script, since the two fields were set up in a
6
# except in compliance with the License. You may obtain a copy of
7
# very similar fashion.
7
# the License at http://www.mozilla.org/MPL/
8
#
8
#
9
# (basically replace each occurrence of 'milestone' with 'version', and
9
# Software distributed under the License is distributed on an "AS
10
# you'll have the original script)
10
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
11
#
11
# implied. See the License for the specific language governing
12
# Matt Masson <matthew@zeroknowledge.com>
12
# rights and limitations under the License.
13
#
13
#
14
# Contributors : Gavin Shelley <bugzilla@chimpychompy.org>
14
# The Initial Developer of the Original Code is Matt Masson.
 
 
15
# Portions created by Matt Masson are Copyright (C) 2000 Matt Masson.
 
 
16
# All Rights Reserved.
 
 
17
#
 
 
18
# Contributors : Matt Masson <matthew@zeroknowledge.com>
 
 
19
#                Gavin Shelley <bugzilla@chimpychompy.org>
15
#                Frédéric Buclin <LpSolit@gmail.com>
20
#                Frédéric Buclin <LpSolit@gmail.com>
16
#
 
 
17
 
21
 
18
use strict;
22
use strict;
19
use lib qw(. lib);
23
use lib qw(. lib);
116
                                                  sortkey => $sortkey });
120
                                                  sortkey => $sortkey });
117
    delete_token($token);
121
    delete_token($token);
118
 
122
 
 
 
123
    $vars->{'message'} = 'milestone_created';
119
    $vars->{'milestone'} = $milestone;
124
    $vars->{'milestone'} = $milestone;
120
    $vars->{'product'} = $product;
125
    $vars->{'product'} = $product;
121
    $template->process("admin/milestones/created.html.tmpl", $vars)
126
    $template->process("admin/milestones/list.html.tmpl", $vars)
122
      || ThrowTemplateError($template->error());
127
      || ThrowTemplateError($template->error());
123
    exit;
128
    exit;
124
}
129
}
158
    $milestone->remove_from_db;
163
    $milestone->remove_from_db;
159
    delete_token($token);
164
    delete_token($token);
160
 
165
 
 
 
166
    $vars->{'message'} = 'milestone_deleted';
161
    $vars->{'milestone'} = $milestone;
167
    $vars->{'milestone'} = $milestone;
162
    $vars->{'product'} = $product;
168
    $vars->{'product'} = $product;
 
 
169
    $vars->{'no_edit_milestone_link'} = 1;
163
 
170
 
164
    $template->process("admin/milestones/deleted.html.tmpl", $vars)
171
    $template->process("admin/milestones/list.html.tmpl", $vars)
165
      || ThrowTemplateError($template->error());
172
      || ThrowTemplateError($template->error());
166
    exit;
173
    exit;
167
}
174
}
202
 
209
 
203
    delete_token($token);
210
    delete_token($token);
204
 
211
 
 
 
212
    $vars->{'message'} = 'milestone_updated';
205
    $vars->{'milestone'} = $milestone;
213
    $vars->{'milestone'} = $milestone;
206
    $vars->{'product'} = $product;
214
    $vars->{'product'} = $product;
207
    $vars->{'changes'} = $changes;
215
    $vars->{'changes'} = $changes;
208
    $template->process("admin/milestones/updated.html.tmpl", $vars)
216
    $template->process("admin/milestones/list.html.tmpl", $vars)
209
      || ThrowTemplateError($template->error());
217
      || ThrowTemplateError($template->error());
210
    exit;
218
    exit;
211
}
219
}
26
#               Frédéric Buclin <LpSolit@gmail.com>
26
#               Frédéric Buclin <LpSolit@gmail.com>
27
#               Greg Hendricks <ghendricks@novell.com>
27
#               Greg Hendricks <ghendricks@novell.com>
28
#               Lance Larsh <lance.larsh@oracle.com>
28
#               Lance Larsh <lance.larsh@oracle.com>
29
#
 
 
30
# Direct any questions on this source code to
 
 
31
#
 
 
32
# Holger Schurig <holgerschurig@nikocity.de>
 
 
33
 
29
 
34
use strict;
30
use strict;
35
use lib qw(. lib);
31
use lib qw(. lib);
73
                                     action => "edit",
69
                                     action => "edit",
74
                                     object => "products"});
70
                                     object => "products"});
75
 
71
 
 
 
72
sub get_group_controls {
 
 
73
    my $product = shift;
 
 
74
 
 
 
75
    my $group_controls = $product->group_controls;
 
 
76
    # Convert Group Controls (membercontrol and othercontrol) from
 
 
77
    # integer to string to display Membercontrol/Othercontrol names
 
 
78
    # in the template.
 
 
79
    my $constants = {
 
 
80
        (CONTROLMAPNA) => 'NA',
 
 
81
        (CONTROLMAPSHOWN) => 'Shown',
 
 
82
        (CONTROLMAPDEFAULT) => 'Default',
 
 
83
        (CONTROLMAPMANDATORY) => 'Mandatory'};
 
 
84
 
 
 
85
    foreach my $group (keys %$group_controls) {
 
 
86
        foreach my $control ('membercontrol', 'othercontrol') {
 
 
87
            $group_controls->{$group}->{$control} =
 
 
88
                $constants->{$group_controls->{$group}->{$control}};
 
 
89
        }
 
 
90
    }
 
 
91
    return $group_controls;
 
 
92
}
 
 
93
 
76
#
94
#
77
# often used variables
95
# often used variables
78
#
96
#
339
    }
357
    }
340
    delete_token($token);
358
    delete_token($token);
341
 
359
 
 
 
360
    $vars->{'message'} = 'product_created';