Permalink
Browse files

The whirlwind swept through. 8-\

Highlights;

    - Added some of the formatting changes suggested by Keith
      Oberlin. (Thanks, Keith!)
    - File transfer stuff works.
    - Added page edit.
    - Modified page layout, still doesn't work, will soon.
    - Quicklinks size changes based on browser.
    - Added ui_download action to catalog_after.cfg
    - Changed all tallyman things to interchange.
    - order_view.html bug fixes found by Bob Jordan.
    - made rotate-file tag work for page upload backup.
    - Added RouteDatabase for high-volume vendor routes.
    - Many, many, minor changes.
  • Loading branch information...
1 parent 483d2a2 commit efe1bb190bd9b0d73514665167beebf206d8bbf9 @perusionmike perusionmike committed Jul 11, 2000
Showing with 238 additions and 19,328 deletions.
  1. +33 −23 MANIFEST
  2. +2 −2 Makefile.PL
  3. +4 −0 dist/barry/catalog.cfg
  4. +7 −0 dist/barry/config/logobar
  5. +147 −0 dist/barry/etc/log_entry
  6. +2 −0 dist/barry/etc/log_transaction
  7. +2 −2 dist/barry/etc/profiles.login
  8. BIN dist/barry/images/admin/down.gif
  9. BIN dist/barry/images/admin/folder.gif
  10. BIN dist/barry/images/admin/folder.open.gif
  11. BIN dist/barry/images/admin/index.gif
  12. BIN dist/barry/images/admin/up.gif
  13. +1 −1 dist/barry/pages/contact.us.html
  14. 0 dist/barry/pages/reconfig/.access
  15. +0 −5 dist/barry/pages/reconfig/.access_gate
  16. +0 −63 dist/barry/pages/reconfig/do_download.html
  17. +0 −95 dist/barry/pages/reconfig/do_upload.html
  18. +0 −16 dist/barry/pages/reconfig/reconfig.html
  19. +0 −110 dist/barry/pages/reconfig/upload.html
  20. +7 −3 dist/barry/pages/splash.html
  21. +1 −0 dist/barry/products/route.txt
  22. +22 −0 dist/catalog_after.cfg
  23. +10 −3 dist/catalog_before.cfg
  24. +0 −6 dist/lib/MiniMate/.cvsignore
  25. +0 −1,232 dist/lib/MiniMate/CfgMgr.pm
  26. +0 −505 dist/lib/MiniMate/LIESMICH
  27. +0 −491 dist/lib/MiniMate/README
  28. +0 −1,145 dist/lib/MiniMate/locales/de_DE.cfg
  29. +0 −1,143 dist/lib/MiniMate/locales/fr_FR.cfg
  30. +0 −1,143 dist/lib/MiniMate/locales/it_IT.cfg
  31. +0 −1,003 dist/lib/MiniMate/locales/pt_BR.cfg
  32. +0 −1,143 dist/lib/MiniMate/locales/ru_RU.cfg
  33. +0 −58 dist/lib/MiniMate/minimate.cfg
  34. +0 −1,376 dist/lib/MiniMate/mmtags.cfg
  35. +0 −137 dist/lib/MiniMate/owner/config/add_field.html
  36. +0 −4 dist/lib/MiniMate/owner/config/catalog.cfg.html
  37. +0 −279 dist/lib/MiniMate/owner/config/db_column.html
  38. +0 −199 dist/lib/MiniMate/owner/config/db_configure.html
  39. +0 −140 dist/lib/MiniMate/owner/config/db_export.html
  40. +0 −102 dist/lib/MiniMate/owner/config/db_journal.html
  41. +0 −33 dist/lib/MiniMate/owner/config/db_limit.html
  42. +0 −125 dist/lib/MiniMate/owner/config/db_upload.html
  43. +0 −146 dist/lib/MiniMate/owner/config/dbedit.html
  44. +0 −84 dist/lib/MiniMate/owner/config/delete_field.html
  45. +0 −79 dist/lib/MiniMate/owner/config/directive.html
  46. +0 −80 dist/lib/MiniMate/owner/config/do_download.html
  47. +0 −70 dist/lib/MiniMate/owner/config/do_upload.html
  48. +0 −44 dist/lib/MiniMate/owner/config/do_upload_page.html
  49. +0 −63 dist/lib/MiniMate/owner/config/do_view.html
  50. +0 −297 dist/lib/MiniMate/owner/config/edit_record.html
  51. +0 −75 dist/lib/MiniMate/owner/config/edit_record_arg.html
  52. +0 −90 dist/lib/MiniMate/owner/config/export.html
  53. +0 −12 dist/lib/MiniMate/owner/config/fmenu.html
  54. +0 −406 dist/lib/MiniMate/owner/config/format_meta.html
  55. +0 −75 dist/lib/MiniMate/owner/config/fr_list.html
  56. +0 −114 dist/lib/MiniMate/owner/config/fr_menu.html
  57. +0 −38 dist/lib/MiniMate/owner/config/fr_select.html
  58. +0 −4 dist/lib/MiniMate/owner/config/getfile.html
  59. +0 −67 dist/lib/MiniMate/owner/config/key_violation.html
  60. +0 −13 dist/lib/MiniMate/owner/config/last_search.html
  61. +0 −79 dist/lib/MiniMate/owner/config/login.html
  62. +0 −136 dist/lib/MiniMate/owner/config/menu.html
  63. +0 −1 dist/lib/MiniMate/owner/config/noframe.html
  64. +0 −3 dist/lib/MiniMate/owner/config/nothing.html
  65. +0 −33 dist/lib/MiniMate/owner/config/reconfig.html
  66. +0 −463 dist/lib/MiniMate/owner/config/report.html
  67. +0 −376 dist/lib/MiniMate/owner/config/report_results.html
  68. +0 −49 dist/lib/MiniMate/owner/config/save_report.html
  69. +0 −18 dist/lib/MiniMate/owner/config/seefile.html
  70. +0 −482 dist/lib/MiniMate/owner/config/setup_acl.html
  71. +0 −179 dist/lib/MiniMate/owner/config/spread.html
  72. +0 −180 dist/lib/MiniMate/owner/config/spread_results.html
  73. +0 −67 dist/lib/MiniMate/owner/config/table_violation.html
  74. +0 −66 dist/lib/MiniMate/owner/config/upload_config.html
  75. +0 −97 dist/lib/MiniMate/owner/config/upload_other.html
  76. +0 −129 dist/lib/MiniMate/owner/config/upload_pages.html
  77. +0 −66 dist/lib/MiniMate/owner/config/violation.html
  78. +0 −3 dist/lib/MiniMate/owner/special/naughty.html
  79. +0 −137 dist/lib/MiniMate/pages/config/add_field.html
  80. +0 −4 dist/lib/MiniMate/pages/config/catalog.cfg.html
  81. +0 −279 dist/lib/MiniMate/pages/config/db_column.html
  82. +0 −199 dist/lib/MiniMate/pages/config/db_configure.html
  83. +0 −140 dist/lib/MiniMate/pages/config/db_export.html
  84. +0 −102 dist/lib/MiniMate/pages/config/db_journal.html
  85. +0 −33 dist/lib/MiniMate/pages/config/db_limit.html
  86. +0 −125 dist/lib/MiniMate/pages/config/db_upload.html
  87. +0 −146 dist/lib/MiniMate/pages/config/dbedit.html
  88. +0 −84 dist/lib/MiniMate/pages/config/delete_field.html
  89. +0 −79 dist/lib/MiniMate/pages/config/directive.html
  90. +0 −80 dist/lib/MiniMate/pages/config/do_download.html
  91. +0 −70 dist/lib/MiniMate/pages/config/do_upload.html
  92. +0 −63 dist/lib/MiniMate/pages/config/do_view.html
  93. +0 −297 dist/lib/MiniMate/pages/config/edit_record.html
  94. +0 −75 dist/lib/MiniMate/pages/config/edit_record_arg.html
  95. +0 −90 dist/lib/MiniMate/pages/config/export.html
  96. +0 −12 dist/lib/MiniMate/pages/config/fmenu.html
  97. +0 −406 dist/lib/MiniMate/pages/config/format_meta.html
  98. +0 −75 dist/lib/MiniMate/pages/config/fr_list.html
  99. +0 −114 dist/lib/MiniMate/pages/config/fr_menu.html
  100. +0 −38 dist/lib/MiniMate/pages/config/fr_select.html
  101. +0 −4 dist/lib/MiniMate/pages/config/getfile.html
  102. +0 −67 dist/lib/MiniMate/pages/config/key_violation.html
  103. +0 −13 dist/lib/MiniMate/pages/config/last_search.html
  104. +0 −79 dist/lib/MiniMate/pages/config/login.html
  105. +0 −139 dist/lib/MiniMate/pages/config/menu.html
  106. +0 −1 dist/lib/MiniMate/pages/config/noframe.html
  107. +0 −3 dist/lib/MiniMate/pages/config/nothing.html
  108. +0 −33 dist/lib/MiniMate/pages/config/reconfig.html
  109. +0 −463 dist/lib/MiniMate/pages/config/report.html
  110. +0 −376 dist/lib/MiniMate/pages/config/report_results.html
  111. +0 −49 dist/lib/MiniMate/pages/config/save_report.html
  112. +0 −18 dist/lib/MiniMate/pages/config/seefile.html
  113. +0 −485 dist/lib/MiniMate/pages/config/setup_acl.html
  114. +0 −179 dist/lib/MiniMate/pages/config/spread.html
Sorry, we could not display the entire diff because it was too big.
View
56 MANIFEST
@@ -22,6 +22,7 @@ dist/barry/config/no_right
dist/barry/config/precopy_commands
dist/barry/config/rightside
dist/barry/config/standard_defs
+dist/barry/etc/log_entry
dist/barry/etc/log_transaction
dist/barry/etc/mail_receipt
dist/barry/etc/profiles.login
@@ -50,6 +51,9 @@ dist/barry/images/admin/coinlogo.jpg
dist/barry/images/admin/curve_left.gif
dist/barry/images/admin/curve_right.gif
dist/barry/images/admin/delete.gif
+dist/barry/images/admin/down.gif
+dist/barry/images/admin/folder.gif
+dist/barry/images/admin/folder.open.gif
dist/barry/images/admin/greendot.gif
dist/barry/images/admin/icon_config.gif
dist/barry/images/admin/icon_help.gif
@@ -59,11 +63,13 @@ dist/barry/images/admin/icon_pages.gif
dist/barry/images/admin/icon_regen.gif
dist/barry/images/admin/icon_regen_anim.gif
dist/barry/images/admin/icon_stats.gif
+dist/barry/images/admin/index.gif
dist/barry/images/admin/plus.gif
dist/barry/images/admin/red_logo.gif
dist/barry/images/admin/reddot.gif
dist/barry/images/admin/tallyman_logo.gif
dist/barry/images/admin/tan_logo.gif
+dist/barry/images/admin/up.gif
dist/barry/images/admin/widgets.gif
dist/barry/images/aspen.gif
dist/barry/images/avid.arch50.jpg
@@ -210,7 +216,6 @@ dist/barry/pages/special/needfield.html
dist/barry/pages/splash.html
dist/barry/pages/srchform.html
dist/barry/pages/subcat.html
-dist/barry/pages/view_page.html
dist/barry/pgsql/area.pgsql
dist/barry/pgsql/cat.pgsql
dist/barry/pgsql/country.pgsql
@@ -242,6 +247,7 @@ dist/barry/products/mv_metadata.asc
dist/barry/products/orderline.txt
dist/barry/products/pricing.txt
dist/barry/products/products.txt
+dist/barry/products/route.txt
dist/barry/products/salestax.asc
dist/barry/products/shipping.asc
dist/barry/products/state.txt
@@ -391,36 +397,39 @@ dist/lib/UI/pages/admin/access_permissions.html
dist/lib/UI/pages/admin/advanced.html
dist/lib/UI/pages/admin/affiliates.html
dist/lib/UI/pages/admin/button_builder.html
+dist/lib/UI/pages/admin/change_t.pl
dist/lib/UI/pages/admin/config.html
dist/lib/UI/pages/admin/customer.html
dist/lib/UI/pages/admin/customer_change_pass.html
dist/lib/UI/pages/admin/customer_view.html
dist/lib/UI/pages/admin/dbdownload.html
+dist/lib/UI/pages/admin/do_upload.html
+dist/lib/UI/pages/admin/do_upload_page.html
+dist/lib/UI/pages/admin/do_view.html
+dist/lib/UI/pages/admin/entry.html
+dist/lib/UI/pages/admin/entry_select.html
dist/lib/UI/pages/admin/env_vars.html
dist/lib/UI/pages/admin/error.html
dist/lib/UI/pages/admin/error_item.html
dist/lib/UI/pages/admin/export_table.html
dist/lib/UI/pages/admin/flex_editor.html
dist/lib/UI/pages/admin/flex_select.html
-dist/lib/UI/pages/admin/footer
dist/lib/UI/pages/admin/format_meta.html
dist/lib/UI/pages/admin/genconfig.html
dist/lib/UI/pages/admin/genreport.html
dist/lib/UI/pages/admin/genstats.html
dist/lib/UI/pages/admin/gentable.html
+dist/lib/UI/pages/admin/genupload.html
dist/lib/UI/pages/admin/genxport.html
dist/lib/UI/pages/admin/group.html
dist/lib/UI/pages/admin/group_edit.html
-dist/lib/UI/pages/admin/header
dist/lib/UI/pages/admin/import_table.html
dist/lib/UI/pages/admin/index.html
dist/lib/UI/pages/admin/item.html
dist/lib/UI/pages/admin/item_edit.html
dist/lib/UI/pages/admin/layout.html
dist/lib/UI/pages/admin/layout_create.html
dist/lib/UI/pages/admin/layout_subcat.html
-dist/lib/UI/pages/admin/layoutdownload.html
-dist/lib/UI/pages/admin/layoutupload.html
dist/lib/UI/pages/admin/login.html
dist/lib/UI/pages/admin/logout.html
dist/lib/UI/pages/admin/matrix_create.html
@@ -429,6 +438,9 @@ dist/lib/UI/pages/admin/order.html
dist/lib/UI/pages/admin/order_view.html
dist/lib/UI/pages/admin/orderstats.html
dist/lib/UI/pages/admin/page.html
+dist/lib/UI/pages/admin/page_edit.html
+dist/lib/UI/pages/admin/page_preview.html
+dist/lib/UI/pages/admin/page_save.html
dist/lib/UI/pages/admin/payment.html
dist/lib/UI/pages/admin/quicklinks.html
dist/lib/UI/pages/admin/reconfig.html
@@ -451,6 +463,10 @@ dist/lib/UI/pages/admin/spread.html
dist/lib/UI/pages/admin/table_editor.html
dist/lib/UI/pages/admin/tax.html
dist/lib/UI/pages/admin/trafficstats.html
+dist/lib/UI/pages/admin/upload_config.html
+dist/lib/UI/pages/admin/upload_file.html
+dist/lib/UI/pages/admin/upload_other.html
+dist/lib/UI/pages/admin/upload_pages.html
dist/lib/UI/pages/admin/user_change_pass.html
dist/lib/UI/pages/admin/user_edit.html
dist/lib/UI/profiles/login
@@ -459,6 +475,7 @@ dist/lib/UI/ui.cfg
dist/lib/UI/usertag/available_ups_internal
dist/lib/UI/usertag/available_www_shipping
dist/lib/UI/usertag/backup-database
+dist/lib/UI/usertag/backup_file
dist/lib/UI/usertag/base_url
dist/lib/UI/usertag/check_upload
dist/lib/UI/usertag/db_columns
@@ -470,6 +487,7 @@ dist/lib/UI/usertag/e
dist/lib/UI/usertag/export_database
dist/lib/UI/usertag/field_label
dist/lib/UI/usertag/file_info
+dist/lib/UI/usertag/file_navigator
dist/lib/UI/usertag/global_value
dist/lib/UI/usertag/grep_mm
dist/lib/UI/usertag/if_key_exists
@@ -487,6 +505,7 @@ dist/lib/UI/usertag/newer
dist/lib/UI/usertag/quick_table
dist/lib/UI/usertag/read_serial
dist/lib/UI/usertag/read_shipping
+dist/lib/UI/usertag/read_ui_template
dist/lib/UI/usertag/rotate_database
dist/lib/UI/usertag/rotate_file
dist/lib/UI/usertag/rotate_table
@@ -506,6 +525,7 @@ dist/lib/UI/usertag/write_relative_file
dist/lib/UI/usertag/write_shipping
dist/lib/UI/vars/UI_STD_DBEDIT_HEAD
dist/lib/UI/vars/UI_STD_DBEDIT_TABLE
+dist/lib/UI/vars/UI_STD_FILE_NAV
dist/lib/UI/vars/UI_STD_FOOTER
dist/lib/UI/vars/UI_STD_HEAD
dist/locale.error
@@ -540,6 +560,7 @@ dist/simple/config/yellow1/menubottom
dist/simple/config/yellow1/no_right
dist/simple/config/yellow1/only_logo
dist/simple/config/yellow1/rightside
+dist/simple/etc/log_entry
dist/simple/etc/log_transaction
dist/simple/etc/mail_receipt
dist/simple/etc/profiles.login
@@ -562,6 +583,9 @@ dist/simple/images/admin/coinlogo.jpg
dist/simple/images/admin/curve_left.gif
dist/simple/images/admin/curve_right.gif
dist/simple/images/admin/delete.gif
+dist/simple/images/admin/down.gif
+dist/simple/images/admin/folder.gif
+dist/simple/images/admin/folder.open.gif
dist/simple/images/admin/greendot.gif
dist/simple/images/admin/icon_config.gif
dist/simple/images/admin/icon_help.gif
@@ -571,11 +595,13 @@ dist/simple/images/admin/icon_pages.gif
dist/simple/images/admin/icon_regen.gif
dist/simple/images/admin/icon_regen_anim.gif
dist/simple/images/admin/icon_stats.gif
+dist/simple/images/admin/index.gif
dist/simple/images/admin/plus.gif
dist/simple/images/admin/red_logo.gif
dist/simple/images/admin/reddot.gif
dist/simple/images/admin/tallyman_logo.gif
dist/simple/images/admin/tan_logo.gif
+dist/simple/images/admin/up.gif
dist/simple/images/admin/widgets.gif
dist/simple/images/blue1/cart.png
dist/simple/images/blue1/go.png
@@ -646,17 +672,6 @@ dist/simple/pages/action/get_password.html
dist/simple/pages/browse.html
dist/simple/pages/browse1.html
dist/simple/pages/canceled.html
-dist/simple/pages/config/report_def/New.html
-dist/simple/pages/config/report_def/Orders%20by%20SKU%20-%20Short.html
-dist/simple/pages/config/report_def/Orders%20by%20SKU.html
-dist/simple/pages/config/report_def/Orders%20by%20amount.html
-dist/simple/pages/config/report_def/Products%20by%20category.html
-dist/simple/pages/config/report_def/Products%20to%20edit.html
-dist/simple/pages/config/reports/Orders%20by%20SKU%20-%20Short.html
-dist/simple/pages/config/reports/Orders%20by%20SKU.html
-dist/simple/pages/config/reports/Orders%20by%20amount.html
-dist/simple/pages/config/reports/Products%20by%20category.html
-dist/simple/pages/config/reports/Products%20to%20edit.html
dist/simple/pages/deliver.html
dist/simple/pages/examples/test_banner.html
dist/simple/pages/feedback.html
@@ -682,18 +697,11 @@ dist/simple/pages/privacy.html
dist/simple/pages/quantity.html
dist/simple/pages/query/check_orders.html
dist/simple/pages/query/order_detail.html
-dist/simple/pages/reconfig/.access
-dist/simple/pages/reconfig/.access_gate
-dist/simple/pages/reconfig/do_download.html
-dist/simple/pages/reconfig/do_upload.html
-dist/simple/pages/reconfig/reconfig.html
-dist/simple/pages/reconfig/upload.html
dist/simple/pages/results.html
dist/simple/pages/special/feedback.html
dist/simple/pages/special/needfield.html
dist/simple/pages/splash.html
dist/simple/pages/srchform.html
-dist/simple/pages/view_page.html
dist/simple/pgsql/area.pgsql
dist/simple/pgsql/cat.pgsql
dist/simple/pgsql/country.pgsql
@@ -725,6 +733,7 @@ dist/simple/products/mv_metadata.asc
dist/simple/products/orderline.txt
dist/simple/products/pricing.txt
dist/simple/products/products.txt
+dist/simple/products/route.txt
dist/simple/products/salestax.asc
dist/simple/products/shipping.asc
dist/simple/products/state.txt
@@ -766,6 +775,7 @@ dist/usertag/bar_button
dist/usertag/db_date
dist/usertag/email
dist/usertag/email_raw
+dist/usertag/fcounter
dist/usertag/loc
dist/usertag/rand
dist/usertag/reconfig
View
4 Makefile.PL
@@ -27,7 +27,7 @@ my $Prompt_sub;
my @mods_to_get;
my $Lock_troubles;
-$VERSION = '4.5.1';
+$VERSION = '4.5.2';
# See if we have the CPAN module
my $Cpan = 0;
@@ -718,7 +718,7 @@ else {
'pod/mvtags.pod' => 'blib/man3/mvtags.8',
'pod/mvfaq.pod' => 'blib/man3/mvfaq.8',
},
- DISTNAME => "minivend",
+ DISTNAME => "interchange",
clean => {
FILES=> "lib/IniConf.pm _uid _db_storable _session_storable lib/File/CounterFile.pm scripts/initp.pl scripts/compile_link scripts/config_prog scripts/configdump scripts/dump scripts/expire scripts/localize scripts/expireall scripts/makecat scripts/minivend scripts/offline scripts/restart scripts/update dist/simple/download/mvdocs.pod dist/simple/download/mvtags.pod dist/simple/download/mvfaq.pod pod/mvtags.pod",
},
View
4 dist/barry/catalog.cfg
@@ -361,6 +361,10 @@ Route main supplant 1
Route main individual_track orders
Route main track logs/tracking.asc
+# Order routes can be maintained in a database, empty in demo
+# CHANGES TO THIS WILL OVERRIDE THE ROUTES ABOVE
+RouteDatabase route
+
SalesTax state
SeparateItems Yes
SpecialPage flypage flypage
View
7 dist/barry/config/logobar
@@ -1,3 +1,10 @@
+[if scratch members_only]
+ [set members_only][/set]
+ [if !session logged_in]
+ [set mv_successpage]@@MV_PAGE@@[/set]
+ [bounce page=login]
+ [/if]
+[/if]
<html>
<head>
<title>[scratch page_title]</title>
View
147 dist/barry/etc/log_entry
@@ -0,0 +1,147 @@
+#### begin [value mv_order_number] #####
+[seti transaction_record]
+[tag flag write]transactions orderline userdb inventory[/tag]
+[if cgi new_customer_id]
+Add new customer: [value name=customer_id set="[fcounter etc/customer.number]"]
+Set password: [value name=password set="[value name=zip filter='word uc']"]
+[/if]
+Update userdb: [perl table=userdb]
+ my $id = $Values->{username} = $Values->{customer_id};
+ @always = qw/
+ company
+ fname
+ lname
+ address1
+ address2
+ city
+ state
+ zip
+ country
+ phone_day
+ mv_shipmode
+ mv_credit_card_type
+ mv_credit_card_exp_month
+ mv_credit_card_exp_year
+ email
+ phone_night
+ fax_order
+ email_copy
+ mail_list
+ /;
+ @sometimes = qw/
+ password
+ b_fname
+ b_lname
+ b_address1
+ b_address2
+ b_city
+ b_state
+ b_zip
+ b_country
+ b_phone
+ fax
+ credit_limit
+ /;
+
+ my $db = $Db{userdb};
+
+ if(! $db->record_exists($id)) {
+ $db->set_row($id);
+ $db->set_field($id, 'password', $Values->{password});
+ }
+
+ for(@always) {
+ $db->set_field($id, $_, $Values->{$_});
+ }
+
+ for (@sometimes) {
+ next unless $Values->{$_} =~ /\S/;
+ $db->set_field($id, $_, $Values->{$_});
+ }
+
+ return "Updated customer record.";
+[/perl]
+
+
+[perl] Log("Starting entry."); [/perl]
+
+[try]
+[perl] Log("Past ACL update user."); [/perl]
+Add main order [data
+ table=userdb
+ column=order_numbers
+ key="[value customer_id]"
+ value=" [value mv_order_number]"
+ append="1"
+ ] to transactions: [import table=transactions type=LINE continue=NOTES]
+code: [value mv_order_number]
+store_id: __STORE_ID__
+order_number: [value mv_order_number]
+session: [data session id]
+username: [value username]
+shipmode: [value mv_shipmode] ([shipping-desc])
+shipping: [shipping noformat=1]
+nitems: [nitems]
+subtotal: [subtotal noformat=1]
+handling: [handling noformat=1]
+salestax: [salestax noformat=1]
+total_cost: [total-cost noformat=1]
+fname: [value filter=strip name=fname]
+lname: [value filter=strip name=lname]
+company: [value filter=strip name=company]
+address1: [value filter=strip name=address1]
+address2: [value filter=strip name=address2]
+city: [value filter=strip name=city]
+state: [value name=state filter="strip uc"]
+zip: [value name=zip filter="word uc"]
+country: [value country]
+phone_day: [value filter=strip name=phone_day]
+phone_night: [value filter=strip name=phone_night]
+b_fname: [value filter=strip name=b_fname]
+b_lname: [value filter=strip name=b_lname]
+b_address1: [value filter=strip name=b_address1]
+b_address2: [value filter=strip name=b_address2]
+b_city: [value filter=strip name=b_city]
+b_state: [value filter=strip name=b_state]
+b_zip: [value filter=strip name=b_zip]
+b_country: [value filter=strip name=b_country]
+b_phone: [value filter=strip name=b_phone]
+payment_method: [value mv_payment]
+order_date: [value name=order_date set="[tag time]%Y%m%d %H:%M:%S[/tag]"]
+order_ymd: [value name=order_date set="[tag time]%Y%m%d[/tag]"]
+order_wday: [value name=order_wday set="[tag time]%u[/tag]"]
+status: pending
+affiliate: ORDER_DESK
+po_number: [value filter=strip po_number]
+[/import]
+[perl] Log("Past transactions entry."); [/perl][item-list]Added [item-code] to orderline: [import table=orderline type=LINE continue=NOTES]
+code: [value mv_order_number]-[item-increment]
+store_id: __STORE_ID__
+order_number: [value mv_order_number]
+session: [data session id]
+username: [value username]
+shipmode: [item-modifier mv_shipmode]
+sku: [item-code]
+quantity: [item-quantity]
+price: [item-price noformat]
+subtotal: [item-subtotal noformat]
+size: [item-modifier size]
+color: [item-modifier color]
+order_date: [value order_date]
+affiliate: ORDER_DESK
+campaign: [value campaign]
+status: pending
+[/import]
+Inventory now: [data table=inventory col=quantity key="[item-code]" increment=1 value="-[item-quantity]"]
+[/item-list][/try]
+[catch] There was an error adding to the transaction log. [/catch]
+[perl] Log("Past add data entry."); [/perl]
+
+[perl] Log("Past all transaction log."); [/perl]
+[/seti][perl]
+ my $out = $Scratch->{transaction_record};
+ $out =~ s/^\s+//;
+ $out =~ s/\s+$//;
+ return $out;
+[/perl]
+#### end [value mv_order_number] #####
View
2 dist/barry/etc/log_transaction
@@ -68,6 +68,8 @@ status: pending
affiliate: [data session source]
campaign: [value campaign]
parent: __PARENT__
+deleted:
+archived:
po_number: [value filter=strip po_number]
[/import]
[comment][perl] Log("Past transactions entry."); [/perl][/comment][item-list]Added [item-code] to orderline: [import table=orderline type=LINE continue=NOTES]
View
4 dist/barry/etc/profiles.login
@@ -2,9 +2,9 @@
__NAME__ Logout
[if type=explicit compare="[userdb logout]"]
-mv_nextpage=[cgi mv_successpage]
+mv_nextpage=[either][cgi mv_successpage][or][cgi mv_nextpage][/either]
[else]
-mv_nextpage=[cgi mv_failpage]
+mv_nextpage=[either][cgi mv_failpage][or][cgi mv_nextpage][/either]
[/else]
[/if]
View
BIN dist/barry/images/admin/down.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dist/barry/images/admin/folder.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dist/barry/images/admin/folder.open.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dist/barry/images/admin/index.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN dist/barry/images/admin/up.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 dist/barry/pages/contact.us.html
@@ -4,7 +4,7 @@
__LEFTSIDE__
<br><br>
-Since we aren't a real store, we'll provide a totally fake address and phone number. However, our email address is real. Email here if you'd like to ask any questions about Tallyman.
+Since we aren't a real store, we'll provide a totally fake address and phone number. However, our email address is real. Email here if you'd like to ask any questions about Interchange.
<p>
Barry's Books, Bikes, and Birkenstocks
<p>
View
0 dist/barry/pages/reconfig/.access
No changes.
View
5 dist/barry/pages/reconfig/.access_gate
@@ -1,5 +0,0 @@
-upload: [if session username eq 'minivend']Yes[else]No[/else][/if]
-do_upload: [if session username eq 'minivend']Yes[else]No[/else][/if]
-do_download: [if session username eq 'minivend']Yes[else]No[/else][/if]
-reconfig: [if session username eq 'minivend']Yes[else]No[/else][/if]
-*: 0
View
63 dist/barry/pages/reconfig/do_download.html
@@ -1,63 +0,0 @@
-[set name=total_junk interpolate=1]
-[if type=explicit compare="[perl arg=values]
- my $v = $Safe{'values'};
- for ( qw/ page_to_upload
- db_to_upload
- arbitrary_to_upload /
- )
- {
- return 1 if $v->{$_} =~ m{\.\./};
- return 1 if $v->{$_} =~ m{^\s*[a-zA-Z]:/};
- $v->{$_} =~ s{^/}{};
- }
- return '';[/perl]"]
-[tag op=log file=">tmp/naughty"]
-That was very naughty!
-[/tag]
-[tag op=log file="tmp/naughty"]
-Hmm, were you reported? Time will tell.
-[/tag]
-[tag op=log file="tmp/naughty"]
-[data session id] - [calc]localtime[/calc] SECURITY VIOLATION
--- attempt to download one of:
- [value arbitrary_to_upload]
- [value page_to_upload]
- [value db_to_upload]
-by:
- [data session username]
- [data session host]
-[/tag]
-[loop arg="arbitrary_to_upload page_to_upload db_to_upload "]
-[value name="[loop-code]" set=""]
-[/loop]
-[value name="arbitrary_to_upload" set="tmp/naughty"]
-
-[/if]
-
-[if value page_to_upload]
- [value name=file_to_download set="pages/[value page_to_upload]"]
-
-[elsif value db_to_upload]
- [perl arg="config values"]
- my $db = $Safe{'values'}{db_to_upload};
- $db =~ s/[\0\s].*//s;
- $fn = $Safe{config}{Database}{$db}{'file'};
- $Safe{'values'}{file_to_download} = "products/$fn";
- [/perl]
-[/elsif]
-
-[elsif value arbitrary_to_upload]
- [value name=file_to_download set="[value arbitrary_to_upload]"]
-[/elsif]
-
-[else]
- [bounce special/missing]
-[/else]
-
-[/if]
-
-[loop arg="arbitrary_to_upload page_to_upload db_to_upload "]
-[value name="[loop-code] set=""]
-[/loop]
-[/set][tag op=header]Content-Type: application/octet-stream[/tag][file name="[value file_to_download]" type="[value download_conversion]"
-][value name=file_to_download set=""][goto end=1 abort=1]
View
95 dist/barry/pages/reconfig/do_upload.html
@@ -1,95 +0,0 @@
-[set page_title] __COMPANY__ -- Database Upload Results [/set]
-__LOGOBAR__
-__MENUBAR__
-__LEFTSIDE__
-
-<BLOCKQUOTE>
-<TABLE>
-<CAPTION> <H2> Upload </H2></CAPTION>
-[if value page_to_upload]
-<TR>
-<TD>
-Page upload of <B>[value page_to_upload]</B> -->
-</TD>
-<TD>
-[if type=explicit compare="[value-extended
- name='page_upload'
- test=isfile
- ]"]
-[value-extended
- Yes=Success
- No=FAILED
- ascii="[value page_ascii]"
- name="page_upload"
- outfile="pages/[value page_to_upload]"
- ]
-[else]
-[value page_to_upload]: No file was uploaded.
-[/else][/if]
-</TD>
-</TR>
-[/if]
-[loop arg="[value-extended db_to_upload]"]
-[if type=explicit compare="[value-extended
- name='upload_[loop-code]'
- test=isfile
- ]"]
-
-<TD>
-Database upload of <B>[loop-code]</B> -->
-</TD>
-<TD>
-[value-extended
- Yes=Success
- No=FAILED
- ascii="1"
- name="upload_[loop-code]"
- outfile="products/[scratch outfile_[loop-code]]"
- ]
-</TD>
-[else]
-<TD COLSPAN=2>
-[loop-code]: No file was uploaded.
-</TD>
-[/else][/if]
-[set upload_[loop-code]][/set]
-</TR>
-[/loop]
-[if value arbitrary_to_upload]
-<TR>
-<TD>
-Arbitrary upload of <B>[value arbitrary_to_upload]</B> -->
-</TD>
-<TD>
-[if type=explicit compare="[value-extended
- name='arbitrary_upload'
- test=isfile
- ]"]
-[value-extended
- Yes=Success
- No=FAILED
- ascii="[value arbitrary_ascii]"
- name="arbitrary_upload"
- outfile="[value arbitrary_to_upload]"
- ]
-[else]
-[value arbitrary_to_upload]: No file was uploaded.
-[/else][/if]
-</TD>
-</TR>
-[/if]
-</TABLE>
-</BLOCKQUOTE>
-
-[value name=db_to_upload set=""]
-[value name=page_to_upload set=""]
-[value name=arbirtrary_to_upload set=""]
-<CENTER>
-[page reconfig/upload]Upload Menu[/page]<BR>
-[page reconfig/reconfig]Reconfigure catalog[/page]
-</CENTER>
-
-__NO_RIGHT__
-__MENUBOTTOM__
-__COPYRIGHT__
-<!-- current page: @@MV_PAGE@@ -->
View
16 dist/barry/pages/reconfig/reconfig.html
@@ -1,16 +0,0 @@
-[set page_title]Catalog reconfiguration...[/set]
-<IMG SRC="mvlogo.png" ALT="MV Logo" ALIGN=CENTER>
-
-[if type=explicit compare="[reconfig]"]
-<h1>Catalog Reconfigured!</h1>
-[reconfig-wait]
-The catalog <B>[calc]$Config->{CatalogName}[/calc]</B> should be successfully reconfigured.
-[else]
-RECONFIGURATION FAILED.
-[/else]
-[/if]
-<P>
-
-__MENUBOTTOM__
-__COPYRIGHT__
-<!-- current page: @@MV_PAGE@@ -->
View
110 dist/barry/pages/reconfig/upload.html
@@ -1,110 +0,0 @@
-[set page_title] __COMPANY__ -- Upload [/set]
-__LOGOBAR__
-__MENUBAR__
-__LEFTSIDE__
-&nbsp;
-<P>
-To upload, check the box and select a file on your local
-computer.
-<P>
-</BLOCKQUOTE>
-<FORM ACTION="[process-target]" METHOD=POST ENCTYPE="multipart/form-data">
-<INPUT TYPE=hidden NAME=mv_todo VALUE="return">
-<INPUT TYPE=hidden NAME=mv_nextpage VALUE="reconfig/do_upload">
-<TABLE BORDER=1>
-<TR>
-<TH COLSPAN=2> Page to upload (relative to pages, include .html)</TH>
-<TH>ASCII</TH>
-<TH> File </TH>
-</TR>
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME=page_to_upload SIZE=40>
-</TD>
-<TD>
-<INPUT NAME=page_ascii TYPE=radio VALUE=1 CHECKED>&nbsp;Yes<BR>
-<INPUT NAME=page_ascii TYPE=radio VALUE=0>&nbsp;No
-</TD>
-<TD>
- <INPUT TYPE=file NAME="page_upload">
-</TD>
-</TR>
-<TR>
-<TH> Database </TH>
-<TH> File name </TH>
-<TH> Type </TH>
-<TH> File to upload </TH>
-</TR>
-[loop arg="[perl arg='scratch config']
- my @out;
- my %type = ( qw/
- 1 DEFAULT
- 2 LINE
- 3 %%
- 4 CSV
- 5 PIPE
- 6 TAB
- /);
- my $ref = $Safe{config}{Database};
- for(sort keys %$ref) {
- next if /^(transactions|userdb)$/;
- push @out, $_;
- $filename{$_} = $ref->{$_}{'file'};
- $Safe{scratch}{qq|filetype_$_|} = $type{$ref->{$_}{'type'}};
- $Safe{scratch}{qq|outfile_$_|} = $ref->{$_}{'file'};
- }
- $filetype{products} = 'whatever';
- return join ' ', @out;
- [/perl]"]
-<TR>
-<TD VALIGN=BOTTOM>
- <INPUT TYPE=checkbox NAME=db_to_upload VALUE="[loop-code]"> [loop-code]
-</TD>
-<TD VALIGN=BOTTOM>
- [scratch outfile_[loop-code]]
-</TD>
-<TD VALIGN=BOTTOM>
- [scratch filetype_[loop-code]]
-</TD>
-<TD>
- <INPUT TYPE=file NAME="upload_[loop-code]">
-</TD>
-</TR>
-[/loop]
-<TR>
-<TH COLSPAN=2> Arbitrary file to upload (like catalog.cfg)</TH>
-<TH>ASCII</TH>
-<TH>File</TH>
-</TR>
-<TR>
-<TD COLSPAN=2>
-<INPUT NAME=arbitrary_to_upload SIZE=40>
-</TD>
-<TD>
-<INPUT NAME=arbitrary_ascii TYPE=radio VALUE=1 CHECKED>&nbsp;Yes<BR>
-<INPUT NAME=arbitrary_ascii TYPE=radio VALUE=0>&nbsp;No
-</TD>
-<TD>
- <INPUT TYPE=file NAME="arbitrary_upload">
-</TD>
-</TR>
-<TR>
-<TD COLSPAN=2 ALIGN=CENTER VALIGN=TOP>
- <INPUT TYPE=submit VALUE="Upload file(s)">
- </TD>
- <TD COLSPAN=2 ALIGN=CENTER VALIGN=TOP>
- [set Download first selected file]
- mv_nextpage=reconfig/do_download
- [/set]
- <INPUT TYPE=submit NAME=mv_click VALUE="Download first selected file"><BR>
- <INPUT TYPE=radio NAME=download_conversion VALUE="" CHECKED>&nbsp;no&nbsp;convert
- <INPUT TYPE=radio NAME=download_conversion VALUE="dos">&nbsp;DOS/Win
- <INPUT TYPE=radio NAME=download_conversion VALUE="mac">&nbsp;Mac
- <INPUT TYPE=radio NAME=download_conversion VALUE="unix">&nbsp;Unix
- </TD></TR>
-</TABLE>
-</FORM>
-__NO_RIGHT__
-__MENUBOTTOM__
-__COPYRIGHT__
-<!-- current page: @@MV_PAGE@@ -->
View
10 dist/barry/pages/splash.html
@@ -9,15 +9,19 @@
<P>
<B><A HREF="[area index]">Enter</A></B>
<P>
+This version introduces the Interchange user interface:
+<P>
+<B><A HREF="[area admin/index]">Admin</A></B>
+<P>
<TABLE WIDTH=70%><TR><TD>
-<I>This is the "simple" demonstration of the MiniVend 4.0 electronic
+<I>This is the "barry" demonstration of the Akopia Interchange 4.0 electronic
catalog system. Links that will help you to use this software:</I>
<P>
<UL>
-<LI><A HREF="http://www.minivend.com/">Main MiniVend Site</A><BR>
+<LI><A HREF="http://www.minivend.com/">Main Interchange Site</A><BR>
<OL>
<LI><A HREF="http://www.minivend.com/iri/faq.html">Frequently Asked Questions</A>
- <LI><A HREF="http://www.minivend.com/iri/document.html">MiniVend Documentation</A>
+ <LI><A HREF="http://www.minivend.com/iri/document.html">Interchange Documentation</A>
<LI><A HREF="http://www.minivend.com/iri/maillist.html">User support mail lists</A>
<LI><A HREF="http://www.linuxia.net/minimate/">MiniMate</A>
</OL>
View
1 dist/barry/products/route.txt
@@ -0,0 +1 @@
+code report receipt encrypt_program encrypt pgp_key pgp_cc_key cyber_mode credit_card profile inline_profile email attach counter increment continue partial supplant track errors_to
View
22 dist/catalog_after.cfg
@@ -3,3 +3,25 @@ UserDB ui crypt 1
UserDB ui time_field last_login
UserDB ui admin 1
UserDB default admin 0
+ParseVariables Yes
+
+ActionMap ui_download <<EOR
+sub {
+ my $deliverable = shift;
+ my $status;
+ $CGI->{mv_nextpage} =~ s:^ui_download/::;
+ $CGI->{mv_nextpage} .= $Session->{extension};
+ if($Tag->if_mm('files', $CGI->{mv_nextpage}) ) {
+ $Document->header("Content-type: application/octet-stream");
+ $Document->hot(1);
+ HTML ( $Tag->file($CGI->{mv_nextpage}) );
+ $status = 0;
+ }
+ else {
+ $Scratch->{ui_error} = "Not authorized for file $CGI->{mv_nextpage}";
+ $CGI->{mv_nextpage} = '__UI_BASE__/error';
+ $status = 1;
+ }
+ return $status;
+}
+EOR
View
13 dist/catalog_before.cfg
@@ -9,21 +9,28 @@ Variable UI_BASE admin
Variable UI_ACCESS_TABLE access
Variable UI_META_TABLE mv_metadata
-Variable UI_OVERALL_WIDTH 600
+Variable UI_OVERALL_WIDTH 750
+Variable UI_MAIN_WIDTH 600
Variable UI_LEFT_WIDTH 150
Variable UI_RIGHT_WIDTH 450
Variable UI_BOTTOMIMG tan_logo.gif
-Variable UI_C_BG #FFFFCC
+Variable UI_T_BG beige
+Variable UI_C_BG #FFFFFF
Variable UI_C_LINK #000000
Variable UI_C_ALINK #000000
Variable UI_C_VLINK #000000
+Variable UI_P_BG #FFFFFF
+Variable UI_P_LINK #0000EE
+Variable UI_P_ALINK #EE0000
+Variable UI_P_VLINK #0000FF
Variable UI_C_TITLEBARBG #336699
Variable UI_C_TITLEBARTXT #CCCCCC
Variable UI_C_HEADERTXT #333333
Variable UI_C_TOPBLOCKBAR #336699
Variable UI_C_INTBLOCK #CCCC99
-Variable UI_C_INTBLOCKBAR #666633
+Variable UI_C_INTBLOCKBAR #999966
Variable UI_HELP_BASE_URL http://www.akopia.com/help/4.5.0
+Variable UI_T_PROPERTIES cellpadding=3 cellspacing=0 width=90% border=0
Variable UI_SZ_LIST_CUSTOMER 50
Variable UI_SZ_LIST_ORDER 50
View
6 dist/lib/MiniMate/.cvsignore
@@ -1,6 +0,0 @@
-MANIFEST
-Makefile
-blib
-pm_to_blib
-*.tar
-*.tar.gz
View
1,232 dist/lib/MiniMate/CfgMgr.pm
@@ -1,1232 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 1998 Michael J. Heins <mikeh@minivend.com>
-
-# Author: Michael J. Heins <mikeh@minivend.com>
-# Maintainer: Stefan Hornburg <racke@linuxia.de>
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any
-# later version.
-
-# This file is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this file; see the file COPYING. If not, write to the Free
-# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-my($order, $label, %terms) = @_;
-
-package MiniMate::CfgMgr;
-
-$VERSION = substr(q$Revision: 1.2 $, 10);
-$DEBUG = 0;
-
-use vars qw!
- @EXPORT @EXPORT_OK
- $VERSION $DEBUG
- $DECODE_CHARS
- *hash_value *array_value
- *boolean_value *page_value
- !;
-
-use Carp;
-use File::Find;
-use File::CounterFile;
-use Exporter;
-use strict;
-use Vend::Util qw/errmsg/;
-$DECODE_CHARS = qq{&[<"\000-\037\177-\377};
-
-@EXPORT = qw( combo_select mm_check_acl mm_acl_enabled ) ;
-
-=head1 NAME
-
-CfgMgr.pm -- MiniMate Configuration Manager
-
-=head1 SYNOPSIS
-
-display_directive %options;
-
-=head1 DESCRIPTION
-
-The MiniMate Configuration Manager is a proprietary interface to configure
-various configuration file parameters.
-
-=cut
-
-use vars qw($Directive_prefix $Configfile $Writing);
-$Directive_prefix = 'mvc_value';
-$Writing = 0;
-$Configfile = 'catalog.cfg';
-my $Counterfile = ".$Configfile.serial";
-$Counterfile =~ tr/./_/ if $^O =~ /win32/i;
-my $mm_safe = new Safe;
-$mm_safe->untrap(@{$Global::SafeUntrap});
-
-my @Out;
-my @Mark;
-
-my %Cfg = (
-
- actionmap => { Complex => 1 },
- admindatabase => { },
- adminpage => { },
- alwayssecure => { },
- asciibackend => { },
- asciitrack => { },
- autoload => { },
- backendorder => { },
- buttonbars => { 'Unparse' => 'page', 'Source' => 1 },
- checkoutframe => { },
- checkoutpage => { 'Default' => 'basket', },
- clearcache => { },
- collectdata => { },
- commonadjust => { },
- configdatabase => { },
- configdir => { },
- cookiedomain => { },
- cookies => { },
- creditcardauto => { },
- customshipping => { 'Unparse' => 'yesno' },
- cybercash => { },
- database => { },
- datadir => { },
- dbdatabase => { },
- debugmode => { },
- defaultshipping => { },
- descriptionfield => { },
- displayerrors => { },
- dynamicdata => { },
- encryptprogram => { },
- errorfile => { },
- extrasecure => { },
- fallbackip => { },
- fielddelimiter => { },
- finishorder => { },
- formignore => { },
- fractionalitems => { },
- frameflypage => { },
- framelinkdir => { },
- frameorderpage => { },
- framesdefault => { },
- framesearchpage => { },
- glimpse => { },
- groupfile => { },
- help => { },
- imagealias => { },
- imagedir => { },
- imagedirinternal => { },
- imagedirsecure => { },
- itemlinkdir => { },
- itemlinkvalue => { },
- localedatabase => { },
- logfile => { },
- mailorderto => { },
- masterhost => { },
- mixmatch => { },
- msqldb => { },
- mv_alinkcolor => { },
- mv_background => { },
- mv_bgcolor => { },
- mv_linkcolor => { },
- mv_textcolor => { },
- mv_vlinkcolor => { },
- newescape => { },
- newreport => { },
- newtags => { },
- nocache => { Unparse => 'page', },
- noimport => { },
- nontaxablefield => { },
- offlinedir => { },
- oldshipping => { },
- ordercounter => { Default => 'etc/order.number', },
- orderframe => { },
- orderlinelimit => { Size => 4, },
- orderprofile => { 'Source' => 1 },
- orderreport => { },
- pagecache => { },
- pagedir => { },
- pageselectfield => { },
- parsevariables => { },
- password => { },
- passwordfile => { },
- pgp => { },
- priceadjustment => { },
- pricebreaks => { },
- pricecommas => { },
- pricedatabase => { },
- pricedivide => { },
- pricefield => { },
- productdir => { },
- productfiles => { },
- random => { 'Unparse' => 'page', 'Source' => 1 },
- receiptpage => { },
- recorddelimiter => { },
- remoteuser => { },
- replace => { },
- reportignore => { },
- requiredfields => { },
- robotlimit => { Size => 4, },
- rotate => { 'Unparse' => 'page', 'Source' => 1 },
- salestax => { },
- saveexpire => { },
- scratchdir => { 'Default' => 'tmp' },
- searchcache => { },
- searchframe => { },
- searchovermsg => { },
- searchprofile => { 'Source' => 1 },
- secureordermsg => { },
- secureurl => { },
- sendmailprogram => { },
- separateitems => { },
- sessiondatabase => { },
- sessiondb => { },
- sessionexpire => { Source => 1 },
- sessionlockfile => { },
- setgroup => { },
- shipping => { },
- specialpage => { Complex => 1 },
- static => { },
- staticall => { },
- staticdepth => { },
- staticdir => { },
- staticfly => { },
- staticpage => { Unparse => 'page', },
- staticpath => { },
- staticpattern => { },
- staticsuffix => { },
- subargs => { },
- taxshipping => { },
- transparentitem => { },
- upszonefile => { },
- usecode => { },
- usemodifier => { },
- userdatabase => { },
- variabledatabase => { },
- vendurl => { },
- wideopen => { },
-
- delimiter => {
- 'Default' => 'TAB',
- 'Choices' => [
- 'TAB',
- 'PIPE',
- 'CSV'
- ],
- 'Unparse' => 'choice'
- },
-
- readpermission => {
- 'Choices' => [
- 'user',
- 'group',
- 'world'
- ],
- 'Unparse' => 'choice'
- },
- writepermission => {
- 'Choices' => [
- 'user',
- 'group',
- 'world'
- ],
- 'Unparse' => 'choice',
- },
-);
-
-my %Display = (
-
- yesno => [\&yesno_box],
- boolean => [\&combo_select],
- array => [\&combo_select],
- hash => [\&combo_select],
- page => [\&combo_select, \&list_pages],
- variable => [\&variable_configure],
- choice => [\&select_box, 'Choices'],
-
-);
-
-# init region
-CFGMGR_DEFAULTS: {
- my ($ary, $ref, $dir, $def, $parse, $cfg);
- $ary = Vend::Config::catalog_directives();
- foreach $ref (@$ary) {
- ($dir,$parse,$def) = @$ref;
- $cfg = $Cfg{lc $dir} || undef;
- next unless defined $cfg;
- ($cfg->{Name}, $cfg->{Parse}) = ($dir,$parse);
- next if defined $cfg->{Default};
- $cfg->{Default} = $def;
- }
-}
-
-sub mm_acl_enabled {
- my $table;
- my $default = defined $Global::Variable->{MINIMATE_ACL}
- ? (! $Global::Variable->{MINIMATE_ACL})
- : 1;
- $table = $::Variable->{MINIMATE_TABLE} || 'minimate';
- $Vend::WriteDatabase{$table} = 1;
- my $db = Vend::Data::database_exists_ref($table);
- return $default unless $db;
- $db = $db->ref() unless $Vend::Interpolate::Db{$table};
- my $uid = $Vend::Session->{username} || $CGI::remote_user;
- if(! $uid or ! $db->record_exists($uid) ) {
- return 0;
- }
- $Vend::Session->{mm_username} = $uid;
- my $ref = $db->row_hash($uid)
- or die "Bad database record for $uid.";
-#::logDebug("ACL enabled, table_control=$ref->{table_control}");
- if($ref->{table_control}) {
- $ref->{table_control_ref} = $mm_safe->reval($ref->{table_control});
- }
- $Vend::Minimate_entry = $ref;
-}
-
-sub get_mm_table_acl {
- my ($table, $user, $keys) = @_;
- $table = $::Values->{mvc_data_table} unless $table;
-#::logDebug("Call get_mm_table_acl: " . Vend::Util::uneval_it(\@_));
- my $acl_top;
- if($user and $user ne $Vend::Session->{mm_username}) {
- if ($Vend::Minimate_acl{$user}) {
- $acl_top = $Vend::Minimate_acl{$user};
- }
- else {
- my $mm_table = $::Variable->{MINIMATE_TABLE} || 'minimate';
- my $acl_txt = Vend::Interpolate::tag_data($mm_table, 'table_control', $user);
- return undef unless $acl_txt;
- $acl_top = $mm_safe->reval($acl_txt);
- return undef unless ref($acl_top);
- }
- $Vend::Minimate_acl{$user} = $acl_top;
- return keys %$acl_top if $keys;
- return $acl_top->{$table};
- }
- else {
- unless ($acl_top = $Vend::Minimate_entry) {
- #::logDebug("Call get_mm_table_acl: acl_top=" . ::uneval($acl_top));
- return undef unless ref($acl_top = mm_acl_enabled());
- }
- }
- return undef unless defined $acl_top->{table_control_ref};
- return $acl_top->{table_control_ref}{$table};
-}
-
-sub mm_acl_grep {
- my ($acl, $name, @entries) = @_;
-#::logDebug("Call mm_acl_grep: " . ::uneval(\@_));
- my $val;
- my %ok;
- @ok{@entries} = @entries;
- if($val = $acl->{owner_field} and $name eq 'keys') {
- my $u = $Vend::Session->{mm_username};
- my $t = $acl->{table}
- or do{
- ::logError("no table name with owner_field.");
- return undef;
- };
- for(@entries) {
-
- my $v = ::tag_data($t, $val, $_);
-#::logDebug("mm_acl_grep owner: t=$t f=$val k=$_ v=$v u=$u");
- $ok{$_} = $v eq $u;
- }
- }
- else {
- if($val = $acl->{"no_$name"}) {
- for(@entries) {
- $ok{$_} = ! mm_check_acl($_, $val);
- }
- }
- if($val = $acl->{"yes_$name"}) {
- for(@entries) {
- $ok{$_} &&= mm_check_acl($_, $val);
- }
- }
- }
- return (grep $ok{$_}, @entries);
-}
-
-sub mm_acl_atom {
- my ($acl, $name, $entry) = @_;
- my $val;
- my $status = 1;
- if($val = $acl->{"no_$name"}) {
- $status = ! mm_check_acl($entry, $val);
- }
- if($val = $acl->{"yes_$name"}) {
- $status &&= mm_check_acl($entry, $val);
- }
- return $status;
-}
-
-sub mm_check_acl {
- my ($item, $string) = @_;
- $string = " $string ";
- return 0 if $string =~ /[\s,]!$item[,\s]/;
- return 1 if $string =~ /[\s,]$item[,\s]/;
- return '';
-}
-
-sub mm_acl_global {
- my $record = mm_acl_enabled('write');
- # First we see if we have ACL enforcement enabled
- # If you don't, then people can do anything!
- unless (ref $record) {
- $::Scratch->{mv_data_enable} = $record;
- return;
- }
- my $CGI = \%CGI::values;
- my $Tag = new Vend::Tags;
- $CGI->{mv_todo} = $CGI->{mv_doit}
- if ! $CGI->{mv_todo};
- if( $CGI->{mv_todo} eq 'set' ) {
- undef $::Scratch->{mv_data_enable};
- my $mml_enable = $Tag->if_mm('functions', 'mml');
- my $html_enable = ! $Tag->if_mm('functions', 'no_html');
- my $target = $CGI->{mv_data_table};
- $Vend::WriteDatabase{$target} = 1;
- my $keyname = $CGI->{mv_data_key};
- my @codes = grep /\S/, split /\0/, $CGI->{$keyname};
- my @fields = grep /\S/, split /[,\s\0]+/, $CGI->{mv_data_fields};
- if ($Tag->if_mm('!edit', undef, { table => $target }, 1) ) {
- $::Scratch->{mm_failure} = "Unauthorized to edit table $target";
- $CGI->{mv_todo} = 'return';
- return;
- }
- for(@codes) {
- next if $Tag->if_mm('keys', $_, { table => $target }, 1);
- $CGI->{mv_todo} = 'return';
- $::Scratch->{mm_failure} = errmsg("Unauthorized for key %s", $_);
- return;
- }
- for(@fields) {
- $CGI->{$_} =~ s/\[/&#91;/g unless $mml_enable;
- $CGI->{$_} =~ s/\</&lt;/g unless $html_enable;
- next if $Tag->if_mm('columns', $_, { table => $target }, 1);
- $CGI->{mv_todo} = 'return';
- $::Scratch->{mm_failure} = errmsg("Unauthorized for key %s", $_);
- return;
- }
- $::Scratch->{mv_data_enable} = 1;
- }
- return;
-
-}
-
-sub yesno_box {
- my($name, $value) = @_;
- $name = lc $name;
- return undef unless defined $Cfg{$name};
-
- $value = read_directive($name) unless $value;
-
- my $dir = $Cfg{$name}->{Name};
-
- my $out = qq{<TABLE BORDER=2>};
- $out .= qq{<TR><TD VALIGN=TOP WIDTH=100>$dir</TD>};
- $out .= qq{</TD><TD VALIGN=TOP>};
- $out .= qq{<SELECT NAME="$Directive_prefix">};
- $out .= '<OPTION> Yes';
- $out .= '<OPTION';
- $out .= ' SELECTED' unless $value =~ /^[YyTt1]/;
- $out .= '> No';
- $out .= '</SELECT>';
- $out .= qq{</TD></TR></TABLE>};
-}
-
-sub yesno_value {
- my($value) = @_;
- return ($value =~ /^\s*[YyTt1]/) ? 'Yes' : 'No';
-}
-
-use Text::ParseWords;
-
-sub hash_value {
- my @in;
- my @out;
- for(@_) {
- push @in, split /\0/, $_;
- }
- for(@in) {
- s/^\s+//;
- s/\s+$//;
- push @out, Text::ParseWords::quotewords('\s+', 1, $_);
- }
- return join " ", @out;
-}
-
-*array_value = \&hash_value;
-*boolean_value = \&hash_value;
-*page_value = \&hash_value;
-
-sub select_box {
- my($name, $value, $choices) = @_;
- $name = lc $name;
- return undef unless defined $Cfg{$name};
-
- $choices = [$value] unless $choices;
-
- $value = read_directive($name) unless $value;
-
- my $dir = $Cfg{$name}->{Name};
-
- my $out = qq{<TABLE BORDER=2>};
- $out .= qq{<TR><TD VALIGN=TOP WIDTH=100>$dir</TD>};
- $out .= qq{</TD><TD VALIGN=TOP>};
- $out .= qq{<SELECT NAME="$Directive_prefix">};
- for(@$choices) {
- $out .= "<OPTION";
- $out .= " SELECTED" if $value eq $_;
- $out .= "> $_";
- }
- $out .= '</SELECT>';
- $out .= qq{</TD></TR></TABLE>};
-}
-
-sub text_box {
- my($name, $value) = @_;
- $name = lc $name;
- return undef unless defined $Cfg{$name};
-
- $value = read_directive($name) unless $value;
-
- my $dir = $Cfg{$name}->{Name};
- my $size = $Cfg{$name}->{Size} || 60;
-
- HTML::Entities::encode($value, $DECODE_CHARS);
- my $out = qq{<TABLE BORDER=2>};
- $out .= qq{<TR><TD VALIGN=TOP WIDTH=100>$dir</TD>};
- $out .= qq{</TD><TD VALIGN=TOP>};
- if($value =~ /\n/) {
- my $rows = ($value =~ s/(\r?\n)/$1/g) + 1;
- $out .= qq{<TEXTAREA NAME="$Directive_prefix" COLS="$size" ROWS="$rows">};
- $out .= $value;
- $out .= '</TEXTAREA>';
- } else {
- $out .= qq{<INPUT NAME="$Directive_prefix" SIZE="$size" VALUE="$value">};
- }
- $out .= qq{</TD></TR></TABLE>};
-}
-
-sub combo_select {
- my($name, $ary, $possible) = @_;
-
- unless($name) {
-# Vend::Util::logError("CfgMgr - bad call combo_select: no name");
- Vend::Util::logError( errmsg('CfgMgr.pm:1', "CfgMgr - bad call combo_select: no name" ) );
- }
-
- if(! $ary) {
- $ary = $Vend::Cfg->{$name};
- }
-
- if(! ref $ary) {
- my @vals;
- @vals = split /[\s,]+/, $ary ;
- $ary = {};
- for(@vals) { $ary->{$_} = 1 }
- }
- elsif ($ary =~ /ARRAY/) {
- my $in = $ary;
- $ary = {};
- for(@$in) { $ary->{$_} = 1 }
- }
-
- unless($ary) {
-# Vend::Util::logError("CfgMgr - bad call combo_select: name=$name");
- Vend::Util::logError( errmsg('CfgMgr.pm:2', "CfgMgr - bad call combo_select: name=%s" , $name) );
- }
-
- if(! $possible ) {
- $possible = [ sort keys %$ary ];
- }
- elsif (! ref $possible ) {
- $possible =~ s/^[\s,]+//;
- $possible =~ s/[\s,]+$//;
- $possible = [ split /[\s,]+/, $possible ];
- }
- elsif ($possible =~ /HASH/) {
- $possible = [ sort keys %$possible ];
- }
-
- my $size = @$possible;
- $size = $size > 5 ? 5 : $size;
-
- my $out = qq{<TABLE BORDER=2>};
- $out .= qq{<TR><TD VALIGN=TOP>Existing</TD>};
- $out .= qq{<TD VALIGN=TOP>Set new value(s)</TD></TR>};
- $out .= qq{<TR><TD VALIGN=TOP>};
- $out .= qq{<SELECT NAME="$Directive_prefix" MULTIPLE SIZE="$size">};
- for(@$possible) {
- $out .= '<OPTION';
- $out .= ' SELECTED' if $ary->{$_};
- $out .= qq{> $_\n};
- }
- $out .= "</SELECT>";
- $out .= qq{</TD><TD VALIGN=TOP>};
- $out .= qq{&nbsp;&nbsp;};
- $out .= qq{<TEXTAREA NAME="mvc_value" COLS="40" ROWS="$size">};
- $out .= qq{</TEXTAREA>};
- $out .= qq{</TD></TR></TABLE>};
-}
-
-sub option_list {
- return join "<OPTION> ", @_;
-}
-
-sub space_list {
- return join " ", @_;
-}
-
-sub list_images {
- my ($base) = @_;
- return undef unless -d $base;
- my $suf = '\.(GIF|gif|JPG|JPEG|jpg|jpeg|png|PNG)';
- my @names;
- my $wanted = sub {
- return undef unless -f $_;
- return undef unless /$suf$/o;
- my $n = $File::Find::name;
- $n =~ s:^$base/?::;
- push(@names, $n);
- };
- find($wanted, $base);
- return sort @names;
-}
-
-sub list_glob {
- my($spec, $prefix) = @_;
- my $globspec = $spec;
- if($prefix) {
- $globspec =~ s:^\s+::;
- $globspec =~ s:\s+$::;
- $globspec =~ s:^:$prefix:;
- $globspec =~ s:\s+: $prefix:g;
- }
- my @files = glob($globspec);
- if($prefix) {
- @files = map { s:^$prefix::; $_ } @files;
- }
- return @files;
-}
-
-sub list_pages {
- my ($keep, $suf, $base) = @_;
- $suf = $Vend::Cfg->{StaticSuffix} if ! $suf;
- $base = Vend::Util::catfile($Vend::Cfg->{VendRoot}, $base) if $base;
- $base = $Vend::Cfg->{PageDir} if ! $base;
- my @names;
- my $wanted = sub {
- if(-d $_ and $Vend::Cfg->{AdminPage}{$_}) {
- $File::Find::prune = 1;
- return;
- }
- return undef unless -f $_;
- return undef unless /$suf$/;
- my $n = $File::Find::name;
- $n =~ s:^$base/?::;
- $n =~ s/$suf$// unless $keep;
- push(@names, $n);
- };
- find($wanted, $base);
- return sort @names;
-}
-
-my %Break = (
- 'variable' => 1,
- 'subroutine' => 1,
-
-);
-
-my %Format_routine;
-
-sub format_line {
- my($directive, $value, @complex) = @_;
-
- my($line,$multi,$sub, $cfg);
-
- if($cfg = $Cfg{lc $directive}) {
- $directive = $cfg->{Name};
- $sub = $cfg->{Unparse} || $cfg->{Parse};
- }
-
- $sub = 'undef' unless $sub;
-
- if ($value =~ /[\r\n]/) {
- $value =~ s/\r\n/\n/g;
- $value =~ s/\r/\n/g;
- $multi = 1;
- }
-
- no strict 'refs';
-
- if(defined &{"${sub}_value"}) {
- $value = &{"${sub}_value"}($value);
- }
-
- if(!$value) {
- return undef unless $cfg;
- $value = $cfg->{Default} || return undef;
- }
-
- # Returns
- if(defined $Format_routine{$sub}) {
- $line = &{$Format_routine{$sub}}($directive, $value, @complex);
- return $line;
- }
-
- if (@complex) {
- my $joiner = $multi ? "\n" : ' ';
- $value = join $joiner, @complex, $value;
- }
-
- if ($multi) {
- $line = $directive;
- $line .= " <<_END_$directive\n";
- $line .= $value;
- $line .= "\n" unless $value =~ /\n$/;
- $line .= "_END_$directive\n";
- }
- else {
- $line = sprintf("%-19s %s\n", $directive, $value);
- }
- return $line;
-}
-
-sub read_directive {
- my($dir, $complex) = @_;
-
- my $file = $Configfile;
- if(-f "$file+") {
- $file .= '+';
- }
- open(MiniMate::CfgMgr::CONFIG, "+<$file") or die "read $file: $!\n";
- Vend::Util::lockfile(\*MiniMate::CfgMgr::CONFIG, 1, 1) or die "lock $file: $!\n";
-
- my ($var, $value, $lvar);
- my $complete = '';
- my $parsed;
-
- my $C = {};
- Vend::Config::setcat($C);
-
- if($Writing) {
- undef @Out;
- undef @Mark;
- }
-
- my $orig_line;
- while (<MiniMate::CfgMgr::CONFIG>) {
- $orig_line = $_;
- s/^\s+//; # leading whitespace, bye-bye
- unless (/^$dir\s+/io) {
- if ($value =~ /^(.*)<<(.*)/) { # "here" value
- my $begin = $1 || '';
- my $mark = $2;
- my $startline = $.;
- $value =
- Vend::Config::read_here(\*MiniMate::CfgMgr::CONFIG, $mark);
- unless (defined $value) {
- die (sprintf('%d: %s', $startline,
- qq#no end marker ("$mark") found#));
- }
- $orig_line .= $value . "\n$mark\n";
- }
- push (@Out, $orig_line) if $Writing;
- next;
- }
- chomp; # zap trailing newline,
- s/\s+$//; # trailing spaces
-
- # lines read from the config file become untainted
- m/^(\w+)\s+(.*)/ or die("Syntax error, config line '$_'");
- $var = $1;
- $value = $2;
- $lvar = lc $var;
- $var = $Cfg{$lvar}->{Name};
- my($codere) = '[\w-_#/.]+';
-
- if ($value =~ /^(.*)<<(.*)/) { # "here" value
- my $begin = $1 || '';
- my $mark = $2;
- my $startline = $.;
- $value = $begin .
- Vend::Config::read_here(\*MiniMate::CfgMgr::CONFIG, $mark);
- unless (defined $value) {
- die (sprintf('%d: %s', $startline,
- qq#no end marker ("$mark") found#));
- }
- $orig_line .= "$value\n$mark\n"; # may need to reconstruct
- }
- elsif ($value =~ /^(\S+)?(\s*)?<\s*($codere)$/o) { # read from file
- #local($^W) = 0;
- $value = $1 || '';
- my $file = $3;
- $value .= "\n" if $value;
- $file = $var unless $file;
- $file = "$Vend::Cfg->{ConfigDir}/$file" unless $file =~ m!^/!;
- $file = Vend::Util::escape_chars($file); # make safe for filename
- my $tmpval = Vend::Util::readfile($file);
- unless( defined $tmpval ) {
- die ("$var: read from non-existent file.");
- }
- chomp($tmpval) unless $tmpval =~ m!.\n.!;
- $value .= $tmpval;
- }
-
- # see if we have a multi-level
- if (defined $Cfg{$lvar}->{Complex}) {
- if($complex and $value =~ /\s*$complex\s+/) {
- push (@Mark, $#Out) if $Writing;
- }
- elsif ($complex) {
- push (@Out, $orig_line) if $Writing;
- next;
- }
- }
- else {
- push (@Mark, $#Out) if $Writing;
- }
-
- $complete .= "\n" if $complete;
- $complete .= $value;
- next if defined $Cfg{$lvar}->{Source};
- next unless wantarray;
- my $parse;
- if (defined $Cfg{$lvar}->{Parse}) {
- $parse = 'Vend::Config::parse_' . $Cfg{$lvar}->{Parse};
- } else {
- $parse = undef;
- }
- no strict 'refs';
- if(! defined $parsed and defined $parse) {
- $parsed = &{$parse}($var, '')
- if defined $Cfg{$lvar}->{Complex};
- $parsed = &{$parse}($var, $Cfg{$lvar}->{Default});
- }
- $C->{$var} = $parsed = &{$parse}($var, $value)
- if defined $parse;
- }
-
- close MiniMate::CfgMgr::CONFIG;
-
- # see if we have a multi-level
- if (! defined $Cfg{$lvar}->{Complex}) { } # do nothing
- elsif ($complex) { $parsed = $parsed->{$complex} }
- else {
- my $ary = $parsed;
- $parsed = [keys %$ary];
-
- }
-
- $lvar = lc $dir unless defined $lvar;
- if(!$complete) {
- $complete = $Cfg{$lvar}->{Default};
- }
- if (defined $Cfg{$lvar}->{Source}) {
- $parsed = $complete;
- }
-
- wantarray ? return ($complete, $parsed) : return $complete;
-}
-
-sub directive_box {
- my($name, $value, $option, $prefix) = @_;
- $Writing = 0;
- $Directive_prefix = $prefix if defined $prefix;
- $name = lc $name;
- return undef unless defined $Cfg{$name};
-
- my (@call);
- my (@args);
- push @args, $name;
- my $type = $Cfg{$name}->{Unparse} || $Cfg{$name}->{Parse};
- if ( defined $Display{$type} ) {
- @call = @{$Display{$type}};
- }
- else {
- @call = \&text_box;
- }
- my $call = shift @call;
- unless($value) {
- (undef, $value) = read_directive($name, defined $Cfg{$name}->{Complex});
- }
- push(@args, $value);
- push(@args, $option) if defined $option;
-
- for (@call) {
- if(! ref $_) {
- push @args, $Cfg{$name}->{$_};
- }
- elsif($_ =~ /CODE/) {
- my @ary = &$_;
- push @args, \@ary;
- }
- else {
- push @args, $_;
- }
- }
- return &$call(@args);
-
-}
-
-sub set_directive {
- my($name,$value,@complex) = @_;
- $Writing = 1;
- read_directive($name);
-
- $name = lc $name;
- my $new;
-
- my $begin = 0;
- my $mark = shift(@Mark) || $#Out;
-
- my $tmpfile;
- if(-f "$Configfile+") {
- $tmpfile = "$Configfile.$$";
- rename "$Configfile+", $tmpfile;
- }
- else {
- $new = "### Config file created by MiniMate configuration manager\n### ";
- $new .= scalar localtime;
- $new .= "\n### Serial ";
- my $serial = new File::CounterFile $Counterfile;
- $new .= $serial->inc();
- $new .= "\n";
- }
-
- open(OUT, ">$Configfile+") or die "creat $Configfile+: $!\n";
- Vend::Util::lockfile(\*OUT, 1, 1) or die "lock $Configfile+: $!\n";
- print OUT $new if defined $new;
-
-# @lines = ( '## <<< THIS IS A NEW LINE >>> ###',
-# '## <<< THIS IS ALSO A NEW LINE >>> ###',
-# );
-
- my ($line, @lines);
- HTML::Entities::decode($value);
- push @lines, format_line($name, $value, @complex);
-
- foreach $line (@lines) {
- if($mark) {
- print OUT @Out[$begin .. $mark];
- $begin = $mark + 1;
- if($mark > $#Out) {
- undef $mark;
- }
- else {
- $mark = shift(@Mark) || $#Out;
- }
- }
- print OUT "$line\n";
- }
- print OUT @Out[$begin .. $mark] if $mark;
- close OUT or die "close $Configfile+: $!\n";
- unlink $tmpfile if $tmpfile;
- return 1;
-}
-
-sub list_directives {
- my($dir, @out);
- foreach $dir (sort keys %Cfg) {
- push @out, $Cfg{$dir}->{Name};
- }
- return @out;
-}
-
-my %database_template = (
- 1 => { qw/LABEL DEFAULT/ },
- 2 => { qw/LABEL LINE/ },
- 3 => { qw/LABEL %%/ },
- 4 => { qw/LABEL CSV/ },
- 5 => { qw/LABEL PIPE/ },
- 6 => { qw/LABEL TAB/ },
- 7 => { LABEL => 'mSQL (old)' },
- 8 => { qw!LABEL SQL/DBI! },
-);
-
-sub database_display {
- my ($name) = @_;
- my $data = $Vend::Cfg->{Database}->{$name}
- or return "<STRONG>Undefined database table <I>$name</I></STRONG>";
- my $out = <<EOF;
-<TABLE><TR><TD COLSPAN=2 ALIGN=CENTER><FONT SIZE="+1">$name</FONT></TD></TR>
-<TR><TD ALIGN=RIGHT>Type</TD><TD><SELECT NAME=mvc_database_define_type>
-EOF
-
- my $one;
- foreach $one (1..8) {
- $out .= qq!<OPTION VALUE="$one"!;
- $out .= qq! SELECTED! if $one == $data->{'type'};
- $out .= qq!>!;
- $out .= $database_template{$one}->{LABEL};
- }
- $out .= qq!</SELECT></TD></TR>!;
-
- $out .= <<EOF;
-<TR><TD ALIGN=RIGHT>Source File</TD><TD>
- <INPUT NAME=mvc_database_define_file SIZE=40 VALUE="$data->{'file'}">
-</TD></TR>
-EOF
-
- foreach $one ( qw/EXCEL CONTINUE /) {
- }
- unless ($data->{'type'} == 7 or $data->{'type'} == 8) {
- $out .= '</TABLE>';
- return $out;
- }
-
- $out .= <<EOF;
-<TR><TD ALIGN=RIGHT>Data Source Name (DSN)</TD><TD>
- <INPUT NAME=mvc_database_define_dsn SIZE=40 VALUE="$data->{DSN}">
-</TD></TR>
-EOF
-
- my $rows = 2;
- my $tmp = '';
- my $int = '';
- my $len = 0;
- DEF: {
- last DEF unless ref $data->{COLUMN_DEF};
- foreach $one (sort keys %{$data->{COLUMN_DEF}}) {
- $tmp .= $one;
- $tmp .= '=';
- $tmp .= $data->{COLUMN_DEF}{$one};
- if(rindex("\n", $tmp) == -1) {
- $len = length $tmp;
- }
- else {
- $len = length(substr($tmp, rindex("\n", $tmp)));
- }
- if($len > 60) {
- $tmp =~ s/,\s*([^,]*)$/,\n/;
- $int .= $tmp;
- $tmp = $1;
- $rows++;
- }
- $tmp .= ', ';
- }
- $tmp =~ s/[,\s]+$//;
- $int .= $tmp;
- }
- $out .= <<EOF;
-<TR><TD ALIGN=RIGHT>Column Definitions</TD><TD>
-<TEXTAREA COLS=60 ROWS=$rows NAME="mvc_database_define_column_def">$int</TEXTAREA>
-</TD></TR>
-EOF
-
- $rows = 2;
- $tmp = '';
- $int = '';
- DEF: {
- last DEF unless ref $data->{NAME};
- foreach $one (@{$data->{NAME}}) {
- $tmp .= $one;
- if(rindex("\n", $tmp) == -1) {
- $len = length $tmp;
- }
- else {
- $len = length(substr($tmp, rindex("\n", $tmp)));
- }
- if($len > 60) {
- $tmp =~ s/\s(\S+)\s*$/\n/;
- $int .= $tmp;
- $tmp = $1;
- $rows++;
- }
- $tmp .= ' ';
- }
- $tmp =~ s/[,\s]+$//;
- $int .= $tmp;
- }
- $out .= <<EOF;
-<TR><TD ALIGN=RIGHT>Column Names</TD><TD>
-<TEXTAREA COLS=60 ROWS=$rows NAME="mvc_database_define_name">$int</TEXTAREA>
-</TD></TR>
-EOF
-
- $rows = 2;
- $tmp = '';
- $int = '';
- DEF: {
- last DEF unless ref $data->{NUMERIC};
- foreach $one (keys %{$data->{NUMERIC}}) {
- $tmp .= $one;
- if(rindex("\n", $tmp) == -1) {
- $len = length $tmp;
- }
- else {
- $len = length(substr($tmp, rindex("\n", $tmp)));
- }
- if($len > 60) {
- $tmp =~ s/\s(\S+)\s*$/\n/;
- $int .= $tmp;
- $tmp = $1;
- $rows++;
- }
- $tmp .= ' ';
- }
- $tmp =~ s/[,\s]+$//;
- $int .= $tmp;
- }
- $out .= <<EOF;
-<TR><TD ALIGN=RIGHT>Numeric Columns</TD><TD>
-<TEXTAREA COLS=60 ROWS=$rows NAME="mvc_database_define_name">$int</TEXTAREA>
-</TD></TR>
-EOF
-
- $out .= '</TABLE>';
-}
-
-sub rotate {
- my($base, $options) = @_;
-
- $base = $Configfile unless $base;
-
- if(! $options) {
- $options = {};
- }
- elsif (! ref $options) {
- $options = {Motion => 'unsave'};
- }
-
- my $dir = $options->{Directory} || '.';
- my $motion = $options->{Motion} || 'save';
-
- $dir =~ s:/+$::;
-
- opendir(forwardDIR, $dir) || die "opendir $dir: $!\n";
- my @files;
- @files = grep /^$base/, readdir forwardDIR;
- my @forward;
- my @backward;
- my $add = '-';
-
- if("\L$motion" eq 'save') {
- return 0 unless -f "$dir/$base+";
- @backward = grep s:^($base\++):$dir/$1:, @files;
- @forward = grep s:^($base-+):$dir/$1:, @files;
- }
- elsif("\L$motion" eq 'unsave') {
- return 0 unless -f "$dir/$base-";
- @forward = grep s:^($base\++):$dir/$1:, @files;
- @backward = grep s:^($base-+):$dir/$1:, @files;
- $add = '+';
- }
- else {
- die "Bad motion: $motion";
- }
-
- $base = "$dir/$base";
-
-#::logGlobal( "rotate $base with options dir=$dir motion=$motion from >> " . Data::Dumper::Dumper($options));
-
- my $base_exists = -f $base;
- push @forward, $base if $base_exists;
-
- for(reverse sort @forward) {
- next unless -f $_;
- rename $_, $_ . $add or die "rename $_ => $_+: $!\n";
- }
-
- #return 1 unless $base_exists && @backward;
-
- @backward = sort @backward;
-
- unshift @backward, $base;
- my $i;
- for($i = 0; $i < $#backward; $i++) {
- rename $backward[$i+1], $backward[$i]
- or die "rename $backward[$i+1] => $backward[$i]: $!\n";
- }
-
- if($options->{Touch}) {
- my $now = time();
- utime $now, $now, $base;
- }
- return 1;
-}
-
-sub meta_display {
- my ($table,$column,$key,$value,$meta_db) = @_;
-
-#::logDebug("metadisplay: t=$table c=$column k=$key v=$value md=$meta_db");
- return undef if $key =~ /::/;
-
- my $metakey;
- $meta_db = $::Variable->{MINIMATE_META} || 'mv_metadata' if ! $meta_db;
-#::logDebug("metadisplay: t=$table c=$column k=$key v=$value md=$meta_db");
- my $meta = Vend::Data::database_exists_ref($meta_db)
- or return undef;
-#::logDebug("metadisplay: got meta ref=$meta");
- my (@tries) = "${table}::$column";
- if($key) {
-