Index: openacs-4/packages/quota/quota.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/quota.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/quota.info 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,46 @@
+
+
+
+
+ Quota
+ Quota
+ f
+ f
+ quota
+
+
+ Paco Soler
+ Agustin Lopez
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/quota/catalog/quota.ca_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/catalog/quota.ca_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/catalog/quota.ca_ES.ISO-8859-1.xml 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,52 @@
+
+
+
+ Tornar
+ Comunitat
+ Detalls de la Comunitat
+ Crear-se-la
+ Eliminar quota
+ QUOTA DETALLADA DE LA COMUNITAT
+ QUOTA D'USUARI DETALLADA
+ N� Arxius
+ QUOTA GLOBAL
+ Quota Global (KB)
+ N� m�xim d'arxius per comunitat
+ N� m�xim d'arxius per usuari
+ N� m�xim d'arxius per usuari en una comunitat
+ N� m�xim d'arxius per directori personal
+ Quota m�xima per comunitat (en KB)
+ Quota m�xima per usuari (en KB)
+ Quota m�xima per usuari en una comunitat (en KB)
+ Quota m�xima del directori personal de l'usuari (en KB)
+ Nom
+ Administrador exempt de quotes
+ PAR�METRES
+ Arxius Personals
+ QUOTA DIRECTORI PERSONAL
+ Quota Personal (KB)
+ Quota
+ Gestionar Quotes
+ QUOTA PER COMMUNITAT
+ QUOTA PER USUARI
+ N� Fitxers
+ Quota (KB)
+ El CONTROL DE QUOTES est� desactivat
+ El CONTROL DE QUOTES est� activat
+ (Desactivar)
+ (Activar)
+ Disponible
+ Guardar Canvis
+ Cercar
+ Selecciona Comunitat
+ Selecciona Usuari
+ Total
+ Utilitzat
+ Quota utilitzada (KB)
+ Usuari
+ Detalls d'usuari
+ L'Usuari t� quota
+ L'Usuari no t� quota
+ QUOTA D'USUARI PER COMUNITATS
+ Nom d'Usuari
+
Index: openacs-4/packages/quota/catalog/quota.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/catalog/quota.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/catalog/quota.en_US.ISO-8859-1.xml 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,52 @@
+
+
+
+ Back
+ Community
+ Community Details
+ Create user quota
+ Delete quota
+ DETAILED COMMUNITY QUOTA
+ DETAILED USER QUOTA
+ Global Files
+ GLOBAL QUOTA
+ Global Quota (KB)
+ Max. Number of files in a community
+ Max. number of files by user
+ Max. number of files by user-community
+ Max. number of files by user personal folder
+ Max. quota used by a community (in KB)
+ Max. quota used by user (in KB)
+ Max. quota used by user-community (in KB)
+ Max. quota used by user personal folder (in KB)
+ Name
+ No quota for Site Admin
+ PARAMETERS
+ Personal Files
+ PERSONAL FOLDER QUOTA
+ Personal Quota (KB)
+ Quota
+ Manage Quota
+ QUOTA BY COMMUNITY
+ QUOTA BY USER
+ N� Files
+ Quota (KB)
+ QUOTA CONTROL is currently off
+ QUOTA CONTROL is currently on
+ (turn it off)
+ (turn it on)
+ Available
+ Save Changes
+ Search
+ Select Community
+ Select User
+ Total
+ Used
+ Used Quota (KB)
+ User
+ User Details
+ User has quota
+ User hasn't quota
+ USER QUOTA BY COMMUNITY
+ Username
+
Index: openacs-4/packages/quota/catalog/quota.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/catalog/quota.es_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/catalog/quota.es_ES.ISO-8859-1.xml 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,52 @@
+
+
+
+ Volver
+ Comunidad
+ Detalles de la Comunidad
+ Cre�rsela
+ Eliminar cuota
+ CUOTA DETALLADA DE LA COMUNIDAD
+ CUOTA DE USUARIO DETALLADA
+ N� Archivos
+ CUOTA GLOBAL
+ Cuota Global (KB)
+ N� m�ximo de archivos por comunidad
+ N� m�ximo de archivos por usuario
+ N� m�ximo de archivos por usuario en una comunidad
+ N� m�ximo de archivos por directorio personal
+ Cuota m�xima por comunidad (en KB)
+ Cuota m�xima por usuario (en KB)
+ Cuota m�xima por usuario en una comunidad (en KB)
+ Cuota m�xima del directorio personal del usuario (en KB)
+ Nombre
+ Administrador exento de cuota
+ PAR�METROS
+ Archivos Personales
+ CUOTA DIRECTORIO PERSONAL
+ Cuota Personal (KB)
+ Quota
+ Gestionar Cuotas
+ CUOTA POR COMUNIDAD
+ CUOTA POR USUARIO
+ N� Archivos
+ Cuota (KB)
+ El CONTROL DE CUOTAS est� desactivado
+ El CONTROL DE CUOTAS est� activado
+ (Desactivar)
+ (Activar)
+ Disponible
+ Guardar Cambios
+ Buscar
+ Selecciona Communidad
+ Selecciona Usuario
+ Total
+ Usado
+ Cuota utilizada (KB)
+ Usuario
+ Detalles del usuario
+ El usuario tiene cuota
+ El usuario no tiene cuota
+ CUOTA DE USUARIO POR COMUNIDADES
+ Nombre de Usuario
+
Index: openacs-4/packages/quota/sql/postgresql/quota-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/sql/postgresql/quota-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/sql/postgresql/quota-create.sql 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,40 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+--
+-- QUOTA TABLES CREATE
+--
+-- @author Paco Soler (fransola@uv.es)
+-- @author Agustin Lopez (Agustin.Lopez@uv.es)
+-- @creation-date 2005-12-15
+-- @version $Id: quota-portlet-drop.sql,v 0.2 2005-12-15
+
+
+-- TABLES -------------------------------------------------------------
+
+-- TABLE USER_QUOTA -------------------------------------------------------------
+create sequence user_quota_sequence start 1;
+create table user_quota (
+ quota_id integer primary key default nextval('user_quota_sequence'),
+ ref_user integer not null,
+ global_quota integer not null,
+ global_files integer not null,
+ personal_quota integer not null,
+ personal_files integer not null,
+ usercomm_actv boolean default true,
+ constraint ref_user_id_fk foreign key (ref_user) references users (user_id)
+);
+create index user_quota_idx on user_quota (ref_user);
+
Index: openacs-4/packages/quota/sql/postgresql/quota-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/sql/postgresql/quota-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/sql/postgresql/quota-drop.sql 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,30 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+--
+-- QUOTA DROP TABLES
+--
+-- @author Paco Soler (fransola@uv.es)
+-- @author Agustin Lopez (Agustin.Lopez@uv.es)
+-- @creation-date 2005-12-15
+-- @version $Id: quota-portlet-drop.sql,v 0.2 2005-12-15
+
+
+--Drop data
+drop sequence user_quota_sequence;
+drop index user_quota_idx;
+drop table user_quota;
+
+
Index: openacs-4/packages/quota/tcl/quota-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/tcl/quota-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/tcl/quota-procs.tcl 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,428 @@
+ad_library {
+ TCL library for the quota system
+
+ @author Paco Soler (fransola@uv.es)
+ @author Agustin Lopez (Agustin.Lopez@uv.es)
+ @creation-date 15 December 2005
+}
+
+
+namespace eval quota {
+
+########################
+# COMMUNTY_QUOTA FUNCTIONS #
+# FOR OACS 5.1 #
+#######################
+
+
+##### PARAMETERS
+# Get default value of a par�meter
+ad_proc -public get_parameter {
+ {-param ""}
+} {
+ Returns the parameter default value with param name
+} {
+ return [db_string sql "select default_value from apm_parameters where parameter_name = :param"]
+}
+
+# Get default value of a par�meter
+ad_proc -public get_parameter_id {
+ {-param ""}
+} {
+ Returns the parameter id of the community instance
+} {
+ return [db_string sql "select parameter_id from apm_parameters where parameter_name = :param"]
+}
+
+
+# Get the quota package_id of the community
+ad_proc -public get_quota_package_id {
+ {-community_id ""}
+} {
+ Returns the quota package_id of the community
+} {
+
+ set ctrl [db_0or1row get_quota_package_id {* sql*}]
+ if {$ctrl == 0} {
+ # Sin instancia --> a ver que hacemos, usar los valores por defecto???
+ return 0
+ } else {
+ return $pid
+ }
+
+}
+
+# Get the parameter instance for the community
+ad_proc -public get_community_parameter {
+ {-community_id ""}
+ {-param ""}
+} {
+ Returns the parameter instance for the community
+} {
+ set pid [quota::get_quota_package_id -community_id $community_id]
+ if {$pid == 0} {
+ return [quota::get_parameter -param $param]
+ } else {
+ set param_id [quota::get_parameter_id -param $param]
+ db_0or1row get_community_parameter {* SQL *}
+ return $value
+ }
+}
+
+# Update default value of a parameter
+ad_proc -public update_parameter {
+ {-param ""}
+ {-value ""}
+} {
+ Update the parameter default value
+} {
+ db_dml update_parameter { *SQL* }
+}
+
+# Update default value of a parameter
+ad_proc -public update_community_parameter {
+ {-community_id ""}
+ {-param ""}
+ {-value ""}
+} {
+ Update the parameter default value
+} {
+ set pid [quota::get_quota_package_id -community_id $community_id]
+ set param_id [quota::get_parameter_id -param $param]
+ db_dml update_community_parameter { *SQL* }
+}
+
+
+##############################
+# FUNCIONES
+
+# Devuelve lista de los folders_id que contiene un folder dado
+ad_proc -public get_child_folders {
+ {-folder_id ""}
+} {
+ Returns a child folder_id list of parent folder_id
+} {
+ return [db_list get_child_folders get_child_folders]
+}
+
+
+# Devuelve lista de los folders_id que tiene una comunidad en su file-storage
+# Se necesita pasar el root folder_id de la comunidad!!!
+ad_proc -public get_filestorage_folders {
+ {-folder_id ""}
+} {
+ Returns a folder_id list of community_filestorage
+} {
+ # lista para lamacenar los directorios
+
+ set l_folders [list $folder_id]
+ # Lista auxiliar para almacenar los directorios que nos quedan por tratar
+ set l_aux [quota::get_child_folders -folder_id $folder_id]
+ set l_folders [concat $l_folders $l_aux]
+ # Contador de vueltas
+ set cont [llength $l_aux]
+
+ while { $cont > 0 } {
+ set c 0
+ set l_aux2 []
+ foreach obj $l_aux {
+ set l_aux1 [quota::get_child_folders -folder_id $obj]
+ set l_folders [concat $l_folders $l_aux1]
+ set l_aux2 [concat $l_aux2 $l_aux1]
+ set c [expr $c + [llength $l_aux1]]
+ }
+ if { $c > 0 } {
+ set l_aux $l_aux2
+ } else {
+ set cont 0
+ }
+ }
+ return $l_folders
+}
+
+# Devuelve lista de los items_id que contiene el folder de tipo type_s
+ad_proc -public get_folder_files {
+ {-folder_id ""}
+ {-type_s ""}
+} {
+ Returns folders files
+} {
+ return [db_list get_folder_files get_folder_files]
+}
+
+# Devuelve lista de los items_id de tipo type_s que tiene una comunidad en su file-storage
+# Se necesita pasar la lista de directorios de la comunidad!!!
+ad_proc -public get_filestorage_files {
+ {-folders_list ""}
+} {
+ Returns a files of the community folders
+} {
+ set files_list [list]
+ foreach obj $folders_list {
+ set files_list [concat $files_list [quota::get_folder_files -folder_id $obj -type_s "file_storage_object"]]
+ }
+ return $files_list
+}
+
+#Devuelve lista de revisiones de un item_id
+ad_proc -public get_revision_files {
+ {-item_id ""}
+ } {
+ Returns revision files
+} {
+ return [db_list get_revision_files get_revision_files]
+}
+
+
+# Devuelve lista de revision_id de la lista de item_id
+ad_proc -public get_filestorage_revisions {
+ {-files_list ""}
+} {
+ Returns a files of the community folders
+} {
+ set revision_list [list]
+ foreach obj $files_list {
+ set revision_list [concat $revision_list [quota::get_revision_files -item_id $obj ]]
+ }
+ return $revision_list
+}
+
+# Devuelve el espacio que ocupan los ficheros
+ad_proc -public get_filesize {
+ {-revision_id ""}
+ {-units ""}
+} {
+ Returns the filesize of revision_id
+} {
+ set fsize 0
+ if {[db_0or1row get_filesize {}] eq 0} {
+ return $fsize
+ } else {
+ switch -exact -- $units {
+ "b" {set fsize $size}
+ "kb" {set fsize [expr $size / 1024]}
+ "mb" {set fsize [expr $size / 1024 / 1024]}
+ default {set fsize [expr $size / 1024]}
+ }
+ return $fsize
+ }
+}
+
+# Devuelve el espacio que ocupan los ficheros
+ad_proc -public get_filestorage_used_quota {
+ {-revision_list ""}
+} {
+ Returns de quota used by list revisions. P.e. Community files
+} {
+ set quota 0
+ foreach obj $revision_list {
+ set quota [expr $quota + [quota::get_filesize -revision_id $obj -units "kb"]]
+ }
+ return $quota
+}
+
+# Devuelve lista de revision_id de la lista de item_id
+ad_proc -public get_filestorage_user_revisions {
+ {-folder_list ""}
+ {-user_id ""}
+} {
+ Returns a revisions files of the community folders
+} {
+ set revision_list [list]
+ foreach obj $folder_list {
+ set revision_list [concat $revision_list [quota::get_folder_user_revisions -folder_id $obj -user_id $user_id]]
+ }
+ return $revision_list
+}
+
+# devuelve la lista de revision_id de un usuario en el directorio
+ad_proc -public get_folder_user_revisions {
+ {-folder_id ""}
+ {-user_id ""}
+} {
+ Returns folders user_revisions
+} {
+ return [db_list get_folder_user_revisions get_folder_user_revisions]
+}
+
+# Devuelve las comunidades a las que pertenece un usuario
+ad_proc -public get_user_communities {
+ {-user_id ""}
+} {
+ Devuelve las comunidades a las que pertenece un usuario
+} {
+ return [db_list get_user_communities {}]
+}
+
+###############################
+# GLOBAL
+# Get user global files used
+ad_proc -public get_used_quota_and_files {
+ {-user_id ""}
+} {
+ Get user global quota and files used
+} {
+ set quota 0
+ set files 0
+ set l_revisions [db_list get_user_qf {* SQL *}]
+ foreach r_size $l_revisions {
+ set files [expr $files + 1]
+ set quota [expr $quota + $r_size/1024]
+ }
+ set l_gobal_quota [list $quota $files]
+ return $l_gobal_quota
+}
+
+
+# PERSONAL
+# Get user personal quota used
+ad_proc -public get_used_pquota_and_pfiles {
+ {-user_id ""}
+} {
+ Get user personal quota and files used
+} {
+ set root_folder [dotlrn_fs::get_user_root_folder -user_id $user_id]
+ set l_folders [quota::get_filestorage_folders -folder_id $root_folder]
+ set l_files [quota::get_filestorage_files -folders_list $l_folders]
+ set l_revisions [quota::get_filestorage_revisions -files_list $l_files]
+ set quota [quota::get_filestorage_used_quota -revision_list $l_revisions]
+ return [list $quota [llength $l_revisions]]
+}
+
+# COMUNITY
+# Get community quota and files used
+ad_proc -public get_used_cquota_and_cfiles {
+ {-community_id ""}
+} {
+ Returns de quota used by a community with community_id
+} {
+ if {$community_id eq ""} {
+ set community_id [dotlrn_community::get_community_id]
+ }
+ set root_fid [dotlrn_fs::get_community_root_folder -community_id $community_id]
+ set l_c_folders [quota::get_filestorage_folders -folder_id $root_fid]
+ set l_files [quota::get_filestorage_files -folders_list $l_c_folders]
+ set l_rev [quota::get_filestorage_revisions -files_list $l_files]
+ set quota [quota::get_filestorage_used_quota -revision_list $l_rev]
+ return [list $quota [llength $l_rev]]
+}
+
+# USER _ COMMUNITY
+# Get user-community quota and files used
+ad_proc -public get_used_ucquota_and_ucfiles {
+ {-community_id ""}
+ {-user_id ""}
+} {
+ Returns de quota used by a community with community_id
+} {
+ if {$community_id eq ""} {
+ set community_id [dotlrn_community::get_community_id]
+ }
+ set root_fid [dotlrn_fs::get_community_root_folder -community_id $community_id]
+ set l_c_folders [quota::get_filestorage_folders -folder_id $root_fid]
+ set l_rev [quota::get_filestorage_user_revisions -folder_list $l_c_folders -user_id $user_id]
+ set quota [quota::get_filestorage_used_quota -revision_list $l_rev]
+ return [list $quota [llength $l_rev]]
+}
+
+######################################
+# CHECKPOINT
+ad_proc -public check_quota {
+ {-user_id ""}
+ {-community_id ""}
+ {-filesize 0}
+} {
+ Allow upload files
+} {
+
+# Init variables
+set used_quota 0
+set used_files 0
+set used_pquota 0
+set used_pfiles 0
+set used_c_quota 0
+set used_c_files 0
+
+# Get if user is root and if the control quota is enabled
+set is_root [acs_user::site_wide_admin_p -user_id $user_id]
+set is_quota_enabled [quota::get_parameter -param "QuotaEnabled"]
+# If the user is root or the control quota is disabled --> We allow the upload without check
+if {$is_root || !($is_quota_enabled)} {
+ return 1
+} else {
+
+# Check if the user has a personal quota and get the parameters
+ set has_quota [db_0or1row get_quota {* SQL *}]
+ if {$has_quota} {
+ set uc_enabled $usercomm_actv
+ set max_pquota $personal_quota
+ set max_pfiles $personal_files
+ set max_quota $global_quota
+ set max_files $global_files
+ } else {
+ set uc_enabled 1
+ set max_pquota [quota::get_parameter -param "MaxQuotaByUserFolder"]
+ set max_pfiles [quota::get_parameter -param "MaxFilesByUserFolder"]
+ set max_quota [quota::get_parameter -param "MaxQuotaByUser"]
+ set max_files [quota::get_parameter -param "MaxFilesByUser"]
+ }
+
+ if {$uc_enabled} {
+ set used_pquota_and_pfiles [quota::get_used_pquota_and_pfiles -user_id $user_id]
+ set used_pquota [expr [lindex $used_pquota_and_pfiles 0] + $filesize]
+ set used_pfiles [expr [lindex $used_pquota_and_pfiles 1] + 1]
+ }
+# Check if we are in a community or in an user_folder
+ if {[string length $community_id] == 0} {
+ # CHECKING
+
+ if {($used_pquota < $max_pquota) && ($used_pfiles < $max_pfiles)} {
+ return 1
+ } else {
+ ns_log Notice "QUOTA >>> USER ($user_id) CAN'T UPLOAD TO ITS USER_FOLDER --> QUOTA ($used_pquota/$max_pquota) -- FILES ($used_pfiles/$max_pfiles)"
+ return 0
+ }
+
+ } else {
+ # COMMUNITY CASE
+
+ if {$uc_enabled} {
+ set used_quota_and_files [quota::get_used_quota_and_files -user_id $user_id]
+ set used_quota [expr [lindex $used_quota_and_files 0] + $filesize - $used_pquota]
+ set used_files [expr [lindex $used_quota_and_files 1] + 1 - $used_pfiles]
+ } else {
+ }
+
+ # Check if there are a quota instance for the community
+ set has_instances [quota::get_quota_package_id -community_id $community_id]
+ if {$has_instances == 0} {
+ set quota_c_enabled 1
+ set max_c_quota [quota::get_parameter -param "MaxQuotaByCommunity"]
+ set max_c_files [quota::get_parameter -param "MaxFilesByCommunity"]
+ } else {
+ set quota_c_enabled [quota::get_community_parameter -param "QuotaEnabled" -community_id $community_id]
+ set max_c_quota [quota::get_community_parameter -param "MaxQuotaByCommunity" -community_id $community_id]
+ set max_c_files [quota::get_community_parameter -param "MaxFilesByCommunity" -community_id $community_id]
+ }
+ # Check if the community has the community_quota enabled
+ if {$quota_c_enabled} {
+ set used_cquota_and_cfiles [quota::get_used_cquota_and_cfiles -community_id $community_id]
+ set used_c_quota [expr [lindex $used_cquota_and_cfiles 0] + $filesize]
+ set used_c_files [expr [lindex $used_cquota_and_cfiles 1] + 1]
+ } {
+ }
+
+ if {($used_quota <= $max_quota) && ($used_files <= $max_files) && \
+ ($used_c_quota <= $max_c_quota) && ($used_c_files <= $max_c_files)} {
+ return 1
+ } else {
+ ns_log Notice "QUOTA >>> USER ($user_id) CAN'T UPLOAD TO COMMUNITY ($community_id) --> QUOTA GLOBAL ($used_quota/$max_quota) -- FILES ($used_files/$max_files) -- COMMUNITY QUOTA ($used_c_quota/$max_c_quota) -- FILES ($used_c_files/$max_c_files)"
+ return 0
+ }
+ }
+}
+# end no root and enabled_q
+}
+# end function
+}
+
Index: openacs-4/packages/quota/tcl/quota-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/tcl/quota-procs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/tcl/quota-procs.xql 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,112 @@
+
+
+
+ postgresql7.1
+
+
+
+ select object_id as pid from acs_objects, apm_packages as apmp
+ where context_id =
+ (select package_id from dotlrn_communities_all
+ where community_id = :community_id)
+ and package_key = 'quota'
+ and object_id = apmp.package_id;
+
+
+
+
+
+ select attr_value as value from apm_parameter_values
+ where parameter_id = :param_id and
+ package_id = :pid
+
+
+
+
+
+
+
+ update apm_parameters set
+ default_value = :value
+ where parameter_name = :param
+
+
+
+
+
+
+ update apm_parameter_values
+ set attr_value = :value
+ where parameter_id = :param_id and
+ package_id = :pid
+
+
+
+
+
+ select * from user_quota
+ where ref_user = :user_id
+
+
+
+
+
+
+
+ select content_length from cr_revisions, acs_objects
+ where revision_id = object_id and
+ object_type = 'file_storage_object' and
+ content_length > 0 and
+ (creation_user = :user_id or modifying_user = :user_id);
+
+
+
+
+
+
+
+ select folder_id
+ from fs_folders
+ where parent_id = :folder_id
+
+
+
+
+
+
+ select item_id
+ from cr_items
+ where parent_id = :folder_id and
+ content_type::text = :type_s::text
+
+
+
+
+
+ select revision_id
+ from cr_revisions
+ where item_id = :item_id
+
+
+
+
+
+ select content_length as size
+ from cr_revisions
+ where revision_id = :revision_id
+
+
+
+
+
+ select community_id from dotlrn_member_rels_approved where user_id = :user_id
+
+
+
+
+
+ select revision_id from cr_revisions where item_id in (select item_id from acs_objects, cr_items where object_type = 'content_item' and content_type = 'file_storage_object' and parent_id = :folder_id and object_id = item_id and (creation_user = :user_id or modifying_user = :user_id));
+
+
+
+
Index: openacs-4/packages/quota/www/quota.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/quota.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota/www/quota.adp 21 Jun 2006 16:46:18 -0000 1.1
@@ -0,0 +1,44 @@
+
+
+@context;noquote@
+Quota
+
+
+
This community hasn't instancied the package quota. To set special values for this community it's needed to add the applet "QUOTA"
+
+Instance package quota for this community now
+