Fixed options and user editing issues.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2621 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan
2008-09-01 14:05:06 +00:00
parent 59ba3d4782
commit 45190dee61
4 changed files with 12 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
function configureButton( element )
{
var form = element.form;
var checked = element.checked;
if ( !element.checked )
{

View File

@@ -20,6 +20,13 @@ function validateForm( form, newUser )
{
errors[errors.length] = "You must supply a password";
}
var monitorIds = new Array();
for ( var i = 0; i < form.elements['monitorIds'].options.length; i++ )
{
if ( form.elements['monitorIds'].options[i].selected )
monitorIds[monitorIds.length] = form.elements['monitorIds'].options[i].value;
}
form.elements['newUser[MonitorIds]'].value = monitorIds.join( ',' );
if ( errors.length )
{
alert( errors.join( "\n" ) );
@@ -27,8 +34,3 @@ function validateForm( form, newUser )
}
return( true );
}
function selectRestrictedMonitors()
{
createPopup( '?view=monitorselect&callForm=contentForm&callField=newUser[MonitorIds]', "zmRestrictedMonitors", 'monitorselect' );
}

View File

@@ -131,7 +131,7 @@ if ( $_REQUEST['tab'] == "users" )
<td class="colSystem"><?= $row['System'] ?></td>
<td class="colBandwidth"><?= $row['MaxBandwidth']?$bwArray[$row['MaxBandwidth']]:'&nbsp;' ?></td>
<td class="colMonitor"><?= $row['MonitorIds']?(join( ", ", $userMonitors )):"&nbsp;" ?></td>
<td class="colMark"><input type="checkbox" name="markUids[]" value="<?= $row['Id'] ?>" onclick="configureButton( this, 'markUids' );"<?php if ( !canEdit( 'System' ) ) { ?> disabled="disabled"<?php } ?>/></td>
<td class="colMark"><input type="checkbox" name="markUids[]" value="<?= $row['Id'] ?>" onclick="configureButton( this );"<?php if ( !canEdit( 'System' ) ) { ?> disabled="disabled"<?php } ?>/></td>
</tr>
<?php
}
@@ -139,7 +139,7 @@ if ( $_REQUEST['tab'] == "users" )
</tbody>
</table>
<div id="contentButtons">
<input type="button" value="<?= $SLANG['AddNewUser'] ?>" onclick="createPopup( '?view=user&uid=-1', 'zmUser', 'user' );"<?php if ( !canEdit( 'System' ) ) { ?> disabled="disabled"<?php } ?>/><input type="submit" name="deleteBtn" value="<?= $SLANG['Delete'] ?>" disabled="disabled"/><input type="button" value="<?= $SLANG['Cancel'] ?>" onclick="closeWindow();"/>
<input type="button" value="<?= $SLANG['AddNewUser'] ?>" onclick="createPopup( '?view=user&uid=0', 'zmUser', 'user' );"<?php if ( !canEdit( 'System' ) ) { ?> disabled="disabled"<?php } ?>/><input type="submit" name="deleteBtn" value="<?= $SLANG['Delete'] ?>" disabled="disabled"/><input type="button" value="<?= $SLANG['Cancel'] ?>" onclick="closeWindow();"/>
</div>
</form>
<?php

View File

@@ -63,6 +63,7 @@ xhtmlHeaders(__FILE__, $SLANG['User']." - ".$newUser['Username'] );
<input type="hidden" name="view" value="<?= $_REQUEST['view'] ?>"/>
<input type="hidden" name="action" value="user"/>
<input type="hidden" name="uid" value="<?= $_REQUEST['uid'] ?>"/>
<input type="hidden" name="newUser[MonitorIds]" value="<?= $newUser['MonitorIds'] ?>"/>
<table id="contentTable" class="major" cellspacing="0">
<tbody>
<?php
@@ -123,7 +124,7 @@ if ( canEdit( 'System' ) )
<tr>
<th scope="row"><?= $SLANG['RestrictedMonitors'] ?></th>
<td>
<select name="newUser[MonitorIds]" size="4" multiple="multiple">
<select name="monitorIds" size="4" multiple="multiple">
<?php
foreach ( $monitors as $monitor )
{