2009-09-01 14:23:05 +02:00
|
|
|
<h1><%= t :contacts %></h1>
|
2011-03-31 22:59:22 +02:00
|
|
|
<% unless @mode == "choose" %>
|
2009-01-07 20:27:12 +01:00
|
|
|
<div id="header">
|
|
|
|
<ul id="primary">
|
|
|
|
<li><%=link_folders%></li>
|
|
|
|
<li><%=link_send_mail%></li>
|
|
|
|
<li><%=link_mail_prefs%></li>
|
|
|
|
<li><%=link_mail_filters%></li>
|
2009-09-01 14:23:05 +02:00
|
|
|
<li><span><%= t :contacts %></span>
|
2011-03-31 22:59:22 +02:00
|
|
|
<ul id="secondary">
|
|
|
|
<li><%=link_contact_add_one%></li>
|
|
|
|
<li><%=link_to t(:add_multiple), add_multiple_contacts_path %></li>
|
|
|
|
<% if ret = session["return_to"] %>
|
|
|
|
<li><%=link_to(t(:back_to_message), ret) %></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2009-01-07 20:27:12 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2011-03-31 22:59:22 +02:00
|
|
|
<% end -%>
|
2009-01-07 20:27:12 +01:00
|
|
|
<div id="tab_main">
|
|
|
|
<div id="tab_content">
|
2011-03-31 22:59:22 +02:00
|
|
|
|
|
|
|
<% if flash["alert"] %><ul><li><%= flash["alert"] %></li></ul><% end %>
|
2009-01-07 20:27:12 +01:00
|
|
|
<form action="<%=link_contact_choose%>?mode=<%=@mode%>" method="post">
|
|
|
|
<input type="hidden" name="mode" value="<%=@mode%>"/>
|
|
|
|
<% if @group_id and not @group_id.nil? %>
|
2011-03-31 22:59:22 +02:00
|
|
|
<input type="hidden" name="group_id" value="<%=@group_id%>"/>
|
2009-01-07 20:27:12 +01:00
|
|
|
<% end %>
|
|
|
|
<table class="list">
|
|
|
|
<tr>
|
|
|
|
<td colspan="4" id="alphaListHeader">
|
2009-02-09 19:24:02 +01:00
|
|
|
<% CDF::CONFIG[:contact_letters].each do |letter| %>
|
|
|
|
<%= link_to letter, contacts_path(:letter => letter) %>
|
|
|
|
<% end %>
|
|
|
|
|
2009-09-01 14:23:05 +02:00
|
|
|
<%= link_to t(:show_all), contacts_path %>
|
2009-01-07 20:27:12 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2009-02-09 19:24:02 +01:00
|
|
|
<td colspan="3"><%= will_paginate @contacts %></td>
|
2009-01-07 20:27:12 +01:00
|
|
|
</tr>
|
|
|
|
<% if @mode == "choose" %>
|
2011-03-31 22:59:22 +02:00
|
|
|
<tr>
|
|
|
|
<th><%= "#{t :to} #{t :cc} #{t :bcc}" %></th>
|
|
|
|
<th><%= t :name %></th>
|
|
|
|
<th><%= t :email %></th>
|
|
|
|
</tr>
|
|
|
|
<% for contact in @contacts %>
|
|
|
|
<tr class="<%= alternator %>">
|
|
|
|
<td><input type="checkbox" name="contacts_to[<%=contact.id%>]" value="1"/>
|
|
|
|
<input type="checkbox" name="contacts_cc[<%=contact.id%>]" value="1"/>
|
|
|
|
<input type="checkbox" name="contacts_bcc[<%=contact.id%>]" value="1"/></td>
|
|
|
|
<td><%=contact.full_name%></td>
|
|
|
|
<td><%=contact.email%></td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<tr class="rowsep"><td colspan="3"><%=t(:groups)%>:</td></tr>
|
|
|
|
<% for group in @contactgroups %>
|
|
|
|
<tr class="<%= alternator %>">
|
|
|
|
<td><input type="checkbox" name="groups_to[<%=group.id%>]" value="1"/>
|
|
|
|
<input type="checkbox" name="groups_cc[<%=group.id%>]" value="1"/>
|
|
|
|
<input type="checkbox" name="groups_bcc[<%=group.id%>]" value="1"/></td>
|
|
|
|
<td><%=group.name%></td>
|
|
|
|
<td> </td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<tr>
|
|
|
|
<td colspan=3 class="buttonBar">
|
|
|
|
<input type="submit" value="<%= t(:choose)%>">
|
|
|
|
<input type="button" value="<%= t(:cancel)%>" onclick="javascript:window.close();">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% elsif @mode == "groups"%>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th width="200px"><%= t(:name)%></th>
|
|
|
|
<th><%= t(:email)%></th>
|
|
|
|
</tr>
|
|
|
|
<% for contact in @contacts %>
|
|
|
|
<input type="hidden" id="contacts_for_group[<%=contact.id%>]" name="contacts_for_group[<%=contact.id%>]" value="<%=@contacts_for_group[contact.id]%>" >
|
|
|
|
<tr class="<%= alternator %>">
|
|
|
|
<td><input type="checkbox" id="contacts_for_group[<%=contact.id%>]" name="contacts_for_group[<%=contact.id%>]"
|
|
|
|
value="<%=@contacts_for_group[contact.id]%>" onclick="toggleCheckbox(this)"
|
|
|
|
<%=@contacts_for_group[contact.id] == 1 ? " checked " : " " %> ></td>
|
|
|
|
<td><%=contact.full_name%></td>
|
|
|
|
<td><%=contact.email%></td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<tr>
|
|
|
|
<td colspan=2 class="buttonBar">
|
|
|
|
<input type="submit" value="<%= t(:save)%>">
|
|
|
|
<input type="button" value="<%= t(:back_to_groups)%>" onclick="window.location='<%=link_contact_group_list%>'">
|
|
|
|
</td>
|
|
|
|
</tr>
|
2009-01-07 20:27:12 +01:00
|
|
|
<% else %>
|
2011-03-31 22:59:22 +02:00
|
|
|
<tr>
|
|
|
|
<th width="200px"><%= t(:name)%></th>
|
|
|
|
<th><%= t(:email)%></th>
|
|
|
|
<th> </th>
|
|
|
|
</tr>
|
|
|
|
<% for contact in @contacts %>
|
|
|
|
<tr class="<%= alternator %>">
|
|
|
|
<td><%= link_to(contact.full_name, :controller=>:contacts, :action => "edit", :id => contact.id ) %></td>
|
|
|
|
<td><%= link_to( contact.email, :controller => :webmail, :action => "compose", :params => { "mail[to]" => contact.email } ) %></td>
|
|
|
|
<td><%= link_to(t(:delete), {:controller=>:contacts, :action=>'delete', :id=>contact.id},
|
|
|
|
{:confirm=>t(:delete_contact_question, :name => contact.show_name, :email => contact.email)})%>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|