本文整理汇总了PHP中CommonDBChild::prepareInputForAdd方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBChild::prepareInputForAdd方法的具体用法?PHP CommonDBChild::prepareInputForAdd怎么用?PHP CommonDBChild::prepareInputForAdd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBChild
的用法示例。
在下文中一共展示了CommonDBChild::prepareInputForAdd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareInputForAdd
/**
* @since version 0.84
**/
function prepareInputForAdd($input)
{
if (!isset($input['field']) || empty($input['field'])) {
return false;
}
return parent::prepareInputForAdd($input);
}
示例2: prepareInputForAdd
/**
* @see CommonDBChild::prepareInputForAdd()
**/
function prepareInputForAdd($input)
{
if (empty($input['end_date']) || $input['end_date'] == 'NULL' || $input['end_date'] < $input['begin_date']) {
$input['end_date'] = $input['begin_date'];
}
return parent::prepareInputForAdd($input);
}
示例3: prepareInputForAdd
function prepareInputForAdd($input)
{
// Check override of segment : do not add
if (count(self::getSegmentsBetween($input['calendars_id'], $input['day'], $input['begin'], $input['day'], $input['end'])) > 0) {
Session::addMessageAfterRedirect(__('Can not add a range riding an existing period'), false, ERROR);
return false;
}
return parent::prepareInputForAdd($input);
}
示例4: prepareInputForAdd
function prepareInputForAdd($input)
{
// Use massiveaction system to manage add system.
// Need to update data : value not set but
if (!isset($input['value'])) {
if (isset($input['field']) && isset($input[$input['field']])) {
$input['value'] = $input[$input['field']];
unset($input[$input['field']]);
unset($input['field']);
}
}
return parent::prepareInputForAdd($input);
}
示例5: prepareInputForAdd
function prepareInputForAdd($input)
{
if (isset($input["logical_number"]) && strlen($input["logical_number"]) == 0) {
unset($input["logical_number"]);
}
return parent::prepareInputForAdd($input);
}
示例6: prepareInputForAdd
function prepareInputForAdd($input)
{
// if ($job->fields["status"] == CommonITILObject::SOLVED
// || $job->fields["status"] == CommonITILObject::CLOSED) {
// return false;
// }
$input["users_id"] = 0;
// Only set requester on manual action
if (!isset($input['_auto_import']) && !isset($input['_auto_update']) && !Session::isCron()) {
$input["users_id"] = Session::getLoginUserID();
}
$input["submission_date"] = $_SESSION["glpi_currenttime"];
$input["status"] = 'waiting';
return parent::prepareInputForAdd($input);
}
示例7: prepareInputForAdd
/**
* @see CommonDBChild::prepareInputForAdd()
**/
function prepareInputForAdd($input)
{
global $CFG_GLPI;
if (!$this->getFromDBforDevice($input['itemtype'], $input['items_id'])) {
if ($item = static::getItemFromArray(static::$itemtype, static::$items_id, $input)) {
$input['alert'] = Entity::getUsedConfig('default_infocom_alert', $item->getEntityID());
return parent::prepareInputForAdd($input);
}
}
return false;
}
示例8: prepareInputForAdd
/**
* @see CommonDBChild::prepareInputForAdd()
**/
function prepareInputForAdd($input)
{
return parent::prepareInputForAdd($this->prepareInput($input));
}
示例9: prepareInputForAdd
function prepareInputForAdd($input)
{
return parent::prepareInputForAdd(self::cleanContentHtml($input));
}
示例10: prepareInputForAdd
/**
* @see CommonDBChild::prepareInputForAdd()
**/
function prepareInputForAdd($input)
{
// Error on previous added reservation on several add
if (isset($input['_ok']) && !$input['_ok']) {
return false;
}
// set new date.
$this->fields["reservationitems_id"] = $input["reservationitems_id"];
$this->fields["begin"] = $input["begin"];
$this->fields["end"] = $input["end"];
if (!$this->test_valid_date()) {
$this->displayError("date", $input["reservationitems_id"]);
return false;
}
if ($this->is_reserved()) {
$this->displayError("is_res", $input["reservationitems_id"]);
return false;
}
return parent::prepareInputForAdd($input);
}
示例11: prepareInputForAdd
function prepareInputForAdd($input)
{
// My preparation on $input
return parent::prepareInputForAdd($input);
}
示例12: prepareInputForAdd
function prepareInputForAdd($input)
{
// Check email validity
if (!isset($input['email']) || empty($input['email'])) {
return false;
}
// First email is default
if (countElementsInTable($this->getTable(), "`users_id` = '" . $input['users_id'] . "'") == 0) {
$input['is_default'] = 1;
}
return parent::prepareInputForAdd($input);
}
示例13: prepareInputForAdd
function prepareInputForAdd($input)
{
$input["users_id"] = 0;
// Only set requester on manual action
if (!isset($input['_auto_import']) && !isset($input['_auto_update']) && !Session::isCron()) {
$input["users_id"] = Session::getLoginUserID();
}
$input["submission_date"] = $_SESSION["glpi_currenttime"];
$input["status"] = self::WAITING;
if (!isset($input["users_id_validate"]) || $input["users_id_validate"] <= 0) {
return false;
}
return parent::prepareInputForAdd($input);
}
示例14: prepareInputForAdd
/**
* @see CommonDBTM::prepareInputForAdd
*/
function prepareInputForAdd($input)
{
if (isset($input["logical_number"]) && strlen($input["logical_number"]) == 0) {
unset($input["logical_number"]);
}
if (!isset($input["_no_history"])) {
$input['_no_history'] = false;
}
if (isset($input['_create_children']) && $input['_create_children']) {
$input = $this->splitInputForElements($input);
}
return parent::prepareInputForAdd($input);
}
示例15: prepareInputForAdd
/**
* @see CommonDBTM::prepareInputForAdd
*/
function prepareInputForAdd($input)
{
if (isset($input["logical_number"]) && strlen($input["logical_number"]) == 0) {
unset($input["logical_number"]);
}
$input = $this->splitInputForElements($input);
return parent::prepareInputForAdd($input);
}