Added department description at select department screen

This commit is contained in:
Dmitriy Simushev 2012-01-03 19:45:49 +00:00
parent 2dc674e5d6
commit f2ab19036a
7 changed files with 41 additions and 5 deletions

View File

@ -330,6 +330,7 @@ function setup_survey($name, $email, $groupid, $info, $referrer)
$allgroups = get_groups($link, false); $allgroups = get_groups($link, false);
close_connection($link); close_connection($link);
$val = ""; $val = "";
$groupdescriptions = array();
foreach ($allgroups as $k) { foreach ($allgroups as $k) {
$groupname = $k['vclocalname']; $groupname = $k['vclocalname'];
if ($k['inumofagents'] == 0) { if ($k['inumofagents'] == 0) {
@ -338,14 +339,18 @@ function setup_survey($name, $email, $groupid, $info, $referrer)
if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) { if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) {
if (!$groupid) { if (!$groupid) {
$groupid = $k['groupid']; // select first online group $groupid = $k['groupid']; // select first online group
$defaultdescription = $k['vclocaldescription'];
} }
} else { } else {
$groupname .= " (offline)"; $groupname .= " (offline)";
} }
$isselected = $k['groupid'] == $groupid; $isselected = $k['groupid'] == $groupid;
$val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">$groupname</option>"; $val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">$groupname</option>";
$groupdescriptions[] = $k['vclocaldescription'];
} }
$page['groups'] = $val; $page['groups'] = $val;
$page['group.descriptions'] = json_encode($groupdescriptions);
$page['default.department.description'] = empty($defaultdescription)?' ':$defaultdescription;
} }
$page['showemail'] = $settings["surveyaskmail"] == "1" ? "1" : ""; $page['showemail'] = $settings["surveyaskmail"] == "1" ? "1" : "";

View File

@ -396,6 +396,7 @@ permission.viewthreads=View another operator's chat thread
permissions.intro=Change restrictions and available features for this operator. permissions.intro=Change restrictions and available features for this operator.
permissions.title=Permissions permissions.title=Permissions
presurvey.department=Choose Department: presurvey.department=Choose Department:
presurvey.department.description=Department description:
presurvey.intro=Thank you for contacting us. Please fill out the form below and click the Start Chat button. presurvey.intro=Thank you for contacting us. Please fill out the form below and click the Start Chat button.
presurvey.mail=Email: presurvey.mail=Email:
presurvey.name=Name: presurvey.name=Name:

View File

@ -394,6 +394,7 @@ permission.viewthreads=
permissions.intro=Здесь вы можете управлять возможностями оператора. permissions.intro=Здесь вы можете управлять возможностями оператора.
permissions.title=Возможности оператора permissions.title=Возможности оператора
presurvey.department=Выберите отдел: presurvey.department=Выберите отдел:
presurvey.department.description=Îïèñàíèå îòäåëà:
presurvey.intro=Спасибо, что связались с нами! Заполните, пожалуйста, небольшую форму и нажмите "Начать диалог". presurvey.intro=Спасибо, что связались с нами! Заполните, пожалуйста, небольшую форму и нажмите "Начать диалог".
presurvey.mail=E-mail: presurvey.mail=E-mail:
presurvey.name=Ваше имя: presurvey.name=Ваше имя:

View File

@ -34,7 +34,9 @@
text-decoration:none; text-decoration:none;
} }
</style> </style>
${if:groups}
<script type="text/javascript">groupDescriptions = ${page:group.descriptions};</script>
${endif:groups}
</head> </head>
<body bgcolor="#FFFFFF" text="#000000" link="#C28400" vlink="#C28400" alink="#C28400" style="margin:0px;"> <body bgcolor="#FFFFFF" text="#000000" link="#C28400" vlink="#C28400" alink="#C28400" style="margin:0px;">
<table width="100%" cellspacing="0" cellpadding="0" border="0"> <table width="100%" cellspacing="0" cellpadding="0" border="0">
@ -114,9 +116,13 @@ ${if:groups}
<tr> <tr>
<td class="text">${msg:presurvey.department}</td> <td class="text">${msg:presurvey.department}</td>
<td> <td>
<select name="group" style="min-width:200px;">${page:groups}</select> <select name="group" style="min-width:200px;" onchange="document.getElementById('departmentDescription').childNodes.item(0).data = groupDescriptions[this.selectedIndex];">${page:groups}</select>
</td> </td>
</tr> </tr>
<tr>
<td class="text">${msg:presurvey.department.description}</td>
<td class="text" id="departmentDescription">${page:default.department.description}</td>
</tr>
${endif:groups} ${endif:groups}
<tr> <tr>

View File

@ -20,6 +20,9 @@
.isubmit { background-position:0px -39px; width: 40px; height: 35px; } .isubmit { background-position:0px -39px; width: 40px; height: 35px; }
.isubmitrest { background-position:-31px -39px; width: 10px; height: 35px;} .isubmitrest { background-position:-31px -39px; width: 10px; height: 35px;}
</style> </style>
${if:groups}
<script type="text/javascript">groupDescriptions = ${page:group.descriptions};</script>
${endif:groups}
</head> </head>
<body bgcolor="#FFFFFF" style="background-image: url(${tplroot}/images/bg.gif); margin: 0px;" text="#000000" link="#C28400" vlink="#C28400" alink="#C28400"> <body bgcolor="#FFFFFF" style="background-image: url(${tplroot}/images/bg.gif); margin: 0px;" text="#000000" link="#C28400" vlink="#C28400" alink="#C28400">
<table width="100%" style="height: 100%;" cellspacing="0" cellpadding="0" border="0"> <table width="100%" style="height: 100%;" cellspacing="0" cellpadding="0" border="0">
@ -75,10 +78,16 @@ ${if:groups}
<td class="text">${msg:presurvey.department}</td> <td class="text">${msg:presurvey.department}</td>
<td width="20"></td> <td width="20"></td>
<td> <td>
<select name="group" style="min-width:200px;">${page:groups}</select> <select name="group" style="min-width:200px;" onchange="document.getElementById('departmentDescription').childNodes.item(0).data = groupDescriptions[this.selectedIndex];">${page:groups}</select>
</td> </td>
</tr> </tr>
<tr><td height="7" colspan="3"></td></tr> <tr><td height="7" colspan="3"></td></tr>
<tr>
<td class="text">${msg:presurvey.department.description}</td>
<td width="20"></td>
<td class="text" id="departmentDescription">${page:default.department.description}</td>
</tr>
<tr><td height="7" colspan="3"></td></tr>
${endif:groups} ${endif:groups}
<tr> <tr>

View File

@ -4,6 +4,9 @@
<title>${msg:presurvey.title}</title> <title>${msg:presurvey.title}</title>
<link rel="shortcut icon" href="${webimroot}/images/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="${webimroot}/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="${tplroot}/chat.css" /> <link rel="stylesheet" type="text/css" href="${tplroot}/chat.css" />
${if:groups}
<script type="text/javascript">groupDescriptions = ${page:group.descriptions};</script>
${endif:groups}
</head> </head>
<body class="bgbody"> <body class="bgbody">
<div id="top2"> <div id="top2">
@ -53,7 +56,11 @@
${if:groups} ${if:groups}
<tr> <tr>
<td><strong>${msg:presurvey.department}</strong></td> <td><strong>${msg:presurvey.department}</strong></td>
<td><select name="group">${page:groups}</select></td> <td><select name="group" onchange="document.getElementById('departmentDescription').childNodes.item(0).data = groupDescriptions[this.selectedIndex];">${page:groups}</select></td>
</tr>
<tr>
<td><strong>${msg:presurvey.department.description}</strong></td>
<td id="departmentDescription">${page:default.department.description}</td>
</tr> </tr>
${endif:groups} ${endif:groups}
<tr> <tr>

View File

@ -4,6 +4,9 @@
<title>${msg:presurvey.title}</title> <title>${msg:presurvey.title}</title>
<link rel="shortcut icon" href="${webimroot}/images/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="${webimroot}/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="${tplroot}/chat.css" /> <link rel="stylesheet" type="text/css" href="${tplroot}/chat.css" />
${if:groups}
<script type="text/javascript">groupDescriptions = ${page:group.descriptions};</script>
${endif:groups}
</head> </head>
<body> <body>
<div id="whitebg"> <div id="whitebg">
@ -44,7 +47,11 @@
${if:groups} ${if:groups}
<tr> <tr>
<td class="text">${msg:presurvey.department}</td> <td class="text">${msg:presurvey.department}</td>
<td><select name="group" style="min-width:200px;">${page:groups}</select></td> <td><select name="group" style="min-width:200px;" onchange="document.getElementById('departmentDescription').childNodes.item(0).data = groupDescriptions[this.selectedIndex];">${page:groups}</select></td>
</tr>
<tr>
<td class="text">${msg:presurvey.department.description}</td>
<td class="text" id="departmentDescription">${page:default.department.description}</td>
</tr> </tr>
${endif:groups} ${endif:groups}
<tr> <tr>