X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fedit.html;h=f003454342d34c369ec6d4129696678da95735d8;hb=98652f79fc4fff916a46bc94d6301b24bcd13df3;hp=73faad4c057c0ef5bbb9c5c54a20f09fd3c0606c;hpb=f62a68016f32b443084705b0e7851497b308f81d;p=freeside.git
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 73faad4c0..f00345434 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -108,6 +108,9 @@ Example:
# 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,
@@ -116,6 +119,9 @@ Example:
# 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
###
@@ -190,7 +196,7 @@ Example:
&>
%doc>
-
+%
% unless ( $opt{embed} ) {
%
% my $title = $opt{action}. ' '. ( $opt{name} || $opt{'name_singular'} );
@@ -207,13 +213,13 @@ Example:
% "View all $items" => $viewall_url,
% );
% }
-
- <% include('/elements/header'. ( $opt{popup} ? '-popup' : '' ). '.html',
+%
+<% include('/elements/header'. ( $opt{popup} ? '-popup' : '' ). '.html',
$title,
include( '/elements/menubar.html', @menubar ),
$opt{'body_etc'},
)
- %>
+%>
<% defined($opt{'html_init'})
? ( ref($opt{'html_init'})
@@ -236,13 +242,17 @@ Example:
-
- <% ( $opt{labels} && exists $opt{labels}->{$pkey} )
- ? $opt{labels}->{$pkey}
- : $pkey
- %>
-
- #<% ( !$clone && $object->$pkey() ) || "(NEW)" %>
+% unless ( $opt{'no_pkey_display'} ) {
+
+
+ <% ( $opt{labels} && exists $opt{labels}->{$pkey} )
+ ? $opt{labels}->{$pkey}
+ : $pkey
+ %>
+
+ #<% ( !$clone && $object->$pkey() ) || "(NEW)" %>
+
+% }
% }
@@ -282,6 +292,7 @@ Example:
% #text and derivitives
% 'size' => $f->{'size'},
% 'maxlength' => $f->{'maxlength'},
+% 'prefix' => $f->{'prefix'},
% 'postfix' => $f->{'postfix'},
%
% #textarea
@@ -292,6 +303,9 @@ Example:
% #& deprecated weird value hashref used only by reason.html
% 'value' => $f->{'value'},
%
+% #fixed
+% 'noescape' => $f->{'noescape'},
+%
% #select(-*)
% 'options' => $f->{'options'},
% 'labels' => $f->{'labels'},
@@ -308,6 +322,10 @@ Example:
%
% #umm. for select-agent_types at least
% 'disabled' => $f->{'disabled'},
+% 'fixed' => $f->{'fixed'},
+%
+% #umm. for select-agent_types at least
+% 'label_callback'=> $f->{'label_callback'},
%
% #any?
% 'colspan' => $f->{'colspan'},
@@ -317,14 +335,16 @@ Example:
% $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 ), # 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
@@ -513,7 +533,7 @@ Example:
% 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';
@@ -645,7 +665,7 @@ Example:
widget_cell.style.borderTop = "1px solid black";
widget_cell.style.paddingTop = "3px";
- widget_cell.colSpan = "<% $f->{'colspan'} || 1 %>"
+ widget_cell.colSpan = "<% $f->{'colspan'} || 1 %>";
widget_cell.innerHTML = newrow;
@@ -751,13 +771,32 @@ Example:
- "
- >
+% unless ($opt{'no_submit'}) {
+ "
+ >
+% 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);
+
+
+% }
+% }