Editing of Dynamic fields in OTRS - otrs

Background: I've installed and currently maintaining a OTRS v4.0 system.
Currently, I've added some Dynamic fields to it i.e whenever user creates a ticket he sees the usual fields like title, body of message + the dynamic fields while creating a ticket in the system. 2 of the dynamic fields are 'Start time' and 'End time'.
Following is my problem: Now, while creating the ticket suppose user doesn't specifies these dynamic fields and creates the ticket and later on he wants to edit the ticket and specify the 'End time' i.e. wants to edit and update the ticket.
I could only get(from OTRS Admin manual) that I can change the status of the ticket from 'Open' -> 'Closed' or 'forward' the ticket to another person or 'move the ticket' to another queue. However, I cannot find if I can edit the ticket(as mentioned above) and update it without creating a new ticket with same details and new 'End date'.
Is their any way out for my problem? Or OTRS strictly doesn't supports this?
Any workaround is also welcome! ;)
Thanks in advance!

Yes, you definitely can edit Ticket's dynamic fields.
Just a quick example ( based on OTRS 3.x but the idea is the same )
1) Open your Admin->SysConfig and search for Ticket::Frontend::AgentTicketNote###DynamicField entry.
2) Open the container settings tab and add your dynamic field to the list ( see image 1 )
3) Open the ticket list and press the Note button ( Image 2 )
4) In the Note window you can add a Note to the ticket, change some settings ( priority, service, criticality etc... ) and definitely change your desired dynamic field ( Image 3 )
Smile,
A.

Related

How to insert and update the inserted row in Oracle APEX?

I want my "Create" button to insert a row on a table and once inserted to update that row. The reason I need to insert that row first and then update is because some columns that I want to update depend on the value being there in the first place. For example I would like to update the "Gross Margin" column but the "Gross Margin" = Payrate + something else. If I don't have the value in "Payrate" column, well there is no way I can update "Gross Margin" since it depends on it.
What I have tried:
) Create a Dynamic Action that triggers if "create" button is clicked. If its clicked is true then run the 2 true actions of type "Execute server side code" which is the Insert statement and the other is the Update statement. I made sure that Insert has the first sequence(It runs first) then the update(It runs second). Please see below picture of the settings of the "Create" button.
Please see below picture of the settings of the "Dynamic action"
See below settings of the "Insert Action"
Below settings of the "Update Action"
2.) I have also tried by creating a "Process" that is binded to the "Create" button when clicked but it did not worked.
I am open to all suggestions and thank you in advance!
I created a workspace on apex.oracle.com to illustrate my answer:
workspace: SO_HELP, username: so_68399404, pwd: so_68399404
App 22384 (Demonstration - EMP / DEPT) is an app generated on the standard emp/dept sample dataset. In the report "Employees", there is a "create" button but employees can also be edited with the edit icon. Both the "create" button and the "edit" link point to the same form (page 4). The salary is depends on the job. If the job is MANAGER then salary is set to 5000 else salary is increased by 1. Similar to your requirement. I did this with an after submit computation with code
CASE WHEN :P4_JOB = 'MANAGER' THEN 5000 ELSE :P4_SAL + 1 END
No other code needed. No dynamic actions, no custom processes. All updates are handled by the process of type "Automatic Row Processing - DML". Login with the credentials above and have a look. If it is not what you need, please explain exactly what is different in this app - or create a new form/report on that data to illustrate your issue.
May I suggest you ask your questions this way ? Extract your problem out of your code and illustrate it with the sample dataset. No one knows your actual data, everyone knows the emp/dept schema. That can avoid endless discussions in the comments.

OpenCart - Create unique product option from within product edit page

Would it be possible (with some modification or maybe an existing plugin) to create unique product options from within the product edit page? Those options then only assigned to that product?
In total across all my products, I'll have around 500 'options'. Each product of mine has about 5 options, rather than having to go to the OPTIONS section which will then list all 500, I'd rather input them directly from within the product edit page.
As it stands I cannot, I have to create the 'option value' elsewhere, then go back in to the product edit page area and then assign the option.
As you'll see in my attachment, you can only select already created product 'options value' from the product edit page, not create them here.

Opencart set Store preferences

In Opencart we have the following type of products.
Printed Books (hard copies) which will be shipped to customer.
For the same we have Digital Downloads.
We want an option set at the store level whether user wants to see Downloads or Printed Copies.
When the user chooses downloads option, it should display only downloadable products in all the categories.
When user chooses Printed Copies, it should display only printed products in each of the categories.
Any suggestions to achieve this functionality are welcome.
Thanks
"Any suggestions to achieve this functionality"
From my point of view (which may not be optimal) we need:
Permanent storage for the user preference [5 % done]
add a column to the table <DB_PREFIX>customer with a type of INT and a value of 0 if the user is interested in all products, 1 for digital downloads and so on..., if there is a possibility that you will add new preferences later, then it's better to store a serialized version of all the user preferences in a column of type TEXT
A way to retrieve user preference [25 % done]
you can just retrieve it from the database every time you need it, a better way is to keep it in the session at the same way the user data (like address, telephone)in the class User is kept
A way to change the user preference [40 % done]
some check box in the user settings page, it's also preferable (UX wise) that the user preference is shown in the header next to his name and can be edited directly from there
And finally, displaying products based on that preference [100 % done :D]
you will need to change some code in the controller of the category page, best seller module, latest products .... (any module that involves displaying products)
Simple, naive and ugly solution:you will notice that there is a code segment that copies products data to the view data, it looks like
$data['products'][] = array( in OC 2.X and $this->data['products'][] = array( for versions prior to OC 2, a simple if condition here will be enough, just check for the user preference and decide accordingly whether to copy the product to the view data or not
Better solution: filter products based on the user preference from the very beginning in the model functions, add an extra optional parameter to all model functions that retrieves products (don't forget those functions that retrieves products count) that indicates the user preference, check inside model functions if the parameter is set then do you work in the query

# Symbol preventing data from going from one form page to another Oracle APEX

In an Oracle Apex 4.2 form when a user has entered a '#' symbol into the text field it's preventing the data from the other fields to carry over when your using the "Set These Items With These Values" function.
The application is a staffing management app, the recruiters will click on a "Submit to Req" button that will pop open another window in a modal (skillbuilders modal plugin was used) asking if they're sure they want to submit and will also show a list of previously submitted candidates that's generated from the req number that's placed in a hidden field in the submittal.
Now, on this page there are also hidden fields that pull information from the job requirements table so when the recruiter clicks on the "Yes" button, it populates the client name, job name, sales name, req number and req priority fields in the candidate submittal form so we're able to track this information better for management.
Often times the sales staff will put the client's job number in with the # symbol, ex: Job #123456, into the job field.
When someone does that, it's preventing the next field that is a hidden field from being carried over and populating that field.
I had a similar issue previously with commas, and using a / in the "Set These Items With These Values" are I was able to work around that problem, but that isn't working for the # symbol.
As of right now I've asked sales to not use that symbol, but that's not a long term answer here.
Any insight would be great.
A simple way to solve this issue is to use the Whitelist option available.
Steps are as follows:
Edit the Textfield item
Click on Security tab or scroll to Security section in the edit page.
From the Restricted Characters dropdown select Whitelist for a-Z, 0-9 and space.
Click Apply Changes.
When user enters the # character and tries to proceed, APEX will throw an error message as
Job field contains special characters. Only the characters a-Z, 0-9 and spaces are allowed.
This way user is restricted to use only the whitelisted characters.

Django 1.3 - Admin - "Add Entry" button - copy the fields from previous model instance

Can't find how to do this for some reason.
When clicking the "Add_model Entry" button on the Admin page, I want most of the fields to be filled in with the same values the user put into the previous model instance that they created and saved. (I don't care about which users, just about the last (youngest) saved instance of a model).
Use Case: The user will be creating instances of this model in batch mode, for example 10 very similar items, so it would be very helpful if most of the info is prepopulated each time they hit the "Add entry" button. They may do this 3-4 times per day, if that mattered for some reason, and each batch would have significantly different values in the fields from the previous batch, but each instance in the batch would be similar. Hence my thought of prepopulating with the most recently saved values.
Contrived Example:
class person:<br>
name= CharField => (obvious)<br>
interests= CharField => Example (fly, skate, swim)<br>
age_range= CharField => Example (old, middle, young)<br>
batch 1 = people who fly and are old
Jim Smith, Fly, Old
Sara Smith, Fly, Old
Larry Jones, Fly, Old
batch 2 = skaters
Sam Samuelson, Skate, Young
Alfred Bob, Skate, Old
Jon Jon, Skate, Old
There is much similarity in each batch, but batches can be very different. So I would guess I need a copy of the previously saved model with a new id, (there is no Inheritance here to deal with, but there are ForeignKeys). How do I add it to the "Add Entry" button/site?
As a second option, you could also use the Django Admin Save As functionality. This isn't exactly what you're looking for, but it would allow users to go to a previous entry, edit some fields, and then save that as a new object, which would be close to the same effect.
You could create a custom ModelForm for your ModelAdmin that had an __init__ function that would check to see if there was an instance provided (if there is, that would mean that you're editing an existing object rather than creating a new one), and, if not, query for the latest object and then populate the initial dict with the values that you pulled out of that instance.