use formSubmit() instead of plain html for submit button

This commit is contained in:
Uwe Steinmann 2022-12-10 13:48:11 +01:00
parent ad19678e86
commit 3477b1fc9b
17 changed files with 41 additions and 43 deletions

View File

@ -182,7 +182,7 @@ $(document).ready( function() {
<?php echo createHiddenFieldWithKey('removeattrdef'); ?>
<input type="hidden" name="attrdefid" value="<?php echo $selattrdef->getID()?>">
<input type="hidden" name="action" value="removeattrdef">
<button type="submit" class="btn btn-secondary"><i class="fa fa-remove"></i> <?php echo getMLText("rm_attrdef")?></button>
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_attrdef'),'','','secondary');?>
</form>
<?php
}

View File

@ -120,7 +120,7 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
<?php echo createHiddenFieldWithKey('removeevent'); ?>
<input type="hidden" name="eventid" value="<?php echo intval($event["id"]); ?>">
<p><?php printMLText("confirm_rm_event", array ("name" => htmlspecialchars($event["name"])));?></p>
<button class="btn btn-danger" type="submit"><i class="fa fa-remove"></i> <?php printMLText("delete");?></button>
<?php $this->formSubmit("<i class=\"fa fa-remove\"></i> ".getMLText('delete'),'','','danger'); ?>
</form>
<?php
$this->contentContainerEnd();

View File

@ -92,7 +92,7 @@ $(document).ready( function() {
<?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="categoryid" value="<?php echo $selcat->getID()?>">
<input type="hidden" name="action" value="removecategory">
<button class="btn btn-danger" type="submit"><i class="fa fa-remove"></i> <?php echo getMLText("rm_document_category")?></button>
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_document_category'),'','','danger');?>
</form>
<?php
}

View File

@ -87,7 +87,7 @@ $(document).ready( function() {
<?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="categoryid" value="<?php echo $selcategory->getId(); ?>">
<input type="hidden" name="action" value="removecategory">
<button class="btn btn-danger" type="submit"><i class="fa fa-remove"></i> <?php echo getMLText("rm_default_keyword_category")?></button>
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_default_keyword_category'),'','','danger');?>
</form>
<?php
}
@ -185,7 +185,7 @@ $(document).ready( function() {
<input type="Hidden" name="action" value="newkeywords">
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input type="text" class="keywords form-control" name="keywords">&nbsp;
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> <?php printMLText("new_default_keywords");?></button>
<?php $this->formSubmit('<i class="fa fa-save"></i> '.getMLText('new_default_keywords'),'','','primary');?>
</form>
</div>
</div>

View File

@ -122,7 +122,7 @@ $(document).ready(function() {
</div>
</div>
<div class="controls">
<button type="submit" class="btn"><i class="fa fa-save"></i> <?php printMLText("save")?></button>
<?php $this->formSubmit('<i class="fa fa-save"></i> '.getMLText('save'),'','','neutral');?>
</div>
</form>
<?php

View File

@ -152,9 +152,7 @@ $(document).ready(function() {
<?php
if($user->getId() == $luser->getId()) {
echo $this->warningMsg(getMLText('edit_online_warning'));
?>
<button id="update" type="submit" class="btn btn-primary"><i class="fa fa-save"></i> <?php printMLText("save"); ?></button>
<?php
$this->formSubmit('<i class="fa fa-save"></i> '.getMLText('save'),'update','','primary');
} else {
echo $this->errorMsg(getMLText('edit_online_not_allowed'));
}

View File

@ -46,8 +46,8 @@ class SeedDMS_View_RemoveArchive extends SeedDMS_Theme_Style {
?>
<form action="../op/op.RemoveArchive.php" name="form1" method="post">
<input type="hidden" name="arkname" value="<?php echo htmlspecialchars($arkname); ?>">
<?php echo createHiddenFieldWithKey('removearchive'); ?>
<p><button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("backup_remove");?></button></p>
<?php echo createHiddenFieldWithKey('removearchive'); ?>
<p><?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('backup_remove'),'','','danger');?></p>
</form>
<?php
$this->contentEnd();

View File

@ -49,7 +49,7 @@ class SeedDMS_View_RemoveDocument extends SeedDMS_Theme_Style {
<form action="../op/op.RemoveDocument.php" name="form1" method="post">
<input type="Hidden" name="documentid" value="<?php print $document->getID();?>">
<?php echo createHiddenFieldWithKey('removedocument'); ?>
<p><button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("rm_document");?></button></p>
<p><?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_document'),'','','danger');?></p>
</form>
<?php
$this->contentEnd();

View File

@ -47,9 +47,9 @@ class SeedDMS_View_RemoveDocumentFile extends SeedDMS_Theme_Style {
?>
<form action="../op/op.RemoveDocumentFile.php" name="form1" method="post">
<?php echo createHiddenFieldWithKey('removedocumentfile'); ?>
<input type="Hidden" name="documentid" value="<?php echo $document->getID()?>">
<input type="Hidden" name="fileid" value="<?php echo $file->getID()?>">
<button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("rm_file");?></button>
<input type="hidden" name="documentid" value="<?php echo $document->getID()?>">
<input type="hidden" name="fileid" value="<?php echo $file->getID()?>">
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_file'),'','','danger');?>
</form>
<?php
$this->contentEnd();

View File

@ -43,12 +43,12 @@ class SeedDMS_View_RemoveDump extends SeedDMS_Theme_Style {
$this->contentHeading(getMLText("dump_remove"));
?>
<form action="../op/op.RemoveDump.php" name="form1" method="post">
<input type="Hidden" name="dumpname" value="<?php echo htmlspecialchars($dumpname); ?>">
<input type="hidden" name="dumpname" value="<?php echo htmlspecialchars($dumpname); ?>">
<?php
echo createHiddenFieldWithKey('removedump');
$this->warningMsg(getMLText("confirm_rm_dump", array ("dumpname" => htmlspecialchars($dumpname))));
?>
<p><button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("dump_remove");?></button></p>
<p><?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('dump_remove'),'','','danger');?></p>
</form>
<?php
$this->contentEnd();

View File

@ -49,7 +49,7 @@ class SeedDMS_View_RemoveEvent extends SeedDMS_Bootstrap_Style {
<?php echo createHiddenFieldWithKey('removeevent'); ?>
<input type="hidden" name="eventid" value="<?php echo intval($event["id"]); ?>">
<p><?php printMLText("confirm_rm_event", array ("name" => htmlspecialchars($event["name"])));?></p>
<button class="btn" type="submit"><i class="fa fa-remove"></i> <?php printMLText("delete");?></button>
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('delete'),'','','neutral');?>
</form>
<?php
$this->contentContainerEnd();

View File

@ -49,7 +49,7 @@ class SeedDMS_View_RemoveGroup extends SeedDMS_Theme_Style {
<?php
$this->warningMsg(getMLText("confirm_rm_group", array ("groupname" => htmlspecialchars($group->getName()))));
?>
<p><button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("rm_group");?></button></p>
<p><?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_group'),'','','danger');?></p>
</form>
<?php
$this->contentEnd();

View File

@ -53,7 +53,7 @@ class SeedDMS_View_RemoveLog extends SeedDMS_Theme_Style {
}
$this->warningMsg(getMLText("confirm_rm_log", array ("logname" => implode(', ', $lognames))));
?>
<p><button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("rm_file");?></button></p>
<p><<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_file'),'','','danger');?>/p>
</form>
<?php
$this->contentEnd();

View File

@ -74,7 +74,7 @@ class SeedDMS_View_RemoveUser extends SeedDMS_Theme_Style {
?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("rm_user");?></button>
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_user'),'','','danger');?>
</div>
</div>

View File

@ -199,24 +199,24 @@ $(document).ready( function() {
}
}
echo "</tbody>\n</table>";
$options = array(array(0, getMLText('do_no_transfer_to_user')));
foreach ($allusers as $currUser) {
if ($currUser->isGuest() || ($currUser->getID() == $rmuser->getID()) )
continue;
$options = array(array(0, getMLText('do_no_transfer_to_user')));
foreach ($allusers as $currUser) {
if ($currUser->isGuest() || ($currUser->getID() == $rmuser->getID()) )
continue;
if ($rmuser && $currUser->getID()==$rmuser->getID()) $selected=$count;
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName()));
}
$this->formField(
getMLText("transfer_process_to_user"),
array(
'element'=>'select',
'name'=>'assignTo',
'class'=>'chzn-select',
'options'=>$options
)
);
echo '<button type="submit" class="btn btn-primary"><i class="fa fa-remove"></i> '.getMLText('transfer_processes_to_user').'</button>';
if ($rmuser && $currUser->getID()==$rmuser->getID()) $selected=$count;
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName()));
}
$this->formField(
getMLText("transfer_process_to_user"),
array(
'element'=>'select',
'name'=>'assignTo',
'class'=>'chzn-select',
'options'=>$options
)
);
$this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('transfer_processes_to_user'),'','','primary');
echo '</form>';
}
} /* }}} */

View File

@ -49,7 +49,7 @@ class SeedDMS_View_RemoveVersion extends SeedDMS_Theme_Style {
<?php echo createHiddenFieldWithKey('removeversion'); ?>
<input type="hidden" name="documentid" value="<?php echo $document->getID()?>">
<input type="hidden" name="version" value="<?php echo $version->getVersion()?>">
<p><button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("rm_version");?></button></p>
<p><?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_version'),'','','danger');?></p>
</form>
<?php
$this->contentEnd();

View File

@ -139,7 +139,7 @@ $(document).ready(function() {
<?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="action" value="removecategory">
<input type="hidden" name="categoryid" value="<?php echo $category->getID()?>">
<button type="submit" class="btn btn-danger" title="<?php echo getMLText("delete")?>"><i class="fa fa-remove"></i> <?php printMLText("rm_default_keyword_category");?></button>
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_default_keyword_category'),'','','danger');?>
</form>
</div>
@ -151,7 +151,7 @@ $(document).ready(function() {
<input type="hidden" name="action" value="editcategory">
<input type="hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input name="name" type="text" value="<?php echo htmlspecialchars($category->getName())?>">
<button type="submit" class="btn"><i class="fa fa-save"></i> <?php printMLText("save")?></button>
<?php $this->formSubmit('<i class="fa fa-save"></i> '.getMLText('save'),'','','neutral');?>
</div>
</div>
</form>
@ -170,14 +170,14 @@ $(document).ready(function() {
<input type="hidden" name="keywordsid" value="<?php echo $list["id"]?>">
<input type="hidden" name="action" value="editkeywords">
<input type="text" name="keywords" value="<?php echo htmlspecialchars($list["keywords"]) ?>">
<button type="submit" class="btn"><i class="fa fa-save"></i> <?php printMLText("save")?></button>
<?php $this->formSubmit('<i class="fa fa-save"></i> '.getMLText('save'),'','','neutral');?>
</form>
<form style="display: inline-block;" method="post" action="../op/op.UserDefaultKeywords.php" >
<?php echo createHiddenFieldWithKey('removekeywords'); ?>
<input type="hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input type="hidden" name="keywordsid" value="<?php echo $list["id"]?>">
<input type="hidden" name="action" value="removekeywords">
<button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("delete")?></button>
<?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('delete'),'','','danger');?>
</form>
<br>
<?php } ?>