Index: openacs-4/packages/dotlrn-quota/dotlrn-quota.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/dotlrn-quota.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/dotlrn-quota.info 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,22 @@
+
+
+
+
+ dotLRN Quota Applet
+ dotLRN Quota Applets
+ f
+ t
+
+
+ OpenACS
+ 2005-12-15
+ OpenACS
+ 0
+
+
+
+
+
+
+
+
Index: openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.ca_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.ca_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.ca_ES.ISO-8859-1.xml 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+
+ Quota
+
Index: openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.en_US.ISO-8859-1.xml 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+
+ Quota
+
Index: openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.es_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/catalog/dotlrn-quota.es_ES.ISO-8859-1.xml 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+
+ Cuota
+
Index: openacs-4/packages/dotlrn-quota/sql/postgresql/dotlrn-quota-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/sql/postgresql/dotlrn-quota-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/sql/postgresql/dotlrn-quota-create.sql 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,152 @@
+--
+-- 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.
+--
+--
+-- Procedures to support the dotlrn quota
+--
+-- @author Agustin Lopez (Agustin.Lopez@uv.es)
+-- @creation-date 2004-10-10
+-- @version $Id: dotlrn-quota-create.sql,v 0.1 2004/10/10
+
+-- create the implementation
+select acs_sc_impl__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'dotlrn_quota'
+);
+
+-- add all the hooks
+
+-- GetPrettyName
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'GetPrettyName',
+ 'dotlrn_quota::get_pretty_name',
+ 'TCL'
+);
+
+-- AddApplet
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddApplet',
+ 'dotlrn_quota::add_applet',
+ 'TCL'
+);
+
+-- RemoveApplet
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveApplet',
+ 'dotlrn_quota::remove_applet',
+ 'TCL'
+);
+
+-- AddAppletToCommunity
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddAppletToCommunity',
+ 'dotlrn_quota::add_applet_to_community',
+ 'TCL'
+);
+
+-- RemoveAppletFromCommunity
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveAppletFromCommunity',
+ 'dotlrn_quota::remove_applet_from_community',
+ 'TCL'
+);
+
+-- AddUser
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddUser',
+ 'dotlrn_quota::add_user',
+ 'TCL'
+);
+
+-- RemoveUser
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveUser',
+ 'dotlrn_quota::remove_user',
+ 'TCL'
+);
+
+-- AddUserToCommunity
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddUserToCommunity',
+ 'dotlrn_quota::add_user_to_community',
+ 'TCL'
+);
+
+-- RemoveUserFromCommunity
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveUserFromCommunity',
+ 'dotlrn_quota::remove_user_from_community',
+ 'TCL'
+);
+
+-- AddPortlet
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddPortlet',
+ 'dotlrn_quota::add_portlet',
+ 'TCL'
+ );
+
+-- RemovePortlet
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemovePortlet',
+ 'dotlrn_quota::remove_portlet',
+ 'TCL'
+);
+
+-- Clone
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'Clone',
+ 'dotlrn_quota::clone',
+ 'TCL'
+);
+
+select acs_sc_impl_alias__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'ChangeEventHandler',
+ 'dotlrn_quota::change_event_handler',
+ 'TCL'
+);
+
+-- Add the binding
+select acs_sc_binding__new (
+ 'dotlrn_applet',
+ 'dotlrn_quota'
+);
Index: openacs-4/packages/dotlrn-quota/sql/postgresql/dotlrn-quota-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/sql/postgresql/dotlrn-quota-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/sql/postgresql/dotlrn-quota-drop.sql 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,120 @@
+--
+-- 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.
+--
+--
+-- Procedures to support the dotlrn quota
+--
+-- @author Agustin Lopez (Agustin.Lopez@uv.es)
+-- @creation-date 2004-10-10
+-- @version $Id: dotlrn-quota-drop.sql,v 0.1 2004/10/10
+
+select acs_sc_impl__delete(
+ 'dotlrn_applet', -- impl_contract_name
+ 'dotlrn_quota' -- impl_name
+);
+
+
+-- add all the hooks
+
+-- GetPrettyName
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'GetPrettyName'
+);
+
+-- AddApplet
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddApplet'
+);
+
+-- RemoveApplet
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveApplet'
+);
+
+-- AddAppletToCommunity
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddAppletToCommunity'
+);
+
+-- RemoveAppletFromCommunity
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveAppletFromCommunity'
+);
+
+-- AddUser
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddUser'
+);
+
+-- RemoveUser
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveUser'
+);
+
+-- AddUserToCommunity
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddUserToCommunity'
+);
+
+-- RemoveUserFromCommunity
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemoveUserFromCommunity'
+);
+
+-- AddPortlet
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'AddPortlet'
+ );
+
+-- RemovePortlet
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'RemovePortlet'
+);
+
+-- Clone
+select acs_sc_impl_alias__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota',
+ 'Clone'
+);
+
+
+-- Add the binding
+select acs_sc_binding__delete (
+ 'dotlrn_applet',
+ 'dotlrn_quota'
+);
Index: openacs-4/packages/dotlrn-quota/tcl/dotlrn-quota-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/tcl/dotlrn-quota-procs-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/tcl/dotlrn-quota-procs-postgresql.xql 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+postgresql7.1
+
+
+
+ select quota__clone (
+ :old_package_id,
+ :new_package_id
+ );
+
+
+
+
+
Index: openacs-4/packages/dotlrn-quota/tcl/dotlrn-quota-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-quota/tcl/dotlrn-quota-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-quota/tcl/dotlrn-quota-procs.tcl 21 Jun 2006 17:07:30 -0000 1.1
@@ -0,0 +1,244 @@
+#
+# 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.
+#
+
+ad_library {
+
+ Procs to set up the dotLRN quota applet
+
+ @author Agustin Lopez (Agustin.Lopez@uv.es)
+ @author Paco Soler (fransola@uv.es)
+ @creation-date 2005-12-15
+ @version $Id: dotlrn-quota-procs.tcl,v 0.2 2005/12/15
+
+}
+
+namespace eval dotlrn_quota {
+
+ ad_proc -public applet_key {
+ } {
+ What's my applet key?
+ } {
+ return dotlrn_quota
+ }
+
+ ad_proc -public package_key {
+ } {
+ What package do I deal with?
+ } {
+ return quota
+ }
+
+ ad_proc -public my_package_key {
+ } {
+ What package do I deal with?
+ } {
+ return "dotlrn-quota"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ returns the pretty name
+ } {
+ return "[_ dotlrn-quota.pretty_name]"
+ }
+
+ ad_proc -public add_applet {
+ } {
+ One time init - must be repeatable!
+ } {
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
+ }
+
+ ad_proc -public remove_applet {
+ } {
+ One time destroy.
+ } {
+ dotlrn_applet::remove_applet_from_dotlrn -applet_key [applet_key]
+ }
+
+ ad_proc -public add_applet_to_community {
+ community_id
+ } {
+ Add the quota applet to a specifc dotlrn community
+ } {
+ set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
+
+ # create the quota package instance (all in one, I've mounted it)
+ set package_id [dotlrn::instantiate_and_mount $community_id [package_key]]
+
+ # set up the admin portal
+ set admin_portal_id [dotlrn_community::get_admin_portal_id \
+ -community_id $community_id
+ ]
+
+ quota_admin_portlet::add_self_to_page \
+ -portal_id $admin_portal_id \
+ -package_id $package_id
+
+ set args [ns_set create]
+ ns_set put $args package_id $package_id
+ add_portlet_helper $portal_id $args
+
+ return $package_id
+ }
+
+ ad_proc -public remove_applet_from_community {
+ community_id
+ } {
+ remove the applet from the community
+ } {
+ ad_return_complaint 1 "[applet_key] remove_applet_from_community not implimented!"
+ }
+
+ ad_proc -public add_user {
+ user_id
+ } {
+ one time user-specifuc init
+ } {
+ # noop
+ }
+
+ ad_proc -public remove_user {
+ user_id
+ } {
+ } {
+ # noop
+ }
+
+ ad_proc -public add_user_to_community {
+ community_id
+ user_id
+ } {
+ Add a user to a specifc dotlrn community
+ } {
+ set package_id [dotlrn_community::get_applet_package_id -community_id $community_id -applet_key [applet_key]]
+ set portal_id [dotlrn::get_portal_id -user_id $user_id]
+
+ # use "append" here since we want to aggregate
+ set args [ns_set create]
+ ns_set put $args package_id $package_id
+ ns_set put $args param_action append
+
+ #For do not appears on user personal page
+ add_portlet_helper $portal_id $args
+ }
+
+ ad_proc -public remove_user_from_community {
+ community_id
+ user_id
+ } {
+ Remove a user from a community
+ } {
+ set package_id [dotlrn_community::get_applet_package_id -community_id $community_id -applet_key [applet_key]]
+ set portal_id [dotlrn::get_portal_id -user_id $user_id]
+
+ set args [ns_set create]
+ ns_set put $args package_id $package_id
+
+ remove_portlet $portal_id $args
+ }
+
+ ad_proc -public add_portletOLD {
+ portal_id
+ } {
+ A helper proc to add the underlying portlet to the given portal.
+
+ @param portal_id
+ } {
+ # simple, no type specific stuff, just set some dummy values
+
+ set args [ns_set create]
+ ns_set put $args package_id 0
+ ns_set put $args param_action overwrite
+ add_portlet_helper $portal_id $args
+ }
+
+ ad_proc -public add_portlet {
+ portal_id
+ } {
+ A helper proc to add the underlying portlet to the given portal.
+
+ @param portal_id
+ } {
+ set args [ns_set create]
+ ns_set put $args package_id 0
+ set type [dotlrn::get_type_from_portal_id -portal_id $portal_id]
+
+ if {[string equal $type "dotlrn_class_instance"] == 1} {
+ add_portlet_helper $portal_id $args
+ } else {
+ # not to any of the other types
+ return
+ }
+
+ }
+
+ ad_proc -public add_portlet_helper {
+ portal_id
+ args
+ } {
+ A helper proc to add the underlying portlet to the given portal.
+
+ @param portal_id
+ @param args an ns_set
+ } {
+ quota_portlet::add_self_to_page \
+ -portal_id $portal_id \
+ -package_id [ns_set get $args package_id] \
+ -param_action [ns_set get $args param_action]
+ }
+
+ ad_proc -public remove_portlet {
+ portal_id
+ args
+ } {
+ A helper proc to remove the underlying portlet from the given portal.
+
+ @param portal_id
+ @param args A list of key-value pairs (possibly user_id, community_id, and more)
+ } {
+ quota_portlet::remove_self_from_page \
+ -portal_id $portal_id \
+ -package_id [ns_set get $args package_id]
+ }
+
+ ad_proc -public clone {
+ old_community_id
+ new_community_id
+ } {
+ Clone this applet's content from the old community to the new one
+ } {
+ set new_package_id [add_applet_to_community $new_community_id]
+ set old_package_id [dotlrn_community::get_applet_package_id \
+ -community_id $old_community_id \
+ -applet_key [applet_key]
+ ]
+
+ db_exec_plsql call_quota_clone {}
+ return $new_package_id
+ }
+
+ ad_proc -public change_event_handler {
+ community_id
+ event
+ old_value
+ new_value
+ } {
+ listens for the following events:
+ } {
+ }
+
+}
Index: openacs-4/packages/quota-portlet/quota-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/quota-portlet.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/quota-portlet.info 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+
+ Quota Portlet
+ Quota Portlets
+ f
+ t
+
+
+ OpenACS
+ 2005-12-15
+ OpenACS
+ 0
+
+
+
+
+
+
+
Index: openacs-4/packages/quota-portlet/catalog/quota-portlet.ca_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/catalog/quota-portlet.ca_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/catalog/quota-portlet.ca_ES.ISO-8859-1.xml 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ Administraci� de quota
+ Comunitat
+ Detalls de la Comunitat
+ N� Arxius
+ Quota Global (Kb)
+ Arxius Personals
+ Quota Personal (Kb)
+ Quota
+ Quota
+ Gestionar Quotes
+ Disponible
+ Total
+ utilitzat
+ Usuari
+ Detalls d'usuari
+
Index: openacs-4/packages/quota-portlet/catalog/quota-portlet.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/catalog/quota-portlet.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/catalog/quota-portlet.en_US.ISO-8859-1.xml 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ Quota administration
+ Community
+ Community Details
+ Global Files
+ Global Quota (Kb)
+ Personal Files
+ Personal Quota (Kb)
+ Quota
+ Quota
+ Manage Quota
+ Available
+ Total
+ Used
+ User
+ User Details
+
Index: openacs-4/packages/quota-portlet/catalog/quota-portlet.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/catalog/quota-portlet.es_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/catalog/quota-portlet.es_ES.ISO-8859-1.xml 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ Administraci�n de cuota
+ Comunidad
+ Detalles de la Comunidad
+ N� Archivos
+ Quota Global (Kb)
+ Archivos Personales
+ Quota Personal (Kb)
+ Cuota
+ Cuota
+ Gestionar Cuotas
+ Disponible
+ Total
+ Usado
+ Usuario
+ Detalles del usuario
+
Index: openacs-4/packages/quota-portlet/sql/postgresql/quota-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/sql/postgresql/quota-admin-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/sql/postgresql/quota-admin-portlet-create.sql 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,180 @@
+--
+-- 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.
+--
+--
+-- Procedures to support the quota portlet
+--
+-- @author Paco Soler (fransola@uv.es)
+-- @author Agustin Lopez (Agustin.Lopez@uv.es)
+-- @creation-date 2005-12-15
+-- @version $Id: quota-admin-portlet-create.sql,v 0.2 2005-12-15
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id = portal_datasource__new( ''quota_admin_portlet'', ''Quota Admin portlet'');
+
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shadeable_p'',
+ ''f''
+);
+
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''f''
+);
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''f''
+);
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+-- quota_admin-specific params
+
+ -- package_id must be configured
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''f'',
+ ''package_id'',
+ ''''
+);
+
+ return 0;
+
+end;' language 'plpgsql';
+
+select inline_0();
+drop function inline_0();
+
+
+create function inline_1()
+returns integer as '
+begin
+
+ -- create the implementation
+ perform acs_sc_impl__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''quota_admin_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new(
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''GetMyName'',
+ ''quota_admin_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''GetPrettyName'',
+ ''quota_admin_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''Link'',
+ ''quota_admin_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''AddSelfToPage'',
+ ''quota_admin_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''Show'',
+ ''quota_admin_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''Edit'',
+ ''quota_admin_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet'',
+ ''RemoveSelfFromPage'',
+ ''quota_admin_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''quota_admin_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+
Index: openacs-4/packages/quota-portlet/sql/postgresql/quota-admin-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/sql/postgresql/quota-admin-portlet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/sql/postgresql/quota-admin-portlet-drop.sql 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,105 @@
+--
+-- 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.
+--
+--
+-- Procedures to support the quota portlet
+--
+-- @author Paco Soler (fransola@uv.es)
+-- @author Agustin Lopez (Agustin.Lopez@uv.es)
+-- @creation-date 2005-12-15
+-- @version $Id: quota-admin-portlet-drop.sql,v 0.2 2005-12-15
+
+create function inline_0 ()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = ''quota_admin_portlet'';
+
+ if not found then
+ raise exception ''No datasource_id found here '',ds_id ;
+ ds_id := null;
+ end if;
+
+
+ if ds_id is NOT null then
+ perform portal_datasource__delete(ds_id);
+ end if;
+
+return 0;
+
+end;' language 'plpgsql';
+
+select inline_0 ();
+
+drop function inline_0 ();
+
+-- create the implementation
+select acs_sc_impl__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet'
+);
+
+-- delete all the hooks
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet',
+ 'GetMyName'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet',
+ 'GetPrettyName'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet',
+ 'Link'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet',
+ 'AddSelfToPage'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet',
+ 'Show'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet',
+ 'Edit'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet',
+ 'RemoveSelfFromPage'
+);
+
+-- Add the binding
+select acs_sc_binding__delete (
+ 'portal_datasource',
+ 'quota_admin_portlet'
+);
Index: openacs-4/packages/quota-portlet/sql/postgresql/quota-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/sql/postgresql/quota-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/sql/postgresql/quota-portlet-create.sql 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,185 @@
+--
+-- 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.
+--
+--
+-- Procedures to support the quota portlet
+--
+-- @author Paco Soler (fransola@uv.es)
+-- @author Agustin Lopez (Agustin.Lopez@uv.es)
+-- @creation-date 2005-12-15
+-- @version $Id: quota-portlet-create.sql,v 0.2 2005-12-15
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id = portal_datasource__new(
+ ''quota_portlet'', -- Name
+ ''Quota portlet'' -- description
+ );
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id, -- datasource_id
+ ''t'', -- config_required_p
+ ''t'', -- configured_p
+ ''shadeable_p'', -- key
+ ''t'' -- value
+);
+
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''t''
+);
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''f''
+);
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+-- quota-specific params
+
+ -- community_id must be configured
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''f'',
+ ''package_id'',
+ ''''
+);
+
+ return 0;
+
+end;' language 'plpgsql';
+
+select inline_0();
+
+drop function inline_0();
+
+
+create function inline_1()
+returns integer as '
+begin
+
+ -- create the implementation
+ perform acs_sc_impl__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''quota_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''GetMyName'',
+ ''quota_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''GetPrettyName'',
+ ''quota_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''Link'',
+ ''quota_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''AddSelfToPage'',
+ ''quota_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''Show'',
+ ''quota_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''Edit'',
+ ''quota_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''RemoveSelfFromPage'',
+ ''quota_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''quota_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+
+drop function inline_1();
+
+
+\i quota-admin-portlet-create.sql
Index: openacs-4/packages/quota-portlet/sql/postgresql/quota-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/sql/postgresql/quota-portlet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/sql/postgresql/quota-portlet-drop.sql 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,109 @@
+--
+-- 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.
+--
+--
+-- Procedures to support the quota portlet
+--
+-- @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
+
+create function inline_1()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = ''quota_portlet'';
+
+ if not found then
+ RAISE EXCEPTION '' No datasource id found '', ds_id;
+ ds_id := null;
+ end if;
+
+ if ds_id is NOT null then
+ perform portal_datasource__delete(ds_id);
+ end if;
+
+ -- drop the hooks
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''GetMyName''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''GetPrettyName''
+ );
+
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''Link''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''AddSelfToPage''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''Show''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''Edit''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''quota_portlet'',
+ ''RemoveSelfFromPage''
+ );
+
+ -- Drop the binding
+ perform acs_sc_binding__delete (
+ ''portal_datasource'',
+ ''quota_portlet''
+ );
+
+ -- drop the impl
+ perform acs_sc_impl__delete (
+ ''portal_datasource'',
+ ''quota_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+\i quota-admin-portlet-drop.sql
+
+
+
+
Index: openacs-4/packages/quota-portlet/tcl/quota-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/tcl/quota-admin-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/tcl/quota-admin-portlet-procs.tcl 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,91 @@
+#
+# 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.
+#
+
+ad_library {
+
+ Procedures to support the quota admin portlet
+
+ @author Agustin Lopez (Agustin.Lopez@uv.es)
+ @author Paco Soler (fransola@uv.es)
+ @creation-date 2005-12-15
+ @version $Id: quota-admin-portlet-procs.tcl,v 0.2 2005-12-15
+
+}
+
+namespace eval quota_admin_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "quota_admin_portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "#quota-portlet.admin_pretty_name#"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "quota-portlet"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-page_name ""}
+ {-package_id:required}
+ } {
+ Adds a quota admin PE to the given portal
+
+ @param portal_id The page to add self to
+ @param package_id The package_id of the quota package
+
+ @return element_id The new element's id
+ } {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key package_id \
+ -value $package_id
+ ]
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ } {
+ Removes a quota admin PE from the given page
+ } {
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ } {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "quota-admin-portlet"
+
+ }
+
+}
Index: openacs-4/packages/quota-portlet/tcl/quota-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/tcl/quota-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/tcl/quota-portlet-procs.tcl 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,99 @@
+#
+# 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.
+#
+
+ad_library {
+
+ Procedures to support the quota portlet
+
+ @author Agustin Lopez (Agustin.Lopez@uv.es)
+ @author Paco Soler (fransola@uv.es)
+ @creation-date 2005-12-15
+ @version $Id: quota-portlet-procs.tcl,v 0.2 2005/12/15
+
+}
+
+namespace eval quota_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "quota_portlet"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "quota-portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "#quota-portlet.pretty_name#"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-page_name ""}
+ {-package_id:required}
+ {-extra_params ""}
+ {-force_region ""}
+ {-param_action:required}
+ } {
+ add the portlet element to the given portal
+ } {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -page_name $page_name \
+ -pretty_name [get_pretty_name] \
+ -portlet_name [get_my_name] \
+ -key package_id \
+ -value $package_id \
+ -force_region $force_region \
+ -extra_params $extra_params \
+ -param_action $param_action
+ ]
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ {-package_id:required}
+ } {
+ Removes a quota PE from the given page or the package_id of the
+ quota package from the portlet if there are others remaining
+
+ @param portal_id The page to remove self from
+ @param package_id
+ } {
+ portal::remove_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value $package_id
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ } {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "quota-portlet"
+ }
+
+}
Index: openacs-4/packages/quota-portlet/www/quota-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/www/quota-admin-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/www/quota-admin-portlet.adp 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,27 @@
+<%
+ #
+ # 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.
+ #
+%>
+
+
\ No newline at end of file
Index: openacs-4/packages/quota-portlet/www/quota-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/www/quota-admin-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/www/quota-admin-portlet.tcl 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,43 @@
+#
+# 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.
+#
+
+ad_page_contract {
+ The display logic for the quota admin portlet
+
+ @author Paco Soler (fransola@uv.es)
+ @author Agustin Lopez (Agustin.Lopez@uv.es)
+ @creation-date 2005-12-15
+ @version $Id: quota-admin-portlet.tcl,v 0.2 2005/12/15
+
+} -properties {
+}
+
+array set config $cf
+set user_id [ad_conn user_id]
+set list_of_package_ids $config(package_id)
+
+if {[llength $list_of_package_ids] > 1} {
+ # We have a problem!
+ return -code error "There should be only one instance of quota for admin purposes"
+}
+
+set package_id [lindex $list_of_package_ids 0]
+
+set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
+
+set site_admin [acs_user::site_wide_admin_p]
+
+ad_return_template
Index: openacs-4/packages/quota-portlet/www/quota-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/www/quota-portlet-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/www/quota-portlet-postgresql.xql 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,7 @@
+
+
+
+postgresql7.1
+
+
+
Index: openacs-4/packages/quota-portlet/www/quota-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/www/quota-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/www/quota-portlet.adp 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,82 @@
+<%
+ #
+ # 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.
+ #
+%>
+
+
+
+@context;noquote@
+Quota
+
+
+ |
+
+ @username@ |
+ #quota-portlet.global_quota# |
+ #quota-portlet.global_files# |
+ #quota-portlet.personal_quota# |
+ #quota-portlet.personal_files# |
+
+
+
+ #quota-portlet.used# |
+ @gq_used@ |
+ @gf_used@ |
+ @pq_used@ |
+ @pf_used@ |
+
+
+
+ #quota-portlet.total# |
+ @gq_total@ |
+ @gf_total@ |
+ @pq_total@ |
+ @pf_total@ |
+
+
+ #quota-portlet.used# |
+ @gq_used@ |
+ @gf_used@ |
+ @pq_used@ |
+ @pf_used@ |
+
+
+ #quota-portlet.rest# |
+ @gq_rest@ |
+ @gf_rest@ |
+ @pq_rest@ |
+ @pf_rest@ |
+
+
+
+
+
+ #quota-portlet.user_details#
+ |
+ #quota-portlet.community_details#
+
+ |
+
+
+
+
Index: openacs-4/packages/quota-portlet/www/quota-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/quota-portlet/www/quota-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/quota-portlet/www/quota-portlet.tcl 21 Jun 2006 17:08:35 -0000 1.1
@@ -0,0 +1,115 @@
+#
+# 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.
+#
+
+ad_page_contract {
+ The display logic for the quota portlet
+ @author Paco Soler (fransola@uv.es)
+ @author Agustin Lopez (Agustin.Lopez@uv.es)
+ @creation-date 2005-12-15
+ @version $Id: quota-portlet.tcl,v 0.2 2005-12-15
+
+} -properties {
+ context:onevalue
+ user_id:onevalue
+} -validate {
+
+}
+
+set context [list]
+array set config $cf
+set list_of_package_ids $config(package_id)
+set user_id [ad_conn user_id]
+set sep_package_ids [join $list_of_package_ids ", "]
+if {[llength $list_of_package_ids] == 1} { set single_p "t"} else {set single_p "f"}
+set context [list]
+set shaded_p $config(shaded_p)
+set quota_url "[ad_conn package_url]/quota/quota"
+set community_id [dotlrn_community::get_community_id]
+set pid 0
+set site_admin [acs_user::site_wide_admin_p -user_id $user_id]
+set admin [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id]
+
+
+if {$sep_package_ids == ""} {
+ set sep_package_ids [dotlrn_community::get_package_id $community_id]
+}
+set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0]
+set package_id [ad_conn package_id]
+
+if {[exists_and_not_null community_id]} {
+ #We are in portal for one class or community
+ set inside_comm_p 1
+ set url_to_quota $quota_url
+ set comm_quota_url "quota/quota"
+} else {
+ #We are in user portal
+ set inside_comm_p 0
+ set url_to_quota ""
+ set comm_quota_url "../quota/quota"
+}
+
+# Get user information
+db_1row get_user_info "select username, first_names, last_name from acs_users_all where user_id = :user_id"
+
+# Obtenemos quota global y del directorio personal m�xima permitida para el usuario
+set has_quota [db_0or1row get_user_quota "select * from user_quota where ref_user = :user_id"]
+ if {$has_quota} {
+ set gq_total $global_quota
+ set gf_total $global_files
+ set pq_total $personal_quota
+ set pf_total $personal_files
+ } else {
+ set gq_total [quota::get_parameter -param "MaxQuotaByUser"]
+ set gf_total [quota::get_parameter -param "MaxFilesByUser"]
+ set pq_total [quota::get_parameter -param "MaxQuotaByUserFolder"]
+ set pf_total [quota::get_parameter -param "MaxFilesByUserFolder"]
+ }
+
+# Obtenemos quota del directorio personal usada por del usuario
+set used_pquota_and_pfiles [quota::get_used_pquota_and_pfiles -user_id $user_id]
+set pq_used [lindex $used_pquota_and_pfiles 0]
+set pf_used [lindex $used_pquota_and_pfiles 1]
+
+# Quota directorio personal disponible
+set pq_rest [expr $pq_total - $pq_used]
+set pf_rest [expr $pf_total - $pf_used]
+
+if {$pq_rest < 0} {
+ set pq_rest 0
+}
+
+if {$pf_rest < 0} {
+ set pf_rest 0
+}
+
+# Obtenemos quota global usada por del usuario
+set used_quota_and_files [quota::get_used_quota_and_files -user_id $user_id]
+set gq_used [lindex $used_quota_and_files 0]
+set gf_used [lindex $used_quota_and_files 1]
+
+set gq_used [expr $gq_used - $pq_used]
+set gf_used [expr $gf_used - $pf_used]
+
+# Quota disponible
+set gq_rest [expr $gq_total - $gq_used]
+set gf_rest [expr $gf_total - $gf_used]
+
+
+ad_return_template
+
+
+
+