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

PHP getDBValidationData函数代码示例

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

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



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

示例1: vtEditExpressions

function vtEditExpressions($adb, $appStrings, $current_language, $theme, $formodule = '')
{
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $smarty = new vtigerCRM_Smarty();
    $smarty->assign('APP', $appStrings);
    $mod = array_merge(return_module_language($current_language, 'FieldFormulas'), return_module_language($current_language, 'Settings'));
    $jsStrings = array('NEED_TO_ADD_A' => $mod['NEED_TO_ADD_A'], 'CUSTOM_FIELD' => $mod['LBL_CUSTOM_FIELD'], 'LBL_USE_FUNCTION_DASHDASH' => $mod['LBL_USE_FUNCTION_DASHDASH'], 'LBL_USE_FIELD_VALUE_DASHDASH' => $mod['LBL_USE_FIELD_VALUE_DASHDASH'], 'LBL_DELETE_EXPRESSION_CONFIRM' => $mod['LBL_DELETE_EXPRESSION_CONFIRM']);
    $smarty->assign("JS_STRINGS", Zend_Json::encode($jsStrings));
    $smarty->assign("MOD", $mod);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $smarty->assign("MODULE_NAME", 'FieldFormulas');
    $smarty->assign("PAGE_NAME", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_TITLE", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_DESC", 'LBL_FIELDFORMULAS_DESCRIPTION');
    $smarty->assign("FORMODULE", $formodule);
    if (file_exists("modules/{$formodule}/{$formodule}.php")) {
        $focus = CRMEntity::getInstance($formodule);
        $validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, getTabid($formodule)));
        $smarty->assign('VALIDATION_DATA_FIELDNAME', $validationArray['fieldname']);
        $smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']);
        $smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']);
    }
    $smarty->display(vtlib_getModuleTemplate('FieldFormulas', 'EditExpressions.tpl'));
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:26,代码来源:editexpressions.php


示例2: vtlib_purify

    $smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action']));
} else {
    $smarty->assign("RETURN_ACTION", "index");
}
if (isset($_REQUEST['return_id'])) {
    $smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id']));
}
if (isset($_REQUEST['return_viewname'])) {
    $smarty->assign("RETURN_VIEWNAME", vtlib_purify($_REQUEST['return_viewname']));
}
$smarty->assign("UPLOADSIZE", $upload_maxsize / 1000000);
//Convert to MB
$smarty->assign("UPLOAD_MAXSIZE", $upload_maxsize);
// Field Validation Information
$tabid = getTabid($currentModule);
$validationData = getDBValidationData($focus->tab_name, $tabid);
$validationArray = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME", $validationArray['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE", $validationArray['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL", $validationArray['fieldlabel']);
// In case you have a date field
$smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
$smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if ($focus->mode != 'edit' && $mod_seq_field != null) {
    $autostr = getTranslatedString('MSG_AUTO_GEN_ON_SAVE');
    $mod_seq_string = $adb->pquery("SELECT prefix, cur_id from vtiger_modentity_num where semodule = ? and active=1", array($currentModule));
    $mod_seq_prefix = $adb->query_result($mod_seq_string, 0, 'prefix');
    $mod_seq_no = $adb->query_result($mod_seq_string, 0, 'cur_id');
    if ($adb->num_rows($mod_seq_string) == 0 || $focus->checkModuleSeqNumber($focus->table_name, $mod_seq_field['column'], $mod_seq_prefix . $mod_seq_no)) {
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:EditView.php


示例3: getModuleSequenceField

$mod_seq_field = getModuleSequenceField($currentModule);
if ($mod_seq_field != null) {
    $mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
} else {
    $mod_seq_id = $focus->id;
}
$smarty->assign('MOD_SEQ_ID', $mod_seq_id);
//Added to display the Tax informations
$tax_details = getTaxDetailsForProduct($focus->id);
for ($i = 0; $i < count($tax_details); $i++) {
    $tax_details[$i]['percentage'] = getProductTaxPercentage($tax_details[$i]['taxname'], $focus->id);
}
$smarty->assign("TAX_DETAILS", $tax_details);
$price_details = getPriceDetailsForProduct($focus->id, $focus->unit_price, 'available_associated', $currentModule);
$smarty->assign('PRICE_DETAILS', $price_details);
$validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, $tabid));
$smarty->assign('VALIDATION_DATA_FIELDNAME', $validationArray['fieldname']);
$smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']);
$smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']);
$smarty->assign('EDIT_PERMISSION', isPermitted($currentModule, 'EditView', $record));
$smarty->assign('CHECK', $tool_buttons);
if (PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule . '_listquery'])) {
    $recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
    VT_detailViewNavigation($smarty, $recordNavigationInfo, $focus->id);
}
$smarty->assign('IS_REL_LIST', isPresentRelatedLists($currentModule));
$smarty->assign('SinglePane_View', $singlepane_view);
if ($singlepane_view == 'true') {
    $related_array = getRelatedLists($currentModule, $focus);
    $smarty->assign("RELATEDLISTS", $related_array);
    require_once 'include/ListView/RelatedListViewSession.php';
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:DetailView.php


示例4: array

        $buttons = "<input title='" . $app_strings['LBL_DELETE_BUTTON_TITLE'] . "' accessKey='" . $app_strings['LBL_DELETE_BUTTON_KEY'] . "' class='classBtn' onclick=\"deleteUser('{$focus->id}')\" type='button' name='Delete' value='  " . $app_strings['LBL_DELETE_BUTTON_LABEL'] . "  '>";
        $smarty->assign('DELETE_BUTTON', $buttons);
    }
    if ($_SESSION['authenticated_user_roleid'] == 'administrator') {
        $buttons = "<input title='" . $app_strings['LBL_LISTROLES_BUTTON_TITLE'] . "' accessKey='" . $app_strings['LBL_LISTROLES_BUTTON_KEY'] . "' class='classBtn' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='TabCustomise'; this.form.action.value='listroles'; this.form.record.value= '" . $current_user->id . "'\" type='submit' name='ListRoles' value=' " . $app_strings['LBL_LISTROLES_BUTTON_LABEL'] . " '>";
        $smarty->assign('LISTROLES_BUTTON', $buttons);
    }
}
if (is_admin($current_user)) {
    $smarty->assign("IS_ADMIN", true);
} else {
    $smarty->assign("IS_ADMIN", false);
}
$lead_tables = array('vtiger_users', 'vtiger_user2role');
$tabid = getTabid("Users");
$validationData = getDBValidationData($lead_tables, $tabid);
$data = split_validationdataArray($validationData);
if ($current_user->id == $_REQUEST['record'] || is_admin($current_user) == true) {
    $smarty->assign("VALIDATION_DATA_FIELDNAME", $data['fieldname']);
    $smarty->assign("VALIDATION_DATA_FIELDDATATYPE", $data['datatype']);
    $smarty->assign("VALIDATION_DATA_FIELDLABEL", $data['fieldlabel']);
    $smarty->assign("MODULE", 'Users');
    $smarty->assign("CURRENT_USERID", $current_user->id);
    $smarty->assign("HOMEORDER", $focus->getHomeStuffOrder($focus->id));
    //Added to provide User based Tagcloud
    $smarty->assign("TAGCLOUDVIEW", getTagCloudView($focus->id));
    $smarty->assign("BLOCKS", getBlocks($currentModule, "detail_view", '', $focus->column_fields));
    $smarty->assign("USERNAME", $focus->last_name . ' ' . $focus->first_name);
    $smarty->assign("HOUR_FORMAT", $focus->hour_format);
    $smarty->assign("START_HOUR", $focus->start_hour);
    $_SESSION['Users_FORM_TOKEN'] = rand(5, 2000) * rand(2, 7);
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:DetailView.php


示例5: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
         //While Duplicating record, If the related record is deleted then we are removing related record info in record model
         $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels();
         foreach ($mandatoryFieldModels as $fieldModel) {
             if ($fieldModel->isReferenceField()) {
                 $fieldName = $fieldModel->get('name');
                 if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) {
                     $recordModel->set($fieldName, '');
                 }
             }
         }
     } else {
         if (!empty($record)) {
             $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $viewer->assign('MODE', '');
         }
     }
     if (!$this->record) {
         $this->record = $recordModel;
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         $specialField = false;
         // We collate date and time part together in the EditView UI handling
         // so a bit of special treatment is required if we come from QuickCreate
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) {
             $specialField = true;
             // Convert the incoming user-picked time to GMT time
             // which will get re-translated based on user-time zone on EditForm
             $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i");
         }
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) {
             $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']);
             $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime);
             list($startDate, $startTime) = explode(' ', $startDateTime);
             $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate);
         }
         if ($fieldModel->isEditable() || $specialField) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     // SalesPlatform.ru begin Unifying method for EditView preparing
     $recordModel = prepareEditView($recordModel, $_REQUEST, $viewer);
     // SalesPlatform.ru end
     // SalesPlatform.ru begin Set company
     if ($request->get('relationOperation')) {
         $sourceRecordModel = Vtiger_Record_Model::getInstanceById($request->get('sourceRecord'));
         if ($sourceRecordModel->get('spcompany') != null && $sourceRecordModel->get('spcompany') != '') {
             if ($recordModel->getField('spcompany')) {
                 $recordModel->set('spcompany', $sourceRecordModel->get('spcompany'));
             }
         }
     }
     // SalesPlatform.ru end
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     // SalesPlatform.ru begin Field Validation Information
     $tabid = getTabid($moduleName);
     $validationData = getDBValidationData($recordModel->get('tab_name'), $tabid);
     $validationArray = split_validationdataArray($validationData);
     $viewer->assign("VALIDATION_DATA_FIELDNAME", $validationArray['fieldname']);
     $viewer->assign("VALIDATION_DATA_FIELDDATATYPE", $validationArray['datatype']);
     $viewer->assign("VALIDATION_DATA_FIELDLABEL", $validationArray['fieldlabel']);
     $viewer->assign('ID', $record);
     // SalesPlatform.ru end
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     // SalesPlatform.ru begin enable/disable button Import
     $instance = Vtiger_Module::getInstance('SPSocialConnector');
     $fl_import_button = true;
     if (empty($record) || $instance->presence == 1) {
         $fl_import_button = false;
     }
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:101,代码来源:Edit.php


示例6: process


//.........这里部分代码省略.........
         $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
         $viewer->assign('MODE', '');
         //The creation of Inventory record from action and Related list of product/service detailview the product/service details will calculated by following code
         if ($request->get('product_id') || $sourceModule === 'Products') {
             if ($sourceRecord) {
                 $productRecordModel = Products_Record_Model::getInstanceById($sourceRecord);
             } else {
                 $productRecordModel = Products_Record_Model::getInstanceById($request->get('product_id'));
             }
             $relatedProducts = $productRecordModel->getDetailsForInventoryModule($recordModel);
         } elseif ($request->get('service_id') || $sourceModule === 'Services') {
             if ($sourceRecord) {
                 $serviceRecordModel = Services_Record_Model::getInstanceById($sourceRecord);
             } else {
                 $serviceRecordModel = Services_Record_Model::getInstanceById($request->get('service_id'));
             }
             $relatedProducts = $serviceRecordModel->getDetailsForInventoryModule($recordModel);
         } elseif ($sourceRecord && ($sourceModule === 'Accounts' || $sourceModule === 'Contacts' || $sourceModule === 'Potentials' || $sourceModule === 'Vendors' && $moduleName === 'PurchaseOrder')) {
             $parentRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecord, $sourceModule);
             $recordModel->setParentRecordData($parentRecordModel);
         }
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     //get the inventory terms and conditions
     $inventoryRecordModel = Inventory_Record_Model::getCleanInstance($moduleName);
     $termsAndConditions = $inventoryRecordModel->getInventoryTermsandConditions();
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     // SalesPlatform.ru begin Set default invoice status for SalesOrder
     if ($moduleName == "SalesOrder") {
         if (empty($record)) {
             $recordModel->set("invoicestatus", "AutoCreated");
         } else {
             $checkbox = $recordModel->get("enable_recurring");
             if ($checkbox != 1) {
                 $recordModel->set("invoicestatus", "AutoCreated");
             }
         }
     }
     // SalesPlatform.ru end
     // SalesPlatform.ru begin Unifying method for EditView preparing
     $recordModel = prepareEditView($recordModel, $_REQUEST, $viewer);
     // SalesPlatform.ru end
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     // SalesPlatform.ru begin Field Validation Information
     $tabid = getTabid($moduleName);
     $validationData = getDBValidationData($recordModel->get('tab_name'), $tabid);
     $validationArray = split_validationdataArray($validationData);
     $viewer->assign("VALIDATION_DATA_FIELDNAME", $validationArray['fieldname']);
     $viewer->assign("VALIDATION_DATA_FIELDDATATYPE", $validationArray['datatype']);
     $viewer->assign("VALIDATION_DATA_FIELDLABEL", $validationArray['fieldlabel']);
     $viewer->assign('ID', $record);
     // SalesPlatform.ru end
     $viewer->assign('VIEW_MODE', "fullForm");
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     //SalesPlatform.ru begin add relation create for Act from Invoice
     $isFromInvoiceCreate = $request->get('convertFromInvoice');
     $viewer->assign('IS_FROM_INVOICE_CREATE', $isFromInvoiceCreate);
     //SalesPlatform.ru end
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     //SalesPlatform.ru begin add relation create for Act from Invoice
     if ($isRelationOperation || $isFromInvoiceCreate) {
         //if($isRelationOperation)
         //SalesPlatform.ru end
         $viewer->assign('SOURCE_MODULE', $sourceModule);
         $viewer->assign('SOURCE_RECORD', $sourceRecord);
     }
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $viewer->assign('IS_DUPLICATE', true);
     } else {
         $viewer->assign('IS_DUPLICATE', false);
     }
     $currencies = Inventory_Module_Model::getAllCurrencies();
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('RELATED_PRODUCTS', $relatedProducts);
     $viewer->assign('SHIPPING_TAXES', $shippingTaxes);
     $viewer->assign('TAXES', $taxes);
     $viewer->assign('CURRENCINFO', $currencyInfo);
     $viewer->assign('CURRENCIES', $currencies);
     $viewer->assign('TERMSANDCONDITIONS', $termsAndConditions);
     $productModuleModel = Vtiger_Module_Model::getInstance('Products');
     $viewer->assign('PRODUCT_ACTIVE', $productModuleModel->isActive());
     $serviceModuleModel = Vtiger_Module_Model::getInstance('Services');
     $viewer->assign('SERVICE_ACTIVE', $serviceModuleModel->isActive());
     $viewer->view('EditView.tpl', 'Inventory');
 }
开发者ID:Wasage,项目名称:werpa,代码行数:101,代码来源:Edit.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getData函数代码示例发布时间:2022-05-15
下一篇:
PHP getDBConnection函数代码示例发布时间: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