) ? >
/*
Choose your timezone from http://php.net/manual/en/timezones.php
Eastern ........... America/New_York
Central ........... America/Chicago
Mountain .......... America/Denver
Mountain no DST ... America/Phoenix
Pacific ........... America/Los_Angeles
Alaska ............ America/Anchorage
Hawaii ............ America/Adak
Hawaii no DST ..... Pacific/Honolulu
*/
define("TIMEZONE", "America/New_York");
/*********
MEMBERSHIP
**********/
// Define when a volunteer becomes a member based hours and days for the calendar year vs a paid membership
// This can also be used as a metric.
/*
At Positive Spin
Actual memberships begin on the day they are purchased
Memberships - $60/year
Memberships include unlimited access to an available work stand during open shop hours and a 10% discount on new parts.
*/
// Needs to volunteer at least this amount of defined hours before being considered a member
// Note: used only as a metric for reports
define("MEMBERSHIP_HOURS",8);
// Needs to volunteer at least this number of days before being considered a member
// Note: used only as a metric for reports
define("MEMBERSHIP_DAYS",2);
// Define how long a patron remains a member if they purchase a membership.
define("PURCHASED_MEMBERSHIP_DAYS",365);
// Define discount for paid members (applies when volunteer benefits do not)
define("MEMBERSHIP_DISCOUNT",10); // PERCENTAGE
/*********
STAND TIME
**********/
// Determines the hourly cost for Stand Time (transaction_type_id)
define("STAND_TIME_HOURLY_RATE",10); // IN DOLLARS
// Define how much time over 1hr is allowed before charging for the next hour.
define("STAND_TIME_GRACE_PERIOD",15); // IN MINUTES 1 - 59
// Define how many free days of stand time are allotted after purchase of a bike
define("FREE_STAND_TIME_PERIOD",30); // IN DAYS
/********************************
SWEAT EQUITY / VOLUNTEER BENEFITS
*********************************/
// For example:
// The settings below are specific to Positive Spin Policies
// Calendar Year = January 1 .. December 31 (366 for leap years)
/*
These hours can only be used to purchase used parts, bicycles and stand time.
Volunteers may only purchase one bike with volunteer hours per calendar year.
If you would like to spend more than $100 in volunteer hours during a calendar year,
75% of every dollar spent over $100 must be paid for with cash/credit card/check/etc
for volunteers who have volunteered fewer than 100 hours. For volunteers who have
donated more than 100 hours of their time in the past 365 days, this match can be reduced to 50%.
(Sweat Equity / Volunteer Benefits can't be combined with Membership Benefits.)
*/
define("SWEAT_EQUITY_LIMIT",100); // IN DOLLARS
define("MAX_BIKE_EARNED",1); // AMOUNT OF BIKES
define("VOLUNTEER_HOUR_VALUE",8); // IN DOLLARS
define("VOLUNTEER_DISCOUNT",25); // PERCENTAGE
define("SPECIAL_VOLUNTEER_HOURS_QUALIFICATION",100); // IN HOURS
define("SPECIAL_VOLUNTEER_DISCOUNT",50); // PERCENTAGE
// Customized sweat equity limit per contact_id
// e.g. for sweat equity limit of $200 for contact_id 500: array(500 => 200)
$custom_sweat_equity_limit = array();
// Determines the behaviour of Bicycles (transaction_type_id) for volunteer to earn-a-bike purchases.
// Keeping things equitable, if a patron decides to purchase a bike, rather than earning it,
// that counts to the EAB limit for the year.
define("EARN_A_BIKE_LIMIT",1);
// Determine if stand time behaviour will be based on the SWEAT_EQUITY_LIMIT with discounts applied,
// or 1 to 1 (1hr of volunteering === 1hr of free stand time) regardless of the SWEAT_EQUITY_LIMIT
define("REDEEM_ONE_TO_ONE", true);
// Map transaction_type_id for transaction to benefits;
// Bicycles and Stand Time are special transaction types for volunteers, but they should still be mapped if benefits are desired.
$transactions_with_volunteer_benefits = array( "Bicycles" => true,
"Stand Time" => true,
"Used Parts" => true
);
// Volunteer benefits take priority over membership benefits if patron qualifies for both
$transactions_with_membership_benefits = array( "Stand Time" => true,
"Used Parts" => true,
"New Parts" => true,
"Helmets" => true,
"Cargo Related" => true,
"Car Racks" => true
);
/*********
BANNED IDS
**********/
// Ban those pesky individuals who continually refuse to follow policies and safer space agreements by contact_id
$banned_individuals = array();
/*******
CONTACTS
********/
// Allow waiver (recommended) in Add/Edit Contacts; 1 = yes, 0 = no
// Waiver text may be modified in Connections/waiver.txt
define("WAIVER", 1);
define("WAIVER_LABEL","Waiver of Liability and Safer Spaces Agreement:");
// Allow email_list option in Add/Edit Contacts; 1 = yes, 0 = no
define("EMAIL_LIST", 1);
// Define a url for an email connector that will connect to an email list.
// The url can be a server:port, program, etc.
// Name (First, Last), email address, subscription choice and connector password will be sent to the connector.
//
// The purpose of email connectors is to provide autonomy in the choice
// of email services and programs. E.g. mailman, googlegroups
// See ./examples for an example mailman connector
define("EMAIL_LIST_CONNECTOR","https://wvcompletestreets.org:9987");
// Define the password that is unique to the connector.
define("EMAIL_LIST_CONNECTOR_PASSWORD","bikebike");
// If a self-signed ssl certificate that is associated with the email connector is being provided,
// designate an absolute path, if not, change to false.
define("SSL_CERTIFICATE", "/var/www/html/examples/cert.pem");
//// "Volunteer Interest" form ////
define("VOLUNTEER_INTEREST_FORM", true);
// Form name
define("VOLUNTEER_INTEREST_FORM_NAME","Volunteer Interests");
// NOTE: Introductory text can be modified in Connections/volunteer_interest_form_introduction.txt
// Define volunteer interests:
//
// You can add new interests to this array.
// The order is kept as 3 columns, left to right.
//
// If you want to delete or change the name of an interest, read instructions below carefully for
// "Delete an interest(s) name and "Change an interest(s) name"
$volunteer_interests = array(
"Repairing Bikes", "Organizing Volunteers", "Serving as a Board Member",
"Arranging Events", "Volunteering at Events", "Writing Grants/Fundraising",
"Answering our Phone", "3D-printing", "Bicycle Valeting",
"Publicizing/Outreach", "Graphic Design", "Greeter at the Front Desk",
"Accounting/Record Keeping", "Ordering parts/supplies", "Picking up Donated Bikes/Parts",
"Teaching classes", "League Certified Instructor", "Pricing bikes",
"Fabricating", "Open Source Programming", "Other/Contact me for general help"
);
// Provide a comment box - true of false
define("VOLUNTEER_INTEREST_COMMENTS", true);
// NOTE: The 2 variables ($volunteer_interest_changename & $volunteer_interests_deletename)
// below allow you to change or delete an interest.
// Only uncomment one variable at a time, and follow the directions.
// Change an interest(s) name:
//
// 1. Associate the name you want to change with a different name to the right as show below.
// In this example "League Certified Instructor" will become "LCI".
// 2. Change the interests name in $volunteer_interests above at the same time.
// 3. Visit your own contact, e.g. contact_add_edit.php?contact_id=1 and click on the Submit button,
// and the database will be updated.
// 4. Comment out //$volunteer_interests_changename
//
// $volunteer_interests_changename = array("League Certified Instructor" => "LCI");
// [BUGGY - don't use it] Delete an interest(s) name.
//
// 1. Add the interest(s) you want to delete. Please understand
// that by doing this you will delete the interest and all associated data.
// 2. Remove the interest from $volunteer_interests above at the same time before saving this page,
// or it will be recreated.
// 3. Visit your own contact, e.g. contact_add_edit.php?contact_id=1 and click on the Submit button,
// and the database will be updated.
//
//$volunteer_interests_deletename = array("LCI");
/***********
TRANSACTIONS
************/
// User defined constants - read sql/populate.sql for an explanation
define("STORAGE_PERIOD", 14);
define("ACCOUNTING_GROUP", "Sales");
define("DEFAULT_TRANSACTION_TYPE", "Sale - Used Parts");
// shop_user_role
define("DEFAULT_SHOP_USER", "Stand Time");
/* Change Fund - A specific amount of money for the purpose of making change.
The amount on hand should remain the same at all times;
therefore a change funds does not require replenishment.
*/
define("CHANGE_FUND", 20);
// How many hours should the shop be open from the time a person logins? Hours display in pulldown in shop_log.php
// No overtime for volunteers. :)
// shop will be current shop for the 24hr day yyyy-mm-dd (currently no check for hrs, only date)
define("SHOP_HOURS_LENGTH", 10);
// What minute interval should be displayed for list_time()? In other words, the time_in and time_out pulldown lists.
// choose an interval that is divisible by 60 minutes, 1, 5, 15, 30 etc.
define("LIST_MINUTE_INTERVAL", 1);
/* If you elect to keep records for non-shop hours, decide which shop should be used for that purpose.
The first shop created, 1, makes sense. A link will show in start_shop.php.
If you do not want this functionality at all, choose 0.
*/
define("NONSHOP", 0);
// How many transactions do you want shown by default
define("NUMBER_OF_TRANSACTIONS", 11);
// Define csv directory (see directions below for creating it)
define("CSV_DIRECTORY","csv");
// Make a directory to store csv accounting files. Currently used for GnuCash format.
// Assuming the root of the website, and directory is called csv, and a Debian-based distribution:
// mkdir csv
// chown www-data:www-data csv
// chmod 0700 csv
// Define array mapping for Accounts. Usually Asset Accounts since Income is generally the main type of transaction.
// Currently there are four types of accounts with checking and credit being supported (working): checking, credit, account_receivable, donation
// checking/credit = transaction has been 1) paid and is 2) cash & check [checking] or a credit card [credit] and 3) deposited
// note: checking type may include $0 transactions, e.g. earn-a-bike
// account_receivable = there is an 1). account receivable invoice and it has been 2) paid and 3) deposited
// donation = transaction that currently has no assessed monetary amount (NULL),
// e.g. shop item giveaway or patron non-monetary donation
// note: this is a hack for record keeping in an accounting program, and not recommended;
// bike donations/giveaways should be handled in a better way like using BikeBinder,
// an inventory system application,that may be tied into YBDB someday
$gnucash_accounts = array( "Assets:Current Assets:Checking Account" => "checking",
"Assets:Current Assets:PayPal" => "credit",
"Assets:Account Receivable" => "account_receivable",
"Assets:Donations" => "donation"
);
// Most collectives require only one shop at a time, but YBDB provides a way to handle 2 concurrent
// shops at different locations using the same instance of software. If this option is on,
// the current shop will still be shown, but users have the option of changing a transaction to the id
// of the other shop location whether it is concurrent or whether it a shop from the same location that
// happened at a previous time.
//
// Note: Remote shops function independently via their IP identification.
//
// Normally, you will want this set at 0.
define('SHOW_SHOP_ID',0);
/*************
ETHERPAD LITE
**************/
// Allow comments/feedback/notes to be added per individual_history_log in reports,
// and globally in shop_log. An etherpad host has to be defined for this to work.
// See wiki for instructions on how to setup an etherpad docker instance or just go to
// https://github.com/fspc/etherpad-and-draw-node-alpine
//
// prefix allows you to set a prefix to the name of the autogenerated padId:
// etherpad = prefix + "pad_contact_id_" + contact_id;
// etherpad_global = prefix_ + "global_pad"
// See https://github.com/ether/etherpad-lite-jquery-plugin for information about other configurations.
$etherpad = array(
"host" => "",
"userName" => "PositiveSpin",
"noColors" => true,
"height" => "75%",
"plugins" => array()
);
$etherpad_global = array(
"host" => "",
"userName" => "PositiveSpin",
"noColors" => true,
"height" => "100%",
"plugins" => array()
);
// END OF USER DEFINED CONFIGURATIONS
if(file_exists( realpath($_SERVER["DOCUMENT_ROOT"]) . "/Connections/local_configurations.php")) {
require('local_configurations.php');
}
// other constants
define("PAGE_START_SHOP", "/start_shop.php");
define("PAGE_SHOP_LOG", "/shop_log.php");
define("PAGE_EDIT_CONTACT", "/contact_add_edit.php");
define("PAGE_SELECT_CONTACT", "/contact_add_edit_select.php");
define("PAGE_SHOP_LOG_DELETE_VISIT", "/shop_log_delete_shopvisitid.php");
define("INDIVIDUAL_HOURS_LOG", "/individual_hours_log.php");
define("INDIVIDUAL_HISTORY_LOG", "/individual_history_log.php");
define("PAGE_SALE_LOG", "/transaction_log.php");
define("PAGE_EDIT_LOCATION", "/location_add_edit.php");
define("PAGE_SELECT_LOCATION", "/location_add_edit_select.php");
// Highlight search results in transaction_log
function highlightKeywords($text, $keyword) {
$wordsAry = explode(" ", $keyword);
$wordsCount = count($wordsAry);
// Using REGEXP, this removes regex from search
$find = array('/[\*\.\$\^\?\+\[\]\|\(\)\,\{\}\:\\\]/');
$replace = array('');
for($i=0;$i<$wordsCount;$i++) {
$wordsAry[$i] = preg_replace($find, $replace, $wordsAry[$i]);
$highlighted_text = "$wordsAry[$i]";
$text = str_ireplace($wordsAry[$i], $highlighted_text, $text);
//$text = str_replace($wordsAry[$i], $highlighted_text, $text);
}
return $text;
}
//This is a general function to generate the contents of a list box based on a MySQL query. All necessary parameters for the query are passed
function generate_list($querySQL,$list_value,$list_text, $form_name, $default_value, $color)
{
global $database_YBDB, $YBDB;
mysql_select_db($database_YBDB, $YBDB);
$recordset = mysql_query($querySQL, $YBDB) or die(mysql_error());
$row_recordset = mysql_fetch_assoc($recordset);
$totalRows_recordset = mysql_num_rows($recordset);
$default_delimiter = '';
// if a form name is supplied HTML listbox code is inserted
if($form_name == "transaction_type" || $form_name == "gnucash_csv_year"){
echo "