fixing the develop branch with initial files and setup
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 8 Sep 2017 13:16:03 +0000 (09:16 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 8 Sep 2017 13:16:03 +0000 (09:16 -0400)
26 files changed:
activate.php
assets/calIcon.png [new file with mode: 0644]
classes/data/dataJobs.php [new file with mode: 0644]
css/admin.css [new file with mode: 0644]
deactivate.php
defines.php
index.php
models/admin/jobs/index.php [new file with mode: 0644]
models/admin/jobs/list.php [new file with mode: 0644]
models/front/jobs/list.php [new file with mode: 0644]
setup/adminHooks.php
setup/adminMenus.php
setup/adminTabs.php
setup/databaseScripts/create_database_V0.0.1.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php [new file with mode: 0644]
setup/databaseScripts/drop_database_V0.0.1.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.1.sql [new file with mode: 0644]
setup/frontHooks.php
setup/rolesAndCapabilities.php
setup/shortcodes.php
setup/validActions.php
uninstall.php
views/admin/header.html [new file with mode: 0644]
views/admin/jobs/edit.html [new file with mode: 0644]
views/admin/jobs/index.html [new file with mode: 0644]
views/front/jobs/list.html [new file with mode: 0644]

index 7f2223e..14018f1 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * Activate Plugin Tasks
  *
  * PHP version 5.5
  *
  * @category glmWordPressPlugin
- * @package  glmMembersJobs
+ * @package  glmMembersjobs
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
  * @release  activate.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
@@ -26,7 +26,7 @@ if (!defined('ABSPATH')) {
  * Currently the only actions are to add role capability to display and modify
  * prototypes.
  */
-class glmMembersJobsPluginActivate
+class glmMembersjobsPluginActivate
 {
 
     /**
@@ -68,7 +68,7 @@ class glmMembersJobsPluginActivate
         $this->config = $config;
 
         // Set current plugin version
-        update_option('glmMembersJobsPluginVersion', GLM_MEMBERS_JOBS_PLUGIN_VERSION);
+        update_option('glmMembersjobsPluginVersion', GLM_MEMBERS_JOBS_PLUGIN_VERSION);
 
         // Set Roles and Capabilities for this plugin
         require_once GLM_MEMBERS_JOBS_PLUGIN_SETUP_PATH.'/rolesAndCapabilities.php';
diff --git a/assets/calIcon.png b/assets/calIcon.png
new file mode 100644 (file)
index 0000000..d50b0fc
Binary files /dev/null and b/assets/calIcon.png differ
diff --git a/classes/data/dataJobs.php b/classes/data/dataJobs.php
new file mode 100644 (file)
index 0000000..7849c25
--- /dev/null
@@ -0,0 +1,334 @@
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Data Class Job Postings
+ *
+ * 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: dataConditions.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**********************************************************************
+ *  NOTE: THIS IS A Job Postings FILE - DO NOT USE UNMODIFIED
+ *
+ *  Please change all references to conditions, Conditions, or CONDITIONS to a name
+ *  appropriate for your new Add-On.
+ *
+ *  Data fields in this file are conditions only.
+ *
+ *  Remove this message before using this file in production!
+ **********************************************************************/
+
+/**
+ * GlmDatajobs 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 GlmDatajobs 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_JOBS_PLUGIN_DB_PREFIX . 'reports';
+
+        //        -- Conditions Table
+        //CREATE TABLE {prefix}conditions (
+        //  id INT NOT NULL AUTO_INCREMENT,
+        //  name TEXT NOT NULL,
+        //  descr_short TEXT NULL,
+        //  descr TEXT NULL,
+        //  last_update DATE NULL,
+        //  PRIMARY KEY (id)
+        //);
+        
+        /*
+         * Table Data Fields
+         */
+
+        $this->fields = array (
+
+            'id' => array (
+                'field' => 'id',
+                'type' => 'integer',
+                'view_only' => true,
+                'use' => 'a'
+            ),
+            'report_active' => array (
+                'field' => 'report_active',
+                'type' => 'checkbox',
+                'default' => false,
+                'use' => 'a'
+            ),
+            'report_date' => array (
+                'field' => 'report_date',
+                'type' => 'date',
+                'default' => false,
+                'use' => 'a'
+            ),
+            'report_notes' => array (
+                'field' => 'report_notes',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'big_bay_cond' => array (
+                'field' => 'big_bay_cond',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'big_bay_name' => array (
+                'field' => 'big_bay_name',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'big_bay_groom' => array (
+                'field' => 'big_bay_groom',
+                'type' => 'date',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'big_bay_base' => array (
+                'field' => 'big_bay_base',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'big_bay_notes' => array (
+                'field' => 'big_bay_notes',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'alston_name' => array (
+                'field' => 'alston_name',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'alston_cond' => array (
+                'field' => 'alston_cond',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'alston_groom' => array (
+                'field' => 'alston_groom',
+                'type' => 'date',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'alston_base' => array (
+                'field' => 'alston_base',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'alston_notes' => array (
+                'field' => 'alston_notes',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'nestoria_cond' => array (
+                'field' => 'nestoria_cond',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'nestoria_name' => array (
+                'field' => 'nestoria_groom',
+                'type' => 'date',
+                'required' => true,
+                'use' => 'a'
+            ),
+            
+            'nestoria_groom' => array (
+                'field' => 'nestoria_groom',
+                'type' => 'date',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'nestoria_base' => array (
+                'field' => 'nestoria_base',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'nestoria_notes' => array (
+                'field' => 'nestoria_notes',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'chassell_cond' => array (
+                'field' => 'chassell_cond',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'chassell_name' => array (
+                'field' => 'chassell_name',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'chassell_groom' => array (
+                'field' => 'chassell_groom',
+                'type' => 'date',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'chassell_base' => array (
+                'field' => 'chassell_base',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'chassell_notes' => array (
+                'field' => 'chassell_notes',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'pinery_name' => array (
+                'field' => 'pinery_name',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'pinery_base' => array (
+                'field' => 'pinery_base',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'pinery_notes' => array (
+                'field' => 'pinery_notes',
+                'type' => 'text',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'pinery_groom' => array (
+                'field' => 'pinery_groom',
+                'type' => 'date',
+                'required' => true,
+                'use' => 'a'
+            ),
+            'report_blurb' => array (
+                'field' => 'report_blurb',
+                'type' => 'text',
+                'required' => 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 row result and also sort by 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;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/css/admin.css b/css/admin.css
new file mode 100644 (file)
index 0000000..d272dc7
--- /dev/null
@@ -0,0 +1,21 @@
+#report-tabs{
+    opacity: 0;
+    max-width: 725px;
+}
+.trail-notes{
+   height: 100px;
+}
+.condition-label,.trail-label{
+    margin-bottom: 5px;
+}
+.ui-datepicker-trigger{
+    margin-left: 5px;
+    position: absolute;
+}
+.ui-tabs-panel .groom-date,.ui-tabs-panel .snow-base,.trail-conditions{
+    margin-bottom: 20px;
+}
+.trail-name{
+    margin-bottom: 20px;
+    
+}
index 0485ba3..b7f20e8 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * Deactivate Plugin Tasks
  *
  * PHP version 5.5
  *
  * @category glmWordPressPlugin
- * @package  glmMembersJobs
+ * @package  glmMembersjobs
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
  * @release  admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
@@ -22,7 +22,7 @@ if (!defined('ABSPATH')) {
  * This class performs all necessary additional work when this
  * plugin is deactivated.
  */
-class glmMembersJobsPluginDeactivate
+class glmMembersjobsPluginDeactivate
 {
 
     /**
@@ -55,7 +55,7 @@ class glmMembersJobsPluginDeactivate
         $this->config = $config;
 
         // Delete our version from WordPress Options
-        delete_option('glmMembersJobsPluginVersion');
+        delete_option('glmMembersjobsPluginVersion');
     }
 
 }
index 6ef5a40..37d8e2e 100644 (file)
@@ -7,14 +7,14 @@
 
 // NOTE: Plugin & Database versions are defined in "/glm-member-db.php".
 
-define('GLM_MEMBERS_JOBS_PLUGIN_NAME', 'GLM Members Job Listings');
-define('GLM_MEMBERS_JOBS_PLUGIN_SHORT_NAME', 'jobs');
-define('GLM_MEMBERS_JOBS_PLUGIN_SLUG', 'glm-member-jobs');
+define('GLM_MEMBERS_JOBS_PLUGIN_NAME', 'GLM Members Database Job Postings');
+define('GLM_MEMBERS_JOBS_PLUGIN_SHORT_NAME', 'Job Postings');
+define('GLM_MEMBERS_JOBS_PLUGIN_SLUG', 'glm-member-db-jobs');
 
 // Database table prefixes - change if using add-on tables
 global $wpdb;
-define('GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX', $wpdb->prefix.'glm_membersJobs');
-define('GLM_MEMBERS_JOBS_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersJobsDbVersion');
+define('GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX', $wpdb->prefix.'glm_membersjobs_');
+define('GLM_MEMBERS_JOBS_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersjobsDbVersion');
 
 // Determine which system we're running on - If not provided, assume PRODUCTION
 $host = getenv('GLM_HOST_ID');
index 0f9091c..0d80aa2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,8 +1,8 @@
 <?php
 /**
- * Plugin Name: GLM Members Job Listings
+ * Plugin Name: GLM Members Database Job Postings
  * Plugin URI: http://www.gaslightmedia.com/
- * Description: A jobs listing plugin for MIGCSA
+ * Description: Job Postings / Listings add-on
  * Version: 0.0.1
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com/
  */
 
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * Index
  *
  * PHP version 5.5
  *
  * @category glmWordPressPluginChild
- * @package glmMembersJobsAddOn
+ * @package glmMembersjobsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
  * @version 0.0.1
@@ -44,8 +44,8 @@ define('GLM_MEMBERS_JOBS_PLUGIN_DB_VERSION', '0.0.1');
 define('GLM_MEMBERS_JOBS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
 
 // Check if plugin version is not current in WordPress option and if needed updated it
-if (GLM_MEMBERS_JOBS_PLUGIN_VERSION != get_option('glmMembersJobsPluginVersion')) {
-    update_option('glmMembersJobsPluginVersion', GLM_MEMBERS_JOBS_PLUGIN_VERSION);
+if (GLM_MEMBERS_JOBS_PLUGIN_VERSION != get_option('glmMembersjobsPluginVersion')) {
+    update_option('glmMembersjobsPluginVersion', GLM_MEMBERS_JOBS_PLUGIN_VERSION);
 }
 
 /*
@@ -100,7 +100,7 @@ if (is_file(GLM_MEMBERS_JOBS_PLUGIN_PATH.'/setup/databaseScripts/dbVersions.php'
  */
 
 // Check for main plugin and that it's active
-function glmMembersJobsPluginRequired() {
+function glmMembersjobsPluginRequired() {
     echo '
         <div class="error">
             <p>The '.GLM_MEMBERS_JOBS_PLUGIN_NAME.' add-on requires the base GLM Member DB plugin to be installed and active!</p>
@@ -111,12 +111,12 @@ function glmMembersJobsPluginRequired() {
 $plugin_name = 'glm-member-db/index.php';
 $is_active = is_plugin_active($plugin_name);
 if ($is_active != '1') {
-    add_action( 'admin_notices', 'glmMembersJobsPluginRequired' );
+    add_action( 'admin_notices', 'glmMembersjobsPluginRequired' );
     deactivate_plugins('/'.GLM_MEMBERS_JOBS_PLUGIN_SLUG.'/index.php');
 }
 
 // Check for Minimum DB version for main Member DB
-function glmMembersJobsMinVerRequired() {
+function glmMembersjobsMinVerRequired() {
     echo '
         <div class="error">
             <p>The '.GLM_MEMBERS_JOBS_PLUGIN_NAME.' requires that the main GLM Member DB plugin version be no older than '
@@ -128,8 +128,8 @@ function glmMembersJobsMinVerRequired() {
 }
 $glmMembersDatabasePluginVersion = get_option('glmMembersDatabasePluginVersion');
 if (version_compare($glmMembersDatabasePluginVersion, GLM_MEMBERS_JOBS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION) < 0) {
-    define('GLM_MEMBERS_JOBS_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, jobs Requires: ".GLM_MEMBERS_JOBS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION);
-    add_action( 'admin_notices', 'glmMembersJobsMinVerRequired');
+    define('GLM_MEMBERS_JOBS_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, Job Postings Requires: ".GLM_MEMBERS_JOBS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION);
+    add_action( 'admin_notices', 'glmMembersjobsMinVerRequired');
     deactivate_plugins('/'.GLM_MEMBERS_JOBS_PLUGIN_SLUG.'/'.GLM_MEMBERS_JOBS_PLUGIN_SLUG.'.php');
 }
 
@@ -144,11 +144,11 @@ if (is_file(GLM_MEMBERS_JOBS_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) {
 
 // Load Add-On Management Settings data
 /* None - Need to figure out a smooth way to do this.
-$glmMembersJobsManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A );
-unset($glmMembersJobsManagementSettings['id']);
+$glmMembersjobsManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A );
+unset($glmMembersjobsManagementSettings['id']);
 */
 
-function glmMembersJobsRegisterAddOn($addOns) {
+function glmMembersjobsRegisterAddOn($addOns) {
 
     // Add this add-on to the add-ons array
     $addOns[GLM_MEMBERS_JOBS_PLUGIN_SLUG] =  array(
@@ -156,21 +156,21 @@ function glmMembersJobsRegisterAddOn($addOns) {
         'name' =>  GLM_MEMBERS_JOBS_PLUGIN_NAME,
         'short_name' => GLM_MEMBERS_JOBS_PLUGIN_SHORT_NAME,
         'slug' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
-        'actions' => $GLOBALS['glmMembersJobsAddOnValidActions'],
+        'actions' => $GLOBALS['glmMembersjobsAddOnValidActions'],
         'config' => array(
         ),
-        'shortcodes' => $GLOBALS['glmMembersJobsShortcodes'],
-        'shortcodesDescription' => $GLOBALS['glmMembersJobsShortcodesDescription']
+        'shortcodes' => $GLOBALS['glmMembersjobsShortcodes'],
+        'shortcodesDescription' => $GLOBALS['glmMembersjobsShortcodesDescription']
     );
 
     // If we have database tables for this plugin/addon, provide that data also
-    if (isset($GLOBALS['glmMembersJobsDbVersions'])) {
+    if (isset($GLOBALS['glmMembersjobsDbVersions'])) {
         $addOns[GLM_MEMBERS_JOBS_PLUGIN_SLUG]['database'] = array(
             'dbPrefix' => GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX,
             'dbCurrentVersion' => GLM_MEMBERS_JOBS_PLUGIN_DB_VERSION,
             'dbActiveVersionOption' => GLM_MEMBERS_JOBS_PLUGIN_ACTIVE_DB_OPTION,
             'dbScriptPath' => GLM_MEMBERS_JOBS_PLUGIN_DB_SCRIPTS,
-            'dbVersions' => $GLOBALS['glmMembersJobsDbVersions']
+            'dbVersions' => $GLOBALS['glmMembersjobsDbVersions']
         );
     } else {
         $addOns[GLM_MEMBERS_JOBS_PLUGIN_SLUG]['database'] = false;
@@ -179,7 +179,7 @@ function glmMembersJobsRegisterAddOn($addOns) {
     // Return the array with our data added
     return $addOns;
 }
-add_filter('glm-member-db-register-addon','glmMembersJobsRegisterAddOn', 10, 1);
+add_filter('glm-member-db-register-addon','glmMembersjobsRegisterAddOn', 10, 1);
 
 /*
  * Plugin Update Support - uses Gaslight Media update server
@@ -204,23 +204,23 @@ ${GLM_MEMBERS_JOBS_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
  */
 
  // Activate
- function glmMembersJobsPluginActivate ()
+ function glmMembersjobsPluginActivate ()
  {
      global $wpdb, $config;
      require_once GLM_MEMBERS_JOBS_PLUGIN_PATH . '/activate.php';
-     new glmMembersJobsPluginActivate($wpdb, $config);
+     new glmMembersjobsPluginActivate($wpdb, $config);
  }
- register_activation_hook(__FILE__, 'glmMembersJobsPluginActivate');
+ register_activation_hook(__FILE__, 'glmMembersjobsPluginActivate');
 
  // Deactivate
- function glmMembersJobsPluginDeactivate ()
+ function glmMembersjobsPluginDeactivate ()
  {
      global $wpdb, $config;
      require_once GLM_MEMBERS_JOBS_PLUGIN_PATH . '/deactivate.php';
-     $x = new glmMembersJobsPluginDeactivate($wpdb, $config);
+     $x = new glmMembersjobsPluginDeactivate($wpdb, $config);
      return false;
  }
- register_deactivation_hook(__FILE__, 'glmMembersJobsPluginDeactivate');
+ register_deactivation_hook(__FILE__, 'glmMembersjobsPluginDeactivate');
 
 /*
  * Hooks for testing capabilities provided by this add-on
diff --git a/models/admin/jobs/index.php b/models/admin/jobs/index.php
new file mode 100644 (file)
index 0000000..d0861b6
--- /dev/null
@@ -0,0 +1,225 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * Job Postings
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  index.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_JOBS_PLUGIN_CLASS_PATH.'/data/dataJobs.php';
+
+class GlmMembersAdmin_jobs_index extends GlmDatajobs
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Report ID
+     *
+     * @var $report ID
+     * @access public
+     */
+    public $report_id = false;
+
+    /*
+     * 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 the Contacts data class
+         *
+         * Note, the third parameter is a flag that indicates to the Contacts
+         * data class that it should flag a group of fields as 'view_only'.
+         */
+        parent::__construct(false, false, true);
+
+
+    }
+
+    public function modelAction($actionData = false)
+    {
+        if( ! wp_script_is( 'jquery-ui', 'enqueued' ) ){
+            wp_enqueue_script('jquery-ui-datepicker', false, array('jquery'), false, true);
+            wp_enqueue_style('jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css');
+            wp_enqueue_script("jquery-ui-tabs");
+        }
+        $success_message = "";
+        $haveReport = false;
+        $option = false;
+        $report = false;
+        $reportUpdated     = false;
+        $reportUpdateError = false;
+        $reportAdded       = false;
+        $reportAddError    = false;
+        
+        
+        if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
+            $option = $_REQUEST['option'];
+        }
+        
+        // get the report id for use in the edit, add and delete options
+        $this->report_id = ( isset( $_REQUEST['report'] ) ? filter_var( $_REQUEST['report'], FILTER_SANITIZE_STRING) : '');
+        
+        $trail_data = $this->getList();
+        
+        switch ($option) {
+
+                 case 'add':
+
+                $report = $this->newEntry();
+                $view_file = 'edit';
+
+                break;
+
+            case 'insert':
+
+                $report = $this->insertEntry();
+//               echo '<pre>', print_r($report), '</pre>';
+                $this->report_id = $report['fieldData']['id'];
+
+                if ($report['status']) {
+                    $haveReport = true;
+                    $reportAdded = true;
+
+                    // Update created timestamp and name slug for URLs
+                    //$this->updateSlug($this->reportID);
+
+                    // Get this again so we have the created date
+                    $report = $this->editEntry($this->report_id);
+
+                    $option = 'edit';
+                    $reportAdded = true;
+
+                } else {
+                    $option = 'add';
+                    $reportAddError = true;
+                }
+
+                $view_file = 'edit';
+
+                break;
+
+            case 'edit':
+
+
+
+                $report = $this->editEntry($this->report_id);
+
+                // If we have a good report
+                if ($report['status']) {
+                    $haveReport = true;
+                }
+
+                $view_file = 'edit';
+                break;
+
+            case 'update':
+
+                // Try to update this report
+                $report = $this->updateEntry($this->report_id);
+
+                // Check if that was successful
+                if ($report['status']) {
+                    $reportUpdated = true;
+
+                    $report = $this->editEntry($this->report_id);
+                } else {
+                    $reportUpdateError = true;
+                }
+
+                $haveReport = true;
+                $view_file     = 'edit';
+
+                break;
+
+            case 'delete':
+                echo "delte";
+                $report = $this->deleteEntry($this->report_id,true);
+
+                if ($report) {
+                    $reportDeleted = true;
+                } else {
+                    $reportDeleteError = true;
+                }
+                $view_file = "index";
+                $trail_data = $this->getList();
+                break;
+            default:
+                $trail_data = $this->getList();
+                $view_file = 'index';
+                break;
+        }
+        
+        // Compile template data
+        $templateData = array(
+            'trailData'  => $trail_data,
+            'haveReport' => $haveReport,
+            'reportUpdated'     => $reportUpdated,
+            'reportUpdateError' => $reportUpdateError,
+            'reportAdded'       => $reportAdded,
+            'reportAddError'    => $reportAddError,
+            'option'     => $option,
+            'report'     => $report,
+            'assetsUrl'    => GLM_MEMBERS_JOBS_PLUGIN_URL . 'assets/',
+            
+        );
+
+        // Return status, any suggested view, and any data to controller
+        return array(
+                'status' => true,
+                'modelRedirect' => false,
+                'view' => 'admin/jobs/'.$view_file.'.html',
+                'data' => $templateData
+        );
+    }
+}
diff --git a/models/admin/jobs/list.php b/models/admin/jobs/list.php
new file mode 100644 (file)
index 0000000..3ac00fa
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+/* 
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
diff --git a/models/front/jobs/list.php b/models/front/jobs/list.php
new file mode 100644 (file)
index 0000000..f112256
--- /dev/null
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * Job Postings
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  index.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_JOBS_PLUGIN_CLASS_PATH.'/data/dataJobs.php';
+
+class GlmMembersFront_jobs_list extends GlmDatajobs
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Contact Info
+     *
+     * @var $contactInfo
+     * @access public
+     */
+    public $contactInfo = false;
+    /**
+     * Member ID
+     *
+     * @var $memberID
+     * @access public
+     */
+    public $memberID = false;
+    /**
+     * Contact ID
+     *
+     * @var $contactID
+     * @access public
+     */
+    public $contactID = false;
+
+
+    /*
+     * 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 the Contacts data class
+         *
+         * Note, the third parameter is a flag that indicates to the Contacts
+         * data class that it should flag a group of fields as 'view_only'.
+         */
+        parent::__construct(false, false, true);
+
+
+    }
+
+    public function modelAction($actionData = false)
+    {
+        $success_message = "";
+        $option = false;
+        if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
+            $option = $_REQUEST['option'];
+        }
+
+        // separate the main report info and the individual details 
+        $trail_data = $this->getList();
+        foreach($trail_data as $id=>$record){
+            foreach($record as $key=>$value){
+                if(strpos($key, "report") !== false){
+                    $JOBS['trail_report'][$id]['report_info'][$key] = $value; 
+                } else {
+                    $JOBS['trail_report'][$id]['trail_info'][$key] = $value; 
+                }
+            }
+        }
+//        echo '<pre>', print_r($JOBS), '</pre>';
+        $view_file = 'list';
+        switch ($option) {
+
+            case "edit":
+                $view_file = 'edit';
+
+                break;
+            
+            default:
+        
+                break;
+        }
+        
+
+        
+        // Compile template data
+        $templateData = array(
+            'trailData'    => $JOBS
+        );
+
+        // Return status, any suggested view, and any data to controller
+        return array(
+                'status' => true,
+                'modelRedirect' => false,
+                'view' => 'front/jobs/'.$view_file.'.html',
+                'data' => $templateData
+        );
+
+    }
+
+}
index 08b2ad7..025d011 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * GLM Members Misc Admin Hooks and Filters
  *
  * PHP version 5.5
  *
  *  Also note that parameters will be in the context of the main admin controller constructor.
   */
+
+// Add content to member detail page
+add_filter('glm-member-db-admin-management-hooksHelp', function($content) {
+
+        // Read in this plugin/addon hook help file
+        $fname = GLM_MEMBERS_JOBS_PLUGIN_PATH.'/setup/hooksHelp.html';
+        if (is_file($fname)) {
+            $hooksHelp = file_get_contents($fname);
+            if ($hooksHelp != false) {
+                $content .= $hooksHelp;
+            }
+        }
+        return $content;
+    },
+    10,
+    2
+);
index bf62c56..fb5cee9 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- * GLM Members Job Listings
- * GLM Members DB - jobs - Admin Menus
+ * GLM Members Database Job Postings
+ * GLM Members DB - Job Postings - Admin Menus
  *
  * PHP version 5.5
  *
  * is named the same as the "glm_action" parameter.
  *
  */
-
+add_submenu_page(
+    'glm-members-admin-menu-members',
+    'Job Postings',
+    'Job Postings',
+    'edit_posts',
+    'glm-members-admin-menu-jobs-index',
+    function(){$this->controller('jobs');}
+);
index 5a07565..0d6de9b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- * GLM Members Job Listings
- * GLM Members DB - jobs - Admin Tabs
+ * GLM Members Database Job Postings
+ * GLM Members DB - Job Postings - Admin Tabs
  *
  * PHP version 5.5
  *
diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql
new file mode 100644 (file)
index 0000000..b5f9b39
--- /dev/null
@@ -0,0 +1,52 @@
+-- Gaslight Media Members Database - Job Postings
+-- File Created: 12/02/15 15:27:15
+-- Database Version: 0.0.2
+-- Database Creation Script
+--
+-- This file is called to create a new set of tables for this
+-- add-on for the most receint 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
+
+-- Conditions Table
+CREATE TABLE {prefix}reports (
+  id INT NOT NULL AUTO_INCREMENT,
+  report_active BOOL NOT NULL,
+  report_date DATE NOT NULL,
+  report_notes TEXT NOT NULL, 
+  big_bay_name TEXT NOT NULL, 
+  big_bay_cond TEXT NOT NULL, 
+  big_bay_groom DATE NOT NULL, 
+  big_bay_base TINYTEXT NOT NULL, 
+  big_bay_notes TEXT NOT NULL, 
+  alston_cond TEXT NOT NULL, 
+  alston_name TEXT NOT NULL, 
+  alston_groom DATE NOT NULL, 
+  alston_base TINYTEXT NOT NULL, 
+  alston_notes TEXT NOT NULL, 
+  nestoria_name TEXT NOT NULL, 
+  nestoria_cond TEXT NOT NULL, 
+  nestoria_groom DATE NOT NULL, 
+  nestoria_base TINYTEXT NOT NULL,
+  nestoria_notes TEXT NOT NULL, 
+  chassell_name TEXT NOT NULL, 
+  chassell_cond TEXT NOT NULL,  
+  chassell_groom DATE NOT NULL,  
+  chassell_base TINYTEXT NOT NULL, 
+  chassell_notes TEXT NOT NULL,  
+  pinery_name TEXT NOT NULL, 
+  pinery_groom DATE NOT NULL,  
+  pinery_base TINYTEXT NOT NULL, 
+  pinery_notes TEXT NOT NULL,
+  report_blurb TEXT NOT NULL, 
+  PRIMARY KEY (id)
+);
+
+----
+
+-- Job Postings default entries in table
+INSERT INTO {prefix}reports ( id,report_date,report_notes,big_bay_name,big_bay_cond,big_bay_groom,big_bay_base,big_bay_notes,alston_name,alston_cond,alston_groom,alston_base,alston_notes,nestoria_name,nestoria_cond,nestoria_groom,nestoria_base,nestoria_notes,chassell_name,chassell_cond,chassell_groom,chassell_base,chassell_notes,pinery_name,pinery_groom,pinery_base,pinery_notes,report_blurb) VALUES
+(1,NOW(),'Trail Notes','Big Bay Trail','Fair',NOW(),'8"-12"','Notes','Alston Trail','Fair',NOW(),'8"-12"','Notes','Nestoria Trail','Fair',NOW(),'8"-12"','Notes','Chassell Trail','Fair',NOW(),'8"-12"','Notes','Pinery Trail',NOW(),'8"-12"','Notes','Grooming');
\ No newline at end of file
diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php
new file mode 100644 (file)
index 0000000..2fbb0bf
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members Job Postings DB Versions
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  dbVersions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+
+/**********************************************************************
+ *  NOTE: THIS IS A Job Postings FILE - DO NOT USE UNMODIFIED
+ *
+ *  Please change all references to conditions, Conditions, or CONDITIONS to a name
+ *  appropriate for your new Add-On.
+ *
+ *  This file lists all versions of the database tables for this add-on.
+ *  The last entry in the array below should be for the most recent
+ *  version and should match the "create_database_V..." file in this
+ *  directory.
+ *
+ *  NOTE: When first creating a new add-on with database tables, there
+ *  should only be one line in the array below and there should be no
+ *  "update_database..." files in this directory.
+ *
+ *  Remove this message before using this file in production!
+ **********************************************************************/
+
+
+$glmMembersjobsDbVersions = array(
+    '0.0.1' => array('version' => '0.0.1', 'tables' => 1, 'date' => '09/08/2017'),
+);
diff --git a/setup/databaseScripts/drop_database_V0.0.1.sql b/setup/databaseScripts/drop_database_V0.0.1.sql
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/setup/databaseScripts/update_database_V0.0.1.sql b/setup/databaseScripts/update_database_V0.0.1.sql
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
index c54ed55..6272ebd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * Misc Hooks and Filters
  *
  * PHP version 5.5
index d0eaf09..5a8bd2a 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * Roles & Capabilities
  *
  * PHP version 5.5
  *
  * @category glmWordPressPlugin
- * @package  glmMembersJobs
+ * @package  glmMembersjobs
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
  * @release  rolesAndPermissions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
index dfe0e8b..706f5a7 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * Short Codes
  *
  * PHP version 5.5
  *
  * @category glmWordPressPlugin
- * @package  glmMembersJobs
+ * @package  glmMembersjobs
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
  * @release  shortcodes.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
  * The following is an explanation of this array.
  *
  * array(
- *      '{shortcode-slug} => array(
+ *      '{shortcode-slug}' => array(
  *          'plugin' => '{plugin (add-on) slug}',       // Identifies which plugin is providing the short-code
  *          'menu' => '{menu name}',                    // Menu name in this context is simply where to find the action
- *          'action' => '{shortcode action name}      // Action used to execute this shortcode
+ *          'action' => '{shortcode action name}',      // Action used to execute this shortcode
  *          'table' => '{table prefix}{table name}',    // Database table where default attribute values are stored
  *          'attributes' => array(                      // An array of all shortcode attributes (options)
  *              '{attr name}' => '{field name}',        // Available attribute names and the database field names with the default value
@@ -62,6 +62,7 @@
  *
  * Shortcode descriptions sample
  *
+ *      <tr><th>Shortcode</th><th>Attribute</th><th>Description</th></tr>
  *      <tr>
  *           <th>[glm-members-sample-shortcode]</th>
  *           <td>&nbsp;</td>
  *       </tr>
  */
 
-$glmMembersJobsShortcodes = array(
+$glmMembersjobsShortcodes = array(
+    'glm-jobs' => array(
+        'plugin'     => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
+        'menu'       => 'jobs',
+        'action'     => 'list',
+        'table'      => false,
+        'attributes' => array(
+            'id'         => true,
+            'member_only' => true
+        )
+    ),
 );
 
-$glmMembersJobsShortcodesDescription = '';
+$glmMembersjobsShortcodesDescription = '';
 
index 4e19b6f..fba7242 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 /**
- * GLM Members Job Listings
+ * GLM Members Database Jobs
  * Valid Actions
  *
  * PHP version 5.5
  *
  * @category glmWordPressPlugin
- * @package  glmMembersJobs
+ * @package  glmMembersjobs
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
  * @release  admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
@@ -31,7 +31,7 @@
  *
  * EXAMPLE
  *
- * $glmMembersJobsAddOnValidActions = array(
+ * $glmMembersjobsAddOnValidActions = array(
  *     'adminActions' => array(
  *         'members' => array(
  *             'sample' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
  *
  */
 
-$glmMembersJobsAddOnValidActions = array(
+$glmMembersjobsAddOnValidActions = array(
     'adminActions' => array(
+        'jobs' => array( 
+            'index' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
+            'list'  => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
+        ),
     ),
     'frontActions' => array(
+        'jobs' => array( 
+            'list' => GLM_MEMBERS_JOBS_PLUGIN_SLUG
+        ),
     )
 );
 
index 9424fba..c8f5528 100644 (file)
@@ -3,13 +3,13 @@
 die('uninstall not configured - See plugin uninstall.php script!');
 
 /**
- * GLM Members Job Listings
+ * GLM Members Database Job Postings
  * Uninstall Plugin
  *
  * PHP version 5.5
  *
  * @category glmWordPressPlugin
- * @package  glmMembersJobs
+ * @package  glmMembersjobs
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
  * @release  admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
diff --git a/views/admin/header.html b/views/admin/header.html
new file mode 100644 (file)
index 0000000..4318c03
--- /dev/null
@@ -0,0 +1,8 @@
+<div class="wrap">
+    <h2>Job Postings</h2>
+    <h2 class="nav-tab-wrapper">
+        <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index} nav-tab-active{/if}">Dashboard</a>
+    </h2>
+    <div id="glm-admin-content-container">
+
+
diff --git a/views/admin/jobs/edit.html b/views/admin/jobs/edit.html
new file mode 100644 (file)
index 0000000..4795973
--- /dev/null
@@ -0,0 +1,149 @@
+{include file='admin/header.html'}
+
+{if ($option == 'add' || $haveReport)}
+
+    <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="button button-secondary glm-button glm-right">Return to Reports List</a>
+
+  {if $option == 'edit' || $option == 'update'}
+    <a id="deleteReportButton" class="button button-secondary glm-button glm-right">Delete this Report</a>
+    <h2>Edit Job Postings
+  {else}
+    <h2>Add New Job Postings
+  {/if}
+        &nbsp;&nbsp;&nbsp;
+        {if $reportUpdated}<span class="glm-notice glm-flash-updated">Obit Updated</span>{/if}
+        {if $reportUpdateError}<span class="glm-error glm-flash-updated">Obit Update Error</span>{/if}
+        {if $reportAdded}<span class="glm-notice glm-flash-updated">Obit Added</span>{/if}
+        {if $reportAddError}<span class="glm-error glm-flash-updated">Obit Add Error</span>{/if}
+    </h2>
+
+  {if $reportUpdateError || $reportAddError}
+    <h1 class="glm-error">NOTICE: Your report has not yet been submitted.<br>Please select the tabs indicating a problem, correct the indicated fields and resubmit.</h1>
+  {else}
+  {/if}
+
+    <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="index">
+
+    {if $haveReport}
+        <input type="hidden" name="option" value="update">
+        <input type="hidden" name="report" value="{$report.fieldData.id}">
+    {else}
+        <input type="hidden" name="option" value="insert">
+    {/if}
+
+       <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+            <a id="glm-report-descr" data-show-table="glm-table-descr" class="glm-report-tab nav-tab nav-tab-active">Job Postings</a>
+        </h2>
+
+        <table id="glm-table-descr" class="glm-admin-table glm-report-table">
+            <tr>
+                <th {if $report.fieldRequired.report_active}class="glm-required"{/if}>Report Active:</th>
+                <td {if $report.fieldFail.report_active}class="glm-form-bad-input" data-tabid="glm-report-descr"{/if}>
+                    <input type="checkbox" name="report_active" class="" {if $report.fieldData.report_active.value == 1} checked="checked" {/if}>
+                    {if $report.fieldFail.report_active}<p>{$report.fieldFail.report_active}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $report.fieldRequired.report_date}class="glm-required"{/if}>Report Date:</th>
+                <td {if $report.fieldFail.report_date}class="glm-form-bad-input" data-tabid="glm-report-descr"{/if}>
+                    <input type="text" name="report_date" value="{$report.fieldData.report_date.date}" class="glm-form-text-input-short groom-date">
+                    {if $report.fieldFail.report_date.date}<p>{$report.fieldFail.report_date.date}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $report.fieldRequired.report_blurb}class="glm-required"{/if}>Report Blurb:</th>
+                <td {if $report.fieldFail.report_blurb}class="glm-form-bad-input" data-tabid="glm-report-descr"{/if}>
+                    <input type="text" name="report_blurb" value="{$report.fieldData.report_blurb}" class="glm-form-text-input-short">
+                    {if $report.fieldFail.report_blurb}<p>{$report.fieldFail.report_blurb}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $report.fieldRequired.report_notes}class="glm-required"{/if}>Report Notes:</th>
+                <td {if $report.fieldFail.report_notes}class="glm-form-bad-input" data-tabid="glm-report-descr"{/if}>
+                    <textarea name="report_notes" class="glm-form-text-input-medium trail-notes"> {$report.fieldData.report_notes}</textarea>
+                    {if $report.fieldFail.report_notes}<p>{$report.fieldFail.report_notes}</p>{/if}<br>
+                </td>
+            </tr>
+        </table>
+        <div id="report-tabs">
+            <ul>
+                <li><a href="#tabs-1">Big Bay Trail</a></li>
+                <li><a href="#tabs-2">Alston Trail</a></li>
+                <li><a href="#tabs-3">Nestoria Trail</a></li>
+                <li><a href="#tabs-4">Chassell Trail</a></li>
+                <li><a href="#tabs-5">Pinery lakes CC Ski Trail</a></li>
+            </ul>
+                {include file='admin/jobs/parts/bigBay.html'}
+                {include file='admin/jobs/parts/alston.html'}
+                {include file='admin/jobs/parts/nestoria.html'}
+                {include file='admin/jobs/parts/chassell.html'}
+                {include file='admin/jobs/parts/pinery.html'}  
+        </div>
+        <input id="updateReport" type="submit" value="{if $haveReport}Update Report{else}Save New Report{/if}">
+    </form>
+
+{else} <!-- Can just display -->
+
+    <h3>Sorry, no report found or permission not granted.</h3>
+
+{/if}
+
+    <!-- Delete Obit Dialog Box -->
+
+    <div id="deleteReportDialog" class="glm-dialog-box" title="Delete Obit">
+        <center>
+            <p><a id="deleteReportCancel" class="button button-primary">Cancel</a></p>
+            <p><input id="deleteReportSubmit" type="submit" value="Delete this report"></p>
+        </center>
+        <div class="glm-item-container">
+            <p><center><span class="glm-error">WARNING:</span></center></p>
+            <p>
+                <span class="glm-warning">Clicking the "Delete this Obit" button above will
+                delete all of the data and images associated with this report.
+                </span>
+            </p>
+            <p>
+                <span class="glm-error">
+                    Once deleted, this information will no longer be available and cannot be retrieved!
+                    If you are unsure that you want to completely remove this data, consider changing the status
+                    of this report to "Archived" instead.
+                </span>
+            </p>
+        </div>
+    </div>
+    <script type="text/javascript">
+        jQuery(document).ready(function($) {
+            $("#report-tabs").fadeTo("600", 1);
+            $('#report-tabs').tabs();
+            $('.groom-date').datepicker({
+                showOn: "both",
+                buttonImage: '{$assetsUrl}' + "/calIcon.png",
+                buttonImageOnly: true
+            });
+        {if $haveReport}
+            // Delete Report dialog
+            $("#deleteReportDialog").dialog({
+                autoOpen: false,
+                minWidth: 400,
+                dialogClass: "glm-dialog-no-close"
+            });
+            $('#deleteReportButton').click( function() {
+                $('#deleteReportDialog').dialog('open');
+            });
+            $('#deleteReportCancel').click( function() {
+                $("#deleteReportDialog").dialog("close");
+            });
+            $('#deleteReportSubmit').click( function() {
+                window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&report={$report.fieldData.id}");
+            });
+    {/if}
+            
+            // 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);
+
+        });
+    </script>
+
+
+{include file='admin/footer.html'}
diff --git a/views/admin/jobs/index.html b/views/admin/jobs/index.html
new file mode 100644 (file)
index 0000000..a82dad3
--- /dev/null
@@ -0,0 +1,38 @@
+{include file='admin/header.html'}
+
+    <table class="glm-admin-table">
+
+        <tr><td colspan="2">&nbsp;</td></tr>
+        <tr>
+            <td class="add-report"><a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=add">New Report</a></td>
+        </tr>
+
+    </table>
+    {if $trailData}
+        
+            <table class="glm-admin-table">
+                <tr>
+                    <th>Report Date</th>
+                    <th>Report Blurb</th>
+                    <th>Report Notes</th>
+                </tr>
+            {foreach $trailData as $record=>$data}
+                <tr>
+                    <td>{$data.report_date.date}</td>
+                    <td>{$data.report_blurb}</td>
+                    <td>{$data.report_notes}</td>
+                    <td><a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&report={$data.id}">Edit</a><a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&report={$data.id}">Delete</a></td>
+                </tr>
+            {/foreach}
+            </table>
+        
+        <script>
+            jQuery(document).ready(function($) {
+                console.log("test");
+            });
+        </script>
+    {else if}
+        <div class="no-trail-data"> No Trail Information </div>
+    {/if}
+{include file='admin/footer.html'}
+
diff --git a/views/front/jobs/list.html b/views/front/jobs/list.html
new file mode 100644 (file)
index 0000000..c14262f
--- /dev/null
@@ -0,0 +1,16 @@
+{foreach $trailData as $key=>$value}
+    {foreach $value as $id=>$trail}
+        <div id='trail-report-{$id}' class="trail-report">
+            <div class='trail-info'>
+                <span class='report-date'> Report Date: {$trail.report_info.report_date.date|date_format:"%B %e, %Y"}
+            </div>
+            <div class="trail-info">
+                {include file='front/jobs/parts/bigBay.html'}
+                {include file='front/jobs/parts/alston.html'}
+                {include file='front/jobs/parts/nestoria.html'}
+                {include file='front/jobs/parts/chassell.html'}
+                {include file='front/jobs/parts/pinery.html'}  
+            </div>
+        </div>
+    {/foreach}
+{/foreach}
\ No newline at end of file