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


PHP Lead::fetchLeadLink方法代码示例

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


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

示例1: addMoreActionsButtons

 /**
  * addMoreActionsButtons Method Hook Call
  *
  * @param string[] $parameters parameters
  * @param CommonObject $object Object to use hooks on
  * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
  * @param HookManager $hookmanager class instance
  * @return void
  */
 function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
 {
     global $langs, $conf, $user, $db, $bc;
     $current_context = explode(':', $parameters['context']);
     if (in_array('commcard', $current_context)) {
         $langs->load("lead@lead");
         if ($user->rights->lead->write) {
             $html = '<div class="inline-block divButAction"><a class="butAction" href="' . dol_buildpath('/lead/lead/card.php', 1) . '?action=create&socid=' . $object->id . '">' . $langs->trans('LeadCreate') . '</a></div>';
         } else {
             $html = '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('LeadCreate') . '</a></div>';
         }
         $html = str_replace('"', '\\"', $html);
         print '<script type="text/javascript">jQuery(document).ready(function () {jQuery(function() {jQuery(".tabsAction").append("' . $html . '");});});</script>';
         if ($user->rights->lead->read) {
             require_once 'lead.class.php';
             $lead = new Lead($db);
             $filter['so.rowid'] = $object->id;
             $resql = $lead->fetch_all('DESC', 't.date_closure', 0, 0, $filter);
             if ($resql == -1) {
                 setEventMessages(null, $object->errors, 'errors');
             }
             $total_lead = count($lead->lines);
             // $filter['so.rowid'] = $object->id;
             $resql = $lead->fetch_all('DESC', 't.date_closure', 4, 0, $filter);
             if ($resql == -1) {
                 setEventMessages(null, $object->errors, 'errors');
             }
             $num = count($lead->lines);
             $html = '<table class="noborder" width="100%">';
             $html .= '<tr class="liste_titre">';
             $html .= '<td colspan="6">';
             $html .= '<table width="100%" class="nobordernopadding"><tr><td>' . $langs->trans("LeadLastLeadUpdated", $num <= 4 ? $num : 4) . '</td><td align="right"><a href="' . dol_buildpath('/lead/lead/list.php', 1) . '?socid=' . $object->id . '">' . $langs->trans("LeadList") . ' (' . $total_lead . ')</a></td>';
             $html .= '<td width="20px" align="right"><a href="' . dol_buildpath('/lead/index.php', 1) . '">' . img_picto($langs->trans("Statistics"), 'stats') . '</a></td>';
             $html .= '</tr></table></td>';
             $html .= '</tr>';
             foreach ($lead->lines as $lead_line) {
                 $var = !$var;
                 $html .= '<tr ' . $bc[$var] . '>';
                 $html .= '<td>' . $lead_line->getNomUrl(1) . '</td>';
                 $html .= '<td>' . $lead_line->ref_int . '</td>';
                 $html .= '<td>' . $lead_line->type_label . '</td>';
                 $html .= '<td>' . price($lead_line->amount_prosp) . ' ' . $langs->getCurrencySymbol($conf->currency) . '</td>';
                 $html .= '<td>' . dol_print_date($lead_line->date_closure, 'daytextshort') . '</td>';
                 $html .= '<td>' . $lead_line->getLibStatut(2) . '</td>';
                 $html .= '</tr>';
             }
             $html .= '</table>';
             $html = str_replace('"', '\\"', $html);
             print '<script type="text/javascript">jQuery(document).ready(function () {jQuery(function() {jQuery(".ficheaddleft").append("' . $html . '");});});</script>';
         }
     }
     if (in_array('propalcard', $current_context)) {
         require_once 'lead.class.php';
         $lead = new Lead($db);
         $ret = $lead->fetchLeadLink($object->rowid ? $id = $object->rowid : $object->id, $object->table_element);
         if ($ret < 0) {
             setEventMessages(null, $lead->errors, 'errors');
         }
         if (count($lead->doclines) == 0) {
             $langs->load("lead@lead");
             if ($user->rights->lead->write) {
                 $html = '<div class="inline-block divButAction"><a class="butAction" href="' . dol_buildpath('/lead/lead/card.php', 1) . '?action=create&amp;socid=' . $object->socid . '&amp;amount_guess=' . $object->total_ht . '&amp;propalid=' . $object->id . '">' . $langs->trans('LeadCreate') . '</a></div>';
             } else {
                 $html = '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('LeadCreate') . '</a></div>';
             }
             $html = str_replace('"', '\\"', $html);
             print '<script type="text/javascript">jQuery(document).ready(function () {jQuery(function() {jQuery(".tabsAction").append("' . $html . '");});});</script>';
         }
     }
 }
开发者ID:BebZ,项目名称:lead,代码行数:79,代码来源:actions_lead.class.php


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