67 lines
2.5 KiB
PHP
Executable File
67 lines
2.5 KiB
PHP
Executable File
<?php
|
|
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
|
die ( 'NotAValidEntryPoint' );
|
|
|
|
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings;
|
|
require_once ('modules/EcmQuotes/EcmQuote.php');
|
|
require_once ('include/time.php');
|
|
|
|
echo '<script type="text/javascript";
|
|
src="modules/EcmInvoiceOuts/javascript/searchcolumndefs.js"></script>';
|
|
echo '<script type="text/javascript"
|
|
src="include/ECM/SearchProductTable.js"></script>';
|
|
echo '<script type="text/javascript"
|
|
src="include/ECM/tablenavigator.js"></script>';
|
|
|
|
$new_number = false;
|
|
$duplicate = false;
|
|
$focus = new EcmQuote ();
|
|
|
|
if (isset ( $_REQUEST ['record'] ) && $_REQUEST['isDuplicate']=="false" ) {
|
|
$focus->retrieve ( $_REQUEST ['record'] );
|
|
if (isset ( $focus->id ) && $focus->id != '') {
|
|
$focus->format_all_fields ();
|
|
}
|
|
}
|
|
else if ($_REQUEST['isDuplicate']=="true") {
|
|
$new_number=true;
|
|
$duplicate=true;
|
|
//get data
|
|
$focus->retrieve($_REQUEST['return_id']);
|
|
$focus->register_date = date("d.m.Y");
|
|
$focus->validtill_date = date("d.m.Y");
|
|
}
|
|
else {
|
|
$new_number=true;
|
|
//dates
|
|
$focus->register_date = date("d.m.Y");
|
|
$focus->validtill_date = date("d.m.Y");
|
|
//for subpanels??
|
|
if (isset ( $_REQUEST ['contact_id'] ) && $_REQUEST ['contact_id'] != '' && isset ( $_REQUEST ['contact_name'] ) && $_REQUEST ['contact_name'] != '') {
|
|
$_REQUEST ['parent_type'] = 'Contacts';
|
|
$_REQUEST ['parent_name'] = $_REQUEST ['contact_name'];
|
|
$_REQUEST ['parent_id'] = $_REQUEST ['contact_id'];
|
|
$OPT ['check_parent_id'] = false;
|
|
}
|
|
|
|
if (isset ( $_REQUEST ['account_id'] ) && $_REQUEST ['account_id'] != '' && isset ( $_REQUEST ['account_name'] ) && $_REQUEST ['account_name'] != '') {
|
|
$_REQUEST ['parent_type'] = 'Accounts';
|
|
$_REQUEST ['parent_name'] = $_REQUEST ['account_name'];
|
|
$_REQUEST ['parent_id'] = $_REQUEST ['account_id'];
|
|
$OPT ['check_parent_id'] = false;
|
|
}
|
|
}
|
|
|
|
require_once ('include/MVC/View/SugarView.php');
|
|
require_once ('modules/EcmQuotes/views/EditView/view.edit.ecmquotes.php');
|
|
$edit = new ViewEditEcmQuotes ();
|
|
$edit->ss = new Sugar_Smarty ();
|
|
$edit->module = 'EcmQuotes';
|
|
$edit->bean = $focus;
|
|
$edit->tplFile = 'include/ECM/EcmViews/EditView/Tabs/EditView.tpl';
|
|
$edit->preDisplay ();
|
|
$edit->ss->assign ( "NEW_NUMBER", $new_number );
|
|
$edit->ss->assign("DUPLICATE", $duplicate);
|
|
echo $edit->display ();
|
|
//loading view
|
|
echo '<link rel="stylesheet" type="text/css" href="modules/EcmQuotes/javascript/helper.css" media="screen" /><div class="loading_panel"></div>'; |