From 82daf4f984e9b415ce4958013dd95bfaeb318bb4 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Thu, 26 Aug 2004 22:10:49 +0000 Subject: [PATCH] Feature Request 718739 -- USS Submission Start/End Dates --- docs/create.sql | 18 ++++++++++-------- docs/upgrades/upgrade_6.1.1-6.2.0.sql | 5 ++++- lib/WebGUI/Wobject/USS.pm | 24 ++++++++++++++++++++++-- lib/WebGUI/i18n/English/USS.pm | 20 ++++++++++++++++++++ 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/docs/create.sql b/docs/create.sql index 694b43b54..8fef0dae5 100644 --- a/docs/create.sql +++ b/docs/create.sql @@ -783,6 +783,8 @@ CREATE TABLE USS_submission ( userDefined3 text, userDefined4 text, userDefined5 text, + startDate int(11) default 946710000, + endDate int(11) default 2114406000, PRIMARY KEY (USS_submissionId), KEY test (status,userId) ) TYPE=MyISAM; @@ -792,12 +794,12 @@ CREATE TABLE USS_submission ( -- -INSERT INTO USS_submission VALUES (1,'Talk to the Experts',1076705448,'Admin',3,' Our website contains all of the different methods for reaching us. Our friendly staff will be happy to assist you in any way possible.\r\n\r\n',NULL,NULL,'Approved',0,1004,1076706084,0,1000,'html','http://www.plainblack.com/contact_us','0',NULL,NULL,NULL); -INSERT INTO USS_submission VALUES (2,'Request an Interactive Demonstration CD',1076705448,'Admin',3,'This CD shows all of the excellent features that WebGUI provides and gives you a brief overview of the product. It also provides examples of how the product works and how it can be used in your environment.',NULL,NULL,'Approved',0,1005,1076706084,0,1000,'html','http://www.plainblack.com/presentation_cd','0',NULL,NULL,NULL); -INSERT INTO USS_submission VALUES (3,'Get the Manual',1076705448,'Admin',3,'Ruling WebGUI is the definitive guide to everything WebGUI related. It has been compiled by the experts at Plain Black Software and covers almost all aspects of WebGUI. When you purchase Ruling WebGUI, you will receive updates to this great manual for one full year.',NULL,NULL,'Approved',0,1006,1076706084,0,1000,'html','http://www.plainblack.com/ruling_webgui','0',NULL,NULL,NULL); -INSERT INTO USS_submission VALUES (4,'Purchase Technical Support',1076705448,'Admin',3,'The WebGUI Support Center is there to help you when you get stuck. With a system as large as WebGUI, you\'ll likely have some questions, and our courteous and knowlegable staff is available to answer those questions. And best of all, you get Ruling WebGUI free when you sign up for the Support Center.\r\n\r\n',NULL,NULL,'Approved',0,1007,1076706084,0,1000,'html','http://www.plainblack.com/support_programs','0',NULL,NULL,NULL); -INSERT INTO USS_submission VALUES (5,'Sign Up for Hosting',1076705448,'Admin',3,'We provide professional hosting services for you so you don\'t have to go through the trouble of finding a hoster who likely won\'t know what to do with WebGUI anyway.',NULL,NULL,'Approved',0,1008,1076706084,0,1000,'html','http://www.plainblack.com/hosting','0',NULL,NULL,NULL); -INSERT INTO USS_submission VALUES (6,'Look Great',1076705448,'Admin',3,'Let Plain Black\'s design team build you a professional looking design. Our award-winning designers can get you the look you need on time and on budget, every time.',NULL,NULL,'Approved',0,1009,1076706084,0,1000,'html','http://www.plainblack.com/design','0',NULL,NULL,NULL); +INSERT INTO USS_submission VALUES (1,'Talk to the Experts',1076705448,'Admin',3,' Our website contains all of the different methods for reaching us. Our friendly staff will be happy to assist you in any way possible.\r\n\r\n',NULL,NULL,'Approved',0,1004,1076706084,0,1000,'html','http://www.plainblack.com/contact_us','0',NULL,NULL,NULL,NULL,NULL); +INSERT INTO USS_submission VALUES (2,'Request an Interactive Demonstration CD',1076705448,'Admin',3,'This CD shows all of the excellent features that WebGUI provides and gives you a brief overview of the product. It also provides examples of how the product works and how it can be used in your environment.',NULL,NULL,'Approved',0,1005,1076706084,0,1000,'html','http://www.plainblack.com/presentation_cd','0',NULL,NULL,NULL,NULL,NULL); +INSERT INTO USS_submission VALUES (3,'Get the Manual',1076705448,'Admin',3,'Ruling WebGUI is the definitive guide to everything WebGUI related. It has been compiled by the experts at Plain Black Software and covers almost all aspects of WebGUI. When you purchase Ruling WebGUI, you will receive updates to this great manual for one full year.',NULL,NULL,'Approved',0,1006,1076706084,0,1000,'html','http://www.plainblack.com/ruling_webgui','0',NULL,NULL,NULL,NULL,NULL); +INSERT INTO USS_submission VALUES (4,'Purchase Technical Support',1076705448,'Admin',3,'The WebGUI Support Center is there to help you when you get stuck. With a system as large as WebGUI, you\'ll likely have some questions, and our courteous and knowlegable staff is available to answer those questions. And best of all, you get Ruling WebGUI free when you sign up for the Support Center.\r\n\r\n',NULL,NULL,'Approved',0,1007,1076706084,0,1000,'html','http://www.plainblack.com/support_programs','0',NULL,NULL,NULL,NULL,NULL); +INSERT INTO USS_submission VALUES (5,'Sign Up for Hosting',1076705448,'Admin',3,'We provide professional hosting services for you so you don\'t have to go through the trouble of finding a hoster who likely won\'t know what to do with WebGUI anyway.',NULL,NULL,'Approved',0,1008,1076706084,0,1000,'html','http://www.plainblack.com/hosting','0',NULL,NULL,NULL,NULL,NULL); +INSERT INTO USS_submission VALUES (6,'Look Great',1076705448,'Admin',3,'Let Plain Black\'s design team build you a professional looking design. Our award-winning designers can get you the look you need on time and on budget, every time.',NULL,NULL,'Approved',0,1009,1076706084,0,1000,'html','http://www.plainblack.com/design','0',NULL,NULL,NULL,NULL,NULL); -- -- Table structure for table `WSClient` @@ -1539,12 +1541,12 @@ INSERT INTO template VALUES (2,'Events List','\r\n

INSERT INTO template VALUES (2,'Center Image','\r\n

\r\n
\r\n\r\n\r\n\r\n
\" border=\"0\">
\r\n
\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n \r\n

\">\r\n \r\n\r\n\r\n

\r\n\r\n\r\n\r\n \r\n·\r\n\r\n·\r\n\r\n\r\n\r\n\r\n\r\n

\r\n \r\n \r\n
\"> ()\">
\r\n\r\n','Article',1,1); INSERT INTO template VALUES (1,'Default Article','\r\n

\r\n
\r\n\r\n\r\n\r\n
\r\n \" align=\"right\" border=\"0\">\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n\r\n \r\n

\">\r\n \r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n \r\n·\r\n\r\n·\r\n\r\n\r\n\r\n\r\n\r\n

\r\n
\r\n
\r\n\r\n\r\n\r\n

\r\n \r\n \r\n
\"> ()\">
\r\n\r\n\r\n','Article',1,1); INSERT INTO template VALUES (4,'Linked Image with Caption','\r\n

\r\n
\r\n\r\n\r\n\r\n
\r\n
\r\n \r\n \">\r\n \" border=\"0\">\r\n
\r\n \r\n \" border=\"0\">\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n

\r\n
\r\n
\r\n\r\n\r\n \r\n·\r\n\r\n·\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n \r\n \r\n
\"> ()\">
\r\n\r\n\r\n\r\n','Article',1,1); -INSERT INTO template VALUES (1,'Default USS','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n
\r\n\r\n\r\n \"> ·\r\n\r\n\r\n\">\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \"> \r\n \r\n ()\r\n \r\n\">
\r\n\r\n\r\n

\r\n · · \r\n
\r\n
\r\n','USS',1,1); +INSERT INTO template VALUES (1,'Default USS','

·
()
* ()

','USS',1,1); INSERT INTO template VALUES (16,'FAQ','\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n \n \">

\r\n\r\n\r\n

    \r\n\r\n
  • \">\r\n\r\n
\r\n

\r\n\r\n\r\n\r\n\r\n \n \n [\">]\n \n \n [\">]\n \n \r\n\r\n \">
\r\n \r\n

[top]

\r\n\r\n\r\n','USS',1,1); INSERT INTO template VALUES (2,'Traditional with Thumbnails','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n \"> ·\r\n\r\n\r\n\">\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \"> \r\n \r\n ()\r\n \r\n\r\n \r\n \">\" border=\"0\">\r\n \r\n \">
\r\n\r\n\r\n

\r\n · · \r\n
\r\n
\r\n\r\n','USS',1,1); INSERT INTO template VALUES (3,'Weblog','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n \"> ·\r\n\r\n\r\n\r\n\">\r\n

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \r\n ()\r\n \r\n
\r\n \r\n \">\" border=\"0\" align=\"right\"/>\r\n \r\n \"> -
\r\n\r\n

( \">\r\n \r\n | \r\n \r\n )

\r\n

\r\n\r\n\r\n

\r\n · \r\n
\r\n
\r\n','USS',1,1); INSERT INTO template VALUES (4,'Photo Gallery','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \"> ·\r\n\r\n\r\n\r\n\">

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n
\r\n \r\n \r\n \">\" border=\"0\"/>
\r\n
\r\n \">\r\n \r\n ()\r\n \r\n
\r\n\r\n\r\n

\r\n · · \r\n
\r\n
\r\n','USS',1,1); -INSERT INTO template VALUES (1,'Default Submission','

\n\n\n
\n: \">
\n:
\n:
\n:
\n
\n\n\n \">«
\n
\n\n \">»
\n
\n\n \">
\n \">
\n
\n\n \">
\n \">
\n
\n\n \">
\n
\n\">
\n\">
\n\n
\n\n \" border=\"0\">

\n\n

\n
\n\n

\n\n','USS/Submission',1,1); +INSERT INTO template VALUES (1,'Default Submission','

','USS/Submission',1,1); INSERT INTO template VALUES (1,'Default Forum','\n \">\n \n • \n \n \">\n \n \">\n \n \n •\n \">\n

\n\n\n\n\n \n \n \n \n \n \n \n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n\n
\">\">\">\">\">
\">\"> @ \n \">\n by \n \n \n \n \">\n \n on @ \n
\n\n\n

\n · · \n
\n
\n\n\n\n','Forum',1,1); INSERT INTO template VALUES (5,'Classifieds','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \"> ·\r\n\r\n\r\n\">

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n
\r\n

\">

\r\n \r\n ()\r\n \r\n
\r\n \r\n \">\" border=\"0\"/ align=\"right\">
\r\n
\r\n\r\n
\r\n\r\n\r\n

\r\n \r\n
\r\n
\r\n','USS',1,1); INSERT INTO template VALUES (15,'Topics','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n \n \">

\r\n\r\n\r\n\r\n\r\n \n \n [\">]\n \n \n [\">]\n \n \r\n

\r\n \r\n

\r\n\r\n\r\n','USS',1,1); diff --git a/docs/upgrades/upgrade_6.1.1-6.2.0.sql b/docs/upgrades/upgrade_6.1.1-6.2.0.sql index 0b1dc006b..ad0f69e33 100644 --- a/docs/upgrades/upgrade_6.1.1-6.2.0.sql +++ b/docs/upgrades/upgrade_6.1.1-6.2.0.sql @@ -275,4 +275,7 @@ INSERT INTO template VALUES (1,'Default Post Preview','

WebGUI::International::get(495), #htmlArea\r\n#2=>WebGUI::International::get(494), #editOnPro2\r\n3=>WebGUI::International::get(887), #midas\r\n4=>WebGUI::International::get(879), #classic\r\n5=>WebGUI::International::get(880),\r\nnone=>WebGUI::International::get(881)\r\n}' WHERE fieldName = 'richEditor'; INSERT INTO template VALUES ('6','HTMLArea 3 (Mozilla / IE)',' \r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n ','richEditor',1,1); alter table page add encryptPage int(11) default 0; - +alter table USS_submission add startDate int(11) default 946710000; +alter table USS_submission add endDate int(11) default 2114406000; +update template set template = '

' where templateId=1 and namespace = 'USS/SubmissionForm'; +update template set template = '

·
()
* ()

' where templateId=1 and namespace='USS'; diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index 1d228b990..552975657 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -569,6 +569,16 @@ sub www_editSubmission { name=>'contentType', value=>[$submission->{contentType}] }); + $var{'startDate.label'} = WebGUI::International::get(497); + $var{'endDate.label'} = WebGUI::International::get(498); + $var{'startDate.form'} = WebGUI::Form::dateTime({ + name => 'startDate', + value => ($submission->{startDate} || $_[0]->get("startDate")) + }); + $var{'endDate.form'} = WebGUI::Form::dateTime({ + name => 'endDate', + value => ($submission->{endDate} || $_[0]->get("endDate")) + }); $var{'form.submit'} = WebGUI::Form::submit(); $var{'form.footer'} = WebGUI::Form::formFooter(); return $_[0]->processTemplate($_[0]->get("submissionFormTemplateId"),\%var,"USS/SubmissionForm"); @@ -610,6 +620,8 @@ sub www_editSubmissionSave { $hash{userDefined3} = $session{form}{userDefined3}; $hash{userDefined4} = $session{form}{userDefined4}; $hash{userDefined5} = $session{form}{userDefined5}; + $hash{startDate} = WebGUI::DateTime::humanToEpoch($session{form}{startDate}); + $hash{endDate} = WebGUI::DateTime::humanToEpoch($session{form}{endDate}); $hash{contentType} = $session{form}{contentType}; $file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{sid}); $file->save("image"); @@ -684,7 +696,7 @@ sub www_view { $var{"submission.edit.label"} = WebGUI::International::get(27,$_[0]->get("namespace")); $p = WebGUI::Paginator->new(WebGUI::URL::page('func=view&wid='.$_[0]->get("wobjectId")),$numResults); $p->setDataByQuery("select USS_submissionId, content, title, userId, status, image, dateSubmitted, dateUpdated, - username, contentType, forumId, userDefined1, userDefined2, userDefined3, userDefined4, userDefined5 from USS_submission + username, contentType, forumId, userDefined1, userDefined2, userDefined3, userDefined4, userDefined5, startDate, endDate from USS_submission where USS_id=".quote($_[0]->get("USS_Id"))." and $constraints order by ".$_[0]->getValue("sortBy")." ".$_[0]->getValue("sortOrder")); $page = $p->getPageData; $i = 0; @@ -716,6 +728,13 @@ sub www_view { .moveDownIcon($quickurl.'moveSubmissionDown'); } } + my $inDateRange; + if ($page->[$i]->{startDate} < WebGUI::DateTime::time() && + $page->[$i]->{endDate} > WebGUI::DateTime::time()) + { + $inDateRange = 1; + } + else { $inDateRange = 0; } push (@submission,{ "submission.id"=>$page->[$i]->{USS_submissionId}, "submission.url"=>WebGUI::URL::page($quickurl.'viewSubmission'), @@ -742,7 +761,8 @@ sub www_view { "submission.thirdColumn"=>(($i+1)%3==0), "submission.fourthColumn"=>(($i+1)%4==0), "submission.fifthColumn"=>(($i+1)%5==0), - 'submission.controls'=>$controls + 'submission.controls'=>$controls, + 'submission.inDateRange'=>$inDateRange }); $i++; } diff --git a/lib/WebGUI/i18n/English/USS.pm b/lib/WebGUI/i18n/English/USS.pm index e4d864ef0..2e5ed5000 100644 --- a/lib/WebGUI/i18n/English/USS.pm +++ b/lib/WebGUI/i18n/English/USS.pm @@ -231,6 +231,10 @@ A translated text label that prompts the user to edit a particular submission. A loop containing each submission.
+submission.inDateRange +A boolean value indicating whether or not the submission is within the specified date range. +

+ submission.id
A unique identifier for this submission.

@@ -794,6 +798,22 @@ A label for the contentType.form variable. A field allowing the user to select the type of content contained in the form.body field.

+startDate.label
+A label for the startDate.form variable. +

+ +startDate.form
+A field allowing the user to select the first date the submission should be visible on the USS list. +

+ +endDate.label
+A label for the endDate.form variable. +

+ +endDate.form
+A field allowing the user to select the last date the submission should be visible on the USS list. +

+ form.submit
A submit button.