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 @@ ...@@ -14,19 +14,20 @@
</style> </style>
<![endif]--> <![endif]-->
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script> <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/tips.js"></script>
<script type="text/javascript" src="./js/nicEdit.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/bootstrap-typeahead.js"></script>
<script type="text/javascript" src="./js/scp.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/scp.css" media="screen">
<link rel="stylesheet" href="./css/typeahead.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> </head>
<body> <body>
<div id="container"> <div id="container">
<div id="header"> <div id="header">
<a href="index.php" id="logo">osTicket - Customer Support System</a> <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 <?php
if($thisstaff->isAdmin() && !defined('ADMINPAGE')) { ?> if($thisstaff->isAdmin() && !defined('ADMINPAGE')) { ?>
| <a href="admin.php">Admin Panel</a> | <a href="admin.php">Admin Panel</a>
......
...@@ -88,13 +88,9 @@ else ...@@ -88,13 +88,9 @@ else
<form action="syslogs.php" method="get"> <form action="syslogs.php" method="get">
<div style="padding-left:2px;"> <div style="padding-left:2px;">
<b>Date Span</b>: <b>Date Span</b>:
&nbsp;From&nbsp;<input class="dp" id="sd" size=15 name="startDate" value="<?php echo Format::htmlchars($_REQUEST['startDate']); ?>" &nbsp;From&nbsp;<input class="dp" id="sd" size=15 name="startDate" value="<?php echo Format::htmlchars($_REQUEST['startDate']); ?>" autocomplete=OFF>
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;&nbsp; to &nbsp;&nbsp; &nbsp;&nbsp; to &nbsp;&nbsp;
<input class="dp" id="ed" size=15 name="endDate" value="<?php echo Format::htmlchars($_REQUEST['endDate']); ?>" <input class="dp" id="ed" size=15 name="endDate" value="<?php echo Format::htmlchars($_REQUEST['endDate']); ?>" autocomplete=OFF>
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>
&nbsp;&nbsp; &nbsp;&nbsp;
&nbsp;Type: &nbsp;Type:
<select name='type'> <select name='type'>
......
...@@ -139,18 +139,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$ticket->getUpdateInfo()); ...@@ -139,18 +139,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$ticket->getUpdateInfo());
Due Date: Due Date:
</td> </td>
<td> <td>
<input id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="10" <input class="dp" id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="12" autocomplete=OFF>
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>
&nbsp;&nbsp; &nbsp;&nbsp;
<?php <?php
$min=$hr=null; $min=$hr=null;
if($info['time']) if($info['time'])
list($hr,$min)=explode(':',$info['time']); list($hr, $min)=explode(':', $info['time']);
echo Misc::timeDropdown($hr,$min,'time');
echo Misc::timeDropdown($hr, $min, 'time');
?> ?>
&nbsp;<font class="error">&nbsp;<?=$errors['duedate']?>&nbsp;<?php echo $errors['time']; ?></font> &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> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -203,18 +203,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -203,18 +203,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
Due Date: Due Date:
</td> </td>
<td> <td>
<input id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="10" <input class="dp" id="duedate" name="duedate" value="<?php echo Format::htmlchars($info['duedate']); ?>" size="12" autocomplete=OFF>
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>
&nbsp;&nbsp; &nbsp;&nbsp;
<?php <?php
$min=$hr=null; $min=$hr=null;
if($info['time']) if($info['time'])
list($hr,$min)=explode(':',$info['time']); list($hr, $min)=explode(':', $info['time']);
echo Misc::timeDropdown($hr,$min,'time');
echo Misc::timeDropdown($hr, $min, 'time');
?> ?>
&nbsp;<font class="error">&nbsp;<?=$errors['duedate']?>&nbsp;<?php echo $errors['time']; ?></font> &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> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -533,9 +533,9 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting.. ...@@ -533,9 +533,9 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting..
</fieldset> </fieldset>
<fieldset class="date_range"> <fieldset class="date_range">
<label>Date Range:</label> <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> <span>TO</span>
<input class="dp" type="input" size="20" name="endDate"><i></i> <input class="dp" type="input" size="20" name="endDate">
</fieldset> </fieldset>
<p> <p>
<span class="buttons"> <span class="buttons">
......
...@@ -1290,3 +1290,16 @@ time { ...@@ -1290,3 +1290,16 @@ time {
background:#ffd8d8; background:#ffd8d8;
border:1px solid #a00; 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(){ ...@@ -185,6 +185,14 @@ $(document).ready(function(){
}, },
'json') 'json')
.error( function() {}); .error( function() {});
/* Datepicker */
$('.dp').datepicker({
numberOfMonths: 2,
showButtonPanel: true,
buttonImage: './images/cal.png',
showOn:'both'
});
/* NicEdit richtext init */ /* NicEdit richtext init */
var rtes = $('.richtext'); 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