/** Function to get the field label/permission array to construct the default orgnization field UI for the specified profile 
 * @param $fieldListResult -- mysql query result that contains the field label and uitype:: Type array
 * @param $lang_strings -- i18n language mod strings array:: Type array
 * @param $profileid -- profile id:: Type integer
 * @returns $standCustFld -- field label/permission array :: Type varchar
 *
 */
function getStdOutput($fieldListResult, $noofrows, $lang_strings, $profileid)
{
    global $adb;
    global $image_path, $theme;
    $standCustFld = array();
    for ($i = 0; $i < $noofrows; $i++) {
        $uitype = $adb->query_result($fieldListResult, $i, "uitype");
        $fieldlabel = $adb->query_result($fieldListResult, $i, "fieldlabel");
        $typeofdata = $adb->query_result($fieldListResult, $i, "typeofdata");
        $fieldtype = explode("~", $typeofdata);
        if ($lang_strings[$fieldlabel] != '') {
            $standCustFld[] = $lang_strings[$fieldlabel];
        } else {
            $standCustFld[] = $fieldlabel;
        }
        if ($adb->query_result($fieldListResult, $i, "visible") == 0 || $uitype == 117 && $fieldtype[1] == "M") {
            $visible = "<img src='" . vtiger_imageurl('prvPrfSelectedTick.gif', $theme) . "'>";
        } else {
            $visible = "<img src='" . vtiger_imageurl('no.gif', $theme) . "'>";
        }
        $standCustFld[] = $visible;
    }
    $standCustFld = array_chunk($standCustFld, 2);
    $standCustFld = array_chunk($standCustFld, 4);
    return $standCustFld;
}
Example #2
0
 static function checkAdminAccess($user)
 {
     if (is_admin($user)) {
         return;
     }
     echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
     echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t<tbody><tr>\n\t\t<td rowspan='2' width='11%'><img src= " . vtiger_imageurl('denied.gif', $theme) . " ></td>\n\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'>\n\t\t\t<span class='genHeaderSmall'>{$app_strings['LBL_PERMISSION']}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>\n\t\t</td>\n\t\t</tr>\n\t\t</tbody></table>\n\t\t</div>";
     echo "</td></tr></table>";
     exit;
 }
function showError()
{
    require_once 'include/utils/VtlibUtils.php';
    global $current_user, $currentModule, $theme, $app_strings, $log;
    echo "<link rel='stylesheet' type='text/css' href='themes/{$theme}/style.css'>";
    echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
    echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t<tbody><tr>\n\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'>\n\t\t\t<span class='genHeaderSmall'>" . getTranslatedString('SINGLE_' . $currentModule, $currentModule) . " " . getTranslatedString('CANNOT_CONVERT', $currentModule) . "\n\t\t<br>\n\t\t<ul> " . getTranslatedString('LBL_FOLLOWING_ARE_POSSIBLE_REASONS', $currentModule) . ":\n\t\t\t<li>" . getTranslatedString('LBL_LEADS_FIELD_MAPPING_INCOMPLETE', $currentModule) . "</li>\n\t\t\t<li>" . getTranslatedString('LBL_MANDATORY_FIELDS_ARE_EMPTY', $currentModule) . "</li>\n\t\t</ul>\n\t\t</span>\n\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class='small' align='right' nowrap='nowrap'>";
    if (is_admin($current_user)) {
        echo "<a href='index.php?module=Settings&action=CustomFieldList&parenttab=Settings&formodule=Leads'>" . getTranslatedString('LBL_LEADS_FIELD_MAPPING', $currentModule) . "</a><br>";
    }
    echo "<a href='javascript:window.history.back();'>" . getTranslatedString('LBL_GO_BACK', $currentModule) . "</a><br>";
    echo "</td>\n               </tr>\n\t\t</tbody></table>\n\t\t</div>\n                </td></tr></table>";
}
Example #4
0
/*+********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *********************************************************************************/
require_once 'Smarty_setup.php';
global $mod_strings, $app_strings, $theme, $adb;
$smarty = new vtigerCRM_Smarty();
$module = vtlib_purify($_REQUEST['formodule']);
$menu_array = array();
$menu_array['CustomFields']['location'] = 'index.php?module=Settings&action=CustomFieldList&parenttab=Settings&formodule=' . $module;
$menu_array['CustomFields']['image_src'] = vtiger_imageurl('orgshar.gif', $theme);
$menu_array['CustomFields']['desc'] = getTranslatedString('LBL_USER_CUSTOMFIELDS_DESCRIPTION', 'Users');
$menu_array['CustomFields']['label'] = getTranslatedString('LBL_USER_CUSTOMFIELDS', 'Users');
//add blanks for 3-column layout
$count = count($menu_array) % 3;
if ($count > 0) {
    for ($i = 0; $i < 3 - $count; $i++) {
        $menu_array[] = array();
    }
}
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("IMAGE_PATH", "themes/{$theme}/images/");
$smarty->assign('MODULE', $module);
$smarty->assign('MODULE_LBL', getTranslatedString($module));
$smarty->assign('MENU_ARRAY', $menu_array);
								</table>
							</td>
						   </tr>
						</table>
					</td>
				   </tr>
				</table>
			    </div>

			</td>
		   </tr>
		</table>
	     </div>
	</td>
	<td align=right valign=top><img src="<?php 
echo vtiger_imageurl('showPanelTopRight.gif', $this->_tpl_vars['THEME']);
?>
"></td>
   </tr>
</table>
</form>

<?php 
if (($this->_tpl_vars['MODULE'] == 'Emails' || 'Documents') && $this->_tpl_vars['USE_RTE'] == 'true') {
    ?>
<script type="text/javascript" src="include/ckeditor/ckeditor.js"></script>
<script type="text/javascript" defer="1">
	var textAreaName = null;
	<?php 
    if ($this->_tpl_vars['MODULE'] == 'Documents') {
        ?>
function showhide(argg,imgId)
{
	var harray=argg.split(",");
	var harrlen = harray.length;	
	var i;
	for(i=0; i<harrlen; i++)
	{
		var x=document.getElementById(harray[i]).style;
        	if (x.display=="none")
        	{
           		x.display="block";
			document.getElementById(imgId).src="<?php 
echo vtiger_imageurl('minus.gif', $this->_tpl_vars['THEME']);
?>
";
         	}
        	else
		{
			x.display="none";
			document.getElementById(imgId).src="<?php 
echo vtiger_imageurl('plus.gif', $this->_tpl_vars['THEME']);
?>
";
		}
	}
}



</script>
    $smarty = new vtigerCRM_Smarty();
    $smarty->assign('APP', $appStrings);
    $mod = array_merge(return_module_language($current_language, 'FieldFormulas'), return_module_language($current_language, 'Settings'));
    $jsStrings = array('NEED_TO_ADD_A' => $mod['NEED_TO_ADD_A'], 'CUSTOM_FIELD' => $mod['LBL_CUSTOM_FIELD'], 'LBL_USE_FUNCTION_DASHDASH' => $mod['LBL_USE_FUNCTION_DASHDASH'], 'LBL_USE_FIELD_VALUE_DASHDASH' => $mod['LBL_USE_FIELD_VALUE_DASHDASH'], 'LBL_DELETE_EXPRESSION_CONFIRM' => $mod['LBL_DELETE_EXPRESSION_CONFIRM']);
    $smarty->assign("JS_STRINGS", Zend_Json::encode($jsStrings));
    $smarty->assign("MOD", $mod);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $smarty->assign("MODULE_NAME", 'FieldFormulas');
    $smarty->assign("PAGE_NAME", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_TITLE", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_DESC", 'LBL_FIELDFORMULAS_DESCRIPTION');
    $smarty->assign("FORMODULE", $formodule);
    if (file_exists("modules/{$formodule}/{$formodule}.php")) {
        $focus = CRMEntity::getInstance($formodule);
        $validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, getTabid($formodule)));
        $smarty->assign('VALIDATION_DATA_FIELDNAME', $validationArray['fieldname']);
        $smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']);
        $smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']);
    }
    $smarty->display(vtlib_getModuleTemplate('FieldFormulas', 'EditExpressions.tpl'));
}
$modules = vtGetModules($adb);
if (vtlib_isModuleActive('FieldFormulas') && in_array(getTranslatedString($_REQUEST['formodule']), $modules)) {
    vtEditExpressions($adb, $app_strings, $current_language, $theme, $_REQUEST['formodule']);
} else {
    echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
    echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 80%; position: relative; z-index: 10000000;'>\n\n\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t<tbody><tr>\n\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>" . $app_strings['LBL_PERMISSION'] . " </span></td>\n\t</tr>\n\t<tr>\n\t<td class='small' align='right' nowrap='nowrap'>\n\t<a href='javascript:window.history.back();'>{$app_strings['LBL_BACK']}</a><br></td>\n\t</tr>\n\t</tbody></table>\n\t</div>";
    echo "</td></tr></table>";
    die;
}
Example #8
0
 /**
  * get_tag_cloud_html
  *
  * This is a pretty straightforward, flexible method that automatically
  * generates some html that can be dropped in as a tag cloud.
  * It uses explicit font sizes inside of the style attribute of SPAN 
  * elements to accomplish the differently sized objects.
  *
  * It will also link every tag to $tag_page_url, appended with the 
  * normalized form of the tag. You should adapt this value to your own
  * tag detail page's URL.
  *
  * @param int The maximum number of tags to return. (default: 100)
  * @param int The minimum font size in the cloud. (default: 10)
  * @param int The maximum number of tags to return. (default: 20)
  * @param string The "units" for the font size (i.e. 'px', 'pt', 'em') (default: px)
  * @param string The class to use for all spans in the cloud. (default: cloud_tag)
  * @param string The tag page URL (default: /tag/)
  *
  * @return string Returns an HTML snippet that can be used directly as a tag cloud.
  */
 function get_tag_cloud_html($module = "", $tagger_id = NULL, $obj_id = NULL, $num_tags = 100, $min_font_size = 10, $max_font_size = 20, $font_units = 'px', $span_class = '', $tag_page_url = '/tag/')
 {
     global $theme;
     $theme_path = "themes/" . $theme . "/";
     $image_path = $theme_path . "images/";
     $tag_list = $this->get_tag_cloud_tags($num_tags, $tagger_id, $module, $obj_id);
     if (count($tag_list[0])) {
         // Get the maximum qty of tagged objects in the set
         $max_qty = max(array_values($tag_list[0]));
         // Get the min qty of tagged objects in the set
         $min_qty = min(array_values($tag_list[0]));
     } else {
         return '';
     }
     // For ever additional tagged object from min to max, we add
     // $step to the font size.
     $spread = $max_qty - $min_qty;
     if (0 == $spread) {
         // Divide by zero
         $spread = 1;
     }
     $step = ($max_font_size - $min_font_size) / $spread;
     // Since the original tag_list is alphabetically ordered,
     // we can now create the tag cloud by just putting a span
     // on each element, multiplying the diff between min and qty
     // by $step.
     $cloud_html = '';
     $cloud_spans = array();
     if ($module == '') {
         $module = 'All';
     }
     if ($module != 'All') {
         foreach ($tag_list[0] as $tag => $qty) {
             $size = $min_font_size + ($qty - $min_qty) * $step;
             $cloud_span[] = '<span id="tag_' . $tag_list[1][$tag] . '" class="' . $span_class . '" onMouseOver=$("tagspan_' . $tag_list[1][$tag] . '").style.display="inline"; onMouseOut=$("tagspan_' . $tag_list[1][$tag] . '").style.display="none";><a class="tagit" href="index.php?module=Home&action=UnifiedSearch&search_module=' . $module . '&query_string=' . urlencode($tag) . '" style="font-size: ' . $size . $font_units . '">' . htmlspecialchars(stripslashes($tag)) . '</a><span class="' . $span_class . '" id="tagspan_' . $tag_list[1][$tag] . '" style="display:none;cursor:pointer;" onClick="DeleteTag(' . $tag_list[1][$tag] . ',' . $obj_id . ');"><img src="' . vtiger_imageurl('del_tag.gif', $theme) . '"></span></span>';
         }
     } else {
         foreach ($tag_list[0] as $tag => $qty) {
             $size = $min_font_size + ($qty - $min_qty) * $step;
             $cloud_span[] = '<span class="' . $span_class . '"><a class="tagit" href="index.php?module=Home&action=UnifiedSearch&search_module=' . $module . '&query_string=' . urlencode($tag) . '" style="font-size: ' . $size . $font_units . '">' . htmlspecialchars(stripslashes($tag)) . '</a></span>';
         }
     }
     $cloud_html = join("\n ", $cloud_span);
     return $cloud_html;
 }
?>
btnL3AllMenu.gif" alt="<?php 
echo $this->_tpl_vars['APP']['LBL_ALL_MENU_ALT'];
?>
" title="<?php 
echo $this->_tpl_vars['APP']['LBL_ALL_MENU_TITLE'];
?>
" border="0"></a></td>
				<?php 
if ($this->_tpl_vars['CHECK']['moduleSettings'] == 'yes') {
    ?>
	        		<td style="padding-left:10px;"><a href='index.php?module=Settings&action=ModuleManager&module_settings=true&formodule=<?php 
    echo $this->_tpl_vars['MODULE'];
    ?>
&parenttab=Settings'><img src="<?php 
    echo vtiger_imageurl('settingsBox.png', $this->_tpl_vars['THEME']);
    ?>
" alt="<?php 
    echo is_array($_tmp = $this->_tpl_vars['MODULE']) ? $this->_run_mod_handler('getTranslatedString', true, $_tmp, $this->_tpl_vars['MODULE']) : getTranslatedString($_tmp, $this->_tpl_vars['MODULE']);
    ?>
 <?php 
    echo $this->_tpl_vars['APP']['LBL_SETTINGS'];
    ?>
" title="<?php 
    echo is_array($_tmp = $this->_tpl_vars['MODULE']) ? $this->_run_mod_handler('getTranslatedString', true, $_tmp, $this->_tpl_vars['MODULE']) : getTranslatedString($_tmp, $this->_tpl_vars['MODULE']);
    ?>
 <?php 
    echo $this->_tpl_vars['APP']['LBL_SETTINGS'];
    ?>
" border="0"></a></td>
				<?php 
Example #10
0
/** Function to return the duplicate records data as a formatted array */
function getDuplicateRecordsArr($module)
{
    global $adb, $app_strings, $list_max_entries_per_page, $theme;
    $field_values_array = getFieldValues($module);
    $field_values = $field_values_array['fieldnames_list'];
    $fld_arr = $field_values_array['fieldnames_array'];
    $col_arr = $field_values_array['columnnames_array'];
    $fld_labl_arr = $field_values_array['fieldlabels_array'];
    $ui_type = $field_values_array['fieldname_uitype'];
    $dup_query = getDuplicateQuery($module, $field_values, $ui_type);
    // added for page navigation
    $dup_count_query = substr($dup_query, stripos($dup_query, 'FROM'), strlen($dup_query));
    $dup_count_query = "SELECT count(*) as count " . $dup_count_query;
    $count_res = $adb->query($dup_count_query);
    $no_of_rows = $adb->query_result($count_res, 0, "count");
    if ($no_of_rows <= $list_max_entries_per_page) {
        $_SESSION['dup_nav_start' . $module] = 1;
    } else {
        if (isset($_REQUEST["start"]) && $_REQUEST["start"] != "" && $_SESSION['dup_nav_start' . $module] != $_REQUEST["start"]) {
            $_SESSION['dup_nav_start' . $module] = ListViewSession::getRequestStartPage();
        }
    }
    $start = $_SESSION['dup_nav_start' . $module] != "" ? $_SESSION['dup_nav_start' . $module] : 1;
    $navigation_array = getNavigationValues($start, $no_of_rows, $list_max_entries_per_page);
    $start_rec = $navigation_array['start'];
    $end_rec = $navigation_array['end_val'];
    $navigationOutput = getTableHeaderNavigation($navigation_array, "", $module, "FindDuplicate", "");
    if ($start_rec == 0) {
        $limit_start_rec = 0;
    } else {
        $limit_start_rec = $start_rec - 1;
    }
    $dup_query .= " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}";
    //ends
    $nresult = $adb->query($dup_query);
    $no_rows = $adb->num_rows($nresult);
    require_once 'modules/Vtiger/layout_utils.php';
    if ($no_rows == 0) {
        if ($_REQUEST['action'] == 'FindDuplicateRecords') {
            //echo "<br><br><center>".$app_strings['LBL_NO_DUPLICATE']." <a href='javascript:window.history.back()'>".$app_strings['LBL_GO_BACK'].".</a></center>";
            //die;
            echo "<link rel='stylesheet' type='text/css' href='themes/{$theme}/style.css'>";
            echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
            echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t\t<tbody><tr>\n\t\t\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('empty.jpg', $theme) . "' ></td>\n\t\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>{$app_strings['LBL_NO_DUPLICATE']}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>     </td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody></table>\n\t\t\t\t</div>";
            echo "</td></tr></table>";
            exit;
        } else {
            echo "<br><br><table align='center' class='reportCreateBottom big' width='95%'><tr><td align='center'>" . $app_strings['LBL_NO_DUPLICATE'] . "</td></tr></table>";
            die;
        }
    }
    $rec_cnt = 0;
    $temp = array();
    $sl_arr = array();
    $grp = "group0";
    $gcnt = 0;
    $ii = 0;
    //ii'th record in group
    while ($rec_cnt < $no_rows) {
        $result = $adb->fetchByAssoc($nresult);
        //echo '<pre>';print_r($result);echo '</pre>';
        if ($rec_cnt != 0) {
            $sl_arr = array_slice($result, 2);
            array_walk($temp, 'lower_array');
            array_walk($sl_arr, 'lower_array');
            $arr_diff = array_diff($temp, $sl_arr);
            if (count($arr_diff) > 0) {
                $gcnt++;
                $temp = $sl_arr;
                $ii = 0;
            }
            $grp = "group" . $gcnt;
        }
        $fld_values[$grp][$ii]['recordid'] = $result['recordid'];
        for ($k = 0; $k < count($col_arr); $k++) {
            if ($rec_cnt == 0) {
                $temp[$fld_labl_arr[$k]] = $result[$col_arr[$k]];
            }
            if ($ui_type[$fld_arr[$k]] == 56) {
                if ($result[$col_arr[$k]] == 0) {
                    $result[$col_arr[$k]] = $app_strings['no'];
                } else {
                    $result[$col_arr[$k]] = $app_strings['yes'];
                }
            }
            if ($ui_type[$fld_arr[$k]] == 75 || $ui_type[$fld_arr[$k]] == 81) {
                $vendor_id = $result[$col_arr[$k]];
                if ($vendor_id != '') {
                    $vendor_name = getVendorName($vendor_id);
                }
                $result[$col_arr[$k]] = $vendor_name;
            }
            if ($ui_type[$fld_arr[$k]] == 57) {
                $contact_id = $result[$col_arr[$k]];
                if ($contact_id != '') {
                    $parent_module = 'Contacts';
                    $displayValueArray = getEntityName($parent_module, $contact_id);
                    if (!empty($displayValueArray)) {
                        foreach ($displayValueArray as $key => $field_value) {
                            $contactname = $field_value;
                        }
                    }
                }
                $result[$col_arr[$k]] = $contactname;
            }
            if ($ui_type[$fld_arr[$k]] == 15 || $ui_type[$fld_arr[$k]] == 16) {
                $result[$col_arr[$k]] = getTranslatedString($result[$col_arr[$k]], $module);
            }
            if ($ui_type[$fld_arr[$k]] == 33) {
                $fieldvalue = explode(' |##| ', $result[$col_arr[$k]]);
                $result[$col_arr[$k]] = array();
                foreach ($fieldvalue as $picklistValue) {
                    $result[$col_arr[$k]][] = getTranslatedString($picklistValue, $module);
                }
                $result[$col_arr[$k]] = implode(', ', $result[$col_arr[$k]]);
            }
            if ($ui_type[$fld_arr[$k]] == 68) {
                $parent_id = $result[$col_arr[$k]];
                if ($parent_id != '') {
                    $parentname = getParentName($parent_id);
                }
                $result[$col_arr[$k]] = $parentname;
            }
            if ($ui_type[$fld_arr[$k]] == 53 || $ui_type[$fld_arr[$k]] == 52) {
                if ($result[$col_arr[$k]] != '') {
                    $owner = getOwnerName($result[$col_arr[$k]]);
                }
                $result[$col_arr[$k]] = $owner;
            }
            if ($ui_type[$fld_arr[$k]] == 50 or $ui_type[$fld_arr[$k]] == 51) {
                if ($module != 'Products') {
                    $entity_name = getAccountName($result[$col_arr[$k]]);
                } else {
                    $entity_name = getProductName($result[$col_arr[$k]]);
                }
                if ($entity_name != '') {
                    $result[$col_arr[$k]] = $entity_name;
                } else {
                    $result[$col_arr[$k]] = '';
                }
            }
            if ($ui_type[$fld_arr[$k]] == 58) {
                $campaign_name = getCampaignName($result[$col_arr[$k]]);
                if ($campaign_name != '') {
                    $result[$col_arr[$k]] = $campaign_name;
                } else {
                    $result[$col_arr[$k]] = '';
                }
            }
            if ($ui_type[$fld_arr[$k]] == 59) {
                $product_name = getProductName($result[$col_arr[$k]]);
                if ($product_name != '') {
                    $result[$col_arr[$k]] = $product_name;
                } else {
                    $result[$col_arr[$k]] = '';
                }
            }
            /*uitype 10 handling*/
            if ($ui_type[$fld_arr[$k]] == 10) {
                $result[$col_arr[$k]] = getRecordInfoFromID($result[$col_arr[$k]]);
            }
            if ($ui_type[$fld_arr[$k]] == 5 || $ui_type[$fld_arr[$k]] == 6 || $ui_type[$fld_arr[$k]] == 23) {
                if (${$result}[$col_arr[$k]] != '' && ${$result}[$col_arr[$k]] != '0000-00-00') {
                    $date = new DateTimeField(${$result}[$col_arr[$k]]);
                    $value = $date->getDisplayDate();
                    if (strpos(${$result}[$col_arr[$k]], ' ') > -1) {
                        $value .= ' ' . $date->getDisplayTime();
                    }
                } elseif (${$result}[$col_arr[$k]] == '0000-00-00') {
                    $value = '';
                } else {
                    $value = ${$result}[$col_arr[$k]];
                }
                $result[$col_arr[$k]] = $value;
            }
            if ($ui_type[$fld_arr[$k]] == 71) {
                $result[$col_arr[$k]] = CurrencyField::convertToUserFormat($result[$col_arr[$k]]);
            }
            if ($ui_type[$fld_arr[$k]] == 72) {
                $result[$col_arr[$k]] = CurrencyField::convertToUserFormat($result[$col_arr[$k]], null, true);
            }
            $fld_values[$grp][$ii][$fld_labl_arr[$k]] = $result[$col_arr[$k]];
        }
        $fld_values[$grp][$ii]['Entity Type'] = $result['deleted'];
        $ii++;
        $rec_cnt++;
    }
    $gro = "group";
    for ($i = 0; $i < $no_rows; $i++) {
        $ii = 0;
        $dis_group[] = $fld_values[$gro . $i][$ii];
        $count_group[$i] = count($fld_values[$gro . $i]);
        $ii++;
        $new_group[] = $dis_group[$i];
    }
    $fld_nam = $new_group[0];
    $ret_arr[0] = $fld_values;
    $ret_arr[1] = $fld_nam;
    $ret_arr[2] = $ui_type;
    $ret_arr["navigation"] = $navigationOutput;
    return $ret_arr;
}
Example #11
0
/**
 * Function creates HTML to display Todos ListView
 * @param array  $todo_list     - collection of strings(Todo Information)
 * @param array  $cal           - collection of objects and strings 
 * return string $list_view     - html tags in string format
 */
function constructTodoListView($todo_list, $cal, $subtab, $navigation_array = '')
{
    global $mod_strings, $cal_log, $adb, $theme;
    $cal_log->debug("Entering constructTodoListView() method...");
    global $current_user, $app_strings;
    $date_format = $current_user->date_format;
    $format = $cal['calendar']->hour_format;
    $hour_startat = timeString(array('hour' => date('H:i'), 'minute' => 0), '24');
    $hour_endat = timeString(array('hour' => date('H:i', time() + 60 * 60), 'minute' => 0), '24');
    $time_arr = getaddEventPopupTime($hour_startat, $hour_endat, $format);
    $temp_ts = $cal['calendar']->date_time->ts;
    //to get date in user selected date format
    $temp_date = $date_format == 'dd-mm-yyyy' ? date('d-m-Y', $temp_ts) : ($date_format == 'mm-dd-yyyy' ? date('m-d-Y', $temp_ts) : ($date_format == 'yyyy-mm-dd' ? date('Y-m-d', $temp_ts) : ''));
    if ($cal['calendar']->day_start_hour != 23) {
        $endtemp_date = $temp_date;
    } else {
        $endtemp_ts = $temp_ts + 1 * 24 * 60 * 60;
        $endtemp_date = $date_format == 'dd-mm-yyyy' ? date('d-m-Y', $endtemp_ts) : ($date_format == 'mm-dd-yyyy' ? date('m-d-Y', $endtemp_ts) : ($date_format == 'yyyy-mm-dd' ? date('Y-m-d', $endtemp_ts) : ''));
    }
    $list_view = "";
    //labels of listview header
    if ($cal['view'] == 'day') {
        $colspan = 9;
        $header = array('0' => '#', '1' => $mod_strings['LBL_TIME'], '2' => $mod_strings['LBL_LIST_DUE_DATE'], '3' => $mod_strings['LBL_TODO']);
        $header_width = array('0' => '5%', '1' => '10%', '2' => '10%', '3' => '38%');
        /*if(getFieldVisibilityPermission('Calendar',$current_user->id,'parent_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_RELATEDTO']);
        			array_push($header_width,'15%');
        		}
        		if(getFieldVisibilityPermission('Calendar',$current_user->id,'contact_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_CONTACT_NAME']);
        			array_push($header_width,'15%');
        		}*/
        if (getFieldVisibilityPermission('Calendar', $current_user->id, 'taskstatus') == '0') {
            array_push($header, $mod_strings['LBL_STATUS']);
            array_push($header_width, '10%');
        }
        if (isPermitted("Calendar", "EditView") == "yes" || isPermitted("Calendar", "Delete") == "yes") {
            array_push($header, $mod_strings['LBL_ACTION']);
            array_push($header_width, '10%');
        }
        array_push($header, $mod_strings['LBL_ASSINGEDTO']);
        array_push($header_width, '15%');
    } else {
        $colspan = 10;
        $header = array('0' => '#', '1' => $mod_strings['LBL_TIME'], '2' => $mod_strings['LBL_START_DATE'], '3' => $mod_strings['LBL_DUE_DATE'], '4' => $mod_strings['LBL_TODO']);
        $header_width = array('0' => '5%', '1' => '10%', '2' => '10%', '3' => '10%', '4' => '28%');
        /*if(getFieldVisibilityPermission('Calendar',$current_user->id,'parent_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_RELATEDTO']);
        			array_push($header_width,'15%');
        		}
        		if(getFieldVisibilityPermission('Calendar',$current_user->id,'contact_id') == '0')
        		{
        			array_push($header,$mod_strings['LBL_CONTACT_NAME']);
        			array_push($header_width,'15%');
        		}*/
        if (getFieldVisibilityPermission('Calendar', $current_user->id, 'taskstatus') == '0') {
            array_push($header, $mod_strings['LBL_STATUS']);
            array_push($header_width, '10%');
        }
        if (isPermitted("Calendar", "EditView") == "yes" || isPermitted("Calendar", "Delete") == "yes") {
            array_push($header, $mod_strings['LBL_ACTION']);
        }
        array_push($header, $mod_strings['LBL_ASSINGEDTO']);
        array_push($header_width, '15%');
    }
    if ($current_user->column_fields['is_admin'] == 'on') {
        $Res = $adb->pquery("select * from vtiger_activitytype", array());
    } else {
        $roleid = $current_user->roleid;
        $subrole = getRoleSubordinates($roleid);
        if (count($subrole) > 0) {
            $roleids = $subrole;
            array_push($roleids, $roleid);
        } else {
            $roleids = $roleid;
        }
        if (count($roleids) > 1) {
            $Res = $adb->pquery("select distinct activitytype from  vtiger_activitytype inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_activitytype.picklist_valueid where roleid in (" . generateQuestionMarks($roleids) . ") and picklistid in (select picklistid from vtiger_activitytype) order by sortid asc", array($roleids));
        } else {
            $Res = $adb->pquery("select distinct activitytype from vtiger_activitytype inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_activitytype.picklist_valueid where roleid = ? and picklistid in (select picklistid from vtiger_activitytype) order by sortid asc", array($roleid));
        }
    }
    $eventlist = '';
    for ($i = 0; $i < $adb->num_rows($Res); $i++) {
        $eventlist .= $adb->query_result($Res, $i, 'activitytype') . ";";
    }
    $list_view .= "<table align='center' border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t<tr><td colspan='3'>&nbsp;</td></tr>";
    //checking permission for Create/Edit Operation
    if (isPermitted("Calendar", "EditView") == "yes") {
        $list_view .= "<tr>\n\t\t\t\t<td class='calAddButton' onMouseOver='fnAddEvent(this,\"addEventDropDown\",\"" . $temp_date . "\",\"" . $endtemp_date . "\",\"" . $time_arr['starthour'] . "\",\"" . $time_arr['startmin'] . "\",\"" . $time_arr['startfmt'] . "\",\"" . $time_arr['endhour'] . "\",\"" . $time_arr['endmin'] . "\",\"" . $time_arr['endfmt'] . "\",\"\",\"" . $subtab . "\",\"" . $eventlist . "\");'style='border: 1px solid #666666;cursor:pointer;height:30px' align='center' width='10%'>\n                                        " . $mod_strings['LBL_ADD'] . "\n                                        <img src='" . vtiger_imageurl('menuDnArrow.gif', $theme) . "' style='padding-left: 5px;' border='0'>                                                                                                                         </td>";
    } else {
        $list_view .= "<tr><td>&nbsp;</td>";
    }
    $list_view .= "<td align='center' width='60%'><span id='total_activities'>" . getTodoInfo($cal, 'listcnt') . "</span>&nbsp;</td>\n\t\t\t\t<td align='right' width='28%'>&nbsp;</td>\n\t\t\t</tr>\n\t\t</table>\n\n\t\t\t<br><table style='background-color: rgb(204, 204, 204);' class='small' align='center' border='0' cellpadding='5' cellspacing='1' width='98%'>\n                        ";
    $header_rows = count($header);
    $navigationOutput = getTableHeaderNavigation($navigation_array, $url_string, "Calendar", "index");
    if ($navigationOutput != '') {
        $list_view .= "<tr width=100% bgcolor=white><td align=center colspan={$header_rows}>";
        $list_view .= "<table align=center width='98%'><tr>" . $navigationOutput . "</tr></table></td></tr>";
    }
    $list_view .= "<tr>";
    for ($i = 0; $i < $header_rows; $i++) {
        $list_view .= "<td class='lvtCol' width='" . $header_width[$i] . "' nowrap='nowrap'>" . $header[$i] . "</td>";
    }
    $list_view .= "</tr>";
    $rows = count($todo_list);
    if ($rows != 0) {
        for ($i = 0; $i < count($todo_list); $i++) {
            $list_view .= "<tr style='height: 25px;' bgcolor='white'>";
            foreach ($todo_list[$i] as $key => $entry) {
                $list_view .= "<td>" . $entry . "</td>";
            }
            $list_view .= "</tr>";
        }
    } else {
        $list_view .= "<tr><td style='background-color:#efefef;height:340px' align='center' colspan='" . $colspan . "'>";
        $list_view .= "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 45%; position: relative; z-index: 5000;'>\n\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t<tr>\n\t\t\t\t<td rowspan='2' width='25%'>\n\t\t\t\t\t<img src='" . vtiger_imageurl('empty.jpg', $theme) . "' height='60' width='61'></td>\n\t\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='75%'><span class='genHeaderSmall'>" . $app_strings['LBL_NO'] . " " . $app_strings['Todos'] . " " . $app_strings['LBL_FOUND'] . " !</span></td>\n\t\t\t</tr>\n\t\t\t<tr>";
        //checking permission for Create/Edit Operation
        if (isPermitted("Calendar", "EditView") == "yes") {
            $list_view .= "<td class='small' align='left' nowrap='nowrap'>" . $app_strings['LBL_YOU_CAN_CREATE'] . "&nbsp;" . $app_strings['LBL_A'] . "&nbsp;" . $app_strings['Todo'] . "&nbsp;" . $app_strings['LBL_NOW'] . ".&nbsp;" . $app_strings['LBL_CLICK_THE_LINK'] . "&nbsp;:<br>\n\t\t\t\t\t&nbsp;&nbsp;-<a href='javascript:void(0);' onClick='gshow(\"createTodo\",\"todo\",\"" . $temp_date . "\",\"" . $temp_date . "\",\"" . $time_arr['starthour'] . "\",\"" . $time_arr['startmin'] . "\",\"" . $time_arr['startfmt'] . "\",\"" . $time_arr['endhour'] . "\",\"" . $time_arr['endmin'] . "\",\"" . $time_arr['endfmt'] . "\",\"listview\",\"todo\");'>" . $app_strings['LBL_CREATE'] . " " . $app_strings['LBL_A'] . " " . $app_strings['Todo'] . "</a>\n\t\t\t\t\t</td>";
        } else {
            $list_view .= "<td class='small' align='left' nowrap='nowrap'>" . $app_strings['LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'] . "&nbsp;" . $app_strings['LBL_A'] . "&nbsp;" . $app_strings['Todo'] . "<br></td>";
        }
        $list_view .= "</tr>\n\t\t\t</table>\n\t\t\t</div>";
        $list_view .= "</td></tr>";
    }
    $list_view .= "</table><br>";
    $cal_log->debug("Exiting constructTodoListView() method...");
    return $list_view;
}
 * All Rights Reserved.
 *********************************************************************************/
global $theme, $mod_strings;
$theme_path = "themes/" . $theme . "/";
$productid = vtlib_purify($_REQUEST['productid']);
$rowid = vtlib_purify($_REQUEST['curr_row']);
$product_total = vtlib_purify($_REQUEST['productTotal']);
$tax_details = getTaxDetailsForProduct($productid, 'all');
//we should pass available instead of all if we want to display only the available taxes.
$associated_tax_count = count($tax_details);
$tax_div = '
		<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small" id="tax_table' . $rowid . '">
		   <tr>
			<td id="tax_div_title' . $rowid . '" nowrap align="left" ><b>' . $app_strings['LABEL_SET_TAX_FOR'] . ' : ' . $product_total . '</b></td>
			<td>&nbsp;</td>
			<td align="right"><img src="' . vtiger_imageurl('close.gif', $theme) . '" border="0" onClick="fnHidePopDiv(\'tax_div' . $rowid . '\')" style="cursor:pointer;"></td>
		   </tr>
	   ';
$net_tax_total = 0.0;
for ($i = 0, $j = $i + 1; $i < count($tax_details); $i++, $j++) {
    $tax_name = $tax_details[$i]['taxname'];
    $tax_label = $tax_details[$i]['taxlabel'];
    $tax_percentage = $tax_details[$i]['percentage'];
    $tax_name_percentage = $tax_name . "_percentage" . $rowid;
    $tax_id_name = "hidden_tax" . $j . "_percentage" . $rowid;
    //used to store the tax name, used in function callTaxCalc
    $tax_name_total = "popup_tax_row" . $rowid;
    //$tax_name."_total".$rowid;
    $tax_total = $product_total * $tax_percentage / 100.0;
    $net_tax_total += $tax_total;
    $tax_div .= '
Example #13
0
function getRelatedTableHeaderNavigation($navigation_array, $url_qry, $module, $related_module, $recordid)
{
    global $log, $app_strings, $adb;
    $log->debug("Entering getTableHeaderNavigation(" . $navigation_array . "," . $url_qry . "," . $module . "," . $action_val . "," . $viewid . ") method ...");
    global $theme;
    $relatedTabId = getTabid($related_module);
    $tabid = getTabid($module);
    $relatedListResult = $adb->pquery('SELECT * FROM vtiger_relatedlists WHERE tabid=? AND
		related_tabid=?', array($tabid, $relatedTabId));
    if (empty($relatedListResult)) {
        return;
    }
    $relatedListRow = $adb->fetchByAssoc($relatedListResult);
    $header = $relatedListRow['label'];
    $actions = $relatedListRow['actions'];
    $functionName = $relatedListRow['name'];
    $urldata = "module={$module}&action={$module}Ajax&file=DetailViewAjax&record={$recordid}&" . "ajxaction=LOADRELATEDLIST&header={$header}&relation_id={$relatedListRow['relation_id']}" . "&actions={$actions}&{$url_qry}";
    $formattedHeader = str_replace(' ', '', $header);
    $target = 'tbl_' . $module . '_' . $formattedHeader;
    $imagesuffix = $module . '_' . $formattedHeader;
    $output = '<td align="right" style="padding="5px;">';
    if ($navigation_array['prev'] != 0) {
        $output .= '<a href="javascript:;" onClick="loadRelatedListBlock(\'' . $urldata . '&start=1\',\'' . $target . '\',\'' . $imagesuffix . '\');" alt="' . $app_strings['LBL_FIRST'] . '" title="' . $app_strings['LBL_FIRST'] . '"><img src="' . vtiger_imageurl('start.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
        $output .= '<a href="javascript:;" onClick="loadRelatedListBlock(\'' . $urldata . '&start=' . $navigation_array['prev'] . '\',\'' . $target . '\',\'' . $imagesuffix . '\');" alt="' . $app_strings['LNK_LIST_PREVIOUS'] . '"title="' . $app_strings['LNK_LIST_PREVIOUS'] . '"><img src="' . vtiger_imageurl('previous.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
    } else {
        $output .= '<img src="' . vtiger_imageurl('start_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
        $output .= '<img src="' . vtiger_imageurl('previous_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
    }
    $jsHandler = "return VT_disableFormSubmit(event);";
    $output .= "<input class='small' name='pagenum' type='text' value='{$navigation_array['current']}'\n\t\tstyle='width: 3em;margin-right: 0.7em;' onchange=\"loadRelatedListBlock('{$urldata}&start='+this.value+'','{$target}','{$imagesuffix}');\"\n\t\tonkeypress=\"{$jsHandler}\">";
    $output .= "<span name='listViewCountContainerName' class='small' style='white-space: nowrap;'>";
    $computeCount = $_REQUEST['withCount'];
    if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true || (bool) $computeCount == true) {
        $output .= $app_strings['LBL_LIST_OF'] . ' ' . $navigation_array['verylast'];
    } else {
        $output .= "<img src='" . vtiger_imageurl('windowRefresh.gif', $theme) . "' alt='" . $app_strings['LBL_HOME_COUNT'] . "'\n\t\t\tonclick=\"loadRelatedListBlock('{$urldata}&withCount=true&start={$navigation_array['current']}','{$target}','{$imagesuffix}');\"\n\t\t\talign='absmiddle' name='" . $module . "_listViewCountRefreshIcon'/>\n\t\t\t<img name='" . $module . "_listViewCountContainerBusy' src='" . vtiger_imageurl('vtbusy.gif', $theme) . "' style='display: none;'\n\t\t\talign='absmiddle' alt='" . $app_strings['LBL_LOADING'] . "'>";
    }
    $output .= '</span>';
    if ($navigation_array['next'] != 0) {
        $output .= '<a href="javascript:;" onClick="loadRelatedListBlock(\'' . $urldata . '&start=' . $navigation_array['next'] . '\',\'' . $target . '\',\'' . $imagesuffix . '\');"><img src="' . vtiger_imageurl('next.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
        $output .= '<a href="javascript:;" onClick="loadRelatedListBlock(\'' . $urldata . '&start=' . $navigation_array['verylast'] . '\',\'' . $target . '\',\'' . $imagesuffix . '\');"><img src="' . vtiger_imageurl('end.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
    } else {
        $output .= '<img src="' . vtiger_imageurl('next_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
        $output .= '<img src="' . vtiger_imageurl('end_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
    }
    $output .= '</td>';
    $log->debug("Exiting getTableHeaderNavigation method ...");
    if ($navigation_array['first'] == '') {
        return;
    } else {
        return $output;
    }
}
">
		<input type="hidden" name="start_hour" value="<?php 
echo $this->_tpl_vars['START_HOUR'];
?>
">
		<input type="hidden" name="form_token" value="<?php 
echo $this->_tpl_vars['FORM_TOKEN'];
?>
">

	<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="settingsSelUITopLine">
	<tr><td align="left">
		<table class="settingsSelUITopLine" border="0" cellpadding="5" cellspacing="0" width="100%">
		<tr>
			<td rowspan="2" width="50"><img src="<?php 
echo vtiger_imageurl('ico-users.gif', $this->_tpl_vars['THEME']);
?>
" align="absmiddle"></td>
			<td>	
				<span class="lvtHeaderText">
				<?php 
if ($this->_tpl_vars['PARENTTAB'] != '') {
    ?>
	
				<b><a href="index.php?module=Settings&action=index&parenttab=Settings"><?php 
    echo $this->_tpl_vars['MOD']['LBL_SETTINGS'];
    ?>
 </a> &gt; <a href="index.php?module=Administration&action=index&parenttab=Settings"><?php 
    echo $this->_tpl_vars['MOD']['LBL_USERS'];
    ?>
</a> &gt; 
function get_graph($cache_file_name, $html_imagename, $cnt_val, $name_val, $width, $height, $left, $right, $top, $bottom, $title, $target_val, $graph_date, $urlstring, $test_target_val, $date_start, $end_date)
{
    global $tmp_dir;
    global $graph_title, $mod_strings;
    global $theme;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $val = explode(":", $title);
    $display_title = $val[0];
    if (isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') {
        $sHTML .= "<tr><td width=50%><table width=100%  border=0 cellspacing=0 cellpadding=0 align=left>";
    }
    $sHTML .= "<tr>\r\n\t   <td><a name='1'></a><table width=20%  border=0 cellspacing=12 cellpadding=0 align=left>\r\n\t         <tr>\r\n\t    \t   <td rowspan=2 valign=top><span class=\"dash_count\">1</span></td>\r\n\t           <td nowrap><span class=genHeaderSmall>" . $display_title . "</span></td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t   <td nowrap><span class=big>" . $mod_strings['LBL_HORZ_BAR_CHART'] . "</span> </td>\r\n\t\t </tr>\r\n\t\t</table>\r\n\t   </td>\r\n\t   <td align='right'>";
    if (isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') {
        $sHTML .= "&nbsp;";
    } else {
        $sHTML .= "<table cellpadding='0' cellspacing='0' border='0' class='small'>\r\n\t\t<tr>\r\n\t\t\t<td class='small'>" . $mod_strings['VIEWCHART'] . " :&nbsp;</td>\r\n\t\t\t<td class='dash_row_sel'>1</td>\r\n\t\t\t<td class='dash_row_unsel'><a class='dash_href' href='#2'>2</a></td>\r\n\t\t\t<td class='dash_switch'><a href='#top'><img align='absmiddle' src='" . vtiger_imageurl('dash_scroll_up.jpg', $theme) . "' border='0'></a></td>\r\n\t\t</tr>\r\n\t\t</table>";
    }
    $sHTML .= "</td>\r\n\t</tr>\r\n\t<tr>\r\n           <td colspan='2'>";
    $sHTML .= render_graph($tmp_dir . "hor_" . $cache_file_name, $html_imagename . "_hor", $cnt_val, $name_val, $width, $height, $left, $right, $top, $bottom, $title, $target_val, "horizontal");
    //Commented by Minnie -- same content displayed in two graphs
    /*$sHTML .= "</td>
    	</tr>
    	<tr>
    	   <td><hr noshade='noshade' size='1' /></td>
    	</tr>";
    
    $sHTML .= "<tr>
    	   <td><table width=20%  border=0 cellspacing=0 cellpadding=0 align=left>
    	   	 <tr>
    		   <td rowspan=2 valign=top><span class=dashSerial>2</span></td>
    		   <td nowrap><span class=genHeaderSmall>".$graph_title."</span></td>
    		 </tr>
    		 <tr>
    		   <td><span class=big>Vertical Bar Chart</span> </td>
    		 </tr>
    	        </table>
    	   </td>
    	</tr>
    	<tr>
    	   <td height=200>";
    
    	   $sHTML .= render_graph($tmp_dir."vert_".$cache_file_name,$html_imagename."_vert",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"vertical");*/
    $sHTML .= "</td>\r\n\t</tr>";
    if (isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') {
        $sHTML .= "</table></td><td width=50%><table width=100%  border=0 cellspacing=0 cellpadding=0 align=left>";
    } else {
        $sHTML .= "<tr><td colspan='2' class='dash_chart_btm'>&nbsp;</td></tr>";
    }
    $sHTML .= "<tr>\r\n\t   <td><a name='2'></a><table width=20%  border=0 cellspacing=12 cellpadding=0 align=left>\r\n           \t <tr>\r\n\t           <td rowspan=2 valign=top><span class=\"dash_count\">2</span></td>\r\n\t           <td nowrap><span class=genHeaderSmall>" . $graph_title . "</span></td>\r\n\t         </tr>\r\n\t         <tr>\r\n\t           <td><span class=big>" . $mod_strings['LBL_PIE_CHART'] . "</span> </td>\r\n\t         </tr>\r\n\t        </table>\r\n\t   </td>\r\n\t     <td align='right'>";
    if (isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') {
        $sHTML .= "&nbsp;";
    } else {
        $sHTML .= "<table cellpadding='0' cellspacing='0' border='0' class='small'>\r\n\t\t<tr>\r\n\t\t\t<td class='small'>" . $mod_strings['VIEWCHART'] . " :&nbsp;</td>\r\n\t\t\t<td class='dash_row_unsel'><a class='dash_href' href='#1'>1</a></td>\r\n\t\t\t<td class='dash_row_sel'>2</td>\r\n\t\t\t<td class='dash_switch'><a href='#top'><img align='absmiddle' src='" . vtiger_imageurl('dash_scroll_up.jpg', $theme) . "' border='0'></a></td>\r\n\t\t</tr>\r\n\t\t</table>";
    }
    $sHTML .= "</td>\r\n\t</tr>\r\n\t<tr>\r\n\t   <td colspan='2'>";
    $sHTML .= render_graph($tmp_dir . "pie_" . $cache_file_name, $html_imagename . "_pie", $cnt_val, $name_val, $width, $height, $left, $right, $top, $bottom, $title, $target_val, "pie");
    $sHTML .= "</td>\r\n\t</tr>";
    if (isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') {
        $sHTML .= "</table></td></tr>";
    }
    $sHTML .= "<tr><td colspan='2' class='dash_chart_btm'>&nbsp;</td></tr>";
    return $sHTML;
}
Example #16
0
 /**	Function to display the Services which are related to the PriceBook
  *	@param string $query - query to get the list of products which are related to the current PriceBook
  *	@param object $focus - PriceBook object which contains all the information of the current PriceBook
  *	@param string $returnset - return_module, return_action and return_id which are sequenced with & to pass to the URL which is optional
  *	return array $return_data which will be formed like array('header'=>$header,'entries'=>$entries_list) where as $header contains all the header columns and $entries_list will contain all the Service entries
  */
 function getPriceBookRelatedServices($query, $focus, $returnset = '')
 {
     global $log;
     $log->debug("Entering getPriceBookRelatedServices(" . $query . "," . get_class($focus) . "," . $returnset . ") method ...");
     global $adb;
     global $app_strings;
     global $current_language, $current_user;
     $current_module_strings = return_module_language($current_language, 'Services');
     global $list_max_entries_per_page;
     global $urlPrefix;
     global $theme;
     $pricebook_id = $_REQUEST['record'];
     $theme_path = "themes/" . $theme . "/";
     $image_path = $theme_path . "images/";
     $computeCount = $_REQUEST['withCount'];
     if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true || (bool) $computeCount == true) {
         $noofrows = $adb->query_result($adb->query(mkCountQuery($query)), 0, 'count');
     } else {
         $noofrows = null;
     }
     $module = 'PriceBooks';
     $relatedmodule = 'Services';
     if (!$_SESSION['rlvs'][$module][$relatedmodule]) {
         $modObj = new ListViewSession();
         $modObj->sortby = $focus->default_order_by;
         $modObj->sorder = $focus->default_sort_order;
         $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj);
     }
     if (isset($_REQUEST['relmodule']) && $_REQUEST['relmodule'] != '' && $_REQUEST['relmodule'] == $relatedmodule) {
         $relmodule = vtlib_purify($_REQUEST['relmodule']);
         if ($_SESSION['rlvs'][$module][$relmodule]) {
             setSessionVar($_SESSION['rlvs'][$module][$relmodule], $noofrows, $list_max_entries_per_page, $module, $relmodule);
         }
     }
     global $relationId;
     $start = RelatedListViewSession::getRequestCurrentPage($relationId, $query);
     $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
     $limit_start_rec = ($start - 1) * $list_max_entries_per_page;
     if ($adb->dbType == "pgsql") {
         $list_result = $adb->pquery($query . " OFFSET {$limit_start_rec} LIMIT {$list_max_entries_per_page}", array());
     } else {
         $list_result = $adb->pquery($query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
     }
     $header = array();
     $header[] = $current_module_strings['LBL_LIST_SERVICE_NAME'];
     if (getFieldVisibilityPermission('Services', $current_user->id, 'unit_price') == '0') {
         $header[] = $current_module_strings['LBL_SERVICE_UNIT_PRICE'];
     }
     $header[] = $current_module_strings['LBL_PB_LIST_PRICE'];
     if (isPermitted("PriceBooks", "EditView", "") == 'yes' || isPermitted("PriceBooks", "Delete", "") == 'yes') {
         $header[] = $app_strings['LBL_ACTION'];
     }
     $currency_id = $focus->column_fields['currency_id'];
     $numRows = $adb->num_rows($list_result);
     for ($i = 0; $i < $numRows; $i++) {
         $entity_id = $adb->query_result($list_result, $i, "crmid");
         $unit_price = $adb->query_result($list_result, $i, "unit_price");
         if ($currency_id != null) {
             $prod_prices = getPricesForProducts($currency_id, array($entity_id), 'Services');
             $unit_price = $prod_prices[$entity_id];
         }
         $listprice = $adb->query_result($list_result, $i, "listprice");
         $field_name = $entity_id . "_listprice";
         $entries = array();
         $entries[] = textlength_check($adb->query_result($list_result, $i, "servicename"));
         if (getFieldVisibilityPermission('Services', $current_user->id, 'unit_price') == '0') {
             $entries[] = CurrencyField::convertToUserFormat($unit_price, null, true);
         }
         $entries[] = CurrencyField::convertToUserFormat($listprice, null, true);
         $action = "";
         if (isPermitted("PriceBooks", "EditView", "") == 'yes' && isPermitted('Services', 'EditView', $entity_id) == 'yes') {
             $action .= '<img style="cursor:pointer;" src="themes/images/editfield.gif" border="0" onClick="fnvshobj(this,\'editlistprice\'),editProductListPrice(\'' . $entity_id . '\',\'' . $pricebook_id . '\',\'' . $listprice . '\')" alt="' . $app_strings["LBL_EDIT_BUTTON"] . '" title="' . $app_strings["LBL_EDIT_BUTTON"] . '"/>';
         } else {
             $action .= '<img src="' . vtiger_imageurl('blank.gif', $theme) . '" border="0" />';
         }
         if (isPermitted("PriceBooks", "Delete", "") == 'yes' && isPermitted('Services', 'Delete', $entity_id) == 'yes') {
             if ($action != "") {
                 $action .= '&nbsp;|&nbsp;';
             }
             $action .= '<img src="themes/images/delete.gif" onclick="if(confirm(\'' . $app_strings['ARE_YOU_SURE'] . '\')) deletePriceBookProductRel(' . $entity_id . ',' . $pricebook_id . ');" alt="' . $app_strings["LBL_DELETE"] . '" title="' . $app_strings["LBL_DELETE"] . '" style="cursor:pointer;" border="0">';
         }
         if ($action != "") {
             $entries[] = $action;
         }
         $entries_list[] = $entries;
     }
     $navigationOutput[] = getRecordRangeMessage($list_result, $limit_start_rec, $noofrows);
     $navigationOutput[] = getRelatedTableHeaderNavigation($navigation_array, '', $module, $relatedmodule, $focus->id);
     $return_data = array('header' => $header, 'entries' => $entries_list, 'navigation' => $navigationOutput);
     $log->debug("Exiting getPriceBookRelatedServices method ...");
     return $return_data;
 }
Example #17
0
			<input type="hidden" name="blockid" id="blockid" value="' . vtlib_purify($_REQUEST['blockid']) . '">
			<input type="hidden" name="tabid" id="tabid" value="' . vtlib_purify($_REQUEST['tabid']) . '">
			<input type="hidden" name="fieldselect" value="' . vtlib_purify($_REQUEST['fieldselect']) . '">
			<input type="hidden" name="column" value="' . $customfield_columnname . '">
			<input type="hidden" name="mode" id="cfedit_mode" value="' . $mode . '">
			<input type="hidden" name="cfcombo" id="selectedfieldtype" value="">

	  
			<table width="100%" border="0" cellpadding="5" cellspacing="0" class="layerHeadingULine">
				<tr>';
if ($mode == 'edit') {
    $output .= '<td width="60%" align="left" class="layerPopupHeading">Edit Field</td>';
} else {
    $output .= '<td width="95%" align="left" class="layerPopupHeading">' . getTranslatedString('LBL_MOVE_BLOCK_FIELD') . vtlib_purify($_REQUEST['blockname']) . '</td>';
}
$output .= '<td width="5%" align="right"><a href="javascript:fninvsh(\'orgLay\');"><img src="' . vtiger_imageurl('close.gif', $theme) . '" border="0"  align="absmiddle" /></a></td>
			</tr>';
$output .= '</table><table border=0 cellspacing=0 cellpadding=0 width=95% align=center> 
							<tr>
								<td class=small >
									<table border=0 celspacing=0 cellpadding=0 width=100% align=center bgcolor=white>
										<tr>';
if ($mode != 'edit') {
    $output .= '<td><table>
					<tr><td>' . getTranslatedString('LBL_SELECT_FIELD_TO_MOVE') . '</td></tr>
					<tr><td>COMBO_OUTPUT_CHANGE</td></tr>
					</table></td>';
}
$output .= '</tr>
			</table>
		</td>
    $list_report_form->assign("REP_MODULE", $oRep->primodule);
    if (!isset($_REQUEST['secondarymodule'])) {
        $list_report_form->assign("SEC_MODULE", $sec_module);
    }
    if (!empty($restricted_modules)) {
        $restrictedmod = implode(",", $restricted_modules);
    } else {
        $restrictedmod = '';
    }
    $list_report_form->assign("RESTRICTEDMODULES", $restrictedmod);
    $list_report_form->assign("BACK", 'false');
}
if ($_REQUEST['reportmodule'] != '') {
    if (vtlib_isModuleActive($_REQUEST['reportmodule']) == false || isPermitted($_REQUEST['reportmodule'], 'index') != "yes") {
        echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
        echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 80%; position: relative; z-index: 10000000;'>\n\n\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t<tbody><tr>\n\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>" . $mod_strings['LBL_NO_ACCESS'] . " : " . getTranslatedString($_REQUEST['reportmodule'], $_REQUEST['reportmodule']) . " </span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class='small' align='right' nowrap='nowrap'>\t\t\t   \t\n\t\t<a href='javascript:window.close();'>{$app_strings['LBL_CLOSE']}</a><br>\t\t\t\t\t\t\t\t   \t\t     </td>\n\t\t</tr>\n\t\t</tbody></table> \n\t\t</div>";
        echo "</td></tr></table>";
        die;
    }
    $list_report_form->assign("RELATEDMODULES", getReportRelatedModules($_REQUEST['reportmodule'], $repObj));
    $list_report_form->assign("REP_MODULE", vtlib_purify($_REQUEST['reportmodule']));
}
if ($_REQUEST['reportName'] != '') {
    $list_report_form->assign("RELATEDMODULES", getReportRelatedModules($_REQUEST['primarymodule'], $repObj));
    $list_report_form->assign("REPORTNAME", vtlib_purify($_REQUEST['reportName']));
    $list_report_form->assign("REPORTDESC", vtlib_purify($_REQUEST['reportDesc']));
    $list_report_form->assign("REP_MODULE", vtlib_purify($_REQUEST['primarymodule']));
    $sec_mod = explode(":", vtlib_purify($_REQUEST['secondarymodule']));
    $sec_module = array();
    foreach ($sec_mod as $module) {
        $sec_module[$module] = 1;
Example #19
0
function show_error_msg($error_type = 'permission_denied')
{
    global $theme;
    if ($error_type == 'permission_denied') {
        echo "<link rel='stylesheet' type='text/css' href='themes/{$theme}/style.css'>";
        echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
        echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\t\n\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t<tbody><tr>\n\t\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>" . getTranslatedString('LBL_PERMISSION') . "</span></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t<td class='small' align='right' nowrap='nowrap'>\t\t\t   \t\n\t\t\t<a href='javascript:window.history.back();'>" . getTranslatedString('LBL_GO_BACK') . "</a><br>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody></table> \n\t\t\t</div>";
        echo "</td></tr></table>";
        die;
    } else {
        if ($error_type == 'no_permitted_modules') {
            echo "<link rel='stylesheet' type='text/css' href='themes/{$theme}/style.css'>";
            echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
            echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\t\n\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t<tbody><tr>\n\t\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('empty.jpg', $theme) . "' ></td>\n\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>" . getTranslatedString('LBL_NO_PERMITTED_MODULES') . "</span></td>\n\t\t\t</tr>\n\t\t\t</tbody></table> \n\t\t\t</div>";
            echo "</td></tr></table>";
            die;
        }
    }
}
Example #20
0
     }
 }
 if (vtlib_isModuleActive('Tooltip')) {
     $sql_result = $adb->pquery("select * from vtiger_settings_field where name = ? and active=0", array('LBL_TOOLTIP_MANAGEMENT'));
     if ($adb->num_rows($sql_result) > 0) {
         $menu_array['Tooltip']['location'] = $adb->query_result($sql_result, 0, 'linkto') . '&formodule=' . $module;
         $menu_array['Tooltip']['image_src'] = vtiger_imageurl($adb->query_result($sql_result, 0, 'iconpath'), $theme);
         $menu_array['Tooltip']['desc'] = getTranslatedString($adb->query_result($sql_result, 0, 'description'), 'Tooltip');
         $menu_array['Tooltip']['label'] = getTranslatedString($adb->query_result($sql_result, 0, 'name'), 'Tooltip');
     }
 }
 if (VTWorkflowUtils::checkModuleWorkflow($module)) {
     $sql_result = $adb->pquery("SELECT * FROM vtiger_settings_field WHERE name = ? AND active=0", array('LBL_WORKFLOW_LIST'));
     if ($adb->num_rows($sql_result) > 0) {
         $menu_array['Workflow']['location'] = $adb->query_result($sql_result, 0, 'linkto') . '&list_module=' . $module;
         $menu_array['Workflow']['image_src'] = vtiger_imageurl($adb->query_result($sql_result, 0, 'iconpath'), $theme);
         $menu_array['Workflow']['desc'] = getTranslatedString($adb->query_result($sql_result, 0, 'description'), 'com_vtiger_workflow');
         $menu_array['Workflow']['label'] = getTranslatedString($adb->query_result($sql_result, 0, 'name'), 'com_vtiger_workflow');
     }
 }
 $menu_array['CYP_SERVER_CONFIGURATION']['location'] = 'index.php?module=CobroPago&action=CobroPagoConfigServer&parenttab=Settings&formodule=CobroPago';
 $menu_array['CYP_SERVER_CONFIGURATION']['image_src'] = 'modules/CobroPago/settings.png';
 $menu_array['CYP_SERVER_CONFIGURATION']['desc'] = getTranslatedString('SERVER_CONFIGURATION_DESCRIPTION', $module);
 $menu_array['CYP_SERVER_CONFIGURATION']['label'] = getTranslatedString('SERVER_CONFIGURATION', $module);
 //add blanks for 3-column layout
 $count = count($menu_array) % 3;
 if ($count > 0) {
     for ($i = 0; $i < 3 - $count; $i++) {
         $menu_array[] = array();
     }
 }
global $theme;
$theme_path = "themes/" . $theme . "/";
$delete_currency_id = $_REQUEST['id'];
$sql = "select * from vtiger_currency_info where id=?";
$result = $adb->pquery($sql, array($delete_currency_id));
$delete_currencyname = $adb->query_result($result, 0, "currency_name");
$output = '';
$output = '<div id="CurrencyDeleteLay"  class="layerPopup">
<form name="newCurrencyForm" action="index.php" style="margin="0" onsubmit="VtigerJS_DialogBox.block();">
<input type="hidden" name="module" value="Settings">
<input type="hidden" name="action" value="CurrencyDelete">
<input type="hidden" name="delete_currency_id" value="' . $delete_currency_id . '">	
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="layerHeadingULine">
<tr>
	<td class="layerPopupHeading"  align="left" width="60%">' . $mod_strings["LBL_DELETE_CURRENCY"] . '</td>
	<td align="right" width="40%"><img src="' . vtiger_imageurl('close.gif', $theme) . '" border=0 alt="' . $app_strings["LBL_CLOSE"] . '" title="' . $app_strings["LBL_CLOSE"] . '" style="cursor:pointer;" onClick="document.getElementById(\'CurrencyDeleteLay\').style.display=\'none\'";></td>
</tr>
<table>
<table border=0 cellspacing=0 cellpadding=5 width=95% align=center> 
	<tr>
		<td class=small >
			<table border=0 celspacing=0 cellpadding=5 width=100% align=center bgcolor=white>
				<tr>
					<td width="50%" class="cellLabel small"><b>' . $mod_strings['LBL_CURRDEL'] . '</b></td>
					<td width="50%" class="cellText small"><b>' . getTranslatedCurrencyString($delete_currencyname) . '</b></td>
				</tr>
				<tr>
					<td class="cellLabel small"><b>' . $mod_strings['LBL_TRANSCURR'] . '</b></td>
					<td class="cellText small">';
$output .= '<select class="select small" name="transfer_currency_id" id="transfer_currency_id">';
global $adb;
Example #22
0
										<tr><td>&nbsp;</td></tr>
										<tr><td><b><?php 
echo $mod_strings['LBL_COMMUNITY'];
?>
</b></td></tr>
										<tr><td>&nbsp;</td></tr>
										<tr><td>&nbsp;</td></tr>
								</table>
						</marquee>
				</td>
				<td width="15%" style="border-right:2px solid #7F7F7F;">&nbsp;</td>
		</tr>
		<tr><td colspan="3"  style="border-left:2px solid #7F7F7F;border-right:2px solid #7F7F7F">&nbsp;</td></tr>
		<tr>
		  <td colspan="3" background="<?php 
echo vtiger_imageurl('about_btm.jpg', $theme);
?>
" height="75">
		  		<table width="100%" border="0" cellpadding="5" cellspacing="0">
						<tr>
							<td width="70%" align="left" class="small">
							<span class="small" style="color:#999999;"><?php 
echo $mod_strings['LBL_VERSION'] . " " . $patch_string;
?>
</span>&nbsp;|&nbsp;
									<a href="javascript:;" onClick=" newpopup('http://www.vtiger.com/copyrights/LICENSE_AGREEMENT.txt')"><?php 
echo $mod_strings['LBL_READ_LICENSE'];
?>
</a>&nbsp;|&nbsp;
									<a href="javascript:;" onClick=" newpopup('http://www.vtiger.com/products/crm/privacy_policy.html')"><?php 
echo $app_strings['LNK_PRIVACY_POLICY'];
    ?>
" target="_blank"><?php 
    echo $this->_tpl_vars['keyval'];
    ?>
</a>
			</td>
		<?php 
} elseif ($this->_tpl_vars['keyid'] == '85') {
    ?>
<!--Skype-->
			<td width=25% class="dvtCellInfo" align="left" id="mouseArea_<?php 
    echo $this->_tpl_vars['label'];
    ?>
">
				&nbsp;<img src="<?php 
    echo vtiger_imageurl('skype.gif', $this->_tpl_vars['THEME']);
    ?>
" alt="<?php 
    echo $this->_tpl_vars['APP']['LBL_SKYPE'];
    ?>
" title="<?php 
    echo $this->_tpl_vars['APP']['LBL_SKYPE'];
    ?>
" LANGUAGE=javascript align="absmiddle"></img>
				<span id="dtlview_<?php 
    echo $this->_tpl_vars['label'];
    ?>
"><a href="skype:<?php 
    echo $this->_tpl_vars['keyval'];
    ?>
?call"><?php 
Example #24
0
function getTableHeaderSimpleNavigation($navigation_array, $url_qry, $module = '', $action_val = 'index', $viewid = '')
{
    global $log, $app_strings;
    global $theme, $current_user;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    if ($module == 'Documents') {
        $output = '<td class="mailSubHeader" width="100%" align="center">';
    } else {
        $output = '<td align="right" style="padding: 5px;">';
    }
    $tabname = getParentTab();
    $url_string = '';
    // vtlib Customization : For uitype 10 popup during paging
    if ($_REQUEST['form'] == 'vtlibPopupView') {
        $url_string .= '&form=vtlibPopupView&forfield=' . vtlib_purify($_REQUEST['forfield']) . '&srcmodule=' . vtlib_purify($_REQUEST['srcmodule']) . '&forrecord=' . vtlib_purify($_REQUEST['forrecord']);
    }
    // END
    if ($module == 'Calendar' && $action_val == 'index') {
        if ($_REQUEST['view'] == '') {
            if ($current_user->activity_view == "This Year") {
                $mysel = 'year';
            } else {
                if ($current_user->activity_view == "This Month") {
                    $mysel = 'month';
                } else {
                    if ($current_user->activity_view == "This Week") {
                        $mysel = 'week';
                    } else {
                        $mysel = 'day';
                    }
                }
            }
        }
        $data_value = date('Y-m-d H:i:s');
        preg_match('/(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})/', $data_value, $value);
        $date_data = array('day' => $value[3], 'month' => $value[2], 'year' => $value[1], 'hour' => $value[4], 'min' => $value[5]);
        $tab_type = $_REQUEST['subtab'] == '' ? 'event' : vtlib_purify($_REQUEST['subtab']);
        $url_string .= isset($_REQUEST['view']) ? "&view=" . vtlib_purify($_REQUEST['view']) : "&view=" . $mysel;
        $url_string .= isset($_REQUEST['subtab']) ? "&subtab=" . vtlib_purify($_REQUEST['subtab']) : '';
        $url_string .= isset($_REQUEST['viewOption']) ? "&viewOption=" . vtlib_purify($_REQUEST['viewOption']) : '&viewOption=listview';
        $url_string .= isset($_REQUEST['day']) ? "&day=" . vtlib_purify($_REQUEST['day']) : '&day=' . $date_data['day'];
        $url_string .= isset($_REQUEST['week']) ? "&week=" . vtlib_purify($_REQUEST['week']) : '';
        $url_string .= isset($_REQUEST['month']) ? "&month=" . vtlib_purify($_REQUEST['month']) : '&month=' . $date_data['month'];
        $url_string .= isset($_REQUEST['year']) ? "&year=" . vtlib_purify($_REQUEST['year']) : "&year=" . $date_data['year'];
        $url_string .= isset($_REQUEST['n_type']) ? "&n_type=" . vtlib_purify($_REQUEST['n_type']) : '';
        $url_string .= isset($_REQUEST['search_option']) ? "&search_option=" . vtlib_purify($_REQUEST['search_option']) : '';
    }
    if ($module == 'Calendar' && $action_val != 'index') {
        //added for the All link from the homepage -- ticket 5211
        $url_string .= isset($_REQUEST['from_homepage']) ? "&from_homepage=" . vtlib_purify($_REQUEST['from_homepage']) : '';
    }
    if ($navigation_array['prev'] != 0) {
        if ($module == 'Calendar' && $action_val == 'index') {
            $output .= '<a href="javascript:;" onClick="cal_navigation(\'' . $tab_type . '\',\'' . $url_string . '\',\'&start=1\');" alt="' . $app_strings['LBL_FIRST'] . '" title="' . $app_strings['LBL_FIRST'] . '"><img src="' . vtiger_imageurl('start.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            $output .= '<a href="javascript:;" onClick="cal_navigation(\'' . $tab_type . '\',\'' . $url_string . '\',\'&start=' . $navigation_array['prev'] . '\');" alt="' . $app_strings['LBL_FIRST'] . '" title="' . $app_strings['LBL_FIRST'] . '"><img src="' . vtiger_imageurl('start.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
        } else {
            if ($action_val == "FindDuplicate") {
                $output .= '<a href="javascript:;" onClick="getDuplicateListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=1' . $url_string . '\');" alt="' . $app_strings['LBL_FIRST'] . '" title="' . $app_strings['LBL_FIRST'] . '"><img src="' . vtiger_imageurl('start.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getDuplicateListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['prev'] . $url_string . '\');" alt="' . $app_strings['LNK_LIST_PREVIOUS'] . '"title="' . $app_strings['LNK_LIST_PREVIOUS'] . '"><img src="' . vtiger_imageurl('previous.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            } elseif ($action_val == 'UnifiedSearch') {
                $output .= '<a href="javascript:;" onClick="getUnifiedSearchEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=1' . $url_string . '\');" alt="' . $app_strings['LBL_FIRST'] . '" title="' . $app_strings['LBL_FIRST'] . '"><img src="' . vtiger_imageurl('start.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getUnifiedSearchEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['prev'] . $url_string . '\');" alt="' . $app_strings['LNK_LIST_PREVIOUS'] . '"title="' . $app_strings['LNK_LIST_PREVIOUS'] . '"><img src="' . vtiger_imageurl('previous.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            } elseif ($module == 'Documents') {
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=1' . $url_string . '\');" alt="' . $app_strings['LBL_FIRST'] . '" title="' . $app_strings['LBL_FIRST'] . '"><img src="' . vtiger_imageurl('start.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['prev'] . $url_string . '&folderid=' . $action_val . '\');" alt="' . $app_strings['LNK_LIST_PREVIOUS'] . '"title="' . $app_strings['LNK_LIST_PREVIOUS'] . '"><img src="' . vtiger_imageurl('previous.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            } else {
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=1' . $url_string . '\');" alt="' . $app_strings['LBL_FIRST'] . '" title="' . $app_strings['LBL_FIRST'] . '"><img src="' . vtiger_imageurl('start.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['prev'] . $url_string . '\');" alt="' . $app_strings['LNK_LIST_PREVIOUS'] . '"title="' . $app_strings['LNK_LIST_PREVIOUS'] . '"><img src="' . vtiger_imageurl('previous.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            }
        }
    } else {
        $output .= '<img src="' . vtiger_imageurl('start_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
        $output .= '<img src="' . vtiger_imageurl('previous_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
    }
    if ($module == 'Calendar' && $action_val == 'index') {
        $jsNavigate = "cal_navigation('{$tab_type}','{$url_string}','&start='+this.value);";
    } else {
        if ($action_val == "FindDuplicate") {
            $jsNavigate = "getDuplicateListViewEntries_js('{$module}','parenttab={$tabname}&start='+this.value+'{$url_string}');";
        } elseif ($action_val == 'UnifiedSearch') {
            $jsNavigate = "getUnifiedSearchEntries_js('{$module}','parenttab={$tabname}&start='+this.value+'{$url_string}');";
        } elseif ($module == 'Documents') {
            $jsNavigate = "getListViewEntries_js('{$module}','parenttab={$tabname}&start='+this.value+'{$url_string}&folderid={$action_val}');";
        } else {
            $jsNavigate = "getListViewEntries_js('{$module}','parenttab={$tabname}&start='+this.value+'{$url_string}');";
        }
    }
    if ($module == 'Documents' && $action_val != 'UnifiedSearch') {
        $url = '&folderid=' . $action_val;
    } else {
        $url = '';
    }
    $jsHandler = "return VT_disableFormSubmit(event);";
    $output .= "<input class='small' name='pagenum' type='text' value='{$navigation_array['current']}'\n\t\tstyle='width: 3em;margin-right: 0.7em;' onchange=\"{$jsNavigate}\"\n\t\tonkeypress=\"{$jsHandler}\">";
    $output .= "<span name='" . $module . "_listViewCountContainerName' class='small' style='white-space: nowrap;'>";
    if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
        $output .= $app_strings['LBL_LIST_OF'] . ' ' . $navigation_array['verylast'];
    } else {
        $output .= "<img src='" . vtiger_imageurl('windowRefresh.gif', $theme) . "' alt='" . $app_strings['LBL_HOME_COUNT'] . "'\n\t\t\tonclick='getListViewCount(\"" . $module . "\",this,this.parentNode,\"" . $url . "\")'\n\t\t\talign='absmiddle' name='" . $module . "_listViewCountRefreshIcon'/>\n\t\t\t<img name='" . $module . "_listViewCountContainerBusy' src='" . vtiger_imageurl('vtbusy.gif', $theme) . "' style='display: none;'\n\t\t\talign='absmiddle' alt='" . $app_strings['LBL_LOADING'] . "'>";
    }
    $output .= '</span>';
    if ($navigation_array['next'] != 0) {
        if ($module == 'Calendar' && $action_val == 'index') {
            $output .= '<a href="javascript:;" onClick="cal_navigation(\'' . $tab_type . '\',\'' . $url_string . '\',\'&start=' . $navigation_array['next'] . '\');" alt="' . $app_strings['LNK_LIST_NEXT'] . '" title="' . $app_strings['LNK_LIST_NEXT'] . '"><img src="' . vtiger_imageurl('next.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            $output .= '<a href="javascript:;" onClick="cal_navigation(\'' . $tab_type . '\',\'' . $url_string . '\',\'&start=' . $navigation_array['verylast'] . '\');" alt="' . $app_strings['LBL_LAST'] . '" title="' . $app_strings['LBL_LAST'] . '"><img src="' . vtiger_imageurl('end.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
        } else {
            if ($action_val == "FindDuplicate") {
                $output .= '<a href="javascript:;" onClick="getDuplicateListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['next'] . $url_string . '\');" alt="' . $app_strings['LNK_LIST_NEXT'] . '" title="' . $app_strings['LNK_LIST_NEXT'] . '"><img src="' . vtiger_imageurl('next.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getDuplicateListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['verylast'] . $url_string . '\');" alt="' . $app_strings['LBL_LAST'] . '" title="' . $app_strings['LBL_LAST'] . '"><img src="' . vtiger_imageurl('end.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            } elseif ($action_val == 'UnifiedSearch') {
                $output .= '<a href="javascript:;" onClick="getUnifiedSearchEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['next'] . $url_string . '\');" alt="' . $app_strings['LNK_LIST_NEXT'] . '" title="' . $app_strings['LNK_LIST_NEXT'] . '"><img src="' . vtiger_imageurl('next.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getUnifiedSearchEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['verylast'] . $url_string . '\');" alt="' . $app_strings['LBL_LAST'] . '" title="' . $app_strings['LBL_LAST'] . '"><img src="themes/images/end.gif" border="0" align="absmiddle"></a>&nbsp;';
            } elseif ($module == 'Documents') {
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['next'] . $url_string . '&folderid=' . $action_val . '\');" alt="' . $app_strings['LNK_LIST_NEXT'] . '" title="' . $app_strings['LNK_LIST_NEXT'] . '"><img src="' . vtiger_imageurl('next.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['verylast'] . $url_string . '&folderid=' . $action_val . '\');" alt="' . $app_strings['LBL_LAST'] . '" title="' . $app_strings['LBL_LAST'] . '"><img src="' . vtiger_imageurl('end.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            } else {
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['next'] . $url_string . '\');" alt="' . $app_strings['LNK_LIST_NEXT'] . '" title="' . $app_strings['LNK_LIST_NEXT'] . '"><img src="' . vtiger_imageurl('next.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
                $output .= '<a href="javascript:;" onClick="getListViewEntries_js(\'' . $module . '\',\'parenttab=' . $tabname . '&start=' . $navigation_array['verylast'] . $url_string . '\');" alt="' . $app_strings['LBL_LAST'] . '" title="' . $app_strings['LBL_LAST'] . '"><img src="' . vtiger_imageurl('end.gif', $theme) . '" border="0" align="absmiddle"></a>&nbsp;';
            }
        }
    } else {
        $output .= '<img src="' . vtiger_imageurl('next_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
        $output .= '<img src="' . vtiger_imageurl('end_disabled.gif', $theme) . '" border="0" align="absmiddle">&nbsp;';
    }
    $output .= '</td>';
    if ($navigation_array['first'] == '') {
        return;
    } else {
        return $output;
    }
}
			<?php elseif ($this->_tpl_vars['HOME_STUFF']['Details']['Title']['1'] != 'Key Metrics' && $this->_tpl_vars['HOME_STUFF']['Details']['Title']['1'] != 'My Group Allocation'): ?>
			<img src="<?php echo vtiger_imageurl('bookMark.gif', $this->_tpl_vars['THEME']); ?>
" align="absmiddle" border="0" alt="<?php echo $this->_tpl_vars['APP']['LBL_MORE']; ?>
 <?php echo $this->_tpl_vars['APP']['LBL_INFORMATION']; ?>
" title="<?php echo $this->_tpl_vars['APP']['LBL_MORE']; ?>
 <?php echo $this->_tpl_vars['APP']['LBL_INFORMATION']; ?>
"/>
			<?php elseif ($this->_tpl_vars['HOME_STUFF']['Details']['Title']['1'] == 'Key Metrics'): ?>
			<img src="<?php echo vtiger_imageurl('bookMark.gif', $this->_tpl_vars['THEME']); ?>
" align="absmiddle" border="0" alt="<?php echo $this->_tpl_vars['APP']['LBL_MORE']; ?>
 <?php echo $this->_tpl_vars['APP']['LBL_INFORMATION']; ?>
" title="<?php echo $this->_tpl_vars['APP']['LBL_MORE']; ?>
 <?php echo $this->_tpl_vars['APP']['LBL_INFORMATION']; ?>
 "/>
			<?php elseif ($this->_tpl_vars['HOME_STUFF']['Details']['Title']['1'] == 'My Group Allocation'): ?>
			<img src="<?php echo vtiger_imageurl('bookMark.gif', $this->_tpl_vars['THEME']); ?>
" align="absmiddle" border="0" alt="<?php echo $this->_tpl_vars['APP']['LBL_MORE']; ?>
 <?php echo $this->_tpl_vars['APP']['LBL_INFORMATION']; ?>
" title="<?php echo $this->_tpl_vars['APP']['LBL_MORE']; ?>
 <?php echo $this->_tpl_vars['APP']['LBL_INFORMATION']; ?>
"/>
			<?php endif; ?>
		</td>
			<?php $_from = $this->_tpl_vars['row']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['element']):
?>
		<td align="left"/> <?php echo $this->_tpl_vars['element']; ?>
</td>
			<?php endforeach; endif; unset($_from); ?>
	</tr>
		<?php endforeach; endif; unset($_from); ?>
    foreach ($_from as $this->_tpl_vars['folder']) {
        ?>
				<tr onmouseout="this.className='lvtColData'" onmouseover="this.className='lvtColDataHover'">
					<td><?php 
        echo $this->_tpl_vars['folder']['foldername'];
        ?>
</td>
					<td align=right>
						<?php 
        if ($this->_tpl_vars['IS_ADMIN'] == 'on' && $this->_tpl_vars['folder']['folderid'] != '1') {
            ?>
							<a href="javascript:;" onclick="DeleteFolderCheck(<?php 
            echo $this->_tpl_vars['folder']['folderid'];
            ?>
);"><img border="0" src="<?php 
            echo vtiger_imageurl('delete.gif', $this->_tpl_vars['THEME']);
            ?>
" style="cursor: pointer;"/></a>
						<?php 
        } else {
            ?>
							&nbsp;
						<?php 
        }
        ?>
					</td>					
				</tr>
			<?php 
    }
}
unset($_from);
/**
 * Function to get customfield entries
 * @param string $module - Module name
 * return array  $cflist - customfield entries
 */
function getCFListEntries($module)
{
    global $adb, $app_strings, $theme, $smarty, $log;
    $tabid = getTabid($module);
    if ($module == 'Calendar') {
        $tabid = array(9, 16);
    }
    $theme_path = "themes/" . $theme . "/";
    $image_path = "themes/images/";
    $dbQuery = "SELECT fieldid,columnname,fieldlabel,uitype,displaytype,block,vtiger_convertleadmapping.cfmid,tabid FROM vtiger_field LEFT JOIN vtiger_convertleadmapping\n\t\t\t\tON  vtiger_convertleadmapping.leadfid = vtiger_field.fieldid WHERE tabid IN (" . generateQuestionMarks($tabid) . ")\n\t\t\t\tAND vtiger_field.presence IN (0,2)\n\t\t\t\tAND generatedtype = 2\n\t\t\t\tORDER BY sequence";
    $result = $adb->pquery($dbQuery, array($tabid));
    $row = $adb->fetch_array($result);
    $count = 1;
    $cflist = array();
    if ($row != '') {
        do {
            $cf_element = array();
            $cf_element['no'] = $count;
            $cf_element['label'] = getTranslatedString($row["fieldlabel"], $module);
            $fld_type_name = getCustomFieldTypeName($row["uitype"]);
            $cf_element['type'] = $fld_type_name;
            $cf_tab_id = $row["tabid"];
            if ($module == 'Leads') {
                $mapping_details = getListLeadMapping($row["cfmid"]);
                $cf_element[] = $mapping_details['accountlabel'];
                $cf_element[] = $mapping_details['contactlabel'];
                $cf_element[] = $mapping_details['potentiallabel'];
            }
            if ($module == 'Calendar') {
                if ($cf_tab_id == '9') {
                    $cf_element['activitytype'] = getTranslatedString('Task', $module);
                } else {
                    $cf_element['activitytype'] = getTranslatedString('Event', $module);
                }
                $cf_element['tool'] = '&nbsp;<img style="cursor:pointer;" onClick="deleteCustomField(' . $row["fieldid"] . ',\'' . $module . '\', \'' . $row["columnname"] . '\', \'' . $row["uitype"] . '\')" src="' . vtiger_imageurl('delete.gif', $theme) . '" border="0"  alt="' . $app_strings['LBL_DELETE_BUTTON_LABEL'] . '" title="' . $app_strings['LBL_DELETE_BUTTON_LABEL'] . '"/></a>';
            }
            $cflist[] = $cf_element;
            $count++;
        } while ($row = $adb->fetch_array($result));
    }
    return $cflist;
}
Example #28
0
/** This function returns a HTML output of associated vtiger_products for a given entity (Quotes,Invoice,Sales order or Purchase order)
 * Param $module - module name
 * Param $focus - module object
 * Return type string
 */
function getDetailAssociatedProducts($module, $focus)
{
    global $log;
    $log->debug("Entering getDetailAssociatedProducts(" . $module . "," . get_class($focus) . ") method ...");
    global $adb;
    global $mod_strings;
    global $theme;
    global $log;
    global $app_strings, $current_user;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    if (vtlib_isModuleActive("Products")) {
        $hide_stock = 'no';
    } else {
        $hide_stock = 'yes';
    }
    if ($module != 'PurchaseOrder') {
        if (GlobalVariable::getVariable('B2B', '1') == '1') {
            $acvid = $focus->column_fields['account_id'];
        } else {
            $acvid = $focus->column_fields['contact_id'];
        }
        if ($hide_stock == 'no') {
            $colspan = '2';
        } else {
            $colspan = '1';
        }
    } else {
        $acvid = $focus->column_fields['vendor_id'];
        $colspan = '1';
    }
    //Get the taxtype of this entity
    $taxtype = getInventoryTaxType($module, $focus->id);
    $currencytype = getInventoryCurrencyInfo($module, $focus->id);
    $output = '';
    //Header Rows
    $output .= '

	<table width="100%"  border="0" align="center" cellpadding="5" cellspacing="0" class="crmTable" id="proTab">
	   <tr valign="top">
	   	<td colspan="' . $colspan . '" class="dvInnerHeader"><b>' . $app_strings['LBL_ITEM_DETAILS'] . '</b></td>
		<td class="dvInnerHeader" align="center" colspan="2"><b>' . $app_strings['LBL_CURRENCY'] . ' : </b>' . getTranslatedCurrencyString($currencytype['currency_name']) . ' (' . $currencytype['currency_symbol'] . ')
		</td>
		<td class="dvInnerHeader" align="center" colspan="2"><b>' . $app_strings['LBL_TAX_MODE'] . ' : </b>' . $app_strings[$taxtype] . '
		</td>
	   </tr>
	   <tr valign="top">
		<td width=40% class="lvtCol"><font color="red">*</font>
			<b>' . $app_strings['LBL_ITEM_NAME'] . '</b>
		</td>';
    //Add Quantity in Stock column for SO, Quotes and Invoice
    if (($module == 'Quotes' || $module == 'SalesOrder' || $module == 'Invoice') && $hide_stock == 'no') {
        $output .= '<td width=10% class="lvtCol"><b>' . $app_strings['LBL_QTY_IN_STOCK'] . '</b></td>';
    }
    $output .= '

		<td width=10% class="lvtCol"><b>' . $app_strings['LBL_QTY'] . '</b></td>
		<td width=10% class="lvtCol" align="right"><b>' . $app_strings['LBL_LIST_PRICE'] . '</b></td>
		<td width=12% nowrap class="lvtCol" align="right"><b>' . $app_strings['LBL_TOTAL'] . '</b></td>
		<td width=13% valign="top" class="lvtCol" align="right"><b>' . $app_strings['LBL_NET_PRICE'] . '</b></td>
	   </tr>
	   	';
    // DG 15 Aug 2006
    // Add "ORDER BY sequence_no" to retain add order on all inventoryproductrel items
    if ($module == 'Quotes' || $module == 'PurchaseOrder' || $module == 'SalesOrder' || $module == 'Invoice') {
        $query = "select case when vtiger_products.productid != '' then vtiger_products.productname else vtiger_service.servicename end as productname," . " case when vtiger_products.productid != '' then 'Products' else 'Services' end as entitytype," . " case when vtiger_products.productid != '' then vtiger_products.unit_price else vtiger_service.unit_price end as unit_price," . " case when vtiger_products.productid != '' then vtiger_products.qtyinstock else 'NA' end as qtyinstock, vtiger_inventoryproductrel.* " . " from vtiger_inventoryproductrel" . " left join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid " . " left join vtiger_service on vtiger_service.serviceid=vtiger_inventoryproductrel.productid " . " where id=? ORDER BY sequence_no";
    }
    $result = $adb->pquery($query, array($focus->id));
    $num_rows = $adb->num_rows($result);
    $netTotal = '0.00';
    for ($i = 1; $i <= $num_rows; $i++) {
        $sub_prod_query = $adb->pquery("SELECT productid from vtiger_inventorysubproductrel WHERE id=? AND sequence_no=?", array($focus->id, $i));
        $subprodname_str = '';
        if ($adb->num_rows($sub_prod_query) > 0) {
            for ($j = 0; $j < $adb->num_rows($sub_prod_query); $j++) {
                $sprod_id = $adb->query_result($sub_prod_query, $j, 'productid');
                $sprod_name = getProductName($sprod_id);
                $str_sep = "";
                if ($j > 0) {
                    $str_sep = ":";
                }
                $subprodname_str .= $str_sep . " - " . $sprod_name;
            }
        }
        $subprodname_str = str_replace(":", "<br>", $subprodname_str);
        $productid = $adb->query_result($result, $i - 1, 'productid');
        $entitytype = $adb->query_result($result, $i - 1, 'entitytype');
        $productname = $adb->query_result($result, $i - 1, 'productname');
        $productname = '<a href="index.php?action=DetailView&record=' . $productid . '&module=' . $entitytype . '">' . $productname . '</a>';
        if ($subprodname_str != '') {
            $productname .= "<br/><span style='color:#C0C0C0;font-style:italic;'>" . $subprodname_str . "</span>";
        }
        $comment = $adb->query_result($result, $i - 1, 'comment');
        $qtyinstock = $adb->query_result($result, $i - 1, 'qtyinstock');
        $qty = $adb->query_result($result, $i - 1, 'quantity');
        $qty = number_format($qty, 2, '.', '');
        //Convert to 2 decimals
        $unitprice = $adb->query_result($result, $i - 1, 'unit_price');
        $listprice = $adb->query_result($result, $i - 1, 'listprice');
        $total = $qty * $listprice;
        $listprice = number_format($listprice, 2, '.', '');
        //Convert to 2 decimals
        //Product wise Discount calculation - starts
        $discount_percent = $adb->query_result($result, $i - 1, 'discount_percent');
        $discount_amount = $adb->query_result($result, $i - 1, 'discount_amount');
        $totalAfterDiscount = $total;
        $productDiscount = '0.00';
        if ($discount_percent != 'NULL' && $discount_percent != '') {
            $productDiscount = $total * $discount_percent / 100;
            $productDiscount = number_format($productDiscount, 2, '.', '');
            $totalAfterDiscount = $total - $productDiscount;
            //if discount is percent then show the percentage
            $discount_info_message = "{$discount_percent} % of " . CurrencyField::convertToUserFormat($total, null, true) . " = " . CurrencyField::convertToUserFormat($productDiscount, null, true);
        } elseif ($discount_amount != 'NULL' && $discount_amount != '') {
            $productDiscount = $discount_amount;
            $productDiscount = number_format($productDiscount, 2, '.', '');
            $totalAfterDiscount = $total - $productDiscount;
            $discount_info_message = $app_strings['LBL_DIRECT_AMOUNT_DISCOUNT'] . " = " . CurrencyField::convertToUserFormat($productDiscount, null, true);
        } else {
            $discount_info_message = $app_strings['LBL_NO_DISCOUNT_FOR_THIS_LINE_ITEM'];
        }
        //Product wise Discount calculation - ends
        $totalAfterDiscount = number_format($totalAfterDiscount, 2, '.', '');
        //Convert to 2 decimals
        $netprice = $totalAfterDiscount;
        //Calculate the individual tax if taxtype is individual
        if ($taxtype == 'individual') {
            $taxtotal = '0.00';
            $tax_info_message = $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . " = " . CurrencyField::convertToUserFormat($totalAfterDiscount, null, true) . " \\n";
            $tax_details = getTaxDetailsForProduct($productid, 'all', $acvid);
            for ($tax_count = 0; $tax_count < count($tax_details); $tax_count++) {
                $tax_name = $tax_details[$tax_count]['taxname'];
                $tax_label = $tax_details[$tax_count]['taxlabel'];
                $tax_value = getInventoryProductTaxValue($focus->id, $productid, $tax_name);
                $individual_taxamount = $totalAfterDiscount * $tax_value / 100;
                $individual_taxamount = number_format($individual_taxamount, 2, '.', '');
                //Convert to 2 decimals
                $taxtotal = $taxtotal + $individual_taxamount;
                $taxtotal = number_format($taxtotal, 2, '.', '');
                //Convert to 2 decimals
                $tax_info_message .= "{$tax_label} : {$tax_value} % = " . CurrencyField::convertToUserFormat($individual_taxamount, null, true) . " \\n";
            }
            $tax_info_message .= "\\n " . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . " = " . CurrencyField::convertToUserFormat($taxtotal, null, true);
            $netprice = $netprice + $taxtotal;
            $netprice = number_format($netprice, 2, '.', '');
            //Convert to 2 decimals
        }
        $sc_image_tag = '';
        if ($module == 'Invoice') {
            switch ($entitytype) {
                case 'Services':
                    if (vtlib_isModuleActive('ServiceContracts')) {
                        $sc_image_tag = '<a href="index.php?module=ServiceContracts&action=EditView&service_id=' . $productid . '&sc_related_to=' . $focus->column_fields['account_id'] . '&start_date=' . DateTimeField::convertToUserFormat($focus->column_fields['invoicedate']) . '&return_module=' . $module . '&return_id=' . $focus->id . '">' . '<img border="0" src="' . vtiger_imageurl('handshake.gif', $theme) . '" title="' . getTranslatedString('LBL_ADD_NEW', $module) . " " . getTranslatedString('ServiceContracts', 'ServiceContracts') . '" style="cursor: pointer;" align="absmiddle" />' . '</a>';
                    }
                    break;
                case 'Products':
                    if (vtlib_isModuleActive('Assets')) {
                        $sc_image_tag = '<a href="index.php?module=Assets&action=EditView&invoiceid=' . $focus->id . '&product=' . $productid . '&account=' . $focus->column_fields['account_id'] . '&datesold=' . DateTimeField::convertToUserFormat($focus->column_fields['invoicedate']) . '&return_module=' . $module . '&return_id=' . $focus->id . '" onmouseout="vtlib_listview.trigger(\'invoiceasset.onmouseout\', $(this))" onmouseover="vtlib_listview.trigger(\'cell.onmouseover\', $(this))">' . '<img border="0" src="' . vtiger_imageurl('barcode.png', $theme) . '" title="' . getTranslatedString('LBL_ADD_NEW', $module) . " " . getTranslatedString('Assets', 'Assets') . '" style="cursor: pointer;" align="absmiddle" />' . '<span style="display:none;" vtmodule="Assets" vtfieldname="invoice_product" vtrecordid="' . $focus->id . '::' . $productid . '::' . $i . '" type="vtlib_metainfo"></span>' . '</a>';
                    }
                    break;
                default:
                    $sc_image_tag = '';
            }
        }
        //For Product Name
        $output .= '
			   <tr valign="top">
				<td class="crmTableRow small lineOnTop">
					' . $productname . '&nbsp;' . $sc_image_tag . '
					<br>' . $comment . '
				</td>';
        //Upto this added to display the Product name and comment
        if ($module != 'PurchaseOrder' && $hide_stock == 'no') {
            $output .= '<td class="crmTableRow small lineOnTop">' . $qtyinstock . '</td>';
        }
        $output .= '<td class="crmTableRow small lineOnTop">' . $qty . '</td>';
        $output .= '
			<td class="crmTableRow small lineOnTop" align="right">
				<table width="100%" border="0" cellpadding="5" cellspacing="0">
				   <tr>
				   	<td align="right">' . CurrencyField::convertToUserFormat($listprice, null, true) . '</td>
				   </tr>
				   <tr>
					   <td align="right">(-)&nbsp;<b><a href="javascript:;" onclick="alert(\'' . $discount_info_message . '\'); ">' . $app_strings['LBL_DISCOUNT'] . ' : </a></b></td>
				   </tr>
				   <tr>
				   	<td align="right" nowrap>' . $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . ' : </td>
				   </tr>';
        if ($taxtype == 'individual') {
            $output .= '
				   <tr>
					   <td align="right" nowrap>(+)&nbsp;<b><a href="javascript:;" onclick="alert(\'' . $tax_info_message . '\');">' . $app_strings['LBL_TAX'] . ' : </a></b></td>
				   </tr>';
        }
        $output .= '
				</table>
			</td>';
        $output .= '
			<td class="crmTableRow small lineOnTop" align="right">
				<table width="100%" border="0" cellpadding="5" cellspacing="0">
				   <tr><td align="right">' . CurrencyField::convertToUserFormat($total, null, true) . '</td></tr>
				   <tr><td align="right">' . CurrencyField::convertToUserFormat($productDiscount, null, true) . '</td></tr>
				   <tr><td align="right" nowrap>' . CurrencyField::convertToUserFormat($totalAfterDiscount, null, true) . '</td></tr>';
        if ($taxtype == 'individual') {
            $output .= '<tr><td align="right" nowrap>' . CurrencyField::convertToUserFormat($taxtotal, null, true) . '</td></tr>';
        }
        $output .= '
				</table>
			</td>';
        $output .= '<td class="crmTableRow small lineOnTop" valign="bottom" align="right">' . CurrencyField::convertToUserFormat($netprice, null, true) . '</td>';
        $output .= '</tr>';
        $netTotal = $netTotal + $netprice;
    }
    $output .= '</table>';
    //$netTotal should be equal to $focus->column_fields['hdnSubTotal']
    $netTotal = $focus->column_fields['hdnSubTotal'];
    $netTotal = number_format($netTotal, 2, '.', '');
    //Convert to 2 decimals
    //Display the total, adjustment, S&H details
    $output .= '<table width="100%" border="0" cellspacing="0" cellpadding="5" class="crmTable">';
    $output .= '<tr>';
    $output .= '<td width="88%" class="crmTableRow small" align="right"><b>' . $app_strings['LBL_NET_TOTAL'] . '</td>';
    $output .= '<td width="12%" class="crmTableRow small" align="right"><b>' . CurrencyField::convertToUserFormat($netTotal, null, true) . '</b></td>';
    $output .= '</tr>';
    //Decide discount
    $finalDiscount = '0.00';
    $final_discount_info = '0';
    //if($focus->column_fields['hdnDiscountPercent'] != '') - previously (before changing to prepared statement) the selected option (either percent or amount) will have value and the other remains empty. So we can find the non selected item by empty check. But now with prepared statement, the non selected option stored as 0
    if ($focus->column_fields['hdnDiscountPercent'] != '0') {
        $finalDiscount = $netTotal * $focus->column_fields['hdnDiscountPercent'] / 100;
        $finalDiscount = number_format($finalDiscount, 2, '.', '');
        $final_discount_info = $focus->column_fields['hdnDiscountPercent'] . " % of " . CurrencyField::convertToUserFormat($netTotal, null, true) . " = " . CurrencyField::convertToUserFormat($finalDiscount, null, true);
    } elseif ($focus->column_fields['hdnDiscountAmount'] != '0') {
        $finalDiscount = $focus->column_fields['hdnDiscountAmount'];
        $finalDiscount = number_format($finalDiscount, 2, '.', '');
        $final_discount_info = CurrencyField::convertToUserFormat($finalDiscount, null, true);
    }
    //Alert the Final Discount amount even it is zero
    $final_discount_info = $app_strings['LBL_FINAL_DISCOUNT_AMOUNT'] . " = {$final_discount_info}";
    $final_discount_info = 'onclick="alert(\'' . $final_discount_info . '\');"';
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop">(-)&nbsp;<b><a href="javascript:;" ' . $final_discount_info . '>' . $app_strings['LBL_DISCOUNT'] . '</a></b></td>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop">' . CurrencyField::convertToUserFormat($finalDiscount, null, true) . '</td>';
    $output .= '</tr>';
    if ($taxtype == 'group') {
        $taxtotal = '0.00';
        $final_totalAfterDiscount = $netTotal - $finalDiscount;
        $tax_info_message = $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . " = " . CurrencyField::convertToUserFormat($final_totalAfterDiscount, null, true) . " \\n";
        //First we should get all available taxes and then retrieve the corresponding tax values
        $tax_details = getAllTaxes('available', '', 'edit', $focus->id);
        $ipr_cols = $adb->getColumnNames('vtiger_inventoryproductrel');
        //if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table
        for ($tax_count = 0; $tax_count < count($tax_details); $tax_count++) {
            $tax_name = $tax_details[$tax_count]['taxname'];
            $tax_label = $tax_details[$tax_count]['taxlabel'];
            if (in_array($tax_name, $ipr_cols)) {
                $tax_value = $adb->query_result($result, 0, $tax_name);
            } else {
                $tax_value = $tax_details[$tax_count]['percentage'];
            }
            if ($tax_value == '' || $tax_value == 'NULL') {
                $tax_value = '0.00';
            }
            $taxamount = ($netTotal - $finalDiscount) * $tax_value / 100;
            $taxtotal = $taxtotal + $taxamount;
            $tax_info_message .= "{$tax_label} : {$tax_value} % = " . CurrencyField::convertToUserFormat($taxtotal, null, true) . " \\n";
        }
        $tax_info_message .= "\\n " . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . " = " . CurrencyField::convertToUserFormat($taxtotal, null, true);
        $output .= '<tr>';
        $output .= '<td align="right" class="crmTableRow small">(+)&nbsp;<b><a href="javascript:;" onclick="alert(\'' . $tax_info_message . '\');">' . $app_strings['LBL_TAX'] . '</a></b></td>';
        $output .= '<td align="right" class="crmTableRow small">' . CurrencyField::convertToUserFormat($taxtotal, null, true) . '</td>';
        $output .= '</tr>';
    }
    $shAmount = $focus->column_fields['hdnS_H_Amount'] != '' ? $focus->column_fields['hdnS_H_Amount'] : '0.00';
    $shAmount = number_format($shAmount, 2, '.', '');
    //Convert to 2 decimals
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small">(+)&nbsp;<b>' . $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'] . '</b></td>';
    $output .= '<td align="right" class="crmTableRow small">' . CurrencyField::convertToUserFormat($shAmount, null, true) . '</td>';
    $output .= '</tr>';
    //calculate S&H tax
    $shtaxtotal = '0.00';
    //First we should get all available taxes and then retrieve the corresponding tax values
    $shtax_details = getAllTaxes('available', 'sh', 'edit', $focus->id);
    //if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table
    $shtax_info_message = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGE'] . " = " . CurrencyField::convertToUserFormat($shAmount, null, true) . "\\n";
    for ($shtax_count = 0; $shtax_count < count($shtax_details); $shtax_count++) {
        $shtax_name = $shtax_details[$shtax_count]['taxname'];
        $shtax_label = $shtax_details[$shtax_count]['taxlabel'];
        $shtax_percent = getInventorySHTaxPercent($focus->id, $shtax_name);
        $shtaxamount = $shAmount * $shtax_percent / 100;
        $shtaxamount = number_format($shtaxamount, 2, '.', '');
        $shtaxtotal = $shtaxtotal + $shtaxamount;
        $shtax_info_message .= "{$shtax_label} : {$shtax_percent} % = " . CurrencyField::convertToUserFormat($shtaxamount, null, true) . " \\n";
    }
    $shtax_info_message .= "\\n " . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . " = " . CurrencyField::convertToUserFormat($shtaxtotal, null, true);
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small">(+)&nbsp;<b><a href="javascript:;" onclick="alert(\'' . $shtax_info_message . '\')">' . $app_strings['LBL_TAX_FOR_SHIPPING_AND_HANDLING'] . '</a></b></td>';
    $output .= '<td align="right" class="crmTableRow small">' . CurrencyField::convertToUserFormat($shtaxtotal, null, true) . '</td>';
    $output .= '</tr>';
    $adjustment = $focus->column_fields['txtAdjustment'] != '' ? $focus->column_fields['txtAdjustment'] : '0.00';
    $adjustment = number_format($adjustment, 2, '.', '');
    //Convert to 2 decimals
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small">&nbsp;<b>' . $app_strings['LBL_ADJUSTMENT'] . '</b></td>';
    $output .= '<td align="right" class="crmTableRow small">' . CurrencyField::convertToUserFormat($adjustment, null, true) . '</td>';
    $output .= '</tr>';
    $grandTotal = $focus->column_fields['hdnGrandTotal'] != '' ? $focus->column_fields['hdnGrandTotal'] : '0.00';
    $grandTotal = number_format($grandTotal, 2, '.', '');
    //Convert to 2 decimals
    $output .= '<tr>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop"><b>' . $app_strings['LBL_GRAND_TOTAL'] . '</b></td>';
    $output .= '<td align="right" class="crmTableRow small lineOnTop">' . CurrencyField::convertToUserFormat($grandTotal, null, true) . '</td>';
    $output .= '</tr>';
    $output .= '</table>';
    $log->debug("Exiting getDetailAssociatedProducts method ...");
    return $output;
}
<script language="javascript" type="text/javascript" src="include/js/notebook.js"></script>

<input id="homeLayout" type="hidden" value="<?php 
echo $this->_tpl_vars['LAYOUT'];
?>
">

<?php 
$_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "Home/HomeButtons.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?>
<div id="vtbusy_homeinfo" style="display:none;">
	<img src="<?php 
echo vtiger_imageurl('vtbusy.gif', $this->_tpl_vars['THEME']);
?>
" border="0">
</div>

<table width="97%" class="small showPanelBg" cellpadding="0" cellspacing="0" border="0" align="center" valign="top">
<tr>
	<td width="100%" align="center" valign="top" height="350">
		<div id="MainMatrix" class="show_tab topMarginHomepage" style="padding:0px;width:100%">
			<?php 
$_from = $this->_tpl_vars['HOMEFRAME'];
if (!is_array($_from) && !is_object($_from)) {
    settype($_from, 'array');
}
$this->_foreach['homeframe'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['homeframe']['total'] > 0) {
Example #30
0
 /** Function to set primodule,secmodule,reporttype,reportname,reportdescription,folderid for given vtiger_reportid
  *  This function accepts the vtiger_reportid as argument
  *  It sets primodule,secmodule,reporttype,reportname,reportdescription,folderid for the given vtiger_reportid
  */
 function Reports($reportid = "")
 {
     global $adb, $current_user, $theme, $mod_strings;
     $this->initListOfModules();
     if ($reportid != "") {
         // Lookup information in cache first
         $cachedInfo = VTCacheUtils::lookupReport_Info($current_user->id, $reportid);
         $subordinate_users = VTCacheUtils::lookupReport_SubordinateUsers($reportid);
         if ($cachedInfo === false) {
             $ssql = "select vtiger_reportmodules.*,vtiger_report.* from vtiger_report inner join vtiger_reportmodules on vtiger_report.reportid = vtiger_reportmodules.reportmodulesid";
             $ssql .= " where vtiger_report.reportid = ?";
             $params = array($reportid);
             require_once 'include/utils/GetUserGroups.php';
             require 'user_privileges/user_privileges_' . $current_user->id . '.php';
             $userGroups = new GetUserGroups();
             $userGroups->getAllUserGroups($current_user->id);
             $user_groups = $userGroups->user_groups;
             if (!empty($user_groups) && $is_admin == false) {
                 $user_group_query = " (shareid IN (" . generateQuestionMarks($user_groups) . ") AND setype='groups') OR";
                 array_push($params, $user_groups);
             }
             $non_admin_query = " vtiger_report.reportid IN (SELECT reportid from vtiger_reportsharing WHERE {$user_group_query} (shareid=? AND setype='users'))";
             if ($is_admin == false) {
                 $ssql .= " and ( (" . $non_admin_query . ") or vtiger_report.sharingtype='Public' or vtiger_report.owner = ? or vtiger_report.owner in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '" . $current_user_parent_role_seq . "::%'))";
                 array_push($params, $current_user->id);
                 array_push($params, $current_user->id);
             }
             $query = $adb->pquery("select userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '" . $current_user_parent_role_seq . "::%'", array());
             $subordinate_users = array();
             for ($i = 0; $i < $adb->num_rows($query); $i++) {
                 $subordinate_users[] = $adb->query_result($query, $i, 'userid');
             }
             // Update subordinate user information for re-use
             VTCacheUtils::updateReport_SubordinateUsers($reportid, $subordinate_users);
             $result = $adb->pquery($ssql, $params);
             if ($result && $adb->num_rows($result)) {
                 $reportmodulesrow = $adb->fetch_array($result);
                 // Update information in cache now
                 VTCacheUtils::updateReport_Info($current_user->id, $reportid, $reportmodulesrow["primarymodule"], $reportmodulesrow["secondarymodules"], $reportmodulesrow["reporttype"], $reportmodulesrow["reportname"], $reportmodulesrow["description"], $reportmodulesrow["folderid"], $reportmodulesrow["owner"]);
             }
             // Re-look at cache to maintain code-consistency below
             $cachedInfo = VTCacheUtils::lookupReport_Info($current_user->id, $reportid);
         }
         if ($cachedInfo) {
             $this->primodule = $cachedInfo["primarymodule"];
             $this->secmodule = $cachedInfo["secondarymodules"];
             $this->reporttype = $cachedInfo["reporttype"];
             $this->reportname = decode_html($cachedInfo["reportname"]);
             $this->reportdescription = decode_html($cachedInfo["description"]);
             $this->folderid = $cachedInfo["folderid"];
             if ($is_admin == true || in_array($cachedInfo["owner"], $subordinate_users) || $cachedInfo["owner"] == $current_user->id) {
                 $this->is_editable = 'true';
             } else {
                 $this->is_editable = 'false';
             }
         } else {
             echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
             echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 80%; position: relative; z-index: 10000000;'>\n\n\t\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t\t<tbody><tr>\n\t\t\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>You are not allowed to View this Report </span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>\t\t\t\t\t\t\t\t   \t\t     </td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody></table>\n\t\t\t\t</div>";
             echo "</td></tr></table>";
             exit;
         }
     }
 }