FSN#36795: Planning, start en afronden niet altijd wenselijk bij terugkerende taken.
svn path=/Website/trunk/; revision=31510
This commit is contained in:
@@ -36,6 +36,7 @@ var multi = ins_key_arr.length > 1; // Er zijn meerdere object keys meegegeven.
|
||||
var insPlan = getQParamInt("plan", 0) == 1; // Inplannen inspectie.
|
||||
var insClose = getQParamInt("close", 0) == 1; // Afmelden of afronden inspectie.
|
||||
var insEdit = !insPlan && !insClose; // Wijzigen inspectie.
|
||||
var fromfinish = getQParamInt("fromfinish", 0) == 1; // Alleen Voltooien bij bulkactie (multi).
|
||||
|
||||
if (insEdit && multi)
|
||||
abort_with_warning(L("lcl_ins_allow_multi_edit"));
|
||||
@@ -97,10 +98,13 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
continue;
|
||||
}
|
||||
|
||||
// Kan de inspectie gereed gemeld/afgemeld of afgerond woden?
|
||||
if (insClose && !this_ins.canInspClose && !this_ins.canInspFinish)
|
||||
{ // De inspectie kan niet afgemeld/afgerond worden. Overslaan.
|
||||
continue;
|
||||
// Kan de inspectie gereed gemeld/afgemeld of afgerond worden?
|
||||
if (insClose)
|
||||
{ // Bij bulkacties (multi) alleen kijken naar de bulkactie die uitgevoerd moet worden.
|
||||
if (insClose && ((multi && ((!fromfinish && !this_ins.canInspClose) || (fromfinish && !this_ins.canInspFinish))) ||
|
||||
(!multi && !this_ins.canInspClose && !this_ins.canInspFinish)))
|
||||
// De inspectie kan niet afgemeld/afgerond worden. Overslaan.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Het mag niet de eerste inspectie zijn en de laatste inspectie mag niet verwerkt zijn.
|
||||
@@ -471,10 +475,10 @@ if (ins_key_arr.length == 1)
|
||||
if (insPlan || insEdit)
|
||||
buttons.push({title: (insPlan? L("lcl_ins_schedule") : L("lcl_submit")), icon: "opslaan.png", action:"ins_submit(0)"});
|
||||
if (insClose)
|
||||
{
|
||||
if (canClose)
|
||||
{ // Bij bulkacties (multi) alleen kijken naar de bulkactie die uitgevoerd moet worden.
|
||||
if (canClose && !(multi && fromfinish))
|
||||
buttons.push({title: L("lcl_ins_close"), icon: "inspfinish.png", action:"ins_submit(0)"});
|
||||
if (canFinish)
|
||||
if (canFinish && !(multi && !fromfinish))
|
||||
buttons.push({title: L("lcl_ins_finish"), icon: "close.png", action: "ins_submit(1)"});
|
||||
}
|
||||
if (canMelding)
|
||||
|
||||
@@ -864,11 +864,24 @@ function ins_list (pautfunction, params)
|
||||
rst.addAction({ action: "insEdit", caption: L("lcl_change"), isDefault: true}); // isDefault, dus nooit multi, alleen door aanklikken regel. Multi via afgehandeld via functie insMultiEdit()
|
||||
if (inspect)
|
||||
{
|
||||
rst.addAction({ action: "insShowInsp", caption: L("lcl_change"), enabler: "eShowInsp" });
|
||||
rst.addAction({ action: "insPlan", caption: L("lcl_ins_schedule"), multi: !tiny, multiOnce: true, enabler: "ePlan" });
|
||||
rst.addAction({ action: "insStart", caption: L("lcl_ins_start"), multi: !tiny, multiOnce: true, enabler: "eStart" });
|
||||
rst.addAction({ action: "insClose", caption: L("lcl_ins_stop"), multi: !tiny, multiOnce: true, enabler: "eClose" });
|
||||
rst.addAction({ action: "insFinish", caption: L("lcl_ins_finish"), multi: !tiny, multiOnce: true, enabler: "eFinish" });
|
||||
var sql_opt = "SELECT MAX(BITAND(ins_srtcontrole_options, 1)) insplan"
|
||||
+ " , MAX(BITAND(ins_srtcontrole_options, 2)) insstart"
|
||||
+ " , MAX(BITAND(ins_srtcontrole_options, 4)) insclose"
|
||||
+ " , MAX(BITAND(ins_srtcontrole_options, 8)) insfinish"
|
||||
+ " , COUNT(ins_srtcontrole_options) aantal"
|
||||
+ " FROM ins_srtcontrole";
|
||||
var oRs_opt = Oracle.Execute(sql_opt);
|
||||
|
||||
if (oRs_opt("aantal").Value > 0)
|
||||
rst.addAction({ action: "insShowInsp", caption: L("lcl_change"), enabler: "eShowInsp" });
|
||||
if (oRs_opt("insplan").Value == 1)
|
||||
rst.addAction({ action: "insPlan", caption: L("lcl_ins_schedule"), multi: !tiny, multiOnce: true, enabler: "ePlan" });
|
||||
if (oRs_opt("insstart").Value == 2)
|
||||
rst.addAction({ action: "insStart", caption: L("lcl_ins_start"), multi: !tiny, multiOnce: true, enabler: "eStart" });
|
||||
if (oRs_opt("insclose").Value == 4)
|
||||
rst.addAction({ action: "insClose", caption: L("lcl_ins_stop"), multi: !tiny, multiOnce: true, enabler: "eClose" });
|
||||
if (oRs_opt("insfinish").Value == 8)
|
||||
rst.addAction({ action: "insFinish", caption: L("lcl_ins_finish"), multi: !tiny, multiOnce: true, enabler: "eFinish" });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -244,7 +244,7 @@ function insStart(rowArray, isMulti)
|
||||
});
|
||||
}
|
||||
|
||||
function insClose(rowArray)
|
||||
function insClose(rowArray, isMulti, fromfinish)
|
||||
{
|
||||
var insKeyString = getKeyString(rowArray);
|
||||
var srtcontrolekeyArray = new Array();
|
||||
@@ -261,7 +261,12 @@ function insClose(rowArray)
|
||||
//if (rowArray.length == 1)
|
||||
// var url = "appl/ins/ins_inspect.asp?close=1&ins_keys=" + insKeyString + "&srtcont_keys=" + srtcontrolekeyArray.join(",") + "&deelsrtcont_key=" + deelsrtcontrkeyArray.join(",");
|
||||
//else
|
||||
var url = "appl/ins/ins_edit_inspect.asp?close=1&ins_keys=" + insKeyString + "&srtcont_keys=" + srtcontrolekeyArray.join(",") + "&deelsrtcont_keys=" + deelsrtcontrkeyArray.join(",");
|
||||
var url = "appl/ins/ins_edit_inspect.asp?close=1&ins_keys=" + insKeyString
|
||||
+ "&srtcont_keys=" + srtcontrolekeyArray.join(",")
|
||||
+ "&deelsrtcont_keys=" + deelsrtcontrkeyArray.join(",")
|
||||
+ (fromfinish
|
||||
? "&fromfinish=1"
|
||||
: "");
|
||||
FcltMgr.openDetail(url, L("lcl_ins_stop"));
|
||||
}
|
||||
|
||||
@@ -286,7 +291,7 @@ function insFinish(rowArray, isMulti)
|
||||
|
||||
if (mustClose)
|
||||
{ // Via insClose scherm de gegevens invullen.
|
||||
insClose(rowArray, isMulti);
|
||||
insClose(rowArray, isMulti, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user