Merge branch 'develop' into feature/memberDashboard feature/memberDashboard
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 14 Oct 2016 19:14:23 +0000 (15:14 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 14 Oct 2016 19:14:23 +0000 (15:14 -0400)
1  2 
css/admin.css
models/admin/member/index.php
views/admin/member/index.html

diff --cc css/admin.css
@@@ -466,3 -418,8 +466,8 @@@ input[type=submit], input[type=file] 
  {
      font-weight: bold;
  }
 -}
+ .notice-link
+ {
+     cursor: pointer;
++}
@@@ -421,24 -427,27 +427,29 @@@ class GlmMembersAdmin_member_index exte
  
          // Compile template data
          $templateData = array(
 -            'haveMemberTypes' => $haveMemberTypes,
 -            'haveMember' => $haveMember,
 -            'addingMember' => $addingMember,
 -            'memberID' => $memberID,
 -            'member' => $memberData,
 -            'memberName' => $memberName,
 -            'haveInfoRecords' => $haveInfoRecords,
 -            'memberInfoRecords' => $memberInfoRecords,
 -            'noActive' => $noActive,
 -            'showArchived' => $showArchived,
 -            'haveMemberInfo' => $haveMemberInfo,
 -            'memberUpdated' => $memberUpdated,
 -            'statusTypeNumbers' => $this->config['status_numb'],
 -            'statusPending' => $this->config['status_numb']['Pending'],
 +            'lockedToMember'     => $lockedToMember,
 +            'haveMemberTypes'    => $haveMemberTypes,
 +            'haveMember'         => $haveMember,
 +            'addingMember'       => $addingMember,
 +            'memberID'           => $memberID,
 +            'member'             => $memberData,
 +            'memberName'         => $memberName,
 +            'haveInfoRecords'    => $haveInfoRecords,
 +            'memberInfoRecords'  => $memberInfoRecords,
 +            'noActive'           => $noActive,
 +            'showArchived'       => $showArchived,
 +            'haveMemberInfo'     => $haveMemberInfo,
 +            'memberUpdated'      => $memberUpdated,
 +            'statusTypeNumbers'  => $this->config['status_numb'],
 +            'statusPending'      => $this->config['status_numb']['Pending'],
              'clickThroughCounts' => $clickThroughCounts,
 -            'detailViewCounts' => $detailViewCounts,
 -            'thisMonth' => date('m')-1,                 // Using this as an index into the month array - starts with 0
 -            'thisYear' => date('Y'),
 -            'years' => $years,
 -            'months' => $this->config['month'],
 -            'time' => time()                            // Used to break browser caching of graphs
 +            'detailViewCounts'   => $detailViewCounts,
 +            'thisDate'           => $thisDate,
++            'thisMonth'          => date('m')-1,                 // Using this as an index into the month array - starts with 0
++            'thisYear'           => date('Y'),
++            'years'              => $years,
++            'months'             => $this->config['month'],
++            'time'               => time()                            // Used to break browser caching of graphs
          );
  
          // Return status, suggested view, and data to controller
    {else}
          <h3>No {$terms.term_member} information available.</h3>
    {/if}
 -    
 +
      <script src="{$jsUrl}/PrintArea/jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>
 -    
 +
      <!-- URL click through graphs -->
      <div id="daysClicks" class="graph-dialog glm-dialog-box" title="URL Click-Through Counts Graph">
+         <center>
+             <p>&nbsp;</p>
+             <select id="clickMonths">
+         {foreach from=$months key=monthNumb item=monthName}
+                 <option value="{$monthNumb}"{if $monthNumb == $thisMonth} selected{/if}>{$monthName}</option>
+         {/foreach}
+             </select>
+             <select id="clickYears">
+         {foreach $years as $year}
+                 <option value="{$year}"{if $thisYear == $year} selected{/if}>{$year}</option>
+         {/foreach}
+             </select>
+             <div id="clickUpdate" class="button button-secondaryt">Update Graphs</div>
+             <span class="message button notice-link" data-notice='Legacy Websites may not have included retained daily data.-br--br-If this was the case, you will only see daily URL Click-Through counts collected subsequent to the introduction of this site.-br--br-Any monthly count summaries imported from a legacy site should however display on the lower graph.'>?</span>
+             &nbsp;&nbsp;&nbsp;&nbsp;<div class="button button-secondary graph-print" data-areaToPrint="urlClicksPrintArea">Print</div>
+             <a id="clickExport" class="button button-secondary" href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=memberGraphs&graphType=exportClicks&memberId={$member.fieldData.id}&memberSlug={$member.fieldData.member_slug}">Export All Monthly Totals</a>
+         </center>
          <div id="urlClicksPrintArea" class="PrintArea" style="padding: 10px;">
-             <b>{$member.fieldData.name}</b>
-             <p>
-                 <span class="glm-right">{$thisDate}</span>
-                 <span class="glm-left">URL Click-Through Counts for Past Month</span>
-             </p>
-             <img src="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=memberGraphs&graphType=clicks&graphPeriod=oneMonth&memberId={$member.fieldData.id}&memberSlug={$member.fieldData.member_slug}">
-             <p>
-                 <span class="glm-right">{$thisDate}</span>
-                 <span class="glm-left">URL Click-Through Counts for Past 2 Years</span>
-             </p>
-             <img src="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=memberGraphs&graphType=clicks&graphPeriod=twoYears&memberId={$member.fieldData.id}&memberSlug={$member.fieldData.member_slug}">
+             <p><img id="clicksMonthGraph" src="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=memberGraphs&graphType=clicks&graphPeriod=oneMonth&memberId={$member.fieldData.id}&memberSlug={$member.fieldData.member_slug}&kb={$time}"><br></p>
+             <p><img id="clicksYearGraph" src="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=memberGraphs&graphType=clicks&graphPeriod=twoYears&memberId={$member.fieldData.id}&memberSlug={$member.fieldData.member_slug}&kb={$time}"><br></p>
          </div>
-         <div class="button button-secondary graph-print glm-right" data-areaToPrint="urlClicksPrintArea">Print</div>
      </div>
  
      <!-- Member Detail Views -->
              $('#showArchived').click( function() {
                  checked = 'false';
                  if ($(this).attr('checked') == 'checked') {
 -                    checked = 'true'; 
 +                    checked = 'true';
                  }
 -                window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&member={$memberID}&showArchived=" + checked);               
 +                window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&member={$memberID}&showArchived=" + checked);
              });
  
 -                alert(notice.replace(/-br-/g, "\n")); 
+             $('.message').on('click', function() {
+                 var notice = $(this).attr('data-notice');
 -            
 -            // Flash certain elements for a short time after display      
++                alert(notice.replace(/-br-/g, "\n"));
+             });
++
 +            // 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).fadeIn(500).fadeOut(500);
  
          });