Assign to and CC fields - Mozilla

This is a discussion on Assign to and CC fields - Mozilla ; How can I configure bugzilla to limit the Assign to: field and CC field to the product they are entering the bug for. For example, if a user is entering bugs for a product called "test," I want them to ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Assign to and CC fields

  1. Assign to and CC fields

    How can I configure bugzilla to limit the Assign to: field and CC field to
    the product they are entering the bug for.

    For example, if a user is entering bugs for a product called "test," I want
    them to ONLY see members in the group "test" for CC AND Assign to:

    Thanks for ANY help. I have been working with the User.pm file. This file
    seems to display the drop down with the users. It uses "user_group_map"
    table to select all the users in serveral groups pertaining to the user.
    Being a Perl novice, I have added this code to try to get the querystring
    value from this URL - /bugz/enter_bug.cgi?product=test - but things haven't
    gone so well. I am also looking through your support emails currently.
    THANKS!

    I need to grab this query value and do the following:

    # I created this sub - I having trouble getting the query value, but it does
    work with a hard coded value
    sub get_group_id {

    my $self = shift;
    my $dbh2 = Bugzilla->dbh;
    my $query2 = "SELECT id FROM groups WHERE name=" . '" . QUERYSTRING VALUE HERE . "';
    my $sth2 = $dbh2->prepare($query2);
    $sth2->execute;
    my @row = $sth2->fetchrow_array;
    return @row->[0];

    }

    sub get_userlist {
    my $self = shift;
    return $self->{'userlist'} if defined $self->{'userlist'};

    my $dbh = Bugzilla->dbh;

    my $query = "SELECT DISTINCT login_name, realname,";
    if (&::Param('usevisibilitygroups')) {
    $query .= " COUNT(group_id) ";
    } else {
    $query .= " 1 ";
    }
    $query .= "FROM profiles ";



    if (&::Param('usevisibilitygroups')) {

    $query .= "LEFT JOIN user_group_map " .
    "ON user_group_map.user_id = userid AND isbless = 0 " .
    #"AND group_id= " . &get_group_id;



    }
    $query .= " WHERE disabledtext = ''";
    $query .= $dbh->sql_group_by('userid', 'login_name, realname');

    my $sth = $dbh->prepare($query);
    $sth->execute;

    my @userlist;
    while (my($login, $name, $visible) = $sth->fetchrow_array) {
    push @userlist, {
    login => $login,
    identity => $name ? "$name <$login>" : $login,
    identity2 => $name ? "$name" : $login,
    visible => $visible,
    };
    }
    @userlist = sort { lc $$a{'identity'} cmp lc $$b{'identity'} }
    @userlist;

    $self->{'userlist'} = \@userlist;
    return $self->{'userlist'};
    }




  2. Re: Assign to and CC fields

    On Fri, 6 Jul 2007 15:30:19 -0500 "Nathan Striedinger"
    wrote:
    > How can I configure bugzilla to limit the Assign to: field and CC
    > field to the product they are entering the bug for.
    >
    > For example, if a user is entering bugs for a product called "test,"
    > I want them to ONLY see members in the group "test" for CC AND Assign
    > to:


    That's what the "usevisibilitygroups" parameter is for.

    -Max
    --
    http://www.everythingsolved.com/
    Competent, Friendly Bugzilla Services. And Everything Else, too.

  3. display group members of the product ONLY

    Nathan Striedinger wrote:
    > How can I configure bugzilla to limit the Assign to: field and CC field to
    > the product they are entering the bug for.
    >
    > For example, if a user is entering bugs for a product called "test," I want
    > them to ONLY see members in the group "test" for CC AND Assign to:
    >
    > Thanks for ANY help. I have been working with the User.pm file. This file
    > seems to display the drop down with the users. It uses "user_group_map"
    > table to select all the users in serveral groups pertaining to the user.
    > Being a Perl novice, I have added this code to try to get the querystring
    > value from this URL - /bugz/enter_bug.cgi?product=test - but things haven't
    > gone so well. I am also looking through your support emails currently.
    > THANKS!
    >
    > I need to grab this query value and do the following:
    >
    > # I created this sub - I having trouble getting the query value, but it does
    > work with a hard coded value
    > sub get_group_id {
    >
    > my $self = shift;
    > my $dbh2 = Bugzilla->dbh;
    > my $query2 = "SELECT id FROM groups WHERE name=" . '" . > QUERYSTRING VALUE HERE . "';
    > my $sth2 = $dbh2->prepare($query2);
    > $sth2->execute;
    > my @row = $sth2->fetchrow_array;
    > return @row->[0];
    >
    > }
    >
    > sub get_userlist {
    > my $self = shift;
    > return $self->{'userlist'} if defined $self->{'userlist'};
    >
    > my $dbh = Bugzilla->dbh;
    >
    > my $query = "SELECT DISTINCT login_name, realname,";
    > if (&::Param('usevisibilitygroups')) {
    > $query .= " COUNT(group_id) ";
    > } else {
    > $query .= " 1 ";
    > }
    > $query .= "FROM profiles ";
    >
    >
    >
    > if (&::Param('usevisibilitygroups')) {
    >
    > $query .= "LEFT JOIN user_group_map " .
    > "ON user_group_map.user_id = userid AND isbless = 0 " .
    > #"AND group_id= " . &get_group_id;
    >
    >
    >
    > }
    > $query .= " WHERE disabledtext = ''";
    > $query .= $dbh->sql_group_by('userid', 'login_name, realname');
    >
    > my $sth = $dbh->prepare($query);
    > $sth->execute;
    >
    > my @userlist;
    > while (my($login, $name, $visible) = $sth->fetchrow_array) {
    > push @userlist, {
    > login => $login,
    > identity => $name ? "$name <$login>" : $login,
    > identity2 => $name ? "$name" : $login,
    > visible => $visible,
    > };
    > }
    > @userlist = sort { lc $$a{'identity'} cmp lc $$b{'identity'} }
    > @userlist;
    >
    > $self->{'userlist'} = \@userlist;
    > return $self->{'userlist'};
    > }
    >
    >
    >


    Well after taking a look at enter_bug.cgi, I am able to modify this
    code. I also tested it in phpmyadmin to make sure I'd get the correct
    results. But now if I log in as a regualar user, I don't see a list of
    group members for that particular product. This list is null. Any ideas
    folks?

    ******** enter_bug.cgi?product="test"

    my $grouplist = $dbh->selectall_arrayref(
    q{SELECT DISTINCT groups.id, groups.name,
    groups.description, membercontrol, othercontrol
    FROM groups
    LEFT JOIN group_control_map
    ON group_id = id AND product_id = ?
    WHERE isbuggroup != 0 AND isactive != 0 AND name = ?
    ORDER BY description}, undef, $product->id,
    $product->name);

  4. Re: Assign to and CC fields

    Max Kanat-Alexander wrote:
    > On Fri, 6 Jul 2007 15:30:19 -0500 "Nathan Striedinger"
    > wrote:
    >> How can I configure bugzilla to limit the Assign to: field and CC
    >> field to the product they are entering the bug for.
    >>
    >> For example, if a user is entering bugs for a product called "test,"
    >> I want them to ONLY see members in the group "test" for CC AND Assign
    >> to:

    >
    > That's what the "usevisibilitygroups" parameter is for.
    >
    > -Max


    I have that turned on in "parameters." If I create a user that is in
    more that one group and I enter a bug for a particular product, I still
    see folks in the other groups? THANKS for your help!

    Nate

  5. Re: Assign to and CC fields

    On Sat, 07 Jul 2007 11:41:45 -0500 Nathan
    wrote:
    > I have that turned on in "parameters." If I create a user that is in
    > more that one group and I enter a bug for a particular product, I
    > still see folks in the other groups? THANKS for your help!


    Have you actually looked at the Group control panel and set the
    Visibility check boxes correctly?

    -Max
    --
    http://www.everythingsolved.com/
    Competent, Friendly Bugzilla Services. And Everything Else, too.

  6. Re: Assign to and CC fields

    Max Kanat-Alexander wrote:
    > On Sat, 07 Jul 2007 11:41:45 -0500 Nathan
    > wrote:
    >> I have that turned on in "parameters." If I create a user that is in
    >> more that one group and I enter a bug for a particular product, I
    >> still see folks in the other groups? THANKS for your help!

    >
    > Have you actually looked at the Group control panel and set the
    > Visibility check boxes correctly?
    >
    > -Max


    I believe so.

    >>> Edit Groups <<<


    under group, "test" - the group is visible to itself (only one check box
    on this line).

    under group "test2" - the group is is visible to itself (same only one
    check box).

    Is that correct to isolate groups, just have then visible to themselves?

    >>> Edit Group Access Controls <<<


    test: Mandatory/Mandatory, ENTRY
    test2: Mandatory/Mandatory, ENTRY

    >>> IN Configuration: Group Security <<<

    makeproductgroups -> ON
    useentrygroupdefault -> ON
    usevisibilitygroups -> ON
    strict_isolation -> ON


    But when I go to enter a bug for "test," I still see the members in
    test2 (in Assign to and CC)...

    thanks,

    Nathan


  7. Re: Assign to and CC fields


    Hi Nathan,

    I think you should change the functiom "get_userlist" in User.pm.
    Assign_to and CC fields are calling this function.

    Thanks,
    Kokul

    Nathan-54 wrote:
    >
    > Max Kanat-Alexander wrote:
    >> On Sat, 07 Jul 2007 11:41:45 -0500 Nathan
    >> wrote:
    >>> I have that turned on in "parameters." If I create a user that is in
    >>> more that one group and I enter a bug for a particular product, I
    >>> still see folks in the other groups? THANKS for your help!

    >>
    >> Have you actually looked at the Group control panel and set the
    >> Visibility check boxes correctly?
    >>
    >> -Max

    >
    > I believe so.
    >
    > >>> Edit Groups <<<

    >
    > under group, "test" - the group is visible to itself (only one check box
    > on this line).
    >
    > under group "test2" - the group is is visible to itself (same only one
    > check box).
    >
    > Is that correct to isolate groups, just have then visible to themselves?
    >
    > >>> Edit Group Access Controls <<<

    >
    > test: Mandatory/Mandatory, ENTRY
    > test2: Mandatory/Mandatory, ENTRY
    >
    > >>> IN Configuration: Group Security <<<

    > makeproductgroups -> ON
    > useentrygroupdefault -> ON
    > usevisibilitygroups -> ON
    > strict_isolation -> ON
    >
    >
    > But when I go to enter a bug for "test," I still see the members in
    > test2 (in Assign to and CC)...
    >
    > thanks,
    >
    > Nathan
    >
    > _______________________________________________
    > support-bugzilla mailing list
    > support-bugzilla@lists.mozilla.org
    > https://lists.mozilla.org/listinfo/support-bugzilla
    > PLEASE put support-bugzilla@lists.mozilla.org in the To: field when you
    > reply.
    >
    >


    --
    View this message in context: http://www.nabble.com/Assign-to-and-...html#a11558475
    Sent from the Bugzilla - Users mailing list archive at Nabble.com.


  8. Re: Assign to and CC fields

    I believe I've accomplished my goal of display group member ONLY for a
    product. Some code for those interested.

    -> add an arg to pass in
    ....

    [% FOREACH tmpuser = user.get_userlist(product.name) %]
    ....

    < Bugzilla/User.pm >
    sub get_group_id {

    my $product_name=shift;

    my $dbh = Bugzilla->dbh;
    my $query = "SELECT id FROM groups WHERE name = '" . $product_name .
    "'";
    my $sth = $dbh->prepare($query);
    $sth->execute;
    my $result = $sth->fetchrow_array();
    return ($result);

    }

    sub get_userlist {
    my ($self, $product_name) = @_; // add $product_name arg


    ....

    if (Bugzilla->params->{'usevisibilitygroups'}) {
    $query .= "LEFT JOIN user_group_map " .
    "ON user_group_map.user_id = userid AND isbless = 0 " .
    #"AND group_id IN(" . join(', ', (-1,
    @{$self->visible_groups_inherited})) . ")";
    "AND group_id= " . get_group_id($product_name); // use our
    sub to get $product_name

    }
    ...
    }





    "Kokul" wrote in message
    news:mailman.3958.1184241656.7364.support-bugzilla@lists.mozilla.org...
    >
    > Hi Nathan,
    >
    > I think you should change the functiom "get_userlist" in User.pm.
    > Assign_to and CC fields are calling this function.
    >
    > Thanks,
    > Kokul
    >
    > Nathan-54 wrote:
    >>
    >> Max Kanat-Alexander wrote:
    >>> On Sat, 07 Jul 2007 11:41:45 -0500 Nathan
    >>> wrote:
    >>>> I have that turned on in "parameters." If I create a user that is in
    >>>> more that one group and I enter a bug for a particular product, I
    >>>> still see folks in the other groups? THANKS for your help!
    >>>
    >>> Have you actually looked at the Group control panel and set the
    >>> Visibility check boxes correctly?
    >>>
    >>> -Max

    >>
    >> I believe so.
    >>
    >> >>> Edit Groups <<<

    >>
    >> under group, "test" - the group is visible to itself (only one check box
    >> on this line).
    >>
    >> under group "test2" - the group is is visible to itself (same only one
    >> check box).
    >>
    >> Is that correct to isolate groups, just have then visible to themselves?
    >>
    >> >>> Edit Group Access Controls <<<

    >>
    >> test: Mandatory/Mandatory, ENTRY
    >> test2: Mandatory/Mandatory, ENTRY
    >>
    >> >>> IN Configuration: Group Security <<<

    >> makeproductgroups -> ON
    >> useentrygroupdefault -> ON
    >> usevisibilitygroups -> ON
    >> strict_isolation -> ON
    >>
    >>
    >> But when I go to enter a bug for "test," I still see the members in
    >> test2 (in Assign to and CC)...
    >>
    >> thanks,
    >>
    >> Nathan
    >>
    >> _______________________________________________
    >> support-bugzilla mailing list
    >> support-bugzilla@lists.mozilla.org
    >> https://lists.mozilla.org/listinfo/support-bugzilla
    >> PLEASE put support-bugzilla@lists.mozilla.org in the To: field when you
    >> reply.
    >>
    >>

    >
    > --
    > View this message in context:
    > http://www.nabble.com/Assign-to-and-...html#a11558475
    > Sent from the Bugzilla - Users mailing list archive at Nabble.com.
    >




+ Reply to Thread