more test code and dummy data to work with, setting up the settings menu so the client can
add job titles for the job posting views
'use' => 'a'
),
'job_title' => array (
- 'field' => 'title',
+ 'field' => 'job_title',
'type' => 'text',
'use' => 'a'
),
'type' => 'text',
'use' => 'a'
),
- 'location' => array (
- 'field' => 'location',
+ 'email_location' => array (
+ 'field' => 'email_location',
'type' => 'text',
'use' => 'a'
),
),
'visible' => array (
'field' => 'visible',
- 'type' => 'boolean',
+ 'type' => 'checkbox',
'use' => 'a'
),
'facility_operation' => array (
),
'job_location' => array (
'field' => 'job_location',
- 'type' => 'tex',
+ 'type' => 'text',
'use' => 'a'
),
'job_expiration' => array (
'field' => 'job_expiration',
'type' => 'list',
- 'list' => $this->config['job_expiration'],
- 'default' => '30 Days',
- 'force_list' => true,
+ 'list' => $this->config['job_expiration'],
+ 'default' => '30 Days',
+ 'force_list' => true,
'use' => 'a'
),
'duration' => array (
-#Job-tabs{
- opacity: 0;
- max-width: 725px;
-}
-.job-notes{
- height: 100px;
-}
-.condition-label,.job-label{
- margin-bottom: 5px;
-}
-.ui-datepicker-trigger{
- margin-left: 5px;
- position: absolute;
-}
-.ui-tabs-panel .groom-date,.ui-tabs-panel .snow-base,.job-conditions{
- margin-bottom: 20px;
-}
-.job-name{
- margin-bottom: 20px;
-
-}
+#glm-admin-content-container .admin-job-label,
+#glm-admin-content-container .admin-job-input{
+ padding: 0;
+}
\ No newline at end of file
* 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 = "";
$haveJob = false;
$jobAdded = false;
$jobAddError = false;
-
if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
$option = $_REQUEST['option'];
}
$this->job_id = ( isset( $_REQUEST['job'] ) ? filter_var( $_REQUEST['job'], FILTER_SANITIZE_STRING) : '');
$job_data = $this->getList();
- echo '<pre>', print_r($_REQUEST), '</pre>';
+ echo '<pre>', print_r($this->getList()), '</pre>';
+ // echo '<pre>', print_r($_REQUEST), '</pre>';
switch ($option) {
case 'insert':
$job = $this->insertEntry();
-// echo '<pre>', print_r($job), '</pre>';
$this->job_id = $job['fieldData']['id'];
if ($job['status']) {
break;
case 'delete':
- echo "delte";
$job = $this->deleteEntry($this->job_id,true);
if ($job) {
--- /dev/null
+
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Obits Dashboard
+ *
+ * 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 Obits data abstract
+require_once GLM_MEMBERS_JOBS_PLUGIN_CLASS_PATH.'/data/dataJobTitles.php';
+
+class GlmMembersAdmin_settings_jobTitles extends GlmDataJobTitles
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Obit ID
+ *
+ * @var $obitID
+ * @access public
+ */
+ public $obitID = 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 Obits 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)
+ {
+
+ $numbObits = 0;
+ $namesList = false;
+
+ // Check if an ID is supplied
+ $id = 0;
+ if ( isset( $_REQUEST['id'] ) ) {
+ $id = $_REQUEST['id'] - 0;
+ }
+ // 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 );
+ }
+ echo "no id";
+ break;
+
+ case 'delete':
+ if ( $id > 0 ) {
+ $this->deleteEntry( $id, true );
+ }
+ break;
+
+ default:
+ $option2 = false;
+ break;
+
+ }
+ }
+
+ // Get number of obits
+
+ $jobTitles = $this->getList();
+
+ // Compile template data
+ $templateData = array(
+ 'jobTitles' => $jobTitles,
+ );
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/settings/jobTitles.html',
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
foreach($job_data as $id=>$record){
foreach($record as $key=>$value){
if(strpos($key, "Job") !== false){
- $JOBS['trail_Job'][$id]['job_info'][$key] = $value;
+ $jobs['trail_Job'][$id]['job_info'][$key] = $value;
} else {
- $JOBS['trail_Job'][$id]['trail_info'][$key] = $value;
+ $jobs['trail_Job'][$id]['trail_info'][$key] = $value;
}
}
}
-// echo '<pre>', print_r($JOBS), '</pre>';
+// echo '<pre>', print_r($jobs), '</pre>';
$view_file = 'list';
switch ($option) {
// Compile template data
$templateData = array(
- 'jobData' => $JOBS
+ 'jobData' => $jobs
);
// Return status, any suggested view, and any data to controller
* );
*
*/
+if (current_user_can('glm_members_members')) {
+ if (apply_filters('glm_members_permit_admin_members_jobTitles_tab', true)) {
+ add_filter('glm-member-db-add-tab-for-settings',
+ function($addOnTabs) {
+ $newTabs = array(
+ array(
+ 'text' => 'Job Titles',
+ 'menu' => 'settings',
+ 'action' => 'jobTitles'
+ ),
+ );
+ $addOnTabs = array_merge($addOnTabs, $newTabs);
+ return $addOnTabs;
+ }
+ );
+
+ }
+}
-- Conditions Table
CREATE TABLE {prefix}jobs (
id INT NOT NULL AUTO_INCREMENT,
- title TINYTEXT NULL DEFAULT '',
- descr TEXT NULL DEFAULT '',
- salary TINYTEXT NULL DEFAULT '',
- location TINYTEXT NULL DEFAULT '',
- contactname TINYTEXT NULL DEFAULT '',
- contactphone TINYTEXT NULL DEFAULT '',
+ title TINYTEXT NULL ,
+ descr TEXT NULL ,
+ salary TINYTEXT NULL ,
+ email_location TINYTEXT NULL ,
+ contactname TINYTEXT NULL ,
+ contactphone TINYTEXT NULL ,
post_date DATETIME NULL DEFAULT NOW(),
visible BOOL NULL,
- facility_operation TEXT NULL DEFAULT '',
- requirements TEXT NULL DEFAULT '',
- benefits TEXT NULL DEFAULT '',
- job_location TINYTEXT NULL DEFAULT '',
+ facility_operation TEXT NULL,
+ requirements TEXT NULL,
+ benefits TEXT NULL ,
+ job_location TINYTEXT NULL ,
job_expiration TINYTEXT NULL,
- duration TINYTEXT NULL DEFAULT '',
- deadline TINYTEXT NULL DEFAULT '',
- course_operation TINYTEXT NULL DEFAULT '',
- position_available TINYTEXT NULL DEFAULT '',
+ duration TINYTEXT NULL ,
+ deadline TINYTEXT NULL ,
+ course_operation TINYTEXT NULL ,
+ position_available TINYTEXT NULL ,
member INT NULL,
PRIMARY KEY (id)
);
-- Job Titles
CREATE TABLE {prefix}job_titles (
id INT NOT NULL AUTO_INCREMENT,
- job_title TINYTEXT NULL DEFAULT '',
+ job_title TINYTEXT NULL ,
PRIMARY KEY (id)
+);
+
+----
+
+-- Job Titles default entries in table
+INSERT INTO {prefix}job_titles ( id,job_title) VALUES
+(1, 'Supervisor'),(2,'Groundskeeper'),(3,'Janitor');
+
+----
+
+-- Job Titles default entries in table
+INSERT INTO {prefix}jobs (
+id,title,descr,salary, email_location,contactname,contactphone,post_date,visible,
+facility_operation,requirements,job_location,job_expiration,duration,deadline,position_available,
+course_operation,member
+) VALUES ( 1, 'TITLE',"DESCRIPTION",'SALARY', 'EMAIL LOCATION', 'CONTACT NAME', '453-3443', NOW(), false,
+'facility operations', 'REQUIREMENTS', 'JOB LOCATION', 'JOB EXPIRATION', 'JOB DURATION', 'DEADLINE', 'POSITION AVAILABLE',
+'COURSE OPERATION', 1
);
\ No newline at end of file
'list' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
),
),
+ 'settings' => array(
+ 'jobTitles' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
+ ),
'frontActions' => array(
'jobs' => array(
'list' => GLM_MEMBERS_JOBS_PLUGIN_SLUG
<h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
<a id="glm-Job-descr" data-show-table="glm-table-descr" class="glm-Job-tab nav-tab nav-tab-active">Job Postings</a>
</h2>
-
- <table id="glm-table-descr" class="glm-admin-table glm-Job-table">
-
- </table>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+ Job Title
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="title">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="position_available">
+ </div>
+ </div>
+ <div class="glm-job-row glm-row">
+ <div class="glm-small-12 glm-medium-4 glm-columns admin-job-label">
+
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
+ <input type="text" name="member">
+ </div>
+ </div>
<input id="updateJob" type="submit" value="{if $haveJob}Update Job{else}Save New Job{/if}">
</form>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
- $("#Job-tabs").fadeTo("600", 1);
- $('#Job-tabs').tabs();
- $('.groom-date').datepicker({
- showOn: "both",
- buttonImage: '{$assetsUrl}' + "/calIcon.png",
- buttonImageOnly: true
- });
+
{if $haveJob}
// Delete Job dialog
$("#deleteJobDialog").dialog({
</tr>
</table>
+ {$jobData}
{if $jobData}
-
+ yes there is
<table class="glm-admin-table">
<tr>
- <th>Job Date</th>
- <th>Job Blurb</th>
- <th>Job Notes</th>
+
</tr>
- {foreach $jobData as $record=>$data}
+ {foreach $jobData as $job=>$data}
<tr>
- <td>{$data.job_date.date}</td>
- <td>{$data.job_blurb}</td>
- <td>{$data.job_notes}</td>
<td><a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&Job={$data.id}">Edit</a><a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&Job={$data.id}">Delete</a></td>
</tr>
{/foreach}
--- /dev/null
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html>
+ <head>
+ <title>TODO supply a title</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ </head>
+ <body>
+ <div>TODO write content</div>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html>
+ <head>
+ <title>TODO supply a title</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ </head>
+ <body>
+ <div>TODO write content</div>
+ </body>
+</html>
{foreach $value as $id=>$job}
<div id='job-Job-{$id}' class="job-Job">
<div class='job-info'>
- <span class='Job-date'> Job Date: {$job.job_info.job_date.date|date_format:"%B %e, %Y"}
+ <!-- <span class='Job-date'> Job Date: {$job.job_info.job_date.date|date_format:"%B %e, %Y"} -->
</div>
<div class="job-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'}
+ jobs
</div>
</div>
{/foreach}