<?php
// $Header: /home/CVS/rps/sfs/sfs_query.php,v 1.12 2008/10/12 22:20:21 yoxel Exp $
/*
* ----START-LICENCE----
* Copyright 2002-2008 Yoxel Systems, Santa Clara, CA, USA (hide@address.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
* -----END-LICENCE-----
*/
require_once('../includes/db.inc');
require_once('includes/sfs/sfs.inc');
if($is_customer)
_quit_error("You are not allowed to use this part of the site.");
$rts = new ForecastTracker();
$pqs_2d=&$rts->pqs_2d;
$FldList = array(
'expected_close_date' => array(
'name'=>'Close Date',
'input' => 'date',
'vbc'=>FALSE),
'r|pid' => array(
'name'=>'Product',
'input' => 'select',
'values' => &$pqs_2d['name'],
'vbc'=>FALSE),
'state'=> array(
'name'=>'State',
'input' => 'select',
'values' => &$rts->state2str,
'vbc'=>FALSE),
'r|customer_id'=> array(
'name'=>'Customer',
'input' => 'select',
'values' => &$customers_2d['name'],
'vbc'=>FALSE),
'fixer_uid'=> array(
'name'=>'Owner',
'input' => 'select',
'values' => '%workers',
'vbc'=>FALSE),
'synopsis'=>array(
'name'=>'Opportunity Name',
'input' => 'text',
'vbc'=>FALSE),
'description'=>array(
'name'=>'Description',
'input' => 'text',
'vbc'=>FALSE),
'rpp' => array(
'name'=>'Requests Per Page',
'input' => 'rselect',
'local' => TRUE,
'values' => array(25=>25,50=>50,100=>100),
'vbc'=>TRUE)
);
$ConfigJoins = array(
'std_join_pq' => TRUE,
'std_join_cust' => TRUE,
'custom_join' => "LEFT OUTER JOIN users AS u ON r.current_owner=u.uid",
'custom_fields' => "u.last_name AS lname, DATE_FORMAT(expected_close_date,'%m/%d/%y') AS ecdate");
$OutputFormat =array(
'ID' => array('field' => 'rid',
'eval' =>'$tmp=$row[\'phase_of_rid\']?(\'⇒ \'.$row[\'rid\']):($row[\'rid\'].\' \');'),
'Expected By' => array('field' => 'ecdate'),
'Account' => array('field' => 'account_name'),
'Product' => array('field' => 'pq_name'),
'Amount' => array('field' => 'booking_amount',
'align'=>'center',),
'State' => array('field' => 'state',
'align'=>'center',
'eval'=>'$tmp=$obj->state2str[$row[\'state\']];'),
'Responsible' => array('field' => 'lname',
'eval'=>'$tmp=YxlUsers::name($row[\'current_owner\']); if(!$tmp) $tmp="N/A";',
'align'=>'center'),
'Opportunity Name' => array('field_name' => 'synopsis',
'eval' => '$tmp=html_safe_text($row[\'synopsis\']);'),
);
$SummaryFormat = array(
array('header' => 'Your pipeline of selected opportunities',
'title' => 'Estimated Booking Amount $$$',
'sql_func' => 'SUM(r.booking_amount)',
'period' => 'expected_close_date')
);
require_once('includes/rts/rts_query_inc.php');
?>