# HG changeset patch # User Matti Hamalainen # Date 1380965639 -10800 # Node ID e85ed35585fcb40ec22f13f2eeabef92d68b6869 # Parent 4e09327ed4d02224f599528d437e5bc7b2ab5b31 Work on attendee editing, etc. diff -r 4e09327ed4d0 -r e85ed35585fc admin.inc.php --- a/admin.inc.php Sat Oct 05 11:36:30 2013 +0300 +++ b/admin.inc.php Sat Oct 05 12:33:59 2013 +0300 @@ -267,9 +267,9 @@ setTimeout("refreshNews();", 50); } - sendPOSTRequest( - "action=add&type=news&"+args, - msuccess); + if (args != "") + sendPOSTRequest("action=add&type=news&"+args, msuccess); + return false; } @@ -280,6 +280,22 @@ } +function addAttendee() +{ + var args = makePostArgs({"name":1,"groups":0,"oneliner":0,"email":0}, "ne", "x"); + + var msuccess = function(txt) + { + setTimeout("refreshAttendees();", 50); + } + + if (args != "") + sendPOSTRequest("action=add&type=attendees&"+args, msuccess); + + return false; +} + + function deleteAttendee(id) { deleteItem(id, "attendee", "attendees", "refreshAttendees();", "attendee"); @@ -295,7 +311,8 @@ setTimeout("refreshAttendees();", 50); } - sendPOSTRequest("action=update&type=attendees&id="+id+"&"+args, msuccess); + if (args != "") + sendPOSTRequest("action=update&type=attendees&id="+id+"&"+args, msuccess); } @@ -323,7 +340,8 @@ setTimeout("refreshCompos();", 50); } - sendPOSTRequest("action=add&type=compo&"+args, msuccess); + if (args != "") + sendPOSTRequest("action=add&type=compo&"+args, msuccess); return false; } @@ -332,7 +350,8 @@ { var args = makePostArgs({"name":1, "description":1, "visible":3, "voting":3, "showAuthors":3}, "co", id); - sendPOSTRequest("action=update&type=compo&id="+id+"&"+args); + if (args != "") + sendPOSTRequest("action=update&type=compo&id="+id+"&"+args); } @@ -345,7 +364,8 @@ setTimeout("refreshEntries();", 50); } - sendPOSTRequest("action=add&type=entry&compo_id="+id+"&"+args, msuccess); + if (args != "") + sendPOSTRequest("action=add&type=entry&compo_id="+id+"&"+args, msuccess); return false; } @@ -359,7 +379,8 @@ setTimeout("refreshEntries();", 50); } - sendPOSTRequest("action=update&type=entry&id="+id+"&"+args, msuccess); + if (args != "") + sendPOSTRequest("action=update&type=entry&id="+id+"&"+args, msuccess); } diff -r 4e09327ed4d0 -r e85ed35585fc ajax.php --- a/ajax.php Sat Oct 05 11:36:30 2013 +0300 +++ b/ajax.php Sat Oct 05 12:33:59 2013 +0300 @@ -232,13 +232,33 @@ " Oneliner\n". " E-mail\n". " Actions\n". - " User key\n". + " Vote key\n". " Active\n". " \n"; $row = 0; foreach ($res as $item) stPrintAttendee($item, $row++, TRUE); - echo "\n"; + + $prefix = "ne"; + echo + "\n". + "
\n". + "\n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + "
NameGroupsE-mailOnelinerActions
".stGetFormTextInput(20, 64, "name", "x", $prefix, "")."".stGetFormTextInput(20, 64, "groups", "x", $prefix, "")."".stGetFormTextInput(20, 64, "email", "x", $prefix, "")."".stGetFormTextInput(30, 64, "oneliner", "x", $prefix, "")."".stGetFormButtonInput("add", "", $prefix, " Add new ", "addAttendee()")."
\n"; } else if ($type == "compos") @@ -340,7 +360,7 @@ stChkRequestItem("author") && stChkRequestItem("compo_id")) { $sql = stPrepareSQL( - "INSERT INTO entries (name,author,compo_id) VALUES (%S,%Q,%D)", + "INSERT INTO entries (name,author,compo_id,filename) VALUES (%S,%S,%D,%S)", "name", "author", "compo_id", "filename"); execSQLCond($sql, "OK, entry added.");