@@ -188,18 +188,22 @@ public function assign($id) {
188188 $ this ->layout = 'ajax ' ;
189189
190190 if (empty ($ this ->request ->params ['pass ' ][0 ])) {
191+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array (_txt ('ct.eligibility_widget.1 ' ) . ' Id ' )), LOG_ERROR );
191192 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array (_txt ('ct.eligibility_widget.1 ' ) . ' Id ' )));
192193 }
193194 if (empty ($ this ->request ->data ['cou_id ' ])) {
195+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array ('cou_id ' )), LOG_ERROR );
194196 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array ('cou_id ' )));
195197 }
196198 if (empty ($ this ->request ->data ['co_person_id ' ])) {
199+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array ('co_person_id ' )), LOG_ERROR );
197200 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array ('co_person_id ' )));
198201 }
199202
200203 // I need to verify that the CO Person is part of the CO
201204 $ copersonid = $ this ->request ->data ['co_person_id ' ];
202205 if (!$ this ->Role ->isCoPerson ($ copersonid , $ this ->cur_co ["Co " ]["id " ])) {
206+ $ this ->log (__METHOD__ . "::message " . _txt ('er.cop.nf ' , array ($ copersonid )), LOG_ERROR );
203207 throw new NotFoundException (_txt ('er.cop.nf ' , array ($ copersonid )));
204208 }
205209
@@ -217,6 +221,7 @@ public function assign($id) {
217221 $ this ->CoPersonRole ->save ($ copr );
218222
219223 if (!$ this ->CoPersonRole ->save ($ copr )) {
224+ $ this ->log (__METHOD__ . "::message " . _txt ('er.db.save ' ), LOG_ERROR );
220225 throw new InternalErrorException (_txt ('er.db.save ' ));
221226 }
222227
@@ -292,19 +297,23 @@ public function eligibility($id) {
292297 $ this ->layout = 'ajax ' ;
293298
294299 if (empty ($ this ->request ->params ['pass ' ][0 ])) {
300+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array (_txt ('ct.eligibility_widget.1 ' ) . ' Id ' )), LOG_ERROR );
295301 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array (_txt ('ct.eligibility_widget.1 ' ) . ' Id ' )));
296302 }
297303
298304 if (empty ($ this ->request ->data ['ois_id ' ])) {
305+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array ('ois_id ' )), LOG_ERROR );
299306 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array ('ois_id ' )));
300307 }
301308 if (empty ($ this ->request ->data ['co_person_id ' ])) {
309+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array ('co_person_id ' )), LOG_ERROR );
302310 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array ('co_person_id ' )));
303311 }
304312
305313 // I need to verify that the CO Person is part of the CO
306314 $ copersonid = $ this ->request ->data ['co_person_id ' ];
307315 if (!$ this ->Role ->isCoPerson ($ copersonid , $ this ->cur_co ["Co " ]["id " ])) {
316+ $ this ->log (__METHOD__ . "::message " . _txt ('er.cop.nf ' , array ($ copersonid )), LOG_ERROR );
308317 throw new NotFoundException (_txt ('er.cop.nf ' , array ($ copersonid )));
309318 }
310319
@@ -313,6 +322,7 @@ public function eligibility($id) {
313322 $ this ->cur_co ["Co " ]["id " ],
314323 $ this ->request ->data ['co_person_id ' ]);
315324 } catch (Exception $ e ) {
325+ $ this ->log (__METHOD__ . "::message " .$ e ->getMessage (), LOG_ERROR );
316326 // Double quotes are not JSON accepted
317327 throw new BadRequestException (str_replace ('" ' , "" , $ e ->getMessage ()));
318328 }
@@ -343,9 +353,11 @@ public function personroles($id) {
343353 $ this ->layout = 'ajax ' ;
344354
345355 if (empty ($ this ->request ->params ['pass ' ][0 ])) {
356+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array (_txt ('ct.eligibility_widget.1 ' ) . ' Id ' )), LOG_ERROR );
346357 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array (_txt ('ct.eligibility_widget.1 ' ) . ' Id ' )));
347358 }
348359 if (empty ($ this ->request ->query ["copersonid " ])) {
360+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.notfound ' , array ('copersonid ' )), LOG_ERROR );
349361 throw new BadRequestException (_txt ('pl.er.eligibilitywidget.param.notfound ' , array ('copersonid ' )));
350362 }
351363
@@ -369,6 +381,7 @@ public function personroles($id) {
369381
370382 $ roles = $ this ->CoPersonRole ->find ('all ' , $ args );
371383 } catch (Exception $ e ) {
384+ $ this ->log (__METHOD__ . "::message " .$ e ->getMessage (), LOG_ERROR );
372385 // Double quotes are not JSON accepted
373386 throw new BadRequestException (str_replace ('" ' , "" , $ e ->getMessage ()));
374387 }
@@ -393,12 +406,14 @@ public function sync($id) {
393406 $ this ->layout = 'ajax ' ;
394407
395408 if (empty ($ this ->request ->query ["copersonrole " ])) {
409+ $ this ->log (__METHOD__ . "::message " . _txt ('pl.er.eligibilitywidget.param.specify ' ), LOG_ERROR );
396410 throw new InvalidArgumentException (_txt ('pl.er.eligibilitywidget.param.specify ' ));
397411 }
398412
399413 try {
400414 $ data = $ this ->CoEligibilityWidget ->syncEligibility ($ this ->request ->query ["copersonrole " ]);
401415 } catch (Exception $ e ) {
416+ $ this ->log (__METHOD__ . "::message " .$ e ->getMessage (), LOG_ERROR );
402417 throw new BadRequestException (str_replace ('" ' , "" , $ e ->getMessage ()));
403418 }
404419
0 commit comments