From: Anthony Talarico Date: Wed, 27 Sep 2017 18:58:49 +0000 (-0400) Subject: fixing import script to preserve special characters, changing admin stlyes X-Git-Tag: v1.0.0~1^2~26 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=890e8adfdd229004c5aae16c736650393628001a;p=WP-Plugins%2Fglm-member-db-jobs.git fixing import script to preserve special characters, changing admin stlyes changing admin styles for the admin list so that mobile view is still managable --- diff --git a/css/admin.css b/css/admin.css index 4bf34df..c269b03 100644 --- a/css/admin.css +++ b/css/admin.css @@ -1,3 +1,3 @@ -#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} +.admin-edit-job-wrapper .admin-job-label,.admin-edit-job-wrapper .admin-job-input,.admin-job-list-wrapper .admin-job-label,.admin-job-list-wrapper .admin-job-input{padding:0}.admin-edit-job-wrapper .admin-job-list,.admin-job-list-wrapper .admin-job-list{padding:6px 0px 6px 2px}.admin-edit-job-wrapper .jobTitle-record,.admin-job-list-wrapper .jobTitle-record{float:left}.admin-edit-job-wrapper .admin-list-edit-item,.admin-job-list-wrapper .admin-list-edit-item{padding:5px}.admin-edit-job-wrapper .admin-new-job,.admin-job-list-wrapper .admin-new-job{margin-bottom:15px}.admin-edit-job-wrapper .admin-new-job .admin-new-job-link,.admin-job-list-wrapper .admin-new-job .admin-new-job-link{padding:5px;background:#3D84D0;color:white;text-decoration:none;border-radius:4px}.admin-edit-job-wrapper .no-padding,.admin-job-list-wrapper .no-padding{padding:0}.admin-edit-job-wrapper .no-margin,.admin-job-list-wrapper .no-margin{margin:0}.admin-edit-job-wrapper .admin-job-list-header,.admin-job-list-wrapper .admin-job-list-header{margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid lightgray}.admin-edit-job-wrapper .job-company-list-header,.admin-edit-job-wrapper .job-date-list-header,.admin-edit-job-wrapper .job-title-list-header,.admin-job-list-wrapper .job-company-list-header,.admin-job-list-wrapper .job-date-list-header,.admin-job-list-wrapper .job-title-list-header{font-weight:bold;font-size:16px}.admin-edit-job-wrapper .admin-job-list-row:nth-child(odd),.admin-job-list-wrapper .admin-job-list-row:nth-child(odd){background:#e3e3e5}.admin-edit-job-wrapper .glm-row,.admin-job-list-wrapper .glm-row{margin:0 !important}@media screen and (max-width: 641px){.admin-edit-job-wrapper,.admin-job-list-wrapper{float:none}.admin-edit-job-wrapper .admin-job-list-header,.admin-job-list-wrapper .admin-job-list-header{display:none}.admin-edit-job-wrapper .admin-list-edit-items,.admin-job-list-wrapper .admin-list-edit-items{margin:0 auto;float:right;max-width:100px}}@media (min-width: 639px) and (max-width: 1025px){.admin-edit-job-wrapper .admin-job-list-header,.admin-job-list-wrapper .admin-job-list-header{display:none}.admin-edit-job-wrapper .admin-list-edit-items,.admin-job-list-wrapper .admin-list-edit-items{margin:0 auto;float:right;max-width:100px}}@media (min-width: 1023px){.admin-edit-job-wrapper .admin-list-edit-items,.admin-job-list-wrapper .admin-list-edit-items{position:absolute;right:0;max-width:100px;float:right}}@media (max-width: 1025px){.admin-edit-job-wrapper .admin-job-data div,.admin-job-list-wrapper .admin-job-data div{margin-bottom:5px}} /*# sourceMappingURL=admin.css.map */ diff --git a/css/admin.css.map b/css/admin.css.map index 9499d0f..b5022e4 100644 --- a/css/admin.css.map +++ b/css/admin.css.map @@ -1 +1 @@ -{"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 +{"version":3,"file":"admin.css","sources":["admin.scss"],"sourcesContent":[".admin-edit-job-wrapper,\n.admin-job-list-wrapper{\n .admin-job-label,\n .admin-job-input {\n padding: 0;\n }\n .admin-job-list{\n padding: 6px 0px 6px 2px;\n }\n .jobTitle-record{\n float: left;\n }\n .admin-list-edit-item{\n // float: right;\n padding: 5px;\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 .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 .job-company-list{\n // padding: 0 3px 0 0;\n }\n .admin-job-list-row:nth-child(odd){\n background: #e3e3e5;\n }\n\n// VIEW PORT MEDIA QUERIES\n\n .glm-row{\n margin: 0 !important;\n }\n\n // small only\n @media screen and (max-width: 641px){\n .admin-job-list-header{\n display: none;\n }\n\n float: none;\n .admin-list-edit-items{\n margin: 0 auto;\n float: right;\n max-width: 100px;\n }\n }\n // medium only\n @media (min-width: 639px) and (max-width: 1025px){\n .admin-job-list-header{\n display: none;\n }\n .admin-list-edit-items{\n margin: 0 auto;\n float: right;\n max-width: 100px;\n }\n }\n // large only\n @media (min-width: 1023px){\n .admin-list-edit-items{\n position: absolute;\n right: 0;\n max-width: 100px;\n float: right;\n }\n }\n // medium down\n @media (max-width: 1025px){\n .admin-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O,CAAE,IAAI,CAChB,AA5ET,AA6EQ,uBA7Ee,CA6Ef,sBAAsB,CA5E9B,AA4EQ,uBA5Ee,CA4Ef,sBAAsB,AAAA,CAClB,MAAM,CAAE,MAAM,CACd,KAAK,CAAE,KAAK,CACZ,SAAS,CAAE,KAAK,CACnB,CAGL,MAAM,EAAE,SAAS,EAAE,MAAM,EApF7B,AAqFQ,uBArFe,CAqFf,sBAAsB,CApF9B,AAoFQ,uBApFe,CAoFf,sBAAsB,AAAA,CAClB,QAAQ,CAAE,QAAQ,CAClB,KAAK,CAAE,CAAC,CACR,SAAS,CAAE,KAAK,CAChB,KAAK,CAAE,KAAK,CACf,CAGL,MAAM,EAAE,SAAS,EAAE,MAAM,EA7F7B,AA+FY,uBA/FW,CA8Ff,eAAe,CACX,GAAG,CA9Ff,AA8FY,uBA9FW,CA6Ff,eAAe,CACX,GAAG,AAAA,CACC,aAAa,CAAE,GAAG,CACrB"} \ No newline at end of file diff --git a/models/admin/jobs/index.php b/models/admin/jobs/index.php index c036c20..5329571 100644 --- a/models/admin/jobs/index.php +++ b/models/admin/jobs/index.php @@ -182,11 +182,6 @@ class GlmMembersAdmin_jobs_index extends GlmDataJobs $this->job_id = false; } } - - - -// echo '
', print_r($this->getList()), '
'; - // echo '
', print_r($_REQUEST), '
'; switch ($option) { @@ -209,11 +204,12 @@ class GlmMembersAdmin_jobs_index extends GlmDataJobs $jobAdded = true; // Update created timestamp and name slug for URLs - //$this->updateSlug($this->JobID); + // $this->updateSlug($this->job_id); $job_titles = $job_titles->getList(); // Get this again so we have the created date $job = $this->editEntry($this->job_id); + // $job = $this->addNewTitle($job); $option = 'edit'; $jobAdded = true; @@ -242,6 +238,7 @@ class GlmMembersAdmin_jobs_index extends GlmDataJobs $haveJob = true; } $job_titles = $job_titles->getList(); + // echo '
', print_r($job), '
'; $job_data = $this->getList($where); $view_file = 'edit'; break; @@ -255,14 +252,13 @@ class GlmMembersAdmin_jobs_index extends GlmDataJobs // Check if that was successful if ($job['status']) { $jobUpdated = true; - $job = $this->editEntry($this->job_id); } else { $jobUpdateError = true; } $job_titles = $job_titles->getList(); - $job_data = $this->getList($where); + $job_data = $this->getList($where); $haveJob = true; $view_file = 'edit'; @@ -270,52 +266,23 @@ class GlmMembersAdmin_jobs_index extends GlmDataJobs case 'delete': $job = $this->deleteEntry($this->job_id,true); - echo $this->job_id; if ($job) { $jobDeleted = true; } else { $jobDeleteError = true; } $view_file = "index"; - $job_data = $this->getList(); break; default: -// $job_data = $this->getList($where); - $sql = "SELECT * FROM ". GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . "jobs";; - $job_data = $this->wpdb->get_results($sql, ARRAY_A); - $job_titles = $job_titles->getList(); - $job_data_new = []; - $start = 0; - foreach($job_data as $job=>$data){ - // echo '
', print_r($data), '
'; - $title_text = false; - // echo "
START + $start
"; - // echo '======================
'; - foreach($job_titles as $job=>$titles){ - // echo $data['title'] . " --data
"; - // echo $titles['old_id'] . " --title
"; - if($data['title'] === $titles['old_id']){ - $title_text = $titles['job_title']; - break; - } else if($data['title'] === $titles['id']) { - $title_text = $titles['job_title']; - break; - } - } - $start++; - $data['new_title'] = $title_text; - $job_data_new[] = $data; - } - - echo '
', print_r($job_data_new), '
'; + $job_data = $this->getList($where, 'post_date DESC'); $view_file = 'index'; break; } // echo '
', print_r($this->getList()), '
'; // Compile template data $templateData = array( - 'jobData' => $job_data_new, + 'jobData' => $job_data, 'memberList' => $member_list, 'lockedToMember' => $lockedToMember, 'haveMember' => $haveMember, diff --git a/models/admin/management/jobsImport.php b/models/admin/management/jobsImport.php index 236f00b..c31148d 100644 --- a/models/admin/management/jobsImport.php +++ b/models/admin/management/jobsImport.php @@ -131,9 +131,9 @@ class GlmMembersAdmin_management_jobsImport // } // $resultMessage .= $this->importMemberData( $file_data ); //$resultMessage .= '
$file_data: ' . print_r( $file_data, true ) . '
'; - break; + // break; - case 'importItems': + case 'importJobs': $table = GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . 'jobs'; define('BASE_URL', 'http://www.migcsa.org'); define('PG_DSN', 'pgsql: host=ds4 dbname=migcsa2_update user=postgres'); @@ -152,9 +152,10 @@ class GlmMembersAdmin_management_jobsImport $job_titles_sql = "SELECT * FROM job_department;"; $stmt = $dbh->query($job_titles_sql); $job_titles = $stmt->fetchAll(PDO::FETCH_ASSOC); - + $title_results = []; foreach($job_titles as $key=>$value){ - $wpdb->insert( GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . 'job_titles', + // + $this->wpdb->insert( GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . 'job_titles', array( 'old_id'=>$value['id'], 'job_title'=>$value['name'] @@ -164,74 +165,77 @@ class GlmMembersAdmin_management_jobsImport '%s' ) ); + $title_results[$value['id']] = array('new_id'=>$this->wpdb->insert_id, 'title'=>$value['name']); } + $job_sql = "SELECT * FROM job ORDER BY id;"; $stmt = $dbh->query($job_sql); $jobs = $stmt->fetchAll(PDO::FETCH_ASSOC); - foreach($jobs as $key=>$value){ - // echo '
', print_r($value), '
'; - $post_date = false; - // echo $value ['operation'] . " : " . $value['requirements'] . " |
"; - // echo '
'; + + $post_exp = false; if( $value['post'] == "30 days" ){ - $post_date = 30; + $post_exp = 30; }else if( $value['post'] == "60 days" ){ - $post_date = 60; - } - // $url - // $wpdb->insert( $table, - // array( - // 'old_id'=>$value['id'], - // 'title'=>$value['departmentid'], - // 'descr'=>$value['descr'], - // 'company'=>$value['operation'], - // 'salary'=>$value['salary'], - // 'descr'=>$value['descr'], - // 'resume_location'=>$value['location'], - // 'email_location'=>$value['contactemail'], - // 'contact_name'=>$value['contactname'], - // 'contact_phone'=>$value['contactphone'], - // 'visible'=>$value['visable'], - // 'facility_operation'=>$value['course_operations'], - // 'duration'=>$value['duration'], - // 'benefits'=>$value['bentext'], - // 'post_date'=>$value['ds'], - // 'requirements'=>$value['requirements'], - // 'member'=>$value['member'], - // 'position_available'=>$value['position_available'], - // 'duration'=>$value['duration'], - // 'deadline'=>$value['deadline'], - // 'job_expiration'=>$post_date, - // 'job_location'=>$value['joblocation'], - // ), - // array( - // '%d', - // '%d', - // '%s', - // '%s', - // '%s', - // '%s', - // '%s', - // '%s', - // '%s', - // '%s', - // '%d', - // '%s', - // '%s', - // '%s', - // '%d', - // '%s', - // '%d', - // '%s', - // '%s', - // '%s', - // '%d', - // '%s', - // ) - // ); + $post_exp = 60; + } + echo "-----------------------------------------------
"; + echo '
', print_r($value['descr']), '
'; + echo "-----------------------------------------------
"; + + + $this->wpdb->insert( $table, + array( + 'old_id'=>$value['id'], + 'title'=>$title_results[$value['departmentid']]['new_id'], + 'descr'=>$value['descr'], + 'company'=>$value['operation'], + 'salary'=>$value['salary'], + 'descr'=>$value['descr'], + 'resume_location'=>$value['location'], + 'email_location'=>$value['contactemail'], + 'contact_name'=>$value['contactname'], + 'contact_phone'=>$value['contactphone'], + 'visible'=>$value['visable'], + 'facility_operation'=>$value['course_operations'], + 'duration'=>$value['duration'], + 'benefits'=>$value['bentext'], + 'post_date'=>$value['ds'], + 'requirements'=>$value['requirements'], + 'member'=>$value['member'], + 'position_available'=>$value['position_available'], + 'duration'=>$value['duration'], + 'deadline'=>$value['deadline'], + 'job_expiration'=>$post_exp, + 'job_location'=>$value['joblocation'], + ), + array( + '%d', + '%d', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%s', + '%d', + '%s', + '%s', + '%s', + '%d', + '%s', + ) + ); } - echo '
', print_r($jobs), '
'; + // echo '
', print_r($jobs), '
'; } catch(PDOException $e) { @@ -249,18 +253,8 @@ class GlmMembersAdmin_management_jobsImport $url = get_site_url() . '/wp-admin/admin.php?page=glm-members-admin-menu-management&glm_action=jobImport&option=importJobs'; $limit = 200; - // $sql = "SELECT name,mother_name,misc_info, courier_date FROM chxctyitem LIMIT $limit OFFSET $start"; - // $jobs = $wpdb->get_results( $sql, ARRAY_A ); - $count = 0; - // foreach($jobs as $column=>$data ){ - // $count++; - // // $insert = array(); - - // } -// echo '
', print_r($insert), '
'; - // $wpdb->insert($table, $insert); - + $resultMessage = "
Start: $start
"; $start += $limit; $resultMessage .= "

Next

"; diff --git a/scss/admin.scss b/scss/admin.scss index 2c826a4..da6eaaf 100644 --- a/scss/admin.scss +++ b/scss/admin.scss @@ -1,43 +1,101 @@ -#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; +.admin-edit-job-wrapper, +.admin-job-list-wrapper{ + .admin-job-label, + .admin-job-input { + padding: 0; + } + .admin-job-list{ + padding: 6px 0px 6px 2px; + } + .jobTitle-record{ + float: left; + } + .admin-list-edit-item{ + // float: right; + padding: 5px; + } + + .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; + } + .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; + } + .job-company-list{ + // padding: 0 3px 0 0; + } + .admin-job-list-row:nth-child(odd){ + background: #e3e3e5; + } + +// VIEW PORT MEDIA QUERIES + + .glm-row{ + margin: 0 !important; + } + + // small only + @media screen and (max-width: 641px){ + .admin-job-list-header{ + display: none; + } + + float: none; + .admin-list-edit-items{ + margin: 0 auto; + float: right; + max-width: 100px; + } + } + // medium only + @media (min-width: 639px) and (max-width: 1025px){ + .admin-job-list-header{ + display: none; + } + .admin-list-edit-items{ + margin: 0 auto; + float: right; + max-width: 100px; + } + } + // large only + @media (min-width: 1023px){ + .admin-list-edit-items{ + position: absolute; + right: 0; + max-width: 100px; + float: right; + } + } + // medium down + @media (max-width: 1025px){ + .admin-job-data{ + div{ + margin-bottom: 5px; + } + } + } } diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql index d5ccb80..52532e8 100644 --- a/setup/databaseScripts/create_database_V0.0.1.sql +++ b/setup/databaseScripts/create_database_V0.0.1.sql @@ -57,11 +57,11 @@ CREATE TABLE {prefix}job_titles ( ---- -- Job Titles default entries in table -INSERT INTO {prefix}jobs ( -id,old_id,title,descr,salary, email_location,resume_location,contact_name,contact_phone,post_date,updated,visible, -facility_operation,requirements,job_location,job_expiration,duration,deadline,position_available, -company,member,benefits -) VALUES ( 1,1, 1,"DESCRIPTION",'SALARY', 'EMAIL LOCATION', 'RESUME LOCATION','CONTACT NAME', '453-3443', NOW(),NOW(), true, -'facility operations', 'REQUIREMENTS', 'JOB LOCATION', 30, 'JOB DURATION', 'DEADLINE', 'POSITION AVAILABLE', -'COMPANY', 1, 'JOB BENEFITS' -); \ No newline at end of file +-- INSERT INTO {prefix}jobs ( +-- id,old_id,title,descr,salary, email_location,resume_location,contact_name,contact_phone,post_date,updated,visible, +-- facility_operation,requirements,job_location,job_expiration,duration,deadline,position_available, +-- company,member,benefits +-- ) VALUES ( 1,1, 1,"DESCRIPTION",'SALARY', 'EMAIL LOCATION', 'RESUME LOCATION','CONTACT NAME', '453-3443', NOW(),NOW(), true, +-- 'facility operations', 'REQUIREMENTS', 'JOB LOCATION', 30, 'JOB DURATION', 'DEADLINE', 'POSITION AVAILABLE', +-- 'COMPANY', 1, 'JOB BENEFITS' +-- ); \ No newline at end of file diff --git a/setup/validActions.php b/setup/validActions.php index 2e975fa..5772abf 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -65,6 +65,9 @@ $glmMembersjobsAddOnValidActions = array( 'settings' => array( 'jobTitles' => GLM_MEMBERS_JOBS_PLUGIN_SLUG, ), + 'management' => array( + 'jobsImport' => GLM_MEMBERS_JOBS_PLUGIN_SLUG, + ) ), 'frontActions' => array( 'jobs' => array( diff --git a/views/admin/jobs/edit.html b/views/admin/jobs/edit.html index d38278c..5ba5a02 100644 --- a/views/admin/jobs/edit.html +++ b/views/admin/jobs/edit.html @@ -1,341 +1,338 @@ {include file='admin/header.html'} +
-{if ($option == 'add' || $haveJob)} - Return to jobs List + {if ($option == 'add' || $haveJob)} + Return to jobs List - {if $option == 'edit' || $option == 'update'} - Delete this Job -

Edit Job Posting - {else} -

Add New Job Posting - {/if} -     - {if $jobUpdated}Job Updated{/if} - {if $jobUpdateError}Job Update Error{/if} - {if $jobAdded}Job Added{/if} - {if $jobAddError}Job Add Error{/if} -

- - {if $jobUpdateError || $jobAddError} -

NOTICE: Your Job has not yet been submitted.
Please select the tabs indicating a problem, correct the indicated fields and resubmit.

- {else} - {/if} -
- - {if $haveJob} - - + {if $option == 'edit' || $option == 'update'} + Delete this Job +

Edit Job Posting {else} - +

Add New Job Posting {/if} - -

- -
-
- Job Title -
- -
- -
-
- - -
-
- - {if !$lockedToMember} -
-
- Member -
-
- -
-
+ + {if $jobUpdateError || $jobAddError} +

NOTICE: Your Job has not yet been submitted.
Please select the tabs indicating a problem, correct the indicated fields and resubmit.

{else} - - {/if} + + + {if $haveJob} + + + {else} + + {/if} + - -
-
- Company -
-
- -
-
- -
-
- Facility Operation -
- -
- {php} - wp_editor( - - '{$job.fieldData.facility_operation|escape:quotes}', - - - 'facility_operation', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'facility_operation', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Description -
-
- {php} - wp_editor( - - '{$job.fieldData.descr|escape:quotes}', - - 'descr', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'descr', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Job Requirements -
-
- {php} - wp_editor( - - '{$job.fieldData.requirements|escape:quotes}', - - 'requirements', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'requirements', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Job Benefits -
-
- {php} - wp_editor( + + +
+
+ Job Title +
+ +
+ +
+
+ + +
+
+ + {if !$lockedToMember} +
+
+ Member +
+
+ +
+
+ {else} + + + {/if} + + +
+
+ Company +
+
+ +
+
+ +
+
+ Facility Operation +
- '{$job.fieldData.benefits|escape:quotes}', - - - 'benefits', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'benefits', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Salary -
-
- -
-
- -
-
- Position Available -
-
- -
-
- -
-
- Job Duration -
-
- -
-
- -
-
- Deadline -
-
- -
-
- -
-
- Job Location -
-
- {php} +
+ {php} + wp_editor( + + '{$job.fieldData.facility_operation|escape:quotes}', + + + 'facility_operation', array( + 'media_buttons' => false, + 'tinymce' => false, + // 'quicktags' => false, + // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. + 'textarea_name' => 'facility_operation', + 'editor_height' => 200, // Height in px, overrides editor_rows + // 'textarea_rows' => 8 + )); + {/php} +
+
+ +
+
+ Description +
+
+ {php} + wp_editor( + + '{$job.fieldData.descr|escape:quotes}', + + 'descr', array( + 'media_buttons' => false, + 'tinymce' => false, + // 'quicktags' => false, + // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. + 'textarea_name' => 'descr', + 'editor_height' => 200, // Height in px, overrides editor_rows + // 'textarea_rows' => 8 + )); + {/php} +
+
+ +
+
+ Job Requirements +
+
+ {php} + wp_editor( + + '{$job.fieldData.requirements|escape:quotes}', + + 'requirements', array( + 'media_buttons' => false, + 'tinymce' => false, + // 'quicktags' => false, + // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. + 'textarea_name' => 'requirements', + 'editor_height' => 200, // Height in px, overrides editor_rows + // 'textarea_rows' => 8 + )); + {/php} +
+
+ +
+
+ Job Benefits +
+
+ {php} + wp_editor( + + '{$job.fieldData.benefits|escape:quotes}', + + + 'benefits', array( + 'media_buttons' => false, + 'tinymce' => false, + // 'quicktags' => false, + // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. + 'textarea_name' => 'benefits', + 'editor_height' => 200, // Height in px, overrides editor_rows + // 'textarea_rows' => 8 + )); + {/php} +
+
+ +
+
+ Salary +
+
+ +
+
+ +
+
+ Position Available +
+
+ +
+
+ +
+
+ Job Duration +
+
+ +
+
+ +
+
+ Deadline +
+
+ +
+
+ +
+
+ Job Location +
+
+ {php} + wp_editor( + + '{$job.fieldData.job_location|escape:quotes}', + + 'job_location', array( + 'media_buttons' => false, + 'tinymce' => false, + // 'quicktags' => false, + // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. + 'textarea_name' => 'job_location', + 'editor_height' => 200, // Height in px, overrides editor_rows + // 'textarea_rows' => 8 + )); + {/php} +
+
+ +
+
+ Send Resume To +
+
+ {php} wp_editor( - - '{$job.fieldData.job_location|escape:quotes}', - - 'job_location', array( + + '{$job.fieldData.resume_location|escape:quotes}', + + 'resume_location', array( 'media_buttons' => false, 'tinymce' => false, // 'quicktags' => false, // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'job_location', + 'textarea_name' => 'resume_location', 'editor_height' => 200, // Height in px, overrides editor_rows // 'textarea_rows' => 8 )); {/php} +
+
+ +
+
+ Contact Name +
+
+ +
+
+ +
+
+ Contact Email +
+
+ +
+
+ +
+
+ Contact Phone +
+
+ +
+
+ +
+
+ Visible +
+
+ +
+
+ +
+
+ Job Expiration +
+
+ +
-
- -
-
- Send Resume To -
-
- {php} - wp_editor( - - '{$job.fieldData.resume_location|escape:quotes}', - - 'resume_location', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'resume_location', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Contact Name -
-
- -
-
- -
-
- Contact Email -
-
- -
-
- -
-
- Contact Phone -
-
- -
-
- -
-
- Visible -
-
- -
-
- -
-
- Job Expiration -
-
- -
-
- - - - + + + + -{else} + {else} -

Sorry, no Job found or permission not granted.

+

Sorry, no Job found or permission not granted.

-{/if} + {/if} @@ -360,9 +357,12 @@

+