本文整理匯總了PHP中CommonDropdown::doSpecificMassiveActions方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDropdown::doSpecificMassiveActions方法的具體用法?PHP CommonDropdown::doSpecificMassiveActions怎麽用?PHP CommonDropdown::doSpecificMassiveActions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonDropdown
的用法示例。
在下文中一共展示了CommonDropdown::doSpecificMassiveActions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doSpecificMassiveActions
/**
* @see CommonDBTM::doSpecificMassiveActions()
**/
function doSpecificMassiveActions($input = array())
{
$res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
switch ($input['action']) {
case "duplicate":
// For calendar duplicate in another entity
if (method_exists($this, 'duplicate')) {
$options = array();
if ($this->isEntityAssign()) {
$options = array('entities_id' => $input['entities_id']);
}
foreach ($input["item"] as $key => $val) {
if ($val == 1) {
if ($this->getFromDB($key)) {
if (!$this->isEntityAssign() || $input['entities_id'] != $this->getEntityID()) {
if ($this->can(-1, 'w', $options)) {
if ($this->duplicate($options)) {
$res['ok']++;
} else {
$res['ko']++;
}
} else {
$res['noright']++;
}
} else {
$res['ko']++;
}
} else {
$res['ko']++;
}
}
}
}
break;
default:
return parent::doSpecificMassiveActions($input);
}
return $res;
}
示例2: doSpecificMassiveActions
/**
* @see CommonDBTM::doSpecificMassiveActions()
**/
function doSpecificMassiveActions($input = array())
{
$res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
switch ($input['action']) {
default:
return parent::doSpecificMassiveActions($input);
}
return $res;
}
示例3: doSpecificMassiveActions
/**
* @see CommonDBTM::doSpecificMassiveActions()
**/
function doSpecificMassiveActions($input = array())
{
$res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
switch ($input['action']) {
case 'move_under':
if (isset($input['parent'])) {
$fk = $this->getForeignKeyField();
$parent = new $input["itemtype"]();
if ($parent->getFromDB($input['parent'])) {
foreach ($input["item"] as $key => $val) {
if ($val == 1 && $this->can($key, 'w')) {
// Check if parent is not a child of the original one
if (!in_array($parent->getID(), getSonsOf($this->getTable(), $this->getID()))) {
if ($this->update(array('id' => $key, $fk => $input['parent']))) {
$res['ok']++;
} else {
$res['ko']++;
}
} else {
$res['ko']++;
}
} else {
$res['noright']++;
}
}
}
}
break;
default:
return parent::doSpecificMassiveActions($input);
}
return $res;
}