Newer
Older
if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied');
$info=array();
$qstr='';
if($team && $_REQUEST['a']!='add'){
//Editing Team
$title='Update Team';
$action='update';
$submit_text='Save Changes';
$info=$team->getInfo();
$info['id']=$team->getId();
$qstr.='&id='.$team->getId();
}else {
$title='Add New Team';
$action='create';
$submit_text='Create Team';
$info['isenabled']=1;
$info['noalerts']=0;
$qstr.='&a='.$_REQUEST['a'];
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="teams.php?<?php echo $qstr; ?>" method="post" id="save">
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<input type="hidden" name="do" value="<?php echo $action; ?>">
<input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
<input type="hidden" name="id" value="<?php echo $info['id']; ?>">
<h2>Team</h2>
<table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
<thead>
<tr>
<th colspan="2">
<h4><?php echo $title; ?></h4>
<em><strong>Team Information</strong>: Disabled team won't be availabe for ticket assignment or alerts.</em>
</th>
</tr>
</thead>
<tbody>
<tr>
<td width="180" class="required">
Name:
</td>
<td>
<input type="text" size="30" name="name" value="<?php echo $info['name']; ?>">
<span class="error">* <?php echo $errors['name']; ?></span>
</td>
</tr>
<tr>
<td width="180" class="required">
Status:
</td>
<td>
<input type="radio" name="isenabled" value="1" <?php echo $info['isenabled']?'checked="checked"':''; ?>><strong>Active</strong>
<input type="radio" name="isenabled" value="0" <?php echo !$info['isenabled']?'checked="checked"':''; ?>><strong>Disabled</strong>
<span class="error">* </span>
</td>
</tr>
<tr>
<td width="180">
Team Lead:
</td>
<td>
<select name="lead_id">
<option value="0">— None —</option>
<option value="" disabled="disabled">Select Team Lead (Optional)</option>
<?php
if($team && ($members=$team->getMembers())){
foreach($members as $k=>$staff){
$selected=($info['lead_id'] && $staff->getId()==$info['lead_id'])?'selected="selected"':'';
echo sprintf('<option value="%d" %s>%s</option>',$staff->getId(),$selected,$staff->getName());
}
}
?>
</select>
<span class="error"> <?php echo $errors['lead_id']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Assignment Alerts:
</td>
<td>
<input type="checkbox" name="noalerts" value="1" <?php echo $info['noalerts']?'checked="checked"':''; ?> >
<strong>Disable</strong> assignment alerts for this team (<i>override global settings.</i>)
</td>
</tr>
<?php
if($team && ($members=$team->getMembers())){ ?>
<tr>
<th colspan="2">
<em><strong>Team Members</strong>: To add additional members go to target member's profile </em>
</th>
</tr>
<?php
foreach($members as $k=>$staff){
echo sprintf('<tr><td colspan=2><span style="width:350px;padding-left:5px; display:block; float:left;">
<b><a href="staff.php?id=%d">%s</a></span></b>
<input type="checkbox" name="remove[]" value="%d"><i>Remove</i></td></tr>',
$staff->getId(),$staff->getName(),$staff->getId());
}
} ?>
<tr>
<th colspan="2">
<em><strong>Admin Notes</strong>: Internal notes viewable by all admins. </em>
</th>
</tr>
<tr>
<td colspan=2>
<textarea class="richtext no-bar" name="notes" cols="21"
rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
</td>
</tr>
</tbody>
</table>
<p style="padding-left:225px;">
<input type="submit" name="submit" value="<?php echo $submit_text; ?>">
<input type="reset" name="reset" value="Reset">
<input type="button" name="cancel" value="Cancel" onclick='window.location.href="teams.php"'>
</p>
</form>