Closed Bug 95967 Opened 23 years ago Closed 9 years ago

Mandatory fields

Categories

(Bugzilla :: Bugzilla-General, enhancement, P4)

2.12
enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: roni_abusch, Unassigned)

Details

Can I make another fields as mandatory? (not only the summary field)
I've hacked the code in my installation to do it.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
that doesn't mean we don't want to fix it in the distribution code, though.

Although since your patches probably didn't provide an option for it, and just
did it directly, they may be worth submitting anyway, just so we can see what
all had to be done.  We may have to change it to make it optional, but it'd
still be useful I think.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
I've just added simple code to two files:
To CGI.pl I've added in make_popup a new option that say "choose one" that 
returns nothing:
sub make_popup {
    my ($name,$src,$default,$listtype,$onchange) = (@_);
    my $popup = "<SELECT NAME=$name";
    if ($listtype > 0) {
        $popup .= " SIZE=5";
        if ($listtype == 2) {
            $popup .= " MULTIPLE";
        }
    }
    if (defined $onchange && $onchange ne "") {
        $popup .= " onchange=$onchange";
    }
    $popup .= "><OPTION VALUE='' SELECTED>Choose one";
    $popup .= make_options($src, "",
                                 ($listtype == 2 && $default ne ""));
    $popup .= "</SELECT>";
    return $popup;
}

And to enter_bug.cgi I've added alerts to find if the fields have been changed:
<INPUT TYPE=\"submit\" VALUE=\"    Commit    \" ONCLICK=\"
if (this.form.version.value =='') { alert('Please enter product version for 
this bug.'); return false;}
if (this.form.bug_severity.value =='') { alert('Please enter severity for this 
bug.'); return false;}
if (this.form.op_sys.value =='') { alert('Please enter operating system for 
this bug.'); return false;}
if (this.form.rep_platform.value =='') { alert('Please enter platform for this 
bug.'); return false;}
if (this.form.component.value =='') { alert('Please enter component for this 
bug.'); return false;}
if (this.form.priority.value =='') { alert('Please enter priority for this 
bug.'); return false;}
if (this.form.short_desc.value =='') { alert('Please enter a summary sentence 
for this bug.'); return false; }
if (this.form.comment.value =='') { alert('Please enter a description for this 
bug.'); return false; }\">
Moving to new Bugzilla product ...
Component: Bugzilla → Bugzilla-General
Priority: -- → P4
Product: Webtools → Bugzilla
Target Milestone: --- → Future
Version: Bugzilla 2.12 → 2.12
.
Severity: major → enhancement
Status: REOPENED → NEW
OS: Windows 2000 → All
Hardware: PC → All
Reassigning all of my "future" targetted bugs to indicate that I'm not presently
working on them, and someone else could feel free to work on them. (sorry for
the spam if you got this twice, it didn't take right the first time)
Assignee: justdave → nobody
I think that this would be very good in combination with the custom fields
described in bug 91037.
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: Future → ---
Assignee: nobody → general
Custom fields can be marked as mandatory. Hardcoded fields always have values, so mandatory doesn't mean anything.
Status: NEW → RESOLVED
Closed: 23 years ago9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.