# overrides default popurl(1)."process/$table.html"
'post_url' => popurl(1).'process/something',
+ # optional link to delete this object; primary key will be appended
+ 'delete_url' => $p.'misc/delete-something.html?',
+
#we're in a popup (no title/menu/searchboxes)
'popup' => 1,
# display of primary key, no submit button, no html_foot, no footer)
'embed' => $object, #need to pass the object
+ #don't show the primary key label and value
+ 'no_pkey_display' => 1,
+
###
# HTML callbacks
###
% );
% }
+
<% include('/elements/header'. ( $opt{popup} ? '-popup' : '' ). '.html',
$title,
include( '/elements/menubar.html', @menubar ),
<INPUT TYPE="hidden" NAME="svcdb" VALUE="<% $table %>">
<INPUT TYPE="hidden" NAME="<% $pkey %>" VALUE="<% $clone ? '' : $object->$pkey() %>">
- <FONT SIZE="+1"><B>
- <% ( $opt{labels} && exists $opt{labels}->{$pkey} )
- ? $opt{labels}->{$pkey}
- : $pkey
- %>
- </B></FONT>
- #<% ( !$clone && $object->$pkey() ) || "(NEW)" %>
+% unless ( $opt{'no_pkey_display'} ) {
+
+ <FONT SIZE="+1"><B>
+ <% ( $opt{labels} && exists $opt{labels}->{$pkey} )
+ ? $opt{labels}->{$pkey}
+ : $pkey
+ %>
+ </B></FONT>
+ #<% ( !$clone && $object->$pkey() ) || "(NEW)" %>
+
+% }
% }
% $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
% qw( js_only html_only select_only layers_only cell_style ),#selectlayers,?
% qw( empty_label ), # select-*
-% qw( value_col compare_sub ), # select-table
+% qw( value_col compare_sub order_by ), # select-table
% qw( table name_col ), #(select,checkboxes)-table
% qw( target_table link_table ), #checkboxes-table
% qw( hashref agent_virt agent_null agent_null_right ),#*-table
% qw( formatted_value ), #fixed
% qw( country ), #select-country
-% qw( width height ), #htmlarea
+% qw( width height config ), #htmlarea
% qw( alt_format ), #select-cust_location
% qw( classnum ), # select-inventory_item
+% qw( aligned ), # columnstart
% ;
%
% #select-table
% if ( $f->{curr_value_callback} ) {
% $curr_value = &{ $f->{curr_value_callback} }( $cgi, $object, $field ),
% } else {
-% $curr_value = $object->$field();
+% $curr_value = $object->$field() if $field;
% }
% $curr_value = &{ $opt{'value_callback'} }( $f->{'field'}, $curr_value )
% if $opt{'value_callback'} && $mode ne 'error';
: "Add ". ($opt{'name'} || $opt{'name_singular'})
%>"
>
+% if ( $opt{'delete_url'} and $object->get($pkey) ) {
+% my $delete_msg = 'Delete this '.
+% ($opt{'name_singular'} || $opt{'name'});
+% my $delete_url = $opt{'delete_url'};
+% $delete_url .= '?' unless $delete_url =~ /\?/;
+% $delete_url .= $object->get($pkey);
+ <SCRIPT TYPE="text/javascript">
+ function confirm_delete() {
+ if(confirm(<% $delete_msg . '?' |js_string %>)) {
+ window.location.href = <% $delete_url |js_string %>;
+ }
+ }
+ </SCRIPT>
+ <INPUT TYPE = "button"
+ VALUE = "<% $delete_msg |h %>"
+ onclick = "confirm_delete()">
+% }
% }
</FORM>