From ce71eba99413a82b6765a1672ce6edf4b31597ff Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 Oct 2021 11:17:50 +0200 Subject: [PATCH] Block opening date --- inc/config.class.php | 12 ++++++++++-- inc/ticket.class.php | 23 +++++++++++++++++++++++ locales/de_DE.mo | Bin 1034 -> 1075 bytes locales/de_DE.po | 11 ++++++++--- locales/en_GB.mo | Bin 1091 -> 1102 bytes locales/en_GB.po | 12 ++++++++---- locales/es_ES.mo | Bin 956 -> 1017 bytes locales/es_ES.po | 14 +++++++++----- locales/gl_ES.mo | Bin 952 -> 993 bytes locales/gl_ES.po | 8 ++++++-- locales/hr_HR.mo | Bin 1083 -> 1124 bytes locales/hr_HR.po | 8 ++++++-- locales/yagp.pot | 14 +++++++++----- setup.php | 4 ++++ 14 files changed, 83 insertions(+), 23 deletions(-) create mode 100644 inc/ticket.class.php diff --git a/inc/config.class.php b/inc/config.class.php index 2a96422..2c7c0b1 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -104,6 +104,11 @@ static function showConfigForm() { Dropdown::showYesNo("gototicket", $config->fields["gototicket"]); echo "\n"; + echo ""; + echo "".__("Block opening date", "yagp").""; + Dropdown::showYesNo("blockdate", $config->fields["blockdate"]); + echo "\n"; + $config->showFormButtons(['candel'=>false]); return false; @@ -142,6 +147,7 @@ public static function install(Migration $migration) { `contractrenew` tinyint(1) NOT NULL default '0', `fixedmenu` tinyint(1) NOT NULL default '0', `gototicket` tinyint(1) NOT NULL default '0', + `blockdate` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; $DB->query($query) or die ($DB->error()); @@ -151,10 +157,12 @@ public static function install(Migration $migration) { 'contractrenew' => 0, 'fixedmenu' => 0, 'gototicket' => 0, + 'blockdate' => 0, ]); }else{ - $migration->addField($table, 'fixedmenu', "tinyint(1) NOT NULL default '0'"); - $migration->addField($table, 'gototicket', "tinyint(1) NOT NULL default '0'"); + $migration->addField($table, 'fixedmenu', 'boolean'); + $migration->addField($table, 'gototicket', 'boolean'); + $migration->addField($table, 'blockdate', 'boolean'); $migration->migrationOneTable($table); } } diff --git a/inc/ticket.class.php b/inc/ticket.class.php new file mode 100644 index 0000000..56c9860 --- /dev/null +++ b/inc/ticket.class.php @@ -0,0 +1,23 @@ +getType() == Ticket::getType()) { + $date = ($item->getID()) ? $item->fields['date'] : '' ; + $script = <<oG7es4z1y@B-;zAngI96M-}zkX{9(<$&}~Agu(XZvbf) zApILiivVd5M;1tlvTWR?%cvHj>s*wYSdy8ar|Xhfl4_-3WME{dYiOWrV6I?jXk}=u OZD3?zu=xq28WRBdU=}d| delta 94 zcmdnY(Zw+#$Iq3Kfnh5U>oG7e{AOZc;04lJ%nS@3K-vOG^8x8bAT0-^Cje7{y#$CFMn+2GZnE+*f4Cw#> diff --git a/locales/de_DE.po b/locales/de_DE.po index a73b08b..4c09679 100644 --- a/locales/de_DE.po +++ b/locales/de_DE.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: YAGP\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 12:06+0200\n" +"POT-Creation-Date: 2021-10-07 11:13+0200\n" "PO-Revision-Date: 2020-07-27 09:12+0200\n" "Last-Translator: Milo Ivir \n" "Language-Team: \n" @@ -20,13 +20,14 @@ msgstr "" "X-Generator: Poedit 2.0.6\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: inc/config.class.php:45 inc/config.class.php:116 +#: inc/config.class.php:45 inc/config.class.php:121 msgid "Yagp" msgstr "Yagp" #: inc/config.class.php:88 msgid "Change ticket solved date to last task end time" -msgstr "Ändere das Schlussdatum des Tickets in die End-Zeit der letzten Aufgabe" +msgstr "" +"Ändere das Schlussdatum des Tickets in die End-Zeit der letzten Aufgabe" #: inc/config.class.php:93 msgid "Auto renew tacit contracts" @@ -40,6 +41,10 @@ msgstr "" msgid "Go to ticket" msgstr "" +#: inc/config.class.php:108 +msgid "Block opening date" +msgstr "" + #: inc/contractrenew.class.php:5 msgid "YagpContractRenew" msgstr "Yagp Vetrag erneuern" diff --git a/locales/en_GB.mo b/locales/en_GB.mo index 510ac9dd5b0506d9ef6094e43da4967fa7bf9b66..c9edcd9bb23a5ab5bf9cec4d862bcd8f52e79d7e 100644 GIT binary patch delta 390 zcmZ|Ku}cC`9KiA4JGCxPhps3Hqlb%=bq|85p`p34UBpDh&;}iI|9#%J8ZDQ0oL{QixbB14G+kyBnQYN(c3ga)XgJJiqvYUl+u^oAOG zM-6?Uh9W8&D)Z3q6(l6bNG835RJy|SX14nG8v9#oY`8DID2EzcVOIUF*^AGvdX0|l tT{pY!Zp&WQ`%Qn7nfM>G?=OOlqN}>3njBf@PTZmI2cIVItttI;>=*o2FXI3J delta 390 zcmZ|KF-yZh7{>9tw%Qn76lp;Mjk8?62B}iqbf}Xe?$RMhmI_+LK`7`hLhuXtF**pv z$whGKB+lLX2@3w7wyOtEen~F(KIAL-2>QPprB}mRBN2HZ>*R-M#nzZD+{RTr#9eG- zi1(=L*~ZisZy+GdoDI{TE|KNj*;;;SCnp!~=qBy-vg@up v?)1`DocP2$zweU0xRJDcbBAXio}Ie$^e(&o_q&68ynl|+p+JFjG@IY}gH0hwwr6_LVA})@hJ!?>s7*iLAZmwE_4(=k( zf|LCZ99=r-U*RGm_`Oi8RLQD>`e<%7`-i`)q7vEw@#wwv5aCB24P#a{8aV6 zZ_NY09cS0Ms&w|$d2kj)p|j1Wx~#c1&+%Nx-H@JF_tvwL@t8ds`xSalJIYVwp=uua UvZbUSt0e6tepbvs7j&Wc1z1iwLI3~& delta 328 zcmey#zK6a3o)F7a1|Z-BVi_P#0b*VtUIWA+@BoOVfcPO0a|7`oAl3(B4n_tBE+B0I zqgtAO-;r5HXpTQGT*L zAj0}tnbPddPjZ72_jjRmJw1IpBt^j}CpwzO= YVw~zMCaW{8WYRO7e1R!svOV)w09}YH&Hw-a diff --git a/locales/es_ES.po b/locales/es_ES.po index e4cff70..bf5c9c0 100644 --- a/locales/es_ES.po +++ b/locales/es_ES.po @@ -7,20 +7,20 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 12:06+0200\n" -"PO-Revision-Date: 2020-07-24 12:08+0200\n" +"POT-Creation-Date: 2021-10-07 11:13+0200\n" +"PO-Revision-Date: 2021-10-07 11:16+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: es_ES\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.3.1\n" +"X-Generator: Poedit 2.3\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: inc/config.class.php:45 inc/config.class.php:116 +#: inc/config.class.php:45 inc/config.class.php:121 msgid "Yagp" -msgstr "" +msgstr "Yagp" #: inc/config.class.php:88 msgid "Change ticket solved date to last task end time" @@ -38,6 +38,10 @@ msgstr "Menú fijo" msgid "Go to ticket" msgstr "Ir al ticket" +#: inc/config.class.php:108 +msgid "Block opening date" +msgstr "Bloquear fecha de apertura" + #: inc/contractrenew.class.php:5 msgid "YagpContractRenew" msgstr "" diff --git a/locales/gl_ES.mo b/locales/gl_ES.mo index 236e0add544713f1f1aeecf6ddfd01262a9eabd1..c3a9ec3cc9ec6a343226d8fdbc19a769324fb0eb 100644 GIT binary patch delta 124 zcmdnN{*Zk_imM+Z1H(ih)?;8`c)-NKzyqZDnHds*wYSdy8ar|Xhfl4_-3WME{dYiOWrV6I?jXk}=uZD3?z Kuz3&TA4UL{F&1h7 delta 85 zcmaFJzJq;2imNIk1H(ih)?;8`*v`bjzyqY80qHOx{TWDe0ckI01_oXr9SWpHfpjvE XmIl(5Kw1e%Pu;jujB)b|#-EG;DX|Sp diff --git a/locales/gl_ES.po b/locales/gl_ES.po index ceaaf27..70885d5 100644 --- a/locales/gl_ES.po +++ b/locales/gl_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 12:06+0200\n" +"POT-Creation-Date: 2021-10-07 11:13+0200\n" "PO-Revision-Date: 2020-07-27 09:10+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -18,7 +18,7 @@ msgstr "" "X-Generator: Poedit 2.0.6\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: inc/config.class.php:45 inc/config.class.php:116 +#: inc/config.class.php:45 inc/config.class.php:121 msgid "Yagp" msgstr "" @@ -40,6 +40,10 @@ msgstr "Menú fixo" msgid "Go to ticket" msgstr "Ir a peticion" +#: inc/config.class.php:108 +msgid "Block opening date" +msgstr "" + #: inc/contractrenew.class.php:5 msgid "YagpContractRenew" msgstr "" diff --git a/locales/hr_HR.mo b/locales/hr_HR.mo index 037017ebc89b2c71326666872b683026ad93e6e4..1cd64e9b7a9e104dd1d0bfa4e8d2335ac5456ee3 100644 GIT binary patch delta 132 zcmdnZ@q}YSj_-Cx28OLbtir&+kju=#zz?J+0cj5)y$DEi1L@a5S_(*i2h!3&T8M># z0f-p%fP@f`HU`qNK-z8NPCZ7o5MAe@)Wnj^{5)Nk#FA7i1tS9^LtR4yT?2CkLqjV= PV{HQ?1B1;^7{i$WVoMhb delta 93 zcmaFDv72K;j&C0$1H)DzR$*XZaA9U(;0Mx~K-vRHR|08nAbki(O9AO~Kw26|zXZ}O bK$;au2mxs>AT0}|WjF5BW85sj6v6}mZ+i>H diff --git a/locales/hr_HR.po b/locales/hr_HR.po index 5a52b4f..358744c 100644 --- a/locales/hr_HR.po +++ b/locales/hr_HR.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: YAGP\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 12:06+0200\n" +"POT-Creation-Date: 2021-10-07 11:13+0200\n" "PO-Revision-Date: 2020-07-27 09:11+0200\n" "Last-Translator: Milo Ivir \n" "Language-Team: \n" @@ -21,7 +21,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" -#: inc/config.class.php:45 inc/config.class.php:116 +#: inc/config.class.php:45 inc/config.class.php:121 msgid "Yagp" msgstr "Yagp" @@ -41,6 +41,10 @@ msgstr "" msgid "Go to ticket" msgstr "" +#: inc/config.class.php:108 +msgid "Block opening date" +msgstr "" + #: inc/contractrenew.class.php:5 msgid "YagpContractRenew" msgstr "Yagp obnovi ugovor" diff --git a/locales/yagp.pot b/locales/yagp.pot index 659e1f5..ddfa03e 100644 --- a/locales/yagp.pot +++ b/locales/yagp.pot @@ -1,15 +1,15 @@ # YAGP Glpi Plugin. -# Copyright (C) 2020 TICgal +# Copyright (C) 2021 TICgal # This file is distributed under the same license as the PACKAGE package. -# TICgal, 2020 +# TICgal, 2021 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 12:09+0200\n" -"PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n" +"POT-Creation-Date: 2021-10-07 11:13+0200\n" +"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: inc/config.class.php:45 inc/config.class.php:116 +#: inc/config.class.php:45 inc/config.class.php:121 msgid "Yagp" msgstr "" @@ -37,6 +37,10 @@ msgstr "" msgid "Go to ticket" msgstr "" +#: inc/config.class.php:108 +msgid "Block opening date" +msgstr "" + #: inc/contractrenew.class.php:5 msgid "YagpContractRenew" msgstr "" diff --git a/setup.php b/setup.php index 90f1ea4..53b118c 100644 --- a/setup.php +++ b/setup.php @@ -49,6 +49,10 @@ function plugin_init_yagp() { if ($config->fields['gototicket']) { $PLUGIN_HOOKS['add_javascript']['yagp']='js/gototicket.js'; } + + if ($config->fields['blockdate']) { + $PLUGIN_HOOKS['post_item_form']['yagp'] = ['PluginYagpTicket', 'postItemForm']; + } } }