forked from osTicket/osTicket
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*This is a major redesign / rework of the osTicket base* This patch drops the concept of static ticket metadata and allows for an admin-configurable arbitrary data that is attachable to tickets The system is architected such that the base osTicket install now comes with a "default" form that has fields for subject, name, email, and phone number. This form is editable to allow for the addition of arbitrary other fields; however, the basic fields must remain in order to be associated with a help-topic and attached to a ticket. This concept can be expanded to allow for arbitrary data associated with registered clients or ticket thread items. Forms are comprised of sections. Sections have a title and instructions properties and a list of fields. Fields have various implementations to represent different data such as text, long answer, phone number, datetime, yes/no, and selections, and are configurable to define the look and feel and interpretation of the respective form field. Dropdown lists are represented as "Dynamic Lists", which are admin-configurable lists of items. Dropdowns can be optionally represented as Bootstrap typeahead fields. This also adds the start of a simple ORM which will hopefully be expanded in the future to support multiple database platforms. Currently, only MySQL is implemented.
- Loading branch information
Jared Hancock
committed
Oct 9, 2013
1 parent
3e3544c
commit 9e75169
Showing
53 changed files
with
4,755 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
require_once(INCLUDE_DIR . 'class.topic.php'); | ||
require_once(INCLUDE_DIR . 'class.dynamic_forms.php'); | ||
|
||
class DynamicFormsAjaxAPI extends AjaxController { | ||
function getForm($form_id) { | ||
$form = DynamicFormSection::lookup($form_id); | ||
if (!$form) return; | ||
|
||
foreach ($form->getFields() as $field) { | ||
$field->render(); | ||
} | ||
} | ||
|
||
function getFormsForHelpTopic($topic_id, $client=false) { | ||
$topic = Topic::lookup($topic_id); | ||
foreach (DynamicFormset::lookup($topic->ht['formset_id'])->getForms() as $form) { | ||
$set=$form; | ||
$form=$form->getForm(); | ||
if ($client) | ||
include(CLIENTINC_DIR . 'templates/dynamic-form.tmpl.php'); | ||
else | ||
include(STAFFINC_DIR . 'templates/dynamic-form.tmpl.php'); | ||
} | ||
} | ||
|
||
function getClientFormsForHelpTopic($topic_id) { | ||
return $this->getFormsForHelpTopic($topic_id, true); | ||
} | ||
|
||
function getFieldConfiguration($field_id) { | ||
$field = DynamicFormField::lookup($field_id); | ||
include(STAFFINC_DIR . 'templates/dynamic-field-config.tmpl.php'); | ||
} | ||
|
||
function saveFieldConfiguration($field_id) { | ||
$field = DynamicFormField::lookup($field_id); | ||
if (!$field->setConfiguration()) | ||
include(STAFFINC_DIR . 'templates/dynamic-field-config.tmpl.php'); | ||
else | ||
$field->save(); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.