Exemplo n.º 1
0
 function load_filter($defaults)
 {
     $current_user =& singleton("current_user");
     // display the list of project name.
     $db = new db_alloc();
     $page_vars = array_keys(timeSheetGraph::get_list_vars());
     $_FORM = get_all_form_data($page_vars, $defaults);
     if ($_FORM["applyFilter"] && is_object($current_user)) {
         // we have a new filter configuration from the user, and must save it
         if (!$_FORM["dontSave"]) {
             $url = $_FORM["url_form_action"];
             unset($_FORM["url_form_action"]);
             $current_user->prefs[$_FORM["form_name"]] = $_FORM;
             $_FORM["url_form_action"] = $url;
         }
     } else {
         // we haven't been given a filter configuration, so load it from user preferences
         $_FORM = $current_user->prefs[$_FORM["form_name"]];
     }
     $rtn["personOptions"] = page::select_options(person::get_username_list($_FORM["personID"]), $_FORM["personID"]);
     $rtn["dateFrom"] = $_FORM["dateFrom"];
     $rtn["dateTo"] = $_FORM["dateTo"];
     $rtn["personID"] = $_FORM["personID"];
     $rtn["groupBy"] = $_FORM["groupBy"];
     // GET
     $rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM));
     return $rtn;
 }
Exemplo n.º 2
0
 public static function load_form_data($defaults = array())
 {
     $current_user =& singleton("current_user");
     $page_vars = array_keys(task::get_list_vars());
     $_FORM = get_all_form_data($page_vars, $defaults);
     if ($_FORM["projectID"] && !is_array($_FORM["projectID"])) {
         $p = $_FORM["projectID"];
         unset($_FORM["projectID"]);
         $_FORM["projectID"][] = $p;
     } else {
         if (!$_FORM["projectType"]) {
             $_FORM["projectType"] = "mine";
         }
     }
     if ($_FORM["showDates"]) {
         $_FORM["showDate1"] = true;
         $_FORM["showDate2"] = true;
         $_FORM["showDate3"] = true;
         $_FORM["showDate4"] = true;
         $_FORM["showDate5"] = true;
     }
     if ($_FORM["applyFilter"] && is_object($current_user)) {
         // we have a new filter configuration from the user, and must save it
         if (!$_FORM["dontSave"]) {
             $url = $_FORM["url_form_action"];
             unset($_FORM["url_form_action"]);
             $current_user->prefs[$_FORM["form_name"]] = $_FORM;
             $_FORM["url_form_action"] = $url;
         }
     } else {
         // we haven't been given a filter configuration, so load it from user preferences
         $_FORM = $current_user->prefs[$_FORM["form_name"]];
         if (!isset($current_user->prefs[$_FORM["form_name"]])) {
             $_FORM["projectType"] = "mine";
             $_FORM["taskStatus"] = "open";
             $_FORM["personID"] = $current_user->get_id();
         }
     }
     // If have check Show Description checkbox then display the Long Description and the Comments
     if ($_FORM["showDescription"]) {
         $_FORM["showComments"] = true;
     } else {
         unset($_FORM["showComments"]);
     }
     $_FORM["taskView"] or $_FORM["taskView"] = "byProject";
     return $_FORM;
 }
Exemplo n.º 3
0
 function load_form_data($defaults = array())
 {
     $current_user =& singleton("current_user");
     $page_vars = array_keys(productSale::get_list_vars());
     $_FORM = get_all_form_data($page_vars, $defaults);
     if (!$_FORM["applyFilter"]) {
         $_FORM = $current_user->prefs[$_FORM["form_name"]];
         if (!isset($current_user->prefs[$_FORM["form_name"]])) {
             $_FORM["status"] = "edit";
             $_FORM["personID"] = $current_user->get_id();
         }
     } else {
         if ($_FORM["applyFilter"] && is_object($current_user) && !$_FORM["dontSave"]) {
             $url = $_FORM["url_form_action"];
             unset($_FORM["url_form_action"]);
             $current_user->prefs[$_FORM["form_name"]] = $_FORM;
             $_FORM["url_form_action"] = $url;
         }
     }
     return $_FORM;
 }
Exemplo n.º 4
0
 function load_form_data($defaults = array())
 {
     $current_user =& singleton("current_user");
     $page_vars = array_keys(transaction::get_list_vars());
     $_FORM = get_all_form_data($page_vars, $defaults);
     #echo "<pre>".print_r($_FORM,1)."</pre>";
     #if (!$_FORM["applyFilter"]) {
     #  $_FORM = $current_user->prefs[$_FORM["form_name"]];
     #  if (!isset($current_user->prefs[$_FORM["form_name"]])) {
     #    #$_FORM["personID"] = $current_user->get_id();
     #    list($_FORM["startDate"], $_FORM["endDate"]) = transaction::get_statement_start_and_end_dates(date("m"),date("Y"));
     #  }
     #} else if ($_FORM["applyFilter"] && is_object($current_user) && !$_FORM["dontSave"]) {
     #  $url = $_FORM["url_form_action"];
     #  unset($_FORM["url_form_action"]);
     #  $current_user->prefs[$_FORM["form_name"]] = $_FORM;
     #  $_FORM["url_form_action"] = $url;
     #}
     return $_FORM;
 }