Commit 7228841f authored by Frank Bergmann's avatar Frank Bergmann

- Added risk filestorage

parent 058bfe18
......@@ -10,7 +10,7 @@
<inherit-templates-p>t</inherit-templates-p>
<auto-mount>intranet-filestorage</auto-mount>
<version name="5.0.2.4.0" url="http://www.project-open.net/download/apm/intranet-filestorage-5.0.2.4.0.apm">
<version name="5.0.2.4.1" url="http://www.project-open.net/download/apm/intranet-filestorage-5.0.2.4.1.apm">
<owner url="mailto:frank.bergmann@project-open.com">Frank Bergmann</owner>
<summary>Filesystem folders for business objects</summary>
<release-date>2004-01-29</release-date>
......@@ -37,6 +37,7 @@
<parameter scope="instance" datatype="string" min_n_values="1" max_n_values="1" name="EventBasePathUnix" default="/web/projop/filestorage/events" description="Where to find the files for the 'Event'-Filestorages? Example: '/web/projop/filestorage/events'. No trailing slash, please."/>
<parameter scope="instance" datatype="string" min_n_values="1" max_n_values="1" name="TmpPathUnix" default="/tmp" description="Tmp directory. Example: '/tmp' for Linux or 'C:/project-open/tmp' for Windows. No trailing slash, please."/>
<parameter scope="instance" datatype="string" min_n_values="1" max_n_values="1" name="UserBasePathUnix" default="/web/projop/filestorage/users" description="Where to find the files for the 'User'-Filestorages? Example: '/web/projop/filestorage/users'. No trailing slash, please."/>
<parameter scope="instance" datatype="string" min_n_values="1" max_n_values="1" name="RiskBasePathUnix" default="/web/projop/filestorage/risks" description="Where to find the files for the 'Risk'-Filestorages? Example: '/web/projop/filestorage/risks'. No trailing slash, please."/>
</parameters>
</version>
......
......@@ -318,6 +318,21 @@ SELECT im_component_plugin__new (
'im_filestorage_cost_component $user_id $bundle_id $bundle_name $return_url' -- component_tcl
);
SELECT im_component_plugin__new (
null, -- plugin_id
'im_component_plugin', -- object_type
now(), -- creation_date
null, -- creation_user
null, -- creation_ip
null, -- context_id
'Risk Filestorage', -- plugin_name
'intranet-filestorage', -- package_name
'bottom', -- location
'/intranet-riskmanagement/new', -- page_url
null, -- view_name
30, -- sort_order
'im_filestorage_risk_component $user_id $risk_id $risk_name $return_url' -- component_tcl
);
-- -----------------------------------------------------
......
......@@ -27,10 +27,12 @@ ad_register_proc GET /intranet/download/event/* intranet_event_download
ad_register_proc GET /intranet/download/project_sales/* intranet_project_sales_download
ad_register_proc GET /intranet/download/company/* intranet_company_download
ad_register_proc GET /intranet/download/user/* intranet_user_download
ad_register_proc GET /intranet/download/cost/* intranet_expense_cost_download
ad_register_proc GET /intranet/download/cost/* intranet_cost_download
ad_register_proc GET /intranet/download/expense_cost/* intranet_expense_cost_download
ad_register_proc GET /intranet/download/conf_item/* intranet_conf_item_download
ad_register_proc GET /intranet/download/home/* intranet_home_download
ad_register_proc GET /intranet/download/zip/* intranet_zip_download
ad_register_proc GET /intranet/download/risk/* intranet_risk_download
ad_proc im_file_action_upload {} { return 2420 }
......@@ -47,6 +49,7 @@ ad_proc intranet_conf_item_download {} { intranet_download "conf_item" }
ad_proc intranet_home_download {} { intranet_download "home" }
ad_proc intranet_zip_download {} { intranet_download "zip" }
ad_proc intranet_expense_cost_download {} { intranet_download "cost" }
ad_proc intranet_risk_download {} { intranet_download "risk" }
# -------------------------------------------------------
#
......@@ -349,6 +352,7 @@ ad_proc -private im_filestorage_base_path_helper {
bt_fs {return [im_filestorage_bug_path $object_id]}
cost {return [im_filestorage_cost_path $object_id]}
conf_item {return [im_filestorage_conf_item_path $object_id]}
risk {return [im_filestorage_risk_path $object_id]}
}
return ""
}
......@@ -478,6 +482,15 @@ ad_proc im_filestorage_conf_item_component { user_id conf_item_id conf_item_name
return [im_filestorage_base_component $user_id $conf_item_id $conf_item_name $conf_item_path $folder_type]
}
ad_proc im_filestorage_risk_component { user_id risk_id risk_name return_url} {
Filestorage for risk items
} {
set risk_path [im_filestorage_risk_path $risk_id]
set folder_type "risk"
return [im_filestorage_base_component $user_id $risk_id $risk_name $risk_path $folder_type]
}
# ---------------------------------------------------------------------
# Determine pathes for project, companies and users
......@@ -881,6 +894,32 @@ ad_proc im_filestorage_conf_item_path { conf_item_id } {
return "$base_path_unix/$conf_item_id"
}
ad_proc im_filestorage_risk_path { risk_id } {
Determine the location where the risk files
are stored on the hard disk
} {
set package_key "intranet-filestorage"
set package_id [db_string package_id "select package_id from apm_packages where package_key=:package_key" -default 0]
set base_path_unix [parameter::get -package_id $package_id -parameter "RiskBasePathUnix" -default "/tmp/risks"]
# Check if the base_path has a trailing "/" and produce an error:
if {[regexp {.\/$} $base_path_unix]} {
ad_return_complaint 1 "<br><blockquote>
The '$base_path_unix' path for this filestorage contains a trailing slash ('/') at the end.
Please notify your system administrator and ask him or her to remove any trailing
slashes in the Admin -&gt; Parameters -&gt; 'intranet-filestorage' section.
</blockquote><br>
"
return
}
return "$base_path_unix/$risk_id"
}
ad_proc im_filestorage_project_workflow_dirs { project_type_id } {
Returns a list of directors that have to be created
as a function of the project type (workfow)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment