sync with other Mgr pages

This commit is contained in:
Uwe Steinmann 2020-03-19 15:56:35 +01:00
parent 417b368039
commit 9c98104bfa

View File

@ -101,9 +101,11 @@ $(document).ready( function() {
$( "#selector" ).change(function() {
$('div.ajax').trigger('update', {attrdefgroupid: $(this).val()});
window.history.pushState({"html":"","pageTitle":""},"", '../out/out.AttributeGroupMgr.php?attrdefgroupid=' + $(this).val());
});
});
<?php
$this->printClickFolderJs();
} /* }}} */
function info() { /* {{{ */
@ -133,13 +135,30 @@ $(document).ready( function() {
}
} /* }}} */
function actionmenu() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$selgroup = $this->params['selattrdefgroup'];
if($selgroup) {
?>
<form style="display: inline-block;" method="post" action="../op/op.AttributeGroupMgr.php" >
<?php echo createHiddenFieldWithKey('removegroup'); ?>
<input type="hidden" name="attrdefgroupid" value="<?php echo $selgroup->getID()?>">
<input type="hidden" name="action" value="removegroup">
<button type="submit" class="btn"><i class="icon-remove"></i> <?php echo getMLText("rm_attrdefgroup")?></button>
</form>
<?php
}
} /* }}} */
function showAttributeGroupForm($group) { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$allUsers = $this->params['attrdefs'];
$groups = $this->params['attrdefgroups'];
?>
<form action="../op/op.AttributeGroupMgr.php" name="form_1" id="form_1" method="post">
<form class="form-horizontal" action="../op/op.AttributeGroupMgr.php" name="form_1" id="form_1" method="post">
<?php
if($group) {
echo createHiddenFieldWithKey('editgroup');
@ -153,31 +172,26 @@ $(document).ready( function() {
<input type="hidden" name="action" value="addgroup">
<?php
}
$this->formField(
getMLText("name"),
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
'value'=>($group ? htmlspecialchars($group->getName()) : '')
)
);
$this->formField(
getMLText("comment"),
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>5,
'value'=>($group ? htmlspecialchars($group->getComment()) : '')
)
);
$this->formSubmit('<i class="icon-save"></i> '.getMLText('save'));
?>
<table class="table-condensed">
<?php
if($group && $this->check_access('RemoveAttributeDefinitionGroup')) {
?>
<tr>
<td></td>
<td><?php echo $this->html_link('RemoveAttributeDefinitionGroup', array('attrdefgroupid'=>$group->getID()), array('class'=>'btn'), '<i class="icon-remove"></i> '.getMLText("rm_attrdefgroup"), false); ?></td>
</tr>
<?php
}
?>
<tr>
<td><?php printMLText("name");?>:</td>
<td><input type="text" name="name" id="name" value="<?php print $group ? htmlspecialchars($group->getName()) : '';?>"></td>
</tr>
<tr>
<td><?php printMLText("comment");?>:</td>
<td><textarea name="comment" id="comment" rows="4" cols="50"><?php print $group ? htmlspecialchars($group->getComment()) : '';?></textarea></td>
</tr>
<tr>
<td></td>
<td><button type="submit" class="btn"><i class="icon-save"></i> <?php printMLText("save")?></button></td>
</tr>
</table>
</form>
<?php
if($group) {
@ -328,18 +342,18 @@ $(document).ready( function() {
<div class="row-fluid">
<div class="span4">
<div class="well">
<?php echo getMLText("selection")?>:
<select class="chzn-select" id="selector">
<option value="-1"><?php echo getMLText("choose_attrdefgroup")?>
<option value="0"><?php echo getMLText("add_attrdefgroup")?>
<form class="form-horizontal">
<select class="chzn-select" id="selector">
<option value="-1"><?php echo getMLText("choose_attrdefgroup")?>
<option value="0"><?php echo getMLText("add_attrdefgroup")?>
<?php
foreach ($allGroups as $group) {
print "<option value=\"".$group->getID()."\" ".($selgroup && $group->getID()==$selgroup->getID() ? 'selected' : '').">" . htmlspecialchars($group->getName());
}
?>
</select>
</div>
</select>
</form>
<div class="ajax" style="margin-bottom: 15px;" data-view="AttributeGroupMgr" data-action="actionmenu" <?php echo ($selattrdef ? "data-query=\"attrdefgroupid=".$selattrdefgroup->getID()."\"" : "") ?>></div>
<?php if($accessop->check_view_access($this, array('action'=>'info'))) { ?>
<div class="ajax" data-view="AttributeGroupMgr" data-action="info" <?php echo ($selgroup ? "data-query=\"attrdefgroupid=".$selgroup->getID()."\"" : "") ?>></div>
<?php } ?>
@ -360,4 +374,3 @@ $(document).ready( function() {
$this->htmlEndPage();
} /* }}} */
}
?>