|
|
@@ -5,13 +5,28 @@ Core::addBreadcrumb("/account/projects", "Projects");
|
|
|
|
|
|
Core::addScript("public/js/app-projects.js");
|
|
|
|
|
|
-$customer = Customer::getForAdmin();
|
|
|
+Core::$allow_all_customers = true;
|
|
|
|
|
|
-$page_title = "$customer->name Projects";
|
|
|
+$customer_id = http::value("customer_id");
|
|
|
+if(Core::$user->isAdmin() && $customer_id == "ALL") {
|
|
|
|
|
|
-Core::addBreadcrumb("/account/projects?customer_id=$customer->id", $page_title);
|
|
|
+ $page_title = "All Projects";
|
|
|
+ Core::addBreadcrumb("/account/projects?customer_id=ALL", $page_title);
|
|
|
|
|
|
-$nvp = ["customer_id" => $customer->id];
|
|
|
+ $nvp = [];
|
|
|
+
|
|
|
+ $customer = new Customer;
|
|
|
+ $customer->id = "ALL";
|
|
|
+ $customer->name = "All";
|
|
|
+
|
|
|
+}
|
|
|
+else {
|
|
|
+ $customer = Customer::getForAdmin();
|
|
|
+ $page_title = "$customer->name Projects";
|
|
|
+ Core::addBreadcrumb("/account/projects?customer_id=$customer->id", $page_title);
|
|
|
+
|
|
|
+ $nvp = ["customer_id" => $customer->id];
|
|
|
+}
|
|
|
|
|
|
$id = http::value("id", "int");
|
|
|
$name = http::value("name", "trim");
|
|
|
@@ -32,10 +47,8 @@ if($year) {
|
|
|
$projects = Project::query($nvp, ["sort" => "dts_start", "order" => "desc"]);
|
|
|
$templates = Template::load(array_column($projects, "template_id"));
|
|
|
|
|
|
-$filter_count = count($nvp) - 1;
|
|
|
+$filter_count = count($nvp);
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
View::include("projects", compact("customer", "filter_count", "projects", "year"));
|
|
|
View::includeOnce("footer");
|
|
|
-
|
|
|
-?>
|