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


PHP Lead::fetch方法代码示例

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


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

示例1: fetchLeadLink

 /**
  * Load object in memory from database
  *
  * @param int $id ID
  * @param string $tablename Name of the table
  *
  * @return int if KO, >0 if OK
  */
 public function fetchLeadLink($id, $tablename)
 {
     global $langs;
     $this->doclines = array();
     $sql = "SELECT";
     $sql .= " t.rowid,";
     $sql .= " t.fk_source,";
     $sql .= " t.sourcetype,";
     $sql .= " t.fk_target,";
     $sql .= " t.targettype";
     $sql .= " FROM " . MAIN_DB_PREFIX . "element_element as t";
     $sql .= " WHERE t.fk_source = " . $id;
     $sql .= " AND t.targettype='lead'";
     if (!empty($tablename)) {
         $sql .= " AND t.sourcetype='" . $tablename . "'";
     }
     $sql .= " ORDER BY t.sourcetype";
     dol_syslog(get_class($this) . "::fetchDocumentLink sql=" . $sql, LOG_DEBUG);
     $resql = $this->db->query($sql);
     if ($resql) {
         while ($obj = $this->db->fetch_object($resql)) {
             $line = new Lead($this->db);
             $line->fetch($obj->fk_target);
             $this->doclines[] = $line;
         }
         $this->db->free($resql);
         return 1;
     } else {
         $this->error = "Error " . $this->db->lasterror();
         dol_syslog(get_class($this) . "::fetchDocumentLink " . $this->error, LOG_ERR);
         return -1;
     }
 }
开发者ID:BebZ,项目名称:lead,代码行数:41,代码来源:lead.class.php

示例2: setEventMessages

    $result = $usergroup->fetch($conf->global->LEAD_GRP_USER_AFFECT);
    if ($result < 0) {
        setEventMessages(null, $usergroup->errors, 'errors');
    }
    $includeuserlisttmp = $usergroup->listUsersForGroup();
    if (is_array($includeuserlisttmp) && count($includeuserlisttmp) > 0) {
        foreach ($includeuserlisttmp as $usertmp) {
            $includeuserlist[] = $usertmp->id;
        }
    }
}
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
if ($id > 0) {
    $ret = $object->fetch($id);
    if ($ret < 0) {
        setEventMessages(null, $object->errors, 'errors');
    }
    if ($ret > 0) {
        $ret = $object->fetch_thirdparty();
    }
    if ($ret < 0) {
        setEventMessages(null, $object->errors, 'errors');
    }
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('leadcard'));
/*
 * Actions
 */
开发者ID:BebZ,项目名称:lead,代码行数:31,代码来源:card.php

示例3: Lead

dol_include_once('/lead/class/lead.class.php');
$object = new Lead($db);
/*
 * Actions
 */
$tablename = GETPOST("tablename");
$leadid = GETPOST("leadid");
$elementselectid = GETPOST("elementselect");
$redirect = GETPOST('redirect', 'alpha');
$action = GETPOST('action');
if (empty($leadid) || $leadid == -1) {
    setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lead")), null, 'errors');
    $error++;
}
if (!$error) {
    $result = $object->fetch($leadid);
    if ($result < 0) {
        setEventMessages(null, $object->errors, 'errors');
        $error++;
    }
}
if (!$error) {
    if ($action == 'link') {
        $result = $object->add_object_linked($tablename, $elementselectid);
        if ($result < 0) {
            setEventMessages(null, $object->errors, 'errors');
        }
    }
    if ($action == 'unlink') {
        $sourceid = GETPOST('sourceid');
        $sourcetype = GETPOST('sourcetype');
开发者ID:ndrosis,项目名称:lead,代码行数:31,代码来源:manage_link.php

示例4: llxHeader

 llxHeader('', $langs->trans('Product'), 'EN:Commercial_Products|FR:Liste_des_produits|ES:Presupuestos');
 $id = GETPOST('id');
 $ref = GETPOST('ref');
 if ($id > 0 || !empty($ref)) {
     /*
      * Show object in view mode
      */
     if ($mesg) {
         if (!preg_match('/div class=/', $mesg)) {
             print '<div class="ok">' . $mesg . '</div><br>';
         } else {
             print $mesg . "<br>";
         }
     }
     $object = new Lead($db);
     $object->fetch($id, $ref);
     $soc = new Societe($db);
     $soc->fetch($object->socid);
     $head = lead_prepare_head($object);
     dol_fiche_head($head, 'category', $langs->trans('Products'), 0, 'lead');
     /*
      * Fiche Affaire
      *
      */
     print '<table class="border" width="100%">';
     $linkback = "<a href=\"product.php?page={$page}&socid={$socid}&viewstatut={$viewstatut}&sortfield={$sortfield}&{$sortorder}\">" . $langs->trans("BackToList") . "</a>";
     // Ref
     print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
     print $html->showrefnav($object, 'ref', '', 1, 'ref', 'ref', '');
     print '</td></tr>';
     $rowspan = 9;
开发者ID:nrjacker4,项目名称:crm-php,代码行数:31,代码来源:categorie.php

示例5: GETPOST

$page = GETPOST("page", 'int');
if ($page == -1) {
    $page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) {
    $sortorder = "ASC";
}
if (!$sortfield) {
    $sortfield = "name";
}
$object = new Lead($db);
if ($id > 0) {
    $ret = $object->fetch($id);
    if ($ret < 0) {
        setEventMessage($object->error, 'errors');
    }
    if ($ret > 0) {
        $ret = $object->fetch_thirdparty();
    }
    if ($ret < 0) {
        setEventMessage($object->error, 'errors');
    }
    $upload_dir = $conf->lead->dir_output . "/" . dol_sanitizeFileName($object->ref);
}
/*
 * Actions
 */
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
开发者ID:ndrosis,项目名称:lead,代码行数:31,代码来源:document.php

示例6: Lead

     if ($act->contact->id && $act->type_code == 'AC_TEL') {
         if ($act->contact->fetch($act->contact->id)) {
             print "<br>" . dol_print_phone($act->contact->phone_pro);
         }
     }
 } else {
     print $langs->trans("None");
 }
 print '</td></tr>';
 $var = !$var;
 // Lead
 if ($conf->lead->enabled && $act->fk_lead) {
     print '<tr ' . $bc[$var] . '><td valign="top" id="label">' . $langs->trans("Lead") . '</td><td colspan="1" id="value">';
     if ($act->fk_lead) {
         $lead = new Lead($db);
         $lead->fetch($act->fk_lead);
         print $lead->getNomUrl(1);
     }
     print '</td></tr>';
     $var = !$var;
 }
 // Project
 if ($conf->projet->enabled) {
     print '<tr><td valign="top">' . $langs->trans("Project") . '</td><td colspan="3">';
     if ($act->fk_project) {
         $project = new Project($db);
         $project->fetch($act->fk_project);
         print $project->getNomUrl(1);
     }
     print '</td></tr>';
     $var = !$var;
开发者ID:nrjacker4,项目名称:crm-php,代码行数:31,代码来源:fiche.php


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