예제 #1
0
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// fetch optionals attributes lines and labels
$extralabelslines = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
// Load object. Make an object->fetch
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';
// Must be include, not include_once
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('expeditioncard', 'globalcard'));
$permissiondellink = $user->rights->expedition->livraison->creer;
// Used by the include of actions_dellink.inc.php
/*
 * Actions
 */
// Set incoterm
if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) {
    $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
}
if ($action == 'update_extras') {
    // Fill array 'array_options' with data from update form
    $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
    $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
    if ($ret < 0) {
        $error++;
    }
    if (!$error) {
        // Actions on extra fields (by external module or standard code)
        // TODO le hook fait double emploi avec le trigger !!
        $hookmanager->initHooks(array('expeditiondao'));
        $parameters = array('id' => $object->id);
        $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action);
        // Note that $action and $object may have been modified by some hooks