# HG changeset patch # User Matti Hamalainen # Date 1417259297 -7200 # Node ID a1da651a2e453fba11866c37425052d6ade92d70 # Parent b0a8cb63334e6fba41d2c5bfbd9344a0284203bb Add compo notes field. diff -r b0a8cb63334e -r a1da651a2e45 admajax.php --- a/admajax.php Sat Nov 29 12:46:41 2014 +0200 +++ b/admajax.php Sat Nov 29 13:08:17 2014 +0200 @@ -154,6 +154,7 @@ " Name: ".stGetFormTextInput(40, SET_LEN_COMPO_NAME, "name", $id, $prefix, $item["name"])."
\n". $str1. " ".stGetFormTextArea(8, 60, "description", $id, $prefix, $item["description"])."
\n". + " ".stGetFormTextArea(8, 40, "notes", $id, $prefix, $item["notes"])."\n". " ".stGetFormCheckBoxInput("visible", $id, $prefix, $item["visible"], "Visible")."\n". $str2."\n". " ".stGetFormButtonInput("update", $id, $prefix, "Update", "updateCompo(".$id.")")."\n". @@ -1716,8 +1717,8 @@ if ($type == "compo" && stValidateRequestCompoData(FALSE, 0)) { $sql = stPrepareSQL( - "INSERT INTO compos (name,description,visible,voting,show_authors,preview_type) VALUES (%S,%Q,0,0,0,0)", - "name", "description"); + "INSERT INTO compos (name,description,notes,visible,voting,show_authors,preview_type) VALUES (%S,%Q,%Q,0,0,0,0)", + "name", "description", "notes"); stExecSQLCond($sql, "OK, compo added."); } @@ -1840,6 +1841,7 @@ array_merge(array( "name" => "S", "description" => "Q", + "notes" => "Q", "visible" => "B", ), $cdata)); diff -r b0a8cb63334e -r a1da651a2e45 admin.js --- a/admin.js Sat Nov 29 12:46:41 2014 +0200 +++ b/admin.js Sat Nov 29 13:08:17 2014 +0200 @@ -361,7 +361,7 @@ // function addCompo() { - var args = jsMakePostArgs({"name":1, "description":1}, "nc", ""); + var args = jsMakePostArgs({"name":1, "description":1, "notes":1}, "nc", ""); var msuccess = function(txt) { @@ -387,7 +387,7 @@ function updateCompo(id) { - var args = jsMakePostArgs({"name":1, "description":1, "visible":3, "voting":3, "show_authors":3, "cpath":1, "preview_type":4}, "co", id, true); + var args = jsMakePostArgs({"name":1, "description":1, "notes":1, "visible":3, "voting":3, "show_authors":3, "cpath":1, "preview_type":4}, "co", id, true); var msuccess = function(txt) { diff -r b0a8cb63334e -r a1da651a2e45 dbdefs.inc.php --- a/dbdefs.inc.php Sat Nov 29 12:46:41 2014 +0200 +++ b/dbdefs.inc.php Sat Nov 29 13:08:17 2014 +0200 @@ -258,6 +258,7 @@ array("id" , "INTEGER", "PRIMARY KEY", "AUTOINCREMENT"), array("name" , "VARCHAR(".SET_LEN_COMPO_NAME.")"), array("description" , "VARCHAR(".SET_LEN_COMPO_DESC.")"), + array("notes" , "VARCHAR(".SET_LEN_COMPO_NOTES.")"), array("visible" , "INT", "DEFAULT 0"), array("voting" , "INT", "DEFAULT 0"), diff -r b0a8cb63334e -r a1da651a2e45 msite.inc.php --- a/msite.inc.php Sat Nov 29 12:46:41 2014 +0200 +++ b/msite.inc.php Sat Nov 29 13:08:17 2014 +0200 @@ -26,6 +26,7 @@ define("SET_LEN_COMPO_NAME", 128); define("SET_LEN_COMPO_DESC", 4096); +define("SET_LEN_COMPO_NOTES", 4096); define("SET_LEN_COMPO_PATH", 128); define("SET_LEN_ENTRY_NAME", 64);