mise en forme bien meilleure du systeme de mail temporaire. Remplacement par un radio 'est-ce un email temporaire' OUI/NON

This commit is contained in:
Benjamin Sonntag 2011-03-27 13:00:19 +00:00
parent e1ade1a251
commit cc25cabf6e
5 changed files with 46 additions and 37 deletions

View File

@ -75,8 +75,7 @@ if (!empty($dst_mail)) $pop=0;
<tr><td><label for="alias"><?php __("Redirections<br />Other recipients:"); ?></label></td><td>(<?php __("one email per line"); ?>)<br /><textarea class="int" cols="32" rows="5" name="alias" id="alias"><?php echo $alias; echo ((empty($alias) && !empty($dst_mail))?"":"\n").$dst_mail; ?></textarea></td></tr>
<tr><td>
<?php echo __("Informations for temporary account"); ?><br/>
<span style="color: red;"><?php __("All this account information will <br/> be deleted at expiration");?></span>
<?php echo __("Is it a temporary mail account?"); ?><br/>
</td><td>
<?php include_once("trash_dateselect.php"); ?>
</td></tr>

View File

@ -87,8 +87,7 @@ echo "<div class=\"warningmsg\">"._("WARNING: turning POP/IMAP off will DELETE t
<tr><td><label for="alias"><?php __("Redirections<br />Other recipients:"); ?></label></td><td>(<?php __("one email per line"); ?>)<br /><textarea class="int" cols="32" rows="5" name="alias" id="alias"><?php echo $alias; ?></textarea></td></tr>
<tr><td>
<?php echo __("Informations for temporary account"); ?><br/>
<span style="color: red;"><?php __("All this account information will <br/> be deleted at expiration time");?></span>
<?php echo __("Is it a temporary mail account?"); ?><br/>
</td><td>
<?php include_once("trash_dateselect.php"); ?>
</td></tr>

View File

@ -55,8 +55,9 @@ if ($error) {
<hr id="topbar"/>
<br />
<p>
<span class="inb"><a href="mail_add.php?domain=<?php echo $domain; ?>"><?php printf(_("Add a mailbox on <b>%s</b>"),$domain); ?></a></span>
<span class="inb"><a href="mail_add.php?many=1&amp;domain=<?php echo $domain; ?>"><?php printf(_("Add many mailboxes on <b>%s</b>"),$domain); ?></a></span>
<span class="inb"><a href="mail_add.php?domain=<?php echo $domain; ?>"><?php printf(_("Add a mailbox on <b>%s</b>"),$domain); ?></a></span>
</p><p>
<span class="inb"><a href="mail_add.php?many=1&amp;domain=<?php echo $domain; ?>"><?php printf(_("Add many mailboxes on <b>%s</b>"),$domain); ?></a></span>
</p>
<?
}
@ -73,8 +74,9 @@ if (isset($error) && $error) {
<hr id="topbar"/>
<br />
<p>
<span class="inb"><a href="mail_add.php?domain=<?php echo $domain; ?>"><?php printf(_("Add a mailbox on <b>%s</b>"),$domain); ?></a></span>
<span class="inb"><a href="mail_add.php?many=1&amp;domain=<?php echo $domain; ?>"><?php printf(_("Add many mailboxes on <b>%s</b>"),$domain); ?></a></span>
<span class="inb"><a href="mail_add.php?domain=<?php echo $domain; ?>"><?php printf(_("Add a mailbox on <b>%s</b>"),$domain); ?></a></span>
</p><p>
<span class="inb"><a href="mail_add.php?many=1&amp;domain=<?php echo $domain; ?>"><?php printf(_("Add many mailboxes on <b>%s</b>"),$domain); ?></a></span>
</p>
<?php
@ -119,13 +121,10 @@ for($i=0;$i<$res["count"];$i++) {
}
echo "<td>";
if (! is_null($val['expiration_date'])) {
// It's a temporary account
echo __("Manage this temporary account");
} else {
// It's a normal account
echo "<a href='mail_add.php?domain=".urlencode($domain)."&dst_mail=".urlencode($val["mail"])."'>";
echo __("Create alias");
echo "</a>";
// It's a temporary account
$trash_info=new m_trash();
$trash_info->set_from_db($val["expiration_date"]);
echo __("This account will be deleted on"); echo "<br />".$trash_info->human_display();
}
echo "</td>";
echo "</tr>";

View File

@ -28,18 +28,21 @@
----------------------------------------------------------------------
*/
require_once("../class/config.php");
$istrash=false;
if (! is_null($res['trash_info']) && $res['trash_info']->is_trash ) {
$istrash=true;
}
?>
<p>
<input type="radio" name="istrash" id="istrash0" class="inc" value="0"<?php cbox(!$istrash); ?> onclick="hide('trash_expire_picker');"><label for="istrash0"><?php __("No"); ?></label>
<input type="radio" name="istrash" id="istrash1" class="inc" value="1"<?php cbox($istrash); ?> onclick="show('trash_expire_picker');"><label for="istrash1"><?php __("Yes"); ?></label>
</p>
<div id="trash_expire_picker">
<table>
<tbody>
<tr>
<td>
<input type="radio" name="trash_type_expiration" value="no_exp" id="no_exp" checked="checked" onclick="trash_exp_none();">
</td><td>
<label for="no_exp"><?php echo __("No auto-deletion date"); ?></label>
</td>
</tr>
<tr>
<td valign="top">
<input type="radio" name="trash_type_expiration" value="trash_in_x" id="trash_in_x" onclick="trash_exp_in_activate();">
@ -57,32 +60,34 @@ require_once("../class/config.php");
</select>
</td>
</tr><tr>
<td valign=top>
<input type="radio" name="trash_type_expiration" value="trash_at_x" id="trash_at_x" onclick="trash_exp_at_activate();">
<td valign="top">
<input type="radio" name="trash_type_expiration" value="trash_at_x" id="trash_at_x" checked="checked" onclick="trash_exp_at_activate();">
</td><td>
<label for="trash_at_x"><?php __('Delete this email the following day,<br/>enter the date using DD/MM/YYYY format');?></label><br/>
<input id="trash_datepicker" name="trash_datepicker" type="text" size="10" value="<?php echo strftime("%d/%m/%Y",mktime() + (3600*24*7));?>" />
<input id="trash_datepicker" name="trash_datepicker" type="text" size="10" value="<?php
if ($istrash) {
echo $res['trash_info']->human_display();
} else {
echo strftime("%d/%m/%Y",mktime() + (3600*24*7));
}
?>" />
</td>
</tr>
</tbody>
</table>
<br />
<span style="color: red;"><?php __("All this account information will be deleted at expiration");?></span>
</div>
<script>
$(document).ready(function() {
$("#trash_datepicker").datepicker({ minDate: '+1d'}); // We can't give an anterior date
$("#trash_datepicker").datepicker( "option", "dateFormat", "dd/mm/yy" ); // format of the date
$("#trash_datepicker").datepicker( "option", "defaultDate", "+7d" ); // format of the date
// I let Vinci make de translation wrapper for jquery and jquery_ui, he have a better view than me
trash_exp_none();
// FIXME : I let Benjamin make de translation wrapper for jquery and jquery_ui, he have a better view than me
trash_exp_at_activate();
});
function trash_exp_none() {
$('#trash_datepicker').attr('disabled', 'disabled');
$('#trash_exp_in_value').attr('disabled', true);
$('#trash_exp_in_unit').attr('disabled', true);
}
function trash_exp_at_activate() {
$('#trash_datepicker').removeAttr('disabled');
$('#trash_exp_in_value').attr('disabled', true);
@ -94,5 +99,9 @@ require_once("../class/config.php");
$('#trash_exp_in_unit').removeAttr('disabled');
}
<?php if (!$istrash) { ?>
hide('trash_expire_picker');
<?php } ?>
</script>

View File

@ -3459,9 +3459,12 @@ msgstr "une adresse email par ligne"
msgid "Informations for temporary account"
msgstr "Informations du compte temporaire"
msgid "Is it a temporary mail account?"
msgstr "Souhaitez-vous que ce mail soit temporaire&nbsp;?"
#: ../admin/mail_add.php:79
msgid "All this account information will <br/> be deleted at expiration"
msgstr "L'adresse email sera détruite<br />à la date d'expiration"
msgid "All this account information will be deleted at expiration"
msgstr "L'adresse email sera détruite à la date d'expiration"
#: ../admin/mail_add.php:85
msgid "Create this email address"
@ -3809,7 +3812,7 @@ msgstr "Pas de date d'autosuppression"
#: ../admin/trash_dateselect.php:47
msgid "You want it to be deleted in"
msgstr "Vous souhaitez que cette adresse soit supprimée le"
msgstr "Vous souhaitez que cette adresse soit supprimée dans"
#: ../admin/trash_dateselect.php:54
msgid "Hours"