Fix selection of cats

This commit is contained in:
Miles Lott 2001-03-29 15:40:10 +00:00
parent 8f786be9f5
commit c4ebab9d28
8 changed files with 8 additions and 32 deletions

View File

@ -34,34 +34,25 @@
}
// Return a select form element with the categories option dialog in it
function cat_option($cat_id='',$name='ncat_id',$notall=False,$java=False) {
function cat_option($cat_id='',$notall=False,$java=True) {
global $phpgw_info;
if ($java) {
$jselect = " onChange=\"this.form.submit();\"";
$name='cat_id';
//$jsubopen = "<noscript>";
//$jsubclose = "</noscript>";
}
// Setup all and none first
$cats_link = "<select name=\"".$name."\"$jselect>";
$cats_link = "\n<select name=\"cat_id\"$jselect>\n";
if (!$notall) {
$cats_link .= "<option value =\"all\"";
$cats_link .= "<option value=\"\"";
if ($cat_id=="all") {
$cats_link .= " selected";
}
$cats_link .= ">".lang("all");
$cats_link .= "></option>".lang("all")."\n";
}
$cats_link .= "<option value =\"0\"";
if (!$cat_id) {
$cats_link .= " selected";
}
$cats_link .= ">".lang("none");
// Get global and app-specific category listings
$cats = CreateObject('phpgwapi.categories');
$cats_link .= $cats->formated_list('select','all',$cat_id,True);
$cats_link .= '</select>';
$cats_link .= '</select>'."\n";
return $cats_link;
}
@ -264,7 +255,7 @@
$cat_id = $fields["cat_id"];
}
$cats_link = cat_option($cat_id,'ncat_id',True);
$cats_link = cat_option($cat_id,True);
if ($access == 'private') {
$access_check = ' checked';

View File

@ -24,7 +24,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="ncat_id" value="{cat_id}">
<input type="submit" name="Cancel" value="{lang_cancel}">
</form>
</td>

View File

@ -1,11 +1,11 @@
<!-- BEGIN edit -->
<input type="hidden" name="ab_id" value="{ab_id}">
<input type="hidden" name="sort" value="{sort}">
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
<TABLE border="0" cellPadding="1" cellSpacing="1" width="95%">
<TBODY>
<tr>
@ -19,7 +19,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="ncat_id" value="{cat_id}">
<input type="submit" name="cancel" value="{lang_cancel}"></form>
</TD>
<TD align="right">
@ -30,7 +29,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
{delete_button}
</form>
</TD>

View File

@ -24,7 +24,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
</FORM>
</TD>
</TR>
@ -36,7 +35,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="ncat_id" value="{cat_id}">
<INPUT type="submit" name="Cancel" value="{lang_cancel}">
</FORM>
</TD>

View File

@ -9,7 +9,6 @@
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
<input type="submit" name="Add" value="{lang_add}">
</div>
</td>
@ -20,7 +19,6 @@
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
<input type="submit" name="AddVcard" value="{lang_addvcard}">
</div>
</td>
@ -36,7 +34,6 @@
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
<input type="submit" name="Import" value="{lang_import}">
</form>
</div>
@ -48,7 +45,6 @@
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
<input type="submit" name="Export" value="{lang_export}">
</form>
</div>

View File

@ -5,13 +5,12 @@
<br>{searchreturn}
<form action="{cats_url}" method="POST">
{cats}{cats_link}
<input type="hidden" name="cat_id" value="{cat_id}">
<input type="hidden" name="sort" value="{sort}">
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="submit" name="cats" value="{lang_cats}">
<noscript><input type="submit" name="cats" value="{lang_cats}"></noscript>
</form>
{search_filter}

View File

@ -37,7 +37,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
</FORM></TD>
</TR>
</TABLE>
@ -52,7 +51,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="query" value="{query}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="ncat_id" value="{cat_id}">
<input type="submit" name="Cancel" value="{lang_cancel}">
</form>
</div>

View File

@ -22,7 +22,6 @@
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="fields" value="{copy_fields}">
<input type="hidden" name="cat_id" value="{cat_id}">
<input type="submit" name="submit" value="{lang_copy}">
</form>
</TD>
@ -33,7 +32,6 @@
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="cat_id" value="{cat_id}">
<input type="submit" name="VCardform" value="{lang_vcard}">
</form>
</TD>
@ -43,7 +41,6 @@
<input type="hidden" name="order" value="{order}">
<input type="hidden" name="filter" value="{filter}">
<input type="hidden" name="start" value="{start}">
<input type="hidden" name="ncat_id" value="{cat_id}">
<input type="submit" name="Doneform" value="{lang_done}">
</form>
</TD>