faisal Posted October 14, 2015 Share Posted October 14, 2015 (edited) Hi all I want to move the Move Support Ticket Custom Fields to more logical place as you can see in the attach files. I just cant find any way to do it, please help. Edited October 14, 2015 by faisal 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 14, 2015 Share Posted October 14, 2015 (edited) on the admin side, you'll need to do the following... 1. delete the custom fields tab - just remove line 43 in admin/templates/blend/viewticket.tpl <li><a href="#tab2" role="tab" data-toggle="tab" onclick="loadTab(2, 'customfields', 1)">{$_ADMINLANG.setup.customfields}</a></li> 2. paste the code below into admin/templates/blend/viewticket.tpl - probably just after {if !$relatedservices}<br />{/if} <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> <i class="fa fa-database"></i> {$_ADMINLANG.setup.customfields}</h3> </div> {foreach from=$customfields item=customfield} <div class="list-group"> <div class="list-group-item"> <strong>{$customfield.name}</strong><br>{$customfield.value} </div> </div> {/foreach} </div> on the client side... 1. again, use a modified version of the above code - all you should need to change is the Admin Lang for a client side lang... paste it into six/viewticket.tpl after {if !$invalidTicketId} <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> <i class="fa fa-database"></i> {$LANG.customfield}</h3> </div> {foreach from=$customfields item=customfield} <div class="list-group"> <div class="list-group-item"> <strong>{$customfield.name}</strong><br>{$customfield.value} </div> </div> {/foreach} </div> 2. to remove the sidebar, just create a file in includes/hooks, call it ticketcfsidebar.php and add the following code.. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Custom Fields'))) { $secondarySidebar->removeChild('Custom Fields'); } }); Edited October 15, 2015 by brian! 1 Quote Link to comment Share on other sites More sharing options...
faisal Posted October 15, 2015 Author Share Posted October 15, 2015 That is awesome Thank you very much, that was very helpful. *Note the client area code above missing: [color=#000000][color=#007700] {/foreach} </[/color][color=#0000BB]div[/color][color=#007700]> [/color][/color] So if anybody just copying and pasting this please be careful. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 15, 2015 Share Posted October 15, 2015 So if anybody just copying and pasting this please be careful. thanks for spotting that - i've edited the original post and have added the missing lines of code. 1 Quote Link to comment Share on other sites More sharing options...
faisal Posted October 15, 2015 Author Share Posted October 15, 2015 Hmm, What about Text Area! (nl2br) Do you think is it OK to use "nl2br" for all custom fields? {if $customfields} <ul> {foreach from=$customfields item=customfield} <li><strong>{$customfield.name}</strong> {$customfield.value|nl2br}</li> {/foreach} </ul> {/if} Or I can do something like: This is not working it is just an idea {if $customfields} <ul> {foreach from=$customfields item=customfield} <li> <strong>{$customfield.name}</strong> {if $customfieldtype == 'textarea'} {$customfield.value|nl2br} {else} {$customfield.value} {/if} </li> {/foreach} </ul> {/if} 0 Quote Link to comment Share on other sites More sharing options...
faisal Posted October 15, 2015 Author Share Posted October 15, 2015 OK this code is working fine: {if $customfields} <ul> {foreach from=$customfields item=customfield} <li> <strong>{$customfield.name}</strong> {if $customfield.type eq "textarea"} {$customfield.value|nl2br} {else} {$customfield.value} {/if} </li> {/foreach} </ul> {/if} 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 15, 2015 Share Posted October 15, 2015 Hmm, What about Text Area! (nl2br) Do you think is it OK to use "nl2br" for all custom fields? nl2br function will apply to text with "\n", only Textarea element give you this feature so no problem 0 Quote Link to comment Share on other sites More sharing options...
faisal Posted October 18, 2015 Author Share Posted October 18, 2015 Thank you sentq 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.