예제 #1
0
    delete_query("tbladdonmodules", array("module" => "project_management", "setting" => "completedstatuses"));
    insert_query("tbladdonmodules", array("module" => "project_management", "setting" => "completedstatuses", "value" => implode(",", $_POST['completestatus'])));
    delete_query("tbladdonmodules", array("module" => "project_management", "setting" => "perms"));
    insert_query("tbladdonmodules", array("module" => "project_management", "setting" => "perms", "value" => serialize($_POST['perms'])));
    delete_query("tbladdonmodules", array("module" => "project_management", "setting" => "clientenable"));
    insert_query("tbladdonmodules", array("module" => "project_management", "setting" => "clientenable", "value" => $_POST['clientenable']));
    delete_query("tbladdonmodules", array("module" => "project_management", "setting" => "clientfeatures"));
    insert_query("tbladdonmodules", array("module" => "project_management", "setting" => "clientfeatures", "value" => implode(",", $_POST['clfeat'])));
    redir("module=project_management&m=settings");
}
$adminroles = array();
$result = select_query("tbladminroles", "", "", "name", "ASC");
while ($data = mysql_fetch_array($result)) {
    $adminroles[$data['id']] = $data['name'];
}
$permissions = project_management_permslist();
echo $headeroutput . "\n\n<form method=\"post\" action=\"" . $modulelink . "\">\n<input type=\"hidden\" name=\"save\" value=\"1\" />";
echo "\n<h2>Settings</h2>\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"200\" class=\"fieldlabel\">Default Hourly Rate</td><td class=\"fieldarea\"><input type=\"text\" name=\"hourlyrate\" size=\"15\" value=\"";
echo $vars['hourlyrate'];
echo "\" /><br />Enter the standard hourly rate you charge for use in time based billing (can be overriden at the time of invoice generation)</td></tr>\n<tr><td class=\"fieldlabel\">Project Statuses</td><td class=\"fieldarea\"><input type=\"text\" name=\"statusvalues\" size=\"90\" value=\"";
echo $vars['statusvalues'];
echo "\" /><br />Enter a comma separated list of the statuses you want to setup for projects</td></tr>\n<tr><td width=\"200\" class=\"fieldlabel\">Completed Statuses</td><td class=\"fieldarea\">";
$statuses = explode(",", $vars['statusvalues']);
$completestatuses = explode(",", $vars['completedstatuses']);
foreach ($statuses as $status) {
    echo "<label><input type=\"checkbox\" name=\"completestatus[]\" value=\"" . $status . "\"" . (in_array($status, $completestatuses) ? " checked" : "") . " /> " . current(explode("|", $status)) . "</label> ";
}
echo "<br />Choose the statuses above that should be treated as closed/completed</td></tr>\n</table>\n\n<h2>Client Area</h2>\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"200\" class=\"fieldlabel\">Enable/Disable</td><td class=\"fieldarea\"><label><input type=\"checkbox\" name=\"clientenable\" value=\"1\"";
if ($vars['clientenable']) {
    echo " checked";
}
예제 #2
0
function project_management_checkperm($perm)
{
    if (project_management_check_masteradmin()) {
        return true;
    }
    static $PMRoleID = 0;
    static $PMPerms = "";
    if (!$PMPerms) {
        $perms = get_query_val("tbladdonmodules", "value", array("module" => "project_management", "setting" => "perms"));
        $PMPerms = unserialize($perms);
    }
    if (!$PMRoleID) {
        $PMRoleID = get_query_val("tbladmins", "roleid", array("id" => $_SESSION['adminid']));
    }
    $revperms = array();
    $permissions = project_management_permslist();
    foreach ($permissions as $k => $v) {
        $revperms[$v] = $k;
    }
    if ($PMPerms[$revperms[$perm]][$PMRoleID]) {
        return true;
    }
    return false;
}