创建OTRS模块

时间:2017-07-19 10:52:46

标签: javascript module frontend otrs

我已经创建了一个新的OTRS模块,但是我对Javascript文件有一些问题 实际上它似乎根本没有执行。

enter image description here

如有必要,我可以发送包文件以获取帮助。

这是.sopm文件。



<?xml version="1.0" encoding="utf-8" ?>
<otrs_package version="1.0">
    <Name>Stat</Name>
    <Version>1.0.0</Version>
    <Framework>5.0.19</Framework>
    <Vendor>OTRS</Vendor>
    <URL>www.otrs.org</URL>
    <License>GNU AFFERO GENERAL PUBLIC LICENSE Version 3, November 2007</License>
    <ChangeLog Version="5.0.19" Date="2017-07-14 16:00:11">Init Custom Stats.</ChangeLog>
    <ChangeLog Version="5.0.19" Date="2017-07-19 09:57:11">Delete some files and change some directories.</ChangeLog>
    <Description Lang="en">Stat</Description>
    <IntroInstall Type="post" Lang="en" Title="Thank you!">Thank you for instaling this.</IntroInstall>
    <BuildDate>?</BuildDate>
    <BuildHost>?</BuildHost>
    <Filelist>
        <File Permission="755" Location="Stats/Kernel/Config/Files/stats.xml"></File>
        <File Permission="755" Location="Stats/Kernel/System/CustomStats.pm"></File>
        <File Permission="755" Location="Stats/Kernel/Modules/AgentCustomStats.pm"></File>
        <File Permission="755" Location="Stats/Kernel/Language/de_CustomStats.pm"></File>
        <File Permission="755" Location="Stats/Kernel/Output/HTML/Templates/Standard/AgentCustomStats.tt"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/jquery.min.js"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/bootstrap.min.js"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/fastclick.js"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/jquery.flot.js"></File>
        <File Permission="666" Location="Stats/var/httpd/htdocs/js/jquery.flot.resize.js"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/jquery.flot.pie.js"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/jquery.flot.categories.js"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/customscript.js"></File>
<!--         <File Permission="755" Location="Stats/var/httpd/htdocs/js/demo.js"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/js/adminlte.min.js"></File> -->
        <File Permission="755" Location="Stats/var/httpd/htdocs/fonts/fontawesome-webfont.woff2"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/fonts/fontawesome-webfont.woff"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/fonts/fontawesome-webfont.ttf"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/fonts/fontawesome-webfont.svg"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/fonts/fontawesome-webfont.eot"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/fonts/FontAwesome.otf"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/css/bootstrap.min.css"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/css/font-awesome.min.css"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/css/ionicons.min.css"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/css/AdminLTE.min.css"></File>
        <File Permission="755" Location="Stats/var/httpd/htdocs/css/all-skins.min.css"></File>
    </Filelist>
</otrs_package>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:0)

您需要在stats.xml文件(注册模块)的部分中定义JS文件。请查看此https://github.com/OTRS/otrs/blob/master/Kernel/Config/Files/Calendar.xml文件的第67-75行作为示例。

答案 1 :(得分:0)

  

要加载的JavaScript文件列表是在模块注册设置Loader中配置的:

<FrontendModuleReg>
  ...
  <Loader>
     <JavaScript>thirdparty/flot/excanvas.js</JavaScript>
     <JavaScript>thirdparty/flot/jquery.flot.js</JavaScript>
     <JavaScript>Core.Agent.Dashboard.js</JavaScript>
  </Loader>
</FrontendModuleReg>