Changeset 1495983
- Timestamp:
- 09/14/2016 09:25:32 PM (10 years ago)
- Location:
- virtuous/trunk
- Files:
-
- 3 edited
-
admin/project-settings.php (modified) (1 diff)
-
assets/js/virtuous.js (modified) (1 diff)
-
lib/core/class-virtuous-project.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
virtuous/trunk/admin/project-settings.php
r1483555 r1495983 246 246 <p><h3>Project Details</h3></p> 247 247 <p><strong>Shortcode name:</strong> virtuous_project_details</p> 248 <p><strong>No optional attributes</strong></p> 248 <p><strong>Optional attribute:</strong></p> 249 <p> 250 <strong>update_status</strong> - temporarily changes Inventory Status to Not Available<br/> 251 </p> 249 252 <p><strong>Sample:</strong></p> 250 253 <p> 251 [virtuous_project_details ]<br/>254 [virtuous_project_details update_status="true"]<br/> 252 255 </p> 253 256 -
virtuous/trunk/assets/js/virtuous.js
r1483555 r1495983 1 1 var $ = jQuery.noConflict(); 2 2 3 function redirect_to_giving_fuel(redirect_url, project_id ) {3 function redirect_to_giving_fuel(redirect_url, project_id, update_status) { 4 4 5 5 var $ = jQuery.noConflict(); 6 var data = { 7 action: 'update_project_status', 8 project_id: project_id 9 }; 10 $.post({ 11 url: virtuous_ajax_script.ajaxurl, 12 data: data, 13 success: function( response ) { 14 console.log(response ); 15 }, 16 error: function( response ) { 17 console.log( response ); 18 } 19 }); 6 7 if (update_status == 'true') { 8 var data = { 9 action: 'update_project_status', 10 project_id: project_id 11 }; 12 $.post({ 13 url: virtuous_ajax_script.ajaxurl, 14 data: data, 15 success: function( response ) { 16 console.log(response ); 17 }, 18 error: function( response ) { 19 console.log( response ); 20 } 21 }); 22 } 23 20 24 window.location.href = redirect_url; 21 25 } -
virtuous/trunk/lib/core/class-virtuous-project.php
r1483555 r1495983 265 265 $support_button_text = ''; 266 266 $base_support_url = ''; 267 268 extract( shortcode_atts(array( 269 'update_status' => 'false' 270 ), $atts ) ); 267 271 268 272 $virtuous_api_project_types_serialized = get_option( 'virtuous_api_project_types' ); … … 334 338 335 339 if ( $include_support_button ) { 336 $return_val .= ' <button class="x-btn" type="button" onclick="redirect_to_giving_fuel(\'' . $support_url . '\', \'' . $id . '\' )">' . $support_button_text . '</button>';340 $return_val .= ' <button class="x-btn" type="button" onclick="redirect_to_giving_fuel(\'' . $support_url . '\', \'' . $id . '\', \'' . $update_status . '\')">' . $support_button_text . '</button>'; 337 341 } 338 342
Note: See TracChangeset
for help on using the changeset viewer.