From: Chuck Scott Date: Wed, 20 Apr 2016 21:04:39 +0000 (-0400) Subject: Events nearly ready, menu restructure X-Git-Tag: v1.0.8^2~12 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a5bbc686a75fc17498c344ea5d718e4dfffb1d23;p=WP-Plugins%2Fglm-member-db-contacts.git Events nearly ready, menu restructure --- diff --git a/models/admin/members/contacts.php b/models/admin/members/contacts.php deleted file mode 100644 index 35d82f3..0000000 --- a/models/admin/members/contacts.php +++ /dev/null @@ -1,148 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ - * @link http://dev.gaslightmedia.com/ - */ - -// Load Contacts data abstract -require_once(GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); - -/* - * This model is called when the "Shortcodes" menu is selected - * - */ -class GlmMembersAdmin_members_contacts extends GlmDataContacts -{ - - /** - * WordPress Database Object - * - * @var $wpdb - * @access public - */ - public $wpdb; - /** - * Plugin Configuration Data - * - * @var $config - * @access public - */ - public $config; - /** - * Contacts List - * - * @var $contacts - * @access public - */ - public $contacts; - - /* - * Constructor - * - * This contructor performs the work for this model. This model returns - * an array containing the following. - * - * 'status' - * - * True if successfull and false if there was a fatal failure. - * - * 'view' - * - * A suggested view name that the contoller should use instead of the - * default view for this model or false to indicate that the default view - * should be used. - * - * 'data' - * - * Data that the model is returning for use in merging with the view to - * produce output. - * - * @wpdb object WordPress database object - * - * @return array Array containing status, suggested view, and any data - */ - public function __construct ($wpdb, $config) - { - - // Save WordPress Database object - $this->wpdb = $wpdb; - - // Save plugin configuration object - $this->config = $config; - - // Run constructor for members data class - parent::__construct(false, false); - - } - - public function modelAction($actionData = false) { - - $haveContacts = false; - $filterArchived = false; - $filterText = false; - $haveFilter = false; - - // Only list member contacts for the selected member - $where = "true"; - - // Filter by text string supplied - if (isset($_REQUEST['filterText'])) { - $filterText = esc_sql($_REQUEST['filterText']); - $where .= " AND ( - T.lname LIKE '%$filterText%' OR - T.fname LIKE '%$filterText%' OR - T.org LIKE '%$filterText%' OR - T.descr LIKE '%$filterText%' - )"; - $haveFilter = true; - } - - // Check if this is a request to show archived contacts - if (!isset($_REQUEST['filterArchived'])) { - $where .= " AND T.access != ".$this->config['access_numb']['Archived']; - $filterArchived = false; - } else { - $filterArchived = true; - $haveFilter = true; - } - - // Get list of contacts - $this->contacts = $this->getList($where); - - if ($this->contacts !== false) { - if (count($this->contacts) > 0) { - $haveContacts = true; - } - } - - // Compile template data - $templateData = array( - 'haveContacts' => $haveContacts, - 'contacts' => $this->contacts, - 'filterArchived' => $filterArchived, - 'filterText' => $filterText, - 'haveFilter' => $haveFilter - ); - - // Return status, any suggested view, and any data to controller - return array( - 'status' => true, - 'modelRedirect' => false, - 'view' => 'admin/members/contacts.html', - 'data' => $templateData - ); - - } -} - -?> \ No newline at end of file diff --git a/views/admin/members/contacts.html b/views/admin/members/contacts.html deleted file mode 100644 index c405bf1..0000000 --- a/views/admin/members/contacts.html +++ /dev/null @@ -1,75 +0,0 @@ -{include file='admin/members/header.html'} - -
- List Filters:   - Show Archived   -    - Search - -

Contacts

- - - - - - - - - - - - - - - -{if $haveContacts} - {foreach $contacts as $c} - - - - - - - - - - - {/foreach} -{else} - -{/if} - -
NameActiveTypeAccessUserEntityOrganizationLocation
{$c.lname}, {$c.fname}{$c.active.name}{$c.contact_type.name}{$c.access.name}{$c.contact_role_short.name} - {$c.ref_type.name}: - {$c.ref_dest_name} - {$c.org}{$c.city.name}, {$c.state.name}
(no contacts listed)
- - - - - -{include file='admin/footer.html'}