Changeset 60

Show
Ignore:
Timestamp:
08/13/07 11:21:21 (1 year ago)
Author:
root
Message:

Fix 'waiting on queue' for normal buttons and some formatting fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/op_server.pl

    r59 r60  
    12631263                $buttons{ uc("$tmphash{server}^$chan_trunk") } = $pos; 
    12641264                $textos{$indice_contexto} = $tmphash{label}; 
    1265                                if(!defined($tmphash{no_label_counter})) { $tmphash{no_label_counter} = 0; } 
     1265                if(!defined($tmphash{no_label_counter})) { $tmphash{no_label_counter} = 0; } 
    12661266                if ( $no_counter == 0 && $tmphash{no_label_counter}==0) { 
    12671267                    $textos{$indice_contexto} .= " " . $count; 
     
    41724172            push @return, $valor; 
    41734173        } 
     4174        $evento = ""; 
    41744175    } 
    41754176    elsif ( $evento eq "leave" ) { 
     
    58925893                                    if ( defined( $group_count{$interno} ) ) { 
    58935894                                        if ( $group_count{$interno} == 1 ) { 
    5894                                                                                                $buttontext = group_count($interno,$canal); 
    5895                                                                    push @respuestas, $buttontext; 
     5895                                                $buttontext = group_count($interno,$canal); 
     5896                                                   push @respuestas, $buttontext; 
    58965897                                        } 
    58975898                                    } 
     
    60786079                            if ( defined( $group_count{$interno} ) ) { 
    60796080                                if ( $group_count{$interno} == 1 ) { 
    6080                                                                        $buttontext = group_count($interno,$canal); 
     6081                                    $buttontext = group_count($interno,$canal); 
    60816082                                    push @respuestas, $buttontext; 
    60826083                                } 
     
    60916092                                if ( defined( $group_count{$interno} ) ) { 
    60926093                                    if ( $group_count{$interno} == 1 ) { 
    6093                                                                                $buttontext = group_count($interno,$canal); 
    6094                                            push @respuestas, $buttontext; 
     6094                                        $buttontext = group_count($interno,$canal); 
     6095                                        push @respuestas, $buttontext; 
    60956096                                    } 
    60966097                                } 
     
    61966197                                } 
    61976198 
    6198                                if ( $tiempo eq "" ) { $tiempo = 0; } 
     6199                if ( $tiempo eq "" ) { $tiempo = 0; } 
    61996200 
    62006201                                if ( $timer_type ne "" ) { 
     
    63626363 
    63636364sub group_count { 
    6364        my $interno = shift; 
    6365        my $canal   = shift; 
     6365    my $interno = shift; 
     6366    my $canal   = shift; 
    63666367    my $plural = ""; 
    6367        my $return = ""; 
     6368    my $return = ""; 
    63686369    if ( @{ $sesbot{$interno} } > 1 ) { 
    63696370             $plural = "s"; 
     
    63776378          $botonpermanenttext{$interno} = ""; 
    63786379          $return ="$interno|corto|"; 
    6379        
    6380        return $return; 
     6380   
     6381    return $return; 
    63816382} 
    63826383 
     
    89948995sub recompute_queues_onjoin { 
    89958996    my ($hash_temporal,$server,$canalid) = @_; 
    8996        my @return        = (); 
    8997        my @corto         = (); 
    8998        my @ocupado       = (); 
     8997    my @return        = (); 
     8998    my @corto         = (); 
     8999    my @ocupado       = (); 
    89999000    my $qclidnum  = ""; 
    90009001    my $qclidname = ""; 
     
    90199020 
    90209021    # Verify if the position is already taken (by means of QUEUE_PRIO) 
    9021        my $tengo = 0; 
     9022    my $tengo = 0; 
    90229023    foreach my $id ( keys %{$cola} ) { 
    90239024        unless ( $cola->{$id}{QUEUE} ) { 
     
    90279028 
    90289029        if ( $canal eq $cola->{$id}{QUEUE} ) { 
    9029                if ( $position eq $cola->{$id}{POSITION} ) { 
    9030                                $tengo = 1; 
    9031                        
    9032                
    9033     } 
    9034        if($tengo==1) { 
     9030            if ( $position eq $cola->{$id}{POSITION} ) { 
     9031                $tengo = 1; 
     9032           
     9033       
     9034    } 
     9035    if($tengo==1) { 
    90359036        # Queue prio! 
    9036        my $time = time(); 
     9037        my $time = time(); 
    90379038        foreach my $id ( keys %{$cola} ) { 
    90389039            unless ( $cola->{$id}{QUEUE} ) { 
     
    90429043 
    90439044            if ( $canal eq $cola->{$id}{QUEUE} ) { 
    9044                                if($cola->{$id}{POSITION} >= $position) { 
    9045                        my $diftime = $time - $cola->{$id}{TIME}; 
    9046                        if ( $queue_hide == 1 ) { 
    9047                        push @corto, construct_cmd( $cola, $id, "setalpha", "000" ); 
    9048                        
    9049                        push @corto, construct_cmd( $cola, $id, "corto", "" ); 
    9050  
    9051                                        $cola->{$id}{POSITION}++; 
    9052                        my $clidtext = $cola->{$id}{CLIDNAME} . " " . $cola->{$id}{CLID}; 
    9053                        push @ocupado, construct_cmd( $cola, $id, "settimer", $diftime ); 
    9054                        push @ocupado, construct_cmd( $cola, $id, "ocupado",  "[$clidtext]" ); 
    9055                                
    9056             } 
    9057         } 
    9058        @ocupado = unique(@ocupado); 
    9059        @corto   = unique(@corto); 
    9060        }  
    9061        # Normal, add new call at the end of the queue 
     9045                if($cola->{$id}{POSITION} >= $position) { 
     9046                    my $diftime = $time - $cola->{$id}{TIME}; 
     9047                    if ( $queue_hide == 1 ) { 
     9048                        push @corto, construct_cmd( $cola, $id, "setalpha", "000" ); 
     9049                   
     9050                    push @corto, construct_cmd( $cola, $id, "corto", "" ); 
     9051 
     9052                    $cola->{$id}{POSITION}++; 
     9053                    my $clidtext = $cola->{$id}{CLIDNAME} . " " . $cola->{$id}{CLID}; 
     9054                    push @ocupado, construct_cmd( $cola, $id, "settimer", $diftime ); 
     9055                    push @ocupado, construct_cmd( $cola, $id, "ocupado",  "[$clidtext]" ); 
     9056               
     9057            } 
     9058        } 
     9059        @ocupado = unique(@ocupado); 
     9060        @corto   = unique(@corto); 
     9061    }  
     9062    # Normal, add new call at the end of the queue 
    90629063    push @return, "$canal=$position|ocupado2|$texto_pos|$unico_id|$canalid"; 
    90639064    push @return, "$canal=$position|setalpha|100|$unico_id|$canalid"; 
     
    90749075    $cola->{$canalid}{SERVER}   = $server; 
    90759076    $cola->{$canalid}{TIME}     = $tiempo; 
    9076        if (@corto) { 
     9077    if (@corto) { 
    90779078       return ( @corto, @ocupado, @return ); 
    9078        } else { 
    9079           return @return; 
     9079    } else { 
     9080       return @return; 
    90809081    } 
    90819082} 
     
    92419242    if ( !defined($name) ) { $name = "" } 
    92429243 
    9243        if ( $name eq "<unknown>" ) { $name = ""; } 
     9244    if ( $name eq "<unknown>" ) { $name = ""; } 
    92449245 
    92459246    if ( !is_number($numero) ) {