forked from science-ation/science-ation
Fixes for bugs 418 and 412
- when editing awards, the list now gets refreshed upon update - increased size of donors notes fields
This commit is contained in:
parent
5956a15754
commit
2563f8295e
@ -28,6 +28,9 @@
|
||||
require_once('awards.inc.php');
|
||||
|
||||
switch($_GET['action']) {
|
||||
case 'draw_awards_table':
|
||||
draw_awards_table();
|
||||
exit;
|
||||
case 'awardinfo_load':
|
||||
$id = intval($_GET['id']);
|
||||
$q=mysql_query("SELECT * FROM award_awards WHERE id='$id'");
|
||||
@ -395,7 +398,7 @@ function awardinfo_save()
|
||||
$("#popup_editor").dialog('close');
|
||||
popup_editor(award_id, '');
|
||||
}
|
||||
|
||||
draw_awards_table();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@ -865,6 +868,10 @@ function award_delete(id)
|
||||
|
||||
}
|
||||
|
||||
function draw_awards_table(){
|
||||
$('#awards_table').load("<?=$_SERVER['PHP_SELF']?>?action=draw_awards_table");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
awardlist_refresh();
|
||||
});
|
||||
@ -965,43 +972,62 @@ echo "</table>";
|
||||
<br /><br />
|
||||
|
||||
<?
|
||||
/* For some reason, this submit button opens the dialog then it closes right away, but it doesn't
|
||||
* if the entry is done through the a href */
|
||||
//<input type="submit" onClick="award_create();" value="<?=i18n("Create New Award")>" />
|
||||
echo "<div id=\"awards_table\">";
|
||||
draw_awards_table();
|
||||
echo "</div>";
|
||||
|
||||
if($sponsors_id) $where_asi="AND sponsors_id='$sponsors_id'";
|
||||
if($award_types_id) $where_ati="AND award_types_id='$award_types_id'";
|
||||
// if($award_sponsors_confirmed) $where_asc="AND award_sponsors.confirmed='$award_sponsors_confirmed'";
|
||||
if($_GET['action'] == 'edit_prize_template') {
|
||||
|
||||
if(!$orderby) $orderby="order";
|
||||
?><script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
popup_editor(-1,'template');
|
||||
});
|
||||
</script>
|
||||
<?
|
||||
}
|
||||
send_footer();
|
||||
|
||||
$q=mysql_query("SELECT
|
||||
award_awards.id,
|
||||
award_awards.name,
|
||||
award_awards.order,
|
||||
award_awards.award_source_fairs_id,
|
||||
award_types.type,
|
||||
sponsors.organization
|
||||
FROM
|
||||
award_awards
|
||||
LEFT JOIN sponsors ON sponsors.id = award_awards.sponsors_id
|
||||
LEFT JOIN award_types ON award_types.id = award_awards.award_types_id
|
||||
WHERE
|
||||
award_awards.year='{$config['FAIRYEAR']}'
|
||||
$where_asi
|
||||
$where_ati
|
||||
AND award_types.year='{$config['FAIRYEAR']}'
|
||||
ORDER BY `$orderby`");
|
||||
function draw_awards_table(){
|
||||
global $config;
|
||||
$award_types_id=$_SESSION['award_types_id'];
|
||||
$sponsors_id=$_SESSION['sponsors_id'];
|
||||
|
||||
echo mysql_error();
|
||||
/* For some reason, this submit button opens the dialog then it closes right away, but it doesn't
|
||||
* if the entry is done through the a href */
|
||||
//<input type="submit" onClick="award_create();" value="<?=i18n("Create New Award")>" />
|
||||
|
||||
if(mysql_num_rows($q))
|
||||
{
|
||||
echo "* ".i18n("Click on the Script Order and drag to re-order the awards");
|
||||
echo "<table id=\"awardlist\" class=\"tableview\" >";
|
||||
echo "<tr class=\"nodrop nodrag\">";
|
||||
echo " <th>".i18n("Order")."</th>";
|
||||
echo " <th>".i18n("Sponsor")."</th>";
|
||||
if($sponsors_id) $where_asi="AND sponsors_id='$sponsors_id'";
|
||||
if($award_types_id) $where_ati="AND award_types_id='$award_types_id'";
|
||||
// if($award_sponsors_confirmed) $where_asc="AND award_sponsors.confirmed='$award_sponsors_confirmed'";
|
||||
|
||||
if(!$orderby) $orderby="order";
|
||||
|
||||
$q=mysql_query("SELECT
|
||||
award_awards.id,
|
||||
award_awards.name,
|
||||
award_awards.order,
|
||||
award_awards.award_source_fairs_id,
|
||||
award_types.type,
|
||||
sponsors.organization
|
||||
FROM
|
||||
award_awards
|
||||
LEFT JOIN sponsors ON sponsors.id = award_awards.sponsors_id
|
||||
LEFT JOIN award_types ON award_types.id = award_awards.award_types_id
|
||||
WHERE
|
||||
award_awards.year='{$config['FAIRYEAR']}'
|
||||
$where_asi
|
||||
$where_ati
|
||||
AND award_types.year='{$config['FAIRYEAR']}'
|
||||
ORDER BY `$orderby`");
|
||||
|
||||
echo mysql_error();
|
||||
|
||||
if(mysql_num_rows($q)){
|
||||
echo "* ".i18n("Click on the Script Order and drag to re-order the awards");
|
||||
echo "<table id=\"awardlist\" class=\"tableview\" >";
|
||||
echo "<tr class=\"nodrop nodrag\">";
|
||||
echo " <th>".i18n("Order")."</th>";
|
||||
echo " <th>".i18n("Sponsor")."</th>";
|
||||
echo " <th>".i18n("Type")."</th>";
|
||||
echo " <th>".i18n("Name")."</th>";
|
||||
echo " <th>".i18n("Prizes")."</th>";
|
||||
@ -1031,8 +1057,8 @@ if(mysql_num_rows($q))
|
||||
echo " <td $eh align=\"center\">{$numr['num']}</td>";
|
||||
|
||||
echo " <td align=\"center\">";
|
||||
// echo "<img border=\"0\" src=\"{$config['SFIABDIRECTORY']}/images/16/edit.{$config['icon_extension']}\">";
|
||||
// echo " ";
|
||||
// echo "<img border=\"0\" src=\"{$config['SFIABDIRECTORY']}/images/16/edit.{$config['icon_extension']}\">";
|
||||
// echo " ";
|
||||
echo "<a onclick=\"award_delete({$r->id});\" href=\"#\" ><img border=0 src=\"{$config['SFIABDIRECTORY']}/images/16/button_cancel.{$config['icon_extension']}\"></a>";
|
||||
|
||||
echo " </td>\n";
|
||||
@ -1041,24 +1067,9 @@ if(mysql_num_rows($q))
|
||||
if($hasexternal)
|
||||
echo "<tr class=\"externalaward\"><td colspan=\"6\">".i18n("Indicates award imported from an external source")."</td></tr>";
|
||||
echo "</table>\n";
|
||||
echo "</form>";
|
||||
// echo "</form>";
|
||||
}
|
||||
echo "<br />";
|
||||
// echo "<a href=\"award_prizes.php?award_awards_id=-1\">Edit prizes for the generic prize template</a>";
|
||||
|
||||
|
||||
if($_GET['action'] == 'edit_prize_template') {
|
||||
|
||||
?><script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
popup_editor(-1,'template');
|
||||
});
|
||||
</script>
|
||||
<?
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_footer();
|
||||
|
||||
//echo "<a href=\"award_prizes.php?award_awards_id=-1\">Edit prizes for the generic prize template</a>";
|
||||
}
|
||||
?>
|
||||
|
@ -741,7 +741,7 @@ function draw_contact_form($sponsor_id, $contact = null){
|
||||
|
||||
<tr>
|
||||
<td><?=i18n("Notes"); ?></td>
|
||||
<td colspan="3"><textarea name="notes" cols="60" rows="4"><?=htmlspecialchars($contact['notes'])?></textarea></td>
|
||||
<td colspan="3"><textarea name="notes" cols="60" rows="8"><?=htmlspecialchars($contact['notes'])?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?=i18n("Primary Contact")?></td>
|
||||
@ -1239,7 +1239,7 @@ echo "<hr />";
|
||||
</td></tr>
|
||||
*/
|
||||
?>
|
||||
<tr><td><?=i18n("Notes")?></td><td colspan="5"><textarea id="organizationinfo_notes" name="notes" rows="4" cols="60"></textarea></td></tr>
|
||||
<tr><td><?=i18n("Notes")?></td><td colspan="5"><textarea id="organizationinfo_notes" name="notes" rows="8" cols="60"></textarea></td></tr>
|
||||
</table>
|
||||
<input id="organizationinfo_save_button" type="submit" value="<?=i18n("Save")?>" onClick="return organizationinfo_save()" />
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user