本文整理汇总了PHP中Dropdown::showTimeStamp方法的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown::showTimeStamp方法的具体用法?PHP Dropdown::showTimeStamp怎么用?PHP Dropdown::showTimeStamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dropdown
的用法示例。
在下文中一共展示了Dropdown::showTimeStamp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displaySpecificTypeField
/**
* @see CommonDropdown::displaySpecificTypeField()
**/
function displaySpecificTypeField($ID, $field = array())
{
switch ($field['type']) {
case 'actiontime':
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * HOUR_TIMESTAMP;
}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
break;
}
}
示例2: getCentral
//.........这里部分代码省略.........
printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getNameID());
} else {
_e('General');
}
}
echo $tt->getEndHiddenFieldValue('itemtype', $ticket);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<th>" . sprintf(__('%1$s%2$s'), __('Priority'), $tt->getMandatoryMark('priority')) . "</th>";
echo "<td>";
$idajax = 'change_priority_' . mt_rand();
if ($canupdate && $canpriority && !$tt->isHiddenField('priority')) {
$idpriority = Ticket::dropdownPriority(array('value' => $ticket->fields["priority"], 'withmajor' => true));
echo " <span id='{$idajax}' style='display:none'></span>";
} else {
$idpriority = 0;
echo "<span id='{$idajax}'>" . Ticket::getPriorityName($ticket->fields["priority"]) . "</span>";
}
if ($canupdate || $canupdate_descr) {
$params = array('urgency' => '__VALUE0__', 'impact' => '__VALUE1__', 'priority' => $idpriority);
Ajax::updateItemOnSelectEvent(array($idurgency, $idimpact), $idajax, $CFG_GLPI["root_doc"] . "/ajax/priority.php", $params);
}
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
// Need comment right to add a followup with the actiontime
if (!$ID && Session::haveRight("global_add_followups", "1")) {
echo "<th>" . $tt->getBeginHiddenFieldText('actiontime');
printf(__('%1$s%2$s'), __('Total duration'), $tt->getMandatoryMark('actiontime'));
echo $tt->getEndHiddenFieldText('actiontime') . "</th>";
echo "<td>";
echo $tt->getBeginHiddenFieldValue('actiontime');
Dropdown::showTimeStamp('actiontime', array('value' => $values['actiontime'], 'addfirstminutes' => true));
echo $tt->getEndHiddenFieldValue('actiontime', $ticket);
echo "</td>";
} else {
echo "<th></th><td></td>";
}
echo "<th>" . $tt->getBeginHiddenFieldText('locations_id');
printf(__('%1$s%2$s'), __('Location'), $tt->getMandatoryMark('locations_id'));
echo $tt->getEndHiddenFieldText('locations_id') . "</th>";
echo "<td>";
echo $tt->getBeginHiddenFieldValue('locations_id');
if ($canupdate) {
Location::dropdown(array('value' => $ticket->fields['locations_id'], 'entity' => $ticket->fields['entities_id']));
} else {
echo Dropdown::getDropdownName('glpi_locations', $ticket->fields["locations_id"]);
}
echo $tt->getEndHiddenFieldValue('locations_id', $ticket);
echo "</td></tr>";
echo "</table>";
if ($ID) {
$values['canupdate'] = $canupdate;
$ticket->showActorsPartForm($ID, $values);
}
$view_linked_tickets = $ID || $canupdate;
echo "<table class='tab_cadre_fixe' id='mainformtable4'>";
echo "<tr class='tab_bg_1'>";
echo "<th width='{$colsize1}%'>" . $tt->getBeginHiddenFieldText('name');
printf(__('%1$s%2$s'), __('Title'), $tt->getMandatoryMark('name'));
echo $tt->getEndHiddenFieldText('name') . "</th>";
echo "<td width='" . (100 - $colsize1) . "%' colspan='3'>";
if (!$ID || $canupdate_descr) {
echo $tt->getBeginHiddenFieldValue('name');
$rand = mt_rand();
示例3: showForm
/**
* Print the rssfeed form
*
* @param $ID integer Id of the item to print
* @param $options array of possible options:
* - target filename : where to go when done.
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
// Test _rss cache directory. I permission trouble : unable to edit
if (Toolbox::testWriteAccessToDirectory(GLPI_RSS_DIR) > 0) {
echo "<div class='center'>";
printf(__('Check permissions to the directory: %s'), GLPI_RSS_DIR);
echo "<p class='red b'>" . __('Error') . "</p>";
echo "</div>";
return false;
}
$this->initForm($ID, $options);
$canedit = $this->can($ID, UPDATE);
$this->showFormHeader($options);
$rowspan = 4;
if (!$this->isNewID($ID)) {
// Force getting feed :
$feed = self::getRSSFeed($this->fields['url'], $this->fields['refresh_rate']);
if (!$feed || $feed->error()) {
$this->setError(true);
} else {
$this->setError(false);
}
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name", array('entity' => -1, 'user' => $this->fields["users_id"]));
echo "</td><td colspan ='2'> </td></tr>\n";
}
echo "<tr class='tab_bg_1'><td>" . __('URL') . "</td>";
echo "<td colspan='3'>";
echo "<input type='text' name='url' size='100' value='" . $this->fields["url"] . "'>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('By') . "</td>";
echo "<td>";
echo getUserName($this->fields["users_id"]);
echo "<input type='hidden' name='users_id' value='" . $this->fields['users_id'] . "'>\n";
echo "</td>";
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}' class='middle'>";
echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Active') . "</td>";
echo "<td>";
Dropdown::showYesNo('is_active', $this->fields['is_active']);
echo "</td></tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Refresh rate') . "</td>";
echo "<td>";
Dropdown::showTimeStamp("refresh_rate", array('value' => $this->fields["refresh_rate"], 'min' => HOUR_TIMESTAMP, 'max' => DAY_TIMESTAMP, 'step' => HOUR_TIMESTAMP, 'display_emptychoice' => false, 'toadd' => array(5 * MINUTE_TIMESTAMP, 15 * MINUTE_TIMESTAMP, 30 * MINUTE_TIMESTAMP, 45 * MINUTE_TIMESTAMP)));
echo "</td></tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Number of items displayed') . "</td>";
echo "<td>";
Dropdown::showNumber("max_items", array('value' => $this->fields["max_items"], 'min' => 5, 'max' => 100, 'step' => 5, 'toadd' => array(1), 'display_emptychoice' => false));
echo "</td></tr>\n";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Error retrieving RSS feed') . "</td>";
echo "<td>";
echo Dropdown::getYesNo($this->fields['have_error']);
echo "</td>";
if ($this->fields['have_error']) {
echo "<td>" . __('RSS feeds found');
echo "</td><td>";
$this->showDiscoveredFeeds();
echo "</td>\n";
} else {
echo "<td colspan='2'> </td>";
}
echo "</tr>";
$this->showFormButtons($options);
return true;
}
示例4: showForm
/**
* Display for reservation
*
* @param $ID ID of the reservation (empty for create new)
* @param $options array of possibles options:
* - item reservation items ID for creation process
* - date date for creation process
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
if (!Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
return false;
}
$resa = new self();
if (!empty($ID)) {
if (!$resa->getFromDB($ID)) {
return false;
}
if (!$resa->can($ID, UPDATE)) {
return false;
}
// Set item if not set
if ((!isset($options['item']) || count($options['item']) == 0) && ($itemid = $resa->getField('reservationitems_id'))) {
$options['item'][$itemid] = $itemid;
}
} else {
$resa->getEmpty();
$resa->fields["begin"] = $options['begin'];
if (!isset($options['end'])) {
$resa->fields["end"] = date("Y-m-d H:00:00", strtotime($resa->fields["begin"]) + HOUR_TIMESTAMP);
} else {
$resa->fields["end"] = $options['end'];
}
}
// No item : problem
if (!isset($options['item']) || count($options['item']) == 0) {
return false;
}
echo "<div class='center'><form method='post' name=form action='reservation.form.php'>";
if (!empty($ID)) {
echo "<input type='hidden' name='id' value='{$ID}'>";
}
echo "<table class='tab_cadre' width='700px'>";
echo "<tr><th colspan='2'>" . __('Reserve an item') . "</th></tr>\n";
// Add Hardware name
$r = new ReservationItem();
echo "<tr class='tab_bg_1'><td>" . __('Item') . "</td>";
echo "<td>";
foreach ($options['item'] as $itemID) {
$r->getFromDB($itemID);
$type = $r->fields["itemtype"];
$name = NOT_AVAILABLE;
$item = NULL;
if ($item = getItemForItemtype($r->fields["itemtype"])) {
$type = $item->getTypeName();
if ($item->getFromDB($r->fields["items_id"])) {
$name = $item->getName();
} else {
$item = NULL;
}
}
echo "<span class='b'>" . sprintf(__('%1$s - %2$s'), $type, $name) . "</span><br>";
echo "<input type='hidden' name='items[{$itemID}]' value='{$itemID}'>";
}
echo "</td></tr>\n";
if (!Session::haveRight("reservation", UPDATE) || is_null($item) || !Session::haveAccessToEntity($item->fields["entities_id"])) {
echo "<input type='hidden' name='users_id' value='" . Session::getLoginUserID() . "'>";
} else {
echo "<tr class='tab_bg_2'><td>" . __('By') . "</td>";
echo "<td>";
if (empty($ID)) {
User::dropdown(array('value' => Session::getLoginUserID(), 'entity' => $item->getEntityID(), 'right' => 'all'));
} else {
User::dropdown(array('value' => $resa->fields["users_id"], 'entity' => $item->getEntityID(), 'right' => 'all'));
}
echo "</td></tr>\n";
}
echo "<tr class='tab_bg_2'><td>" . __('Start date') . "</td><td>";
$rand_begin = Html::showDateTimeField("resa[begin]", array('value' => $resa->fields["begin"], 'timestep' => -1, 'maybeempty' => false));
echo "</td></tr>\n";
$default_delay = floor((strtotime($resa->fields["end"]) - strtotime($resa->fields["begin"])) / $CFG_GLPI['time_step'] / MINUTE_TIMESTAMP) * $CFG_GLPI['time_step'] * MINUTE_TIMESTAMP;
echo "<tr class='tab_bg_2'><td>" . __('Duration') . "</td><td>";
$rand = Dropdown::showTimeStamp("resa[_duration]", array('min' => 0, 'max' => 24 * HOUR_TIMESTAMP, 'value' => $default_delay, 'emptylabel' => __('Specify an end date')));
echo "<br><div id='date_end{$rand}'></div>";
$params = array('duration' => '__VALUE__', 'end' => $resa->fields["end"], 'name' => "resa[end]");
Ajax::updateItemOnSelectEvent("dropdown_resa[_duration]{$rand}", "date_end{$rand}", $CFG_GLPI["root_doc"] . "/ajax/planningend.php", $params);
if ($default_delay == 0) {
$params['duration'] = 0;
Ajax::updateItem("date_end{$rand}", $CFG_GLPI["root_doc"] . "/ajax/planningend.php", $params);
}
Alert::displayLastAlert('Reservation', $ID);
echo "</td></tr>\n";
if (empty($ID)) {
echo "<tr class='tab_bg_2'><td>" . __('Rehearsal') . "</td>";
echo "<td>";
$values = array('' => _x('periodicity', 'None'), 'day' => _x('periodicity', 'Daily'), 'week' => _x('periodicity', 'Weekly'), 'month' => _x('periodicity', 'Monthly'));
$rand = Dropdown::showFromArray('periodicity[type]', $values);
$field_id = Html::cleanId("dropdown_periodicity[type]{$rand}");
$params = array('type' => '__VALUE__', 'end' => $resa->fields["end"]);
//.........这里部分代码省略.........
示例5: showFormMassiveAction
/**
* Form for Ticket or Problem Task on Massive action
**/
function showFormMassiveAction()
{
echo " " . __('Category') . " ";
TaskCategory::dropdown(array('condition' => "`is_active`= '1'"));
echo "<br>" . __('Description') . " ";
echo "<textarea name='content' cols='50' rows='6'></textarea> ";
if ($this->maybePrivate()) {
echo "<input type='hidden' name='is_private' value='" . $_SESSION['glpitask_private'] . "'>";
}
echo "<br>" . __('Duration');
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * HOUR_TIMESTAMP;
}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
echo "<input type='submit' name='add' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
}
示例6: showFormBadgeReturn
public function showFormBadgeReturn($target, $ID)
{
$this->getFromDB($ID);
echo "<div align='center'>";
echo "<form method='post' action=\"{$target}\">";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'>";
echo "<th colspan='4'>";
_e('Time of checking of validity of the badges', 'badges');
echo "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>";
_e('Badge return delay', 'badges') . " ";
echo "</td>";
echo "<td>";
Dropdown::showTimeStamp("delay_returnexpire", array('min' => DAY_TIMESTAMP, 'max' => 52 * WEEK_TIMESTAMP, 'step' => DAY_TIMESTAMP, 'value' => $this->fields["delay_returnexpire"], 'addfirstminutes' => true, 'inhours' => false));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td class='center' colspan='4'>";
echo "<input type='hidden' name='id' value='" . $ID . "'>";
echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit' >";
echo "</td>";
echo "</tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
示例7: showForm
function showForm($ID, $options = array())
{
if (!$this->canView()) {
return false;
}
$plugin_resources_resources_id = -1;
if (isset($options['plugin_resources_resources_id'])) {
$plugin_resources_resources_id = $options['plugin_resources_resources_id'];
}
$item = new PluginResourcesResource();
if ($item->getFromDB($plugin_resources_resources_id)) {
$entities_id = $item->fields["entities_id"];
}
if ($ID > 0) {
$this->check($ID, 'r');
$plugin_resources_resources_id = $this->fields["plugin_resources_resources_id"];
} else {
// Create item
$input = array('plugin_resources_resources_id' => $plugin_resources_resources_id, 'entities_id' => $entities_id);
$this->check(-1, 'w', $input);
}
$this->showTabs($options);
$this->showFormHeader($options);
echo "<input type='hidden' name='plugin_resources_resources_id' value='{$plugin_resources_resources_id}'>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . PluginResourcesResource::getTypeName(2) . " </td><td>";
$user = PluginResourcesResource::getResourceName($plugin_resources_resources_id, 2);
$out = "<a href='" . $user['link'] . "'>";
$out .= $user["name"];
if ($_SESSION["glpiis_ids_visible"]) {
$out .= " (" . $plugin_resources_resources_id . ")";
}
$out .= "</a>";
echo $out;
echo "</td>";
echo "<td colspan='2'>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'><td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name", array('size' => "50"));
echo "</td>";
echo "<td>" . PluginResourcesTaskType::getTypeName(1) . "</td><td>";
Dropdown::show('PluginResourcesTaskType', array('value' => $this->fields["plugin_resources_tasktypes_id"]));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician') . "</td><td>";
User::dropdown(array('name' => "users_id", 'value' => $this->fields["users_id"], 'right' => 'interface'));
echo "</td>";
echo "<td>" . __('Planning') . "</td>";
echo "<td>";
$plan = new PluginResourcesTaskPlanning();
$plan->showFormForTask($plugin_resources_resources_id, $this);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td><td>";
Dropdown::show('Group', array('value' => $this->fields["groups_id"]));
echo "</td>";
echo "<td>" . __('Carried out task', 'resources') . "</td><td>";
Dropdown::showYesNo("is_finished", $this->fields["is_finished"]);
echo "</td>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Effective duration', 'resources') . "</td><td>";
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * HOUR_TIMESTAMP;
}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
echo "</td><td colspan='2'></td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td colspan='4'>" . __('Comments') . "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'><td colspan='4'>";
echo "<textarea cols='130' rows='4' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "<input type='hidden' name='withtemplate' value=\"" . $options['withtemplate'] . "\" >";
echo "</td></tr>";
$this->showFormButtons($options);
$this->addDivForTabs();
return true;
}
示例8: showForm
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td>" . _n('Context', 'Contexts', 1, 'tasklists') . "</td><td>";
Dropdown::show('PluginTasklistsTaskType', array('name' => "plugin_tasklists_tasktypes_id", 'value' => $this->fields["plugin_tasklists_tasktypes_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Priority') . "</td>";
echo "<td>";
CommonITILObject::dropdownPriority(array('value' => $this->fields['priority'], 'withmajor' => 1));
echo "</td>";
echo "<td>" . __('Planned duration') . "</td>";
echo "<td>";
$toadd = array();
//for ($i=9 ; $i<=100 ; $i++) {
// $toadd[] = $i*HOUR_TIMESTAMP;
//}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 50 * DAY_TIMESTAMP, 'step' => DAY_TIMESTAMP, 'value' => $this->fields["actiontime"], 'toadd' => $toadd));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Visibility') . "</td>";
echo "<td>";
self::dropdownVisibility(array('value' => $this->fields['visibility']));
echo "</td>";
echo "<td>" . __('Due date');
echo " ";
Html::showToolTip(nl2br(__('Empty for infinite', 'tasklists')));
echo "</td>";
echo "<td>";
Html::showDateFormItem("due_date", $this->fields["due_date"], true, true);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td><td>";
User::dropdown(array('name' => "users_id", 'value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Percent done') . "</td>";
echo "<td>";
Dropdown::showNumber("percent_done", array('value' => $this->fields['percent_done'], 'min' => 0, 'max' => 100, 'step' => 20, 'unit' => '%'));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Dropdown::show('Group', array('name' => "groups_id", 'value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_assign`'));
echo "</td>";
echo "<td>" . __('Status') . "</td><td>";
Planning::dropdownState("state", $this->fields["state"]);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>";
echo __('Description') . "</td>";
echo "<td colspan = '3' class='center'>";
echo "<textarea cols='100' rows='15' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td>";
echo "</tr>";
$this->showFormButtons($options);
return true;
}
示例9: showForm
/**
* Print the item cost form
*
* @param $ID integer ID of the item
* @param $options array options used
**/
function showForm($ID, $options = array())
{
if (isset($options['parent']) && !empty($options['parent'])) {
$item = $options['parent'];
}
if ($ID > 0) {
$this->check($ID, READ);
} else {
// Create item
$options[static::$items_id] = $item->getField('id');
$this->check(-1, CREATE, $options);
$this->initBasedOnPrevious();
}
if ($ID > 0) {
$items_id = $this->fields[static::$items_id];
} else {
$items_id = $options['parent']->fields["id"];
}
$item = new static::$itemtype();
if (!$item->getFromDB($items_id)) {
return false;
}
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
echo "<input type='hidden' name='" . static::$items_id . "' value='" . $item->fields['id'] . "'>";
Html::autocompletionTextField($this, 'name');
echo "</td>";
echo "<td>" . __('Begin date') . "</td>";
echo "<td>";
Html::showDateField("begin_date", array('value' => $this->fields['begin_date']));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Duration') . "</td>";
echo "<td>";
Dropdown::showTimeStamp('actiontime', array('value' => $this->fields['actiontime'], 'addfirstminutes' => true));
echo "</td>";
echo "<td>" . __('End date') . "</td>";
echo "<td>";
Html::showDateField("end_date", array('value' => $this->fields['end_date']));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Time cost') . "</td><td>";
echo "<input type='text' size='15' name='cost_time' value='" . Html::formatNumber($this->fields["cost_time"], true) . "'>";
echo "</td>";
$rowspan = 4;
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}' class='middle'>";
echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Fixed cost') . "</td><td>";
echo "<input type='text' size='15' name='cost_fixed' value='" . Html::formatNumber($this->fields["cost_fixed"], true) . "'>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Material cost') . "</td><td>";
echo "<input type='text' size='15' name='cost_material' value='" . Html::formatNumber($this->fields["cost_material"], true) . "'>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'><td>" . __('Budget') . "</td>";
echo "<td>";
Budget::dropdown(array('value' => $this->fields["budgets_id"], 'entity' => $this->fields["entities_id"]));
echo "</td></tr>";
$this->showFormButtons($options);
return true;
}
示例10: showForm
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$this->initForm($ID, $options);
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'><td>" . __('Name') . "</td>";
echo "<td>";
$opt = array();
if (isset($options['helpdesk_id']) && !empty($options['helpdesk_id'])) {
$help = new $options['helpdesk_itemtype']();
if ($help->getFromDB($options['helpdesk_id'])) {
$opt['value'] = $help->fields["name"];
echo "<input type='hidden' name='helpdesk_id' value='" . $options['helpdesk_id'] . "'>";
echo "<input type='hidden' name='helpdesk_itemtype' value='" . $options['helpdesk_itemtype'] . "'>";
}
}
Html::autocompletionTextField($this, "name", $opt);
echo "</td>";
//Projet parent
echo "<td>" . __('Parent project', 'projet') . "</td>";
echo "<td>";
PluginProjetProjet_Projet::displayLinkedProjetsTo($ID, $options['withtemplate']);
if ($this->canCreate() && $options['withtemplate'] < 2) {
$rand_linked_projet = mt_rand();
echo " ";
if (!PluginProjetProjet_Projet::getParentProjetsTo($ID)) {
echo "<img onClick=\"Ext.get('linkedprojet{$rand_linked_projet}').setDisplayed('block')\"\n title=\"" . _x('button', 'Add') . "\" alt=\"" . _x('button', 'Add') . "\"\n class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
}
echo "<div style='display:none' id='linkedprojet{$rand_linked_projet}'>";
PluginProjetProjet_Projet::dropdownLinks('_link[link]', isset($values["_link"]) ? $values["_link"]['link'] : '');
echo " ";
PluginProjetProjet_Projet::dropdownParent("_link[plugin_projet_projets_id_2]", isset($values["_link"]) ? $values["_link"]['plugin_projet_projets_id_2'] : '', array('id' => $this->fields["id"], 'entities_id' => $this->fields["entities_id"]));
echo "<input type='hidden' name='_link[plugin_projet_projets_id_1]' value='{$ID}'>\n";
echo " ";
echo "</div>";
if (isset($values["_link"]) && !empty($values["_link"]['plugin_projet_projets_id_2'])) {
echo "<script language='javascript'>Ext.get('linkedprojet{$rand_linked_projet}').\n setDisplayed('block');</script>";
}
}
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td colspan='2'>" . _n('Responsible', 'Responsibles', 2, 'projet') . "</td>";
echo "<td colspan='2'>" . __('Planification', 'projet') . "</td></tr>";
echo "<tr class='tab_bg_1'><td>" . __('User') . "</td><td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Start date') . "</td><td>";
Html::showDateFormItem("date_begin", $this->fields["date_begin"], true, true);
echo "</td></tr>";
echo "<tr class='tab_bg_1'><td>" . __('Group') . "</td><td>";
Dropdown::show('Group', array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('End date') . "</td><td>";
Html::showDateFormItem("date_end", $this->fields["date_end"], true, true);
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Estimated duration', 'projet');
echo "</td>";
echo "<td>";
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * DAY_TIMESTAMP;
}
Dropdown::showTimeStamp("estimatedtime", array('min' => 0, 'max' => 8 * DAY_TIMESTAMP, 'value' => $this->fields["estimatedtime"], 'addfirstminutes' => false, 'inhours' => false, 'toadd' => $toadd));
echo "</td>\n";
echo "<td>" . __('Effective duration', 'projet') . " ";
Html::showToolTip(nl2br(__('Total of effective duration of project tasks', 'projet')));
echo "</td>";
echo "<td>" . self::getProjectForecast($ID) . "</td></tr>";
echo "<tr class='tab_bg_2'><td>";
echo __('Estimated duration', 'projet') . " " . __('in hours', 'projet');
echo "</td><td>";
$time = floor($this->fields["estimatedtime"]);
$out = Html::formatNumber($time / HOUR_TIMESTAMP, 2);
echo sprintf(_n('%s hour', '%s hours', $out), $out);
echo "</td><td>" . __('Linked tickets duration', 'projet') . " ";
Html::showToolTip(nl2br(__('Total of duration of linked tickets for project', 'projet')));
echo "</td>";
echo "<td>" . self::getProjectDuration($ID) . "</td></tr>";
//status
echo "<tr class='tab_bg_1'><td>" . __('State') . "</td><td>";
Dropdown::show('PluginProjetProjetState', array('value' => $this->fields["plugin_projet_projetstates_id"]));
echo "</td>";
echo "<td>" . __('Display on the global Gantt', 'projet') . "</td><td>";
Dropdown::showYesNo("show_gantt", $this->fields["show_gantt"]);
echo "</td></tr>";
//advance
echo "<tr class='tab_bg_1'><td>" . __('Progress') . "</td><td>";
$advance = floor($this->fields["advance"]);
echo "<select name='advance'>";
for ($i = 0; $i < 101; $i += 5) {
echo "<option value='{$i}' ";
if ($advance == $i) {
echo "selected";
}
echo " >{$i}</option>";
}
echo "</select> %";
echo "<td>" . __('Associable to a ticket') . "</td><td>";
Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
echo "</td></tr>";
//.........这里部分代码省略.........
示例11: showForm
/** form for Task
*
* @param $ID Integer : Id of the task
* @param $options array
* - parent Object : the object
**/
function showForm($ID, $options = array())
{
global $DB, $CFG_GLPI;
if (isset($options['parent']) && !empty($options['parent'])) {
$item = $options['parent'];
}
$fkfield = $item->getForeignKeyField();
if ($ID > 0) {
$this->check($ID, 'r');
} else {
// Create item
$options[$fkfield] = $item->getField('id');
$this->check(-1, 'w', $options);
}
$canplan = Session::haveRight("show_planning", "1");
$this->showFormHeader($options);
$rowspan = 5;
if ($this->maybePrivate()) {
$rowspan++;
}
// Recall
if (!empty($this->fields["begin"])) {
$rowspan++;
}
echo "<tr class='tab_bg_1'>";
echo "<td rowspan='{$rowspan}' class='middle right'>" . __('Description') . "</td>";
echo "<td class='center middle' rowspan='{$rowspan}'>" . "<textarea name='content' cols='50' rows='{$rowspan}'>" . $this->fields["content"] . "</textarea></td>";
if ($ID > 0) {
echo "<td>" . __('Date') . "</td>";
echo "<td>";
Html::showDateTimeFormItem("date", $this->fields["date"], 1, false);
} else {
echo "<td colspan='2'> ";
}
echo "<input type='hidden' name='{$fkfield}' value='" . $this->fields[$fkfield] . "'>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Category') . "</td><td>";
TaskCategory::dropdown(array('value' => $this->fields["taskcategories_id"], 'entity' => $item->fields["entities_id"]));
echo "</td></tr>\n";
if (isset($this->fields["state"])) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Status') . "</td><td>";
Planning::dropdownState("state", $this->fields["state"]);
echo "</td></tr>\n";
}
if ($this->maybePrivate()) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Private') . "</td>";
echo "<td>";
Dropdown::showYesNo('is_private', $this->fields["is_private"]);
echo "</td>";
echo "</tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Duration') . "</td><td>";
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * HOUR_TIMESTAMP;
}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Planning') . "</td>";
echo "<td>";
if (!empty($this->fields["begin"])) {
if (Session::haveRight('show_planning', 1)) {
echo "<script type='text/javascript' >\n";
echo "function showPlan" . $ID . "() {\n";
echo "Ext.get('plan').setDisplayed('none');";
$params = array('form' => 'followups', 'users_id' => $this->fields["users_id_tech"], 'id' => $this->fields["id"], 'begin' => $this->fields["begin"], 'end' => $this->fields["end"], 'entity' => $item->fields["entities_id"], 'itemtype' => $this->getType(), 'items_id' => $this->getID());
Ajax::updateItemJsCode('viewplan', $CFG_GLPI["root_doc"] . "/ajax/planning.php", $params);
echo "}";
echo "</script>\n";
echo "<div id='plan' onClick='showPlan" . $ID . "()'>\n";
echo "<span class='showplan'>";
}
if (isset($this->fields["state"])) {
echo Planning::getState($this->fields["state"]) . "<br>";
}
printf(__('From %1$s to %2$s'), Html::convDateTime($this->fields["begin"]), Html::convDateTime($this->fields["end"]));
echo "<br>" . getUserName($this->fields["users_id_tech"]);
if (Session::haveRight('show_planning', 1)) {
echo "</span>";
echo "</div>\n";
echo "<div id='viewplan'></div>\n";
}
} else {
if (Session::haveRight('show_planning', 1)) {
echo "<script type='text/javascript' >\n";
echo "function showPlanUpdate() {\n";
echo "Ext.get('plan').setDisplayed('none');";
$params = array('form' => 'followups', 'users_id' => Session::getLoginUserID(), 'entity' => $_SESSION["glpiactive_entity"], 'itemtype' => $this->getType(), 'items_id' => $this->getID());
Ajax::updateItemJsCode('viewplan', $CFG_GLPI["root_doc"] . "/ajax/planning.php", $params);
//.........这里部分代码省略.........
示例12: showForm
function showForm($ID, $options = array())
{
global $CFG_GLPI;
if (!$this->isNewID($ID)) {
$this->check($ID, READ);
} else {
// Create item
$this->check(-1, CREATE);
}
$this->showFormHeader($options);
$fields = $this->getAdditionalFields();
$nb = count($fields);
echo "<tr class='tab_bg_1'><td>" . __('Name') . "</td>";
echo "<td>";
if ($this instanceof CommonDevice) {
// Awfull hack for CommonDevice where name is designation
Html::autocompletionTextField($this, "designation");
} else {
Html::autocompletionTextField($this, "name");
}
echo "</td>";
echo "<td rowspan='" . ($nb + 1) . "'>" . __('Comments') . "</td>";
echo "<td rowspan='" . ($nb + 1) . "'>\n <textarea cols='45' rows='" . ($nb + 2) . "' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>\n";
foreach ($fields as $field) {
if ($field['name'] == 'entities_id' && $ID == 0 && !$this->isNewID($ID)) {
// No display for root entity
echo "<tr class='tab_bg_1'><td colspan='2'> </td></tr>";
break;
}
if (!isset($field['type'])) {
$field['type'] = '';
}
if ($field['name'] == 'header') {
echo "<tr class='tab_bg_1'><th colspan='2'>" . $field['label'] . "</th></tr>";
continue;
}
echo "<tr class='tab_bg_1'><td>" . $field['label'];
if (isset($field['comment']) && !empty($field['comment'])) {
echo " ";
Html::showToolTip($field['comment']);
}
echo "</td><td>";
switch ($field['type']) {
case 'UserDropdown':
$param = array('name' => $field['name'], 'value' => $this->fields[$field['name']], 'right' => 'interface', 'entity' => $this->fields["entities_id"]);
if (isset($field['right'])) {
$params['right'] = $field['right'];
}
User::dropdown($param);
break;
case 'dropdownValue':
$params = array('value' => $this->fields[$field['name']], 'name' => $field['name'], 'entity' => $this->getEntityID());
if (isset($field['condition'])) {
$params['condition'] = $field['condition'];
}
Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField($field['name'])), $params);
break;
case 'text':
Html::autocompletionTextField($this, $field['name']);
break;
case 'textarea':
$cols = 40;
$rows = 3;
if (isset($field['rows'])) {
$rows = $field['rows'];
}
if (isset($field['cols'])) {
$cols = $field['cols'];
}
echo "<textarea name='" . $field['name'] . "' cols='{$cols}' rows='{$rows}'>" . $this->fields[$field['name']] . "</textarea >";
break;
case 'integer':
Dropdown::showNumber($field['name'], array('value' => $this->fields[$field['name']]));
break;
case 'timestamp':
$param = array('value' => $this->fields[$field['name']]);
if (isset($field['min'])) {
$param['min'] = $field['min'];
}
if (isset($field['max'])) {
$param['max'] = $field['max'];
}
if (isset($field['step'])) {
$param['step'] = $field['step'];
}
Dropdown::showTimeStamp($field['name'], $param);
break;
case 'parent':
if ($field['name'] == 'entities_id') {
$restrict = -1;
} else {
$restrict = $this->getEntityID();
}
Dropdown::show(getItemTypeForTable($this->getTable()), array('value' => $this->fields[$field['name']], 'name' => $field['name'], 'entity' => $restrict, 'used' => $ID > 0 ? getSonsOf($this->getTable(), $ID) : array()));
break;
case 'icon':
Dropdown::dropdownIcons($field['name'], $this->fields[$field['name']], GLPI_ROOT . "/pics/icones");
if (!empty($this->fields[$field['name']])) {
echo " <img style='vertical-align:middle;' alt='' src='" . $CFG_GLPI["typedoc_icon_dir"] . "/" . $this->fields[$field['name']] . "'>";
//.........这里部分代码省略.........
示例13: getValueToSelect
//.........这里部分代码省略.........
case "date":
case "date_delay":
if (isset($options['relative_dates']) && $options['relative_dates']) {
if (isset($searchoptions['maybefuture']) && $searchoptions['maybefuture']) {
$options['with_future'] = true;
}
return Html::showGenericDateTimeSearch($name, $value, $options);
}
$copytooption = array('min', 'max', 'maybeempty', 'showyear');
foreach ($copytooption as $key) {
if (isset($searchoptions[$key]) && !isset($options[$key])) {
$options[$key] = $searchoptions[$key];
}
}
$options['value'] = $value;
return Html::showDateField($name, $options);
case "datetime":
if (isset($options['relative_dates']) && $options['relative_dates']) {
if (isset($searchoptions['maybefuture']) && $searchoptions['maybefuture']) {
$options['with_future'] = true;
}
$options['with_time'] = true;
return Html::showGenericDateTimeSearch($name, $value, $options);
}
$copytooption = array('mindate', 'maxdate', 'mintime', 'maxtime', 'maybeempty', 'timestep');
foreach ($copytooption as $key) {
if (isset($searchoptions[$key]) && !isset($options[$key])) {
$options[$key] = $searchoptions[$key];
}
}
$options['value'] = $value;
return Html::showDateTimeField($name, $options);
case "timestamp":
$copytooption = array('addfirstminutes', 'emptylabel', 'inhours', 'max', 'min', 'step', 'toadd', 'display_emptychoice');
foreach ($copytooption as $key) {
if (isset($searchoptions[$key]) && !isset($options[$key])) {
$options[$key] = $searchoptions[$key];
}
}
$options['value'] = $value;
return Dropdown::showTimeStamp($name, $options);
case "itemlink":
// Do not use dropdown if wanted to select string value instead of ID
if (isset($options['itemlink_as_string']) && $options['itemlink_as_string']) {
break;
}
case "dropdown":
$copytooption = array('condition', 'displaywith', 'emptylabel', 'right', 'toadd');
$options['name'] = $name;
$options['value'] = $value;
foreach ($copytooption as $key) {
if (isset($searchoptions[$key]) && !isset($options[$key])) {
$options[$key] = $searchoptions[$key];
}
}
if (!isset($options['entity'])) {
$options['entity'] = $_SESSION['glpiactiveentities'];
}
$itemtype = getItemTypeForTable($searchoptions['table']);
return $itemtype::dropdown($options);
case "right":
return Profile::dropdownRights(Profile::getRightsFor($searchoptions['rightclass']), $name, $value, array('multiple' => false, 'display' => false));
case "itemtypename":
if (isset($searchoptions['itemtype_list'])) {
$options['types'] = $CFG_GLPI[$searchoptions['itemtype_list']];
}
$copytooption = array('types');
$options['value'] = $value;
foreach ($copytooption as $key) {
if (isset($searchoptions[$key]) && !isset($options[$key])) {
$options[$key] = $searchoptions[$key];
}
}
if (isset($options['types'])) {
return Dropdown::showItemTypes($name, $options['types'], $options);
}
return false;
case "language":
$copytooption = array('emptylabel', 'display_emptychoice');
foreach ($copytooption as $key) {
if (isset($searchoptions[$key]) && !isset($options[$key])) {
$options[$key] = $searchoptions[$key];
}
}
$options['value'] = $value;
return Dropdown::showLanguages($name, $options);
}
// Get specific display if available
$itemtype = getItemTypeForTable($searchoptions['table']);
if ($item = getItemForItemtype($itemtype)) {
$specific = $item->getSpecificValueToSelect($searchoptions['field'], $name, $values, $options);
if (strlen($specific)) {
return $specific;
}
}
}
// default case field text
$this->fields[$name] = $value;
return Html::autocompletionTextField($this, $name, $options);
}
示例14: showForm
/** form for Task
*
* @param $ID Integer : Id of the task
* @param $options array
* - parent Object : the object
**/
function showForm($ID, $options = array())
{
global $DB, $CFG_GLPI;
if (isset($options['parent']) && !empty($options['parent'])) {
$item = $options['parent'];
}
$fkfield = $item->getForeignKeyField();
if ($ID > 0) {
$this->check($ID, READ);
} else {
// Create item
$options[$fkfield] = $item->getField('id');
$this->check(-1, CREATE, $options);
}
$rand = mt_rand();
$this->showFormHeader($options);
$canplan = !$item->isStatusExists(CommonITILObject::PLANNED) || $item->isAllowedStatus($item->fields['status'], CommonITILObject::PLANNED);
$rowspan = 3;
if ($this->maybePrivate()) {
$rowspan++;
}
if (isset($this->fields["state"])) {
$rowspan++;
}
echo "<tr class='tab_bg_1'>";
echo "<td rowspan='{$rowspan}' class='middle'>" . __('Description') . "</td>";
echo "<td class='center middle' rowspan='{$rowspan}'>" . "<textarea name='content' cols='50' rows='{$rowspan}' class='form-control'>" . $this->fields["content"] . "</textarea></td>";
if ($ID > 0) {
echo "<td>" . __('Date') . "</td>";
echo "<td>";
Html::showDateTimeField("date", array('value' => $this->fields["date"], 'timestep' => 1, 'maybeempty' => false));
} else {
echo "<td colspan='2'> ";
}
echo "<input type='hidden' name='{$fkfield}' value='" . $this->fields[$fkfield] . "'>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Category') . "</td><td>";
TaskCategory::dropdown(array('value' => $this->fields["taskcategories_id"], 'entity' => $item->fields["entities_id"]));
echo "</td></tr>\n";
if (isset($this->fields["state"])) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Status') . "</td><td>";
Planning::dropdownState("state", $this->fields["state"]);
echo "</td></tr>\n";
}
if ($this->maybePrivate()) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Private') . "</td>";
echo "<td>";
Dropdown::showYesNo('is_private', $this->fields["is_private"]);
echo "</td>";
echo "</tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Duration') . "</td><td>";
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * HOUR_TIMESTAMP;
}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('By');
echo " <a href='#' onClick=\"" . Html::jsGetElementbyID('planningcheck' . $rand) . ".dialog('open');\">";
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/reservation-3.png'\n title=\"" . __s('Availability') . "\" alt=\"" . __s('Availability') . "\"\n class='calendrier'>";
echo "</a>";
Ajax::createIframeModalWindow('planningcheck' . $rand, $CFG_GLPI["root_doc"] . "/front/planning.php?checkavailability=checkavailability" . "&itemtype=" . $item->getType() . "&{$fkfield}=" . $item->getID(), array('title' => __('Availability')));
echo "</td>";
echo "<td class='center'>";
$rand_user = mt_rand();
$params = array('name' => "users_id_tech", 'value' => $this->fields["users_id_tech"], 'right' => "own_ticket", 'rand' => $rand_user, 'entity' => $item->fields["entities_id"]);
$params['toupdate'] = array('value_fieldname' => 'users_id', 'to_update' => "user_available{$rand_user}", 'url' => $CFG_GLPI["root_doc"] . "/ajax/planningcheck.php");
User::dropdown($params);
echo "</td>\n";
if ($canplan) {
echo "<td>" . __('Planning') . "</td>";
}
echo "<td>";
if (!empty($this->fields["begin"])) {
if (Session::haveRight('planning', Planning::READMY)) {
echo "<script type='text/javascript' >\n";
echo "function showPlan" . $ID . "() {\n";
echo Html::jsHide('plan');
$params = array('form' => 'followups', 'users_id' => $this->fields["users_id_tech"], 'id' => $this->fields["id"], 'begin' => $this->fields["begin"], 'end' => $this->fields["end"], 'rand_user' => $rand_user, 'entity' => $item->fields["entities_id"], 'itemtype' => $this->getType(), 'items_id' => $this->getID());
Ajax::updateItemJsCode('viewplan', $CFG_GLPI["root_doc"] . "/ajax/planning.php", $params);
echo "}";
echo "</script>\n";
echo "<div id='plan' onClick='showPlan" . $ID . "()'>\n";
echo "<span class='showplan'>";
}
if (isset($this->fields["state"])) {
echo Planning::getState($this->fields["state"]) . "<br>";
}
//.........这里部分代码省略.........
示例15: showForm
//.........这里部分代码省略.........
echo "</select> %";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_3'>";
echo "<td colspan='4'>" . __('Assigned to') . "</td>";
echo "<td colspan='4'>" . __('Planification', 'projet') . "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td colspan='4' width='{$width_left}'>";
echo "<table width='100%'>";
echo "<tr>";
echo "<td>" . _n('User', 'Users', 1) . "</td><td>";
$this->dropdownItems($this->fields["plugin_projet_projets_id"], "users_id", array(), $this->fields["users_id"], 'User');
echo "</td></tr>";
echo "<tr><td>" . _n('Group', 'Groups', 1) . "</td><td>";
$this->dropdownItems($this->fields["plugin_projet_projets_id"], "groups_id", array(), $this->fields["groups_id"], 'Group');
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>" . _n('Supplier', 'Suppliers', 1) . "</td><td>";
$this->dropdownItems($this->fields["plugin_projet_projets_id"], "contacts_id", array(), $this->fields["contacts_id"], 'Supplier');
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td colspan='4' width='{$width_right}' valign='top'>";
echo "<table width='100%'>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Effective duration', 'projet') . "</td><td>";
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * HOUR_TIMESTAMP;
}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Planning') . "</td>";
echo "<td>";
$plan = new PluginProjetTaskPlanning();
$plan->showFormForTask($plugin_projet_projets_id, $this);
echo "</td></tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_3'>";
$colspan = '8';
if (!empty($ID)) {
$colspan = '4';
}
echo "<td colspan='" . $colspan . "'>" . __('Description') . "</td>";
if (!empty($ID)) {
echo "<td colspan='4'>" . __('Results') . "</td>";
}
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td colspan='" . $colspan . "' width='{$width_left}'>";
echo "<table width='100%'>";
echo "<tr>";
echo "<td>";
echo "<textarea name='comment' cols='{$cols}' rows='{$rows}'>" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "</table>";
if (!empty($ID)) {
echo "</td>";
echo "<td colspan='4' width='{$width_left}'>";
echo "<table width='100%'>";