예제 #1
0
 public function ShowFormAction($form_id)
 {
     $id = $form_id + 0;
     $dict_link_multi = array();
     if ($this->fw->route['method'] == 'GET') {
         if ($id > 0) {
             $item = $this->model->one($id);
             $item["ftime_str"] = DateUtils::int2timestr($item["ftime"]);
             $dict_link_multi = FormUtils::ids2multi($item['dict_link_multi']);
         } else {
             #defaults
             $item = array('fint' => 0, 'ffloat' => 0);
         }
     } else {
         $itemdb = $id ? $this->model->one($id) : array();
         $item = array_merge($itemdb, req('item'));
         $dict_link_multi = req('dict_link_multi');
     }
     $ps = array('id' => $id, 'i' => $item, 'add_user_id_name' => fw::model('Users')->full_name($item['add_user_id']), 'upd_user_id_name' => fw::model('Users')->full_name($item['upd_user_id']), 'select_options_parent_id' => FormUtils::select_options_db(db_array("select id, iname from {$this->table_name} where parent_id=0 and status=0 order by iname"), $item['parent_id']), 'select_options_demo_dicts_id' => $this->model_related->get_select_options($item['demo_dicts_id']), 'dict_link_auto_id_iname' => $item['dict_link_auto_id'] ? $this->model_related->iname($item['dict_link_auto_id']) : $item['dict_link_auto_id_iname'], 'multi_datarow' => $this->model_related->get_multi_list($dict_link_multi), 'att_id_url_s' => $this->fw->model('Att')->get_url_direct($item['att_id'], 's'));
     #combo date
     #TODO FormUtils::combo4date( $item['fdate_combo'], $ps, 'fdate_combo');
     return $ps;
 }