From 0f31f72f07963485558a71927bb522086bcfe156 Mon Sep 17 00:00:00 2001 From: dave Date: Fri, 25 Sep 2009 04:29:41 +0000 Subject: [PATCH] - Add two more fields: - additional_materials: if there are additional materials required if a fair assigns a winner to this award. - register_winners: to tell the feeder fair that this award is for winners who will participate at the upstream fair --- admin/award_awards.php | 14 +++++++++++--- db/db.code.version.txt | 2 +- db/db.update.139.sql | 2 ++ remote.php | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 db/db.update.139.sql diff --git a/admin/award_awards.php b/admin/award_awards.php index b4968aa..92f4960 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -218,6 +218,8 @@ $q = mysql_query("SELECT * FROM award_awards WHERE id='$id'"); $a = mysql_fetch_assoc($q); $ret['identifier'] = $a['external_identifier']; + $ret['additional_materials'] = $a['external_additional_materials']; + $ret['register_winners'] = $a['external_register_winners']; echo json_encode($ret); exit; @@ -244,7 +246,11 @@ echo mysql_error(); } $ident=mysql_escape_string(stripslashes($_POST['identifier'])); - mysql_query("UPDATE award_awards SET external_identifier='$ident' WHERE id='$id'"); + $mat = intval($_POST['additional_materials']); + $w = intval($_POST['register_winners']); + mysql_query("UPDATE award_awards SET external_identifier='$ident', + external_additional_materials='$mat', + external_register_winners='$w' WHERE id='$id'"); happy_("Feeder Fair information saved"); exit; @@ -470,6 +476,8 @@ function update_feeder() function(json) { $("#feeder_id").val(award_id); $("#feeder_identifier").val(json.identifier); + $("#feeder_additional_materials").val([json.additional_materials]); + $("#feeder_register_winners").val([json.register_winners]); $("[name=feeder_dl\\[\\]]").val(json.dl); $("[name=feeder_ul\\[\\]]").val(json.ul); @@ -729,9 +737,9 @@ $(document).ready(function() { - + - +
:

diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 93e7803..897bdc8 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -138 +139 diff --git a/db/db.update.139.sql b/db/db.update.139.sql new file mode 100644 index 0000000..1610a2c --- /dev/null +++ b/db/db.update.139.sql @@ -0,0 +1,2 @@ +ALTER TABLE `award_awards` ADD `external_additional_materials` BOOL NOT NULL AFTER `external_postback`; +ALTER TABLE `award_awards` ADD `external_register_winners` BOOL NOT NULL AFTER `external_additional_materials` ; diff --git a/remote.php b/remote.php index 9c3c959..90331c5 100644 --- a/remote.php +++ b/remote.php @@ -83,6 +83,8 @@ function handle_getawards(&$u, $fair, &$data, &$response) while($a = mysql_fetch_assoc($q)) { $award = array(); $award['identifier'] = $a['external_identifier']; + $award['external_additional_materials'] = $a['external_additional_materials']; + $award['external_register_winners'] = $a['external_register_winners']; $award['year'] = $a['year']; $award['name_en'] = $a['name']; $award['criteria_en'] = $a['criteria'];