|
#1
|
|||
|
|||
|
In viewticket.inc.php how can I modify it so that each Internal Note is expandable? I have tried to do this by re-using the code to toggle all notes (i.e., Internal Notes) but I can't get it just right. Example of what I'm looking for: Internal Notes (2) Sat, Oct 22 2011 1:32pm - posted by Admin Admin Sat, Oct 20 2011 4:20pm - posted by Admin Admin // user clicks on the first url and sees... Sat, Oct 22 2011 1:32pm - posted by Admin Admin - Ticket assigned to Billy Bob - This is some useful stuff right here. Sat, Oct 20 2011 4:20pm - posted by Admin Admin Thanks for any direction you can provide!!! Last edited by slhendrix; 10-22-2011 at 06:03 PM. Reason: To make more sense... |
|
#2
|
|||
|
|||
|
Hi
Try this.. ( make a backup up first... I won't be held responsible if it all goes wrong )I've only quickly tested it, but it seems OK and should help you on your way !! In viewticket.inc.php Find Line 27 & 28 and ADD this BETWEEN 27 & 28 LINE 27 Code:
?> Code:
<script language="javascript">
<!--
var state = 'none';
function showhide(layer_ref) {
if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
//-->
</script>
Code:
<table width="100%" cellpadding="2" cellspacing="0" border="0"> Find this around LINE 211: Code:
<div align="left">
<a class="Icon note" href="#" onClick="toggleLayer('ticketnotes'); return false;">Internal Notes (<?=$notes?>)</a><br><br>
<div id='ticketnotes' style="display:<?=$display?>;text-align:center;">
<?
while($row=db_fetch_array($resp)) {?>
<table align="center" class="note" cellspacing="0" cellpadding="1" width="100%" border=0>
<tr><th><?=Format::db_daydatetime($row['created'])?> - posted by <?=$row['source']?></th></tr>
<? if($row['title']) {?>
<tr class="header"><td><?=Format::display($row['title'])?></td></tr>
<?} ?>
<tr><td><?=Format::display($row['note'])?></td></tr>
</table>
<?} ?>
</div>
</div>
AND REPLACE WITH : Code:
<div align="left">
<h3>Internal Notes (<?=$notes?>)</h3>
<div id='ticketnotes' style="display:<?=$display?>;text-align:left;">
<?
while($row=db_fetch_array($resp)) {?>
<tr><th><a href="#" onclick="showhide('<?=$row['note_id']?>');"><?=Format::db_daydatetime($row['created'])?> - posted by <?=$row['source']?></a></th></tr>
<div id="<?=$row['note_id']?>" style="display: none;" align="left">
<table align="center" class="note" cellspacing="0" cellpadding="1" width="100%" border=0>
<? if($row['title']) {?>
<tr class="header"><td><?=Format::display($row['title'])?></td></tr>
<?} ?>
<tr><td><?=Format::display($row['note'])?></td></tr>
</table>
</div><br/>
<?} ?>
</div>
</div>
Code:
<br/><a class="Icon thread" href="#" onClick="toggleLayer('ticketthread'); return false;">Ticket Thread</a>
|
|
#3
|
|||
|
|||
|
I will get started on this right away and let you know the results. Thank you for the quick response!!
|
|
#4
|
|||
|
|||
|
Hi tomt,
The new code is working great in Chrome, but not in IE9. Any ideas? Also, when I click on a note, the page pops back up to the top. My steps to re-create this are: 1) View the ticket. 2) Scroll down some on the page until Internal Notes is midway on the screen. 3) Click on the first note. 4) The page pops back to the top. ** in Chrome, the note does expand as explained above, but the page does still return to the top. Thanks again for all your help! |
|
#5
|
|||
|
|||
|
UPDATE:
I was able to get this to work in IE9 by changing the "showhide" to "toggleLayer". I also added "return false" and it fixed the page popping back to the top when clicking on the note. See below... "<a href="#" onclick="toggleLayer('<?=$row['note_id']?>'); return false;"><?=Format::db_daydatetime($row['created'])?> - posted by <?=$row['source']?></a>" Please let me know if you see any compatability issues with this. Thanks again!! |
|
#6
|
|||
|
|||
|
Glad you got it sorted.
I should have mentioned I'd only tested it on firefox !! |
![]() |
| Bookmarks |
| Tags |
| expandable, mod, notes |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|