Commit f2d9d6e0 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Report.php: Fixed double && in building UrlParam

FormAction.php: In case of 'AFTER_DELETE', do not try to load primary record - that one is already deleted.
Sip.php: Do not skip SIP_TARGET_URL as parameter for the SIP.
parent 66e0de3a
......@@ -82,9 +82,14 @@ class FormAction {
// Preparation for Log, Debug
$this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($fe), STORE_SYSTEM);
if ($fe[FE_TYPE] !== FE_TYPE_BEFORE_LOAD && $fe[FE_TYPE] !== FE_TYPE_AFTER_LOAD) {
// Always work on recent data: previous actions might have modified the data.
$this->fillStoreRecord($this->primaryTableName, $recordId);
switch ($fe[FE_TYPE]) {
case FE_TYPE_BEFORE_LOAD:
case FE_TYPE_AFTER_LOAD:
case FE_TYPE_AFTER_DELETE: # Main record is already deleted. Do not try to load it again.
break;
default:
// Always work on recent data: previous actions might have modified the data.
$this->fillStoreRecord($this->primaryTableName, $recordId);
}
if (!$this->checkRequiredList($fe)) {
......@@ -127,6 +132,8 @@ class FormAction {
}
/**
* Copy the current primary record to STORE_RECORD
*
* @param $table
* @param $recordId
* @throws CodeException
......
......@@ -943,7 +943,7 @@ class Report {
$kvp = new KeyValueStringParser();
// Split in: [p => 'delete&r=100&table=note&..', 'D' => ''... ],
// Split in: [p => 'delete&r=100&_table=note&..', 'D' => ''... ],
$param = $kvp->parse($columnValue, ':', '|');
// decode TOKEN_PAGE and fill TOKEN_URL_PARAM with it
......@@ -960,11 +960,11 @@ class Report {
// Concat already existing $param[TOKEN_URL_PARAM] with additional from TOKEN_PAE
Support::setIfNotSet($param, TOKEN_URL_PARAM);
if($param[TOKEN_URL_PARAM]!=='') {
$param[TOKEN_URL_PARAM] .= '&';
}
if(count($args)>0) {
if ($param[TOKEN_URL_PARAM] !== '') {
$param[TOKEN_URL_PARAM] .= '&';
}
$param[TOKEN_URL_PARAM] .= $kvp->unparse($args, '=', '&');
}
......
......@@ -182,7 +182,8 @@ class Sip {
}
/**
* Takes the values form an array and creates a urlparamstring. Skip values which should no passed to the urlparamstring.
* Takes the values form an array and creates a urlparamstring. Skip values which should not passed to the urlparamstring.
* - SIP_TARGET_URL is necessary for 'delete' links (via 'report') - may be unessary in other situations
*
* @param array $sipArray
* @return string
......@@ -193,10 +194,11 @@ class Sip {
foreach ($sipArray as $key => $value) {
switch ($key) {
case SIP_SIP:
case SIP_TARGET_URL:
// case SIP_MODE_ANSWER:
// case SIP_TABLE:
case SIP_URLPARAM:
break;
case SIP_TARGET_URL: // Do not skip this param. Necessary for delete links (via 'report') - specifies the target where to jump after delete,php has been called via AJAX
break;
default:
$tmpArray[$key] = $value;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment