Esempio n. 1
0
 function get_all_parties($projectID = "")
 {
     $db = new db_alloc();
     $interestedPartyOptions = array();
     if ($_GET["projectID"]) {
         $projectID = $_GET["projectID"];
     } else {
         if (!$projectID) {
             $projectID = $this->get_value("projectID");
         }
     }
     if ($projectID) {
         $project = new project($projectID);
         $interestedPartyOptions = $project->get_all_parties(false, $this->get_id());
     }
     $extra_interested_parties = config::get_config_item("defaultInterestedParties") or $extra_interested_parties = array();
     foreach ($extra_interested_parties as $name => $email) {
         $interestedPartyOptions[$email]["name"] = $name;
     }
     if ($this->get_value("creatorID")) {
         $p = new person();
         $p->set_id($this->get_value("creatorID"));
         $p->select();
         if ($p->get_value("emailAddress")) {
             $interestedPartyOptions[$p->get_value("emailAddress")]["name"] = $p->get_name();
             $interestedPartyOptions[$p->get_value("emailAddress")]["role"] = "creator";
             $interestedPartyOptions[$p->get_value("emailAddress")]["personID"] = $this->get_value("creatorID");
         }
     }
     if ($this->get_value("personID")) {
         $p = new person();
         $p->set_id($this->get_value("personID"));
         $p->select();
         if ($p->get_value("emailAddress")) {
             $interestedPartyOptions[$p->get_value("emailAddress")]["name"] = $p->get_name();
             $interestedPartyOptions[$p->get_value("emailAddress")]["role"] = "assignee";
             $interestedPartyOptions[$p->get_value("emailAddress")]["personID"] = $this->get_value("personID");
             $interestedPartyOptions[$p->get_value("emailAddress")]["selected"] = 1;
         }
     }
     if ($this->get_value("managerID")) {
         $p = new person();
         $p->set_id($this->get_value("managerID"));
         $p->select();
         if ($p->get_value("emailAddress")) {
             $interestedPartyOptions[$p->get_value("emailAddress")]["name"] = $p->get_name();
             $interestedPartyOptions[$p->get_value("emailAddress")]["role"] = "manager";
             $interestedPartyOptions[$p->get_value("emailAddress")]["personID"] = $this->get_value("managerID");
             $interestedPartyOptions[$p->get_value("emailAddress")]["selected"] = 1;
         }
     }
     // return an aggregation of the current task/proj/client parties + the existing interested parties
     $interestedPartyOptions = interestedParty::get_interested_parties("task", $this->get_id(), $interestedPartyOptions);
     return $interestedPartyOptions;
 }
Esempio n. 2
0
 function get_all_parties($projectID = "")
 {
     $db = new db_alloc();
     $interestedPartyOptions = array();
     if (!$projectID && is_object($this)) {
         $projectID = $this->get_value("projectID");
     }
     if ($projectID) {
         $project = new project($projectID);
         $interestedPartyOptions = $project->get_all_parties();
     }
     $extra_interested_parties = config::get_config_item("defaultInterestedParties") or $extra_interested_parties = array();
     foreach ($extra_interested_parties as $name => $email) {
         $interestedPartyOptions[$email] = array("name" => $name);
     }
     if (is_object($this)) {
         if ($this->get_value("personID")) {
             $p = new person();
             $p->set_id($this->get_value("personID"));
             $p->select();
             $p->get_value("emailAddress") and $interestedPartyOptions[$p->get_value("emailAddress")] = array("name" => $p->get_name(), "selected" => true, "personID" => $this->get_value("personID"));
         }
         if ($this->get_value("productSaleCreatedUser")) {
             $p = new person();
             $p->set_id($this->get_value("productSaleCreatedUser"));
             $p->select();
             $p->get_value("emailAddress") and $interestedPartyOptions[$p->get_value("emailAddress")] = array("name" => $p->get_name(), "selected" => true, "personID" => $this->get_value("productSaleCreatedUser"));
         }
         $this_id = $this->get_id();
     }
     // return an aggregation of the current proj/client parties + the existing interested parties
     $interestedPartyOptions = interestedParty::get_interested_parties("productSale", $this_id, $interestedPartyOptions);
     return $interestedPartyOptions;
 }
Esempio n. 3
0
 function get_cc_list_select($projectID = "")
 {
     $interestedParty = array();
     $interestedPartyOptions = array();
     if (is_object($this)) {
         $interestedPartyOptions = $this->get_all_parties($projectID);
     } else {
         $project = new project($projectID);
         $interestedPartyOptions = $project->get_all_parties();
     }
     if (is_array($interestedPartyOptions)) {
         foreach ($interestedPartyOptions as $email => $info) {
             $name = $info["name"];
             $identifier = $info["identifier"];
             if ($info["role"] == "interested" && $info["selected"]) {
                 $interestedParty[] = $identifier;
             }
             if ($email) {
                 $name = trim($name);
                 $str = trim(page::htmlentities($name . " <" . $email . ">"));
                 $options[$identifier] = $str;
             }
         }
     }
     $str = "<select name=\"interestedParty[]\" multiple=\"true\">" . page::select_options($options, $interestedParty, 100, false) . "</select>";
     return $str;
 }
Esempio n. 4
0
 function get_all_parties($projectID = "")
 {
     $db = new db_alloc();
     $interestedPartyOptions = array();
     if (!$projectID && is_object($this)) {
         $projectID = $this->get_value("projectID");
     }
     if ($projectID) {
         $project = new project($projectID);
         $interestedPartyOptions = $project->get_all_parties();
     }
     $extra_interested_parties = config::get_config_item("defaultInterestedParties") or $extra_interested_parties = array();
     foreach ($extra_interested_parties as $name => $email) {
         $interestedPartyOptions[$email] = array("name" => $name);
     }
     if (is_object($this)) {
         if ($this->get_value("personID")) {
             $p = new person();
             $p->set_id($this->get_value("personID"));
             $p->select();
             $p->get_value("emailAddress") and $interestedPartyOptions[$p->get_value("emailAddress")] = array("name" => $p->get_value("firstName") . " " . $p->get_value("surname"), "role" => "assignee", "selected" => false, "personID" => $this->get_value("personID"));
         }
         if ($this->get_value("approvedByManagerPersonID")) {
             $p = new person();
             $p->set_id($this->get_value("approvedByManagerPersonID"));
             $p->select();
             $p->get_value("emailAddress") and $interestedPartyOptions[$p->get_value("emailAddress")] = array("name" => $p->get_value("firstName") . " " . $p->get_value("surname"), "role" => "manager", "selected" => true, "personID" => $this->get_value("approvedByManagerPersonID"));
         }
         $this_id = $this->get_id();
     }
     // return an aggregation of the current task/proj/client parties + the existing interested parties
     $interestedPartyOptions = interestedParty::get_interested_parties("timeSheet", $this_id, $interestedPartyOptions);
     return $interestedPartyOptions;
 }
Esempio n. 5
0
 function get_all_parties($projectID = "", $clientID = "")
 {
     $db = new db_alloc();
     $interestedPartyOptions = array();
     if (!$projectID && is_object($this)) {
         $projectID = $this->get_value("projectID");
     }
     if ($projectID) {
         $project = new project($projectID);
         $interestedPartyOptions = $project->get_all_parties();
     }
     if ($clientID) {
         $client = new client($clientID);
         $interestedPartyOptions = array_merge((array) $interestedPartyOptions, (array) $client->get_all_parties());
     }
     $extra_interested_parties = config::get_config_item("defaultInterestedParties") or $extra_interested_parties = array();
     foreach ($extra_interested_parties as $name => $email) {
         $interestedPartyOptions[$email] = array("name" => $name);
     }
     // return an aggregation of the current task/proj/client parties + the existing interested parties
     $interestedPartyOptions = interestedParty::get_interested_parties("invoice", $this->get_id(), $interestedPartyOptions);
     return $interestedPartyOptions;
 }