['card' => 'images/credit_cards/Test-Visa-Icon.png', 'text' => 'Visa'], 2 => ['card' => 'images/credit_cards/Test-MasterCard-Icon.png', 'text' => 'Master Card'], 4 => ['card' => 'images/credit_cards/Test-AmericanExpress-Icon.png', 'text' => 'American Express'], 8 => ['card' => 'images/credit_cards/Test-Diners-Icon.png', 'text' => 'Diners'], 16 => ['card' => 'images/credit_cards/Test-Discover-Icon.png', 'text' => 'Discover'], ]; define('CREDIT_CARDS', serialize($creditCards)); $cachedTables = [ 'currencies' => 'App\Models\Currency', 'sizes' => 'App\Models\Size', 'industries' => 'App\Models\Industry', 'timezones' => 'App\Models\Timezone', 'dateFormats' => 'App\Models\DateFormat', 'datetimeFormats' => 'App\Models\DatetimeFormat', 'languages' => 'App\Models\Language', 'paymentTypes' => 'App\Models\PaymentType', 'countries' => 'App\Models\Country', 'invoiceDesigns' => 'App\Models\InvoiceDesign', 'invoiceStatus' => 'App\Models\InvoiceStatus', 'frequencies' => 'App\Models\Frequency', 'gateways' => 'App\Models\Gateway', 'gatewayTypes' => 'App\Models\GatewayType', 'fonts' => 'App\Models\Font', 'banks' => 'App\Models\Bank', ]; define('CACHED_TABLES', serialize($cachedTables)); // Fix for mPDF: https://github.com/kartik-v/yii2-mpdf/issues/9 define('_MPDF_TTFONTDATAPATH', storage_path('framework/cache/')); /** STD constatns */ if(!defined('STDIN')) define('STDIN', fopen('php://stdin', 'r')); if(!defined('STDOUT')) define('STDOUT', fopen('php://stdout', 'w')); if(!defined('STDERR')) define('STDERR', fopen('php://stderr', 'w')); /** Tickets constants */ define('TICKET_PRIORITY_LOW', 10); define('TICKET_PRIORITY_MEDIUM', 20); define('TICKET_PRIORITY_HIGH', 30); define('TICKET_STATUS_NEW', 1); define('TICKET_STATUS_OPEN',2); define('TICKET_STATUS_CLOSED',3); define('TICKET_STATUS_MERGED',4); define('TICKET_CLIENT_NEW', 'ticket_client_new'); define('TICKET_CLIENT_UPDATE', 'ticket_client_update'); define('TICKET_INBOUND_NEW', 'ticket_inbound_new'); define('TICKET_INBOUND_NEW_INTERNAL', 'ticket_inbound_new_internal'); define('TICKET_INBOUND_REPLY', 'ticket_inbound_reply'); define('TICKET_INBOUND_CONTACT_REPLY', 'ticket_inbound_contact_reply'); define('TICKET_INBOUND_AGENT_REPLY', 'ticket_inbound_agent_reply'); define('TICKET_INBOUND_ADMIN_REPLY', 'ticket_inbound_admin_reply'); define('TICKET_AGENT_UPDATE', 'ticket_agent_update'); define('TICKET_AGENT_NEW', 'ticket_agent_new'); define('TICKET_MERGE', 'ticket_merge'); define('TICKET_ASSIGNED', 'ticket_assigned'); define('TICKET_OVERDUE', 'ticket_overdue'); define('TICKET_AGENT_CLOSED', 'ticket_agent_closed'); define('TICKET_SAVE_ONLY', 'ticket_save_only'); /* Default ticket statuses - Category - support*/ $supportTicketStatuses = [ trans('texts.new'), trans('texts.open'), trans('texts.closed'), trans('texts.merged') ]; function uctrans($text, $data = []) { $locale = Session::get(SESSION_LOCALE); $text = trans($text, $data); return $locale == 'en' ? ucwords($text) : $text; } function utrans($text, $data = []) { $locale = Session::get(SESSION_LOCALE); $text = trans($text, $data); return $locale == 'en' ? strtoupper($text) : $text; } // optional trans: only return the string if it's translated function otrans($text) { $locale = Session::get(SESSION_LOCALE); if ($locale == 'en') { return trans($text); } else { $string = trans($text); $english = trans($text, [], 'en'); return $string != $english ? $string : ''; } } // include modules in translations function mtrans($entityType, $text = false) { if (! $text) { $text = $entityType; } // check if this has been translated in a module language file if (! Utils::isNinjaProd() && $module = Module::find($entityType)) { $key = "{$module->getLowerName()}::texts.{$text}"; $value = trans($key); if ($key != $value) { return $value; } } return trans("texts.{$text}"); } }