PublicInquiry files the inquiry as before, then mails it through the wiki's mail service: plain text, the subject fixed but for the topic (line breaks removed), Reply-To the visitor's checked address, a link to the filed entry. If it is not sent the inquiry is filed all the same; a new class field, mailed (E-mailed to Captain Bob), says which, shown on the entry's sheet. Installed on the .org; a guest's test inquiry filed and thanked, mailed 0 -- the wiki has no SMTP account yet (Mail.MailConfig: no host), which Captain Bob sets in Administration > Email. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
28 lines
1.6 KiB
Plaintext
28 lines
1.6 KiB
Plaintext
{{velocity}}
|
|
## Makes the inquiry class's fields, once. Run it by viewing this page as an administrator
|
|
## (programming right); install.sh does. Viewing it again changes nothing.
|
|
#if (!$hasProgramming)
|
|
Needs the programming right.
|
|
#else
|
|
#set ($xdoc = $xwiki.getDocument('Inquiries.Code.InquiryClass').getDocument().clone())
|
|
#set ($c = $xdoc.getXClass())
|
|
#set ($changed = false)
|
|
#if (!$c.get('name'))#set ($d = $c.addTextField('name', 'Name', 60))#set ($changed = true)#end
|
|
#if (!$c.get('email'))#set ($d = $c.addTextField('email', 'Email', 60))#set ($changed = true)#end
|
|
#if (!$c.get('organization'))#set ($d = $c.addTextField('organization', 'Organization', 60))#set ($changed = true)#end
|
|
#if (!$c.get('topic'))#set ($d = $c.addTextField('topic', 'Topic', 60))#set ($changed = true)#end
|
|
#if (!$c.get('message'))#set ($d = $c.addTextAreaField('message', 'Message', 80, 12))#set ($d = $c.get('message').setStringValue('contenttype', 'PureText'))#set ($changed = true)#end
|
|
#if (!$c.get('announcements'))#set ($d = $c.addBooleanField('announcements', 'Wants announcements', 'yesno'))#set ($changed = true)#end
|
|
#if (!$c.get('source'))#set ($d = $c.addTextField('source', 'Source', 60))#set ($changed = true)#end
|
|
#if (!$c.get('status'))#set ($d = $c.addStaticListField('status', 'Status', 1, false, 'new|read|answered|closed'))#set ($changed = true)#end
|
|
#if (!$c.get('mailed'))#set ($d = $c.addBooleanField('mailed', 'E-mailed to Captain Bob', 'yesno'))#set ($changed = true)#end
|
|
#if ($changed)
|
|
#set ($d = $xdoc.setTitle('Inquiry class'))
|
|
#set ($d = $xwiki.getXWiki().saveDocument($xdoc, 'The inquiry fields', $xcontext.getContext()))
|
|
CLASS-SAVED
|
|
#else
|
|
CLASS-UNCHANGED
|
|
#end
|
|
#end
|
|
{{/velocity}}
|