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


PHP Societe::fetch_optionals方法代码示例

本文整理汇总了PHP中Societe::fetch_optionals方法的典型用法代码示例。如果您正苦于以下问题:PHP Societe::fetch_optionals方法的具体用法?PHP Societe::fetch_optionals怎么用?PHP Societe::fetch_optionals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Societe的用法示例。


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

示例1: getThirdParty

function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '')
{
    global $db, $conf, $langs;
    dol_syslog("Function: getThirdParty login=" . $authentication['login'] . " id=" . $id . " ref=" . $ref . " ref_ext=" . $ref_ext);
    if ($authentication['entity']) {
        $conf->entity = $authentication['entity'];
    }
    // Init and check authentication
    $objectresp = array();
    $errorcode = '';
    $errorlabel = '';
    $error = 0;
    $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
    // Check parameters
    if (!$error && ($id && $ref || $id && $ref_ext || $ref && $ref_ext)) {
        $error++;
        $errorcode = 'BAD_PARAMETERS';
        $errorlabel = "Parameter id, ref and ref_ext can't be both provided. You must choose one or other but not both.";
    }
    if (!$error) {
        $fuser->getrights();
        if ($fuser->rights->societe->lire) {
            $thirdparty = new Societe($db);
            $result = $thirdparty->fetch($id, $ref, $ref_ext);
            if ($result > 0) {
                $thirdparty_result_fields = array('id' => $thirdparty->id, 'ref' => $thirdparty->name, 'ref_ext' => $thirdparty->ref_ext, 'status' => $thirdparty->status, 'client' => $thirdparty->client, 'supplier' => $thirdparty->fournisseur, 'customer_code' => $thirdparty->code_client, 'supplier_code' => $thirdparty->code_fournisseur, 'customer_code_accountancy' => $thirdparty->code_compta, 'supplier_code_accountancy' => $thirdparty->code_compta_fournisseur, 'fk_user_author' => $thirdparty->fk_user_author, 'date_creation' => dol_print_date($thirdparty->date_creation, 'dayhourrfc'), 'date_modification' => dol_print_date($thirdparty->date_modification, 'dayhourrfc'), 'address' => $thirdparty->address, 'zip' => $thirdparty->zip, 'town' => $thirdparty->town, 'province_id' => $thirdparty->state_id, 'country_id' => $thirdparty->country_id, 'country_code' => $thirdparty->country_code, 'country' => $thirdparty->country, 'phone' => $thirdparty->phone, 'fax' => $thirdparty->fax, 'email' => $thirdparty->email, 'url' => $thirdparty->url, 'profid1' => $thirdparty->idprof1, 'profid2' => $thirdparty->idprof2, 'profid3' => $thirdparty->idprof3, 'profid4' => $thirdparty->idprof4, 'profid5' => $thirdparty->idprof5, 'profid6' => $thirdparty->idprof6, 'capital' => $thirdparty->capital, 'barcode' => $thirdparty->barcode, 'vat_used' => $thirdparty->tva_assuj, 'vat_number' => $thirdparty->tva_intra, 'note_private' => $thirdparty->note_private, 'note_public' => $thirdparty->note_public);
                //Retreive all extrafield for thirdsparty
                // fetch optionals attributes and labels
                $extrafields = new ExtraFields($db);
                $extralabels = $extrafields->fetch_name_optionals_label('societe', true);
                //Get extrafield values
                $thirdparty->fetch_optionals($thirdparty->id, $extralabels);
                foreach ($extrafields->attribute_label as $key => $label) {
                    $thirdparty_result_fields = array_merge($thirdparty_result_fields, array('options_' . $key => $thirdparty->array_options['options_' . $key]));
                }
                // Create
                $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'thirdparty' => $thirdparty_result_fields);
            } else {
                $error++;
                $errorcode = 'NOT_FOUND';
                $errorlabel = 'Object not found for id=' . $id . ' nor ref=' . $ref . ' nor ref_ext=' . $ref_ext;
            }
        } else {
            $error++;
            $errorcode = 'PERMISSION_DENIED';
            $errorlabel = 'User does not have permission for this request';
        }
    }
    if ($error) {
        $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
    }
    return $objectresp;
}
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:53,代码来源:server_thirdparty.php

示例2: Societe

         print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
         print '</center>';
         print '</form>';
         dol_fiche_end();
     }
 } else {
     /*
      * View
      */
     $object = new Societe($db);
     $res = $object->fetch($socid);
     if ($res < 0) {
         dol_print_error($db, $object->error);
         exit;
     }
     $res = $object->fetch_optionals($object->id, $extralabels);
     //if ($res < 0) { dol_print_error($db); exit; }
     $head = societe_prepare_head($object);
     dol_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
     // Confirm delete third party
     if ($action == 'delete' || $conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) {
         print $form->formconfirm($_SERVER["PHP_SELF"] . "?socid=" . $object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete");
     }
     dol_htmloutput_errors($error, $errors);
     $showlogo = $object->logo;
     $showbarcode = empty($conf->barcode->enabled) ? 0 : 1;
     if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
         $showbarcode = 0;
     }
     print '<table class="border" width="100%">';
     // Ref
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:31,代码来源:soc.php


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