Merge pull request #369 from mkoch227/client-side-validation

Client side validation
merge-requests/2/head
Mike Koch 9 years ago
commit 34ef665699

@ -201,9 +201,9 @@ if (!empty($_POST['set_priority'])) {
}
$options = array(
0 => '<font class="critical">' . $hesklang['critical'] . '</font>',
1 => '<font class="important">' . $hesklang['high'] . '</font>',
2 => '<font class="medium">' . $hesklang['medium'] . '</font>',
0 => '<span class="critical">' . $hesklang['critical'] . '</span>',
1 => '<span class="important">' . $hesklang['high'] . '</span>',
2 => '<span class="medium">' . $hesklang['medium'] . '</span>',
3 => $hesklang['low']
);

@ -31,6 +31,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('WYSIWYG', 1);
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -668,28 +669,51 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div id="modifytime" style="display:none">
<br />
<form method="post" action="admin_ticket.php" style="margin:0px; padding:0px;">
<table class="white">
<tr>
<td class="admin_gray"><?php echo $hesklang['hh']; ?>:</td>
<td class="admin_gray"><input type="text" name="h" value="<?php echo $t[0]; ?>" size="3" /></td>
</tr>
<tr>
<td class="admin_gray"><?php echo $hesklang['mm']; ?>:</td>
<td class="admin_gray"><input type="text" name="m" value="<?php echo $t[1]; ?>" size="3" /></td>
</tr>
<tr>
<td class="admin_gray"><?php echo $hesklang['ss']; ?>:</td>
<td class="admin_gray"><input type="text" name="s" value="<?php echo $t[2]; ?>" size="3" /></td>
</tr>
</table>
<br />
<input class="btn btn-default" type="submit" value="<?php echo $hesklang['save']; ?>" />
<a class="btn btn-default" href="Javascript:void(0)" onclick="Javascript:hesk_toggleLayerDisplay('modifytime')"><?php echo $hesklang['cancel']; ?></a>
<input type="hidden" name="track" value="<?php echo $trackingID; ?>" />
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
<form data-toggle="validator" class="form-horizontal" method="post" action="admin_ticket.php" style="margin:0px; padding:0px;">
<div class="form-group">
<label for="h" class="col-sm-4 control-label"><?php echo $hesklang['hh']; ?></label>
<div class="col-sm-8">
<input type="text" name="h" value="<?php echo $t[0]; ?>" size="3"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['hh']); ?>"
class="form-control input-sm" required>
</div>
<div class="col-sm-12 text-right">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group input-group-sm">
<label for="m" class="col-sm-4 control-label"><?php echo $hesklang['mm']; ?></label>
<div class="col-sm-8">
<input type="text" name="m" value="<?php echo $t[1]; ?>" size="3"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['mm']); ?>"
class="form-control input-sm" required>
</div>
<div class="col-sm-12 text-right">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group input-group-sm">
<label for="s" class="col-sm-4 control-label"><?php echo $hesklang['ss']; ?></label>
<div class="col-sm-8">
<input type="text" name="s" value="<?php echo $t[2]; ?>" size="3"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['ss']); ?>"
class="form-control input-sm" required>
</div>
<div class="col-sm-12 text-right">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="text-right">
<div class="btn-group btn-group-sm text-right">
<input class="btn btn-primary" type="submit" value="<?php echo $hesklang['save']; ?>" />
<a class="btn btn-default" href="Javascript:void(0)" onclick="Javascript:hesk_toggleLayerDisplay('modifytime')"><?php echo $hesklang['cancel']; ?></a>
</div>
</div>
<input type="hidden" name="track" value="<?php echo $trackingID; ?>" />
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
</form>
</div>
@ -1213,10 +1237,13 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div id="notesform" style="display:<?php echo isset($_SESSION['note_message']) ? 'block' : 'none'; ?>">
<form method="post" action="admin_ticket.php" style="margin:0px; padding:0px;"
<form data-toggle="validator" method="post" action="admin_ticket.php" style="margin:0px; padding:0px;"
enctype="multipart/form-data">
<textarea class="form-control" name="notemsg" rows="6"
cols="60"><?php echo isset($_SESSION['note_message']) ? stripslashes(hesk_input($_SESSION['note_message'])) : ''; ?></textarea><br/>
<div class="form-group">
<textarea data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']) ?>" class="form-control" name="notemsg" rows="6"
cols="60" required><?php echo isset($_SESSION['note_message']) ? stripslashes(hesk_input($_SESSION['note_message'])) : ''; ?></textarea>
<div class="help-block with-errors"></div>
</div>
<?php
// attachments
if ($hesk_settings['attachments']['use']) {
@ -1565,13 +1592,18 @@ function print_form()
<div class="col-sm-10 col-sm-offset-1">
<h3 align="left"><?php echo $hesklang['view_existing']; ?></a></h3>
<form action="admin_ticket.php" method="get" class="form-horizontal">
<form data-toggle="validator" action="admin_ticket.php" method="get" class="form-horizontal">
<div class="form-group">
<label for="track" class="control-label col-sm-3"><?php echo $hesklang['ticket_trackID']; ?></label>
<div class="col-sm-9">
<input type="text" name="track" maxlength="20" size="35" value="<?php echo $trackingID; ?>"
placeholder="<?php echo $hesklang['ticket_trackID']; ?>" class="form-control"><br>
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo $hesklang['ticket_trackID']; ?>" class="form-control" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="submit" value="<?php echo $hesklang['view_ticket']; ?>" class="btn btn-default">
<input type="hidden" name="Refresh" value="<?php echo rand(10000, 99999); ?>">
</div>
@ -1678,8 +1710,14 @@ function hesk_printReplyForm()
<div class="footerWithBorder"></div>
<div class="blankSpace"></div>
<form role="form" class="form-horizontal" method="post" action="admin_reply_ticket.php"
enctype="multipart/form-data" name="form1" onsubmit="javascript:force_stop();return true;">
<?php
$onsubmit = 'onsubmit="force_stop();"';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="force_stop();return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form role="form" data-toggle="validator" class="form-horizontal" method="post" action="admin_reply_ticket.php"
enctype="multipart/form-data" name="form1" <?php echo $onsubmit; ?>>
<?php
/* Ticket assigned to someone else? */
@ -1697,17 +1735,19 @@ function hesk_printReplyForm()
?>
<div class="form-group">
<label for="time_worked" class="col-sm-3 control-label"><?php echo $hesklang['ts']; ?>:</label>
<label for="time_worked" class="col-sm-3 control-label"><?php echo $hesklang['ts']; ?></label>
<div class="col-sm-6">
<input type="text" class="form-control" name="time_worked" id="time_worked" size="10"
value="<?php echo(isset($_SESSION['time_worked']) ? hesk_getTime($_SESSION['time_worked']) : '00:00:00'); ?>"/>
</div>
<div class="col-sm-3 text-right">
<input type="button" class="btn btn-success" onclick="ss()" id="startb"
value="<?php echo $hesklang['start']; ?>"/>
<input type="button" class="btn btn-danger" onclick="r()"
value="<?php echo $hesklang['reset']; ?>"/>
<div class="btn-group">
<input type="button" class="btn btn-success" onclick="ss()" id="startb"
value="<?php echo $hesklang['start']; ?>"/>
<input type="button" class="btn btn-danger" onclick="r()"
value="<?php echo $hesklang['reset']; ?>"/>
</div>
</div>
</div>
<?php
@ -1716,9 +1756,7 @@ function hesk_printReplyForm()
if (strlen($can_options)) {
?>
<div class="form-group">
<label for="saved_replies" class="col-sm-3 control-label"><?php echo $hesklang['saved_replies']; ?>
:</label>
<label for="saved_replies" class="col-sm-3 control-label"><?php echo $hesklang['saved_replies']; ?></label>
<div class="col-sm-9">
<label><input type="radio" name="mode" id="modeadd" value="1"
checked="checked"/> <?php echo $hesklang['madd']; ?></label><br/>
@ -1733,14 +1771,16 @@ function hesk_printReplyForm()
<?php
}
?>
<div class="form-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>: <font
class="important">*</font></label>
<div class="form-group" id="message-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
<span id="HeskMsg">
<textarea class="form-control htmlEditor" name="message" id="message" rows="12"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" cols="72"><?php
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" cols="72"
data-error="<?php echo htmlspecialchars($hesklang['enter_message']); ?>"
required><?php
// Do we have any message stored in session?
if (isset($_SESSION['ticket_message'])) {
@ -1753,7 +1793,8 @@ function hesk_printReplyForm()
}
}
?></textarea></span>
?></textarea>
<div class="help-block with-errors" id="message-help-block"></div></span>
</div>
</div>
<?php

@ -124,15 +124,16 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<form action="banned_emails.php" method="post" name="form1" role="form" class="form-horizontal">
<form action="banned_emails.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['bananemail']; ?></label>
<label for="text" class="col-sm-3 control-label"><?php echo $hesklang['bananemail']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="email" size="30" maxlength="255"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>">
<input type="email" class="form-control" name="email" size="30" maxlength="255" data-error="<?php echo htmlspecialchars($hesklang['enterbanemail']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>" required>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="ban"/>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">

@ -127,15 +127,16 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<form action="banned_ips.php" method="post" name="form1" role="form" class="form-horizontal">
<form action="banned_ips.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="ip" class="col-sm-3 control-label"><?php echo $hesklang['bananip']; ?></label>
<div class="col-sm-9">
<input type="text" name="ip" size="30" maxlength="255" class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['iprange']); ?>">
<input type="text" name="ip" size="30" maxlength="255" class="form-control" data-error="<?php echo htmlspecialchars($hesklang['enterbanip']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['iprange']); ?>" required>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="ban"/>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">

@ -541,13 +541,15 @@ function mail_list_messages()
<div align="center">
<table class="table table-striped">
<thead>
<tr>
<th><input type="checkbox" name="checkall" value="2" onclick="hesk_changeAll(this)"/></th>
<th><?php echo $hesklang['m_sub']; ?></th>
<th><?php echo $hesk_settings['mailtmp']['m_from']; ?></th>
<th><?php echo $hesklang['date']; ?></th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
while ($pm = hesk_dbFetchAssoc($res)) {
@ -564,17 +566,15 @@ function mail_list_messages()
$pm['subject'] = '<b>' . $pm['subject'] . '</b>';
}
$pm['name'] = isset($admins[$pm[$hesk_settings['mailtmp']['other']]]) ? '<a href="mail.php?a=new&amp;id=' . $pm[$hesk_settings['mailtmp']['other']] . '">' . $admins[$pm[$hesk_settings['mailtmp']['other']]] . '</a>' : (($pm['from'] == 9999) ? '<a href="http://www.hesk.com" target="_blank">HESK.com</a>' : $hesklang['e_udel']);
$pm['dt'] = hesk_dateToString($pm['dt'], 0, 0, 0, true);
echo <<<EOC
<tr>
<td><input type="checkbox" name="id[]" value="$pm[id]" />&nbsp;</td>
<td>$pm[subject]</td>
<td>$pm[name]</td>
<td>$pm[dt]</td>
</tr>
EOC;
$pm['dt'] = hesk_dateToString($pm['dt'], 0, 0, 0, true)
?>
<tr>
<td><input type="checkbox" name="id[]" value="<?php echo $pm['id']; ?>" />&nbsp;</td>
<td><?php echo $pm['subject']; ?></td>
<td><?php echo $pm['name']; ?></td>
<td><?php echo $pm['dt']; ?></td>
</tr>
<?php
} // End while
?>
</table>
@ -620,7 +620,7 @@ function show_new_form()
global $hesk_settings, $hesklang, $admins;
?>
<br/>
<form action="mail.php" method="post" name="form2" class="form-horizontal" role="form">
<form action="mail.php" method="post" name="form2" class="form-horizontal" role="form" data-toggle="validator">
<h3><?php echo $hesklang['new_mail']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
@ -629,7 +629,8 @@ global $hesk_settings, $hesklang, $admins;
<label for="to" class="col-sm-3 control-label"><?php echo $hesklang['m_to']; ?></label>
<div class="col-sm-9">
<select class="form-control" name="to">
<select class="form-control" name="to" type="number"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>" required>
<option value="" selected="selected"><?php echo $hesklang['select']; ?></option>
<?php
foreach ($admins as $k => $v) {
@ -643,6 +644,7 @@ global $hesk_settings, $hesklang, $admins;
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
@ -655,21 +657,25 @@ global $hesk_settings, $hesklang, $admins;
if (isset($_SESSION['mail']['subject'])) {
echo ' value="' . stripslashes($_SESSION['mail']['subject']) . '" ';
}
?>
/>
?> data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>:</label>
<div class="col-sm-9">
<textarea name="message" class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" rows="15" cols="70"><?php
if (isset($_SESSION['mail']['message'])) {
echo stripslashes($_SESSION['mail']['message']);
}
?></textarea>
<textarea name="message" class="form-control" data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" rows="15" cols="70" required><?php
if (isset($_SESSION['mail']['message'])) {
echo stripslashes($_SESSION['mail']['message']);
}
?></textarea>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<div class="checkbox">
<label>
<input type="checkbox" name="signature" value="1" checked>

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -285,7 +286,13 @@ $num = hesk_dbNumRows($result);
<div class="footerWithBorder blankSpace"></div>
<form action="manage_canned.php" method="post" name="form1" class="form-horizontal" role="form">
<?php
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form action="manage_canned.php" method="post" name="form1" class="form-horizontal" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
<h3><?php echo $hesklang['new_saved']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
@ -329,24 +336,28 @@ $num = hesk_dbNumRows($result);
<span id="HeskTitle"><input id="subject" class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['saved_title']); ?>"
type="text" name="name" size="40"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
maxlength="50" <?php if (isset($_SESSION['canned']['name'])) {
echo ' value="' . stripslashes($_SESSION['canned']['name']) . '" ';
} ?> /></span>
} ?> required></span>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="form-group" id="message-group">
<label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="col-sm-10">
<span id="HeskMsg">
<textarea id="message" class="htmlEditor form-control"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="msg"
rows="15" cols="70"><?php
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
rows="15" cols="70" required><?php
if (isset($_SESSION['canned']['msg'])) {
echo stripslashes($_SESSION['canned']['msg']);
}
?></textarea>
</span>
<div class="help-block with-errors" id="message-help-block"></div>
<?php echo $hesklang['insert_special']; ?>:
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_ID')"><?php echo $hesklang['seqid']; ?></a> |

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -118,7 +119,7 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
<div class="tab-content summaryList tabPadding">
<div class="tab-pane fade in active" id="addCat">
<!-- CONTENT -->
<form action="manage_categories.php" method="post" role="form" class="form-horizontal">
<form action="manage_categories.php" method="post" role="form" class="form-horizontal" data-toggle="validator">
<h4><?php echo $hesklang['add_cat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
@ -135,7 +136,9 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
echo ' value="' . hesk_input($_SESSION['catname']) . '" ';
}
?>
/>
data-error="<?php echo htmlspecialchars($hesklang['enter_cat_name']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
@ -193,7 +196,7 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
</form>
</div>
<div class="tab-pane fade" id="renameCat">
<form action="manage_categories.php" method="post" role="form" class="form-horizontal">
<form action="manage_categories.php" method="post" role="form" class="form-horizontal" data-toggle="validator">
<h4><?php echo $hesklang['ren_cat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
@ -212,7 +215,10 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
placeholder="<?php echo htmlspecialchars($hesklang['cat_name']); ?>" type="text"
name="name" size="40" maxlength="40" <?php if (isset($_SESSION['catname2'])) {
echo ' value="' . hesk_input($_SESSION['catname2']) . '" ';
} ?> />
} ?>
data-error="<?php echo htmlspecialchars($hesklang['enter_cat_name']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group text-center">

@ -30,6 +30,7 @@
define('IN_SCRIPT',1);
define('HESK_PATH','../');
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -351,7 +352,13 @@ if (!isset($_SESSION['hide']['new_article']))
<h3 class="move-right-10"><a name="new_article"></a><?php echo $hesklang['new_kb_art']; ?></h3>
<div class="footerWithBorder blankSpace move-right-10 move-left-10"></div>
<form action="manage_knowledgebase.php" role="form" method="post" name="form1" enctype="multipart/form-data">
<?php
$onsubmit = '';
if ($hesk_settings['kb_wysiwyg']) {
$onsubmit = 'onsubmit="return validateRichText(\'content-help-block\', \'content-group\', \'content\', \''.addslashes($hesklang['kb_e_cont']).'\')"';
}
?>
<form action="manage_knowledgebase.php" role="form" method="post" name="form1" enctype="multipart/form-data" data-toggle="validator" <?php echo $onsubmit; ?>>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default move-right-10">
@ -405,9 +412,14 @@ if (!isset($_SESSION['hide']['new_article']))
</span>
<div class="form-group">
<label for="subject" class="control-label"><?php echo $hesklang['kb_subject']; ?></label>
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['kb_subject']); ?>" name="subject" size="70" maxlength="255" <?php if (isset($_SESSION['new_article']['subject'])) {echo 'value="'.$_SESSION['new_article']['subject'].'"';} ?> />
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['kb_subject']); ?>" data-error="<?php echo htmlspecialchars($hesklang['kb_e_subj']); ?>"
name="subject" size="70" maxlength="255" <?php if (isset($_SESSION['new_article']['subject'])) {echo 'value="'.$_SESSION['new_article']['subject'].'"';} ?> required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="content-group">
<textarea class="form-control" id="content" name="content" rows="25" cols="70" data-error="<?php echo htmlspecialchars($hesklang['kb_e_cont']); ?>" id="content" required><?php if (isset($_SESSION['new_article']['content'])) {echo $_SESSION['new_article']['content'];} ?></textarea>
<div class="help-block with-errors" id="content-help-block"></div>
</div>
<p><textarea class="form-control" name="content" rows="25" cols="70" id="content"><?php if (isset($_SESSION['new_article']['content'])) {echo $_SESSION['new_article']['content'];} ?></textarea></p>
</div>
<div class="col-md-3">
<div class="panel panel-default move-left-10">
@ -427,8 +439,11 @@ if (!isset($_SESSION['hide']['new_article']))
<div class="form-group">
<input type="hidden" name="a" value="new_article" />
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
<input type="submit" value="<?php echo $hesklang['kb_save']; ?>" class="btn btn-default" />
<a class="btn btn-default" href="manage_knowledgebase.php?a=manage_cat&amp;catid=<?php echo $catid; ?>"><?php echo $hesklang['cancel']; ?></a>
<div class="btn-group">
<input type="submit" value="<?php echo $hesklang['kb_save']; ?>" class="btn btn-primary" />
<a class="btn btn-default" href="manage_knowledgebase.php?a=manage_cat&amp;catid=<?php echo $catid; ?>"><?php echo $hesklang['cancel']; ?></a>
</div>
</div>
</div>
</div>
@ -497,14 +512,15 @@ if (!isset($_SESSION['hide']['new_category']))
?>
</div>
<div class="col-md-7 move-left-20">
<form action="manage_knowledgebase.php" class="form-horizontal" method="post" role="form" name="form2">
<form action="manage_knowledgebase.php" class="form-horizontal" method="post" role="form" name="form2" data-toggle="validator">
<h3><a name="new_category"></a><?php echo $hesklang['kb_cat_new']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="title" class="col-sm-3 control-label"><?php echo $hesklang['kb_cat_title']; ?>:</label>
<label for="title" class="col-sm-3 control-label"><?php echo $hesklang['kb_cat_title']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="title" size="70" maxlength="255" />
<input type="text" class="form-control" name="title" size="70" maxlength="255" data-error="<?php echo htmlspecialchars($hesklang['kb_cat_e_title']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
@ -530,8 +546,10 @@ if (!isset($_SESSION['hide']['new_category']))
<div class="col-sm-9 col-sm-offset-3">
<input type="hidden" name="a" value="new_category" />
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
<input type="submit" value="<?php echo $hesklang['kb_cat_add']; ?>" class="btn btn-default" />
<a class="btn btn-default" href="manage_knowledgebase.php"><?php echo $hesklang['cancel']; ?></a>
<div class="btn-group">
<input type="submit" value="<?php echo $hesklang['kb_cat_add']; ?>" class="btn btn-primary" />
<a class="btn btn-default" href="manage_knowledgebase.php"><?php echo $hesklang['cancel']; ?></a>
</div>
</div>
</div>
</form>
@ -1325,8 +1343,13 @@ function edit_article()
<h3 class="move-right-10"><?php echo $hesklang['kb_art_edit']; ?></h3>
<div class="footerWithBorder blankSpace move-right-10 move-left-10"></div>
<form action="manage_knowledgebase.php" role="form" method="post" name="form1" enctype="multipart/form-data">
<?php
$onsubmit = '';
if ($hesk_settings['kb_wysiwyg']) {
$onsubmit = 'onsubmit="return validateRichText(\'content-help-block\', \'content-group\', \'content\', \''.addslashes($hesklang['kb_e_cont']).'\')"';
}
?>
<form action="manage_knowledgebase.php" role="form" method="post" name="form1" enctype="multipart/form-data" data-toggle="validator" <?php echo $onsubmit; ?>>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default move-right-10">
@ -1403,9 +1426,15 @@ function edit_article()
</span>
<div class="form-group">
<label for="subject" class="control-label"><?php echo $hesklang['kb_subject']; ?></label>
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['kb_subject']); ?>" name="subject" size="70" maxlength="255" value="<?php echo $article['subject']; ?>" />
<input type="text" data-error="<?php echo htmlspecialchars($hesklang['kb_e_subj']); ?>" class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['kb_subject']); ?>" name="subject" size="70" maxlength="255" value="<?php echo $article['subject']; ?>" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="content-group">
<textarea name="content" class="form-control" data-error="<?php echo htmlspecialchars($hesklang['kb_e_cont']); ?>" id="content"
placeholder="<?php echo htmlspecialchars($hesklang['kb_content']); ?>" rows="25" cols="70" id="content" required><?php echo $article['content']; ?></textarea>
<div class="help-block with-errors" id="content-help-block"></div>
</div>
<textarea name="content" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['kb_content']); ?>" rows="25" cols="70" id="content"><?php echo $article['content']; ?></textarea>
</div>
<div class="col-md-3">
<div class="panel panel-default move-left-10">
@ -1601,10 +1630,13 @@ function manage_category() {
<div class="panel panel-default">
<div class="panel-heading"><?php echo $hesklang['catset']; ?></div>
<div class="panel-body">
<form action="manage_knowledgebase.php" method="post" role="form" name="form1" onsubmit="Javascript:return hesk_deleteIfSelected('dodelete','<?php echo hesk_makeJsString($hesklang['kb_delcat']); ?>')">
<form action="manage_knowledgebase.php" method="post" role="form" name="form1" data-toggle="validator"
onsubmit="Javascript:return hesk_deleteIfSelected('dodelete','<?php echo hesk_makeJsString($hesklang['kb_delcat']); ?>')">
<div class="form-group">
<label for="title" class="control-label"><?php echo $hesklang['kb_cat_title']; ?></label>
<input type="text" class="form-control" name="title" size="70" maxlength="255" value="<?php echo $this_cat['name']; ?>" />
<input type="text" class="form-control" name="title" size="70" maxlength="255" value="<?php echo $this_cat['name']; ?>"
data-error="<?php echo htmlspecialchars($hesklang['kb_cat_e_title']); ?>" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label for="parent" class="control-label"><?php echo $hesklang['kb_cat_parent']; ?></label>
@ -1637,12 +1669,14 @@ function manage_category() {
</div>
</div>
</div>
<div class="form-group text-center">
<div class="form-group">
<input type="hidden" name="a" value="edit_category" />
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
<input type="hidden" name="catid" value="<?php echo $catid; ?>" />
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-default" />
<a class="btn btn-default" href="manage_knowledgebase.php?a=add_category&amp;parent='.$catid.'"><?php echo $hesklang['kb_i_cat2']; ?></a>
<div class="btn-group">
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-primary" />
<a class="btn btn-default" href="manage_knowledgebase.php?a=add_category&amp;parent='.$catid.'"><?php echo $hesklang['kb_i_cat2']; ?></a>
</div>
</div>
</form>
</div>

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -95,35 +96,38 @@ while ($row = hesk_dbFetchAssoc($res)) {
}
?>
<div class="row move-down-20">
<div class="col-md-10 col-md-offset-1">
<h3><?php echo $hesklang['manage_permission_templates']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="tooltip" data-placement="right"
title="<?php echo $hesklang['manage_permission_templates_help']; ?>"></i>
</h3>
<div class="footerWithBorder blankSpace"></div>
<div class="col-md-12">
<?php
hesk_handle_messages();
?>
<a href="#" data-toggle="modal" data-target="#modal-template-new" class="btn btn-success">
<i class="fa fa-plus-circle"></i> <?php echo $hesklang['create_new_template']; ?>
</a>
<table class="table table-striped">
<thead>
<th><?php echo $hesklang['name']; ?></th>
<th><?php echo $hesklang['number_of_users']; ?></th>
<th><?php echo $hesklang['actions']; ?></th>
</thead>
<tbody>
<?php foreach ($templates as $row): ?>
<tr>
<td><?php echo $row['name']; ?></td>
<td><?php echo getNumberOfUsersWithPermissionGroup($row['id']); ?></td>
<td>
<a href="#" data-toggle="modal" data-target="#modal-template-<?php echo $row['id'] ?>">
<i class="fa fa-pencil icon-link" data-toggle="tooltip"
title="<?php echo $hesklang['view_permissions_for_this_template'] ?>"></i></a>
<?php if ($row['id'] == 1) { ?>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['manage_permission_templates']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="tooltip" data-placement="right"
title="<?php echo $hesklang['manage_permission_templates_help']; ?>"></i>
<span class="nu-floatRight panel-button">
<a href="#" data-toggle="modal" data-target="#modal-template-new" class="btn btn-success nu-floatRight">
<i class="fa fa-plus-circle"></i> <?php echo $hesklang['create_new_template']; ?>
</a>
</span>
</h4>
</div>
<table class="table table-striped">
<thead>
<th><?php echo $hesklang['name']; ?></th>
<th><?php echo $hesklang['number_of_users']; ?></th>
<th><?php echo $hesklang['actions']; ?></th>
</thead>
<tbody>
<?php foreach ($templates as $row): ?>
<tr>
<td><?php echo $row['name']; ?></td>
<td><?php echo getNumberOfUsersWithPermissionGroup($row['id']); ?></td>
<td>
<a href="#" data-toggle="modal" data-target="#modal-template-<?php echo $row['id'] ?>">
<i class="fa fa-pencil icon-link" data-toggle="tooltip"
title="<?php echo $hesklang['view_permissions_for_this_template'] ?>"></i></a>
<?php if ($row['id'] == 1) { ?>
<i class="fa fa-star icon-link orange" data-toggle="tooltip"
title="<?php echo $hesklang['admin_cannot_be_staff']; ?>"></i></a>
<?php } elseif ($row['heskprivileges'] == 'ALL' && $row['categories'] == 'ALL'){ ?>
@ -141,17 +145,18 @@ while ($row = hesk_dbFetchAssoc($res)) {
title="<?php echo $hesklang['staff_cannot_be_admin']; ?>"></i>
<?php
}
if ($row['id'] != 1 && $row['id'] != 2):
?>
<a href="manage_permission_templates.php?a=delete&amp;id=<?php echo $row['id']; ?>">
<i class="fa fa-times icon-link red" data-toggle="tooltip"
title="<?php echo $hesklang['delete']; ?>"></i></a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
if ($row['id'] != 1 && $row['id'] != 2):
?>
<a href="manage_permission_templates.php?a=delete&amp;id=<?php echo $row['id']; ?>">
<i class="fa fa-times icon-link red" data-toggle="tooltip"
title="<?php echo $hesklang['delete']; ?>"></i></a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php
@ -192,7 +197,7 @@ function createEditModal($template, $features, $categories)
aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form action="manage_permission_templates.php" role="form" method="post">
<form action="manage_permission_templates.php" role="form" method="post" id="form<?php echo $template['id']; ?>">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
@ -205,14 +210,19 @@ function createEditModal($template, $features, $categories)
<i class="fa fa-info-circle"></i> <?php echo $hesklang['template_is_admin_cannot_change']; ?>
</div>
<?php endif; ?>
<div class="col-sm-2">
<label for="name"
class="control-label"><?php echo $hesklang['template_name']; ?></label>
</div>
<div class="col-sm-10">
<input type="text" class="form-control" name="name"
value="<?php echo $template['name']; ?>"
placeholder="<?php echo $hesklang['template_name']; ?>">
<div class="form-group">
<div class="col-sm-2">
<label for="name"
class="control-label"><?php echo $hesklang['template_name']; ?></label>
</div>
<div class="col-sm-10">
<input type="text" class="form-control" name="name"
value="<?php echo htmlspecialchars($template['name']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['template_name']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="row">
@ -220,8 +230,8 @@ function createEditModal($template, $features, $categories)
<h4><?php echo $hesklang['menu_cat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($categories as $category): ?>
<div class="form-group">
<div class="form-group">
<?php foreach ($categories as $category): ?>
<div class="checkbox">
<label>
<?php
@ -234,15 +244,16 @@ function createEditModal($template, $features, $categories)
<?php echo $category['name']; ?>
</label>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['allow_feat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($features as $feature): ?>
<div class="form-group">
<div class="form-group">
<?php foreach ($features as $feature): ?>
<div class="checkbox">
<label><?php
$checked = '';
@ -254,8 +265,9 @@ function createEditModal($template, $features, $categories)
<?php echo $hesklang[$feature]; ?>
</label>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
</div>
@ -287,7 +299,7 @@ function buildCreateModal($features, $categories)
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form action="manage_permission_templates.php" role="form" method="post">
<form action="manage_permission_templates.php" role="form" method="post" id="createForm">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
@ -295,13 +307,16 @@ function buildCreateModal($features, $categories)
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-2">
<label for="name"
class="control-label"><?php echo $hesklang['template_name']; ?></label>
</div>
<div class="col-sm-10">
<input type="text" class="form-control" name="name"
placeholder="<?php echo $hesklang['template_name']; ?>">
<div class="form-group">
<div class="col-sm-2">
<label for="name"
class="control-label"><?php echo $hesklang['template_name']; ?></label>
</div>
<div class="col-sm-10">
<input type="text" class="form-control" name="name"
placeholder="<?php echo $hesklang['template_name']; ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="row">
@ -309,33 +324,39 @@ function buildCreateModal($features, $categories)
<h4><?php echo $hesklang['menu_cat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($categories as $category): ?>
<div class="form-group">
<div class="form-group">
<?php foreach ($categories as $category): ?>
<div class="checkbox">
<label>
<input type="checkbox" name="categories[]"
data-modal="new-categories"
data-checkbox="categories"
value="<?php echo $category['id']; ?>">
<?php echo $category['name']; ?>
</label>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['allow_feat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($features as $feature): ?>
<div class="form-group">
<div class="form-group">
<?php foreach ($features as $feature): ?>
<div class="checkbox">
<label>
<input type="checkbox" name="features[]"
data-modal="new-features"
data-checkbox="features"
value="<?php echo $feature; ?>">
<?php echo $hesklang[$feature]; ?>
</label>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
</div>
@ -350,6 +371,9 @@ function buildCreateModal($features, $categories)
</div>
</div>
</form>
<script>
buildValidatorForPermissionTemplates('createForm', '<?php echo $hesklang['select_at_least_one_value']; ?>');
</script>
</div>
</div>
</div>

@ -102,7 +102,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div class="panel-heading">
<h4>
<?php echo $hesklang['statuses']; ?>
<span class="nu-floatRight panel-buton">
<span class="nu-floatRight panel-button">
<button class="btn btn-success" data-toggle="modal" data-target="#modal-status-new">
<i class="fa fa-plus-circle"></i>
<?php
@ -446,7 +446,7 @@ function buildCreateModal()
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form action="manage_statuses.php" role="form" method="post" class="form-horizontal">
<form action="manage_statuses.php" role="form" method="post" class="form-horizontal" data-toggle="validator">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
@ -470,7 +470,9 @@ function buildCreateModal()
<div class="col-sm-9">
<input type="text" placeholder="<?php echo htmlspecialchars($language); ?>"
class="form-control" name="name[<?php echo $language; ?>]">
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
class="form-control" name="name[<?php echo $language; ?>]" required>
<div class="help-block with-errors"></div>
</div>
</div>
<?php endforeach; ?>
@ -490,7 +492,9 @@ function buildCreateModal()
<div class="col-sm-8">
<input type="text" name="text-color" class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['textColor']); ?>">
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['textColor']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
@ -571,7 +575,7 @@ function buildEditModal($statusId)
aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form action="manage_statuses.php" role="form" method="post" class="form-horizontal">
<form action="manage_statuses.php" role="form" method="post" class="form-horizontal" data-toggle="validator">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
@ -613,7 +617,9 @@ function buildEditModal($statusId)
<div class="col-sm-9">
<input type="text" placeholder="<?php echo htmlspecialchars($language); ?>"
class="form-control" name="name[<?php echo $language; ?>]"
value="<?php echo htmlspecialchars($text); ?>">
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
value="<?php echo htmlspecialchars($text); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<?php endforeach; ?>
@ -634,7 +640,9 @@ function buildEditModal($statusId)
<div class="col-sm-8">
<input type="text" name="text-color" class="form-control"
value="<?php echo $status['TextColor']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['textColor']); ?>">
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['textColor']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -187,8 +188,13 @@ $num = hesk_dbNumRows($result);
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form class="form-horizontal" action="manage_ticket_templates.php" method="post" name="form1" role="form">
<form class="form-horizontal" action="manage_ticket_templates.php" method="post" name="form1" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
<h3><?php echo $hesklang['new_ticket_tpl']; ?> <a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['ticket_tpl_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a></h3>
@ -235,21 +241,24 @@ $num = hesk_dbNumRows($result);
<div class="col-sm-10">
<span id="HeskTitle">
<input id="subject" class="form-control" type="text" name="name" size="40" maxlength="50"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['ticket_tpl_title']); ?>"
<?php if (isset($_SESSION['canned']['name'])) {
echo ' value="' . stripslashes($_SESSION['canned']['name']) . '" ';
} ?>>
} ?> required>
</span>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="form-group" id="message-group">
<label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="col-sm-10">
<span id="HeskMsg">
<textarea id="message" class="form-control htmlEditor"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="msg"
rows="15" cols="70"><?php
rows="15" cols="70" required><?php
if (isset($_SESSION['canned']['msg'])) {
if ($modsForHesk_settings['rich_text_for_tickets']) {
echo $_SESSION['canned']['msg'];
@ -259,6 +268,7 @@ $num = hesk_dbNumRows($result);
}
?></textarea>
</span>
<div class="help-block with-errors" id="message-help-block"></div>
</div>
</div>
<div class="form-group">

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -326,7 +327,7 @@ EOC;
<div class="footerWithBorder blankSpace"></div>
<form name="form1" method="post" action="manage_users.php" class="form-horizontal" role="form">
<form data-toggle="validator" name="form1" method="post" action="manage_users.php" class="form-horizontal" role="form">
<?php hesk_profile_tab('userdata', false, 'create_user'); ?>
</form>
</div>

@ -31,6 +31,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('WYSIWYG', 1);
define('VALIDATOR', 1);
// Auto-focus first empty or error field
define('AUTOFOCUS', true);
@ -176,9 +177,15 @@ if (!$show['show']) {
});
/* ]]> */
</script>
<?php endif; ?>
<?php endif;
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form role="form" class="form-horizontal" method="post" action="admin_submit_ticket.php" name="form1"
enctype="multipart/form-data">
enctype="multipart/form-data" <?php echo $onsubmit; ?>>
<?php if ($hesk_settings['can_sel_lang']) { ?>
<div class="form-group">
<label for="customerLanguage" class="col-sm-3 control-label"><?php echo $hesklang['chol']; ?>:&nbsp;<span
@ -197,8 +204,8 @@ if (!$show['show']) {
} else {
echo '<div class="form-group">';
} ?>
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>: <font
class="important">*</font></label>
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="name" size="40" maxlength="30"
@ -207,11 +214,13 @@ if (!$show['show']) {
} else if (isset($_GET['name'])) {
echo hesk_GET('name');
} ?>"
placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>">
data-error="<?php echo htmlspecialchars($hesklang['enter_your_name']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?>: </label>
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="email" size="40" maxlength="1000" id="email-input"
@ -237,11 +246,14 @@ if (!$show['show']) {
} else {
echo '<div class="form-group">';
} ?>
<label for="category" class="col-sm-3 control-label"><?php echo $hesklang['category']; ?>: <font
class="important">*</font></label>
<label for="category" class="col-sm-3 control-label"><?php echo $hesklang['category']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
<select name="category" class="form-control">
<select name="category" class="form-control"
pattern="[0-9]+"
data-error="<?php echo htmlspecialchars($hesklang['sel_app_cat']); ?>"
required>
<?php
// Show the "Click to select"?
if ($hesk_settings['select_cat']) {
@ -261,6 +273,7 @@ if (!$show['show']) {
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<?php if (in_array('priority', $_SESSION['iserror'])) {
@ -268,10 +281,13 @@ if (!$show['show']) {
} else {
echo '<div class="form-group">';
} ?>
<label for="priority" class="col-sm-3 control-label"><?php echo $hesklang['priority']; ?>: <font
class="important">*</font></label>
<label for="priority" class="col-sm-3 control-label"><?php echo $hesklang['priority']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
<select name="priority" class="form-control">
<select name="priority" class="form-control"
pattern="[0-9]+"
data-error="<?php echo htmlspecialchars($hesklang['sel_app_priority']); ?>"
required>
<?php
// Show the "Click to select"?
if ($hesk_settings['select_pri']) {
@ -303,6 +319,7 @@ if (!$show['show']) {
echo 'selected="selected"';
} ?>><?php echo $hesklang['critical']; ?></option>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<!-- Start Custom Before -->
@ -342,7 +359,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
switch ($v['type']) {
/* Radio box */
case 'radio':
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . '</label><div align="left" class="col-sm-9">';
$options = explode('#HESK#', $v['value']);
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
@ -375,7 +392,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '" ' . $cls . '>';
// Show "Click to select"?
@ -408,7 +425,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
$options = explode('#HESK#', $v['value']);
@ -438,7 +455,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $v['name']);
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . '</label><div align="left" class="col-sm-9">';
$options = explode('#HESK#', $v['value']);
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
@ -468,7 +485,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><textarea class="form-control" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div>
</div>';
break;
@ -486,7 +503,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9">
<input type="text" class="datepicker form-control white-readonly ' . $cls . '" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40"
maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" readonly/>
@ -512,7 +529,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
</div>';
@ -545,7 +562,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' readonly></div>
</div>';
@ -564,7 +581,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
</div>';
}
@ -672,7 +689,7 @@ if (hesk_dbNumRows($res)) {
if (strlen($can_options)) {
?>
<div class="form-group">
<label for="modeadd" class="col-sm-3 control-label"><?php echo $hesklang['ticket_tpl']; ?>:</label>
<label for="modeadd" class="col-sm-3 control-label"><?php echo $hesklang['ticket_tpl']; ?></label>
<div class="col-sm-9">
<div class="radio">
@ -686,7 +703,7 @@ if (strlen($can_options)) {
</div>
</div>
<div class="form-group">
<label for="saved_replies" class="col-sm-3 control-label"><?php echo $hesklang['select_ticket_tpl']; ?>:</label>
<label for="saved_replies" class="col-sm-3 control-label"><?php echo $hesklang['select_ticket_tpl']; ?></label>
<div class="col-sm-9">
<select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
@ -713,27 +730,33 @@ elseif (hesk_checkPermission('can_man_ticket_tpl', 0)) {
} else {
echo '<div class="form-group">';
} ?>
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?>: <font
class="important">*</font></label>
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
<span id="HeskSub"><input class="form-control" type="text" name="subject" id="subject" size="40" maxlength="40"
value="<?php if (isset($_SESSION['as_subject']) || isset($_GET['subject'])) {
echo stripslashes(hesk_input($_SESSION['as_subject']));
} ?>" placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"/></span>
} ?>" placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_subject']); ?>"
required></span>
<div class="help-block with-errors"></div>
</div>
</div>
<?php if (in_array('message', $_SESSION['iserror'])) {
echo '<div class="form-group has-error">';
echo '<div class="form-group has-error" id="message-group">';
} else {
echo '<div class="form-group">';
echo '<div class="form-group" id="message-group">';
} ?>
<div class="col-sm-12">
<span id="HeskMsg">
<textarea class="form-control htmlEditor" name="message" id="message" rows="12" cols="60"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>"><?php if (isset($_SESSION['as_message'])) {
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_message']); ?>"
required><?php if (isset($_SESSION['as_message'])) {
echo stripslashes(hesk_input($_SESSION['as_message']));
} ?></textarea>
</span>
<div class="help-block with-errors" id="message-help-block"></div>
</div>
</div>
<hr/>
@ -772,7 +795,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $v['name']);
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . '</label><div align="left" class="col-sm-9">';
$options = explode('#HESK#', $v['value']);
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
@ -800,7 +823,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '" ' . $cls . '>';
// Show "Click to select"?
@ -832,7 +855,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $v['name']);
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . '</label><div align="left" class="col-sm-9">';
$options = explode('#HESK#', $v['value']);
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
@ -863,7 +886,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><textarea class="form-control" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div>
</div>';
break;
@ -881,7 +904,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9">
<input type="text" class="datepicker form-control white-readonly ' . $cls . '" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40"
maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" readonly/>
@ -897,7 +920,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
$options = explode('#HESK#', $v['value']);
@ -938,7 +961,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
</div>';
@ -971,7 +994,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' readonly></div>
</div>';
@ -990,7 +1013,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
</div>';
}
@ -1108,6 +1131,10 @@ if ($modsForHesk_settings['request_location']):
</div>
</div>
</form>
<script>
buildValidatorForTicketSubmission("form1",
"<?php echo addslashes($hesklang['select_at_least_one_value']); ?>");
</script>
</div>
</div>
<?php

@ -147,7 +147,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
}
?>
<form role="form" class="form-horizontal" method="post" action="profile.php" name="form1">
<form role="form" class="form-horizontal" method="post" action="profile.php" name="form1" data-toggle="validator">
<?php hesk_profile_tab('new'); ?>
</form>
</div>

@ -296,7 +296,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
class="fa fa-question-circle settingsquestionmark"></i></a></h4>
</div>
<div class="panel-body">
<form action="service_messages.php" method="post" name="form1" role="form" class="form-horizontal">
<form action="service_messages.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="style"
class="col-md-2 control-label"><?php echo $hesklang['sm_style']; ?></label>
@ -415,7 +415,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
type="text" name="title" size="70" maxlength="255"
<?php if (isset($_SESSION['new_sm']['title'])) {
echo 'value="' . $_SESSION['new_sm']['title'] . '"';
} ?>>
} ?> data-error="<?php echo htmlspecialchars($hesklang['sm_e_title']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
@ -438,7 +439,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div class="col-md-10 col-md-offset-2">
<div class="btn-group" role="group">
<input type="submit" name="sm_save" value="<?php echo $hesklang['sm_save']; ?>"
class="btn btn-default">
class="btn btn-primary">
<input type="submit" name="sm_preview"
value="<?php echo $hesklang['sm_preview']; ?>" class="btn btn-default">
</div>

@ -92,6 +92,7 @@ $modsForHesk_settings = mfh_getSettings();
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-iconpicker.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/platform.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-validator.min.js"></script>
<style>
.navbar-default {
background-color: <?php echo $modsForHesk_settings['navbarBackgroundColor']; ?>;
@ -204,6 +205,12 @@ $modsForHesk_settings = mfh_getSettings();
if (defined('RECAPTCHA')) {
echo '<script src="https://www.google.com/recaptcha/api.js?hl=' . $hesklang['RECAPTCHA'] . '" async defer></script>';
}
if (defined('VALIDATOR')) {
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/validation-scripts.js"></script>
<?php
}
?>
</head>

@ -88,6 +88,7 @@ $modsForHesk_settings = mfh_getSettings();
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-iconpicker.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/platform.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-validator.min.js"></script>
<style>
.navbar-default {
background-color: <?php echo $modsForHesk_settings['navbarBackgroundColor']; ?>;
@ -173,6 +174,12 @@ $modsForHesk_settings = mfh_getSettings();
<?php
}
if (defined('VALIDATOR')) {
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/validation-scripts.js"></script>
<?php
}
/* If page requires timer load Javascript */
if (defined('TIMER')) {
?>

@ -64,66 +64,85 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
<div class="tab-content summaryList tabPadding">
<div role="tabpanel" class="tab-pane fade in active" id="profile-info">
<div class="form-group">
<label for="name" class="col-md-3 control-label"><?php echo $hesklang['real_name']; ?>: <font
class="important">*</font></label>
<label for="name" class="col-md-3 control-label"><?php echo $hesklang['real_name']; ?>
<span class="important">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" name="name" size="40" maxlength="50"
value="<?php echo $_SESSION[$session_array]['name']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['real_name']); ?>"/>
placeholder="<?php echo htmlspecialchars($hesklang['real_name']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_real_name']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="email" class="col-md-3 control-label"><?php echo $hesklang['email']; ?>: <font
class="important">*</font></label>
<label for="email" class="col-md-3 control-label"><?php echo $hesklang['email']; ?>
<span class="important">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" name="email" size="40" maxlength="255"
<input type="email" class="form-control" name="email" size="40" maxlength="255"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"
value="<?php echo $_SESSION[$session_array]['email']; ?>"/>
value="<?php echo $_SESSION[$session_array]['email']; ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_valid_email']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
<?php
if (!$is_profile_page || $_SESSION['isadmin']) {
?>
<div class="form-group">
<label for="user" class="col-md-3 control-label"><?php echo $hesklang['username']; ?>: <font
class="important">*</font></label>
<label for="user" class="col-md-3 control-label"><?php echo $hesklang['username']; ?>
<span class="important">*</span></label>
<div class="col-md-9">
<input type="text" class="form-control" name="user" size="40" maxlength="20"
value="<?php echo $_SESSION[$session_array]['user']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['username']); ?>"/>
placeholder="<?php echo htmlspecialchars($hesklang['username']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_username']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
<?php
}
$passwordRequiredSpan = $action == 'create_user' ? '' : 'display:none';
$passwordValidator = 'data-error="'.htmlspecialchars($hesklang['password_not_valid']).'" data-minlength="5" required';
$confirmPasswordValidator = 'data-error="'.htmlspecialchars($hesklang['passwords_not_same']).'" data-match="#newpass" required';
$passwordRequiredSpan = '';
if ($action != 'create_user') {
$passwordValidator = '';
$confirmPasswordValidator = '';
$passwordRequiredSpan = 'display:none';
}
?>
<div class="form-group">
<label for="pass"
class="col-md-3 control-label"><?php echo $is_profile_page ? $hesklang['new_pass'] : $hesklang['pass']; ?>
: <span class="important" style="<?php echo $passwordRequiredSpan; ?>">*</span></label>
<span class="important" style="<?php echo $passwordRequiredSpan; ?>">*</span></label>
<div class="col-md-9">
<input type="password" class="form-control" name="newpass" autocomplete="off" size="40"
<input type="password" class="form-control" id="newpass" name="newpass" autocomplete="off" size="40"
placeholder="<?php echo htmlspecialchars($hesklang['pass']); ?>"
value="<?php echo isset($_SESSION[$session_array]['cleanpass']) ? $_SESSION[$session_array]['cleanpass'] : ''; ?>"
onkeyup="javascript:hesk_checkPassword(this.value)"/>
onkeyup="javascript:hesk_checkPassword(this.value)" <?php echo $passwordValidator; ?>>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="confirmPass" class="col-md-3 control-label"><?php echo $hesklang['confirm_pass']; ?>:
<label for="confirmPass" class="col-md-3 control-label"><?php echo $hesklang['confirm_pass']; ?>
<span class="important" style="<?php echo $passwordRequiredSpan; ?>">*</span></label>
<div class="col-md-9">
<input type="password" name="newpass2" class="form-control" autocomplete="off"
placeholder="<?php echo htmlspecialchars($hesklang['confirm_pass']); ?>" size="40"
value="<?php echo isset($_SESSION[$session_array]['cleanpass']) ? $_SESSION[$session_array]['cleanpass'] : ''; ?>"/>
value="<?php echo isset($_SESSION[$session_array]['cleanpass']) ? $_SESSION[$session_array]['cleanpass'] : ''; ?>"
<?php echo $confirmPasswordValidator; ?>>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="pwStrength" class="col-md-3 control-label"><?php echo $hesklang['pwdst']; ?>:</label>
<label for="pwStrength" class="col-md-3 control-label"><?php echo $hesklang['pwdst']; ?></label>
<div class="col-md-9">
<div class="progress">
@ -185,8 +204,8 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
<div id="options">
<div class="form-group">
<label for="categories[]"
class="col-md-3 control-label"><?php echo $hesklang['allowed_cat']; ?>: <font
class="important">*</font></label>
class="col-md-3 control-label"><?php echo $hesklang['allowed_cat']; ?> <span
class="important">*</span></label>
<div class="col-md-9">
<?php
@ -203,8 +222,8 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
</div>
<div class="form-group">
<label for="features[]"
class="col-md-3 control-label"><?php echo $hesklang['allow_feat']; ?>: <font
class="important">*</font></label>
class="col-md-3 control-label"><?php echo $hesklang['allow_feat']; ?> <span
class="important">*</span></label>
<div class="col-md-9">
<?php
@ -226,9 +245,7 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
?>
<div role="tabpanel" class="tab-pane fade" id="signature">
<div class="form-group">
<label for="signature" class="col-md-3 control-label"><?php echo $hesklang['signature_max']; ?>
:</label>
<label for="signature" class="col-md-3 control-label"><?php echo $hesklang['signature_max']; ?></label>
<div class="col-md-9">
<textarea class="form-control" name="signature" rows="6"
placeholder="<?php echo htmlspecialchars($hesklang['sig']); ?>"
@ -242,8 +259,7 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
if (!$is_profile_page || $can_reply_tickets) {
?>
<div class="form-group">
<label for="afterreply" class="col-sm-3 control-label"><?php echo $hesklang['aftrep']; ?>
:</label>
<label for="afterreply" class="col-sm-3 control-label"><?php echo $hesklang['aftrep']; ?></label>
<div class="col-sm-9">
<div class="radio">
@ -316,7 +332,7 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
</div>
<div role="tabpanel" class="tab-pane fade" id="notifications">
<?php $disabledText =
(!$_SESSION[$session_array]['isadmin'] && strpos($_SESSION[$session_array]['heskprivileges'], 'can_change_notification_settings') === false)
(!$_SESSION[$session_array]['isadmin'] && isset($_SESSION[$session_array]['heskprivileges']) && strpos($_SESSION[$session_array]['heskprivileges'], 'can_change_notification_settings') === false)
? 'disabled' : '';
if (!$is_profile_page) {
$disabledText = '';
@ -453,8 +469,10 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
{ ?>
<input type="hidden" name="a" value="new" />
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
<input type="submit" value="<?php echo $hesklang['create_user']; ?>" class="btn btn-default">
<a href="manage_users.php?a=reset_form" class="btn btn-danger"><?php echo $hesklang['refi']; ?></a></p>
<div class="btn-group">
<input type="submit" value="<?php echo $hesklang['create_user']; ?>" class="btn btn-default">
<a href="manage_users.php?a=reset_form" class="btn btn-danger"><?php echo $hesklang['refi']; ?></a>
</div>
<?php
} elseif ($action == 'edit_user')
{ ?>
@ -462,8 +480,10 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
<input type="hidden" name="userid" value="<?php echo intval( hesk_GET('id') ); ?>" />
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
<input type="hidden" name="active" value="<?php echo $_SESSION[$session_array]['active']; ?>">
<input class="btn btn-default" type="submit" value="<?php echo $hesklang['save_changes']; ?>" />
<a class="btn btn-danger" href="manage_users.php"><?php echo $hesklang['dich']; ?></a>
<div class="btn-group">
<input class="btn btn-default" type="submit" value="<?php echo $hesklang['save_changes']; ?>">
<a class="btn btn-danger" href="manage_users.php"><?php echo $hesklang['dich']; ?></a>
</div>
<?php
}
?>

@ -402,15 +402,20 @@ $more2 = empty($_GET['more2']) ? 0 : 1;
<tr>
<td valign="top">
<form class="form-inline" action="find_tickets.php" method="get" name="findby" id="findby">
<form data-toggle="validator" class="form-inline" action="find_tickets.php" method="get" name="findby" id="findby">
<table class="table" style="width: auto" border="0" cellpadding="3" cellspacing="0">
<tr style="border: none">
<td class="text-left" style="border: none">
<b style="color: #000"><?php echo $hesklang['s_for']; ?></b><br/>
<input class="form-control" type="text" name="q" size="30" <?php if (isset($q)) {
echo 'value="' . $q . '"';
} ?> />
<div class="form-group">
<input class="form-control" type="text" name="q" size="30" <?php if (isset($q)) {
echo 'value="' . $q . '"';
} ?>
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</td>
<td class="text-left" style="border: none">
<b style="color: #000"><?php echo $hesklang['s_in']; ?></b><br/>

@ -31,6 +31,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', './');
define('WYSIWYG', 1);
define('VALIDATOR', 1);
// Get all the required files and functions
require(HESK_PATH . 'hesk_settings.inc.php');
@ -186,8 +187,14 @@ function print_add_ticket()
<div align="left" class="h3"><?php echo $hesklang['add_ticket_general_information']; ?></div>
<div class="footerWithBorder"></div>
<div class="blankSpace"></div>
<?php
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets_for_customers']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form class="form-horizontal" role="form" method="post" action="submit_ticket.php?submit=1" name="form1"
enctype="multipart/form-data">
enctype="multipart/form-data" <?php echo $onsubmit; ?>>
<!-- Contact info -->
<div class="form-group">
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>: <font
@ -199,12 +206,14 @@ function print_add_ticket()
echo stripslashes(hesk_input($_SESSION['c_name']));
} ?>" <?php if (in_array('name', $_SESSION['iserror'])) {
echo ' class="isError" ';
} ?> placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>"/>
} ?> placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_your_name']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?>: <font
class="important">*</font></label>
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?>: <span
class="important">*</span></label>
<div class="col-sm-9">
<input type="text" class="form-control" id="email" name="email" size="40" maxlength="1000"
@ -216,23 +225,31 @@ function print_add_ticket()
echo ' class="isNotice" ';
} ?> <?php if ($hesk_settings['detect_typos']) {
echo ' onblur="Javascript:hesk_suggestEmail(0)"';
} ?> placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"/>
} ?> placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_valid_email']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<?php
if ($hesk_settings['confirm_email']) {
?>
<div class="form-group">
<label for="email2" class="col-sm-3 control-label"><?php echo $hesklang['confemail']; ?>: <font
class="important">*</font></label>
<label for="email2" class="col-sm-3 control-label"><?php echo $hesklang['confemail']; ?>: <span
class="important">*</span></label>
<div class="col-sm-9">
<input type="text" id="email2" class="form-control" name="email2" size="40" maxlength="1000"
<input type="text" id="email2" class="form-control" name="email2" size="40"
maxlength="1000"
value="<?php if (isset($_SESSION['c_email2'])) {
echo stripslashes(hesk_input($_SESSION['c_email2']));
} ?>" <?php if (in_array('email2', $_SESSION['iserror'])) {
echo ' class="isError" ';
} ?> placeholder="<?php echo htmlspecialchars($hesklang['confemail']); ?>"/>
} ?> placeholder="<?php echo htmlspecialchars($hesklang['confemail']); ?>"
data-match="#email"
data-error="<?php echo htmlspecialchars($hesklang['confemaile']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<?php
@ -240,8 +257,6 @@ function print_add_ticket()
<div id="email_suggestions"></div>
<!-- Department and priority -->
<?php
$is_table = 0;
// Get categories
hesk_dbConnect();
$orderBy = $modsForHesk_settings['category_order_column'];
@ -255,18 +270,18 @@ function print_add_ticket()
// No public categories, set it to default one
echo '<input type="hidden" name="category" value="1" />';
} else {
// List available categories
$is_table = 1;
?>
<div class="form-group">
<label for="category" class="col-sm-3 control-label"><?php echo $hesklang['category']; ?>: <font
class="important">*</font></label>
<label for="category" class="col-sm-3 control-label"><?php echo $hesklang['category']; ?>: <span
class="important">*</span></label>
<div class="col-sm-9">
<select name="category" id="category"
class="form-control" <?php if (in_array('category', $_SESSION['iserror'])) {
echo ' class="isError" ';
} ?> ><?php
class="form-control" pattern="[0-9]+"
data-error="<?php echo htmlspecialchars($hesklang['sel_app_cat']); ?>" required
<?php if (in_array('category', $_SESSION['iserror'])) {
echo ' class="isError" ';
} ?> ><?php
// Show the "Click to select"?
if ($hesk_settings['select_cat']) {
echo '<option value="">' . $hesklang['select'] . '</option>';
@ -276,6 +291,8 @@ function print_add_ticket()
echo '<option value="' . $row['id'] . '"' . (($_SESSION['c_category'] == $row['id']) ? ' selected="selected"' : '') . '>' . $row['name'] . '</option>';
} ?>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<?php
@ -285,14 +302,16 @@ function print_add_ticket()
if ($hesk_settings['cust_urgency']) {
?>
<div class="form-group">
<label for="priority" class="col-sm-3 control-label"><?php echo $hesklang['priority']; ?>: <font
class="important">*</font></label>
<label for="priority" class="col-sm-3 control-label"><?php echo $hesklang['priority']; ?>: <span
class="important">*</span></label>
<div class="col-sm-9">
<select id="priority" class="form-control"
pattern="[0-9]+"
data-error="<?php echo htmlspecialchars($hesklang['sel_app_priority']); ?>"
name="priority" <?php if (in_array('priority', $_SESSION['iserror'])) {
echo ' class="isError" ';
} ?> >
} ?> required>
<?php
// Show the "Click to select"?
if ($hesk_settings['select_pri']) {
@ -312,6 +331,8 @@ function print_add_ticket()
echo 'selected="selected"';
} ?>><?php echo $hesklang['high']; ?></option>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<?php
@ -330,9 +351,10 @@ function print_add_ticket()
$v['name'] = $hesklang[$v['name']];
}
$v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
$required = $v['req'] ? 'required' : '';
$v['req'] = $v['req'] ? '<span class="important">*</span>' : '';
if ($v['type'] == 'checkbox') {
if ($v['type'] == 'checkbox' || $v['type'] == 'multiselect') {
$k_value = array();
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
foreach ($_SESSION["c_$k"] as $myCB) {
@ -366,9 +388,10 @@ function print_add_ticket()
$checked = '';
}
echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' ' . $required . ' > ' . $option . '</label><br />';
}
echo '<div class="help-block with-errors"></div>';
echo '</div></div>';
break;
@ -408,6 +431,7 @@ function print_add_ticket()
/* Checkbox */
case 'checkbox':
$validator = $required == 'required' ? 'data-checkbox="' . $k . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -425,13 +449,14 @@ function print_add_ticket()
$checked = '';
}
echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
echo '<label style="font-weight: normal;"><input ' . $validator . ' id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
}
echo '</div></div>';
echo '<div class="help-block with-errors"></div></div></div>';
break;
/* Large text box */
case 'textarea':
$errorText = $required == 'required' ? 'data-error="' . htmlspecialchars($hesklang['this_field_is_required']) . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -444,11 +469,14 @@ function print_add_ticket()
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div>
<div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . ' ' . $errorText . ' ' . $required . '>' . $k_value . '</textarea>
<div class="help-block with-errors"></div>
</div>
</div>';
break;
case 'multiselect':
$validator = $required == 'required' ? 'data-multiselect="' . $k . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -456,7 +484,7 @@ function print_add_ticket()
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
<div class="col-sm-9"><select ' . $validator . ' class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
$options = explode('#HESK#', $v['value']);
@ -474,9 +502,10 @@ function print_add_ticket()
echo '</select>
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button>
<button type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button>
<button ' . $validator . ' type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button>
<button ' . $validator . ' type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button>
</div>
<div class="help-block with-errors"></div>
</div></div>';
break;
@ -520,7 +549,9 @@ function print_add_ticket()
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" data-error="' . htmlspecialchars($hesklang['enter_valid_email']) . '" ' . $cls . ' ' . $required . '>
<div class="help-block with-errors"></div>
</div>
</div>';
break;
@ -560,6 +591,7 @@ function print_add_ticket()
/* Default text input */
default:
$errorText = $required == 'required' ? 'data-error="' . htmlspecialchars($hesklang['this_field_is_required']) . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -572,7 +604,9 @@ function print_add_ticket()
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' ' . $errorText . ' ' . $required . '>
<div class="help-block with-errors"></div>
</div>
</div>';
}
}
@ -587,8 +621,8 @@ function print_add_ticket()
<div class="blankSpace"></div>
<!-- ticket info -->
<div class="form-group">
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?>: <font
class="important">*</font></label>
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?>: <span
class="important">*</span></label>
<div class="col-sm-9">
<input type="text" id="subject" class="form-control" name="subject" size="40" maxlength="40"
@ -596,19 +630,25 @@ function print_add_ticket()
echo stripslashes(hesk_input($_SESSION['c_subject']));
} ?>" <?php if (in_array('subject', $_SESSION['iserror'])) {
echo ' class="isError" ';
} ?> placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"/>
} ?> placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_subject']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="form-group" id="message-group">
<div class="col-sm-12">
<textarea placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="message"
id="message" class="form-control htmlEditor" rows="12"
cols="60" <?php if (in_array('message', $_SESSION['iserror'])) {
echo ' class="isError" ';
} ?> ><?php if (isset($_SESSION['c_message'])) {
} ?> data-error="<?php echo htmlspecialchars($hesklang['enter_message']); ?>"
required><?php if (isset($_SESSION['c_message'])) {
echo stripslashes(hesk_input($_SESSION['c_message']));
} ?></textarea>
<div class="help-block with-errors" id="message-help-block"></div>
<?php if ($modsForHesk_settings['rich_text_for_tickets_for_customers']): ?>
<script type="text/javascript">
/* <![CDATA[ */
@ -665,9 +705,9 @@ function print_add_ticket()
$v['name'] = $hesklang[$v['name']];
}
$v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
$v['req'] = $v['req'] ? '<span class="important">*</span>' : '';
if ($v['type'] == 'checkbox') {
if ($v['type'] == 'checkbox' || $v['type'] == 'multiselect') {
$k_value = array();
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
foreach ($_SESSION["c_$k"] as $myCB) {
@ -744,6 +784,7 @@ function print_add_ticket()
/* Checkbox */
case 'checkbox':
$validator = $required == 'required' ? 'data-checkbox="' . $k . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -761,13 +802,14 @@ function print_add_ticket()
$checked = '';
}
echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
echo '<label style="font-weight: normal;"><input ' . $validator . ' id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
}
echo '</div></div>';
echo '<div class="help-block with-errors"></div><</div></div>';
break;
/* Large text box */
case 'textarea':
$errorText = $required == 'required' ? 'data-error="' . htmlspecialchars($hesklang['this_field_is_required']) . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -780,11 +822,13 @@ function print_add_ticket()
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div>
<div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . ' ' . $errorText . ' ' . $required . '>' . $k_value . '</textarea>
<div class="help-block with-errors"></div>
</div>';
break;
case 'multiselect':
$validator = $required == 'required' ? 'data-multiselect="' . $k . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -792,7 +836,7 @@ function print_add_ticket()
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
<div class="col-sm-9"><select class="form-control" ' . $validator . ' id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
$options = explode('#HESK#', $v['value']);
@ -810,8 +854,8 @@ function print_add_ticket()
echo '</select>
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button>
<button type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button>
<button ' . $validator . ' type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button>
<button ' . $validator . ' type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button>
</div></div></div>';
break;
@ -855,7 +899,8 @@ function print_add_ticket()
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" data-error="' . htmlspecialchars($hesklang['enter_valid_email']) . '" ' . $cls . ' ' . $required . '>
<div class="help-block with-errors"></div>
</div>';
break;
@ -895,6 +940,7 @@ function print_add_ticket()
/* Default text input */
default:
$errorText = $required == 'required' ? 'data-error="' . htmlspecialchars($hesklang['this_field_is_required']) . '"' : '';
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
@ -907,7 +953,8 @@ function print_add_ticket()
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' ' . $errorText . ' ' . $required . '>
<div class="help-block with-errors"></div>
</div>';
}
}
@ -966,8 +1013,8 @@ function print_add_ticket()
{
?>
<div class="form-group">
<label for="secimage" class="col-sm-3 control-label"><?php echo $hesklang['verify_i']; ?> <font
class="important">*</font></label>
<label for="secimage" class="col-sm-3 control-label"><?php echo $hesklang['verify_i']; ?> <span
class="important">*</span></label>
<?php
// SPAM prevention verified for this session
if (isset($_SESSION['img_verified'])) {
@ -1078,12 +1125,16 @@ function print_add_ticket()
class="btn btn-default">
</div>
</div>
<script>
$('#screen-resolution-height').prop('value', screen.height);
$('#screen-resolution-width').prop('value', screen.width);
</script>
<?php
<?php
} // End IF submit_notice
else {
?>
<div class="row">
?>
<div class=" row">
<div class="col-md-9 col-md-offset-3">
<input type="hidden" id="latitude" name="latitude" value="E-0">
<input type="hidden" id="longitude" name="longitude" value="E-0">
@ -1108,8 +1159,11 @@ function print_add_ticket()
<!-- >
<input type="text" name="phone" value="3" />
< -->
</form>
<script>
buildValidatorForTicketSubmission("form1",
"<?php echo addslashes($hesklang['select_at_least_one_value']); ?>");
</script>
</div>
</div>
<?php if ($columnWidth == 'col-md-10 col-md-offset-1'): ?>
@ -1178,11 +1232,14 @@ function print_start()
<div class="panel panel-default">
<div class="panel-heading"><?php echo $hesklang['view_ticket']; ?></div>
<div class="panel-body">
<form role="form" class="viewTicketSidebar" action="ticket.php" method="get" name="form2">
<form data-toggle="validator" role="form" class="viewTicketSidebar" action="ticket.php" method="get" name="form2">
<div class="form-group">
<br/>
<label for="ticketID"><?php echo $hesklang['ticket_trackID']; ?>:</label>
<input type="text" class="form-control" name="track" id="ticketID" maxlength="20" size="35" value="" placeholder="<?php echo htmlspecialchars($hesklang['ticket_trackID']); ?>">
<input type="text" class="form-control" name="track" id="ticketID" maxlength="20" size="35" value=""
data-error="<?php echo htmlspecialchars($hesklang['enter_id']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['ticket_trackID']); ?>" required>
<div class="help-block with-errors"></div>
</div>
<?php
$tmp = '';
@ -1201,7 +1258,10 @@ function print_start()
$do_remember = 'checked';
}
?>
<input type="text" class="form-control" name="e" id="emailAddress" size="35" value="<?php echo $my_email; ?>" placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"/>
<input type="text" class="form-control" name="e" id="emailAddress" size="35" value="<?php echo $my_email; ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_valid_email']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>" required>
<div class="help-block with-errors"></div>
</div>
<div class="checkbox">
<label for="r">

File diff suppressed because one or more lines are too long

@ -0,0 +1,58 @@
function validateRichText(helpBlock, messageGroup, messageContainer, errorText) {
$('#' + helpBlock).text("");
$('#' + messageGroup).removeClass('has-error');
var content = tinyMCE.get(messageContainer).getContent();
if (content == '') {
$('#' + helpBlock).text(errorText).focus();
$('#' + messageGroup).addClass('has-error');
$('#' + messageGroup).get(0).scrollIntoView();
return false;
}
return true;
}
function buildValidatorForTicketSubmission(formName, validationText) {
$('form[name="' + formName + '"]').validator({
custom: {
checkbox: function($el) {
var checkboxes = $('input[name="' + $el.attr('data-checkbox') + '[]"]');
for (var checkbox in checkboxes) {
if (checkboxes[checkbox].checked) {
return true;
}
}
return false;
},
multiselect: function($el) {
var count = $('select[name="' + $el.attr('data-multiselect') + '[]"] :selected').length;
return count > 0;
}
},
errors: {
checkbox: validationText,
multiselect: validationText
}
});
}
function buildValidatorForPermissionTemplates(formId, validationText) {
$('#' + formId).validator({
custom: {
checkbox: function($el) {
var checkboxes = $('input[data-modal="new-' + $el.attr('data-checkbox') + '"]');
for (var checkbox in checkboxes) {
if (checkboxes[checkbox].checked) {
return true;
}
}
return false;
}
},
errors: {
checkbox: validationText
}
});
}

@ -38,6 +38,8 @@ $hesklang['readonly_custom_field'] = 'Read-only text field';
$hesklang['readonly_custom_field_help'] = 'This input is the same as a text field; however this value cannot be changed, but will be visible to the user.';
$hesklang['navbar_title_url'] = 'Navbar Title URL';
$hesklang['navbar_title_url_help'] = 'Enter the URL you wish to use when a customer (or staff) clicks on the help desk title on the top-left corner of the screen. The URL must begin with http:// or https://.';
$hesklang['this_field_is_required'] = 'This field is required';
$hesklang['select_at_least_one_value'] = 'Please select at least one value';
// ADDED OR MODIFIED IN Mods for HESK 2.4.0
$hesklang['sort_by_user_defined_order'] = 'Sort by user-defined order';
@ -160,7 +162,7 @@ $hesklang['cannot_change_admin_staff'] = 'You cannot change admin/non-admin stat
$hesklang['permission_tpl_man'] = 'Manage permission templates'; // Menu link
$hesklang['permission_templates'] = 'Permission Templates';
$hesklang['can_man_permission_tpl'] = 'Can manage permission templates';
$hesklang['permission_template_colon'] = 'Permission Template:';
$hesklang['permission_template_colon'] = 'Permission Template';
$hesklang['permission_template'] = 'Permission Template';
$hesklang['custom'] = 'Custom';

@ -32,6 +32,7 @@ define('IN_SCRIPT', 1);
define('HESK_PATH', './');
define('HESK_NO_ROBOTS', 1);
define('WYSIWYG', 1);
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -464,14 +465,16 @@ function print_form()
<div class="footerWithBorder"></div>
<div class="blankSpace"></div>
<form action="ticket.php" class="form-horizontal" role="form" method="get" name="form2">
<form data-toggle="validator" action="ticket.php" class="form-horizontal" role="form" method="get" name="form2">
<div class="form-group">
<label for="track" class="col-sm-3 control-label"><?php echo $hesklang['ticket_trackID']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="track" id="track" maxlength="20" size="35"
value="<?php echo $trackingID; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['ticket_trackID']); ?>">
placeholder="<?php echo htmlspecialchars($hesklang['ticket_trackID']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['eytid']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<?php
@ -485,7 +488,9 @@ function print_form()
<div class="col-sm-9">
<input type="text" class="form-control" id="e" name="e" size="35"
value="<?php echo $my_email; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"/>
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_valid_email']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div align="left" class="form-group">
@ -516,19 +521,21 @@ function print_form()
<p><?php echo $hesklang['tid_mail']; ?></p>
<div class="blankSpace"></div>
<form action="index.php" method="post" class="form-horizontal" name="form1">
<form data-toggle="validator" action="index.php" method="post" class="form-horizontal" name="form1">
<div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?></label>
<div class="col-sm-9">
<input type="text" id="email" class="form-control" name="email" size="35"
value="<?php echo $my_email; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"/><input
type="hidden" name="a" value="forgot_tid"/>
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"
data-error="<?php echo htmlspecialchars($hesklang['enter_valid_email']); ?>" required>
<div class="help-block with-errors"></div>
<input type="hidden" name="a" value="forgot_tid"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<div class="col-sm-9 col-sm-offset-3">
<div class="radio">
<label>
<input type="radio" name="open_only"
@ -575,16 +582,24 @@ function hesk_printCustomerReplyForm($reopen = 0)
<div class="footerWithBorder"></div>
<div class="blankSpace"></div>
<form role="form" class="form-horizontal" method="post" action="reply_ticket.php" enctype="multipart/form-data">
<div class="form-group">
<?php
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets_for_customers']) {
$onsubmit = 'onclick="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form data-toggle="validator" role="form" class="form-horizontal" method="post" action="reply_ticket.php"
enctype="multipart/form-data" <?php echo $onsubmit; ?>>
<div class="form-group" id="message-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>: <span
class="important">*</span></label>
<div class="col-sm-9">
<textarea name="message" class="form-control htmlEditor" rows="12"
cols="60"><?php if (isset($_SESSION['ticket_message'])) {
cols="60" data-error="<?php echo htmlspecialchars($hesklang['enter_message']); ?>" required><?php if (isset($_SESSION['ticket_message'])) {
echo stripslashes(hesk_input($_SESSION['ticket_message']));
} ?></textarea>
<div class="help-block with-errors" id="message-help-block"></div>
<?php if ($modsForHesk_settings['rich_text_for_tickets_for_customers']): ?>
<script type="text/javascript">
/* <![CDATA[ */
@ -640,7 +655,7 @@ function hesk_printCustomerReplyForm($reopen = 0)
?>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="submit" value="<?php echo $hesklang['submit_reply']; ?>" class="btn btn-default"/>
<input type="submit" value="<?php echo $hesklang['submit_reply']; ?>" class="btn btn-default">
</div>
</div>
</form>

Loading…
Cancel
Save