diff --git a/docs/upgrades/upgrade_5.2.5-5.3.0.pl b/docs/upgrades/upgrade_5.2.5-5.3.0.pl
index d7ea7eac0..8fb9ec593 100644
--- a/docs/upgrades/upgrade_5.2.5-5.3.0.pl
+++ b/docs/upgrades/upgrade_5.2.5-5.3.0.pl
@@ -4,6 +4,8 @@ use lib "../../lib";
use Getopt::Long;
use Parse::PlainConfig;
use strict;
+use WebGUI::International;
+use WebGUI::SQL;
use WebGUI::Utility;
@@ -32,4 +34,105 @@ $macros->{PreviousDropMenu} = "PreviousDropMenu";
$macros->{TopDropMenu} = "TopDropMenu";
$macros->{SI} = "SI_scaledImage";
$conf->set("macros"=>$macros);
+my $wobjects = $conf->get("wobjects");
+foreach my $i ($wobjects) {
+ if ($wobjects->[$i] eq "MailForm") {
+ $wobjects->[$i] = "DataForm";
+ }
+}
+$conf->set("wobjects"=>$wobjects);
$conf->write;
+
+
+print "\tRemoving unneeded files.\n" unless ($quiet);
+
+unlink("../../lib/WebGUI/Wobject/MailForm.pm");
+
+
+print "\tMigrating Mail Form to Data Form.\n" unless ($quiet);
+
+WebGUI::Session::open("../../lib",$configFile);
+
+#renaming namespace
+my @sql = (
+ "update wobject set namespace='DataForm' where namespace='MailForm'",
+ "alter table MailForm rename DataForm",
+ "alter table MailForm_entry rename DataForm_entry",
+ "alter table MailForm_entryData rename DataForm_entryData",
+ "alter table MailForm_field rename DataForm_field",
+ "update incrementer set incrementerId='DataForm_entryId' where incrementerId='MailForm_entryId'",
+ "update incrementer set incrementerId='DataForm_fieldId' where incrementerId='MailForm_fieldId'",
+ "alter table DataForm_field change MailForm_fieldId DataForm_fieldId int not null",
+ "alter table DataForm_entryData change MailForm_entryId DataForm_entryId int not null",
+ "alter table DataForm_entry change MailForm_entryId DataForm_entryId int not null",
+ "alter table DataForm drop column storeEntries",
+ "alter table DataForm_field add column isMailField int not null default 0",
+ "alter table DataForm add column mailData int not null default 1",
+ "alter table DataForm_field add column label varchar(255)",
+ "update DataForm_field set label=name"
+ );
+foreach my $query (@sql) {
+ WebGUI::SQL->write($query);
+}
+
+#migrating data
+my $sth = WebGUI::SQL->read("select * from DataForm");
+while (my %dataform = $sth->hash) {
+ my $startInsert = "insert into DataForm_field (wobjectId, DataForm_fieldId, sequenceNumber, name, status, type,
+ defaultValue, width, isMailField, label) values";
+ WebGUI::SQL->write($startInsert." ($dataform{wobjectId}, ".getNext("DataForm_fieldId").", -5, "from",
+ ".quote($dataform{fromStatus}).", "email", ".quote($dataform{fromField}).", $dataform{width}, 1,
+ ".quote(WebGUI::International::get(10,"DataForm")).")");
+ WebGUI::SQL->write($startInsert." ($dataform{wobjectId}, ".getNext("DataForm_fieldId").", -4, "to",
+ ".quote($dataform{toStatus}).", "email", ".quote($dataform{toField}).", $dataform{width}, 1,
+ ".quote(WebGUI::International::get(11,"DataForm")).")");
+ WebGUI::SQL->write($startInsert." ($dataform{wobjectId}, ".getNext("DataForm_fieldId").", -3, "cc",
+ ".quote($dataform{ccStatus}).", "email", ".quote($dataform{ccField}).", $dataform{width}, 1,
+ ".quote(WebGUI::International::get(12,"DataForm")).")");
+ WebGUI::SQL->write($startInsert." ($dataform{wobjectId}, ".getNext("DataForm_fieldId").", -2, "bcc",
+ ".quote($dataform{bccStatus}).", "email", ".quote($dataform{bccField}).", $dataform{width}, 1,
+ ".quote(WebGUI::International::get(13,"DataForm")).")");
+ WebGUI::SQL->write($startInsert." ($dataform{wobjectId}, ".getNext("DataForm_fieldId").", -1, "subject",
+ ".quote($dataform{subjectStatus}).", "text", ".quote($dataform{subjectField}).", $dataform{width}, 1,
+ ".quote(WebGUI::International::get(14,"DataForm")).")");
+ my $i = 1;
+ my $sth2 = WebGUI::SQL->read("select DataForm_fieldId from DataForm_field where wobjectId=$dataform{wobjectId} order by sequenceNumber");
+ while (my ($id) = $sth2->array) {
+ WebGUI::SQL->write("update DataForm_fieldId set sequenceNumber=$i where MailForm_entryId=$id");
+ $i++;
+ }
+ $sth2->finish;
+}
+$sth->finish;
+
+#removing unneeded fields and changing structures for the new data form
+@sql = (
+ "alter table DataForm drop column width",
+ "alter table DataForm drop column fromField",
+ "alter table DataForm drop column fromStatus",
+ "alter table DataForm drop column toField",
+ "alter table DataForm drop column toStatus",
+ "alter table DataForm drop column ccField",
+ "alter table DataForm drop column ccStatus",
+ "alter table DataForm drop column bccField",
+ "alter table DataForm drop column bccStatus",
+ "alter table DataForm drop column subjectField",
+ "alter table DataForm drop column subjectStatus",
+ "alter table DataForm_field change status status varchar(35)",
+ "update DataForm_field set status='hidden' where status=1",
+ "update DataForm_field set status='visible' where status=2",
+ "update DataForm_field set status='editable' where status=3",
+ "update DataForm_field set type='selectList' where type='select'",
+ "alter table DataForm add column templateId int not null default 1",
+ "alter table DataForm_entryData drop column sequenceNumber",
+ "alter table DataForm add column emailTemplateId int not null default 2",
+ "alter table DataForm add column acknowlegementTemplateId int not null default 3",
+ "alter table DataForm_field drop column validation"
+ );
+foreach my $query (@sql) {
+ WebGUI::SQL->write($query);
+}
+
+WebGUI::Session::close();
+
+
diff --git a/docs/upgrades/upgrade_5.2.5-5.3.0.sql b/docs/upgrades/upgrade_5.2.5-5.3.0.sql
index 39e3dbcdb..107a583fb 100644
--- a/docs/upgrades/upgrade_5.2.5-5.3.0.sql
+++ b/docs/upgrades/upgrade_5.2.5-5.3.0.sql
@@ -62,190 +62,6 @@ insert into incrementer values ("themeComponentId",1000);
alter table theme add column webguiVersion varchar(10);
alter table theme add column versionNumber int not null default 0;
alter table themeComponent change id id varchar(255);
-delete from help where helpId=20 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (20, 'WebGUI', 670, 625, '49,WebGUI;');
-delete from help where helpId=1 and namespace='FileManager';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'FileManager', 61, 71, '3,FileManager;2,FileManager;21,WebGUI;');
-delete from help where helpId=28 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (28, 'WebGUI', 678, 633, '1,WebGUI;3,WebGUI;');
-delete from help where helpId=31 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (31, 'WebGUI', 681, 636, '30,WebGUI;1,WebGUI;3,WebGUI;');
-delete from help where helpId=30 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (30, 'WebGUI', 680, 635, '31,WebGUI;');
-delete from help where helpId=25 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (25, 'WebGUI', 675, 630, '60,WebGUI;');
-delete from help where helpId=1 and namespace='Item';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Item', 61, 71, '2,Item;21,WebGUI;');
-delete from help where helpId=6 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (6, 'WebGUI', 656, 611, '12,WebGUI;');
-delete from help where helpId=46 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (46, 'WebGUI', 696, 651, NULL);
-delete from help where helpId=22 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (22, 'WebGUI', 672, 627, '12,WebGUI;');
-delete from help where helpId=1 and namespace='USS';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'USS', 61, 71, '3,USS;2,USS;21,WebGUI;');
-delete from help where helpId=24 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (24, 'WebGUI', 674, 629, '12,WebGUI;');
-delete from help where helpId=1 and namespace='FAQ';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'FAQ', 61, 71, '3,FAQ;2,FAQ;21,WebGUI;');
-delete from help where helpId=13 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (13, 'WebGUI', 663, 618, '12,WebGUI;');
-delete from help where helpId=1 and namespace='SyndicatedContent';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SyndicatedContent', 61, 71, '2,SyndicatedContent;21,WebGUI;');
-delete from help where helpId=1 and namespace='EventsCalendar';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'EventsCalendar', 61, 71, '2,EventsCalendar;3,EventsCalendar;21,WebGUI;');
-delete from help where helpId=1 and namespace='MessageBoard';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'MessageBoard', 61, 71, '2,MessageBoard;21,WebGUI;');
-delete from help where helpId=1 and namespace='LinkList';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'LinkList', 61, 71, '3,LinkList;2,LinkList;21,WebGUI;');
-delete from help where helpId=21 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (21, 'WebGUI', 671, 626, '19,WebGUI;18,WebGUI;27,WebGUI;14,WebGUI;');
-delete from help where helpId=1 and namespace='Article';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Article', 61, 71, '2,Article;21,WebGUI;');
-delete from help where helpId=1 and namespace='ExtraColumn';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'ExtraColumn', 61, 71, '21,WebGUI;');
-delete from help where helpId=27 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (27, 'WebGUI', 677, 632, '1,Article;1,EventsCalendar;1,ExtraColumn;1,FAQ;1,FileManager;1,HttpProxy;1,Item;1,LinkList;1,MailForm;1,MessageBoard;1,Poll;1,Product;1,SiteMap;1,SQLReport;1,Survey;1,SyndicatedContent;1,USS;1,WobjectProxy;21,WebGUI;');
-delete from help where helpId=1 and namespace='Poll';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Poll', 61, 71, '2,Poll;21,WebGUI;');
-delete from help where helpId=1 and namespace='SiteMap';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SiteMap', 61, 71, '2,SiteMap;21,WebGUI;');
-delete from help where helpId=1 and namespace='SQLReport';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SQLReport', 61, 71, '21,WebGUI;');
-delete from help where helpId=18 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (18, 'WebGUI', 668, 623, NULL);
-delete from help where helpId=17 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (17, 'WebGUI', 667, 622, '10,WebGUI;');
-delete from help where helpId=2 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'WebGUI', 652, 607, '12,WebGUI;');
-delete from help where helpId=15 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (15, 'WebGUI', 665, 620, '10,WebGUI;');
-delete from help where helpId=16 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (16, 'WebGUI', 666, 621, '60,WebGUI;9,WebGUI;');
-delete from help where helpId=14 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (14, 'WebGUI', 664, 619, '21,WebGUI;');
-delete from help where helpId=12 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (12, 'WebGUI', 662, 617, '6,WebGUI;29,WebGUI;13,WebGUI;24,WebGUI;22,WebGUI;2,WebGUI;');
-delete from help where helpId=10 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (10, 'WebGUI', 660, 615, '17,WebGUI;15,WebGUI;8,WebGUI;');
-delete from help where helpId=8 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (8, 'WebGUI', 658, 613, '10,WebGUI;32,WebGUI;5,WebGUI;7,WebGUI;');
-delete from help where helpId=9 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (9, 'WebGUI', 659, 614, '19,WebGUI;61,WebGUI;18,WebGUI;16,WebGUI;4,WebGUI;');
-delete from help where helpId=7 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (7, 'WebGUI', 657, 612, '8,WebGUI;');
-delete from help where helpId=32 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (32, 'WebGUI', 682, 637, '8,WebGUI;');
-delete from help where helpId=5 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (5, 'WebGUI', 655, 610, '8,WebGUI;');
-delete from help where helpId=3 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'WebGUI', 653, 608, '1,WebGUI;');
-delete from help where helpId=4 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'WebGUI', 654, 609, '9,WebGUI;');
-delete from help where helpId=1 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'WebGUI', 642, 606, '52,WebGUI;3,WebGUI;');
-delete from help where helpId=29 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (29, 'WebGUI', 679, 634, '12,WebGUI;');
-delete from help where helpId=33 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (33, 'WebGUI', 683, 638, '61,WebGUI;34,WebGUI;35,WebGUI;50,WebGUI;');
-delete from help where helpId=34 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (34, 'WebGUI', 684, 639, '33,WebGUI;');
-delete from help where helpId=35 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (35, 'WebGUI', 685, 640, '33,WebGUI;');
-delete from help where helpId=19 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (19, 'WebGUI', 669, 624, '53,WebGUI;58,WebGUI;57,WebGUI;60,WebGUI;59,WebGUI;');
-delete from help where helpId=1 and namespace='MailForm';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'MailForm', 61, 71, '21,WebGUI;');
-delete from help where helpId=2 and namespace='MailForm';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'MailForm', 62, 72, '1,MailForm;');
-delete from help where helpId=2 and namespace='FileManager';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'FileManager', 72, 73, '1,FileManager;');
-delete from help where helpId=2 and namespace='EventsCalendar';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'EventsCalendar', 72, 73, '4,EventsCalendar;1,EventsCalendar;');
-delete from help where helpId=2 and namespace='FAQ';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'FAQ', 72, 73, '1,FAQ;');
-delete from help where helpId=2 and namespace='LinkList';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'LinkList', 72, 73, '1,LinkList;');
-delete from help where helpId=47 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (47, 'WebGUI', 697, 698, '1,Article;17,WebGUI;1,MessageBoard;1,Poll;2,WebGUI;1,USS;');
-delete from help where helpId=1 and namespace='WobjectProxy';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'WobjectProxy', 5, 6, '21,WebGUI;');
-delete from help where helpId=1 and namespace='Product';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Product', 38, 39, '5,Product;4,Product;6,Product;2,Product;3,Product;7,Product;21,WebGUI;');
-delete from help where helpId=2 and namespace='Product';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Product', 40, 41, '6,Product;1,Product;');
-delete from help where helpId=3 and namespace='Product';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'Product', 42, 43, '1,Product;');
-delete from help where helpId=4 and namespace='Product';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'Product', 44, 45, '1,Product;');
-delete from help where helpId=5 and namespace='Product';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (5, 'Product', 46, 47, '1,Product;');
-delete from help where helpId=6 and namespace='Product';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (6, 'Product', 49, 50, '2,Product;1,Product;');
-delete from help where helpId=7 and namespace='Product';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (7, 'Product', 62, 63, '1,Product;51,WebGUI;');
-delete from help where helpId=1 and namespace='Survey';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Survey', 3, 4, '21,WebGUI;');
-delete from help where helpId=49 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (49, 'WebGUI', 785, 786, '53,WebGUI;54,WebGUI;56,WebGUI;20,WebGUI;61,WebGUI;55,WebGUI;');
-delete from help where helpId=50 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (50, 'WebGUI', 825, 826, '33,WebGUI;');
-delete from help where helpId=2 and namespace='Article';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Article', 72, 73, '1,Article;51,WebGUI;');
-delete from help where helpId=51 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (51, 'WebGUI', 827, 828, '2,Article;3,EventsCalendar;3,FAQ;3,FileManager;2,Item;3,LinkList;2,MessageBoard;7,Product;2,SiteMap;2,SyndicatedContent;33,WebGUI;2,USS;');
-delete from help where helpId=3 and namespace='EventsCalendar';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'EventsCalendar', 94, 95, '1,EventsCalendar;51,WebGUI;');
-delete from help where helpId=3 and namespace='FAQ';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'FAQ', 76, 77, '1,FAQ;51,WebGUI;');
-delete from help where helpId=3 and namespace='FileManager';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'FileManager', 75, 76, '1,FileManager;51,WebGUI;');
-delete from help where helpId=4 and namespace='EventsCalendar';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'EventsCalendar', 96, 97, '2,EventsCalendar;51,WebGUI;');
-delete from help where helpId=2 and namespace='Item';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Item', 73, 74, '1,Item;51,WebGUI;');
-delete from help where helpId=3 and namespace='LinkList';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'LinkList', 75, 76, '1,LinkList;51,WebGUI;');
-delete from help where helpId=2 and namespace='MessageBoard';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'MessageBoard', 73, 74, '1,MessageBoard;51,WebGUI;');
-delete from help where helpId=2 and namespace='SiteMap';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'SiteMap', 72, 73, '1,SiteMap;51,WebGUI;');
-delete from help where helpId=2 and namespace='USS';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'USS', 74, 75, '1,USS;51,WebGUI;');
-delete from help where helpId=3 and namespace='USS';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'USS', 76, 77, '1,USS;51,WebGUI;');
-delete from help where helpId=52 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (52, 'WebGUI', 829, 830, '1,WebGUI;33,WebGUI;');
-delete from help where helpId=53 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (53, 'WebGUI', 831, 832, '49,WebGUI;19,WebGUI;');
-delete from help where helpId=54 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (54, 'WebGUI', 833, 834, '49,WebGUI;');
-delete from help where helpId=55 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (55, 'WebGUI', 835, 836, '49,WebGUI;');
-delete from help where helpId=56 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (56, 'WebGUI', 837, 838, '49,WebGUI;');
-delete from help where helpId=57 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (57, 'WebGUI', 839, 840, '19,WebGUI;');
-delete from help where helpId=58 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (58, 'WebGUI', 841, 842, '19,WebGUI;');
-delete from help where helpId=59 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (59, 'WebGUI', 843, 844, '19,WebGUI;');
-delete from help where helpId=60 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (60, 'WebGUI', 845, 846, '19,WebGUI;16,WebGUI;');
-delete from help where helpId=2 and namespace='SyndicatedContent';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'SyndicatedContent', 72, 73, '1,SyndicatedContent;');
-delete from help where helpId=1 and namespace='HttpProxy';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'HttpProxy', 10, 11, '21,WebGUI;');
-delete from help where helpId=2 and namespace='Poll';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Poll', 73, 74, '1,Poll;51,WebGUI;');
-delete from help where helpId=61 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (61, 'WebGUI', 931, 932, '49,WebGUI;9,WebGUI;33,WebGUI;64,WebGUI;62,WebGUI;63,WebGUI;');
-delete from help where helpId=62 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (62, 'WebGUI', 933, 934, '61,WebGUI;');
-delete from help where helpId=63 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (63, 'WebGUI', 936, 937, '61,WebGUI;');
-delete from help where helpId=64 and namespace='WebGUI';
-insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (64, 'WebGUI', 938, 939, '61,WebGUI;');
delete from international where languageId=1 and namespace='WebGUI' and internationalId=931;
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (931,1,'WebGUI','Themes, Manage', 1050437240);
delete from international where languageId=1 and namespace='WebGUI' and internationalId=932;
@@ -388,9 +204,255 @@ delete from international where languageId=1 and namespace='WebGUI' and internat
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (844,1,'WebGUI','These macros have to do with users and logins.\r\n
\r\n\r\n^a; or ^a(); - My Account Link \r\nA link to your account information. In addition you can change the link text by creating a macro like this ^a("Account Info");. \r\n
\r\n\r\nNOTES: You can also use the special case ^a(linkonly); to return only the URL to the account page and nothing more. Also, the .myAccountLink style sheet class is tied to this macro.\r\n
\r\n\r\n\r\n^AdminText(); \r\nDisplays a small text message to a user who is in admin mode. Example: ^AdminText("You are in admin mode!");\r\n
\r\n\r\n^AdminToggle; or ^AdminToggle(); \r\nPlaces a link on the page which is only visible to content managers and adminstrators. The link toggles on/off admin mode. You can optionally specify other messages to display like this: ^AdminToggle("Edit On","Edit Off");\r\n
\r\n\r\n^CanEditText(); \r\nDisplay a message to a user that can edit the current page.\r\n
\r\nExample: ^CanEditText(^AdminToggle;);\r\n
\r\n\r\n\r\n^GroupText(); \r\nDisplays a small text message to the user if they belong to the specified group. And you can specify an alternate message to those who are not in the group.\r\n
\r\nExample: ^GroupText("Visitors","You need an account to do anything cool on this site!","We value our registered users!");\r\n
\r\n\r\n^L; or ^L(); - Login Box \r\nA small login form. You can also configure this macro. You can set the width of the login box like this ^L(20);. You can also set the message displayed after the user is logged in like this ^L(20,Hi ^a(^@;);. Click %here% if you wanna log out!)\r\n
\r\n\r\nNOTE: The .loginBox style sheet class is tied to this macro.\r\n
\r\n\r\n^LoginToggle; or ^LoginToggle(); \r\nDisplays a "Login" or "Logout" message depending upon whether the user is logged in or not. You can optionally specify other labels like this: ^LoginToggle("Click here to log in.","Click here to log out.");. You can also use the special case ^LoginToggle(linkonly); to return only the URL with no label.\r\n
\r\n\r\n^@; - Username \r\nThe username of the currently logged in user.\r\n
\r\n\r\n\r\n^#; - User ID \r\nThe user id of the currently logged in user.\r\n
\r\n\r\n', 1051222028,NULL);
delete from international where languageId=1 and namespace='WebGUI' and internationalId=832;
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (832,1,'WebGUI','The collateral management system has several macros for its specific purpose.\r\n
\r\n\r\n^File(); \r\nThis macro builds a quick file link. It creates an icon for the file and outputs the files name. Then it links them both to the file for downloading.\r\n\r\n\r\n^I(); \r\nThis macro retrieves an image from the collateral management system along with an HTML image tag so that you can quickly display an image from the repository in your content.\r\n\r\nExample: ^I("logo");\r\n\r\n\r\n^i(); \r\nThis macro retrieves the URL for any file in the collateral management system.\r\n\r\nExample: ^i("status report");\r\n\r\n\r\n\r\n^RandomImage(); \r\nThis macro takes a collateral folder as a parameter. If the folder name is omitted, then the root folder will be used. The macro then randomly chooses an image in the folder and returns it in much the same way the ^I(); macro works.\r\n\r\nExample: ^RandomImage("site headers");\r\n\r\n\r\n^RandomSnippet(); \r\nThis macro takes a collateral folder as a parameter. If the folder name is omitted, then the root folder will be used. The macro then randomly chooses a snippet from the folder and returns it in much the same way the ^Snippet(); macro works.\r\n\r\nExample: ^RandomSnippet("quips");\r\n\r\n\r\n\r\n^SI(); \r\nThe Scaled Image macro allows images to be found in the collateral and scaled (on the server-side), either maintaining the original aspect ratio or an entirely new ratio of your design. \r\n
\r\nIt takes four parameters. The first is the image name or optionally the collateral id. The second is the width. Set the width to "0" to maintain aspect ratio by height. The third is height. Set the height to "0" to maintain aspect ratio by width. The fourth parameter allows you to specify additional parameters to the image.\r\n
\r\nExamples: \r\nRetrieving an image by name (no scaling) \r\n^SI(myimage);\r\n
\r\nRetrieving an image by collateralId (no scaling) \r\n^SI(66);\r\n
\r\nScaling by width, maintaining aspect ratio \r\n^SI(66,25);\r\n
\r\nScaling by height, maintaining aspect ratio \r\n^SI(66,0,25);\r\n
\r\nPlaying with the aspect ratio \r\n^SI(66,148,25);\r\n
\r\n\r\n\r\n^Snippet(); \r\nThis macro retrieves the contents of a snippet in the collateral management system and inserts it into the page.\r\n\r\nExample: ^Snippet("flash code");\r\n\r\n\r\n^Thumbnail(); \r\nThis macro retrieves the URL for the thumbnail of any image in the collateral management system.\r\n\r\nExample: ^Thumbnail("logo");\r\n\r\n\r\n^ThumbnailLinker(); \r\nThis macro builds a quick image viewer using nothing more than the collateral management system. It creates a thumbnail image with the name of the image under it and then links them both to the full sized image. You can also specify a "1" as a second parameter to have the linker create a new window to display the linked image.\r\n\r\nExample: ^ThumbnailLinker("logo");\r\n\r\n\r\n', 1051221379,NULL);
-
-
-
-
+delete from help where namespace='MailForm';
+update international set namespace='DataForm' where namespace='MailForm';
+delete from international where languageId=1 and namespace='DataForm' and internationalId=83;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (83,1,'DataForm','The following template variables are available for Data Form templates.\r\n\r\n\r\nexport.tab.url \r\nFollowing this URL will export the data stored to this data form as a tab delimited file.\r\n
\r\n\r\nexport.tab.label \r\nThe default label for the export.tab.url variable.\r\n
\r\n\r\ncanEdit\r\nA conditional indicating whether the current user has the privileges to edit an existing entry or export the form\'s data.\r\n
\r\n\r\nback.url \r\nA url that will take you back to the default page in the form.\r\n
\r\n\r\nback.label \r\nThe default label for the back.url variable.\r\n
\r\n\r\nusername* \r\nThe username of the user that submitted the data.\r\n
\r\n\r\nuserId* \r\nThe user id of the user that submitted the data.\r\n
\r\n\r\ndate* \r\nThe date that this data was submitted or last updated formatted as the user\'s preferred date/time format.\r\n
\r\n\r\n\r\nepoch* \r\nThe date that this data was submitted or last updated formatted as an epoch date.\r\n
\r\n\r\nipAddress* \r\nThe IP address of the user that submitted the data.\r\n
\r\n\r\nedit.url* \r\nThe URL to the page to edit this entry.\r\n
\r\n\r\nerror_loop* \r\nA loop containing error information, for instance if someone doesn\'t fill out a required field.\r\n
\r\n\r\n
\r\n\r\nerror.message* \r\nAn error message indicating what the user might have done wrong.\r\n\r\n
\r\n\r\naddField.url \r\nThe URL that content managers will visit to add a new field to the form.\r\n
\r\n\r\naddField.label \r\nThe default label for the addField.url variable.\r\n
\r\n\r\nform.start \r\nThe beginning of the form.\r\n
\r\n\r\nfield_loop \r\nA loop containing all of the field information.\r\n
\r\n\r\n
\r\n\r\nfield.form \r\nThe form element for this field.\r\n
\r\n\r\nfield.name \r\nThe name of this field.\r\n
\r\n\r\nfield.value \r\nThe value of this field. If this is new data, then the default value will be used.\r\n
\r\n\r\nfield.label \r\nThe text label for this field.\r\n
\r\n\r\nfield.isHidden \r\nA conditional indicating whether this field is supposed to be hidden. \r\n
\r\n\r\nfield.isDisplayed \r\nA conditional indicating whether this field is supposed to be displayed. \r\n
\r\n\r\nfield.isEditable \r\nA conditional indicating whether this field is editable. \r\n
\r\n\r\nfield.isRequired \r\nA conditional indicating whether this field is required. \r\n
\r\n\r\nfield.isMailField \r\nA conditional indicating whether this field is present only to facilitate sending an email. \r\n
\r\n\r\n\r\nfield.subtext \r\nA description of the field so that users know what to put in the field.\r\n
\r\n\r\nfield.controls \r\nWebGUI\'s administrative controls for this field.\r\n
\r\n\r\n
\r\n\r\nform.send \r\nA form button with the word "send" printed on it.\r\n
\r\n\r\nform.save/b> \r\nA form button with the word "save" printed on it.\r\n
\r\n\r\nform.end \r\nThe end of the form.\r\n
\r\n\r\n*Only available if the user has already submitted the form.', 1052089810,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=84;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (84,1,'DataForm','Export tab delimited.', 1052088598,'Save the data with tabs as separaters.');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=61;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (61,1,'DataForm','Data Form, Add/Edit', 1052065048,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=71;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (71,1,'DataForm','This wobject creates a simple multipurpose data-entry form.\r\n
\r\n\r\nAcknowledgement \r\nThis message will be displayed to the user after they submit their data..\r\n
\r\n\r\nMail entries?\r\nIf set to yes, some additional fields will be added to your form for dealing with email. These fields will then be used to email any date entered into the form to a person of your choice.\r\n
\r\nNOTE: The "To" field that is added as a result of setting this to yes can accept a standard email address, or a WebGUI username or a WebGUI group name.\r\n
\r\n\r\nTemplate \r\nChoose a template for your form.\r\n
\r\n\r\nEmail Template \r\nChoose a template for the data that will be sent via email.\r\n
\r\n\r\nAcknowlegement Template \r\nChoose a template that will be used to display the acknowlegement.\r\n', 1052065048,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=82;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (82,1,'DataForm','Data Form Template', 1052064770,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=81;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (81,1,'DataForm','Acknowlegement Template', 1052064282,'A template to display whatever data there is to display.');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=28;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (28,1,'DataForm','Optional for text area and HTML area.', 1052048005,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=26;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (26,1,'DataForm','Store data?', 1052047897,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=11;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (11,1,'DataForm','To', 1052047848,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=62;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (62,1,'DataForm','Data Form Fields, Add/Edit', 1052047004,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=72;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (72,1,'DataForm','You may add as many additional fields to your Mail Form as you like.\r\n
\r\n\r\nLabel \r\nThis is an informative text label to let the user know what this field represents.\r\n
\r\n\r\nField Name \r\nThe name of this field. It must be unique among all of the other fields on your form.\r\n
\r\n\r\nSubtext \r\nAn extension of the label, this is a description of what should go in the field or optional instructions for the field.\r\n
\r\n\r\nStatus \r\nHidden fields will not be visible to the user, but will be sent in the email.Displayed fields can be seen by the user but not modified. Modifiable fields can be filled in by the user. Required fields must be filled in by the user.\r\nIf you choose Hidden or Displayed, be sure to fill in a Default Value.\r\n
\r\n\r\nType \r\nChoose the type of form element for this field. \r\n
\r\n\r\nWidth \r\nSet the number of characters wide this field will be.\r\n
\r\n\r\nHeight \r\nSet the number of characters tall this field will be. Only used on textarea and HTMLArea.\r\n
\r\n\r\nPossible Values \r\nThis field is used for the list types (like Checkbox List and Select List). Enter the values you wish to appear, one per line.\r\n
\r\n\r\nDefault Value (optional) \r\nEnter the default value (if any) for the field. For Yes/No fields, enter "yes" to select "Yes" and "no" to select "No".\r\n
\r\n\r\n', 1052047004,NULL);
+delete from international where languageId=1 and namespace='WebGUI' and internationalId=827;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (827,1,'WebGUI','Wobject Template', 1052046436,NULL);
+delete from international where languageId=1 and namespace='WebGUI' and internationalId=828;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (828,1,'WebGUI','Most wobjects have templates that allow you to change the layout of the wobject\'s user interface. Those wobjects that do have templates all have a common set of template variables that you can use for layout, as well as their own custom variables. The following is a list of the common template variables shared among all wobjects.\r\n
\r\ntitle \r\nThe title for this wobject.\r\n\r\n\r\ndisplayTitle \r\nA conditional variable for whether or not the title should be displayed.\r\n\r\n\r\ndescription \r\nThe description of this wobject.\r\n\r\n\r\nwobjectId \r\nThe unique identifier that WebGUI uses to control this wobject.\r\n\r\n', 1052046436,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=7;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (7,1,'DataForm','Edit Data Form', 1052045309,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=1;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (1,1,'DataForm','Data Form', 1052045252,NULL);
+delete from international where languageId=1 and namespace='DataForm' and internationalId=80;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (80,1,'DataForm','Email Template', 1052044326,'A template that will construct the email to be sent.');
+delete from international where languageId=1 and namespace='WebGUI' and internationalId=944;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (944,1,'WebGUI','Zip Code', 1051962797,'The American term for "Postal Code". When translating translate as "Postal Code".');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=79;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (79,1,'DataForm','Subtext', 1051482497,'A small piece of text under a form element. Gives extra description.');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=78;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (78,1,'DataForm','Template', 1051479870,'Select a template from the list of templates in the template manager.');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=77;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (77,1,'DataForm','Label', 1051467316,'The text in front of a form field. (Like "Context" or "Message".)');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=76;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (76,1,'DataForm','Add a field.', 1051464925,'As in "Add a field element to this form."');
+delete from international where languageId=1 and namespace='WebGUI' and internationalId=943;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (943,1,'WebGUI','Checkbox', 1051464272,'A form type that allows you to put a check mark in a box.');
+delete from international where languageId=1 and namespace='WebGUI' and internationalId=942;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (942,1,'WebGUI','Radio List', 1051464141,'A form with a list of checkable boxes where only one box can be checked at a time.');
+delete from international where languageId=1 and namespace='WebGUI' and internationalId=941;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (941,1,'WebGUI','Checkbox List', 1051464113,'A form with a list of checkable boxes.');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=75;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (75,1,'DataForm','Required', 1051463599,'A field that cannot be blank.');
+delete from international where languageId=1 and namespace='DataForm' and internationalId=74;
+insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (74,1,'DataForm','Mail data?', 1051463006,'As in, "Do you wish to email someone this data?"');
+delete from international where internationalId=15 and namespace='DataForm';
+delete from international where internationalId=29 and namespace='DataForm';
+delete from international where internationalId=30 and namespace='DataForm';
+delete from international where internationalId=31 and namespace='DataForm';
+delete from international where internationalId=32 and namespace='DataForm';
+delete from international where internationalId=30 and namespace='DataForm';
+delete from international where internationalId=31 and namespace='DataForm';
+delete from international where internationalId=32 and namespace='DataForm';
+delete from international where internationalId=9 and namespace='DataForm';
+delete from international where internationalId=26 and namespace='DataForm';
+delete from help where helpId=20 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (20, 'WebGUI', 670, 625, '49,WebGUI;');
+delete from help where helpId=1 and namespace='FileManager';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'FileManager', 61, 71, '3,FileManager;2,FileManager;21,WebGUI;');
+delete from help where helpId=28 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (28, 'WebGUI', 678, 633, '1,WebGUI;3,WebGUI;');
+delete from help where helpId=31 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (31, 'WebGUI', 681, 636, '30,WebGUI;1,WebGUI;3,WebGUI;');
+delete from help where helpId=30 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (30, 'WebGUI', 680, 635, '31,WebGUI;');
+delete from help where helpId=25 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (25, 'WebGUI', 675, 630, '60,WebGUI;');
+delete from help where helpId=1 and namespace='Item';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Item', 61, 71, '2,Item;21,WebGUI;');
+delete from help where helpId=6 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (6, 'WebGUI', 656, 611, '12,WebGUI;');
+delete from help where helpId=46 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (46, 'WebGUI', 696, 651, NULL);
+delete from help where helpId=22 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (22, 'WebGUI', 672, 627, '12,WebGUI;');
+delete from help where helpId=1 and namespace='USS';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'USS', 61, 71, '3,USS;2,USS;21,WebGUI;');
+delete from help where helpId=24 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (24, 'WebGUI', 674, 629, '12,WebGUI;');
+delete from help where helpId=1 and namespace='FAQ';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'FAQ', 61, 71, '3,FAQ;2,FAQ;21,WebGUI;');
+delete from help where helpId=13 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (13, 'WebGUI', 663, 618, '12,WebGUI;');
+delete from help where helpId=1 and namespace='SyndicatedContent';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SyndicatedContent', 61, 71, '2,SyndicatedContent;21,WebGUI;');
+delete from help where helpId=1 and namespace='EventsCalendar';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'EventsCalendar', 61, 71, '2,EventsCalendar;3,EventsCalendar;21,WebGUI;');
+delete from help where helpId=1 and namespace='MessageBoard';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'MessageBoard', 61, 71, '2,MessageBoard;21,WebGUI;');
+delete from help where helpId=1 and namespace='LinkList';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'LinkList', 61, 71, '3,LinkList;2,LinkList;21,WebGUI;');
+delete from help where helpId=21 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (21, 'WebGUI', 671, 626, '19,WebGUI;18,WebGUI;27,WebGUI;14,WebGUI;');
+delete from help where helpId=1 and namespace='Article';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Article', 61, 71, '2,Article;21,WebGUI;');
+delete from help where helpId=1 and namespace='ExtraColumn';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'ExtraColumn', 61, 71, '21,WebGUI;');
+delete from help where helpId=27 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (27, 'WebGUI', 677, 632, '1,Article;1,EventsCalendar;1,ExtraColumn;1,FAQ;1,FileManager;1,HttpProxy;1,Item;1,LinkList;1,DataForm;1,MessageBoard;1,Poll;1,Product;1,SiteMap;1,SQLReport;1,Survey;1,SyndicatedContent;1,USS;1,WobjectProxy;21,WebGUI;');
+delete from help where helpId=1 and namespace='Poll';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Poll', 61, 71, '2,Poll;21,WebGUI;');
+delete from help where helpId=1 and namespace='SiteMap';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SiteMap', 61, 71, '2,SiteMap;21,WebGUI;');
+delete from help where helpId=1 and namespace='SQLReport';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SQLReport', 61, 71, '21,WebGUI;');
+delete from help where helpId=18 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (18, 'WebGUI', 668, 623, NULL);
+delete from help where helpId=17 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (17, 'WebGUI', 667, 622, '10,WebGUI;');
+delete from help where helpId=2 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'WebGUI', 652, 607, '12,WebGUI;');
+delete from help where helpId=15 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (15, 'WebGUI', 665, 620, '10,WebGUI;');
+delete from help where helpId=16 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (16, 'WebGUI', 666, 621, '60,WebGUI;9,WebGUI;');
+delete from help where helpId=14 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (14, 'WebGUI', 664, 619, '21,WebGUI;');
+delete from help where helpId=12 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (12, 'WebGUI', 662, 617, '6,WebGUI;29,WebGUI;13,WebGUI;24,WebGUI;22,WebGUI;2,WebGUI;');
+delete from help where helpId=10 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (10, 'WebGUI', 660, 615, '17,WebGUI;15,WebGUI;8,WebGUI;');
+delete from help where helpId=8 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (8, 'WebGUI', 658, 613, '10,WebGUI;32,WebGUI;5,WebGUI;7,WebGUI;');
+delete from help where helpId=9 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (9, 'WebGUI', 659, 614, '19,WebGUI;61,WebGUI;18,WebGUI;16,WebGUI;4,WebGUI;');
+delete from help where helpId=7 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (7, 'WebGUI', 657, 612, '8,WebGUI;');
+delete from help where helpId=32 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (32, 'WebGUI', 682, 637, '8,WebGUI;');
+delete from help where helpId=5 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (5, 'WebGUI', 655, 610, '8,WebGUI;');
+delete from help where helpId=3 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'WebGUI', 653, 608, '1,WebGUI;');
+delete from help where helpId=4 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'WebGUI', 654, 609, '9,WebGUI;');
+delete from help where helpId=1 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'WebGUI', 642, 606, '52,WebGUI;3,WebGUI;');
+delete from help where helpId=29 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (29, 'WebGUI', 679, 634, '12,WebGUI;');
+delete from help where helpId=33 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (33, 'WebGUI', 683, 638, '61,WebGUI;34,WebGUI;35,WebGUI;50,WebGUI;');
+delete from help where helpId=34 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (34, 'WebGUI', 684, 639, '33,WebGUI;');
+delete from help where helpId=35 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (35, 'WebGUI', 685, 640, '33,WebGUI;');
+delete from help where helpId=19 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (19, 'WebGUI', 669, 624, '53,WebGUI;58,WebGUI;57,WebGUI;60,WebGUI;59,WebGUI;');
+delete from help where helpId=1 and namespace='DataForm';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'DataForm', 61, 71, '2,DataForm;3,DataForm;21,WebGUI;');
+delete from help where helpId=2 and namespace='DataForm';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'DataForm', 62, 72, '3,DataForm;1,DataForm;');
+delete from help where helpId=2 and namespace='FileManager';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'FileManager', 72, 73, '1,FileManager;');
+delete from help where helpId=2 and namespace='EventsCalendar';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'EventsCalendar', 72, 73, '4,EventsCalendar;1,EventsCalendar;');
+delete from help where helpId=2 and namespace='FAQ';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'FAQ', 72, 73, '1,FAQ;');
+delete from help where helpId=2 and namespace='LinkList';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'LinkList', 72, 73, '1,LinkList;');
+delete from help where helpId=47 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (47, 'WebGUI', 697, 698, '1,Article;17,WebGUI;1,MessageBoard;1,Poll;2,WebGUI;1,USS;');
+delete from help where helpId=1 and namespace='WobjectProxy';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'WobjectProxy', 5, 6, '21,WebGUI;');
+delete from help where helpId=1 and namespace='Product';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Product', 38, 39, '5,Product;4,Product;6,Product;2,Product;3,Product;7,Product;21,WebGUI;');
+delete from help where helpId=2 and namespace='Product';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Product', 40, 41, '6,Product;1,Product;');
+delete from help where helpId=3 and namespace='Product';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'Product', 42, 43, '1,Product;');
+delete from help where helpId=4 and namespace='Product';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'Product', 44, 45, '1,Product;');
+delete from help where helpId=5 and namespace='Product';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (5, 'Product', 46, 47, '1,Product;');
+delete from help where helpId=6 and namespace='Product';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (6, 'Product', 49, 50, '2,Product;1,Product;');
+delete from help where helpId=7 and namespace='Product';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (7, 'Product', 62, 63, '1,Product;51,WebGUI;');
+delete from help where helpId=1 and namespace='Survey';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'Survey', 3, 4, '21,WebGUI;');
+delete from help where helpId=49 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (49, 'WebGUI', 785, 786, '53,WebGUI;54,WebGUI;56,WebGUI;20,WebGUI;61,WebGUI;55,WebGUI;');
+delete from help where helpId=50 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (50, 'WebGUI', 825, 826, '33,WebGUI;');
+delete from help where helpId=2 and namespace='Article';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Article', 72, 73, '1,Article;51,WebGUI;');
+delete from help where helpId=51 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (51, 'WebGUI', 827, 828, '2,Article;3,DataForm;3,EventsCalendar;3,FAQ;3,FileManager;2,Item;3,LinkList;2,MessageBoard;7,Product;2,SiteMap;2,SyndicatedContent;33,WebGUI;2,USS;');
+delete from help where helpId=3 and namespace='EventsCalendar';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'EventsCalendar', 94, 95, '1,EventsCalendar;51,WebGUI;');
+delete from help where helpId=3 and namespace='FAQ';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'FAQ', 76, 77, '1,FAQ;51,WebGUI;');
+delete from help where helpId=3 and namespace='FileManager';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'FileManager', 75, 76, '1,FileManager;51,WebGUI;');
+delete from help where helpId=4 and namespace='EventsCalendar';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'EventsCalendar', 96, 97, '2,EventsCalendar;51,WebGUI;');
+delete from help where helpId=2 and namespace='Item';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Item', 73, 74, '1,Item;51,WebGUI;');
+delete from help where helpId=3 and namespace='LinkList';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'LinkList', 75, 76, '1,LinkList;51,WebGUI;');
+delete from help where helpId=2 and namespace='MessageBoard';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'MessageBoard', 73, 74, '1,MessageBoard;51,WebGUI;');
+delete from help where helpId=2 and namespace='SiteMap';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'SiteMap', 72, 73, '1,SiteMap;51,WebGUI;');
+delete from help where helpId=2 and namespace='USS';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'USS', 74, 75, '1,USS;51,WebGUI;');
+delete from help where helpId=3 and namespace='USS';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'USS', 76, 77, '1,USS;51,WebGUI;');
+delete from help where helpId=52 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (52, 'WebGUI', 829, 830, '1,WebGUI;33,WebGUI;');
+delete from help where helpId=53 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (53, 'WebGUI', 831, 832, '49,WebGUI;19,WebGUI;');
+delete from help where helpId=54 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (54, 'WebGUI', 833, 834, '49,WebGUI;');
+delete from help where helpId=55 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (55, 'WebGUI', 835, 836, '49,WebGUI;');
+delete from help where helpId=56 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (56, 'WebGUI', 837, 838, '49,WebGUI;');
+delete from help where helpId=57 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (57, 'WebGUI', 839, 840, '19,WebGUI;');
+delete from help where helpId=58 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (58, 'WebGUI', 841, 842, '19,WebGUI;');
+delete from help where helpId=59 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (59, 'WebGUI', 843, 844, '19,WebGUI;');
+delete from help where helpId=60 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (60, 'WebGUI', 845, 846, '19,WebGUI;16,WebGUI;');
+delete from help where helpId=2 and namespace='SyndicatedContent';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'SyndicatedContent', 72, 73, '1,SyndicatedContent;');
+delete from help where helpId=1 and namespace='HttpProxy';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'HttpProxy', 10, 11, '21,WebGUI;');
+delete from help where helpId=2 and namespace='Poll';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (2, 'Poll', 73, 74, '1,Poll;51,WebGUI;');
+delete from help where helpId=61 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (61, 'WebGUI', 931, 932, '49,WebGUI;9,WebGUI;33,WebGUI;64,WebGUI;62,WebGUI;63,WebGUI;');
+delete from help where helpId=62 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (62, 'WebGUI', 933, 934, '61,WebGUI;');
+delete from help where helpId=63 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (63, 'WebGUI', 936, 937, '61,WebGUI;');
+delete from help where helpId=64 and namespace='WebGUI';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (64, 'WebGUI', 938, 939, '61,WebGUI;');
+delete from help where helpId=3 and namespace='DataForm';
+insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'DataForm', 82, 83, '2,DataForm;1,DataForm;51,WebGUI;');
diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm
index d6e238df5..e80852f5c 100644
--- a/lib/WebGUI/Form.pm
+++ b/lib/WebGUI/Form.pm
@@ -400,7 +400,7 @@ sub fieldType {
# without adult supervision. =) It was done this way because a huge
# if/elsif construct executes much more quickly than a bunch of
# unnecessary database hits.
- my @types = qw(zipcode text textarea HTMLArea url date email phone integer yesNo selectList radioList checkboxList checkbox);
+ my @types = qw(zipcode text textarea HTMLArea url date email phone integer yesNo selectList radioList checkboxList);
$_[0]->{types} = \@types unless ($_[0]->{types});
foreach $type (@{$_[0]->{types}}) {
if ($type eq "text") {
diff --git a/lib/WebGUI/FormProcessor.pm b/lib/WebGUI/FormProcessor.pm
index 6475b6b85..a58b8e5b3 100644
--- a/lib/WebGUI/FormProcessor.pm
+++ b/lib/WebGUI/FormProcessor.pm
@@ -14,7 +14,7 @@ package WebGUI::FormProcessor;
=cut
-use strict;
+use strict qw(vars subs);
use WebGUI::DateTime;
use WebGUI::HTML;
use WebGUI::Session;
diff --git a/lib/WebGUI/Macro.pm b/lib/WebGUI/Macro.pm
index e4e6167fe..234d8fa65 100644
--- a/lib/WebGUI/Macro.pm
+++ b/lib/WebGUI/Macro.pm
@@ -33,7 +33,9 @@ NOTE: This entire system is likely to be replaced in the near future. It has se
=head1 SYNOPSIS
use WebGUI::Macro;
+ $html = WebGUI::Macro::filter($html);
@array = WebGUI::Macro::getParams($parameterString);
+ $html = WebGUI::Macro::negate($html);
$html = WebGUI::Macro::process($html);
=head1 METHODS
diff --git a/lib/WebGUI/Wobject.pm b/lib/WebGUI/Wobject.pm
index c61c3c5cf..c327a5bfe 100644
--- a/lib/WebGUI/Wobject.pm
+++ b/lib/WebGUI/Wobject.pm
@@ -714,7 +714,7 @@ sub processMacros {
#-------------------------------------------------------------------
-=head2 processTemplate ( templateId, vars )
+=head2 processTemplate ( templateId, vars [ , namespace ] )
Returns the content generated from this template.
@@ -730,6 +730,10 @@ An id referring to a particular template in the templates table.
A hash reference containing variables and loops to pass to the template engine.
+=item namespace
+
+A namespace to use for the template. Defaults to the wobject's namespace.
+
=back
=cut
@@ -739,7 +743,8 @@ sub processTemplate {
%{$_[0]->{_property}},
%{$_[2]}
);
- return WebGUI::Template::process(WebGUI::Template::get($_[1],$_[0]->get("namespace")), \%vars);
+ my $namespace = $_[3] || $_[0]->get("namespace");
+ return WebGUI::Template::process(WebGUI::Template::get($_[1],$namespace), \%vars);
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Wobject/DataForm.pm b/lib/WebGUI/Wobject/DataForm.pm
new file mode 100644
index 000000000..50ebbdf14
--- /dev/null
+++ b/lib/WebGUI/Wobject/DataForm.pm
@@ -0,0 +1,575 @@
+package WebGUI::Wobject::DataForm;
+
+#-------------------------------------------------------------------
+# WebGUI is Copyright 2001-2003 Plain Black LLC.
+#-------------------------------------------------------------------
+# Please read the legal notices (docs/legal.txt) and the license
+# (docs/license.txt) that came with this distribution before using
+# this software.
+#-------------------------------------------------------------------
+# http://www.plainblack.com info@plainblack.com
+#-------------------------------------------------------------------
+
+use strict qw(vars subs);
+use Tie::CPHash;
+use Tie::IxHash;
+use WebGUI::DateTime;
+use WebGUI::Form;
+use WebGUI::FormProcessor;
+use WebGUI::HTMLForm;
+use WebGUI::Icon;
+use WebGUI::International;
+use WebGUI::MessageLog;
+use WebGUI::Privilege;
+use WebGUI::Session;
+use WebGUI::SQL;
+use WebGUI::URL;
+use WebGUI::Wobject;
+use WebGUI::Utility;
+
+our @ISA = qw(WebGUI::Wobject);
+
+#-------------------------------------------------------------------
+sub _createField {
+ my $data = $_[0];
+ my %param;
+ $param{name} = WebGUI::URL::urlize($data->{name});
+ $param{name} = "field_".$data->{sequenceNumber} if ($param{name} eq ""); # Empty fieldname not allowed
+ $session{form}{$param{name}} =~ s/\^.*?\;//gs ; # remove macro's from user input
+ $param{value} = $data->{value};
+ $param{size} = $data->{width};
+ $param{rows} = $data->{rows} || 5;
+ $param{columns} = $data->{width};
+ $param{vertical} = 1;
+ if ($data->{type} eq "checkbox") {
+ $param{value} = ($data->{defaultValue} =~ /checked/i) ? 1 : "";
+ }
+ if (isIn($data->{type},qw(selectList checkboxList))) {
+ my @defaultValues;
+ if ($session{form}{$param{name}}) {
+ @defaultValues = $session{cgi}->param($param{name});
+ } else {
+ foreach (split(/\n/, $data->{defaultValue})) {
+ s/\s+$//; # remove trailing spaces
+ push(@defaultValues, $_);
+ }
+ }
+ $param{value} = \@defaultValues;
+ }
+ if (isIn($data->{type},qw(selectList checkboxList radioList))) {
+ delete $param{size};
+ my %options;
+ tie %options, 'Tie::IxHash';
+ foreach (split(/\n/, $data->{possibleValues})) {
+ s/\s+$//; # remove trailing spaces
+ $options{$_} = $_;
+ }
+ $param{options} = \%options;
+ }
+ if ($data->{type} eq "yesNo") {
+ if ($data->{defaultValue} =~ /yes/i) {
+ $param{value} = 1;
+ } elsif ($data->{defaultValue} =~ /no/i) {
+ $param{value} = 0;
+ }
+ }
+ my $cmd = "WebGUI::Form::".$data->{type};
+ return &$cmd(\%param);
+}
+
+#-------------------------------------------------------------------
+sub _fieldAdminIcons {
+ my $fid = $_[1];
+ my $output;
+ $output = deleteIcon('func=deleteField&wid='.$_[0]->get("wobjectId").'&fid='.$fid) unless ($_[2]);
+ $output .= editIcon('func=editField&wid='.$_[0]->get("wobjectId").'&fid='.$fid)
+ .moveUpIcon('func=moveFieldUp&wid='.$_[0]->get("wobjectId").'&fid='.$fid)
+ .moveDownIcon('func=moveFieldDown&wid='.$_[0]->get("wobjectId").'&fid='.$fid);
+ return $output;
+}
+
+#-------------------------------------------------------------------
+sub duplicate {
+ my ($w, %data, $sth);
+ tie %data, 'Tie::CPHash';
+ $w = $_[0]->SUPER::duplicate($_[1]);
+ $w = WebGUI::Wobject::DataForm->new({wobjectId=>$w,namespace=>$_[0]->get("namespace")});
+ $sth = WebGUI::SQL->read("select * from DataForm_field where wobjectId=".$_[0]->get("wobjectId"));
+ while (%data = $sth->hash) {
+ $data{DataForm_fieldId} = "new";
+ $w->setCollateral("DataForm_field","DataForm_fieldId",\%data);
+ }
+ $sth->finish;
+}
+
+#-------------------------------------------------------------------
+sub getTemplateVars {
+ my $self = shift;
+ my $var = shift;
+ $var->{error_loop} = [] unless (exists $var->{error_loop});
+ $var->{canEdit} = (WebGUI::Privilege::canEditPage());
+ $var->{"export.tab.url"} = WebGUI::URL::page('func=exportTab&wid='.$self->get("wobjectId"));
+ $var->{"export.tab.label"} = WebGUI::International::get(84,$self->get("namespace"));
+ $var->{"back.url"} = WebGUI::URL::page();
+ $var->{"back.label"} = WebGUI::International::get(18,$self->get("namespace"));
+ $var->{"addField.url"} = WebGUI::URL::page('func=editField&wid='.$self->get("wobjectId"));
+ $var->{"addField.label"} = WebGUI::International::get(76,$self->get("namespace"));
+ $var->{"form.start"} = WebGUI::Form::formHeader()
+ .WebGUI::Form::hidden({name=>"wid",value=>$self->get("wobjectId")})
+ .WebGUI::Form::hidden({name=>"func",value=>"process"});
+ my @fields;
+ my $where = "where a.wobjectId=".$self->get("wobjectId");
+ my $select = "select a.name, a.label, a.status, a.isMailField, a.subtext, a.type, a.defaultValue, a.possibleValues, a.width, a.rows";
+ my $join;
+ if ($var->{entryId}) {
+ $var->{"form.start"} .= WebGUI::Form::hidden({name=>"entryId",value=>$var->{entryId}});
+ my $entry = $self->getCollateral("DataForm_entry","DataForm_entryId",$var->{entryId});
+ $var->{ipAddress} = $entry->{ipAddress};
+ $var->{username} = $entry->{username};
+ $var->{userId} = $entry->{userId};
+ $var->{date} = WebGUI::DateTime::epochToHuman($entry->{submissionDate});
+ $var->{epoch} = $entry->{submissionDate};
+ $var->{"edit.URL"} = WebGUI::URL::page('func=view&wid='.$self->get("wobjectId").'&entryId='.$var->{entryId});
+ $where .= " and b.DataForm_entryId=".$var->{entryId};
+ $join = "left join DataForm_entryData as b on a.name=b.name";
+ $select .= ", b.value";
+ }
+ my %data;
+ tie %data, 'Tie::CPHash';
+ my $sth = WebGUI::SQL->read("$select from DataForm_field as a $join $where order by a.sequenceNumber");
+ while (%data = $sth->hash) {
+ my $formValue = $session{form}{WebGUI::URL::urlize($data{name})};
+ if (defined $formValue) {
+ $data{value} = $formValue;
+ } elsif (not exists $data{value}) {
+ $data{value} = $data{defaultValue};
+ }
+ push(@fields,{
+ "field.form" => _createField(\%data),
+ "field.name" => $data{name},
+ "field.value" => $data{value},
+ "field.label" => $data{label},
+ "field.isMailField" => $data{isMailField},
+ "field.isRequired" => ($data{status} eq "required"),
+ "field.isHidden" => ($data{status} eq "hidden" && !$session{var}{adminOn}),
+ "field.isDisplayed" => ($data{status} eq "displayed"),
+ "field.isEditable" => ($data{status} eq "editable"),
+ "field.subtext" => $data{subtext},
+ "field.controls" => $self->_fieldAdminIcons($data{DataForm_fieldId},$data{isMailField})
+ });
+ }
+ $sth->finish;
+ $var->{field_loop} = \@fields;
+ $var->{"form.send"} = WebGUI::Form::submit({value=>WebGUI::International::get(73, $self->get("namespace"))});
+ $var->{"form.save"} = WebGUI::Form::submit();
+ $var->{"form.end"} = "";
+ return $var;
+}
+
+#-------------------------------------------------------------------
+sub name {
+ return WebGUI::International::get(1,$_[0]->get("namespace"));
+}
+
+#-------------------------------------------------------------------
+sub new {
+ my $class = shift;
+ my $property = shift;
+ my $self = WebGUI::Wobject->new(
+ -properties=>$property,
+ -extendedProperties=>{
+ acknowledgement=>{},
+ templateId=>{
+ defaultValue=>1
+ },
+ emailTemplateId=>{
+ defaultValue=>2
+ },
+ acknowlegementTemplateId=>{
+ defaultValue=>3,
+ },
+ mailData=>{
+ defaultValue=>0
+ },
+ }
+ );
+ bless $self, $class;
+}
+
+#-------------------------------------------------------------------
+sub purge {
+ WebGUI::SQL->write("delete from DataForm_field where wobjectId=".$_[0]->get("wobjectId"));
+ WebGUI::SQL->write("delete from DataForm_entry where wobjectId=".$_[0]->get("wobjectId"));
+ WebGUI::SQL->write("delete from DataForm_entryData where wobjectId=".$_[0]->get("wobjectId"));
+ $_[0]->SUPER::purge();
+}
+
+#-------------------------------------------------------------------
+sub sendEmail {
+ my $var = $_[1];
+ my $message = WebGUI::Macro::process($_[0]->processTemplate($_[0]->get("emailTemplateId"),$var));
+ my ($to, $subject, $from, $bcc, $cc);
+ foreach my $row (@{$var->{field_loop}}) {
+ if ($row->{"field.name"} eq "to") {
+ $to = $row->{"field.value"};
+ } elsif ($row->{"field.name"} eq "from") {
+ $from = $row->{"field.value"};
+ } elsif ($row->{"field.name"} eq "cc") {
+ $cc = $row->{"field.value"};
+ } elsif ($row->{"field.name"} eq "bcc") {
+ $bcc = $row->{"field.value"};
+ } elsif ($row->{"field.name"} eq "subject") {
+ $subject = $row->{"field.value"};
+ }
+ }
+ if ($to =~ /\@/) {
+ WebGUI::Mail::send(
+ $to,
+ $subject,
+ $message,
+ $cc,
+ $from,
+ $bcc
+ );
+ } else {
+ my ($userId) = WebGUI::SQL->quickArray("select userId from users where username=".quote($to));
+ my $groupId;
+ # if no user is found, try finding a matching group
+ unless ($userId) {
+ ($groupId) = WebGUI::SQL->quickArray("select groupId from groups where groupName=".quote($to));
+ }
+ unless ($userId || $groupId) {
+ WebGUI::ErrorHandler::warn($_[0]->get("wobjectId").": Unable to send message, no user or group found.");
+ } else {
+ WebGUI::MessageLog::addEntry($userId, $groupId, $subject, $message);
+ }
+ }
+}
+
+#-------------------------------------------------------------------
+sub uiLevel {
+ return 5;
+}
+
+#-------------------------------------------------------------------
+sub www_deleteField {
+ return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
+ return $_[0]->confirm(WebGUI::International::get(19,$_[0]->get("namespace")),
+ WebGUI::URL::page('func=deleteFieldConfirm&wid='.$_[0]->get("wobjectId").'&fid='.$session{form}{fid}));
+}
+
+#-------------------------------------------------------------------
+sub www_deleteFieldConfirm {
+ return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
+ $_[0]->deleteCollateral("DataForm_field","DataForm_fieldId",$session{form}{fid});
+ $_[0]->reorderCollateral("DataForm_field","DataForm_fieldId");
+ return "";
+}
+
+#-------------------------------------------------------------------
+sub www_edit {
+ my $layout = WebGUI::HTMLForm->new;
+ $layout->template(
+ -name=>"templateId",
+ -value=>$_[0]->getValue("templateId"),
+ -namespace=>$_[0]->get("namespace"),
+ -label=>WebGUI::International::get(78,$_[0]->get("namespace")),
+ -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
+ );
+ $layout->template(
+ -name=>"emailTemplateId",
+ -value=>$_[0]->getValue("emailTemplateId"),
+ -namespace=>$_[0]->get("namespace"),
+ -label=>WebGUI::International::get(80,$_[0]->get("namespace")),
+ -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
+ );
+ $layout->template(
+ -name=>"acknowlegementTemplateId",
+ -value=>$_[0]->getValue("acknowlegementTemplateId"),
+ -namespace=>$_[0]->get("namespace"),
+ -label=>WebGUI::International::get(81,$_[0]->get("namespace")),
+ -afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
+ );
+ my $properties = WebGUI::HTMLForm->new;
+ $properties->HTMLArea(
+ -name=>"acknowledgement",
+ -label=>WebGUI::International::get(16, $_[0]->get("namespace")),
+ -value=>($_[0]->get("acknowledgement") || WebGUI::International::get(3, $_[0]->get("namespace")))
+ );
+ $properties->yesNo(
+ -name=>"mailData",
+ -label=>WebGUI::International::get(74,$_[0]->get("namespace")),
+ -value=>$_[0]->getValue("mailData")
+ );
+ if ($_[0]->get("wobjectId") eq "new") {
+ $properties->whatNext(
+ -options=>{
+ addField=>WebGUI::International::get(76,$_[0]->get("namespace")),
+ backToPage=>WebGUI::International::get(745)
+ },
+ -value=>"addField"
+ );
+ }
+ return $_[0]->SUPER::www_edit(
+ -properties=>$properties->printRowsOnly,
+ -layout=>$layout->printRowsOnly,
+ -helpId=>1,
+ -headingId=>7
+ );
+}
+
+#-------------------------------------------------------------------
+sub www_editSave {
+ return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
+ $_[0]->SUPER::www_editSave();
+ if ($session{form}{wid} eq "new") {
+ $_[0]->setCollateral("DataForm_field","DataForm_fieldId",{
+ DataForm_fieldId=>"new",
+ name=>"from",
+ label=>WebGUI::International::get(10,$_[0]->get("namespace")),
+ status=>"editable",
+ isMailField=>1,
+ width=>45,
+ type=>"email"
+ });
+ $_[0]->setCollateral("DataForm_field","DataForm_fieldId",{
+ DataForm_fieldId=>"new",
+ name=>"to",
+ label=>WebGUI::International::get(11,$_[0]->get("namespace")),
+ status=>"hidden",
+ isMailField=>1,
+ width=>45,
+ type=>"email",
+ defaultValue=>$session{setting}{companyEmail}
+ });
+ $_[0]->setCollateral("DataForm_field","DataForm_fieldId",{
+ DataForm_fieldId=>"new",
+ name=>"cc",
+ label=>WebGUI::International::get(12,$_[0]->get("namespace")),
+ status=>"hidden",
+ isMailField=>1,
+ width=>45,
+ type=>"email"
+ });
+ $_[0]->setCollateral("DataForm_field","DataForm_fieldId",{
+ DataForm_fieldId=>"new",
+ name=>"bcc",
+ label=>WebGUI::International::get(13,$_[0]->get("namespace")),
+ status=>"hidden",
+ isMailField=>1,
+ width=>45,
+ type=>"email"
+ });
+ $_[0]->setCollateral("DataForm_field","DataForm_fieldId",{
+ DataForm_fieldId=>"new",
+ name=>"subject",
+ label=>WebGUI::International::get(14,$_[0]->get("namespace")),
+ status=>"editable",
+ isMailField=>1,
+ width=>45,
+ type=>"text",
+ defaultValue=>WebGUI::International::get(2,$_[0]->get("namespace"))
+ });
+ }
+ if ($session{form}{proceed} eq "addField") {
+ return $_[0]->www_editField();
+ }
+ return "";
+}
+
+#-------------------------------------------------------------------
+sub www_editField {
+ return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
+ my ($output, %field, $f, %fieldStatus);
+ tie %field, 'Tie::CPHash';
+ tie %fieldStatus, 'Tie::IxHash';
+
+ %fieldStatus = (
+ "hidden" => WebGUI::International::get(4, $_[0]->get("namespace")),
+ "visible" => WebGUI::International::get(5, $_[0]->get("namespace")),
+ "editable" => WebGUI::International::get(6, $_[0]->get("namespace")),
+ "required" => WebGUI::International::get(75, $_[0]->get("namespace"))
+ );
+ $session{form}{fid} = "new" if ($session{form}{fid} eq "");
+ unless ($session{form}{fid} eq "new") {
+ %field = WebGUI::SQL->quickHash("select * from DataForm_field where DataForm_fieldId=$session{form}{fid}");
+ }
+ $output = helpIcon(2,$_[0]->get("namespace"));
+ $output .= '
';
-
- # get all international text for each field caption
- my %text = (
- from => WebGUI::International::get(10, $_[0]->get("namespace")),
- to => WebGUI::International::get(11, $_[0]->get("namespace")),
- cc => WebGUI::International::get(12, $_[0]->get("namespace")),
- bcc => WebGUI::International::get(13, $_[0]->get("namespace")),
- subject => WebGUI::International::get(14, $_[0]->get("namespace")),
- );
-
- if ($session{var}{adminOn}) {
- $output .= ''
- .WebGUI::International::get(9,$_[0]->get("namespace")).'';
- }
-
- $f = WebGUI::HTMLForm->new();
- $f->hidden("wid",$_[0]->get("wobjectId"));
- $f->hidden('func','send');
-
- foreach my $field (qw(from to cc bcc subject)) {
- if ($_[0]->get("${field}Status") == 1) {
- # Hidden field, don't show on form for security reasons
- } else {
- my $row = '
\u$field:
".$_[0]->get("${field}Field");
- } else {
- # Modifiable Field
- if ($field eq 'content') {
- my $taWidth = $_[0]->get("width") - 9;
- $row .= "top\">".$text{$field}.":
";
- $f->raw($row);
- }
- }
-
- $sth = WebGUI::SQL->read("select * from MailForm_field where wobjectId=".$_[0]->get("wobjectId")." order by sequenceNumber");
- while (%data = $sth->hash) {
- if ($data{status} == 1) {
- # hidden field, don't show on form for security reasons
- $row = "";
- # but show for admins
- if ($session{var}{adminOn}) {
- $row = "