From: Anthony Talarico Date: Wed, 13 Sep 2017 20:37:48 +0000 (-0400) Subject: making changes to the database setup script to changes some of the field names X-Git-Tag: v1.0.0~1^2~36 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=3b9ada8f0891318f529e6b8b7bf112463373e238;p=WP-Plugins%2Fglm-member-db-jobs.git making changes to the database setup script to changes some of the field names finishing the setup for the job titles settings and pulling them into the edit view, changing some of the database field's names. --- diff --git a/classes/data/dataJobTitles.php b/classes/data/dataJobTitles.php index 0a10234..fb21aa2 100644 --- a/classes/data/dataJobTitles.php +++ b/classes/data/dataJobTitles.php @@ -35,7 +35,7 @@ * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmDatajobTitles extends GlmDataAbstract +class GlmDataJobTitles extends GlmDataAbstract { /** @@ -112,7 +112,7 @@ class GlmDatajobTitles extends GlmDataAbstract * Table Name */ - $this->table = GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . 'jobs'; + $this->table = GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . 'job_titles'; // -- Conditions Table //CREATE TABLE {prefix}conditions ( diff --git a/classes/data/dataJobs.php b/classes/data/dataJobs.php index 1d441c3..b4de75f 100644 --- a/classes/data/dataJobs.php +++ b/classes/data/dataJobs.php @@ -138,7 +138,7 @@ class GlmDatajobs extends GlmDataAbstract 'title' => array ( 'field' => 'title', 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . 'jobs_titles', + 'p_table' => GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . 'job_titles', 'p_field' => 'job_title', 'p_orderby' => 'job_Title', 'use' => 'a' @@ -216,8 +216,8 @@ class GlmDatajobs extends GlmDataAbstract 'type' => 'text', 'use' => 'a' ), - 'course_operation' => array ( - 'field' => 'course_operation', + 'company' => array ( + 'field' => 'company', 'type' => 'text', 'use' => 'a' ), diff --git a/css/admin.css b/css/admin.css index f638434..f6fd0fc 100644 --- a/css/admin.css +++ b/css/admin.css @@ -1,4 +1,7 @@ #glm-admin-content-container .admin-job-label, #glm-admin-content-container .admin-job-input{ padding: 0; +} +.jobTitle-record{ + float: left; } \ No newline at end of file diff --git a/models/admin/jobs/index.php b/models/admin/jobs/index.php index 8f2ee5f..e705187 100644 --- a/models/admin/jobs/index.php +++ b/models/admin/jobs/index.php @@ -14,7 +14,9 @@ */ // Load Contacts data abstract -require_once GLM_MEMBERS_JOBS_PLUGIN_CLASS_PATH.'/data/dataJobs.php'; +require_once GLM_MEMBERS_JOBS_PLUGIN_CLASS_PATH .'/data/dataJobs.php'; +require_once GLM_MEMBERS_JOBS_PLUGIN_CLASS_PATH .'/data/dataJobTitles.php'; +require_once GLM_MEMBERS_PLUGIN_CLASS_PATH .'/data/dataMembers.php'; class GlmMembersAdmin_jobs_index extends GlmDatajobs { @@ -86,6 +88,9 @@ class GlmMembersAdmin_jobs_index extends GlmDatajobs public function modelAction($actionData = false) { + $job_titles = new GlmDataJobTitles($this->wpdb,$this->config); + $job_titles = $job_titles->getList(); + 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'); @@ -98,7 +103,7 @@ class GlmMembersAdmin_jobs_index extends GlmDatajobs $jobUpdateError = false; $jobAdded = false; $jobAddError = false; - + $view_file = 'index'; if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') { $option = $_REQUEST['option']; } @@ -107,7 +112,7 @@ class GlmMembersAdmin_jobs_index extends GlmDatajobs $this->job_id = ( isset( $_REQUEST['job'] ) ? filter_var( $_REQUEST['job'], FILTER_SANITIZE_STRING) : ''); $job_data = $this->getList(); - echo '
', print_r($this->getList()), '
'; +// echo '
', print_r($this->getList()), '
'; // echo '
', print_r($_REQUEST), '
'; switch ($option) { @@ -145,9 +150,6 @@ class GlmMembersAdmin_jobs_index extends GlmDatajobs break; case 'edit': - - - $job = $this->editEntry($this->job_id); // If we have a good Job @@ -193,10 +195,11 @@ class GlmMembersAdmin_jobs_index extends GlmDatajobs $view_file = 'index'; break; } - +// echo '
', print_r($this->getList()), '
'; // Compile template data $templateData = array( 'jobData' => $job_data, + 'jobTitles' => $job_titles, 'haveJob' => $haveJob, 'jobUpdated' => $jobUpdated, 'jobUpdateError' => $jobUpdateError, diff --git a/models/admin/settings/jobTitles.php b/models/admin/settings/jobTitles.php index 97d01ae..e92b9ad 100644 --- a/models/admin/settings/jobTitles.php +++ b/models/admin/settings/jobTitles.php @@ -2,7 +2,7 @@ config = $config; /* - * Run constructor for the Obits data class + * Run constructor for the Job Titles 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'. @@ -89,9 +89,9 @@ class GlmMembersAdmin_settings_jobTitles extends GlmDataJobTitles public function modelAction($actionData = false) { - $numbObits = 0; - $namesList = false; - + $numbJobTitles = 0; + $jobTitleList = false; + // Check if an ID is supplied $id = 0; if ( isset( $_REQUEST['id'] ) ) { @@ -129,7 +129,7 @@ class GlmMembersAdmin_settings_jobTitles extends GlmDataJobTitles // Get number of obits $jobTitles = $this->getList(); - +// echo '
', print_r($this), '
';
         // Compile template data
         $templateData = array(
             'jobTitles'      => $jobTitles,
diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql
index e175f23..9dc6513 100644
--- a/setup/databaseScripts/create_database_V0.0.1.sql
+++ b/setup/databaseScripts/create_database_V0.0.1.sql
@@ -29,7 +29,7 @@ CREATE TABLE {prefix}jobs (
     job_expiration TINYTEXT NULL,
     duration TINYTEXT NULL ,
     deadline TINYTEXT NULL ,
-    course_operation TINYTEXT NULL ,
+    company TINYTEXT NULL ,
     position_available TINYTEXT NULL ,
     member INT NULL,
     PRIMARY KEY (id)
@@ -56,8 +56,8 @@ INSERT INTO {prefix}job_titles ( id,job_title) VALUES
 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,
+company,member
+) VALUES ( 1, 1,"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
+'COMPANY', 1
 );
\ No newline at end of file
diff --git a/setup/validActions.php b/setup/validActions.php
index 8c4e429..9c46898 100644
--- a/setup/validActions.php
+++ b/setup/validActions.php
@@ -63,9 +63,9 @@ $glmMembersjobsAddOnValidActions = array(
             'index' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
             'list'  => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
         ),
-    ),
-    'settings' => array(
-        'jobTitles' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
+        'settings' => array(
+            'jobTitles' => GLM_MEMBERS_JOBS_PLUGIN_SLUG,
+        ),
     ),
     'frontActions' => array(
         'jobs' => array( 
diff --git a/views/admin/jobs/edit.html b/views/admin/jobs/edit.html
index d9d72ff..ab8ea32 100644
--- a/views/admin/jobs/edit.html
+++ b/views/admin/jobs/edit.html
@@ -34,14 +34,30 @@
        
+        
         
Job Title
-
- +
+ +
+
+
+
@@ -50,6 +66,7 @@
+
@@ -58,6 +75,7 @@
+
diff --git a/views/admin/jobs/index.html b/views/admin/jobs/index.html index 866ba80..6aa0b36 100644 --- a/views/admin/jobs/index.html +++ b/views/admin/jobs/index.html @@ -6,25 +6,23 @@ New Job - - {$jobData} {if $jobData} - yes there is - + {foreach $jobData as $job=>$data} - + {$data.title}{$data.company}{$data.post_date.timestamp|date_format:"%Y-%m-%d"} + {/foreach}
EditDeleteEditDelete
{else if} diff --git a/views/admin/settings/jobTitles.html b/views/admin/settings/jobTitles.html index c627c24..2a4ec87 100644 --- a/views/admin/settings/jobTitles.html +++ b/views/admin/settings/jobTitles.html @@ -1,16 +1,166 @@ - - - - - TODO supply a title - - - - -
TODO write content
- - +{include file='admin/management/header.html'} + + + + +
+ +
Add a Job Title
+
+
+ + + + + + + + + +
Job Title: + +
+

* Required

+ Cancel + + +
+
+ + +
+
+

Are you sure you want to delete this Newspaper?

+

Yes, delete this Job Title

+

Cancel

+
+
+ + +
+
+ + + + + + + + + + + +
Job Title: + +
+

* Required

+ Cancel + + +
+
+ + + + + + + + + + + {if $jobTitles} + {assign var="i" value="0"} + {foreach $jobTitles as $job} + {if $i++ is odd by 1} + + {else} + + {/if} + + + + {/foreach} + {else} + + {/if} + +
Job Title  
+
{$job.job_title}
+
Edit
+
Delete
+
(No Job Titles Listed)
+
+ + +