How to create new Calendar ?

Moderator: crythias

Post Reply
kalyana1315
Znuny expert
Posts: 171
Joined: 24 Apr 2013, 12:29
Znuny Version: OTRS3.3
Real Name: kalyanachakravarthy M P
Company: TATA Technologies
Location: Pune,India
Contact:

How to create new Calendar ?

Post by kalyana1315 »

hello,

how to create new Framework -> Core::Time::Calendar10 ,11, like ??
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: How to create new Calendar ?

Post by RStraub »

There is a huge calendar block in the Kernel/Config/Files/Framework.xml:

Code: Select all

 <ConfigItem Name="TimeZone::Calendar1Name" Required="1" Valid="1">
        <Description Translatable="1">Defines the name of the indicated calendar.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::Time::Calendar1</SubGroup>
        <Setting>
            <String Regex="">Calendar Name 1</String>
        </Setting>
    </ConfigItem>
[...]
                <Day Name="Fri">
                    <Hour>8</Hour>
                    <Hour>9</Hour>
                    <Hour>10</Hour>
                    <Hour>11</Hour>
                    <Hour>12</Hour>
                    <Hour>13</Hour>
                    <Hour>14</Hour>
                    <Hour>15</Hour>
                    <Hour>16</Hour>
                    <Hour>17</Hour>
                    <Hour>18</Hour>
                    <Hour>19</Hour>
                    <Hour>20</Hour>
                </Day>
                <Day Name="Sat">
                </Day>
                <Day Name="Sun">
                </Day>
            </TimeWorkingHours>
        </Setting>
    </ConfigItem>
You probably have to copy such a block and increment the highest number. (followed by a rebuildconfig)
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
kalyana1315
Znuny expert
Posts: 171
Joined: 24 Apr 2013, 12:29
Znuny Version: OTRS3.3
Real Name: kalyanachakravarthy M P
Company: TATA Technologies
Location: Pune,India
Contact:

Re: How to create new Calendar ?

Post by kalyana1315 »

RStraub wrote:There is a huge calendar block in the Kernel/Config/Files/Framework.xml:

Code: Select all

 <ConfigItem Name="TimeZone::Calendar1Name" Required="1" Valid="1">
        <Description Translatable="1">Defines the name of the indicated calendar.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::Time::Calendar1</SubGroup>
        <Setting>
            <String Regex="">Calendar Name 1</String>
        </Setting>
    </ConfigItem>
[...]
                <Day Name="Fri">
                    <Hour>8</Hour>
                    <Hour>9</Hour>
                    <Hour>10</Hour>
                    <Hour>11</Hour>
                    <Hour>12</Hour>
                    <Hour>13</Hour>
                    <Hour>14</Hour>
                    <Hour>15</Hour>
                    <Hour>16</Hour>
                    <Hour>17</Hour>
                    <Hour>18</Hour>
                    <Hour>19</Hour>
                    <Hour>20</Hour>
                </Day>
                <Day Name="Sat">
                </Day>
                <Day Name="Sun">
                </Day>
            </TimeWorkingHours>
        </Setting>
    </ConfigItem>
You probably have to copy such a block and increment the highest number. (followed by a rebuildconfig)

any .pm file added or only adding Framework.xml ??
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to create new Calendar ?

Post by crythias »

Any such changes you might add (as .xml) is best to be created in its own .xml file within Kernel/Config/Files/ (myCalendars.xml as example)

Find the relevant header from the .xml file that contains a similar config. For this case, Framework.xml has:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<otrs_config version="1.0" init="Framework">
Then ConfigItem xml data (yours)
then close otrs_config

Code: Select all

</otrs_config>
Next, go to SysConfig (it will rebuild the list because it sees the new .xml file) and confirm your addition is enabled.
Where is it? (wherever Group/Subgroup is defined within ConfigItem)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply