".translate('LBL_MODULE_NAME','Administration')."", $mod_strings['LBL_MODULE_NAME'], ), false ); if($current_user->is_admin){ require_once('modules/Currencies/ListCurrency.php'); $focus = new Currency(); $lc = new ListCurrency(); $lc->handleAdd(); if(isset($_REQUEST['merge']) && $_REQUEST['merge'] == 'true'){ $isMerge = true; } if(isset($_REQUEST['domerge'])){ $currencies = $_REQUEST['mergecur']; $opp = new Opportunity(); $opp->update_currency_id($currencies, $_REQUEST['mergeTo'] ); foreach($currencies as $cur){ if($cur != $_REQUEST['mergeTo']) $focus->mark_deleted($cur); } } $lc->lookupCurrencies(); if (isset($focus->id)) $focus_id = $focus->id; else $focus_id=''; $merge_button = ''; $pretable = ''; if((isset($_REQUEST['doAction']) && $_REQUEST['doAction'] == 'merge') || (isset($isMerge) && !$isMerge)){ $merge_button = '
'; } if(isset($isMerge) && $isMerge){ $currencyList = new ListCurrency(); $listoptions = $currencyList->getSelectOptions(); $pretable = <<
{$mod_strings['LBL_MERGE_TXT']}

EOQ; } $edit_botton = '
'; $edit_botton .= ''; $edit_botton .= ''; $edit_botton .= ''; $edit_botton .= ''; $edit_botton .= ''; $edit_botton .= ''; $edit_botton .= ''; $edit_botton .= ' '; $edit_botton .= ' '; $header_text = ''; if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){ $header_text = " ".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'").""; } $ListView = new ListView(); $ListView->initNewXTemplate( 'modules/Currencies/ListView.html',$mod_strings); $ListView->xTemplateAssign('PRETABLE', $pretable); $ListView->xTemplateAssign('POSTTABLE', '
'); $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" alt="'.$app_strings['LNK_DELETE'].'" border="0"')); //$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']. $header_text ); $ListView->setHeaderText($merge_button); $ListView->processListView($lc->list, "main", "CURRENCY"); if(isset($_GET['record']) && !empty($_GET['record']) && !isset($_POST['edit'])) { $focus->retrieve($_GET['record']); $focus->conversion_rate = format_number($focus->conversion_rate, 10, 10); } if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){ $header_text = " ".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'").""; } if ( empty($focus->id) ) { echo get_form_header($app_strings['LBL_CREATE_BUTTON_LABEL'] . $header_text,$edit_botton , false); } else { echo get_form_header($app_strings['LBL_EDIT_BUTTON_LABEL']." » ".$focus->name . $header_text,$edit_botton , false); } $sugar_smarty = new Sugar_Smarty(); $sugar_smarty->assign("MOD", $mod_strings); $sugar_smarty->assign("APP", $app_strings); // Load in the full ISO 4217 list, so we can dynamically populate the currency strings require_once('modules/Currencies/iso4217.php'); $json = getJSONobj(); $js_iso4217 = $json->encode($fullIsoList); $sugar_smarty->assign('JS_ISO4217',$js_iso4217); if (isset($_REQUEST['return_module'])) $sugar_smarty->assign("RETURN_MODULE", $_REQUEST['return_module']); if (isset($_REQUEST['return_action'])) $sugar_smarty->assign("RETURN_ACTION", $_REQUEST['return_action']); if (isset($_REQUEST['return_id'])) $sugar_smarty->assign("RETURN_ID", $_REQUEST['return_id']); $sugar_smarty->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); $sugar_smarty->assign("JAVASCRIPT", get_set_focus_js()); $sugar_smarty->assign("THEME", SugarThemeRegistry::current()->__toString()); $sugar_smarty->assign("ID", $focus->id); $sugar_smarty->assign('NAME', $focus->name); $sugar_smarty->assign('STATUS', $focus->status); $sugar_smarty->assign('ISO4217', $focus->iso4217); $sugar_smarty->assign('CONVERSION_RATE', $focus->conversion_rate); $sugar_smarty->assign('SYMBOL', $focus->symbol); $sugar_smarty->assign('STATUS_OPTIONS', get_select_options_with_id($mod_strings['currency_status_dom'], $focus->status)); //if (empty($focus->list_order)) $xtpl->assign('LIST_ORDER', count($focus->get_manufacturers(false,'All'))+1); //else $xtpl->assign('LIST_ORDER', $focus->list_order); $sugar_smarty->display("modules/Currencies/EditView.tpl"); $javascript = new javascript(); $javascript->setFormName('EditView'); $javascript->setSugarBean($focus); $javascript->addAllFields('',array('iso4217'=>'iso4217')); echo $javascript->getScript(); echo(""); }else{ echo 'Admin\'s Only'; } ?>