/ipmasq/

e='text/css' href='/cgit-local/local.css'/>
summaryrefslogtreecommitdiff
path: root/scripts/vendor.pl
blob: c8c21503a1c84f6ae72c9cdf63659a654ac800ad (plain)
  1. =pod
  2. =head1 NAME
  3. LedgerSMB::Scripts::Vendor - LedgerSMB class defining the Controller
  4. functions, template instantiation and rendering for Vendor editing and display.
  5. =head1 SYOPSIS
  6. This module is the UI controller for the Vendor DB access; it provides the
  7. View interface, as well as defines the Save Vendor.
  8. Save vendor will update or create as needed.
  9. =head1 METHODS
  10. =cut
  11. package LedgerSMB::Scripts::Vendor;
  12. use LedgerSMB::Template;
  13. use LedgerSMB::DBObject::Vendor;
  14. =pod
  15. =over
  16. =item get($self, $request, $user)
  17. Requires form var: id
  18. Extracts a single Vendor from the database, using its company ID as the primary
  19. point of uniqueness. Shows (appropriate to user privileges) and allows editing
  20. of the vendor informations.
  21. =back
  22. =cut
  23. sub get {
  24. my ($class, $request) = @_;
  25. my $vendor = LedgerSMB::DBObject::Vendor->new(base => $request, copy => 'all');
  26. my $result = $vendor->get($vendor->{id});
  27. my $template = LedgerSMB::Template->new( user => $user,
  28. template => 'vendor.html', language => $user->{language},
  29. format => 'html');
  30. $template->render($results);
  31. }
  32. =pod
  33. =over
  34. =item search($self, $request, $user)
  35. Requires form var: search_pattern