@@ -1270,9 +1270,8 @@ public function doMake(Request $request)
12701270 '403 Forbidden '
12711271 );
12721272
1273- // check :
1274- // plan date not in the past
1275- if (request ('score ' ) === null ) {
1273+ // Score must be set
1274+ if ((request ('score ' ) === null )||(request ('score ' ) == 0 )) {
12761275 return back ()
12771276 ->withErrors (['score ' => 'score not set ' ])
12781277 ->withInput ();
@@ -1474,7 +1473,7 @@ public function draft(Request $request)
14741473
14751474 $ control ->observations = request ('observations ' );
14761475 $ control ->note = request ('note ' );
1477- $ control ->score = request ('score ' );
1476+ $ control ->score = request ('score ' )== 0 ? null : request ( ' score ' ) ;
14781477
14791478 // only admin and user can update the plan_date and action_plan
14801479 if (Auth::User ()->role === 1 || Auth::User ()->role === 2 ) {
@@ -1524,7 +1523,6 @@ public function reject(Request $request)
15241523 $ control ->score = request ('score ' );
15251524 $ control ->plan_date = request ('plan_date ' );
15261525 $ control ->action_plan = request ('action_plan ' );
1527- // $control->realisation_date = null;
15281526
15291527 // Reject -> set status=0
15301528 $ control ->status = 0 ;
@@ -1552,9 +1550,8 @@ public function accept()
15521550
15531551 $ id = (int ) request ('id ' );
15541552
1555- // check :
1556- // plan date not in the past
1557- if (request ('score ' ) === null ) {
1553+ // Score must be set
1554+ if ((request ('score ' ) === null )||(request ('score ' ) == 0 )) {
15581555 return back ()
15591556 ->withErrors (['score ' => 'score not set ' ])
15601557 ->withInput ();
@@ -1681,7 +1678,6 @@ public function template(Request $request)
16811678 $ templateProcessor ->setComplexValue ('input ' , self ::string2Textrun ($ control ->input ));
16821679 $ templateProcessor ->setComplexValue ('model ' , self ::string2Textrun ($ control ->model ));
16831680
1684- //dd(urldecode($request->observations))
16851681 $ templateProcessor ->setComplexValue ('observations ' , self ::string2Textrun (urldecode ($ request ->observations )));
16861682
16871683 $ templateProcessor ->setValue ('date ' , Carbon::today ()->format ('d/m/Y ' ));
0 commit comments