<!-- $Id: review.tt2 5408 2008-12-18 08:22:22Z olivier.salaun $ -->

[% PROCESS picture_upload.tt2 %]

[% IF action != 'search' %]
<div class="search_form">
  <form action="[% path_cgi %]">
  <fieldset>
  <label for="size">[%|loc%]Page size[%END%]</label>
  <input type="hidden" name="sortby" value="[% sortby %]" />
  <input type="hidden" name="action" value="review" />
  <input type="hidden" name="list" value="[% list %]" />
  <select id="size" name="size" onchange="this.form.submit();">
          <option value="[% size %]" selected="selected">[% size %]</option>
	  <option value="25">25</option>
          <option value="50">50</option>
          <option value="100">100</option>
	  <option value="500">500</option>
  </select>
  </fieldset>
  </form>
<br />
   [% IF prev_page %]
    <a href="[% path_cgi %]/review/[% list %]/[% prev_page %]/[% size %]/[% sortby %]"><img src="[% icons_url %]/left.png" alt="[%|loc%]Previous page[%END%]" /></a>
   [% END %]
   [% IF page %]
     [%|loc%]page[%END%] [% page %] / [% total_page %]
   [% END %]
   [% IF next_page %]
     <a href="[% path_cgi %]/review/[% list %]/[% next_page %]/[% size %]/[% sortby %]"><img src="[% icons_url %]/right.png" alt="[%|loc%]Next page[%END%]" /></a>
   [% END %]
</div>
[% END %]

[% IF is_owner %]
  <br />
  <a class="actionMenuLinks" href="[% path_cgi %]/subindex/[% list %]">[%|loc%]Pending subscriptions[%END%]</a> 
  [% IF conf.use_blacklist != 'none' %]
    <a class="actionMenuLinks" href="[% path_cgi %]/blacklist/[% list %]">[%|loc%]Blacklist[%END%]</a>
  [% END %]
  <a class="actionMenuLinks" href="[% path_cgi %]/reviewbouncing/[% list %]">[%|loc%]Bounces[%END%]</a>
  [% IF action == 'search' %]
     <a class="actionMenuLinks" href="[% path_cgi %]/dump/[% list %]/[% filter %]">[%|loc%]Dump[%END%]</a>
  [% ELSE %]
     <a class="actionMenuLinks" href="[% path_cgi %]/dump/[% list %]/light">[%|loc%]Dump[%END%]</a> 
  [% END %]
  <br />
  [% IF may_sync %]
  <br />
  <form name="synchronize_list_members" action="[% path_cgi %]" method="post">
  <input class="MainMenuLinks" type="submit" name="action_sync_include" value="[%|loc%]Synchronize members with data sources[%END%]"/>
  <input type="hidden" name="list" value="[% list %]"/>
  </form>
  [% END %]
  <br />
  <form name="synchronize_list_members" action="[% path_cgi %]" method="post">
  <input class="MainMenuLinks" type="submit" name="action_remind" value="[%|loc%]Remind all[%END%]" onclick="return request_confirm('[% FILTER escape_quote %][%|loc(total)%]Do you really want to send a subscription reminder message to the %1 subscribers?[%END%][%END%]');"/>
  <input type="hidden" name="list" value="[% list %]"/>
  </form>
  <br /><br />
  <form action="[% path_cgi %]" method="post">
  <fieldset>
   <input type="hidden" name="previous_action" value="review" />
   <input type="hidden" name="list" value="[% list %]" />
   <input type="hidden" name="action" value="add" />
   <label for="email_search">[%|loc%]Add an user: [%END%]</label>
   <input id="email_search" type="text" name="email" size="35" />
   <input class="MainMenuLinks" type="submit" name="action_add" value="[%|loc%]Add[%END%]" /> <input id="quietly" type="checkbox" name="quiet" /> <label for="quietly">[%|loc%]quiet[%END%]</label>
   &nbsp;&nbsp;<a class="actionMenuLinks" href="[% path_cgi %]/add_request/[% list %]">[%|loc%]Multiple add[%END%]</a>
  </fieldset>
  </form>

[% END %]

<br />
<form action="[% path_cgi %]" method="post"> 
<fieldset>
<input type="hidden" name="previous_action" value="review" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="action" value="search" />
<label for="filter">[%|loc%]Search user by e-mail: [%END%]</label>
<input alt="[%|loc%]Search user by email[%END%]" type="text" size="18" id="filter" name="filter" value="[% filter %]" />
<input class="MainMenuLinks" type="submit" name="action_search" value="[%|loc%]Search[%END%]" /> 
<br />
[% IF action == 'search' %]
<br />[%|loc(occurrence)%]%1 occurrence(s) found[%END%]<br />
[% IF too_many_select %]
[%|loc%]Selection too wide, can not show selection[%END%]
[% END %]
[% END %]
</fieldset>
</form>
<br /><br />
<form name="myform" action="[% path_cgi %]" method="post">
<fieldset>
  <input type="hidden" name="previous_action" value="[% action %]" />
  <input type="hidden" name="previous_list" value="[% list %]" />
  <input type="hidden" name="list" value="[% list %]" />
  [% IF is_owner %]
    <input class="MainMenuLinks" type="submit" name="action_del" value="[%|loc%]Delete selected email addresses[%END%]" />
    <input id="quiet" type="checkbox" name="quiet" /> <label for="quiet">[%|loc%]quiet[%END%]</label>
  [% END %]

    <table summary="[%|loc%]List members[%END%]" class="listOfItems text_center">
      <tr>
	[% IF is_owner %]
	   <th>X</th>
	[% END %]

        [% IF sortby == 'email' %]
  	    <th colspan="2" class="sortby">
	    [%|loc%]Email[%END%]
	[% ELSE %]
	    <th colspan="2">	    
	    <a href="[% path_cgi %]/review/[% list %]/1/[% size %]/email">[%|loc%]Email[%END%]</a>
	[% END %]
	</th>
        [% IF sortby == 'domain' %]
  	    <th class="sortby">
	    [%|loc%]Domain[%END%]
	[% ELSE %]
	    <th>
               <a href="[% path_cgi %]/review/[% list %]/1/[% size %]/domain">[%|loc%]Domain[%END%]</a>
	[% END %]
	</th>
	[% IF pictures_display %]
  	    <th>	    
  	    [%|loc%]Picture[%END%]
	    </th>
  	[% END %]
	[% IF sortby == 'name' %]
	<th class="sortby">
	  [%|loc%]Name[%END%]
	[% ELSE %]
	<th>
          <a href="[% path_cgi %]/review/[% list %]/1/[% size %]/name">[%|loc%]Name[%END%]</a>
	[% END %] 
	</th>
        [% IF is_owner %]
          <th>
	  [%|loc%]Reception[%END%]
	  </th>
	  [% IF list_conf.user_data_source == 'include2' %]
            [% IF sortby == 'sources' %]
  	      <th class="sortby">
	      [%|loc%]Sources[%END%]
	    [% ELSE %]
	      <th>
	      <a href="[% path_cgi %]/review/[% list %]/1/[% size %]/sources" >[%|loc%]Sources[%END%]</a>
	    [% END %]
	    </th>
          [% END %]
	  [% IF sortby == 'date' %]
  	    <th class="sortby">
	    [%|loc%]Sub date[%END%]
	  [% ELSE %]
	    <th>
            <a href="[% path_cgi %]/review/[% list %]/1/[% size %]/date" >[%|loc%]Sub date[%END%]</a>
	  [% END %]
          </th>
	  <th>[%|loc%]Last update[%END%]</th>
	  [% IF additional_fields %]
	    <th>[% additional_fields %]</th>
	  [% END %]
	  <th>
	      [%|loc%]Additional information[%END%]
	  </th>
        [% END %]
      </tr>
      
      [% FOREACH u = members %]
	[% IF dark == '1' %]
	  <tr>
	[% ELSE %]
          <tr class="color0">
	[% END %]

	 [% IF is_owner %]
	  [% IF u.subscribed %]
	    <td>
	        <input type="checkbox" name="email" value="[% u.escaped_email %]" />
	    </td>
	  [% ELSE %]
            <td>&nbsp;</td>
          [% END %]
 	 [% END %]
	 [% IF u.bounce %]
	   <td colspan="2" class="text_left">
	 
	     [% IF is_owner %]
	       <a href="[% path_cgi %]/editsubscriber/[% list %]/[% u.escaped_email %]/review">[% u.email %]</a>
	     [% ELSE %]
 	       [% u.email %]
 	     [% END %]
	   </td>
	 [% IF is_owner %]
           <td class="color7"><strong>[%|loc%]bouncing[%END%]</strong>
	   </td>
	 [% END %]

	 [% ELSE %]
	   <td colspan="3" class="text_left">
	     [% IF is_owner %]
	       <a href="[% path_cgi %]/editsubscriber/[% list %]/[% u.escaped_email %]/review">[% u.email %]</a>
	     [% ELSE %]
	       [% u.email %]
	     [% END %]
	   </td>
	 [% END %]

  	  [% IF pictures_display %]
  	    [% IF u.pictures_url %]
  	      <td>
  	      <a href="[%u.pictures_url%]" title="[%|loc%]Open in a new window[%END%]" target="pictures"><img class="Pictures" src="[%u.pictures_url%]" alt="[%|loc(u.email)%]%1's picture[%END%]" /></a>   
  	      </td>
  	    [% ELSE %]
  	      <td>
  	      </td>
  	    [% END %]
  	  [% END %]
	  <td>
             <span class="smaller">
	        [% u.gecos %]&nbsp;
	     </span>
          </td>
	  [% IF is_owner %]
  	    <td>
  	      [% u.reception %]
	    </td>
          [% IF list_conf.user_data_source == 'include2' %]
            <td>
            [% IF u.subscribed %]
              [% IF u.included %]
                 subscribed<br />[% u.sources %]
              [% ELSE %]
                 subscribed
              [% END %]
            [% ELSE %]
              [% u.sources %]
            [% END %]   
            </td>
          [% END %]
	    <td>
	      [% u.date %]
	    </td>
	    <td>
	      [% u.update_date %]
	    </td>
    	  [% IF additional_fields %]
	     <td>
	      [% u.additional %]
	     </td>
	  [% END %]
	  <td class="text_left">
	  	 [% FOREACH ca_k IN list_conf.custom_attribute %]<b>[% ca_k.name %] : </b>[% SET id = ca_k.id %][% u.custom_attribute.$id.value %]<br/>[% END %]
	</td>
       	  [% END %]
        </tr>

        [% IF dark == '1' %]
	  [% SET dark = 0 %]
	[% ELSE %]
	  [% SET dark = 1 %]
	[% END %]

        [% END %]


      </table>
   [% IF action != 'search' %]
    <div class="search_form">
       [% IF prev_page %]
	 <a href="[% path_cgi %]/review/[% list %]/[% prev_page %]/[% size %]/[% sortby %]"><img src="[% icons_url %]/left.png" alt="[%|loc%]Previous page[%END%]" /></a>
       [% END %]
       [% IF page %]
  	  [%|loc%]page[%END%] [% page %] / [% total_page %]
       [% END %]
       [% IF next_page %]
	  <a href="[% path_cgi %]/review/[% list %]/[% next_page %]/[% size %]/[% sortby %]"><img src="[% icons_url %]/right.png" alt="[%|loc%]Next page[%END%]" /></a>
       [% END %]
    </div>
   [% END %]
      [% IF is_owner %]
        <!--input type="button" name="action_del" value="Delete selected email addresses" onclick="return request_confirm('[%|loc%]Do you really want to unsubscribe ALL selected subscribers?[%END%]')" /-->
        <input class="MainMenuLinks" type="button" value="[%|loc%]Toggle Selection[%END%]" onclick="toggle_selection(document.myform.email)" /><br />
	<input class="MainMenuLinks" type="submit" name="action_del" value="[%|loc%]Delete selected email addresses[%END%]" />
        <input type="checkbox" name="quiet" />[%|loc%]quiet[%END%]
      [% END %]

   </fieldset>
   </form>






