Index: openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl 15 Apr 2011 11:43:48 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/admin/group-types/new.tcl 7 Aug 2017 23:47:58 -0000 1.6 @@ -22,34 +22,30 @@ template::form create group_type template::element create group_type object_type \ - -datatype "text" \ - -label "[_ acs-subsite.Group_type]" \ - -html { size 30 maxlength 30 } + -datatype "text" \ + -label [_ acs-subsite.Group_type] \ + -html { size 30 maxlength 30 } -set supertype_options [db_list_of_lists "select_group_supertypes" { - select replace(lpad(' ', (level - 1) * 4), ' ', ' ') || t.pretty_name, t.object_type - from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type = 'group'}] +set supertype_options [db_list_of_lists select_group_supertypes {}] foreach opt $supertype_options { lappend supertype_options_i18n [lang::util::localize $opt] } template::element create group_type supertype \ - -datatype "text" \ - -widget select \ - -options $supertype_options_i18n \ - -label "[_ acs-subsite.Supertype]" + -datatype "text" \ + -widget select \ + -options $supertype_options_i18n \ + -label [_ acs-subsite.Supertype] template::element create group_type pretty_name \ - -datatype "text" \ - -label "[_ acs-subsite.Pretty_name]" \ - -html { size 50 maxlength 100 } + -datatype "text" \ + -label [_ acs-subsite.Pretty_name] \ + -html { size 50 maxlength 100 } template::element create group_type pretty_plural \ - -datatype "text" \ - -label "[_ acs-subsite.Pretty_plural]" \ - -html { size 50 maxlength 100 } + -datatype "text" \ + -label [_ acs-subsite.Pretty_plural] \ + -html { size 50 maxlength 100 } set approval_policy_options { { {Open: Users can create groups of this type} open } @@ -65,41 +61,43 @@ set safe_object_type [plsql_utility::generate_oracle_name -max_length 29 $object_type] if { [plsql_utility::object_type_exists_p $safe_object_type] } { - incr exception_count - append exception_text "
  • The specified object type, $object_type, already exists. -[ad_decode $safe_object_type $object_type "" "Note that we converted the object type to \"$safe_object_type\" to ensure that the name would be safe for the database."] -Please back up and choose another.
  • " + incr exception_count + append exception_text \ + "
  • The specified object type, $object_type, already exists. " \ + [ad_decode $safe_object_type $object_type "" \ + "Note that we converted the object type to \"$safe_object_type\" to ensure that the name would be safe for the database."] \ + "Please back up and choose another.
  • " } else { - # let's make sure the names are unique - if { [db_string pretty_name_unique { - select case when exists (select 1 from acs_object_types t where t.pretty_name = :pretty_name) - then 1 else 0 end - from dual - }] } { - incr exception_count - append exception_text "
  • The specified pretty name, $pretty_name, already exists. Please enter another
  • " - } + # let's make sure the names are unique + if { [db_string pretty_name_unique {}] } { + incr exception_count + append exception_text \ + "
  • The specified pretty name, $pretty_name, already exists. Please enter another
  • " + } - if { [db_string pretty_name_unique { - select case when exists (select 1 from acs_object_types t where t.pretty_plural = :pretty_plural) - then 1 else 0 end - from dual - }] } { - incr exception_count - append exception_text "
  • The specified pretty plural, $pretty_plural, already exists. Please enter another
  • " - } + if { [db_string pretty_name_unique {}] } { + incr exception_count + append exception_text \ + "
  • The specified pretty plural, $pretty_plural, already exists. Please enter another
  • " + } } if { $exception_count > 0 } { - ad_return_complaint $exception_count $exception_text - ad_script_abort + ad_return_complaint $exception_count $exception_text + ad_script_abort } - db_transaction { - group_type::new -group_type $object_type -supertype $supertype $pretty_name $pretty_plural + db_transaction { + group_type::new -group_type $object_type -supertype $supertype $pretty_name $pretty_plural } ad_returnredirect "" return } ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: