示例#1
0
 /**
  * @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);
 }