Skip to content

Commit

Permalink
Merge branch 'Development' into change-innertext-width-search-index
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaSalikov authored May 15, 2024
2 parents d00f8ed + 065ae1e commit 90fb6f0
Show file tree
Hide file tree
Showing 296 changed files with 880 additions and 630 deletions.
2 changes: 1 addition & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayLeftMenu = true;
include($SERVER_ROOT.'/includes/header.php');
?>
<div id="innertext">
<div role="main" id="innertext">
<h1><?php echo $LANG['FORBIDDEN']; ?></h1>
<div style="font-weight:bold;">
<?php echo $LANG['NO_PERMISSION']; ?>
Expand Down
2 changes: 1 addition & 1 deletion admin/portalindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function validateHandshakeForm(f){
<a href="../../index.php">Home</a> &gt;&gt;
<b><a href="portalindex.php">Portal Index Control Panel</a></b>
</div>
<div id="innertext">
<div role="main" id="innertext">
<?php
if(!isset($GLOBALS['ACTIVATE_PORTAL_INDEX'])){
echo 'This feature has not yet been activated within this portal';
Expand Down
2 changes: 1 addition & 1 deletion admin/schemamanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<?php
include($SERVER_ROOT.'/includes/header.php');
?>
<div id="innertext">
<div role="main" id="innertext">
<h1>Database Schema Manager</h1>
<?php
if($IS_ADMIN || !$curentVersion){
Expand Down
2 changes: 1 addition & 1 deletion agents/rpc/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
include($SERVER_ROOT.'/includes/header.php');
?>
<!-- This is inner text! -->
<div id="innertext">
<div role="main" id="innertext">
<h1 class="page-heading">Forbidden</h1>
<div style="font-weight:bold;">
You don't have permission to access this page.
Expand Down
5 changes: 3 additions & 2 deletions checklists/checklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function changeImageSource(elem){
}
?>
#editsppon { display: none; color:green; font-size: 70%; font-weight:bold; padding-bottom: 5px; position: relative; top: -4px; }
.moredetails{ clear: both }
.normal-font-weight {
font-weight: normal;
}
Expand Down Expand Up @@ -584,7 +585,7 @@ function changeImageSource(elem){
?>
</div>
</div>
<hr />
<hr style="margin-right: 2rem"/>
<div class="printoff">
<?php
$taxaLimit = ($showImages?$clManager->getImageLimit():$clManager->getTaxaLimit());
Expand All @@ -610,7 +611,7 @@ function changeImageSource(elem){
}
?>
</div>
<hr />
<hr style="margin-right: 2rem"/>
<?php
if($showImages){
$prevfam = '';
Expand Down
4 changes: 2 additions & 2 deletions checklists/checklistadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function validateAddProjectForm(f){
<div style="margin:15px;">
<form name="deleteclform" action="checklistadmin.php" method="post" onsubmit="return window.confirm('<?php echo $LANG['CONFIRMDELETE'];?>')">
<input name="delclid" type="hidden" value="<?php echo $clid; ?>" />
<button name="submitaction" type="submit" value="deleteChecklist" aria-label="<?php echo $LANG['DELETECHECK'];?>" <?php if($projArr || count($editorArr) > 1) echo 'DISABLED'; ?>><?php echo $LANG['DELETECHECK'];?></button>
<button class="button-danger" name="submitaction" type="submit" value="deleteChecklist" aria-label="<?php echo $LANG['DELETECHECK'];?>" <?php if($projArr || count($editorArr) > 1) echo 'DISABLED'; ?>><?php echo $LANG['DELETECHECK'];?></button>
</form>
</div>
</div>
Expand Down Expand Up @@ -392,4 +392,4 @@ function validateAddProjectForm(f){
include($SERVER_ROOT.'/includes/footer.php');
?>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion checklists/checklistadminchildren.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function validateAddChildForm(f){
button{ margin:20px; }
</style>
<!-- inner text -->
<div id="innertext" style="background-color:white;">
<div role="main" id="innertext" style="background-color:white;">
<div style="float:right;">
<a href="#" onclick="toggle('addchilddiv')"><img src="../images/add.png" style="width:1.5em;" /></a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions checklists/checklistadminmeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function enableDisableExtServiceFields() {
<?php echo $LANG['POLYGON_NOT_DEFINED']; ?>
</span>
<span style="margin:10px;"><a href="#" onclick="openMappingPolyAid();return false;" title="<?php echo $LANG['CREATE_EDIT_POLYGON']; ?>"><img src="../images/world.png" style="width:1em;" /></a></span>
<input type="hidden" id="footprintwkt" name="footprintwkt" value="" />
<input type="hidden" id="footprintwkt" name="footprintwkt" value="<?= $clArray['footprintwkt']?>" />
</fieldset>
</div>
<div style="clear:both;margin-top:5px;">
Expand Down Expand Up @@ -318,7 +318,7 @@ function enableDisableExtServiceFields() {
<?php
// Activate Identification key: 0 = false, 1 = true
$activateKey = $KEY_MOD_IS_ACTIVE;
if(array_key_exists('activatekey', $defaultArr)) $activateKey = $defaultArr["activatekey"];
if(array_key_exists('activatekey', $defaultArr??[])) $activateKey = $defaultArr["activatekey"];
?>
<input name='activatekey' type='checkbox' value='1' <?php echo ($activateKey?"checked":""); ?> />
<?php echo $LANG['ACTIVATEKEY']; ?>
Expand Down Expand Up @@ -420,4 +420,4 @@ function enableDisableExtServiceFields() {
}
}
?>
</div>
</div>
4 changes: 2 additions & 2 deletions checklists/clsppeditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function removeTaxon(){
<input type="hidden" name='clid' value="<?php echo $vManager->getClid(); ?>" />
<input type="hidden" name='cltype' value="<?php echo $clArray['cltype']; ?>" />
<input type="hidden" name='locality' value="<?php echo $clArray['locality']; ?>" />
<button type="submit" name="action" value="deleteTaxon"><?php echo $LANG['DELETE_TAXON']; ?></button>
<button class="button-danger" type="submit" name="action" value="deleteTaxon"><?php echo $LANG['DELETE_TAXON']; ?></button>
</fieldset>
</form>
</div>
Expand Down Expand Up @@ -363,4 +363,4 @@ function removeTaxon(){
?>
</div>
</body>
</html>
</html>
6 changes: 4 additions & 2 deletions checklists/imgvouchertab.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
<input type="hidden" name="clid" value="<?php echo $clid; ?>" />
</div>
<div style="margin:5px;">
<input type="submit" name="submitvoucher" value=<?php echo $LANG['ADDIMGVOUC'];?> /><br/>
<button type="submit" name="submitvoucher">
<?php echo $LANG['ADDIMGVOUC'];?>
</button>
</div>
</fieldset>
</form>
</div>
</div>
2 changes: 1 addition & 1 deletion checklists/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<a href="../index.php"><?php echo htmlspecialchars($LANG['NAV_HOME'], ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); ?></a> &gt;&gt;
<b><?php echo $LANG['SPECIES_INVENTORIES']; ?></b>
</div>
<div id="innertext">
<div role="main" id="innertext">
<h1 class="page-heading"><?= $LANG['SPECIES_INVENTORIES']; ?></h1>
<div style="margin:20px;">
<?php
Expand Down
2 changes: 1 addition & 1 deletion checklists/rpc/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
include($SERVER_ROOT.'/includes/header.php');
?>
<!-- This is inner text! -->
<div id="innertext">
<div role="main" id="innertext">
<h1> <?php echo $LANG['FORBIDDEN']; ?> </h1>
<div style="font-weight:bold;">
<?php echo $LANG['NO_PERMISSION']; ?>
Expand Down
2 changes: 1 addition & 1 deletion checklists/tools/checklistloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function displayErrors(clickObj){
<a href="checklistloader.php?clid=<?php echo htmlspecialchars($clid, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE) . '&pid=' . htmlspecialchars($pid, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); ?>"><b><?php echo $LANG['CHECK_LOADER']; ?></b></a>
</div>
<!-- This is inner text! -->
<div id="innertext">
<div role="main" id="innertext">
<h1>
<a href="<?php echo $CLIENT_ROOT."/checklists/checklist.php?clid=" . htmlspecialchars($clid, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE) . '&pid=' . htmlspecialchars($pid, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); ?>">
<?php echo $clMeta['name']; ?>
Expand Down
2 changes: 1 addition & 1 deletion checklists/tools/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
include($SERVER_ROOT.'/includes/header.php');
?>
<!-- This is inner text! -->
<div id="innertext">
<div role="main" id="innertext">
<h1 class="page-heading">Checklist Tools</h1>
<h1 class="page-heading">Forbidden</h1>
<div style="font-weight:bold;">
Expand Down
18 changes: 14 additions & 4 deletions checklists/tools/mappolyaid.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
//Default is that trim is checked and lnglat/switchCoord is not
let trimPolyFlag = true;
let lnglatLayoutFlag = false;
let action = "<?= htmlspecialchars($formSubmit) ?>"
if(action === 'exit') {
window.close();
}

function onPolyUpdate(shape) {
setWkt(map.shapes);
Expand Down Expand Up @@ -215,8 +219,11 @@ function initialize() {
let polygons;

//Loads wkt from opener value otherwise db value is used
let wkt = opener.document.getElementById("footprintwkt").value;
if(wkt) document.getElementById("footprintwkt").value = wkt;
let parent_wkt = opener.document.getElementById("footprintwkt");
console.log(parent_wkt)
if(parent_wkt) {
document.getElementById("footprintwkt").value = parent_wkt.value
}

if(<?= (!empty($GOOGLE_MAP_KEY)?'true':'false') ?>) {
googleInit();
Expand Down Expand Up @@ -262,8 +269,11 @@ function submitPolygonForm(f){
opener.document.getElementById("polyDefDiv").style.display = str1;
opener.document.getElementById("polyNotDefDiv").style.display = str2;
}
opener.document.getElementById("footprintwkt").value = f.footprintwkt.value;
window.close();
if(opener.document.getElementById("footprintwkt")) {
opener.document.getElementById("footprintwkt").value = f.footprintwkt.value;
// If Tool is filling out form value from parent form don't finish action on itself just forward value to parent form
window.close();
}
return f.clid.value != 0;
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion checklists/vaconflicts.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function validateBatchConflictForm(f){
f.submit();
}
</script>
<div id="innertext" style="background-color:white;">
<div role="main" id="innertext" style="background-color:white;">
<div style="margin-bottom:10px;">
<?php
echo $LANG['EXPLAIN_PARAGRAPH'];
Expand Down
2 changes: 1 addition & 1 deletion checklists/vamissingtaxa.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
elseif($displayMode==2) $missingArr = $vManager->getMissingProblemTaxa();
else $missingArr = $vManager->getMissingTaxa();
?>
<div id="innertext" style="background-color:white;">
<div role="main" id="innertext" style="background-color:white;">
<div style='float:left;font-weight:bold;margin-left:5px'>
<?php
if($displayMode == 2){
Expand Down
14 changes: 9 additions & 5 deletions checklists/voucheradmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<b><?php echo $LANG['LATN'];?>:</b>
<input id="upperlat" type="text" name="latnorth" style="width:80px;" value="<?php echo isset($termArr['latnorth'])?$termArr['latnorth']:''; ?>" title="<?php echo $LANG['LAT_NORTH'] ?>" />
<?php
$coordAidUrl = '../collections/tools/mapcoordaid.php?mapmode=rectangle&latdef='.$clMetaArr['latcentroid'].'&lngdef='.$clMetaArr['longcentroid'];
$coordAidUrl = '../collections/tools/mapcoordaid.php?map_mode_strict=true&mapmode=rectangle&latdef='.$clMetaArr['latcentroid'].'&lngdef='.$clMetaArr['longcentroid'];
?>
<a href="#" onclick="openPopup('<?php echo htmlspecialchars($coordAidUrl, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); ?>','boundingbox')"><img src="../images/world.png" style="width:1.2em" title="<?php echo $LANG['FIND_COORD'] ?>" /></a>
</div>
Expand Down Expand Up @@ -233,7 +233,9 @@
<tr>
<td colspan="2">
<div style="margin:10px;">
<input type="submit" name="submit" value="<?php echo $LANG['SAVESEARCH'];?>" />
<button type="submit">
<?php echo $LANG['SAVESEARCH'];?>
</button>
<input type="hidden" name="submitaction" value="SaveSearch" />
<input type='hidden' name='clid' value='<?php echo $clid; ?>' />
<input type='hidden' name='pid' value='<?php echo $pid; ?>' />
Expand All @@ -250,8 +252,10 @@
<legend><b><?php echo $LANG['REMOVESEARCH'];?></b></legend>
<form name="sqldeleteform" action="voucheradmin.php" method="post" onsubmit="return confirm('<?php echo $LANG['SURE_DELETE_QUERY'];?>');">
<div style="margin:20px">
<input type="submit" name="submit" value="<?php echo $LANG['DELETEVARIABLES'];?>" />
<input type="hidden" name="submitaction" value="DeleteVariables" />
<button class="button-danger" type="submit">
<?php echo $LANG['DELETEVARIABLES'];?>
</button>
<input type="hidden" name="submitaction" value="DeleteVariables" />
</div>
<input type="hidden" name="clid" value="<?php echo $clid; ?>" />
<input type="hidden" name="pid" value="<?php echo $pid; ?>" />
Expand Down Expand Up @@ -322,4 +326,4 @@
include($SERVER_ROOT.'/includes/footer.php');
?>
</body>
</html>
</html>
8 changes: 4 additions & 4 deletions classes/ChecklistAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function createChecklist($postArr){
//Add permissions to allow creater to be an editor and then reset user permissions stored in browser cache
$inventoryManager->insertUserRole($GLOBALS['SYMB_UID'], 'ClAdmin', 'fmchecklists', $newClid, $GLOBALS['SYMB_UID']);
$newPManager = new ProfileManager();
$newPManager->setUserName($GLOBALS['USERNAME']);
$newPManager->authenticate();
$newPManager->setUid($GLOBALS['SYMB_UID']);
$newPManager->setUserRights();
if($postArr['type'] == 'excludespp' && $postArr['excludeparent']){
//If is an exclusion checklists, link to parent checklist
if(!$inventoryManager->insertChildChecklist($postArr['excludeparent'], $newClid, $GLOBALS['SYMB_UID'])){
Expand Down Expand Up @@ -615,7 +615,7 @@ public function getClName(){

//Misc support functions
public function cleanOutArray($inputArray){
$skip = array('defaultsettings', 'dynamicsql', 'footprintWkt');
$skip = array('defaultsettings', 'dynamicsql', 'footprintwkt');
if(is_array($inputArray)){
foreach($inputArray as $key => $value){
if(is_array($value)){
Expand All @@ -631,4 +631,4 @@ public function cleanOutArray($inputArray){
return $inputArray;
}
}
?>
?>
1 change: 1 addition & 0 deletions classes/DwcArchiverBaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function writeOutRecordBlock($occidArr){
$this->writeOutRecord($r);
}
$rs->free();
fclose($this->fileHandler);
}
else{
$this->logOrEcho('ERROR writing out to extension file: '.$this->conn->error."\n");
Expand Down
4 changes: 2 additions & 2 deletions classes/DwcArchiverCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -1790,11 +1790,11 @@ private function writeOccurrenceFile(){
}
if ($this->includeAttributes){
$this->writeAttributeData($batchOccidArr);
if($this->attributeHandler !== null) $this->attributeHandler->__destruct();
if($this->attributeHandler !== null) $this->attributeHandler = null;
}
if ($this->includeMaterialSample){
$this->writeMaterialSampleData($batchOccidArr);
if($this->materialSampleHandler !== null) $this->materialSampleHandler->__destruct();
if($this->materialSampleHandler !== null) $this->materialSampleHandler = null;
}
}
else {
Expand Down
3 changes: 2 additions & 1 deletion classes/ImInventories.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function getChecklistMetadata($pid = null){
$retArr['defaultsettings'] = $row->defaultsettings;
$retArr['dynamicsql'] = $row->dynamicsql;
$retArr['hasfootprintwkt'] = ($row->footprintwkt?'1':'0');
$retArr['footprintwkt'] = $row->footprintwkt;
$retArr['sortsequence'] = $row->sortsequence;
$retArr['datelastmodified'] = $row->datelastmodified;
$retArr['dynamicProperties'] = $row->dynamicProperties;
Expand Down Expand Up @@ -695,4 +696,4 @@ public function getPrimaryKey(){
return $this->primaryKey;
}
}
?>
?>
4 changes: 2 additions & 2 deletions classes/ImageLibrarySearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function getDbStr(){
}

public function setCollectionVariables($reqArr){
$this->dbStr = trim(OccurrenceSearchSupport::getDbRequestVariable(), '; ');
$this->dbStr = trim(OccurrenceSearchSupport::getDbRequestVariable(), ',; ');
}

public function setTaxonType($t){
Expand Down Expand Up @@ -448,4 +448,4 @@ public function getErrorStr(){
return $this->errorStr;
}
}
?>
?>
2 changes: 1 addition & 1 deletion classes/OccurrenceMapManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ public function getObservationIds(){

//Misc support functions
private function htmlEntities($string){
return htmlspecialchars($string, ENT_XML1 | ENT_QUOTES, 'UTF-8');
return htmlspecialchars($string ?? '', ENT_XML1 | ENT_QUOTES, 'UTF-8');
}
}
?>
12 changes: 3 additions & 9 deletions classes/OccurrenceSearchSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,10 @@ public static function getDbWhereFrag($dbSearchTerm){
}
elseif($dbSearchTerm == 'allobs'){
$sqlRet .= 'AND (o.collid IN(SELECT collid FROM omcollections WHERE colltype IN("General Observations","Observations"))) ';
}
else{
} else {
// Check in case there is ; inside dbSearchTerm
$dbArr = explode(';',$dbSearchTerm);
$dbStr = '';
if(isset($dbArr[0]) && $dbArr[0]){
$dbStr = "(o.collid IN(".$dbArr[0].")) ";
}
if(isset($dbArr[1]) && $dbArr[1]){
//$dbStr .= ($dbStr?'OR ':'').'(o.CollID IN(SELECT collid FROM omcollcatlink WHERE (ccpk IN('.$dbArr[1].')))) ';
}
$dbStr = "o.collid IN(" . (is_array($dbArr)? implode(',', $dbArr): $dbArr) . ")";
$sqlRet .= 'AND ('.$dbStr.') ';
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/ProfileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ public function loginExists($login){
return $status;
}

protected function setUserRights(){
public function setUserRights(){
if($this->uid){
$userRights = array();
$sql = 'SELECT role, tablepk FROM userroles WHERE (uid = ?) ';
Expand Down
Loading

0 comments on commit 90fb6f0

Please sign in to comment.