コード例 #1
0
ファイル: AgentManager.php プロジェクト: Symbiota/Symbiota
 public function getDetailsView($includeRelated = true, $editLinkURL = '')
 {
     global $clientRoot;
     $editLinkURL = trim($editLinkURL);
     $model = $this->model;
     $returnvalue = "<h3>" . $model->getAssembledName() . "</h3>\n";
     $returnvalue .= '<ul>';
     $primarykeys = array("agentid");
     if ($editLinkURL != '') {
         if (!preg_match('/\\&$/', $editLinkURL)) {
             $editLinkURL .= '&';
         }
         $nullpk = false;
         foreach ($primarykeys as $primarykey) {
             // Add fieldname=value pairs for primary key(s) to editLinkURL.
             $editLinkURL .= urlencode($primarykey) . '=' . urlencode($model->keyGet($primarykey));
             if ($model->keyGet($primarykey) == '') {
                 $nullpk = true;
             }
         }
         if (!$nullpk) {
             $returnvalue .= "<li>Agent <a href='{$editLinkURL}'>Edit</a></li>\n";
         }
     }
     //$returnvalue .= "<li>".Agent::AGENTID.": ".$model->getagentid()."</li>\n";
     $returnvalue .= "<li>" . Agent::TYPE . ": " . $model->gettype() . "</li>\n";
     $returnvalue .= "<li>" . Agent::CURATED . ": " . $model->getcurated() . "</li>\n";
     $returnvalue .= "<li>" . Agent::NOTOTHERWISESPECIFIED . ": " . $model->getnototherwisespecified() . "</li>\n";
     if ($model->gettype() == 'Individual') {
         $returnvalue .= "<li>" . Agent::PREFIX . ": " . $model->getprefix() . "</li>\n";
         $returnvalue .= "<li>" . Agent::FIRSTNAME . ": " . $model->getfirstname() . "</li>\n";
         $returnvalue .= "<li>" . Agent::MIDDLENAME . ": " . $model->getmiddlename() . "</li>\n";
         $returnvalue .= "<li>" . Agent::FAMILYNAME . ": " . $model->getfamilyname() . "</li>\n";
         $returnvalue .= "<li>" . Agent::SUFFIX . ": " . $model->getsuffix() . "</li>\n";
     } else {
         $returnvalue .= "<li>" . Agent::NAMESTRING . ": " . $model->getnamestring() . "</li>\n";
     }
     $returnvalue .= "<li>" . Agent::YEAROFBIRTH . ": " . $model->getyearofbirth() . "</li>\n";
     $returnvalue .= "<li>" . Agent::YEAROFBIRTHMODIFIER . ": " . $model->getyearofbirthmodifier() . "</li>\n";
     $returnvalue .= "<li>" . Agent::YEAROFDEATH . ": " . $model->getyearofdeath() . "</li>\n";
     $returnvalue .= "<li>" . Agent::YEAROFDEATHMODIFIER . ": " . $model->getyearofdeathmodifier() . "</li>\n";
     $returnvalue .= "<li>" . Agent::LIVING . ": " . $model->getliving() . "</li>\n";
     $returnvalue .= "<li>" . Agent::STARTYEARACTIVE . ": " . $model->getstartyearactive() . "</li>\n";
     $returnvalue .= "<li>" . Agent::ENDYEARACTIVE . ": " . $model->getendyearactive() . "</li>\n";
     $returnvalue .= "<li>" . Agent::NOTES . ": " . $model->getnotes() . "</li>\n";
     $returnvalue .= "<li>" . Agent::RATING . ": " . $model->getrating() . "</li>\n";
     $returnvalue .= "<li>" . Agent::GUID . ": " . $model->getguid() . "</li>\n";
     $returnvalue .= "<li>" . Agent::INITIALTIMESTAMP . ": " . $model->getinitialtimestamp() . "</li>\n";
     $returnvalue .= "<li>" . Agent::BIOGRAPHY . ": " . $model->getbiography() . "</li>\n";
     $returnvalue .= "<li>" . Agent::TAXONOMICGROUPS . ": " . $model->gettaxonomicgroups() . "</li>\n";
     $returnvalue .= "<li>" . Agent::COLLECTIONSAT . ": " . $model->getcollectionsat() . "</li>\n";
     $returnvalue .= "<li>" . Agent::MBOX_SHA1SUM . ": " . $model->getmbox_sha1sum() . "</li>\n";
     $returnvalue .= "<li>" . Agent::UUID . ": <a href='{$clientRoot}/agents/agent.php?uuid=" . $model->getuuid() . "'>" . $model->getuuid() . "</a></li>\n";
     $returnvalue .= "<li>" . Agent::DATELASTMODIFIED . ": " . $model->getdatelastmodified() . "</li>\n";
     $returnvalue .= "<li>" . Agent::LASTMODIFIEDBYUID . ": " . $model->getlastmodifiedbyuid() . "</li>\n";
     $returnvalue .= "<div id='statusDiv'></div>";
     $returnvalue .= "<li><h3>Names</h3></li>";
     $am = new AgentManager();
     $returnvalue .= $am->getAgentNamesForAgent($model->getagentid());
     $returnvalue .= $am->getTeamMembersForAgent($model->getagentid());
     if ($includeRelated) {
         $t_Agent = new Agent();
         $t_AgentView = new AgentView();
         $t_AgentView->setModel($t_Agent);
         if ($model->getpreferredrecbyid() != '') {
             $dupof = "";
             $dup = new Agent();
             $dupid = $model->getpreferredrecbyid();
             $dup->load($model->getpreferredrecbyid());
             $dupof = $dup->getAssembledName(TRUE);
             $returnvalue .= "<li><h3>Bad Duplicate Of</h3> <a href='{$clientRoot}/agents/agent.php?agentid={$dupid}'>{$dupof}</a></li>";
         }
         $returnvalue .= $am->getBadDuplicatesForAgent($model->getagentid());
         $returnvalue .= $am->getNumberPatternsForAgent($model->getagentid());
         $returnvalue .= $am->getLinksForAgent($model->getagentid());
         $returnvalue .= $am->getRelationsForAgent($model->getagentid());
         $returnvalue .= $am->getTeamMembershipForAgent($model->getagentid());
     }
     $returnvalue .= '</ul>';
     return $returnvalue;
 }