diff --git a/include/class-Plan.php b/include/class-Plan.php index 7e558b9..f112a3a 100644 --- a/include/class-Plan.php +++ b/include/class-Plan.php @@ -1,129 +1,138 @@ . // load Plan trait class_exists( 'Plan' ); /** * Methods for a Plan class */ trait PlanTrait { /** * Get plan ID * * @return int */ public function getPlanID() { return $this->get( 'plan_ID' ); } /* * Get plan name * * @return string */ public function getPlanName() { return $this->get( 'plan_name' ); } /** * Get the number of FTP users of this Plan * * @return int|null */ public function getPlanFTPUsers() { return $this->get( 'plan_ftpusers' ); } /** * Get the number of Databases of this Plan * * @return int|null */ public function getPlanDatabases() { return $this->get( 'plan_databases' ); } /** * Get the number of Mailboxes of this Plan * * @return int|null */ public function getPlanMailboxes() { return $this->get( 'plan_mailboxes' ); } + /** + * Get the number of Mailforwardings of this Plan + * + * @return int|null + */ + public function getPlanMailforwardings() { + return $this->get( 'plan_mailforwards' ); + } + /** * Get the plan edit URl * * @param boolean $absolute True for an absolute URL * @return string */ public function getPlanPermalink( $absolute = false ) { return Plan::permalink( $this->get( 'plan_name' ), $absolute ); } /** * Normalize a Plan object after being retrieved from database */ protected function normalizePlan() { $this->integers( 'plan_ID', 'plan_ftpusers', 'plan_databases', 'plan_mailboxes', 'plan_mailforwards' ); } } /** * Describe the 'plan' table */ class Plan extends Queried { use PlanTrait; /** * Table name */ const T = 'plan'; /** * Constructor */ public function __construct() { $this->normalizePlan(); } /** * Get the plan permalink * * @param string $plan_name Plan name * @param boolean $absolute True for an absolute URL */ public static function permalink( $plan_name = null, $absolute = false ) { $url = 'plan.php'; if( $plan_name ) { $url .= _ . $plan_name; } return site_page( $url, $absolute ); } } diff --git a/template/mailforwards.php b/template/mailforwards.php index 8b65dd1..7114ebc 100644 --- a/template/mailforwards.php +++ b/template/mailforwards.php @@ -1,66 +1,73 @@ . /* * This is the template for the mailboxes list * * Called from: * template/domain.php * * Available variables: * $domain object */ // unuseful when load directly defined( 'BOZ_PHP' ) or die; // domain mail forwardings $mailforwardfroms = $domain->factoryMailforwardfrom() ->select( [ 'mailforwardfrom.mailforwardfrom_ID', 'mailforwardfrom_username', 'domain_name', ] ) ->queryGenerator(); ?>

valid() ): ?>

+

getPlanName(), + $plan->getPlanMailForwardings(), + __( "Forwarding" ) + ) ) ?>

+

getDomainName() ), __( "Create" ) ) ?>