init
This commit is contained in:
184
modules/EcmFkPackages/DetailView.php
Normal file
184
modules/EcmFkPackages/DetailView.php
Normal file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
|
||||
|
||||
//require_once('modules/EcmGroupFkPackages/HeaderMenu.php');
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once('modules/EcmFkPackages/EcmFkPackage.php');
|
||||
// require_once('modules/EcmFkPackages/Forms.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$json_config = new json_config();
|
||||
|
||||
$file = 'modules/EcmGroupFkPackages/EcmGroupFkPackage.php';
|
||||
|
||||
if (file_exists($file)) {
|
||||
$cc = array();
|
||||
require_once($file);
|
||||
$cc = EcmGroupFkPackage::loadSettings();
|
||||
}
|
||||
|
||||
|
||||
$OPT = array();
|
||||
|
||||
$OPT['row_item_height'] = $cc['row_item_height'];
|
||||
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
|
||||
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
|
||||
$OPT['position_table_height'] = $OPT['row_item_height'] * $OPT['rows_on_item_list'] + 40 + $OPT['rows_on_item_list'] * 4;
|
||||
|
||||
$focus = new EcmFkPackage();
|
||||
|
||||
if (isset($_REQUEST['record'])) {
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
|
||||
if($focus->total == '')
|
||||
$focus->total = '0';
|
||||
|
||||
if($focus->subtotal == '')
|
||||
$focus->subtotal = '0';
|
||||
|
||||
$focus->format_all_fields();
|
||||
|
||||
if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') {
|
||||
$focus->doNotAccepted();
|
||||
}
|
||||
|
||||
/*
|
||||
echo '<pre>PL:' . var_export($focus->getPositionList(true), true) . PHP_EOL;
|
||||
echo '<pre>PL:' . var_export($focus->getFkPackagePositionList(true), true) . PHP_EOL;
|
||||
echo '<pre>PL:' . var_export($focus->getIncomePositionList(true), true) . PHP_EOL;
|
||||
exit;
|
||||
*/
|
||||
|
||||
// $focus->position_list = str_replace('"', '\"', $focus->getPositionList());
|
||||
// $focus->fkpackages_list = str_replace('"', '\"', $focus->getFkPackagePositionList());
|
||||
// $focus->income_list = str_replace('"', '\"', $focus->getIncomePositionList());
|
||||
|
||||
$OPT['status'] = $focus->status;
|
||||
} else {
|
||||
$OPT['new_number'] = true;
|
||||
|
||||
$datef = $current_user->getPreference('datef');
|
||||
|
||||
if ($datef != '')
|
||||
$sugar_config['datef'];
|
||||
|
||||
$focus->register_date = date($datef);
|
||||
|
||||
$focus->payment_date = date($datef, mktime() + 30 * 24 * 60 * 60);
|
||||
|
||||
$focus->sell_date = date($datef);
|
||||
}
|
||||
|
||||
//if access 'Delete' is avaible for user than he is Manager and he can confirm Quotes.
|
||||
$OPT['user']['access']['send_email'] = $focus->ACLAccess("send_email");
|
||||
if (isset($_REQUEST['send_email']) && $_REQUEST['send_email'] == '1')
|
||||
$OPT['setTab'] = 'EMAIL';
|
||||
|
||||
$tmp = $current_user->getPreference('num_grp_sep');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_number_grouping_seperator'];
|
||||
|
||||
$OPT['sep_1000'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('dec_sep');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_decimal_seperator'];
|
||||
|
||||
$OPT['dec_sep'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('default_currency_significant_digits');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_currency_significant_digits'];
|
||||
|
||||
$OPT['dec_len'] = $tmp;
|
||||
|
||||
|
||||
$OPT['default_unit'] = "1";
|
||||
|
||||
$OPT['default_vat'] = "23.00";
|
||||
|
||||
$OPT['default_category'] = "";
|
||||
|
||||
$OPT['type'] = $focus->type;
|
||||
|
||||
$OPT['to_is_vat_free'] = $focus->to_is_vat_free;
|
||||
|
||||
$cq = $current_user->getPreference('confirm_quotes');
|
||||
$OPT['user']['confirm_quotes'] = ((isset($cq) && $cq) ? 1 : 0);
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
$show_pdf = $current_user->getPreference('show_pdf_in_div');
|
||||
|
||||
if (!isset($show_pdf)) {
|
||||
require_once('modules/EcmGroupFkPackages/EcmGroupFkPackage.php');
|
||||
$cc = EcmGroupFkPackage::loadSettings();
|
||||
$show_pdf = $cc['show_pdf_in_div_global'];
|
||||
}
|
||||
|
||||
$scriptOpt = '
|
||||
<script language="javascript">
|
||||
var SHOW_PDF_IN_DIV =' . $show_pdf . ';
|
||||
var OPT = ' . str_replace('"', '\"', $json->encode($OPT)) . ';
|
||||
var MOD = ' . str_replace('"', '\"', $json->encode($mod_strings)) . ';
|
||||
var N, N2;
|
||||
</script>
|
||||
';
|
||||
|
||||
echo $scriptOpt;
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('modules/EcmFkPackages/views/DetailView/view.detail.my.php');
|
||||
|
||||
$edit = new ViewDetailMy();
|
||||
$edit->ss = new Sugar_Smarty();
|
||||
|
||||
$edit->module = 'EcmFkPackages';
|
||||
$edit->bean = $focus;
|
||||
$edit->tplFile = 'include/ECM/EcmViews/DetailView/Tabs/DetailView.tpl';
|
||||
//$edit->bean->total = unformat_number($edit->bean->total);
|
||||
//$edit->bean->total = format_number($edit->bean->total);
|
||||
|
||||
$edit->preDisplay();
|
||||
|
||||
// $arr_template = $focus->getTemplateList();
|
||||
|
||||
if (isset($focus->template_id))
|
||||
$edit->ss->assign("DOCUMENT_TEMPLATES_OPTIONS", get_select_options_with_id($arr_template, $focus->template_id));
|
||||
else
|
||||
$edit->ss->assign("DOCUMENT_TEMPLATES_OPTIONS", get_select_options_with_id($arr_template, ''));
|
||||
|
||||
$focus->history = htmlspecialchars_decode($focus->history) ? : '[]';
|
||||
|
||||
//echo '<pre>' . var_export(strlen($focus->history), true) . '</pre>';
|
||||
//echo '<pre>' . var_export(json_decode($focus->history, true), true) . '</pre>';
|
||||
|
||||
$edit->ss->assign('HISTORY', json_decode($focus->history, true));
|
||||
|
||||
|
||||
$edit->ss->assign("POSITION_LIST", $focus->position_list);
|
||||
$edit->ss->assign("SERVICES_LIST", $focus->fkpackages_list);
|
||||
$edit->ss->assign("INCOME_LIST", $focus->income_list);
|
||||
|
||||
//echo '<pre>P' . var_export($focus->position_list, true) . '</pre>' . PHP_EOL;
|
||||
//echo '<pre>S' . var_export($focus->fkpackages_list, true) . '</pre>' . PHP_EOL;
|
||||
//echo '<pre>I' . var_export($focus->income_list, true) . '</pre>' . PHP_EOL;
|
||||
//exit;
|
||||
|
||||
// $edit->ss->assign("EMAIL_LINK", $focus->createSendEmailLink());
|
||||
|
||||
// $email_link_tab = '<script language="javascript">YAHOO.util.Event.addListener(window,"load",function(){setEMAIL = function(){' . $focus->createSendEmailLink() . '}});</script>';
|
||||
$edit->ss->assign("EMAIL_LINK_TAB", $email_link_tab);
|
||||
|
||||
$edit->ss->assign("OPT", $OPT);
|
||||
|
||||
echo $edit->display();
|
||||
|
||||
require_once('include/SubPanel/SubPanelTiles.php');
|
||||
$subpanel = new SubPanelTiles($focus, 'EcmFkPackages');
|
||||
echo $subpanel->display();
|
||||
Reference in New Issue
Block a user