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


PHP get_singular_bean_name函数代码示例

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


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

示例1: getRecordFields

 private function getRecordFields($bean)
 {
     global $dictionary;
     global $app_list_strings;
     $fields = array();
     foreach ($dictionary[$bean->object_name]['fields'] as $name => $field_meta) {
         if ($field_meta['type'] != 'link') {
             $field_name = translate($field_meta['vname'], $bean->module_dir);
             $field_name = preg_replace('/:\\s*$/', '', $field_name);
             if ($field_name != '') {
                 if ($field_meta['type'] == 'relate' && $field_meta['dbType'] == 'id') {
                     $fields[$name] = $field_name . ' (references ' . get_singular_bean_name($field_meta['module']) . ')';
                 } else {
                     $fields[$name] = $field_name;
                 }
             }
         }
     }
     asort($fields);
     return $fields;
 }
开发者ID:nunoabc,项目名称:Web2,代码行数:21,代码来源:view.crmdataconfig.php

示例2: checkEachColInArr

function checkEachColInArr($arr, $full_table_list, $report_id, $report_name, $user_name)
{
    foreach ($arr as $column) {
        global $beanFiles;
        if (empty($beanFiles)) {
            include 'include/modules.php';
        }
        if (is_array($column)) {
            $module_name = $full_table_list[$column['table_key']]['module'];
        }
        if (!isset($module_name)) {
            continue;
        }
        $bean_name = get_singular_bean_name($module_name);
        require_once $beanFiles[$bean_name];
        $module = new $bean_name();
        $table = $module->table_name;
        $colName = $column['name'];
        if (isset($altered_cols[$table]) && isset($altered_cols[$table][$colName]) || $colName == 'email1' || $colName == 'email2') {
            echo $user_name . '------' . $report_name . "------" . $colName;
            //array_push($bad_reports[$report_id], $column);
        }
    }
}
开发者ID:klr2003,项目名称:sourceread,代码行数:24,代码来源:CheckReports.php

示例3: array

$step_num = 3;
$xtpl->assign("PREV_STEP", '2');
$xtpl->assign("STEP_NUM", "Step 3:");
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array('id' => 'rel_id', 'name' => 'rel_name'));
$json = getJSONobj();
// must urlencode to put into the filter request string
// because IE gets an out of memory error when it is passed
// as the usual object literal
$encoded_popup_request_data = urlencode($json->encode($popup_request_data));
$modules = $modules_array;
$xtpl->assign("MAILMERGE_MODULE_OPTIONS", get_select_options_with_id($modules, '0'));
$change_parent_button = "<input title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' tabindex='2' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "' name='button' onclick='open_popup(document.EditView.rel_type.value, 600, 400, \"&request_data={$encoded_popup_request_data}\", true, false, {});' />";
$change_parent_button = "<input title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' tabindex='2' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "' name='button' onclick='open_popup(document.EditView.parent_type.value, 600, 400, \"&request_data={$encoded_popup_request_data}\", true, false, {});' />";
$xtpl->assign("CHANGE_PARENT_BUTTON", $change_parent_button);
$relModule = $_SESSION['MAILMERGE_CONTAINS_CONTACT_INFO'];
$xtpl->assign("STEP3_HEADER", "Set " . get_singular_bean_name($relModule) . " Association");
$select = "Select id, name from contacts";
global $beanList, $beanFiles;
$class_name = $beanList[$relModule];
require_once $beanFiles[$class_name];
$seed = new $class_name();
if (isset($_SESSION['MAILMERGE_SKIP_REL']) && $_SESSION['MAILMERGE_SKIP_REL']) {
    $disabled = 'disabled';
} else {
    $disabled = '';
}
$oddRow = true;
foreach ($sel_obj as $key => $value) {
    $value = str_replace("##", "&", $value);
    $value = stripslashes($value);
    $code = md5($key);
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:31,代码来源:Step3.php

示例4: queryOrderBy

 public function queryOrderBy($layout_def)
 {
     $field_def = $this->reporter->all_fields[$layout_def['column_key']];
     if (!empty($field_def['sort_on'])) {
         $order_by = $layout_def['table_alias'] . "." . $field_def['sort_on'];
     } else {
         $order_by = $this->_get_column_select($layout_def);
     }
     $list = array();
     if (isset($field_def['options'])) {
         $list = translate($field_def['options'], $field_def['module']);
     } else {
         if (isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) {
             global $beanFiles;
             if (empty($beanFiles)) {
                 include 'include/modules.php';
             }
             $bean_name = get_singular_bean_name($field_def['module']);
             require_once $beanFiles[$bean_name];
             $list = $field_def['function']();
         }
     }
     $order_by_arr = array();
     if (empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') {
         $order_dir = " DESC";
     } else {
         $order_dir = " ASC";
     }
     foreach ($list as $key => $value) {
         if ($key == '') {
             array_push($order_by_arr, "(" . $order_by . "='" . $key . "' OR " . $order_by . " IS NULL)" . " {$order_dir}\n");
         } else {
             array_push($order_by_arr, $order_by . "='" . $key . "' {$order_dir}\n");
         }
     }
     $thisarr = implode(',', $order_by_arr);
     return $thisarr;
 }
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:38,代码来源:SugarWidgetFieldenum.php

示例5: save

 function save($df)
 {
     // create the new ID field associated with this relate field - this will hold the id of the related record
     // this field must have a unique name as the name is used when constructing quicksearches and when saving the field
     //Check if we have not saved this field so we don't create two ID fields.
     //Users should not be able to switch the module after having saved it once.
     if (!$df->fieldExists($this->name)) {
         $id = new TemplateId();
         $id->len = 36;
         $id->label = strtoupper("LBL_{$this->name}_" . BeanFactory::getBeanName($this->ext2) . "_ID");
         $id->vname = $id->label;
         $this->saveIdLabel($id->label, $df);
         $count = 0;
         $basename = strtolower(get_singular_bean_name($this->ext2)) . '_id';
         $idName = $basename . '_c';
         while ($df->fieldExists($idName, 'id')) {
             $idName = $basename . ++$count . '_c';
         }
         $id->name = $idName;
         $id->reportable = false;
         $id->save($df);
         // record the id field's name, and save
         $this->ext3 = $id->name;
         $this->id_name = $id->name;
     }
     parent::save($df);
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:27,代码来源:TemplateRelatedTextField.php

示例6: queryOrderBy

 public function queryOrderBy($layout_def)
 {
     $field_def = $this->reporter->all_fields[$layout_def['column_key']];
     if (!empty($field_def['sort_on'])) {
         $order_by = $layout_def['table_alias'] . "." . $field_def['sort_on'];
     } else {
         $order_by = $this->_get_column_select($layout_def);
     }
     $list = array();
     if (isset($field_def['options'])) {
         $list = translate($field_def['options'], $field_def['module']);
     } elseif (isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) {
         global $beanFiles;
         if (empty($beanFiles)) {
             include 'include/modules.php';
         }
         $bean_name = get_singular_bean_name($field_def['module']);
         require_once $beanFiles[$bean_name];
         $list = $field_def['function']();
     }
     if (empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') {
         $order_dir = "ASC";
     } else {
         $order_dir = "DESC";
     }
     return $this->reporter->db->orderByEnum($order_by, $list, $order_dir);
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:27,代码来源:SugarWidgetFieldenum.php

示例7: template_module_defs_js

function template_module_defs_js()
{
    global $report_modules, $current_language;
    $mod_strings = return_module_language($current_language, 'Reports');
    $currentModule = 'Reports';
    $global_json = getJSONobj();
    global $ACLAllowedModules;
    $ACLAllowedModules = getACLAllowedModules(true);
    echo 'ACLAllowedModules = ' . $global_json->encode(array_keys($ACLAllowedModules)) . ";\n";
    ?>
var module_defs = new Object();
default_summary_columns = ['count'];
<?php 
    // build table datastructure in javascript objs
    global $mod_strings;
    global $current_language;
    global $app_list_strings;
    global $currentModule;
    $relationships = array();
    foreach ($report_modules as $module_name => $bean_name) {
        if ($module_name == 'Reports') {
            continue;
        }
        global $beanFiles;
        if (empty($beanFiles)) {
            include 'include/modules.php';
        }
        //we need singular name here;
        $bean_name = get_singular_bean_name($bean_name);
        require_once $beanFiles[$bean_name];
        $module = new $bean_name();
        $mod_strings = return_module_language($current_language, $module_name);
        $currentModule = $module_name;
        ?>

var rel_defs = new Object();
var link_defs_<?php 
        echo $module_name;
        ?>
 = new Object();
<?php 
        $linked_fields = $module->get_linked_fields();
        foreach ($linked_fields as $linked_field) {
            $module->load_relationship($linked_field['name']);
            $field = $linked_field['name'];
            if (empty($module->{$field}) || isset($linked_field['reportable']) && $linked_field['reportable'] == false || empty($linked_field['relationship'])) {
                continue;
            }
            if (empty($relationships[$linked_field['relationship']])) {
                $relationships[$linked_field['relationship']] = $module->{$field}->relationship;
            }
            $vname = '';
            // To figure out the label, we will start with the least specific and move in from there
            if (!empty($linked_field['vname'])) {
                $vname = $linked_field['vname'];
            }
            // In order to get the correct label, we have to track down and see if there is a name field and use that for the label.
            foreach ($module->field_defs as $idx => $fieldDef) {
                if (!isset($fieldDef['link'])) {
                    continue;
                }
                if ($fieldDef['link'] != $linked_field['name']) {
                    continue;
                }
                if ($fieldDef['type'] == 'relate' && $fieldDef['rname'] == 'name' && !empty($fieldDef['vname'])) {
                    // This is the name field for the link field
                    $vname = $fieldDef['vname'];
                    break;
                }
            }
            if (!empty($vname)) {
                $linked_field['label'] = translate($vname);
                // Try the label from this side of the module
                if ($linked_field['label'] == $vname) {
                    $linked_field['label'] = translate($vname, $module->module_dir);
                }
                // How about from the other side
                if ($linked_field['label'] == $vname) {
                    $linked_field['label'] = translate($vname, $module->{$field}->getRelatedModuleName());
                }
            } else {
                $linked_field['label'] = $linked_field['name'];
            }
            $linked_field['label'] = preg_replace('/:$/', '', $linked_field['label']);
            $linked_field['label'] = addslashes($linked_field['label']);
            echo "link_defs_{$module_name}[ '{$linked_field['name']}' ] = " . json_encode(array('name' => $linked_field['name'], 'relationship_name' => $linked_field['relationship'], 'bean_is_lhs' => $module->{$field}->getSide() == REL_LHS, 'link_type' => $module->{$field}->getType(), 'label' => $linked_field['label'], 'module' => $module->{$field}->getRelatedModuleName())) . ";\n";
        }
        ?>
var field_defs_<?php 
        echo $module_name;
        ?>
 = new Object();
<?php 
        if (is_array($module->field_defs)) {
            $module->ACLFilterFieldList($module->field_defs, array("owner_override" => true));
            ksort($module->field_defs);
            if (isset($module->field_defs['team_set_id'])) {
                $module->field_defs['team_set_id']['type'] = 'team_set_id';
            }
            foreach ($module->field_defs as $field_def) {
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:templates_modules_def_js.php

示例8: crmdata

 function crmdata($session, $email)
 {
     global $dictionary;
     global $app_list_strings;
     global $current_user;
     global $beanList, $beanFiles;
     if (!self::$helperObject->checkSessionAndModuleAccess($session, 'invalid_session', 'Accounts', 'read', 'no_access', new SoapError())) {
         echo "No access";
         return;
     }
     $field_list = array();
     $config = new ZendeskWidgetConfig();
     foreach (query_module_access_list($current_user) as $module) {
         if ($object_name = $beanList[$module]) {
             $field_config = $config->getFields($module);
             if ($field_config != null && $field_config != '') {
                 $field_list[$object_name] = $field_config;
             }
         }
     }
     $root = new SimpleXMLElement('<records></records>');
     $ea = new EmailAddress();
     $beans = $ea->getBeansByEmailAddress($email);
     while ($bean = array_pop($beans)) {
         if (isset($field_list[$bean->object_name])) {
             $record = $root->addChild('record');
             $record->addChild('id', $bean->id);
             $record->addChild('url', htmlspecialchars("/index.php?module={$bean->module_dir}&action=DetailView&record={$bean->id}"));
             $record->addChild('label', $bean->name);
             $record->addChild('record_type', $bean->object_name);
             $fields = $record->addChild('fields');
             foreach (split(',', $field_list[$bean->object_name]) as $name) {
                 $field_meta = $dictionary[$bean->object_name]['fields'][$name];
                 if ($field_meta['type'] == 'relate') {
                     if ($field_meta['dbType'] == 'id') {
                         $beanType = get_singular_bean_name($field_meta['module']);
                         $newBean = $this->getBeanInstance($beanType);
                         $newBean->retrieve($bean->{$name});
                         $beans[] = $newBean;
                         continue;
                     }
                 }
                 $field = $fields->addChild('field');
                 $field->addChild('label', translate($field_meta['vname'], $bean->module_dir));
                 $value = $bean->{$name};
                 if ($field_meta['type'] == 'enum') {
                     $value = $app_list_strings[$field_meta['options']][$bean->{$name}];
                 }
                 $field->addChild('value', $value);
             }
         }
     }
     return $root->asXML();
 }
开发者ID:nunoabc,项目名称:Web2,代码行数:54,代码来源:SugarRestServiceImpl_v2_custom.php

示例9: queryOrderBy

 public function queryOrderBy($layout_def)
 {
     $field_def = $this->reporter->all_fields[$layout_def['column_key']];
     if (!empty($field_def['sort_on'])) {
         $order_by = $layout_def['table_alias'] . "." . $field_def['sort_on'];
     } else {
         $order_by = $this->_get_column_select($layout_def);
     }
     $list = array();
     if (isset($field_def['options'])) {
         $list = translate($field_def['options'], $field_def['module']);
     } elseif (isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) {
         global $beanFiles;
         if (empty($beanFiles)) {
             include 'include/modules.php';
         }
         $list = array();
         $checkedFunction = false;
         //use bean function if function and function bean have been specified
         if (!empty($field_def['function_bean'])) {
             $bean = BeanFactory::getBean($field_def['function_bean']);
             if (method_exists($bean, $field_def['function'])) {
                 $list = $bean->{$field_def}['function']();
                 $checkedFunction = true;
             }
         }
         //if list was not filled through a bean function, try method
         if (!$checkedFunction) {
             $bean_name = get_singular_bean_name($field_def['module']);
             require_once $beanFiles[$bean_name];
             $list = $field_def['function']();
         }
     }
     if (empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') {
         $order_dir = "ASC";
     } else {
         $order_dir = "DESC";
     }
     return $this->reporter->db->orderByEnum($order_by, $list, $order_dir);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:40,代码来源:SugarWidgetFieldenum.php


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