'; $button = '
'.$button.'
'; // Added to have Purchase Order as form Title if($relatedmodule == 'Orders') { echo get_form_header($app_strings['PurchaseOrder'],$button, false); } else { echo get_form_header($app_strings[$relatedmodule],$button, false); } $xtpl=new XTemplate ('include/RelatedListView.html'); require_once('themes/'.$theme.'/layout_utils.php'); $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; $xtpl->assign("MOD", $mod_strings); $xtpl->assign("APP", $app_strings); $xtpl->assign("IMAGE_PATH",$image_path); //Retreive the list from Database //$query = getListQuery("Accounts"); //Appending the security parameter global $others_permission_id; global $current_user; $rel_tab_id = getTabid($relatedmodule); $defSharingPermissionData = $_SESSION['defaultaction_sharing_permission_set']; $others_rel_permission_id = $defSharingPermissionData[$rel_tab_id]; if($others_rel_permission_id == 3 && $relatedmodule != 'Notes' && $relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook') //Security fix by Don { $query .= " and crmentity.smownerid in(".$current_user->id .",0)"; } if(isset($where) && $where != '') { $query .= ' and '.$where; } //Appending the group by for Jaguar/Don if($relatedmodule == 'Activities') { $query .= ' group by crmentity.crmid'; } //$url_qry = getURLstring($focus); if(isset($order_by) && $order_by != '') { $query .= ' ORDER BY '.$order_by; $url_qry .="&order_by=".$order_by; } $list_result = $adb->query($query); //Retreiving the no of rows $noofrows = $adb->num_rows($list_result); //Retreiving the start value from request if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') { $start = $_REQUEST['start']; } else { $start = 1; } //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); //Retreive the List View Table Header if($noofrows == 0) { echo $app_strings['LBL_NONE_SCHEDULED']; } else { $listview_header = getListViewHeader($focus,$relatedmodule,'','','','relatedlist');//"Accounts"); $xtpl->assign("LISTHEADER", $listview_header); if($module == 'PriceBook' && $relatedmodule == 'Products') { $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,$edit_val,$del_val); } if($module == 'Products' && $relatedmodule == 'PriceBook') { $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'PriceBookEditView','DeletePriceBookProductRel'); } elseif($relatedmodule == 'SalesOrder') { $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'SalesOrderEditView','DeleteSalesOrder'); }else { $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset); } //$listview_entries = getListViewEntries1($focus,"Accounts",$list_result,$navigation_array); $xtpl->assign("LISTENTITY", $listview_entries); $xtpl->assign("SELECT_SCRIPT", $view_script); $navigationOutput = getTableHeaderNavigation($navigation_array, $url_qry,$relatedmodule); //echo $navigationOutput; //$xtpl->assign("NAVIGATION", $navigationOutput); $xtpl->parse("main"); $xtpl->out("main"); } } function getAttachmentsAndNotes($parentmodule,$query,$id,$sid='') { global $theme; $list = ''; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once ($theme_path."layout_utils.php"); global $adb; global $mod_strings; global $app_strings; $result=$adb->query($query); $noofrows = $adb->num_rows($result); if($sid=='salesorderid') { $return_action = "SalesOrderDetailView"; } else { $return_action = "DetailView"; } $button .= '
'; $button .= ''; $button .= ' '; if(isPermitted("Notes",1,"") == 'yes') { $button .= ' '; } $button .= '
'; echo '

'; echo get_form_header($app_strings['LBL_ATTACHMENT_AND_NOTES'],$button, false); if($noofrows == 0) { echo $app_strings['LBL_NONE_SCHEDULED']; } else { $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $i=1; while($row = $adb->fetch_array($result)) { if($row[1] == 'Notes') { $module = 'Notes'; $editaction = 'EditView'; $deleteaction = 'Delete'; } elseif($row[1] == 'Attachments') { $module = 'uploads'; $editaction = 'upload'; $deleteaction = 'deleteattachments'; } if ($i%2==0) $trowclass = 'evenListRow'; else $trowclass = 'oddListRow'; $list .= ''; $list .= ''; elseif($module == 'uploads') $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $i++; } $list .= ''; $list .= '
'; $list .= ''; $list .= $app_strings['LBL_TITLE_OR_DESCRIPTION'].''; $list .= ''; $list .= $app_strings['LBL_ENTITY_TYPE'].''; $list .= ''; $list .= $app_strings['LBL_FILENAME'].''; $list .= ''; $list .= $app_strings['LBL_TYPE'].''; $list .= ''; $list .= $app_strings['LBL_LAST_MODIFIED'].''; $list .= ''; $list .= $app_strings['LBL_ACTION'].''; $list .= ''; $list .= '
'; if($module == 'Notes') $list .= ''.$row[0].''.$row[0].''; $list .= ''; $list .= $row[1]; $list .= ''; $list .= ''; $list .= ''.$row[2].''; $list .= ''; $list .= ''; $list .= $row[3]; $list .= ''; $list .= ''; if($row[4] != '0000-00-00 00:00:00') $list .= $row[4]; else $list .= ''; $list .= ''; $list .= ''; if($row[1] == 'Notes') $list .= ''.$app_strings['LNK_EDIT'].' | '; // $list .= ''.$app_strings['LNK_DELETE'].''; $del_param = 'index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action='.$return_action.'&record='.$row["crmid"].'&filename='.$row[2].'&return_id='.$_REQUEST["record"]; $list .= ''.$app_strings['LNK_DELETE'].''; $list .= '
'; echo $list; } } function getHistory($parentmodule,$query,$id) { global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once ($theme_path."layout_utils.php"); global $adb; global $mod_strings; global $app_strings; //Appending the security parameter global $others_permission_id; global $current_user; $rel_tab_id = getTabid("Activities"); $defSharingPermissionData = $_SESSION['defaultaction_sharing_permission_set']; $others_rel_permission_id = $defSharingPermissionData[$rel_tab_id]; if($others_rel_permission_id == 3) //Security fix by Don { $query .= " and crmentity.smownerid in(".$current_user->id .",0)"; } $result=$adb->query($query); $noofrows = $adb->num_rows($result); $button .= '
'; $button .= '
'; echo '

'; echo get_form_header($app_strings['LBL_HISTORY'],'', false); if($noofrows == 0) { echo $app_strings['LBL_NONE_SCHEDULED']; } else { $list .= ''; $list .= ''; $list .= ''; // $list .= $app_strings['LBL_ICON'].'Icon'; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $i=1; while($row = $adb->fetch_array($result)) { if($row['activitytype'] == 'Task') { $activitymode = 'Task'; $icon = 'Tasks.gif'; $status = $row['status']; } elseif($row['activitytype'] == 'Call' || $row['activitytype'] == 'Meeting') { $activitymode = 'Events'; $icon = 'Activities.gif'; $status = $row['eventstatus']; } if ($i%2==0) $trowclass = 'evenListRow'; else $trowclass = 'oddListRow'; $list .= ''; $list .= ''; $list .= ''; $list .= ''; $list .= ''; if($row['firstname'] != 'NULL') $contactname = $row['firstname'].' '; if($ros['lastname'] != 'NULL') $contactname .= $row['lastname']; $list .= ''; $parentname = getRelatedTo('Activities',$result,$i-1); $list .= ''; $list .= ''; $list .= ''; $i++; } $list .= '
'; $list .= ''; $list .= ''; $list .= $app_strings['LBL_SUBJECT'].''; $list .= ''; $list .= $app_strings['LBL_STATUS'].''; $list .= ''; $list .= $app_strings['LBL_LIST_CONTACT_NAME'].''; $list .= ''; $list .= $app_strings['LBL_RELATED_TO'].''; $list .= ''; $list .= $app_strings['LBL_LAST_MODIFIED'].''; $list .= ''; $list .= $app_strings['LBL_ACTION'].''; $list .= ''; $list .= '
'; $list .= ''; $list .= ''; $list .= ''.$row['subject'].''; $list .= ''; $list .= $status.''; $list .= ''; $list .= ''; $list .= ''.$contactname; $list .= ''; $list .= ''; $list .= $parentname; $list .= ''; $list .= ''; $modifiedtime = getDisplayDate($row['modifiedtime']); $list .= $modifiedtime; $list .= ''; $list .= ''; if(isPermitted("Activities",1,$row["activityid"]) == 'yes') { $list .= ''.$app_strings['LNK_EDIT'].' | '; } if(isPermitted("Activities",2,$row["activityid"]) == 'yes') { $list .= ''.$app_strings['LNK_DELETE'].''; } $list .= '
'; echo $list; } } function getPriceBookRelatedProducts($query,$focus,$returnset='') { global $adb; global $app_strings; global $mod_strings; global $current_language; $current_module_strings = return_module_language($current_language, 'Products'); global $list_max_entries_per_page; global $urlPrefix; global $theme; $pricebook_id = $_REQUEST['record']; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); $list_result = $adb->query($query); $num_rows = $adb->num_rows($list_result); $xtpl=new XTemplate('include/RelatedListView.html'); $xtpl->assign("MOD", $mod_strings); $xtpl->assign("APP", $app_strings); $xtpl->assign("IMAGE_PATH",$image_path); echo '
'; $other_text = ''; $other_text .=''; $other_text .='
'; //Retreive the list from Database echo get_form_header($current_module_strings['LBL_LIST_FORM_TITLE'], $other_text, false ); //echo $list_query; $list_result = $adb->query($query); $num_rows = $adb->num_rows($list_result); //Retreive the List View Table Header $list_header = ''; $list_header .= ''; $list_header .= ''; $list_header .= ''.$mod_strings['LBL_LIST_PRODUCT_NAME'].''; $list_header .=''; $list_header .= ''.$mod_strings['LBL_PRODUCT_CODE'].''; $list_header .=''; $list_header .= ''.$mod_strings['LBL_PRODUCT_UNIT_PRICE'].''; $list_header .=''; $list_header .= ''.$mod_strings['LBL_PB_LIST_PRICE'].''; $list_header .=''; $list_header .= 'Edit|Del'; $list_header .=''; $list_header .= ''; $xtpl->assign("LISTHEADER", $list_header); $list_body =''; for($i=0; $i<$num_rows; $i++) { $entity_id = $adb->query_result($list_result,$i,"crmid"); if (($i%2)==0) $list_body .= ''; else $list_body .= ''; $unit_price = $adb->query_result($list_result,$i,"unit_price"); $listprice = $adb->query_result($list_result,$i,"listprice"); $field_name=$entity_id."_listprice"; $list_body .= ''; $list_body .= ''.$adb->query_result($list_result,$i,"productname").''; $list_body .=''; $list_body .= ''.$adb->query_result($list_result,$i,"productcode").''; $list_body .=''; $list_body .= ''.$unit_price.''; $list_body .=''; $list_body .= ''.$listprice.''; $list_body .=''; $list_body .= 'edit | del'; $list_body .=''; } //$listview_entries = getListViewEntries($focus,"Products",$list_result,$navigation_array); $xtpl->assign("LISTENTITY", $list_body); $xtpl->parse("main"); $xtpl->out("main"); } //echo ''; ?>