本文整理汇总了PHP中CommonGLPI::canApprove方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonGLPI::canApprove方法的具体用法?PHP CommonGLPI::canApprove怎么用?PHP CommonGLPI::canApprove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonGLPI
的用法示例。
在下文中一共展示了CommonGLPI::canApprove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayTabContentForItem
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
{
switch ($item->getType()) {
case __CLASS__:
switch ($tabnum) {
case 1:
echo "<div class='timeline_box'>";
$rand = mt_rand();
$item->showTimelineForm($rand);
$item->showTimeline($rand);
echo "</div>";
break;
case 2:
if (!isset($_GET['load_kb_sol'])) {
$_GET['load_kb_sol'] = 0;
}
$item->showSolutionForm($_GET['load_kb_sol']);
if ($item->canApprove()) {
$fup = new TicketFollowup();
$fup->showApprobationForm($item);
}
break;
case 3:
$satisfaction = new TicketSatisfaction();
if ($item->fields['status'] == self::CLOSED && $satisfaction->getFromDB($_GET["id"])) {
$duration = Entity::getUsedConfig('inquest_duration', $item->fields['entities_id']);
$date2 = strtotime($satisfaction->fields['date_begin']);
if ($duration == 0 || strtotime("now") - $date2 <= $duration * DAY_TIMESTAMP) {
$satisfaction->showForm($item);
} else {
echo "<p class='center b'>" . __('Satisfaction survey expired') . "</p>";
}
} else {
echo "<p class='center b'>" . __('No generated survey') . "</p>";
}
break;
case 4:
$item->showStats();
break;
}
break;
case 'Group':
case 'SLT':
default:
self::showListForItem($item);
}
return true;
}
示例2: displayTabContentForItem
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
{
switch ($item->getType()) {
case __CLASS__:
switch ($tabnum) {
case 2:
if (!isset($_GET['load_kb_sol'])) {
$_GET['load_kb_sol'] = 0;
}
$item->showSolutionForm($_GET['load_kb_sol']);
if ($item->canApprove()) {
$fup = new TicketFollowup();
$fup->showApprobationForm($item);
}
break;
case 3:
$satisfaction = new TicketSatisfaction();
if ($item->fields['status'] == self::CLOSED && $satisfaction->getFromDB($_GET["id"])) {
$satisfaction->showForm($item);
} else {
echo "<p class='center b'>" . __('No generated survey') . "</p>";
}
break;
case 4:
$item->showStats();
break;
}
break;
case 'Group':
case 'SLA':
default:
self::showListForItem($item);
}
return true;
}