Commit 9040de60 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Exception: UserException renamed to UserFormException. New Class UserReportException created.

parent 038400fe
......@@ -21,7 +21,7 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
$qfq = new \qfq\QuickFormQuery($contentObject->data);
$html = $qfq->process();
} catch (qfq\UserException $e) {
} catch (qfq\UserFormException $e) {
$html = $e->formatMessage();
} catch (qfq\CodeException $e) {
$html = $e->formatMessage();
......
......@@ -60,7 +60,7 @@ try {
$answer[API_REDIRECT] = API_ANSWER_REDIRECT_CLIENT;
$answer[API_STATUS] = API_ANSWER_STATUS_SUCCESS;
} catch (qfq\UserException $e) {
} catch (qfq\UserFormException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
} catch (qfq\CodeException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
......
......@@ -66,7 +66,7 @@ try {
$answer[API_MESSAGE] = 'load: success';
$answer[API_FORM_UPDATE] = $data;
} catch (qfq\UserException $e) {
} catch (qfq\UserFormException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
$val = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM);
......
......@@ -64,7 +64,7 @@ try {
$answer[API_STATUS] = API_ANSWER_STATUS_SUCCESS;
$answer[API_MESSAGE] = 'save: success';
} catch (qfq\UserException $e) {
} catch (qfq\UserFormException $e) {
$answer[API_MESSAGE] = $e->formatMessage();
$val = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM);
......
......@@ -9,7 +9,7 @@ namespace qfq;
use qfq;
use qfq\Store;
use qfq\UserException;
use qfq\UserFormException;
use qfq\OnArray;
require_once(__DIR__ . '/../qfq/store/Store.php');
......@@ -116,7 +116,7 @@ abstract class AbstractBuildForm {
* @return string|array $mode=LOAD_FORM: The whole form as HTML, $mode=FORM_UPDATE: array of all formElement.dynamicUpdate-yes values/states
* @throws CodeException
* @throws DbException
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
public function process($mode) {
$htmlHead = '';
......@@ -297,7 +297,7 @@ abstract class AbstractBuildForm {
* @return string
* @throws CodeException
* @throws DbException
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
public function elements($recordId, $filter = FORM_ELEMENTS_NATIVE, $feIdContainer = 0, &$json) {
$html = '';
......@@ -375,7 +375,7 @@ abstract class AbstractBuildForm {
* Takes the current SIP ('form' and additional parameter), set SIP_RECORD_ID=0 and create a new 'NewRecordUrl'.
*
* @throws CodeException
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
public function deriveNewRecordUrlFromExistingSip(&$toolTipNew) {
$urlParam = $this->store->getStore(STORE_SIP);
......@@ -426,7 +426,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId
* @param $value
* @return string
* @throws UserException
* @throws UserFormException
*/
public function buildInput(array $formElement, $htmlFormElementId, $value, &$json) {
$textarea = '';
......@@ -547,7 +547,7 @@ abstract class AbstractBuildForm {
* @param $type
* @param $data
* @return string
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
private function getInputCheckPattern($type, $data) {
$attribute = '';
......@@ -561,7 +561,7 @@ abstract class AbstractBuildForm {
case SANITIZE_ALLOW_MIN_MAX_DATE:
$arrData = explode("|", $data);
if (count($arrData) != 2 || $arrData[0] == '' || $arrData[1] == '')
throw new UserException("Missing MIN|MAX values", ERROR_MISSING_MIN_MAX);
throw new UserFormException("Missing MIN|MAX values", ERROR_MISSING_MIN_MAX);
$attribute = 'min="' . $arrData[0] . '" ';
$attribute .= 'max="' . $arrData[1] . '" ';
......@@ -587,7 +587,7 @@ abstract class AbstractBuildForm {
*
* @param array $formElement
* @return string
* @throws UserException
* @throws UserFormException
*/
private function getAttributeMode(array $formElement) {
$attribute = '';
......@@ -609,7 +609,7 @@ abstract class AbstractBuildForm {
default:
$this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM);
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'mode', STORE_SYSTEM);
throw new UserException("Unknown mode '" . $formElement['mode'] . "'", ERROR_UNKNOWN_MODE);
throw new UserFormException("Unknown mode '" . $formElement['mode'] . "'", ERROR_UNKNOWN_MODE);
break;
}
return $attribute;
......@@ -645,7 +645,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId
* @param $value
* @return string
* @throws UserException
* @throws UserFormException
*/
public function buildCheckbox(array $formElement, $htmlFormElementId, $value, &$json) {
$itemKey = array();
......@@ -678,7 +678,7 @@ abstract class AbstractBuildForm {
$html = $this->buildCheckboxMulti($formElement, $htmlFormElementId, $attributeBase, $value, $itemKey, $itemValue);
break;
default:
throw new UserException('checkBoxMode: \'' . $formElement['checkBoxMode'] . '\' is unknown.', ERROR_CHECKBOXMODE_UNKNOWN);
throw new UserFormException('checkBoxMode: \'' . $formElement['checkBoxMode'] . '\' is unknown.', ERROR_CHECKBOXMODE_UNKNOWN);
}
$json = $this->getJsonElementUpdate($htmlFormElementId, $value, $formElement['mode']);
......@@ -699,7 +699,7 @@ abstract class AbstractBuildForm {
* @param $itemKey
* @param $itemValue
* @throws CodeException
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
public function getKeyValueListFromSqlEnumSpec(array $formElement, &$itemKey, &$itemValue) {
$fieldType = '';
......@@ -735,7 +735,7 @@ abstract class AbstractBuildForm {
} elseif ($fieldType === 'enum' || $fieldType === 'set') {
// already done at the beginning with '$this->getItemsForEnumOrSet($formElement['name'], $fieldType);'
} else {
throw new UserException("Missing definition (- nothing found in 'sql1', 'parameter:itemValues', 'enum-' or 'set-definition'", ERROR_MISSING_ITEM_VALUES);
throw new UserFormException("Missing definition (- nothing found in 'sql1', 'parameter:itemValues', 'enum-' or 'set-definition'", ERROR_MISSING_ITEM_VALUES);
}
if (count($itemKey) === 0) {
......@@ -767,7 +767,7 @@ abstract class AbstractBuildForm {
* @param $column
* @param $fieldType
* @return array
* @throws UserException
* @throws UserFormException
*/
private function getItemsForEnumOrSet($column, &$fieldType) {
......@@ -775,7 +775,7 @@ abstract class AbstractBuildForm {
$fieldTypeDefinition = $this->store->getVar($column, STORE_TABLE_COLUMN_TYPES);
if ($fieldTypeDefinition === false) {
throw new UserException("Column '$column' unknown in table '" . $this->formSpec['tableName'] . "'", ERROR_DB_UNKNOWN_COLUMN);
throw new UserFormException("Column '$column' unknown in table '" . $this->formSpec['tableName'] . "'", ERROR_DB_UNKNOWN_COLUMN);
}
$length = strlen($fieldTypeDefinition);
......@@ -809,7 +809,7 @@ abstract class AbstractBuildForm {
*
* @param array $itemKey
* @param array $formElement
* @throws UserException
* @throws UserFormException
*/
private function prepareCheckboxCheckedUncheckedValue(array $itemKey, array &$formElement) {
......@@ -833,7 +833,7 @@ abstract class AbstractBuildForm {
}
if ($formElement[CHECKBOX_VALUE_CHECKED] === $formElement[CHECKBOX_VALUE_UNCHECKED]) {
throw new UserException('FormElement: type=checkbox - checked and unchecked can\'t be the same: ' . $formElement[CHECKBOX_VALUE_CHECKED], ERROR_CHECKBOX_EQUAL);
throw new UserFormException('FormElement: type=checkbox - checked and unchecked can\'t be the same: ' . $formElement[CHECKBOX_VALUE_CHECKED], ERROR_CHECKBOX_EQUAL);
}
}
......@@ -973,7 +973,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId
* @param $value
* @return string
* @throws UserException
* @throws UserFormException
*/
public function buildRadio(array $formElement, $htmlFormElementId, $value, &$json) {
$itemKey = array();
......@@ -1086,7 +1086,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId
* @param $value
* @return string
* @throws UserException
* @throws UserFormException
*/
public function buildSubrecord(array $formElement, $htmlFormElementId, $value, &$json) {
$rcText = false;
......@@ -1161,7 +1161,7 @@ abstract class AbstractBuildForm {
* @param $rcText
* @param $nameColumnId
* @return bool
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
private function prepareSubrecod(array $formElement, array $primaryRecord, &$rcText, &$nameColumnId) {
......@@ -1171,7 +1171,7 @@ abstract class AbstractBuildForm {
}
if (!is_array($formElement['sql1'])) {
throw new UserException('Missing \'sql1\' Query', ERROR_MISSING_SQL1);
throw new UserFormException('Missing \'sql1\' Query', ERROR_MISSING_SQL1);
}
// No records?
......@@ -1184,7 +1184,7 @@ abstract class AbstractBuildForm {
$nameColumnId = '_id';
if (!isset($formElement['sql1'][0][$nameColumnId])) {
throw new UserException('Missing column \'id\' (or "@_id") in \'sql1\' Query', ERROR_DB_MISSING_COLUMN_ID);
throw new UserFormException('Missing column \'id\' (or "@_id") in \'sql1\' Query', ERROR_DB_MISSING_COLUMN_ID);
}
return true;
......@@ -1208,7 +1208,7 @@ abstract class AbstractBuildForm {
* @param $targetRecordId
* @param $record
* @return string
* @throws UserException
* @throws UserFormException
*/
private function createFormLink(array $formElement, $targetRecordId, array $record, $symbol, $toolTip) {
......@@ -1286,7 +1286,7 @@ abstract class AbstractBuildForm {
*
* @param $titleRaw
* @return array
* @throws UserException
* @throws UserFormException
*/
private function getSubrecordColumnControl(array $titleRaw) {
$control = array();
......@@ -1396,7 +1396,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId
* @param $value
* @return string
* @throws UserException
* @throws UserFormException
*/
public function buildFile(array $formElement, $htmlFormElementId, $value, &$json) {
......@@ -1417,11 +1417,11 @@ abstract class AbstractBuildForm {
* @param array $formElement
* @param $htmlFormElementId
* @param $value
* @throws UserException
* @throws UserFormException
*/
public function buildDateJQW(array $formElement, $htmlFormElementId, $value) {
// TODO: implement
throw new UserException("Not implemented yet: buildDateJQW()", ERROR_NOT_IMPLEMENTED);
throw new UserFormException("Not implemented yet: buildDateJQW()", ERROR_NOT_IMPLEMENTED);
}
/**
......@@ -1430,11 +1430,11 @@ abstract class AbstractBuildForm {
* @param array $formElement
* @param $htmlFormElementId
* @param $value
* @throws UserException
* @throws UserFormException
*/
public function buildGridJQW(array $formElement, $htmlFormElementId, $value) {
// TODO: implement
throw new UserException("Not implemented yet: buildGridJQW()", ERROR_NOT_IMPLEMENTED);
throw new UserFormException("Not implemented yet: buildGridJQW()", ERROR_NOT_IMPLEMENTED);
}
/**
......
......@@ -90,7 +90,7 @@ class BodytextParser {
/**
* @param $bodytext
* @return mixed|string
* @throws UserException
* @throws UserFormException
*/
private function unNest($bodytext) {
// Replace '\{' | '\}' by internal token. All remaining '}' | '{' means: 'nested'
......@@ -106,7 +106,7 @@ class BodytextParser {
$posMatchOpen = strrpos(substr($result, 0, $posFirstClose), '{');
if ($posMatchOpen === false) {
throw new \qfq\UserException("Missing open delimiter: $result", ERROR_MISSING_OPEN_DELIMITER);
throw new \qfq\UserFormException("Missing open delimiter: $result", ERROR_MISSING_OPEN_DELIMITER);
}
$pre = substr($result, 0, $posMatchOpen);
......
......@@ -9,7 +9,7 @@
namespace qfq;
use qfq;
use qfq\UserException;
use qfq\UserFormException;
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/helper/OnArray.php');
......@@ -180,7 +180,7 @@ BUTTON;
/**
* @param $pillArray
* @return string
* @throws UserException
* @throws UserFormException
*/
private function buildPillNavigation($pillArray) {
$pillButton = '';
......@@ -201,7 +201,7 @@ BUTTON;
if ($formElement['name'] === '' || $formElement['label'] === '') {
$this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM);
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'name, label', STORE_SYSTEM);
throw new UserException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY);
throw new UserFormException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY);
}
// Anker for pill navigation
......
......@@ -238,6 +238,9 @@ const SYSTEM_FORM = CLIENT_FORM; // '<formName> / <formId
const SYSTEM_FORM_ELEMENT = 'formElement'; // '<formElementName> / <formElementeId>'
const SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>'
const SYSTEM_REPORT_COLUMN_KEY = 'reportColumnKey'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_VALUE = 'reportColumnValue'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_FULL_LEVEL = 'reportFullLevel'; // Keyname of SQL-column processed at the moment.
// die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen gloable Vars benutzt.
//const SYSTEM_FORM_DEF = 'formDefinition'; // Type: SANITIZE_ALNUMX / AssocArray. Final form to process. Useful for error reporting.
......
......@@ -11,7 +11,7 @@ namespace qfq;
use qfq;
use qfq\CodeException;
use qfq\DbException;
use qfq\UserException;
use qfq\UserFormException;
use qfq\Support;
use qfq\Store;
......@@ -60,7 +60,7 @@ class Database {
* If not exists: open database and store the new dbh in Store[System][SYSTEM_DBH]
*
* @throws CodeException
* @throws UserException
* @throws UserFormException
*/
public function __construct() {
$this->store = Store::getInstance();
......@@ -76,7 +76,7 @@ class Database {
* Open mysqli database connection if not already done.
*
* @return \mysqli
* @throws UserException
* @throws UserFormException
*/
private function dbConnect() {
$mysqli = null;
......@@ -89,7 +89,7 @@ class Database {
$mysqli = new \mysqli($dbserver, $dbuser, $dbpw, $db);
if ($mysqli->connect_error) {
throw new UserException ("Error open Database 'mysql:host=" . $dbserver . ";dbname=" . $db . ";dbuser=" . $dbuser . "'': " . $mysqli->connect_errno . PHP_EOL . $mysqli->connect_error, ERROR_DB_OPEN);
throw new UserFormException ("Error open Database 'mysql:host=" . $dbserver . ";dbname=" . $db . ";dbuser=" . $dbuser . "'': " . $mysqli->connect_errno . PHP_EOL . $mysqli->connect_error, ERROR_DB_OPEN);
}
return $mysqli;
......@@ -117,7 +117,7 @@ class Database {
* @param string $table name of the table
* @param string $columnName name of the column
*
* @throws UserException if the table or column does not exist, or is not of type ENUM or SET
* @throws UserFormException if the table or column does not exist, or is not of type ENUM or SET
* @return array
*/
public function getEnumSetValueList($table, $columnName) {
......@@ -296,7 +296,7 @@ class Database {
* @return int|mixed
* @throws \qfq\CodeException
* @throws \qfq\DbException
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
private function prepareExecute($sql, array $parameterArray = array()) {
$result = 0;
......@@ -364,7 +364,7 @@ class Database {
* @param $sql
* @param array $parameterArray
* @return string
* @throws \qfq\UserException
* @throws \qfq\UserFormException
*/
private function dbLog($sql, $parameterArray = array()) {
......@@ -380,7 +380,7 @@ class Database {
// nothing to log.
return;
default:
throw new UserException("Unknown SQL_LOG_MODE: $mode", ERROR_UNKNOWN_SQL_LOG_MODE);
throw new UserFormException("Unknown SQL_LOG_MODE: $mode", ERROR_UNKNOWN_SQL_LOG_MODE);
}
$msg = '[' . date('Y.m.d H:i:s O') . '][';
......
......@@ -67,13 +67,13 @@ class Evaluate {
* @param $line
* @param int $recursion
* @return array|mixed|null|string
* @throws UserException
* @throws UserFormException
*/
public function parse($line, $recursion = 0, &$debugStack = array(), &$foundInStore = '') {
$flagTokenReplaced = false;
if ($recursion > 4) {
throw new qfq\UserException("Recursion too deep ($recursion). Line: $line", ERROR_RECURSION_TOO_DEEP);
throw new qfq\UserFormException("Recursion too deep ($recursion). Line: $line", ERROR_RECURSION_TOO_DEEP);
}
$result = $line;
......@@ -88,7 +88,7 @@ class Evaluate {
$posMatchOpen = strrpos(substr($result, 0, $posFirstClose), $this->startDelimiter);
if ($posMatchOpen === false) {
throw new \qfq\UserException("Missing open delimiter: $result", ERROR_MISSING_OPEN_DELIMITER);
throw new \qfq\UserFormException("Missing open delimiter: $result", ERROR_MISSING_OPEN_DELIMITER);
}
$pre = substr($result, 0, $posMatchOpen);
......
......@@ -177,7 +177,7 @@ class QuickFormQuery {
*
* @return string
* @throws CodeException
* @throws UserException
* @throws UserFormException
*/
private function doForm($mode) {
$data = '';
......@@ -244,7 +244,7 @@ class QuickFormQuery {
* @return bool|string if found the formName, else 'false'.
* @throws CodeException
* @throws DbException
* @throws UserException
* @throws UserFormException
*/
private function loadFormSpecification($mode, &$foundInStore = '') {
......@@ -314,7 +314,7 @@ class QuickFormQuery {
* @param string $foundInStore
* @return array|bool|mixed|null|string Formname (Form.name) or FALSE, if no formname found.
* @throws CodeException
* @throws UserException
* @throws UserFormException
*/
private function getFormName($mode, &$foundInStore = '') {
$dummy = array();
......@@ -353,7 +353,7 @@ class QuickFormQuery {
* @param $formNameFoundInStore
* @return bool 'true' if SIP exists, else 'false'
* @throws CodeException
* @throws UserException
* @throws UserFormException
* @internal param $foundInStore
*/
private function validateForm($formNameFoundInStore) {
......@@ -370,37 +370,37 @@ class QuickFormQuery {
if ($sipFound) {
if (($formNameFoundInStore === STORE_CLIENT) || ($recordIdFoundInStore === STORE_CLIENT)) {
throw new UserException("SIP exist but FORM or RECORD_ID are given by CLIENT.", ERROR_SIP_EXIST_BUT_OTHER_PARAM_GIVEN_BY_CLIENT);
throw new UserFormException("SIP exist but FORM or RECORD_ID are given by CLIENT.", ERROR_SIP_EXIST_BUT_OTHER_PARAM_GIVEN_BY_CLIENT);
}
}
switch ($permitMode) {
case FORM_PERMISSION_SIP:
if (!$sipFound || $formNameFoundInStore !== STORE_SIP || $recordIdFoundInStore !== STORE_SIP) {
throw new UserException("SIP Parameter needed for this form.", ERROR_SIP_NEEDED_FOR_THIS_FORM);
throw new UserFormException("SIP Parameter needed for this form.", ERROR_SIP_NEEDED_FOR_THIS_FORM);
}
break;
case FORM_PERMISSION_LOGGED_IN:
if (!$feUserLoggedIn) {
throw new UserException("User not logged in.", ERROR_USER_NOT_LOGGED_IN);
throw new UserFormException("User not logged in.", ERROR_USER_NOT_LOGGED_IN);
}
break;
case FORM_PERMISSION_LOGGED_OUT:
if ($feUserLoggedIn) {
throw new UserException("User logged in.", ERROR_USER_LOGGED_IN);
throw new UserFormException("User logged in.", ERROR_USER_LOGGED_IN);
}
break;
case FORM_PERMISSION_ALWAYS:
break;
case FORM_PERMISSION_NEVER:
throw new UserException("Loading form forbidden.", ERROR_FORM_FORBIDDEN);
throw new UserFormException("Loading form forbidden.", ERROR_FORM_FORBIDDEN);
default:
throw new CodeException("Unknown permission mode: '" . $permitMode . "'", ERROR_FORM_UNKNOWN_PERMISSION_MODE);
}
// Form Definition valid?
if ($this->formSpec['multiMode'] !== 'none' && $this->formSpec['multiSql'] === '') {
throw new UserException("MultiMode selected, but MultiSQL missing", ERROR_MULTI_SQL_MISSING);
throw new UserFormException("MultiMode selected, but MultiSQL missing", ERROR_MULTI_SQL_MISSING);
}
return $sipFound;
......@@ -450,7 +450,7 @@ class QuickFormQuery {
*
* @throws CodeException
* @throws DbException
* @throws UserException
* @throws UserFormException
*/
public function delete() {
......@@ -461,7 +461,7 @@ class QuickFormQuery {
$table = $this->store->getVar(SIP_TABLE, STORE_SIP);
if ($recordId === false || $recordId < 1 || $table === false || $table === '') {
throw new UserException("Invalid or missing parameter: recordId=$recordId, table=$table", ERROR_INVALID_OR_MISSING_PARAMETER);
throw new UserFormException("Invalid or missing parameter: recordId=$recordId, table=$table", ERROR_INVALID_OR_MISSING_PARAMETER);
}
$this->db->sql("DELETE FROM $table WHERE id = ? LIMIT 1", ROW_REGULAR, [$recordId]);
......
......@@ -49,7 +49,7 @@ class Save {
*
* @throws CodeException
* @throws DbException
* @throws UserException
* @throws UserFormException
*/
public function process() {
......@@ -70,7 +70,7 @@ class Save {
* @return string
* @throws CodeException
* @throws DbException
* @throws UserException
* @throws UserFormException
*/
public function elements($recordId) {
......
......@@ -12,20 +12,20 @@ namespace qfq;
require_once(__DIR__ . '/AbstractException.php');
/**
* Class UserException
* Class UserFormException
*
* Thrown by Form or FormElement on User errors
*
* @package qfq\exceptions
*/
class UserException extends AbstractException {
class UserFormException extends AbstractException {
/*
* @return string HTML formatted error string
*/
public function formatMessage() {
$this->messageArray['Type'] = 'User Exception';
$this->messageArray['Type'] = 'User Form Exception';
$this->messageArray['Form'] = Store::getVar(SYSTEM_FORM, STORE_SYSTEM);
$this->messageArray['Form Element'] = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM);
$this->messageArray['Form Element Column'] = Store::getVar(SYSTEM_FORM_ELEMENT_COLUMN, STORE_SYSTEM);
......
<?php
/**
* Created by PhpStorm.
* User: crose
* Date: 4/1/16
* Time: 11:28 PM
*/
namespace qfq;
require_once(__DIR__ . '/AbstractException.php');
/**
* Class UserReportException
*
* Thrown by Report on User errors
*
* @package qfq\exceptions
*/
class UserFormException extends AbstractException {
/*
* @return string HTML formatted error string
*/
public function formatMessage() {
$this->messageArray['Type'] = 'User Report Exception';
$this->messageArray['SqlRaw'] = Store::getVar(SYSTEM_FORM, STORE_SYSTEM);
$this->messageArray['SqlFinal'] = Store::getVar(SYSTEM_SQL_FINAL, STORE_SYSTEM);
$this->messageArray['ColumnKey'] = Store::getVar(SYSTEM_REPORT_COLUMN_KEY, STORE_SYSTEM);
$this->messageArray['ColumnValue'] = Store::getVar(SYSTEM_REPORT_COLUMN_VALUE, STORE_SYSTEM);
return parent::formatException();
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ namespace qfq;
use qfq;
use qfq\Store;
use qfq\UserException;
use qfq\UserFormException;
require_once(__DIR__ . '/../../qfq/store/Store.php');
require_once(__DIR__ . '/../../qfq/Constants.php');
......@@ -20,6 +20,17 @@ require_once(__DIR__ . '/../../qfq/exceptions/UserException.php');
class HelperFormElement
{
/**