本文整理汇总了PHP中Ajax::UpdateItemJsCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Ajax::UpdateItemJsCode方法的具体用法?PHP Ajax::UpdateItemJsCode怎么用?PHP Ajax::UpdateItemJsCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ajax
的用法示例。
在下文中一共展示了Ajax::UpdateItemJsCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteitemtodefatc
function deleteitemtodefatc($type, $a_items_id, $taskjobs_id)
{
global $CFG_GLPI;
$this->getFromDB($taskjobs_id);
$a_type = importArrayFromDB($this->fields[$type]);
$split = explode("-", $a_items_id);
foreach ($split as $key) {
unset($a_type[$key]);
}
$input = array();
$input['id'] = $this->fields['id'];
$input[$type] = exportArrayToDB($a_type);
$this->update($input);
// reload item list
$params = array();
$params['taskjobs_id'] = $taskjobs_id;
$params['typename'] = $type;
echo "<script type='text/javascript'>";
Ajax::UpdateItemJsCode("show" . $type . "list" . $taskjobs_id . "_", $CFG_GLPI["root_doc"] . "/plugins/fusioninventory/ajax/dropdownlist.php", $params);
echo "</script>";
}
示例2: showFormForTask
function showFormForTask($projet, PluginProjetTask $task)
{
global $CFG_GLPI;
$PluginProjetProjet = new PluginProjetProjet();
$PluginProjetProjet->getFromDB($projet);
$taskid = $task->getField('id');
if ($taskid > 0 && $this->getFromDBbyTask($taskid)) {
if ($this->canCreate()) {
echo "<script type='text/javascript' >\n";
echo "function showPlan" . $taskid . "(){\n";
echo "Ext.get('plan').setDisplayed('none');";
$params = array('form' => 'followups', 'id' => $this->fields["id"], 'begin' => $this->fields["begin"], 'end' => $this->fields["end"], 'entity' => $PluginProjetProjet->fields["entities_id"]);
Ajax::updateItemJsCode('viewplan', $CFG_GLPI["root_doc"] . "/plugins/projet/ajax/planning.php", $params);
echo "}";
echo "</script>\n";
echo "<div id='plan' onClick='showPlan" . $taskid . "()'>\n";
echo "<span class='showplan'>";
}
if ($this->fields["begin"] && $this->fields["end"]) {
echo Html::convDateTime($this->fields["begin"]) . " -> " . Html::convDateTime($this->fields["end"]);
} else {
_e('Plan this task');
}
if ($this->canCreate()) {
echo "</span>";
echo "</div>\n";
echo "<div id='viewplan'></div>\n";
}
} else {
if ($this->canCreate()) {
echo "<script type='text/javascript' >\n";
echo "function showPlanUpdate(){\n";
echo "Ext.get('plan').setDisplayed('none');";
$params = array('form' => 'followups', 'entity' => $_SESSION["glpiactive_entity"]);
Ajax::UpdateItemJsCode('viewplan', $CFG_GLPI["root_doc"] . "/plugins/projet/ajax/planning.php", $params);
echo "};";
echo "</script>";
echo "<div id='plan' onClick='showPlanUpdate()'>\n";
echo "<span class='showplan'>" . __('Plan this task') . "</span>";
echo "</div>\n";
echo "<div id='viewplan'></div>\n";
} else {
_e('None');
}
}
}
示例3: showModifyCommentFrom
static function showModifyCommentFrom($item, $rand)
{
global $CFG_GLPI;
$items_id = $item['id'];
echo "<script type='text/javascript' >\n";
echo "function showComment{$items_id} () {\n";
echo "Ext.get('commentneed{$items_id}{$rand}').setDisplayed('none');";
echo "Ext.get('viewaccept{$items_id}{$rand}').setDisplayed('block');";
$params = array('name' => 'commentneed' . $items_id, 'data' => rawurlencode($item["comment"]));
Ajax::UpdateItemJsCode("viewcommentneed{$items_id}{$rand}", $CFG_GLPI["root_doc"] . "/plugins/resources/ajax/inputtext.php", $params, false);
echo "}";
echo "</script>\n";
echo "<div id='commentneed{$items_id}{$rand}' class='center' onClick='showComment{$items_id}()'>\n";
echo $item["comment"];
echo "</div>\n";
echo "<div id='viewcommentneed{$items_id}{$rand}'>\n";
echo "</div>\n";
echo "<div id='viewaccept{$items_id}{$rand}' style='display:none;' class='center'>";
echo "<p><input type='submit' name='updateneedcomment[" . $items_id . "]' value=\"" . _sx('button', 'Update') . "\" class='submit'>";
echo " <input type='button' onclick=\"hideForm{$items_id}();\" value=\"" . _sx('button', 'Cancel') . "\" class='submit'></p>";
echo "</div>";
echo "<script type='text/javascript' >\n";
echo "function hideForm{$items_id}() {\n";
echo "Ext.get('commentneed{$items_id}{$rand}').setDisplayed('block');";
echo "Ext.select('#viewcommentneed{$items_id}{$rand} textarea').remove();";
echo "Ext.get('viewaccept{$items_id}{$rand}').setDisplayed('none');";
echo "}\n";
echo "</script>\n";
}