Fix report_awards for new sponsor format

This commit is contained in:
james 2009-01-21 20:13:30 +00:00
parent f25a6d1e6b
commit 7e250693af

View File

@ -63,88 +63,88 @@ $report_awards_fields = array(
'name' => 'Sponsor -- Organization', 'name' => 'Sponsor -- Organization',
'header' => 'Sponsor Organization', 'header' => 'Sponsor Organization',
'width' => 2.0, 'width' => 2.0,
'table' => 'award_sponsors.organization' ), 'table' => 'sponsors.organization' ),
'sponsor_phone' => array( 'sponsor_phone' => array(
'name' => 'Sponsor -- Phone', 'name' => 'Sponsor -- Phone',
'header' => 'Sp. Phone', 'header' => 'Sp. Phone',
'width' => 1, 'width' => 1,
'table' => 'award_sponsors.phone' ), 'table' => 'sponsors.phone' ),
'sponsor_fax' => array( 'sponsor_fax' => array(
'name' => 'Sponsor -- Fax', 'name' => 'Sponsor -- Fax',
'header' => 'Sp. Fax', 'header' => 'Sp. Fax',
'width' => 1, 'width' => 1,
'table' => 'award_sponsors.fax' ), 'table' => 'sponsors.fax' ),
'sponsor_address' => array( 'sponsor_address' => array(
'name' => 'Sponsor -- Street Address', 'name' => 'Sponsor -- Street Address',
'header' => 'Sponsor Address', 'header' => 'Sponsor Address',
'width' => 2.0, 'width' => 2.0,
'table' => 'award_sponsors.address'), 'table' => 'sponsors.address'),
'sponsor_city' => array( 'sponsor_city' => array(
'name' => 'Sponsor -- City', 'name' => 'Sponsor -- City',
'header' => 'Sp. City', 'header' => 'Sp. City',
'width' => 1.5, 'width' => 1.5,
'table' => 'award_sponsors.city' ), 'table' => 'sponsors.city' ),
'sponsor_province' => array( 'sponsor_province' => array(
'name' => 'Sponsor -- '.$config['provincestate'], 'name' => 'Sponsor -- '.$config['provincestate'],
'header' => 'Sp. '.$config['provincestate'], 'header' => 'Sp. '.$config['provincestate'],
'width' => 0.75, 'width' => 0.75,
'table' => 'award_sponsors.province_code' ), 'table' => 'sponsors.province_code' ),
'sponsor_postal' => array( 'sponsor_postal' => array(
'name' => 'Sponsor -- '.$config['postalzip'], 'name' => 'Sponsor -- '.$config['postalzip'],
'header' => 'Sp. '.$config['postalzip'], 'header' => 'Sp. '.$config['postalzip'],
'width' => 0.75, 'width' => 0.75,
'table' => 'award_sponsors.postalcode' ), 'table' => 'sponsors.postalcode' ),
'sponsor_notes' => array( 'sponsor_notes' => array(
'name' => 'Sponsor -- Notes', 'name' => 'Sponsor -- Notes',
'header' => 'Sponsor Notes', 'header' => 'Sponsor Notes',
'width' => 3, 'width' => 3,
'table' => 'award_sponsors.notes' ), 'table' => 'sponsors.notes' ),
'sponsor_confirmed' => array( 'sponsorship_status' => array(
'name' => 'Sponsor -- Confirmed', 'name' => 'Sponsorship -- Status',
'header' => 'Sp. Confirmed', 'header' => 'Sp. Status',
'width' => .5, 'width' => .5,
'table' => 'award_sponsors.confirmed', 'table' => 'sponsorships.status',
'value_map' => array ('no' => 'No', 'yes' => 'Yes')), 'value_map' => array ('pending' => 'Pending', 'confirmed' => 'Confirmed'), "received"=>"Received"),
'pcontact_salutation' => array( 'pcontact_salutation' => array(
'name' => 'Primary Contact -- Salutation', 'name' => 'Primary Contact -- Salutation',
'header' => 'Cnct. Salutation', 'header' => 'Cnct. Salutation',
'width' => 1.0, 'width' => 1.0,
'table' => 'PRIMARYCONTACT.salutation' ), 'table' => 'PRIMARYCONTACTUSER.salutation' ),
'pcontact_last_name' => array( 'pcontact_last_name' => array(
'name' => 'Primary Contact -- Last Name', 'name' => 'Primary Contact -- Last Name',
'header' => 'Cnct. Last Name', 'header' => 'Cnct. Last Name',
'width' => 1.0, 'width' => 1.0,
'table' => 'PRIMARYCONTACT.lastname' ), 'table' => 'PRIMARYCONTACTUSER.lastname' ),
'pcontact_first_name' => array( 'pcontact_first_name' => array(
'name' => 'Primary Contact -- First Name', 'name' => 'Primary Contact -- First Name',
'header' => 'Cnct. First Name', 'header' => 'Cnct. First Name',
'width' => 1.0, 'width' => 1.0,
'table' => 'PRIMARYCONTACT.firstname' ), 'table' => 'PRIMARYCONTACTUSER.firstname' ),
'pcontact_name' => array( 'pcontact_name' => array(
'name' => 'Primary Contact -- Full Name (last, first)', 'name' => 'Primary Contact -- Full Name (last, first)',
'header' => 'Contact Name', 'header' => 'Contact Name',
'width' => 1.75, 'width' => 1.75,
'table' => "CONCAT(PRIMARYCONTACT.lastname, ', ', PRIMARYCONTACT.firstname)", 'table' => "CONCAT(PRIMARYCONTACTUSER.lastname, ', ', PRIMARYCONTACTUSER.firstname)",
'table_sort'=> 'PRIMARYCONTACT.lastname' ), 'table_sort'=> 'PRIMARYCONTACTUSER.lastname' ),
'pcontact_namefl' => array( 'pcontact_namefl' => array(
'name' => 'Primary Contact -- Full Name (salutation first last)', 'name' => 'Primary Contact -- Full Name (salutation first last)',
'header' => 'Contact Name', 'header' => 'Contact Name',
'width' => 1.75, 'width' => 1.75,
'table' => "CONCAT(PRIMARYCONTACT.salutation, ' ', PRIMARYCONTACT.firstname, ' ', PRIMARYCONTACT.lastname)", 'table' => "CONCAT(PRIMARYCONTACTUSER.salutation, ' ', PRIMARYCONTACTUSER.firstname, ' ', PRIMARYCONTACTUSER.lastname)",
'table_sort'=> 'PRIMARYCONTACT.lastname' ), 'table_sort'=> 'PRIMARYCONTACTUSER.lastname' ),
'pcontact_position' => array( 'pcontact_position' => array(
'name' => 'Primary Contact -- Position', 'name' => 'Primary Contact -- Position',
@ -156,37 +156,37 @@ $report_awards_fields = array(
'name' => 'Primary Contact -- Email', 'name' => 'Primary Contact -- Email',
'header' => 'Cnct. Email', 'header' => 'Cnct. Email',
'width' => 2.0, 'width' => 2.0,
'table' => 'PRIMARYCONTACT.email'), 'table' => 'PRIMARYCONTACTUSER.email'),
'pcontact_hphone' => array( 'pcontact_hphone' => array(
'name' => 'Primary Contact -- Home Phone', 'name' => 'Primary Contact -- Home Phone',
'header' => 'Cnct. Home', 'header' => 'Cnct. Home',
'width' => 1, 'width' => 1,
'table' => 'PRIMARYCONTACT.phonehome' ), 'table' => 'PRIMARYCONTACTUSER.phonehome' ),
'pcontact_wphone' => array( 'pcontact_wphone' => array(
'name' => 'Primary Contact -- Work Phone', 'name' => 'Primary Contact -- Work Phone',
'header' => 'Cnct. Work', 'header' => 'Cnct. Work',
'width' => 1, 'width' => 1,
'table' => 'PRIMARYCONTACT.phonework' ), 'table' => 'PRIMARYCONTACTUSER.phonework' ),
'pcontact_cphone' => array( 'pcontact_cphone' => array(
'name' => 'Primary Contact -- Cell Phone', 'name' => 'Primary Contact -- Cell Phone',
'header' => 'Cnct. Cell', 'header' => 'Cnct. Cell',
'width' => 1, 'width' => 1,
'table' => 'PRIMARYCONTACT.phonecell' ), 'table' => 'PRIMARYCONTACTUSER.phonecell' ),
'pcontact_fax' => array( 'pcontact_fax' => array(
'name' => 'Primary Contact -- Fax', 'name' => 'Primary Contact -- Fax',
'header' => 'Cnct. Fax', 'header' => 'Cnct. Fax',
'width' => 1, 'width' => 1,
'table' => 'PRIMARYCONTACT.fax' ), 'table' => 'PRIMARYCONTACTUSER.fax' ),
'pcontact_notes' => array( 'pcontact_notes' => array(
'name' => 'Primary Contact -- Notes', 'name' => 'Primary Contact -- Notes',
'header' => 'Contact Notes', 'header' => 'Contact Notes',
'width' => 3, 'width' => 3,
'table' => 'PRIMARYCONTACT.notes' ), 'table' => 'PRIMARYCONTACTUSER.notes' ),
'judgeteamname' => array( 'judgeteamname' => array(
'components' => array('judgingteam'), 'components' => array('judgingteam'),
@ -248,12 +248,14 @@ $report_awards_fields = array(
$q = " FROM award_awards $q = " FROM award_awards
LEFT JOIN award_sponsors ON ( LEFT JOIN sponsors ON (
award_sponsors.id=award_awards.award_sponsors_id) sponsors.id=award_awards.sponsors_id)
LEFT JOIN award_types ON award_types.id=award_types_id LEFT JOIN award_types ON award_types.id=award_types_id
LEFT JOIN award_contacts AS PRIMARYCONTACT ON ( LEFT JOIN users_sponsor AS PRIMARYCONTACT ON (
PRIMARYCONTACT.award_sponsors_id=award_sponsors.id PRIMARYCONTACT.sponsors_id=sponsors.id
AND PRIMARYCONTACT.`primary`='yes') AND PRIMARYCONTACT.`primary`='yes')
LEFT JOIN users AS PRIMARYCONTACTUSER ON (
PRIMARYCONTACT.users_id=PRIMARYCONTACTUSER.id)
$judges_join $judges_join
$judges_members_join $judges_members_join
WHERE WHERE