کد ها :

کد:
{foreach from=$relatedservices item=relatedservice}
<option value="{$relatedservice.id}">{$relatedservice.name} ({$relatedservice.status})</option>
{/foreach}
به :

کد:
{foreach from=$relatedservices item=relatedservice}{if !in_array($relatedservice.status,array('Cancelled','Terminated'))}
<option value="{$relatedservice.id}">{$relatedservice.name} ({$relatedservice.status})</option>
{/if}
{/foreach}
تبدیل میشه

و هوکش هم این هست :

کد:
<?php
# Filter & Sort Ticket Related Services Hook
# Public By Alireza AHmadi in the p30web.org

function filter_related_services_hook($vars){

    if ($vars['templatefile']=='supportticketsubmit-steptwo'){
        $relatedservices = $vars['relatedservices'];
        $cancelled = array('Cancelled','Terminated');
        foreach($relatedservices as $key => $service) {
            if (in_array($service['status'],$cancelled)) {
                unset($relatedservices[$key]);
            }
        }
        array_multisort(array_column($relatedservices, 'status'), SORT_ASC, array_column($relatedservices, 'name'), SORT_ASC, $relatedservices);
        return array("relatedservices" => $relatedservices);
    }
}
add_hook("ClientAreaPageSubmitTicket", 1, "filter_related_services_hook");