Re-added comments to enq table and the little JS editor thing
This commit is contained in:
parent
cde0312586
commit
00874d0495
|
|
@ -23,6 +23,7 @@ echo $paginator->counter(array(
|
||||||
|
|
||||||
|
|
||||||
<th><?php echo $paginator->sort('status_id');?></th>
|
<th><?php echo $paginator->sort('status_id');?></th>
|
||||||
|
<th>Comments</th>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -231,7 +232,15 @@ ENDJS;
|
||||||
echo $javascript->codeBlock($jsblock);
|
echo $javascript->codeBlock($jsblock);
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
<td class="comments"><?
|
||||||
|
if(strlen($enquiry['Enquiry']['comments']) > 150) {
|
||||||
|
echo substr($enquiry['Enquiry']['comments'], 0, 150);
|
||||||
|
echo $html->link('.....', array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id']));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo $enquiry['Enquiry']['comments'];
|
||||||
|
}
|
||||||
|
;?></td>
|
||||||
<td class="viewedit">
|
<td class="viewedit">
|
||||||
<?php echo $html->link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
<?php echo $html->link(__('View', true), array('controller'=>'enquiries','action'=>'view', $enquiry['Enquiry']['id'])); ?>
|
||||||
<?php echo $html->link(__('Edit', true), array('controller'=>'enquiries','action'=>'edit', $enquiry['Enquiry']['id'])); ?>
|
<?php echo $html->link(__('Edit', true), array('controller'=>'enquiries','action'=>'edit', $enquiry['Enquiry']['id'])); ?>
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//echo $form->input('submitted');
|
//echo $form->input('submitted');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo $javascript->link('quotenik/add_datetime.js', true);
|
||||||
echo $form->input('comments', array('id'=>'comments', 'wrap'=>'hard'));
|
echo $form->input('comments', array('id'=>'comments', 'wrap'=>'hard'));
|
||||||
?>
|
?>
|
||||||
<input type="BUTTON" onClick="datetime('<?php echo "$initials"; ?>');" value="Edit Comments" class="dateButton" id="datebutton"/>
|
<span id="userInitials" style="display: none;"><?=$initials?></span>
|
||||||
|
|
||||||
|
<button id ="dateButton">Edit Comments</button>
|
||||||
|
|
||||||
<?
|
<?
|
||||||
echo $javascript->link('quotenik/add_datetime.js', true);
|
|
||||||
echo $form->input('posted', array('label' => 'This quote been sent hard copy via Post'));
|
echo $form->input('posted', array('label' => 'This quote been sent hard copy via Post'));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,34 @@
|
||||||
/* Adds Date/Timestamp to a comments field when it's selected for modifiying. */
|
/* Adds Date/Timestamp to a comments field when it's selected for modifiying. */
|
||||||
|
|
||||||
Event.observe(window, 'load', function() {
|
|
||||||
$('comments').disable();
|
$(function() {
|
||||||
|
$('#comments').attr('readonly', 'readonly');
|
||||||
|
|
||||||
|
var userinitials = $('#userInitials').html();
|
||||||
|
|
||||||
|
$('#dateButton').click(function() {
|
||||||
|
datetime(userinitials);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function datetime(userinitials) {
|
function datetime(userinitials) {
|
||||||
$('comments').enable();
|
$('#comments').attr('readonly','');
|
||||||
$('datebutton').disable();
|
$('#dateButton').button('disable');
|
||||||
var currentTime = new Date();
|
var currentTime = new Date();
|
||||||
month = currentTime.getMonth() + 1;
|
month = currentTime.getMonth() + 1;
|
||||||
day = currentTime.getDate();
|
day = currentTime.getDate();
|
||||||
year = currentTime.getFullYear();
|
year = currentTime.getFullYear();
|
||||||
hour = currentTime.getHours();
|
hour = currentTime.getHours();
|
||||||
minute = currentTime.getMinutes();
|
minute = currentTime.getMinutes();
|
||||||
if(minute < 10) {
|
if(minute < 10) {
|
||||||
minute = '0'+minute;
|
minute = '0'+minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var newValue = '[' + day + '-' + month + '-' + year + ' @' + hour + ':' + minute +' '+ userinitials +']' + '\n' + $('#comments').val();
|
||||||
|
|
||||||
$('comments').value = '[' + day + '-' + month + '-' + year + ' @' + hour + ':' + minute +' '+ userinitials +']' + '\n' + $('comments').value;
|
$('#comments').val(newValue);
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue