Skip to content

Commit

Permalink
improvement/devel: refreshed node group forms
Browse files Browse the repository at this point in the history
  • Loading branch information
chilek committed Jun 11, 2021
1 parent dd5350d commit a82a9b5
Show file tree
Hide file tree
Showing 5 changed files with 318 additions and 265 deletions.
3 changes: 3 additions & 0 deletions lib/locale/pl_PL/strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,9 @@
$_LANG['Map'] = 'Mapa';
$_LANG['Medium'] = 'Średni';
$_LANG['Members:'] = 'Członkowie:';
$_LANG['Members'] = 'Członkowie';
$_LANG['Members Count:'] = 'Liczba członków:';
$_LANG['Members Count'] = 'Liczba członków';
$_LANG['Message:'] = 'Wiadomość:';
$_LANG['Message body:'] = 'Treść wiadomości:';
$_LANG['Show message body'] = 'Pokaż treść wiadomości';
Expand Down Expand Up @@ -2606,6 +2608,7 @@
$_LANG['Are you sure, you want to delete that group?'] = 'Jesteś pewien, że chcesz usunąć tę grupę?';
$_LANG['Are you sure, you want to move members to selected group?'] = 'Czy jesteś pewien, że chcesz przenieść członków do wybranej grupy?';
$_LANG['Move members to group:'] = 'Przenieś członków do grupy:';
$_LANG['Move members to group'] = 'Przenieś członków do grupy';
$_LANG['Select group to which you want to move members'] = 'Wybierz grupę, do której chcesz przenieść członków';
$_LANG['Default period value for assignment. Default: 0'] = 'Domyślna wartość okresu obciążenia. Domyślnie: 0';
$_LANG['Customer has got nodes in group(s): <b>$a</b>!'] = 'Komputer(y) klienta należą do grup(y): <b>$a</b>!';
Expand Down
103 changes: 58 additions & 45 deletions templates/default/node/nodegroupadd.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,62 @@
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
<FORM METHOD="POST" NAME="nodegroupadd" ACTION="?m=nodegroupadd">
<INPUT type="submit" class="hiddenbtn">
<TABLE class="lmsbox">
<THEAD>
<TR>
<TD WIDTH="1%">
<IMG SRC="img/nodegroup.gif" ALT="">
</TD>
<TD WIDTH="1%">
<B>{trans("Name:")}</B>
</TD>
<TD WIDTH="98%">
<INPUT TYPE="TEXT" NAME="nodegroupadd[name]" VALUE="{$nodegroupadd.name}" required {tip trigger="name" bold=1}>
</TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD WIDTH="1%">
<IMG SRC="img/info1.gif" ALT="">
</TD>
<TD WIDTH="1%">
<B>{trans("Description:")}</B>
</TD>
<TD WIDTH="98%">
<TEXTAREA NAME="nodegroupadd[description]" COLS="50" ROWS="5" {tip text="Enter additional information (optional)"}>{$nodegroupadd.description}</TEXTAREA>
</TD>
</TR>
<TR>
<TD WIDTH="100%" COLSPAN="3" ALIGN="RIGHT">
<A HREF="javascript:document.nodegroupadd.submit();" accesskey="s">{trans("Submit")} <IMG SRC="img/save.gif" alt=""></A>
<A HREF="?m=nodegrouplist">{trans("Cancel")} <IMG SRC="img/cancel.gif" alt=""></A><BR>
<INPUT type="checkbox" name="nodegroupadd[reuse]" id="reuse" value="ON" {if $nodegroupadd.reuse}checked{/if}><label for="reuse">{trans("Display this form again, when this group is saved")}</label>
</TD>
</TR>
</TBODY>
</TABLE></FORM>
<SCRIPT type="text/javascript">
<!--
$(function() {
$('form[name="nodegroupadd"] [name="nodegroupadd[name]"]').focus();
});
//-->
</SCRIPT>
<h1>{$layout.pagetitle}</h1>
<form method="POST" name="nodegroupadd" action="?m=nodegroupadd">
<input type="submit" class="hiddenbtn">
<table class="lmsbox">
<colgroup>
<col style="width: 1%;">
<col style="width: 1%;">
<col style="width: 98%;">
</colgroup>
<thead>
<tr>
<td>
{icon name="nodegroup"}
</td>
<td>
<strong>{trans("Name")}</strong>
</td>
<td>
<input type="text" name="nodegroupadd[name]"
value="{$nodegroupadd.name|escape}" required {tip trigger="name" bold=1}>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
{icon name="info"}
</td>
<td>
<strong>{trans("Description:")}</strong>
</td>
<td>
<textarea name="nodegroupadd[description]" cols="50" rows="5"
{tip text="Enter additional information (optional)"}>{$nodegroupadd.description|escape}</textarea>
</td>
</tr>
<tr>
<td colspan="3" class="lms-ui-box-buttons">
{button type="submit" icon="save" label="Submit"}
{button icon="cancel" label="Cancel" href="?m=nodegrouplist"}
<label>
<input type="checkbox" name="nodegroupadd[reuse]" value="ON"
{if $nodegroupadd.reuse} checked{/if}>
{trans("Display this form again, when this group is saved")}
</label>
</td>
</tr>
</tbody>
</table>
</form>

<script>

$(function() {
$('[name="nodegroupadd[name]"]').focus();
});

</script>
{/block}
136 changes: 74 additions & 62 deletions templates/default/node/nodegroupedit.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,82 @@
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ -->
<H1>{$layout.pagetitle}</H1>
<TABLE class="lmsbox">
<FORM METHOD="POST" NAME="tedit" ACTION="?m=nodegroupedit&amp;id={$nodegroup.id}">
<INPUT type="submit" class="hiddenbtn">
<THEAD>
<TR>
<TD WIDTH="1%">
<IMG SRC="img/nodegroup.gif" alt="">
</TD>
<TD WIDTH="1%" NOWRAP>
<B>{trans("Name:")}</B>
</TD>
<TD WIDTH="98%">
<INPUT TYPE="TEXT" VALUE="{$nodegroup.name}" NAME="nodegroup[name]" required {tip trigger="name" bold=1}>
<B>&nbsp;({$nodegroup.id|string_format:"%04d"})</B>
</TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD WIDTH="1%">
<IMG SRC="img/info1.gif" alt="">
</TD>
<TD WIDTH="1%">
<B>{trans("Description:")}</B>
</TD>
<TD WIDTH="98%">
<TEXTAREA ROWS="5" COLS="50" NAME="nodegroup[description]" {tip text="Enter additional information (optional)"}>{$nodegroup.description}</TEXTAREA>
</TD>
</TR>
</FORM>
<TR>
<TD WIDTH="100%" COLSPAN="3" ALIGN="RIGHT">
{if count($nodegroups) > 1 && $nodegroup.count}
<FORM name="tmove" method="get" action="">
<input type="hidden" name="is_sure" value="1">
<input type="hidden" name="m" value="nodegroupmove">
<input type="hidden" name="from" value="{$nodegroup.id}">
<A id="move-members" HREF="#">{trans("Move members to group:")}</A>
<SELECT SIZE="1" NAME="to" {tip text="Select group to which you want to move members"}>
{foreach from=$nodegroups item=item}{if $item.id != $nodegroup.id}
<OPTION VALUE="{$item.id}">{$item.name}</OPTION>
{/if}{/foreach}
</SELECT>
</FORM>
{/if}
<A HREF="javascript:document.tedit.submit();" ACCESSKEY="S">{trans("Submit")} <IMG SRC="img/save.gif" ALT=""></A>
<A HREF="?m=nodegroupinfo&amp;id={$nodegroup.id}{if $membersnetid}&membersnetid={$membersnetid}{/if}{if $othersnetid}&othersnetid={$othersnetid}{/if}">{trans("Cancel")} <IMG SRC="img/cancel.gif" ALT=""></A>
</TD>
</TR>
</TBODY>
</TABLE>
<SCRIPT>
$(function() {
$('forms[name="tedit"] [name="nodegroup[name]"]').focus();
});
<h1>{$layout.pagetitle}</h1>
<form method="POST" name="tedit" id="tedit" action="?m=nodegroupedit&id={$nodegroup.id}">
<input type="submit" class="hiddenbtn">
</form>
<table class="lmsbox">
<colgroup>
<col style="width: 1%;">
<col style="width: 1%;">
<col style="width: 98%;">
</colgroup>
<thead>
<tr>
<td>
{icon name="nodegroup"}
</td>
<TD class="nobr">
<strong>{trans("Name")}</strong>
</TD>
<td>
<input type="text" value="{$nodegroup.name|escape}" name="nodegroup[name]" required form="tedit"
{tip trigger="name" bold=1}>
<strong>(#{$nodegroup.id})</strong>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
{icon name="info"}
</td>
<td>
<strong>{trans("Description")}</strong>
</td>
<td>
<textarea rows="5" cols="50" name="nodegroup[description]" form="tedit"
{tip text="Enter additional information (optional)"}>{$nodegroup.description|escape}</textarea>
</td>
</tr>
<tr>
<td colspan="3" class="lms-ui-box-buttons">
{if count($nodegroups) > 1 && $nodegroup.count}
<form name="tmove" id="tmove" method="get" action="">
<input type="hidden" name="is_sure" value="1">
<input type="hidden" name="m" value="nodegroupmove">
<input type="hidden" name="from" value="{$nodegroup.id}">
{button label="Move members to group" id="move-members" icon="move"}
<select size="1" name="to" {tip text="Select group to which you want to move members"}>
{foreach $nodegroups as $item}
{if $item.id != $nodegroup.id}
<option value="{$item.id}">{$item.name|escape}</option>
{/if}
{/foreach}
</select>
</form>
{/if}
{button type="submit" icon="save" label="Submit" form="tedit"}
{button icon="cancel" label="Cancel"
href="?m=nodegroupinfo&id={$nodegroup.id}{if $membersnetid}&membersnetid={$membersnetid}{/if}{if $othersnetid}&othersnetid={$othersnetid}{/if}"}
</td>
</tr>
</tbody>
</table>

$('#move-members').click(function() {
confirmDialog($t("Are you sure, you want to move members to selected group?"), this).done(function() {
document.tmove.submit();
<script>

$(function() {
$('[name="nodegroup[name]"]').focus();

$('#move-members').click(function() {
confirmDialog($t("Are you sure, you want to move members to selected group?"), this).done(function() {
$('#tmove').submit();
});
return false;
});
});
return false;
});

</SCRIPT>
</script>
{include file="node/nodegroupassignments.html"}
{/block}
120 changes: 67 additions & 53 deletions templates/default/node/nodegroupinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,74 @@
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
<P><TABLE class="lmsbox">
<THEAD>
<TR>
<TD WIDTH="1%">
<IMG SRC="img/nodegroup.gif" ALT="">
</TD>
<TD WIDTH="99%" COLSPAN="2" NOWRAP>
<B>{$nodegroup.name} ({$nodegroup.id|string_format:"%04d"})</B>
</TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD WIDTH="1%">
<IMG SRC="img/node.gif" ALT="">
</TD>
<TD WIDTH="1%" NOWRAP><B>{trans("Members Count:")}</B>
</TD>
<TD WIDTH="98%">
{$nodegroup.count}
</TD>
</TR>
{if $nodegroup.description}
<TR>
<TD WIDTH="1%">
<IMG SRC="img/info1.gif" ALT="">
</TD>
<TD WIDTH="98%" COLSPAN="2">
<TABLE WIDTH="100%" CELLPADDING="3">
<TR><TD CLASS="fall superlight">
{$nodegroup.description|replace:"\n":"<BR>"}
</TD></TR>
</TABLE>
</TD>
</TR>
{/if}
<TR>
<TD ALIGN="RIGHT" COLSPAN="3">
<A HREF="?m=nodegroupedit&amp;id={$nodegroup.id}{if $membersnetid}&membersnetid={$membersnetid}{/if}{if $othersnetid}&othersnetid={$othersnetid}{/if}" ACCESSKEY="E">{trans("Edit")} <IMG SRC="img/edit.gif" ALT=""></A>
{if !$nodegroup.count}
<A id="delete-nodegroup" HREF="?m=nodegroupdel&amp;id={$nodegroup.id}">{trans("Delete")} <IMG SRC="img/delete.gif" ALT=""></A>
{/if}
</TD>
</TR>
</TBODY>
</TABLE></P>
<h1>{$layout.pagetitle}</h1>
<table class="lmsbox">
<colgroup>
<col style="width: 1%;">
<col style="width: 1%;">
<col style="width: 98%;">
</colgroup>
<thead>
<tr>
<td>
{icon name="nodegroup"}
</TD>
<td colspan="2" class="nobr">
<strong>{$nodegroup.name|escape} (#{$nodegroup.id})</strong>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
{icon name="node"}
</td>
<td class="nobr">
<strong>{trans("Members Count")}</strong>
</td>
<td>
{$nodegroup.count}
</td>
</tr>
{if $nodegroup.description}
<tr>
<td>
{icon name="info"}
</td>
<td colspan="2">
<table style="width: 100%;" cellpadding="3">
<tr>
<td class="fall superlight">
{$nodegroup.description|escape|replace:"\n":"<BR>"}
</td>
</tr>
</table>
</td>
</tr>
{/if}
<tr>
<td colspan="3" class="lms-ui-box-buttons">
{button icon="edit" label="Edit"
href="?m=nodegroupedit&id={$nodegroup.id}{if $membersnetid}&membersnetid={$membersnetid}{/if}{if $othersnetid}&othersnetid={$othersnetid}{/if}"}
{if !$nodegroup.count}
{button icon="delete" label="Delete" id="delete-nodegroup" data_href="?m=nodegroupdel&id={$nodegroup.id}"}
{/if}
</td>
</tr>
</tbody>
</table>

{include file="node/nodegroupassignments.html"}
<script>
$('#delete-nodegroup').click(function() {
confirmDialog($t("Are you sure, you want to delete that group?"), this).done(function() {
location.href = $(this).attr('href');

<script>

$(function() {
$('#delete-nodegroup').click(function () {
confirmDialog($t("Are you sure, you want to delete that group?"), this).done(function () {
location.href = $(this).attr('data-href');
});
return false;
});
</script>
});

</script>
{/block}
Loading

0 comments on commit a82a9b5

Please sign in to comment.