diff --git a/include/staff/dynamic-list.inc.php b/include/staff/dynamic-list.inc.php index d05396f99732f9ed03064f867eca1778cbfdafa7..6ae07c06eadc2a6bbff6004db4523efec61d3596 100644 --- a/include/staff/dynamic-list.inc.php +++ b/include/staff/dynamic-list.inc.php @@ -99,7 +99,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); <i class="help-tip icon-question-sign" href="#field_delete"></i></th> </tr> </thead> - <tbody class="sortable-rows" data-sort="sort-"> + <tbody class="sortable-rows" data-sort="prop-sort-"> <?php if ($form) foreach ($form->getDynamicFields() as $f) { $id = $f->get('id'); $deletable = !$f->isDeletable() ? 'disabled="disabled"' : ''; @@ -108,7 +108,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); $ferrors = $f->errors(); ?> <tr> <td><i class="icon-sort"></i></td> - <td><input type="text" size="32" name="label-<?php echo $id; ?>" + <td><input type="text" size="32" name="prop-label-<?php echo $id; ?>" value="<?php echo Format::htmlchars($f->get('label')); ?>"/> <font class="error"><?php if ($ferrors['label']) echo '<br/>'; echo $ferrors['label']; ?> @@ -148,7 +148,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); </td> <td><input type="checkbox" name="delete-<?php echo $id; ?>" <?php echo $deletable; ?>/> - <input type="hidden" name="sort-<?php echo $id; ?>" + <input type="hidden" name="prop-sort-<?php echo $id; ?>" value="<?php echo $f->get('sort'); ?>"/> </td> </tr> @@ -156,10 +156,10 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); } for ($i=0; $i<$newcount; $i++) { ?> <td><em>+</em> - <input type="hidden" name="sort-new-<?php echo $i; ?>" - value="<?php echo $info["sort-new-$i"]; ?>"/></td> - <td><input type="text" size="32" name="label-new-<?php echo $i; ?>" - value="<?php echo $info["label-new-$i"]; ?>"/></td> + <input type="hidden" name="prop-sort-new-<?php echo $i; ?>" + value="<?php echo $info["prop-sort-new-$i"]; ?>"/></td> + <td><input type="text" size="32" name="prop-label-new-<?php echo $i; ?>" + value="<?php echo $info["prop-label-new-$i"]; ?>"/></td> <td><select name="type-new-<?php echo $i; ?>"> <?php foreach (FormField::allTypes() as $group=>$types) { ?><optgroup label="<?php echo Format::htmlchars($group); ?>"><?php diff --git a/scp/lists.php b/scp/lists.php index 668ae4f68d26a1f9ba15e7a093f26cd9cccfa80c..79748a709eea0f9757649cf0874dfef9d7ebe3cb 100644 --- a/scp/lists.php +++ b/scp/lists.php @@ -61,8 +61,8 @@ if($_POST) { $field->set('name', $_POST["name-$id"]); # TODO: make sure all help topics still have all required fields foreach (array('sort','label') as $f) { - if (isset($_POST["$f-$id"])) { - $field->set($f, $_POST["$f-$id"]); + if (isset($_POST["prop-$f-$id"])) { + $field->set($f, $_POST["prop-$f-$id"]); } } if (in_array($field->get('name'), $names)) @@ -133,7 +133,7 @@ if($_POST) { } if ($list) { - for ($i=0; isset($_POST["sort-new-$i"]); $i++) { + for ($i=0; isset($_POST["prop-sort-new-$i"]); $i++) { if (!$_POST["value-new-$i"]) continue; $item = DynamicListItem::create(array( @@ -149,13 +149,14 @@ if($_POST) { } if ($form) { - for ($i=0; isset($_POST["sort-new-$i"]); $i++) { - if (!$_POST["label-new-$i"]) + for ($i=0; isset($_POST["prop-sort-new-$i"]); $i++) { + if (!$_POST["prop-label-new-$i"]) continue; $field = DynamicFormField::create(array( 'form_id'=>$form->get('id'), - 'sort'=>$_POST["sort-new-$i"] ? $_POST["sort-new-$i"] : ++$max_sort, - 'label'=>$_POST["label-new-$i"], + 'sort'=>$_POST["prop-sort-new-$i"] + ? $_POST["prop-sort-new-$i"] : ++$max_sort, + 'label'=>$_POST["prop-label-new-$i"], 'type'=>$_POST["type-new-$i"], 'name'=>$_POST["name-new-$i"], ));