[interchange-cvs] interchange - heins modified 4 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Wed Jun 25 11:35:37 2003


User:      heins
Date:      2003-06-25 15:32:55 GMT
Modified:  code/UI_Tag backup_database.coretag
Modified:  dist/lib/UI/pages/admin dbdownload.html
Modified:  dist/foundation/products mv_metadata.asc variable.txt
Log:
* Minor improvements in backup setup.

	-- Let backup tables be explicitly specified in
       UI_BACKUP_TABLES.

    -- If no UI_BACKUP_TABLES, honor first "backup" then
       "!display_filter" in table metadata.

    -- Display size of downloadable file.

	-- Prevent spurious .html extension on download link.

Revision  Changes    Path
1.2       +3 -1      interchange/code/UI_Tag/backup_database.coretag


rev 1.2, prev_rev 1.1
Index: backup_database.coretag
===================================================================
RCS file: /var/cvs/interchange/code/UI_Tag/backup_database.coretag,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- backup_database.coretag	29 Jan 2002 05:52:40 -0000	1.1
+++ backup_database.coretag	25 Jun 2003 15:32:55 -0000	1.2
@@ -44,7 +44,9 @@
 	for my $table (@tables) {
 		my $unlink;
 		my $db = Vend::Data::database_exists_ref($table);
-		my $file = "$backup_dir/" . $db->config('file');
+		my $fn = $db->config('file');
+		$fn =~ s:.*/::;
+		my $file = "$backup_dir/$fn";
 		my $status;
 		eval {
 			$status = export(



2.3       +27 -2     interchange/dist/lib/UI/pages/admin/dbdownload.html


rev 2.3, prev_rev 2.2
Index: dbdownload.html
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/dbdownload.html,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- dbdownload.html	18 Aug 2002 08:09:05 -0000	2.2
+++ dbdownload.html	25 Jun 2003 15:32:55 -0000	2.3
@@ -33,10 +33,11 @@
 [if file backup/DBDOWNLOAD.xls]
 	[calc] $Scratch->{mv_deliver} .= ' backup/DBDOWNLOAD.xls'; return; [/calc]
 	[page href="ui/backup/DBDOWNLOAD.xls"
+	      add_dot_html=0
 			form="
 				mv_data_file=backup/DBDOWNLOAD.xls
 				mv_todo=deliver
-			"][L]Download XLS file[/L] ([file-info name="backup/DBDOWNLOAD.xls" date=1])</A><BR>
+			"][L]Download XLS file[/L] ([file-info name="backup/DBDOWNLOAD.xls" date=1], [file-info name="backup/DBDOWNLOAD.xls" size=1] bytes)</A><BR>
 [/if]
 
 [if scratch ui_error]
@@ -56,13 +57,37 @@
 &nbsp;
 <p>
 
+[perl tables=mv_metadata]
+	my @tabs = $Tag->list_databases();
+	%backup = ();
+	if($Variable->{UI_BACKUP_TABLES}) {
+		my @backs = grep /\S/, split /[\s,\0]+/, $Variable->{UI_BACKUP_TABLES};
+		@backup{@backs} = @backs;
+	}
+	else {
+		for(@tabs) {
+			my $meta = $Tag->meta_record($_);
+			if(defined $meta->{backup}) {
+				$backup{$_} = $meta->{backup};
+			}
+			else {
+				$backup{$_} = ! $meta->{display_filter};
+			}
+		}
+	}
+	return;
+[/perl]
+
 <TABLE>
 <TR>
 <TD VALIGN=top>
 What data would you like to export?
 <blockquote>
 [loop list="[list-databases]"]
-<INPUT type=checkbox value="[loop-code]" name="ui_do_export" [if-loop-data __UI_META_TABLE__ display_filter][else]CHECKED[/else][/if-loop-data]> [loop-code]
+<INPUT type=checkbox value="[loop-code]" name="ui_do_export" [loop-calc]
+	return 'CHECKED' if $backup{'[loop-code]'};
+	return;
+[/loop-calc]> [loop-code]
 	[if-loop-data __UI_META_TABLE__ name]
 		(<small>[loop-data __UI_META_TABLE__ name]</small>)
 	[/if-loop-data]



2.38      +2 -1      interchange/dist/foundation/products/mv_metadata.asc


rev 2.38, prev_rev 2.37
Index: mv_metadata.asc
===================================================================
RCS file: /var/cvs/interchange/dist/foundation/products/mv_metadata.asc,v
retrieving revision 2.37
retrieving revision 2.38
diff -u -r2.37 -r2.38
--- mv_metadata.asc	24 Jun 2003 21:20:33 -0000	2.37
+++ mv_metadata.asc	25 Jun 2003 15:32:55 -0000	2.38
@@ -50,7 +50,7 @@
 dbconfig::mv_metadata::options	move_combo	20	8	 				columns::		Fields to edit	Recommended fields to display on editor screen, in order of
 display. If a blank line is between them, a break line will
be put in.										
 dbconfig::mv_metadata::type	select							=No,
1=Yes		Display with meta (spreadsheet)			filesafe								
 dbconfig::mv_metadata::width	text	4								Default spreadsheet column width			digits								
-ichelp	table		100									ichelp									{'panel_shade' => "f",'ui_show_fields' => "code
title",'include_form' => "<td class=clabel>
                        Send result to ICDEVGROUP
                    </td>
                    <td class=cdata>
                        <input type=checkbox name=mv_cleanup value=send_to_icdevgroup> 
                             <span class=chelp style=\"font-size: smaller\">If you believe this help edit is generally applicable, you can check this button to send to ICDEVGROUP for possible inclusion in the distribution. (Emailed, your email must be working.)</span>
                    </td>",'ui_sort_field' => "code",}
+ichelp	table		100									ichelp							1		{'panel_shade' => "f",'ui_show_fields' => "code
title",'include_form' => "<td class=clabel>
                        Send result to ICDEVGROUP
                    </td>
                    <td class=cdata>
                        <input type=checkbox name=mv_cleanup value=send_to_icdevgroup> 
                             <span class=chelp style=\"font-size: smaller\">If you believe this help edit is generally applicable, you can check this button to send to ICDEVGROUP for possible inclusion in the distribution. (Emailed, your email must be working.)</span>
                    </td>",'ui_sort_field' => "code",}
 ichelp::helptext	textarea	72	15							Help Text											
 icmenu	table	12	50	code
mgroup
msort
next_line
page
name(30)
inactive
		Interchange menus						icmenu									
 icmenu::debug	yesno									Debug	 Set to "Yes" to get debug messages relating to the item (if supported by menu).										
@@ -385,6 +385,7 @@
 variable::Variable::STYLE	select							foundation=Foundation Red,purpleyellow=Purple and Yellow,grayorange=Gray and Orange,fixedwidth=Fixed Width,greens=Green,grayscale=Gray,blueyellow=Blue and Yellow		Theme											
 variable::Variable::TAXFIELD	select							state=Simple state-based,
multi=State/Province and VAT,=None		Type of tax	You must <b>apply changes</b> after changing this.										
 variable::Variable::THEME_CSS	textarea_70_40									CSS for site	This overrides the setting in the foundation template/*/theme.cfg file.										
+variable::Variable::UI_BACKUP_TABLES	multiple							tables		Tables to Back up			null_to_space								{}
 variable::Variable::UI_DBCONFIG	yesno									Offer Database Config Link	Shows Database configuration link on Tables  main manu										
 variable::Variable::UI_IMAGE_META	yesno									New table display style	Image meta llink										
 variable::Variable::UI_IMAGE_META-_NULL_-UI_META_LINK	yesno									New table display style											



2.31      +1 -0      interchange/dist/foundation/products/variable.txt


rev 2.31, prev_rev 2.30
Index: variable.txt
===================================================================
RCS file: /var/cvs/interchange/dist/foundation/products/variable.txt,v
retrieving revision 2.30
retrieving revision 2.31
diff -u -r2.30 -r2.31
--- variable.txt	20 Jun 2003 20:38:59 -0000	2.30
+++ variable.txt	25 Jun 2003 15:32:55 -0000	2.31
@@ -75,6 +75,7 @@
 UI_ABOUT_LOGIN_URL	http://www.icdevgroup.org/	Admin layout
 UI_ABOUT_NORMAL_URL	http://www.icdevgroup.org/	Admin layout
 UI_ADMIN_TABLES	mv_metadata locale variable ichelp route access	Admin control
+UI_BACKUP_TABLES	affiliate area cat country inventory locale merchandising options order_returns orderline pricing products state survey transactions tree userdb variants	Database
 UI_BOTTOMIMG	poweredby.gif	Admin layout
 UI_CLONE_TABLES	products* pricing* inventory merchandising options:sku	Item display
 UI_COMPONENT_DIR	templates/components	Directories and Paths