X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FUI%2FWeb.pm;h=1cc539a9f999158d44150e9156b031162d495dfb;hb=dafdfc24616b04a5ff594da31e2cdd03f58634b6;hp=cb740ee3b329fe640e1b39473adc3ef4f44e8608;hpb=09ce724404f16e036cbdfeccb64a0955dafca99a;p=freeside.git diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index cb740ee3b..1cc539a9f 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -135,7 +135,8 @@ sub svc_link { sub svc_label_link { my($m, $part_svc, $cust_svc) = @_ or return ''; - svc_X_link( ($cust_svc->label)[1], @_ ); + my($svc, $label, $svcdb) = $cust_svc->label; + svc_X_link( $label, @_ ); } sub svc_X_link { @@ -483,6 +484,20 @@ sub cust_aligns { } } +=item is_mobile + +Utility function to determine if the client is a mobile browser. + +=cut + +sub is_mobile { + my $ua = $ENV{'HTTP_USER_AGENT'} || ''; + if ( $ua =~ /(?:hiptop|Blazer|Novarra|Vagabond|SonyEricsson|Symbian|NetFront|UP.Browser|UP.Link|Windows CE|MIDP|J2ME|DoCoMo|J-PHONE|PalmOS|PalmSource|iPhone|iPod|AvantGo|Nokia|Android|WebOS|S60|Opera Mini|Opera Mobi)/io ) { + return 1; + } + return 0; +} + ### # begin JSRPC code... ### @@ -640,7 +655,9 @@ sub job_status { } #to_json(\@return); #waiting on deb 5.0 for new JSON.pm? - objToJson(\@return); + #silence the warning though + my $to_json = JSON->can('to_json') || JSON->can('objToJson'); + &$to_json(\@return); }