Skip to content
Snippets Groups Projects
Commit 1350e9cc authored by Peter Rotich's avatar Peter Rotich
Browse files

Add DatePicker support

parent 53182157
No related branches found
No related tags found
No related merge requests found
......@@ -14,19 +14,20 @@
</style>
<![endif]-->
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="./js/calendar.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript" src="./js/tips.js"></script>
<script type="text/javascript" src="./js/nicEdit.js"></script>
<script type="text/javascript" src="./js/bootstrap-typeahead.js"></script>
<script type="text/javascript" src="./js/scp.js"></script>
<link rel="stylesheet" href="./css/scp.css" media="screen">
<link rel="stylesheet" href="./css/typeahead.css" media="screen">
<link type="text/css" href="../css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div id="header">
<a href="index.php" id="logo">osTicket - Customer Support System</a>
<p id="info">Welcome back, <strong><?php echo $thisstaff->getUserName(); ?></strong>
<p id="info">Howdy, <strong><?php echo $thisstaff->getUserName(); ?></strong>
<?php
if($thisstaff->isAdmin() && !defined('ADMINPAGE')) { ?>
| <a href="admin.php">Admin Panel</a>
......
......@@ -88,13 +88,9 @@ else
<form action="syslogs.php" method="get">
<div style="padding-left:2px;">
<b>Date Span</b>:
&nbsp;From&nbsp;<input class="dp" id="sd" size=15 name="startDate" value="<?php echo Format::htmlchars($_REQUEST['startDate']); ?>"
onclick="event.cancelBubble=true;calendar(this);" autocomplete=OFF>
<a href="#" onclick="event.cancelBubble=true;calendar(getObj('sd')); return false;"><img src='images/cal.png'border=0 alt=""></a>
&nbsp;From&nbsp;<input class="dp" id="sd" size=15 name="startDate" value="<?php echo Format::htmlchars($_REQUEST['startDate']); ?>" autocomplete=OFF>
&nbsp;&nbsp; to &nbsp;&nbsp;
<input class="dp" id="ed" size=15 name="endDate" value="<?php echo Format::htmlchars($_REQUEST['endDate']); ?>"
onclick="event.cancelBubble=true;calendar(this);" autocomplete=OFF >
<a href="#" onclick="event.cancelBubble=true;calendar(getObj('ed')); return false;"><img src='images/cal.png'border=0 alt=""></a>
<input class="dp" id="ed" size=15 name="endDate" value="<?php echo Format::htmlchars($_REQUEST['endDate']); ?>" autocomplete=OFF>
&nbsp;&nbsp;
&nbsp;Type:
<select name='type'>
......
......@@ -139,18 +139,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$ticket->getUpdateInfo());
Due Date:
</td>
<td>
<input id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="10"
onclick="event.cancelBubble=true;calendar(this);" autocomplete=OFF>
<a href="#" onclick="event.cancelBubble=true;calendar(getObj('duedate')); return false;"><img src='images/cal.png'border=0 alt=""></a>
<input class="dp" id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="12" autocomplete=OFF>
&nbsp;&nbsp;
<?php
$min=$hr=null;
if($info['time'])
list($hr,$min)=explode(':',$info['time']);
echo Misc::timeDropdown($hr,$min,'time');
list($hr, $min)=explode(':', $info['time']);
echo Misc::timeDropdown($hr, $min, 'time');
?>
&nbsp;<font class="error">&nbsp;<?=$errors['duedate']?>&nbsp;<?php echo $errors['time']; ?></font>
<em>Time is based on your time zone (GM <?php echo $thisstaff->getTZoffset(); ?>)</em>
<em>Time is based on your time zone (GMT <?php echo $thisstaff->getTZoffset(); ?>)</em>
</td>
</tr>
<tr>
......
......@@ -203,18 +203,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
Due Date:
</td>
<td>
<input id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="10"
onclick="event.cancelBubble=true;calendar(this);" autocomplete=OFF>
<a href="#" onclick="event.cancelBubble=true;calendar(getObj('duedate')); return false;"><img src='images/cal.png'border=0 alt=""></a>
<input class="dp" id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="12" autocomplete=OFF>
&nbsp;&nbsp;
<?php
$min=$hr=null;
if($info['time'])
list($hr,$min)=explode(':',$info['time']);
echo Misc::timeDropdown($hr,$min,'time');
list($hr, $min)=explode(':', $info['time']);
echo Misc::timeDropdown($hr, $min, 'time');
?>
&nbsp;<font class="error">&nbsp;<?=$errors['duedate']?>&nbsp;<?php echo $errors['time']; ?></font>
<em>Time is based on your time zone (GM <?php echo $thisstaff->getTZoffset(); ?>)</em>
<em>Time is based on your time zone (GMT <?php echo $thisstaff->getTZoffset(); ?>)</em>
</td>
</tr>
<tr>
......
......@@ -533,9 +533,9 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting..
</fieldset>
<fieldset class="date_range">
<label>Date Range:</label>
<input class="dp" type="input" size="20" name="startDate"><i></i>
<input class="dp" type="input" size="20" name="startDate">
<span>TO</span>
<input class="dp" type="input" size="20" name="endDate"><i></i>
<input class="dp" type="input" size="20" name="endDate">
</fieldset>
<p>
<span class="buttons">
......
......@@ -1290,3 +1290,16 @@ time {
background:#ffd8d8;
border:1px solid #a00;
}
/* Custom css for datepicker */
.ui-datepicker-trigger {
display:inline-block;
border:0;
padding:0;
margin-left:2px;
position:relative;
top:5px;
width:16px;
height:16px;
background:inherit;
}
......@@ -185,6 +185,14 @@ $(document).ready(function(){
},
'json')
.error( function() {});
/* Datepicker */
$('.dp').datepicker({
numberOfMonths: 2,
showButtonPanel: true,
buttonImage: './images/cal.png',
showOn:'both'
});
/* NicEdit richtext init */
var rtes = $('.richtext');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment