• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_return_value函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: action_search

 public function action_search()
 {
     //set ajax view
     $this->view = 'ajax';
     //get the module
     $module = !empty($_REQUEST['qModule']) ? $_REQUEST['qModule'] : '';
     //lowercase module name
     $lmodule = strtolower($module);
     //get the search term
     $term = !empty($_REQUEST['term']) ? $GLOBALS['db']->quote($_REQUEST['term']) : '';
     //in the case of Campaigns we need to use the related module
     $relModule = !empty($_REQUEST['rel_module']) ? $_REQUEST['rel_module'] : null;
     $max = !empty($_REQUEST['max']) ? $_REQUEST['max'] : 10;
     $order_by = !empty($_REQUEST['order_by']) ? $_REQUEST['order_by'] : $lmodule . ".name";
     $offset = !empty($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
     $response = array();
     if (!empty($module)) {
         $where = '';
         $deleted = '0';
         $using_cp = false;
         if (!empty($term)) {
             if ($module == 'Contacts' || $module == 'Leads') {
                 $where = $lmodule . ".first_name like '%" . $term . "%' OR " . $lmodule . ".last_name like '%" . $term . "%'";
                 $order_by = $lmodule . ".last_name";
             } else {
                 $where = $lmodule . ".name like '" . $term . "%'";
             }
         }
         if ($module == 'CampaignProspects') {
             $using_cp = true;
             $module = 'Prospects';
             $lmodule = strtolower($relModule);
             $campign_where = $_SESSION['MAILMERGE_WHERE'];
             $where = $lmodule . ".first_name like '%" . $term . "%' OR " . $lmodule . ".last_name like '%" . $term . "%'";
             if ($campign_where) {
                 $where .= " AND " . $campign_where;
             }
             $where .= " AND related_type = #" . $lmodule . "#";
         }
         $seed = BeanFactory::getBean($module);
         if ($using_cp) {
             $fields = array('id', 'first_name', 'last_name');
             $dataList = $seed->retrieveTargetList($where, $fields, $offset, -1, $max, $deleted);
         } else {
             $dataList = $seed->get_list($order_by, $where, $offset, -1, $max, $deleted);
         }
         $list = $dataList['list'];
         $row_count = $dataList['row_count'];
         $output_list = array();
         foreach ($list as $value) {
             $output_list[] = get_return_value($value, $module);
         }
         $response['result'] = array('result_count' => $row_count, 'entry_list' => $output_list);
     }
     $json = getJSONobj();
     $json_response = $json->encode($response, true);
     print $json_response;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:58,代码来源:controller.php


示例2: get_modified_entries

function get_modified_entries($session, $module_name, $ids, $select_fields)
{
    global $beanList, $beanFiles;
    $error = new SoapError();
    $field_list = array();
    $output_list = array();
    if (!validate_authenticated($session)) {
        $error->set_error('invalid_login');
        return array('field_list' => $field_list, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if (empty($beanList[$module_name])) {
        $error->set_error('no_module');
        return array('field_list' => $field_list, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    global $current_user;
    if (!check_modules_access($current_user, $module_name, 'read')) {
        $error->set_error('no_access');
        return array('field_list' => $field_list, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    $class_name = $beanList[$module_name];
    require_once $beanFiles[$class_name];
    $seed = new $class_name();
    //rsmith
    $in = '';
    $field_select = '';
    $table_name = $seed->table_name;
    if (isset($ids)) {
        foreach ($ids as $value) {
            if (empty($in)) {
                $in .= "('" . $GLOBALS['db']->quote($value) . "'";
            } else {
                $in .= ",'" . $GLOBALS['db']->quote($value) . "'";
            }
        }
        //end foreach
    }
    $index = 0;
    foreach ($select_fields as $field) {
        if (!isset($seed->field_defs[$field])) {
            continue;
        }
        $field_select .= $table_name . "." . $field;
        if ($index < count($select_fields) - 1) {
            $field_select .= ",";
            $index++;
        }
    }
    //end foreach
    $ids = array();
    //end rsmith
    if (!empty($in)) {
        $in .= ')';
    }
    $ret_array = $seed->create_new_list_query('', "{$table_name}.id IN {$in}", $select_fields, array(), -2, '', true, $seed, true);
    if (!is_array($params)) {
        $params = array();
    }
    if (!isset($params['custom_select'])) {
        $params['custom_select'] = '';
    }
    if (!isset($params['custom_from'])) {
        $params['custom_from'] = '';
    }
    if (!isset($params['custom_where'])) {
        $params['custom_where'] = '';
    }
    if (!isset($params['custom_order_by'])) {
        $params['custom_order_by'] = '';
    }
    $main_query = $ret_array['select'] . $params['custom_select'] . $ret_array['from'] . $params['custom_from'] . $ret_array['where'] . $params['custom_where'] . $ret_array['order_by'] . $params['custom_order_by'];
    $result = $seed->db->query($main_query);
    $xml = '<?xml version="1.0" encoding="utf-8"?><items>';
    while ($row = $seed->db->fetchByAssoc($result)) {
        if (version_compare(phpversion(), '5.0') < 0) {
            $temp = $seed;
        } else {
            $temp = @clone $seed;
        }
        $temp->setupCustomFields($temp->module_dir);
        $temp->loadFromRow($row);
        $temp->fill_in_additional_detail_fields();
        if (isset($temp->emailAddress)) {
            $temp->emailAddress->handleLegacyRetrieve($temp);
        }
        $val = get_return_value($temp, $table_name);
        $xml .= get_name_value_xml($val, $module_name);
    }
    $xml .= "</items>";
    $xml = base64_encode($xml);
    return array('result' => $xml, 'error' => $error->get_soap_array());
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:91,代码来源:SoapData.php


示例3: portal_get_entry_list_limited

function portal_get_entry_list_limited($session, $module_name, $where, $order_by, $select_fields, $row_offset, $limit)
{
    global $beanList, $beanFiles, $portal_modules;
    $error = new SoapError();
    if (!portal_validate_authenticated($session)) {
        $error->set_error('invalid_session');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if ($_SESSION['type'] == 'lead') {
        $error->set_error('no_access');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if (empty($beanList[$module_name])) {
        $error->set_error('no_module');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if ($module_name == 'Cases') {
        //if the related cases have not yet been loaded into the session object,
        //then call the methods that will load the cases related to the contact/accounts for this user
        if (!isset($_SESSION['viewable'][$module_name])) {
            //retrieve the contact/account id's for this user
            $c = get_contacts_in();
            $a = get_accounts_in();
            if (!empty($c)) {
                get_cases_in_contacts($c);
            }
            if (!empty($a)) {
                get_cases_in_accounts($a);
            }
        }
        $sugar = new aCase();
        $list = array();
        //if no Cases have been loaded into the session as viewable, then do not issue query, just return empty list
        //issuing a query with no cases loaded in session will return ALL the Cases, which is not a good thing
        if (!empty($_SESSION['viewable'][$module_name])) {
            $list = get_related_list(get_module_in($module_name), new aCase(), $where, $order_by, $row_offset, $limit);
        }
    } else {
        if ($module_name == 'Contacts') {
            $sugar = new Contact();
            $list = get_related_list(get_module_in($module_name), new Contact(), $where, $order_by);
        } else {
            if ($module_name == 'Accounts') {
                $sugar = new Account();
                $list = get_related_list(get_module_in($module_name), new Account(), $where, $order_by);
            } else {
                if ($module_name == 'Bugs') {
                    //if the related bugs have not yet been loaded into the session object,
                    //then call the methods that will load the bugs related to the contact/accounts for this user
                    if (!isset($_SESSION['viewable'][$module_name])) {
                        //retrieve the contact/account id's for this user
                        $c = get_contacts_in();
                        $a = get_accounts_in();
                        if (!empty($c)) {
                            get_bugs_in_contacts($c);
                        }
                        if (!empty($a)) {
                            get_bugs_in_accounts($a);
                        }
                    }
                    $list = array();
                    //if no Bugs have been loaded into the session as viewable, then do not issue query, just return empty list
                    //issuing a query with no bugs loaded in session will return ALL the Bugs, which is not a good thing
                    if (!empty($_SESSION['viewable'][$module_name])) {
                        $list = get_related_list(get_module_in($module_name), new Bug(), $where, $order_by, $row_offset, $limit);
                    }
                } else {
                    if ($module_name == 'KBDocuments') {
                    } else {
                        if ($module_name == 'FAQ') {
                        } else {
                            $error->set_error('no_module_support');
                            return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
                        }
                    }
                }
            }
        }
    }
    $output_list = array();
    $field_list = array();
    foreach ($list as $value) {
        //$loga->fatal("Adding another account to the list");
        $output_list[] = get_return_value($value, $module_name);
        $_SESSION['viewable'][$module_name][$value->id] = $value->id;
        if (empty($field_list)) {
            $field_list = get_field_list($value);
        }
    }
    $output_list = filter_return_list($output_list, $select_fields, $module_name);
    $field_list = filter_field_list($field_list, $select_fields, $module_name);
    return array('result_count' => sizeof($output_list), 'next_offset' => 0, 'field_list' => $field_list, 'entry_list' => $output_list, 'error' => $error->get_soap_array());
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:93,代码来源:SoapPortalHelper.php


示例4: get_related_notes

/**
 * Retrieve the collection of notes that are related to a bean.
 *
 * @param String $session -- Session ID returned by a previous call to login.
 * @param String $module_name -- The name of the module to return records from.  This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method)..
 * @param String $module_id -- The ID of the bean that you want to associate the note with
 * @param Array  $select_fields -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved.
 * @return Array    'result_count' -- The number of records returned (-1 on error)
 *                  'next_offset' -- The start of the next page (This will always be the previous offset plus the number of rows returned.  It does not indicate if there is additional data unless you calculate that the next_offset happens to be closer than it should be.
 *                  'field_list' -- The vardef information on the selected fields.
 *                  'entry_list' -- The records that were retrieved
 *                  'error' -- The SOAP error, if any
 */
function get_related_notes($session, $module_name, $module_id, $select_fields)
{
    global $beanList, $beanFiles;
    $error = new SoapError();
    if (!validate_authenticated($session)) {
        $error->set_error('invalid_login');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if (empty($beanList[$module_name])) {
        $error->set_error('no_module');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    global $current_user;
    if (!check_modules_access($current_user, $module_name, 'read')) {
        $error->set_error('no_access');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    $class_name = $beanList[$module_name];
    require_once $beanFiles[$class_name];
    $seed = new $class_name();
    $seed->retrieve($module_id);
    if (!$seed->ACLAccess('DetailView')) {
        $error->set_error('no_access');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    $list = $seed->get_linked_beans('notes', 'Note', array(), 0, -1, 0);
    $output_list = array();
    $field_list = array();
    foreach ($list as $value) {
        $output_list[] = get_return_value($value, 'Notes');
        if (empty($field_list)) {
            $field_list = get_field_list($value);
        }
    }
    $output_list = filter_return_list($output_list, $select_fields, $module_name);
    $field_list = filter_field_list($field_list, $select_fields, $module_name);
    return array('result_count' => sizeof($output_list), 'next_offset' => 0, 'field_list' => $field_list, 'entry_list' => $output_list, 'error' => $error->get_soap_array());
}
开发者ID:sunmo,项目名称:snowlotus,代码行数:51,代码来源:SoapSugarUsers.php


示例5: get_altered

function get_altered($module_name, $from_date, $to_date)
{
    $name = strtolower($module_name);
    global $disable_date_format;
    $disable_date_format = true;
    global $sugar_config;
    //$sugar_config['list_max_entries_per_page'] = 1000;
    $seed = BeanFactory::getBean($module_name);
    $table_name = $seed->table_name;
    $removeAutoIncrementFields = false;
    $fieldsToRemove = array();
    if ($module_name == 'Quotes') {
        $removeAutoIncrementFields = true;
        $fieldsToRemove = array('quote_num');
    }
    //rrs bug: 29890 - if record on Offline Client is assigned to a team the user does not have access to
    //then it will not sync to server, but the relationship will.  We will assume the user would like to ignore team
    //level security; however, I have added it as an variable "DISABLE_ROW_LEVEL_SECURITY" to this file (see above) so that it can be changed
    //by the server and synced down.
    $seed->disable_row_level_security = DISABLE_ROW_LEVEL_SECURITY;
    $db = DBManagerFactory::getInstance();
    $where = "{$table_name}.date_modified > {$db->convert($db->quoted($from_date), 'datetime')}";
    $where .= " AND {$table_name}.date_modified <= {$db->convert($db->quoted($to_date), 'datetime')}";
    $response = $seed->get_list('', $where, 0, -1, -1, 2);
    $list = $response['list'];
    $output_list = array();
    $field_list = array();
    foreach ($list as $value) {
        if ($removeAutoIncrementFields) {
            foreach ($fieldsToRemove as $fieldToRemove) {
                unset($value->{$fieldToRemove});
            }
        }
        if (isset($value->emailAddress)) {
            $value->emailAddress->handleLegacyRetrieve($value);
        }
        $output_list[] = get_return_value($value, $module_name);
        if (isset($_SESSION['force_accept_server'])) {
            $output_list[sizeof($output_list) - 1]['resolve'] = $_SESSION['force_accept_server'];
        } else {
            $output_list[sizeof($output_list) - 1]['resolve'] = 0;
        }
    }
    return array('result_count' => sizeof($output_list), 'entry_list' => $output_list);
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:45,代码来源:SyncHelper.php


示例6: portal_get_related_list

function portal_get_related_list($session, $module_name, $rel_module, $module_id, $select_fields, $order_by, $offset, $limit)
{
    global $beanList, $beanFiles;
    $error = new SoapError();
    if (!portal_validate_authenticated($session)) {
        $error->set_error('invalid_session');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if ($_SESSION['type'] == 'lead') {
        $error->set_error('no_access');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if (empty($beanList[$module_name])) {
        $error->set_error('no_module');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if (empty($_SESSION['viewable'][$module_name][$module_id])) {
        $error->set_error('no_access');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    $list = get_related_in_module("('" . $GLOBALS['db']->quote($module_id) . "')", $module_name, $rel_module, $order_by, $offset, $limit);
    $output_list = array();
    $field_list = array();
    foreach ($list as $value) {
        $output_list[] = get_return_value($value, $rel_module);
        $_SESSION['viewable'][$rel_module][$value->id] = $value->id;
        if (empty($field_list)) {
            $field_list = get_field_list($value, true);
        }
    }
    $output_list = filter_return_list($output_list, $select_fields, $module_name);
    $field_list = filter_field_list($field_list, $select_fields, $module_name);
    return array('result_count' => $list['result_count'], 'next_offset' => 0, 'field_list' => $field_list, 'entry_list' => $output_list, 'error' => $error->get_soap_array());
}
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:34,代码来源:SoapPortalUsers.php


示例7: portal_get_entry_list_limited


//.........这里部分代码省略.........
        //then call the methods that will load the cases related to the contact/accounts for this user
        if (!isset($_SESSION['viewable'][$module_name])) {
            //retrieve the contact/account id's for this user
            $c = get_contacts_in();
            $a = get_accounts_in();
            if (!empty($c)) {
                get_cases_in_contacts($c);
            }
            if (!empty($a)) {
                get_cases_in_accounts($a);
            }
        }
        $sugar = BeanFactory::getBean('Cases');
        $list = array();
        //if no Cases have been loaded into the session as viewable, then do not issue query, just return empty list
        //issuing a query with no cases loaded in session will return ALL the Cases, which is not a good thing
        if (!empty($_SESSION['viewable'][$module_name])) {
            $list = get_related_list(get_module_in($module_name), BeanFactory::getBean('Cases'), $where, $order_by, $row_offset, $limit);
        }
    } else {
        if ($module_name == 'Contacts') {
            $sugar = BeanFactory::getBean('Contacts');
            $list = get_related_list(get_module_in($module_name), BeanFactory::getBean('Contacts'), $where, $order_by);
        } else {
            if ($module_name == 'Accounts') {
                $sugar = BeanFactory::getBean('Accounts');
                $list = get_related_list(get_module_in($module_name), BeanFactory::getBean('Accounts'), $where, $order_by);
            } else {
                if ($module_name == 'Bugs') {
                    //if the related bugs have not yet been loaded into the session object,
                    //then call the methods that will load the bugs related to the contact/accounts for this user
                    if (!isset($_SESSION['viewable'][$module_name])) {
                        //retrieve the contact/account id's for this user
                        $c = get_contacts_in();
                        $a = get_accounts_in();
                        if (!empty($c)) {
                            get_bugs_in_contacts($c);
                        }
                        if (!empty($a)) {
                            get_bugs_in_accounts($a);
                        }
                    }
                    $list = array();
                    //if no Bugs have been loaded into the session as viewable, then do not issue query, just return empty list
                    //issuing a query with no bugs loaded in session will return ALL the Bugs, which is not a good thing
                    if (!empty($_SESSION['viewable'][$module_name])) {
                        $list = get_related_list(get_module_in($module_name), BeanFactory::getBean('Bugs'), $where, $order_by, $row_offset, $limit);
                    }
                } else {
                    if ($module_name == 'KBDocuments') {
                        $sugar = BeanFactory::getBean('KBDocuments');
                        $sugar->disable_row_level_security = true;
                        $keywords = array();
                        //Check if there was a LIKE or = clause built.  If so, the key/value pairs
                        $where = str_replace("\\'", "<##@comma@##>", $where);
                        if (preg_match_all("/kbdocuments[\\.]([^\\s]*?)[\\s]+(LIKE|=)[\\s]+[\\'](.*?)[%][\\']/si", $where, $matches, PREG_SET_ORDER)) {
                            foreach ($matches as $match) {
                                $value = str_replace("<##@comma@##>", "\\'", $match[3]);
                                $keywords[$match[1]] = $value;
                            }
                        }
                        $where = "";
                        $result = create_portal_list_query($sugar, $order_by, $where, $keywords, $row_offset, $limit);
                        $list = array();
                        while ($row = $sugar->db->fetchByAssoc($result)) {
                            $id = $row['id'];
                            //$list[] = $id;
                            $record = BeanFactory::getBean('KBDocuments', $id, array("disable_row_level_security" => true));
                            $record->fill_in_additional_list_fields();
                            $list[] = $record;
                        }
                    } else {
                        if ($module_name == 'FAQ') {
                            $sugar = BeanFactory::getBean('KBDocuments');
                            preg_match("/kbdocuments.tags[\\s]=[\\s]+[(][\\'](.*?)[\\'][)]/si", $where, $matches);
                            //Use KBDocuments/SearchUtils.php
                            //ToDo: Set Global ID for FAQ somewhere, can't assume it's faq1
                            $list = get_faq_list($matches[1], $sugar);
                        } else {
                            $error->set_error('no_module_support');
                            return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
                        }
                    }
                }
            }
        }
    }
    $output_list = array();
    $field_list = array();
    foreach ($list as $value) {
        $output_list[] = get_return_value($value, $module_name);
        $_SESSION['viewable'][$module_name][$value->id] = $value->id;
        if (empty($field_list)) {
            $field_list = get_field_list($value);
        }
    }
    $output_list = filter_return_list($output_list, $select_fields, $module_name);
    $field_list = filter_field_list($field_list, $select_fields, $module_name);
    return array('result_count' => sizeof($output_list), 'next_offset' => 0, 'field_list' => $field_list, 'entry_list' => $output_list, 'error' => $error->get_soap_array());
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:SoapPortalHelper.php


示例8: json_get_objects_from_module

function json_get_objects_from_module($request_id, &$params)
{
    global $beanList, $beanFiles, $json, $current_user;
    $module_name = $params[0]['module'];
    $offset = intval($params[0]['offset']);
    $where = $params[0]['where'];
    $max = $params[0]['max'];
    $order_by = $params[0]['order_by'];
    $class_name = $beanList[$module_name];
    require_once $beanFiles[$class_name];
    $seed = new $class_name();
    if ($where == '') {
        $where = '';
    }
    if ($offset == '' || $offset == -1) {
        $offset = 0;
    }
    if ($max == '') {
        $max = 10;
    }
    $deleted = '0';
    $response = $seed->get_list($order_by, $where, $offset, -1, $max, $deleted);
    $list = $response['list'];
    $row_count = $response['row_count'];
    $output_list = array();
    foreach ($list as $value) {
        $output_list[] = get_return_value($value, $module_name);
    }
    $response = array();
    $response['id'] = $request_id;
    $response['result'] = array('result_count' => $row_count, 'entry_list' => $output_list);
    //echo $response['result'];
    $json_response = $json->encode($response);
    //echo $offset;
    print $json_response;
    exit;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:37,代码来源:json_server.php


示例9: sync_set_entries

function sync_set_entries($session, $module_name, $from_date, $to_date, $sync_entry_list, $deleted)
{
    $name = strtolower($module_name);
    $entry_list = get_decoded($sync_entry_list);
    $status = 0;
    global $beanList, $beanFiles;
    $error = new SoapError();
    if (!validate_authenticated($session)) {
        $error->set_error('invalid_login');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if (empty($beanList[$module_name])) {
        $error->set_error('no_module');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    global $current_user;
    require_once 'modules/Sync/SyncController.php';
    if (!in_array($module_name, $read_only_override) && !check_modules_access($current_user, $module_name, 'write')) {
        $error->set_error('no_access');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    global $sugar_config;
    $sugar_config['list_max_entries_per_page'] = '-99';
    $conflicts = array();
    $in = '';
    $ids = array();
    foreach ($entry_list as $value) {
        $ids[$value['id']] = $value['id'];
        if ($value['resolve'] == 0) {
            if (empty($in)) {
                $in .= "('" . $GLOBALS['db']->quote($value['id']) . "'";
            } else {
                $in .= ",'" . $GLOBALS['db']->quote($value['id']) . "'";
            }
        }
    }
    $list = array();
    $output_list = array();
    $field_list = array();
    if (!empty($in)) {
        $in .= ')';
        $seed = BeanFactory::getBean($module_name);
        $table_name = $seed->table_name;
        //query for any of the records that have been modified after the fact
        $response = $seed->get_list('', "{$table_name}.date_modified > " . db_convert("'" . $GLOBALS['db']->quote($from_date) . "'", 'datetime') . " AND {$table_name}.date_modified <= " . db_convert("'" . $GLOBALS['db']->quote($to_date) . "'", 'datetime') . " AND {$table_name}.id IN {$in} ", 0, -1, -1, (int) $deleted);
        $list = $response['list'];
        foreach ($list as $value) {
            $cur = BeanFactory::getBean($module_name, $value->id);
            unset($ids[$value->id]);
            $output_list[] = get_return_value($cur, $module_name);
            if (empty($field_list)) {
                $field_list = get_field_list($value);
            }
        }
    }
    $myoutput = get_encoded($output_list);
    if (empty($list)) {
        foreach ($entry_list as $value) {
            $cur = $seed->getCleanCopy();
            foreach ($value['name_value_list'] as $name_value) {
                $cur->{$name_value}['name'] = $name_value['value'];
            }
            $temp = BeanFactory::getBean($module_name, $cur->id);
            if (empty($tmp)) {
                $cur->new_with_id = true;
            }
            if ($value['resolve'] < 1 || $cur->new_with_id) {
                $cur->update_date_modified = true;
                $cur->update_modified_by = true;
                $cur->date_modified = $to_date;
                if ($cur->deleted != 0) {
                    $cur->mark_deleted($cur->id);
                } else {
                    $cur->save();
                }
            }
        }
        $status = 'success';
    } else {
        $status = 'conflict';
    }
    return array('conflicts' => $myoutput, 'status' => $status, 'ids' => $ids, 'error' => $error->get_soap_array());
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:83,代码来源:SoapSync.php


示例10: json_get_objects_from_module

function json_get_objects_from_module($request_id, $params)
{
    global $beanList, $beanFiles, $current_user;
    $json = getJSONobj();
    $module_name = $params[0]['module'];
    $offset = intval($params[0]['offset']);
    $where = $params[0]['where'];
    $max = $params[0]['max'];
    $order_by = $params[0]['order_by'];
    $using_cp = false;
    if ($module_name == 'CampaignProspects') {
        $module_name = 'Prospects';
        $using_cp = true;
    }
    $class_name = $beanList[$module_name];
    require_once $beanFiles[$class_name];
    $seed = new $class_name();
    if ($where == '') {
        $where = '';
    }
    if ($offset == '' || $offset == -1) {
        $offset = 0;
    }
    if ($max == '') {
        $max = 10;
    }
    $deleted = '0';
    if ($using_cp) {
        $fields = array('id', 'first_name', 'last_name');
        $response = $seed->retrieveTargetList($where, $fields, $offset, -1, $max, $deleted);
    } else {
        $response = $seed->get_list($order_by, $where, $offset, -1, $max, $deleted);
    }
    $list = $response['list'];
    $row_count = $response['row_count'];
    $output_list = array();
    foreach ($list as $value) {
        $output_list[] = get_return_value($value, $module_name);
    }
    $response = array();
    $response['id'] = $request_id;
    $response['result'] = array('result_count' => $row_count, 'entry_list' => $output_list);
    $json_response = $json->encode($response, true);
    print $json_response;
}
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:45,代码来源:json_server.php


示例11: portal_get_entry_list_limited

function portal_get_entry_list_limited($session, $module_name, $where, $order_by, $select_fields, $row_offset, $limit)
{
    global $beanList, $beanFiles, $portal_modules;
    $error = new SoapError();
    if (!portal_validate_authenticated($session)) {
        $error->set_error('invalid_session');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if ($_SESSION['type'] == 'lead') {
        $error->set_error('no_access');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if (empty($beanList[$module_name])) {
        $error->set_error('no_module');
        return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    if ($module_name == 'Cases') {
        if (!isset($_SESSION['viewable'][$module_name])) {
            get_cases_in_contacts(get_contacts_in());
            get_cases_in_accounts(get_accounts_in());
        }
        $sugar = new aCase();
        $list = get_related_list(get_module_in($module_name), new aCase(), $where, $order_by, $row_offset, $limit);
    } else {
        if ($module_name == 'Contacts') {
            $sugar = new Contact();
            $list = get_related_list(get_module_in($module_name), new Contact(), $where, $order_by);
        } else {
            if ($module_name == 'Accounts') {
                $sugar = new Account();
                $list = get_related_list(get_module_in($module_name), new Account(), $where, $order_by);
            } else {
                if ($module_name == 'Bugs') {
                    if (!isset($_SESSION['viewable'][$module_name])) {
                        get_bugs_in_contacts(get_contacts_in());
                        get_bugs_in_accounts(get_accounts_in());
                    }
                    $list = get_related_list(get_module_in($module_name), new Bug(), $where, $order_by, $row_offset, $limit);
                } else {
                    if ($module_name == 'KBDocuments') {
                    } else {
                        if ($module_name == 'FAQ') {
                        } else {
                            $error->set_error('no_module_support');
                            return array('result_count' => -1, 'entry_list' => array(), 'error' => $error->get_soap_array());
                        }
                    }
                }
            }
        }
    }
    $output_list = array();
    $field_list = array();
    foreach ($list as $value) {
        //$loga->fatal("Adding another account to the list");
        $output_list[] = get_return_value($value, $module_name);
        $_SESSION['viewable'][$module_name][$value->id] = $value->id;
        if (empty($field_list)) {
            $field_list = get_field_list($value);
        }
    }
    $output_list = filter_return_list($output_list, $select_fields, $module_name);
    $field_list = filter_field_list($field_list, $select_fields, $module_name);
    return array('result_count' => sizeof($output_list), 'next_offset' => 0, 'field_list' => $field_list, 'entry_list' => $output_list, 'error' => $error->get_soap_array());
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:65,代码来源:SoapPortalHelper.php


示例12: gmdate

     }
     $dm = gmdate($GLOBALS['timedate']->get_db_date_time_format(), time() - 36000);
     $id = $synccontact_ids[0];
     echo '<br><br>Modifying Local and Through Soap - Should Have Conflict - test sync_set_entries' . $id;
     $current_user = new User();
     $current_user->retrieve('1');
     $contact = new Contact();
     echo 'saving ' . $id;
     $contact->retrieve($id);
     $contact->first_name = 'modifed local';
     $contact->save();
     $contact->retrieve($id);
     $contact->first_name = 'modifed server';
     $timestart = microtime(true);
     $commit = array();
     $commit[] = get_return_value($contact, 'Contacts');
     $commit[0]['resolve'] = 0;
     echo 'RESOLVING ' . $commit[0]['resolve'];
     $commit = get_encoded($commit);
     $result = $soapclient->call('sync_set_entries', array('session' => $session, 'module_name' => 'Contacts', 'from_date' => $dm, 'sync_entry_list' => $commit));
     $diff = microtime(true) - $timestart;
     echo "<b>Time for retrieving the contacts added list is {$diff} </b> <br><br>";
     print_result($result);
 }
 echo '<BR>TESTING NOTES<BR>';
 echo '<br><br><b>Set A Note - set_entry test:</b><BR>';
 $time = $timedate->nowDb();
 $date = $timedate->asDbDate($timedate->getNow()->get("+" + rand(0, 360000) + "seconds"));
 $hour = $timedate->asDbTime($timedate->getNow()->get("+" + rand(0, 360000) + "seconds"));
 $result = $soapclient->call('set_entry', array('session' => $session, 'module_name' => 'Notes', 'name_value_list' => array(array('name' => 'name', 'value' => "{$time} Note {$i}"))));
 $note_id = $result['id'];
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:SoapFullTest.php


示例13: get_entries

/**
 * Retrieve a list of object based on provided IDs.
 *
 * @param String $session -- Session ID returned by a previous call to login.
 * @param String $module_name -- The name of the module to return records from.  This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method)..
 * @param Array $ids -- An array of  IDs.
 * @param Array $select_fields -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved.
 * @return Array 'field_list' -- Var def information about the returned fields
 *               'entry_list' -- The records that were retrieved
 *               'error' -- The SOAP error, if any
 */
function get_entries($session, $module_name, $ids, $select_fields = null)
{
    global $db;
    $error = new SoapError();
    $field_list = array();
    $output_list = array();
    if (!validate_authenticated($session)) {
        $error->set_error('invalid_session');
        return array('field_list' => $field_list, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    $AppUI =& $_SESSION['AppUI'];
    $GLOBALS['AppUI'] = $AppUI;
    $modclass = $AppUI->getModuleClass($module_name);
    if (file_exists($modclass)) {
        include_once $modclass;
    } else {
        $error->set_error('no_module');
        return array('field_list' => $field_list, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    $perms =& $AppUI->acl();
    $canAccess = $perms->checkModule($module_name, 'access');
    $canRead = $perms->checkModule($module_name, 'view');
    $canEdit = $perms->checkModule($module_name, 'edit');
    $canAuthor = $perms->checkModule($module_name, 'add');
    $canDelete = $perms->checkModule($module_name, 'delete');
    $GLOBALS['perms'] = $perms;
    if (!$canRead) {
        $error->set_error('no_access');
        return array('field_list' => $field_list, 'entry_list' => array(), 'error' => $error->get_soap_array());
    }
    $field_defs = $db->MetaColumns($module_name);
    $_SESSION['field_defs'] = $field_defs;
    $class_name = 'C' . ucfirst(rtrim($module_name, 's'));
    foreach ($ids as $id) {
        $seed = new $class_name();
        $seed->load($id);
        $output_list[] = get_return_value($seed, $module_name);
    }
    if (empty($field_list)) {
        $field_list = get_field_list($field_defs);
    }
    $output_list = filter_return_list($output_list, $select_fields, $module_name);
    $field_list = filter_field_list($field_list, $select_fields, $module_name);
    return array('field_list' => $field_list, 'entry_list' => $output_list, 'error' => $error->get_soap_array());
}
开发者ID:EvgenyPopov,项目名称:DotProject-SOAP,代码行数:56,代码来源:SoapFunctions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_role函数代码示例发布时间:2022-05-15
下一篇:
PHP get_return_url函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap