Subversion Repositories VORC

Rev

Rev 65 | Rev 121 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 65 Rev 97
Line 106... Line 106...
106
  
106
  
107
	return $optionList;
107
	return $optionList;
Line 108... Line 108...
108
}
108
}
-
 
109
 
-
 
110
sub fetchDerbyNameWithRCid {
-
 
111
  my $ATTRIBUTES;
-
 
112
  if (ref $_[0] eq "HASH") {
109
 
113
    $ATTRIBUTES = shift;
110
sub fetchDerbyNameWithRCid {
114
  }
111
  my $DEPT = shift // "";
115
  my $DEPT = shift // "";
Line 112... Line 116...
112
  my $selected = shift // "";
116
  my $selected = shift // "";
113
	my $optionList = "";
117
	my $optionList = "";
114
	
118
	
115
	my $cathan;
119
	my $cathan;
116
	if (!$DEPT or $DEPT eq "CMP") {
120
	if (!$DEPT or $DEPT eq "CMP") {
117
	  $cathan = $internalDBH->prepare("select RCid, derby_name from official where level > 0 order by derby_name");
121
	  $cathan = $internalDBH->prepare("select RCid, derby_name from official where access > 0 order by derby_name");
118
  	$cathan->execute();
122
  	$cathan->execute();
119
  } elsif ($DEPT eq "CLA") {
123
  } elsif ($DEPT eq "CLA") {
120
    $cathan = $internalDBH->prepare("select RCid, derby_name from v_official where level > 0 and isnull(MVPid) = false and last_login > CURRENT_DATE - INTERVAL 365 DAY order by derby_name");
124
    $cathan = $internalDBH->prepare("select RCid, derby_name from v_official where access > 0 and isnull(MVPid) = false and last_login > CURRENT_DATE - INTERVAL 365 DAY order by derby_name");
121
    $cathan->execute;
125
    $cathan->execute;
122
	} else {
126
	} else {
123
    $cathan = $internalDBH->prepare("select RCid, derby_name from official where level > 0 and (department like ? and department not like ?) and last_login > CURRENT_DATE - INTERVAL 365 DAY order by derby_name");
127
    $cathan = $internalDBH->prepare("select RCid, derby_name from official where access > 0 and (department like ? and department not like ?) and last_login > CURRENT_DATE - INTERVAL 365 DAY order by derby_name");
-
 
128
    $cathan->execute("%".$DEPT."%", "%".$DEPT."-0%");
124
    $cathan->execute("%".$DEPT."%", "%".$DEPT."-0%");
129
	}
125
	}
130
  
126
 
131
  my $valuelabel = $ATTRIBUTES->{DATALIST} ? "data-value" : "value";
127
	while (my ($id, $cat) = $cathan->fetchrow) {
132
	while (my ($id, $cat) = $cathan->fetchrow) {
128
	  if ($id == $selected) {
133
	  if ($id == $selected) {
129
	    $optionList .= "<OPTION value=$id selected>$cat</OPTION>";
134
	    $optionList .= "<OPTION $valuelabel=$id selected>$cat</OPTION>";
130
	  } else {
135
	  } else {
Line 131... Line 136...
131
	    $optionList .= "<OPTION value=$id>$cat</OPTION>";
136
	    $optionList .= "<OPTION $valuelabel=$id>$cat</OPTION>";
132
	  }
137
	  }