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