mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-22 21:40:28 +03:00
ability to override notification email for group
This commit is contained in:
parent
3715d2207e
commit
acc86b9221
@ -51,6 +51,7 @@ function store_message($name, $email, $info, $message,$groupid,$referrer) {
|
||||
|
||||
$groupid = "";
|
||||
$groupname = "";
|
||||
$group = NULL;
|
||||
loadsettings();
|
||||
if($settings['enablegroups'] == '1') {
|
||||
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
||||
@ -108,7 +109,11 @@ store_message($visitor_name, $email, $info, $message, $groupid, $referrer);
|
||||
$subject = getstring2_("leavemail.subject", array($visitor_name), $message_locale);
|
||||
$body = getstring2_("leavemail.body", array($visitor_name,$email,$message,$info ? "$info\n" : ""), $message_locale);
|
||||
|
||||
$inbox_mail = $settings['email'];
|
||||
if (isset($group) && !empty($group['vcemail'])) {
|
||||
$inbox_mail = $group['vcemail'];
|
||||
} else {
|
||||
$inbox_mail = $settings['email'];
|
||||
}
|
||||
|
||||
if($inbox_mail) {
|
||||
$link = connect();
|
||||
|
@ -144,6 +144,7 @@ form.field.groupcommonname.description=Name in English.
|
||||
form.field.groupcommonname=International name
|
||||
form.field.groupdesc.description=Description of the group.
|
||||
form.field.groupdesc=Description
|
||||
form.field.groupemail.description=Group email for notifications. Leave empty to use the default address.
|
||||
form.field.groupname.description=Name to identify the group.
|
||||
form.field.groupname=Name
|
||||
form.field.jabber.description=For instant notifications
|
||||
|
@ -144,6 +144,7 @@ form.field.groupcommonname.description=
|
||||
form.field.groupcommonname=Интернациональное название
|
||||
form.field.groupdesc.description=Будет доступно посетителям при выборе группы.
|
||||
form.field.groupdesc=Описание
|
||||
form.field.groupemail.description=Адрес для извещений. Оставьте пустым, чтобы использовать глобальный адрес.
|
||||
form.field.groupname.description=Может быть названием отдела в вашей компании.
|
||||
form.field.groupname=Название группы
|
||||
form.field.jabber.description=Для быстрого получения уведомлений
|
||||
|
@ -39,16 +39,17 @@ function group_by_name($name)
|
||||
return $group;
|
||||
}
|
||||
|
||||
function create_group($name, $descr, $commonname, $commondescr)
|
||||
function create_group($name, $descr, $commonname, $commondescr, $email)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$link = connect();
|
||||
$query = sprintf(
|
||||
"insert into ${mysqlprefix}chatgroup (vclocalname,vclocaldescription,vccommonname,vccommondescription) values ('%s','%s','%s','%s')",
|
||||
"insert into ${mysqlprefix}chatgroup (vclocalname,vclocaldescription,vccommonname,vccommondescription,vcemail) values ('%s','%s','%s','%s','%s')",
|
||||
mysql_real_escape_string($name),
|
||||
mysql_real_escape_string($descr),
|
||||
mysql_real_escape_string($commonname),
|
||||
mysql_real_escape_string($commondescr));
|
||||
mysql_real_escape_string($commondescr),
|
||||
mysql_real_escape_string($email));
|
||||
|
||||
perform_query($query, $link);
|
||||
$id = mysql_insert_id($link);
|
||||
@ -58,16 +59,17 @@ function create_group($name, $descr, $commonname, $commondescr)
|
||||
return $newdep;
|
||||
}
|
||||
|
||||
function update_group($groupid, $name, $descr, $commonname, $commondescr)
|
||||
function update_group($groupid, $name, $descr, $commonname, $commondescr, $email)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$link = connect();
|
||||
$query = sprintf(
|
||||
"update ${mysqlprefix}chatgroup set vclocalname = '%s', vclocaldescription = '%s', vccommonname = '%s', vccommondescription = '%s' where groupid = %s",
|
||||
"update ${mysqlprefix}chatgroup set vclocalname = '%s', vclocaldescription = '%s', vccommonname = '%s', vccommondescription = '%s', vcemail = '%s' where groupid = %s",
|
||||
mysql_real_escape_string($name),
|
||||
mysql_real_escape_string($descr),
|
||||
mysql_real_escape_string($commonname),
|
||||
mysql_real_escape_string($commondescr),
|
||||
mysql_real_escape_string($email),
|
||||
$groupid);
|
||||
|
||||
perform_query($query, $link);
|
||||
@ -81,10 +83,14 @@ if (isset($_POST['name'])) {
|
||||
$description = getparam('description');
|
||||
$commonname = getparam('commonname');
|
||||
$commondescription = getparam('commondescription');
|
||||
$email = getparam('email');
|
||||
|
||||
if (!$name)
|
||||
$errors[] = no_field("form.field.groupname");
|
||||
|
||||
if ($email != '' && !is_valid_email($email))
|
||||
$errors[] = wrong_field("form.field.mail");
|
||||
|
||||
$existing_group = group_by_name($name);
|
||||
if ((!$groupid && $existing_group) ||
|
||||
($groupid && $existing_group && $groupid != $existing_group['groupid']))
|
||||
@ -92,11 +98,11 @@ if (isset($_POST['name'])) {
|
||||
|
||||
if (count($errors) == 0) {
|
||||
if (!$groupid) {
|
||||
$newdep = create_group($name, $description, $commonname, $commondescription);
|
||||
$newdep = create_group($name, $description, $commonname, $commondescription, $email);
|
||||
header("Location: $webimroot/operator/groupmembers.php?gid=" . $newdep['groupid']);
|
||||
exit;
|
||||
} else {
|
||||
update_group($groupid, $name, $description, $commonname, $commondescription);
|
||||
update_group($groupid, $name, $description, $commonname, $commondescription, $email);
|
||||
header("Location: $webimroot/operator/group.php?gid=$groupid&stored");
|
||||
exit;
|
||||
}
|
||||
@ -105,6 +111,7 @@ if (isset($_POST['name'])) {
|
||||
$page['formdescription'] = topage($description);
|
||||
$page['formcommonname'] = topage($commonname);
|
||||
$page['formcommondescription'] = topage($commondescription);
|
||||
$page['formemail'] = topage($email);
|
||||
$page['grid'] = topage($groupid);
|
||||
}
|
||||
|
||||
@ -120,6 +127,7 @@ if (isset($_POST['name'])) {
|
||||
$page['formdescription'] = topage($group['vclocaldescription']);
|
||||
$page['formcommonname'] = topage($group['vccommonname']);
|
||||
$page['formcommondescription'] = topage($group['vccommondescription']);
|
||||
$page['formemail'] = topage($group['vcemail']);
|
||||
$page['grid'] = topage($group['groupid']);
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,16 @@ require_once('inc_errors.php');
|
||||
<div class="fdescr"> — <?php echo getlocal('form.field.groupcommondesc.description') ?></div>
|
||||
<br clear="all"/>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<div class="flabel"><?php echo getlocal('form.field.mail') ?></div>
|
||||
<div class="fvalue">
|
||||
<input type="text" name="email" size="40" value="<?php echo form_value('email') ?>" class="formauth"/>
|
||||
</div>
|
||||
<div class="fdescr"> — <?php echo getlocal('form.field.groupemail.description') ?></div>
|
||||
<br clear="all"/>
|
||||
</div>
|
||||
|
||||
<div class="fbutton">
|
||||
<input type="image" name="save" value="" src='<?php echo $webimroot.getlocal("image.button.save") ?>' alt='<?php echo getlocal("button.save") ?>'/>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user