Add an html checkbox in OTRS ticket submit page - html

I'm new to OTRS and I have to add an HTML checkbox with some text in the ticket submit page. Essentially, I need the user to accept a privacy statement (clicking on the checkbox) before he submits a new ticket. Hence, the submit button has to be enabled only after the user clicks on the checkbox. How can I do this?
I know HTML, but I don't know OTRS architecture so I can't figure out how can I modify HTML pages.
In Kernel->Output->HTML->Standard I've founded HTML templates (*.dtl), but:
I don't know which elements are part of ticket submitting page;
I don't know if I need to modify an existing template, adding HTML, or to create a new template (in this second case I think I should modify some perl module that call the layout, but which one!?!)
I'm trying to open .dtl files to understand which I've to modify, but Firefox can't render them correctly; how can I open them?

If you want customers to accept a privacy statement you don't need to code.
You can simply go to Admin > SysConfig > Framework > Frontend::Customer and activate the CustomerPanelPreApplicationModule###CustomerAccept module, and the InfoKey and InfoFile values. When the customer logs in the text in the InfoFile is displayed and the customer needs to accept this. After accepting the InfoKey is stored in the User Preferences. This way the system will not bother asking permission to the customer again, and if you might change the policy you can change the key as well, displaying the message when needed.
For your questions on .dtl files: these are plain HTML files, but different blocks are rendered by the files located under Kernel/Modules.
If you want to modify the page that is used for submitting new tickets, it's this file:
CustomerTicketMessage.dtl. You can edit these files with any text editor.

Related

Reference a custom field in NS on the standard HTML transaction form/SO email form

Does anyone know how to reference a NS field in the standard HTML form?
I have a custom field on my SO that links to our external website. The field uses a formula to pull the NS SO internal ID to create the link so we can send it out to the customer. That field works perfect and I was able to get that link to display properly as an element on the standard PDF form layout that gets emailed to the customer as an attachment on the SO notification email.
Now, here is the issue, I don't know how to reference it on the "a href" html tag in the HTML code on the transaction HTML layout. I know the field name/backend ID, I just don't know how to reference it in the "a href" html tag, this is what I have so far:
Securely View, Edit, & Track the status of this order
(in the curly brackets is my field name and I removed the carrots so the exact code would show up in this text box)
Does anyone know how to get that field from the SO form to show up in the Transaction HTML Layout form?
Actually I figured it out. I needed to have the href set as <NLCUSTBODYPG_LINK_SO>.

Mailchimp: Customise fields in profile update form

I am trying to create a customised 'update profile' form for mailchimp subscribers that will allow them to opt in or out of a specific group and edit a couple of their profile fields without seeing their entire profile.
I can see how to edit the visible fields on a signup form (by changing the html code on the embed form), but I am unclear as to how to edit a 'profile update' form. There is only embeddable html available for signup forms, not profile update forms.
Doe anyone know of a solution to this? Does it require using he mailchimp API?
At first I tried to use Mailchimps partially generated code to write the 'update profile form', however, it got ugly and I used bootstrap to make a beautiful form.
Go to 'Lists',
click on the 'List' you want to make form
click 'Signup forms' from the menu
click 'General forms'
Go to the end of the form, and click 'advanced mode'
It then will reset everything (if you had made a form using drag and drop), 7- and give you a partially created form.(for this you must be a paid customer)
After this, you are presented with a choice of different types of forms like
Signup form, Signup thank you page, update profile form, unsubscribe form etc.
Just click on the type of form you wanna make.
You can use any of your favorite editor to make the form using bootstrap and simply paste it into the Mailchimp's editor and it works perfectly. Just remember to put the correct merge tag in the email template like |update_profile|. You can even use javascript, if you need it.

Customize Ektron HTML Form Email Layout

I would like to know if there's a way to customize the email HTML body contents when submitting an Ektron HTML form.
For example, a form is submitted and the form data is emailed to john#doe.gov. Upon opening the email, there is a table containing the data from the submitted form. I want to know if there's a way to modify the HTML table which was generated for that email.
My goal is to experiment with some CSS to force word-wrapping in the table so lengthy textarea-input data will be wrapped appropriately.
I've never tried customizing it, so I don't know if there are any "gotchas", but these files look promising:
/Workarea/controls/forms/DefaultFormEmailBody.xslt
/Workarea/controls/forms/template_FormDataDisplay.xslt
/Workarea/controls/forms/template_FormFieldValue.xslt
The table is generated in "template_FormDataDisplay.xslt", and the individual table rows are generated in "template_FormFieldValue.xslt".
The usual "I want to modify something in the workarea" warning applies: Make backups of any file you change, and know that installing an upgrade to Ektron will overwrite any of your changes.
Are you using php? Because you can edit the way that email looks once you open it. This is an awesome tutorial:
http://tangledindesign.com/how-to-create-a-contact-form-using-html5-css3-and-php/

Unable to understand a html attribute

I am learning html from w3schools. They have used <form action="demo_form.asp"> this form tag with attribute action="demo_form.asp. I know the meaning of form tag as well as action attribute. But I don't know what is the meaning of action="demo_form.asp". When I use this attribute action="demo_form.asp", a file named demo_form.asp start downloading!
Can anybody explain me this thing?
Full code is here.
action attribute define the page to be use to post the data, when you hit submit button it redirect to the page you have mentioned in the action attribute. so that you can access the data submitted through this page.
The action="demo_form.asp" attribute is the file to which your <form> will be submitted.
From HTML spec
action = uri [CT]
This attribute specifies a form processing agent.
It's used to send the request to the page (url) specified in the action attribute when the form is submitted.
As per the example:
Once you enter your favourite color in the input box & click submit.
The form details is sent to the server page (demo_form.jsp) based on form action.
There the form is processed and based on the input, it's redirecting you to different page.
Where you can find the fav color which you have entered is mentioned there.
Input was received as:
favcolor=blue
The value of the action attribute tells the browser the location of the script that will process this form. In the example you have provided, the data submitted by the user in the form will be processed by the file/script called demo_form.asp.
The action element points to a thing that will handle the content of the form you have submitted. This can be as simple as a new page (maybe php), or a .cgi script, and so on. In your case it is attempting to submit to an ASP page. If you are attempting to use the form in your own pages, it is likely your browser can't find 'demo_form.asp'.
Why it is attempting to download it, rather than just tell you the page is missing, I'm afraid I don't know.
Hope this helps.
demo_form.asp should execute and not download. How are you running the file? It looks like your IIS is not enabled.
If you are trying this locally, to run ASP you'll have to configure IIS in your system (it is not enabled by default) and then use
http://localhost
.... to run your file. Otherwise ASP will not execute. See http://msdn.microsoft.com/en-us/library/ms181052(v=vs.80).aspx for enabling IIS. Once IIS is enabled,
http://localhost
will point to c:\inetpub\wwwroot folder by default. Create a folder in wwroot (say test) and place your files inside that folder. If your file is abc.asp then to run it you'll have to type
http://localhost/test/abc.asp
.
Hope this helps.

Auto-populate form via URL, then submit?

I have working the auto population of this form: http://getpocket.com/save
I'm using it rather than the API so that it works when users are logged into Pocket on the same browser as my website.
However, it's not a good user experience to then have to click 'save', so how can I "automate" that?
I won't show my code, because it essentially is just to generate a link of the form:
http://getpocket.com/save/?title=thetitle&url=encodedurl
It populates the form fine, but how can I submit? I tried apending &save and &submitand then each of those =True, in vain. Is the issue that the save button doesn't have a name= field, which is what's used to hook into the title and URL fields?
EDIT: Just to be clear, I didn't have any malicious intentions, only to save articles to read later on click of a button.
If I find the time I'll have a look at the API.
Luckily this is impossible (on Pocket and most sites) due to cross site forgery request protection to prevent exactly what you are trying to do.
A token is set in the form and together with session information for the user on pocket (or any other site that uses csfr token protection) it will need to form some sort of secret hash. When the 'save' form is submitted the combination of these strings will be checked and normally new strings will be set. Because there is (practically) no chance that you will be able to predict the token form the form itself and have no real way of manipulating the session hash, you are out of luck. And we are all very happy for that :).
Otherwise you could make links on other sites that would delete your whole database when you happen to click on them, etc.
In short: You can't.
On any form without csrf protection you'd have to target not the url of the page with the form, but the 'action' of the form. You can see this action by inspecting the form with your browser's DOM inspector. But, as I said, csrf protection will prevent this from working most of the time.
http://en.wikipedia.org/wiki/Cross-site_request_forgery
https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)