Implemented "Allow branching"

SVN revision: 2273
This commit is contained in:
2009-11-27 12:48:07 +00:00
parent 4f68a72988
commit 20e7c19e9d
2 changed files with 18 additions and 4 deletions
+11 -4
View File
@@ -9163,6 +9163,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
text = xmalloc(TEXT_SIZE);
text[0] = 0;
orig_author[0] = 0;
orig_tag[0] = 0;
encoding[0] = 0;
date[0] = 0;
locked_by[0] = 0;
@@ -9316,10 +9317,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
sprintf(str, "Preset on first reply %s", attr_list[index]);
if ((i = getcfg(lbs->name, str, preset, sizeof(preset))) > 0 && breply) {
el_retrieve(lbs, message_id, NULL, NULL, NULL, 0, NULL, 0, str, NULL, NULL, NULL, NULL);
if (str[0] == 0) {
if (orig_tag[0] == 0) {
if (!breedit || (breedit && i == 2)) { /* subst on reedit only if preset is under condition */
/* do not format date for date attributes */
@@ -9492,6 +9490,15 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
}
}
/* check for non-allowed branching */
if (breply && getcfg(lbs->name, "Allow branching", str, sizeof(str)) && atoi(str) == 0) {
if (reply_tag[0]) {
show_error("Branches are not allowed in this logbook");
xfree(text);
return;
}
}
/* check for author */
if (bedit && getcfg(lbs->name, "Restrict edit", str, sizeof(str)) && atoi(str) == 1) {
if (!is_author(lbs, attrib, owner)) {