Ejemplo n.º 1
0
 function render()
 {
     $current_user =& singleton("current_user");
     global $TPL;
     if (isset($current_user->prefs["projectListNum"]) && $current_user->prefs["projectListNum"] != "all") {
         $options["limit"] = sprintf("%d", $current_user->prefs["projectListNum"]);
     }
     $options["projectStatus"] = "Current";
     $options["personID"] = $current_user->get_id();
     $TPL["projectListRows"] = project::get_list($options);
     return true;
 }
Ejemplo n.º 2
0
}
$TPL["clientCategoryOptions"] = page::select_options($cc, $client->get_value("clientCategory"));
$client->get_value("clientCategory") and $TPL["client_clientCategoryLabel"] = $cc[$client->get_value("clientCategory")];
// client contacts
if ($_POST["clientContact_save"] || $_POST["clientContact_delete"]) {
    $clientContact = new clientContact();
    $clientContact->read_globals();
    if ($_POST["clientContact_save"]) {
        #$clientContact->set_value('clientID', $_POST["clientID"]);
        $clientContact->save();
    }
    if ($_POST["clientContact_delete"]) {
        $clientContact->delete();
    }
}
if (!$clientID) {
    $TPL["message_help"][] = "Create a new Client by inputting the Client Name and other details and clicking the Create New Client button.";
    $TPL["main_alloc_title"] = "New Client - " . APPLICATION_NAME;
    $TPL["clientSelfLink"] = "New Client";
} else {
    $TPL["main_alloc_title"] = "Client " . $client->get_id() . ": " . $client->get_name() . " - " . APPLICATION_NAME;
    $TPL["clientSelfLink"] = sprintf("<a href=\"%s\">%d %s</a>", $client->get_url(), $client->get_id(), $client->get_name(array("return" => "html")));
}
if ($current_user->have_role("admin")) {
    $TPL["invoice_links"] .= "<a href=\"" . $TPL["url_alloc_invoice"] . "clientID=" . $clientID . "\">New Invoice</a>";
}
$projectListOps = array("showProjectType" => true, "clientID" => $client->get_id());
$TPL["projectListRows"] = project::get_list($projectListOps);
$TPL["client_clientPostalAddress"] = $client->format_address("postal");
$TPL["client_clientStreetAddress"] = $client->format_address("street");
include_template("templates/clientM.tpl");
Ejemplo n.º 3
0
 function get_list_by_client($clientID = false, $onlymine = false)
 {
     $current_user =& singleton("current_user");
     $clientID and $options["clientID"] = $clientID;
     $options["projectStatus"] = "Current";
     $options["showProjectType"] = true;
     if ($onlymine) {
         $options["personID"] = $current_user->get_id();
     }
     $ops = project::get_list($options);
     return array_kv($ops, "projectID", "label");
 }
Ejemplo n.º 4
0
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * allocPSA is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "../alloc.php";
$defaults = array("showProjectType" => true, "url_form_action" => $TPL["url_alloc_projectList"], "form_name" => "projectList_filter");
function show_filter()
{
    global $TPL;
    global $defaults;
    $_FORM = project::load_form_data($defaults);
    $arr = project::load_project_filter($_FORM);
    is_array($arr) and $TPL = array_merge($TPL, $arr);
    include_template("templates/projectListFilterS.tpl");
}
$_FORM = project::load_form_data($defaults);
$TPL["projectListRows"] = project::get_list($_FORM);
$TPL["_FORM"] = $_FORM;
if (!$current_user->prefs["projectList_filter"]) {
    $TPL["message_help"][] = "\n\nallocPSA helps you manage Projects. This page allows you to see a list of\nProjects.\n\n<br><br>\n\nSimply adjust the filter settings and click the <b>Filter</b> button to\ndisplay a list of previously created Projects. \nIf you would prefer to create a new Project, click the <b>New Project</b> link\nin the top-right hand corner of the box below.";
}
$TPL["main_alloc_title"] = "Project List - " . APPLICATION_NAME;
include_template("templates/projectListM.tpl");