Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[ljcom] r7136: LJSUP-4036: Add 'Russian Support' catego...

Committer: gariev
LJSUP-4036: Add 'Russian Support' category to the list at http://www.livejournal.com/support/submit.bml
U   trunk/cgi-bin/LJ/Hooks/SUP.pm
Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm	2009-03-18 08:58:54 UTC (rev 7135)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm	2009-03-18 09:06:17 UTC (rev 7136)
@@ -643,4 +643,23 @@
     return _email_pm($ev, $u, 0);
 });
 
+LJ::register_hook("support_request_extra_cat", sub {
+    ##
+    ## For Cyrillic users (by IP or Cyr flag) add support category "Russian Support".
+    ## If no support category is selected, set the "Russian Support" as selected.
+    ##
+    my ($choices, $selected_cat_ref, $cats) = @_;
+    return unless LJ::SUP->is_remote_sup;
+
+    my ($russian_support_cat) = grep { $_->{catkey} eq 'russian' } values %$cats;
+    return unless $russian_support_cat;
+    
+    if (!grep { $_ eq $russian_support_cat->{spcatid} } @$choices) {
+        push @$choices, $russian_support_cat->{spcatid}, $russian_support_cat->{catname};
+    }
+    if (!$$selected_cat_ref) {
+        $$selected_cat_ref = $russian_support_cat->{spcatid};
+    }
+});
+
 1;

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments