View Issue Details

IDProjectCategoryView StatusLast Update
0002553phplist applicationConfigurationpublic12-02-09 13:54
ReporterDamienMcKenna 
PriorityimmediateSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version2.9.3 
Target VersionFixed in Version2.9.5 
Summary0002553: admin/spageedit.php: Clean up attributes list
DescriptionThe attributes list should be a regular column-based table rather than one table per attribute.
TagsNo tags attached.

Relationships

related to 0003586 closed Continuous overall improvement tasks 
related to 0002554 closedmichiel commonlib/pages/attributes.php: clean up the UI 

Activities

DamienMcKenna

08-02-05 04:27

manager   ~0003428

Last edited: 08-02-05 04:37

Change lines 167 onwards from:

  while ($row = Sql_Fetch_Array($req)) {
    if (is_array($attributedata[$row["id"]])) {
      $checked[$row["id"]] = "checked";
      $bgcol = '#F7E7C2';
      $value = $attributedata[$row["id"]];
     } else {
      $value = $row;
      $bgcol = '#ffffff';
    }
  ?>
  <table border=1 width=100% bgcolor="<?php echo $bgcol?>">
  <tr><td colspan=2 width=150>Attribute:<?php echo $row["id"] ?></td><td colspan=2>Check this box to use this attribute in the page <input type="checkbox" name="attr_use[<? echo $row["id"] ?>]" value="1" <?=$checked[$row["id"]]?>></td></tr>
  <tr><td colspan=2>Name: </td><td colspan=2><h2><?php echo htmlspecialchars(stripslashes($row["name"])) ?></h2></td></tr>
  <tr><td colspan=2>Type: </td><td colspan=2><h2><?php echo $row["type"]?></h2></td></tr>
  <tr><td colspan=2>Default Value: </td><td colspan=2><input type=text name="attr_default[<?php echo $row["id"]?>]" value="<? echo htmlspecialchars(stripslashes($value["default_value"])) ?>" size=40></td></tr>
  <tr><td>Order of Listing: </td><td><input type=text name="attr_listorder[<?php echo $row["id"]?>]" value="<? echo $value["listorder"] ?>" size=5></td>
  <td>Is this attribute required?: </td><td><input type=checkbox name="attr_required[<?php echo $row["id"]?>]" value="1" <? echo $value["required"] ? "checked": "" ?>></td></tr>
  </table><hr>
<?php
  }


to:


  print "<table border=\"1\" width=\"100%\">\n";
    print " <tr>\n";
    print " <th>use?</th>\n";
    print " <th>name</th>\n";
    print " <th>type</th>\n";
    print " <th>default</th>\n";
    print " <th>required</th>\n";
    print " <th>order</th>\n";
    print " </tr>\n";

  while ($row = Sql_Fetch_Array($req)) {
    if (is_array($attributedata[$row["id"]])) {
      $checked[$row["id"]] = "checked";
      $bgcol = '#F7E7C2';
      $value = $attributedata[$row["id"]];
     } else {
      $value = $row;
      $bgcol = '#ffffff';
    }
  ?>
    <tr bgcolor="<?php echo $bgcol; ?>">
        <td><input type="checkbox" name="attr_use[<? echo $row["id"]; ?>]" value="1" <? echo $checked[$row["id"]]; ?> /></td>
        <td><?php echo htmlspecialchars(stripslashes($row["name"])); ?></td>
        <td><?php echo $row["type"]; ?></td>
        <td><input type="text" name="attr_default[<?php echo $row["id"]; ?>]" value="<? echo htmlspecialchars(stripslashes($value["default_value"])) ?>" size="15" /></td>
        <td><input type="checkbox" name="attr_required[<?php echo $row["id"]; ?>]" value="1" <? echo $value["required"] ? "checked": ""; ?> /></td>
        <td><input type="text" name="attr_listorder[<?php echo $row["id"]; ?>]" value="<? echo $value["listorder"]; ?>" size="5" /></td>
    </tr>
<?php
  }
    print "</table>\n";

DamienMcKenna

08-02-05 04:31

manager   ~0003429

Waiting for insertion of code into CVS.

michiel

18-02-05 16:35

manager   ~0003572

Made this part of 2.9.5, because with the translation stuff going in, it's not a simple cut-n-paste anymore.