From ce2ce0a13a876707d6cf5b4d0804244de5277960 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 2 Sep 2011 12:10:46 -0400 Subject: [PATCH] CC-2755: Displaying trial ending information - it only displays about remaining date when the plan level is 'trial' --- .../application/layouts/scripts/layout.phtml | 2 +- .../application/layouts/scripts/library.phtml | 2 +- .../application/views/helpers/IsTrial.php | 12 ++++++++++++ .../application/views/helpers/TrialRemaining.php | 16 ++++++++++++++++ .../views/scripts/partialviews/header.phtml | 2 ++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 airtime_mvc/application/views/helpers/IsTrial.php create mode 100644 airtime_mvc/application/views/helpers/TrialRemaining.php diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index 1483cd3f3..232fecd37 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -10,7 +10,7 @@
- partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "trial_remain"=> $this->trialRemaining())) ?> + partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining())) ?> navigation()->menu()->setPartial($partial); ?> diff --git a/airtime_mvc/application/layouts/scripts/library.phtml b/airtime_mvc/application/layouts/scripts/library.phtml index 6a0f8e1db..587da8927 100644 --- a/airtime_mvc/application/layouts/scripts/library.phtml +++ b/airtime_mvc/application/layouts/scripts/library.phtml @@ -10,7 +10,7 @@
- partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "trial_remain"=> $this->trialRemaining())) ?> + partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining())) ?> navigation()->menu()->setPartial($partial); ?> diff --git a/airtime_mvc/application/views/helpers/IsTrial.php b/airtime_mvc/application/views/helpers/IsTrial.php new file mode 100644 index 000000000..2890bbc49 --- /dev/null +++ b/airtime_mvc/application/views/helpers/IsTrial.php @@ -0,0 +1,12 @@ +diff($datetime2); + if($interval->format('%R') == '-'){ + return "Trial expired."; + } + return $interval->format('%a days'); + } +} diff --git a/airtime_mvc/application/views/scripts/partialviews/header.phtml b/airtime_mvc/application/views/scripts/partialviews/header.phtml index 85d46224f..2ef5b307f 100644 --- a/airtime_mvc/application/views/scripts/partialviews/header.phtml +++ b/airtime_mvc/application/views/scripts/partialviews/header.phtml @@ -30,12 +30,14 @@
  • + is_trial){?>
    • Trial remaining
    • trial_remain?>
    +