Beispiel #1
0
 public static function toolbar()
 {
     global $TPL;
     $current_user =& singleton("current_user");
     $db = new db_alloc();
     has("task") and $str[] = "<option value=\"create_" . $TPL["url_alloc_task"] . "\">New Task</option>";
     has("time") and $str[] = "<option value=\"create_" . $TPL["url_alloc_timeSheet"] . "\">New Time Sheet</option>";
     has("task") and $str[] = "<option value=\"create_" . $TPL["url_alloc_task"] . "tasktype=Fault\">New Fault</option>";
     has("task") and $str[] = "<option value=\"create_" . $TPL["url_alloc_task"] . "tasktype=Message\">New Message</option>";
     if (has("project") && have_entity_perm("project", PERM_CREATE, $current_user)) {
         $str[] = "<option value=\"create_" . $TPL["url_alloc_project"] . "\">New Project</option>";
     }
     has("client") and $str[] = "<option value=\"create_" . $TPL["url_alloc_client"] . "\">New Client</option>";
     has("finance") and $str[] = "<option value=\"create_" . $TPL["url_alloc_expenseForm"] . "\">New Expense Form</option>";
     has("reminder") and $str[] = "<option value=\"create_" . $TPL["url_alloc_reminder"] . "parentType=general&step=2\">New Reminder</option>";
     if (has("person") && have_entity_perm("person", PERM_CREATE, $current_user)) {
         $str[] = "<option value=\"create_" . $TPL["url_alloc_person"] . "\">New Person</option>";
     }
     has("item") and $str[] = "<option value=\"create_" . $TPL["url_alloc_loanAndReturn"] . "\">New Item Loan</option>";
     $str[] = "<option value=\"\" disabled=\"disabled\">--------------------";
     $history = new history();
     $q = $history->get_history_query("DESC");
     $db = new db_alloc();
     $db->query($q);
     while ($row = $db->row()) {
         $r["history_" . $row["value"]] = $row["the_label"];
     }
     $str[] = page::select_options($r, $_POST["search_action"]);
     $TPL["history_options"] = implode("\n", $str);
     $TPL["category_options"] = page::get_category_options($_POST["search_action"]);
     $TPL["needle"] = $_POST["needle"];
     include_template(ALLOC_MOD_DIR . "shared/templates/toolbarS.tpl");
 }