[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 /********************************************************************************* 3 * The contents of this file are subject to the SugarCRM Public License Version 1.1.2 4 * ("License"); You may not use this file except in compliance with the 5 * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL 6 * Software distributed under the License is distributed on an "AS IS" basis, 7 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for 8 * the specific language governing rights and limitations under the License. 9 * The Original Code is: SugarCRM Open Source 10 * The Initial Developer of the Original Code is SugarCRM, Inc. 11 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.; 12 * All Rights Reserved. 13 * Contributor(s): ______________________________________. 14 ********************************************************************************/ 15 /********************************************************************************* 16 * $Header$ 17 * Description: returns HTML for client-side image map. 18 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. 19 * All Rights Reserved. 20 * Contributor(s): ______________________________________.. 21 ********************************************************************************/ 22 23 require_once ('include/utils/utils.php'); 24 require_once ('include/logging.php'); 25 require_once ("modules/Potentials/Charts.php"); 26 require_once ('include/ComboUtil.php'); 27 global $current_language, $ids, $tmp_dir; 28 $current_module_strings = return_module_language($current_language, 'Dashboard'); 29 30 // Get _dom arrays from Database 31 $comboFieldNames = Array('leadsource'=>'lead_source_dom'); 32 $comboFieldArray = getComboArray($comboFieldNames); 33 34 $log = LoggerManager::getLogger('CSIM_pipeline_by_lead_source'); 35 36 if (isset($_REQUEST['pbls_refresh'])) { $refresh = $_REQUEST['pbls_refresh']; } 37 else { $refresh = false; } 38 39 // added for auto refresh 40 $refresh = true; 41 // 42 43 $tempx = array(); 44 $datax = array(); 45 //get list of sales stage keys to display 46 if (isset($_SESSION['pbls_lead_sources']) && count($_SESSION['pbls_lead_sources']) > 0 && !isset($_REQUEST['pbls_lead_sources'])) { 47 $tempx = $_SESSION['pbls_lead_sources']; 48 $log->debug("_SESSION['pbls_lead_sources'] is:"); 49 $log->debug($_SESSION['pbls_lead_sources']); 50 } 51 elseif (isset($_REQUEST['pbls_lead_sources']) && count($_REQUEST['pbls_lead_sources']) > 0) { 52 $tempx = $_REQUEST['pbls_lead_sources']; 53 $current_user->setPreference('pbls_lead_sources', $_REQUEST['pbls_lead_sources']); 54 $log->debug("_REQUEST['pbls_lead_sources'] is:"); 55 $log->debug($_REQUEST['pbls_lead_sources']); 56 $log->debug("_SESSION['pbls_lead_sources'] is:"); 57 $log->debug($_SESSION['pbls_lead_sources']); 58 } 59 60 //set $datax using selected sales stage keys 61 if (count($tempx) > 0) { 62 foreach ($tempx as $key) { 63 $datax[$key] = $comboFieldArray['lead_source_dom'][$key]; 64 } 65 } 66 else { 67 $datax = $comboFieldArray['lead_source_dom']; 68 } 69 $log->debug("datax is:"); 70 $log->debug($datax); 71 72 $ids = array(); 73 //get list of user ids for which to display data 74 if (isset($_SESSION['pbls_ids']) && count($_SESSION['pbls_ids']) != 0 && !isset($_REQUEST['pbls_ids'])) { 75 $ids = $_SESSION['pbls_ids']; 76 $log->debug("_SESSION['pbls_ids'] is:"); 77 $log->debug($_SESSION['pbls_ids']); 78 } 79 elseif (isset($_REQUEST['pbls_ids']) && count($_REQUEST['pbls_ids']) > 0) { 80 $ids = $_REQUEST['pbls_ids']; 81 $current_user->setPreference('pbls_ids', $ids); 82 $log->debug("_REQUEST['pbls_ids'] is:"); 83 $log->debug($_REQUEST['pbls_ids']); 84 $log->debug("_SESSION['pbls_ids'] is:"); 85 $log->debug($_SESSION['pbls_ids']); 86 } 87 else { 88 $ids = get_user_array(false); 89 $ids = array_keys($ids); 90 } 91 92 //create unique prefix based on selected vtiger_users for image vtiger_files 93 $id_hash = ''; 94 if (isset($ids)) { 95 sort($ids); 96 $id_hash = crc32(implode('',$ids)); 97 } 98 $log->debug("ids is:"); 99 $log->debug($ids); 100 101 $cache_file_name = $id_hash."_pipeline_by_lead_source_".$current_language."_".crc32(implode('',$datax)).".png"; 102 $log->debug("cache file name is: $cache_file_name"); 103 104 if(isPermitted('Potentials','index')=="yes") 105 { 106 $draw_this = new jpgraph(); 107 $width = 850; 108 $height = 500; 109 if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') 110 { 111 $width = 350; 112 $height = 250; 113 } 114 115 116 echo $draw_this->pipeline_by_lead_source($datax, $ids, $tmp_dir.$cache_file_name, $refresh,$width,$height); 117 echo "<P><font size='1'><em>".$current_module_strings['LBL_LEAD_SOURCE_FORM_DESC']."</em></font></P>"; 118 if (isset($_REQUEST['pbls_edit']) && $_REQUEST['pbls_edit'] == 'true') { 119 ?> 120 <form action="index.php" method="post" > 121 <input type="hidden" name="module" value="<?php echo $currentModule;?>"> 122 <input type="hidden" name="action" value="<?php echo $action;?>"> 123 <input type="hidden" name="pbls_refresh" value="true"> 124 <table cellpadding="2" border="0"><tbody> 125 <tr> 126 <td valign='top' nowrap><?php echo $current_module_strings['LBL_LEAD_SOURCES'];?></td> 127 <td valign='top'><select name="pbls_lead_sources[]" multiple size='3'><?php echo get_select_options_with_id($comboFieldArray['lead_source_dom'],$_SESSION['pbls_lead_sources']); ?></select></td> 128 </tr><tr> 129 <td valign='top' nowrap><?php echo $current_module_strings['LBL_USERS'];?></td> 130 <td valign='top'><select name="pbls_ids[]" multiple size='3'><?php echo get_select_options_with_id(get_user_array(false),$_SESSION['pbls_ids']); ?></select></td> 131 </tr><tr> 132 <td align="right"><br /> <input class="button" type="submit" title="<?php echo $app_strings['LBL_SELECT_BUTTON_TITLE']; ?>" accessKey="<?php echo $app_strings['LBL_SELECT_BUTTON_KEY']; ?>" value="<?php echo $app_strings['LBL_SELECT_BUTTON_LABEL']?>" /></td> 133 </tr></table> 134 </form> 135 <?php } 136 else { 137 if (file_exists($tmp_dir.$cache_file_name)) { 138 $file_date = getDisplayDate(date('Y-m-d H:i', filemtime($tmp_dir.$cache_file_name))); 139 } 140 else { 141 $file_date = ''; 142 } 143 ?> 144 <div align=right><FONT size='1'> 145 <em><?php echo $current_module_strings['LBL_CREATED_ON'].' '.$file_date; ?> 146 </em>[<a href="javascript:void(0)" onClick="changeView('DashboardHome','NORMAL');"><?php echo $current_module_strings['LBL_REFRESH'];?></a>] 147 [<a href="index.php?module=<?php echo $currentModule;?>&action=index&pbls_edit=true"><?php echo $current_module_strings['LBL_EDIT'];?></a>] 148 </FONT></div> 149 <?php } 150 } 151 else 152 { 153 echo $mod_strings['LBL_NO_PERMISSION']; 154 } 155 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |