Share My Creation [Web] Support Ticketing System

aeric

Expert
Licensed User
Longtime User
With MiniORM or DatabaseBuilder class, the varchar column such as message_body is set to length of 255 by default if the size is not specified.

You can ALTER the table schema by increasing the size of the column manually if it is in production.

If you are setting up the system before production, you need to modify the CreateDatabase sub.
B4X:
DB.Columns.Add(DB.CreateORMColumn2(CreateMap("Name": "message_body", "Size": 1000)))

This will allow you to insert longer text up to 1000 characters.

This is also applies to other fields such as Ticket Descriptions for database other than SQLite.
 

aeric

Expert
Licensed User
Longtime User
Version 1.01 beta #2 has been released with some improvement.

What's New:
  1. Custom column size for articles, tickets, messages and logs tables title/subject set to 500 characters and descriptions set to 1000 characters
  2. jQuery validate (maxlength) for above corresponding fields have been updated
  3. Minor changes in login forms (client and staff)
 

aeric

Expert
Licensed User
Longtime User
I realized 1000 characters length is not enough if someone is adding an image using the WYSIWYG editor. I will put 5000 as default in the release.
Probably in production, use something like 300,000 chars. Adjust the database to suit your case.

However, it is better to upload big image as attachment instead of using the ticket description field.

If you are using SQLite then no need to predefine the text column size. The JQuery validation to check the chars limit can also be removed.
 
Last edited:

aeric

Expert
Licensed User
Longtime User
Version 1.01 is now released!

What's new?
  1. WYSIWYG editor, using summernote plugin
  2. Toast message, using toastr plugin, replacing the ugly javascript alert
  3. SessionStorage is used to show toast message after page reload
  4. Email notification added for client registration and ticket status changes by staff or client
  5. HTML file generated for previewing emails instead of sending actual email
  6. Bug fixed in JavaScript document ready calling functions in wrong order (Ajax/event loop issue)
  7. Bug fixed in SQLite, missing "server" tag in build configuration causing unexpected database closed
  8. Bug fixed in SQLite message table created date (DatabaseBuilder)
  9. Add size to some text fields in tables like tickets, messages and articles (no affects to SQLite database)
  10. Disable/Enable cascading drop-down lists when selecting equipments (Type->Brand->Model)
  11. Some code cleanup and renaming
  12. Some modification in database config example file
  13. Missing additional jars for Velocity library 2.01 has been uploaded under B4J (shortcut back to version 1.00)
  14. Moved some js files to plugins folder
  15. Minor UI changes in login forms (client and staff)
  16. Updated jQuery validation to validate maxlength of some name and description fields
  17. jQuery validation also validate WYSIWYG editor which has default text even the content is empty
  18. Limit client from deleting their attachments (Error message toast and page reloads)
This update will be available to members who purchased version 1.00 or earlier.
 

aeric

Expert
Licensed User
Longtime User
SupportController
Version 1.00
This library is optional. It is a replacement of WebApiController library but in b4xlib format instead of jar and xml files.

The code is copied from ArticlesController. It is like duplicating the class but you don't need to copy+paste and renaming the file.
Currently you need to Find+Replace the word CONTROLLER inside this class to new Controller's name.





Members who have purchased the source code can find this library name SupportController.b4xlib inside B4J Additional library folder.
 

aeric

Expert
Licensed User
Longtime User
Version 1.02 is now released!

What's new?
  1. Changes in firebird.example - DbToolPath to set path of isql, UseScript, ScriptFile
  2. Changes in postgresql.example - DbToolPath to set path of createdb
  3. Updated firebird.sql script file
  4. Fix issue creating tables for Firebird, articles table must be created after topics table
  5. Fix search engine on top of page for Firebird to support case-insensitive keyword search
 
Last edited:

aeric

Expert
Licensed User
Longtime User
SupportController
Version 1.01
This library is optional.

It is a replacement of WebApiController library specially made for Support Ticketing System project but in b4xlib format instead of jar and xml files.
The code is modified from ArticlesController for creating additional controller class.

What's New:
It is now added with Code Snippets (19 snippets). You are no longer need to Find+Replace the word CONTROLLER.

The library is available in the Additional library folder shared in Google Drive.
 

aeric

Expert
Licensed User
Longtime User
Version 1.03 is now released!

What's new?
  1. Performance improvement when querying for tickets using vw_tickets view.
    This view is automatically created if it does not exist in old database.
  2. Many new functions in DatabaseBuilder class such as IfNull, Create2, setSelect2, SelectFromView, ViewExists and ViewExists2.
  3. Added "Delete Ticket" button for Staff ticket view.
  4. Some enhancements in User Login page.
  5. Some changes in JavaScripts files.
  6. Updated firebird.example to use MaxPoolSize=0 by default
  7. Updated firebird.sql script file to create vw_tickets view
 

aeric

Expert
Licensed User
Longtime User
The query for Tickets is a bit slow due to joining of 10 tables and reading the ticket_descriptions column which contains very long text.
I have experience this in my production which use SQLite as the database.

One way to improve the performance is to skip the ticket_descriptions column when listing all the rows in search query.
This will be updated in next version.

For members who purchased the source code, you can try commented line #458 in GetTickets sub and #757 in GetTicketsSortedBy sub of TicketsController class (version 1.03).
B4X:
'Columns.Add("ticket_descriptions")
 
Last edited:

aeric

Expert
Licensed User
Longtime User
Just for sharing.
Even though you can, but it is not a good idea to store image as base64 text in database especially SQLite (inserted from WYSIWYG editor).
Total db size: 3.8MB
One image size: 2.9MB

This is just an example. The photo was captured and uploaded from mobile without resizing.

Now I know why the page load was slow.

The solution is always upload image as attachment. It will improve user experience.

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…