Update the account edit page with new field.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 15 Jan 2018 21:53:58 +0000 (16:53 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 15 Jan 2018 21:53:58 +0000 (16:53 -0500)
Also added the field into the dataAbstract class for accounts.

classes/data/dataAccounts.php
views/admin/billing/editAccount.html

index 7c9c60a..e7666f5 100644 (file)
@@ -145,6 +145,15 @@ class GlmDataAccounts extends GlmDataAbstract
                 'required' => true,
             ),
 
+            // Renewal Date
+            'renewal_date' => array(
+                'field'    => 'renewal_date',
+                'type'     => 'date',
+                'use'      => 'a',
+                'default'  => '',
+                'required' => false,
+            ),
+
             // Payment Data
             'payment_data' => array(
                 'field'    => 'payment_data',
index 436c942..147909d 100644 (file)
             </td>
         </tr>
 
+        <tr>
+            <th {if $account.fieldRequired.renewal_date} class="glm-required"}{/if}>Renewal Date</th>
+            <td {if $account.fieldFail.renewal_date}class="glm-form-bad-input" data-tabid="glm-renewal-date"{/if}>
+                <input type="text" name="renewal_date" value="{$account.fieldData.renewal_date.date}" class="glm-form-text-input-medium">
+            {if $account.fieldFail.renewal_date}<p>{$account.fieldFail.renewal_date}</p>{/if}<br>
+            </td>
+        </tr>
+
         <tr>
             <th {if $account.fieldRequired.email} class="glm-required"}{/if}>Billing Email</th>
             <td {if $account.fieldFail.email}class="glm-form-bad-input" data-tabid="glm-email"{/if}>
@@ -110,6 +118,8 @@ jQuery(document).ready(function($){
 
     // Setup the date picker for the input field with the name anniversary_date
     $('input[name="anniversary_date"]').datepicker();
+    // Setup the date picker for the input field with the name renewal_date
+    $('input[name="renewal_date"]').datepicker();
 
     // Flash certain elements for a short time after display
     $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);