archive-version-add.tcl

Location:
/packages/download/www/archive-version-add.tcl
Author:
jbank@arsdigita.com [jbank@arsdigita.com]
Created:
Thu Dec 14 00:44:30 2000
CVS ID:
$Id: archive-version-add.tcl,v 1.7 2013/09/30 11:05:49 gustafn Exp $

Related Files

[ hide source ] | [ make this the default ]

File Contents

# /packages/download/www/archive-version-add.tcl
ad_page_contract {
     
     @author jbank@arsdigita.com [jbank@arsdigita.com]
     @creation-date Thu Dec 14 00:44:30 2000
     @cvs-id $Id: archive-version-add.tcl,v 1.7 2013/09/30 11:05:49 gustafn Exp $
} {
    archive_id:naturalnum,notnull
    {return_url ""}
}

if {$return_url eq ""} {
    set return_url "[ad_conn package_url]/one-archive?archive_id=$archive_id"
}

auth::require_login
set repository_id [download_repository_id]

permission::require_permission -object_id $archive_id -privilege write

if {![db_0or1row archive_info_select {
   select da.archive_name, 
          da.archive_type_id,
          da.summary,
          da.description, 
          da.description_type, 
          u.last_name || ', ' || u.first_names as creation_user_name,
          da.creation_user, 
          to_char(da.creation_date,'Mon DD, YYYY') as creation_date
     from download_archives_obj da, cc_users u
    where da.archive_id = :archive_id
      and u.user_id = da.creation_user
}]} {
    ad_return_complaint 1 "[_ download.lt_The_archive_you_are_l]"
    return
}

#FIXME: Do the conversion based on mime type
#set description [ad_format_text $description $description_type]
set extra_form_elts ""
db_foreach metadata {
    select 
      dam.metadata_id,
      dam.pretty_name,
      dam.data_type
    from download_archive_metadata dam
         where dam.repository_id = :repository_id and
               dam.computed_p = 'f' and
               (dam.archive_type_id = :archive_type_id or
                dam.archive_type_id is null)
    order by sort_key
} {
    append extra_form_elts [download_metadata_widget $data_type $pretty_name $metadata_id]
}

set context [list "[_ download.lt_Add_an_Revision_to_ar]"]

ad_return_template