Example #1
0
$accountidstr = $focus->column_fields['accountid'];
$accountidarr = explode(",", $accountidstr);
if (is_array($accountidarr)) {
    foreach ($accountidarr as $accountid) {
        if (!empty($accountid)) {
            $accountname = getAccountNameInfo($accountid);
            $acc_arr[] = $accountname;
        }
    }
}
$acc_arr_srt = implode(",", $acc_arr);
$focus->column_fields['accountid'] = $acc_arr_srt;
$smarty = new CRMSmarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$blocks2 = getBlocks($currentModule, "detail_view", '', $focus->column_fields);
$smarty->assign("BLOCKS", $blocks2);
$smarty->assign("UPDATEINFO", updateInfo($focus->id));
if (isset($module_enable_product) && $module_enable_product) {
    $smarty->assign("MODULE_ENABLE_PRODUCT", "true");
    $smarty->assign("ASSOCIATED_PRODUCTS", $focus->getDetailAssociatedProducts());
}
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
} else {
    $smarty->assign("NAME", "");
}
if (isset($_REQUEST['return_module'])) {
    $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
}
if (isset($_REQUEST['return_action'])) {
Example #2
0
    $focus->name = $focus->column_fields['bookname'];
}
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
    $focus->id = "";
    $focus->mode = '';
}
if (empty($_REQUEST['record']) && $focus->mode != 'edit') {
    setObjectValuesFromRequest($focus);
}
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$disp_view = getView($focus->mode);
if ($disp_view == 'edit_view') {
    $smarty->assign("BLOCKS", getBlocks($currentModule, $disp_view, $mode, $focus->column_fields));
} else {
    $bas_block = getBlocks($currentModule, $disp_view, $mode, $focus->column_fields, 'BAS');
    $blocks['basicTab'] = $bas_block;
    $smarty->assign("BLOCKS", $blocks);
    $smarty->assign("BLOCKS_COUNT", count($blocks));
}
$smarty->assign("OP_MODE", $disp_view);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("SINGLE_MOD", 'PriceBook');
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
if (isset($cust_fld)) {
    $smarty->assign("CUSTOMFIELD", $cust_fld);
}
$smarty->assign("ID", $focus->id);
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
Example #3
0
if (PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule . '_listquery'])) {
    $recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
    VT_detailViewNavigation($smarty, $recordNavigationInfo, $focus->id);
}
$smarty->assign('IS_REL_LIST', isPresentRelatedLists($currentModule));
$smarty->assign('SinglePane_View', $singlepane_view);
if ($singlepane_view == 'true') {
    $related_array = getRelatedLists($currentModule, $focus);
    $smarty->assign("RELATEDLISTS", $related_array);
    require_once 'include/ListView/RelatedListViewSession.php';
    if (!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
        RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']), vtlib_purify($_REQUEST['selected_header']));
    }
    $open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
    $smarty->assign("SELECTEDHEADERS", $open_related_modules);
}
if (isPermitted($currentModule, 'EditView', $record) == 'yes') {
    $smarty->assign('EDIT_DUPLICATE', 'permitted');
}
if (isPermitted($currentModule, 'Delete', $record) == 'yes') {
    $smarty->assign('DELETE', 'permitted');
}
$smarty->assign('BLOCKS', getBlocks($currentModule, 'detail_view', '', $focus->column_fields));
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$customlink_params = array('MODULE' => $currentModule, 'RECORD' => $focus->id, 'ACTION' => vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), array('DETAILVIEWBASIC', 'DETAILVIEW', 'DETAILVIEWWIDGET'), $customlink_params));
// Record Change Notification
$focus->markAsViewed($current_user->id);
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display('Inventory/InventoryDetailView.tpl');
Example #4
0
        }
        $smarty->assign('webmail_attachments', $attachment_links);
        if (preg_match("/FW:/i", $webmail->subject)) {
            $smarty->assign('SUBJECT', $webmail->subject);
        } else {
            $smarty->assign('SUBJECT', "FW: " . $webmail->subject);
        }
    }
    $smarty->assign('DESCRIPTION', $webmail->replyBody());
    $focus->mode = '';
}
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$disp_view = getView($focus->mode);
$details = getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields);
//changed this below line to view description in all language - bharath
$smarty->assign("BLOCKS", $details[$mod_strings['LBL_EMAIL_INFORMATION']]);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("SINGLE_MOD", $app_strings['Email']);
//id list of attachments while forwarding
$smarty->assign("ATT_ID_LIST", $att_id_list);
//needed when creating a new email with default values passed in
if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) {
    $focus->contact_name = vtlib_purify($_REQUEST['contact_name']);
}
if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) {
    $focus->contact_id = vtlib_purify($_REQUEST['contact_id']);
}
if (isset($_REQUEST['parent_name']) && is_null($focus->parent_name)) {
    $focus->parent_name = vtlib_purify($_REQUEST['parent_name']);
<?php

$TList = 0;
$BlockParam = $_GET['b'];
if (empty($BlockParam)) {
    $TList = getBlocks();
} else {
    $TList = getBlockFiles($BlockParam);
}
?>
<h1>Browse Blocks</h1>
<?php 
if (empty($_GET['b'])) {
    ?>
    <?php 
    foreach ($TList as $value) {
        ?>
  
        <a style="display:block" href="admin.php?p=BrowseBlocks&b=<?php 
        echo $value;
        ?>
"><?php 
        echo $value;
        ?>
</a>
    <?php 
    }
} else {
    ?>
     <?php 
    foreach ($TList as $value) {
if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) {
    $focus->contact_id = $_REQUEST['contact_id'];
}
if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) {
    $focus->parent_name = $_REQUEST['opportunity_name'];
}
if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) {
    $focus->parent_id = $_REQUEST['opportunity_id'];
}
if (isset($_REQUEST['accountname']) && is_null($focus->parent_name)) {
    $focus->parent_name = $_REQUEST['accountname'];
}
if (isset($_REQUEST['accountid']) && is_null($focus->parent_id)) {
    $focus->parent_id = $_REQUEST['accountid'];
}
$act_data = getBlocks($tab_type, "detail_view", '', $focus->column_fields);
$finaldata = array();
foreach ($act_data as $block => $entry) {
    foreach ($entry as $key => $value) {
        foreach ($value as $label => $field) {
            $fldlabel[$field['fldname']] = $label;
            if ($field['ui'] == 15 || $field['ui'] == 16) {
                foreach ($field['options'] as $index => $arr_val) {
                    if ($arr_val[2] == "selected") {
                        $finaldata[$field['fldname']] = $arr_val[0];
                    }
                }
            } else {
                $fldvalue = $field['value'];
                if ($field['fldname'] == 'description') {
                    $fldvalue = nl2br($fldvalue);
Example #7
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.
 ********************************************************************************/
global $mod_strings, $app_strings, $theme, $currentModule, $current_user;
require_once 'Smarty_setup.php';
require_once 'include/utils/utils.php';
$focus = CRMEntity::getInstance($currentModule);
$focus->mode = '';
$mode = 'mass_edit';
$disp_view = getView($focus->mode);
$idstring = $_REQUEST['idstring'];
$smarty = new vtigerCRM_Smarty();
$smarty->assign('MODULE', $currentModule);
$smarty->assign('APP', $app_strings);
$smarty->assign('THEME', $theme);
$smarty->assign('IMAGE_PATH', "themes/{$theme}/images/");
$smarty->assign('IDS', $idstring);
$smarty->assign('MASS_EDIT', '1');
$smarty->assign('BLOCKS', getBlocks($currentModule, $disp_view, $mode, $focus->column_fields, '', $focus->non_mass_edit_fields));
$smarty->assign("CATEGORY", getParentTab());
// Field Validation Information
$tabid = getTabid($currentModule);
$validationData = getDBValidationData($focus->tab_name, $tabid);
$validationArray = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME", $validationArray['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE", $validationArray['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL", $validationArray['fieldlabel']);
$smarty->display('MassEditForm.tpl');
Example #8
0
}
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
    $focus->id = "";
    $focus->mode = '';
}
if (empty($_REQUEST['record']) && $focus->mode != 'edit') {
    setObjectValuesFromRequest($focus);
}
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$disp_view = getView($focus->mode);
if ($disp_view == 'edit_view') {
    $smarty->assign("BLOCKS", getBlocks($currentModule, $disp_view, $mode, $focus->column_fields));
} else {
    $bas_block = getBlocks($currentModule, $disp_view, $mode, $focus->column_fields, 'BAS');
    $adv_block = getBlocks($currentModule, $disp_view, $mode, $focus->column_fields, 'ADV');
    $blocks['basicTab'] = $bas_block;
    if (is_array($adv_block)) {
        $blocks['moreTab'] = $adv_block;
    }
    $smarty->assign("BLOCKS", $blocks);
    $smarty->assign("BLOCKS_COUNT", count($blocks));
}
$smarty->assign("OP_MODE", $disp_view);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("SINGLE_MOD", 'Vendor');
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("ID", $focus->id);
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
Example #9
0
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$log->info("Account detail view");
$smarty = new vtigerCRM_Smarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=" . session_id() . $GLOBALS['request_string']);
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
} else {
    $smarty->assign("NAME", "");
}
$smarty->assign("BLOCKS", getBlocks("Accounts", "detail_view", '', $focus->column_fields));
$smarty->assign("UPDATEINFO", updateInfo($focus->id));
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if ($mod_seq_field != null) {
    $mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
} else {
    $mod_seq_id = $focus->id;
}
$smarty->assign('MOD_SEQ_ID', $mod_seq_id);
// END
$smarty->assign("CUSTOMFIELD", $cust_fld);
$smarty->assign("ID", $_REQUEST['record']);
$smarty->assign("SINGLE_MOD", 'Account');
$category = getParentTab();
$smarty->assign("CATEGORY", $category);
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="author" content="Michel Hiemstra (mhiemstra@php.net)" />
		<meta name="keywords" content="drag&drop portal, igoogle drag and drop, igoogle, drag and drop div igoogle javascript, drag and drop block like igoogle, div drag drop" />
		<meta name="description" content="iGoogle like Drag & Drop Portal v3 by Michel Hiemstra" />
		
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js"></script>
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js"></script>
		<script type="text/javascript" src="js/portal.js"></script>
		
		<?php 
require_once 'blocks_get.php';
?>
		
		<script type="text/javascript">
			var settings 	= <?php 
echo getBlocks();
?>
;
			
			var options 	= { portal 			: 'columns', 
								editorEnabled 	: true, 
								saveurl 		: 'blocks_save.php' };
								
			var data 		= {};
						
			var portal;
					
			Event.observe(window, 'load', function() {
				portal = new Portal(settings, options, data);
			});
		</script>
Example #11
0
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
    $focus->id = "";
    $focus->mode = '';
    $focus->column_fields['customernum'] = "";
}
/*
if(empty($focus->column_fields['customernum'])) {
	require_once('user_privileges/seqprefix_config.php');
	$focus->column_fields['customernum'] = $account_seqprefix.date("Ymd")."-".$focus->get_next_id();
}
*/
$disp_view = getView($focus->mode);
if ($disp_view == 'edit_view') {
    $smarty->assign("BLOCKS", getBlocks("Accounts", $disp_view, $focus->mode, $focus->column_fields));
} else {
    $smarty->assign("BASBLOCKS", getBlocks("Accounts", $disp_view, $focus->mode, $focus->column_fields));
    //$smarty->assign("ADVBLOCKS",getBlocks("Accounts",$disp_view,$mode,$focus->column_fields,'ADV'));
}
$smarty->assign("OP_MODE", $disp_view);
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
//retreiving the combo values array
//$comboFieldNames = Array('accounttype'=>'account_type_dom'
//                      ,'industry'=>'industry_dom');
//$comboFieldArray = getComboArray($comboFieldNames);
$log->info("Account detail view");
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
} else {
Example #12
0
function doluck($data, $user)
{
    global $fld_sep, $val_sep;
    if ($user === null) {
        $ans = getBlocks('Anon');
    } else {
        $ans = getBlocks($user);
    }
    $pg = '<h1>Pool Avg Block Luck History</h1><br>';
    if ($ans['STATUS'] == 'ok' and isset($ans['rows']) and $ans['rows'] > 0) {
        $count = $ans['s_rows'] - 1;
        $av = number_format(100 * $ans['s_luck:' . $count], 3);
        for ($i = 0; $i < $count; $i++) {
            // This also defines how many lines there are
            $cols = array('#0000c0', '#00dd00', '#e06020', '#b020e0');
        }
        $nams = array(1, 5, 15, 25);
        $nc = count($cols);
        addGBase();
        $cbx = array('skey' => 'block key', 'slines' => 'block lines', 'tkey' => 'time key', 'tlines' => 'time lines', 'over' => 'key overlap', 'smooth' => 'smooth', 'utc' => 'utc');
        $xon = array('skey' => 1, 'tkey' => 1, 'tlines' => 1, 'utc' => 1);
        $pg .= '<div>';
        foreach ($cbx as $nam => $txt) {
            $pg .= ' <span class=nb>';
            $pg .= "<input type=checkbox id={$nam} onclick='gact(this)'>";
            $pg .= "{$txt}&nbsp;</span>";
        }
        $pg .= '</div><div>';
        $i = 1;
        $datacols = '';
        foreach ($cols as $col) {
            if ($i != 1) {
                $pg .= '&nbsp;&nbsp;';
            }
            if ($i == 2 || $i == 4) {
                $chk = ' checked';
            } else {
                $chk = '';
            }
            $pg .= "<span class=nb><font color={$col}>";
            $pg .= "<input type=checkbox id=lin{$i}{$chk} onclick='godrw(0)'>: ";
            if ($nams[$i - 1] == 1) {
                $avs = '';
            } else {
                $avs = ' Avg';
            }
            $pg .= $nams[$i - 1] . " Block Luck{$avs}</font></span>";
            if ($i > 1) {
                $datacols .= ',';
            }
            $datacols .= $col;
            $i++;
        }
        $pg .= '</div>';
        $pg .= '<div id=can0><canvas id=can width=1 height=1>';
        $pg .= 'A graph will show here if your browser supports html5/canvas';
        $pg .= "</canvas></div>\n";
        $count = $ans['rows'];
        # add the orphan/reject ratios to the subsequent blocks
        $dr = 0;
        for ($i = $count - 1; $i >= 0; $i--) {
            $conf = $ans["confirmed:{$i}"];
            if ($conf == '1' or $conf == 'F') {
                $ans["diffratio:{$i}"] += $dr;
                $dr = 0;
            } else {
                $dr += $ans["diffratio:{$i}"];
            }
        }
        # $ans blocks are 0->rows-1 highest->lowest
        # build an array of valid block offsets (reversed lowest->highest)
        $off = array();
        for ($i = $count - 1; $i >= 0; $i--) {
            $conf = $ans["confirmed:{$i}"];
            if ($conf == '1' or $conf == 'F') {
                $off[] = $i;
            }
        }
        $data = '';
        $count = count($off);
        $avg = 0;
        # each valid block offset number (lowest->highest)
        for ($j = 0; $j < $count; $j++) {
            $i = $off[$j];
            $data .= $fld_sep . "height:{$j}{$val_sep}";
            $data .= $ans["height:{$i}"];
            $data .= $fld_sep . "seq:{$j}{$val_sep}";
            $data .= $ans["seq:{$i}"];
            $data .= $fld_sep . "firstcreatedate:{$j}{$val_sep}";
            $data .= $ans["firstcreatedate:{$i}"];
            $data .= $fld_sep . "0_luck:{$j}{$val_sep}";
            $data .= number_format(100 * $ans['luck:' . $i], 3);
            $avg += $ans["diffratio:{$i}"];
            $l5c = $l15c = $l25c = 1;
            $l5 = $l15 = $l25 = $ans['diffratio:' . $i];
            # +/- offset from j (12 is the max for 25)
            for ($k = 1; $k <= 12; $k++) {
                # we want the (n-1)/2 on each side of the offset number
                foreach (array(-1, 1) as $s) {
                    $o = $j + $s * $k;
                    if (0 <= $o && $o < $count) {
                        $dr = $ans['diffratio:' . $off[$o]];
                        if ($k <= 2) {
                            $l5 += $dr;
                            $l5c++;
                        }
                        if ($k < 7) {
                            $l15 += $dr;
                            $l15c++;
                        }
                        $l25 += $dr;
                        $l25c++;
                    }
                }
            }
            # luck is 1/(mean diffratio)
            $data .= $fld_sep . "1_luck:{$j}{$val_sep}";
            $data .= number_format(100 * $l5c / $l5, 3);
            $data .= $fld_sep . "2_luck:{$j}{$val_sep}";
            $data .= number_format(100 * $l15c / $l15, 3);
            $data .= $fld_sep . "3_luck:{$j}{$val_sep}";
            $data .= number_format(100 * $l25c / $l25, 3);
        }
        $data .= $fld_sep . 'rows' . $val_sep . $count;
        $data .= $fld_sep . 'arp' . $val_sep . ',0_,1_,2_,3_';
        $data .= $fld_sep . 'cols' . $val_sep . $datacols;
        $pg .= "<script type='text/javascript'>\n";
        $pg .= lckg($nc, 100 * $count / $avg);
        $pg .= "\nfunction godrw(f){var cbx=[";
        $comma = '';
        foreach ($cbx as $nam => $txt) {
            $pg .= "{$comma}'{$nam}'";
            $comma = ',';
        }
        $pg .= '];if(f){var xon={};';
        foreach ($xon as $nam => $val) {
            $pg .= "xon['{$nam}']=1;";
        }
        $pg .= "doinit(cbx,xon)}dodrw('{$data}',cbx)};godrw(1);</script>\n";
    }
    return $pg;
}
Example #13
0
function doblocks($data, $user)
{
    $blink = '<a href=https://www.blocktrail.com/BTC/block/';
    $pg = '';
    if ($user === null) {
        $ans = getBlocks('Anon');
    } else {
        $ans = getBlocks($user);
    }
    if (nuem(getparam('csv', true))) {
        $wantcsv = false;
    } else {
        $wantcsv = true;
    }
    if ($wantcsv === false) {
        if ($ans['STATUS'] == 'ok' and isset($ans['s_rows']) and $ans['s_rows'] > 0) {
            $pg .= '<h1>Block Statistics</h1>';
            $pg .= "<table callpadding=0 cellspacing=0 border=0>\n";
            $pg .= "<tr class=title>";
            $pg .= "<td class=dl>Description</td>";
            $pg .= "<td class=dr>Time</td>";
            $pg .= "<td class=dr>MeanTx%</td>";
            $pg .= "<td class=dr>Diff%</td>";
            $pg .= "<td class=dr>Mean%</td>";
            $pg .= "<td class=dr>CDF[Erl]</td>";
            $pg .= "<td class=dr>Luck%</td>";
            $pg .= "</tr>\n";
            $since = $data['info']['lastblock'];
            $count = $ans['s_rows'];
            for ($i = 0; $i < $count; $i++) {
                if ($i % 2 == 0) {
                    $row = 'even';
                } else {
                    $row = 'odd';
                }
                $desc = $ans['s_desc:' . $i];
                $age = daysago($since - $ans['s_prevcreatedate:' . $i]);
                $diff = number_format(100 * $ans['s_diffratio:' . $i], 2);
                $mean = number_format(100 * $ans['s_diffmean:' . $i], 2);
                $cdferl = $ans['s_cdferl:' . $i];
                list($fg, $bg) = erlcolour($cdferl);
                $cdferldsp = "<font color={$fg}>" . number_format($cdferl, 4) . '</font>';
                $bg = " bgcolor={$bg}";
                $luck = number_format(100 * $ans['s_luck:' . $i], 2);
                $txm = number_format(100 * $ans['s_txmean:' . $i], 1);
                $pg .= "<tr class={$row}>";
                $pg .= "<td class=dl>{$desc} Blocks</td>";
                $pg .= "<td class=dr>{$age}</td>";
                $pg .= "<td class=dr>{$txm}%</td>";
                $pg .= "<td class=dr>{$diff}%</td>";
                $pg .= "<td class=dr>{$mean}%</td>";
                $pg .= "<td class=dr{$bg}>{$cdferldsp}</td>";
                $pg .= "<td class=dr>{$luck}%</td>";
                $pg .= "</tr>\n";
            }
            $pg .= "</table>\n";
        }
        if ($ans['STATUS'] == 'ok') {
            $count = $ans['rows'];
            if ($count == 1) {
                $num = '';
                $s = '';
            } else {
                $num = " {$count}";
                $s = 's';
            }
            $pg .= "<h1>Last{$num} Block{$s}</h1>";
        } else {
            $pg .= '<h1>Blocks</h1>';
        }
        list($fg, $bg) = pctcolour(25.0);
        $pg .= "<span style='background:{$bg}; color:{$fg};'>";
        $pg .= "&nbsp;Green&nbsp;</span>&nbsp;";
        $pg .= 'is good luck. Lower Diff% and brighter green is better luck.<br>';
        list($fg, $bg) = pctcolour(100.0);
        $pg .= "<span style='background:{$bg}; color:{$fg};'>";
        $pg .= "&nbsp;100%&nbsp;</span>&nbsp;";
        $pg .= 'is expected average.&nbsp;';
        list($fg, $bg) = pctcolour(400.0);
        $pg .= "<span style='background:{$bg}; color:{$fg};'>";
        $pg .= "&nbsp;Red&nbsp;</span>&nbsp;";
        $pg .= 'is bad luck. Higher Diff% and brighter red is worse luck.<br><br>';
        $pg .= "<table callpadding=0 cellspacing=0 border=0>\n";
        $pg .= "<tr class=title>";
        $pg .= "<td class=dr>#</td>";
        $pg .= "<td class=dl>Height</td>";
        if ($user !== null) {
            $pg .= "<td class=dl>Who</td>";
        }
        $pg .= "<td class=dr>Block Reward</td>";
        $pg .= "<td class=dc>When</td>";
        $pg .= "<td class=dr>Status</td>";
        $pg .= "<td class=dr>Diff</td>";
        $pg .= "<td class=dr>Diff%</td>";
        $pg .= "<td class=dr>CDF</td>";
        $pg .= "<td class=dr>B</td>";
        $pg .= "</tr>\n";
    }
    $blktot = 0;
    $nettot = 0;
    $i = 0;
    $cnt = 0;
    $orph = false;
    $csv = "Sequence,Height,Status,Timestamp,DiffAcc,NetDiff,Hash\n";
    if ($ans['STATUS'] == 'ok') {
        $count = $ans['rows'];
        for ($i = 0; $i < $count; $i++) {
            if ($i % 2 == 0) {
                $row = 'even';
            } else {
                $row = 'odd';
            }
            $hi = $ans['height:' . $i];
            $hifld = "{$blink}{$hi}>{$hi}</a>";
            $ex = '';
            $conf = $ans['confirmed:' . $i];
            $stat = $ans['status:' . $i];
            $inf = $ans['info:' . $i];
            $tt = '';
            if ($conf == 'O' or $conf == 'R') {
                $ex = 's';
                $orph = true;
                $seq = '';
                $nn = $cnt;
                if ($conf == 'R') {
                    addTips();
                    $in = explode(':', $inf, 2);
                    if (trim($in[0]) != '') {
                        $stat = trim($in[0]);
                    }
                    if (count($in) < 2 or trim($in[1]) == '') {
                        $tip = 'Share diff was VERY close<br>';
                        $tip .= 'so we tested it,<br>';
                        $tip .= "but it wasn't worthy<br>";
                    } else {
                        $tip = str_replace('+', '<br>', trim($in[1]));
                    }
                    $tt = "<span class=q onclick='tip(\"btip{$i}\",6000)'>";
                    $tt .= '?</span><span class=tip0>';
                    $tt .= "<span class=notip id=btip{$i}>";
                    $tt .= "{$tip}</span></span>";
                }
            } else {
                $seq = $ans['seq:' . $i];
                $nn = ++$cnt;
            }
            if ($conf == '1') {
                if (isset($data['info']['lastheight'])) {
                    $confn = 1 + $data['info']['lastheight'] - $hi;
                    $stat = '+' . $confn . ' Confirms';
                } else {
                    $stat = 'Conf';
                }
            }
            $stara = '';
            if ($conf == 'O' or $conf == 'R') {
                $stara = '<span class=st1>*</span>';
            }
            if (isset($ans['statsconf:' . $i])) {
                if ($ans['statsconf:' . $i] == 'Y') {
                    $approx = '';
                } else {
                    $approx = '~';
                }
            } else {
                $approx = '';
            }
            $diffacc = $ans['diffacc:' . $i];
            $acc = number_format($diffacc, 0);
            $netdiff = $ans['netdiff:' . $i];
            $diffratio = $ans['diffratio:' . $i];
            $cdf = $ans['cdf:' . $i];
            $luck = $ans['luck:' . $i];
            if ($diffratio > 0) {
                $pct = 100.0 * $diffratio;
                list($fg, $bg) = pctcolour($pct);
                $bpct = "<font color={$fg}>{$approx}" . number_format($pct, 3) . '%</font>';
                $bg = " bgcolor={$bg}";
                $blktot += $diffacc;
                if ($conf != 'O' and $conf != 'R') {
                    $nettot += $netdiff;
                }
                $cdfdsp = number_format($cdf, 3);
            } else {
                $bg = '';
                $bpct = '?';
                $cdfdsp = '?';
            }
            if ($wantcsv === false) {
                $pg .= "<tr class={$row}>";
                $pg .= "<td class=dr{$ex}>{$seq}</td>";
                $pg .= "<td class=dl{$ex}>{$hifld}</td>";
                if ($user !== null) {
                    $pg .= "<td class=dl{$ex}>" . htmlspecialchars($ans['workername:' . $i]) . '</td>';
                }
                $pg .= "<td class=dr{$ex}>" . btcfmt($ans['reward:' . $i]) . '</td>';
                $pg .= "<td class=dl{$ex}>" . utcd($ans['firstcreatedate:' . $i]) . '</td>';
                $pg .= "<td class=dr{$ex}>{$tt}{$stat}</td>";
                $pg .= "<td class=dr>{$stara}{$approx}{$acc}</td>";
                $pg .= "<td class=dr{$bg}>{$bpct}</td>";
                $pg .= "<td class=dr>{$cdfdsp}</td>";
                $pg .= "<td class=dr>{$nn}</td>";
                $pg .= "</tr>\n";
            } else {
                $csv .= "{$seq},";
                $csv .= "{$hi},";
                $csv .= "\"{$stat}\",";
                $csv .= $ans['firstcreatedate:' . $i] . ',';
                $csv .= "{$diffacc},";
                $csv .= "{$netdiff},";
                $csv .= $ans['blockhash:' . $i] . "\n";
            }
        }
    }
    if ($wantcsv === true) {
        echo $csv;
        exit(0);
    }
    if ($orph === true) {
        $pg .= '<tr><td colspan=';
        if ($user === null) {
            $pg .= '7';
        } else {
            $pg .= '8';
        }
        $pg .= ' class=dc><font size=-1><span class=st1>*</span>';
        $pg .= 'Orphans/Rejects count as shares but not as a block in calculations';
        $pg .= '</font></td></tr>';
    }
    $pg .= "</table>\n";
    return $pg;
}
Example #14
0
}
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$log->info("SalesOrder detail view");
$smarty = new vtigerCRM_Smarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=" . session_id() . $GLOBALS['request_string']);
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
} else {
    $smarty->assign("NAME", "");
}
$smarty->assign("BLOCKS", getBlocks($currentModule, "detail_view", '', $focus->column_fields));
$smarty->assign("UPDATEINFO", updateInfo($focus->id));
$smarty->assign("CUSTOMFIELD", $cust_fld);
$smarty->assign("ID", vtlib_purify($_REQUEST['record']));
$salesorder_no = getModuleSequenceNumber($currentModule, vtlib_purify($_REQUEST['record']));
$smarty->assign("SO_NO", $salesorder_no);
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if ($mod_seq_field != null) {
    $mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
} else {
    $mod_seq_id = $focus->id;
}
$smarty->assign('MOD_SEQ_ID', $mod_seq_id);
// END
$smarty->assign("SINGLE_MOD", 'SalesOrder');
Example #15
0
    $related_array = getRelatedLists($currentModule, $focus);
    $smarty->assign("RELATEDLISTS", $related_array);
    require_once 'include/ListView/RelatedListViewSession.php';
    if (!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
        RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']), vtlib_purify($_REQUEST['selected_header']));
    }
    $open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
    $smarty->assign("SELECTEDHEADERS", $open_related_modules);
}
if (isPermitted($currentModule, 'EditView', $record) == 'yes') {
    $smarty->assign('EDIT_DUPLICATE', 'permitted');
}
if (isPermitted($currentModule, 'Delete', $record) == 'yes') {
    $smarty->assign('DELETE', 'permitted');
}
$blocks = getBlocks($currentModule, 'detail_view', '', $focus->column_fields);
// This might not be picked up in getBlocks as we do not have a field in it.
if (empty($blocks[getTranslatedString('StatusInformation', $currentModule)])) {
    $blocks[getTranslatedString('StatusInformation', $currentModule)] = array();
}
$smarty->assign('BLOCKS', $blocks);
// Gather the custom link information to display
include_once 'vtlib/Vtiger/Link.php';
$customlink_params = array('MODULE' => $currentModule, 'RECORD' => $focus->id, 'ACTION' => vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), array('DETAILVIEWBASIC', 'DETAILVIEW', 'DETAILVIEWWIDGET'), $customlink_params));
// Record Change Notification
$focus->markAsViewed($current_user->id);
//$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
/** Removing Edit permissions */
$smarty->assign('DETAILVIEW_AJAX_EDIT', false);
$smarty->assign('EDIT_DUPLICATE', 'notpermitted');
Example #16
0
    $RETURN_MODULE = vtlib_purify($_REQUEST['return_module']);
}
if (isset($_REQUEST['return_action'])) {
    $smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action']));
    $RETURN_ACTION = vtlib_purify($_REQUEST['return_action']);
}
if ($_REQUEST['isDuplicate'] != 'true' && isset($_REQUEST['return_id'])) {
    $smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id']));
    $RETURN_ID = vtlib_purify($_REQUEST['return_id']);
}
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$focus->mode = $mode;
$disp_view = getView($focus->mode);
$smarty->assign("IMAGENAME", $focus->imagename);
$smarty->assign("BLOCKS", getBlocks($currentModule, $disp_view, $mode, $focus->column_fields));
$smarty->assign("MODULE", 'Settings');
$smarty->assign("MODE", $focus->mode);
$smarty->assign("HOUR_FORMAT", $focus->hour_format);
$smarty->assign("START_HOUR", $focus->start_hour);
if ($_REQUEST['Edit'] == ' Edit ') {
    $smarty->assign("READONLY", "readonly");
    $smarty->assign("USERNAME_READONLY", "readonly");
}
if (isset($_REQUEST['record']) && $_REQUEST['isDuplicate'] != 'true') {
    $smarty->assign("USERNAME_READONLY", "readonly");
}
$HomeValues = $focus->getHomeStuffOrder($focus->id);
$smarty->assign("TAGCLOUDVIEW", $HomeValues['Tag Cloud']);
$smarty->assign("SHOWTAGAS", $HomeValues['showtagas']);
unset($HomeValues['Tag Cloud']);
Example #17
0
}
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
    $focus->id = "";
    $focus->mode = '';
}
if (empty($_REQUEST['record']) && $focus->mode != 'edit') {
    setObjectValuesFromRequest($focus);
}
$userDetails = getOtherUserName($current_user->id);
$to_email = getUserEmailId('id', $current_user->id);
$smarty->assign("CURRENTUSERID", $current_user->id);
$disp_view = getView($focus->mode);
if ($disp_view == 'edit_view') {
    $act_data = getBlocks($tab_type, $disp_view, $mode, $focus->column_fields);
} else {
    $act_data = getBlocks($tab_type, $disp_view, $mode, $focus->column_fields, 'BAS');
}
$smarty->assign("BLOCKS", $act_data);
foreach ($act_data as $header => $blockitem) {
    foreach ($blockitem as $row => $data) {
        foreach ($data as $key => $maindata) {
            $uitype[$maindata[2][0]] = $maindata[0][0];
            $fldlabel[$maindata[2][0]] = $maindata[1][0];
            $fldlabel_sel[$maindata[2][0]] = $maindata[1][1];
            $fldlabel_combo[$maindata[2][0]] = $maindata[1][2];
            $value[$maindata[2][0]] = $maindata[3][0];
            $secondvalue[$maindata[2][0]] = $maindata[3][1];
            $thirdvalue[$maindata[2][0]] = $maindata[3][2];
        }
    }
}
Example #18
0
    $focus->column_fields['ship_city'] = $vend_focus->column_fields['city'];
    $focus->column_fields['bill_street'] = $vend_focus->column_fields['street'];
    $focus->column_fields['ship_street'] = $vend_focus->column_fields['street'];
    $focus->column_fields['bill_state'] = $vend_focus->column_fields['state'];
    $focus->column_fields['ship_state'] = $vend_focus->column_fields['state'];
    $focus->column_fields['bill_code'] = $vend_focus->column_fields['postalcode'];
    $focus->column_fields['ship_code'] = $vend_focus->column_fields['postalcode'];
    $focus->column_fields['bill_country'] = $vend_focus->column_fields['country'];
    $focus->column_fields['ship_country'] = $vend_focus->column_fields['country'];
    $focus->column_fields['bill_pobox'] = $vend_focus->column_fields['pobox'];
    $focus->column_fields['ship_pobox'] = $vend_focus->column_fields['pobox'];
}
$disp_view = getView($focus->mode);
$smarty->assign('BLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields));
$smarty->assign('BASBLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields, 'BAS'));
$smarty->assign('ADVBLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields, 'ADV'));
$smarty->assign('OP_MODE', $disp_view);
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('MODULE', $currentModule);
// TODO: Update Single Module Instance name here.
$smarty->assign('SINGLE_MOD', 'SINGLE_' . $currentModule);
$smarty->assign('CATEGORY', $category);
$smarty->assign("THEME", $theme);
$smarty->assign('IMAGE_PATH', "themes/{$theme}/images/");
$smarty->assign('ID', $focus->id);
$smarty->assign('MODE', $focus->mode);
$smarty->assign('CREATEMODE', isset($_REQUEST['createmode']) ? vtlib_purify($_REQUEST['createmode']) : '');
$smarty->assign('CHECK', Button_Check($currentModule));
$smarty->assign('DUPLICATE', $isduplicate);
if ($focus->mode == 'edit' || $isduplicate) {
Example #19
0
<?
    //new block content aka new content
    $TBlocks = getBlocks();
    
    //if post then save
    if( !empty($_POST['BlockName']) && !empty($_POST['ContentName']) )
    {
        $BlockParam = $_POST['BlockName'];
        $FileParam  = $_POST['ContentName'];
        $FileContent = $_POST['ContentData'];
        
        $SaveFile = GC_PBASE.'blocks/'.$BlockParam.'/'.$FileParam.'.php';
        
        //check if file exist
        if(!is_file($SaveFile))
        {
            $filehandle = fopen($SaveFile,'w');
            fwrite($filehandle,stripslashes($FileContent));
            fclose($filehandle);
        }
        else //file exist
            $TMsg = '<p>The File already exist please use the browse block function.</p>';
    }
?>
<h1>New Block Content</h1>
<br/>
<?php 
echo $TMsg;
?>
<form action="admin.php?p=NewContent" method="post">
     <select name="BlockName" class="combobox">