示例#1
0
 /**
  * @group bug45963
  */
 public function testGetImportableModules()
 {
     $modules = Importer::getImportableModules();
     $this->assertTrue(empty($modules['Groups']));
     $this->assertNotEmpty($modules['Contacts']);
     $this->assertNotEmpty($modules['Accounts']);
 }
示例#2
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings, $current_user;
     global $sugar_config;
     $this->ss->assign("MODULE_TITLE", $this->getModuleTitle(false));
     $this->ss->assign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_DELETE']));
     $this->ss->assign("PUBLISH_INLINE_PNG", SugarThemeRegistry::current()->getImage('publish_inline', 'align="absmiddle" border="0"', null, null, '.gif', $mod_strings['LBL_PUBLISH']));
     $this->ss->assign("UNPUBLISH_INLINE_PNG", SugarThemeRegistry::current()->getImage('unpublish_inline', 'align="absmiddle" border="0"', null, null, '.gif', $mod_strings['LBL_UNPUBLISH']));
     $this->ss->assign("IMPORT_MODULE", $_REQUEST['import_module']);
     $showModuleSelection = $this->importModule == 'Administration';
     $importableModulesOptions = array();
     $importablePersonModules = array();
     //If we are coming from the admin link, get the module list.
     if ($showModuleSelection) {
         $tmpImportable = Importer::getImportableModules();
         $importableModulesOptions = get_select_options_with_id($tmpImportable, '');
         $importablePersonModules = $this->getImportablePersonModulesJS();
         $this->ss->assign("IMPORT_MODULE", key($tmpImportable));
     } else {
         $this->instruction = 'LBL_SELECT_DS_INSTRUCTION';
         $this->ss->assign('INSTRUCTION', $this->getInstruction());
     }
     $this->ss->assign("FROM_ADMIN", $showModuleSelection);
     $this->ss->assign("PERSON_MODULE_LIST", json_encode($importablePersonModules));
     $this->ss->assign("showModuleSelection", $showModuleSelection);
     $this->ss->assign("IMPORTABLE_MODULES_OPTIONS", $importableModulesOptions);
     $this->ss->assign("EXTERNAL_APIS", $this->getExternalApis());
     $this->ss->assign("EXTERNAL_SOURCES", $this->getAllImportableExternalEAPMs());
     $this->ss->assign("EXTERNAL_AUTHENTICATED_SOURCES", json_encode($this->getAuthenticatedImportableExternalEAPMs()));
     $selectExternal = !empty($_REQUEST['application']) ? $_REQUEST['application'] : '';
     $this->ss->assign("selectExternalSource", $selectExternal);
     $content = $this->ss->fetch('modules/Import/tpls/step1.tpl');
     $submitContent = "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"right\">";
     $submitContent .= "<input title=\"" . $mod_strings['LBL_IMPORT_COMPLETE'] . "\" onclick=\"SUGAR.importWizard.closeDialog();\" class=\"button\" type=\"submit\" name=\"finished\" value=\"  " . $mod_strings['LBL_IMPORT_COMPLETE'] . "  \" id=\"finished\">";
     $submitContent .= "<input title=\"" . $mod_strings['LBL_NEXT'] . "\" class=\"button primary\" type=\"submit\" name=\"button\" value=\"  " . $mod_strings['LBL_NEXT'] . "  \"  id=\"gonext\"></td></tr></table>";
     $this->ss->assign("JAVASCRIPT", $this->_getJS());
     $this->ss->assign("CONTENT", $content);
     $this->ss->display('modules/Import/tpls/wizardWrapper.tpl');
 }