seeddms-code/controllers/class.AttributeMgr.php

95 lines
2.5 KiB
PHP
Raw Normal View History

2017-12-07 17:23:07 +00:00
<?php
/**
* Implementation of Attribute Definition manager controller
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Class which does the busines logic for attribute definition manager
*
* @category DMS
* @package SeedDMS
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_Controller_AttributeMgr extends SeedDMS_Controller_Common {
public function run() { /* {{{ */
} /* }}} */
public function addattrdef() { /* {{{ */
$dms = $this->params['dms'];
$name = $this->params['name'];
$type = $this->params['type'];
$objtype = $this->params['objtype'];
$multiple = $this->params['multiple'];
$minvalues = $this->params['minvalues'];
$maxvalues = $this->params['maxvalues'];
$valueset = $this->params['valueset'];
$regex = $this->params['regex'];
return($dms->addAttributeDefinition($name, $objtype, $type, $multiple, $minvalues, $maxvalues, $valueset, $regex));
} /* }}} */
public function removeattrdef() { /* {{{ */
$attrdef = $this->params['attrdef'];
return $attrdef->remove();
} /* }}} */
public function editattrdef() { /* {{{ */
$dms = $this->params['dms'];
$name = $this->params['name'];
$attrdef = $this->params['attrdef'];
$type = $this->params['type'];
$objtype = $this->params['objtype'];
$multiple = $this->params['multiple'];
$minvalues = $this->params['minvalues'];
$maxvalues = $this->params['maxvalues'];
$valueset = $this->params['valueset'];
$regex = $this->params['regex'];
if (!$attrdef->setName($name)) {
return false;
}
if (!$attrdef->setType($type)) {
return false;
}
if (!$attrdef->setObjType($objtype)) {
return false;
}
if (!$attrdef->setMultipleValues($multiple)) {
return false;
}
if (!$attrdef->setMinValues($minvalues)) {
return false;
}
if (!$attrdef->setMaxValues($maxvalues)) {
return false;
}
if (!$attrdef->setValueSet($valueset)) {
return false;
}
if (!$attrdef->setRegex($regex)) {
return false;
}
return true;
} /* }}} */
2018-02-22 18:11:57 +00:00
public function removeattrvalue() { /* {{{ */
$attrdef = $this->params['attrdef'];
$attrval = $this->params['attrval'];
//$attrdef->getObjects($attrval);
return $attrdef->removeValue($attrval);
} /* }}} */
2017-12-07 17:23:07 +00:00
}