die($mod_strings['LBL_UPGRADE_WIZARD_FILE_NOT_SPEC']); } if (!isset($_REQUEST['mode']) || $_REQUEST['mode'] == "") { die($mod_strings['LBL_UPGRADE_WIZARD_NO_MODE_SPEC']); } if (!file_exists($base_tmp_upgrade_dir)) { mkdir($base_tmp_upgrade_dir, 0755, true); } $unzip_dir = mk_temp_dir($base_tmp_upgrade_dir); $install_file = hashToFile($_REQUEST['install_file']); $hidden_fields = ""; $new_lang_name = ""; $new_lang_desc = ""; $mode = $_REQUEST['mode']; $hidden_fields .= "<input type=hidden name=\"mode\" value=\"{$mode}\"/>"; $hidden_fields .= smarty_function_sugar_csrf_form_token(array(), $smarty); $install_type = UpgradeWizardCommon::getInstallType($install_file); $version = ""; $previous_version = ""; $show_files = true; $zip_from_dir = "."; $zip_to_dir = "."; $zip_force_copy = array(); $license_file = $unzip_dir . '/LICENSE'; $readme_file = $unzip_dir . '/README.txt'; $require_license = false; $found_readme = false; $author = ''; $name = ''; $description = ''; $is_uninstallable = true;
if ((is_admin($current_user) || is_admin_for_module($GLOBALS['current_user'], 'Products')) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) { $header_text = " <a href='index.php?action=index&module=DynamicLayout&from_action=ListView&from_module=" . $_REQUEST['module'] . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDITLAYOUT']) . "</a>"; } $ListView->initNewXTemplate('modules/ProductTypes/ListView.html', $mod_strings); $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_DELETE'])); $action_button = smarty_function_sugar_action_menu(array('id' => 'manufacturer_create_button', 'buttons' => array($button)), $ListView); $ListView->setHeaderTitle($header_text . $action_button); $ListView->show_export_button = false; $ListView->show_mass_update = false; $ListView->show_delete_button = false; $ListView->setQuery("", "", "list_order", "PRODUCTTYPE"); $ListView->processListView($focus, "main", "PRODUCTTYPE"); if ($is_edit) { $GLOBALS['log']->info("ProductType edit view"); $edit_button = "<form name='EditView' method='POST' action='index.php'>\n"; $edit_button .= smarty_function_sugar_csrf_form_token(array(), $ListView); $edit_button .= "<input type='hidden' name='module' value='ProductTypes'>\n"; $edit_button .= "<input type='hidden' name='record' value='{$focus->id}'>\n"; $edit_button .= "<input type='hidden' name='action'>\n"; $edit_button .= "<input type='hidden' name='edit'>\n"; $edit_button .= "<input type='hidden' name='isDuplicate'>\n"; $edit_button .= "<input type='hidden' name='return_module' value='ProductTypes'>\n"; $edit_button .= "<input type='hidden' name='return_action' value='index'>\n"; $edit_button .= "<input type='hidden' name='return_id' value=''>\n"; $edit_button .= '<input id="save_bttn" title="' . $app_strings['LBL_SAVE_BUTTON_TITLE'] . '" accessKey="' . $app_strings['LBL_SAVE_BUTTON_KEY'] . '" class="button primary" onclick="this.form.action.value=\'Save\'; return check_form(\'EditView\');" type="submit" name="button" value="' . $app_strings['LBL_SAVE_BUTTON_LABEL'] . '" >'; $edit_button .= ' <input id="save_and_create_bttn" title="' . $app_strings['LBL_SAVE_NEW_BUTTON_TITLE'] . '" class="button" onclick="this.form.action.value=\'Save\'; this.form.isDuplicate.value=\'true\'; this.form.edit.value=\'true\'; this.form.return_action.value=\'EditView\'; return check_form(\'EditView\')" type="submit" name="button" value="' . $app_strings['LBL_SAVE_NEW_BUTTON_LABEL'] . '" >'; if ((is_admin($current_user) || is_admin_for_module($GLOBALS['current_user'], 'Products')) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) { $header_text = " <a href='index.php?action=index&module=DynamicLayout&edit=true&from_action=EditView&from_module=" . $_REQUEST['module'] . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDITLAYOUT']) . "</a>"; } echo get_form_header($mod_strings['LBL_PRODUCTTYPE'] . " " . $focus->name . ' ' . $header_text, $edit_button, false); $GLOBALS['log']->info("ProductTypes edit view");
} if (unlink($delete_me)) { // successful deletion? echo string_format($mod_strings['LBL_UPGRADE_WIZARD_PKG_REMOVED'], array($delete_me)) . "<br>"; } else { die("Problem removing package {$delete_me}."); } } } } if ($view == "module") { print getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_MODULE_LOADER_TITLE']), false); } else { print getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_UPGRADE_WIZARD_TITLE']), false); } $csrfToken = smarty_function_sugar_csrf_form_token(array(), $smarty); // upload link if (!empty($GLOBALS['sugar_config']['use_common_ml_dir']) && $GLOBALS['sugar_config']['use_common_ml_dir'] && !empty($GLOBALS['sugar_config']['common_ml_dir'])) { //rrs $form = '<form name="move_form" action="index.php?module=Administration&view=module&action=UpgradeWizard" method="post" ><input type=hidden name="run" value="upload" /><input type=hidden name="load_module_from_dir" id="load_module_from_dir" value="' . $GLOBALS['sugar_config']['common_ml_dir'] . '" /><input type=hidden name="upgrade_zip_escaped" value="" />'; $form .= $csrfToken; $form .= '<br>' . $mod_strings['LBL_MODULE_UPLOAD_DISABLE_HELP_TEXT'] . '</br>'; $form .= '<table width="100%" class="edit view"><tr><th align="left">' . $mod_strings['LBL_ML_NAME'] . '</th><th align="left">' . $mod_strings['LBL_ML_ACTION'] . '</th></tr>'; if ($handle = opendir($GLOBALS['sugar_config']['common_ml_dir'])) { while (false !== ($filename = readdir($handle))) { if ($filename == '.' || $filename == '..' || !preg_match("#.*\\.zip\$#", $filename)) { continue; } $form .= '<tr><td>' . $filename . '</td><td><input type=button class="button" value="' . $mod_strings['LBL_UW_BTN_UPLOAD'] . '" onClick="document.move_form.upgrade_zip_escaped.value = escape( \'' . $filename . '\');document.move_form.submit();" /></td></tr>'; } }
function render_rebuild_options($global_team_id = 1) { global $current_language; $user = BeanFactory::getBean('Users'); static $mod_strings = null; if (empty($mod_strings)) { $mod_strings = return_module_language($current_language, 'Administration'); } $global_team_sel = ""; if (no_global_team()) { //a list of not-private teams. $query = "select id, name from teams where deleted=0 and private!=1 and id!='1'"; $result = $user->db->query($query); $options = array(); while (($row = $user->db->fetchByAssoc($result)) != null) { $options[$row['id']] = $row['name']; } $options_html = get_select_options_with_id($options, ""); $global_team_sel = <<<ABC <tr> <td width="10%" NOWRAP valign="top" > <select name="global_team_id" id="global_team_id">{$options_html}</select> </td> <td valign="middle" valign="top" colspan="3"> {$mod_strings['LBL_GLOBAL_TEAM']} </td> </tr> <tr><td colspan=4> </td></tr> ABC; } $process_global_team_checked = ""; $process_implict_teams_checked = ""; $process_private_team_checked = ""; $missing_global = ''; if (ScanTeams::scanForMissingGlobal($global_team_id)) { $missing_global = "(" . $mod_strings['LBL_MISSING_GLOBAL'] . ")"; $process_global_team_checked = "checked"; } $missing_teams = ''; if (ScanTeams::scanForMissingReportsToTeams()) { $missing_teams = "(" . $mod_strings['LBL_MISSING_TEAMS'] . ")"; $process_implict_teams_checked = "checked"; } $missing_private = ''; if (ScanTeams::scanForMissingPrivateTeams()) { $missing_private = "(" . $mod_strings['LBL_MISSING_PRIVATE'] . ")"; $process_private_team_checked = "checked"; } $csrfToken = smarty_function_sugar_csrf_form_token(array(), $smarty); $xyz = <<<EOF <form name="RepairTeams" method="POST" > {$csrfToken} <input type="hidden" name="module" value="Administration"> <input type="hidden" name="action" value="RepairTeams"> <input type="hidden" name="process" value="1"> <input type="hidden" name="silent" value="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view"> <tr><td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> \t\t\t\t\t<tr> <td width="10%" NOWRAP valign="top" > <input type="checkbox" name="process_global_team" id="process_global_team" {$process_global_team_checked}> </td> <td valign="middle" valign="top" colspan="3"> {$mod_strings['LBL_GLOBAL_TEAM']}<br/>{$missing_global} </td> </tr> <tr><td colspan=4> </td></tr> {$global_team_sel} <tr> <td width="10%" NOWRAP valign="top" > <input type="checkbox" name="process_private_team" id="process_private_team" {$process_private_team_checked}> </td> <td valign="middle" valign="top" colspan="3"> {$mod_strings['LBL_PRIVATE_TEAM']}<br/>{$missing_private} </td> </tr> <tr><td colspan=4> </td></tr> <tr> <td width="10%" NOWRAP valign="top" > <input type="checkbox" name="process_implict_teams" id="process_implict_teams" {$process_implict_teams_checked}> </td> <td valign="middle" valign="top" colspan="3"> {$mod_strings['LBL_TEAM_HIERARCHY']}<br/>{$missing_teams} </td> </tr> <tr><td colspan=4> </td></tr> <tr> <td width="10%" NOWRAP valign="top" > <input type="checkbox" name="process_clean_up_team_sets" id="process_clean_up_team_sets" "checked"> </td> <td valign="middle" valign="top" colspan="3"> {$mod_strings['LBL_TEAM_SETS']} </td> </tr> <tr> <td colspan=4 > </td> </tr> <tr> <td colspan=4 align="left"> <input title="{$mod_strings['LBL_REBUILD']}" class="button" type="submit" name="button" value=" {$mod_strings['LBL_REBUILD']} " > </td> </tr> </table> </td></tr> </table> </form> EOF; print $xyz; }
/** * @return void * @param unknown $data * @param unknown $xTemplateSection * @param unknown $html_varName * @desc INTERNAL FUNCTION handles the rows * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. */ function processListRows($data, $xtemplateSection, $html_varName) { global $odd_bg; global $even_bg; global $hilite_bg; global $app_strings, $sugar_version, $sugar_config; global $currentModule; $this->xTemplate->assign('BG_HILITE', $hilite_bg); $this->xTemplate->assign('CHECKALL', SugarThemeRegistry::current()->getImage('blank', '', 1, 1, ".gif", '')); //$this->xTemplate->assign("BG_CLICK", $click_bg); $oddRow = true; $count = 0; reset($data); //GETTING OFFSET $offset = $this->getOffset($html_varName); $timeStamp = $this->unique_id(); $_SESSION[$html_varName . "_FROM_LIST_VIEW"] = $timeStamp; $associated_row_data = array(); //mail merge list $mergeList = array(); $module = ''; //todo what is this? It is using an array as a boolean while (list($aVal, $aItem) = each($data)) { if (isset($this->data_array)) { $fields = $this->data_array; } else { $aItem->check_date_relationships_load(); $fields = $aItem->get_list_view_data(); } if (is_object($aItem)) { // cn: bug 5349 //add item id to merge list, if the button is clicked $mergeList[] = $aItem->id; if (empty($module)) { $module = $aItem->module_dir; } } //ADD OFFSET TO ARRAY $fields['OFFSET'] = $offset + $count + 1; $fields['STAMP'] = $timeStamp; if ($this->shouldProcess) { $prerow = ''; if (!isset($this->data_array)) { $prerow .= "<input onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox' class='checkbox' name='mass[]' value='" . $fields['ID'] . "'>"; } $this->xTemplate->assign('PREROW', $prerow); $this->xTemplate->assign('CHECKALL', "<input type='checkbox' class='checkbox' title='" . $GLOBALS['app_strings']['LBL_SELECT_ALL_TITLE'] . "' name='massall' id='massall' value='' onclick='sListView.check_all(document.MassUpdate, \"mass[]\", this.checked)'>"); } if (!isset($this->data_array)) { $tag = $aItem->listviewACLHelper(); $this->xTemplate->assign('TAG', $tag); } if ($oddRow) { $ROW_COLOR = 'oddListRow'; $BG_COLOR = $odd_bg; } else { $ROW_COLOR = 'evenListRow'; $BG_COLOR = $even_bg; } $oddRow = !$oddRow; $this->xTemplate->assign('ROW_COLOR', $ROW_COLOR); $this->xTemplate->assign('BG_COLOR', $BG_COLOR); if (isset($this->data_array)) { $this->xTemplate->assign('KEY', $aVal); $this->xTemplate->assign('VALUE', $aItem); $this->xTemplate->assign('INDEX', $count); } else { //AED -- some modules do not have their additionalDetails.php established. Add a check to ensure require_once does not fail // Bug #2786 $additionalDetailsFile = SugarAutoLoader::existingCustomOne('modules/' . $aItem->module_dir . '/metadata/additionalDetails.php'); if ($this->_additionalDetails && $aItem->ACLAccess('DetailView') && !empty($additionalDetailsFile)) { require_once $additionalDetailsFile; $ad_function = (empty($this->additionalDetailsFunction) ? 'additionalDetails' : $this->additionalDetailsFunction) . $aItem->object_name; $results = $ad_function($fields); $results['string'] = str_replace(array("'", "'"), '\\'', $results['string']); // no xss! if (trim($results['string']) == '') { $results['string'] = $app_strings['LBL_NONE']; } $fields[$results['fieldToAddTo']] = $fields[$results['fieldToAddTo']] . '</a>'; } if ($aItem->ACLAccess('Delete')) { $delete = "<form border='0' action='index.php' method='post' name='form'>\n"; $delete .= smarty_function_sugar_csrf_form_token(array(), $this); $delete .= "<input type='hidden' name='module' value='" . $aItem->module_dir . "'>\n"; $delete .= "<input type='hidden' name='action' value='Delete'>\n"; $delete .= "<input type='hidden' name='return_module' value='" . $aItem->module_dir . "'>\n"; $delete .= "<input type='hidden' name='return_action' value='index'>\n"; $delete .= "<input type='hidden' name='return_id' value=''>\n"; $delete .= "<input type='hidden' name='record' value='" . $fields['ID'] . "'>\n"; $delete .= "<input class='listViewTdToolsS1 button secondary' name='Delete' onclick='javascript: return confirm(\"" . $this->local_app_strings['NTC_DELETE_CONFIRMATION'] . "\")' type='submit' value='" . $this->local_app_strings['LBL_DELETE_INLINE'] . "'>\n"; $delete .= "</form>\n"; require_once 'include/SugarSmarty/plugins/function.sugar_action_menu.php'; $fields['DELETE_BUTTON'] = smarty_function_sugar_action_menu(array('id' => $aItem->module_dir . '_' . $fields['ID'] . '_create_button', 'buttons' => array($delete)), $this); } $this->xTemplate->assign($html_varName, $fields); $aItem->setupCustomFields($aItem->module_dir); $aItem->custom_fields->populateAllXTPL($this->xTemplate, 'detail', $html_varName, $fields); } if (!isset($this->data_array) && $aItem->ACLAccess('DetailView')) { $count++; } if (isset($this->data_array)) { $count++; } if (!isset($this->data_array)) { $aItem->list_view_parse_additional_sections($this->xTemplate, $xtemplateSection); if ($this->xTemplate->exists($xtemplateSection . '.row.pro')) { $this->xTemplate->parse($xtemplateSection . '.row.pro'); } } $this->xTemplate->parse($xtemplateSection . '.row'); if (isset($fields['ID'])) { $associated_row_data[$fields['ID']] = $fields; // Bug 38908: cleanup data for JS to avoid having shuffled around foreach ($fields as $key => $value) { if ($value == ' ') { $associated_row_data[$fields['ID']][$key] = ''; } } } } $_SESSION['MAILMERGE_RECORDS'] = $mergeList; $_SESSION['MAILMERGE_MODULE_FROM_LISTVIEW'] = $module; if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'Popup') { $_SESSION['MAILMERGE_MODULE'] = $module; } if ($this->process_for_popups) { $json = getJSONobj(); $is_show_fullname = showFullName() ? 1 : 0; $associated_javascript_data = '<script type="text/javascript">' . "\n" . 'var associated_javascript_data = ' . $json->encode($associated_row_data) . ";\n" . 'var is_show_fullname = ' . $is_show_fullname . ";\n" . '</script>'; $this->xTemplate->assign('ASSOCIATED_JAVASCRIPT_DATA', $associated_javascript_data); } $this->xTemplate->parse($xtemplateSection); }
<?php if (!defined('sugarEntry') || !sugarEntry) { die('Not A Valid Entry Point'); } /* * Your installation or use of this SugarCRM file is subject to the applicable * terms available at * http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/. * If you do not agree to all of the applicable terms or do not have the * authority to bind the entity as an authorized representative, then do not * install or use this SugarCRM file. * * Copyright (C) SugarCRM Inc. All rights reserved. */ require_once 'include/SugarSmarty/plugins/function.sugar_csrf_form_token.php'; if (is_admin($current_user)) { global $mod_strings; //echo out warning message and msgDiv echo '<br>' . $mod_strings['LBL_REPAIR_JS_FILES_PROCESSING']; echo '<div id="msgDiv"></div>'; //echo out script that will make an ajax call to process the files via callJSRepair.php echo "<script>\n var ajxProgress;\n var showMSG = 'true';\n //when called, this function will make ajax call to rebuild/repair js files\n function callJSRepair() {\n \n //begin main function that will be called\n ajaxCall = function(){\n //create success function for callback\n success = function() { \n //turn off loading message\n ajaxStatus.hideStatus();\n var targetdiv=document.getElementById('msgDiv');\n targetdiv.innerHTML=SUGAR.language.get('Administration', 'LBL_REPAIR_JS_FILES_DONE_PROCESSING');\n }//end success\n \n \n \n //set loading message and create url\n ajaxStatus.showStatus(SUGAR.language.get('app_strings', 'LBL_PROCESSING_REQUEST'));\n postData = \"module=Administration&action=callJSRepair&js_admin_repair=" . $_REQUEST['type'] . "&root_directory=" . urlencode(getcwd()) . "&csrf_token=" . smarty_function_sugar_csrf_form_token(array('raw' => true), $smarty) . "\";\n \n \n \n //if this is a call already in progress, then just return \n if(typeof ajxProgress != 'undefined'){ \n return; \n }\n \n //make asynchronous call to process js files\n var ajxProgress = YAHOO.util.Connect.asyncRequest('POST','index.php', {success: success, failure: success}, postData);\n \n \n };//end ajaxCall method\n \n \n //show loading status and make ajax call\n// ajaxStatus.hideStatus();\n// ajaxStatus.showStatus(SUGAR.language.get('app_strings', 'LBL_PROCESSING_REQUEST'));\n window.setTimeout('ajaxCall()', 2000);\n return;\n \n }\n //call function, so it runs automatically \n callJSRepair();\n </script>"; }