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'); ?> <?php echo createHiddenFieldWithKey('removeattrdef'); ?>
<input type="hidden" name="attrdefid" value="<?php echo $selattrdef->getID()?>"> <input type="hidden" name="attrdefid" value="<?php echo $selattrdef->getID()?>">
<input type="hidden" name="action" value="removeattrdef"> <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> </form>
<?php <?php
} }

View File

@ -120,7 +120,7 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
<?php echo createHiddenFieldWithKey('removeevent'); ?> <?php echo createHiddenFieldWithKey('removeevent'); ?>
<input type="hidden" name="eventid" value="<?php echo intval($event["id"]); ?>"> <input type="hidden" name="eventid" value="<?php echo intval($event["id"]); ?>">
<p><?php printMLText("confirm_rm_event", array ("name" => htmlspecialchars($event["name"])));?></p> <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> </form>
<?php <?php
$this->contentContainerEnd(); $this->contentContainerEnd();

View File

@ -92,7 +92,7 @@ $(document).ready( function() {
<?php echo createHiddenFieldWithKey('removecategory'); ?> <?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="categoryid" value="<?php echo $selcat->getID()?>"> <input type="hidden" name="categoryid" value="<?php echo $selcat->getID()?>">
<input type="hidden" name="action" value="removecategory"> <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> </form>
<?php <?php
} }

View File

@ -87,7 +87,7 @@ $(document).ready( function() {
<?php echo createHiddenFieldWithKey('removecategory'); ?> <?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="categoryid" value="<?php echo $selcategory->getId(); ?>"> <input type="hidden" name="categoryid" value="<?php echo $selcategory->getId(); ?>">
<input type="hidden" name="action" value="removecategory"> <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> </form>
<?php <?php
} }
@ -185,7 +185,7 @@ $(document).ready( function() {
<input type="Hidden" name="action" value="newkeywords"> <input type="Hidden" name="action" value="newkeywords">
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>"> <input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input type="text" class="keywords form-control" name="keywords">&nbsp; <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> </form>
</div> </div>
</div> </div>

View File

@ -122,7 +122,7 @@ $(document).ready(function() {
</div> </div>
</div> </div>
<div class="controls"> <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> </div>
</form> </form>
<?php <?php

View File

@ -152,9 +152,7 @@ $(document).ready(function() {
<?php <?php
if($user->getId() == $luser->getId()) { if($user->getId() == $luser->getId()) {
echo $this->warningMsg(getMLText('edit_online_warning')); echo $this->warningMsg(getMLText('edit_online_warning'));
?> $this->formSubmit('<i class="fa fa-save"></i> '.getMLText('save'),'update','','primary');
<button id="update" type="submit" class="btn btn-primary"><i class="fa fa-save"></i> <?php printMLText("save"); ?></button>
<?php
} else { } else {
echo $this->errorMsg(getMLText('edit_online_not_allowed')); 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"> <form action="../op/op.RemoveArchive.php" name="form1" method="post">
<input type="hidden" name="arkname" value="<?php echo htmlspecialchars($arkname); ?>"> <input type="hidden" name="arkname" value="<?php echo htmlspecialchars($arkname); ?>">
<?php echo createHiddenFieldWithKey('removearchive'); ?> <?php echo createHiddenFieldWithKey('removearchive'); ?>
<p><button type="submit" class="btn btn-danger"><i class="fa fa-remove"></i> <?php printMLText("backup_remove");?></button></p> <p><?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('backup_remove'),'','','danger');?></p>
</form> </form>
<?php <?php
$this->contentEnd(); $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"> <form action="../op/op.RemoveDocument.php" name="form1" method="post">
<input type="Hidden" name="documentid" value="<?php print $document->getID();?>"> <input type="Hidden" name="documentid" value="<?php print $document->getID();?>">
<?php echo createHiddenFieldWithKey('removedocument'); ?> <?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> </form>
<?php <?php
$this->contentEnd(); $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"> <form action="../op/op.RemoveDocumentFile.php" name="form1" method="post">
<?php echo createHiddenFieldWithKey('removedocumentfile'); ?> <?php echo createHiddenFieldWithKey('removedocumentfile'); ?>
<input type="Hidden" name="documentid" value="<?php echo $document->getID()?>"> <input type="hidden" name="documentid" value="<?php echo $document->getID()?>">
<input type="Hidden" name="fileid" value="<?php echo $file->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> <?php $this->formSubmit('<i class="fa fa-remove"></i> '.getMLText('rm_file'),'','','danger');?>
</form> </form>
<?php <?php
$this->contentEnd(); $this->contentEnd();

View File

@ -43,12 +43,12 @@ class SeedDMS_View_RemoveDump extends SeedDMS_Theme_Style {
$this->contentHeading(getMLText("dump_remove")); $this->contentHeading(getMLText("dump_remove"));
?> ?>
<form action="../op/op.RemoveDump.php" name="form1" method="post"> <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 <?php
echo createHiddenFieldWithKey('removedump'); echo createHiddenFieldWithKey('removedump');
$this->warningMsg(getMLText("confirm_rm_dump", array ("dumpname" => htmlspecialchars($dumpname)))); $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> </form>
<?php <?php
$this->contentEnd(); $this->contentEnd();

View File

@ -49,7 +49,7 @@ class SeedDMS_View_RemoveEvent extends SeedDMS_Bootstrap_Style {
<?php echo createHiddenFieldWithKey('removeevent'); ?> <?php echo createHiddenFieldWithKey('removeevent'); ?>
<input type="hidden" name="eventid" value="<?php echo intval($event["id"]); ?>"> <input type="hidden" name="eventid" value="<?php echo intval($event["id"]); ?>">
<p><?php printMLText("confirm_rm_event", array ("name" => htmlspecialchars($event["name"])));?></p> <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> </form>
<?php <?php
$this->contentContainerEnd(); $this->contentContainerEnd();

View File

@ -49,7 +49,7 @@ class SeedDMS_View_RemoveGroup extends SeedDMS_Theme_Style {
<?php <?php
$this->warningMsg(getMLText("confirm_rm_group", array ("groupname" => htmlspecialchars($group->getName())))); $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> </form>
<?php <?php
$this->contentEnd(); $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)))); $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> </form>
<?php <?php
$this->contentEnd(); $this->contentEnd();

View File

@ -74,7 +74,7 @@ class SeedDMS_View_RemoveUser extends SeedDMS_Theme_Style {
?> ?>
<div class="control-group"> <div class="control-group">
<div class="controls"> <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>
</div> </div>

View File

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

View File

@ -49,7 +49,7 @@ class SeedDMS_View_RemoveVersion extends SeedDMS_Theme_Style {
<?php echo createHiddenFieldWithKey('removeversion'); ?> <?php echo createHiddenFieldWithKey('removeversion'); ?>
<input type="hidden" name="documentid" value="<?php echo $document->getID()?>"> <input type="hidden" name="documentid" value="<?php echo $document->getID()?>">
<input type="hidden" name="version" value="<?php echo $version->getVersion()?>"> <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> </form>
<?php <?php
$this->contentEnd(); $this->contentEnd();

View File

@ -139,7 +139,7 @@ $(document).ready(function() {
<?php echo createHiddenFieldWithKey('removecategory'); ?> <?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="action" value="removecategory"> <input type="hidden" name="action" value="removecategory">
<input type="hidden" name="categoryid" value="<?php echo $category->getID()?>"> <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> </form>
</div> </div>
@ -151,7 +151,7 @@ $(document).ready(function() {
<input type="hidden" name="action" value="editcategory"> <input type="hidden" name="action" value="editcategory">
<input type="hidden" name="categoryid" value="<?php echo $category->getID()?>"> <input type="hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input name="name" type="text" value="<?php echo htmlspecialchars($category->getName())?>"> <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>
</div> </div>
</form> </form>
@ -170,14 +170,14 @@ $(document).ready(function() {
<input type="hidden" name="keywordsid" value="<?php echo $list["id"]?>"> <input type="hidden" name="keywordsid" value="<?php echo $list["id"]?>">
<input type="hidden" name="action" value="editkeywords"> <input type="hidden" name="action" value="editkeywords">
<input type="text" name="keywords" value="<?php echo htmlspecialchars($list["keywords"]) ?>"> <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>
<form style="display: inline-block;" method="post" action="../op/op.UserDefaultKeywords.php" > <form style="display: inline-block;" method="post" action="../op/op.UserDefaultKeywords.php" >
<?php echo createHiddenFieldWithKey('removekeywords'); ?> <?php echo createHiddenFieldWithKey('removekeywords'); ?>
<input type="hidden" name="categoryid" value="<?php echo $category->getID()?>"> <input type="hidden" name="categoryid" value="<?php echo $category->getID()?>">
<input type="hidden" name="keywordsid" value="<?php echo $list["id"]?>"> <input type="hidden" name="keywordsid" value="<?php echo $list["id"]?>">
<input type="hidden" name="action" value="removekeywords"> <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> </form>
<br> <br>
<?php } ?> <?php } ?>