Thank you Torsten
I've been exploring this alternatives you mention in your email before I read it.I'm very happy to know that this ways to solve the problem are the same I've found, so I think I'm not wrong at all :) Another way is to make a .pm with many "z"s at the beginign of the name (as the XML) Have you notice this? if you use the config object to intert a config value via ConfigItemUpdate, the configuration value will be inseted in zzauto.pm no matter if the value is already in the file (so it will be duplicated) and after, if you enter to the sysconfig and modify any other value the "zzauto.pm" will be cleaned leaving the lastest values of the configuration options. (in this case the lastets value is the one you've insert) Saludos, Carlos Fernando Rodríguez Hdz. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Torsten Thau Sent: Friday, May 22, 2009 4:09 AM To: Development community of OTRS.org Subject: Re: [dev] Code to Upload a Configuration File -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Carlos, > Does anyone knows Is there any way to access the config upload functions > via code in a Package installation? For example to write the config > file, please it some ware in the filesystem and upload it to the main > configuration, or to upload the config options itself via code in a package Do you want to change existing values or simply add new configuration values? However, for new configuration values you should use xml-files as <OTRS_HOME>/Kernel/Config/Ticket.xml (which contains a lot of config values). For updated or changed values which are already defined you can use a similar approach - as long as your XML-file gets read later than the original. For instance you can write a ZZZZMyDefaultTicket.xml which overwrite original OTRS default config with your default ticke config. Another approach, which is more understandable, is to use a Kernel::System::Config object to set your config values. Just insert the corresponding code in the CodeInstall section of your sopm. The original default values are not affected then. A simple sample, which adds a new queue-layout to the 'PreferencesGroups###QueueView' SysConfig queue: #-------------------------------------------------------------------- $Self->{ConfigQueueView} = Kernel::System::Config->new(%{$Self}); $Self->{ConfigQueueView}->ConfigItemUpdate( Valid => 1, Key => 'PreferencesGroups###QueueView', Value => { 'Prio' => '3000', 'Label' => 'QueueView', 'DataSelected' => 'AgentTicketQueueTicketView', 'PrefKey' => 'UserQueueView', 'Module' => 'Kernel::Output::HTML::PreferencesGeneric', 'Desc' => 'Select your frontend QueueView.', 'Data' => { 'AgentTicketQueueTicketViewLite' => 'Lite', 'AgentTicketQueueTicketViewFoldable' => 'Foldable', 'AgentTicketQueueTicketView' => 'Standard' }, 'Colum' => 'Frontend', 'Activ' => '1' } ); #-------------------------------------------------------------------- See also http://dev.otrs.org/2.3/Kernel/System/Config.html for more information. regards, Torsten Thau - -- Torsten Thau, Dipl. Inform. c.a.p.e. IT Labs GbR - Annaberger Str. 240 - D-09125 Chemnitz phone: +49 371 5347 623 cell: +49 176 66 680 680 personal pgp-key: 0x93E0A174 fax: +49 371 5347 625 http://www.cape-it.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkoWa5gACgkQvXo8m5PgoXQkigCbBT+a87PYnHB/8TfAp/1C5P13 riwAn2NFMNVGZGJ8Ww7qXOKzK360TOFG =DCGO -----END PGP SIGNATURE----- --------------------------------------------------------------------- OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW! http://www.otrs.com/en/support/enterprise-subscription/ --------------------------------------------------------------------- OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW! http://www.otrs.com/en/support/enterprise-subscription/
