本文整理匯總了PHP中CommonDBTM::canCreateItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDBTM::canCreateItem方法的具體用法?PHP CommonDBTM::canCreateItem怎麽用?PHP CommonDBTM::canCreateItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::canCreateItem方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: canCreateItem
function canCreateItem()
{
// From Ticket Document Tab => check right to add followup.
if (isset($this->fields['tickets_id']) && $this->fields['tickets_id'] > 0) {
$ticket = new Ticket();
if ($ticket->getFromDB($this->fields['tickets_id'])) {
return $ticket->canAddFollowups();
}
}
if (Session::haveRight('document', 'w')) {
return parent::canCreateItem();
}
return false;
}
示例2: canCreateItem
function canCreateItem()
{
if (isset($this->input['itemtype']) && isset($this->input['items_id'])) {
if ($item = getItemForItemtype($this->input['itemtype'])) {
if ($item->canAddItem('Document')) {
return true;
}
}
}
// From Ticket Document Tab => check right to add followup.
if (isset($this->fields['tickets_id']) && $this->fields['tickets_id'] > 0) {
$ticket = new Ticket();
if ($ticket->getFromDB($this->fields['tickets_id'])) {
return $ticket->canAddFollowups();
}
}
if (Session::haveRight('document', 'w')) {
return parent::canCreateItem();
}
return false;
}
示例3: canCreateItem
/**
* Special case: a private bookmark has entities_id==-1 => we cannot check it
* @see CommonDBTM::canCreateItem()
*
* @since version 0.85
**/
function canCreateItem()
{
if ($this->fields['is_private'] == 1 && $this->fields['users_id'] == Session::getLoginUserID()) {
return true;
}
return parent::canCreateItem();
}