[interchange-cvs] interchange - heins modified 4 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Fri Aug 2 02:15:01 2002


User:      heins
Date:      2002-08-02 06:14:38 GMT
Modified:  dist/lib/UI/pages/admin quicklinks.html
Added:     dist/lib/UI/pages/admin menu_editor.html
Added:     dist/lib/UI/pages/include/menus Accounting.txt
Added:              Quicklinks.txt
Log:
* Add a pretty handy-dandy menu editor. It allows creation of either
  simple or tree-based menus. It will be supported by mv_metadata and
  a standard menu-display routine, so that you can do things like:

     [loop search=3D"
	 			bd=3Dinclude/menus
				fi=3DQuicklinks.txt
				st=3Dtext

				iterator=3Dmenu_display
				display-type=3Dsimple

				co=3Dyes
				sf=3Dmgroup
				se=3D[cgi mgroup]

				ms=3D0
			"][/loop]

	I will put in the support for a "product_tree" component
	soon. The goal will be to make all of the IC menus editable
	by this.

	To test it, install and go to the "Quicklinks", then select
	[edit] from the bottom of the menu. Try changing it into
	a tree and playing (though that menu program won't handle
	trees).

    Comments are welcome.

Revision  Changes    Path
2.3       +78 -237   interchange/dist/lib/UI/pages/admin/quicklinks.html


rev 2.3, prev_rev 2.2
Index: quicklinks.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/admin/quicklin=
ks.html,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- quicklinks.html	5 Jun 2002 14:23:34 -0000	2.2
+++ quicklinks.html	2 Aug 2002 06:14:33 -0000	2.3
@@ -30,242 +30,57 @@
 [seti win][data session arg][/seti]
 [/if]
=20
-<b>[L]Store Admin:[/L]</b>
-<br><br>
-
-[if-mm advanced order]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/order]">
-[L]Orders[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced userdb]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/customer]">
-[L]Customers[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced userdb]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/entry]">
-[L]Order entry[/L]</a><br>
-[/if-mm]
-<P>
-[if-mm advanced orderstats]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/orderstats=
]">
-[L]Order stats[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced trafficstats]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/trafficsta=
ts]">
-[L]Traffic stats[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced affiliate]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/affiliates=
]">
-[L]Affiliates[/L]</a><br>
-[/if-mm]
-<P>
-[if-mm advanced item]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/item]">
-[L]Items[/L]</a><br>
-[/if-mm]
-
-
-[if-mm advanced sitedesign]
-<hr noshade size=3D1>
-<b>[L]Site Design:[/L]</b>
-<br><br>
-
-
-
-[if-mm advanced layout]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/layout]">
-[L]Site Layout[/L]</a><br>
-[/if-mm]
-
-
-[if-mm advanced layout]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/page]">
-[L]Page Edit[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced searchbuilder]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/regenerate=
]">
-[L]Generate static[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced searchbuilder]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/build_rela=
ted]">
-[L]Build related[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced searchbuilder]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/search_wiz=
ard]">
-[L]Search Builder[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced buttonbuilder]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/button_bui=
lder]">
-[L]Button Builder[/L]</a><br>
-[/if-mm]
-
-[/if-mm]
-
-<br>
-
-<hr noshade size=3D1>
-
-[if-mm advanced techadmin]
-<b>[L]Technical Admin:[/L]</b>
-<br>
-<br>
-
-
-[if-mm advanced tax]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/tax]">
-[L]Tax[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced shipping]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/ship]">
-[L]Shipping[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced payment]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/payment]">
-[L]Payment[/L]</a><br>
-[/if-mm]
-
-<br>
-
-
-[if-mm files]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/file_trans=
fer]">
-[L]File transfer[/L]</a><br>
-<p>
-[/if-mm]
-
-
-[if-mm files]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/wizard/ind=
ex]">
-[L]Wizard[/L]</a><br>
-<p>
-[/if-mm]
-
-[if-mm advanced table_edit]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/gentable]">
-[L]Direct Table Edit[/L]</a><br>
-[comment]
-<table cellpadding=3D0 cellspacing=3D0>
-[table-organize cols=3D2]
-[loop list=3D"[list-databases]"]
-<td style=3D"font-size: 6pt">
-<a target=3D"mainwindow[scratch win]"
-	href=3D"[area=20
-		href=3D__UI_BASE__/flex_select
-		form=3Dmv_data_table=3D[loop-code]
-		]">[loop-code]</A>
-</td>
-[/loop]
-[/table-organize]
-</table>
-[/comment]
-[/if-mm]
-
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/import_tab=
le]">
-[L]Table import[/L]</a><br>
-
-
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/export_tab=
le]">
-[L]Table export[/L]</a><br>
-
-<br>
-
-[if-mm advanced access]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/access]">
-[L]Administrators[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced group]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/group]">
-[L]Admin Groups[/L]</a><br>
-[/if-mm]
-
-[if-mm advanced perm]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/access_per=
missions]">
-[L]Permissions[/L]</a><br>
-[/if-mm]
-
-<br>
-
-[if-mm advanced env_vars]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/env_vars]">
-[L]Environment[/L]</a><br>
-[/if-mm]
-
-
-[if-mm advanced knar]
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area href=3D__UI_BASE__/pre=
ferences]">
-[L]Preferences[/L]</a><br>
-&nbsp;&nbsp;&nbsp;
-<a target=3D"mainwindow[scratch win]" href=3D"[area href=3D__UI_BASE__/fle=
x_select
-				form=3D'
-					mv_data_table=3Dvariable
-					page_title=3DKnar editor
-					ui_meta_specific=3D1
-					help_name=3Dknar.main
-				']">
-[L]Knar editor[/L]</a><br>
-[/if-mm]
-
-<br>
-
-<hr noshade size=3D1>
-[/if-mm]
-
-<b>
-<a target=3D"mainwindow[scratch win]" href=3D"__VendURL__">
-[L]Go to catalog[/L]</a><br>
-</b>
-
-<b>
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/login]">
-[L]Logout[/L]</a><br>
-</b>
-
-
-[if-mm advanced reconfig]
-<b>
-<a target=3D"mainwindow[scratch win]" href=3D"[area __UI_BASE__/reconfig]">
-[L]Apply Changes[/L]</a><br>
-</b>
-[/if-mm]
-
-<br>
+[loop prefix=3Dmenu
+	  head-skip=3D1
+	  list=3D"[file include/menus/Quicklinks.txt]"
+	  lr=3D1
+][on-match][menu-exec menu_link]Just gets fieldnames[/menu-exec][/on-match]
+[menu-sub menu_link]
+sub {
+	my $attrlist =3D shift;
+
+	# Set to a default if not passed
+	$attrlist =3D <<EOF unless $attrlist =3D~ /\S/;
+{PAGE:}
+	<b>{NAME}:</b>
+	<br>
+{/PAGE:}
+
+{PAGE?}
+&nbsp;&nbsp;&nbsp;
+<a href=3D"{HREF}"{DESCRIPTION?} title=3D"{DESCRIPTION}"{/DESCRIPTION?}>{N=
AME}</a><br>
+{/PAGE?}
+EOF
+
+	my $row =3D shift;
+	if(ref($row) eq 'HASH') {
+		@menu_fieldnames =3D map { uc($_) } @{$row->{object}{mv_field_names}};
+		return;
+	}
+	my %line;
+	@line{@menu_fieldnames} =3D @$row;
+	if($line{MGROUP} and $CGI->{mgroup} !~ /\b$line{MGROUP}\b/) {
+		return;
+	}
+	return '<br>' unless $line{NAME};
+	return $line{NAME} if ! $line{PAGE} and $line{NAME} =3D~ /^\s*</;
+	$line{WIN}  =3D $Scratch->{win};
+	$line{HREF} =3D $Tag->area( { href =3D> $line{PAGE}, form =3D> $line{FORM=
} });
+	$line{NAME} =3D errmsg($line{NAME});
+	$line{DESCRIPTION} =3D~ s/"/&quot;/g;
+	return $Tag->attr_list(\%line, $attrlist);
+}
+[/menu-sub]
+[menu-exec menu_link]{PAGE:}
+	<b>{NAME}:</b>
+	<br>
+{/PAGE:}{PAGE?}
+&nbsp;&nbsp;&nbsp;
+<a
+	target=3D"mainwindow{WIN}"
+	href=3D"{HREF}"{DESCRIPTION?}
+	title=3D"{DESCRIPTION}"{/DESCRIPTION?}>{NAME}</a><br>
+{/PAGE?}[/menu-exec][/loop]
=20
 </FONT>
                 </TD>
@@ -274,7 +89,33 @@
 </td></tr></table>
 </center>
 </div>
-<div align=3D"center"><a href=3D"javascript:self.window.close()">&#91;[L]c=
lose[/L]]</a></div>
+<div align=3D"center">
+<a href=3D"javascript:self.window.close()">&#91;[L]close[/L]]</a>
+<br>
+<a  target=3D"mainwindow[scratch win]"
+	href=3D"[area href=3D'__UI_BASE__/menu_editor'
+				form=3D'
+					qmenu_name=3DQuicklinks
+				'
+			]">&#91;[L]edit[/L]]</a>
+[if cgi mgroup eq full]
+<a href=3D"[area
+			href=3D'@@MV_PAGE@@'
+			form=3D'
+				mv_arg=3D[scratch win]
+				'
+		]">&#91;[L]short menu[/L]]</a>
+[else]
+<a href=3D"[area
+			href=3D'@@MV_PAGE@@'
+			form=3D'
+				mgroup=3Dfull
+				mv_arg=3D[scratch win]
+				'
+		]">&#91;[L]full menu[/L]]</a>
+[/else]
+[/if]
+</div>
 </BODY>
 </HTML>
=20



2.1                  interchange/dist/lib/UI/pages/admin/menu_editor.html


rev 2.1, prev_rev 2.0



1.1                  interchange/dist/lib/UI/pages/include/menus/Accounting=
txt


rev 1.1, prev_rev 1.0
Index: Accounting.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
code	mgroup	msort	inactive	page	form	name	description	extended
001		001				AR
002		002		ar.pl	customer=3DAll%20Customers&sort=3Dtransdate&open=3DY&l_invn=
umber=3DY&l_transdate=3DY&l_name=3DY&l_amount=3DY&l_paid=3DY&nextsub=3Dar_t=
ransactions&action=3DContinue	Open transactions
003		003		ar.pl	customer=3DAll%20Customers&sort=3Dtransdate&open=3DY&l_invn=
umber=3DY&l_transdate=3DY&l_name=3DY&l_amount=3DY&l_paid=3DY&nextsub=3Dar_t=
ransactions&action=3DContinue&closed=3DY	All Transactions
004		004		ar.pl	action=3Dsearch&nextsub=3Dar_transactions	Search: Transacti=
ons
005		005		ar.pl	action=3Dsearch&nextsub=3Dpayments	Search: Payments
006	full	006		ct.pl	action=3Dadd&db=3Dcustomer	Add Customer
007	full	007		ar.pl	action=3Dadd	Add Transaction
008	full	008		is.pl	action=3Dadd&foo=3Dbar	Customer Invoice
009		009=09
010	full	010				AP
011	full	011		ct.pl	action=3Dadd&db=3Dvendor	Add Vendor
012	full	012		ap.pl	action=3Dsearch&nextsub=3Dpayments	Payments
013	full	013		rp.pl	action=3Dreport&title=3DAP%20Aging	Report: Aging
014	full	014		ap.pl	action=3Dsearch&nextsub=3Dar_transactions	Report: Trans=
actions
015	full	015		ct.pl	action=3Dsearch&db=3Dvendor	Search Vendor
016	full	016		ir.pl	action=3Dadd&type=3Dinvoice	Vendor Invoice
017	full	017=09
018		018				Order Entry
019	full	019		oe.pl	action=3Dsearch&type=3Dpurchase_order	Show POs
020		020		oe.pl	action=3Dsearch&type=3Dsales_order	Show Sales Orders
021	full	021		oe.pl	action=3Dadd&type=3Dpurchase_order	Add PO
022		022		oe.pl	action=3Dadd&type=3Dsales_order	Add Sales Order
023		023=09
024		024				General Ledger
025	full	025		gl.pl	action=3Dadd	Add Transaction
026		026		gl.pl	action=3Dsearch	Reports
027		027=09
028		028				Inventory
029	full	029		ic.pl	action=3Dadd&item=3Dassembly	Add Assembly
030		030		ic.pl	action=3Dadd&item=3Dpart	Add Part
031		031		ic.pl	action=3Dadd&item=3Dservice	Add Service
032		032		ir.pl	action=3Dadd&type=3Dinvoice	Merchandise Received
033		033		ic.pl	searchitems=3Dall&l_partnumber=3DY&l_description=3DY&l_onha=
nd=3DY&l_unit=3DY&l_sellprice=3DY&action=3DGenerate%20Report	Show all parts
034	full	034		ic.pl	action=3Dsearch	Reports
035		035=09
036		036				Reports
037		037		rp.pl	action=3Dreport&title=3DBalance%20Sheet	Balance Sheet
038		038		ca.pl	action=3Dchart_of_accounts	Chart of Accounts
039		039		rp.pl	action=3Dreport&title=3DIncome%20Statement	Income Statement
040		040		rp.pl	action=3Dreport&title=3DTrial%20Balance	Trial Balance



1.1                  interchange/dist/lib/UI/pages/include/menus/Quicklinks=
txt


rev 1.1, prev_rev 1.0
Index: Quicklinks.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
code	mgroup	msort	inactive	page	form	name	description	extended
001		001				Store Admin=09=09
002		002		admin/order		Orders=09=09
003	full	003		admin/entry		Order entry=09=09
004		004=09=09=09=09=09=09
005	full	005		admin/orderstats		Order stats=09=09
006	full	006		admin/trafficstats		Traffic stats=09=09
007	full	007		admin/affiliates		Affiliates=09=09
008	full	008=09=09=09=09=09=09
009		009		admin/item		Items=09=09
010		010				<hr noshade size=3D1>=09=09
011		011				Site Design=09=09
012		012		admin/layout		Site Layout=09=09
013		013		admin/page		Page Edit=09=09
014		014		admin/regenerate		Generate static=09=09
015		015		admin/build_related		Build related=09=09
016		016		admin/search_wizard		Search Builder=09=09
017		017		admin/button_builder		Button Builder=09=09
018		018		admin/menu_editor		Menu Builder	Create and edit quick menus with =
a graphical UI=09
019		019				<hr noshade size=3D1>=09=09
020		020				Technical Admin=09=09
021		021		admin/tax		Tax=09=09
022		022		admin/ship		Shipping=09=09
023		023		admin/payment		Payment=09=09
024		024=09=09=09=09=09=09
025		025		admin/file_transfer		File transfer=09=09
026		026		admin/auto_wizard		Wizard=09=09
027		027=09=09=09=09=09=09
028		028		admin/gentable		Direct Table Edit=09=09
029		029		admin/import_table		Table import=09=09
030		030		admin/export_table		Table export=09=09
031		031=09=09=09=09=09=09
032		032		admin/access		Administrators=09=09
033	full	033		admin/group		Admin Groups=09=09
034	full	034		admin/access_permissions		Permissions=09=09
035		035=09=09=09=09=09=09
036		036		admin/env_vars		Environment=09=09
037		037		admin/preferences		Preferences=09=09
038	full	038		admin/flex_select	mv_data_table=3Dvariable&page_title=3DKnar%=
20editor&ui_meta_specific=3D1&help_name=3Dknar.main	Knar editor=09=09
039		039				<hr noshade size=3D1>=09=09
040		040		index		<b>Go to catalog</b>=09=09
041		041		admin/login		<b>Logout</b>=09=09
042		042		admin/reconfig		<b>Apply Changes</b>=09=09