2009-09-01 14:23:05 +02:00
|
|
|
<h1><%= t :contacts %></h1>
|
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>
|
2009-01-07 20:27:12 +01:00
|
|
|
<ul id="secondary">
|
|
|
|
<li><%=link_contact_add_one%></li>
|
|
|
|
<li><%=link_contact_add_multiple%></li>
|
2009-02-07 19:46:42 +01:00
|
|
|
<% if ret = session["return_to"] %>
|
2009-09-01 14:23:05 +02:00
|
|
|
<li><%=link_to(t(:back_to_message), ret) %></li>
|
2009-01-07 20:27:12 +01:00
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="tab_main">
|
|
|
|
<div id="tab_content">
|
|
|
|
|
2009-02-07 19:46:42 +01: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? %>
|
|
|
|
<input type="hidden" name="group_id" value="<%=@group_id%>"/>
|
|
|
|
<% 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" %>
|
|
|
|
<tr>
|
2009-09-01 14:23:05 +02:00
|
|
|
<th><%= "#{t :to} #{t :cc} #{t :bcc}" %></th>
|
|
|
|
<th><%= t :name %></th>
|
|
|
|
<th><%= t :email %></th>
|
2009-01-07 20:27:12 +01:00
|
|
|
</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"><%=_('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="<%= _('choose')%>">
|
|
|
|
<input type="button" value="<%= _('cancel')%>" onclick="javascript:window.close();">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% elsif @mode == "groups"%>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th width="200px"><%= _('Name')%></th>
|
|
|
|
<th><%= _('E-mail')%></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="<%= _('Save')%>">
|
|
|
|
<input type="button" value="<%= _('Back to groups')%>" onclick="window.location='<%=link_contact_group_list%>'">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% else %>
|
|
|
|
<tr>
|
|
|
|
<th width="200px"><%= _('Name')%></th>
|
|
|
|
<th><%= _('E-mail')%></th>
|
|
|
|
<th> </th>
|
|
|
|
</tr>
|
|
|
|
<% for contact in @contacts %>
|
|
|
|
<tr class="<%= alternator %>">
|
|
|
|
<td><%= link_to(contact.full_name, :controller=>"/contacts/contact", :action => "edit", :id => contact.id ) %></td>
|
|
|
|
<td><%= link_to( contact.email, :controller => "/webmail", :action => "compose", :params => { "mail[to]" => contact.email } ) %></td>
|
|
|
|
<td><%= link_to(_('delete'), {:controller=>'/contacts/contact', :action=>'delete', :id=>contact.id}, {:confirm=>sprintf(_('DELETE CONTACT?\r\n\Name - %s\r\nE-mail - %s'), contact.show_name, contact.email)})%></td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|