thanks, you are a true guru
final code which works global: <%category_exclude%> placed in include_form
Here is the global:
sub {
my $catid = shift;
my $in_id = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
my $table = $DB->table('Category');
my $return_cats;
$table->select_options ('ORDER BY Full_Name ASC');
my $cond = GT::SQL::Condition->new('canAdd','=','Yes');
my $sth = $table->select( $cond );
my $return_cats = qq|<select name="CatLinks.CategoryID">|;
while (my $hit = $sth->fetchrow_hashref) {
$return_cats .= "<option value=\"" . $hit->{ID} . "\"";
if ($in_id == $hit->{ID}) { $return_cats .= "selected=\"selected\""; }
$return_cats .= ">" . $hit->{Full_Name} . "</option>";
}
$return_cats .= '</select>';
return $return_cats;
}
------------------------------------
you must add a column to Category table named 'canAdd' ENUM(Yes,No) with default 'yes'
i would post it in resource, but i don't know how
thanks
final code which works global: <%category_exclude%> placed in include_form
Here is the global:
sub {
my $catid = shift;
my $in_id = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
my $table = $DB->table('Category');
my $return_cats;
$table->select_options ('ORDER BY Full_Name ASC');
my $cond = GT::SQL::Condition->new('canAdd','=','Yes');
my $sth = $table->select( $cond );
my $return_cats = qq|<select name="CatLinks.CategoryID">|;
while (my $hit = $sth->fetchrow_hashref) {
$return_cats .= "<option value=\"" . $hit->{ID} . "\"";
if ($in_id == $hit->{ID}) { $return_cats .= "selected=\"selected\""; }
$return_cats .= ">" . $hit->{Full_Name} . "</option>";
}
$return_cats .= '</select>';
return $return_cats;
}
------------------------------------
you must add a column to Category table named 'canAdd' ENUM(Yes,No) with default 'yes'
i would post it in resource, but i don't know how
thanks