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


PHP encodeMultienumValue函数代码示例

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


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

示例1: save_lines

 function save_lines($post_data, $parent, $key = '')
 {
     $line_count = count($post_data[$key . 'action']);
     $j = 0;
     for ($i = 0; $i < $line_count; ++$i) {
         if ($post_data[$key . 'deleted'][$i] == 1) {
             $this->mark_deleted($post_data[$key . 'id'][$i]);
         } else {
             $action = new AOW_Action();
             foreach ($this->field_defs as $field_def) {
                 if (isset($post_data[$key . $field_def['name']][$i])) {
                     $action->{$field_def}['name'] = $post_data[$key . $field_def['name']][$i];
                 }
             }
             $params = array();
             foreach ($post_data[$key . 'param'][$i] as $param_name => $param_value) {
                 if ($param_name == 'value') {
                     foreach ($param_value as $p_id => $p_value) {
                         if ($post_data[$key . 'param'][$i]['value_type'][$p_id] == 'Value' && is_array($p_value)) {
                             $param_value[$p_id] = encodeMultienumValue($p_value);
                         }
                     }
                 }
                 $params[$param_name] = $param_value;
             }
             $action->parameters = base64_encode(serialize($params));
             if (trim($action->action) != '') {
                 $action->action_order = ++$j;
                 $action->assigned_user_id = $parent->assigned_user_id;
                 $action->aow_workflow_id = $parent->id;
                 $action->save();
             }
         }
     }
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:35,代码来源:AOW_Action.php

示例2: save

 public function save(&$bean, $params, $field, $properties, $prefix = '')
 {
     if (isset($params[$prefix . $field])) {
         if ($params[$prefix . $field][0] === '' && !empty($params[$prefix . $field][1])) {
             unset($params[$prefix . $field][0]);
         }
         $bean->{$field} = encodeMultienumValue($params[$prefix . $field]);
     }
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:9,代码来源:SugarFieldMultienum.php

示例3: populateFromPost

function populateFromPost($prefix, &$focus, $skipRetrieve = false)
{
    global $current_user;
    if (!empty($_REQUEST[$prefix . 'record']) && !$skipRetrieve) {
        $focus->retrieve($_REQUEST[$prefix . 'record']);
    }
    if (!empty($_POST['assigned_user_id']) && $focus->assigned_user_id != $_POST['assigned_user_id'] && $_POST['assigned_user_id'] != $current_user->id) {
        $GLOBALS['check_notify'] = true;
    }
    require_once 'include/SugarFields/SugarFieldHandler.php';
    $sfh = new SugarFieldHandler();
    foreach ($focus->field_defs as $field => $def) {
        $type = !empty($def['custom_type']) ? $def['custom_type'] : $def['type'];
        $sf = $sfh->getSugarField(ucfirst($type), true);
        if ($sf != null) {
            $sf->save($focus, $_POST, $field, $def);
        }
        if (isset($_POST[$prefix . $field])) {
            if (is_array($_POST[$prefix . $field]) && !empty($focus->field_defs[$field]['isMultiSelect'])) {
                if (empty($_POST[$prefix . $field][0])) {
                    unset($_POST[$prefix . $field][0]);
                }
                $_POST[$prefix . $field] = encodeMultienumValue($_POST[$prefix . $field]);
            }
            $focus->{$field} = $_POST[$prefix . $field];
            /* 
             * overrides the passed value for booleans.
             * this will be fully deprecated when the change to binary booleans is complete.
             */
            if (isset($focus->field_defs[$prefix . $field]) && $focus->field_defs[$prefix . $field]['type'] == 'bool' && isset($focus->field_defs[$prefix . $field]['options'])) {
                $opts = explode("|", $focus->field_defs[$prefix . $field]['options']);
                $bool = $_POST[$prefix . $field];
                if (is_int($bool) || ($bool === "0" || $bool === "1" || $bool === "2")) {
                    // 1=on, 2=off
                    $selection = $_POST[$prefix . $field] == "0" ? 1 : 0;
                } elseif (is_bool($_POST[$prefix . $field])) {
                    // true=on, false=off
                    $selection = $_POST[$prefix . $field] ? 0 : 1;
                }
                $focus->{$field} = $opts[$selection];
            }
        } else {
            if (!empty($focus->field_defs[$field]['isMultiSelect']) && !isset($_POST[$prefix . $field]) && isset($_POST[$prefix . $field . '_multiselect'])) {
                $focus->{$field} = '';
            }
        }
    }
    foreach ($focus->additional_column_fields as $field) {
        if (isset($_POST[$prefix . $field])) {
            $value = $_POST[$prefix . $field];
            $focus->{$field} = $value;
        }
    }
    return $focus;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:55,代码来源:formbase.php

示例4: requestToUserParameters

function requestToUserParameters()
{
    $params = array();
    foreach ($_REQUEST['parameter_id'] as $key => $parameterId) {
        if ($_REQUEST['parameter_type'][$key] === 'Multi') {
            $_REQUEST['parameter_value'][$key] = encodeMultienumValue(explode(',', $_REQUEST['parameter_value'][$key]));
        }
        $params[$parameterId] = array('id' => $parameterId, 'operator' => $_REQUEST['parameter_operator'][$key], 'type' => $_REQUEST['parameter_type'][$key], 'value' => $_REQUEST['parameter_value'][$key]);
    }
    return $params;
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:11,代码来源:aor_utils.php

示例5: save_lines

 function save_lines($post_data, $parent, $key = '')
 {
     require_once 'modules/AOW_WorkFlow/aow_utils.php';
     $line_count = count($post_data[$key . 'field']);
     $j = 0;
     for ($i = 0; $i < $line_count; ++$i) {
         if ($post_data[$key . 'deleted'][$i] == 1) {
             $this->mark_deleted($post_data[$key . 'id'][$i]);
         } else {
             $condition = new AOR_Condition();
             foreach ($this->field_defs as $field_def) {
                 if (isset($post_data[$key . $field_def['name']][$i])) {
                     if (is_array($post_data[$key . $field_def['name']][$i])) {
                         switch ($condition->value_type) {
                             case 'Date':
                                 $post_data[$key . $field_def['name']][$i] = base64_encode(serialize($post_data[$key . $field_def['name']][$i]));
                             default:
                                 $post_data[$key . $field_def['name']][$i] = encodeMultienumValue($post_data[$key . $field_def['name']][$i]);
                         }
                     } else {
                         if ($field_def['name'] == 'value') {
                             $post_data[$key . $field_def['name']][$i] = fixUpFormatting($_REQUEST['report_module'], $condition->field, $post_data[$key . $field_def['name']][$i]);
                         } else {
                             if ($field_def['name'] == 'parameter') {
                                 $post_data[$key . $field_def['name']][$i] = isset($post_data[$key . $field_def['name']][$i]);
                             } else {
                                 if ($field_def['name'] == 'module_path') {
                                     $post_data[$key . $field_def['name']][$i] = base64_encode(serialize(explode(":", $post_data[$key . $field_def['name']][$i])));
                                 }
                             }
                         }
                     }
                     $condition->{$field_def}['name'] = $post_data[$key . $field_def['name']][$i];
                 } else {
                     if ($field_def['name'] == 'parameter') {
                         $condition->{$field_def}['name'] = 0;
                     }
                 }
             }
             // Period must be saved as a string instead of a base64 encoded datetime.
             // Overwriting value
             if ($condition->value_type == 'Period') {
                 $condition->value = base64_encode($_POST['aor_conditions_value'][$i]);
                 //                    $condition->value = $_POST['aor_conditions_value'][$i];
             }
             if (trim($condition->field) != '') {
                 $condition->condition_order = ++$j;
                 $condition->aor_report_id = $parent->id;
                 $condition->save();
             }
         }
     }
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:53,代码来源:AOR_Condition.php

示例6: save_lines

 function save_lines($post_data, $parent, $key = '')
 {
     require_once 'modules/AOW_WorkFlow/aow_utils.php';
     $line_count = count($post_data[$key . 'field']);
     $j = 0;
     for ($i = 0; $i < $line_count; ++$i) {
         if ($post_data[$key . 'deleted'][$i] == 1) {
             $this->mark_deleted($post_data[$key . 'id'][$i]);
         } else {
             $condition = new AOW_Condition();
             foreach ($this->field_defs as $field_def) {
                 if (isset($post_data[$key . $field_def['name']][$i])) {
                     if (is_array($post_data[$key . $field_def['name']][$i])) {
                         if ($field_def['name'] == 'module_path') {
                             $post_data[$key . $field_def['name']][$i] = base64_encode(serialize($post_data[$key . $field_def['name']][$i]));
                         } else {
                             switch ($condition->value_type) {
                                 case 'Date':
                                     $post_data[$key . $field_def['name']][$i] = base64_encode(serialize($post_data[$key . $field_def['name']][$i]));
                                 default:
                                     $post_data[$key . $field_def['name']][$i] = encodeMultienumValue($post_data[$key . $field_def['name']][$i]);
                             }
                         }
                     } else {
                         if ($field_def['name'] === 'value' && $post_data[$key . 'value_type'][$i] === 'Value') {
                             $post_data[$key . $field_def['name']][$i] = fixUpFormatting($_REQUEST['flow_module'], $condition->field, $post_data[$key . $field_def['name']][$i]);
                         }
                     }
                     $condition->{$field_def}['name'] = $post_data[$key . $field_def['name']][$i];
                 }
             }
             if (trim($condition->field) != '') {
                 $condition->condition_order = ++$j;
                 $condition->assigned_user_id = $parent->assigned_user_id;
                 $condition->aow_workflow_id = $parent->id;
                 $condition->save();
             }
         }
     }
 }
开发者ID:omusico,项目名称:windcrm,代码行数:40,代码来源:AOW_Condition.php

示例7: requestToUserParameters

function requestToUserParameters()
{
    $params = array();
    if (isset($_REQUEST['parameter_id']) && $_REQUEST['parameter_id']) {
        foreach ($_REQUEST['parameter_id'] as $key => $parameterId) {
            if ($_REQUEST['parameter_type'][$key] === 'Multi') {
                $_REQUEST['parameter_value'][$key] = encodeMultienumValue(explode(',', $_REQUEST['parameter_value'][$key]));
            }
            $params[$parameterId] = array('id' => $parameterId, 'operator' => $_REQUEST['parameter_operator'][$key], 'type' => $_REQUEST['parameter_type'][$key], 'value' => $_REQUEST['parameter_value'][$key]);
            // Fix for issue #1272 - AOR_Report module cannot update Date type parameter.
            if ($_REQUEST['parameter_type'][$key] === 'Date') {
                $values = array();
                $values[] = $_REQUEST['parameter_value'][0];
                $values[] = $_REQUEST['parameter_value'][1];
                $values[] = $_REQUEST['parameter_value'][2];
                $values[] = $_REQUEST['parameter_value'][3];
                $params[$parameterId] = array('id' => $parameterId, 'operator' => $_REQUEST['parameter_operator'][$key], 'type' => $_REQUEST['parameter_type'][$key], 'value' => $values);
            }
        }
    }
    return $params;
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:22,代码来源:aor_utils.php

示例8: save

 function save($df)
 {
     if (isset($this->default)) {
         if (is_array($this->default)) {
             $this->default = encodeMultienumValue($this->default);
         }
         $this->ext4 = isset($this->dependency) ? serialize(array('default' => $this->default, 'dependency' => $this->dependency)) : $this->default;
     } else {
         if (isset($this->dependency)) {
             $this->ext4 = serialize(array('dependency' => $this->dependency));
         }
     }
     parent::save($df);
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:14,代码来源:TemplateMultiEnum.php

示例9: handle_set_entries

function handle_set_entries($module_name, $name_value_lists, $select_fields = FALSE)
{
    global $beanList, $beanFiles, $app_list_strings, $current_user;
    $error = new SoapError();
    $ret_values = array();
    if (empty($beanList[$module_name])) {
        $error->set_error('no_module');
        return array('ids' => array(), 'error' => $error->get_soap_array());
    }
    if (!check_modules_access($current_user, $module_name, 'write')) {
        $error->set_error('no_access');
        return array('ids' => -1, 'error' => $error->get_soap_array());
    }
    $class_name = $beanList[$module_name];
    require_once $beanFiles[$class_name];
    $ids = array();
    $count = 1;
    $total = sizeof($name_value_lists);
    foreach ($name_value_lists as $name_value_list) {
        $seed = new $class_name();
        $seed->update_vcal = false;
        //See if we can retrieve the seed by a given id value
        foreach ($name_value_list as $value) {
            if ($value['name'] == 'id') {
                $seed->retrieve($value['value']);
                break;
            }
        }
        $dataValues = array();
        foreach ($name_value_list as $value) {
            $val = $value['value'];
            if ($seed->field_name_map[$value['name']]['type'] == 'enum' || $seed->field_name_map[$value['name']]['type'] == 'radioenum') {
                $vardef = $seed->field_name_map[$value['name']];
                if (isset($app_list_strings[$vardef['options']]) && !isset($app_list_strings[$vardef['options']][$val])) {
                    if (in_array($val, $app_list_strings[$vardef['options']])) {
                        $val = array_search($val, $app_list_strings[$vardef['options']]);
                    }
                }
            } else {
                if ($seed->field_name_map[$value['name']]['type'] == 'multienum') {
                    $vardef = $seed->field_name_map[$value['name']];
                    if (isset($app_list_strings[$vardef['options']]) && !isset($app_list_strings[$vardef['options']][$value])) {
                        $items = explode(",", $val);
                        $parsedItems = array();
                        foreach ($items as $item) {
                            if (in_array($item, $app_list_strings[$vardef['options']])) {
                                $keyVal = array_search($item, $app_list_strings[$vardef['options']]);
                                array_push($parsedItems, $keyVal);
                            }
                        }
                        if (!empty($parsedItems)) {
                            $val = encodeMultienumValue($parsedItems);
                        }
                    }
                }
            }
            //Apply the non-empty values now since this will be used for duplicate checks
            //allow string or int of 0 to be updated if set.
            if (!empty($val) || ($val === '0' || $val === 0)) {
                $seed->{$value}['name'] = $val;
            }
            //Store all the values in dataValues Array to apply later
            $dataValues[$value['name']] = $val;
        }
        if ($count == $total) {
            $seed->update_vcal = false;
        }
        $count++;
        //Add the account to a contact
        if ($module_name == 'Contacts') {
            $GLOBALS['log']->debug('Creating Contact Account');
            add_create_account($seed);
            $duplicate_id = check_for_duplicate_contacts($seed);
            if ($duplicate_id == null) {
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    //Now apply the values, since this is not a duplicate we can just pass false for the $firstSync argument
                    apply_values($seed, $dataValues, false);
                    $seed->save();
                    if ($seed->deleted == 1) {
                        $seed->mark_deleted($seed->id);
                    }
                    $ids[] = $seed->id;
                }
            } else {
                //since we found a duplicate we should set the sync flag
                if ($seed->ACLAccess('Save')) {
                    //Determine if this is a first time sync.  We find out based on whether or not a contacts_users relationship exists
                    $seed->id = $duplicate_id;
                    $seed->load_relationship("user_sync");
                    $beans = $seed->user_sync->getBeans();
                    $first_sync = empty($beans);
                    //Now apply the values and indicate whether or not this is a first time sync
                    apply_values($seed, $dataValues, $first_sync);
                    $seed->contacts_users_id = $current_user->id;
                    $seed->save();
                    $ids[] = $duplicate_id;
                    //we have a conflict
                }
            }
        } else {
//.........这里部分代码省略.........
开发者ID:sunmo,项目名称:snowlotus,代码行数:101,代码来源:SoapSugarUsers.php

示例10: testValidMultiEnumWhenSpacesExistInTheValue

 /**
  * @ticket 37842 
  */
 public function testValidMultiEnumWhenSpacesExistInTheValue()
 {
     $vardefs = array('options' => 'salutation_dom');
     $this->assertEquals($this->_ifs->multienum('Mr., Mrs.', $vardefs), encodeMultienumValue(array('Mr.', 'Mrs.')));
 }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:8,代码来源:ImportFieldSanitizeTest.php

示例11: populateDefaultMapValue

 protected function populateDefaultMapValue($field, $fieldValue, $fieldDef)
 {
     global $timedate, $current_user;
     if (is_array($fieldValue)) {
         $defaultRowValue = encodeMultienumValue($fieldValue);
     } else {
         $defaultRowValue = $_REQUEST[$field];
     }
     // translate default values to the date/time format for the import file
     if ($fieldDef['type'] == 'date' && $this->ifs->dateformat != $timedate->get_date_format()) {
         $defaultRowValue = $timedate->swap_formats($defaultRowValue, $this->ifs->dateformat, $timedate->get_date_format());
     }
     if ($fieldDef['type'] == 'time' && $this->ifs->timeformat != $timedate->get_time_format()) {
         $defaultRowValue = $timedate->swap_formats($defaultRowValue, $this->ifs->timeformat, $timedate->get_time_format());
     }
     if (($fieldDef['type'] == 'datetime' || $fieldDef['type'] == 'datetimecombo') && $this->ifs->dateformat . ' ' . $this->ifs->timeformat != $timedate->get_date_time_format()) {
         $defaultRowValue = $timedate->swap_formats($defaultRowValue, $this->ifs->dateformat . ' ' . $this->ifs->timeformat, $timedate->get_date_time_format());
     }
     if (in_array($fieldDef['type'], array('currency', 'float', 'int', 'num')) && $this->ifs->num_grp_sep != $current_user->getPreference('num_grp_sep')) {
         $defaultRowValue = str_replace($current_user->getPreference('num_grp_sep'), $this->ifs->num_grp_sep, $defaultRowValue);
     }
     if (in_array($fieldDef['type'], array('currency', 'float')) && $this->ifs->dec_sep != $current_user->getPreference('dec_sep')) {
         $defaultRowValue = str_replace($current_user->getPreference('dec_sep'), $this->ifs->dec_sep, $defaultRowValue);
     }
     $user_currency_symbol = $this->defaultUserCurrency->symbol;
     if ($fieldDef['type'] == 'currency' && $this->ifs->currency_symbol != $user_currency_symbol) {
         $defaultRowValue = str_replace($user_currency_symbol, $this->ifs->currency_symbol, $defaultRowValue);
     }
     return $defaultRowValue;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:30,代码来源:Importer.php

示例12: workflow_convert_multienum_value

/**
 * Creates proper representation of multienum value from actions_array.php
 *
 * @param string $value
 * @return string
 */
function workflow_convert_multienum_value($value)
{
    // this is weird, but new value is stored in workflow definition as a partially
    // encoded string — without leading and trailing ^s, but with delimiting ^s and commas.
    // thus we pretend it's a single value and wrap it into array in order to get the leading and trailing ^s
    // @see parse_multi_array()
    return encodeMultienumValue(array($value));
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:14,代码来源:action_utils.php

示例13: saveField

function saveField($field, $id, $module, $value)
{
    $bean = BeanFactory::getBean($module, $id);
    if (is_object($bean) && $bean->id != "") {
        if ($bean->field_defs[$field]['type'] == "multienum") {
            $bean->{$field} = encodeMultienumValue($value);
        } else {
            if ($bean->field_defs[$field]['type'] == "relate") {
                $save_field = $bean->field_defs[$field]['id_name'];
                $bean->{$save_field} = $value;
            } else {
                $bean->{$field} = $value;
            }
        }
        $bean->save();
        return getDisplayValue($bean, $field);
    } else {
        return false;
    }
}
开发者ID:pikkoui,项目名称:suitecrm,代码行数:20,代码来源:InlineEditing.php

示例14: saveField

function saveField($field, $id, $module, $value)
{
    $bean = BeanFactory::getBean($module, $id);
    if (is_object($bean) && $bean->id != "") {
        if ($bean->field_defs[$field]['type'] == "multienum") {
            $bean->{$field} = encodeMultienumValue($value);
        } else {
            if ($bean->field_defs[$field]['type'] == "relate" || $bean->field_defs[$field]['type'] == 'parent') {
                $save_field = $bean->field_defs[$field]['id_name'];
                $bean->{$save_field} = $value;
                if ($bean->field_defs[$field]['type'] == 'parent') {
                    $bean->parent_type = $_REQUEST['parent_type'];
                    $bean->fill_in_additional_parent_fields();
                    // get up to date parent info as need it to display name
                }
            } else {
                $bean->{$field} = $value;
            }
        }
        $bean->save();
        return getDisplayValue($bean, $field);
    } else {
        return false;
    }
}
开发者ID:auf,项目名称:crm_auf_org,代码行数:25,代码来源:InlineEditing.php

示例15: encodeMultienumValue

            }
            $value = encodeMultienumValue($value);
        }
        $focus->merge_bean->{$field} = $value;
    } elseif (isset($focus->merge_bean->field_name_map[$field]['type']) && $focus->merge_bean->field_name_map[$field]['type'] == 'bool') {
        $focus->merge_bean->{$field} = 0;
    }
}
foreach ($focus->merge_bean->additional_column_fields as $field) {
    if (isset($_POST[$field])) {
        $value = $_POST[$field];
        if (is_array($value) && !empty($focus->merge_bean->field_defs[$field]->properties['isMultiSelect'])) {
            if (empty($value[0])) {
                unset($value[0]);
            }
            $value = encodeMultienumValue($value);
        }
        $focus->merge_bean->{$field} = $value;
    }
}
global $check_notify;
$_REQUEST['useEmailWidget'] = true;
if (isset($_POST['date_entered'])) {
    // set this to true so we won't unset date_entered when saving
    $focus->merge_bean->update_date_entered = true;
}
$focus->merge_bean->save($check_notify);
unset($_REQUEST['useEmailWidget']);
$return_id = $focus->merge_bean->id;
$return_module = $focus->merge_module;
$return_action = 'DetailView';
开发者ID:alachaum,项目名称:sugarcrm,代码行数:31,代码来源:SaveMerge.php


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