bitsoffreedom / w0bw0b

Tool for keeping track of multiple simultaneous Dutch FoIA-requests.
https://www.bof.nl/
2 stars 1 forks source link

case is closed after decision on appeal is taken, forgetting about court #22

Open rejozenger opened 11 years ago

rejozenger commented 11 years ago

When a decision on appeal is taken, the case is closed ("afgerond") immediately, forgetting about the possibility of going to court for another six weeks. To reproduce, open a new case, enter a decision for a request, appeal that decision, enter a decision on the appeal. The case is "afgerond" right away, where it should be left "open" for another six weeks.

martijnhoutman commented 11 years ago

I see the following clause being used for the calculation of the status in case of a decision on an appeal:

  if ($("#edit-field-request-decision input").val()) {
    var deadline = $("#edit-field-objection-deadline-date input").datepicker("getDate");
    if (deadline && deadline.getTime() > today.getTime()) {
      $("#edit-field-status select").val("open");
    } else {
      $("#edit-field-status select").val("afgerond");
    }
  } else {
    $("#edit-field-status select").val("open");
  }

The first clause checks if the decision input is set (which is true), so it checks for a deadline, which is another calculated field. If the deadline is larger than today, the status is still open. This deadline is calculated as follows:

if (deadline = $("#edit-field-request-decision input").datepicker("getDate")) {
  deadline.setDate(deadline.getDate()+42);
  $("#edit-field-objection-deadline-date input").datepicker("setDate", deadline);
}

i.e., it uses the 6 weeks as you state.

@rejozenger: This means the calculation is already correct, right?

rejozenger commented 11 years ago

To avoid misunderstanding: the first phase is named "verzoek" and "request", the second is named "bezwaar" and "objection" and the third and current final phase is named "beroep" and "appeal".

When a decision on an objection has been taken a period of six weeks start within one can take the case to the court (and start an appeal). When a decision on an appeal has been taken, one can take the case to the higher court (and start a phase that we currently do not track). And so, there are actually two issues.

First, when a decision has been taken in the "objection" phase, another six weeks are left open to take the case to the court. At https://github.com/bitsoffreedom/w0bw0b/blob/master/sites/all/modules/wob/wob.module#L362 it now says:

                        if ($("#edit-field-objection-decision-date input").val()) {
                                $("#edit-field-status select").val("afgerond");
                        } else {
                                var deadline = $("#edit-field-appeal-deadline input").datepicker("getDate");
                                if (deadline && deadline.getTime() > today.getTime()) {
                                        $("#edit-field-status select").val("afgerond");
                                } else {
                                        $("#edit-field-status select").val("open");
                                }
                        }

To me it looks like the logic is the wrong way around: if a field-objection-decision-date has a value, the case should not be closed, but it should incorporate those six weeks. In pseudo:

if (decision on objection has been taken) then 
        if (field_appeal_deadline > today) then 
                edit-field-status = "afgerond"
        else 
                edit-field-status = "open"
else
        edit-field-status = "open"

Secondly, when a decision by court has been taken, another six weeks are given for taking the case to the next court. At https://github.com/bitsoffreedom/w0bw0b/blob/master/sites/all/modules/wob/wob.module#L357 it now says:

                        if ($("#edit-field-appeal-completed input").val()) {
                                $("#edit-field-status select").val("afgerond");
                        } else {
                                $("#edit-field-status select").val("open");
                        }

It should say, in pseudo code:

if appeal has been completed then
        if field_appeal_judgement + 6w) > today) then 
                edit-field-status = "afgerond"
        else 
                edit-field-status = "open"
else
        edit-field-status = "open"
rejozenger commented 10 years ago

This doesn't to have fixed the issue. To reproduce I do the following:

When this is done, the case will be marked "done". However, when selecting the "beroep" tab you will see there's a deadline of "10 januari 2014", a date in the future, for filing a case at the court. Ergo, the case should still be "open". Only when this deadline has passed, without taking the case to the court, it should be closed.

martijnhoutman commented 10 years ago

Was a reversed status check, fixed now.

rejozenger commented 10 years ago

The issue as described in https://github.com/bitsoffreedom/w0bw0b/issues/22#issuecomment-29790447 seems to be fixed, but the other way around not. If the last date to be entered in the reproducing steps is not "28/11/2013" but "02/10/2013", then the deadline for filing a courtcase is "14 november 2013" (see tab "beroep"). As this date is in the past, the status should be "closed", but is still "open".