#157 Add closable setting to statuses

Still need to enforce this though
merge-requests/2/head
Mike Koch 9 years ago
parent 54bbbf1610
commit 62d19e255e

@ -2186,6 +2186,7 @@ if ( defined('HESK_DEMO') )
<th><?php echo $hesklang['shortNameKey']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['shortNameKey']; ?>" data-content="<?php echo $hesklang['shortNameKeyDescr']; ?>"></i></th>
<th><?php echo $hesklang['longNameKey']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['longNameKey']; ?>" data-content="<?php echo $hesklang['longNameKeyDescr']; ?>"></i></th>
<th><?php echo $hesklang['textColor']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" title="<?php echo $hesklang['textColor']; ?>" data-content="<?php echo $hesklang['textColorDescr']; ?>"></i></th>
<th><?php echo $hesklang['closable_question']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover" data-placement="bottom" title="<?php echo $hesklang['closable_question']; ?>" data-content="<?php echo $hesklang['closable_description']; ?>"></i></th>
<th><?php echo $hesklang['closedQuestionMark']; ?> <i class="fa fa-question-circle settingsquestionmark" data-toggle="popover" data-placement="top" title="<?php echo $hesklang['closedQuestionMark']; ?>" data-content="<?php echo $hesklang['closedQuestionMarkDescr']; ?>"></i></th>
<th><?php echo $hesklang['delete']; ?></th>
</tr>
@ -2204,11 +2205,25 @@ if ( defined('HESK_DEMO') )
$isDisabled = true;
}
$yesSelected = $customersOnlySelected = $staffOnlySelected = $noSelected = '';
if ($row['Closable'] == 'yes') { $yesSelected = 'selected'; }
elseif ($row['Closable'] == 'conly') { $customersOnlySelected = 'selected'; }
elseif ($row['Closable'] == 'sonly') { $staffOnlySelected = 'selected'; }
else { $noSelected = 'selected'; }
echo '<tr id="s'.$row['ID'].'_row">';
echo '<td>'.$hesklang[$row['ShortNameContentKey']].'</td>'; //Name
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_shortName" value="'.$row['ShortNameContentKey'].'" placeholder="'.htmlspecialchars($hesklang['shortNameKey']).'"></td>'; // Short Name Language File
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_longName" value="'.$row['TicketViewContentKey'].'" placeholder="'.htmlspecialchars($hesklang['longNameKey']).'"></td>'; // Long Name Language File
echo '<td><input type="text" class="form-control" name="s'.$row['ID'].'_textColor" value="'.$row['TextColor'].'" placeholder="'.htmlspecialchars($hesklang['textColor']).'"></td>'; // Text Color
echo '<td>
<select class="form-control" name="s'.$row['ID'].'_closable">
<option value="yes" '.$yesSelected.'>'.$hesklang['yes_title_case'].'</option>
<option value="conly" '.$customersOnlySelected.'>'.$hesklang['customers_only'].'</option>
<option value="sonly" '.$staffOnlySelected.'>'.$hesklang['staff_only'].'</option>
<option value="no" '.$noSelected.'>'.$hesklang['no_title_case'].'</option>
</select>
</td>';
echo '<td><input type="checkbox" name="s'.$row['ID'].'_isClosed" value="1" '.$checkedEcho.'></td>'; // Resolved Status?
echo '<td>';
if ($isDisabled)
@ -2228,6 +2243,14 @@ if ( defined('HESK_DEMO') )
echo '<td><input type="text" class="form-control" name="sN_shortName" value="" placeholder="'.htmlspecialchars($hesklang['shortNameKey']).'"></td>'; // Short Name Language File
echo '<td><input type="text" class="form-control" name="sN_longName" value="" placeholder="'.htmlspecialchars($hesklang['longNameKey']).'"></td>'; // Long Name Language File
echo '<td><input type="text" class="form-control" name="sN_textColor" value="" placeholder="'.htmlspecialchars($hesklang['textColor']).'"></td>'; // Text Color
echo '<td>
<select class="form-control" name="sN_closable">
<option value="yes">'.$hesklang['yes_title_case'].'</option>
<option value="conly">'.$hesklang['customers_only'].'</option>
<option value="sonly">'.$hesklang['staff_only'].'</option>
<option value="no">'.$hesklang['no_title_case'].'</option>
</select>
</td>';
echo '<td><input type="checkbox" name="sN_isClosed" value="1"></td>'; // Resolved Status?
echo '<td></td>'; //Empty placeholder where the delete row is.
echo '</tr>';

@ -529,10 +529,10 @@ while ($row = $results->fetch_assoc())
} else
{
//-- Update the information in the database with what is on the page
$query = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ShortNameContentKey` = ?, `TicketViewContentKey` = ?, `TextColor` = ?, `IsClosed` = ? WHERE `ID` = ?";
$query = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ShortNameContentKey` = ?, `TicketViewContentKey` = ?, `TextColor` = ?, `IsClosed` = ?, `Closable` = ? WHERE `ID` = ?";
$stmt = hesk_dbConnect()->prepare($query);
$isStatusClosed = (isset($_POST['s'.$row['ID'].'_isClosed']) ? 1 : 0);
$stmt->bind_param('sssii', $_POST['s'.$row['ID'].'_shortName'], $_POST['s'.$row['ID'].'_longName'], $_POST['s'.$row['ID'].'_textColor'], $isStatusClosed, $row['ID']);
$stmt->bind_param('sssisi', $_POST['s'.$row['ID'].'_shortName'], $_POST['s'.$row['ID'].'_longName'], $_POST['s'.$row['ID'].'_textColor'], $isStatusClosed, $_POST['s'.$row['ID'].'_closable'], $row['ID']);
$stmt->execute();
}
}
@ -555,7 +555,7 @@ if ($_POST['sN_shortName'] != null && $_POST['sN_longName'] != null && $_POST['s
$insert = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` (`ID`, `ShortNameContentKey`, `TicketViewContentKey`, `TextColor`, `IsClosed`) VALUES (?, ?, ?, ?, ?)";
$stmt = hesk_dbConnect()->prepare($insert);
$isClosed = isset($_POST['sN_isClosed']) ? 1 : 0;
$stmt->bind_param('isssi', $nextValue, $_POST['sN_shortName'], $_POST['sN_longName'], $_POST['sN_textColor'], $isClosed);
$stmt->bind_param('isssis', $nextValue, $_POST['sN_shortName'], $_POST['sN_longName'], $_POST['sN_textColor'], $isClosed, $_POST['sN_closable']);
$stmt->execute();
}

@ -381,7 +381,7 @@ function execute211Scripts() {
}
function execute211FileUpdate() {
//-- Add the boostrap theme property to modsForHesk_settings.inc.php
//-- Add the new kb article visibility property to modsForHesk_settings.inc.php
$file = file_get_contents(HESK_PATH . 'modsForHesk_settings.inc.php');
//-- Only add the additional settings if they aren't already there.
@ -402,5 +402,8 @@ function execute220Scripts() {
global $hesk_settings;
hesk_dbConnect();
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ADD COLUMN `Closable` VARCHAR(10) NOT NULL");
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `Closable` = 'yes'");
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.2.0' WHERE `Key` = 'modsForHeskVersion'");
}
// END Version 2.2.0

@ -47,7 +47,17 @@ $hesklang['email_template_saved'] = 'The email template <b>%s</b> has been saved
$hesklang['error_saving_template'] = 'An error occurred when trying to save the email template!';
$hesklang['can_man_email_tpl'] = 'Edit email templates';
$hesklang['email_template_directory_not_writable'] = 'The email template <b>%s</b> is not writable by HESK. Please CHMOD it to 0666.'; // %s: template file name
$hesklang['closable_question'] = 'Closable?';
$hesklang['closable_description'] = '<b><i>This setting is ignored if the &quot;Closed?&quot; checkbox is checked for this status</i></b>.
<br><br>Determines if the customer staff is able to close a ticket in this status.
<br><br><b>Yes:</b> Both customers and staff can close a ticket in this status.
<br><b>Customers only:</b> Customers can close a ticket in this status, but staff cannot.
<br><b>Staff only:</b> Staff can close a ticket in this status, but customers cannot.
<br><b>No:</b> No one is allowed to close a ticket in this status.'; // &quot; = "
$hesklang['customers_only'] = 'Customers only';
$hesklang['staff_only'] = 'Staff only';
$hesklang['yes_title_case'] = 'Yes';
$hesklang['no_title_case'] = 'No';
// ADDED OR MODIFIED IN Mods for HESK 2.1.1
$hesklang['new_article_default_type'] = 'Default Type for New Articles';

Loading…
Cancel
Save