function process($option)
 {
     switch ($option) {
         case 'EditDropdown':
             parent::process($option);
             require_once 'modules/Studio/DropDowns/EditView.php';
             break;
         case 'SaveDropDown':
             DropDownHelper::saveDropDown($_REQUEST);
             require_once 'modules/Studio/DropDowns/EditView.php';
             break;
         default:
             parent::process($option);
     }
 }
Exemple #2
0
 function save_sms_macro($module, $field, $macro, $macro_to_remove = '')
 {
     if (strpos($macro, "%1") === false and $macro_to_remove == '') {
         echo "Макро строка должна содержать %1.";
         return false;
         // the string must contain %1
     }
     require_once 'modules/Studio/DropDowns/DropDownHelper.php';
     $params = array();
     $params['dropdown_name'] = "sms_mod_macro_list";
     $count = 0;
     //if (!empty($GLOBALS["app_list_strings"]["sms_mod_macro_list"])) {
     $mod_wd_macro = $GLOBALS["app_list_strings"]["sms_mod_macro_list"];
     foreach ($mod_wd_macro as $k => $v) {
         if ($k != $macro_to_remove) {
             $params['slot_' . $count] = $count;
             $params['key_' . $count] = $k;
             $params['value_' . $count] = $v;
             $count++;
         }
     }
     if ($module != '' and $field != '') {
         $params['slot_' . $count] = $count;
         $params['key_' . $count] = $module;
         $params['value_' . $count] = $field . ":" . $macro;
     }
     DropDownHelper::saveDropDown($params);
     return true;
     //} else {
     //	return false;
     //}
 }
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
global $app_list_strings, $app_strings, $mod_strings;
require_once 'modules/Studio/DropDowns/DropDownHelper.php';
require_once 'modules/Studio/parsers/StudioParser.php';
$dh = new DropDownHelper();
$dh->getDropDownModules();
$smarty = new Sugar_Smarty();
$smarty->assign('MOD', $GLOBALS['mod_strings']);
$title = getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_RENAME_TABS']), false);
$smarty->assign('title', $title);
$selected_lang = !empty($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : $_SESSION['authenticated_user_language'];
if (empty($selected_lang)) {
    $selected_lang = $GLOBALS['sugar_config']['default_language'];
}
if ($selected_lang == $GLOBALS['current_language']) {
    $my_list_strings = $GLOBALS['app_list_strings'];
} else {
    $my_list_strings = return_app_list_strings_language($selected_lang);
}
foreach ($my_list_strings as $key => $value) {
 /**
  * Save changes to the module names to the app string entries for both the moduleList and moduleListSingular entries.
  *
  * @return RenameModules
  */
 private function changeAppStringEntries()
 {
     $GLOBALS['log']->debug('Begining to save app string entries');
     //Save changes to the moduleList app string entry
     DropDownHelper::saveDropDown($_REQUEST);
     //Save changes to the moduleListSingular app string entry
     $newParams = array();
     $newParams['dropdown_name'] = 'moduleListSingular';
     $newParams['dropdown_lang'] = isset($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : '';
     $newParams['use_push'] = true;
     DropDownHelper::saveDropDown($this->createModuleListSingularPackage($newParams, $this->changedModules));
     //Save changes to the "*type_display*" app_list_strings entry.
     global $app_list_strings;
     $typeDisplayList = getTypeDisplayList();
     foreach (array_keys($this->changedModules) as $moduleName) {
         foreach ($typeDisplayList as $typeDisplay) {
             if (isset($app_list_strings[$typeDisplay]) && isset($app_list_strings[$typeDisplay][$moduleName])) {
                 $newParams['dropdown_name'] = $typeDisplay;
                 DropDownHelper::saveDropDown($this->createModuleListSingularPackage($newParams, array($moduleName => $this->changedModules[$moduleName])));
             }
         }
     }
     return $this;
 }
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 */
global $app_list_strings, $app_strings, $mod_strings;
require_once 'modules/Studio/DropDowns/DropDownHelper.php';
require_once 'modules/Studio/parsers/StudioParser.php';
$dh = new DropDownHelper();
$dh->getDropDownModules();
$smarty = new Sugar_Smarty();
$smarty->assign('MOD', $GLOBALS['mod_strings']);
$title = get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'] . ": " . $mod_strings['LBL_RENAME_TABS'], true);
$smarty->assign('title', $title);
$selected_lang = !empty($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : $_SESSION['authenticated_user_language'];
if (empty($selected_lang)) {
    $selected_lang = $GLOBALS['sugar_config']['default_language'];
}
if ($selected_lang == $GLOBALS['current_language']) {
    $my_list_strings = $GLOBALS['app_list_strings'];
} else {
    $my_list_strings = return_app_list_strings_language($selected_lang);
}
foreach ($my_list_strings as $key => $value) {
 /**
  * Save changes to the module names to the app string entries for both the moduleList and moduleListSingular entries.
  *
  * @return RenameModules
  */
 private function changeAppStringEntries()
 {
     $GLOBALS['log']->debug('Begining to save app string entries');
     //Save changes to the moduleList app string entry
     DropDownHelper::saveDropDown($_REQUEST);
     //Save changes to the moduleListSingular app string entry
     $newParams = array();
     $newParams['dropdown_name'] = 'moduleListSingular';
     $newParams['dropdown_lang'] = isset($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : '';
     $newParams['use_push'] = true;
     DropDownHelper::saveDropDown($this->createModuleListSingularPackage($newParams, $this->changedModules));
     //Save changes to the parent_type_display app_list_strings entry
     global $app_list_strings;
     $cur_app_list_strings = $app_list_strings;
     foreach ($this->changedModules as $moduleName => $package) {
         $found = false;
         // only change if it exists
         foreach ($cur_app_list_strings['parent_type_display'] as $moduleName2 => $parentDispName) {
             if ($moduleName == $moduleName2) {
                 $found = true;
                 break;
             }
         }
         if ($found) {
             $newParams['dropdown_name'] = 'parent_type_display';
             DropDownHelper::saveDropDown($this->createModuleListSingularPackage($newParams, array($moduleName => $this->changedModules[$moduleName])));
         }
     }
     return $this;
 }
 /**
  * Save changes to the module names to the app string entries for both the moduleList and moduleListSingular entries.
  *
  * @return RenameModules
  */
 private function changeAppStringEntries()
 {
     $GLOBALS['log']->debug('Begining to save app string entries');
     //Save changes to the moduleList app string entry
     DropDownHelper::saveDropDown($_REQUEST);
     //Save changes to the moduleListSingular app string entry
     $newParams = array();
     $newParams['dropdown_name'] = 'moduleListSingular';
     $newParams['dropdown_lang'] = isset($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : '';
     $newParams['use_push'] = true;
     DropDownHelper::saveDropDown($this->createModuleListSingularPackage($newParams, $this->getAllModulesFromRequest()));
     //Save changes to the "*type_display*" app_list_strings entry.
     global $app_list_strings;
     $typeDisplayList = getTypeDisplayList();
     foreach (array_keys($this->changedModules) as $moduleName) {
         //Save changes to the "*type_display*" app_list_strings entry.
         foreach ($typeDisplayList as $typeDisplay) {
             if (isset($app_list_strings[$typeDisplay]) && isset($app_list_strings[$typeDisplay][$moduleName])) {
                 $newParams['dropdown_name'] = $typeDisplay;
                 DropDownHelper::saveDropDown($this->createModuleListSingularPackage($newParams, array($moduleName => $this->changedModules[$moduleName])));
             }
         }
         //save changes to moduleIconList
         if (isset($app_list_strings['moduleIconList']) && isset($app_list_strings['moduleIconList'][$moduleName])) {
             $newParams['dropdown_name'] = 'moduleIconList';
             //recreate the moduleIconList array to be passed in using the format defined in getAllModulesFromRequest()
             $newIconList = $app_list_strings['moduleIconList'];
             $modPackages = $this->getAllModulesFromRequest();
             foreach ($newIconList as $modKey => $modVal) {
                 $newIconList[$modKey] = $modPackages[$modKey];
             }
             //save modified moduleIconList array
             $newIconList[$moduleName] = $this->changedModules[$moduleName];
             DropDownHelper::saveDropDown($this->createModuleListSingularPackage($newParams, $newIconList));
         }
     }
     return $this;
 }
Exemple #8
0
    $dir_tablecust = 'custom/application/Ext/TableDictionary/';
    $the_file = $dir_tablecust . "tabledictionary.ext.php";
    if (!is_dir($the_file)) {
        mkdir_recursive($dir_tablecust);
    }
    $content = file($the_file);
    if ($fg = fopen($the_file, 'w+')) {
        $lines = "<?php \n";
        for ($i = 1; $i < count($content) - 1; $i++) {
            $lines .= $content[$i] . "\n";
        }
        $lines .= $tabledicext . "\n ?>";
        fwrite($fg, $lines);
        fclose($fg);
    }
    DropDownHelper::saveDropDown($params);
    unset($_GET);
    echo "<div>Нажмите кнопку Восстановить, чтобы применить ваши настройки.</div>";
    $ver = explode(".", $GLOBALS['sugar_config']['sugar_version']);
    if ($ver[0] == '6') {
        echo "<input type='button' id='repair' class='button' value='Восстановить' onclick=\"window.location.href='./index.php?module=Administration&action=repair'\" />";
    } else {
        echo "<input type='button' id='repair' class='button' value='Восстановить' onclick=\"window.location.href='./index.php?module=Administration&action=repairSelectModule'\" />";
    }
    //rebuild files
    //$installer->rebuild_vardefs();
    //$installer->rebuild_layoutdefs();
    //$installer->rebuild_relationships();
} else {
    echo "<div class='moduleTitle'><h2><a href='index.php?module=Administration&action=index'>Administration</a><span class='pointer'>&raquo;</span>Связь модулей с модулем SMS</h2></div>";
    // just a space