Half implement temporary saving divs/cats for single uploads. That's

going to be a lot of work.  For now, always save the div/cat preferences
when they hit next.  Fixes a bug where the divs/cats have never been
saved, but the award proceeded to upload with a div/cat id=0.  Also, the
uploader made a temp change to the div/cat, the change wouldn't get
picked up by the upload, now it will.
This commit is contained in:
dave 2010-04-07 16:17:26 +00:00
parent 8ffb710715
commit e3cda665c2

View File

@ -27,7 +27,7 @@ require_once('curl.inc.php');
user_auth_required('committee', 'admin');
//function get_cwsf_award_winners()
function get_winners($awardid)
function get_winners($awardid, $catmap_str=NULL, $divmap_str=NULL)
{
global $config;
@ -77,8 +77,8 @@ function get_winners($awardid)
/* Get the fair for the div/cat mappings */
$q = mysql_query("SELECT * FROM fairs WHERE id='{$award['award_source_fairs_id']}'");
$fair = mysql_fetch_assoc($q);
$catmap = unserialize($fair['catmap']);
$divmap = unserialize($fair['divmap']);
$catmap = unserialize(($catmap_str != NULL) ? $catmap_str : $fair['catmap']);
$divmap = unserialize(($divmap_str != NULL) ? $divmap_str : $fair['divmap']);
$winners=array( 'prizes' => array(),
'award_name' => $award['name'],
@ -272,7 +272,7 @@ case 'catdiv_save':
echo "UPDATE fairs SET catmap='$catmap',divmap='$divmap' WHERE id='$fairs_id'";
echo mysql_error();
happy_("Category/Division mapping information saved");
// happy_("Category/Division mapping information saved");
exit;
case 'confirm_load':
@ -433,6 +433,13 @@ $(document).ready(function() {
<input type="hidden" name="award_source_fairs_id" id="award_source_fairs_id" value="0" />
<h4><?=i18n("Category Mapping")?></h4>
<br />
<table style="border-width:0; width:100%">
<tr><td></td>
<td width="30%"><input type="submit" onClick="#" disabled="disabled" value="<?=i18n("<< Prev")?>" /></td>
<td width="30%">&nbsp;</td>
<td width="40%"><input type="submit" onClick="catdiv_save();catdiv_next();return false;" value="<?=i18n("Next >>")?>" /></td>
</tr></table>
<br />
<table class="editor">
<tr><th><?=i18n("Our Category")?></th><th><?=i18n("Server Category")?></th></tr>
<?
@ -458,15 +465,16 @@ $(document).ready(function() {
echo "<option value=\"-1\">Loading...</option>";
echo '</select></td></tr>';
}
/* <input type="submit" onClick="catdiv_save();return false;" value="<?=i18n("Save")?>" /></td>*/
?>
</table>
<br />
<br />
<table style="border-width:0; width:100%">
<tr><td></td>
<td><input type="submit" onClick="#" disabled="disabled" value="<?=i18n("<< Prev")?>" /></td>
<td><input type="submit" onClick="catdiv_save();return false;" value="<?=i18n("Save")?>" /></td>
<td><input type="submit" onClick="catdiv_next();return false;" value="<?=i18n("Next >>")?>" /></td>
<td width="30%"><input type="submit" onClick="#" disabled="disabled" value="<?=i18n("<< Prev")?>" /></td>
<td width="30%">&nbsp;</td>
<td width="40%"><input type="submit" onClick="catdiv_save();catdiv_next();return false;" value="<?=i18n("Next >>")?>" /></td>
</tr></table>
<br />
@ -478,9 +486,9 @@ $(document).ready(function() {
<br />
<table style="border-width:0; width:100%">
<tr><td></td>
<td><input type="submit" onClick="confirm_prev();return false;" value="<?=i18n("<< Prev")?>" /></td>
<td><input type="submit" onClick="confirm_upload();return false;" value="<?=i18n("Upload")?>" /></td>
<td><input type="submit" onClick="#" disabled="disabled" value="<?=i18n("Next >>")?>" /></td>
<td width="30%"><input type="submit" onClick="confirm_prev();return false;" value="<?=i18n("<< Prev")?>" /></td>
<td width="30%"><input type="submit" onClick="confirm_upload();return false;" value="<?=i18n("Upload")?>" /></td>
<td width="40%"><input type="submit" onClick="#" disabled="disabled" value="<?=i18n("Next >>")?>" /></td>
</tr></table>
<br />