File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ public function showForm($options = []) {
236236 echo '<tr class="line0"> ' ;
237237 echo '<td><strong> ' . __ ('Description ' ) . ' <span style="color:red;">*</span></strong></td> ' ;
238238 echo '<td colspan="3"> ' ;
239+ echo '<textarea name="comment" style="width:700px;" rows="15"> ' . $ this ->fields ['comment ' ] . '</textarea> ' ;
239240 echo '</td> ' ;
240241 echo '</tr> ' ;
241242
@@ -891,6 +892,20 @@ public function prepareInputForUpdate($input) {
891892 }
892893 }
893894
895+ $ target = new PluginFormcreatorTarget ();
896+ $ target ->getFromDBByCrit ([
897+ 'itemtype ' => self ::class,
898+ 'items_id ' => $ this ->getID ()
899+ ]);
900+ if (!$ target ->isNewItem ()) {
901+ $ target ->update ([
902+ 'id ' => $ target ->getID (),
903+ 'name ' => $ input ['name ' ],
904+ ]);
905+ }
906+ $ input ['name ' ] = $ input ['title ' ];
907+ unset($ input ['title ' ]);
908+
894909 return $ input ;
895910 }
896911
Original file line number Diff line number Diff line change @@ -924,9 +924,16 @@ public function prepareInputForUpdate($input) {
924924 }
925925
926926 $ target = new PluginFormcreatorTarget ();
927- $ found = $ target ->find ('items_id = ' . $ this ->getID ());
928- $ found = array_shift ($ found );
929- $ target ->update (['id ' => $ found ['id ' ], 'name ' => $ input ['name ' ]]);
927+ $ target ->getFromDBByCrit ([
928+ 'itemtype ' => self ::class,
929+ 'items_id ' => $ this ->getID ()
930+ ]);
931+ if (!$ target ->isNewItem ()) {
932+ $ target ->update ([
933+ 'id ' => $ target ->getID (),
934+ 'name ' => $ input ['name ' ],
935+ ]);
936+ }
930937 $ input ['name ' ] = $ input ['title ' ];
931938 unset($ input ['title ' ]);
932939
You can’t perform that action at this time.
0 commit comments