--- /dev/null
+node_modules
{
return $r;
}
+ /**
+ * Add a job title to the job title table.
+ *
+ * This function is provided so cities may be added by other code instead of as a user submission.
+ *
+ * @param string $jobTitle Name Name of the job title to add
+ *
+ * @return integer ID of the job title just added, the id of an existing record matching the job title name, or false
+ *
+ * @access public
+ */
-}
+ public function addJobTitles($jobTitleName) {
+
+ // Check that we have a good name
+ $jName = trim($jobTitleName);
+ if ($jName == '') {
+ return false;
+ }
+
+ // Check if the job title name already exists
+ $sql = "
+ SELECT id
+ FROM ".GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX."job_titles
+ WHERE job_title = '$jName'
+ ;";
+ $jFound = $this->wpdb->get_row($sql, ARRAY_A);
+
+ // If it already exists, then just retun the id for the existing entry.
+ if (count($jFound) > 0) {
+ return $jFound['id'];
+ }
+
+ // Try to add the job title name
+ $sql = "
+ INSERT INTO ".GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX."job_titles
+ ( job_title )
+ VALUES
+ ( '$jName' )
+ ;";
+ $this->wpdb->query($sql);
+ $id = $this->wpdb->insert_id;
+ // Return the new job title id or false if the query failed
+ return $id;
+ }
+}
?>
\ No newline at end of file
-#glm-admin-content-container .admin-job-label,
-#glm-admin-content-container .admin-job-input,
-#glm-admin-content-container .admin-job-list{
- padding: 0;
-}
-.jobTitle-record{
- float: left;
-}
-.admin-job-input textarea{
-
-}
-.admin-new-job{
- margin-bottom: 15px;
-}
-.admin-new-job .admin-new-job-link{
- padding: 5px;
- background: #3D84D0;
- color: white;
- text-decoration: none;
- border-radius: 4px;
-}
-.no-padding{
- padding: 0;
-}
-.no-margin{
- margin: 0;
-}
-#glm-admin-content-container .admin-job-list-header{
- margin-bottom: 20px;
- padding-bottom: 2px;
- border-bottom: 1px solid lightgray;
-}
-.admin-job-list-row{
- padding-bottom: 5px;
-/* border-bottom: 1px solid lightgray;*/
-}
-.job-company-list-header,.job-date-list-header, .job-title-list-header{
- font-weight: bold;
- font-size: 16px;
-}
-.admin-job-list-row:nth-child(odd){
- background: #e3e3e5;
-}
\ No newline at end of file
+#glm-admin-content-container .admin-job-label,#glm-admin-content-container .admin-job-input,#glm-admin-content-container .admin-job-list{padding:0}.jobTitle-record{float:left}.admin-new-job{margin-bottom:15px}.admin-new-job .admin-new-job-link{padding:5px;background:#3D84D0;color:white;text-decoration:none;border-radius:4px}.no-padding{padding:0}.no-margin{margin:0}#glm-admin-content-container .admin-job-list-header{margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid lightgray}.admin-job-list-row{padding-bottom:5px}.job-company-list-header,.job-date-list-header,.job-title-list-header{font-weight:bold;font-size:16px}.admin-job-list-row:nth-child(odd){background:#e3e3e5}
+
+/*# sourceMappingURL=admin.css.map */
--- /dev/null
+{"version":3,"file":"admin.css","sources":["admin.scss"],"sourcesContent":["#glm-admin-content-container .admin-job-label,\n#glm-admin-content-container .admin-job-input,\n#glm-admin-content-container .admin-job-list{\n padding: 0;\n}\n.jobTitle-record{\n float: left;\n}\n.admin-job-input textarea{\n \n}\n.admin-new-job{\n margin-bottom: 15px;\n}\n.admin-new-job .admin-new-job-link{\n padding: 5px;\n background: #3D84D0;\n color: white;\n text-decoration: none;\n border-radius: 4px;\n}\n.no-padding{\n padding: 0;\n}\n.no-margin{\n margin: 0;\n}\n#glm-admin-content-container .admin-job-list-header{\n margin-bottom: 20px;\n padding-bottom: 2px;\n border-bottom: 1px solid lightgray;\n}\n.admin-job-list-row{\n padding-bottom: 5px;\n/* border-bottom: 1px solid lightgray;*/\n}\n.job-company-list-header,.job-date-list-header, .job-title-list-header{\n font-weight: bold;\n font-size: 16px;\n}\n.admin-job-list-row:nth-child(odd){\n background: #e3e3e5;\n}\n"],"names":[],"mappings":"AAAA,AAA6B,4BAAD,CAAC,gBAAgB,CAC7C,AAA6B,4BAAD,CAAC,gBAAgB,CAC7C,AAA6B,4BAAD,CAAC,eAAe,AAAA,CACxC,OAAO,CAAE,CAAC,CACb,AACD,AAAA,gBAAgB,AAAA,CACZ,KAAK,CAAE,IAAI,CACd,AAID,AAAA,cAAc,AAAA,CACV,aAAa,CAAE,IAAI,CACtB,AACD,AAAe,cAAD,CAAC,mBAAmB,AAAA,CAC9B,OAAO,CAAE,GAAG,CACZ,UAAU,CAAE,OAAO,CACnB,KAAK,CAAE,KAAK,CACZ,eAAe,CAAE,IAAI,CACrB,aAAa,CAAE,GAAG,CACrB,AACD,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AACD,AAAA,UAAU,AAAA,CACN,MAAM,CAAE,CAAC,CACZ,AACD,AAA6B,4BAAD,CAAC,sBAAsB,AAAA,CAC/C,aAAa,CAAE,IAAI,CACnB,cAAc,CAAE,GAAG,CACnB,aAAa,CAAE,mBAAmB,CACrC,AACD,AAAA,mBAAmB,AAAA,CACf,cAAc,CAAE,GAAG,CAEtB,AACD,AAAA,wBAAwB,CAAC,AAAA,qBAAqB,CAAE,AAAA,sBAAsB,AAAA,CAClE,WAAW,CAAE,IAAI,CACjB,SAAS,CAAE,IAAI,CAClB,AACD,AAAA,mBAAmB,AAAA,UAAW,CAAA,AAAA,GAAG,CAAC,CAC9B,UAAU,CAAE,OAAO,CACtB"}
\ No newline at end of file
-.no-padding{
- padding: 0;
-}
-.front-job-list-row{
- margin-bottom: 20px;
-}
\ No newline at end of file
+.no-padding{padding:0}.front-job-listings-wrapper{margin-top:20px}.front-job-listings-wrapper .front-job-list-row{margin-bottom:20px}.front-job-listings-wrapper .job-title-search #job_title_dropdown{max-width:450px}.front-job-listings-wrapper .job-title-search .job-title-button{height:39px}.front-job-listings-wrapper .job-title-list span{font-weight:bold;font-size:20px}@media screen and (max-width: 641px){.front-job-listings-wrapper .job-title-button{display:block;max-width:100px;margin:0 auto}.front-job-listings-wrapper .front-job-search{margin-bottom:20px}}@media (min-width: 639px) and (max-width: 1025px){.front-job-listings-wrapper .job-title-button{display:inline-block;margin:0 0 0 10px}}@media (min-width: 1023px){.front-job-listings-wrapper .job-title-button{display:inline-block;margin:0 0 0 10px}}
+
+/*# sourceMappingURL=front.css.map */
--- /dev/null
+{"version":3,"file":"front.css","sources":["front.scss"],"sourcesContent":[".no-padding{\n padding: 0;\n}\n\n.front-job-listings-wrapper{\n .front-job-list{\n\n }\n margin-top: 20px;\n\n .front-job-list-row{\n margin-bottom: 20px;\n }\n .job-title-search{\n #job_title_dropdown{\n max-width: 450px;\n }\n .job-title-button{\n height: 39px;\n }\n }\n .job-title-list{\n span{\n font-weight: bold;\n font-size: 20px;\n }\n }\n @media screen and (max-width: 641px){\n .job-title-button{\n display: block;\n max-width: 100px;\n margin: 0 auto;\n }\n .front-job-search{\n margin-bottom: 20px;\n }\n }\n @media (min-width: 639px) and (max-width: 1025px){\n .job-title-button{\n display: inline-block;\n margin: 0 0 0 10px;\n }\n }\n @media (min-width: 1023px){\n .job-title-button{\n display: inline-block;\n margin: 0 0 0 10px;\n } \n }\n}"],"names":[],"mappings":"AAAA,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AAED,AAAA,2BAA2B,AAAA,CAIvB,UAAU,CAAE,IAAI,CAyCnB,AA7CD,AAMI,2BANuB,CAMvB,mBAAmB,AAAA,CACf,aAAa,CAAE,IAAI,CACtB,AARL,AAUQ,2BAVmB,CASvB,iBAAiB,CACb,mBAAmB,AAAA,CACf,SAAS,CAAE,KAAK,CACnB,AAZT,AAaQ,2BAbmB,CASvB,iBAAiB,CAIb,iBAAiB,AAAA,CACb,MAAM,CAAE,IAAI,CACf,AAfT,AAkBQ,2BAlBmB,CAiBvB,eAAe,CACX,IAAI,AAAA,CACA,WAAW,CAAE,IAAI,CACjB,SAAS,CAAE,IAAI,CAClB,AAEL,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK,EAvBvC,AAwBQ,2BAxBmB,CAwBnB,iBAAiB,AAAA,CACb,OAAO,CAAE,KAAK,CACd,SAAS,CAAE,KAAK,CAChB,MAAM,CAAE,MAAM,CACjB,AA5BT,AA6BQ,2BA7BmB,CA6BnB,iBAAiB,AAAA,CACb,aAAa,CAAE,IAAI,CACtB,CAEL,MAAM,EAAE,SAAS,EAAE,KAAK,OAAO,SAAS,EAAE,MAAM,EAjCpD,AAkCQ,2BAlCmB,CAkCnB,iBAAiB,AAAA,CACb,OAAO,CAAE,YAAY,CACrB,MAAM,CAAE,UAAU,CACrB,CAEL,MAAM,EAAE,SAAS,EAAE,MAAM,EAvC7B,AAwCQ,2BAxCmB,CAwCnB,iBAAiB,AAAA,CACb,OAAO,CAAE,YAAY,CACrB,MAAM,CAAE,UAAU,CACrB"}
\ No newline at end of file
--- /dev/null
+var gulp = require('gulp');
+var rename = require('gulp-rename');
+var sass = require('gulp-sass');
+var maps = require('gulp-sourcemaps');
+
+function swallowError (error) {
+
+ // If you want details of the error in the console
+ console.log(error.toString())
+
+ this.emit('end')
+}
+
+function swallowError (error) {
+
+ // If you want details of the error in the console
+ console.log(error.toString());
+
+ this.emit('end');
+}
+
+gulp.task('sass_admin', function() {
+ return gulp.src('scss/admin.scss')
+ .pipe(maps.init())
+ .on('error', swallowError)
+ .pipe(sass({
+ outputStyle: 'compressed'
+ })).on('error', swallowError)
+ .pipe(rename('admin.css'))
+ .pipe(maps.write('.'))
+ .pipe(gulp.dest('css'));
+});
+gulp.task('sass_front', function() {
+ return gulp.src('scss/front.scss')
+ .pipe(maps.init())
+ .on('error', swallowError)
+ .pipe(sass({
+ outputStyle: 'compressed'
+ })).on('error', swallowError)
+ .pipe(rename('front.css'))
+ .pipe(maps.write('.'))
+ .pipe(gulp.dest('css'));
+ });
+
+gulp.task('watch', function () {
+ gulp.watch('scss/**/*.{scss,sass}', ['sass_admin','sass_front']);
+});
+
+gulp.task('build', ["sass_admin", "sass_front"]);
+
+gulp.task('runwatch', ["sass_admin", "sass_front"]);
+
+gulp.task('default', ["runwatch","watch"]);
\ No newline at end of file
*
* 'view'
*
- * A suggested view name that the contoller should use instead of the
+ * A suggested view name that the contoller should us
+ $this->job_id = $job['e instead of the
* default view for this model or false to indicate that the default view
* should be used.
*
$member_list = $members->getList();
$job_titles = new GlmDataJobTitles($this->wpdb,$this->config);
- $job_titles = $job_titles->getList();
+
$success_message = "";
$haveJob = false;
}
}
- $job_data = $this->getList($where);
+
// echo '<pre>', print_r($this->getList()), '</pre>';
// echo '<pre>', print_r($_REQUEST), '</pre>';
switch ($option) {
case 'add':
+ $job_titles = $job_titles->getList();
$job = $this->newEntry();
$view_file = 'edit';
-
+
+ $job_data = $this->getList($where);
break;
case 'insert':
+ $this->checkNewJobTitles();
$job = $this->insertEntry();
$this->job_id = $job['fieldData']['id'];
-
+
if ($job['status']) {
$haveJob = true;
$jobAdded = true;
// Update created timestamp and name slug for URLs
//$this->updateSlug($this->JobID);
+ $job_titles = $job_titles->getList();
// Get this again so we have the created date
$job = $this->editEntry($this->job_id);
$option = 'add';
$jobAddError = true;
}
-
+ $job_data = $this->getList($where);
$view_file = 'edit';
break;
case 'edit':
+
$job = $this->editEntry($this->job_id);
+
+ // If we're locked to a member as a contact user and the event member doesn't equal the contact member
+ if ($lockedToMember && $job['fieldData']['member']['value'] != $lockedToMember) {
+ $haveJob = false;
+ $job = false;
+ }
// If we have a good Job
if ($job['status']) {
$haveJob = true;
}
-
+ $job_titles = $job_titles->getList();
+ $job_data = $this->getList($where);
$view_file = 'edit';
break;
case 'update':
+
// Try to update this Job
$job = $this->updateEntry($this->job_id);
-
+ $this->checkNewJobTitles();
+
// Check if that was successful
if ($job['status']) {
$jobUpdated = true;
} else {
$jobUpdateError = true;
}
-
- $haveJob = true;
- $view_file = 'edit';
+ $job_titles = $job_titles->getList();
+ $job_data = $this->getList($where);
+ $haveJob = true;
+ $view_file = 'edit';
break;
$jobDeleteError = true;
}
$view_file = "index";
+ $job_titles = $job_titles->getList();
$job_data = $this->getList();
break;
default:
'data' => $templateData
);
}
+ /**
+ * Check for new Cities being submitted
+ *
+ * @return void
+ */
+ public function checkNewJobTitles()
+ {
+
+ // If we have a member ID and this was a submission with a new city (id < 0)
+ if (isset($_REQUEST['new_job_title']) && trim($_REQUEST['new_job_title']) != '') {
+
+ // Clean up job titlename
+ $jName = trim(filter_var($_REQUEST['new_job_title']));
+
+ // Try to add the job title
+ require_once GLM_MEMBERS_JOBS_PLUGIN_CLASS_PATH.'/data/dataJobTitles.php';
+ $jobTitles = new GlmDataJobTitles($this->wpdb, $this->config);
+ $jID = $jobTitles->addJobTitles($jName);
+
+ // If we got a job title id back
+ if (is_int($jID) && $jID > 0) {
+
+ // Update the job title selected for this job record
+ $sql = "
+ UPDATE ".GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX."jobs
+ SET title = $jID
+ WHERE id = ".$this->job_id."
+ ;";
+ $insert = $this->wpdb->query($sql);
+ echo $insert;
+
+ // Update submitted job title value to use the new ID
+ $_REQUEST['new_job_title'] = $jID;
+
+ }
+ }
+ }
}
+++ /dev/null
-<?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.
- */
-
--- /dev/null
+{
+ "name": "glm-member-db-jobs",
+ "version": "1.0.0",
+ "description": "=== GLM Members Job Listings === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com Tags: Gaslight Media,Plugin,jobs Requires at least: 3.0.1 Tested up to: 3.4 Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git@cvs2:WP-Plugins/glm-member-db-jobs"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "gulp": "^3.9.1",
+ "gulp-rename": "^1.2.2",
+ "gulp-sass": "^3.1.0",
+ "gulp-sourcemaps": "^2.6.1"
+ }
+}
--- /dev/null
+#glm-admin-content-container .admin-job-label,
+#glm-admin-content-container .admin-job-input,
+#glm-admin-content-container .admin-job-list{
+ padding: 0;
+}
+.jobTitle-record{
+ float: left;
+}
+.admin-job-input textarea{
+
+}
+.admin-new-job{
+ margin-bottom: 15px;
+}
+.admin-new-job .admin-new-job-link{
+ padding: 5px;
+ background: #3D84D0;
+ color: white;
+ text-decoration: none;
+ border-radius: 4px;
+}
+.no-padding{
+ padding: 0;
+}
+.no-margin{
+ margin: 0;
+}
+#glm-admin-content-container .admin-job-list-header{
+ margin-bottom: 20px;
+ padding-bottom: 2px;
+ border-bottom: 1px solid lightgray;
+}
+.admin-job-list-row{
+ padding-bottom: 5px;
+/* border-bottom: 1px solid lightgray;*/
+}
+.job-company-list-header,.job-date-list-header, .job-title-list-header{
+ font-weight: bold;
+ font-size: 16px;
+}
+.admin-job-list-row:nth-child(odd){
+ background: #e3e3e5;
+}
--- /dev/null
+.no-padding{
+ padding: 0;
+}
+
+.front-job-listings-wrapper{
+ .front-job-list{
+
+ }
+ margin-top: 20px;
+
+ .front-job-list-row{
+ margin-bottom: 20px;
+ .job-title-list{
+ span{
+ font-weight: bold;
+ font-size: 20px;
+ }
+ }
+ }
+ .job-title-search{
+ #job_title_dropdown{
+ max-width: 450px;
+ }
+ .job-title-button{
+ height: 39px;
+ }
+ }
+
+ @media screen and (max-width: 641px){
+ .job-title-button{
+ display: block;
+ max-width: 100px;
+ margin: 0 auto;
+ }
+ .front-job-search{
+ margin-bottom: 20px;
+ }
+ }
+ @media (min-width: 639px) and (max-width: 1025px){
+ .job-title-button{
+ display: inline-block;
+ margin: 0 0 0 10px;
+ }
+ }
+ @media (min-width: 1023px){
+ .job-title-button{
+ display: inline-block;
+ margin: 0 0 0 10px;
+ }
+ }
+}
\ No newline at end of file
'adminActions' => array(
'jobs' => array(
'index' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
- 'list' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
),
'settings' => array(
'jobTitles' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
<div class="glm-small-12 glm-medium-2 glm-columns admin-job-input">
<select id="job_title" data-id="title" name="title">
<option value="">Select a Job Title</option>
+ {$jobTitles|@print_r}
{foreach from=$jobTitles item=j}
{if 'fieldData'|array_key_exists:$job}
<option value="{$j.id}" {if $job.fieldData.title.name == {$j.job_title}} selected="selected"{/if}>
</select>
</div>
<div class="glm-small-12 glm-medium-8 glm-columns admin-job-input">
-<!-- <input type="text" name="title">-->
+ <label for="new_title">New Job Title</label>
+ <input id="new_job_title" type="text" name="new_job_title">
</div>
</div>
<!-- MEMBER for admins only-->
</select>
</div>
</div>
+ {else}
+ <!-- hidden MEMBER ID field here -->
+ <input type="hidden" name="member" value="{$job.fieldData.member.value}">
{/if}
+
<!-- COMPANY -->
<div class="glm-job-row glm-row">
<div class="glm-small-12 glm-medium-2 glm-columns admin-job-label">
-<div class="job-title-search glm-row">
- <form action="{$siteBaseUrl}job-postings" method="post" enctype="multipart/form-data">
- <select name="job_titles" id="job_title_dropdown">
- <option value="">Show All</option>
- {foreach $jobTitles as $jtitle=>$title}
- <option value="{$title.id}">{$title.job_title}</option>
- {/foreach}
- <input type="submit" value="Show">
- </select>
- </form>
-</div>
-{if $jobData}
- {foreach $jobData as $key=>$value}
- <div class='glm-row front-job-list-row'>
- <div class="glm-small-12 glm-columns front-job-list">
- <div class="glm-row front-job-data">
- <div class="job-title-list glm-small-12 glm-columns no-padding">
- <span>{$value.title}</span>
- </div>
- <div class="job-location-list glm-small-12 glm-columns no-padding">
- <span>Location: </span>{$value.job_location}
- </div>
- <div class="job-company-list glm-small-12 glm-columns no-padding">
- <span>Company: </span>{$value.company}
- </div>
- <div class="job-date-list glm-small-12 glm-columns no-padding">
- <span></span>{$value.post_date.timestamp|date_format:"%Y-%m-%d"}
+<div class="front-job-listings-wrapper">
+ <div class="job-title-search glm-row">
+ <form class="front-job-search" action="{$siteBaseUrl}job-postings" method="post" enctype="multipart/form-data">
+ <select name="job_titles" id="job_title_dropdown">
+ <option value="">Show All</option>
+ {foreach $jobTitles as $jtitle=>$title}
+ <option value="{$title.id}">{$title.job_title}</option>
+ {/foreach}
+ <input class="button job-title-button" type="submit" value="Show">
+ </select>
+ </form>
+ </div>
+ {if $jobData}
+ {foreach $jobData as $key=>$value}
+ <div class='glm-row front-job-list-row'>
+ <div class="glm-small-12 glm-columns front-job-list no-padding">
+ <div class="glm-row front-job-data">
+ <div class="job-title-list glm-small-12 glm-columns no-padding">
+ <span>{$value.title}</span>
+ </div>
+ <div class="job-location-list glm-small-12 glm-columns no-padding">
+ <span>Location: </span>{$value.job_location}
+ </div>
+ <div class="job-company-list glm-small-12 glm-columns no-padding">
+ <span>Company: </span>{$value.company}
+ </div>
+ <div class="job-date-list glm-small-12 glm-columns no-padding">
+ <span></span>{$value.post_date.timestamp|date_format:"%Y-%m-%d"}
+ </div>
+ <a href="{$siteBaseUrl}job-detail/?job={$value.id}">Full Job Description</a>
</div>
- <a href="{$siteBaseUrl}job-detail/?job={$value.id}">Full Job Description</a>
</div>
</div>
+ {/foreach}
+ {else}
+ <div class="glm-row">
+ <div class="glm-small-12 glm-columns">
+ No Job Listings
</div>
- {/foreach}
-{else}
-<div class="glm-row">
- <div class="glm-small-12 glm-columns">
- No Job Listings
</div>
+{/if}
</div>
-{/if}
\ No newline at end of file