forked from science-ation/science-ation
Add enabled and website (for help) to external sources
Update source editor Make downloader only check enabled source Make downloader check for username/password before attempting Add extra instructions
This commit is contained in:
parent
75669d9c08
commit
fab18eb0c7
@ -42,8 +42,13 @@
|
||||
require_once("xml.inc.php");
|
||||
foreach($_GET['check'] AS $checksource) {
|
||||
$checksource=intval($checksource);
|
||||
$q=mysql_query("SELECT * FROM award_sources WHERE id='$checksource'");
|
||||
$q=mysql_query("SELECT * FROM award_sources WHERE id='$checksource' AND enabled='yes'");
|
||||
$r=mysql_fetch_object($q);
|
||||
if(!($r->username && $r->password)) {
|
||||
echo error(i18n("Username and Password are not set for source '%1'. Please set them in the SFIAB Configuration/External Award Sources editor first",array($r->name)));
|
||||
continue;
|
||||
|
||||
}
|
||||
echo i18n("Checking %1 for awards...",array($r->name));
|
||||
echo "<br />";
|
||||
|
||||
@ -313,7 +318,7 @@ echo mysql_error();
|
||||
else
|
||||
$links=true;
|
||||
|
||||
$q=mysql_query("SELECT * FROM award_sources ORDER BY name");
|
||||
$q=mysql_query("SELECT * FROM award_sources WHERE enabled='yes' ORDER BY name");
|
||||
echo "<table class=\"tableview\">";
|
||||
echo "<tr><th>".i18n("Source Name")."</th>";
|
||||
echo "<th>".i18n("Source Location URL")."</th>";
|
||||
|
@ -32,8 +32,18 @@
|
||||
|
||||
|
||||
$editor=new TableEditor("award_sources",
|
||||
array("name"=>"Name",
|
||||
"url"=>"URL",
|
||||
array(
|
||||
"enabled"=>"Enabled?",
|
||||
"name"=>"Name",
|
||||
"website"=>"Help URL",
|
||||
"username"=>"Username",
|
||||
)
|
||||
,
|
||||
array(
|
||||
"enabled"=>"Enabled?",
|
||||
"name"=>"Name",
|
||||
"url"=>"Source URL",
|
||||
"website"=>"Help URL",
|
||||
"username"=>"Username",
|
||||
"password"=>"Password"
|
||||
)
|
||||
@ -44,5 +54,8 @@
|
||||
$editor->setRecordType("Award Source");
|
||||
$editor->execute();
|
||||
|
||||
echo "<br />";
|
||||
echo i18n("Open the 'Help URL' in your browser to see if the award source applies to your fair and to obtain the username/password for the source if it does.");
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
|
@ -1 +1 @@
|
||||
70
|
||||
71
|
||||
|
4
db/db.update.71.sql
Normal file
4
db/db.update.71.sql
Normal file
@ -0,0 +1,4 @@
|
||||
ALTER TABLE `award_sources` ADD `enabled` ENUM( 'no', 'yes' ) DEFAULT 'no' NOT NULL ;
|
||||
ALTER TABLE `award_sources` ADD `website` VARCHAR( 255 ) NOT NULL AFTER `url` ;
|
||||
INSERT INTO `award_sources` VALUES ('', 'Sci-Tech Ontario', 'http://www.scitechontario.org/awarddownloader/index.php', 'http://www.scitechontario.org/awarddownloader/help.php', '', '', 'no');
|
||||
INSERT INTO `award_sources` VALUES ('', 'Youth Science Foundation', 'https://secure.ysf-fsj.ca/awarddownloader/index.php', 'http://apps.ysf-fsj.ca/awarddownloader/help.php', '', '', 'no');
|
Loading…
x
Reference in New Issue
Block a user