Commit 1845214e authored by Frank Bergmann's avatar Frank Bergmann

- added invoice notify files

parent 700187e2
# /packages/intranet-core/www/member-notify.tcl
#
# Copyright (C) 1998-2004 various parties
# The code is based on ArsDigita ACS 3.4
#
# This program 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. This program 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 {
Sends a notification message to a member
@author frank.bergmann@project-open.com
} {
user_id_from_search:integer
object_id:integer
role_id:integer
subject
message
return_url
}
set user_id [ad_maybe_redirect_for_registration]
# Send out an email alert
im_send_alert $user_id_from_search "hourly" $subject $message
ad_returnredirect $return_url
<master src="master">
<property name=title>Add a user</property>
<property name="context">@context;noquote@</property>
<H1>Send Notification</H1>
@first_names_from_search@ @last_name_from_search@ has been added to @system_name@.
Edit the message below and hit "Send Email" to
notify this user.
</p>
<form method="post" action="member-notify">
@export_vars;noquote@
<textarea name=subject rows=1 cols=70 wrap=hard>
@role_name@ of @object_name@
</textarea>
<textarea name=message rows=10 cols=70 wrap=hard>
Dear @first_names_from_search@,
You have been added as a @role_name@
to @object_name@
in @system_name@
at @object_url@
Please click on the link above for details.
Best regards,
@current_user_name@
</textarea>
<center>
<input type="submit" value="Send Email" />
</center>
</form>
</p>
# /packages/intranet-core/www/member-add-2.tcl
#
# Copyright (C) 1998-2004 various parties
# The code is based on ArsDigita ACS 3.4
#
# This program 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. This program 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 {
Purpose: Confirms adding of person to group
@param user_id_from_search user_id to add
@param object_id group to which to add
@param role_id role in which to add
@param return_url Return URL
@param also_add_to_group_id Additional groups to which to add
@author mbryzek@arsdigita.com
@author frank.bergmann@project-open.com
} {
user_id_from_search:integer
{ notify_asignee 0 }
object_id:integer
role_id:integer
return_url
{ also_add_to_group_id:integer "" }
}
set user_id [ad_maybe_redirect_for_registration]
# expect commands such as: "im_project_permissions" ...
#
set object_type [db_string acs_object_type "select object_type from acs_objects where object_id=:object_id"]
set perm_cmd "${object_type}_permissions \$user_id \$object_id view read write admin"
eval $perm_cmd
if {!$write} {
ad_return_complaint 1 "You have no rights to add members to this object."
return
}
im_biz_object_add_role $user_id_from_search $object_id $role_id
# --------------------------------------------------------
# Prepare to send out an email alert
# --------------------------------------------------------
set system_name [ad_system_name]
set object_name [db_string project_name "select acs_object.name(:object_id) from dual"]
set page_title "Notify user"
set context [list $page_title]
set export_vars [export_form_vars user_id_from_search object_id role_id return_url]
set current_user_name [db_string cur_user "select im_name_from_user_id(:user_id) from dual"]
set object_rel_url [db_string object_url "select url from im_biz_object_urls where url_type = 'view' and object_type = :object_type"]
set role_name [db_string role_name "select im_category_from_id(:role_id) from dual" -default "Member"]
# Get the SystemUrl without trailing "/"
set system_url [ad_parameter -package_id [ad_acs_kernel_id] SystemURL ""]
set sysurl_len [string length $system_url]
set last_char [string range $system_url [expr $sysurl_len-1] $sysurl_len]
if {[string equal "/" $last_char]} {
set system_url "[string range $system_url 0 [expr $sysurl_len-2]]"
}
set object_url "$system_url$object_rel_url$object_id"
db_1row user_name "
select
im_name_from_user_id(person_id) as user_name_from_search,
first_names as first_names_from_search,
last_name as last_name_from_search
from
persons
where
person_id=:user_id_from_search"
if {"" != $notify_asignee && ![string equal "0" $notify_asignee]} {
# Show a textarea to edit the alert at member-add-2.tcl
ad_return_template
} else {
ad_returnredirect $return_url
}
return
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