diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index d3d2b9b55..84fbd4b2d 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -11,5 +11,6 @@ - Created format and processReplacements subs in the WebGUI::HTML package. - Migrated extra columns to page templates and removed the Extra Column wobject. + - Migrated Link Lists to USS submissions and removed the Link List wobject. diff --git a/docs/upgrades/upgrade_5.5.3-6.0.0.pl b/docs/upgrades/upgrade_5.5.3-6.0.0.pl index bd297bc44..ca572f3ac 100644 --- a/docs/upgrades/upgrade_5.5.3-6.0.0.pl +++ b/docs/upgrades/upgrade_5.5.3-6.0.0.pl @@ -187,6 +187,11 @@ WebGUI::SQL->write("alter table USS_submission add column contentType varchar(35 WebGUI::SQL->write("update USS_submission set contentType='html' where convertCarriageReturns=0"); WebGUI::SQL->write("alter table USS_submission drop column convertCarriageReturns"); WebGUI::SQL->write("insert into incrementer (incrementerId,nextValue) values ('USS_id',$ussId)"); +WebGUI::SQL->write("alter table USS_submission add column userDefined1 text"); +WebGUI::SQL->write("alter table USS_submission add column userDefined2 text"); +WebGUI::SQL->write("alter table USS_submission add column userDefined3 text"); +WebGUI::SQL->write("alter table USS_submission add column userDefined4 text"); +WebGUI::SQL->write("alter table USS_submission add column userDefined5 text"); #-------------------------------------------- @@ -251,6 +256,70 @@ WebGUI::SQL->write("drop table FAQ_question"); WebGUI::SQL->write("delete from incrementer where incrementerId='FAQ_questionId'"); +#-------------------------------------------- +print "\tMigrating Link Lists to USS Submissions.\n" unless ($quiet); +my $sth = WebGUI::SQL->read("select * from template where namespace='LinkList'"); +while (my $template = $sth->hashRef) { + $template->{name} =~ s/Default (.*?)/$1/i; + if ($template->{templateId} < 1000) { + ($template->{templateId}) = WebGUI::SQL->quickArray("select max(templateId) from template where namespace='USS' and templateId<1000"); + $template->{templateId}++; + } else { + ($template->{templateId}) = WebGUI::SQL->quickArray("select max(templateId) from template where namespace='USS'"); + if ($template->{templateId} > 999) { + $template->{templateId}++; + } else { + $template->{templateId} = 1000; + } + } + $template->{template} =~ s/\/\/igs; + $template->{template} =~ s/\//igs; + $template->{template} =~ s/\<\/tmpl\_if\>\s*\<\/tmpl\_if\>/\<\/tmpl_if>/igs; + my $replacement = ' + + [] + + + + '; + $template->{template} =~ s/\\s*\\s*/$replacement/igs; + $replacement = ' + '; + $template->{template} =~ s/\\s*\"\>/$replacement/igs; + $template->{template} =~ s/\/\/igs; + $template->{template} =~ s/\/\/igs; + $template->{template} =~ s/\/\/igs; + $template->{template} =~ s/\/\/igs; + $template->{template} =~ s/\/\/igs; + $template->{template} =~ s/\/\/igs; + WebGUI::SQL->write("insert into template (templateId,name,template,namespace) values (".$template->{templateId}.", + ".quote($template->{name}).", ".quote($template->{template}).", 'USS')"); +} +$sth->finish; +WebGUI::SQL->write("delete from template where namespace='LinkList'"); +my $a = WebGUI::SQL->read("select a.wobjectId,a.groupIdEdit,a.ownerId,a.lastEdited,b.username,a.dateAdded from wobject a left join users b on + a.ownerId=b.userId where a.namespace='LinkList'"); +while (my $data = $a->hashRef) { + $ussId = getNextId("USS_id"); + WebGUI::SQL->write("insert into USS (wobjectId, USS_id, groupToContribute, submissionsPerPage, filterContent, sortBy, sortOrder, + submissionFormTemplateId) values ( + ".$data->{wobjectId}.", $ussId, ".$data->{groupIdEdit}.", 1000, 'none', 'sequenceNumber', 'asc', 3)"); + my $b = WebGUI::SQL->read("select * from LinkList_link"); + while (my $sub = $b->hashRef) { + my $subId = getNextId("USS_submissionId"); + my $forum = WebGUI::Forum->create({}); + WebGUI::SQL->write("insert into USS_submission (USS_submissionId, USS_id, title, username, userId, content, + dateUpdated, dateSubmited, forumId,contentType,userDefined1, userDefined2) values ( $subId, $ussId, ".quote($sub->{name}).", + ".quote($data->{username}).", ".$data->{ownerId}.", ".quote($sub->{description}).", ".$data->{lastEdited}.", + ".$data->{dateAdded}.", ".$forum->get("forumId").", 'html', ".quote($sub->{url}).", ".quote($sub->{newWindow}).")"); + } + $b->finish; +} +$a->finish; +WebGUI::SQL->write("update wobject set namespace='USS' where namespace='LinkList'"); +WebGUI::SQL->write("drop table LinkList"); +WebGUI::SQL->write("drop table LinkList_link"); +WebGUI::SQL->write("delete from incrementer where incrementerId='LinkList_linkId'"); @@ -265,7 +334,7 @@ $conf->set("macros"=>$macros); my $wobjects = $conf->get("wobjects"); my @newWobjects; foreach my $wobject (@{$wobjects}) { - unless ($wobject eq "Item" || $wobject eq "FAQ" || $wobject eq "ExtraColumn") { + unless ($wobject eq "Item" || $wobject eq "FAQ" || $wobject eq "ExtraColumn" || $wobject eq "LinkList") { push(@newWobjects,$wobject); } } @@ -278,7 +347,7 @@ $conf->write; print "\tRemoving unneeded files.\n" unless ($quiet); unlink("../../lib/WebGUI/Operation/Style.pm"); unlink("../../lib/WebGUI/Wobject/Item.pm"); -#unlink("../../lib/WebGUI/Wobject/LinkList.pm"); +unlink("../../lib/WebGUI/Wobject/LinkList.pm"); unlink("../../lib/WebGUI/Wobject/FAQ.pm"); unlink("../../lib/WebGUI/Wobject/ExtraColumn.pm"); diff --git a/docs/upgrades/upgrade_5.5.3-6.0.0.sql b/docs/upgrades/upgrade_5.5.3-6.0.0.sql index 3890ad414..fc5f50148 100644 --- a/docs/upgrades/upgrade_5.5.3-6.0.0.sql +++ b/docs/upgrades/upgrade_5.5.3-6.0.0.sql @@ -50,7 +50,7 @@ insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (25, 'WebGUI', insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (6, 'WebGUI', 656, 611, '12,WebGUI;'); insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (46, 'WebGUI', 696, 651, '66,WebGUI;'); insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (22, 'WebGUI', 672, 627, '12,WebGUI;'); -insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'USS', 61, 71, '71,WebGUI;3,USS;2,USS;21,WebGUI;'); +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'USS', 61, 71, '71,WebGUI;4,USS;3,USS;2,USS;21,WebGUI;'); insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (24, 'WebGUI', 674, 629, '12,WebGUI;'); insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (13, 'WebGUI', 663, 618, '12,WebGUI;'); insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (1, 'SyndicatedContent', 61, 71, '2,SyndicatedContent;21,WebGUI;'); @@ -138,7 +138,7 @@ insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (75, 'WebGUI', insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (76, 'WebGUI', 1065, 1066, '71,WebGUI;73,WebGUI;50,WebGUI;33,WebGUI;'); insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (77, 'WebGUI', 1067, 1068, '71,WebGUI;50,WebGUI;33,WebGUI;'); insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (3, 'MessageBoard', 78, 79, '71,WebGUI;1,MessageBoard;'); - +insert into help (helpId,namespace,titleId,bodyId,seeAlso) values (4, 'USS', 93, 94, '1,USS;'); delete from international where namespace='Item'; update international set namespace='USS', internationalId='83' where namespace='FAQ' and internationalId=9; @@ -153,7 +153,21 @@ INSERT INTO template VALUES (2,'FAQ Submission Form','

\n\n\n \n \n \n \n \n \n \n \n \n \n
\n\n','USS/SubmissionForm'); +delete from international where languageId=1 and namespace='USS' and internationalId=93; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (93,1,'USS','Submission Form Template', 1070199365,NULL); +delete from international where languageId=1 and namespace='USS' and internationalId=94; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (94,1,'USS','The following template variables are available to you when building your submission form templates.\r\n

\r\n\r\nsubmission.isNew
\r\nA condition indicating whether this is a new submission being contributed.\r\n

\r\n\r\nlink.header.label
\r\nA header telling the user they are editing a link.\r\n

\r\n\r\nquestion.header.label
\r\nA header telling the user they are editing a question.\r\n

\r\n\r\nsubmission.header.label
\r\nA header telling the user they are editing a submission.\r\n

\r\n\r\nuser.isVisitor
\r\nA condition indicating whether the current user is a visitor.\r\n

\r\n\r\nvisitorName.label
\r\nA label for the visitorName.form variable.\r\n

\r\n\r\nvisitorName.form
\r\nA text box that allows a visitor (non-logged in user) to enter their own name instead of submitting completely anonymously.\r\n

\r\n\r\nform.header
\r\nAll the information necessary to route the form contents back to WebGUI.\r\n

\r\n\r\nurl.label
\r\nA generic label for a URL field.\r\n

\r\n\r\nnewWindow.label
\r\nA generic label for a field asking the user whether they would like links to pop up new windows.\r\n

\r\n\r\nuserDefined1.form - userDefined5.form
\r\nA series of generic text fields that can be used to extend the functionality of the USS.\r\n

\r\n\r\nuserDefined1.form.yesNo - userDefined5.form.yesNo
\r\nYes / No versions of the user defined fields.\r\n

\r\n\r\nuserDefined1.form.textarea - userDefined5.form.textarea
\r\nTextarea versions of the user defined fields.\r\n

\r\n\r\nuserDefined1.value - userDefined5.value
\r\nThe raw values of the user defined fields.\r\n

\r\n\r\nquestion.label
\r\nA label prompting the user to enter a question.\r\n

\r\n\r\ntitle.label
\r\nA label prompting the user to enter a title.\r\n

\r\n\r\ntitle.form
\r\nA text field for titles or headers for each submission.\r\n

\r\n\r\ntitle.form.textarea
\r\nA textarea version of the title.form field.\r\n

\r\n\r\ntitle.value
\r\nThe raw value of the title field.\r\n

\r\n\r\nbody.label
\r\nA label for the body.form variable.\r\n

\r\n\r\nanswer.label
\r\nAnother label for the body.form variable.\r\n

\r\n\r\ndescription.label
\r\nAnother label for the body.form variable.\r\n

\r\n\r\nbody.form
\r\nAn HTML Area field allowing the user to enter descriptive content of this submission.\r\n

\r\n\r\nbody.value
\r\nThe raw content of the body.form field.\r\n

\r\n\r\nbody.form.textarea
\r\nA textarea version of body.form.\r\n

\r\n\r\nimage.label
\r\nA label for the image.form variable.\r\n

\r\n\r\nimage.form
\r\nA field allowing the user to pick an image from his/her hard drive.\r\n

\r\n\r\nattachment.label
\r\nA label for the attachment.form variable.\r\n

\r\n\r\nattachment.form
\r\nA field allowing the user to pick a file from his/her hard drive to attach to this submission.\r\n

\r\n\r\ncontentType.label
\r\nA label for the contentType.form variable.\r\n

\r\n\r\ncontentType.form
\r\nA field allowing the user to select the type of content contained in the form.body field.\r\n

\r\n\r\nform.submit
\r\nA submit button.\r\n

\r\n\r\nform.footer
\r\nThe bottom of the form.\r\n

\r\n', 1070199365,NULL); +delete from international where languageId=1 and namespace='USS' and internationalId=75; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (75,1,'USS','This is the listing of template variables available in user submission system templates.\r\n

\r\n\r\nreadmore.label
\r\nA translated label that indicates that the user should click to read more.\r\n

\r\n\r\nresponses.label
\r\nA translated label that indicates that the user should click to view the responses to this submission.\r\n

\r\n\r\ncanPost
\r\nA condition that indicates whether a user can add a new submission.\r\n

\r\n\r\npost.url
\r\nThe URL to add a new submission.\r\n

\r\n\r\npost.label
\r\nA translated label for the post link.\r\n

\r\n\r\naddquestion.label
\r\nA translated label that prompts the user to add a question to the USS.\r\n

\r\n\r\naddlink.label
\r\nA translated label that prompts the user to add a link to the USS.\r\n

\r\n\r\nsearch.label
\r\nA translated label for the search link.\r\n

\r\n\r\nsearch.url
\r\nThe URL to toggle on/off WebGUI\'s power search form.\r\n

\r\n\r\nsearch.form
\r\nWebGUI\'s power search form.\r\n

\r\n\r\nrss.url
\r\nThe URL to generate an RSS feed from the content in the USS.\r\n

\r\n\r\ncanModerate
\r\nA condition indicating whether the current user has the rights to moderate posts in this USS.\r\n

\r\n\r\ntitle.label
\r\nA translated label for the title column.\r\n

\r\n\r\nthumbnail.label
\r\nA translated label for the thumbnail column.\r\n

\r\n\r\ndate.label
\r\nA translated label for the date column.\r\n

\r\n\r\ndate.updated.label
\r\nThe translated label indicating what date this submission was last edited.\r\n

\r\n\r\nby.label
\r\nA translated label stating who the submission was submitted by.\r\n

\r\n\r\nsubmission.edit.label
\r\nA translated text label that prompts the user to edit a particular submission.\r\n

\r\n\r\nsubmissions_loop
\r\nA loop containing each submission.\r\n

\r\n\r\nsubmission.id
\r\nA unique identifier for this submission.\r\n

\r\n\r\nsubmission.url
\r\nThe URL to view this submission.\r\n

\r\n\r\nsubmission.content
\r\nThe abbreviated text content of this submission.\r\n

\r\n\r\nsubmission.content.full
\r\nThe full text content of this submission.\r\n

\r\n\r\n\r\nsubmission.responses
\r\nThe number of responses to this submission.\r\n

\r\n\r\nsubmission.title
\r\nThe title for this submission.\r\n

\r\n\r\nsubmission.userDefined1 - submission.userDefined5
\r\nA series of user defined fields to add custom functionality to the USS.\r\n

\r\n\r\nsubmission.userId
\r\nThe user id of the user that posted this submission.\r\n

\r\n\r\nsubmission.username
\r\nThe username of the person that posted this submission.\r\n

\r\n\r\nsubmission.status
\r\nThe status of this submission (approved, pending, denied).\r\n

\r\n\r\nsubmission.thumbnail
\r\nThe thumbnail of the image uploaded with this submission (if any).\r\n

\r\n\r\nsubmission.image
\r\nThe URL of the image attached to this submission.\r\n

\r\n\r\n\r\nsubmission.date
\r\nThe that this submission was posted.\r\n

\r\n\r\nsubmission.date.updated
\r\nA human readable date that displays the date and time this submission was last edited.\r\n

\r\n\r\nsubmission.currentUser
\r\nA condition indicating whether the current user is the same as the user that posted this submission.\r\n

\r\n\r\nsubmission.userProfile
\r\nThe URL to the profile of the user that posted this submission.\r\n

\r\n\r\nsubmission.edit.url
\r\nThe URL to edit this submission.\r\n

\r\n\r\n\r\nsubmission.secondColumn
\r\nA condition indicating whether or not this submission would belong in the second column, in a multi-column layout.\r\n

\r\n\r\nsubmission.thirdColumn
\r\nA condition indicating whether or not this submission would belong in the third column, in a multi-column layout.\r\n

\r\n\r\nsubmission.fourthColumn
\r\nA condition indicating whether or not this submission would belong in the fourth column, in a multi-column layout.\r\n

\r\n\r\nsubmission.fifthColumn
\r\nA condition indicating whether or not this submission would belong in the fifth column, in a multi-column layout.\r\n

\r\n\r\nsubmission.controls
\r\nThe administrative toolbar for each submission.\r\n

\r\n\r\n

\r\n

\r\n\r\n\r\nfirstPage
\r\nA link to the first page in the paginator.\r\n

\r\n\r\nlastPage
\r\nA link to the last page in the paginator.\r\n

\r\n\r\nnextPage
\r\nA link to the next page forward in the paginator.\r\n

\r\n\r\npreviousPage
\r\nA link to the next page backward in the paginator.\r\n

\r\n\r\npageList
\r\nA list of links to all the pages in the paginator.\r\n

\r\n\r\nmultiplePages
\r\nA conditional indicating whether there is more than one page in the paginator.\r\n

\r\n', 1070197639,NULL); +delete from international where languageId=1 and namespace='USS' and internationalId=77; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (77,1,'USS','The following are the template variables used in a submission template. Submission templates are used to display the individual submissions in a user submission system.\r\n

\r\n\r\ntitle
\r\nThe title of this submission.\r\n

\r\n\r\ncontent
\r\nThe full text content of this submission.\r\n

\r\n\r\nuser.label
\r\nThe translated label indicating what user posted this submission.\r\n

\r\n\r\nuser.profile
\r\nThe URL to the profile of the user that posted this submission.\r\n

\r\n\r\nuser.username
\r\nThe username of the user that posted this submission.\r\n

\r\n\r\nuser.id
\r\nThe unique identifier for the user that posted this submission.\r\n

\r\n\r\ndate.label
\r\nThe translated label indicating what date this submission was posted.\r\n

\r\n\r\ndate.epoch
\r\nThe number of seconds since January 1, 1970 that this submission was posted.\r\n

\r\n\r\ndate.human
\r\nA human readable date that displays the date and time this submission was posted.\r\n

\r\n\r\ndate.updated.label
\r\nThe translated label indicating what date this submission was last edited.\r\n

\r\n\r\ndate.updated.epoch
\r\nThe number of seconds since January 1, 1970 that this submission was last edited.\r\n

\r\n\r\ndate.updated.human
\r\nA human readable date that displays the date and time this submission was last edited.\r\n

\r\n\r\nstatus.label
\r\nA translated label indicating the status of this submission.\r\n

\r\n\r\nstatus.status
\r\nThe actual status of this submission (pending, approved, denied).\r\n

\r\n\r\nviews.label
\r\nA translated label indicating how many times this submission has been viewed.\r\n

\r\n\r\nviews.count
\r\nThe number of times this submission has been viewed.\r\n

\r\n\r\ncanPost
\r\nAn condition indicating whether or not this user can post a new submission.\r\n

\r\n\r\npost.url
\r\nThe URL to post a new submission.\r\n

\r\n\r\npost.label
\r\nA translated label for the post link.\r\n

\r\n\r\nprevious.more
\r\nAn condition indicating whether there are any posts prior to this one available for viewing.\r\n

\r\n\r\nprevious.url
\r\nA URL to the post that came before this one.\r\n

\r\n\r\nprevious.label
\r\nA translated label for the previous link.\r\n

\r\n\r\nnext.more
\r\nA condition indicating whether there are any posts after this one available for viewing.\r\n

\r\n\r\nnext.url
\r\nThe URL to the post that came after this one.\r\n

\r\n\r\nnext.label
\r\nA translated label for the next link.\r\n

\r\n\r\ncanEdit
\r\nA condition indicating whether the current user cane edit or delete this post.\r\n

\r\n\r\nedit.url
\r\nThe URL to edit this post.\r\n

\r\n\r\nedit.label
\r\nA translated label for the edit link.\r\n

\r\n\r\ndelete.url
\r\nThe URL to delete this post.\r\n

\r\n\r\ndelete.label
\r\nA translated label for the delete link.\r\n

\r\n\r\ncanChangeStatus
\r\nA condition indicating whether the current user has the privileges to change the status of this post.\r\n

\r\n\r\napprove.url
\r\nThe URL to approve this post.\r\n

\r\n\r\napprove.label
\r\nA translated label for the approve link.\r\n

\r\n\r\ndeny.url
\r\nThe URL to deny this post.\r\n

\r\n\r\ndeny.label
\r\nA translated label for the deny link.\r\n

\r\n\r\nleave.url
\r\nThe URL to leave this post in it\'s current state.\r\n

\r\n\r\nleave.label
\r\nA translated label for the leave link.\r\n

\r\n\r\ncanReply
\r\nA condition indicating whether the current user can reply to this post.\r\n

\r\n\r\nreply.url
\r\nThe URL to reply to this post.\r\n

\r\n\r\nreply.label
\r\nA translated label for the reply link.\r\n

\r\n\r\nsearch.url
\r\nThe URL to toggle on the WebGUI power search form.\r\n

\r\n\r\nsearch.label
\r\nA translated label for the search link.\r\n

\r\n\r\nback.url
\r\nThe URL to return the user to the main listing.\r\n

\r\n\r\nback.label
\r\nA translated label for the back link.\r\n

\r\n\r\nreplies
\r\nA complete listing of all replies to this post.\r\n

\r\n\r\nuserDefined1.value - userDefined5.value
\r\nA series of user defined values that can be used to extend the functionality of the USS.\r\n

\r\n\r\nimage.url
\r\nThe URL to the attached image.\r\n

\r\n\r\nimage.thumbnail
\r\nThe URL to the attached image\'s thumbnail.\r\n

\r\n\r\nattachment.box
\r\nA standard WebGUI attachment box which displays the icon for the file, and the filename, along with an attachment icon and all are linked to the file.\r\n

\r\n\r\nattachment.url
\r\nThe URL to the attached file.\r\n

\r\n\r\nattachment.icon
\r\nThe icon that represents the attached file\'s type.\r\n

\r\n\r\nattachment.name
\r\nThe filename of the attached file.\r\n

\r\n\r\n\r\n', 1070197000,NULL); - - +delete from international where languageId=1 and namespace='USS' and internationalId=71; +insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (71,1,'USS','User Submission Systems (USS) are a great way to add a sense of community to any site as well as get free content from your users. The User Submission System name is misleading to some people, because they immediately think of users as visitors. However, users are also staff, or business partners, or even yourself. With the USS you can select who can add new content, and even who can moderate that content.\r\n

\r\nUser Submission systems are so versatile that they allow you to create all kinds of applications, just by editing a few templates. Example applications are Photo Galleries, FAQs, Link Lists, Guest Books, Classifieds, and more.\r\n\r\n\r\n

\r\nSubmission Template
\r\nChoose a layout for the individual submissions.\r\n

\r\n\r\nSubmission Form Template
\r\nChoose a layout of the form users see when submitting content.\r\n

\r\n\r\n\r\nSubmissions Per Page
\r\nHow many submissions should be listed per page in the submissions index?\r\n

\r\n\r\n\r\nFilter Content
\r\nSelect the level of content filtering you wish to perform on all submitted content.\r\n

\r\n\r\nSort By
\r\nThe field to sort the submission list by.\r\n

\r\n\r\nSort Order
\r\nThe direction to sort the submission list by.\r\n

\r\n\r\n\r\n\r\n\r\nWho can approve?
\r\nWhat group is allowed to approve and deny content?\r\n

\r\n\r\nWho can contribute?
\r\nWhat group is allowed to contribute content?\r\n

\r\n\r\n\r\nDefault Status
\r\nShould submissions be set to Approved, Pending, or Denied by default?\r\n

\r\nNote: If you set the default status to Pending, then be prepared to monitor your message log for new submissions.\r\n

\r\n\r\nKarma Per Submission
\r\nHow much karma should be given to a user when they contribute to this user submission system?\r\n

\r\n\r\n\r\nAllow discussion?
\r\nChecking this box will enable responses to your article much like Articles on Slashdot.org.\r\n

\r\n\r\n\r\n', 1070199700,NULL); diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index 6678dde6f..eefd4e200 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -14,7 +14,7 @@ uploadsPath = /data/WebGUI/www/uploads authMethods = LDAP, WebGUI -wobjects = Article, EventsCalendar, ExtraColumn, FileManager, HttpProxy, \ +wobjects = Article, EventsCalendar, FileManager, HttpProxy, \ DataForm, MessageBoard, Poll, Product, SiteMap, \ SQLReport, Survey, SyndicatedContent, USS, WobjectProxy diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index b674db4e9..889ee28a1 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -335,9 +335,8 @@ sub www_editSubmission { return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute")) || $submission->{userId} == $session{user}{userId} || WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"))); + $var{'link.header.label'} = WebGUI::International::get(90,$_[0]->get("namespace")); $var{'question.header.label'} = WebGUI::International::get(84,$_[0]->get("namespace")); - $var{'question.label'} = WebGUI::International::get(85,$_[0]->get("namespace")); - $var{'answer.label'} = WebGUI::International::get(86,$_[0]->get("namespace")); $var{'submission.header.label'} = WebGUI::International::get(19,$_[0]->get("namespace")); $var{'user.isVisitor'} = ($session{user}{userId} == 1); $var{'visitorName.label'} = WebGUI::International::get(438); @@ -357,6 +356,74 @@ sub www_editSubmission { name=>"func", value=>"editSubmissionSave" }); + $var{'url.label'} = WebGUI::International::get(91,$_[0]->get("namespace")); + $var{'newWindow.label'} = WebGUI::International::get(92,$_[0]->get("namespace")); + $var{'userDefined1.form'} = WebGUI::Form::text({ + name=>"userDefined1", + value=>$submission->{userDefined1} + }); + $var{'userDefined1.form.yesNo'} = WebGUI::Form::yesNo({ + name=>"userDefined1", + value=>$submission->{userDefined1} + }); + $var{'userDefined1.form.textarea'} = WebGUI::Form::textarea({ + name=>"userDefined1", + value=>$submission->{userDefined1} + }); + $var{'userDefined2.form'} = WebGUI::Form::text({ + name=>"userDefined2", + value=>$submission->{userDefined2} + }); + $var{'userDefined2.form.yesNo'} = WebGUI::Form::yesNo({ + name=>"userDefined2", + value=>$submission->{userDefined2} + }); + $var{'userDefined2.form.textarea'} = WebGUI::Form::textarea({ + name=>"userDefined2", + value=>$submission->{userDefined2} + }); + $var{'userDefined3.form'} = WebGUI::Form::text({ + name=>"userDefined3", + value=>$submission->{userDefined3} + }); + $var{'userDefined3.form.yesNo'} = WebGUI::Form::yesNo({ + name=>"userDefined3", + value=>$submission->{userDefined3} + }); + $var{'userDefined3.form.textarea'} = WebGUI::Form::textarea({ + name=>"userDefined3", + value=>$submission->{userDefined3} + }); + $var{'userDefined4.form'} = WebGUI::Form::text({ + name=>"userDefined4", + value=>$submission->{userDefined4} + }); + $var{'userDefined4.form.yesNo'} = WebGUI::Form::yesNo({ + name=>"userDefined4", + value=>$submission->{userDefined4} + }); + $var{'userDefined4.form.textarea'} = WebGUI::Form::textarea({ + name=>"userDefined4", + value=>$submission->{userDefined4} + }); + $var{'userDefined5.form'} = WebGUI::Form::text({ + name=>"userDefined5", + value=>$submission->{userDefined5} + }); + $var{'userDefined5.form.yesNo'} = WebGUI::Form::yesNo({ + name=>"userDefined5", + value=>$submission->{userDefined5} + }); + $var{'userDefined5.form.textarea'} = WebGUI::Form::textarea({ + name=>"userDefined5", + value=>$submission->{userDefined5} + }); + $var{'userDefined1.value'} = $submission->{userDefined1}; + $var{'userDefined2.value'} = $submission->{userDefined2}; + $var{'userDefined3.value'} = $submission->{userDefined3}; + $var{'userDefined4.value'} = $submission->{userDefined4}; + $var{'userDefined5.value'} = $submission->{userDefined5}; + $var{'question.label'} = WebGUI::International::get(85,$_[0]->get("namespace")); $var{'title.label'} = WebGUI::International::get(35,$_[0]->get("namespace")); $var{'title.form'} = WebGUI::Form::text({ name=>"title", @@ -368,11 +435,17 @@ sub www_editSubmission { }); $var{'title.value'} = $submission->{title}; $var{'body.label'} = WebGUI::International::get(31,$_[0]->get("namespace")); + $var{'answer.label'} = WebGUI::International::get(86,$_[0]->get("namespace")); + $var{'description.label'} = WebGUI::International::get(85); $var{'body.value'} = $submission->{content}; $var{'body.form'} = WebGUI::Form::HTMLArea({ name=>"body", value=>$submission->{content} }); + $var{'body.form.textarea'} = WebGUI::Form::textarea({ + name=>"body", + value=>$submission->{content} + }); $var{'image.label'} = WebGUI::International::get(32,$_[0]->get("namespace")); if ($submission->{image} ne "") { $var{'image.form'} = 'save("image"); @@ -477,11 +555,11 @@ sub www_view { $numResults = $_[0]->get("submissionsPerPage"); $var{"readmore.label"} = WebGUI::International::get(46,$_[0]->get("namespace")); $var{"responses.label"} = WebGUI::International::get(57,$_[0]->get("namespace")); - $var{title} = $_[0]->get("title"); - $var{description} = $_[0]->get("description"); $var{canPost} = WebGUI::Privilege::isInGroup($_[0]->get("groupToContribute")); $var{"post.url"} = WebGUI::URL::page('func=editSubmission&sid=new&wid='.$_[0]->get("wobjectId")); $var{"post.label"} = WebGUI::International::get(20,$_[0]->get("namespace")); + $var{"addquestion.label"} = WebGUI::International::get(83,$_[0]->get("namespace")); + $var{"addlink.label"} = WebGUI::International::get(89,$_[0]->get("namespace")); $var{"search.label"} = WebGUI::International::get(364); $var{"search.Form"} = WebGUI::Search::form({wid=>$_[0]->get("wobjectId"),func=>'view',search=>1}); $var{"search.url"} = WebGUI::Search::toggleURL("wid=".$_[0]->get("wobjectId")."&func=view"); @@ -495,7 +573,6 @@ sub www_view { } else { $constraints = "(status='Approved' or (userId=$session{user}{userId} and userId<>1))"; } - $var{"addquestion.label"} = WebGUI::International::get(83,$_[0]->get("namespace")); $var{canModerate} = WebGUI::Privilege::isInGroup($_[0]->get("groupToApprove"),$session{user}{userId}); $var{"title.label"} = WebGUI::International::get(99); $var{"thumbnail.label"} = WebGUI::International::get(52,$_[0]->get("namespace")); @@ -505,7 +582,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 from USS_submission + username, contentType, forumId, userDefined1, userDefined2, userDefined3, userDefined4, userDefined5 from USS_submission where USS_id=".$_[0]->get("USS_Id")." and $constraints order by ".$_[0]->getValue("sortBy")." ".$_[0]->getValue("sortOrder")); $page = $p->getPageData; $i = 0; @@ -544,14 +621,19 @@ sub www_view { "submission.content.full"=>join("\n",@content), "submission.responses"=>$responses, "submission.title"=>$page->[$i]->{title}, + "submission.userDefined1"=>$page->[$i]->{userDefined1}, + "submission.userDefined2"=>$page->[$i]->{userDefined2}, + "submission.userDefined3"=>$page->[$i]->{userDefined3}, + "submission.userDefined4"=>$page->[$i]->{userDefined4}, + "submission.userDefined5"=>$page->[$i]->{userDefined5}, "submission.userId"=>$page->[$i]->{userId}, + "submission.username"=>$page->[$i]->{username}, "submission.status"=>$page->[$i]->{status}, "submission.thumbnail"=>$thumbnail, "submission.image"=>$imageURL, "submission.date"=>epochToHuman($page->[$i]->{dateSubmitted}), "submission.date.updated"=>epochToHuman($page->[$i]->{dateUpdated}), "submission.currentUser"=>($session{user}{userId} == $page->[$i]->{userId}), - "submission.username"=>$page->[$i]->{username}, "submission.userProfile"=>WebGUI::URL::page('op=viewProfile&uid='.$page->[$i]->{userId}), "submission.edit.url"=>WebGUI::URL::page($quickurl.'editSubmission'), "submission.secondColumn"=>(($i+1)%2==0), @@ -697,6 +779,11 @@ sub www_viewSubmission { $var{"search.label"} = WebGUI::International::get(364); $var{"back.url"} = WebGUI::URL::page(); $var{"back.label"} = WebGUI::International::get(28,$_[0]->get("namespace")); + $var{'userDefined1.value'} = $submission->{userDefined1}; + $var{'userDefined2.value'} = $submission->{userDefined2}; + $var{'userDefined3.value'} = $submission->{userDefined3}; + $var{'userDefined4.value'} = $submission->{userDefined4}; + $var{'userDefined5.value'} = $submission->{userDefined5}; if ($submission->{image} ne "") { $file = WebGUI::Attachment->new($submission->{image},$session{form}{wid},$session{form}{sid}); $var{"image.url"} = $file->getURL;