function display() { global $mod_strings, $sugar_config; $bean = BeanFactory::getBean('xeBayAccounts'); $ebay_account_options = "<select name='ebay_account_name' id='ebay_account_name' title=''>"; $resp = $bean->get_list("", "ebay_auth_token<>''", 0, -1, -1, 0, false, array('name')); if ($resp['row_count'] > 0) { $ebay_account_options = "<select name='ebay_account_name' id='ebay_account_name' title=''>"; if ($resp['row_count'] > 1) { $ebay_account_options .= "<option value='All'>All</option>"; } foreach ($resp['list'] as &$account) { $name = $account->name; $ebay_account_options .= "<option value='{$name}'>{$name}</option>"; } } $ebay_account_options .= "</select>"; $express_carrier_options = get_select_options_with_id(getExpressCarrierDropDown(), isset($sugar_config['ebay_express_carrier']) ? $sugar_config['ebay_express_carrier'] : 'default'); $shortcuts_unhandled = <<<EOF <script> var OO = {}; OO.get = YAHOO.util.Dom.get; OO.importorderDialog = false;\t OO.toggle_importorder = function (){ \tvar sd = OO.get("importorder_dialog"); \tif(!OO.importorderDialog){\t \t\tOO.importorderDialog = new YAHOO.widget.Dialog("importorder_dialog",{ \t\t\t \tfixedcenter: true, \t\t\t \tdraggable: false, \t\t\t \tvisible : false, \t\t\t \tmodal : true, \t\t\t \tclose: true \t\t}); \t\tvar listeners = new YAHOO.util.KeyListener(document, { keys : 27 }, {fn: function() { OO.importorderDialog.cancel();} } ); \t\tOO.importorderDialog.cfg.queueProperty("keylisteners", listeners); \t} \tOO.importorderDialog.cancelEvent.subscribe(function(e, a, o){ \t\tOO.get("form_importorder").reset(); \t}); \tsd.style.display = "block";\t \tOO.importorderDialog.render(); \tOO.importorderDialog.show(); } OO.printallDialog = false;\t OO.toggle_printall = function (){ \tvar sd = OO.get("printall_dialog"); \tif(!OO.printallDialog){\t \t\tOO.printallDialog = new YAHOO.widget.Dialog("printall_dialog",{ \t\t\t \tfixedcenter: true, \t\t\t \tdraggable: false, \t\t\t \tvisible : false, \t\t\t \tmodal : true, \t\t\t \tclose: true \t\t}); \t\tvar listeners = new YAHOO.util.KeyListener(document, { keys : 27 }, {fn: function() { OO.printallDialog.cancel();} } ); \t\tOO.printallDialog.cfg.queueProperty("keylisteners", listeners); \t} \tOO.printallDialog.cancelEvent.subscribe(function(e, a, o){ \t\tOO.get("form_printall").reset(); \t}); \tsd.style.display = "block";\t \tOO.printallDialog.render(); \tOO.printallDialog.show(); } OO.exportallDialog = false;\t OO.toggle_exportall = function (){ \tvar sd = OO.get("exportall_dialog"); \tif(!OO.exportallDialog){\t \t\tOO.exportallDialog = new YAHOO.widget.Dialog("exportall_dialog",{ \t\t\t \tfixedcenter: true, \t\t\t \tdraggable: false, \t\t\t \tvisible : false, \t\t\t \tmodal : true, \t\t\t \tclose: true \t\t}); \t\tvar listeners = new YAHOO.util.KeyListener(document, { keys : 27 }, {fn: function() { OO.exportallDialog.cancel();} } ); \t\tOO.exportallDialog.cfg.queueProperty("keylisteners", listeners); \t} \tOO.exportallDialog.cancelEvent.subscribe(function(e, a, o){ \t\tOO.get("form_exportall").reset(); \t}); \tsd.style.display = "block";\t \tOO.exportallDialog.render(); \tOO.exportallDialog.show(); } OO.completeallDialog = false;\t OO.toggle_completeall = function (){ \tvar sd = OO.get("completeall_dialog"); \tif(!OO.completeallDialog){\t \t\tOO.completeallDialog = new YAHOO.widget.Dialog("completeall_dialog",{ \t\t\t \tfixedcenter: true, \t\t\t \tdraggable: false, \t\t\t \tvisible : false, \t\t\t \tmodal : true, \t\t\t \tclose: true \t\t}); \t\tvar listeners = new YAHOO.util.KeyListener(document, { keys : 27 }, {fn: function() { OO.completeallDialog.cancel();} } ); \t\tOO.completeallDialog.cfg.queueProperty("keylisteners", listeners); \t} \tOO.completeallDialog.cancelEvent.subscribe(function(e, a, o){ \t\tOO.get("form_completeall").reset(); \t}); \tsd.style.display = "block";\t \tOO.completeallDialog.render(); \tOO.completeallDialog.show(); } function automessage() { var href="index.php?module=xeBayOrders&action=automessage&eturn_module=xeBayOrders&return_action=index"; window.location.href=href; } </script> <div id="importorder_dialog" style="width: 450px; display: none;"> \t<div class="hd">{$mod_strings['LBL_IMPORT_TITLE']}</div> \t<div class="bd"> \t<form name="importorder" id="form_importorder" method="POST" action="index.php?module=xeBayOrders&action=importorder"> \t\t<table class='edit view tabForm'> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top" width="55%"> \t\t\t\t\t{$mod_strings['LBL_EBAY_ACCOUNT']} \t\t\t\t</td> \t\t\t\t<td width="45%">\t \t\t\t\t\t<input type="hidden" name="ebay_account_name" value="">{$ebay_account_options} \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top"> \t\t\t\t\t{$mod_strings['LBL_NUMBER_OF_DAYS']} \t\t\t\t</td> \t\t\t\t<td>\t \t\t\t\t\t<input type="hidden" name="number_of_days" value=""> \t\t\t <select name='number_of_days' id='number_of_days' title=''> \t\t\t\t <option value='1'>1</option> \t\t\t\t <option value='2' selected>2</option> \t\t\t\t <option value='3'>3</option> \t\t\t\t <option value='5'>5</option> \t\t\t\t <option value='7'>7</option> \t\t\t\t <option value='15'>15</option> \t\t\t\t <option value='30'>30</option> \t\t\t\t <option value='90'>90</option> \t\t\t </select> \t\t\t\t</td> \t\t\t</tr> \t\t</table> \t</form> \t<div style="text-align: right;"> \t\t<button id="btn-save-importorderDialog" class="button" type="button" onclick="OO.get('form_importorder').submit()">{$mod_strings['LBL_APPLY_BUTTON']}</button> \t\t<button id="btn-cancel-importorderDialog" class="button" type="button" onclick="OO.importorderDialog.cancel()">{$mod_strings['LBL_CANCEL_BUTTON']}</button> \t</div> \t</div> </div> <div id="printall_dialog" style="width: 450px; display: none;"> \t<div class="hd">{$mod_strings['LBL_PRINTALL_TITLE']}</div> \t<div class="bd"> \t<form name="printall" id="form_printall" method="POST" action="index.php?module=xeBayOrders&action=printall"> \t\t<table class='edit view tabForm'> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top" width="55%"> \t\t\t\t\t{$mod_strings['LBL_STOCKOUT_CHECKED']} \t\t\t\t</td> \t\t\t\t<td width="45%">\t \t\t\t\t\t<input type="hidden" name="stockout_checked" value=""> \t\t\t\t\t<input type="checkbox" id="stockout_checked" name="stockout_checked" checked value="1" tabindex=""> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top"> \t\t\t\t\t{$mod_strings['LBL_AUTO_MERGE']} \t\t\t\t</td> \t\t\t\t<td>\t \t\t\t\t\t<input type="hidden" name="automerge" value=""> \t\t\t\t\t<input type="checkbox" id="automerge" name="automerge" checked value="1" tabindex=""> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top"> \t\t\t\t\t{$mod_strings['LBL_PRINTED_ORDER_INCLUDED']} \t\t\t\t</td> \t\t\t\t<td>\t \t\t\t\t\t<input type="hidden" name="printed_order_included" value=""> \t\t\t\t\t<input type="checkbox" id="printed_order_included" name="printed_order_included" value="1" tabindex=""> \t\t\t\t</td> \t\t\t</tr> \t\t</table> \t</form> \t<div style="text-align: right;"> \t\t<button id="btn-save-printallDialog" class="button" type="button" onclick="OO.get('form_printall').submit()">{$mod_strings['LBL_APPLY_BUTTON']}</button> \t\t<button id="btn-cancel-printallDialog" class="button" type="button" onclick="OO.printallDialog.cancel()">{$mod_strings['LBL_CANCEL_BUTTON']}</button> \t</div> \t</div> </div> <div id="exportall_dialog" style="width: 450px; display: none;"> \t<div class="hd">{$mod_strings['LBL_EXPORTALL_TITLE']}</div> \t<div class="bd"> \t<form name="exportall" id="form_exportall" method="POST" action="index.php?module=xeBayOrders&action=exportall"> \t\t<table class='edit view tabForm'> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top" width="55%"> \t\t\t\t\t{$mod_strings['LBL_STOCKOUT_CHECKED']} \t\t\t\t</td> \t\t\t\t<td width="45%">\t \t\t\t\t\t<input type="hidden" name="stockout_checked" value=""> \t\t\t\t\t<input type="checkbox" id="stockout_checked" name="stockout_checked" checked value="1" tabindex=""> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top"> \t\t\t\t\t{$mod_strings['LBL_AUTO_MERGE']} \t\t\t\t</td> \t\t\t\t<td>\t \t\t\t\t\t<input type="hidden" name="automerge" value=""> \t\t\t\t\t<input type="checkbox" id="automerge" name="automerge" checked value="1" tabindex=""> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top"> \t\t\t\t\t{$mod_strings['LBL_PRINTED_ORDER_INCLUDED']} \t\t\t\t</td> \t\t\t\t<td>\t \t\t\t\t\t<input type="hidden" name="printed_order_included" value=""> \t\t\t\t\t<input type="checkbox" id="printed_order_included" name="printed_order_included" checked value="1" tabindex=""> \t\t\t\t</td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<td scope="row" valign="top"> \t\t\t\t\t{$mod_strings['LBL_EXPRESS_CARRIER']} \t\t\t\t</td> \t\t\t\t<td>\t \t\t\t\t\t<input type='hidden' name='express_carrier' value='0'> \t\t\t\t\t<select name='express_carrier'>{$express_carrier_options}</select> \t\t\t\t</td> \t\t\t</tr> \t\t</table> \t</form> \t<div style="text-align: right;"> \t\t<button id="btn-save-exportallDialog" class="button" type="button" onclick="OO.get('form_exportall').submit()">{$mod_strings['LBL_APPLY_BUTTON']}</button> \t\t<button id="btn-cancel-exportallDialog" class="button" type="button" onclick="OO.exportallDialog.cancel()">{$mod_strings['LBL_CANCEL_BUTTON']}</button> \t</div> \t</div> </div> <div id="completeall_dialog" style="width: 450px; display: none;"> \t<div class="hd">{$mod_strings['LBL_COMPLETEALL_TITLE']}</div> \t<div class="bd"> \t<form name="completeall" id="form_completeall" method="POST" action="index.php?module=xeBayOrders&action=completeall"> \t\t<table class='edit view tabForm'> \t\t\t\t<tr> \t\t\t\t\t<td scope="row" valign="top" width="55%"> \t\t\t\t\t\t{$mod_strings['LBL_UNPRINTED_ORDER_INCLUDED']} \t\t\t\t\t</td> \t\t\t\t\t<td width="45%">\t \t\t\t\t\t\t<input type="hidden" name="unprinted_order_included" value=""> \t\t\t\t\t\t<input type="checkbox" id="unprinted_order_included" name="unprinted_order_included" checked value="1" tabindex=""> \t\t\t\t\t</td> \t\t\t\t</tr> \t\t</table> \t</form> \t<div style="text-align: right;"> \t\t<button id="btn-save-completeallDialog" class="button" type="button" onclick="OO.get('form_completeall').submit()">{$mod_strings['LBL_APPLY_BUTTON']}</button> \t\t<button id="btn-cancel-completeallDialog" class="button" type="button" onclick="OO.completeallDialog.cancel()">{$mod_strings['LBL_CANCEL_BUTTON']}</button> \t</div> \t</div> </div> <input title="{$mod_strings['LBL_IMPORT_TIPS']}" class="button" type="submit" name="button" value="{$mod_strings['LBL_IMPORT']}" id="import_order" onclick="OO.toggle_importorder()"> <input title="{$mod_strings['LBL_PRINT_TIPS']}" class="button" type="submit" name="button" value="{$mod_strings['LBL_PRINT_ALL']}" id="print_all" onclick="OO.toggle_printall()"> <input title="{$mod_strings['LBL_EXPORT_TIPS']}" class="button" type="submit" name="button" value="{$mod_strings['LBL_EXPORT_ALL']}" id="export_all" onclick="OO.toggle_exportall()"> <input title="{$mod_strings['LBL_COMPLERE_ALL_TIPS']}" class="button" type="submit" name="button" value="{$mod_strings['LBL_COMPLERE_ALL']}" id="complete_all" onclick="OO.toggle_completeall()"> <input title="{$mod_strings['LBL_AUTO_MESSAGE_TIPS']}" class="button" type="submit" name="button" value="{$mod_strings['LBL_AUTO_MESSAGE']}" id="auto_message" onclick="return automessage()"> <br/> <br/> EOF; $result = $GLOBALS['db']->query("SELECT count(*) c FROM xeBayOrders WHERE handled_status = 'unhandled' AND deleted = 0"); $assoc = $GLOBALS['db']->fetchByAssoc($result); $lbl_list_unhandled = $mod_strings['LNK_LIST_UNHANDLED'] . '(<span style="color:red">' . $assoc['c'] . '</span>)'; $result = $GLOBALS['db']->query("SELECT count(*) c FROM xeBayOrders WHERE handled_status = 'handled' AND deleted = 0"); $assoc = $GLOBALS['db']->fetchByAssoc($result); $lbl_list_handled = $mod_strings['LNK_LIST_HANDLED'] . '(<span style="color:red">' . $assoc['c'] . '</span>)'; $result = $GLOBALS['db']->query("SELECT count(*) c FROM xeBayOrders WHERE handled_status = 'suspended' AND deleted = 0"); $assoc = $GLOBALS['db']->fetchByAssoc($result); $lbl_list_suspended = $mod_strings['LNK_LIST_SUSPENDED'] . '(<span style="color:red">' . $assoc['c'] . '</span>)'; $result = $GLOBALS['db']->query("SELECT count(*) c FROM xeBayOrders WHERE handled_status = 'deleted' AND deleted = 0"); $assoc = $GLOBALS['db']->fetchByAssoc($result); $lbl_list_deleted = $mod_strings['LNK_LIST_DELETED'] . '(<span style="color:red">' . $assoc['c'] . '</span>)'; switch ($_REQUEST['handled_status_advanced'][0]) { case 'handled': $lbl_list_handled = "<b>{$lbl_list_handled}</b>"; break; case 'suspended': $lbl_list_suspended = "<b>{$lbl_list_suspended}</b>"; break; case 'deleted': $lbl_list_deleted = "<b>{$lbl_list_deleted}</b>"; break; case 'unhandled': $lbl_list_unhandled = "<b>{$lbl_list_unhandled}</b>"; break; default: break; } if (isset($this->options['show_title']) && $this->options['show_title']) { echo $shortcuts_unhandled; echo "{$lbl_list_unhandled} {$lbl_list_handled} {$lbl_list_suspended} {$lbl_list_deleted}<br/>"; } parent::display(); }
/** * @see SugarView::display() */ public function display() { global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale; $configurator = new Configurator(); $sugarConfig = SugarConfig::getInstance(); $focus = new Administration(); $configurator->parseLoggerSettings(); $focus->retrieveSettings(); if (!empty($_POST['restore'])) { $configurator->restoreConfig(); } $this->ss->assign('MOD', $mod_strings); $this->ss->assign('APP', $app_strings); $this->ss->assign('APP_LIST', $app_list_strings); $this->ss->assign('config', $configurator->config); $this->ss->assign('error', $configurator->errors); $this->ss->assign("AUTO_REFRESH_INTERVAL_OPTIONS", get_select_options_with_id($app_list_strings['dashlet_auto_refresh_options_admin'], isset($configurator->config['dashlet_auto_refresh_min']) ? $configurator->config['dashlet_auto_refresh_min'] : 30)); $this->ss->assign('LANGUAGES', get_languages()); $this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js()); $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png')); $this->ss->assign("settings", $focus->settings); $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype'])); if (!empty($focus->settings['proxy_on'])) { $this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline'); } else { $this->ss->assign("PROXY_CONFIG_DISPLAY", 'none'); } if (!empty($focus->settings['proxy_auth'])) { $this->ss->assign("PROXY_AUTH_DISPLAY", 'inline'); } else { $this->ss->assign("PROXY_AUTH_DISPLAY", 'none'); } if (!empty($configurator->config['logger']['level'])) { $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level'])); } else { $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), '')); } if (!empty($configurator->config['lead_conv_activity_opt'])) { $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), $configurator->config['lead_conv_activity_opt'])); } else { $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), '')); } if (!empty($configurator->config['logger']['file']['suffix'])) { $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix'])); } else { $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, '')); } if (isset($configurator->config['logger_visible'])) { $this->ss->assign('logger_visible', $configurator->config['logger_visible']); } else { $this->ss->assign('logger_visible', true); } $ebay_site_ids = array('0' => 'eBay United States', '2' => 'eBay Canada (English)', '3' => 'eBay UK', '15' => 'eBay Australia', '16' => 'eBay Austria', '23' => 'eBay Belgium (French)', '71' => 'eBay France', '77' => 'eBay Germany', '100' => 'eBay Motors', '101' => 'eBay Italy', '123' => 'eBay Belgium (Dutch)', '146' => 'eBay Netherlands', '186' => 'eBay Spain', '193' => 'eBay Switzerland', '201' => 'eBay Hong Kong', '203' => 'eBay India', '205' => 'eBay Ireland', '207' => 'eBay Malaysia', '210' => 'eBay Canada (French)', '211' => 'eBay Philippines', '212' => 'eBay Poland', '216' => 'eBay Singapore'); $this->ss->assign("EBAY_SITE_ID_OPTIONS", get_select_options_with_id($ebay_site_ids, isset($configurator->config['ebay_primary_site_id']) ? $configurator->config['ebay_primary_site_id'] : 0)); require_once 'modules/xeBayOrders/xeBayOrder.php'; $this->ss->assign("EBAY_SHIPPING_SERVICE_OPTIONS", get_select_options_with_id(getShippingServiceDropDown(), isset($configurator->config['ebay_shipping_service']) ? $configurator->config['ebay_shipping_service'] : 'HKBAM')); $this->ss->assign("EBAY_EXPRESS_CARRIER_OPTIONS", get_select_options_with_id(getExpressCarrierDropDown(), isset($configurator->config['ebay_express_carrier']) ? $configurator->config['ebay_express_carrier'] : 'default')); echo $this->getModuleTitle(false); $this->ss->display('modules/Configurator/tpls/EditView.tpl'); $javascript = new javascript(); $javascript->setFormName("ConfigureSettings"); $javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, ""); $javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, ""); $javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, ""); $javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, ""); $javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, ""); $javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, ""); echo $javascript->getScript(); }