Gossamer Forum
Home : Products : DBMan : Customization :

multi modify mod

Quote Reply
multi modify mod
I'm using the multi modify mod by JP. It works just fine as is. My question is, can you use this mod with your own page layout or do you have to use the auto generate html form?

Thank you
Ed
Quote Reply
Re: [knue] multi modify mod In reply to
i usually use my own layout because i often use the mod to make changes to just a few fields and i want the rest of them hidden. just create your own sub build_html_mult_record_form.
Quote Reply
Re: [delicia] multi modify mod In reply to
Hello delicia,

I tried this before with no luck. This is one of the ways i tried.

sub build_html_mult_record_form {
# --------------------------------------------------------
# Builds a record form based on the config information.
#
my ($output, $field, $name);
my (%rec) = @_;

$output = "<p><table border=1>";

<center>
<input type=hidden NAME="ID2" VALUE="$rec{'ID2'}" MAXLENGTH="5">
<input type=hidden NAME="Date" VALUE="$rec{'Date'}" MAXLENGTH="12">
<table width="1000" border="0" cellspacing="0" cellpadding="3" bgcolor="#E0E0D6">
<tr>
<td colspan=3 bgcolor="#8A148A"></td><td colspan=2 bgcolor="#8A148A"><font color="#ffffff">Master Data Base</font></td><td colspan=3 bgcolor="#8A148A"></td>
</tr>
<tr>
<td>|; print &build_select_field ("Promotion", "$rec{'Promotion'}"); print qq|</td>
<td>|; print &build_select_field ("Pdate", "$rec{'Pdate'}"); print qq|</td>
<td>|; print &build_select_field ("Dino_Pro", "$rec{'Dino_Pro'}"); print qq|</td>
<td colspan="2">Week:<input type="text" name="Week" VALUE="$rec{'Week'}" size="3"></td>
<td></td>
<td colspan="2">Sale:|; print &build_select_field ("Tap", "$in{'Tap'}"); print qq|</td>
</tr>
<tr>
<td colspan="2">Company:<input type="text" name="Company" VALUE="$rec{'Company'}"></td>
<td>|; print &get_all_records_from_dbads; print qq|</td>
<td colspan="2">Phone: <input type="text" name="Phone" VALUE="$rec{'Phone'}"></td>
<td></td>
<td colspan="2">Amount:<input type="text" name="Amount" VALUE="$rec{'Amount'}"></td>
</tr>
<tr>
<td colspan="2">Contact:<input type="text" name="Contact" VALUE="$rec{'Contact'}"></td>
<td></td>
<td colspan="2">Email:<input type="text" name="Email" VALUE="$rec{'Email'}"></td>
<td></td>
|;
if ($per_admin) {
print qq|
<td colspan="2">Collected Date &nbsp<input name="Collected_date" value="$rec{'Collected_date'}" type="text"></td> |;
}
else {
print qq|<td colspan="2"></td>|;
}
print qq|
</tr>
<tr>
<td colspan="2">Address:<input type="text" name="Address" VALUE="$rec{'Address'}"></td>
<td></td>
|;
if ($per_admin) {
print qq|
<td colspan="2">Sales Rep: &nbsp; |; print &build_select_field ("Userid", "$rec{'Userid'}"); print qq|</td>|; print qq| |;
}
print qq|
<td></td>
<td colspan="2">Trigger: &nbsp; |; print &build_checkbox_field ("Trigger", "$rec{'Trigger'}"); print qq|</td>
</tr>
<tr>
<td colspan="2"><p>City:&nbsp;<input type="text" name="CSZ" VALUE="$rec{'CSZ'}"></td>
<td></td>
<td></td>
<td>Jerseys</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><input name="JName1" value="$rec{'JName1'}" size="20" type="text"></td>
<td></td>
<td><input name="JName2" value="$rec{'JName2'}" size="20" type="text"></td>
<td></td>
<td><input name="JName3" value="$rec{'JName3'}" size="20" type="text"></td>
<td></td>
<td><input name="JName4" value="$rec{'JName4'}" size="20" type="text"></td>
<td></td>
</tr>
</table>
<table width="1000" bgcolor="69B310" border="0" cellspacing="2" cellpadding="3">
<tr>
<td colspan="8">Special Inst: <input type="text" name="Special_Inst" VALUE="$rec{'Special_Inst'}" size="120"></td>
</tr>
</table>
</center>

$output .= "</table></p>\n";
return $output;
}


I put my code between the $output, but it did not like that. I tried replacing eveything below the

my ($output, $field, $name);
my (%rec) = @_;

but that didn't do it either.

Any ideals?

thank you,
Ed-
Quote Reply
Re: [knue] multi modify mod In reply to
delicia I tried something different,
I changed html_record_form_mult
From this:

sub html_record_form_mult {
# --------------------------------------------------------
#
my (%rec) = @_;
print &build_html_mult_record_form (%rec);
}

To this:

sub html_record_form_mult {
# --------------------------------------------------------
#
my (%rec) = @_;
print qq|
<center>
<input type=hidden NAME="ID2" VALUE="$rec{'ID2'}" MAXLENGTH="5">
<input type=hidden NAME="Date" VALUE="$rec{'Date'}" MAXLENGTH="12">
<table width="1000" border="0" cellspacing="0" cellpadding="3" bgcolor="#E0E0D6">
<tr>
<td colspan=3 bgcolor="#8A148A"></td><td colspan=2 bgcolor="#8A148A"><font color="#ffffff">Master Data Base</font></td><td colspan=3 bgcolor="#8A148A"></td>
</tr>
<tr>
<td>|; print &build_select_field ("Promotion", "$rec{'Promotion'}"); print qq|</td>
<td>|; print &build_select_field ("Pdate", "$rec{'Pdate'}"); print qq|</td>
<td>|; print &build_select_field ("Dino_Pro", "$rec{'Dino_Pro'}"); print qq|</td>
<td colspan="2">Week:<input type="text" name="Week" VALUE="$rec{'Week'}" size="3"></td>
<td></td>
<td colspan="2">Sale:|; print &build_select_field ("Tap", "$in{'Tap'}"); print qq|</td>
</tr>
<tr>
<td colspan="2">Company:<input type="text" name="Company" VALUE="$rec{'Company'}"></td>
<td>|; print &get_all_records_from_dbads; print qq|</td>
<td colspan="2">Phone: <input type="text" name="Phone" VALUE="$rec{'Phone'}"></td>
<td></td>
<td colspan="2">Amount:<input type="text" name="Amount" VALUE="$rec{'Amount'}"></td>
</tr>
<tr>
<td colspan="2">Contact:<input type="text" name="Contact" VALUE="$rec{'Contact'}"></td>
<td></td>
<td colspan="2">Email:<input type="text" name="Email" VALUE="$rec{'Email'}"></td>
<td></td>
|;
if ($per_admin) {
print qq|
<td colspan="2">Collected Date &nbsp<input name="Collected_date" value="$rec{'Collected_date'}" type="text"></td> |;
}
else {
print qq|<td colspan="2"></td>|;
}
print qq|
</tr>
<tr>
<td colspan="2">Address:<input type="text" name="Address" VALUE="$rec{'Address'}"></td>
<td></td>
|;
if ($per_admin) {
print qq|
<td colspan="2">Sales Rep: &nbsp; |; print &build_select_field ("Userid", "$rec{'Userid'}"); print qq|</td>|; print qq| |;
}
print qq|
<td></td>
<td colspan="2">Trigger: &nbsp; |; print &build_checkbox_field ("Trigger", "$rec{'Trigger'}"); print qq|</td>
</tr>
<tr>
<td colspan="2"><p>City:&nbsp;<input type="text" name="CSZ" VALUE="$rec{'CSZ'}"></td>
<td></td>
<td></td>
<td>Jerseys</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><input name="JName1" value="$rec{'JName1'}" size="20" type="text"></td>
<td></td>
<td><input name="JName2" value="$rec{'JName2'}" size="20" type="text"></td>
<td></td>
<td><input name="JName3" value="$rec{'JName3'}" size="20" type="text"></td>
<td></td>
<td><input name="JName4" value="$rec{'JName4'}" size="20" type="text"></td>
<td></td>
</tr>
</table>
<table width="1000" bgcolor="69B310" border="0" cellspacing="2" cellpadding="3">
<tr>
<td colspan="8">Special Inst: <input type="text" name="Special_Inst" VALUE="$rec{'Special_Inst'}" size="120"></td>
</tr>
</table>
</center>
|;
}

******************************************End*********************************************

This give me the look I wanted and all the information shows in the fields, when I save the changes I get sent to the success page.
When I go and check the records for the changes the records are not there, all the information is gone, only thing there are the |'s.

This step bypass the "sub build_html_mult_record_form" all together but i'm sure there is something in there that I need. I just don't know what.

Thanks
Ed-
Quote Reply
Re: [knue] multi modify mod In reply to
change ALL the input fields from the following EXAMPLE:
Code:
<input type=hidden NAME="Date" VALUE="$rec{'Date'}" MAXLENGTH="12">
<table width="1000" border="0" cellspacing="0" cellpadding="3" bgcolor="#E0E0D6">
<tr>
<td colspan=3 bgcolor="#8A148A"></td><td colspan=2 bgcolor="#8A148A"><font color="#ffffff">Master Data Base</font></td><td colspan=3 bgcolor="#8A148A"></td>
</tr>
<tr>
<td>|; print &build_select_field ("Promotion", "$rec{'Promotion'}"); print qq|</td>

to:
Code:
<input type=hidden NAME="Date-$rec{$db_key}" VALUE="$rec{'Date'}" MAXLENGTH="12">
<table width="1000" border="0" cellspacing="0" cellpadding="3" bgcolor="#E0E0D6">
<tr>
<td colspan=3 bgcolor="#8A148A"></td><td colspan=2 bgcolor="#8A148A"><font color="#ffffff">Master Data Base</font></td><td colspan=3 bgcolor="#8A148A"></td>
</tr>
<tr>
<td>|; print &build_select_field ("Promotion", "$rec{'Promotion'}","$rec{'Promotion'}-$rec{$db_key}"); print qq|</td>

note: -$rec{$db_key} must be part of each field name

i only showed Date and Promotion above, but you must change all of them. the build_select_field etc now has three components instead of two, so be sure you made the changes to each of the build routines (build_select_field, build_radio_field etc) as noted in the multi mod
Quote Reply
Re: [delicia] multi modify mod In reply to
delicia,

I made the changes to all the fields, everything works except for the drop downs and the check box, I'm confused about your comment
"be sure you made the changes to each of the build routines (build_select_field, build_radio_field etc) as noted in the multi mod".
Are you talking about the changes when I installed the mod, (in which case I did) or am I to make new changes?

Thanks,
Ed

Below is the code with the changes:

sub html_record_form_mult {
# --------------------------------------------------------
#
my (%rec) = @_;
print qq|
<center>
<input type=hidden NAME="ID2-$rec{$db_key}" VALUE="$rec{'ID2'}" MAXLENGTH="5">
<input type=hidden NAME="Date-$rec{$db_key}" VALUE="$rec{'Date'}" MAXLENGTH="12">
<table width="1000" border="0" cellspacing="0" cellpadding="3" bgcolor="#E0E0D6">
<tr>
<td colspan=3 bgcolor="#8A148A"></td><td colspan=2 bgcolor="#8A148A"><font color="#ffffff">Master Data Base</font></td><td colspan=3 bgcolor="#8A148A"></td>
</tr>
<tr>
<td>|; print &build_select_field ("Promotion", "$rec{'Promotion'}","$rec{'Promotion'}-$rec{$db_key}"); print qq|</td>
<td>|; print &build_select_field ("Pdate", "$rec{'Pdate'}","$rec{'Pdate'}-$rec{$db_key}"); print qq|</td>
<td>|; print &build_select_field ("Dino_Pro", "$rec{'Dino_Pro'}","$rec{'Dino_Pro'}-$rec{$db_key}"); print qq|</td>
<td colspan="2">Week:<input type="text" name="Week-$rec{$db_key}" VALUE="$rec{'Week'}" size="3"></td>
<td></td>
<td colspan="2">Sale:|; print &build_select_field ("Tap", "$rec{'Tap'}","$rec{'Tap'}-$rec{$db_key}"); print qq|</td>
</tr>
<tr>
<td colspan="2">Company:<input type="text" name="Company-$rec{$db_key}" VALUE="$rec{'Company'}"></td>
<td>|; print &get_all_records_from_dbads; print qq|</td>
<td colspan="2">Phone: <input type="text" name="Phone-$rec{$db_key}" VALUE="$rec{'Phone'}"></td>
<td></td>
<td colspan="2">Amount:<input type="text" name="Amount-$rec{$db_key}" VALUE="$rec{'Amount'}"></td>
</tr>
<tr>
<td colspan="2">Contact:<input type="text" name="Contact-$rec{$db_key}" VALUE="$rec{'Contact'}"></td>
<td></td>
<td colspan="2">Email:<input type="text" name="Email-$rec{$db_key}" VALUE="$rec{'Email'}"></td>
<td></td>
|;
if ($per_admin) {
print qq|
<td colspan="2">Collected Date &nbsp<input name="Collected_date-$rec{$db_key}" value="$rec{'Collected_date'}" type="text"></td> |;
}
else {
print qq|<td colspan="2"></td>|;
}
print qq|
</tr>
<tr>
<td colspan="2">Address:<input type="text" name="Address-$rec{$db_key}" VALUE="$rec{'Address'}"></td>
<td></td>
|;
if ($per_admin) {
print qq|
<td colspan="2">Sales Rep: &nbsp; |; print &build_select_field ("Userid", "$rec{'Userid'}","$rec{'Userid'}-$rec{$db_key}"); print qq|</td>|; print qq| |;
}
print qq|
<td></td>
<td colspan="2">Trigger: &nbsp; |; print &build_checkbox_field ("Trigger", "$rec{'Trigger'}","$rec{'Trigger'}-$rec{$db_key}"); print qq|</td>
</tr>
<tr>
<td colspan="2"><p>City:&nbsp;<input type="text" name="CSZ-$rec{$db_key}" VALUE="$rec{'CSZ'}"></td>
<td></td>
<td></td>
<td>Jerseys</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><input name="JName1-$rec{$db_key}" value="$rec{'JName1'}" size="20" type="text"></td>
<td></td>
<td><input name="JName2-$rec{$db_key}" value="$rec{'JName2'}" size="20" type="text"></td>
<td></td>
<td><input name="JName3-$rec{$db_key}" value="$rec{'JName3'}" size="20" type="text"></td>
<td></td>
<td><input name="JName4-$rec{$db_key}" value="$rec{'JName4'}" size="20" type="text"></td>
<td></td>
</tr>
</table>
<table width="1000" bgcolor="69B310" border="0" cellspacing="2" cellpadding="3">
<tr>
<td colspan="8">Special Inst: <input type="text" name="Special_Inst-$rec{$db_key}" VALUE="$rec{'Special_Inst'}" size="120"></td>
</tr>
</table>
</center>
|;
}


Quote Reply
Re: [knue] multi modify mod In reply to
nothing new. you should have replaced build_select_field, build_radio_field, and build_checkbox_field per attached.

are you using preview mod? if you're using any other mods that affected these build routines you must figure out how to merge the changes so all the mods work together.

Last edited by:

delicia: Oct 28, 2015, 6:57 AM
Quote Reply
Re: [delicia] multi modify mod In reply to
No i'm not running preview mod.
My build_*_fields are the same as in the mod.
I'm not using any other mod that affects these build routines.

I have attached a file with my sub routine, maybe you can see what I'm missing.

thank you,
Ed-
Quote Reply
Re: [knue] multi modify mod In reply to
i need to see the html.pl file that has your sub build_radio_field etc
Quote Reply
Re: [delicia] multi modify mod In reply to
Here you go.

Last edited by:

knue: Oct 28, 2015, 1:12 PM
Quote Reply
Re: [knue] multi modify mod In reply to
sorry wrong file. i guess those subs are in db.cgi. (i have rearranged all the routines so much, i forgot where they were). please upload db.cgi -- i think you have to name it db.txt to upload it, not sure.
Quote Reply
Re: [delicia] multi modify mod In reply to
here you go.

Last edited by:

knue: Oct 28, 2015, 1:46 PM
Quote Reply
Re: [knue] multi modify mod In reply to
i don't see anything wrong with your code. but i'm wondering why you have

print &get_all_records_from_dbads;

in the modify multiple records section? i don't see how that would hurt.

are you really modifying that many fields when you modify multiple records? i just use this to make changes to a few specific fields in each record and i set the rest of the fields as hidden. but that's just me!
Quote Reply
Re: [delicia] multi modify mod In reply to
No thats one I missed.Frown

There are 65 fields in dbads.db when they get copied over to the master i keep just the information of about 9 fields. At some point these field may need to be changed.

Ed
Quote Reply
Re: [knue] multi modify mod In reply to
sorry i couldn't help. i just don't know why the text fields are working and the select fields are not.
Quote Reply
Re: [delicia] multi modify mod In reply to
Thanks for the help, I'll keep working on it, I'm sure something will come up.Smile
i'll keep you posted, i may have some questions for you.

Ed-
Quote Reply
Re: [knue] multi modify mod In reply to
did you get this working? (select fields, etc) if so, what was the fix?
Quote Reply
Re: [delicia] multi modify mod In reply to
No, not yet still working on it. my other problem came up that i need to fix. i'll post my finding (if i do).

Ed-
Quote Reply
Re: [knue] multi modify mod In reply to
what happens to the select fields? do they keep the previous values or do they get deleted? is there any way i could like at your site?
Quote Reply
Re: [delicia] multi modify mod In reply to
no they get deleted.

When i get home i'll send you the link, user id and password.

i'll send it by PM if that will work for you?
Quote Reply
Re: [knue] multi modify mod In reply to
Did you get my PM with the log in information?
Ed-
Quote Reply
Re: [knue] multi modify mod In reply to
couldn't find button for modify multiple records. also, can you turn on debug?
Quote Reply
Re: [delicia] multi modify mod In reply to
sorry for all the trouble. it was my fault. i need to be more careful with copy and paste.
Quote Reply
Re: [delicia] multi modify mod In reply to
i don't think your form can span multiple pages so suggest you modify sub query:

change
# Define the maximum number of hits we will allow, and the next hit counter.
$in{'mh'} ? ($maxhits = $in{'mh'}) : ($maxhits = $db_max_hits);
$in{'nh'} ? ($nh = $in{'nh'}) : ($nh = 1);
$numhits = 0;

to
# Define the maximum number of hits we will allow, and the next hit counter.
# 2015 mod so delete/mod will list all
if ($_[0] eq "mod") { $in{'mh'} = 9999; }
$in{'mh'} ? ($maxhits = $in{'mh'}) : ($maxhits = $db_max_hits);
$in{'nh'} ? ($nh = $in{'nh'}) : ($nh = 1);
$numhits = 0;

this will display all the records on one page when you're doing multimod or when you're deleting. you may need higher number than 9999
Quote Reply
Re: [knue] multi modify mod In reply to
This is the solution that delicia came up with to fix the problem with the data from the dropdown not passing.

The problem is the third part of the item passed in parentheses:
change

&build_select_field ("Promotion", $rec{'Promotion'},"$rec{'Promotion'}-$rec{$db_key}");

to

&build_select_field ("Promotion", "$rec{'Promotion'}","Promotion-$rec{$db_key}");

This did fix the problem! thanks delicia.

Ed