Skip to content

Commit

Permalink
New features: - included tokens.js in token page (wasn't there before),
Browse files Browse the repository at this point in the history
- updated messages to indicate when emails or reminders are going to all applicable token entries, or just to individual or selected entries
- uses messagebox classes when sending (to look nicer)

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@8485 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 14, 2010
1 parent 798175e commit 5493126
Showing 1 changed file with 35 additions and 13 deletions.
48 changes: 35 additions & 13 deletions admin/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@
if (!isset($tokenids)) {$tokenids=returnglobal('tids');}
if (!isset($starttokenid)) {$starttokenid=sanitize_int(returnglobal('last_tid'));}

if(isset($tokenids)) {$tokenids=explode("|", substr($tokenids, 1));} //Make the tokenids string into an array, and exclude the first character
if(isset($tokenids)) {
$tokenidsarray=explode("|", substr($tokenids, 1)); //Make the tokenids string into an array, and exclude the first character
unset($tokenids);
foreach($tokenidsarray as $tokenitem) {
if($tokenitem != "") $tokenids[]=sanitize_int($tokenitem);
}
}

include_once("login_check.php");
include_once("database.php");
$js_adminheader_includes[]='scripts/tokens.js';
$dateformatdetails=getDateFormatData($_SESSION['dateformat']);
$thissurvey=getSurveyInfo($surveyid);

Expand Down Expand Up @@ -1279,11 +1286,16 @@
.$clang->gT("Sending to Token ID").":</label>".$tokenid
."</li>";
}
if (isset($tokenids))
if (isset($tokenids) && count($tokenids) > 0)
{
$tokenoutput .= "<li><label>"
.$clang->gT("Sending to Token IDs").":</label>".implode(", ", $tokenids)
."</li>";
} else {
$tokenoutput .= "<li><label>"
.$clang->gT("Sending to:")."</label>"
.$clang->gT("All tokens who have not yet been sent an invitation")
."</li>";
}
$tokenoutput .="\t<li>\n"
."\t<label for='bypassbademails'>".$clang->gT("Bypass token with failing email addresses").":</label><select id='bypassbademails' name='bypassbademails'>\n"
Expand All @@ -1300,7 +1312,10 @@
}
else
{
$tokenoutput .= "<div class='messagebox'>\n"
."\t<div class='header'>\n";
$tokenoutput .= $clang->gT("Sending invitations...");
$tokenoutput .= "\n\t</div>\n";
if (isset($tokenid)) {$tokenoutput .= " (".$clang->gT("Sending to Token ID").":&nbsp;{$tokenid})";}
if (isset($tokenids)) {$tokenoutput .= " (".$clang->gT("Sending to Token IDs").":&nbsp;".implode(", ", $tokenids).")";}
$tokenoutput .= "<br />\n";
Expand Down Expand Up @@ -1466,7 +1481,7 @@
."<li>".$clang->gT("having a token")."</li></ul></div>";
}
}
$tokenoutput .= "</div>\n";
$tokenoutput .= "</div>\n</div>\n";
}


Expand Down Expand Up @@ -1534,20 +1549,23 @@
}

$tokenoutput .= "</div><ul>\n";
if (!isset($tokenid) && !isset($tokenids)) {

if (isset($tokenids)) {
$tokenoutput .= "\t<li>\n"
. "<label>".$clang->gT("Send reminder to token IDs:")."</label>\n"
. implode(", ", $tokenids)."</li>\n";
} elseif (!isset($tokenid)) {
$tokenoutput .= "<li><label>"
.$clang->gT("Sending to:")."</label>"
.$clang->gT("All token entries to whom a reminder email would apply")
."</li>";
$tokenoutput .= "\t<li>\n"
."<label for='last_tid'>".$clang->gT("Start at Token ID:")."</label>\n"
."<input type='text' size='5' id='last_tid' name='last_tid' />\n"
."\t</li>\n";
}
elseif (isset($tokenids)) {
$tokenoutput .= "\t<li>\n"
. "<label>".$clang->gT("Send reminder to token IDs:")."</label>\n"
. implode(", ", $tokenids)."</li>\n";
}
else {
} elseif (isset($tokenid)) {
$tokenoutput .= "\t<li>\n"
."<label>".$clang->gT("Stop at Token ID:")."</label>\n"
."<label>".$clang->gT("Send reminder to Token ID:")."</label>\n"
."{$tokenid}</li>\n";
}
$tokenoutput .="<li><label for='bypassbademails'>\n"
Expand Down Expand Up @@ -1575,7 +1593,10 @@
else
{

$tokenoutput .= $clang->gT("Sending Reminders")."<br />\n";
$tokenoutput .= "<div class='messagebox'>\n"
. "<div class='header'>";
$tokenoutput .= $clang->gT("Sending Reminders")
."</div><br />\n";

$surveylangs = GetAdditionalLanguagesFromSurveyID($surveyid);
$baselanguage = GetBaseLanguageFromSurveyID($surveyid);
Expand Down Expand Up @@ -1799,6 +1820,7 @@
}
$tokenoutput .= "\t</tr>\n"
."</table>\n";
$tokenoutput .= "</div>\n";
}
}

Expand Down

0 comments on commit 5493126

Please sign in to comment.