Commit 5581722e authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 312876: Make new products non-selectable until they have components - Patch…

Bug 312876: Make new products non-selectable until they have components - Patch by victory(_RSZ_) <bmo2007@rsz.jp> r=wurblzap a=myk
parent 84973470
...@@ -45,7 +45,7 @@ var tms = new Array(); ...@@ -45,7 +45,7 @@ var tms = new Array();
prods[[% nclass FILTER js %]] = [ prods[[% nclass FILTER js %]] = [
[% sep = '' %] [% sep = '' %]
[%- FOREACH item = c.products -%] [%- FOREACH item = c.products -%]
[%- IF user.can_see_product(item.name) -%] [%- IF user.can_see_product(item.name) && item.components.size -%]
[%- sep FILTER js %]'[% item.name FILTER js %]' [%- sep FILTER js %]'[% item.name FILTER js %]'
[%- sep = ',' -%] [%- sep = ',' -%]
[%- END -%] [%- END -%]
...@@ -58,7 +58,7 @@ var tms = new Array(); ...@@ -58,7 +58,7 @@ var tms = new Array();
[% n = 0 %] [% n = 0 %]
[% FOREACH p = product %] [% FOREACH p = product %]
[% IF Param('useclassification') %] [% IF Param('useclassification') && p.components.size %]
prods['[% p.name FILTER js %]'] = [% n %] prods['[% p.name FILTER js %]'] = [% n %]
[% END %] [% END %]
cpts[[% n %]] = [ cpts[[% n %]] = [
...@@ -193,9 +193,11 @@ function doOnSelectProduct(selectmode) { ...@@ -193,9 +193,11 @@ function doOnSelectProduct(selectmode) {
<select name="product" multiple="multiple" size="5" id="product" <select name="product" multiple="multiple" size="5" id="product"
onchange="doOnSelectProduct(2);"> onchange="doOnSelectProduct(2);">
[% FOREACH p = product %] [% FOREACH p = product %]
[% IF p.components.size %]
<option value="[% p.name FILTER html %]" <option value="[% p.name FILTER html %]"
[% " selected" IF lsearch(default.product, p.name) != -1 %]> [% " selected" IF lsearch(default.product, p.name) != -1 %]>
[% p.name FILTER html %]</option> [% p.name FILTER html %]</option>
[% END %]
[% END %] [% END %]
</select> </select>
</td> </td>
......
...@@ -74,7 +74,7 @@ for "crash secure SSL flash". ...@@ -74,7 +74,7 @@ for "crash secure SSL flash".
[% FOREACH c = classification %] [% FOREACH c = classification %]
<optgroup label="[% c.name FILTER html %]"> <optgroup label="[% c.name FILTER html %]">
[% FOREACH p = c.products %] [% FOREACH p = c.products %]
[% IF user.can_see_product(p.name) %] [% IF user.can_see_product(p.name) && p.components.size %]
<option value="[% p.name FILTER html %]" <option value="[% p.name FILTER html %]"
[% " selected" IF lsearch(default.product, p.name) != -1 %]> [% " selected" IF lsearch(default.product, p.name) != -1 %]>
[% p.name FILTER html %] [% p.name FILTER html %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment