trash ok for yes/no (was buggy)
This commit is contained in:
parent
15e4a171cf
commit
eb2ddaad7b
|
@ -30,6 +30,17 @@
|
|||
require_once("../class/config.php");
|
||||
$trash->getfromform();
|
||||
|
||||
$fields = array (
|
||||
"domain" => array ("request", "string", ""),
|
||||
"email" => array ("request", "string", ""),
|
||||
"pop" => array ("request", "integer", 0),
|
||||
"pass" => array ("request", "string", ""),
|
||||
"passconf" => array ("request", "string", ""),
|
||||
"alias" => array ("request", "string", ""),
|
||||
);
|
||||
getFields($fields);
|
||||
|
||||
|
||||
if ($pass != $passconf) {
|
||||
$error = _("Passwords do not match");
|
||||
include("mail_add.php");
|
||||
|
|
|
@ -37,22 +37,26 @@ class m_trash {
|
|||
function set_from_db($expiration_date_db) {
|
||||
$this->expiration_date_db=$expiration_date_db;
|
||||
$this->expiration_date=strtotime($this->expiration_date_db);
|
||||
if ($this->expiration_date_db) $this->is_trash=true;
|
||||
}
|
||||
|
||||
function human_display() {
|
||||
return strftime("%d/%m/%Y %T",$this->expiration_date);
|
||||
return strftime("%d/%m/%Y",$this->expiration_date);
|
||||
}
|
||||
|
||||
function getfromform() {
|
||||
$fields = array (
|
||||
"trash_type_expiration" => array ("request", "string", ""),
|
||||
"trash_exp_in_value" => array ("request", "string", ""),
|
||||
"trash_exp_in_unit" => array ("request", "string", ""),
|
||||
"trash_datepicker" => array ("request", "string", ""),
|
||||
"istrash" => array ("request", "boolean", false),
|
||||
"trash_type_expiration" => array ("request", "string", ""),
|
||||
"trash_exp_in_value" => array ("request", "string", ""),
|
||||
"trash_exp_in_unit" => array ("request", "string", ""),
|
||||
"trash_datepicker" => array ("request", "string", ""),
|
||||
);
|
||||
$champs=getFields($fields);
|
||||
foreach($champs as $k=>$v) $$k = $v;
|
||||
|
||||
if (!$istrash) $trash_type_expiration="no_exp";
|
||||
|
||||
switch($trash_type_expiration) {
|
||||
case "trash_at_x":
|
||||
// We can use date_parse_from_format if we have php 5.3
|
||||
|
|
Loading…
Reference in New Issue