mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
check if attribute definition exists
This commit is contained in:
parent
25e7eaed64
commit
3d638b47a8
|
@ -84,7 +84,8 @@ $categories = isset($_POST["categories"]) ? $_POST["categories"] : null;
|
||||||
$cats = array();
|
$cats = array();
|
||||||
if($categories) {
|
if($categories) {
|
||||||
foreach($categories as $catid) {
|
foreach($categories as $catid) {
|
||||||
$cats[] = $dms->getDocumentCategory($catid);
|
if($cat = $dms->getDocumentCategory($catid))
|
||||||
|
$cats[] = $cat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +94,7 @@ if(isset($_POST["attributes"]))
|
||||||
else
|
else
|
||||||
$attributes = array();
|
$attributes = array();
|
||||||
foreach($attributes as $attrdefid=>$attribute) {
|
foreach($attributes as $attrdefid=>$attribute) {
|
||||||
$attrdef = $dms->getAttributeDefinition($attrdefid);
|
if($attrdef = $dms->getAttributeDefinition($attrdefid)) {
|
||||||
if($attribute) {
|
if($attribute) {
|
||||||
if(!$attrdef->validate($attribute)) {
|
if(!$attrdef->validate($attribute)) {
|
||||||
$errmsg = getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute);
|
$errmsg = getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute);
|
||||||
|
@ -103,6 +104,7 @@ foreach($attributes as $attrdefid=>$attribute) {
|
||||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_POST["attributes_version"]))
|
if(isset($_POST["attributes_version"]))
|
||||||
$attributes_version = $_POST["attributes_version"];
|
$attributes_version = $_POST["attributes_version"];
|
||||||
|
@ -130,6 +132,8 @@ if (!is_numeric($sequence)) {
|
||||||
switch($_POST["presetexpdate"]) {
|
switch($_POST["presetexpdate"]) {
|
||||||
case "date":
|
case "date":
|
||||||
$tmp = explode('-', $_POST["expdate"]);
|
$tmp = explode('-', $_POST["expdate"]);
|
||||||
|
if(count($tmp) != 3)
|
||||||
|
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("malformed_expiration_date"));
|
||||||
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
|
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
|
||||||
break;
|
break;
|
||||||
case "1w":
|
case "1w":
|
||||||
|
|
Loading…
Reference in New Issue
Block a user