Implemented "Allow branching"
SVN revision: 2273
This commit is contained in:
@@ -2592,6 +2592,13 @@ Options Location = Main Building{a}, New Building{b}, Old Building{c}
|
||||
This can be handy when locating options from long lists in drop-down boxes in
|
||||
quick filters for example. Default for this setting is <b>0</b>.
|
||||
</li>
|
||||
<li>
|
||||
<b><code>Allow branching = 0|1</code></b><br>
|
||||
With this option one can probihit "branching", which is that an entry gets
|
||||
more than one reply. When braning is prohibited, only linear threads are
|
||||
possible, which is one head entry, one reply to it, then one reply to the reply
|
||||
and so on. Default for this setting is <b>1</b>.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
<a name="themes" id="themes"></a>
|
||||
|
||||
+11
-4
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user