--- /dev/null
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Data Class Management
+ *
+ * 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: dataObitss.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * GlmDataObits 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 GlmDataObitsManagement 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;
+ /**
+ * MemberInfo DB object
+ *
+ * @var $MemberInfo
+ * @access public
+ */
+ public $MemberInfo;
+
+ /**
+ * 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_OBITS_PLUGIN_DB_PREFIX . 'obits';
+
+ /*
+ * Table Data Fields
+ */
+
+ $this->fields = array (
+
+ 'id' => array (
+ 'field' => 'id',
+ 'type' => 'integer',
+ 'view_only' => true,
+ 'use' => 'a'
+ ),
+
+ 'last_name' => array(
+ 'field' => 'last_name',
+ 'type' => 'text',
+ 'required' => true,
+ 'use' => 'a',
+ ),
+
+ 'first_mid' => array(
+ 'field' => 'first_mid',
+ 'type' => 'text',
+ 'required' => true,
+ 'use' => 'a',
+ ),
+
+ 'b_year' => array(
+ 'field' => 'b_year',
+ 'type' => 'integer',
+ 'required' => true,
+ 'use' => 'a',
+ ),
+
+ 'b_yr_range' => array(
+ 'field' => 'b_yr_range',
+ 'type' => 'integer',
+ 'default' => true,
+ 'use' => 'a',
+ ),
+
+ 'd_year' => array(
+ 'field' => 'd_year',
+ 'type' => 'integer',
+ 'required' => true,
+ 'use' => 'a',
+ ),
+
+ 'd_yr_range' => array(
+ 'field' => 'd_yr_range',
+ 'type' => 'integer',
+ 'required' => false,
+ 'use' => 'a',
+ ),
+
+ 'maiden_other' => array(
+ 'field' => 'maiden_other',
+ 'type' => 'text',
+ 'required' => false,
+ 'use' => 'a',
+ ),
+
+ 'spouse_partner' => array(
+ 'field' => 'spouse_partner',
+ 'type' => 'text',
+ 'required' => false,
+ 'use' => 'a',
+ ),
+
+ 'obit_article' => array(
+ 'field' => 'obit_article',
+ 'type' => 'text',
+ 'required' => false,
+ 'use' => 'a',
+ ),
+
+ 'article_a' => array(
+ 'field' => 'article_a',
+ 'type' => 'text',
+ 'default' => false,
+ 'use' => 'a',
+ ),
+
+ 'article_b' => array(
+ 'field' => 'article_b',
+ 'type' => 'text',
+ 'default' => false,
+ 'use' => 'a',
+ ),
+
+ 'article_c' => array(
+ 'field' => 'article_c',
+ 'type' => 'text',
+ 'default' => false,
+ 'use' => 'a',
+ ),
+
+ 'newspaper' => array(
+ 'field' => 'newspaper',
+ 'type' => 'text',
+ 'required' => true,
+ 'use' => 'a',
+ ),
+
+ 'newspaper_date' => array(
+ 'field' => 'newspaper_date',
+ 'type' => 'text',
+ 'required' => true,
+ 'use' => 'a',
+ ),
+
+ 'father_name' => array(
+ 'field' => 'father_name',
+ 'type' => 'text',
+ 'required' => false,
+ 'use' => 'a',
+ ),
+
+ 'mother_name' => array(
+ 'field' => 'mother_name',
+ 'type' => 'text',
+ 'required' => false,
+ 'use' => 'a',
+ ),
+
+ 'misc_info' => array(
+ 'field' => 'misc_info',
+ 'type' => 'text',
+ '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;
+ }
+
+}
+
+?>
+-- Gaslight Media Members Database - Events Add-On
+-- File Created: 2017-02-07
+-- Database Version: 0.0.1
+-- Database Creation Script
+--
+-- This file is called to create a new set of tables for this
+-- add-on for the most recent database version for this add-on.
+--
+-- There should only be one such file in this directory
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+
+-- Obits Table
+CREATE TABLE {prefix}obits (
+ id INT NOT NULL AUTO_INCREMENT,
+ last_name TINYTEXT NOT NULL DEFAULT '',
+ first_mid TINYTEXT NOT NULL DEFAULT '',
+ b_year TINYINT NOT NULL DEFAULT 0, -- Birth Year
+ b_yr_range TINYINT NOT NULL DEFAULT 0, -- Birth Year Range (use the start of the decade like 2010 or 2000)
+ d_year TINYINT NOT NULL DEFAULT 0, -- Death Year
+ d_yr_range TINYINT NOT NULL DEFAULT 0, -- Death Year Range (use the start of the decade like 2010 or 2000)
+ maiden_other TINYTEXT NULL DEFAULT '',
+ spouse_partner TINYTEXT NULL DEFAULT '',
+ obit_article TINYTEXT NULL DEFAULT '',
+ article_a TINYTEXT NULL DEFAULT '',
+ article_b TINYTEXT NULL DEFAULT '',
+ article_c TINYTEXT NULL DEFAULT '',
+ newspaper INT NOT NULL DEFAULT 0,
+ newspaper_date TINYTEXT NOT NULL DEFAULT '',
+ father_name TINYTEXT NULL DEFAULT '',
+ mother_name TINYTEXT NULL DEFAULT '',
+ misc_info LONGTEXT NULL DEFAULT '',
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Newspapers
+CREATE TABLE {prefix}newspapers (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NOT NULL DEFAULT '',
+ PRIMARY KEY (id)
+);