當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Supplier::getLink方法代碼示例

本文整理匯總了PHP中Supplier::getLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP Supplier::getLink方法的具體用法?PHP Supplier::getLink怎麽用?PHP Supplier::getLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Supplier的用法示例。


在下文中一共展示了Supplier::getLink方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: showForm


//.........這裏部分代碼省略.........
     if ($canedit) {
         PluginOrderOrderType::Dropdown(array('name' => "plugin_order_ordertypes_id", 'value' => $this->fields["plugin_order_ordertypes_id"]));
     } else {
         echo Dropdown::getDropdownName("glpi_plugin_order_ordertypes", $this->fields["plugin_order_ordertypes_id"]);
     }
     echo "</td></tr>";
     /* state */
     echo "<tr class='tab_bg_1'><td>" . __("Order status", "order") . ": </td>";
     echo "<td>";
     if (!$this->getID()) {
         $state = $config->getDraftState();
     } else {
         $state = $this->fields["plugin_order_orderstates_id"];
     }
     if ($canedit) {
         PluginOrderOrderState::Dropdown(array('name' => "plugin_order_orderstates_id", 'value' => $state));
     } else {
         echo Dropdown::getDropdownName("glpi_plugin_order_orderstates", $this->getState());
     }
     echo "</td>";
     /* budget */
     echo "<td>" . __("Budget") . ": </td>";
     echo "<td>";
     if ($canedit) {
         if ($config->canHideInactiveBudgets()) {
             $restrict = " (`end_date` IS NULL) OR (`end_date`> '" . date("Y-m-d") . "')";
         } else {
             $restrict = "";
         }
         Budget::Dropdown(array('name' => "budgets_id", 'value' => $this->fields["budgets_id"], 'entity' => $this->fields["entities_id"], 'comments' => true, 'condition' => $restrict, 'width' => '150px'));
     } else {
         $budget = new Budget();
         if ($this->fields["budgets_id"] > 0 && $budget->can($this->fields["budgets_id"], READ)) {
             echo $budget->getLink();
         } else {
             echo Dropdown::getDropdownName("glpi_budgets", $this->fields["budgets_id"]);
         }
     }
     echo "</td></tr>";
     /* location */
     echo "<tr class='tab_bg_1'><td>" . __("Delivery location", "order") . ": </td>";
     echo "<td>";
     if ($canedit) {
         Location::Dropdown(array('name' => "locations_id", 'value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
     } else {
         echo Dropdown::getDropdownName("glpi_locations", $this->fields["locations_id"]);
     }
     echo "</td>";
     /* payment */
     echo "<td>" . __("Payment conditions", "order") . ": </td><td>";
     if ($canedit) {
         PluginOrderOrderPayment::Dropdown(array('name' => "plugin_order_orderpayments_id", 'value' => $this->fields["plugin_order_orderpayments_id"]));
     } else {
         echo Dropdown::getDropdownName("glpi_plugin_order_orderpayments", $this->fields["plugin_order_orderpayments_id"]);
     }
     echo "</td>";
     echo "</tr>";
     /* supplier of order */
     echo "<tr class='tab_bg_1'><td>" . __("Supplier") . ": </td>";
     echo "<td>";
     if ($canedit && !$this->checkIfDetailExists($ID)) {
         $rand = mt_rand();
         Supplier::dropdown(array('name' => "suppliers_id", 'rand' => $rand, 'value' => $this->fields["suppliers_id"], 'entity' => $this->fields["entities_id"]));
         $params = array('suppliers_id' => '__VALUE__', 'fieldname' => 'contacts_id');
         Ajax::updateItemOnSelectEvent("dropdown_suppliers_id{$rand}", "show_contacts_id{$rand}", "../ajax/dropdownSupplier.php", $params);
     } else {
開發者ID:pluginsGLPI,項目名稱:order,代碼行數:67,代碼來源:order.class.php

示例3: 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

示例4: 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)
 {
     global $CFG_GLPI;
     $showsupplierlink = 0;
     if (Session::haveRight('contact_enterprise', 'r')) {
         $showsupplierlink = 1;
     }
     $suppliericon = self::getActorIcon('supplier', $type);
     $supplier = new Supplier();
     if (isset($this->suppliers[$type]) && count($this->suppliers[$type])) {
         foreach ($this->suppliers[$type] as $d) {
             $k = $d['suppliers_id'];
             echo "{$suppliericon}&nbsp;";
             if ($supplier->getFromDB($k)) {
                 echo $supplier->getLink(array('comments' => $showsupplierlink));
             }
             if ($canedit) {
                 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:gaforeror,項目名稱:glpi,代碼行數:34,代碼來源:commonitilobject.class.php

示例5: showForm

 public function showForm($ID, $options = array())
 {
     global $DB;
     $plugin_order_references_id = -1;
     if (isset($options['plugin_order_references_id'])) {
         $plugin_order_references_id = $options['plugin_order_references_id'];
     }
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     $PluginOrderReference = new PluginOrderReference();
     $PluginOrderReference->getFromDB($plugin_order_references_id);
     echo "<input type='hidden' name='plugin_order_references_id' value='{$plugin_order_references_id}'>";
     echo "<input type='hidden' name='entities_id' value='" . $PluginOrderReference->getEntityID() . "'>";
     echo "<input type='hidden' name='is_recursive' value='" . $PluginOrderReference->isRecursive() . "'>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __("Supplier") . ": </td>";
     echo "<td>";
     if ($ID > 0) {
         $supplier = new Supplier();
         $supplier->getFromDB($this->fields['suppliers_id']);
         echo $supplier->getLink(Session::haveRight('supplier', READ));
     } else {
         $suppliers = array();
         $query = "SELECT `suppliers_id`\n                     FROM `" . $this->getTable() . "`\n                     WHERE `plugin_order_references_id` = '{$plugin_order_references_id}'";
         $result = $DB->query($query);
         while ($data = $DB->fetch_array($result)) {
             $suppliers[] = $data["suppliers_id"];
         }
         Supplier::Dropdown(array('name' => 'suppliers_id', 'used' => $suppliers, 'entity' => $PluginOrderReference->getEntityID()));
     }
     echo "</td>";
     echo "<td>" . __("Manufacturer's product reference", "order") . ": </td>";
     echo "<td>";
     Html::autocompletionTextField($this, "reference_code");
     echo "</td></tr>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __("Unit price tax free", "order") . ": </td>";
     echo "<td>";
     echo "<input type='text' name='price_taxfree' value=\"" . Html::formatNumber($this->fields["price_taxfree"], true) . "\" size='7'>";
     echo "</td>";
     echo "<td></td>";
     echo "<td></td>";
     echo "</tr>";
     $options['candel'] = false;
     $this->showFormButtons($options);
     return true;
 }
開發者ID:korial29,項目名稱:order,代碼行數:48,代碼來源:reference_supplier.class.php

示例6: showForm


//.........這裏部分代碼省略.........
     } else {
         echo $this->fields["num_order"];
     }
     echo "</td>";
     /* type order */
     echo "<td>" . __("Type") . ": </td><td>";
     if ($canedit) {
         PluginOrderOrderType::Dropdown(array('name' => "plugin_order_ordertypes_id", 'value' => $this->fields["plugin_order_ordertypes_id"]));
     } else {
         echo Dropdown::getDropdownName("glpi_plugin_order_ordertypes", $this->fields["plugin_order_ordertypes_id"]);
     }
     echo "</td></tr>";
     /* state */
     echo "<tr class='tab_bg_1'><td>" . __("Order status", "order") . ": </td>";
     echo "<td>";
     if (!$this->getID()) {
         $state = $config->getDraftState();
     } else {
         $state = $this->fields["plugin_order_orderstates_id"];
     }
     if ($canedit) {
         PluginOrderOrderState::Dropdown(array('name' => "plugin_order_orderstates_id", 'value' => $state));
     } else {
         echo Dropdown::getDropdownName("glpi_plugin_order_orderstates", $this->getState());
     }
     echo "</td>";
     /* budget */
     echo "<td>" . __("Budget") . ": </td><td>";
     if ($canedit) {
         Budget::Dropdown(array('name' => "budgets_id", 'value' => $this->fields["budgets_id"], 'entity' => $this->fields["entities_id"], 'comments' => true));
     } else {
         $budget = new Budget();
         if ($this->fields["budgets_id"] > 0 && $budget->can($this->fields["budgets_id"], 'r')) {
             echo "<a href='" . $budget->getLinkURL() . "'>" . $budget->getName(1) . "</a>";
         } else {
             echo Dropdown::getDropdownName("glpi_budgets", $this->fields["budgets_id"]);
         }
     }
     echo "</td></tr>";
     /* location */
     echo "<tr class='tab_bg_1'><td>" . __("Delivery location", "order") . ": </td>";
     echo "<td>";
     if ($canedit) {
         Location::Dropdown(array('name' => "locations_id", 'value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
     } else {
         echo Dropdown::getDropdownName("glpi_locations", $this->fields["locations_id"]);
     }
     echo "</td>";
     /* payment */
     echo "<td>" . __("Payment conditions", "order") . ": </td><td>";
     if ($canedit) {
         PluginOrderOrderPayment::Dropdown(array('name' => "plugin_order_orderpayments_id", 'value' => $this->fields["plugin_order_orderpayments_id"]));
     } else {
         echo Dropdown::getDropdownName("glpi_plugin_order_orderpayments", $this->fields["plugin_order_orderpayments_id"]);
     }
     echo "</td>";
     echo "</tr>";
     /* supplier of order */
     echo "<tr class='tab_bg_1'><td>" . __("Supplier") . ": </td>";
     echo "<td>";
     if ($canedit && !$this->checkIfDetailExists($ID)) {
         $this->dropdownSuppliers("suppliers_id", $this->fields["suppliers_id"], $this->fields["entities_id"]);
     } else {
         $supplier = new Supplier();
         if ($supplier->can($this->fields['suppliers_id'], 'r')) {
             echo $supplier->getLink();
開發者ID:geldarr,項目名稱:hack-space,代碼行數:67,代碼來源:order.class.php


注:本文中的Supplier::getLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。