当前位置: 首页>>代码示例>>PHP>>正文


PHP getJSONobj函数代码示例

本文整理汇总了PHP中getJSONobj函数的典型用法代码示例。如果您正苦于以下问题:PHP getJSONobj函数的具体用法?PHP getJSONobj怎么用?PHP getJSONobj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getJSONobj函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 /**
  * @see ViewQuickcreate::display()
  */
 public function display()
 {
     $userPref = $GLOBALS['current_user']->getPreference('email_link_type');
     $defaultPref = $GLOBALS['sugar_config']['email_default_client'];
     if ($userPref != '') {
         $client = $userPref;
     } else {
         $client = $defaultPref;
     }
     if ($client == 'sugar') {
         $eUi = new EmailUI();
         if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan'))) {
             $fullComposeUrl = "index.php?module=Emails&action=Compose&parent_id={$this->bean->id}&parent_type={$this->bean->module_dir}";
             $composeData = array('parent_id' => $this->bean->id, 'parent_type' => $this->bean->module_dir);
         } else {
             $fullComposeUrl = "index.php?module=Emails&action=Compose";
             $composeData = array('parent_id' => '', 'parent_type' => '');
         }
         $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, $fullComposeUrl);
         $json_obj = getJSONobj();
         $opts = $json_obj->decode($j_quickComposeOptions);
         $opts['menu_id'] = 'dccontent';
         $ss = new Sugar_Smarty();
         $ss->assign('json_output', $json_obj->encode($opts));
         $ss->display('modules/Emails/templates/dceMenuQuickCreate.tpl');
     } else {
         $emailAddress = '';
         if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan')) && !is_null($this->bean->emailAddress)) {
             $emailAddress = $this->bean->emailAddress->getPrimaryAddress($this->bean);
         }
         echo "<script>document.location.href='mailto:{$emailAddress}';lastLoadedMenu=undefined;DCMenu.closeOverlay();</script>";
         die;
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:37,代码来源:view.quickcreate.php

示例2: testFormatResults

 public function testFormatResults()
 {
     $tempPT = new ProductTemplate();
     $tempPT->name = 'MasonUnitTest';
     $tempPT->description = "Unit'test";
     $tempPT->cost_price = 1000;
     $tempPT->discount_price = 800;
     $tempPT->list_price = 1100;
     $tempPT->save();
     $_REQUEST['data'] = '{"conditions":[{"end":"%","name":"name","op":"like_custom","value":""}],"field_list":["name","id","type_id","mft_part_num","cost_price","list_price","discount_price","pricing_factor","description","cost_usdollar","list_usdollar","discount_usdollar","tax_class_name"],"form":"EditView","group":"or","id":"EditView_product_name[1]","limit":"30","method":"query","modules":["ProductTemplates"],"no_match_text":"No Match","order":"name","populate_list":["name_1","product_template_id_1"],"post_onblur_function":"set_after_sqs"}';
     $_REQUEST['query'] = 'MasonUnitTest';
     require_once 'modules/home/quicksearchQuery.php';
     $json = getJSONobj();
     $data = $json->decode(html_entity_decode($_REQUEST['data']));
     if (isset($_REQUEST['query']) && !empty($_REQUEST['query'])) {
         foreach ($data['conditions'] as $k => $v) {
             if (empty($data['conditions'][$k]['value'])) {
                 $data['conditions'][$k]['value'] = $_REQUEST['query'];
             }
         }
     }
     $this->quickSearch = new quicksearchQuery();
     $result = $this->quickSearch->query($data);
     $resultBean = $json->decodeReal($result);
     $this->assertEquals($resultBean['fields'][0]['description'], $tempPT->description);
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:26,代码来源:QuickSearchTests.php

示例3: display

 public function display()
 {
     global $beanList, $beanFiles, $current_user, $app_strings;
     $moduleDir = empty($_REQUEST['bean']) ? '' : $_REQUEST['bean'];
     $beanName = empty($beanList[$moduleDir]) ? '' : $beanList[$moduleDir];
     $id = empty($_REQUEST['id']) ? '' : $_REQUEST['id'];
     // Bug 40216 - Add support for a custom additionalDetails.php file
     $additionalDetailsFile = $this->getAdditionalDetailsMetadataFile($moduleDir);
     if (empty($beanFiles[$beanName]) || empty($id) || !is_file($additionalDetailsFile)) {
         echo 'bad data';
         die;
     }
     require_once $beanFiles[$beanName];
     require_once $additionalDetailsFile;
     $adFunction = 'additionalDetails' . $beanName;
     if (function_exists($adFunction)) {
         // does the additional details function exist
         $json = getJSONobj();
         $bean = new $beanName();
         $bean->retrieve($id);
         $arr = array_change_key_case($bean->toArray(), CASE_UPPER);
         $results = $adFunction($arr);
         $retArray['body'] = str_replace(array("\rn", "\r", "\n"), array('', '', '<br />'), $results['string']);
         if (!$bean->ACLAccess('EditView')) {
             $results['editLink'] = '';
         }
         $retArray['caption'] = "<div style='float:left'>{$app_strings['LBL_ADDITIONAL_DETAILS']}</div><div style='float: right'>";
         $retArray['caption'] .= "";
         $retArray['width'] = empty($results['width']) ? '300' : $results['width'];
         echo 'result = ' . $json->encode($retArray);
     }
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:32,代码来源:view.additionaldetailsretrieve.php

示例4: display

    public function display()
    {
        global $beanList, $beanFiles, $current_user, $app_strings, $app_list_strings;
        $moduleDir = empty($_REQUEST['bean']) ? '' : $_REQUEST['bean'];
        $beanName = empty($beanList[$moduleDir]) ? '' : $beanList[$moduleDir];
        $id = empty($_REQUEST['id']) ? '' : $_REQUEST['id'];
        // Bug 40216 - Add support for a custom additionalDetails.php file
        $additionalDetailsFile = $this->getAdditionalDetailsMetadataFile($moduleDir);
        if (empty($id) || empty($additionalDetailsFile)) {
            echo 'bad data';
            die;
        }
        require_once $additionalDetailsFile;
        $adFunction = 'additionalDetails' . $beanName;
        if (function_exists($adFunction)) {
            // does the additional details function exist
            $json = getJSONobj();
            $bean = BeanFactory::getBean($moduleDir, $id);
            //bug38901 - shows dropdown list label instead of database value
            foreach ($bean->field_name_map as $field => $value) {
                if ($value['type'] == 'enum' && !empty($value['options']) && !empty($app_list_strings[$value['options']]) && isset($app_list_strings[$value['options']][$bean->{$field}])) {
                    $bean->{$field} = $app_list_strings[$value['options']][$bean->{$field}];
                }
            }
            $bean->ACLFilterFields();
            $arr = array_change_key_case($bean->toArray(), CASE_UPPER);
            $results = $adFunction($arr);
            $retArray['body'] = str_replace(array("\rn", "\r", "\n"), array('', '', '<br />'), $results['string']);
            $retArray['caption'] = "<div style='float:left'>{$app_strings['LBL_ADDITIONAL_DETAILS']}</div><div style='float: right'>";
            if (!empty($_REQUEST['show_buttons'])) {
                if ($bean->ACLAccess('EditView')) {
                    $editImg = SugarThemeRegistry::current()->getImageURL('edit_inline.png', false);
                    $results['editLink'] = $this->buildButtonLink($results['editLink']);
                    $retArray['caption'] .= <<<EOC
<a style="text-decoration:none;" title="{$GLOBALS['app_strings']['LBL_EDIT_BUTTON']}" href="{$results['editLink']}">
    <img border=0 src="{$editImg}">
</a>
EOC;
                }
                if ($bean->ACLAccess('DetailView')) {
                    $detailImg = SugarThemeRegistry::current()->getImageURL('view_inline.png', false);
                    $results['viewLink'] = $this->buildButtonLink($results['viewLink']);
                    $retArray['caption'] .= <<<EOC
<a style="text-decoration:none;" title="{$GLOBALS['app_strings']['LBL_VIEW_BUTTON']}" href="{$results['viewLink']}">
    <img border=0 src="{$detailImg}" style="margin-left:2px;">
</a>
EOC;
                }
                $closeImg = SugarThemeRegistry::current()->getImageURL('close.png', false);
                $retArray['caption'] .= <<<EOC
<a title="{$GLOBALS['app_strings']['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE']}" href="javascript:SUGAR.util.closeStaticAdditionalDetails();">
    <img border=0 src="{$closeImg}" style="margin-left:2px;">
</a>
EOC;
            }
            $retArray['caption'] .= "";
            $retArray['width'] = empty($results['width']) ? '300' : $results['width'];
            echo 'result = ' . $json->encode($retArray);
        }
    }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:60,代码来源:view.additionaldetailsretrieve.php

示例5: getSVNumbersHtml

function getSVNumbersHtml($focus, $name, $value, $view)
{
    if ('EditView' != $view && 'DetailView' != $view) {
        return "";
        // skip the rest of the method if another view calls this method
    }
    global $app_list_strings;
    global $sugar_config;
    $json = getJSONobj();
    $svnumbersSmartyArray = $focus->getSVNumbersArray();
    $svnumberQuicksearch = getSVNumberQuicksearch('svnumber', 'svnumber_id');
    $smarty = new Sugar_Smarty();
    $smarty->assign('sugarDateFormat', getSugarCrmLocale('datef'));
    //$smarty->assign('sugarDateFormat', $sugar_config['default_date_format']);
    $smarty->assign('sqsJavaScript', $svnumberQuicksearch);
    $smarty->assign('svnumbersArray', $svnumbersSmartyArray);
    $smarty->assign('languageStringsCommon', getLanguageStrings("common"));
    if ('DetailView' === $view) {
        // transfer ide into ajvascript code so that we can determine the urls in the ajax call
        $smarty->assign('id', $focus->id);
        //		$smarty->assign('languageStringsDocuments', getLanguageStrings('Documents'));
    }
    $sep = get_number_seperators();
    $smarty->assign('sugarDecimalSeperator', $sep[1]);
    return $smarty->fetch('include/oqc/ExternalContracts/SVNumbers.' . $view . '.html');
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:26,代码来源:ExternalContracts.php

示例6: getHeaderText

 function getHeaderText($action, $currentModule)
 {
     global $app_strings;
     global $current_user;
     $button = "<form border='0' action='index.php' method='post' name='UsersDetailView' id='UsersDetailView'>\n";
     $button .= "<input type='hidden' name='record' value=''>\n";
     $button .= "<input type='hidden' name='user_id' value='{$_REQUEST['record']}'>\n";
     $button .= "<input type='hidden' name='team_id' value=''>\n";
     $button .= "<input type='hidden' name='module' value='Teams'>\n";
     $button .= "<input type='hidden' name='action' value='AddUserToTeam'>\n";
     $button .= "<input type='hidden' name='return_module' value='Users'>\n";
     $button .= "<input type='hidden' name='return_action' value='" . $action . "'>\n";
     $button .= "<input type='hidden' name='return_id' value='" . $this->focus->id . "'>\n";
     if ($current_user->isAdminForModule('Users')) {
         ///////////////////////////////////////
         ///
         /// SETUP PARENT POPUP
         $popup_request_data = array('call_back_function' => 'set_return_user_and_save', 'form_name' => 'UsersDetailView', 'field_to_name_array' => array('id' => 'record'));
         $json = getJSONobj();
         $encoded_popup_request_data = $json->encode($popup_request_data);
         if (isset($widget_data['mode'])) {
             $popup_mode = $widget_data['mode'];
         } else {
             $popup_mode = 'Single';
         }
         //
         ///////////////////////////////////////
         $button .= "<input title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' type='button' class='button' value='  " . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "  ' name='button' onclick='open_popup(\"Teams\", 600, 400, \"\", true, true, {$encoded_popup_request_data}, \"MultiSelect\");'>\n";
         //				."  ' name='button' onclick='window.open(\"index.php?module=Teams&action=Popup&html=Popup_picker&form=UsersDetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'>\n";
     }
     $button .= "</form>\n";
     return $button;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:33,代码来源:SubPanelViewUsers.php

示例7: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     $this->ss->assign('APPLIST', $GLOBALS['app_list_strings']);
     $repeatIntervals = array();
     for ($i = 1; $i <= self::MAX_REPEAT_INTERVAL; $i++) {
         $repeatIntervals[$i] = $i;
     }
     $this->ss->assign("repeat_intervals", $repeatIntervals);
     $fdow = $GLOBALS['current_user']->get_first_day_of_week();
     $dow = array();
     for ($i = $fdow; $i < $fdow + 7; $i++) {
         $dayIndex = $i % 7;
         $dow[] = array("index" => $dayIndex, "label" => $GLOBALS['app_list_strings']['dom_cal_day_short'][$dayIndex + 1]);
     }
     $this->ss->assign('dow', $dow);
     $this->ss->assign('repeatData', json_encode($this->view_object_map['repeatData']));
     parent::display();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:35,代码来源:view.edit.php

示例8: display

 function display()
 {
     global $mod_strings;
     $smarty = new Sugar_Smarty();
     $mb = new ModuleBuilder();
     //if (!empty($_REQUEST['package'])) {
     if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) {
         $this->generatePackageButtons($mb->getPackageList());
         $smarty->assign('buttons', $this->buttons);
         $smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']);
         $smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']);
         $smarty->assign("defaultHelp", "mbHelp");
         $ajax = new AjaxCompose();
         $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
         $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], '');
         $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
         echo $ajax->getJavascript();
     } else {
         $name = !empty($_REQUEST['package']) ? $_REQUEST['package'] : '';
         $mb->getPackage($name);
         require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
         $mbt = new MBPackageTree();
         $nodes = $mbt->fetchNodes();
         $package_labels = array();
         if (!empty($nodes['tree_data']['nodes'])) {
             foreach ($nodes['tree_data']['nodes'] as $entry) {
                 if (!empty($entry['data']['label']) && $name != $entry['data']['label']) {
                     $package_labels[] = strtoupper($entry['data']['label']);
                 }
             }
         }
         $json = getJSONobj();
         $smarty->assign('package_labels', $json->encode($package_labels));
         $this->package =& $mb->packages[$name];
         $this->loadModuleTypes();
         $this->loadPackageHelp($name);
         $this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified);
         $smarty->assign('package', $this->package);
         $smarty->assign('mod_strings', $mod_strings);
         $smarty->assign('package_already_deployed', 'false');
         foreach ($this->package->modules as $a_module) {
             if (in_array($a_module->key_name, $GLOBALS['moduleList'])) {
                 $smarty->assign('package_already_deployed', 'true');
                 break;
             }
         }
         $ajax = new AjaxCompose();
         $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
         if (empty($name)) {
             $name = $mod_strings['LBL_NEW_PACKAGE'];
         }
         $ajax->addCrumb($name, '');
         $html = $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
         if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SavePackage') {
             $html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
         }
         $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
         echo $ajax->getJavascript();
     }
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:60,代码来源:view.package.php

示例9: getAttachmentsHtml

function getAttachmentsHtml($focus, $name, $value, $view)
{
    if ('EditView' != $view && 'DetailView' != $view) {
        return "";
        // skip the rest of the method if another view calls this method
    }
    global $app_list_strings;
    $smarty = new Sugar_Smarty();
    if (isset($focus->attachmentsequence)) {
        $c = get_all_linked_attachment_revisions($focus->attachmentsequence);
        // smarty mit Werten befüllen
        $smarty->assign('attachments', buildAttachmentsArray($c));
    } else {
        $smarty->assign('attachments', array());
    }
    // setup the popup link
    $popup_request_data = array('call_back_function' => 'popup_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom']['']));
    $revision_request_data = array('call_back_function' => 'revision_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom']['']));
    $json = getJSONobj();
    $encoded_request_data = $json->encode($popup_request_data);
    $encoded_revision_request_data = $json->encode($revision_request_data);
    $languageStrings = $json->encode($app_list_strings["oqc"]["Attachments"]);
    $smarty->assign('moduleName', getCurrentModuleName());
    $smarty->assign('languageStringsAttachments', $languageStrings);
    $smarty->assign('open_popup_encoded_request_data', $encoded_request_data);
    $smarty->assign('create_popup_encoded_request_data', $encoded_request_data);
    $smarty->assign('upload_revision_encoded_request_data', $encoded_revision_request_data);
    $smarty->assign('initialFilter', "\"&deleted=0\"");
    // Todo: Hier nur Dokumente zulassen, die für Vertragsanhänge erlaubt sind
    return $smarty->fetch('include/oqc/Attachments/' . $view . '.html');
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:31,代码来源:Attachments.php

示例10: saveDropDown

 /**
  * Takes in the request params from a save request and processes
  * them for the save.
  *
  * @param REQUEST params  $params
  */
 function saveDropDown($params)
 {
     require_once 'modules/Administration/Common.php';
     $emptyMarker = translate('LBL_BLANK');
     $selected_lang = !empty($params['dropdown_lang']) ? $params['dropdown_lang'] : $_SESSION['authenticated_user_language'];
     $type = $_REQUEST['view_package'];
     $dir = '';
     $dropdown_name = $params['dropdown_name'];
     $json = getJSONobj();
     $list_value = str_replace('&quot;&quot;:&quot;&quot;', '&quot;__empty__&quot;:&quot;&quot;', $params['list_value']);
     //Bug 21362 ENT_QUOTES- convert single quotes to escaped single quotes.
     $dropdown = $json->decode(html_entity_decode(rawurldecode($list_value), ENT_QUOTES));
     if (array_key_exists($emptyMarker, $dropdown)) {
         unset($dropdown[$emptyMarker]);
         $dropdown[''] = '';
     }
     if ($type != 'studio') {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($params['view_package'], $params['view_module']);
         $this->synchMBDropDown($dropdown_name, $dropdown, $selected_lang, $module);
         //Can't use synch on selected lang as we want to overwrite values, not just keys
         $module->mblanguage->appListStrings[$selected_lang . '.lang.php'][$dropdown_name] = $dropdown;
         $module->mblanguage->save($module->key_name);
         // tyoung - key is required parameter as of
     } else {
         $contents = return_custom_app_list_strings_file_contents($selected_lang);
         $my_list_strings = return_app_list_strings_language($selected_lang);
         if ($selected_lang == $GLOBALS['current_language']) {
             $GLOBALS['app_list_strings'][$dropdown_name] = $dropdown;
         }
         //write to contents
         $contents = str_replace("?>", '', $contents);
         if (empty($contents)) {
             $contents = "<?php";
         }
         //add new drop down to the bottom
         if (!empty($params['use_push'])) {
             //this is for handling moduleList and such where nothing should be deleted or anything but they can be renamed
             foreach ($dropdown as $key => $value) {
                 //only if the value has changed or does not exist do we want to add it this way
                 if (!isset($my_list_strings[$dropdown_name][$key]) || strcmp($my_list_strings[$dropdown_name][$key], $value) != 0) {
                     //clear out the old value
                     $pattern_match = '/\\s*\\$app_list_strings\\s*\\[\\s*\'' . $dropdown_name . '\'\\s*\\]\\[\\s*\'' . $key . '\'\\s*\\]\\s*=\\s*[\'\\"]{1}.*?[\'\\"]{1};\\s*/ism';
                     $contents = preg_replace($pattern_match, "\n", $contents);
                     //add the new ones
                     $contents .= "\n\$GLOBALS['app_list_strings']['{$dropdown_name}']['{$key}']=" . var_export_helper($value) . ";";
                 }
             }
         } else {
             //Now synch up the keys in other langauges to ensure that removed/added Drop down values work properly under all langs.
             $this->synchDropDown($dropdown_name, $dropdown, $selected_lang, $dir);
             $contents = $this->getNewCustomContents($dropdown_name, $dropdown, $selected_lang);
         }
         if (!empty($dir) && !is_dir($dir)) {
             $continue = mkdir_recursive($dir);
         }
         save_custom_app_list_strings_contents($contents, $selected_lang, $dir);
     }
     sugar_cache_reset();
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:66,代码来源:parser.dropdown.php

示例11: getUserConfigJSON

 function getUserConfigJSON()
 {
     global $timedate;
     global $current_user, $sugar_config;
     $json = getJSONobj();
     if (isset($_SESSION['authenticated_user_theme']) && $_SESSION['authenticated_user_theme'] != '') {
         $theme = $_SESSION['authenticated_user_theme'];
     } else {
         $theme = $sugar_config['default_theme'];
     }
     $user_arr = array();
     $user_arr['theme'] = $theme;
     $user_arr['fields'] = array();
     $user_arr['module'] = 'User';
     $user_arr['fields']['id'] = $current_user->id;
     $user_arr['fields']['user_name'] = $current_user->user_name;
     $user_arr['fields']['first_name'] = $current_user->first_name;
     $user_arr['fields']['last_name'] = $current_user->last_name;
     $user_arr['fields']['full_name'] = $current_user->full_name;
     $user_arr['fields']['email'] = $current_user->email1;
     $user_arr['fields']['gmt_offset'] = $timedate->getUserUTCOffset();
     $user_arr['fields']['date_time_format'] = $current_user->getUserDateTimePreferences();
     $str = "\n" . $this->global_registry_var_name . ".current_user = " . $json->encode($user_arr) . ";\n";
     return $str;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:25,代码来源:json_config.php

示例12: process

 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'ProjectTask');
     parent::process();
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"projectTaskQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"projecttask\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_projecttask\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('projectTaskQuickCreate');
     $focus = new ProjectTask();
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
     $this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['project_task_status_options'], $focus->status));
     $json = getJSONobj();
     ///////////////////////////////////////
     ///
     /// SETUP PARENT POPUP
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'projectTypeQuickCreate', 'field_to_name_array' => array('id' => 'parent_id', 'name' => 'parent_name'));
     $encoded_parent_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_parent_popup_request_data', $encoded_parent_popup_request_data);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'projectTaskQuickCreate', 'field_to_name_array' => array('id' => 'account_id', 'name' => 'account_name'));
     $encoded_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:29,代码来源:ProjectTaskQuickCreate.php

示例13: json_get_full_list

function json_get_full_list()
{
    global $beanFiles;
    global $beanList;
    require_once 'include/utils.php';
    require_once $beanFiles[$beanList[$_REQUEST['module']]];
    $json = getJSONobj();
    $where = str_replace('\\', '', rawurldecode($_REQUEST['where']));
    $order = str_replace('\\', '', rawurldecode($_REQUEST['order']));
    $focus = new $beanList[$_REQUEST['module']]();
    $fullList = $focus->get_full_list($order, $where, '');
    $all_fields = array_merge($focus->column_fields, $focus->additional_column_fields);
    $js_fields_arr = array();
    $i = 1;
    // js doesn't like 0 index?
    foreach ($fullList as $note) {
        $js_fields_arr[$i] = array();
        foreach ($all_fields as $field) {
            if (isset($note->{$field})) {
                $note->{$field} = from_html($note->{$field});
                $note->{$field} = preg_replace('/\\r\\n/', '<BR>', $note->{$field});
                $note->{$field} = preg_replace('/\\n/', '<BR>', $note->{$field});
                $js_fields_arr[$i][$field] = addslashes($note->{$field});
            }
        }
        $i++;
    }
    $out = $json->encode($js_fields_arr, true);
    print $out;
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:30,代码来源:json.php

示例14: process

 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'Opportunities');
     $json = getJSONobj();
     parent::process();
     list($num_grp_sep, $dec_sep) = get_number_seperators();
     $this->ss->assign('NUM_GRP_SEP', $num_grp_sep);
     $this->ss->assign('DEC_SEP', $dec_sep);
     $this->ss->assign('CURRENCY_ID', $current_user->getPreference('currency'));
     $this->ss->assign("SALES_STAGE_OPTIONS", get_select_options_with_id($app_list_strings['sales_stage_dom'], ''));
     $this->ss->assign("LEAD_SOURCE_OPTIONS", get_select_options_with_id($app_list_strings['lead_source_dom'], ''));
     $this->ss->assign('prob_array', $json->encode($app_list_strings['sales_probability_dom']));
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"opportunitiesQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"opportunities\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_opportunities\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('opportunitiesQuickCreate');
     $focus = new Opportunity();
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:26,代码来源:OpportunitiesQuickCreate.php

示例15: get_xtpl_edit

 function get_xtpl_edit()
 {
     $name = $this->name . '_name';
     $id = $this->name;
     $module = $this->ext2;
     $returnXTPL = array();
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array('id' => $this->name, $this->ext1 => $name));
     $json = getJSONobj();
     $encoded_contact_popup_request_data = $json->encode($popup_request_data);
     $returnXTPL['ENCODED_' . strtoupper($id) . '_POPUP_REQUEST_DATA'] = $encoded_contact_popup_request_data;
     $returnXTPL[strtoupper($id) . '_MODULE'] = $module;
     if (isset($beanList[$module]) && isset($this->bean->{$id})) {
         if (!isset($this->bean->{$name})) {
             $mod_field = $this->ext1;
             global $beanList, $beanFiles;
             $class = $beanList[$module];
             require_once $beanFiles[$class];
             $mod = new $class();
             $mod->retrieve($this->bean->{$id});
             if (isset($mod->{$mod_field})) {
                 $this->bean->{$name} = $mod->{$mod_field};
             }
         }
         $returnXTPL[strtoupper($id)] = $this->bean->{$id};
     }
     if (isset($this->bean->{$name})) {
         $returnXTPL[strtoupper($name)] = $this->bean->{$name};
     }
     return $returnXTPL;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:TemplateRelatedTextField.php


注:本文中的getJSONobj函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。