Commit f17c0191 authored by Frank Bergmann's avatar Frank Bergmann

Initial Import

parents
Pipeline #235 failed with stages
<?xml version="1.0"?>
<!-- Generated by the OpenACS Package Manager -->
<package key="intranet-estimate-to-complete" url="http://openacs.org/repository/apm/packages/intranet-estimate-to-complete" type="apm_application">
<package-name>]project-open[ Estimate to Complete</package-name>
<pretty-plural>]project-open[ Estimate to Complete</pretty-plural>
<initial-install-p>f</initial-install-p>
<singleton-p>t</singleton-p>
<implements-subsite-p>f</implements-subsite-p>
<inherit-templates-p>f</inherit-templates-p>
<auto-mount>intranet-estimate-to-complete</auto-mount>
<version name="0.1d" url="http://openacs.org/repository/download/apm/intranet-estimate-to-complete-0.1d.apm">
<owner url="mailto:frank.bergmann@project-open.com">Frank Bergmann</owner>
<summary>Provides the &#34;Estimate to Complete&#34; (ETC) project management tool</summary>
<vendor url="http://www.project-open.com/">]project-open[ Business Solutions, S.L.</vendor>
<description format="text/plain">Estimate to Complete (ETC) allows users to enter an estimation of the remaining work in a task conveniently in a timesheet screen. It serves as an early warning tool for project managers.</description>
<maturity>0</maturity>
<provides url="intranet-estimate-to-complete" version="0.1d"/>
<callbacks>
</callbacks>
<parameters>
<!-- No version parameters -->
</parameters>
</version>
</package>
This diff is collapsed.
-- /packages/intranet-estimate-to-complete/sql/postgresql/intranet-estimate-to-complete-drop.sql
--
-- Copyright (c) 2003-2008 ]project-open[
--
-- All rights reserved. Please check
-- http://www.project-open.com/license/ for details.
--
-- @author frank.bergmann@project-open.com
-- Drop plugins and menus for the module
--
select im_component_plugin__del_module('intranet-estimate-to-complete');
select im_menu__del_module('intranet-estimate-to-complete');
-----------------------------------------------------------
-- Drop main structures info
-- Drop functions
drop function if exists im_estimate_to_complete__name(integer);
drop function if exists im_estimate_to_complete__new (
integer, varchar, timestamptz, integer, varchar, integer,
integer, integer,
integer, integer, numeric, integer
);
drop function if exists im_estimate_to_complete__delete(integer);
-- Drop the main table
drop table if exists im_estimate_to_completes;
update acs_objects set context_id = null
where context_id in (select object_id from acs_objects where object_type = 'im_estimate_to_complete');
delete from im_dynfield_layout
where attribute_id in (
select attribute_id from im_dynfield_attributes
where acs_attribute_id in (
select attribute_id from acs_attributes
where object_type = 'im_estimate_to_complete'
)
);
delete from im_dynfield_attributes
where acs_attribute_id in (
select attribute_id from acs_attributes
where object_type = 'im_estimate_to_complete'
);
delete from im_dynfield_layout_pages
where object_type = 'im_estimate_to_complete';
delete from acs_attributes
where object_type = 'im_estimate_to_complete';
delete from acs_object_type_tables
where object_type = 'im_estimate_to_complete';
delete from im_biz_object_urls
where object_type = 'im_estimate_to_complete';
-- Completely delete the object type from the
-- object system
SELECT acs_object_type__drop_type ('im_estimate_to_complete', 't');
-----------------------------------------------------------
-- Drop Categories
--
-- drop view if exists im_estimate_to_complete_status;
-- drop view if exists im_estimate_to_complete_type;
delete from im_categories where category_type = 'Intranet Estimate to Complete Status';
delete from im_categories where category_type = 'Intranet Estimate to Complete Type';
psql:intranet-estimate-to-complete-create.sql:26: ERROR
: duplicate key value violates unique constraint "acs_obj_types_pretty_name_un"
DETAIL: Key (pretty_name)=(Estimate to Complete) already exists.
CONTEXT: SQL statement "insert into acs_object_types (
object_type, pretty_name, pretty_plural, supertype, table_name,
id_column, abstract_p, type_extension_table, package_name,
name_method
) values (
create_type__object_type, create_type__pretty_name,
create_type__pretty_plural, v_supertype,
create_type__table_name, create_type__id_column,
create_type__abstract_p, create_type__type_extension_table,
v_package_name, v_name_method
)"
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying) line 40 at SQL statement
psql:intranet-estimate-to-complete-create.sql:29: ERROR: insert or update on table "acs_object_type_tables" violates foreign key constraint "acs_obj_type_tbls_obj_type_fk"
DETAIL: Key (object_type)=(im_estimate_to_complete) is not present in table "acs_object_types".
INSERT 4520686 1
INSERT 4520687 1
UPDATE 0
psql:intranet-estimate-to-complete-create.sql:82: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "im_estimate_to_complete_id_pk" for table "im_estimate_to_completes"
CREATE TABLE
CREATE INDEX
CREATE FUNCTION
psql:intranet-estimate-to-complete-create.sql:163: ERROR: syntax error at or near "v_etc_planned_hours_audit"
LINE 40: v_etc_planned_hours_audit, v_etc_logged_hours_audit, v_etc...
^
CREATE FUNCTION
CREATE FUNCTION
im_category_new
-----------------
0
(1 row)
im_category_new
-----------------
0
(1 row)
im_component_plugin__new
--------------------------
48419
(1 row)
acs_permission__grant_permission
----------------------------------
0
(1 row)
CREATE FUNCTION
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: project_id=37483, project_name=Brainstorm concepts
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: planned_hours_task=552
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: reported_hours=183.13
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: percent_completed=33.4915311761236
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: assigned_percentage_task=400.00
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: Angelique Picard: ass=100.00, planned_etc=91.78168697694943200, logged_etc=<NULL>
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: Consultant Consultant: ass=100.00, planned_etc=91.78168697694943200, logged_etc=<NULL>
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: Project Manager: ass=100.00, planned_etc=91.78168697694943200, logged_etc=<NULL>
psql:intranet-estimate-to-complete-create.sql:321: NOTICE: im_estimate_to_complete__user_etc: System Administrator: ass=100.00, planned_etc=91.78168697694943200, logged_etc=<NULL>
im_estimate_to_complete__user_etc
-----------------------------------
367.12674790779772800
(1 row)
DELETE 16
DELETE 1
INSERT 4520733 1
INSERT 4520734 1
INSERT 4520735 1
INSERT 4520736 1
INSERT 4520737 1
INSERT 4520738 1
INSERT 4520739 1
INSERT 4520740 1
INSERT 4520741 1
INSERT 4520742 1
INSERT 4520743 1
INSERT 4520744 1
INSERT 4520745 1
INSERT 4520746 1
INSERT 4520747 1
INSERT 4520748 1
INSERT 4520749 1
# /packages/intranet-estimate-to-complete/tcl/intranet-estimate-to-complete-procs.tcl
#
# Copyright (C) 1998-2004 various parties
ad_library {
Estimate to Complete
@author frank.bergmann@project-open.com
}
# ---------------------------------------------------------------------
#
# ---------------------------------------------------------------------
ad_proc -public im_estimate_to_complete_task_details_component {
task_id
} {
Returns information about ETC and other estimation types.
} {
db_1row task_info "
select p.*,
t.*,
im_estimate_to_complete__user_etc(p.project_id) as etc_entered,
p.start_date::date as start_date_pretty,
p.end_date::date as end_date_pretty,
now()::date as today_pretty,
extract(epoch from p.start_date) as start_date_epoch,
extract(epoch from p.end_date) as end_date_epoch,
extract(epoch from (p.end_date - p.start_date)) as duration_epoch,
extract(epoch from now()) as today_epoch,
( select sum(pbom.percentage)
from acs_rels pr,
im_biz_object_members pbom
where pr.rel_id = pbom.rel_id and
pr.object_id_one = p.project_id
) as assigned_percentage
from im_projects p,
im_timesheet_tasks t
where p.project_id = :task_id and
p.project_id = t.task_id
"
# -----------------------------------------------------
#
set result [list]
lappend result [list "Time Planning"]
lappend result [list "Start" $start_date_pretty "Scheduled start of task"]
lappend result [list "End" $end_date_pretty "Scheduled end of task"]
lappend result [list "Time Passed" [expr ($today_epoch - $start_date_epoch) / (24 * 2600)] "Days since task start.<br>Negative values indicatate that the task will start in the future."]
if {0 == $duration_epoch} { set duration_epoch [24 * 3600] }
set today_perc [expr 100.0 * ($today_epoch - $start_date_epoch) / $duration_epoch]
lappend result [list "Time Passed %" $today_perc "Progress of the task as a percentage between start- and end date.<br>Values &lt; 0 indicate that the task will start in the future.<br>Values &gt; 100 indicate that end date of the task has passed."]
lappend result [list "Hour Based Planning"]
lappend result [list "Planned Hours" $planned_units "Estimation of the work needed to complete the task.<br>Typically imported from MS-Project or entered manually."]
lappend result [list "Billable Hours" $billable_units "Normally same as planned units, but used for invoicing customers."]
lappend result [list "Logged Hours" $reported_hours_cache "Hours logged by employees in the timesheet."]
set reported_hours_perc [expr 100.0 * $reported_hours_cache / $planned_units]
lappend result [list "Logged Hours %" $reported_hours_perc "Logged hours as a percentage of planned hours.<br>This corresponds to the resources consumed<br>(ignoring resources other than logged hours)."]
lappend result [list "Percent Completed" $percent_completed "How much of the task has been finished (percent)?<br>Entered manually by the PM normally.<br>Should be greater or equal to logged hours %, otherwise the task is late."]
lappend result [list "Resources Assigned" $assigned_percentage "How many resources have been assigned to the task (percent)?<br>One resource counts as 100%."]
# -----------------------------------------------------
#
lappend result [list "Estimate to Complete"]
set etc_planned [expr $planned_units * (100.0 - $percent_completed) / 100.0]
lappend result [list "Estimate to Complete<br>(Planned)" $etc_planned "Based on the number of hours left to work, according to planned hours and percent completed."]
set etc_eva $planned_units
if {$percent_completed > 0.0} {
set etc_eva [expr (100.0 - $percent_completed) * $reported_hours_cache / $percent_completed]
}
lappend result [list "Estimate to Complete<br>(Earned Value)" $etc_eva "Based on the logged hours that it took to achieve the current percent completed."]
lappend result [list "Estimate to Complete<br>(Manually Entered)" $etc_entered "Based on manually entered ETC values (during timesheet entry), taking planned ETC as a default if no estimates are available.<br>Watch out for outdated ETC estimates!"]
# -----------------------------------------------------
#
lappend result [list "Estimate at Completion"]
lappend result [list "Estimate at Completion<br>(Planned)" $planned_units "= Planned Hours."]
set eac_eva [expr $reported_hours_cache + $etc_eva]
lappend result [list "Estimate at Completion<br>(Earned Value)" $eac_eva "Based on the logged hours that it took to achieve the current percent completed."]
set eac_entered [expr $reported_hours_cache + $etc_entered]
lappend result [list "Estimate at Completion<br>(Manually Entered)" $eac_entered "Based on manually entered ETC values (during timesheet entry), taking planned ETC as a default if no estimates are available.<br>Watch out for outdated ETC estimates!"]
set html ""
foreach tuple $result {
set key [lindex $tuple 0]
regsub -all { } $key "_" key_underscored
set key_l10n [lang::message::lookup "" intranet-timesheet2-tasks.$key_underscored $key]
if {[llength $tuple] eq 1} {
append html "<tr valign=top><td colspan=3 align=center><b>$key_l10n</b></td></tr>\n"
continue
}
set value [lindex $tuple 1]
if {[string is double $value]} {
set value [expr round($value * 10.0) / 10.0]
}
append html "<tr valign=top><td><nobr>$key_l10n</nobr></td><td align=right><nobr>$value</nobr></td><td>[lindex $tuple 2]</tr>\n"
}
return "
<table cellspacing=2 cellpadding=2>
<th><tr class=rowtitle>
<td class=rowtitle>[lang::message::lookup "" intranet-timesheet2.Indicator "Indicator"]</td>
<td class=rowtitle>[lang::message::lookup "" intranet-timesheet2.Value "Value"]</td>
<td class=rowtitle>[lang::message::lookup "" intranet-timesheet2.Comment "Comment"]</td>
</tr></th>
$html</table>
"
}
ad_proc -public im_estimate_to_complete_task_history_component {
task_id
} {
Returns information about ETC and other estimation types.
} {
set current_user_id [auth::require_login]
set history_sql "
select
creation_date::date as day,
round(task_planned_hours_audit,1) as task_planned_hours,
round(task_completed_percent_audit,1) as task_percent_completed,
im_name_from_user_id(etc_user_id) as user_name,
round(task_planned_hours_audit * user_assigned_percent_audit / task_assigned_percent_audit,1) as user_planned_hours,
round(100.0 * user_assigned_percent_audit / task_assigned_percent_audit,1) as percent_hours_assigned_to_user,
round(logged_hours, 1) as user_logged_hours,
round(etc_units,1) as estimate_to_complete_manual,
round(logged_hours + etc_units,1) as estimate_at_completion_based_on_etc,
round(100.0 * (logged_hours + etc_units - (task_planned_hours_audit * user_assigned_percent_audit / task_assigned_percent_audit)) / (task_planned_hours_audit * user_assigned_percent_audit / task_assigned_percent_audit),1) as eac_deviation_percent
from (select e.*,
o.creation_date,
( select round(sum(h.hours),1)
from im_hours h
where h.project_id = :task_id and
h.user_id = :current_user_id
) as logged_hours,
(select sum(percentage)
from acs_rels r,
im_biz_object_members bom
where r.rel_id = bom.rel_id and
r.object_id_two = :current_user_id and
r.object_id_one = :task_id
) as user_percent_assigned,
(select greatest(sum(percentage), 0.01)
from acs_rels r,
im_biz_object_members bom
where r.rel_id = bom.rel_id and
r.object_id_one = :task_id
) as total_percent_assigned
from acs_objects o,
im_estimate_to_completes e
where o.object_id = e.etc_id and
e.etc_project_id = :task_id
) t
order by
im_name_from_user_id(etc_user_id),
creation_date
"
return [im_ad_hoc_query -format html $history_sql]
}
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