Pro Bono Attorneys Enabled

From PikaDocs

How I added the ability to keep track of whether Pro Bono Attorneys are enabled or not. (Basically, keeping track of current attorneys. This is modeled off of functionality we had in our old CMS).

Add a new field to your pb_attorneys table with this SQL:

ALTER TABLE `pb_attorneys` ADD `enabled` TINYINT DEFAULT '1' NOT NULL ;

(This will add the new field and set it to 1. So all attorneys currently in your table will be set to enabled).

Modify pb_attorneys.php around line 27:

// Andrew Cameron 2006/4/25 - grab new checkbox for enabled attorneys
$enabled = pl_grab_var('enabled');

Now around line 172:

    // Andrew Cameron 2006/4/25 add new ability to filter Pb attorneys based on enabled
    $C .= '</td><td><font size="-1">Enter 1 for Active:</font><br>';
    $C .= "<input type=\"text\" name=\"enabled\" value=\"1\" size=2 tabindex=1>\n";

Now around line 215:

    // Andrew Cameron 2006/4/25 - add ability to filter enabled pb attorneys
    if ($enabled)
    {
        $filter['enabled'] = 1;
    }

Now modify app/gilalib/lib/pikaCms.php around line 1548:

            // Andrew Cameron 2006/4/25 adding new filter for enabled attorneys
            if (isset($filter['enabled']) && $filter['enabled'])
			{
				$sql_filter .= " AND enabled=1 ";
			}

Now modify subtemplates/pb_attorneys.html around line 113:

        <p>Enabled: <br/>
        
            %%[enabled,yes_no,checkbox]%%
        </p>

original entry by Andrew Cameron

Legal Services Lawline of Vermont (http://www.lawlinevt.org/) and Vermont Legal Aid (http://www.vtlegalaid.org/)