*/
public $config;
/**
- * Report ID
+ * Job ID
*
- * @var $report ID
+ * @var $job ID
* @access public
*/
- public $report_id = false;
+ public $job_id = false;
/*
* Constructor
wp_enqueue_script("jquery-ui-tabs");
}
$success_message = "";
- $haveReport = false;
+ $haveJob = false;
$option = false;
- $report = false;
- $reportUpdated = false;
- $reportUpdateError = false;
- $reportAdded = false;
- $reportAddError = false;
+ $job = false;
+ $jobUpdated = false;
+ $jobUpdateError = false;
+ $jobAdded = false;
+ $jobAddError = 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) : '');
+ // get the Job id for use in the edit, add and delete options
+ $this->Job_id = ( isset( $_REQUEST['Job'] ) ? filter_var( $_REQUEST['Job'], FILTER_SANITIZE_STRING) : '');
- $trail_data = $this->getList();
+ $job_data = $this->getList();
switch ($option) {
case 'add':
- $report = $this->newEntry();
+ $job = $this->newEntry();
$view_file = 'edit';
break;
case 'insert':
- $report = $this->insertEntry();
-// echo '<pre>', print_r($report), '</pre>';
- $this->report_id = $report['fieldData']['id'];
+ $job = $this->insertEntry();
+// echo '<pre>', print_r($job), '</pre>';
+ $this->Job_id = $job['fieldData']['id'];
- if ($report['status']) {
- $haveReport = true;
- $reportAdded = true;
+ if ($job['status']) {
+ $haveJob = true;
+ $jobAdded = true;
// Update created timestamp and name slug for URLs
- //$this->updateSlug($this->reportID);
+ //$this->updateSlug($this->JobID);
// Get this again so we have the created date
- $report = $this->editEntry($this->report_id);
+ $job = $this->editEntry($this->Job_id);
$option = 'edit';
- $reportAdded = true;
+ $jobAdded = true;
} else {
$option = 'add';
- $reportAddError = true;
+ $jobAddError = true;
}
$view_file = 'edit';
- $report = $this->editEntry($this->report_id);
+ $job = $this->editEntry($this->Job_id);
- // If we have a good report
- if ($report['status']) {
- $haveReport = true;
+ // If we have a good Job
+ if ($job['status']) {
+ $haveJob = true;
}
$view_file = 'edit';
case 'update':
- // Try to update this report
- $report = $this->updateEntry($this->report_id);
+ // Try to update this Job
+ $job = $this->updateEntry($this->Job_id);
// Check if that was successful
- if ($report['status']) {
- $reportUpdated = true;
+ if ($job['status']) {
+ $jobUpdated = true;
- $report = $this->editEntry($this->report_id);
+ $job = $this->editEntry($this->Job_id);
} else {
- $reportUpdateError = true;
+ $jobUpdateError = true;
}
- $haveReport = true;
+ $haveJob = true;
$view_file = 'edit';
break;
case 'delete':
echo "delte";
- $report = $this->deleteEntry($this->report_id,true);
+ $job = $this->deleteEntry($this->Job_id,true);
- if ($report) {
- $reportDeleted = true;
+ if ($job) {
+ $jobDeleted = true;
} else {
- $reportDeleteError = true;
+ $jobDeleteError = true;
}
$view_file = "index";
- $trail_data = $this->getList();
+ $job_data = $this->getList();
break;
default:
- $trail_data = $this->getList();
+ $job_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/',
+ 'jobData' => $job_data,
+ 'haveJob' => $haveJob,
+ 'JobUpdated' => $jobUpdated,
+ 'JobUpdateError' => $jobUpdateError,
+ 'JobAdded' => $jobAdded,
+ 'JobAddError' => $jobAddError,
+ 'option' => $option,
+ 'Job' => $job,
+ 'assetsUrl' => GLM_MEMBERS_JOBS_PLUGIN_URL . 'assets/',
);
{include file='admin/header.html'}
-{if ($option == 'add' || $haveReport)}
+{if ($option == 'add' || $haveJob)}
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="button button-secondary glm-button glm-right">Return to Reports List</a>
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="button button-secondary glm-button glm-right">Return to jobs List</a>
{if $option == 'edit' || $option == 'update'}
- <a id="deleteReportButton" class="button button-secondary glm-button glm-right">Delete this Report</a>
+ <a id="deleteJobButton" class="button button-secondary glm-button glm-right">Delete this Job</a>
<h2>Edit Job Postings
{else}
<h2>Add New Job Postings
{/if}
- {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}
+ {if $jobUpdated}<span class="glm-notice glm-flash-updated">Job Updated</span>{/if}
+ {if $jobUpdateError}<span class="glm-error glm-flash-updated">Job Update Error</span>{/if}
+ {if $jobAdded}<span class="glm-notice glm-flash-updated">Job Added</span>{/if}
+ {if $jobAddError}<span class="glm-error glm-flash-updated">Job 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>
+ {if $jobUpdateError || $jobAddError}
+ <h1 class="glm-error">NOTICE: Your Job 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}
+ {if $haveJob}
<input type="hidden" name="option" value="update">
- <input type="hidden" name="report" value="{$report.fieldData.id}">
+ <input type="hidden" name="Job" value="{$job.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>
+ <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-report-table">
+ <table id="glm-table-descr" class="glm-admin-table glm-Job-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>
+ <th {if $job.fieldRequired.Job_active}class="glm-required"{/if}>Job Active:</th>
+ <td {if $job.fieldFail.Job_active}class="glm-form-bad-input" data-tabid="glm-Job-descr"{/if}>
+ <input type="checkbox" name="Job_active" class="" {if $job.fieldData.Job_active.value == 1} checked="checked" {/if}>
+ {if $job.fieldFail.Job_active}<p>{$job.fieldFail.Job_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>
+ <th {if $job.fieldRequired.Job_date}class="glm-required"{/if}>Job Date:</th>
+ <td {if $job.fieldFail.Job_date}class="glm-form-bad-input" data-tabid="glm-Job-descr"{/if}>
+ <input type="text" name="Job_date" value="{$job.fieldData.Job_date.date}" class="glm-form-text-input-short groom-date">
+ {if $job.fieldFail.Job_date.date}<p>{$job.fieldFail.Job_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>
+ <th {if $job.fieldRequired.Job_blurb}class="glm-required"{/if}>Job Blurb:</th>
+ <td {if $job.fieldFail.Job_blurb}class="glm-form-bad-input" data-tabid="glm-Job-descr"{/if}>
+ <input type="text" name="Job_blurb" value="{$job.fieldData.Job_blurb}" class="glm-form-text-input-short">
+ {if $job.fieldFail.Job_blurb}<p>{$job.fieldFail.Job_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>
+ <th {if $job.fieldRequired.Job_notes}class="glm-required"{/if}>Job Notes:</th>
+ <td {if $job.fieldFail.Job_notes}class="glm-form-bad-input" data-tabid="glm-Job-descr"{/if}>
+ <textarea name="Job_notes" class="glm-form-text-input-medium job-notes"> {$job.fieldData.Job_notes}</textarea>
+ {if $job.fieldFail.Job_notes}<p>{$job.fieldFail.Job_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}">
+ <input id="updateJob" type="submit" value="{if $haveJob}Update Job{else}Save New Job{/if}">
</form>
{else} <!-- Can just display -->
- <h3>Sorry, no report found or permission not granted.</h3>
+ <h3>Sorry, no Job found or permission not granted.</h3>
{/if}
- <!-- Delete Obit Dialog Box -->
+ <!-- Delete Job Dialog Box -->
- <div id="deleteReportDialog" class="glm-dialog-box" title="Delete Obit">
+ <div id="deleteJobDialog" class="glm-dialog-box" title="Delete Job">
<center>
- <p><a id="deleteReportCancel" class="button button-primary">Cancel</a></p>
- <p><input id="deleteReportSubmit" type="submit" value="Delete this report"></p>
+ <p><a id="deleteJobCancel" class="button button-primary">Cancel</a></p>
+ <p><input id="deletejobsubmit" type="submit" value="Delete this Job"></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 class="glm-warning">Clicking the "Delete this Job" button above will
+ delete all of the data and images associated with this Job.
</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.
+ of this Job to "Archived" instead.
</span>
</p>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
- $("#report-tabs").fadeTo("600", 1);
- $('#report-tabs').tabs();
+ $("#Job-tabs").fadeTo("600", 1);
+ $('#Job-tabs').tabs();
$('.groom-date').datepicker({
showOn: "both",
buttonImage: '{$assetsUrl}' + "/calIcon.png",
buttonImageOnly: true
});
- {if $haveReport}
- // Delete Report dialog
- $("#deleteReportDialog").dialog({
+ {if $haveJob}
+ // Delete Job dialog
+ $("#deleteJobDialog").dialog({
autoOpen: false,
minWidth: 400,
dialogClass: "glm-dialog-no-close"
});
- $('#deleteReportButton').click( function() {
- $('#deleteReportDialog').dialog('open');
+ $('#deleteJobButton').click( function() {
+ $('#deleteJobDialog').dialog('open');
});
- $('#deleteReportCancel').click( function() {
- $("#deleteReportDialog").dialog("close");
+ $('#deleteJobCancel').click( function() {
+ $("#deleteJobDialog").dialog("close");
});
- $('#deleteReportSubmit').click( function() {
- window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&report={$report.fieldData.id}");
+ $('#deletejobsubmit').click( function() {
+ window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&Job={$job.fieldData.id}");
});
{/if}