Browse Source

This closes #83 adding probation status to shop_log for contact_id.

devel
Jonathan Rosenbaum 5 years ago
parent
commit
ca4085109c
  1. 12
      Connections/database_functions.php
  2. 18
      js/shop.js
  3. 11
      json/contact.php

12
Connections/database_functions.php

@ -119,6 +119,16 @@ BANNED IDS
// Ban those pesky individuals who continually refuse to follow policies and safer space agreements by contact_id
$banned_individuals = array();
/************
PROBATION IDS
************/
// Put individuals under probation by contact_id. Probation could be used for a variety of scenarios,
// an individual who may potentially become banned, or who has been deemed as worthy of coming out of a ban,
// or someone who IOU's volunteer time for a bike they earned (generally, people should not be allowed to do
// this in the first place), etc.
$probation_individuals = array();
/*******
CONTACTS
@ -369,7 +379,7 @@ function generate_list($querySQL,$list_value,$list_text, $form_name, $default_va
$default_delimiter = 'selected="selected"';
} else { $default_delimiter = '';}
echo '<option style="color:' . $color . ';" value="' . $row_recordset[$list_value] . '" ' . $default_delimiter . '>' .
$row_recordset[$list_text] . '</option>\n';
$row_recordset[$list_text] . '</option>';
} while ($row_recordset = mysql_fetch_assoc($recordset));
$rows = mysql_num_rows($recordset);
if($rows > 0) {

18
js/shop.js

@ -32,6 +32,23 @@ $(function(){
});
$(banned_list).css({backgroundColor: "red"}).prop("title", "BANNED");
// return probation list
var probation_list, pl;
$.post("json/contact.php", {probation: 1}, function (data) {
if (data) {
pl = $.parseJSON(data);
$(pl).each(function(i,v) {
if (i === 0) {
probation_list = "#" + v;
} else {
probation_list = probation_list + ",#" + v;
}
});
}
});
$(probation_list).css({backgroundColor: "#eed202"}).prop("title", "PROBATION");
// error handler for shops with a popup dialog (TODO)
function error_handler(input,error_span,error,error_text,event) {
@ -87,7 +104,6 @@ $(function(){
} );
// could have done this in php, but this separates out the view logic
var membership_ids, volunteer_ids;
var last_index = $("#shop_log tr[id]").length;

11
json/contact.php

@ -57,6 +57,15 @@ $ssl_certificate = SSL_CERTIFICATE;
}
// pass probation contact_id values if they exist
if (isset($_POST['probation'])) {
if ($probation_individuals) {
echo json_encode($probation_individuals);
}
}
// update email_list
if( isset($_POST['email_list']) ) {
@ -94,7 +103,7 @@ $ssl_certificate = SSL_CERTIFICATE;
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($json),
);
);
if ($ssl_certificate) {
$curlConfig[CURLOPT_CAINFO] = $ssl_certificate;

Loading…
Cancel
Save