--- /dev/null
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Data Class Leads
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package GLM Member-DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataLeads.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * GlmDataLeads class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package GLM Member DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
+ * Exp $
+ */
+class GlmDataInterestGroups extends GlmDataAbstract
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Data Table Name
+ *
+ * @var $table
+ * @access public
+ */
+ public $table;
+ /**
+ * Field definitions
+ *
+ * 'type' is type of field as defined by the application
+ * text Regular text field
+ * pointer Pointer to an entry in another table
+ * 'filters' is the filter name for a particular filter ID in PHP filter
+ * functions
+ * See PHP filter_id()
+ *
+ * 'use' is when to use the field
+ * l = List
+ * g = Get
+ * n = New
+ * i = Insert
+ * e = Edit
+ * u = Update
+ * d = Delete
+ * a = All
+ *
+ * @var $ini
+ * @access public
+ */
+ public $fields = false;
+
+ /**
+ * Constructor
+ *
+ * @param object $d database connection
+ * @param array $config Configuration array
+ * @param bool $limitedEdit Flag to say indicate limited edit requested
+ *
+ * @return void
+ * @access public
+ */
+ public function __construct($wpdb, $config, $limitedEdit = false)
+ {
+
+ // If this class is not being extended along with existing $wpdb and $config
+ if (!$this->wpdb) {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ }
+
+ /*
+ * Table Name
+ */
+ $this->table = GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'interest_groups';
+
+ /*
+ * Table Data Fields
+ */
+
+ $this->fields = array (
+
+ 'id' => array (
+ 'field' => 'id',
+ 'type' => 'integer',
+ 'view_only' => true,
+ 'use' => 'a'
+ ),
+
+ 'title' => array(
+ 'field' => 'title',
+ 'type' => 'text',
+ 'required' => true,
+ 'unique' => true,
+ 'use' => 'a',
+ ),
+
+
+ );
+
+ }
+
+ /*
+ * Entry Post Processing Call-Back Method
+ *
+ * Perform post-processing for all result entries.
+ *
+ * In this case we're using it to append an array of category
+ * data to each member result and also sort by member name.
+ *
+ * @param array $r Array of field result data for a single entry
+ * @param string $a Action being performed (l, i, g, ...)
+ *
+ * @return object Class object
+ *
+ */
+ public function entryPostProcessing($r, $a)
+ {
+ return $r;
+ }
+
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Data Class Leads
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package GLM Member-DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataLeads.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * GlmDataLeads class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package GLM Member DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
+ * Exp $
+ */
+class GlmDataInterests extends GlmDataAbstract
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Data Table Name
+ *
+ * @var $table
+ * @access public
+ */
+ public $table;
+ /**
+ * Field definitions
+ *
+ * 'type' is type of field as defined by the application
+ * text Regular text field
+ * pointer Pointer to an entry in another table
+ * 'filters' is the filter name for a particular filter ID in PHP filter
+ * functions
+ * See PHP filter_id()
+ *
+ * 'use' is when to use the field
+ * l = List
+ * g = Get
+ * n = New
+ * i = Insert
+ * e = Edit
+ * u = Update
+ * d = Delete
+ * a = All
+ *
+ * @var $ini
+ * @access public
+ */
+ public $fields = false;
+
+ /**
+ * Constructor
+ *
+ * @param object $d database connection
+ * @param array $config Configuration array
+ * @param bool $limitedEdit Flag to say indicate limited edit requested
+ *
+ * @return void
+ * @access public
+ */
+ public function __construct($wpdb, $config, $limitedEdit = false)
+ {
+
+ // If this class is not being extended along with existing $wpdb and $config
+ if (!$this->wpdb) {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ }
+
+ /*
+ * Table Name
+ */
+ $this->table = GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'interests';
+
+ /*
+ * Table Data Fields
+ */
+
+ $this->fields = array (
+
+ 'id' => array (
+ 'field' => 'id',
+ 'type' => 'integer',
+ 'view_only' => true,
+ 'use' => 'a',
+ ),
+
+ 'title' => array(
+ 'field' => 'title',
+ 'type' => 'text',
+ 'required' => true,
+ 'unique' => true,
+ 'use' => 'a',
+ ),
+
+ // Parent - for adding, deleting and editing, has selection Tables
+ 'group_id' => array(
+ 'field' => 'group_id',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . 'interest_groups',
+ 'p_field' => 'title',
+ 'p_orderby' => 'title',
+ 'p_blank' => true,
+ 'force_list' => true,
+ 'required' => false,
+ 'use' => 'a'
+ ),
+
+
+ );
+
+ }
+
+ /*
+ * Entry Post Processing Call-Back Method
+ *
+ * Perform post-processing for all result entries.
+ *
+ * In this case we're using it to append an array of category
+ * data to each member result and also sort by member name.
+ *
+ * @param array $r Array of field result data for a single entry
+ * @param string $a Action being performed (l, i, g, ...)
+ *
+ * @return object Class object
+ *
+ */
+ public function entryPostProcessing($r, $a)
+ {
+ return $r;
+ }
+
+}
+
* @release leads.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
* @link http://dev.gaslightmedia.com/
*/
-
+require_once GLM_MEMBERS_LEADS_PLUGIN_CLASS_PATH.'/data/dataInterests.php';
+require_once GLM_MEMBERS_LEADS_PLUGIN_CLASS_PATH.'/data/dataInterestGroups.php';
/**
* GlmMembersAdmin_settings_leads
*
* @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott
* Exp $
*/
-class GlmMembersAdmin_settings_leads // extends GlmDataLeadsSettings
+class GlmMembersAdmin_settings_leads extends GlmDataInterests
{
/**
* @access public
*/
public $settings = array();
- /**
- * categories
- *
- * @var bool
- * @access public
- */
- public $categories = array();
- public $oldCatMap = array();
- /**
- * events
- *
- * @var bool
- * @access public
- */
- public $events = array();
- public $image_owner;
/**
* Constructor
$this->config = $config;
// Run constructor for members data class
-// parent::__construct(false, false);
+ parent::__construct(false, false);
}
* @access public
* @return void
*/
- public function modelAction($actionData = false)
+ public function modelAction ( $actionData = false )
{
+ $success = true;
+ $haveInterests = false;
+ $haveGroups = false;
+ $interests = false;
+ $error = false;
+ $option2 = '';
+ $newInterest = $this->newEntry();
+
+ // Check if a category ID is supplied
+ $id = 0;
+ if ( isset( $_REQUEST['id'] ) ) {
+ $id = $_REQUEST['id'] - 0;
+ }
+
+ $groupData = new GlmDataInterestGroups( $this->wpdb, $this->config );
+
+ // If there's an action option
+ if ( isset( $_REQUEST['option'] ) ) {
+ switch( $_REQUEST['option'] ) {
+ case 'addNew':
+ $return = $this->insertEntry();
+ $id = $return['fieldData']['id'];
+ break;
+
+ case 'update':
+ if ( $id > 0 ) {
+ $this->updateEntry( $id );
+ }
+ break;
+
+ case 'delete':
+ if ( $id > 0 ) {
+ $this->deleteEntry( $id, true );
+ }
+ break;
+
+ case 'addNewGroup':
+ $groupData->insertEntry();
+ break;
+
+ case 'updateGroup':
+ if ( $id > 0 ) {
+ $groupData->updateEntry( $id );
+ }
+ break;
+
+ case 'deleteGroup':
+ if ( $id > 0 ) {
+ $groupData->deleteEntry( $id, true );
+ }
+ break;
+
+ default:
+ $option2 = false;
+ break;
+
+ }
+ }
+
+ if ( isset( $_REQUEST['option2'] ) ) {
+ $option2 = $_REQUEST['option2'];
+ }
+
+ // Get a current list of interests
+ $interests = $this->getList();
+ //echo '<pre>$interests: ' . print_r($interests, true) . '</pre>';
+
+ if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) {
+ glmMembersAdmin::addNotice( $interests, 'DataBlock', 'Interests Data' );
+ }
+
+ // If we have list entries - even if it's an empty list
+ $success = true;
+ $haveInterests = false;
+ if ( $interests !== false ) {
+
+ $success = true;
+
+ // If we have any entries
+ if ( count( $interests ) > 0 ) {
+ $haveInterests = true;
+ }
+ }
+
+ $groups = $groupData->getList();
+
+ if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) {
+ glmMembersAdmin::addNotice( $groups, 'DataBlock', 'Interest Groups Data' );
+ }
+
+ if ( $groups !== false ) {
+ $success = true;
+
+ // If we have any entries.
+ if ( count( $groups ) > 0 ) {
+ $haveGroups = true;
+ }
+ }
+
+ // If we had a fatal error, redirect to the error page
+ if ($error) {
+ return array(
+ 'status' => $success,
+ 'menuItemRedirect' => 'error',
+ 'modelRedirect' => 'index',
+ 'view' => 'admin/error/index.html',
+ 'data' => false,
+ );
+ }
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice( $interests, 'DataBlock', 'Interests Data' );
+ }
// Compile template data
$templateData = array(
+ 'haveInterests' => $haveInterests,
+ 'haveGroups' => $haveGroups,
+ 'interests' => $interests,
+ 'groups' => $groups,
+ 'option2' => $option2,
+ 'newInterest' => $newInterest,
);
// Return status, suggested view, and data to controller
return array(
- 'status' => true,
+ 'status' => $success,
'menuItemRedirect' => false,
'modelRedirect' => false,
'view' => 'admin/settings/leads.html',
- 'data' => $templateData
+ 'data' => $templateData,
);
-
}
}
{include file='admin/settings/header.html'}
-<H1>ADMIN LEADS SETTINGS VIEW STUFF GOES HERE</H1>
\ No newline at end of file
+<h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+ <a id="glm-interests-list" data-show-table="glm-table-interests" class="glm-settings-tab nav-tab nav-tab-active">Interests List</a>
+ <a id="glm-groups-list" data-show-table="glm-table-groups" class="glm-settings-tab nav-tab">Groups</a>
+</h2>
+
+<table id="glm-table-interests" class="glm-admin-table glm-settings-table{if $option2!=''} glm-hidden{/if}">
+ <tr><td colspan="2">
+ <!-- Add Interests Button and Dialog Box -->
+ <div id="newInterestButton" class="button button-primary glm-right">Add an Interest</div>
+ <div id="newInterestDialog" class="glm-dialog-box" title="Enter a New Interest">
+ <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="leads">
+ <input type="hidden" name="option" value="addNew">
+
+ <!-- This is only temporary until we reinstate the "Used With" selection below -->
+ <input type="hidden" name="ref_type" value="20">
+
+ <table class="glm-admin-table">
+ <tr>
+ <th class="glm-required">Interest Name:</th>
+ <td>
+ <input type="text" name="title" class="glm-form-text-input">
+ </td>
+ </tr>
+ <tr>
+ <th class="glm-required">Group:</th>
+ <td >
+ <select name="group_id">
+ <option value="0">(none)</option>
+ {if $haveGroups}
+ {foreach $groups as $group}
+ <option value="{$group.id}">{$group.title}</option>
+ {/foreach}
+ {/if}
+ </select>
+ </td>
+ </tr>
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <a id="newInterestCancel" class="button button-primary glm-right">Cancel</a>
+ <input type="submit" value="Add new Interest" class="button button-primary">
+
+ </form>
+ </div>
+
+ <!-- Delete Interests Button -->
+ <div id="deleteInterestDialog" class="glm-dialog-box" title="Delete Interest">
+ <center>
+ <p>Are you sure you want to delete this interest?</p>
+ <p><div id="deleteInterestConfirm" class="button button-primary">Yes, delete this interest</div></p>
+ <p><div id="deleteInterestCancel" class="button button-primary">Cancel</div></p>
+ </center>
+ </div>
+
+ <!-- Edit Interests Dialog Box -->
+ <div id="editInterestDialog" class="glm-dialog-box" title="Edit this Interest">
+ <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="leads">
+ <input type="hidden" name="option" value="update">
+ <input id="editInterestID" type="hidden" name="id" value="">
+
+ <!-- This is only temporary until we reinstate the "Used With" selection below -->
+ <input type="hidden" name="ref_type" value="20">
+
+ <table class="glm-admin-table">
+ <tr>
+ <th class="glm-required">Interest Name:</th>
+ <td>
+ <input id="editInterestName" type="text" name="title" class="glm-form-text-input">
+ </td>
+ </tr>
+ <tr>
+ <th class="glm-required">Group:</th>
+ <td>
+ <select id="editGroupId" name="group_id">
+ <option value="0">(none)</option>
+ {if $haveGroups}
+ {foreach $groups as $group}
+ <option value="{$group.id}"{if $group.selected} selected{/if}>{$group.title}</option>
+ {/foreach}
+ {/if}
+ </select>
+ </td>
+ </tr>
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <a id="editInterestCancel" class="button button-primary glm-right">Cancel</a>
+ <input type="submit" value="Update this Interest">
+
+ </form>
+ </div>
+
+
+ <h2>Interests</h2>
+
+ <table class="wp-list-table widefat fixed posts glm-admin-table">
+ <thead>
+ <tr>
+ <th>Interest</th>
+ <th>Used With</th>
+ <th>Groups</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ {if $haveInterests}
+ {assign var="i" value="0"}
+ {foreach $interests as $t}
+ {if $i++ is odd by 1}
+ <tr>
+ {else}
+ <tr class="alternate">
+ {/if}
+ <td>
+ <a class="editInterest" data-interestID="{$t.id}" data-refTypeID="{$t.ref_type.value}" data-interestUsesValue="{$t.uses_value.value}" data-group_id='{$t.group_id.value}'>{$t.title}</a>
+ </td>
+ <td id="editInterestRefType_{$t.id}">
+ {$t.ref_type.title}
+ </td>
+ <td id="editInterestGroups">
+ {foreach $t.group_id.list as $group}
+ {if $group.default}
+ {$group.name}
+ {/if}
+ {/foreach}
+ </td>
+ <td>
+ <div class="deleteInterestButton button button-secondary glm-button-small glm-right" data-interestID="{$t.id}">Delete</div>
+ </td>
+ </tr>
+ {/foreach}
+ {else}
+ <tr class="alternate"><td colspan="2">(no interests listed)</td></tr>
+ {/if}
+ </tbody>
+ </table>
+ </tr>
+</table>
+<script type="text/javascript">
+ jQuery(document).ready(function($) {
+
+ $("#newInterestDialog").dialog({
+ autoOpen: false,
+ minWidth: 400,
+ dialogClass: "glm-dialog-no-close"
+ });
+ $("#editInterestDialog").dialog({
+ autoOpen: false,
+ minWidth: 400,
+ dialogClass: "glm-dialog-no-close"
+ });
+ $("#deleteInterestDialog").dialog({
+ autoOpen: false,
+ minWidth: 400,
+ dialogClass: "glm-dialog-no-close"
+ });
+
+ $('#newInterestButton').click( function() {
+ $("#newInterestDialog").dialog("open");
+ });
+ $('.editInterest').click( function() {
+ var interestID = $(this).attr('data-interestID');
+ var interestName = $(this).text();
+ var interestRefTypeID = $(this).attr('data-refTypeID');
+ var interestUsesValue = parseInt($(this).attr('data-interestUsesValue'));
+ var interestDescr = $('#editInterestDescr_' + interestID).html();
+ var interestShortDescr = $('#editInterestShortDescr_' + interestID).html();
+ var interestGroupId = $(this).attr('data-group_id');
+ console.log(interestGroupId);
+ $('#editInterestID').val(interestID);
+ $('#editInterestName').val(interestName.trim());
+ $('#editInterestRef').val(interestRefTypeID);
+ $('#editInterestUsesValue').prop('checked', interestUsesValue);
+ $('#editGroupId').val(interestGroupId);
+ $('.interestSearch').each(function(){
+ $(this).prop('checked', false);
+ });
+ $("#editInterestDialog").dialog("open");
+ });
+ $('#editInterestCancel').click( function() {
+ $("#editInterestDialog").dialog("close");
+ });
+ $('#newInterestCancel').click( function() {
+ $("#newInterestDialog").dialog("close");
+ });
+
+ var id = false;
+ $('.deleteInterestButton').click( function() {
+ id = $(this).attr('data-interestID');
+ $("#deleteInterestDialog").dialog("open");
+ });
+ $('#deleteInterestConfirm').click( function() {
+ $("#deleteInterestDialog").dialog("close");
+ window.location.href = "{$thisUrl}?page={$thisPage}&glm_action=leads&option=delete&id=" + id;
+ });
+ $('#deleteInterestCancel').click( function() {
+ $("#deleteInterestDialog").dialog("close");
+ });
+
+ /*
+ * Edit area tabs
+ */
+ $('.glm-settings-tab').click( function() {
+
+ // Clear tabl highlights and hide all tables
+ $('.glm-settings-tab').removeClass('nav-tab-active');
+ $('.glm-settings-table').addClass('glm-hidden');
+
+ // Highlight selected tab
+ $(this).addClass('nav-tab-active');
+
+ // Show selected table
+ var table = $(this).attr('data-show-table');
+ $('#' + table).removeClass('glm-hidden');
+
+ if (table == 'glm-table-address') {
+ initMap();
+ }
+
+ });
+
+ });
+</script>
+<table id="glm-table-groups" class="glm-admin-table glm-settings-table{if $option2!='group'} glm-hidden{/if}">
+ <tr>
+ <td colspan="2">
+ <!-- Add Group Button and Dialog Box -->
+ <div id="newGroupButton" class="button button-primary glm-right">Add a Group</div>
+ <div id="newGroupDialog" class="glm-dialog-box" title="Enter a New Group">
+ <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="leads">
+ <input type="hidden" name="option" value="addNewGroup">
+ <input type="hidden" name="option2" value="group">
+
+ <!-- This is only temporary until we reinstate the "Used With" selection below -->
+ <input type="hidden" name="ref_type" value="20">
+
+ <table class="glm-admin-table">
+ <tr>
+ <th class="glm-required">Group Name:</th>
+ <td>
+ <input type="text" name="title" class="glm-form-text-input">
+ </td>
+ </tr>
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <a id="newGroupCancel" class="button button-primary glm-right">Cancel</a>
+ <input type="submit" value="Add new Group" class="button button-primary">
+
+ </form>
+ </div>
+
+ <!-- Delete Group Button -->
+ <div id="deleteGroupDialog" class="glm-dialog-box" title="Delete Group">
+ <center>
+ <p>Are you sure you want to delete this group?</p>
+ <p><div id="deleteGroupConfirm" class="button button-primary">Yes, delete this group</div></p>
+ <p><div id="deleteGroupCancel" class="button button-primary">Cancel</div></p>
+ </center>
+ </div>
+
+ <!-- Edit Interests Dialog Box -->
+ <div id="editGroupDialog" class="glm-dialog-box" title="Edit this Group">
+ <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="leads">
+ <input type="hidden" name="option" value="updateGroup">
+ <input type="hidden" name="option2" value="group">
+ <input id="editGroupID" type="hidden" name="id" value="">
+
+ <!-- This is only temporary until we reinstate the "Used With" selection below -->
+ <input type="hidden" name="ref_type" value="20">
+ <table class="glm-admin-table">
+ <tr>
+ <th class="glm-required">Group Name:</th>
+ <td>
+ <input id="editGroupName" type="text" name="title" class="glm-form-text-input">
+ </td>
+ </tr>
+
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <a id="editGroupCancel" class="button button-primary glm-right">Cancel</a>
+ <input type="submit" value="Update this Group">
+
+ </form>
+ </div>
+
+ <h2>Groups</h2>
+ <table class="wp-list-table widefat fixed posts glm-admin-table">
+ <thead>
+ <tr>
+ <th>Group</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ {if $haveGroups}
+ {assign var="i" value="0"}
+ {foreach $groups as $t}
+ {if $i++ is odd by 1}
+ <tr>
+ {else}
+ <tr class="alternate">
+ {/if}
+ <td>
+ <a class="editGroup" data-groupID="{$t.id}" data-refTypeID="{$t.ref_type.value}">{$t.title}</a>
+ </td>
+ <td>
+ <div class="deleteGroupButton button button-secondary glm-button-small glm-right" data-groupID="{$t.id}">Delete</div>
+ </td>
+ </tr>
+ {/foreach}
+ {else}
+ <tr class="alternate"><td colspan="2">(no groups listed)</td></tr>
+ {/if}
+ </tbody>
+ </table>
+
+ </tr>
+</table>
+<script type="text/javascript">
+ jQuery(document).ready(function($) {
+
+ $("#newGroupDialog").dialog({
+ autoOpen: false,
+ minWidth: 400,
+ dialogClass: "glm-dialog-no-close"
+ });
+ $("#editGroupDialog").dialog({
+ autoOpen: false,
+ minWidth: 400,
+ dialogClass: "glm-dialog-no-close"
+ });
+ $("#deleteGroupDialog").dialog({
+ autoOpen: false,
+ minWidth: 400,
+ dialogClass: "glm-dialog-no-close"
+ });
+
+ $('#newGroupButton').click( function() {
+ $("#newGroupDialog").dialog("open");
+ });
+ $('.editGroup').click( function() {
+ var groupID = $(this).attr('data-groupID');
+ var groupName = $(this).text();
+ $('#editGroupID').val(groupID);
+ $('#editGroupName').val(groupName.trim());
+ $("#editGroupDialog").dialog("open");
+ });
+ $('#editGroupCancel').click( function() {
+ $("#editGroupDialog").dialog("close");
+ });
+ $('#newGroupCancel').click( function() {
+ $("#newGroupDialog").dialog("close");
+ });
+
+ var group_id = false;
+ $('.deleteGroupButton').click( function() {
+ group_id = $(this).attr('data-groupID');
+ $("#deleteGroupDialog").dialog("open");
+ });
+ $('#deleteGroupConfirm').click( function() {
+ $("#deleteGroupDialog").dialog("close");
+ window.location.href = "{$thisUrl}?page={$thisPage}&glm_action=leads&option=deleteGroup&id=" + group_id + "&option2=group";
+ });
+ $('#deleteGroupCancel').click( function() {
+ $("#deleteGroupDialog").dialog("close");
+ });
+
+ });
+</script>
+
+
+{include file='admin/footer.html'}