Skip to content

Commit

Permalink
NEW Module ticket is available as a stable module
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 11, 2019
1 parent 9353cf9 commit f0e56ab
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
14 changes: 7 additions & 7 deletions htdocs/core/class/html.formticket.class.php
Expand Up @@ -294,16 +294,16 @@ function(response) {
print $this->selectTypesTickets((GETPOST('type_code') ? GETPOST('type_code') : $this->type_code), 'type_code', '', '2');
print '</td></tr>';

// Category
print '<tr><td><span class="fieldrequired"><label for="selectcategory_code">' . $langs->trans("TicketCategory") . '</span></label></td><td>';
print $this->selectCategoriesTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2');
print '</td></tr>';

// Severity
print '<tr><td><span class="fieldrequired"><label for="selectseverity_code">' . $langs->trans("TicketSeverity") . '</span></label></td><td>';
print $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', '2');
print '</td></tr>';

// Category
print '<tr><td><span class="fieldrequired"><label for="selectcategory_code">' . $langs->trans("TicketCategory") . '</span></label></td><td>';
print $this->selectAnalyticCodesTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2');
print '</td></tr>';

// Notify thirdparty at creation
if (empty($this->ispublic))
{
Expand Down Expand Up @@ -520,7 +520,7 @@ public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $fi
}

/**
* Return html list of ticket categories
* Return html list of ticket anaytic codes
*
* @param string $selected Id categorie pre-selectionnée
* @param string $htmlname Nom de la zone select
Expand All @@ -532,7 +532,7 @@ public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $fi
* @param string $morecss More CSS
* @return void
*/
public function selectCategoriesTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '')
public function selectAnalyticCodesTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '')
{
global $langs, $user;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/modTicket.class.php
Expand Up @@ -63,7 +63,7 @@ public function __construct($db)
// (where XXX is value of numeric property 'numero' of module)
$this->description = "Incident/support ticket management";
// Possible values for version are: 'development', 'experimental' or version
$this->version = 'experimental';
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled
// (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/main.lang
Expand Up @@ -961,3 +961,4 @@ FileSharedViaALink=File shared via a link
SelectAThirdPartyFirst=Select a third party first...
YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
Inventory=Inventory
AnalyticCode=Analytic code
10 changes: 5 additions & 5 deletions htdocs/langs/en_US/ticket.lang
Expand Up @@ -28,7 +28,7 @@ Permission56004=Manage tickets
Permission56005=See tickets of all third parties (not effective for external users, always be limited to the third party they depend on)

TicketDictType=Tickets type
TicketDictCategory=Tickets categories
TicketDictCategory=Tickets analytic code
TicketDictSeverity=Tickets severity
TicketTypeShortBUGSOFT=Dysfonctionnement logiciel
TicketTypeShortBUGHARD=Dysfonctionnement matériel
Expand Down Expand Up @@ -67,7 +67,7 @@ Deleted=Deleted

# Dict
Type=Type
Category=Category
Category=Analytic code
Severity=Severity

# Email templates
Expand All @@ -80,7 +80,7 @@ TicketSetup=Ticket module setup
TicketSettings=Settings
TicketSetupPage=
TicketPublicAccess=A public interface requiring no identification is available at the following url
TicketSetupDictionaries=The type of application categories and severity level are configurable from dictionaries
TicketSetupDictionaries=The type of ticket, severity and analytic codes are configurable from dictionaries
TicketParamModule=Module variable setup
TicketParamMail=Email setup
TicketEmailNotificationFrom=Notification email from
Expand Down Expand Up @@ -147,7 +147,7 @@ CreatedBy=Created by
NewTicket=New Ticket
SubjectAnswerToTicket=Ticket answer
TicketTypeRequest=Request type
TicketCategory=Category
TicketCategory=Analytic code
SeeTicket=See ticket
TicketMarkedAsRead=Ticket has been marked as read
TicketReadOn=Read on
Expand All @@ -158,7 +158,7 @@ TicketHistory=Ticket history
AssignUser=Assign to user
TicketAssigned=Ticket is now assigned
TicketChangeType=Change type
TicketChangeCategory=Change category
TicketChangeCategory=Change analytic code
TicketChangeSeverity=Change severity
TicketAddMessage=Add a message
AddMessage=Add a message
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/ticket/list.php
Expand Up @@ -471,7 +471,7 @@

if (!empty($arrayfields['category.code']['checked'])) {
print '<td class="liste_titre">';
$formTicket->selectCategoriesTickets($search_category, 'search_category', '', 2, 1, 1);
$formTicket->selectAnalyticCodesTickets($search_category, 'search_category', '', 2, 1, 1);
print '</td>';
}

Expand Down
29 changes: 15 additions & 14 deletions htdocs/ticket/card.php
Expand Up @@ -149,8 +149,8 @@
$object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha'));

$object->type_code = GETPOST('update_value_type', 'az09');
$object->category_code = GETPOST('update_value_category', 'az09');
$object->severity_code = GETPOST('update_value_severity', 'az09');
$object->category_code = GETPOST('update_value_category', 'az09');

$ret = $object->update($user);
if ($ret > 0) {
Expand Down Expand Up @@ -542,16 +542,16 @@
print '</tr>';
print '<tr>';
print '<td>';
print $langs->trans('TicketChangeCategory');
print $langs->trans('TicketChangeSeverity');
print '</td><td>';
print $formticket->selectCategoriesTickets($object->category_code, 'update_value_category', '', 2);
print $formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
print '</td>';
print '</tr>';
print '<tr>';
print '<td>';
print $langs->trans('TicketChangeSeverity');
print $langs->trans('TicketChangeCategory');
print '</td><td>';
print $formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
print $formticket->selectAnalyticCodesTickets($object->category_code, 'update_value_category', '', 2);
print '</td>';
print '</tr>';
} else {
Expand All @@ -563,21 +563,21 @@
}*/
print '</td></tr>';

// Category
print '<tr><td>' . $langs->trans("Category") . '</td><td>';
print $langs->getLabelFromKey($db, $object->category_code, 'c_ticket_category', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
print '</td></tr>';

// Severity
print '<tr><td>' . $langs->trans("TicketSeverity") . '</td><td>';
print $langs->getLabelFromKey($db, $object->severity_code, 'c_ticket_severity', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
print '</td></tr>';

// Category
print '<tr><td>' . $langs->trans("AnalyticCode") . '</td><td>';
print $langs->getLabelFromKey($db, $object->category_code, 'c_ticket_category', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
print '</td></tr>';
}
print '</table>'; // End table actions

Expand Down Expand Up @@ -824,8 +824,9 @@
$formticket->substit['__TICKETSUP_REF__'] = $object->ref;
$formticket->substit['__TICKETSUP_SUBJECT__'] = $object->subject;
$formticket->substit['__TICKETSUP_TYPE__'] = $object->type_code;
$formticket->substit['__TICKETSUP_CATEGORY__'] = $object->category_code;
$formticket->substit['__TICKETSUP_SEVERITY__'] = $object->severity_code;
$formticket->substit['__TICKETSUP_CATEGORY__'] = $object->category_code; // For backward compatibility
$formticket->substit['__TICKETSUP_ANALYTIC_CODE__'] = $object->category_code;
$formticket->substit['__TICKETSUP_MESSAGE__'] = $object->message;
$formticket->substit['__TICKETSUP_PROGRESSION__'] = $object->progress;
if ($object->fk_user_assign > 0) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/ticket/list.php
Expand Up @@ -529,7 +529,7 @@
print '</td>';
} elseif ($key == 'category_code') {
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
$formTicket->selectCategoriesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
$formTicket->selectAnalyticCodesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
print '</td>';
} elseif ($key == 'severity_code') {
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
Expand Down

0 comments on commit f0e56ab

Please sign in to comment.