Skip to content
Snippets Groups Projects
Commit 605c9daa authored by Peter Rotich's avatar Peter Rotich
Browse files

Consolidate SLAs selection/list.

parent 9fe88a86
No related branches found
No related tags found
No related merge requests found
......@@ -108,11 +108,10 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
<select name="sla_id">
<option value="0">&mdash; System default &mdash;</option>
<?php
$sql='SELECT id,name FROM '.SLA_TABLE.' sla ORDER by name';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){
$selected=($info['sla_id'] && $id==$info['sla_id'])?'selected="selected"':'';
echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$name);
if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['sla_id']==$id)?'selected="selected"':'',$name);
}
}
?>
......
......@@ -258,13 +258,12 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
</td>
<td>
<select name="sla_id">
<option value="0">&mdash; Default &mdash;</option>
<option value="0">&mdash; System Default &mdash;</option>
<?php
$sql='SELECT id,name FROM '.SLA_TABLE.' sla ORDER by name';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){
$selected=($info['sla_id'] && $id==$info['sla_id'])?'selected="selected"':'';
echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$name);
if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['sla_id']==$id)?'selected="selected"':'',$name);
}
}
?>
......
......@@ -137,11 +137,10 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
<select name="sla_id">
<option value="0">&mdash; Department's Default &mdash;</option>
<?php
$sql='SELECT id,name FROM '.SLA_TABLE.' sla ORDER by name';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){
$selected=($info['sla_id'] && $id==$info['sla_id'])?'selected="selected"':'';
echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$name);
if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['sla_id']==$id)?'selected="selected"':'',$name);
}
}
?>
......
......@@ -34,11 +34,12 @@ if(!($maxfileuploads=ini_get('max_file_uploads')))
<select name="default_sla_id">
<option value="0">&mdash; None &mdash;</option>
<?php
$sql='SELECT id,name FROM '.SLA_TABLE.' sla ORDER by name';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){
$selected=($config['default_sla_id'] && $id==$config['default_sla_id'])?'selected="selected"':'';
echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$name);
if($slas=SLA::getSLAs()) {
foreach($slas as $id => $name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id,
($config['default_sla_id'] && $id==$config['default_sla_id'])?'selected="selected"':'',
$name);
}
}
?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment