diff --git a/SeedDMS_Core/Core/inc.ClassAttribute.php b/SeedDMS_Core/Core/inc.ClassAttribute.php index a033b026c..6404e6251 100644 --- a/SeedDMS_Core/Core/inc.ClassAttribute.php +++ b/SeedDMS_Core/Core/inc.ClassAttribute.php @@ -900,15 +900,33 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */ $success = true; switch((string) $this->getType()) { + case self::type_boolean: + foreach($values as $value) { + $success &= preg_match('/^[01]$/', $value) ? true : false; + } + if(!$success) + $this->_validation_error = 8; + break; case self::type_int: foreach($values as $value) { $success &= preg_match('/^[0-9]*$/', $value) ? true : false; } + if(!$success) + $this->_validation_error = 6; + break; + case self::type_date: + foreach($values as $value) { + $success &= preg_match('/^[12][0-9]{3}-[01][0-9]-[0-9]{2}$/', $value) ? true : false; + } + if(!$success) + $this->_validation_error = 9; break; case self::type_float: foreach($values as $value) { $success &= is_numeric($value); } + if(!$success) + $this->_validation_error = 7; break; case self::type_string: if(trim($this->getRegex()) != '') { diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index 997364a8d..474fbb0f4 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -1274,6 +1274,7 @@ SeedDMS_Core_DMS::getNotificationsByUser() are deprecated GPL License - all changes from 4.3.30 merged +- better attribute value checking diff --git a/controllers/class.EditFolder.php b/controllers/class.EditFolder.php index 03d01c327..44b0c174d 100644 --- a/controllers/class.EditFolder.php +++ b/controllers/class.EditFolder.php @@ -55,46 +55,10 @@ class SeedDMS_Controller_EditFolder extends SeedDMS_Controller_Common { $attrdef = $dms->getAttributeDefinition($attrdefid); if($attribute) { if(!$attrdef->validate($attribute)) { - $this->error = $attrdef->getValidationError(); - switch($attrdef->getValidationError()) { - case 5: - $this->errormsg = getMLText("attr_malformed_email", array("attrname"=>$attrdef->getName(), "value"=>$attribute)); - break; - case 4: - $this->errormsg = getMLText("attr_malformed_url", array("attrname"=>$attrdef->getName(), "value"=>$attribute)); - break; - case 3: - $this->errormsg = getMLText("attr_no_regex_match", array("attrname"=>$attrdef->getName(), "value"=>$attribute, "regex"=>$attrdef->getRegex())); - break; - case 2: - $this->errormsg = getMLText("attr_max_values", array("attrname"=>$attrdef->getName())); - break; - case 1: - $this->errormsg = getMLText("attr_min_values", array("attrname"=>$attrdef->getName())); - break; - default: - $this->errormsg = getMLText("error_occured"); - } + $this->errormsg = getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute); return false; } - /* - if($attrdef->getRegex()) { - if(!preg_match($attrdef->getRegex(), $attribute)) { - $this->error = 1; - return false; - } - } - if(is_array($attribute)) { - if($attrdef->getMinValues() > count($attribute)) { - $this->error = 2; - return false; - } - if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) { - $this->error = 3; - return false; - } - } - */ + if(!isset($oldattributes[$attrdefid]) || $attribute != $oldattributes[$attrdefid]->getValue()) { if(!$folder->setAttributeValue($dms->getAttributeDefinition($attrdefid), $attribute)) return false; diff --git a/inc/inc.Language.php b/inc/inc.Language.php index bb13c30f0..02f8fba75 100644 --- a/inc/inc.Language.php +++ b/inc/inc.Language.php @@ -317,4 +317,42 @@ function getOverallStatusText($status) { /* {{{ */ } } /* }}} */ +function getAttributeValidationText($error, $attrname='', $attrvalue='') { /* {{{ */ + switch($error) { + case 10: + return getMLText("attr_not_in_valueset", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 8: + return getMLText("attr_malformed_date", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 8: + return getMLText("attr_malformed_boolean", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 7: + return getMLText("attr_malformed_float", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 6: + return getMLText("attr_malformed_int", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 5: + return getMLText("attr_malformed_email", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 4: + return getMLText("attr_malformed_url", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 3: + return getMLText("attr_no_regex_match", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 2: + return getMLText("attr_max_values", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + case 1: + return getMLText("attr_min_values", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + default: + return getMLText("attr_validation_error", array('attrname'=>$attrname, 'value'=>$attrvalue)); + break; + } +} /* }}} */ + ?> diff --git a/languages/ar_EG/lang.inc b/languages/ar_EG/lang.inc index 1caed9c4f..1797e244e 100644 --- a/languages/ar_EG/lang.inc +++ b/languages/ar_EG/lang.inc @@ -158,11 +158,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - تم تغيير سمة', 'attribute_count' => 'ﻉﺩﺩ ﻡﺭﺎﺗ ﺍﻸﺴﺘﺧﺩﺎﻣ', 'attribute_value' => 'ﻖﻴﻣﺓ ﺎﻠﺴﻣﺓ', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '', 'august' => 'أغسطس', 'authentication' => '', @@ -1271,6 +1277,7 @@ URL: [url]', 'splash_add_group_member' => '', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '', diff --git a/languages/bg_BG/lang.inc b/languages/bg_BG/lang.inc index fcf7b7e2b..8084082c1 100644 --- a/languages/bg_BG/lang.inc +++ b/languages/bg_BG/lang.inc @@ -143,11 +143,17 @@ $text = array( 'attribute_changed_email_subject' => '', 'attribute_count' => '', 'attribute_value' => '', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '', 'august' => 'Август', 'authentication' => '', @@ -1136,6 +1142,7 @@ $text = array( 'splash_add_group_member' => '', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '', diff --git a/languages/ca_ES/lang.inc b/languages/ca_ES/lang.inc index da60fac74..65cf5696c 100644 --- a/languages/ca_ES/lang.inc +++ b/languages/ca_ES/lang.inc @@ -148,11 +148,17 @@ URL: [url]', 'attribute_changed_email_subject' => '', 'attribute_count' => '', 'attribute_value' => '', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '', 'august' => 'Agost', 'authentication' => '', @@ -1141,6 +1147,7 @@ URL: [url]', 'splash_add_group_member' => '', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '', diff --git a/languages/cs_CZ/lang.inc b/languages/cs_CZ/lang.inc index b6aa08fc8..198a250d8 100644 --- a/languages/cs_CZ/lang.inc +++ b/languages/cs_CZ/lang.inc @@ -165,11 +165,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Atributy změněny', 'attribute_count' => 'Počet použití', 'attribute_value' => 'Hodnota atributu', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => 'Maximální počet pažadovaných hodnot pro atribut [attrname] je překročen.', 'attr_min_values' => 'Není dosaženo minimálního počtu požadovaných hodnot pro atribut [attrname].', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Hodnota atributu nesouhlasí s regulárním výrazem', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Alespoň [number_of_users] uživatelů z [group]', 'august' => 'Srpen', 'authentication' => 'Autentizace', @@ -1280,6 +1286,7 @@ URL: [url]', 'splash_add_group_member' => 'Přidán nový člen skupiny', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Přidán nový uživatel', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Schránka vymazána', diff --git a/languages/de_DE/lang.inc b/languages/de_DE/lang.inc index 1dcb9b18f..6139d6a2f 100644 --- a/languages/de_DE/lang.inc +++ b/languages/de_DE/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (2310), dgrutsch (21) +// Translators: Admin (2319), dgrutsch (21) $text = array( '2_factor_auth' => '2-Faktor Authentifizierung', @@ -170,11 +170,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Attribut geändert', 'attribute_count' => 'Anzahl Verwendungen', 'attribute_value' => 'Attributwert', +'attr_malformed_boolean' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist kein gültiger Ja/Nein-Wert.', +'attr_malformed_date' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist kein gültiges Datum.', 'attr_malformed_email' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist keine gültige E-Mail.', +'attr_malformed_float' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist keine Dezimalzahl.', +'attr_malformed_int' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist kein ganzzahliger Wert.', 'attr_malformed_url' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist keine gültige URL.', 'attr_max_values' => 'Die maximale Anzahl der erlaubten Werte für das Attribut [attrname] ist überschritten.', 'attr_min_values' => 'Die minimal Anzahl von Werte für das Attribut [attrname] ist nicht erreicht.', +'attr_not_in_valueset' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist nicht in der Werteauswahl.', 'attr_no_regex_match' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' passt nicht zum regulären Ausdruck \'[regex]\'', +'attr_validation_error' => 'Der Attributwert \'[value]\' des Attributs \'[attrname]\' ist ungültig.', 'at_least_n_users_of_group' => 'Mindestens [number_of_users] Benutzer der Gruppe [group]', 'august' => 'August', 'authentication' => 'Authentifizierung', @@ -1084,8 +1090,8 @@ URL: [url]', 'settings_Edition' => 'Funktions-Einstellungen', 'settings_editOnlineFileTypes' => 'Dateitypen für Online-Editieren:', 'settings_editOnlineFileTypes_desc' => 'Dateien mit den angegebenen Endungen können Online editiert werden (benutzen Sie ausschließlich Kleinbuchstaben).', -'settings_enable2FactorAuthentication' => '', -'settings_enable2FactorAuthentication_desc' => '', +'settings_enable2FactorAuthentication' => '2-Faktor Authentifizierung einschalten', +'settings_enable2FactorAuthentication_desc' => 'Schaltet die 2-Faktor Authentifizierung ein, welche den Google Authenticator auf dem Mobiltelefon erfordert.', 'settings_enableAcknowledgeWorkflow' => 'Ermögliche Bestätigung des Dokumentenempfang', 'settings_enableAcknowledgeWorkflow_desc' => 'Anwählen, um den Workflow zur Kenntnisnahme von Dokumenten einzuschalten', 'settings_enableAdminRevApp' => 'Admin darf freigeben/prüfen', @@ -1323,6 +1329,7 @@ URL: [url]', 'splash_add_group_member' => 'Neues Gruppenmitglied hinzugefügt', 'splash_add_role' => 'Neue Rolle hinzugefügt', 'splash_add_to_transmittal' => 'Zur Dokumentenliste hinzugefügt', +'splash_add_transmittal' => 'Dokumentenliste angelegt', 'splash_add_user' => 'Neuen Benutzer hinzugefügt', 'splash_clearcache' => 'Cache geleert', 'splash_cleared_clipboard' => 'Zwischenablage geleert', diff --git a/languages/el_GR/lang.inc b/languages/el_GR/lang.inc index aeba14e17..3df67683b 100644 --- a/languages/el_GR/lang.inc +++ b/languages/el_GR/lang.inc @@ -143,11 +143,17 @@ $text = array( 'attribute_changed_email_subject' => '', 'attribute_count' => '', 'attribute_value' => '', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '', 'august' => 'Αύγουστος', 'authentication' => '', @@ -1147,6 +1153,7 @@ URL: [url]', 'splash_add_group_member' => '', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '', diff --git a/languages/en_GB/lang.inc b/languages/en_GB/lang.inc index 87aebd690..5a252dc3c 100644 --- a/languages/en_GB/lang.inc +++ b/languages/en_GB/lang.inc @@ -19,7 +19,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// Translators: Admin (1448), dgrutsch (7), netixw (14) +// Translators: Admin (1455), dgrutsch (7), netixw (14) $text = array( '2_factor_auth' => '2-factor authentication', @@ -170,11 +170,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Attribute changed', 'attribute_count' => 'Number of uses', 'attribute_value' => 'Value of attribute', +'attr_malformed_boolean' => 'The attribute value \'[value]\' of attribute \'[attrname]\' is not a valid boolean.', +'attr_malformed_date' => 'The attribute value \'[value]\' of attribute \'[attrname]\' is not a valid date.', 'attr_malformed_email' => 'The attribute value \'[value]\' of attribute \'[attrname]\' is not a valid URL.', +'attr_malformed_float' => 'The attribute value \'[value]\' of attribute \'[attrname]\' is not a valid float.', +'attr_malformed_int' => 'The attribute value \'[value]\' of attribute \'[attrname]\' is not a valid integer.', 'attr_malformed_url' => 'The attribute value \'[value]\' of attribute \'[attrname]\' is not a valid URL.', 'attr_max_values' => 'The maximum number of required values for attribute [attrname] is exceeded.', 'attr_min_values' => 'The minimum number of required values for attribute [attrname] is not reached.', +'attr_not_in_valueset' => 'The attribute value \'[value]\' for attribute \'[attrname]\' is not contained in the valueset.', 'attr_no_regex_match' => 'The attribute value \'[value]\' for attribute \'[attrname]\' does not match the regular expression \'[regex]\'', +'attr_validation_error' => 'The value \'[value]\' of attribute \'[attrname]\' is invalid.', 'at_least_n_users_of_group' => 'At least [number_of_users] users of [group]', 'august' => 'August', 'authentication' => 'Authentication', @@ -1318,6 +1324,7 @@ URL: [url]', 'splash_add_group_member' => 'New group member added', 'splash_add_role' => 'Added new role', 'splash_add_to_transmittal' => 'Add to transmittal', +'splash_add_transmittal' => 'Added transmittal', 'splash_add_user' => 'New user added', 'splash_clearcache' => 'Cache cleared', 'splash_cleared_clipboard' => 'Clipboard cleared', diff --git a/languages/es_ES/lang.inc b/languages/es_ES/lang.inc index 4dd98376d..2af9a3861 100644 --- a/languages/es_ES/lang.inc +++ b/languages/es_ES/lang.inc @@ -165,11 +165,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Atributo modificado', 'attribute_count' => 'Cantidad de usos', 'attribute_value' => 'Valor del atributo', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'El valor del atributo no concuerda con la expresión regular', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Al menos [number_of_users] usuarios de [group]', 'august' => 'Agosto', 'authentication' => 'Autenticación', @@ -1286,6 +1292,7 @@ URL: [url]', 'splash_add_group_member' => 'Nuevo miembro del grupo agregado', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Nuevo usuario agregado', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Portapapeles limpiado', diff --git a/languages/fr_FR/lang.inc b/languages/fr_FR/lang.inc index 9912ae2e0..98abda493 100644 --- a/languages/fr_FR/lang.inc +++ b/languages/fr_FR/lang.inc @@ -165,11 +165,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Attribut changé', 'attribute_count' => 'Nombre d\'utilisations', 'attribute_value' => 'Valeur de l\'attribut', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => 'Le nombre maximum de valeurs pour l\'attribut [attrname] est dépassé', 'attr_min_values' => 'Le nombre minimum de valeurs pour l\'attribut [attrname] n\'est pas atteint', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'La valeur de l\'attribut ne correspond pas à l\'expression régulière.', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Au moins [number_of_users] utilisateurs de [group]', 'august' => 'Août', 'authentication' => 'Authentification', @@ -1262,6 +1268,7 @@ URL: [url]', 'splash_add_group_member' => 'Nouveau membre ajouté au groupe', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Nouvel utilisateur ajouté', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Presse-papier vidé', diff --git a/languages/hr_HR/lang.inc b/languages/hr_HR/lang.inc index a8abac456..7ea0151de 100644 --- a/languages/hr_HR/lang.inc +++ b/languages/hr_HR/lang.inc @@ -170,11 +170,17 @@ Internet poveznica: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Promijenjen atribut', 'attribute_count' => 'Broj uporaba', 'attribute_value' => 'Vrijednost atributa', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => 'Vrijednost atributa \'[value]\' za atribut \'[attrname]\' nije važeći URL.', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => 'Vrijednost atributa \'[value]\' za atribut \'[attrname]\' nije važeći URL.', 'attr_max_values' => 'Premašen je maksimalni broj zahtjevanih vrijednosti za atribute[attrname].', 'attr_min_values' => 'Minimalni broj zahtjevanih vrijednosti za atribute[attrname] nije dostignut.', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Vrijednost atributa ne odgovara pravilnom izrazu', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Najmanje [number_of_users] korisnika iz [group]', 'august' => 'Kolovoz', 'authentication' => 'Ovjera', @@ -1307,6 +1313,7 @@ Internet poveznica: [url]', 'splash_add_group_member' => 'Dodan novi član grupe', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Dodan novi korisnik', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Očišćen međuspremnik', diff --git a/languages/hu_HU/lang.inc b/languages/hu_HU/lang.inc index 9d3515147..8be5f45f6 100644 --- a/languages/hu_HU/lang.inc +++ b/languages/hu_HU/lang.inc @@ -165,11 +165,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Jellemző módosult', 'attribute_count' => 'Felhasználók száma', 'attribute_value' => 'Tulajdonság értéke', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'A jellemző értéke nem felel meg a szabályos kifejezésnek', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Legalább [number_of_users] felhasználó a [group] csoportban', 'august' => 'Augusztus', 'authentication' => 'Hitelesítés', @@ -1285,6 +1291,7 @@ URL: [url]', 'splash_add_group_member' => 'Új csoporttag hozzáadva', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Új felhasználó hozzáadva', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Vágólap törölve', diff --git a/languages/it_IT/lang.inc b/languages/it_IT/lang.inc index ac0037984..f645d50d7 100644 --- a/languages/it_IT/lang.inc +++ b/languages/it_IT/lang.inc @@ -170,12 +170,18 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Attributo modificato', 'attribute_count' => 'Numero di utilizzi', 'attribute_value' => 'Valore dell\'Attributo', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => 'Il valore di \'[value]\' dell, => attributo \'[attrname]\' non é un URL valido.', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => 'Il valore dell\'attributo \'[valore]\' di attributo \'[attrname]\' non è un URL valido.', 'attr_max_values' => 'Il numero massimo dei valori richiesti per l\'Attributo [attrname] è superato.', 'attr_min_values' => 'Il numero minimo di valori richiesti per l\'Attributo [attrname] non è raggiunto.', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Il valore dell\'Attributo non è conforme ad un\'espressione regolare.', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Minimo [number_of_users] utenti del gruppo [group]', 'august' => 'Agosto', 'authentication' => 'Autenticazione', @@ -1319,6 +1325,7 @@ URL: [url]', 'splash_add_group_member' => 'Membro aggiunto al gruppo', 'splash_add_role' => 'Aggiunto nuovo ruolo', 'splash_add_to_transmittal' => 'Aggiungere alla trasmissione', +'splash_add_transmittal' => '', 'splash_add_user' => 'Utente aggiunto', 'splash_clearcache' => 'Cache cancellata', 'splash_cleared_clipboard' => 'Appunti cancellati', diff --git a/languages/ko_KR/lang.inc b/languages/ko_KR/lang.inc index 881a6f7b7..ce170ddc3 100644 --- a/languages/ko_KR/lang.inc +++ b/languages/ko_KR/lang.inc @@ -170,12 +170,18 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename] : [name] - 속성이 변경', 'attribute_count' => '사용자수', 'attribute_value' => '속성', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '속성값 \'[value]\' \'[attrname]\'은(는) 유효한 URL이 아닙니다.', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '속성값 \'[value]\' \'[attrname]\'은(는) 유효한 URL이 아닙니다.', 'attr_max_values' => '속성[attrname]값이 필요한 최대수에 도달하지 못했습니다.', 'attr_min_values' => '속성[attrname]값이 필요한 최소수에 도달하지 못했습니다.', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '속성값이 정규 표현식과 불일치 속성값 \'[value]\' \'[attrname]\'은(는) 정규 표현에 일치 하지 않는 \'[regex]\'', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'At least [number_of_users] users of [group] 적어도 [number_of_users]의 사용자 [group]', 'august' => '8월', @@ -1300,6 +1306,7 @@ URL : [url]', 'splash_add_group_member' => '새 그룹 구성원 추가', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '새 사용자 추가', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '클립 보드 비우기', diff --git a/languages/nl_NL/lang.inc b/languages/nl_NL/lang.inc index 4548952a6..5e3a7be7d 100644 --- a/languages/nl_NL/lang.inc +++ b/languages/nl_NL/lang.inc @@ -163,11 +163,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Attribuut gewijzigd', 'attribute_count' => 'Aantal maal gebruikt', 'attribute_value' => 'Waarde van het attribuut', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => 'Foute vormgeving email', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => 'Foute url', 'attr_max_values' => 'attribuut: maximale waarde', 'attr_min_values' => 'attribuut: minimale waarde', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'De waarde van het attribuut komt niet overeen met de veelgebruikte uitdrukking (regular expression)', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Minimaal [number_of_users] gebruikers van [group]', 'august' => 'augustus', 'authentication' => 'Authentificatie', @@ -1313,6 +1319,7 @@ URL: [url]', 'splash_add_group_member' => 'Nieuwe groepslid toegevoegd', 'splash_add_role' => 'Nieuwe rol toegevoegd', 'splash_add_to_transmittal' => 'Toevoegen aan verzending', +'splash_add_transmittal' => '', 'splash_add_user' => 'Nieuwe gebruiker toegevoegd', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Klembord leeg gemaakt', diff --git a/languages/pl_PL/lang.inc b/languages/pl_PL/lang.inc index 4ab736c96..70b4f8ede 100644 --- a/languages/pl_PL/lang.inc +++ b/languages/pl_PL/lang.inc @@ -158,11 +158,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Zmiana atrybutu', 'attribute_count' => 'liczba użyć', 'attribute_value' => 'wartość atrybutu', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Wartość atrybutu nie pasuje do wyrażenia regularnego', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Przynajmniej [number_of_users] użytkowników grupy [group]', 'august' => 'Sierpień', 'authentication' => 'Autoryzacja', @@ -1265,6 +1271,7 @@ URL: [url]', 'splash_add_group_member' => 'Dodano nowego członka grupy', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Dodano nowego użytkownika', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Wyczyszczono schowek', diff --git a/languages/pt_BR/lang.inc b/languages/pt_BR/lang.inc index c26e769fa..ea655b91f 100644 --- a/languages/pt_BR/lang.inc +++ b/languages/pt_BR/lang.inc @@ -165,11 +165,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Atributo modificado', 'attribute_count' => 'Número de utilizações', 'attribute_value' => 'Valor do atributo', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'O valor do atributo não corresponde à expressão regular', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Pelo menos [nuber_of_users] usuários de [group]', 'august' => 'August', 'authentication' => 'Autenticação', @@ -1283,6 +1289,7 @@ URL: [url]', 'splash_add_group_member' => 'Novo membro do grupo adicionado', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Novo usuário adicionado', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Área de transferência limpada', diff --git a/languages/ro_RO/lang.inc b/languages/ro_RO/lang.inc index 92aa89afe..c29fc4296 100644 --- a/languages/ro_RO/lang.inc +++ b/languages/ro_RO/lang.inc @@ -170,11 +170,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Atribut schimbat', 'attribute_count' => 'Numărul de utilizări', 'attribute_value' => 'Valoare atribut', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => 'Valoarea \'[value]\' a atributului \'[attrname]\' nu este o adresa URL valida.', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => 'Valoarea \'[value]\' a atributului \'[attrname]\' nu este o adresa URL valida.', 'attr_max_values' => 'Numărul maxim de valori necesare pentru atributul [attrname] este depășit.', 'attr_min_values' => 'Numărul minim de valori necesare pentru atributul [attrname] nu este atins.', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Valoarea atributului nu se potrivește cu expresia regulată', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Cel puțin [number_of_users] utilizatori in [group]', 'august' => 'August', 'authentication' => 'Autentificare', @@ -1308,6 +1314,7 @@ URL: [url]', 'splash_add_group_member' => 'Membru grup nou adăugat', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Utilizator nou adăugat', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Clipboard golit', diff --git a/languages/ru_RU/lang.inc b/languages/ru_RU/lang.inc index a3fceaa75..842d93a99 100644 --- a/languages/ru_RU/lang.inc +++ b/languages/ru_RU/lang.inc @@ -170,11 +170,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: изменён атрибут «[name]»', 'attribute_count' => 'Использован раз', 'attribute_value' => 'Значение атрибута', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => 'Значение атрибута \'[value]\' атрибута \'[attrname]\' не является допустимым URL.', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => 'Значение атрибута \'[value]\' атрибута \'[attrname]\' не является допустимым URL.', 'attr_max_values' => 'Максимальное количество требуемых значений для атрибутов [attrname] превышено.', 'attr_min_values' => 'Минимальное количество требуемых значений для атрибутов [attrname] не достигнуто.', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Значение атрибута не соответствует регулярному выражению', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '[number_of_users] польз. группы [group]', 'august' => 'Август', 'authentication' => 'Авторизация', @@ -1315,6 +1321,7 @@ URL: [url]', 'splash_add_group_member' => 'Добавлен новый член группы', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Добавлен новый пользователь', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Буфер обмена очищен', diff --git a/languages/sk_SK/lang.inc b/languages/sk_SK/lang.inc index 28fba6e79..b304082c9 100644 --- a/languages/sk_SK/lang.inc +++ b/languages/sk_SK/lang.inc @@ -147,11 +147,17 @@ URL: [url]', 'attribute_changed_email_subject' => '', 'attribute_count' => '', 'attribute_value' => '', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '', 'august' => 'August', 'authentication' => '', @@ -1140,6 +1146,7 @@ URL: [url]', 'splash_add_group_member' => '', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '', diff --git a/languages/sv_SE/lang.inc b/languages/sv_SE/lang.inc index 90ea07f5b..e28162196 100644 --- a/languages/sv_SE/lang.inc +++ b/languages/sv_SE/lang.inc @@ -158,11 +158,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Ändrad attribut', 'attribute_count' => 'Antal användningar', 'attribute_value' => 'Attributvärde', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Värdet av attributet stämmer inte överens med regulära uttrycket', +'attr_validation_error' => '', 'at_least_n_users_of_group' => 'Åtminstone [number_of_users] användare av [group]', 'august' => 'augusti', 'authentication' => '', @@ -1271,6 +1277,7 @@ URL: [url]', 'splash_add_group_member' => 'Ny gruppmedlem tillagt', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Ny användare tillagt', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Urklipp rensat', diff --git a/languages/tr_TR/lang.inc b/languages/tr_TR/lang.inc index 91b22bcae..2f67aac82 100644 --- a/languages/tr_TR/lang.inc +++ b/languages/tr_TR/lang.inc @@ -164,11 +164,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: [name] - Nitelik değişti', 'attribute_count' => 'Kullanım sayısı', 'attribute_value' => 'Niteliğin değeri', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '[attrname] niteliği için maksimum gerekli olan değer aşıldı.', 'attr_min_values' => '[attrname] niteliği için minimum gerekli olan değere ulaşılmadı.', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Nitelik değeri düzenli ifade ile eşleşmiyor', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '[group] için en az [number_of_users] kullanıcı', 'august' => 'Ağustos', 'authentication' => 'Kimlik doğrulama', @@ -1287,6 +1293,7 @@ URL: [url]', 'splash_add_group_member' => 'Yeni grup üyesi eklendi', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Yeni kullanıcı eklendi', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Pano temizlendi', diff --git a/languages/uk_UA/lang.inc b/languages/uk_UA/lang.inc index cb5a44676..6c2bc4000 100644 --- a/languages/uk_UA/lang.inc +++ b/languages/uk_UA/lang.inc @@ -170,11 +170,17 @@ URL: [url]', 'attribute_changed_email_subject' => '[sitename]: змінено атрибут «[name]»', 'attribute_count' => 'Використано разів', 'attribute_value' => 'Значення атрибута', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => 'Значення \'[value]\' атрибуту \'[attrname]\' не є правильною адресою email.', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => 'Значення \'[value]\' атрибуту \'[attrname]\' не є правильним ULR', 'attr_max_values' => 'Досягнуто максимальної кількості значень атрибуту [attrname].', 'attr_min_values' => 'Не досягнуто мінімальної кількості значень атрибуту [attrname]', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => 'Значення атрибуту не відповідає регулярному виразу', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '[number_of_users] користувачі групи [group]', 'august' => 'Серпень', 'authentication' => 'Авторизація', @@ -1308,6 +1314,7 @@ URL: [url]', 'splash_add_group_member' => 'Додано нового члена групи', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => 'Додано нового користувача', 'splash_clearcache' => '', 'splash_cleared_clipboard' => 'Буфер обміну очищено', diff --git a/languages/zh_CN/lang.inc b/languages/zh_CN/lang.inc index acef42999..2b0b3c05d 100644 --- a/languages/zh_CN/lang.inc +++ b/languages/zh_CN/lang.inc @@ -147,11 +147,17 @@ URL: [url]', 'attribute_changed_email_subject' => '', 'attribute_count' => '使用次数', 'attribute_value' => '属性值', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '', 'august' => '八 月', 'authentication' => '认证', @@ -1142,6 +1148,7 @@ URL: [url]', 'splash_add_group_member' => '', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '', diff --git a/languages/zh_TW/lang.inc b/languages/zh_TW/lang.inc index b23d20448..c71fe6fd2 100644 --- a/languages/zh_TW/lang.inc +++ b/languages/zh_TW/lang.inc @@ -147,11 +147,17 @@ URL: [url]', 'attribute_changed_email_subject' => '', 'attribute_count' => '使用次數', 'attribute_value' => '屬性值', +'attr_malformed_boolean' => '', +'attr_malformed_date' => '', 'attr_malformed_email' => '', +'attr_malformed_float' => '', +'attr_malformed_int' => '', 'attr_malformed_url' => '', 'attr_max_values' => '', 'attr_min_values' => '', +'attr_not_in_valueset' => '', 'attr_no_regex_match' => '', +'attr_validation_error' => '', 'at_least_n_users_of_group' => '', 'august' => '八 月', 'authentication' => '', @@ -1140,6 +1146,7 @@ URL: [url]', 'splash_add_group_member' => '', 'splash_add_role' => '', 'splash_add_to_transmittal' => '', +'splash_add_transmittal' => '', 'splash_add_user' => '', 'splash_clearcache' => '', 'splash_cleared_clipboard' => '', diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index 7826c74b2..accf88543 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -116,21 +116,10 @@ else foreach($attributes_version as $attrdefid=>$attribute) { $attrdef = $dms->getAttributeDefinition($attrdefid); if($attribute) { - if($attrdef->getRegex()) { - if(!preg_match($attrdef->getRegex(), $attribute)) { - UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_no_regex_match")); - } + if(!$attrdef->validate($attribute)) { + $errmsg = getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute); + UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),$errmsg); } - if(is_array($attribute)) { - if($attrdef->getMinValues() > count($attribute)) { - UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName()))); - } - if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) { - UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName()))); - } - } - } elseif($attrdef->getMinValues() > 0) { - UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName()))); } } diff --git a/op/op.AddSubFolder.php b/op/op.AddSubFolder.php index 4ebd2fe9e..eedd0cda8 100644 --- a/op/op.AddSubFolder.php +++ b/op/op.AddSubFolder.php @@ -66,18 +66,9 @@ else foreach($attributes as $attrdefid=>$attribute) { $attrdef = $dms->getAttributeDefinition($attrdefid); if($attribute) { - if($attrdef->getRegex()) { - if(!preg_match($attrdef->getRegex(), $attribute)) { - UI::exitError(getMLText("folder_title", array("foldername" => $document->getName())),getMLText("attr_no_regex_match")); - } - } - if(is_array($attribute)) { - if($attrdef->getMinValues() > count($attribute)) { - UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName()))); - } - if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) { - UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName()))); - } + if(!$attrdef->validate($attribute)) { + $errmsg = getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute); + UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())), $errmsg); } } } diff --git a/op/op.EditDocument.php b/op/op.EditDocument.php index 49e9f5fab..fd5b62c96 100644 --- a/op/op.EditDocument.php +++ b/op/op.EditDocument.php @@ -261,25 +261,8 @@ if($attributes) { $attrdef = $dms->getAttributeDefinition($attrdefid); if($attribute) { if(!$attrdef->validate($attribute)) { - switch($attrdef->getValidationError()) { - case 5: - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_malformed_email", array("attrname"=>$attrdef->getName(), "value"=>$attribute))); - break; - case 4: - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_malformed_url", array("attrname"=>$attrdef->getName(), "value"=>$attribute))); - break; - case 3: - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_no_regex_match", array("attrname"=>$attrdef->getName(), "value"=>$attribute, "regex"=>$attrdef->getRegex()))); - break; - case 2: - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName()))); - break; - case 1: - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName()))); - break; - default: - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); - } + $errmsg = getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute); + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())), $errmsg); } if(!isset($oldattributes[$attrdefid]) || $attribute != $oldattributes[$attrdefid]->getValue()) { if(!$document->setAttributeValue($dms->getAttributeDefinition($attrdefid), $attribute)) diff --git a/op/op.Settings.php b/op/op.Settings.php index f3015e5ab..7d26d4aa1 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -74,7 +74,7 @@ if ($action == "saveSettings") $settings->_maxSizeForFullText = intval($_POST["maxSizeForFullText"]); $settings->_fullSearchEngine = $_POST["fullSearchEngine"]; $settings->_defaultSearchMethod = $_POST["defaultSearchMethod"]; - $settings->_showSingleSearchHit = $_POST["showSingleSearchHit"]; + $settings->_showSingleSearchHit = getBoolValue("showSingleSearchHit"); $settings->_enableClipboard = getBoolValue("enableClipboard"); $settings->_enableMenuTasks = getBoolValue("enableMenuTasks"); $settings->_enableDropUpload = getBoolValue("enableDropUpload"); diff --git a/views/bootstrap/class.AttributeMgr.php b/views/bootstrap/class.AttributeMgr.php index 910de5004..c315cd1a7 100644 --- a/views/bootstrap/class.AttributeMgr.php +++ b/views/bootstrap/class.AttributeMgr.php @@ -76,7 +76,7 @@ $(document).ready( function() {
@@ -89,9 +89,19 @@ $(document).ready( function() { print "\n\n"; print "".getMLText("attribute_value")."\n"; print "".getMLText("attribute_count")."\n"; + print "\n"; print "\n\n"; foreach($res['frequencies'][$type] as $entry) { - echo "".$entry['value']."".$entry['c'].""; + echo ""; + echo "".$entry['value']."".$entry['c'].""; + /* various checks, if the value is valid */ + echo ""; + /* Check if value is in value set */ + if(!$selattrdef->validate($entry['value'])) { + echo getAttributeValidationText($selattrdef->getValidationError(), $selattrdef->getName(), $entry['value']); + } + echo ""; + echo ""; } print ""; }