當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。