本文整理汇总了PHP中ExtraFields::getOptionalsFromPost方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtraFields::getOptionalsFromPost方法的具体用法?PHP ExtraFields::getOptionalsFromPost怎么用?PHP ExtraFields::getOptionalsFromPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtraFields
的用法示例。
在下文中一共展示了ExtraFields::getOptionalsFromPost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GETPOST
$info_bits = 0;
if (preg_match('/\\*/', $vat_rate)) {
$info_bits |= 0x1;
}
// Define vat_rate
$vat_rate = str_replace('*', '', $vat_rate);
$localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty);
$localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty);
// Add buying price
$fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : '');
$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : '');
// If buying_price is '0', we muste keep this value
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
foreach ($extralabelsline as $key => $value) {
unset($_POST["options_" . $key]);
}
}
// Define special_code for special lines
$special_code = GETPOST('special_code');
if (!GETPOST('qty')) {
$special_code = 3;
}
$line = new FactureLigne($db);
$line->fetch(GETPOST('lineid'));
$percent = $line->get_prev_progress();
示例2: ExtraFields
if ($search_type == '') {
$search_type = '1';
}
}
if ($type === '0') {
$contextpage = 'productlist';
if ($search_type == '') {
$search_type = '0';
}
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array($contextpage));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('product');
$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_');
if (empty($action)) {
$action = 'list';
}
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$canvas = GETPOST("canvas");
$objcanvas = null;
if (!empty($canvas)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php';
$objcanvas = new Canvas($db, $action);
$objcanvas->getCanvas('product', 'list', $canvas);
}
// Security check
if ($type == '0') {
$result = restrictedArea($user, 'produit', '', '', '', '', '', $objcanvas);
} else {
示例3: GETPOST
$j++;
$stockLocation = "ent1" . $i . "_" . $j;
$qty = "qtyl" . $i . '_' . $j;
}
} else {
var_dump($_POST);
var_dump($batch);
//shipment line for product with no batch management and no multiple stock location
if (GETPOST($qty, 'int') > 0) {
$totalqty += GETPOST($qty, 'int');
}
}
}
// Extrafields
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
foreach ($extralabelsline as $key => $value) {
unset($_POST["options_" . $key]);
}
}
}
//var_dump($batch_line[2]);
if ($totalqty > 0) {
//var_dump($_POST);exit;
for ($i = 0; $i < $num; $i++) {
$qty = "qtyl" . $i;
if (!isset($batch_line[$i])) {
// not batch mode