Changeset 12314

Show
Ignore:
Timestamp:
09/17/07 09:28:36 (1 year ago)
Author:
w_i
Message:

Finishing the missing features

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/net.nemein.quickpoll/config/manifest.inc

    r5819 r12314  
    22  'name' => 'net.nemein.quickpoll', 
    33  'purecode' => false, 
    4   'version' => '1.0.2beta1', 
     4  'version' => '1.0.2beta2', 
    55  'state' => 'beta', 
    66  'privileges' =>  
     
    2323        'role' => 'lead', 
    2424      ), 
     25      'w_i' =>  
     26      array ( 
     27        'name' => 'Jerry Jalava', 
     28        'email' => 'jerry.jalava@gmail.com', 
     29        'role' => 'developer', 
     30      ), 
    2531    ), 
    2632    'dependencies' =>  
  • trunk/midcom/net.nemein.quickpoll/handler/admin.php

    r5693 r12314  
    212212 
    213213            case 'cancel': 
    214                 $_MIDCOM->relocate("{$this->_article->name}.html"); 
     214                $_MIDCOM->relocate("{$this->_article->name}"); 
    215215                // This will exit. 
    216216        } 
  • trunk/midcom/net.nemein.quickpoll/handler/index.php

    r12299 r12314  
    152152        $qb_vote_count_total->add_constraint('article', '=', $this->_article->id); 
    153153        $this->_vote_count = $qb_vote_count_total->count(); 
     154 
     155        $qb_vote = net_nemein_quickpoll_vote_dba::new_query_builder(); 
     156        $qb_vote->add_constraint('article', '=', $this->_article->id); 
     157        $qb_vote->begin_group('OR'); 
     158            $qb_vote->add_constraint('user', '=', $_MIDGARD['user']); 
     159            $qb_vote->add_constraint('ip', '=', $_SERVER['REMOTE_ADDR']); 
     160        $qb_vote->end_group(); 
     161        $vote_count = $qb_vote->count(); 
     162 
     163        if ($vote_count > 0) 
     164        { 
     165            $this->_request_data['voted'] =  true; 
     166        } 
     167        else 
     168        { 
     169            $this->_request_data['voted'] =  false; 
     170        } 
     171         
     172        if (   !$this->_config->get('enable_anonymous') 
     173            && (   !$_MIDCOM->auth->user 
     174                && !$_MIDCOM->auth->admin)) 
     175        { 
     176            $this->_request_data['voted'] =  true; 
     177        } 
    154178         
    155179        $this->_prepare_request_data(); 
     
    230254        $qb_vote = net_nemein_quickpoll_vote_dba::new_query_builder(); 
    231255        $qb_vote->add_constraint('article', '=', $this->_article->id); 
    232         $qb_vote->add_constraint('user', '=', $_MIDGARD['user']); 
    233         $qb_vote->add_constraint('ip', '=', $_SERVER['REMOTE_ADDR']); 
     256        $qb_vote->begin_group('OR'); 
     257            $qb_vote->add_constraint('user', '=', $_MIDGARD['user']); 
     258            $qb_vote->add_constraint('ip', '=', $_SERVER['REMOTE_ADDR']); 
     259        $qb_vote->end_group(); 
    234260        $vote_count = $qb_vote->count(); 
    235          
     261 
    236262        if ($vote_count > 0) 
    237263        { 
     
    243269        } 
    244270         
    245  
     271        if (   !$this->_config->get('enable_anonymous') 
     272            && (   !$_MIDCOM->auth->user 
     273                && !$_MIDCOM->auth->admin)) 
     274        { 
     275            $this->_request_data['voted'] =  true; 
     276        } 
    246277         
    247278        return true; 
  • trunk/midcom/net.nemein.quickpoll/style/index.php

    r12299 r12314  
    5050        { 
    5151        ?> 
    52         <form method="post"  id="net_nemein_quickpoll_vote_form" name="net_nemein_quickpoll_vote_form" action="&(prefix);vote/&(view_id);.html"> 
     52        <form method="post"  id="net_nemein_quickpoll_vote_form" name="net_nemein_quickpoll_vote_form" action="&(prefix);vote/&(view_id);"> 
    5353        &(view["options"]:h); 
    5454        <br /><br /><input type="submit" value="&(submit_string);" />