本文整理匯總了PHP中CommonDBTM::showMassiveActionsSubForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDBTM::showMassiveActionsSubForm方法的具體用法?PHP CommonDBTM::showMassiveActionsSubForm怎麽用?PHP CommonDBTM::showMassiveActionsSubForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::showMassiveActionsSubForm方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'import_email':
Entity::dropdown();
echo "<br><br>";
echo Html::submit(_x('button', 'Import'), array('name' => 'massiveaction'));
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例2: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'duplicate':
$entity_assign = False;
foreach ($ma->getitems() as $itemtype => $ids) {
if ($item = getItemForItemtype($itemtype)) {
if ($item->isEntityAssign()) {
$entity_assign = true;
break;
}
}
}
if ($entity_assign) {
Entity::dropdown();
}
echo "<br><br>" . Html::submit(_x('button', 'Duplicate'), array('name' => 'massiveaction'));
return true;
case 'move_rule':
$input = $ma->getInput();
$values = array('after' => __('After'), 'before' => __('Before'));
Dropdown::showFromArray('move_type', $values, array('width' => '20%'));
if (isset($input['entity'])) {
$entity = $input['entity'];
} else {
$entity = "";
}
if (isset($input['condition'])) {
$condition = $input['condition'];
} else {
$condition = 0;
}
echo Html::hidden('rule_class_name', array('value' => $input['rule_class_name']));
Rule::dropdown(array('sub_type' => $input['rule_class_name'], 'name' => "ranking", 'condition' => $condition, 'entity' => $entity, 'width' => '50%'));
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Move') . "'>\n";
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例3: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
global $CFG_GLPI;
switch ($ma->getAction()) {
case 'move_bookmark':
$values = array('after' => __('After'), 'before' => __('Before'));
Dropdown::showFromArray('move_type', $values, array('width' => '20%'));
$param = array('name' => "bookmarks_id_ref", 'width' => '50%');
$param['condition'] = "(`is_private`='1' AND `users_id`='" . Session::getLoginUserID() . "') ";
$param['entity'] = -1;
Bookmark::dropdown($param);
echo "<br><br>\n";
echo Html::submit(_x('button', 'Move'), array('name' => 'massiveaction')) . "</span>";
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例4: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'plugin_certificates_add_item':
self::dropdownCertificate(array());
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
case "install":
Dropdown::showAllItems("item_item", 0, 0, -1, self::getTypes(true), false, false, 'typeitem');
echo Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
break;
case "uninstall":
Dropdown::showAllItems("item_item", 0, 0, -1, self::getTypes(true), false, false, 'typeitem');
echo Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
break;
case "transfer":
Dropdown::show('Entity');
echo Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
break;
}
return parent::showMassiveActionsSubForm($ma);
}
示例5: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
global $CFG_GLPI;
switch ($ma->getAction()) {
case 'add_task':
$itemtype = $ma->getItemtype(true);
$tasktype = $itemtype . 'Task';
if ($ttype = getItemForItemtype($tasktype)) {
$ttype->showFormMassiveAction();
return true;
}
return false;
case 'add_actor':
$types = array(0 => Dropdown::EMPTY_VALUE, CommonITILActor::REQUESTER => __('Requester'), CommonITILActor::OBSERVER => __('Watcher'), CommonITILActor::ASSIGN => __('Assigned to'));
$rand = Dropdown::showFromArray('actortype', $types);
$paramsmassaction = array('actortype' => '__VALUE__');
Ajax::updateItemOnSelectEvent("dropdown_actortype{$rand}", "show_massiveaction_field", $CFG_GLPI["root_doc"] . "/ajax/dropdownMassiveActionAddActor.php", $paramsmassaction);
echo "<span id='show_massiveaction_field'> </span>\n";
return true;
case 'update_notif':
Dropdown::showYesNo('use_notification');
echo "<br><br>";
echo Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例6: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'plugin_ocsinventoryng_force_ocsng_update':
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
case 'plugin_ocsinventoryng_lock_ocsng_field':
$fields['all'] = __('All');
$fields += self::getLockableFields();
Dropdown::showFromArray("field", $fields);
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
case 'plugin_ocsinventoryng_unlock_ocsng_field':
$fields['all'] = __('All');
$fields += self::getLockableFields();
Dropdown::showFromArray("field", $fields);
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例7: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
$action = $ma->getAction();
$items = $ma->getItems();
$itemtypes_affect = array();
$itemtypes_unaffect = array();
foreach (array_keys($items) as $itemtype) {
if (!Toolbox::is_a($itemtype, __CLASS__)) {
continue;
}
$specificities = $itemtype::getConnexityMassiveActionsSpecificities();
if (in_array($action, $specificities['normalized']['affect'])) {
$itemtypes_affect[$itemtype] = $specificities;
continue;
}
if (in_array($action, $specificities['normalized']['unaffect'])) {
$itemtypes_unaffect[$itemtype] = $specificities;
continue;
}
}
if (count($itemtypes_affect) > count($itemtypes_unaffect)) {
$normalized_action = 'affect';
$itemtypes = $itemtypes_affect;
} else {
if (count($itemtypes_affect) < count($itemtypes_unaffect)) {
$normalized_action = 'unaffect';
$itemtypes = $itemtypes_unaffect;
} else {
return parent::showMassiveActionsSubForm($ma);
}
}
switch ($normalized_action) {
case 'unaffect':
foreach ($itemtypes as $itemtype => $specificities) {
if (Toolbox::is_a($itemtype, 'CommonDBRelation')) {
$peer_field = "peer[{$itemtype}]";
if (!$itemtype::$mustBeAttached_1 && !$itemtype::$mustBeAttached_2) {
// Should never occur ... But we must care !
$values = array();
if (empty($itemtype::$itemtype_1) || preg_match('/^itemtype/', $itemtype::$itemtype_1)) {
$values[0] = __('First Item');
} else {
$itemtype_1 = $itemtype::$itemtype_1;
$values[0] = $itemtype_1::getTypeName(Session::getPluralNumber());
}
if (empty($itemtype::$itemtype_2) || preg_match('/^itemtype/', $itemtype::$itemtype_2)) {
$values[1] = __('Second Item');
} else {
$itemtype_2 = $itemtype::$itemtype_2;
$values[1] = $itemtype_2::getTypeName(Session::getPluralNumber());
}
echo sprintf(__('Select a peer for %s:'), $itemtype::getTypeName());
Dropdown::showFromArray($peer_field, $values);
echo "<br>\n";
} else {
if (!$itemtype::$mustBeAttached_1) {
echo "<input type='hidden' name='{$peer_field}' value='0'>";
} else {
if (!$itemtype::$mustBeAttached_2) {
echo "<input type='hidden' name='{$peer_field}' value='1'>";
}
}
}
}
}
echo "<br><br>" . Html::submit(_x('button', 'Dissociate'), array('name' => 'massiveaction'));
return true;
case 'affect':
$peertypes = array();
foreach ($itemtypes as $itemtype => $specificities) {
if (!$specificities['reaffect']) {
continue;
}
if (Toolbox::is_a($itemtype, 'CommonDBRelation')) {
if ($specificities['reaffect'] == 1) {
$peertype = $itemtype::$itemtype_1;
} else {
$peertype = $itemtype::$itemtype_2;
}
} else {
$peertype = $itemtype::$itemtype;
}
if (preg_match('/^itemtype/', $peertype)) {
$peertypes = array_merge($peertypes, $specificities['itemtypes']);
} else {
$peertypes[] = $peertype;
}
}
$peertypes = array_unique($peertypes);
if (count($peertypes) == 0) {
echo __('Unable to reaffect given elements !');
exit;
}
$options = array();
if (count($peertypes) == 1) {
//.........這裏部分代碼省略.........
示例8: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
global $CFG_GLPI;
switch ($ma->getAction()) {
case 'change_authtype':
$rand = Auth::dropdown(array('name' => 'authtype'));
$paramsmassaction = array('authtype' => '__VALUE__');
Ajax::updateItemOnSelectEvent("dropdown_authtype{$rand}", "show_massiveaction_field", $CFG_GLPI["root_doc"] . "/ajax/dropdownMassiveActionAuthMethods.php", $paramsmassaction);
echo "<span id='show_massiveaction_field'><br><br>";
echo Html::submit(_x('button', 'Post'), array('name' => 'massiveaction')) . "</span>";
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例9: showMassiveActionsSubForm
/**
* Massive actions display
*
* @param $input array of input datas
*
* @return array of results (nbok, nbko, nbnoright counts)
* */
static function showMassiveActionsSubForm(MassiveAction $ma)
{
$itemtype = $ma->getItemtype(false);
switch ($itemtype) {
case self::getType():
switch ($ma->getAction()) {
case "validate":
case "refuse":
echo "<textarea cols='80' rows='7' name='comment'></textarea><br><br>";
break;
}
return parent::showMassiveActionsSubForm($ma);
}
}
示例10: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'plugin_financialreports_add_date_disposal':
Html::showDateFormItem("date_disposal", "", true, true);
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例11: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'DoIt':
echo " <input type='hidden' name='toto' value='1'>" . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction')) . " " . __('Write in item history', 'example');
return true;
case 'do_nothing':
echo " " . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction')) . " " . __('but do nothing :)', 'example');
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例12: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'transfert':
Dropdown::show('Entity');
echo "<br><br>" . Html::submit(__('Post'), array('name' => 'massiveaction'));
return true;
}
$pfAgentmodule = new PluginFusioninventoryAgentmodule();
$a_modules = $pfAgentmodule->find();
foreach ($a_modules as $data) {
if ($ma->getAction() == $data['modulename']) {
Dropdown::showYesNo($ma->getAction());
echo "<br><br>" . Html::submit(__('Post'), array('name' => 'massiveaction'));
return true;
}
}
return parent::showMassiveActionsSubForm($ma);
}
示例13: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
global $CFG_GLPI;
switch ($ma->getAction()) {
case 'add_to_static_group':
Dropdown::show('PluginFusioninventoryDeployGroup', array('condition' => "`type`='" . PluginFusioninventoryDeployGroup::STATIC_GROUP . "'"));
echo Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例14: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'transfert':
Dropdown::show('Entity');
echo "<br><br>" . Html::submit(__('Post'), array('name' => 'massiveaction'));
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例15: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'merge':
echo " " . $_SESSION['glpiactive_entity_shortname'];
echo "<br><br>" . Html::submit(_x('button', 'Merge'), array('name' => 'massiveaction'));
return true;
}
return parent::showMassiveActionsSubForm($ma);
}