#set($distributorsearcher = $searcherManager.getSearcher($catalogid, "distributor")) #set($manufacturersearcher = $searcherManager.getSearcher($catalogid, "manufacturer")) #set($productsearcher = $searcherManager.getSearcher($catalogid, "product")) #if (!$value) #set ($value = $context.getRequestParameter("manufacturerid.value")) #if(!$value) #set($searchtype = $context.getRequestParameter("searchtype")) #if($searchtype == "ticket") #set($ticketid = $context.getRequestParameter("id")) #set($ticket = $searcherManager.getData($catalogid, "ticket", $ticketid)) #set($productid = $ticket.get("product")) #else #set($productid = $context.getRequestParameter("productid")) #end #set($product = $productsearcher.searchById($productid)) #set($value = $product.get("manufacturerid")) #end #end #set($isDistributor = $userprofile.get("distributor")) #set($distributor = $searcherManager.getData($catalogid, "distributor", $isDistributor)) #if($distributor) #set($distributor = $distributorsearcher.searchById($distributor.getId())) #set($manufacturerList = $distributor.getValues("manufacturer")) #foreach($manufacturer in $manufacturerList) #if( $value && $target.getId() == $value ) $target.get("name") #end #end #else #set($manufacturerList = $mediaarchive.getSearcher("manufacturer").fieldSearch("id", "*", name)) #foreach($target in $manufacturerList) #if( $value && $target.getId() == $value ) $target #end #end #end