[interchange-cvs] interchange - heins modified 3 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Sat Feb 2 23:28:00 2002


User:      heins
Date:      2002-02-03 04:27:55 GMT
Modified:  dist/lib/UI icmenu.txt ichelp.txt
Modified:  dist/lib/UI/pages/admin search_replace.html
Log:
	* Refine search/replace feature
		-- Add case sensitivity select
		-- Pre-set table to one you selected it from
		-- Improve on-screen directions
		-- Add menu support
		-- Add online help

Revision  Changes    Path
2.2       +1 -0      interchange/dist/lib/UI/icmenu.txt


rev 2.2, prev_rev 2.1
Index: icmenu.txt
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/icmenu.txt,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -r2.1 -r2.2
--- icmenu.txt	28 Aug 2001 15:12:11 -0000	2.1
+++ icmenu.txt	3 Feb 2002 04:27:55 -0000	2.2
@@ -21,6 +21,7 @@
 0020	Admin	11			no_dbmenu	mv_data_table	admin/import_table	mv_data_table=[cgi mv_data_table]	Import Data									
 0021	Admin	12			no_dbmenu	mv_data_table	admin/export_table	mv_data_table=[cgi mv_data_table]	Export Data									
 0022	Admin	13			no_dbmenu	mv_data_table	admin/spread	mv_data_table=[cgi mv_data_table]	Spreadsheet									
+0022b	Admin	13b			no_dbmenu	mv_data_table	admin/search_replace	mv_data_table=[cgi mv_data_table]	Search/Replace									
 0023	Admin	14			no_dbmenu	mv_data_table	admin/flex_editor	mv_data_table=[cgi mv_data_table]&ui_new_item=1	New Entry									
 0024	Admin	15			no_dbmenu	mv_data_table	admin/gentable		    Re-select Table									
 0025	Admin	16	1			access_menu	admin/access		Users									



2.2       +1 -0      interchange/dist/lib/UI/ichelp.txt


rev 2.2, prev_rev 2.1
Index: ichelp.txt
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/ichelp.txt,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -r2.1 -r2.2
--- ichelp.txt	19 Oct 2001 11:27:56 -0000	2.1
+++ ichelp.txt	3 Feb 2002 04:27:55 -0000	2.2
@@ -1,5 +1,6 @@
 code	title	helptext
 gentable	Direct Table Edit	<p>
The <b>Direct Table Edit</b> page allows you to edit any of Interchange's internal tables. Select a table
to edit, or search a table and select rows to edit.
</p>
+table.searchreplace	Database: Search and Replace	This feature allows you to mass-change a field in the database.

<P>
Select the table to operate on, then the column, from the dropdowns. (This page requires JavaScript enabled.) Enter the string to be searched for, and the string to replace it. Click <b>Search and Replace</b>.
<P>
The search string is a regular expression. If the string is a partial match for the field, only the matching text will be replaced. You may parenthesize one part of the search expression, in which case only the parenthesized part will be replaced and the rest of the matching text will be kept in place.
<P>
The replacement string is the literal text that will be inserted instead of the search text.
<P>
If the regular expression is incorrect, you will be returned to the page and the message "Error: Compiling regex" will be displayed.
<P>
If the operation is successful, you will be sent to the edit select list for the table you operated on, and a message indicating how many rows (if any) were changed.
 shipping.data	Shipping: Edit Data Table	<p>
Once you've created a shipping method, you can fine tune the calculation
based on the weight of the order. Use the "+" button to add new ranges
and specify which ranges will apply to which calculations. Choose a type
of calculation to perform for each weight range, such as a number (flat charge),
formula (arbitrary calculation based on the weight), UPS lookup (internal
or via their Web site), multiply by (simple rate), or select <b>Message</b> to
generate an error message. If you specify a formula, you can include the
string "@@TOTAL@@" to represent the total weight of the order. For example,
"8 + @@TOTAL@@ + 2.50".
</p>
 shipping.main	Shipping Options	<p>
The <b>Shipping Options</b> page allows you to specify and configure the shipping methods and costs for your online store. Before you begin here, you need to decide how you want to charge for shipping. We support all the most common shipping options:
</p>

<p>
<a href="shipping.price.html">By Price:</a> shipping total based on the total price of the order. This can also be used to calculate a flat shipping price ($0 - infinity = $4.95) or a flat rate with big orders shipped free ($0 - 500 = $4.95 and $500 - infinity = free). The shipping charge can either be a flat charge or a percentage.
</p>

<p>
<a href="shipping.weight.html">Standard by Weight: </a> calculates shipping by total weight with no regard to zones. To use this method, you must enter a weight for each item in your inventory. You can use any unit of measure you wish as long as you are consistent. If you enter your item prices in grams, then configure shipping with pounds, your customers will not be happy when they are quoted huge shipping rates.
</p>

<p>
<a href="shipping.quantity.html">Standard by Quantity:</a> this is identical to shipping by price, but the shipping charge will be multiplied by the total number of items ordered.
</p>

<p>
<a href="shipping.ups.html">UPS Zones-Based:</a> Interchange is pre-configured with UPS zones tables for ground, three day select, second day air, and next day air.
</p>

<p>
If you require zones support for Fedex, DHL, or USPS, please <a href="mailto:info@akopia.com">contact Akopia</a>.
</p>

<p>
Keep in mind that you can choose a variety of these shipping methods, giving the customer a choice. Many companies use flat shipping for ground orders and use UPS zones shipping for second day and next day orders.
</p>

<p>
<b>Create New Method</b><br>
Once you've decided what shipping options you are going to offer your customers, click the "Create New Method" button and configure each option. You will be able to name and configure each option from the "Create New Method" screen. See

</p>

<p>
<b><a href="shipping.edit.html">Edit Method</a></b><br>
Select one of the currently existing shipping methods from the list and click "edit method" to change its name, enable or disable it, change the calculation method, or set a minimum charge. The "edit method" button takes you to the same screen as "create new method" button, but already filled out. To edit the individual charges for different prices or weights, use the "edit data table" function.
</p>

<p><b><a href="shipping.data.html">Edit Data Table</a></b><br>
The process of creating a new method is usually a two-step process. In the first step, you name the shipping method and devide on a calculation algorithm (by price, by weight/zone, etc). The second stage involves configuring your chosen method. The "edit data table" function allows you to change the particular settings for an already-created method.
</p>

<p>
<b>Delete Method</b><br>
Select a method from the list and click on this button to delete it. You will be asked to confirm your choice. If you choose yes, it will be deleted permanently. If you merely want to temporarily disable a particular shipping method and remove it from the list your customers see, edit the method and un-check the box next to "enable this method." That way, if you want to enable it later, you won't have to re-configure it.
</p>
 order.main.pending	Pending Orders	The <b>Pending Orders</b> page displays all current orders in the system. This page works in real-time, but if you leave this page open or your Web browser has cached the page's contents, it is recommended that you re-load the page periodically to see the most recent orders.
<h2>Functions</h2>
<b>Start at Order Number</b><br>
Type the order number to be displayed first. Following this number, all other order numbers will be displayed in numerical order.
<p>
<b>Limit with Search</b><br>
Type the parameter by which you want to search. For example, type <b>CA</b> to search for all orders originating in the state of California. Only the orders containing the search parameter will be displayed.
<p>
<b>Delete Checked Orders</b><br>
Click this button after checking the order(s) you want to delete. A warning is displayed. Click <b>OK</b> to delete. The deleted order(s) are removed from the <b>Orders</b> page, but remain in the system. <i><b>Hint:</b> To delete an individual order, click the <b>X</b> in the red square beside the order number.</i>
<p>
<b>Archive Checked Orders</b><br>
Click this button after checking the order(s) you want to archive. The order(s) are moved to the <A HREF="order.main.archived.html">Archived Orders</a> section. <i><b>Hint:</b> To archive an individual order, click the black arrow beside the order checkbox.</i>
<p>
<h2>Features</h2>
You can sort the order list by clicking the heading of the column by which you want to sort. For instance, to sort by total price, click the <b>Total</b> heading. This displays the orders by amount in ascending or descending order. To sort in reverse order, click the <b>Total</b> heading again.
<p>
You can view the details of a specific order by clicking the <b>Order Number</b>, <b>User</b>, or <b>Status</b> of that order.<br>
Click the <b>Order Number</b> to access the <a href="order.view.html">View Order</a> page.<br>
Click the <b>User</b> to access the <a href="customer.view.html">View Customer</a> page.<br>
Click the <b>Statu
to access the <a href="item.edit.html">Order Status</a> page.
<p>



<!-- commented out
<p>
<b>Delete False Order</b><br>
Periodically, either through fraud or because an order fell through after it was placed due to product availability problems, an order will need to be deleted and not reported in the order statistics. Select the false order from the list and click on the delete false order button. You will be asked for confirmation to delete this order, because once an order is deleted, it is irretrievable.
</p>
-->



1.2       +10 -7     interchange/dist/lib/UI/pages/admin/search_replace.html


rev 1.2, prev_rev 1.1
Index: search_replace.html
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/admin/search_replace.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- search_replace.html	3 Feb 2002 03:42:49 -0000	1.1
+++ search_replace.html	3 Feb 2002 04:27:55 -0000	1.2
@@ -2,7 +2,7 @@
 [set ui_class]Admin[/set]
 [set page_banner]Search and Replace: Mass-update data in a table[/set]
 [set page_perm]tables[/set]
-[set help_name]genedit[/set]
+[set help_name]table.searchreplace[/set]
 [set icon_name]icon_config.gif[/set]
 [tmp meta_header]
 	[include include/table_populator]
@@ -40,8 +40,8 @@
 
 </td>
 <td>
-[if !value area_table]
-	[value name=area_table set=products hide=1]
+[if !cgi area_table]
+	[value name=area_table set="[either][cgi mv_data_table][or]__ProductFiles_1__[/either]" hide=1]
 	[value name=area_column set=category hide=1]
 [/if]
 <select name="area_table"
@@ -77,7 +77,8 @@
 3. Set what to search for in that column:
 </td>
 <td>
-<input name="search_for" type="text" size="30"> (Perl regular expression, case sensitive)
+<input name="search_for" type="text" size="30"> Case-sensitive? [display name=case_sensitive type=yesno cgi-default=1]
+<br><i>(Exact text match or regular expression)</i>
 </td>
 </tr>
 <tr>
@@ -85,7 +86,8 @@
 4. Choose the replacement string
 </td>
 <td>
-<input name="replace_with" type="text" size="30"> (Perl regular expression, case sensitive)
+<input name="replace_with" type="text" size="30">
+<br><i>(Exact text to be inserted instead of search value. Replaces parenthisized text if parentheses are used.)</i>
 </td>
 </tr>
 <tr>
@@ -123,17 +125,18 @@
 	$Scratch->{try_message} = "Compiling regex";
 	my $sf = $CGI->{search_for};
 	my $rw = $CGI->{replace_with};
+	my $cs = $CGI->{case_sensitive};
 
 	my $regex;
 	if($sf =~ m{(^|[^\\])\(} and $sf =~ m{[^\\]\)}) {
 Debug("regex with parens, '$sf'");
 		$sf =~ s/(.*?)\((.*)\)(.*)/($1)($2)($3)/;
 Debug("regex with parens, now '$sf'");
-		$regex = qr{$sf};
+		$regex = $cs ? qr{$sf} : qr{(?i)$sf};
 	}
 	else {
 Debug("regex without parens, '$sf'");
-		$regex = qr{()($sf)()};
+		$regex = $cs ? qr{()($sf)()} : qr{(?i)()($sf)()}i;
 Debug("regex without parens, now '$sf'");
 	}