[vhffs-dev] [2216] Revamp object states : |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 2216
Author: lau
Date: 2012-10-16 21:01:02 +0200 (Tue, 16 Oct 2012)
Log Message:
-----------
Revamp object states :
- new WAITING_FOR_ACTIVATION => 5,
- modify WAITING_FOR_SUSPENSION => from 7 to 14,
- new ACTIVATION_ERROR => 7,
- modify SUSPENDED => from 8 to 15,
- new SUSPENSION_ERROR => 16
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Constants.pm
trunk/vhffs-api/src/Vhffs/Object.pm
trunk/vhffs-api/src/Vhffs/Panel.pm
trunk/vhffs-compat/from-4.4-to-4.5.sql
trunk/vhffs-panel/templates/admin/object/edit.tt
Modified: trunk/vhffs-api/src/Vhffs/Constants.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Constants.pm 2012-10-16 11:36:13 UTC (rev 2215)
+++ trunk/vhffs-api/src/Vhffs/Constants.pm 2012-10-16 19:01:02 UTC (rev 2216)
@@ -27,9 +27,12 @@
VALIDATION_REFUSED => 2,
WAITING_FOR_CREATION => 3,
CREATION_ERROR => 4,
+ WAITING_FOR_ACTIVATION => 5,
ACTIVATED => 6,
- WAITING_FOR_SUSPENSION => 7,
- SUSPENDED => 8,
+ ACTIVATION_ERROR => 7,
+ WAITING_FOR_SUSPENSION => 14,
+ SUSPENDED => 15,
+ SUSPENSION_ERROR => 16,
WAITING_FOR_MODIFICATION => 9,
MODIFICATION_ERROR => 10,
WAITING_FOR_DELETION => 12,
@@ -97,9 +100,12 @@
Vhffs::Constants::VALIDATION_REFUSED => 'Validation refused',
Vhffs::Constants::WAITING_FOR_CREATION => 'Waiting for creation',
Vhffs::Constants::CREATION_ERROR => 'Creation error',
+ Vhffs::Constants::WAITING_FOR_ACTIVATION => 'Waiting for activation',
Vhffs::Constants::ACTIVATED => 'Activated',
+ Vhffs::Constants::ACTIVATION_ERROR => 'Activation error',
Vhffs::Constants::WAITING_FOR_SUSPENSION => 'Waiting for suspension',
Vhffs::Constants::SUSPENDED => 'Suspended',
+ Vhffs::Constants::SUSPENSION_ERROR => 'Suspension error',
Vhffs::Constants::WAITING_FOR_MODIFICATION => 'Waiting for modification',
Vhffs::Constants::MODIFICATION_ERROR => 'Modification error',
Vhffs::Constants::WAITING_FOR_DELETION => 'Will be deleted',
@@ -199,9 +205,12 @@
=head2 VALIDATION_REFUSED
=head2 WAITING_FOR_CREATION
=head2 CREATION_ERROR
+=head2 WAITING_FOR_ACTIVATION
=head2 ACTIVATED
+=head2 ACTIVATION_ERROR
=head2 WAITING_FOR_SUSPENSION
=head2 SUSPENDED
+=head2 SUSPENSION_ERROR
=head2 WAITING_FOR_MODIFICATION
=head2 MODIFICATION_ERROR
=head2 WAITING_FOR_DELETION
Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm 2012-10-16 11:36:13 UTC (rev 2215)
+++ trunk/vhffs-api/src/Vhffs/Object.pm 2012-10-16 19:01:02 UTC (rev 2216)
@@ -485,15 +485,24 @@
elsif( $value == Vhffs::Constants::CREATION_ERROR ) {
$self->add_history( 'An error occured while creating this object' );
}
+ elsif( $value == Vhffs::Constants::WAITING_FOR_ACTIVATION ) {
+ $self->add_history( 'Waiting for activation' );
+ }
elsif( $value == Vhffs::Constants::ACTIVATED ) {
$self->add_history( 'Is now active for production' );
}
+ elsif( $value == Vhffs::Constants::ACTIVATION_ERROR ) {
+ $self->add_history( 'An error occured while activating this object' );
+ }
elsif( $value == Vhffs::Constants::WAITING_FOR_SUSPENSION ) {
$self->add_history( 'Waiting for suspension' );
}
elsif( $value == Vhffs::Constants::SUSPENDED ) {
$self->add_history( 'Suspended' );
}
+ elsif( $value == Vhffs::Constants::SUSPENSION_ERROR ) {
+ $self->add_history( 'An error occured while suspending this object' );
+ }
elsif( $value == Vhffs::Constants::WAITING_FOR_MODIFICATION ) {
$self->add_history( 'Waiting for modification' );
}
Modified: trunk/vhffs-api/src/Vhffs/Panel.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel.pm 2012-10-16 11:36:13 UTC (rev 2215)
+++ trunk/vhffs-api/src/Vhffs/Panel.pm 2012-10-16 19:01:02 UTC (rev 2216)
@@ -386,9 +386,12 @@
VALIDATION_REFUSED => Vhffs::Constants::VALIDATION_REFUSED,
WAITING_FOR_CREATION => Vhffs::Constants::WAITING_FOR_CREATION,
CREATION_ERROR => Vhffs::Constants::CREATION_ERROR,
+ WAITING_FOR_ACTIVATION => Vhffs::Constants::WAITING_FOR_ACTIVATION,
ACTIVATED => Vhffs::Constants::ACTIVATED,
+ ACTIVATION_ERROR => Vhffs::Constants::ACTIVATION_ERROR,
WAITING_FOR_SUSPENSION => Vhffs::Constants::WAITING_FOR_SUSPENSION,
SUSPENDED => Vhffs::Constants::SUSPENDED,
+ SUSPENSION_ERROR => Vhffs::Constants::SUSPENSION_ERROR,
WAITING_FOR_MODIFICATION => Vhffs::Constants::WAITING_FOR_MODIFICATION,
MODIFICATION_ERROR => Vhffs::Constants::MODIFICATION_ERROR,
WAITING_FOR_DELETION => Vhffs::Constants::WAITING_FOR_DELETION,
Modified: trunk/vhffs-compat/from-4.4-to-4.5.sql
===================================================================
--- trunk/vhffs-compat/from-4.4-to-4.5.sql 2012-10-16 11:36:13 UTC (rev 2215)
+++ trunk/vhffs-compat/from-4.4-to-4.5.sql 2012-10-16 19:01:02 UTC (rev 2216)
@@ -202,3 +202,15 @@
DROP TABLE vhffs_boxes;
DROP TABLE vhffs_forward;
DROP TABLE vhffs_mxdomain;
+
+-- update vhffs states values
+BEGIN;
+ UPDATE vhffs_object SET state=15 WHERE state=8;
+ UPDATE vhffs_object SET state=14 WHERE state=7;
+ UPDATE vhffs_mailings SET state=15 WHERE state=8;
+ UPDATE vhffs_mailings SET state=14 WHERE state=7;
+ UPDATE vhffs_user_group SET state=15 WHERE state=8;
+ UPDATE vhffs_user_group SET state=14 WHERE state=7;
+ UPDATE vhffs_mx_box SET state=15 WHERE state=8;
+ UPDATE vhffs_mx_box SET state=14 WHERE state=7;
+COMMIT;
Modified: trunk/vhffs-panel/templates/admin/object/edit.tt
===================================================================
--- trunk/vhffs-panel/templates/admin/object/edit.tt 2012-10-16 11:36:13 UTC (rev 2215)
+++ trunk/vhffs-panel/templates/admin/object/edit.tt 2012-10-16 19:01:02 UTC (rev 2216)
@@ -29,9 +29,12 @@
<option value="[% constants.object_statuses.VALIDATION_REFUSED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.VALIDATION_REFUSED %]>[% 'Validation refused' | i18n | html %]</option>
<option value="[% constants.object_statuses.WAITING_FOR_CREATION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_CREATION %]>[% 'Waiting for creation' | i18n | html %]</option>
<option value="[% constants.object_statuses.CREATION_ERROR %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.CREATION_ERROR %]>[% 'Error while creating object' | i18n | html %]</option>
+ <option value="[% constants.object_statuses.WAITING_FOR_ACTIVATION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_ACTIVATION %]>[% 'Waiting for activation' | i18n | html %]</option>
<option value="[% constants.object_statuses.ACTIVATED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.ACTIVATED %]>[% 'Activated' | i18n | html %]</option>
+ <option value="[% constants.object_statuses.ACTIVATION_ERROR %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.ACTIVATION_ERROR %]>[% 'Error while activating object' | i18n | html %]</option>
<option value="[% constants.object_statuses.WAITING_FOR_SUSPENSION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_SUSPENSION %]>[% 'Waiting for suspension' | i18n | html %]</option>
<option value="[% constants.object_statuses.SUSPENDED %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.SUSPENDED %]>[% 'Suspended' | i18n | html %]</option>
+ <option value="[% constants.object_statuses.SUSPENSION_ERROR %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.SUSPENSION_ERROR %]>[% 'Error while suspending object' | i18n | html %]</option>
<option value="[% constants.object_statuses.WAITING_FOR_MODIFICATION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_MODIFICATION %]>[% 'Waiting for modification' | i18n | html %]</option>
<option value="[% constants.object_statuses.MODIFICATION_ERROR %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.MODIFICATION_ERROR %]>[% 'Error while modifying object' | i18n | html %]</option>
<option value="[% constants.object_statuses.WAITING_FOR_DELETION %]"[% ' selected="selected"' IF object.get_status == constants.object_statuses.WAITING_FOR_DELETION %]>[% 'Will be deleted' | i18n | html %]</option>