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


PHP Supplier::getTable方法代码示例

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


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

示例1: showSuppliersAssociated

 /**
  * show suppliers associated
  *
  * @since version 0.84
  *
  * @param $type      integer : user type
  * @param $canedit   boolean : can edit ?
  * @param $options   array    options for default values ($options of showForm)
  *
  * @return nothing display
  **/
 function showSuppliersAssociated($type, $canedit, array $options = array())
 {
     global $CFG_GLPI;
     $showsupplierlink = 0;
     if (Session::haveRight('contact_enterprise', READ)) {
         $showsupplierlink = 2;
     }
     $suppliericon = self::getActorIcon('supplier', $type);
     $supplier = new Supplier();
     $linksupplier = new $this->supplierlinkclass();
     $itemtype = $this->getType();
     $typename = self::getActorFieldNameType($type);
     $candelete = true;
     $mandatory = '';
     // For ticket templates : mandatories
     if ($itemtype == 'Ticket' && isset($options['_tickettemplate'])) {
         $mandatory = $options['_tickettemplate']->getMandatoryMark("_suppliers_id_" . $typename);
         if ($options['_tickettemplate']->isMandatoryField("_suppliers_id_" . $typename) && isset($this->suppliers[$type]) && count($this->suppliers[$type]) == 1) {
             $candelete = false;
         }
     }
     if (isset($this->suppliers[$type]) && count($this->suppliers[$type])) {
         foreach ($this->suppliers[$type] as $d) {
             $k = $d['suppliers_id'];
             echo "{$mandatory}{$suppliericon} ";
             if ($supplier->getFromDB($k)) {
                 echo $supplier->getLink(array('comments' => $showsupplierlink));
                 echo " ";
                 $tmpname = Dropdown::getDropdownName($supplier->getTable(), $k, 1);
                 Html::showToolTip($tmpname['comment']);
                 if ($CFG_GLPI['use_mailing']) {
                     $text = __('Email followup') . "&nbsp;" . Dropdown::getYesNo($d['use_notification']) . '<br>';
                     if ($d['use_notification']) {
                         $supemail = $d['alternative_email'];
                         if (empty($supemail)) {
                             $supemail = $supplier->fields['email'];
                         }
                         $text .= sprintf(__('%1$s: %2$s'), __('Email'), $supemail);
                     }
                     echo "&nbsp;";
                     if ($canedit) {
                         $opt = array('img' => $CFG_GLPI['root_doc'] . '/pics/edit.png', 'popup' => $linksupplier->getFormURL() . "?id=" . $d['id']);
                         Html::showToolTip($text, $opt);
                     }
                 }
             }
             if ($canedit && $candelete) {
                 echo "&nbsp;";
                 Html::showSimpleForm($linksupplier->getFormURL(), 'delete', _x('button', 'Delete permanently'), array('id' => $d['id']), $CFG_GLPI["root_doc"] . "/pics/delete.png");
             }
             echo '<br>';
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:65,代码来源:commonitilobject.class.php

示例2: showSuppliersAssociated

 /**
  * show suppliers associated
  *
  * @since version 0.84
  *
  * @param $type      integer : user type
  * @param $canedit   boolean : can edit ?
  *
  * @return nothing display
  **/
 function showSuppliersAssociated($type, $canedit, array $options = array())
 {
     global $CFG_GLPI;
     $showsupplierlink = 0;
     if (Session::haveRight('contact_enterprise', 'r')) {
         $showsupplierlink = 1;
     }
     $suppliericon = self::getActorIcon('supplier', $type);
     $supplier = new Supplier();
     $itemtype = $this->getType();
     $typename = self::getActorFieldNameType($type);
     $candelete = true;
     $mandatory = '';
     // For ticket templates : mandatories
     if ($itemtype == 'Ticket' && isset($options['_tickettemplate'])) {
         $mandatory = $options['_tickettemplate']->getMandatoryMark("_suppliers_id_" . $typename);
         if ($options['_tickettemplate']->isMandatoryField("_suppliers_id_" . $typename) && isset($this->suppliers[$type]) && count($this->suppliers[$type]) == 1) {
             $candelete = false;
         }
     }
     if (isset($this->suppliers[$type]) && count($this->suppliers[$type])) {
         foreach ($this->suppliers[$type] as $d) {
             $k = $d['suppliers_id'];
             echo "{$mandatory}{$suppliericon}&nbsp;";
             if ($supplier->getFromDB($k)) {
                 echo $supplier->getLink(array('comments' => $showsupplierlink));
                 echo "&nbsp;";
                 $tmpname = Dropdown::getDropdownName($supplier->getTable(), $k, 1);
                 Html::showToolTip($tmpname['comment']);
             }
             if ($canedit && $candelete) {
                 echo "&nbsp;";
                 Html::showSimpleForm($this->getFormURL(), 'delete_supplier', _x('button', 'Delete permanently'), array('id' => $d['id'], $this->getForeignKeyField() => $this->fields['id']), $CFG_GLPI["root_doc"] . "/pics/delete.png");
             }
             echo '<br>';
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:48,代码来源:commonitilobject.class.php


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