Changeset 1588187
- Timestamp:
- 02/03/2017 01:18:42 PM (9 years ago)
- Location:
- zartis-job-plugin
- Files:
-
- 17 added
- 4 edited
-
tags/2.3.1 (added)
-
tags/2.3.1/Zartis_Job_Landing.php (added)
-
tags/2.3.1/Zartis_Job_Plugin.php (added)
-
tags/2.3.1/Zartis_Job_Token.php (added)
-
tags/2.3.1/css (added)
-
tags/2.3.1/css/hirehive-widget-styles.css (added)
-
tags/2.3.1/css/zartis_wp.css (added)
-
tags/2.3.1/images (added)
-
tags/2.3.1/images/arrow_right_alt1_24x24.png (added)
-
tags/2.3.1/images/check_12x10.png (added)
-
tags/2.3.1/images/check_alt_16x16.png (added)
-
tags/2.3.1/js (added)
-
tags/2.3.1/js/jquery-1.6.4.min.js (added)
-
tags/2.3.1/js/zartis_functions.js (added)
-
tags/2.3.1/js/zartis_functions.min.js (added)
-
tags/2.3.1/readme.txt (added)
-
tags/2.3.1/screenshot-1.png (added)
-
trunk/Zartis_Job_Plugin.php (modified) (13 diffs)
-
trunk/Zartis_Job_Token.php (modified) (1 diff)
-
trunk/css/zartis_wp.css (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zartis-job-plugin/trunk/Zartis_Job_Plugin.php
r1588130 r1588187 4 4 Plugin URI: http://hirehive.io 5 5 Description: (Formerly Zartis ATS) Easily add your own secure jobs and careers page to your WordPress site. Includes full access to professional candidate management and posting to twitter, facebook and free job aggregation sites. 6 Version: 2.3. 06 Version: 2.3.1 7 7 Author: HireHive 8 8 Author URI: http://hirehive.io … … 34 34 if (!defined('Zartis_Url')) 35 35 define('Zartis_Url', WP_PLUGIN_URL . '/' . HireHive_Folder); 36 36 37 37 // Add jquery core and our css styles 38 38 if (is_admin()) { … … 40 40 wp_enqueue_style('zartis_wp', Zartis_Url . '/css/zartis_wp.css'); 41 41 wp_enqueue_script('zartis_functions', Zartis_Url . '/js/zartis_functions.js'); 42 42 43 43 // The styles for the widget 44 44 wp_enqueue_style('hirehive_wp_widget', Zartis_Url . '/css/hirehive-widget-styles.css'); … … 83 83 global $wpdb; 84 84 $zartis_page_ID = get_option('Zartis_Page_ID'); 85 85 86 86 // Clean up DB fields 87 87 HireHive_CleanUp_DB(); 88 88 89 89 // the id of our page... 90 90 $page_ID = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE ID = '" . $zartis_page_ID . "'"); … … 114 114 add_action('admin_menu', 'Add_HireHive_Admin_Menu'); 115 115 $Zartis_Notice = get_option('Zartis_Notice'); 116 116 117 117 //checks if this is an activation and then displays the zartis message 118 118 if ($Zartis_Notice == "False") { … … 133 133 function Display_HireHive_Widget( $atts ) { 134 134 $category = ''; 135 135 136 136 if( isset( $atts['category'] ) && $atts['category']) { 137 137 $category = $atts['category']; 138 138 } 139 139 140 140 $Company_Zartis_ID = get_option('Zartis_Unique_ID'); 141 141 142 142 $Zartis_Group = get_option('Zartis_Group'); 143 143 144 144 if ($Zartis_Group == null){ 145 145 $Zartis_Group = 1; 146 146 } 147 147 148 148 if ($Company_Zartis_ID != "False") { 149 149 try { 150 150 151 151 if ($category !=null){ 152 152 $url = 'https://my.hirehive.io/api/v2/public/search?cname='.$Company_Zartis_ID.'&groupBy='.$Zartis_Group.'&category='.$category; … … 155 155 $url = 'https://my.hirehive.io/api/v2/public/search?cname='.$Company_Zartis_ID.'&groupBy='.$Zartis_Group; 156 156 } 157 157 158 158 $jsondata = file_get_contents($url); 159 159 //$jsonString = stripslashes($jsondata); 160 160 $decodedJSON = json_decode($jsondata, true); 161 161 162 162 $decodeError = ''; 163 163 switch (json_last_error()) { 164 164 165 165 case JSON_ERROR_NONE: 166 166 break; … … 184 184 break; 185 185 } 186 186 187 187 if (strlen($decodeError) > 0) { 188 188 $emailBody = "JSON Decode failed: " .$Company_Zartis_ID; … … 192 192 $emailBody .= '<br><br>'; 193 193 $emailBody .= '<pre>' .print_r($decodeError, 1). '</pre>'; 194 194 195 195 $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 196 196 197 197 error_log($emailBody, 1, '[email protected]', $headers); 198 198 199 199 throw new Exception('JSON version failed, fallback to JS widget'); 200 200 } 201 201 202 202 //$obj = json_decode(preg_replace('/\p{Cc}+/u', '', $jsondata), true); //json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $jsondata), true); 203 203 204 204 //$groups = $obj; 205 205 $groups = $decodedJSON; 206 206 $jobTemplate = '<a class="hh-list-row" href="{{Link}}"><span class="hh-list-title">{{Title}}</span> <span class="hh-list-location">{{Location}}, {{Country}}</span> <span class="hh-list-type">{{Type}}</span></a>'; 207 207 208 208 $jobsHTML = "<div id='jobs_iframe' class='hh-list'>"; 209 $jobsHTML .= '<!-- Jobs for - ' .$Company_Zartis_ID. ' -->'; 210 $jobsHTML .= '<!-- Chosen group - ' .$Zartis_Group. ' -->'; 211 $jobsHTML .= '<!-- Category - ' .$category. ' -->'; 212 209 213 foreach ($groups as $group) { 210 214 if ($Zartis_Group > 1){ 211 215 $jobsHTML .= '<h3 class="hh-list-cat">'.$group["name"].'</h3>'; 212 216 } 213 217 214 218 if ($category !=null){ 215 219 $jobsHTML .= Compile_Job_Template($jobTemplate, $group); … … 221 225 } 222 226 } 227 223 228 $jobsHTML .= "</div>"; 224 229 225 230 return $jobsHTML; 226 231 } … … 228 233 // If we have an exception using the API to get the jobs then we fallback to the old JS Version 229 234 $script = '<script type="text/javascript"src="https://my.hirehive.io/' . $Company_Zartis_ID . '/getwidget"></script><script type="text/javascript"charset="utf-8">function getParam(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return"";else return results[1];}function updateIFrame(height){var iframe=document.getElementById("jobs_iframe");iframe.setAttribute("height",height);}var height=getParam("height");if(height==""){var zartis_options={};zartis_options.display="iframe";zartis_options.company="' . $Company_Zartis_ID . '";zartis_options.placement="left";zartis_options.type="widget";zartis_options.color="#222";zartis_options.width="' . $Zartis_Width . '%";zartis_options.style="idea";zartis_options.url=document.URL;var zartis_widget=new ZARTIS.jobs_widget(zartis_options);}else{window.top.updateIFrame(height);}</script>'; 230 235 236 $script .= '<!-- Jobs for - ' .$Company_Zartis_ID. ' -->'; 237 $script .= '<!-- Chosen group - ' .$Zartis_Group. ' -->'; 238 $script .= '<!-- Category - ' .$category. ' -->'; 239 $script .= '<!--' .$e.message. '-->'; 240 231 241 return $script; 232 242 } 233 243 234 244 } else { 235 245 return false; … … 238 248 239 249 function Compile_Job_Template($template, &$job){ 240 250 241 251 $template = str_replace("{{Title}}",$job["title"],$template); 242 252 $template = str_replace("{{Link}}",$job["jobUrl"],$template); … … 244 254 $template = str_replace("{{Country}}",$job["countryName"],$template); 245 255 $template = str_replace("{{Type}}",$job["type"],$template); 246 256 247 257 return $template; 248 258 } -
zartis-job-plugin/trunk/Zartis_Job_Token.php
r1571917 r1588187 32 32 33 33 34 <?php if(!isset($_GET["WordPressURL"])) : ?> 35 <div class="cent"> 36 <a href="https://my.hirehive.io/Register/WordPress" class="btn save buttons a"> 37 <span>Sign up and get token now</span> 38 </a><br><br> 39 <a href="https://my.hirehive.io/#/settings/wordpress">Already have an account? Get token here.</a> 34 <?php if(!isset($_GET["WordPressURL"])) : ?> 35 <div class="cent"> 36 <a href="https://my.hirehive.io/Register/WordPress" class="btn save buttons a"> 37 <span>Sign up and get token now</span> 38 </a> 39 <br> 40 <br> 41 <a href="https://my.hirehive.io/#/settings/wordpress">Already have an account? Get token here.</a> 40 42 41 </div>42 <!-- END OF cent -->43 <?php endif; ?>43 </div> 44 <!-- END OF cent --> 45 <?php endif; ?> 44 46 45 47 </div> 46 48 <!-- END OF content --> 47 <?php if(isset($_GET["WordPressURL"])) : ?>48 <form method="post" action="options.php">49 <?php wp_nonce_field('update-options'); ?>50 <fieldset class="default fieldset">51 <ol class="ol">52 <!-- Email Input -->53 <li>54 <label class='label' for="email">55 Your token56 </label>57 <input class="token-input" id="Zartis_Unique_ID" name="Zartis_Unique_ID" type="text" class="input text-box" value="<?php if (isset($_GET["WordPressURL"])){echo $_GET["WordPressURL"]; } ?>" required="required" />58 <div class="hint hide" style="display: none;">59 Your token is required60 </div>61 </li>62 </ol>63 <input type="hidden" name="action" value="update" />64 <input type="hidden" name="page_options" value="Zartis_Unique_ID" />65 <div class="cent">66 <button type="submit" class="btn save buttons a zar_next">Save and get started</button>67 </div>68 49 69 </fieldset> 70 </form> 71 <?php endif; ?> 50 <div style="margin-top:35px"> 51 <h3>Enter HireHive WordPress Token</h3> 52 <p>Already have an account? <a href="https://my.hirehive.io/#/Settings/Careerpage" target="_blank">Get token here.</a></p> 53 <form method="post" action="options.php"> 54 <?php wp_nonce_field('update-options'); ?> 55 <fieldset class="default fieldset"> 56 <ol class="ol"> 57 <!-- Email Input --> 58 <li> 59 <label class='label' for="email"> 60 Your token 61 </label> 62 <input class="token-input" id="Zartis_Unique_ID" name="Zartis_Unique_ID" type="text" class="input text-box" value="<?php if (isset($_GET["WordPressURL"])){echo $_GET["WordPressURL"]; } ?>" required="required" /> 63 <div class="hint hide" style="display: none;"> 64 Your token is required 65 </div> 66 </li> 67 </ol> 68 <input type="hidden" name="action" value="update" /> 69 <input type="hidden" name="page_options" value="Zartis_Unique_ID" /> 70 <div class="cent"> 71 <button type="submit" class="btn save buttons a zar_next">Save and get started</button> 72 </div> 73 74 </fieldset> 75 </form> 76 </div> 77 72 78 </div> 73 79 <!-- END OF c8 --> 74 80 75 81 <div class="c8"> 76 <div class="callout">77 <h3>How your jobs should look</h3>78 <p> This is how your jobs listing should look on your Wordpress site, when your HireHive account is setup and79 <strong>shortcode is added to your jobs page</strong>. The styling of jobs will also depend on the installed theme.</p>80 <img src="https://zartis.blob.core.windows.net/public-screens/Wordpress-Jobs-Listing.png"/>81 </div>82 <div class="callout"> 83 <h3>How your jobs should look</h3> 84 <p> This is how your jobs listing should look on your Wordpress site, when your HireHive account is setup and 85 <strong>shortcode is added to your jobs page</strong>. The styling of jobs will also depend on the installed theme.</p> 86 <img src="https://zartis.blob.core.windows.net/public-screens/Wordpress-Jobs-Listing.png" /> 87 </div> 82 88 </div> 83 89 <!-- END OF c8 --> -
zartis-job-plugin/trunk/css/zartis_wp.css
r1481678 r1588187 57 57 58 58 .zar_body .content { 59 position: relative; 60 float: left; 59 position: relative; 61 60 width: 100%; 62 63 61 } 64 62 -
zartis-job-plugin/trunk/readme.txt
r1588130 r1588187 5 5 Requires at least: 2.9 6 6 Tested up to: 4.7.2 7 Stable tag: 2.3. 07 Stable tag: 2.3.1 8 8 9 9 Easily add job listings and secure candidate management to your Wordpress site. … … 94 94 = 2.2.2 = 95 95 * Minor text change 96 97 = 2.3.0 = 98 * Added more exception handling 99 * Added a fallback if JSON fails 100 101 = 2.3.1 = 102 * Added informational output to page when rendering 103 * Can add a HireHive token using an input box
Note: See TracChangeset
for help on using the changeset viewer.