Skip to content
Permalink
d6aff1cc37
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
1196 lines (1081 sloc) 31.1 KB
<?php
/**
* Plugin Name: UC Purchasing
* Description: Purchasing Contracts
* Version: 1.0
* Plugin URI:
* Domain Path:
* Network:
* Author: John Calande UITS Web Development Lab
* Copyright: UConn April 2016
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
//
// If this plugin script is called directly,
// notify the user and abort.
//
if ( ! defined( 'ABSPATH' ) || ! defined( 'WPINC' ) ){
wp_die( 'Sorry, no direct access to plugin scripts!' );
}
require_once( plugin_dir_path( __FILE__ ) . 'template-class.php' );
add_action( 'plugins_loaded', array( 'Purchasing_Template_Plugin', 'get_instance' ) );
// Search for templates in plugin 'templates' dir, and load if exists
function purchasing_template_include( $template ) {
if ( file_exists( untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' . basename( $template ) ) )
$template = untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' . basename( $template );
return $template;
}
add_filter( 'template_include', 'purchasing_template_include', 11 );
/**********************************************************************************
NOTES:
Our custom post type: Contract (uc_contract)
Note that you must call register_post_type()
before the admin_menu and after the after_setup_theme action hooks.
A good hook to use is the 'init' hook.
Do pay close attention to not having your custom post type identifier
exceed 20 characters though, as the post_type column in the database
is currently a VARCHAR field of that length.
Read more about Custom Post types here: https://codex.wordpress.org/Post_Types
***********************************************************************************
CONTRACT DATABASE FIELDS:
contract_name
contract_number
contract_expires
contract_vendor_name
contract_contact_name
contract_contact_phone
contract_vendor_characteristics
The templates below are how they want the contracts to be displayed.
They would also like a gravity form on the front end for users to submit new contracts.
There is a way with gravity forms to create new posts:
http://gravitywiz.com/use-gravity-forms-to-create-user-submitted-posts/
and it looks like if we use the following plugin we can create new posts
for a custom post type: https://wordpress.org/plugins/gravity-forms-custom-post-types/
What I would do is modify the custom post type you created to have the
fields that they have in the templates. Then create a gravity form and
test out creating posts with it. And then try incorporating the plugin
above to see if you can get it to create a new custom post.
From Jeremiah:
Our wish list consists of the below pages. The pages are what we want them
to look like (or similar). The headers are all consistent and are what we
want searchable/sortable by.
The form is what our internal employees fill out and currently is set to
email me, but I was wondering if there was a way for the form to auto fill
into the template pages depending on the criteria selected (conditional logic).
Not a big deal if it can’t or it’s too much work then don’t worry about it.
Templates:
http://purchasing.uconn.edu/uconn-contracts-redo/
http://cpca.uconn.edu/on-call-trade-contracts/
http://cpca.uconn.edu/on-call-professional-services-contracts/
(perhaps one more page for CPCA in the near future {0-100 Program/smbe})
Form:
http://procurement.uconn.edu/procurement-contract-submit-form/
***********************************************************************************/
class UC_Purchasing{
//
// Create our hook for our create_post_type() method
// and hook our function to the 'init' action
//
public function __construct(){
add_action( $tag_action_hook = 'init',
$function_to_call = array( $this, 'create_post_type' ) ,
0);
}
//
// Register our new custom post type: uc_contract
//
public function create_post_type() {
$labels = array(
'name' => __( 'Contracts' ), // show 'Contracts' in the menu
'menu_name' => __( 'Purchasing' ), // show 'Purchasing' in the dashboard
'singular_name' => __( 'Contract' ), // same as 'name_admin_bar'
'name_admin_bar'=> __( 'Contract' ),
'add_new_item' => __( 'Add New Contract' ),
'add_new' => __( 'Add New Contract' ),
'new_item' => __( 'New Contract' ),
'view_item' => __( 'View Contract' ),
'search_items' => __( 'Search Contracts' ),
'edit_item' => __( 'Edit Contract' ),
'not_found' => __( 'No contracts were found.' ),
'not_found_in_trash' => __( 'No contracts found in trash' ),
'all_items' => __( 'All Contracts' ), // show 'All Contracts' in the menu
);
$supports = array(
'title',
'author',
'thumbnail'
);
$args = array(
'label' => 'Contract',
'labels' => $labels,
'description' => __( 'Purchasing Contract' ),
'public' => true,
'exclude_from_search' => false,
'has_archive' => true, // post type archives?
'show_ui' => true,
'show_in_menu' => true, // false to remove from dashboard menu
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'publicly_queryable' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'contracts' ),
'capability_type' => 'uc_contract',
'hierarchical' => false,
'menu_position' => 36, // 75 - below Tools
'supports' => $supports,
'capabilities' => array(
'edit_post' => 'manage_options',
'read_post' => 'manage_options',
'delete_post' => 'manage_options',
'edit_posts' => 'manage_options',
'edit_others_posts' => 'manage_options',
'delete_posts' => 'manage_options',
'publish_posts' => 'manage_options',
'read_private_posts' => 'manage_options'
),
);
register_post_type( 'uc_contract', $args );
} // create_post_type
} // Class
//
// Create a new instance of UC Purchasing
//
$uc_purchasing = new UC_Purchasing();
function add_uc_contract_columns($columns) {
return array(
'cb' => '<input type="checkbox" />',
'title' => __('Title'),
'contract_number' => __('Contract or Project/Bid Number'),
'contract_vendor_name' => __('Vendor Name'),
'author' => __('Author'),
'date' => __('Date')
);
//return array_merge($columns,
// array('contract_number' => __('Contract Number')));
}
add_filter('manage_uc_contract_posts_columns' , 'add_uc_contract_columns');
function uc_contract_columns( $column, $post_id ) {
switch ( $column ) {
case 'contract_number':
if(get_field( "contract_number", $post_id ) == ""){
echo get_field( "cpca_project_number", $post_id );
} else {
echo get_field( "contract_number", $post_id );
}
break;
case 'contract_vendor_name':
echo get_field( "contract_vendor_name", $post_id );
break;
}
}
add_action( 'manage_uc_contract_posts_custom_column' , 'uc_contract_columns', 10, 2 );
//===============================================================================
// Contract Archive filter - show a list of contracts on this page
//===============================================================================
function get_custom_post_type_template( $archive_template ) {
if ( is_post_type_archive( 'uc_contract' ) ) {
$archive_template = dirname( __FILE__ ) . '/templates/archive.php';
}
return $archive_template;
}
add_filter( 'archive_template', 'get_custom_post_type_template' );
//===============================================================================
// Single contract filter - Not currently used.
//===============================================================================
function contract_page_template( $template ) {
if ( is_page( $slug = 'contract' ) ) {
//$new_template = locate_template( array( 'single.php' ) );
$new_template = dirname( __FILE__ ) . '/templates/single.php';
if ( $new_template != '' ) {
return $new_template ;
}
}
return $template;
}
add_filter( 'template_include', 'contract_page_template', $priority = 99 );
//===============================================================================
// This filter tells wordpress which URL query params to look for.
// The URL looks something like this:
// http://development.wordpress.uconn.edu/john/contracts/?order_by_column=contract_name
//===============================================================================
function set_parameter_query_vars( $qvars ){
$qvars[] = 'order_by_column'; // order by column header
$qvars[] = 'vendor_characteristic'; // select by icon clicked on
$qvars[] = 'search_contracts';
$qvars[] = 'ccv';
$qvars[] = 'ccv+';
$qvars[] = 'ctb';
$qvars[] = 'disbe';
$qvars[] = 'mbe';
$qvars[] = 'sbe';
$qvars[] = 'wbe';
return $qvars;
}
add_filter( 'query_vars', 'set_parameter_query_vars' );
//===============================================================================
// Here we are removing the "View" link from the
// Dashboard -> Purchasing -> All Contracts page
//===============================================================================
function remove_row_actions( $actions )
{
if( get_post_type() === 'uc_contract' ){
unset( $actions['view'] );
}
return $actions;
}
add_filter( 'post_row_actions', 'remove_row_actions', $priority = 10, $args = 1 );
//===============================================================================
// Called from create new contract page
// (data entry via Gravity Form/Contract Add page)
//===============================================================================
function acf_after_submission( $entry )
{
$post_id = $entry["post_id"];
$values = get_post_custom_values( "contract_vendor_characteristics", $post_id );
if(is_array($values) && is_serialized( $values[0] )){
return;
}
update_field( "contract_vendor_characteristics", $values, $post_id );
// update any null field values and set them to empty strings
$value = get_post_meta( $post_id, 'contract_title', $single = true );
if ( empty($value) ){
update_field( "contract_title", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_name', $single = true );
if ( empty($value) ){
update_field( "contract_name", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_type', $single = true );
if ( empty($value) ){
update_field( "contract_type", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_number', $single = true );
if ( empty($value) ){
update_field( "contract_number", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_expires', $single = true );
if ( empty($value) ){
update_field( "contract_expires", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_contact_name', $single = true );
if ( empty($value) ){
update_field( "contract_contact_name", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_vendor_name', $single = true );
if ( empty($value) ){
update_field( "contract_vendor_name", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_contact_phone', $single = true );
if ( empty($value) ){
update_field( "contract_contact_phone", '', $post_id );
}
$value = get_post_meta( $post_id, 'contract_file', $single = true );
if ( empty($value) ){
update_field( "contract_file", '', $post_id );
}
//Construction and Professional Awards fields
$value = get_post_meta( $post_id, 'cpca_project_number', $single = true );
if ( empty($value) ){
update_field( "cpca_project_number", '', $post_id );
}
$value = get_post_meta( $post_id, 'cpca_award_date', $single = true );
if ( empty($value) ){
update_field( "cpca_award_date", '', $post_id );
}
$value = get_post_meta( $post_id, 'cpca_award_desc', $single = true );
if ( empty($value) ){
update_field( "cpca_award_desc", '', $post_id );
}
$value = get_post_meta( $post_id, 'cpca_firm_awarded', $single = true );
if ( empty($value) ){
update_field( "cpca_firm_awarded", '', $post_id );
}
$value = get_post_meta( $post_id, 'cpca_contract_value', $single = true );
if ( empty($value) ){
update_field( "cpca_contract_value", '', $post_id );
}
$value = get_post_meta( $post_id, 'cpca_contact_name', $single = true );
if ( empty($value) ){
update_field( "cpca_contact_name", '', $post_id );
}
$value = get_post_meta( $post_id, 'cpca_contact_phone', $single = true );
if ( empty($value) ){
update_field( "cpca_contact_phone", '', $post_id );
}
}
add_action( "gform_after_submission", "acf_after_submission", $priority = 10, $args = 1 );
//add_action( 'gform_pre_submission', 'pre_submission_handler' );
//function pre_submission_handler( $form ) {
// print_r($_POST); exit;
//}
function acf_smart_dates($field) {
if ($field['value']) {
$field['value'] = date('Ymd',strtotime($field['value']));
}
return $field;
}
add_filter('acf/prepare_field/type=date_picker','acf_smart_dates');
add_action( "gform_after_submission", "acf_after_submission_upload_file", $priority = 11, $args = 2 );
//===============================================================================
//
//
//===============================================================================
function acf_after_submission_upload_file( $entry, $form ){
$gf_images_field_id = 9; // the upload field id
$acf_field_id = 'contract_file'; // the acf field id
// get post
if( isset( $entry['post_id'] ) ) {
$post = get_post( $entry['post_id'] );
if( is_null( $post ) ){
return;
}
} else {
return;
}
/*
// Clean up images upload and create array for gallery field
if( isset( $entry[ $gf_images_field_id ] ) ) {
$images = stripslashes( $entry[ $gf_images_field_id ] );
$images = json_decode( $images, true );
if( !empty( $images ) && is_array( $images ) ) {
$gallery = array();
foreach( $images as $key => $value ) {
// NOTE: this is the other function you need: https://gist.github.com/joshuadavidnelson/164a0a0744f0693d5746
if( function_exists( 'jdn_create_image_id' ) )
$image_id = jdn_create_image_id( $value, $post->ID );
if( $image_id ) {
$gallery[] = $image_id;
}
}
}
}
//var_dump( $entry ); exit;
*/
if( ! empty( $entry[ $gf_images_field_id ] ) ) {
$image_id = jdn_create_image_id( $entry[ $gf_images_field_id ], $post->ID );
//update_field( $acf_field_id, $entry[ $gf_images_field_id ], $post->ID );
update_field( $acf_field_id, $image_id, $post->ID );
// Updating post
wp_update_post( $post );
}
}
function jdn_create_image_id( $image_url, $parent_post_id = null ) {
// Bail if the image url isn't valid
if( empty( $image_url ) || ! esc_url( $image_url ) )
return false;
// Escape the url, just to be save
$image_url = esc_url( $image_url );
// Cache info on the wp uploads dir
$wp_upload_dir = wp_upload_dir();
// get the file path
$path = parse_url( $image_url, PHP_URL_PATH );
// File base name, e.g. image.jpg
$file_base_name = basename( $image_url );
// Full path, set up to work with a WP in a subdirectory or default location
if( site_url() != home_url() ) {
$home_path = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) );
} else {
$home_path = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
}
// Remove the trailing slash on the home path
$home_path = untrailingslashit( $home_path );
// Combine the two to get the uploaded file path
$uploaded_file_path = $home_path . $path;
// Check the type of file. We'll use this as the 'post_mime_type'.
$filetype = wp_check_filetype( $file_base_name, null );
// error check
if( !empty( $filetype ) && is_array( $filetype ) ) {
// Create attachment title - basically, pull out the text
$post_title = preg_replace( '/\.[^.]+$/', '', $file_base_name );
// Prepare an array of post data for the attachment.
$attachment = array(
'guid' => $wp_upload_dir['url'] . '/' . basename( $uploaded_file_path ),
'post_mime_type' => $filetype['type'],
'post_title' => esc_attr( $post_title ),
'post_content' => '',
'post_status' => 'inherit'
);
// Set the post parent id if there is one
if( ! is_null( $parent_post_id ) && absint( $parent_post_id ) ){
$attachment['post_parent'] = absint( $parent_post_id );
}
// Insert the attachment.
$attach_id = wp_insert_attachment( $attachment, $uploaded_file_path );
//Error check
if( !is_wp_error( $attach_id ) ) {
//Generate wp attachment meta data
if( file_exists( ABSPATH . 'wp-admin/includes/image.php') && file_exists( ABSPATH . 'wp-admin/includes/media.php') ) {
require_once( ABSPATH . 'wp-admin/includes/image.php' );
require_once( ABSPATH . 'wp-admin/includes/media.php' );
$attach_data = wp_generate_attachment_metadata( $attach_id, $uploaded_file_path );
wp_update_attachment_metadata( $attach_id, $attach_data );
} // end if file exists check
} // end if error check
return $attach_id;
} else {
return false;
} // end if $filetype
} // end function jdn_create_image_id
function fix_attachment_url($url){
$url = str_replace('sites/'.get_current_blog_id().'/sites','sites',$url);
return $url;
}
add_filter( 'wp_get_attachment_url', 'fix_attachment_url', 10, 1 );
//===============================================================================
// Let's redirect the user to the list of contracts, immediately after
// creating a new Contract
//===============================================================================
function redirect_to_contract_list( ){
$contract_list = home_url( '/contracts/?search_contracts=&vendor_characteristic=&order_by_column=contract_name' );
return array( 'redirect' => $contract_list );
}
//add_filter( 'gform_confirmation', 'redirect_to_contract_list', $priority = 10, $args = 0 );
function purchasing_scripts() {
wp_enqueue_script( 'purchasing-js', plugin_dir_url( __FILE__ ) . '/purchasing.js', array( 'jquery' ));
}
add_action( 'wp_enqueue_scripts', 'purchasing_scripts' );
add_action( 'pre_get_posts', function( $q )
{
if( $title = $q->get( '_meta_or_title' ) )
{
add_filter( 'get_meta_sql', function( $sql ) use ( $title )
{
global $wpdb;
// Only run once:
static $nr = 0;
if( 0 != $nr++ ) return $sql;
// Modify WHERE part:
$sql['where'] = sprintf(
" AND ( %s OR %s ) ",
$wpdb->prepare( "{$wpdb->posts}.post_title LIKE '%%%s%%'", $title ),
mb_substr( $sql['where'], 5, mb_strlen( $sql['where'] ) )
);
return $sql;
});
}
});
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'group_5915d82d3b8ee',
'title' => 'Contract',
'fields' => array (
array (
'key' => 'field_5915e2349513b',
'label' => 'Contract Status',
'name' => 'contract_status',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array (
'New' => 'New',
'Update' => 'Update',
),
'default_value' => array (
),
'allow_null' => 0,
'multiple' => 0,
'ui' => 0,
'ajax' => 0,
'return_format' => 'value',
'placeholder' => '',
),
array (
'key' => 'field_5915d83a1dcda',
'label' => 'Contract Type',
'name' => 'contract_type',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array (
'0-100' => 'On-Call S/MBE GC and Trade Contracts (0 – 100k)',
'100-500' => 'On-Call GC and Trade Contracts (100k – 500k)',
'Professional' => 'On-Call Professional Services Contracts',
'Construction-Awards' => 'Open-Bid Construction Awards',
'Professional-Services-Awards' => 'Open-Bid Professional Services Awards',
),
'default_value' => array (
),
'allow_null' => 0,
'multiple' => 0,
'ui' => 0,
'ajax' => 0,
'return_format' => 'value',
'placeholder' => '',
),
array (
'key' => 'field_5915d86a8679d',
'label' => 'Contract No.',
'name' => 'contract_number',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '0-100',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '100-500',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915d8818679e',
'label' => 'Contract Expires',
'name' => 'contract_expires',
'type' => 'date_picker',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '0-100',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '100-500',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'display_format' => 'Y/m/d',
'return_format' => 'Y/m/d',
'first_day' => 0,
),
array (
'key' => 'field_5915d8b72f116',
'label' => 'Vendor Name',
'name' => 'contract_vendor_name',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '0-100',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '100-500',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915d8c52f117',
'label' => 'Contact Name',
'name' => 'contract_contact_name',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '0-100',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '100-500',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915d8eb2f118',
'label' => 'Contact Phone',
'name' => 'contract_contact_phone',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '0-100',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '100-500',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915d95b2f11a',
'label' => 'Contract File',
'name' => 'contract_file',
'type' => 'file',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '0-100',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => '100-500',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'array',
'library' => 'all',
'min_size' => '',
'max_size' => '',
'mime_types' => '',
),
array (
'key' => 'field_5915e03eefff5',
'label' => 'Project/Bid Number',
'name' => 'cpca_project_number',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915e063efff7',
'label' => 'Award Date',
'name' => 'cpca_award_date',
'type' => 'date_picker',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'display_format' => 'Y/m/d',
'return_format' => 'Y/m/d',
'first_day' => 0,
),
array (
'key' => 'field_5915e08fefff8',
'label' => 'Award Description',
'name' => 'cpca_award_description',
'type' => 'textarea',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'new_lines' => 'wpautop',
),
array (
'key' => 'field_5915e056efff6',
'label' => 'Firm Awarded',
'name' => 'cpca_firm_awarded',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915e34d39dc2',
'label' => 'Contract Value',
'name' => 'cpca_contract_value',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915e0d2efff9',
'label' => 'Contact Name',
'name' => 'cpca_contact_name',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915e0e4efffa',
'label' => 'Contact Phone',
'name' => 'cpca_contact_phone',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array (
'key' => 'field_5915e0f8efffb',
'label' => 'Contact Email',
'name' => 'cpca_contact_email',
'type' => 'email',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Construction-Awards',
),
),
array (
array (
'field' => 'field_5915d83a1dcda',
'operator' => '==',
'value' => 'Professional-Services-Awards',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
),
array (
'key' => 'field_5915d90a2f119',
'label' => 'Vendor Characteristics',
'name' => 'contract_vendor_characteristics',
'type' => 'checkbox',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array (
'CCV' => 'CCV',
'CCV+' => 'CCV+',
'CTB' => 'CTB',
'DISBE' => 'DISBE',
'MBE' => 'MBE',
'SBE' => 'SBE',
'WBE' => 'WBE',
),
'allow_custom' => 0,
'save_custom' => 0,
'default_value' => array (
),
'layout' => 'vertical',
'toggle' => 0,
'return_format' => 'value',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'uc_contract',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
));
endif;
?>