rt# 74031 Implement forms for editing real estate inventory
[freeside.git] / httemplate / edit / realestate_unit.html
diff --git a/httemplate/edit/realestate_unit.html b/httemplate/edit/realestate_unit.html
new file mode 100644 (file)
index 0000000..b8bf1fa
--- /dev/null
@@ -0,0 +1,49 @@
+<% include( 'elements/edit.html',
+ 'name_singular' => 'Real Estate Unit',
+ 'table'  => 'realestate_unit',
+
+ 'labels' => {
+    realestatenum  => 'Ref No',
+    unit_title => 'Unit Title',
+    agentnum => 'Agent',
+    realestatelocnum => 'Location',
+  },
+  'fields' => [
+    { field => 'realestatenum', type => 'hidden' },
+    { field => 'custnum', type => 'hidden' },
+
+    { field => 'unit_title',
+      type=>'text',
+      size => 40,
+    },
+    { field => 'realestatelocnum',
+      type => 'select-realestate_location',
+
+      # possible todo:
+      # I'd like to have this field disabled for editing on existing records,
+      # and only show the full selectbox for new records.
+
+    },
+    { field => 'agentnum',
+      type => 'select-agent',
+    },
+    { field => 'disabled',
+      type=>'checkbox',
+      value=>'Y'
+    },
+  ],
+
+ 'viewall_dir' => 'browse',
+ 'agent_virt' => 1,
+)
+%>
+
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+die("access denied")
+  unless $curuser->access_right('Edit inventory')
+      || $curuser->access_right('Edit global inventory')
+      || $curuser->access_right('Configuration');
+
+</%init>