Kernel::System::FAQ - faq lib
All faq functions. E. g. to add faqs or to get faqs.
new()
create a faq object
use Kernel::Config;
use Kernel::System::Log;
use Kernel::System::DB;
use Kernel::System::FAQ;
my $ConfigObject = Kernel::Config->new();
my $LogObject = Kernel::System::Log->new(
ConfigObject => $ConfigObject,
);
my $DBObject = Kernel::System::DB->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
);
my $FAQObject = Kernel::System::FAQ->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
);
FAQGet()
get an article
my %Article = $FAQObject->FAQGet(
ID => 1,
);
ItemVoteDataGet()
returns a hash with number and result of a item
my %Flag = $FAQObject->ItemVoteDataGet(
ItemID => 1,
);
FAQAdd()
add an article
my $ItemID = $FAQObject->FAQAdd(
Number => '13402',
Title => 'Some Text',
CategoryID => 1,
StateID => 1,
LanguageID => 1,
Field1 => 'Problem...',
Field2 => 'Solution...',
FreeKey1 => 'Software',
FreeText1 => 'Apache 3.4.2',
FreeKey2 => 'OS',
FreeText2 => 'OpenBSD 4.2.2',
# attachment options (not required)
Filename => $Filename,
Content => $Content,
ContentType => $ContentType,
);
AttachmentAdd()
AttachmentGet()
AttachmentDelete()
AttachmentSearch()
FAQUpdate()
update an article
$FAQObject->FAQUpdate(
CategoryID => 1,
StateID => 1,
LanguageID => 1,
Title => 'Some Text',
Field1 => 'Problem...',
Field2 => 'Solution...',
FreeKey1 => 'Software',
FreeText1 => 'Apache 3.4.2',
FreeKey2 => 'OS',
FreeText2 => 'OpenBSD 4.2.2',
# attachment options (not required)
Filename => $Filename,
Content => $Content,
ContentType => $ContentType,
);
FAQCount()
count an article
$FAQObject->FAQCount(
CategoryIDs => [1,2,3,4],
);
VoteAdd()
add an article
my $ItemID = $FAQObject->FAQVote(
CreateBy => 'Some Text',
ItemID => '123456',
IP => 54.43.30.1',
Interface => 'Some Text',
Rate => 100,
);
VoteGet()
add an article
my %VoteData = %{$FAQObject->VoteGet(
CreateBy => 'Some Text',
ItemID => '123456',
Interface => 'Some Text',
)};
VoteSearch()
returns a array with VoteIDs
my @FAQIDs = @{$FAQObject->VoteSearch(
ItemID => 1,
)};
VoteDelete()
add an article
my $Flag = $FAQObject->VoteDelete(
VoteID => 1,
);
FAQDelete()
delete an article
$Flag = $FAQObject->FAQDelete(ItemID => 1);
FAQHistoryAdd()
add an history to an article
$Flag = $FAQObject->FAQHistoryAdd(
ItemID => 1,
Name => 'Updated Article.',
);
FAQHistoryGet()
get a array with hachref (Name, Created) with history of an article back
my @Data = @{$FAQObject->FAQHistoryGet(
ItemID => 1,
)};
FAQHistoryDelete()
delete an history of an article
$FAQObject->FAQHistoryDelete(
ItemID => 1,
);
HistoryGet()
get the system history
my @Data = @{$FAQObject->HistoryGet()};
CategoryList()
get the category list as hash
my %Categories = %{$FAQObject->CategoryList(
Valid => 1,
)};
CategorySearch()
get the category search as hash
my @CategorieIDs = @{$FAQObject->CategorySearch(
Name => "Name"
)};
CategoryGet()
get a category as hash
my %Category = $FAQObject->CategoryGet(
ID => 1,
);
CategorySubCategoryIDList()
get all subcategory ids of of a category
my %Category = $FAQObject->CategorySubCategorieIDList(
ParentID => 1,
ItemStates => [1,2,3]
);
CategoryAdd()
add a category
my $ID = $FAQObject->CategoryAdd(
Name => 'Some Category',
Comment => 'some comment ...',
);
CategoryUpdate()
update a category
$FAQObject->CategoryUpdate(
ID => 1,
Name => 'Some Category',
Comment => 'some comment ...',
);
CategoryDuplicateCheck()
check a category
$FAQObject->CategoryDuplicateCheck(
ID => 1, # or
Name => 'Some Name',
ParentID => 1,
);
CategoryCount()
count an article
$FAQObject->CategoryCount(
ParentIDs => [1,2,3,4],
);
StateTypeList()
get the state type list as hash
my %StateTypes = $FAQObject->StateTypeList();
StateList()
get the state list as hash
my %States = $FAQObject->StateList();
StateUpdate()
update a state
$FAQObject->StateUpdate(
ID => 1,
Name => 'public',
TypeID => 1,
);
StateAdd()
add a state
my $ID = $FAQObject->StateAdd(
ID => 1,
Name => 'public',
TypeID => 1,
);
StateGet()
get a state as hash
my %State = $FAQObject->StateGet(
ID => 1,
);
StateTypeGet()
get a state as hash
my %State = $FAQObject->StateGet(
ID => 1, # or
Name => 'internal',
);
LanguageList()
get the language list as hash
my %Languages = $FAQObject->LanguageList();
LanguageUpdate()
update a language
$FAQObject->LanguageUpdate(
ID => 1,
Name => 'Some Category',
);
LanguageDuplicateCheck()
check a language
$FAQObject->LanguageDuplicateCheck(
Name => 'Some Name',
ID => 1, # for update
);
LanguageAdd()
add a language
my $ID = $FAQObject->LanguageAdd(
Name => 'Some Category',
);
LanguageGet()
get a language as hash
my %Language = $FAQObject->LanguageGet(
ID => 1,
);
FAQSearch()
search in articles
my @IDs = $FAQObject->FAQSearch(
Number => '*134*',
What => '*some text*',
Keywords => '*webserver*',
States = ['public', 'internal'],
Order => 'changed'
Sort => 'ASC'
Limit => 150,
);
FAQPathListGet()
returns a category array
my @IDs = $FAQObject->FAQPathListGet(
CategoryID => 150,
);
GetCategoryTree()
get all categories as tree
my $Hash = $FAQObject->GetCategoryTree(
Valid => 0, # if 1 then check valid category
);
This software is part of the OTRS project (http://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
$Revision: 1.6 $ $Date: 2006-12-13 15:22:01 $
Hey! The above document had some coding errors, which are explained below:
Around line 501:
You forgot a '=back' before '=head1'