added support for record deletion in DataForm

This commit is contained in:
Hal Roberts 2003-07-25 15:14:40 +00:00
parent ba4a5c7e4b
commit c1f4105699
3 changed files with 19 additions and 0 deletions

View file

@ -10,6 +10,7 @@
- Fixed a relative hyperlink bug in htmlArea (Thanks to Andreas Graf.)
- Ordered the username list in the manageUsersInGroup operation (Thanks to
Andreas Graf.)
- Added support for record deletion in DataForm (Thanks to Hal Roberts.)

View file

@ -110,3 +110,7 @@ insert into international (internationalId,languageId,namespace,message,lastUpda
delete from international where languageId=1 and namespace='SyndicatedContent' and internationalId=71;
INSERT INTO international VALUES (71,'SyndicatedContent',1,'Syndicated content is content that is pulled from another site using the RDF/RSS specification. This technology is often used to pull headlines from various news sites like <a href=\"http://www.cnn.com/\">CNN</a> and <a href=\"http://slashdot.org/\">Slashdot</a>. It can, of course, be used for other things like sports scores, stock market info, etc.\r\n<br><br>\r\n\r\n<b>URL to RSS file</b><br>\r\nProvide the exact URL (starting with http://) to the syndicated content\'s RDF or RSS file. The syndicated content will be downloaded from this URL hourly.\r\n<br><br>\r\nYou can find syndicated content at the following locations:\r\n</p><ul>\r\n<li><a href=\"http://www.newsisfree.com/\">http://www.newsisfree.com</a>\r\n</li><li><a href=\"http://www.syndic8.com/\">http://www.syndic8.com</a>\r\n</li><li><a href=\"http://www.voidstar.com/node.php?id=144\">http://www.voidstar.com/node.php?id=144</a>\r\n</li><li><a href=\"http://my.userland.com/\">http://my.userland.com</a>\r\n</li><li><a href=\"http://www.webreference.com/services/news/\">http://www.webreference.com/services/news/</a>\r\n</li><li><a href=\"http://www.xmltree.com/\">http://www.xmltree.com</a>\r\n</li><li><a href=\"http://w.moreover.com/\">http://w.moreover.com/</a>\r\n</li></ul>\r\n\r\n<p>\r\n\r\nTo create an aggregate RSS feed, include a list of space separated urls instead of a single url. For an aggregate feed, the system will display an equal number of headlines from each source, sorted by the date the system first received the story.<p>\r\n\r\n<b>Template</b><br>\r\nSelect a template for this content.\r\n<p><b>Maximum Headlines</b><br>\r\nEnter the maximum number of headlines that should be displayed. For an aggregate feed, the system will display an equal number of headlines from each source, even if doing so requires displaying more than the requested maximum number of headlines. Set to zero to allow any number of headlines.\r\n<p>',1047855741,NULL);
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (90,1,'DataForm','Delete this entry.',1057208065);
delete from template where templateId=1 and namespace='DataForm';
INSERT INTO template VALUES (1,'Mail Form','<tmpl_if displayTitle>\n <h1><tmpl_var title></h1>\n</tmpl_if>\n\n<tmpl_loop error_loop>\n <li><b><tmpl_var error.message></b>\n</tmpl_loop>\n\n\n<tmpl_if description>\n <tmpl_var description><p />\n</tmpl_if>\n\n<tmpl_if canEdit>\n <a href=\"<tmpl_var entryList.url>\"><tmpl_var entryList.label></a>\n &middot; <a href=\"<tmpl_var export.tab.url>\"><tmpl_var export.tab.label></a>\n <tmpl_if entryId>\n &middot; <a href=\"<tmpl_var delete.url>\"><tmpl_var delete.label></a>\n </tmpl_if>\n <tmpl_if session.var.adminOn>\n &middot; <a href=\"<tmpl_var addField.url>\"><tmpl_var addField.label></a>\n </tmpl_if>\n <p /> \n</tmpl_if>\n\n<tmpl_var form.start>\n<table>\n<tmpl_loop field_loop>\n <tmpl_unless field.isHidden>\n <tr><td class=\"formDescription\" valign=\"top\">\n <tmpl_if session.var.adminOn><tmpl_if canEdit><tmpl_var field.controls></tmpl_if></tmpl_if>\n <tmpl_var field.label>\n </td><td class=\"tableData\" valign=\"top\">\n <tmpl_if field.isDisplayed>\n <tmpl_var field.value>\n <tmpl_else>\n <tmpl_var field.form>\n </tmpl_if>\n <tmpl_if field.required>*</tmpl_if>\n <span class=\"formSubtext\"><br /><tmpl_var field.subtext></span>\n </td></tr>\n </tmpl_unless>\n</tmpl_loop>\n<tr><td></td><td><tmpl_var form.send></td></tr>\n</table>\n\n<tmpl_var form.end>\n','DataForm');

View file

@ -166,6 +166,8 @@ sub getRecordTemplateVars {
$var->{"entryList.label"} = WebGUI::International::get(86,$self->get("namespace"));
$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->{"delete.url"} = WebGUI::URL::page('func=delete&wid='.$self->get("wobjectId").'&entryId='.$var->{entryId});
+ $var->{"delete.label"} = WebGUI::International::get(90,$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"));
@ -650,6 +652,18 @@ sub www_view {
return $_[0]->processTemplate($_[0]->get("templateId"),$var);
}
#-------------------------------------------------------------------
sub www_delete {
my $entryId = $session{form}{entryId};
if (!WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId"))) {
return WebGUI::Privilege::insufficient();
}
WebGUI::SQL->write("delete from DataForm_entry where DataForm_entryId=".$entryId);
$session{form}{entryId} = 'list';
return $_[0]->www_view();
}
1;