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


PHP Dropdown::getdropdownname方法代码示例

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


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

示例1: plugin_projet_giveItem


//.........这里部分代码省略.........
            }
            return "";
            break;
        case 'PluginProjetTask':
            switch ($table . '.' . $field) {
                case "glpi_plugin_projet_tasks_tasks.plugin_projet_tasks_id_1":
                    $out = " ";
                    $split = explode("\$\$\$\$", $data["ITEM_" . $num]);
                    $split2 = explode("\$\$\$\$", $data["ITEM_" . $num . "_2"]);
                    $displayed = array();
                    for ($k = 0; $k < count($split); $k++) {
                        //$linkid = $split2[$k];
                        $linkid = $split[$k] == $data['id'] ? $split2[$k] : $split2[$k];
                        if ($linkid > 0 && $linkid != $data['id'] && !isset($displayed[$linkid])) {
                            $text = $linkid . " - " . Dropdown::getDropdownName('glpi_plugin_projet_tasks', $linkid);
                            if (count($displayed)) {
                                $out .= "<br>";
                            }
                            $displayed[$linkid] = $linkid;
                            $out .= $text;
                        }
                    }
                    return $out;
                    break;
                case "glpi_plugin_projet_tasks.advance":
                    $out = PluginProjetProjet::displayProgressBar('100', $data["ITEM_{$num}"]);
                    return $out;
                    break;
                case "glpi_plugin_projet_tasks.priority":
                    $out = Ticket::getPriorityName($data["ITEM_{$num}"]);
                    return $out;
                    break;
                case 'glpi_plugin_projet_tasks.depends':
                    $out = "";
                    if ($data["ITEM_{$num}"] == 1) {
                        $out .= "<span class='red'>";
                    }
                    $out .= Dropdown::getYesNo($data["ITEM_{$num}"]);
                    if ($data["ITEM_{$num}"] == 1) {
                        $out .= "</span>";
                    }
                    return $out;
                    break;
                case "glpi_plugin_projet_tasks.plugin_projet_projets_id":
                    $out = Dropdown::getdropdownname("glpi_plugin_projet_projets", $data["ITEM_{$num}"]);
                    $out .= " (" . $data["ITEM_{$num}"] . ")";
                    return $out;
                    break;
                case "glpi_plugin_projet_tasks_items.items_id":
                    $restrict = "`plugin_projet_tasks_id` = '" . $data['id'] . "' \n                           ORDER BY `itemtype`, `items_id`";
                    $items = getAllDatasFromTable("glpi_plugin_projet_tasks_items", $restrict);
                    $out = '';
                    if (!empty($items)) {
                        foreach ($items as $device) {
                            $item = new $device["itemtype"]();
                            $item->getFromDB($device["items_id"]);
                            $out .= $item->getTypeName() . " - " . $item->getLink() . "<br>";
                        }
                    }
                    return $out;
                    break;
                case "glpi_contacts.name":
                    if (!empty($data["ITEM_{$num}"])) {
                        $link = Toolbox::getItemTypeFormURL('Contact');
                        $out = "<a href=\"" . $link . "?id=" . $data["ITEM_{$num}"] . "\">";
                        $temp = $data["contacts_name"];
                        $firstname = $data["contacts_firstname"];
                        if (strlen($firstname) > 0) {
                            if ($CFG_GLPI["names_format"] == FIRSTNAME_BEFORE) {
                                $temp = $firstname . " " . $temp;
                            } else {
                                $temp .= " " . $firstname;
                            }
                        }
                        $out .= $temp;
                        if ($_SESSION["glpiis_ids_visible"] || empty($data["ITEM_{$num}"])) {
                            $out .= " (" . $data["ITEM_{$num}"] . ")";
                        }
                        $out .= "</a>";
                    } else {
                        $out = "";
                    }
                    return $out;
                    break;
                case "glpi_plugin_projet_taskplannings.id":
                    if (!empty($data["ITEM_{$num}"])) {
                        $plan = new PluginProjetTaskPlanning();
                        $plan->getFromDB($data["ITEM_{$num}"]);
                        $out = Html::convDateTime($plan->fields["begin"]) . "<br>&nbsp;->&nbsp;" . Html::convDateTime($plan->fields["end"]);
                    } else {
                        $out = __('None');
                    }
                    return $out;
                    break;
            }
            return "";
            break;
    }
    return "";
}
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:hook.php


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