mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fixed bug with required attributes being a userlist
SVN revision: 1826
This commit is contained in:
parent
0e4120c5b1
commit
dd07b4c969
27
src/elogd.c
27
src/elogd.c
@ -8551,7 +8551,7 @@ void ricon(char *name, char *comment, char *onclick)
|
|||||||
rsprintf(" onclick=\"%s\"", onclick);
|
rsprintf(" onclick=\"%s\"", onclick);
|
||||||
rsprintf(" onmousedown=\"document.images.%s.src='icons/eld_%s.png'\"", name, name);
|
rsprintf(" onmousedown=\"document.images.%s.src='icons/eld_%s.png'\"", name, name);
|
||||||
rsprintf(" onmouseup=\"document.images.%s.src='icons/elc_%s.png'\"", name, name);
|
rsprintf(" onmouseup=\"document.images.%s.src='icons/elc_%s.png'\"", name, name);
|
||||||
rsprintf(" onmouseover=\"this.style.cursor='hand';\" />");
|
rsprintf(" onmouseover=\"this.style.cursor='pointer';\" />");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
@ -8563,7 +8563,7 @@ void rsicon(char *name, char *comment, char *elcode)
|
|||||||
rsprintf(" onclick=\"elcode(document.form1.Text, '','%s')\"", elcode);
|
rsprintf(" onclick=\"elcode(document.form1.Text, '','%s')\"", elcode);
|
||||||
rsprintf(" onmousedown=\"document.images.%s.src='icons/eld_%s.png'\"", name, name);
|
rsprintf(" onmousedown=\"document.images.%s.src='icons/eld_%s.png'\"", name, name);
|
||||||
rsprintf(" onmouseup=\"document.images.%s.src='icons/elc_%s.png'\"", name, name);
|
rsprintf(" onmouseup=\"document.images.%s.src='icons/elc_%s.png'\"", name, name);
|
||||||
rsprintf(" onmouseover=\"this.style.cursor='hand';\" />");
|
rsprintf(" onmouseover=\"this.style.cursor='pointer';\" />");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
@ -9008,7 +9008,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
/* convert dots to underscores */
|
/* convert dots to underscores */
|
||||||
dtou(ua);
|
dtou(ua);
|
||||||
|
|
||||||
if (attr_flags[i] & (AF_MULTI | AF_MUSERLIST)) {
|
if (attr_flags[i] & AF_MULTI) {
|
||||||
rsprintf(" if (\n");
|
rsprintf(" if (\n");
|
||||||
for (j = 0; j < MAX_N_LIST && attr_options[i][j][0]; j++) {
|
for (j = 0; j < MAX_N_LIST && attr_options[i][j][0]; j++) {
|
||||||
sprintf(str, "%s_%d", ua, j);
|
sprintf(str, "%s_%d", ua, j);
|
||||||
@ -9023,6 +9023,25 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf(" return false;\n");
|
rsprintf(" return false;\n");
|
||||||
rsprintf(" }\n");
|
rsprintf(" }\n");
|
||||||
|
|
||||||
|
} else if (attr_flags[i] & AF_MUSERLIST) {
|
||||||
|
rsprintf(" if (\n");
|
||||||
|
for (j = 0;; j++) {
|
||||||
|
if (!enum_user_line(lbs, j, login_name, sizeof(login_name)))
|
||||||
|
break;
|
||||||
|
get_user_line(lbs, login_name, NULL, full_name, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
sprintf(str, "%s_%d", ua, j);
|
||||||
|
rsprintf(" !document.form1.%s.checked", str);
|
||||||
|
if (enum_user_line(lbs, j+1, login_name, sizeof(login_name)))
|
||||||
|
rsprintf(" &&\n");
|
||||||
|
}
|
||||||
|
rsprintf(") {\n");
|
||||||
|
sprintf(str, loc("Please select at least one '%s'"), attr_list[i]);
|
||||||
|
rsprintf(" alert(\"%s\");\n", str);
|
||||||
|
rsprintf(" document.form1.%s_0.focus();\n", ua);
|
||||||
|
rsprintf(" return false;\n");
|
||||||
|
rsprintf(" }\n");
|
||||||
|
|
||||||
} else if (attr_flags[i] & AF_RADIO) {
|
} else if (attr_flags[i] & AF_RADIO) {
|
||||||
rsprintf(" for (var i=0 ; i<document.form1.%s.length ; i++)\n", ua);
|
rsprintf(" for (var i=0 ; i<document.form1.%s.length ; i++)\n", ua);
|
||||||
rsprintf(" if (document.form1.%s[i].checked) { break }\n", ua);
|
rsprintf(" if (document.form1.%s[i].checked) { break }\n", ua);
|
||||||
@ -9869,7 +9888,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
(" <img align=\"middle\" name=\"smileys\" src=\"icons/elc_smile.png\" alt=\"%s\" title=\"%s\" border=\"0\"",
|
(" <img align=\"middle\" name=\"smileys\" src=\"icons/elc_smile.png\" alt=\"%s\" title=\"%s\" border=\"0\"",
|
||||||
loc("Show the smiley bar"), loc("Show the smiley bar"));
|
loc("Show the smiley bar"), loc("Show the smiley bar"));
|
||||||
rsprintf(" onclick=\"switch_smileys()\"");
|
rsprintf(" onclick=\"switch_smileys()\"");
|
||||||
rsprintf(" onmouseover=\"this.style.cursor='hand';\" />\n");
|
rsprintf(" onmouseover=\"this.style.cursor='pointer';\" />\n");
|
||||||
|
|
||||||
rsprintf(" <select name=\"font\" ");
|
rsprintf(" <select name=\"font\" ");
|
||||||
rsprintf("onchange=\"elcode(document.form1.Text,'FONT',this.options[this.selectedIndex].value);");
|
rsprintf("onchange=\"elcode(document.form1.Text,'FONT',this.options[this.selectedIndex].value);");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user