From 941169836e3424e8ef92eccde5fccf4b1f896d78 Mon Sep 17 00:00:00 2001 From: Kilian Saffran Date: Mon, 8 Oct 2018 15:26:28 +0200 Subject: [PATCH] installer modifications --- License.txt | 167 ++-- app_v3/chrome.manifest_basic | 4 +- app_v3/chrome.manifest_localmanager | 2 +- app_v3/chrome/content/creorga.xul | 43 +- app_v3/chrome/content/js/init.js | 36 +- app_v3/chrome/content/js/system.js | 6 +- app_v3/chrome/content/license.html | 205 +++-- .../modules/calendar/calactivity_basic.html | 114 --- .../modules/calendar/calendar_basic.xul | 14 - .../modules/calendar/calvacancy_basic.html | 72 -- .../modules/calendar/js/calactivity_basic.js | 731 ------------------ .../modules/calendar/js/calvacancy_basic.js | 467 ----------- .../modules/calendar/js/calvacancy_free.js | 471 ----------- .../chrome/content/modules/forms/forms.html | 2 +- .../content/modules/forms/forms_basic.html | 55 -- .../content/modules/forms/forms_basic.xul | 8 - .../chrome/content/modules/forms/js/forms.js | 11 +- .../content/modules/forms/js/forms_basic.js | 55 -- .../modules/logbook/js/logactivity_free.js | 327 -------- .../modules/logbook/js/logchild_free.js | 359 --------- .../modules/logbook/js/logcominterne_free.js | 328 -------- .../content/modules/staff/coworker.html | 2 - app_v3/chrome/content/web/childs_basic.html | 61 -- app_v3/chrome/content/web/js/childs.js | 11 +- app_v3/chrome/content/web/js/childs_basic.js | 140 ---- install/create_setup_windows.pl | 183 ++--- 26 files changed, 311 insertions(+), 3563 deletions(-) delete mode 100644 app_v3/chrome/content/modules/calendar/calactivity_basic.html delete mode 100644 app_v3/chrome/content/modules/calendar/calendar_basic.xul delete mode 100644 app_v3/chrome/content/modules/calendar/calvacancy_basic.html delete mode 100644 app_v3/chrome/content/modules/calendar/js/calactivity_basic.js delete mode 100644 app_v3/chrome/content/modules/calendar/js/calvacancy_basic.js delete mode 100644 app_v3/chrome/content/modules/calendar/js/calvacancy_free.js delete mode 100644 app_v3/chrome/content/modules/forms/forms_basic.html delete mode 100644 app_v3/chrome/content/modules/forms/forms_basic.xul delete mode 100644 app_v3/chrome/content/modules/forms/js/forms_basic.js delete mode 100644 app_v3/chrome/content/modules/logbook/js/logactivity_free.js delete mode 100644 app_v3/chrome/content/modules/logbook/js/logchild_free.js delete mode 100644 app_v3/chrome/content/modules/logbook/js/logcominterne_free.js delete mode 100644 app_v3/chrome/content/web/childs_basic.html delete mode 100644 app_v3/chrome/content/web/js/childs_basic.js diff --git a/License.txt b/License.txt index 876dafc..d54e195 100644 --- a/License.txt +++ b/License.txt @@ -1,70 +1,97 @@ -Creorga 3.0 -Copyright (c) 2018 DKS - -*** END USER LICENSE AGREEMENT *** - -IMPORTANT: PLEASE READ THIS LICENSE CAREFULLY BEFORE USING THIS SOFTWARE. - -1. LICENSE - -By receiving, opening the file package, and/or using Creorga 3.0("Software") containing this software, you agree that this End User User License Agreement(EULA) is a legally binding and valid contract and agree to be bound by it. You agree to abide by the intellectual property laws and all of the terms and conditions of this Agreement. - -Unless you have a different license agreement signed by DKS your use of Creorga 3.0 indicates your acceptance of this license agreement and warranty. - -Subject to the terms of this Agreement, DKS grants to you a limited, non-exclusive, non-transferable license, without right to sub-license, to use Creorga 3.0 in accordance with this Agreement and any other written agreement with DKS. DKS does not transfer the title of Creorga 3.0 to you; the license granted to you is not a sale. This agreement is a binding legal agreement between DKS and the purchasers or users of Creorga 3.0. - -If you do not agree to be bound by this agreement, remove Creorga 3.0 from your computer now and, if applicable, promptly return to DKS by mail any copies of Creorga 3.0 and related documentation and packaging in your possession. - -2. DISTRIBUTION - -Creorga 3.0 and the license herein granted shall not be copied, shared, distributed, re-sold, offered for re-sale, transferred or sub-licensed in whole or in part except that you may make one copy for archive purposes only. For information about redistribution of Creorga 3.0 contact DKS. - -3. USER AGREEMENT - -3.1 Use - -Your license to use Creorga 3.0 is limited to the number of licenses purchased by you. You shall not allow others to use, copy or evaluate copies of Creorga 3.0. - -3.2 Use Restrictions - -You shall use Creorga 3.0 in compliance with all applicable laws and not for any unlawful purpose. Without limiting the foregoing, use, display or distribution of Creorga 3.0 together with material that is pornographic, racist, vulgar, obscene, defamatory, libelous, abusive, promoting hatred, discriminating or displaying prejudice based on religion, ethnic heritage, race, sexual orientation or age is strictly prohibited. - -Each licensed copy of Creorga 3.0 may be used on one single computer location by one user. Use of Creorga 3.0 means that you have loaded, installed, or run Creorga 3.0 on a computer or similar device. If you install Creorga 3.0 onto a multi-user platform, server or network, each and every individual user of Creorga 3.0 must be licensed separately. - -You may make one copy of Creorga 3.0 for backup purposes, providing you only have one copy installed on one computer being used by one person. Other users may not use your copy of Creorga 3.0 . The assignment, sublicense, networking, sale, or distribution of copies of Creorga 3.0 are strictly forbidden without the prior written consent of DKS. It is a violation of this agreement to assign, sell, share, loan, rent, lease, borrow, network or transfer the use of Creorga 3.0. If any person other than yourself uses Creorga 3.0 registered in your name, regardless of whether it is at the same time or different times, then this agreement is being violated and you are responsible for that violation! - -3.3 Copyright Restriction - -This Software contains copyrighted material, trade secrets and other proprietary material. You shall not, and shall not attempt to, modify, reverse engineer, disassemble or decompile Creorga 3.0. Nor can you create any derivative works or other works that are based upon or derived from Creorga 3.0 in whole or in part. - -DKS's name, logo and graphics file that represents Creorga 3.0 shall not be used in any way to promote products developed with Creorga 3.0 . DKS retains sole and exclusive ownership of all right, title and interest in and to Creorga 3.0 and all Intellectual Property rights relating thereto. - -Copyright law and international copyright treaty provisions protect all parts of Creorga 3.0, products and services. No program, code, part, image, audio sample, or text may be copied or used in any way by the user except as intended within the bounds of the single user program. All rights not expressly granted hereunder are reserved for DKS. - -3.4 Limitation of Responsibility - -You will indemnify, hold harmless, and defend DKS , its employees, agents and distributors against any and all claims, proceedings, demand and costs resulting from or in any way connected with your use of DKS's Software. - -In no event (including, without limitation, in the event of negligence) will DKS , its employees, agents or distributors be liable for any consequential, incidental, indirect, special or punitive damages whatsoever (including, without limitation, damages for loss of profits, loss of use, business interruption, loss of information or data, or pecuniary loss), in connection with or arising out of or related to this Agreement, Creorga 3.0 or the use or inability to use Creorga 3.0 or the furnishing, performance or use of any other matters hereunder whether based upon contract, tort or any other theory including negligence. - -DKS's entire liability, without exception, is limited to the customers' reimbursement of the purchase price of the Software (maximum being the lesser of the amount paid by you and the suggested retail price as listed by DKS ) in exchange for the return of the product, all copies, registration papers and manuals, and all materials that constitute a transfer of license from the customer back to DKS. - -3.5 Warranties - -Except as expressly stated in writing, DKS makes no representation or warranties in respect of this Software and expressly excludes all other warranties, expressed or implied, oral or written, including, without limitation, any implied warranties of merchantable quality or fitness for a particular purpose. - -3.6 Governing Law - -This Agreement shall be governed by the law of the Luxembourg applicable therein. You hereby irrevocably attorn and submit to the non-exclusive jurisdiction of the courts of Luxembourg therefrom. If any provision shall be considered unlawful, void or otherwise unenforceable, then that provision shall be deemed severable from this License and not affect the validity and enforceability of any other provisions. - -3.7 Termination - -Any failure to comply with the terms and conditions of this Agreement will result in automatic and immediate termination of this license. Upon termination of this license granted herein for any reason, you agree to immediately cease use of Creorga 3.0 and destroy all copies of Creorga 3.0 supplied under this Agreement. The financial obligations incurred by you shall survive the expiration or termination of this license. - -4. DISCLAIMER OF WARRANTY - -THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. THIS DISCLAIMER CONCERNS ALL FILES GENERATED AND EDITED BY Creorga 3.0 AS WELL. - -5. CONSENT OF USE OF DATA - -You agree that DKS may collect and use information gathered in any manner as part of the product support services provided to you, if any, related to Creorga 3.0.DKS may also use this information to provide notices to you which may be of use or interest to you. +LICENCE PUBLIQUE DE L'UNION EUROPÉENNE v. 1.2 +EUPL © Union européenne 2007, 2016 + +La présente licence publique de l'Union européenne («EUPL») s'applique à toute œuvre (telle que définie ci-dessous) fournie aux conditions prévues par la présente licence. Toute utilisation de l'œuvre autre que ce qu'autorise la présente licence est interdite (dans la mesure où pareille utilisation est couverte par un droit du titulaire des droits d'auteur sur l'œuvre). L'œuvre est fournie aux conditions prévues par la présente licence quand le donneur de licence (tel que défini ci-dessous) a placé la mention suivante immédiatement après la déclaration relative au droit d'auteur sur l'œuvre: + Sous licence EUPL +ou a exprimé de toute autre manière sa volonté de fournir l'œuvre sous licence EUPL. + +1.Définitions +Dans la présente licence, on entend par: +— «licence», la présente licence, +— «œuvre originale», l'œuvre ou le logiciel distribué ou communiqué par le donneur de licence en vertu de la présente licence, sous forme de code source ou de code objet, selon le cas, +— «œuvres dérivées», les œuvres ou logiciels qui pourraient être créés par le licencié sur la base de l'œuvre originale ou des modifications qui y auraient été appliquées. La présente licence ne définit pas le degré de modification ou de dépendance requis par rapport à l'œuvre originale pour qu'une œuvre soit qualifiée d'œuvre dérivée; cette question est réglée par la loi applicable en matière de droit d'auteur dans le pays visé à l'article 15, +— «œuvre», l'œuvre originale ou ses œuvres dérivées, +— «code source», la forme de l'œuvre, lisible par l'homme, la plus appropriée pour que des personnes puissent l'examiner et la modifier, +— «code objet», l'œuvre codée, généralement après compilation, destinée à être exécutée en tant que programme par un ordinateur, — «donneur de licence», la personne physique ou morale qui distribue ou communique l'œuvre sous licence, +— «contributeur», toute personne physique ou morale qui modifie l'œuvre sous licence, ou contribue de toute autre manière à en faire une œuvre dérivée, +— «licencié» ou «vous», toute personne physique ou morale qui utilise l'œuvre conformément à la licence, +— «distribution» ou «communication», tout acte de vente, don, prêt, location, distribution, communication, transmission ou mise à disposition, en ligne ou hors ligne, de copies de l'œuvre, et tout acte donnant accès à ses fonctions essentielles à toute autre personne physique ou morale. + +2.Portée des droits accordés par la licence +Par la présente, le donneur de licence vous concède, pour la durée de la protection de son droit d'auteur sur l'œuvre originale, une licence mondiale, libre de redevances, non exclusive et pouvant faire l'objet de sous-licences, en vertu de laquelle vous pouvez: +— utiliser l'œuvre en toute circonstance et pour tout usage, +— reproduire l'œuvre, +— modifier l'œuvre et créer des œuvres dérivées sur la base de l'œuvre, +— communiquer l'œuvre au public, ce qui inclut le droit de mettre à disposition du public ou de lui présenter l'œuvre ou des copies de l'œuvre et d'en effectuer des représentations publiques, le cas échéant, +— distribuer l'œuvre ou des copies de celle-ci, +— prêter et louer l'œuvre ou des copies de celles-ci, +— accorder en sous-licence des droits sur l'œuvre ou sur des copies de celle-ci. +Ces droits peuvent être exercés sur tout support et format, connu ou encore à inventer, dans la mesure où le droit applicable le permet. Dans les pays où des droits moraux s'appliquent, le donneur de licence renonce à son droit d'exercer son droit moral dans la mesure permise par la loi afin que la licence sur les droits patrimoniaux susmentionnés produise ses effets. Le donneur de licence vous concède un droit d'usage libre de redevances et non exclusif sur tout brevet qu'il détient, dans la mesure nécessaire à l'exercice des droits qui vous sont concédés sur l'œuvre sous licence. + +3.Communication du code source +Le donneur de licence fournit l'œuvre sous forme de code source ou de code objet. Si l'œuvre est fournie sous forme de code objet, le donneur de licence accompagne chacune des copies de l'œuvre qu'il distribue d'une copie lisible par machine du code source de l'œuvre ou indique, dans un avis qui suit la déclaration relative au droit d'auteur jointe à l'œuvre, l'endroit où le code source est aisément et gratuitement accessible aussi longtemps que le donneur de licence continue à distribuer ou communiquer l'œuvre. + +4.Limitations du droit d'auteur +Rien dans la présente licence n'a pour but de priver le licencié des avantages résultant de toute exception ou limitation aux droits exclusifs des titulaires de droits sur l'œuvre, de l'épuisement de ces droits ou de toute autre limitation qui s'y applique. + +5.Obligations du licencié +La concession des droits susmentionnés est soumise à des restrictions et à des obligations pour le licencié. Ces obligations sont les suivantes: + +Droit d'attribution: le licencié laisse intactes toutes les déclarations concernant le droit d'auteur, le brevet ou les marques et toutes les déclarations concernant la licence et l'exclusion de garantie. Le licencié assortit chaque copie de l'œuvre qu'il distribue ou communique d'une copie de ces déclarations et d'une copie de la licence. Le licencié veille à ce que toute œuvre dérivée soit assortie d'un avis bien visible indiquant que l'œuvre a été modifiée et mentionnant la date de la modification. + +Clause copyleft: si le licencié distribue ou communique des copies d'œuvres originales ou d'œuvres dérivées, cette distribution ou cette communication est effectuée dans les conditions prévues par la présente licence ou une version ultérieure de cette licence, sauf si l'œuvre originale est expressément distribuée en vertu de la présente version de la licence uniquement, par exemple au moyen de la mention «EUPL v. 1.2 seulement». Le licencié (qui devient donneur de licence) ne peut pas, en ce qui concerne l'œuvre ou les œuvres dérivées, offrir ou imposer des conditions supplémentaires qui restreignent ou modifient les conditions de la licence. + +Clause de compatibilité: si le licencié distribue ou communique des œuvres dérivées ou des copies de telles œuvres basées à la fois sur l'œuvre et sur une autre œuvre concédée sous une licence compatible, la distribution ou la communication peut être faite aux conditions de cette licence compatible. Aux fins de la présente clause, une «licence compatible» est l'une des licences énumérées dans l'appendice de la présente licence. Dans le cas où les obligations du licencié au titre de la licence compatible entrent en conflit avec les obligations du licencié au titre de la présente licence, les premières prévalent. + +Fourniture du code source: lorsqu'il distribue ou communique des copies de l'œuvre, le licencié fournit une copie lisible par machine du code source ou indique l'endroit où ce code source restera aisément et gratuitement accessible aussi longtemps que le donneur de licence continuera à distribuer ou communiquer l'œuvre. + +Protection des droits: la présente licence ne donne pas le droit d'utiliser les noms commerciaux, les marques commerciales, les marques de service ou les noms du donneur de licence, sauf dans la mesure nécessaire, conformément à une utilisation raisonnable et aux pratiques habituelles, pour décrire l'origine de l'œuvre et reproduire la déclaration concernant le droit d'auteur. + +6.Chaîne d'auteurs +Le donneur de licence initial garantit que les droits d'auteur sur l'œuvre originale concédés par la présente licence lui appartiennent ou lui ont été donnés sous licence, et qu'il a le pouvoir et la capacité de concéder la licence. Tout contributeur garantit que les droits d'auteur sur les modifications qu'il apporte à l'œuvre lui appartiennent ou lui ont été donnés sous licence, et qu'il a le pouvoir et la capacité de concéder la licence. Chaque fois que vous acceptez la licence, le donneur de licence initial et les contributeurs successifs vous concèdent une licence sur leurs contributions à l'œuvre selon les conditions de la présente licence. + +7.Exclusion de garantie +L'œuvre est un travail en cours, amélioré de manière continue par de nombreux contributeurs. Elle constitue un travail inachevé et peut dès lors contenir des défauts ou bogues inhérents à ce type de développement. Pour cette raison, l'œuvre est fournie sous licence telle quelle, sans aucune garantie d'aucune sorte la concernant, y compris, sans que cette liste soit exhaustive, eu égard à sa qualité marchande, son aptitude à un usage particulier, l'absence de défauts ou d'erreurs, l'exactitude ou la non-violation de droits de propriété intellectuelle autres que le droit d'auteur comme prévu à l'article 6 de la présente licence. Cette exclusion de garantie est une partie essentielle de la licence et une condition de la concession de droits sur l'œuvre. + +8.Exclusion de responsabilité +Sauf dans les cas de faute intentionnelle ou de dommages directement causés à des personnes physiques, le donneur de licence n'est en aucun cas responsable des dommages, quelle qu'en soit la nature, directs ou indirects, matériels ou moraux, résultant de la licence ou de l'utilisation de l'œuvre, y compris, sans que cette liste soit exhaustive, des dommages causés par les atteintes à la réputation, les interruptions de travail, les défaillances ou le mauvais fonctionnement de matériel informatique, les pertes de données ou tout autre dommage économique, même si le donneur de licence a été informé de la possibilité de tels dommages. Cependant, le donneur de licence est responsable en vertu des dispositions législatives et réglementaires relatives à la responsabilité du fait des produits, dans la mesure où celles-ci sont applicables à l'œuvre. + +9.Accords additionnels +Lorsque vous distribuez l'œuvre, vous pouvez choisir de conclure un accord additionnel définissant des obligations ou des services compatibles avec la présente licence. Cependant, si vous acceptez des obligations, vous ne pouvez agir qu'en votre nom et sous votre seule responsabilité, et non au nom du donneur de licence initial ou de tout autre contributeur, et seulement si vous acceptez d'indemniser, de défendre et de mettre hors de cause tous les contributeurs s'ils encourent une responsabilité quelconque ou si des réclamations sont formulées à leur encontre du fait que vous avez accepté des garanties ou des responsabilités additionnelles. + +10.Acceptation de la licence +Vous pouvez exprimer votre accord sur le contenu de la présente licence en cliquant sur l'icône «J'accepte» placée au bas d'une fenêtre faisant apparaître le texte de la présente licence, ou par toute autre manifestation de consentement similaire, conformément à la loi applicable. Le fait de cliquer sur cette icône indique votre acceptation claire et irrévocable de la présente licence et de toutes ses conditions. De même, vous acceptez irrévocablement la présente licence et toutes ses conditions dès lors que vous exercez un des droits qui vous sont concédés par l'article 2 de la présente licence, tels que l'utilisation de l'œuvre, la création d'une œuvre dérivée ou la distribution ou la communication de l'œuvre ou de copies de l'œuvre. + +11.Information du public +En cas de distribution ou de communication électronique de l'œuvre (par exemple en permettant son téléchargement à distance), le canal de distribution ou le support (par exemple un site web) doit au minimum fournir au public les informations requises par le droit applicable en ce qui concerne le donneur de licence et la licence ainsi que la manière dont le licencié peut accéder à celle-ci, la conclure, la stocker et la reproduire. + +12.Fin de la licence +La licence et les droits qu'elle concède prennent automatiquement fin dès que le licencié viole l'une de ses conditions. Un tel événement ne met pas fin aux licences des personnes ayant reçu l'œuvre sous licence de la part du licencié, pour autant que ces personnes respectent pleinement la licence. + +13.Divers +Sous réserve de l'article 9, la licence représente l'entièreté de l'accord entre les parties quant à l'œuvre. Le fait qu'une clause quelconque de la licence soit invalide ou inapplicable en vertu du droit applicable n'affecte pas la validité ou l'applicabilité de la licence dans son ensemble. Une telle clause sera interprétée ou modifiée dans la mesure nécessaire pour la rendre valide ou applicable. La Commission européenne peut publier d'autres versions linguistiques ou de nouvelles versions de la présente licence ou des versions actualisées de son appendice, dans la mesure de ce qui est nécessaire et raisonnable, sans réduire la portée des droits accordés par la licence. Les nouvelles versions de la licence seront publiées avec un numéro de version unique. Toutes les versions linguistiques de la présente licence, approuvées par la Commission européenne, ont la même valeur. Les parties peuvent se prévaloir de la version linguistique de leur choix. + +14.Juridiction compétente +Sans préjudice d'accords spécifiques entre les parties, +— tout litige résultant de l'interprétation de la présente licence survenant entre des institutions, organes, bureaux ou agences de l'Union européenne en tant que donneurs de licence et un licencié relève de la juridiction de la Cour de justice de l'Union européenne, conformément à l'article 272 du traité sur le fonctionnement de l'Union européenne, +— tout litige survenant entre d'autres parties et résultant de l'interprétation de la présente licence relève de la compétence exclusive de la juridiction compétente du lieu où le donneur de licence réside ou exerce son activité principale. + +15.Droit applicable +Sans préjudice d'accords spécifiques entre les parties, +— la présente licence est régie par le droit de l'État membre de l'Union européenne où le donneur de licence réside ou a son siège social ou statutaire, +— la présente licence est régie par le droit belge si le donneur de licence ne réside pas et n'a pas son siège social ou statutaire dans un État membre de l'Union européenne. + +Appendice +Aux fins de l'article 5 de l'EUPL, les licences compatibles sont les suivantes: +— GNU General Public License (GPL) v. 2, v. 3 +— GNU Affero General Public License (AGPL) v. 3 +— Open Software License (OSL) v. 2.1, v. 3.0 +— Eclipse Public License (EPL) v. 1.0 +— CeCILL v. 2.0, v. 2.1 +— Mozilla Public licence (MPL) v. 2 +— GNU Lesser General Public licence (LGPL) v. 2.1, v. 3 +— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) pour les œuvres autres que logicielles +— Licence publique de l'Union européenne (EUPL) v. 1.1, v. 1.2 +— Licence libre du Québec — Réciprocité (LiLiQ-R) ou Réciprocité forte (LiLiQ-R+) +La Commission européenne pourra actualiser le présent appendice afin d'y inclure des versions ultérieures des licences ci-dessus sans produire de nouvelle version de l'EUPL, dès lors que ces versions prévoient la concession des droits visés à l'article 2 de la présente licence et empêchent l'appropriation exclusive du code source couvert. +Tout autre changement ou ajout au présent appendice requiert la production d'une nouvelle version de l'EUPL. \ No newline at end of file diff --git a/app_v3/chrome.manifest_basic b/app_v3/chrome.manifest_basic index c33db3e..6755163 100644 --- a/app_v3/chrome.manifest_basic +++ b/app_v3/chrome.manifest_basic @@ -3,10 +3,10 @@ locale branding fr-FR chrome/branding/locale/ overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/presences/presences.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/multisite/multisite.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/staff/staff_basic.xul -overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/forms/forms_basic.xul +overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/forms/forms.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/support/support.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/reports/reports.xul -overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/calendar/calendar_basic.xul +overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/calendar/calendar.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/logbook/logbook_basic.xul diff --git a/app_v3/chrome.manifest_localmanager b/app_v3/chrome.manifest_localmanager index 79d021a..171d9c6 100644 --- a/app_v3/chrome.manifest_localmanager +++ b/app_v3/chrome.manifest_localmanager @@ -3,7 +3,7 @@ locale branding fr-FR chrome/branding/locale/ overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/presences/presences.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/multisite/multisite.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/staff/staff.xul -overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/forms/forms_basic.xul +overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/forms/forms.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/support/support.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/reports/reports.xul overlay chrome://creorga/content/creorga.xul chrome://creorga/content/modules/calendar/calendar.xul diff --git a/app_v3/chrome/content/creorga.xul b/app_v3/chrome/content/creorga.xul index 9d334e2..7337d49 100644 --- a/app_v3/chrome/content/creorga.xul +++ b/app_v3/chrome/content/creorga.xul @@ -12,14 +12,9 @@ minheight="700" minwidth="1200" onload="system.setappdata();" onclose="system.closeapp();"> - - - - - - - - - - - - - - - - - - - - diff --git a/app_v3/chrome/content/modules/calendar/calendar_basic.xul b/app_v3/chrome/content/modules/calendar/calendar_basic.xul deleted file mode 100644 index c46318b..0000000 --- a/app_v3/chrome/content/modules/calendar/calendar_basic.xul +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app_v3/chrome/content/modules/calendar/calvacancy_basic.html b/app_v3/chrome/content/modules/calendar/calvacancy_basic.html deleted file mode 100644 index 5c435ee..0000000 --- a/app_v3/chrome/content/modules/calendar/calvacancy_basic.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Congé - - - - - - - - - - - - - - - - - - - -
- -
-
- du mois: - - -
- - - -
-
 Crèche
- - -
- - -
- -
- - -
-
- - -
- - - - - - - - - - - - - - - - - - diff --git a/app_v3/chrome/content/modules/calendar/js/calactivity_basic.js b/app_v3/chrome/content/modules/calendar/js/calactivity_basic.js deleted file mode 100644 index f058309..0000000 --- a/app_v3/chrome/content/modules/calendar/js/calactivity_basic.js +++ /dev/null @@ -1,731 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var pconfig = {}; -var initdate = new Date(); -initdate.setDate(1); -var lastmonthday = null; -var firstmonday = null; -var lastsunday = null; -var winh = window.innerHeight - 140; -var tblacc = null; -var lblfreq = {daily:'jour(s)',weekly:'semaine(s)',monthly:'mois'}; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre','Octobre', 'Novembre', 'Décembre']; -var linkpos = {}; -var posday = {}; -var delac = null; -var curfreq ={}; -var redate = /\d\d.\d\d.\d\d\d\d/; -var tblcal = null; -var vacpos = {}; -var vacdata = null; -var drsql = ""; -var eventdates = {}; -var curevcolor = ""; -var alltr = {}; -var rtblall = {}; -var crsel = []; -function initdata() { - //curcfg.loadconfig(apppref.getpreference("creorga.support.database.currentdb.num")); - load_helpers(); - $('#view_list').hide(); - var configdata = apppref.getpreference("pageconfig.calactivity"); - if (!configdata) { - apppref.setpreference("pageconfig.calactivity", ''); - } - if (configdata !== '') { - pconfig = JSON.parse(configdata); - } - pconfig.view = 'table'; - //if (!pconfig.printlayout) { - pconfig.printlayout = 'table'; - apppref.setpreference("pageconfig.calactivity",pconfig); - //} - if (pconfig.calmonth) { - - initdate = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g, '')); - $("#calmonth").val(pconfig.calmonth); - } else { - $("#calmonth").val(initdate.toLocaleFormat('%m.%Y')); - pconfig.calmonth = initdate.toLocaleFormat('%m.%Y'); - } - - load_staff_selection('filter_staff'); - load_activity_selection('filter_activity','multiple'); - load_staff_selection('staffuuid'); - //load_creche_selection(); - set_infoheader(amonth[parseInt(pconfig.calmonth.substring(0,3))] + " " + pconfig.calmonth.substring(3,8)); - load_calendar_month(); - - $('#calmonth').on('dp.hide',function(e){ - set_calmonth(); - }); - $('#frmeditevent #color').minicolors({theme:'bootstrap',position: 'bottom right'}); - $("#weekly_byday :input").change(function() { - - if (this.checked) { - this.setAttribute("checked",true); - }else { - this.removeAttribute("checked"); - } -}); - $("#monthly_bydaypos :input").change(function() { - - if (this.checked) { - this.setAttribute("checked",true); - }else { - this.removeAttribute("checked"); - } - -}); - $("#monthly_bydaywday :input").change(function() { - - if (this.checked) { - this.setAttribute("checked",true); - }else { - this.removeAttribute("checked"); - } - -}); - $("#monthly_bymonthday :input").change(function() { - - if (this.checked) { - this.setAttribute("checked",true); - }else { - this.removeAttribute("checked"); - } - -}); - $("#monthly_by :input").change(function() { - var xd = this.id.split("_"); - curfreq.freqtype=xd[2]; - - this.setAttribute("checked",true); - - $('#freq_monthly_byday').hide(); - $('#freq_monthly_bymonthday').hide(); - $('#pnl_monthly_byday').removeAttr("checked"); - $('#pnl_monthly_bymonthday').removeAttr("checked"); - - $('#freq_' + this.value).show(); - -}); - - $('#frmeditevent #datefrom').on("blur",function (e) { - var ok = true; - if ($('#frmeditevent #datefrom').val().match(redate)) { - $('#btn_save_event').removeAttr("disabled"); - }else { - ok = false; - $('#btn_save_event').attr("disabled","1"); - } - if ((ok === true) && ($('#frmeditevent #dateto').val() !== '')) { - var tmpdt1 = encodeparam($('#frmeditevent #datefrom').val(),'date'); - var tmpdt2 = encodeparam($('#frmeditevent #dateto').val(),'date'); - - if (tmpdt1 >= tmpdt2) { - $('#btn_save_event').attr("disabled","1"); - } else { - $('#btn_save_event').removeAttr("disabled"); - } - - } - }); - $('#frmeditevent #dateto').on("blur",function (e) { - var ok = true; - if ($('#frmeditevent #dateto').val().match(redate)) { - $('#btn_save_event').removeAttr("disabled"); - }else { - ok = false; - $('#btn_save_event').attr("disabled","1"); - } - if ((ok === true) && ($('#frmeditevent #dateto').val() !== '')) { - var tmpdt1 = encodeparam($('#frmeditevent #datefrom').val(),'date'); - var tmpdt2 = encodeparam($('#frmeditevent #dateto').val(),'date'); - - if (tmpdt1 >= tmpdt2) { - $('#btn_save_event').attr("disabled","1"); - } else { - $('#btn_save_event').removeAttr("disabled"); - } - - } - }); -} - -function load_calendar_month() { - - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(), -1 * parseInt(initdate.toLocaleFormat('%w')) + 2); - if (firstmonday > initdate) { - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(),firstmonday.getDate()-7); - } - lastmonthday = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 1); - - lastsunday = new Date(lastmonthday.getFullYear(), lastmonthday.getMonth(), lastmonthday.getDate() + 7 - parseInt(lastmonthday.toLocaleFormat('%w'))); - - var weeknum = 0; - var cmonth = initdate.getMonth(); - var sday = []; - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(), -1 * parseInt(initdate.toLocaleFormat('%w')) + 2); - if (firstmonday > initdate) { - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(),firstmonday.getDate()-7); - } - load_vacancy_data(); - - load_calendar_data(); - -} - -function load_calendar_data() { - var where = []; - if ((pconfig.filterstaff) && (pconfig.filterstaff.length > 0)) { - where.push(" st.uuid in ('"+ pconfig.filterstaff.join("','") + "')"); - } - if ((pconfig.filteractivity) && (pconfig.filteractivity.length > 0)) { - where.push(" cal.description in ('"+ pconfig.filteractivity.join("','") + "')"); - } - var sql = "SELECT cal.uuid, cal.datefrom, cal.dateto, '
' || strftime('%Y%m%d',cal.datefrom) ||'
' || strftime('%d.%m.%Y',cal.datefrom) AS tbldatefrom ,strftime('%Y%m%d',cal.datefrom) AS strdatefrom, strftime('%Y%m%d',cal.dateto) AS strdateto,cal.timefrom, cal.timeto, cal.description, cal.location, cal.color, cal.freq, '[\"' || GROUP_CONCAT(sp.staffuuid,'\",\"') || '\"]' as staffuuid, GROUP_CONCAT(coalesce(st.surname,'') || ' ' || coalesce(st.prename,''), '
' ) as staffnames ,'[\"' || GROUP_CONCAT(st.color,'\",\"') || '\"]' as staffcolors from eventcalendar cal " + ((pconfig.filterstaff)?"":" left ") +" join staffplanning sp on (cal.uuid=sp.eventcalendaruuid " + ((pconfig.filterstaff)?" AND sp.staffuuid in ('"+ pconfig.filterstaff.join("','") + "')":"") +") left join staff st on (sp.staffuuid=st.uuid) "+ - - " where (cal.datefrom between '" + initdate.toLocaleFormat('%Y-%m-%d') + "' and '" + lastmonthday.toLocaleFormat('%Y-%m-%d') + "' and (cal.dateto >= '" + initdate.toLocaleFormat('%Y-%m-%d') + "' or cal.dateto is null)) or (cal.dateto between '" + initdate.toLocaleFormat('%Y-%m-%d') + "' and '" + lastmonthday.toLocaleFormat('%Y-%m-%d') + "' and cal.datefrom < '" + initdate.toLocaleFormat('%Y-%m-%d') + "') or ((cal.datefrom <= '" + firstmonday.toLocaleFormat('%Y-%m-%d') + "') and ((cal.dateto >= '" + lastmonthday.toLocaleFormat('%Y-%m-%d') + "') or cal.dateto is null)) "+ ((where.length > 0)?" AND (" + where.join(" or ") + ")":"")+" group by cal.uuid order by cal.datefrom,cal.dateto;"; - - var caldata = appdb.dbquery(sql); - - caldata = caldata.sqldata; - get_vacancy_data(); - - for (var c in caldata) { - if (!eventdates[caldata[c].uuid]) { - eventdates[caldata[c].uuid] = {}; - } - var freq = caldata[c].freq; - if (freq !== '') { - freq += ';DTSTART='+caldata[c].strdatefrom + 'T000000Z'; - if ((caldata[c].dateto !== '') && (caldata[c].dateto <= lastmonthday.toLocaleFormat('%Y-%m-%d'))){ - freq += ';UNTIL='+caldata[c].strdateto + 'T000000Z'; - }else { - freq += ';UNTIL='+lastmonthday.toLocaleFormat('%Y%m%d') + 'T000000Z'; - } - } - - if (freq !== ""){ - try { - var rule = RRule.fromString(freq); - rall = rule.all(); - } catch (ex){ - //dump("ERROR! loading data!" + ex + " FREQ:" + freq + "\n"); - } - } else { - continue; - } - for (var r in rall){ - //dump(rall[r].toLocaleFormat('%Y-%m-%d') + " " + initdate.toLocaleFormat('%Y-%m-%d')+ " " + lastmonthday.toLocaleFormat('%Y-%m-%d') + "\n" ); - if ((rall[r].toLocaleFormat('%Y-%m-%d') >= initdate.toLocaleFormat('%Y-%m-%d')) && (rall[r].toLocaleFormat('%Y-%m-%d') <= lastmonthday.toLocaleFormat('%Y-%m-%d'))) { - //dump("OK " + rall[r].toLocaleFormat('%Y-%m-%d') + " " + initdate.toLocaleFormat('%Y-%m-%d')+ " " + lastmonthday.toLocaleFormat('%Y-%m-%d') + "\n" ); - if (!eventdates[caldata[c].uuid][rall[r].toLocaleFormat('%d')]) { - eventdates[caldata[c].uuid][rall[r].toLocaleFormat('%d')] = 1; - } - } - - } - } - load_timetable(); -} - -function load_timetable() { - $('#tbl_timetable').html(""); - drsql = getdaterangesql(); - var ophdata = getoph(); - - var thead = []; - var weekrange = {}; - var ltd = ""; - for (var t in ophdata){ - var dx = new Date(ophdata[t].daydate); - if (!weekrange[parseInt(dx.toLocaleFormat('%W'))]) { - weekrange[parseInt(dx.toLocaleFormat('%W'))] = 1; - }else if (ltd != ophdata[t].daydate) { - weekrange[parseInt(dx.toLocaleFormat('%W'))] += 1; - } - var head = ophdata[t].daydate.substring(8,10); - if (thead.indexOf(head) == -1) { - thead.push(head); - - } - - ltd = ophdata[t].daydate; - - } - var actdata = getstaffactivity(); - - var lev = ""; - var lst = ""; - - var ev = {}; - - var alltrx = {}; - for (var ac in actdata){ - var evid = actdata[ac].eventuuid; - - if ((evid) && (lev !== evid) && (!alltrx[evid])) { - ev = {"eventuuid":evid,"description": actdata[ac].description ,"timefrom":actdata[ac].timefrom,"timeto":actdata[ac].timeto,"eventcolor":actdata[ac].eventcolor}; - for (var h in thead){ - ev[thead[h]] = {}; - } - alltrx[evid] = ev; - - } - var cday = actdata[ac].daydate.substring(8,10); - - if ((evid) && (eventdates[evid]) && (eventdates[evid][cday])) { - - alltrx[evid][cday]={"staffuuid":JSON.parse(actdata[ac].staffuuid),"staffcolor":JSON.parse(actdata[ac].staffcolor),"staffnames":JSON.parse(actdata[ac].staffnames)}; - - } - lev = null; - lev = evid; - - } - - var vacdata = getstaffvacancy(); - var staffuuids = []; - for (var vc in vacdata){ - var dx = new Date(vacdata[vc].daydate).toLocaleFormat('%d'); - if (staffuuids.indexOf(vacdata[vc].staffuuid)) { - staffuuids.push(vacdata[vc].staffuuid); - } - for (var e in alltrx){ - - if (alltrx[e][dx]['staffuuid']) { - var idx = alltrx[e][dx]['staffuuid'].indexOf(vacdata[vc].staffuuid); - - if (idx != -1) { - - if (vacdata[vc].timefrom==vacdata[vc].timeto) { - alltrx[e][dx]['staffcolor'][idx] = "transparent"; - }else { - - var tfto =((parseInt(vacdata[vc].timeto.substring(1,2)) - parseInt(vacdata[vc].timefrom.substring(1,2)))/8)*100; - var clr = alltrx[e][dx]['staffcolor'][idx]; - - alltrx[e][dx]['staffcolor'][idx] = "linear-gradient(to right, "+convertHex(clr,1)+" 0%,"+convertHex(clr,1)+" "+tfto+"%,rgba(0,0,0,0) 100%)"; - } - - } - } - } - - } - var cspan = 0; - var hdays = get_vacancydays(); - var strhead = 'Semaine'; - for (var w in weekrange){ - strhead += '' + w + ''; - cspan += weekrange[w]; - } - strhead += '  de à '; - for (var th in thead){ - var sty=""; - if (hdays[thead[th]]) { - sty =' style="background-color: '+((hdays[thead[th]]=='vacancy')?'#FF7145':'#FF9C2A')+' !important;" '; - } - strhead += ''+ thead[th]+''; - } - - strhead += ''; - $('#tbl_timetable').append(strhead); - $('#tbl_timetable').append(''); - cspan +=3; - - var actchange = ""; - //dump(JSON.stringify(alltr) + "\n"); - for (var a in alltrx){ - - if (alltrx[a].description != actchange) { - $('#tbl_timetable').append(' '+alltrx[a].description+''); - } - actchange = alltrx[a].description; - var trn = ' '; - trn += ''+alltrx[a].timefrom+''+alltrx[a].timeto+''; - for (var h in thead){ - if ((hdays[thead[h]]) && (hdays[thead[h]] == 'vacancy')) { - trn += ''; - continue; - } - if (alltrx[a][thead[h]]) { - - trn += ''; - if (alltrx[a][thead[h]]["staffcolor"]) { - var xx = alltrx[a][thead[h]]["staffcolor"]; - for (var r in xx){ - var col = ""; - if (xx[r] == 'transparent') { - col = 'color: transparent; display: none;'; - } - trn += '
'+alltrx[a][thead[h]]["staffnames"][r] +'
'; - } - - } - - trn += ''; - }else { - trn += ''; - } - } - trn += ''; - - $('#tbl_timetable').append(trn); - - } - - $('#tbl_timetable').append(''); - -} - -function load_vacancy_data() { - var sql = "select vacancydate,strftime('%Y%m%d',vacancydate) as strvacancydate,vacancydateto,case when vacancydateto is not null then strftime('%Y%m%d',vacancydateto) else null end as strvacancydateto,vacancydescription from vacancy " + - "where (vacancydate between '" + firstmonday.toLocaleFormat('%Y-%m-%d') + "' and '" + lastsunday.toLocaleFormat('%Y-%m-%d') + "' and (vacancydateto >= '" + firstmonday.toLocaleFormat('%Y-%m-%d') + "' or vacancydateto is null)) or (vacancydateto between '" + firstmonday.toLocaleFormat('%Y-%m-%d') + "' and '" + lastsunday.toLocaleFormat('%Y-%m-%d') + "' and vacancydate < '" + firstmonday.toLocaleFormat('%Y-%m-%d') + "') or ((vacancydate <= '" + firstmonday.toLocaleFormat('%Y-%m-%d') + "') and (vacancydateto >= '" + lastsunday.toLocaleFormat('%Y-%m-%d') + "')) " + - "order by vacancydate,vacancydateto;"; - var caldata = appdb.dbquery(sql); - caldata = caldata.sqldata; - for (var c in caldata) { - var freq = "FREQ=DAILY"; - freq += ';DTSTART='+caldata[c].strvacancydate + 'T000000Z'; - - if (caldata[c].vacancydateto !== ''){ - freq += ';UNTIL='+caldata[c].strvacancydateto + 'T000000Z'; - }else { - freq += ';UNTIL='+caldata[c].strvacancydate + 'T000000Z'; - } - try { - var rule = RRule.fromString(freq); - var rall = rule.all(); - - for (var r in rall){ - if ((rall[r].toLocaleFormat('%Y-%m-%d') >= initdate.toLocaleFormat('%Y-%m-%d')) && (rall[r].toLocaleFormat('%Y-%m-%d') <= lastmonthday.toLocaleFormat('%Y-%m-%dT00:00.000Z'))) { - - $("#" + linkpos["" + rall[r].toLocaleFormat('%Y-%m-%d')] + " > div.panel-day > div.panel-dayhead").addClass(((caldata[c].vacancydateto == '')?'calvacancy':'calvacrange')); - $("#" + linkpos["" + rall[r].toLocaleFormat('%Y-%m-%d')] + " > div.panel-day > div.panel-dayhead > div#vacname").remove(); - $("#" + linkpos["" + rall[r].toLocaleFormat('%Y-%m-%d')] + " > div.panel-day > div.panel-dayhead").prepend('
'+ caldata[c].vacancydescription + "
 "); - } - } - } catch (ex){ - } - } -} - -function load_staff_selection(objid,option){ - var stdata = appdb.dbquery("select uuid, coalesce(surname,'') || ' ' || coalesce(prename,'') as name,case when color is null then '#000' else color end as color from staff order by surname,prename"); - stdata = stdata.sqldata; - for (var s in stdata){ - $('#' + objid).append(''); - } - if (objid == 'filter_staff') { - $('#' + objid).multiselect({enableHTML: true,numberDisplayed:1,nonSelectedText:"Tous",allSelectedText: 'Tous',nSelectedText: ' selections'}); - if (pconfig.filterstaff) { - $('#' + objid).multiselect('select',pconfig.filterstaff); - } - }else { - var copt = {}; - if (option) { - copt = option; - } - copt['enableHTML'] = true; - copt['nonSelectedText']="Sélectionner un(e) employé(e)..."; - copt['numberDisplayed']=5; - copt['allSelectedText']='Tous'; - copt['nSelectedText']=' selections'; - - $('#' + objid).multiselect(copt); - } - -} - - -function load_activity_selection(objid,type) { - var stdata = appdb.dbquery("select uuid,description as activity,color from eventcalendar group by description,color;"); - stdata = stdata.sqldata; - for (var s in stdata){ - $('#' + objid).append(''); - } - if (pconfig.filteractivity) { - $('#' + objid).multiselect({enableHTML: true,numberDisplayed:1,nonSelectedText:"Tous",allSelectedText: 'Tous',nSelectedText: ' selections'}); - $('#' + objid).multiselect('select',pconfig.filteractivity); - } else if (type == 'multiple') { - $('#' + objid).multiselect({enableHTML: true,numberDisplayed:1,nonSelectedText:"Tous",allSelectedText: 'Tous',nSelectedText: ' selections'}); - } else { - var copt = {}; - copt['enableHTML'] = true; - copt['nonSelectedText']="Sélectionner une activité.."; - $('#' + objid).multiselect(copt); - $('#' + objid).multiselect('select',null); - } -} - -function set_calmonth() { - pconfig.calmonth = $('#calmonth').val(); - apppref.setpreference("pageconfig.calactivity", pconfig); - globelreq.send_request({ - page: 'calactivity_basic', - module: 'calendar', - header: 'Organisation Personnel' - }, null); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.calmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.calactivity", pconfig); - globelreq.send_request({ - page: 'calactivity_basic', - module: 'calendar', - header: 'Organisation Personnel' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.calmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.calactivity", pconfig); - globelreq.send_request({ - page: 'calactivity_basic', - module: 'calendar', - header: 'Organisation Personnel' - }, null); -} - -function dlg_vacancy_detail(stuuids) { - //dump(JSON.stringify(stuuids) + "\n"); - var obj = stuuids.split(',') - var vsql = "select coalesce(surname,'') || ' ' || coalesce(prename,'') as staffname,color from staff where uuid in ('" + obj.join("','") + "');"; - //dump(vsql + "\n"); - var vst = appdb.dbquery(vsql); - vst = vst.sqldata; - $('#vacdetail').html(""); - for (var v in vst){ - $('#vacdetail').append('
'+ vst[v].staffname+'
'); - } - $("#dlg_vacancy_detail").modal('show'); - -} - - -function setfreq() { - - curfreq.freq = $('#freq option:selected').val(); - $('#freqinterval').hide(); - $('#freqmonthly').hide(); - $('#freqweekly').hide(); - if (curfreq.freq != "") { - $('#lblfreq').text(lblfreq[curfreq.freq]); - $('#freqinterval').show(); - if (curfreq.freq != 'daily') { - $('#freq' + curfreq.freq).show(); - } - } - -} - -function invertColor(hexTripletColor) { - var color = hexTripletColor; - color = color.substring(1); // remove # - color = parseInt(color, 16); // convert to integer - color = 0xFFFFFF ^ color; // invert three bytes - color = color.toString(16); // convert to hex - color = ("000000" + color).slice(-6); // pad with leading zeros - color = "#" + color; // prepend # - return color; -} - -function onselactivity(objid) { - pconfig.filteractivity = $('#' + objid).val()//(()?$('#' + objid).val().split(','):null); - apppref.setpreference("pageconfig.calactivity",pconfig); - load_calendar_data(); -} -function onselstaff(objid) { - - pconfig.filterstaff = $('#' + objid).val(); - apppref.setpreference("pageconfig.calactivity",pconfig); - load_calendar_data(); -} - -function get_vacancy_data() { - vacpos = {}; - var where = ""; - if ((pconfig.filterstaff) && (pconfig.filterstaff.length > 0)) { - where = " st.uuid in ('"+ pconfig.filterstaff.join("','") + "')"; - } - var sql = getvacancysql(new Date(initdate.toLocaleFormat("%Y-%m-%d")),new Date(lastmonthday.toLocaleFormat("%Y-%m-%d")),where); - vacdata = appdb.dbquery(sql); - vacdata = vacdata.sqldata; - - for (var v in vacdata) { - var freq = "FREQ=DAILY"; - - freq += ';DTSTART='+vacdata[v].strdatefrom + 'T000000Z'; - if (vacdata[v].vacancydateto != ''){ - freq += ';UNTIL='+vacdata[v].strdateto + 'T000000Z'; - }else { - freq += ';UNTIL='+vacdata[v].strstrdatefrom + 'T000000Z'; - } - try { - var vacrule = RRule.fromString(freq); - var vacrall = vacrule.all(); - } catch (ex){ - //dump("ERROR! loading data!" + ex + " FREQ:" + freq + "\n"); - } - for (var r in vacrall){ - if ((vacrall[r].toLocaleFormat('%Y-%m-%d') >= initdate.toLocaleFormat('%Y-%m-%d')) && (vacrall[r].toLocaleFormat('%Y-%m-%d') <= lastmonthday.toLocaleFormat('%Y-%m-%dT00:00.000Z'))) { - if (!vacpos[vacrall[r].toLocaleFormat('%Y-%m-%d')]) { - vacpos[vacrall[r].toLocaleFormat('%Y-%m-%d')] = {'staffuuid':[vacdata[v].staffuuid],color:[vacdata[v].color]}; - }else { - vacpos[vacrall[r].toLocaleFormat('%Y-%m-%d')]['staffuuid'].push(vacdata[v].staffuuid); - vacpos[vacrall[r].toLocaleFormat('%Y-%m-%d')]['color'].push(vacdata[v].color); - } - } - } - } -} - -function getvacancysql(datefrom2,dateto2,where) { - var sqlret = "SELECT vc.uuid, vc.datefrom,strftime('%Y%m%d',vc.datefrom) as strdatefrom,' ' || strftime('%Y%m%d',vc.datefrom) || strftime('%Y%m%d',vc.dateto) || '' || strftime('%d.%m.%Y',vc.datefrom) || ' - ' || strftime('%d.%m.%Y',vc.dateto) as tbldaterange, vc.dateto,strftime('%Y%m%d',vc.dateto) as strdateto,vc.timefrom,vc.timeto "+ -", vc.staffuuid,coalesce(st.surname,'') || ' ' || coalesce(st.prename,'') as staffname,vc.type,st.color FROM vacancycalendar vc left join staff st on (vc.staffuuid=st.uuid) " + - "LEFT JOIN ( SELECT * FROM ( "; - var sqldays = new Array(); - - for (var cdate2=datefrom2;cdate2<=dateto2;cdate2.setDate(cdate2.getDate() +1)){ - if ((cdate2.getDay() != 0) && (cdate2.getDay() != 6)){ - sqldays.push ("SELECT date('" + cdate2.toLocaleFormat('%Y-%m-%d') +"') as daydate"); - } - } - - sqlret += sqldays.join(' UNION ALL ') + " )) oph " + - "ON (oph.daydate BETWEEN vc.datefrom AND vc.dateto) " + - "WHERE oph.daydate IS NOT NULL and strftime('%w',oph.daydate) not in (0') " + - "AND oph.daydate NOT IN ( SELECT vacancydate FROM vacancy WHERE vacancydateto IS NULL AND vacancydate BETWEEN '"+initdate.toLocaleFormat("%Y-%m-%d") + "' AND '" + dateto2.toLocaleFormat("%Y-%m-%d")+"') " + - ((where != '')?" AND " + where + " ":"") + - " GROUP BY vc.uuid ORDER BY st.uuid,vc.datefrom, vc.dateto; "; - return sqlret; -} - -function getoph() { - var ophsql = "select dd.daydate,max(wh.datestart) as baseopendate, "+ -"case when strftime('%w',daydate) = '1' then montimeopen "+ -"when strftime('%w',daydate) = '2' then tuetimeopen "+ -"when strftime('%w',daydate) = '3' then wedtimeopen "+ -"when strftime('%w',daydate) = '4' then thutimeopen "+ -"when strftime('%w',daydate) = '5' then fritimeopen else null when strftime('%w',daydate) = '6' then sattimeopen else null end as begintime, "+ -"case when strftime('%w',daydate) = '1' then montimeclose "+ -"when strftime('%w',daydate) = '2' then tuetimeclose "+ -"when strftime('%w',daydate) = '3' then wedtimeclose "+ -"when strftime('%w',daydate) = '4' then thutimeclose "+ -"when strftime('%w',daydate) = '5' then fritimeclose when strftime('%w',daydate) = '6' then sattimeclose else null end as endtime "+ - "from workinghours wh left join ("; - ophsql += drsql + - ") dd on (dd.daydate > wh.datestart) group by dd.daydate order by dd.daydate"; - //dump("\n\n\nOPHSQL: " + ophsql + "\n\n\n"); - var ophdata = appdb.dbquery(ophsql); - ophdata = ophdata.sqldata; - return ophdata; -} - -function getdaterangesql(){ - var adays = []; - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - for (var cdt = bdate; cdt <= bend; cdt.setDate(cdt.getDate() + 1)) { - if ((cdt.getDay() != 0)){ - adays.push("select date('" + cdt.toLocaleFormat('%Y-%m-%d') + "') as daydate"); - } - - } - return adays.join(" UNION "); -} - -function getstaffactivity() { - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - var actsql = "select dd.daydate as daydate, '[\"' || GROUP_CONCAT(ev.staffuuid,'\",\"') || '\"]' AS staffuuid,'[\"' || GROUP_CONCAT(st.color,'\",\"') || '\"]' as staffcolor,'[\"' || GROUP_CONCAT(coalesce(substr(st.surname,1,2),'') || ' ' || coalesce(substr(st.prename,1,2),''), '\",\"' ) || '\"]' as staffnames, ev.timefrom as timefrom,ev.timeto as timeto, ev.description as description,ev.color as eventcolor,ev.uuid as eventuuid from ( "+ -"select sp.staffuuid,ec.description,ec.color,ec.uuid, "+ -"case when datefrom < '"+bdate.toLocaleFormat("%Y-%m-%d")+"' then '"+bdate.toLocaleFormat("%Y-%m-%d")+"' else datefrom end as datefrom, "+ -"case when dateto > '"+bend.toLocaleFormat("%Y-%m-%d")+"' then '"+bend.toLocaleFormat("%Y-%m-%d")+"' else dateto end as dateto, "+ -"timefrom,timeto "+ -"from eventcalendar ec join staffplanning sp on (ec.uuid=sp.eventcalendaruuid) where datefrom <= '"+bend.toLocaleFormat("%Y-%m-%d")+"' and (dateto is null or dateto >= '"+bdate.toLocaleFormat("%Y-%m-%d")+"')) ev "+ -"join staff st on (ev.staffuuid=st.uuid) "+ -"join ("+ drsql+") dd "+ -"on (dd.daydate between ev.datefrom and ev.dateto) "; -var wh = []; -if (pconfig.filterstaff) { - wh.push("st.uuid in ('"+ pconfig.filterstaff.join("','")+"')"); -} -if (pconfig.filteractivity) { - //dump(pconfig.filteractivity + "\n"); - wh.push("ev.description in ('"+ pconfig.filteractivity.join("','")+"')"); -} -if (wh.length > 0) { - actsql += " WHERE " + wh.join( " OR "); -} -actsql += " GROUP BY dd.daydate,ev.uuid ORDER BY ev.description,dd.daydate,ev.timefrom,ev.timeto; "; -//dump("\n\n\nSTAFF ACTIVITY: " + actsql + "\n\n\n"); - var actdata = appdb.dbquery(actsql); - actdata = actdata.sqldata; - return actdata; -} - -function getstaffvacancy() { - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - var vacsql = "select dd.daydate as daydate,staffuuid, timefrom,timeto,type from ( "+ -"select staffuuid, "+ -"case when datefrom < '"+bdate.toLocaleFormat("%Y-%m-%d")+"' then '"+bdate.toLocaleFormat("%Y-%m-%d")+"' else datefrom end as datefrom, "+ -"case when dateto > '"+bend.toLocaleFormat("%Y-%m-%d")+"' then '"+bend.toLocaleFormat("%Y-%m-%d")+"' else dateto end as dateto, "+ -"timefrom,timeto, type "+ -"from vacancycalendar where (datefrom is null or datefrom <= '"+bend.toLocaleFormat("%Y-%m-%d")+"') and (dateto is null or dateto >= '"+bdate.toLocaleFormat("%Y-%m-%d")+"')) vc "+ -"join ("+drsql+") dd "+ -"on (dd.daydate between vc.datefrom and vc.dateto); "; -var wh = []; -if (pconfig.filterstaff) { - wh.push("staffuuid in ('"+ pconfig.filterstaff.join("','")+"')"); -} -if (wh.length > 0) { - vacsql += " WHERE " + wh.join( " OR "); -} -//dump("\n\n\nOPHSQL: " + ophsql + "\n\n\n"); - var vacdata = appdb.dbquery(vacsql); - vacdata = vacdata.sqldata; - return vacdata; -} - -function get_vacancydays(){ - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - var sql = "select dd.daydate,strftime('%d',dd.daydate) as strday,type from ( "+ -"select vacancydate, "+ -"case when vacancydateto is null then vacancydate else vacancydateto end as vacancydateto, "+ -"case when vacancydateto is null then 'vacancy' else 'holiday' end as type, "+ -"vacancydescription from vacancy where (vacancydate between '"+bdate.toLocaleFormat("%Y-%m-%d")+"' and '"+bend.toLocaleFormat("%Y-%m-%d")+"' and (vacancydateto >= '"+bdate.toLocaleFormat("%Y-%m-%d")+"' or vacancydateto is null)) or (vacancydateto between '"+bdate.toLocaleFormat("%Y-%m-%d")+"' and '"+bend.toLocaleFormat("%Y-%m-%d")+"' and vacancydate < '"+bdate.toLocaleFormat("%Y-%m-%d")+"') or ((vacancydate <= '"+bdate.toLocaleFormat("%Y-%m-%d")+"') and (vacancydateto >= '"+bend.toLocaleFormat("%Y-%m-%d")+"')) order by vacancydate,vacancydateto) vc "+ -"join ( "+ drsql +") dd "+ -"on (dd.daydate between vc.vacancydate and vc.vacancydateto) group by dd.daydate order by daydate;"; - var hdata = appdb.dbquery(sql); - hdata = hdata.sqldata; - var hs = {}; - for (var h in hdata){ - hs[hdata[h].strday] = hdata[h].type; - } - return hs; -} - -function convertHex(hex,opacity){ - hex = hex.replace('#',''); - r = parseInt(hex.substring(0,2), 16); - g = parseInt(hex.substring(2,4), 16); - b = parseInt(hex.substring(4,6), 16); - - result = 'rgba('+r+','+g+','+b+','+opacity+')'; - return result; -} - - - - - diff --git a/app_v3/chrome/content/modules/calendar/js/calvacancy_basic.js b/app_v3/chrome/content/modules/calendar/js/calvacancy_basic.js deleted file mode 100644 index a61e5ee..0000000 --- a/app_v3/chrome/content/modules/calendar/js/calvacancy_basic.js +++ /dev/null @@ -1,467 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var pconfig = {}; -//var cdate = null; -var initdate = new Date(); -initdate.setDate(1); -var lastmonthday = null; -var firstmonday = null; -var lastsunday = null; -var winh = window.innerHeight - 140; -var tblcal = null; -var lblfreq = {daily:'jour(s)',weekly:'semaine(s)',monthly:'mois'}; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre',,'Octobre', 'Novembre', 'Décembre']; -var linkpos = {}; -var posday = {}; -var delac = null; -var curfreq ={}; -var redate = /\d\d.\d\d.\d\d\d\d/; -var curdatediff = null; -var accdb = null; -var drsql = ""; -var defaultcreche = null; -var curcreche=null; -//var lictype = apppref.getpreference("support.lictype"); - -function initdata() { - load_helpers(); - - var configdata = apppref.getpreference("pageconfig.calvacancy"); - if (!configdata) { - apppref.setpreference("pageconfig.calvacancy", ''); - } - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - if (!pconfig.printlayout) { - pconfig.printlayout = 'calendar'; - apppref.setpreference("pageconfig.calvacancy",pconfig); - } - //if (lictype == "free"){ - // $("#divfilterstaff").hide(); - //} - if (pconfig.calmonth) { - - initdate = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g, '')); - $("#calmonth").val(pconfig.calmonth); - } else { - $("#calmonth").val(initdate.toLocaleFormat('%m.%Y')); - pconfig.calmonth = initdate.toLocaleFormat('%m.%Y'); - } - -// load_staff_selection('filter_staff'); -// load_staff_selection('staffuuid',{maxHeight: 300}); - load_creche_selection(); - set_infoheader(amonth[parseInt(pconfig.calmonth.substring(0,3))] + " " + pconfig.calmonth.substring(3,8)); - load_calendar_month(); - $('#calmonth').on('dp.hide',function(e){ - set_calmonth(); - }); - - -} - - - -function load_calendar_month() { - - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(), -1 * parseInt(initdate.toLocaleFormat('%w')) + 2); - if (firstmonday > initdate) { - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(),firstmonday.getDate()-7); - } - - lastmonthday = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - - lastsunday = new Date(lastmonthday.getFullYear(), lastmonthday.getMonth(), lastmonthday.getDate() + 7 - parseInt(lastmonthday.toLocaleFormat('%w'))); - - var weeknum = 0; - var cmonth = initdate.getMonth(); - var sday = new Array(); - for (var cdate = firstmonday; cdate <= lastsunday; cdate.setDate(cdate.getDate() + 1)) { - dayident = "day" + weeknum + cdate.toLocaleFormat('%w'); - - linkpos[cdate.toLocaleFormat('%Y-%m-%d')] = "day" + weeknum + cdate.toLocaleFormat('%w'); - posday["day" + weeknum + cdate.toLocaleFormat('%w')] = cdate.toLocaleFormat('%Y-%m-%d'); - $("#" + dayident + " > div.panel-day > div.panel-dayhead").html(cdate.toLocaleFormat('%d')); - - if (cdate.getMonth() == cmonth) { - $("#" + dayident + " > div.panel-day > div.panel-dayhead").addClass("panel-dayheadcurrent"); - } else { - $("#" + dayident).addClass("panel-dayother"); - - } - if (cdate.toLocaleFormat('%w') == "0") { - weeknum++; - } - - } - - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(), -1 * parseInt(initdate.toLocaleFormat('%w')) + 2); - - if (firstmonday > initdate) { - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(),firstmonday.getDate()-7); - } - //load_vacancy_data(); - load_calendar_data(); - -} - -function load_calendar_data() { - var where = ""; - - var sql = getmonthlysql(new Date(initdate.toLocaleFormat("%Y-%m-%d")),new Date(lastmonthday.toLocaleFormat("%Y-%m-%d")),where); - - $("#tbl_timetable").html(""); - - - // set timetable header - drsql = getdaterangesql(); - var ophdata = getoph(); - - var thead = []; - var weekrange = {}; - var ltd = ""; - for (var t in ophdata){ - var dx = new Date(ophdata[t].daydate); - if (!weekrange[parseInt(dx.toLocaleFormat('%W'))]) { - weekrange[parseInt(dx.toLocaleFormat('%W'))] = 1; - }else if (ltd != ophdata[t].daydate) { - weekrange[parseInt(dx.toLocaleFormat('%W'))] += 1; - } - var head = ophdata[t].daydate.substring(8,10); - if (thead.indexOf(head) == -1) { - thead.push(head); - - } - - ltd = ophdata[t].daydate; - - } - var cspan = 0; - var hdays = get_vacancydays(); - var strhead = 'Semaine'; - for (var w in weekrange){ - strhead += '' + w + ''; - cspan += weekrange[w]; - } - strhead += ' '; - for (var th in thead){ - var sty=""; - if (hdays[thead[th]]) { - sty =' style="background-color: '+((hdays[thead[th]]=='vacancy')?'#FF7145':'#FF9C2A')+' !important;" '; - } - strhead += ''+ thead[th]+''; - } - - strhead += ''; - $('#tbl_timetable').append(strhead); - $('#tbl_timetable').append(''); - //dump(JSON.stringify(accdb) + "\n"); - if (pconfig.filtercreche){ - //dump(JSON.stringify(pconfig.filtercreche) + "\n"); - for (var c in pconfig.filtercreche){ - //dump(c + "\n"); - var xnum = pconfig.filtercreche[c]; - var crspan = thead.length + 1; - curcreche = accdb[xnum]; - var crhead = '' + curcreche.name +''; - $('#tbl_timetable').append(crhead); - appdb.closeConnection(); - appdb.setdbFile(curcreche.path.local + system.sep() + curcreche.uuid + ".sqlite"); - appdb.openDatabase(); - setcrechevacancydata(thead,hdays); - } - } - $('#tbl_timetable').append(''); -} - -function setcrechevacancydata(thead,hdays){ - var vacdata = getstaffvacancy(); - - var staffsql = "SELECT uuid,prename || ' ' || substr(surname,1,2) as fullname,color from staff where entrydate <= date('"+initdate.toLocaleFormat('%Y-%m-%d')+"','+1 month','-1 day') and (exitdate is null or exitdate >= date('"+initdate.toLocaleFormat('%Y-%m-%d')+"'));"; - //dump("SSQL:" + staffsql + "\n"); - var staffnames = appdb.dbquery(staffsql); - staffnames = staffnames.sqldata; - var stxcolor = {}; - //dump(JSON.stringify(staffnames)); - for (var stu in staffnames){ - //dump(JSON.stringify(staffnames[stu]) + "\n"); - stxcolor[staffnames[stu].uuid] = staffnames[stu].color; - var row = ''+ staffnames[stu].fullname+'.'; - - for (var d in thead){ - if ((hdays[thead[d]]) && (hdays[thead[d]] == 'vacancy')){ - row += ''; - }else { - row += ''; - } - - } - row += ''; - $('#tbl_timetable').append(row); - } - if (vacdata.length > 0){ - for (var vc in vacdata){ - //dump(JSON.stringify(vacdata[vc]) + "\n"); - var da = vacdata[vc].daydate.substring(8,10); - var hh = ""; - if (vacdata[vc].timefrom==vacdata[vc].timeto) { - hh="8h"; - }else { - hh=parseInt(vacdata[vc].timeto.substring(1,2))-parseInt(vacdata[vc].timefrom.substring(1,2)) + "h"; - } - - $('#tblcon_' + vacdata[vc].staffuuid + '_' + da + "").append(''); - } - - } - -} - - - -function getmonthlysql(datefrom2,dateto2,where) { - var sqlret = "SELECT vc.uuid, vc.datefrom,strftime('%Y%m%d',vc.datefrom) as strdatefrom,' ' || strftime('%Y%m%d',vc.datefrom) || strftime('%Y%m%d',vc.dateto) || '' || strftime('%d.%m.%Y',vc.datefrom) || ' - ' || strftime('%d.%m.%Y',vc.dateto) as tbldaterange, vc.dateto,strftime('%Y%m%d',vc.dateto) as strdateto, "+ -"case when vc.timefrom=vc.timeto then '8h' else (cast(substr(vc.timeto,1,2) as int) - cast(substr(vc.timefrom,1,2) as int)) || 'h' end as hours , " + -"vc.description, vc.staffuuid,coalesce(st.surname,'') || ' ' || coalesce(st.prename,'') as staffname,vc.type,st.color FROM vacancycalendar vc left join staff st on (vc.staffuuid=st.uuid) " + - "LEFT JOIN ( SELECT * FROM ( "; - var sqldays = new Array(); - - for (var cdate2=datefrom2;cdate2<=dateto2;cdate2.setDate(cdate2.getDate() +1)){ - if ((cdate2.getDay() != 0) && (cdate2.getDay() != 6)){ - sqldays.push ("SELECT date('" + cdate2.toLocaleFormat('%Y-%m-%d') +"') as daydate"); - } - } - - sqlret += sqldays.join(' UNION ALL ') + " )) oph " + - "ON (oph.daydate BETWEEN vc.datefrom AND vc.dateto) " + - "WHERE oph.daydate IS NOT NULL and strftime('%w',oph.daydate) not in ('0') " + - "AND oph.daydate NOT IN ( SELECT vacancydate FROM vacancy WHERE vacancydateto IS NULL AND vacancydate BETWEEN '"+initdate.toLocaleFormat("%Y-%m-%d") + "' AND '" + dateto2.toLocaleFormat("%Y-%m-%d")+"') " + - ((where != '')?" AND " + where + " ":"") + - " GROUP BY vc.uuid ORDER BY st.uuid,vc.datefrom, vc.dateto; "; - return sqlret; -} - - -function set_calmonth() { - pconfig.calmonth = $('#calmonth').val(); - apppref.setpreference("pageconfig.calvacancy", pconfig); - globelreq.send_request({ - page: 'calvacancy_basic', - module: 'calendar', - header: 'Congés' - }, null); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g,'')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.calmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.calvacancy", pconfig); - globelreq.send_request({ - page: 'calvacancy_basic', - module: 'calendar', - header: 'Congés' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g,'')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.calmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.calvacancy", pconfig); - globelreq.send_request({ - page: 'calvacancy_basic', - module: 'calendar', - header: 'Congés' - }, null); -} - -function dlg_sel_creche(){ - $('#select_creche').modal('show'); -} - -function set_creche(){ - $('#select_creche').modal('hide'); - dlg_vacancy($('#sel_creche :selected').val(),null, 'ins') -} - -function dlg_vacancy(xnum,uuid, type) { - if (!xnum){ - return false; - } - curcreche = accdb[xnum]; - - appdb.closeConnection(); - appdb.setdbFile(curcreche.path.local + system.sep() + curcreche.uuid + ".sqlite"); - appdb.openDatabase(); - - load_staff_selection('staffuuid',{maxHeight: 300}); - //dump("TYPE " + type +" CUUID:" + uuid +"\n"); -if (type == 'ins') { - - //load staffdata - $('#frmeditvacancy #staffuuid').multiselect('select',[]); - $('#btndeletevacancy').hide(); - }else { - $('#btndeletevacancy').show(); - } - - var evdata = { - uuid: '0', - description: '', - datefrom:new Date().toLocaleFormat("%d.%m.%Y"), - dateto:new Date().toLocaleFormat("%d.%m.%Y"), - staffuuid:'', - timefrom: '00:00', - hours: '1', - type:'0', - dailyduration:'1.0' - }; - - if (type == 'upd') { - var evsql = "SELECT uuid, strftime(\"%d.%m.%Y\",datefrom) as datefrom, strftime(\"%d.%m.%Y\",dateto) as dateto, timefrom, description, staffuuid,type, case when timefrom!=timeto then '0.' || (cast(substr(timeto,1,2) as int) - cast(substr(timefrom,1,2) as int)) else 1.0 end as dailyduration,null as hours FROM vacancycalendar where uuid='" + uuid + "';"; - //dump("UPDSQL:" +evsql + "\n"); - evdata = appdb.dbquery(evsql); - evdata = evdata.sqldata[0]; - if (evdata.dailyduration == '1') { - evdata.dailyduration = '1.0'; - evdata.hours = '8'; - }else { - evdata.hours = evdata.dailyduration.substring(2,3); - if (evdata.dailyduration != '0.4') { - evdata.dailyduration = '0.'; - } - } - $('#frmeditvacancy #staffuuid').multiselect('select',[evdata.staffuuid]); - } - - for (var w in evdata) { - if ($("#frmeditvacancy #" + w)) { - $("#frmeditvacancy #" + w).val(evdata[w]); - } - } - curdatediff=daysBetween(new Date(encodeparam($('#frmeditvacancy #datefrom').val(),'date').replace(/'/g,'')),new Date(encodeparam($('#frmeditvacancy #dateto').val(),'date').replace(/'/g,''))); - setdailydurationfields(); - $("#edit_vacancy").modal('show'); -} - - - - - - -function invertColor(hexTripletColor) { - var color = hexTripletColor; - color = color.substring(1); // remove # - color = parseInt(color, 16); // convert to integer - color = 0xFFFFFF ^ color; // invert three bytes - color = color.toString(16); // convert to hex - color = ("000000" + color).slice(-6); // pad with leading zeros - color = "#" + color; // prepend # - return color; -} - - -function load_creche_selection(){ - accdb = appdb.getaccessibledatabases(); - - for (var i in accdb){ - //dump("DBcfg: " +JSON.stringify(i) + "\n"); - if (appdb.dbFile == accdb[i].path.local){ - defaultcreche = accdb[i].dbnum; - } - $('#filter_creche').append(''); - $('#sel_creche').append(''); - } - - $('#filter_creche').multiselect({enableHTML: true,numberDisplayed:1,nonSelectedText:"Crèche Courrant",allSelectedText: 'Tous',nSelectedText: ' selections'}); - if (pconfig.filtercreche) { - $('#filter_creche').multiselect('select',pconfig.filtercreche); - }else { - var xar = []; - xar.push(defaultcreche); - $('#filter_creche').multiselect('select',xar); - pconfig.filtercreche = xar; - } - apppref.setpreference("pageconfig.calvacancy",pconfig); -} - -function onselcreche(){ - pconfig.filtercreche = $('#filter_creche').val(); - apppref.setpreference("pageconfig.calvacancy",pconfig); - load_calendar_data(); -} - -function getoph() { - var ophsql = "select dd.daydate,max(wh.datestart) as baseopendate, "+ - "case when strftime('%w',daydate) = '1' then montimeopen "+ - "when strftime('%w',daydate) = '2' then tuetimeopen "+ - "when strftime('%w',daydate) = '3' then wedtimeopen "+ - "when strftime('%w',daydate) = '4' then thutimeopen "+ - "when strftime('%w',daydate) = '5' then fritimeopen when strftime('%w',daydate) = '6' then sattimeopen else null end as begintime, "+ - "case when strftime('%w',daydate) = '1' then montimeclose "+ - "when strftime('%w',daydate) = '2' then tuetimeclose "+ - "when strftime('%w',daydate) = '3' then wedtimeclose "+ - "when strftime('%w',daydate) = '4' then thutimeclose "+ - "when strftime('%w',daydate) = '5' then fritimeclose when strftime('%w',daydate) = '6' then sattimeclose else null end as endtime "+ - "from workinghours wh left join ("; - ophsql += drsql + - ") dd on (dd.daydate > wh.datestart) group by dd.daydate order by dd.daydate"; - //dump("\n\n\nOPHSQL: " + ophsql + "\n\n\n"); - var ophdata = appdb.dbquery(ophsql); - ophdata = ophdata.sqldata; - return ophdata; - } - - function getdaterangesql(){ - var adays = []; - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - for (var cdt = bdate; cdt <= bend; cdt.setDate(cdt.getDate() + 1)) { - if ((cdt.getDay() != 0) ){ - adays.push("select date('" + cdt.toLocaleFormat('%Y-%m-%d') + "') as daydate"); - } - - } - return adays.join(" UNION "); - } - - function get_vacancydays(){ - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - var sql = "select dd.daydate,strftime('%d',dd.daydate) as strday,type from ( "+ - "select vacancydate, "+ - "case when vacancydateto is null then vacancydate else vacancydateto end as vacancydateto, "+ - "case when vacancydateto is null then 'vacancy' else 'holiday' end as type, "+ - "vacancydescription from vacancy where (vacancydate between '"+bdate.toLocaleFormat("%Y-%m-%d")+"' and '"+bend.toLocaleFormat("%Y-%m-%d")+"' and (vacancydateto >= '"+bdate.toLocaleFormat("%Y-%m-%d")+"' or vacancydateto is null)) or (vacancydateto between '"+bdate.toLocaleFormat("%Y-%m-%d")+"' and '"+bend.toLocaleFormat("%Y-%m-%d")+"' and vacancydate < '"+bdate.toLocaleFormat("%Y-%m-%d")+"') or ((vacancydate <= '"+bdate.toLocaleFormat("%Y-%m-%d")+"') and (vacancydateto >= '"+bend.toLocaleFormat("%Y-%m-%d")+"')) order by vacancydate,vacancydateto) vc "+ - "join ( "+ drsql +") dd "+ - "on (dd.daydate between vc.vacancydate and vc.vacancydateto) group by dd.daydate order by daydate;"; - var hdata = appdb.dbquery(sql); - hdata = hdata.sqldata; - var hs = {}; - for (var h in hdata){ - hs[hdata[h].strday] = hdata[h].type; - } - return hs; - } - - function getstaffvacancy() { - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - var vacsql = "select uuid,dd.daydate as daydate,staffuuid, timefrom,timeto,type from ( "+ - "select uuid,staffuuid, "+ - "case when datefrom < '"+bdate.toLocaleFormat("%Y-%m-%d")+"' then '"+bdate.toLocaleFormat("%Y-%m-%d")+"' else datefrom end as datefrom, "+ - "case when dateto > '"+bend.toLocaleFormat("%Y-%m-%d")+"' then '"+bend.toLocaleFormat("%Y-%m-%d")+"' else dateto end as dateto, "+ - "timefrom,timeto, type "+ - "from vacancycalendar where (datefrom is null or datefrom <= '"+bend.toLocaleFormat("%Y-%m-%d")+"') and (dateto is null or dateto >= '"+bdate.toLocaleFormat("%Y-%m-%d")+"')) vc "+ - "join ("+drsql+") dd "+ - "on (dd.daydate between vc.datefrom and vc.dateto); "; - - //dump("\n\n\nSVSQL: " + vacsql + "\n\n\n"); - var vacdata = appdb.dbquery(vacsql); - vacdata = vacdata.sqldata; - return vacdata; - } - - \ No newline at end of file diff --git a/app_v3/chrome/content/modules/calendar/js/calvacancy_free.js b/app_v3/chrome/content/modules/calendar/js/calvacancy_free.js deleted file mode 100644 index abcdca5..0000000 --- a/app_v3/chrome/content/modules/calendar/js/calvacancy_free.js +++ /dev/null @@ -1,471 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var pconfig = {}; -//var cdate = null; -var initdate = new Date(); -initdate.setDate(1); -var lastmonthday = null; -var firstmonday = null; -var lastsunday = null; -var winh = window.innerHeight - 140; -var tblcal = null; -var lblfreq = {daily:'jour(s)',weekly:'semaine(s)',monthly:'mois'}; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre',,'Octobre', 'Novembre', 'Décembre']; -var linkpos = {}; -var posday = {}; -var delac = null; -var curfreq ={}; -var redate = /\d\d.\d\d.\d\d\d\d/; -var curdatediff = null; -var accdb = null; -var drsql = ""; -var defaultcreche = null; -//var curcreche=null; -//var lictype = apppref.getpreference("support.lictype"); - -function initdata() { - load_helpers(); - - var configdata = apppref.getpreference("pageconfig.calvacancy"); - if (!configdata) { - apppref.setpreference("pageconfig.calvacancy", ''); - } - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - if (!pconfig.printlayout) { - pconfig.printlayout = 'calendar'; - apppref.setpreference("pageconfig.calvacancy",pconfig); - } - curcfg.loadconfig(apppref.getpreference("support.database.currentdb.num")); -// if (!pconfig.filtercreche){ -// pconfig.filtercreche = apppref.getpreference("support.database.currentdb.num"); -// } - //if (lictype == "free"){ - // $("#divfilterstaff").hide(); - //} - if (pconfig.calmonth) { - - initdate = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g, '')); - $("#calmonth").val(pconfig.calmonth); - } else { - $("#calmonth").val(initdate.toLocaleFormat('%m.%Y')); - pconfig.calmonth = initdate.toLocaleFormat('%m.%Y'); - } - -// load_staff_selection('filter_staff'); -// load_staff_selection('staffuuid',{maxHeight: 300}); - //load_creche_selection(); - set_infoheader(amonth[parseInt(pconfig.calmonth.substring(0,3))] + " " + pconfig.calmonth.substring(3,8)); - load_calendar_month(); - $('#calmonth').on('dp.hide',function(e){ - set_calmonth(); - }); - - -} - - - -function load_calendar_month() { - - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(), -1 * parseInt(initdate.toLocaleFormat('%w')) + 2); - if (firstmonday > initdate) { - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(),firstmonday.getDate()-7); - } - - lastmonthday = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - - lastsunday = new Date(lastmonthday.getFullYear(), lastmonthday.getMonth(), lastmonthday.getDate() + 7 - parseInt(lastmonthday.toLocaleFormat('%w'))); - - var weeknum = 0; - var cmonth = initdate.getMonth(); - var sday = new Array(); - for (var cdate = firstmonday; cdate <= lastsunday; cdate.setDate(cdate.getDate() + 1)) { - dayident = "day" + weeknum + cdate.toLocaleFormat('%w'); - - linkpos[cdate.toLocaleFormat('%Y-%m-%d')] = "day" + weeknum + cdate.toLocaleFormat('%w'); - posday["day" + weeknum + cdate.toLocaleFormat('%w')] = cdate.toLocaleFormat('%Y-%m-%d'); - $("#" + dayident + " > div.panel-day > div.panel-dayhead").html(cdate.toLocaleFormat('%d')); - - if (cdate.getMonth() == cmonth) { - $("#" + dayident + " > div.panel-day > div.panel-dayhead").addClass("panel-dayheadcurrent"); - } else { - $("#" + dayident).addClass("panel-dayother"); - - } - if (cdate.toLocaleFormat('%w') == "0") { - weeknum++; - } - - } - - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(), -1 * parseInt(initdate.toLocaleFormat('%w')) + 2); - - if (firstmonday > initdate) { - firstmonday = new Date(initdate.getFullYear(), initdate.getMonth(),firstmonday.getDate()-7); - } - //load_vacancy_data(); - load_calendar_data(); - -} - -function load_calendar_data() { - var where = ""; - - var sql = getmonthlysql(new Date(initdate.toLocaleFormat("%Y-%m-%d")),new Date(lastmonthday.toLocaleFormat("%Y-%m-%d")),where); - - $("#tbl_timetable").html(""); - - - // set timetable header - drsql = getdaterangesql(); - var ophdata = getoph(); - - var thead = []; - var weekrange = {}; - var ltd = ""; - for (var t in ophdata){ - var dx = new Date(ophdata[t].daydate); - if (!weekrange[parseInt(dx.toLocaleFormat('%W'))]) { - weekrange[parseInt(dx.toLocaleFormat('%W'))] = 1; - }else if (ltd != ophdata[t].daydate) { - weekrange[parseInt(dx.toLocaleFormat('%W'))] += 1; - } - var head = ophdata[t].daydate.substring(8,10); - if (thead.indexOf(head) == -1) { - thead.push(head); - - } - - ltd = ophdata[t].daydate; - - } - var cspan = 0; - var hdays = get_vacancydays(); - var strhead = 'Semaine'; - for (var w in weekrange){ - strhead += '' + w + ''; - cspan += weekrange[w]; - } - strhead += ' '; - for (var th in thead){ - var sty=""; - if (hdays[thead[th]]) { - sty =' style="background-color: '+((hdays[thead[th]]=='vacancy')?'#FF7145':'#FF9C2A')+' !important;" '; - } - strhead += ''+ thead[th]+''; - } - - strhead += ''; - $('#tbl_timetable').append(strhead); - $('#tbl_timetable').append(''); - //dump(JSON.stringify(accdb) + "\n"); -// if (pconfig.filtercreche){ -// //dump(JSON.stringify(pconfig.filtercreche) + "\n"); -// for (var c in pconfig.filtercreche){ -// //dump(c + "\n"); -// var xnum = pconfig.filtercreche[c]; - var crspan = thead.length + 1; -// curcreche = curcfg; - var crhead = '' + curcfg.name +''; - $('#tbl_timetable').append(crhead); -// appdb.closeConnection(); -// appdb.setdbFile(curcreche.path.local + system.sep() + curcfg.uuid + ".sqlite"); -// appdb.openDatabase(); - setcrechevacancydata(thead,hdays); -// } -// } - $('#tbl_timetable').append(''); -} - -function setcrechevacancydata(thead,hdays){ - var vacdata = getstaffvacancy(); - - var staffsql = "SELECT uuid,prename || ' ' || substr(surname,1,2) as fullname,color from staff where entrydate <= date('"+initdate.toLocaleFormat('%Y-%m-%d')+"','+1 month','-1 day') and (exitdate is null or exitdate >= date('"+initdate.toLocaleFormat('%Y-%m-%d')+"'));"; - //dump("SSQL:" + staffsql + "\n"); - var staffnames = appdb.dbquery(staffsql); - staffnames = staffnames.sqldata; - var stxcolor = {}; - //dump(JSON.stringify(staffnames)); - for (var stu in staffnames){ - //dump(JSON.stringify(staffnames[stu]) + "\n"); - stxcolor[staffnames[stu].uuid] = staffnames[stu].color; - var row = ''+ staffnames[stu].fullname+'.'; - - for (var d in thead){ - if ((hdays[thead[d]]) && (hdays[thead[d]] == 'vacancy')){ - row += ''; - }else { - row += ''; - } - - } - row += ''; - $('#tbl_timetable').append(row); - } - if (vacdata.length > 0){ - for (var vc in vacdata){ - //dump(JSON.stringify(vacdata[vc]) + "\n"); - var da = vacdata[vc].daydate.substring(8,10); - var hh = ""; - if (vacdata[vc].timefrom==vacdata[vc].timeto) { - hh="8h"; - }else { - hh=parseInt(vacdata[vc].timeto.substring(1,2))-parseInt(vacdata[vc].timefrom.substring(1,2)) + "h"; - } - - $('#tblcon_' + vacdata[vc].staffuuid + '_' + da + "").append(''); - } - - } - -} - - - -function getmonthlysql(datefrom2,dateto2,where) { - var sqlret = "SELECT vc.uuid, vc.datefrom,strftime('%Y%m%d',vc.datefrom) as strdatefrom,' ' || strftime('%Y%m%d',vc.datefrom) || strftime('%Y%m%d',vc.dateto) || '' || strftime('%d.%m.%Y',vc.datefrom) || ' - ' || strftime('%d.%m.%Y',vc.dateto) as tbldaterange, vc.dateto,strftime('%Y%m%d',vc.dateto) as strdateto, "+ -"case when vc.timefrom=vc.timeto then '8h' else (cast(substr(vc.timeto,1,2) as int) - cast(substr(vc.timefrom,1,2) as int)) || 'h' end as hours , " + -"vc.description, vc.staffuuid,coalesce(st.surname,'') || ' ' || coalesce(st.prename,'') as staffname,vc.type,st.color FROM vacancycalendar vc left join staff st on (vc.staffuuid=st.uuid) " + - "LEFT JOIN ( SELECT * FROM ( "; - var sqldays = new Array(); - - for (var cdate2=datefrom2;cdate2<=dateto2;cdate2.setDate(cdate2.getDate() +1)){ - if ((cdate2.getDay() != 0) && (cdate2.getDay() != 6)){ - sqldays.push ("SELECT date('" + cdate2.toLocaleFormat('%Y-%m-%d') +"') as daydate"); - } - } - - sqlret += sqldays.join(' UNION ALL ') + " )) oph " + - "ON (oph.daydate BETWEEN vc.datefrom AND vc.dateto) " + - "WHERE oph.daydate IS NOT NULL and strftime('%w',oph.daydate) not in ('6','0') " + - "AND oph.daydate NOT IN ( SELECT vacancydate FROM vacancy WHERE vacancydateto IS NULL AND vacancydate BETWEEN '"+initdate.toLocaleFormat("%Y-%m-%d") + "' AND '" + dateto2.toLocaleFormat("%Y-%m-%d")+"') " + - ((where != '')?" AND " + where + " ":"") + - " GROUP BY vc.uuid ORDER BY st.uuid,vc.datefrom, vc.dateto; "; - return sqlret; -} - - -function set_calmonth() { - pconfig.calmonth = $('#calmonth').val(); - apppref.setpreference("pageconfig.calvacancy", pconfig); - globelreq.send_request({ - page: 'calvacancy_free', - module: 'calendar', - header: 'Congés' - }, null); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g,'')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.calmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.calvacancy", pconfig); - globelreq.send_request({ - page: 'calvacancy_free', - module: 'calendar', - header: 'Congés' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.calmonth, 'month').replace(/'/g,'')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.calmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.calvacancy", pconfig); - globelreq.send_request({ - page: 'calvacancy_free', - module: 'calendar', - header: 'Congés' - }, null); -} - -function dlg_sel_creche(){ - $('#select_creche').modal('show'); -} - -function set_creche(){ - $('#select_creche').modal('hide'); - dlg_vacancy($('#sel_creche :selected').val(),null, 'ins') -} - -function dlg_vacancy(xnum,uuid, type) { - if (!xnum){ - return false; - } - curcreche = accdb[xnum]; - - appdb.closeConnection(); - appdb.setdbFile(curcreche.path.local + system.sep() + curcreche.uuid + ".sqlite"); - appdb.openDatabase(); - - load_staff_selection('staffuuid',{maxHeight: 300}); - //dump("TYPE " + type +" CUUID:" + uuid +"\n"); -if (type == 'ins') { - - //load staffdata - $('#frmeditvacancy #staffuuid').multiselect('select',[]); - $('#btndeletevacancy').hide(); - }else { - $('#btndeletevacancy').show(); - } - - var evdata = { - uuid: '0', - description: '', - datefrom:new Date().toLocaleFormat("%d.%m.%Y"), - dateto:new Date().toLocaleFormat("%d.%m.%Y"), - staffuuid:'', - timefrom: '00:00', - hours: '1', - type:'0', - dailyduration:'1.0' - }; - - if (type == 'upd') { - var evsql = "SELECT uuid, strftime(\"%d.%m.%Y\",datefrom) as datefrom, strftime(\"%d.%m.%Y\",dateto) as dateto, timefrom, description, staffuuid,type, case when timefrom!=timeto then '0.' || (cast(substr(timeto,1,2) as int) - cast(substr(timefrom,1,2) as int)) else 1.0 end as dailyduration,null as hours FROM vacancycalendar where uuid='" + uuid + "';"; - //dump("UPDSQL:" +evsql + "\n"); - evdata = appdb.dbquery(evsql); - evdata = evdata.sqldata[0]; - if (evdata.dailyduration == '1') { - evdata.dailyduration = '1.0'; - evdata.hours = '8'; - }else { - evdata.hours = evdata.dailyduration.substring(2,3); - if (evdata.dailyduration != '0.4') { - evdata.dailyduration = '0.'; - } - } - $('#frmeditvacancy #staffuuid').multiselect('select',[evdata.staffuuid]); - } - - for (var w in evdata) { - if ($("#frmeditvacancy #" + w)) { - $("#frmeditvacancy #" + w).val(evdata[w]); - } - } - curdatediff=daysBetween(new Date(encodeparam($('#frmeditvacancy #datefrom').val(),'date').replace(/'/g,'')),new Date(encodeparam($('#frmeditvacancy #dateto').val(),'date').replace(/'/g,''))); - setdailydurationfields(); - $("#edit_vacancy").modal('show'); -} - - - - - - -function invertColor(hexTripletColor) { - var color = hexTripletColor; - color = color.substring(1); // remove # - color = parseInt(color, 16); // convert to integer - color = 0xFFFFFF ^ color; // invert three bytes - color = color.toString(16); // convert to hex - color = ("000000" + color).slice(-6); // pad with leading zeros - color = "#" + color; // prepend # - return color; -} - - -//function load_creche_selection(){ -// accdb = appdb.getaccessibledatabases(); -// -// for (var i in accdb){ -// //dump("DBcfg: " +JSON.stringify(i) + "\n"); -// if (appdb.dbFile == accdb[i].path.local){ -// defaultcreche = accdb[i].dbnum; -// } -// $('#filter_creche').append(''); -// $('#sel_creche').append(''); -// } -// -// $('#filter_creche').multiselect({enableHTML: true,numberDisplayed:1,nonSelectedText:"Crèche Courrant",allSelectedText: 'Tous',nSelectedText: ' selections'}); -// if (pconfig.filtercreche) { -// $('#filter_creche').multiselect('select',pconfig.filtercreche); -// }else { -// var xar = []; -// xar.push(defaultcreche); -// $('#filter_creche').multiselect('select',xar); -// pconfig.filtercreche = xar; -// } -// apppref.setpreference("pageconfig.calvacancy",pconfig); -//} - -//function onselcreche(){ -// pconfig.filtercreche = $('#filter_creche').val(); -// apppref.setpreference("pageconfig.calvacancy",pconfig); -// load_calendar_data(); -//} - -function getoph() { - var ophsql = "select dd.daydate,max(wh.datestart) as baseopendate, "+ - "case when strftime('%w',daydate) = '1' then montimeopen "+ - "when strftime('%w',daydate) = '2' then tuetimeopen "+ - "when strftime('%w',daydate) = '3' then wedtimeopen "+ - "when strftime('%w',daydate) = '4' then thutimeopen "+ - "when strftime('%w',daydate) = '5' then fritimeopen else null end as begintime, "+ - "case when strftime('%w',daydate) = '1' then montimeclose "+ - "when strftime('%w',daydate) = '2' then tuetimeclose "+ - "when strftime('%w',daydate) = '3' then wedtimeclose "+ - "when strftime('%w',daydate) = '4' then thutimeclose "+ - "when strftime('%w',daydate) = '5' then fritimeclose else null end as endtime "+ - "from workinghours wh left join ("; - ophsql += drsql + - ") dd on (dd.daydate > wh.datestart) group by dd.daydate order by dd.daydate"; - //dump("\n\n\nOPHSQL: " + ophsql + "\n\n\n"); - var ophdata = appdb.dbquery(ophsql); - ophdata = ophdata.sqldata; - return ophdata; - } - - function getdaterangesql(){ - var adays = []; - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - for (var cdt = bdate; cdt <= bend; cdt.setDate(cdt.getDate() + 1)) { - if ((cdt.getDay() != 0)){ - adays.push("select date('" + cdt.toLocaleFormat('%Y-%m-%d') + "') as daydate"); - } - - } - return adays.join(" UNION "); - } - - function get_vacancydays(){ - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - var sql = "select dd.daydate,strftime('%d',dd.daydate) as strday,type from ( "+ - "select vacancydate, "+ - "case when vacancydateto is null then vacancydate else vacancydateto end as vacancydateto, "+ - "case when vacancydateto is null then 'vacancy' else 'holiday' end as type, "+ - "vacancydescription from vacancy where (vacancydate between '"+bdate.toLocaleFormat("%Y-%m-%d")+"' and '"+bend.toLocaleFormat("%Y-%m-%d")+"' and (vacancydateto >= '"+bdate.toLocaleFormat("%Y-%m-%d")+"' or vacancydateto is null)) or (vacancydateto between '"+bdate.toLocaleFormat("%Y-%m-%d")+"' and '"+bend.toLocaleFormat("%Y-%m-%d")+"' and vacancydate < '"+bdate.toLocaleFormat("%Y-%m-%d")+"') or ((vacancydate <= '"+bdate.toLocaleFormat("%Y-%m-%d")+"') and (vacancydateto >= '"+bend.toLocaleFormat("%Y-%m-%d")+"')) order by vacancydate,vacancydateto) vc "+ - "join ( "+ drsql +") dd "+ - "on (dd.daydate between vc.vacancydate and vc.vacancydateto) group by dd.daydate order by daydate;"; - var hdata = appdb.dbquery(sql); - hdata = hdata.sqldata; - var hs = {}; - for (var h in hdata){ - hs[hdata[h].strday] = hdata[h].type; - } - return hs; - } - - function getstaffvacancy() { - var bdate = new Date(initdate.getFullYear(), initdate.getMonth(), initdate.getDate()); - var bend = new Date(initdate.getFullYear(), initdate.getMonth() + 1, 0); - var vacsql = "select uuid,dd.daydate as daydate,staffuuid, timefrom,timeto,type from ( "+ - "select uuid,staffuuid, "+ - "case when datefrom < '"+bdate.toLocaleFormat("%Y-%m-%d")+"' then '"+bdate.toLocaleFormat("%Y-%m-%d")+"' else datefrom end as datefrom, "+ - "case when dateto > '"+bend.toLocaleFormat("%Y-%m-%d")+"' then '"+bend.toLocaleFormat("%Y-%m-%d")+"' else dateto end as dateto, "+ - "timefrom,timeto, type "+ - "from vacancycalendar where (datefrom is null or datefrom <= '"+bend.toLocaleFormat("%Y-%m-%d")+"') and (dateto is null or dateto >= '"+bdate.toLocaleFormat("%Y-%m-%d")+"')) vc "+ - "join ("+drsql+") dd "+ - "on (dd.daydate between vc.datefrom and vc.dateto); "; - - //dump("\n\n\nSVSQL: " + vacsql + "\n\n\n"); - var vacdata = appdb.dbquery(vacsql); - vacdata = vacdata.sqldata; - return vacdata; - } - - \ No newline at end of file diff --git a/app_v3/chrome/content/modules/forms/forms.html b/app_v3/chrome/content/modules/forms/forms.html index 17bb414..52753ab 100644 --- a/app_v3/chrome/content/modules/forms/forms.html +++ b/app_v3/chrome/content/modules/forms/forms.html @@ -24,7 +24,7 @@
- diff --git a/app_v3/chrome/content/modules/forms/forms_basic.html b/app_v3/chrome/content/modules/forms/forms_basic.html deleted file mode 100644 index 25ea04b..0000000 --- a/app_v3/chrome/content/modules/forms/forms_basic.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - Creorga - Creche - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- -
-
- - - - - - - - - - - - - - - - diff --git a/app_v3/chrome/content/modules/forms/forms_basic.xul b/app_v3/chrome/content/modules/forms/forms_basic.xul deleted file mode 100644 index b3294db..0000000 --- a/app_v3/chrome/content/modules/forms/forms_basic.xul +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app_v3/chrome/content/modules/forms/js/forms.js b/app_v3/chrome/content/modules/forms/js/forms.js index 8c43a23..6666df2 100644 --- a/app_v3/chrome/content/modules/forms/js/forms.js +++ b/app_v3/chrome/content/modules/forms/js/forms.js @@ -4,10 +4,14 @@ var wh= window.screen.height -400; var myfiles = null; var delform = null; var cruuid = null; +var candelete = 0; function initdata(){ curcfg.loadconfig(apppref.getpreference("support.database.currentdb.num")); load_table_forms(); set_infoheader(""); + if (system.appinfo().ID.indexOf("director")){ + candelete = 1; + } } function load_table_forms(){ @@ -21,8 +25,11 @@ function load_table_forms(){ var fname = system.getFileName(myfiles[i].path); if (!fname.startsWith('.')){ var row = new Array(); - - row.push(''); + var btndelete = ""; + if (candelete == 1){ + btnelete = ''; + } + row.push('' + btndelete); row.push(fname); atbody.push(row); } diff --git a/app_v3/chrome/content/modules/forms/js/forms_basic.js b/app_v3/chrome/content/modules/forms/js/forms_basic.js deleted file mode 100644 index a490392..0000000 --- a/app_v3/chrome/content/modules/forms/js/forms_basic.js +++ /dev/null @@ -1,55 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var wh= window.screen.height -400; -var myfiles = null; -var delform = null; -var cruuid = null; -function initdata(){ - curcfg.loadconfig(apppref.getpreference("support.database.currentdb.num")); - load_table_forms(); - set_infoheader(""); - } - -function load_table_forms(){ - var cname = appdb.dbquery("select uuid from creche LIMIT 1;"); - cruuid = cname.sqldata[0].uuid; - - myfiles = system.getReports(cruuid); - var atbody = new Array(); - for (var i=0;i'); - row.push(fname.substring(0,fname.length-4)); - atbody.push(row); - } - - $("#tbl_forms").html(""); - - - - var headerdata = getlabels("action,description"); - $("#tbl_forms").html(""); - $("#tbl_forms").dataTable({ - "language": { - "url": "js/locale/datatable_fr.json" - }, - "data": atbody, - "columns": headerdata, - "paging": false, - "scrollY": wh + "px", - "scrollCollapse": true, - "ordering": true, - "info": false, - "filter": false, - "destroy": true - }); -} - -function preview_report(fi){ - var ff = system.openFile(myfiles[fi].path); -} - - - - diff --git a/app_v3/chrome/content/modules/logbook/js/logactivity_free.js b/app_v3/chrome/content/modules/logbook/js/logactivity_free.js deleted file mode 100644 index 71973e6..0000000 --- a/app_v3/chrome/content/modules/logbook/js/logactivity_free.js +++ /dev/null @@ -1,327 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var deluuid = ""; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre', 'Octobre','Novembre', 'Décembre']; -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logactivity"); - //dump("cfdata:" + configdata +"\n"); - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - //dump("logactivity Page new loaded!\n"); - //if (!pconfig.printlayout) { - pconfig.printlayout = 'book'; - apppref.setpreference("pageconfig.logactivity",pconfig); - //} - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - var edith = 270; - loadtextareas(edith); - myhostname = system.hostname(); - if (pconfig.logmonth) { - - initdate = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - $("#logmonth").val(pconfig.logmonth); - } else { - $("#logmonth").val(initdate.toLocaleFormat('%m.%Y')); - - pconfig.logmonth=initdate.toLocaleFormat("%m.%Y"); - apppref.setpreference("pageconfig.logactivity",pconfig); - } - var acttitle = ""; - if (pconfig.activityuuid){ - var chdata = appdb.dbquery("select logtitle from activitylog where uuid='"+ pconfig.activityuuid +"'"); - if (chdata.sqldata.length > 0){ - acttitle = chdata.sqldata[0].logtitle + " - "; - } - } - dump(JSON.stringify(pconfig) + "\n"); - set_infoheader(acttitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - - $('#logmonth').on('dp.hide', function(e) { - set_logmonth(); - }); - $("#btnedit").hide(); -// $("#btnprotection").hide(); - $("#btndelete").hide(); - load_logactivity_table(); - -} - - - -function load_logactivity_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var logsql = "SELECT uuid, logtitle, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto,'' || lastmodified || '' || strftime('%d.%m.%Y %H:%M',lastmodified,'"+mins+" minutes') as lastmodified,editor FROM activitylog where date(logdatefrom) between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day') or logdateto between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day');"; - var logdata = appdb.dbquery(logsql); - var headerdata = getlabels("activity,lastmodified"); - $("#tbl_logactivity").html(""); - - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logactivity").append("" + tblheader + ""); - $("#tbl_logactivity").append("" + tblheader + ""); - $("#tbl_logactivity").append(""); - - - for (var i in logdata.sqldata){ - var sel = ""; - var row = logdata.sqldata[i]; - if (pconfig.activityuuid && row.uuid == pconfig.activityuuid) { - sel = "selected"; - load_activitylog(); - } - // - //!= '')?'':'') +row.editor - var tr = '' + row.logtitle + '
' + row.logdatefrom +' - ' + row.logdateto + ''+ - ''+ row.lastmodified+''+ - //''+ row.editor +''+ - ''; - - $("#tbl_logactivity").append(tr); - } - - $("#tbl_logactivity").append(""); - - - tbllog = $("#tbl_logactivity").dataTable({ - "language": { - "url": "../../web/js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - - - - $('#tbl_logactivity').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logactivity",pconfig); - - } ); - - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - $('#tbl_logactivity tbody').on( 'click', 'tr', function () { - //dump("select activity\n"); - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - //dump("select activity\n"); - $("#btnedit").hide(); -// $("#btnprotection").hide(); - $("#btndelete").hide(); - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curactivity = $(this).attr('data-activity'); - pconfig.activityuuid = curactivity; - var actlogsql = "SELECT editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - var adata = appdb.dbquery(actlogsql); - - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } -// if (adata.sqldata[0].editor != '' && adata.sqldata[0].editor != myhostname){ -// $("#btnprotection").show(); -// } - //setforeigneditor($(this).attr('data-editor')); - apppref.setpreference("pageconfig.logactivity",pconfig); - load_activitylog(); - } - } ); - -} - - - -function newlogactivity(){ - var nuuid = appdb.generate_uuid(); - var sql = "INSERT INTO activitylog (uuid,logtitle,logdatefrom,logdateto) VALUES ('"+nuuid+"','nouvelle Activité',date('"+initdate.toLocaleFormat('%Y-%m-%d')+"'),date('"+initdate.toLocaleFormat('%Y-%m-%d')+"'));"; - appdb.dbexec(sql); - pconfig.activityuuid=nuuid; - apppref.setpreference("pageconfig.logactivity",pconfig); - edit_activitylog(); - //load_logactivity_table(); -} - -function load_activitylog(){ - $("#btnedit").hide(); -// $("#btnprotection").hide(); - $("#btndelete").hide(); - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto, logtitle, logmessage,editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - var adata = appdb.dbquery(actlogsql); - var inftitle = ""; - if (adata.sqldata.length > 0){ - $("#activityloguuid").val(adata.sqldata[0].uuid); - $("#activitylogmessage").html(htmlUnescape(adata.sqldata[0].logmessage)) - $("#activitylogtitle").html(adata.sqldata[0].logtitle); - $("#activitylogdatefrom").html(adata.sqldata[0].logdatefrom); - $("#activitylogdateto").html(adata.sqldata[0].logdateto); - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } -// if (adata.sqldata[0].editor != '' && adata.sqldata[0].editor != myhostname){ -// $("#btnprotection").show(); -// } - - inftitle=adata.sqldata[0].logtitle; - }else { - $("#activityloguuid").val(0); - $("#activitylogmessage").html(""); - $("#activitylogtitle").html(''); - $("#activitylogdatefrom").html(''); - $("#activitylogdateto").html(''); - } - - set_infoheader(inftitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - -} - -function edit_activitylog(){ - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto, logtitle, logmessage,editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - - var adata = appdb.dbquery(actlogsql); - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); - if ((adata.sqldata[0].editor != '') && (adata.sqldata[0].editor != myhostname)){ - system.popup("cette activité est bloqué par l'editeur: " + adata.sqldata[0].editor); - load_logactivity_table(); - return; - } - //seteditorhost(); - if (adata.sqldata.length > 0){ - $('#frmeditactivitylog #loguuid').val(adata.sqldata[0].uuid); - $("#frmeditactivitylog #logtitle").val(adata.sqldata[0].logtitle); - $("#frmeditactivitylog #logdatefrom").val(adata.sqldata[0].logdatefrom); - $("#frmeditactivitylog #logdateto").val(adata.sqldata[0].logdateto); - $("#frmeditactivitylog #logmessage").summernote('reset'); - $("#frmeditactivitylog #logmessage").summernote('code',htmlUnescape(adata.sqldata[0].logmessage)); - } - $("#edit_activitylog").modal('show'); -} - -function save_activitylog(){ - var lsql = ""; - //dump($('#frmeditactivitylog #logdateto').val() + " - " + $('#frmeditactivitylog #logdatefrom').val() + "\n"); - $("#activityloguuid").val($("#frmeditactivitylog #loguuid").val()); - //var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var dt = encodeparam($("#frmeditactivitylog #logdateto").val(),"date"); - var df = encodeparam($("#frmeditactivitylog #logdatefrom").val(),"date"); - var ltitle = encodeparam($('#frmeditactivitylog #logtitle').val(),"text"); - var lmessage = encodeparam($('#frmeditactivitylog #logmessage').val(),"richtextarea"); - var uid = $("#frmeditactivitylog #loguuid").val(); - //dump(df + " - " + dt + "\n"); - var lsql = "UPDATE activitylog set logtitle="+ltitle+ - ",logmessage="+lmessage+ - ",logdatefrom=date("+df+")"+ - ",logdateto=date("+dt+") where uuid='"+uid+"';"; - //dump(lsql + "\n"); - appdb.dbexec(lsql); - //removeeditorhost(); - load_logactivity_table(); - //load_activitylog(); - $("#edit_activitylog").modal('hide'); -} - -function confirm_delete_activity() { - - deluuid = $("#activityloguuid").val(); - $('#confirm_delete_logactivity').modal('show'); -} - -function delete_logactivity() { - appdb.dbexec("delete from activitylog where uuid='"+ deluuid+"';"); - load_logactivity_table(); - $('#confirm_delete_logactivity').modal('hide'); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logactivity", pconfig); - globelreq.send_request({ - page: 'logactivity', - module: 'logbook', - header: 'Livret des activités' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logactivity", pconfig); - globelreq.send_request({ - page: 'logactivity', - module: 'logbook', - header: 'Livret des activités' - }, null); -} - -function set_logmonth(){ - pconfig.logmonth =$("#logmonth").val(); - apppref.setpreference("pageconfig.logactivity",pconfig); - globelreq.send_request({ - page: 'logactivity', - module: 'logbook', - header: 'Livret des activités' - }); -} - -//function seteditorhost(){ -// appdb.dbexec("UPDATE activitylog set editor=null where editor='"+myhostname+"';"); -// appdb.dbexec("UPDATE activitylog set editor='"+myhostname+"' where uuid='"+$('#activityloguuid').val()+"';"); -//} -// -//function removeeditorhost(){ -// appdb.dbexec("UPDATE activitylog set editor=null where editor='"+myhostname+"';"); -//} - - -//function confirm_delete_protection(){ -// $("#confirm_delete_protection").modal('show'); -//} -// -//function delete_protection(){ -// appdb.dbexec("UPDATE activitylog set editor=null where uuid='"+$('#activityloguuid').val()+"';"); -// $('#editorhost').html(''); -// $('#btneditorhost').removeClass('btn-danger'); -// $('#btneditorhost').addClass('btn-default'); -// $('#btnprotection').hide(); -// load_logactivity_table(); -// $("#confirm_delete_protection").modal('hide'); -//} \ No newline at end of file diff --git a/app_v3/chrome/content/modules/logbook/js/logchild_free.js b/app_v3/chrome/content/modules/logbook/js/logchild_free.js deleted file mode 100644 index 701bba2..0000000 --- a/app_v3/chrome/content/modules/logbook/js/logchild_free.js +++ /dev/null @@ -1,359 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logchild"); - - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - //dump(JSON.stringify(pconfig) + "\n"); - //if (!pconfig.printlayout) { - pconfig.printlayout = 'logchild'; - apppref.setpreference("pageconfig.logchild",pconfig); - //} - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - - loadtextareas(winh); - $("#logdate").on("dp.hide", function () { - set_logdate(); - }); - myhostname = system.hostname(); - if (pconfig.logdate) { - - initdate = new Date(encodeparam(pconfig.logdate, 'date').replace(/'/g, '')); - $("#logdate").val(pconfig.logdate); - } else { - $("#logdate").val(initdate.toLocaleFormat('%d.%m.%Y')); - pconfig.logdate = initdate.toLocaleFormat('%d.%m.%Y'); - } - var childname = ""; - if (pconfig.childuuid){ - var chdata = appdb.dbquery("select prename || ' ' || surname AS childname from childs where uuid='"+ pconfig.childuuid +"'"); - if (chdata.sqldata.length > 0){ - childname = chdata.sqldata[0].childname + " - "; - } - } - set_infoheader(childname + " Date du: " + pconfig.logdate); - load_logchild_table(); - -} - - - - - -function load_logchild_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var sqlchilds = "select distinct(ch.uuid) as uuid, ch.prename || ' ' || ch.surname AS childname, ch.checkservicenumber,gr.grpname,'' || cl.lastmodified || '' || strftime('%d.%m.%Y %H:%M',cl.lastmodified,'"+mins+" minutes') as lastmodified,cl.editor as editor from childs ch left join planning pl on (ch.uuid=pl.childuuid) left join groups gr on (pl.groupuuid=gr.uuid) left join childslog cl on (ch.uuid=cl.childuuid and logdate=date('"+initdate.toLocaleFormat('%Y-%m-%d')+"')) where date('"+ initdate.toLocaleFormat('%Y-%m-%d')+"') between pl.datebegin and pl.dateend order by childname;"; - //dump("SQLChilds:" + sqlchilds + "\n"); - var logdata = appdb.dbquery(sqlchilds); - //dump("load childs Log!\n"); - var headerdata = getlabels("childname,grpname,lastmodified"); - - $("#tbl_logchild").html(""); - //if (tbllog) {tbllog.destroy();} - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - if ((pconfig.hidden_columns) && (pconfig.hidden_columns.indexOf(headerdata[h].keyname) != -1)) { - if (headerdata[h].class.indexOf('colhidden') == -1) { - headerdata[h].class += " colhidden"; - } - }else { - headerdata[h].class.replace("colhidden",""); - } - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logchild").append("" + tblheader + ""); - $("#tbl_logchild").append("" + tblheader + ""); - $("#tbl_logchild").append(""); - - //var curchld = ""; - - for (var i in logdata.sqldata){ - var row = logdata.sqldata[i]; - var sel = ""; - if (pconfig.childuuid && row.uuid == pconfig.childuuid) { - sel = "selected"; - load_childlog(); - } - var tr = ''; - //tr += ''; - tr += '' + row.childname +'
('+ row.checkservicenumber+ ')'+ ""; - tr += '' + row.grpname + ""; - tr += '' + row.lastmodified + ""; - //tr += '' + row.editor + ""; - tr += ""; - $("#tbl_logchild").append(tr); - } - - $("#tbl_logchild").append(""); - - - tbllog = $("#tbl_logchild").dataTable({ - "language": { - "url": "../../web/js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - -// $('#tbl_logchild').on( 'search.dt', function () { -// pconfig.filter = tbllog.api().search(); -// apppref.setpreference("pageconfig.logchild",pconfig); -// } ); - - $('#tbl_logchild').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logchild",pconfig); - - } ); -// if (pconfig.filter) { -// tbllog.fnFilter(pconfig.filter); -// } - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - - - -$('#tbl_logchild tbody').on( 'click', 'tr', function () { - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curchild = $(this).attr('data-child'); - pconfig.childuuid = curchild; - var chsel = appdb.dbquery("select lastmodified,editor from childslog where childuuid='"+pconfig.childuuid+"' and logdate=date('"+initdate.toLocaleFormat('%Y-%m-%d')+"');"); - //dump(JSON.stringify(chsel) + "\n"); - $("#btnadd").hide(); - $("#btnedit").hide(); -// $("#btnprotection").hide(); - if (chsel.sqldata.length > 0){ -// if (chsel.sqldata[0].editor == '' || chsel.sqldata[0].editor == myhostname){ - $("#btnedit").show(); -// } -// if (chsel.sqldata[0].editor != '' && chsel.sqldata[0].editor != myhostname){ -// $("#btnprotection").show(); -// } - - - load_childlog(); - } else { - $("#childlogmessage").html(""); - $("#btnadd").show(); - } - apppref.setpreference("pageconfig.logchild",pconfig); - - } - } ); -} - -function load_childlog(){ - //$("#childlogmessage").summernote('disable'); - var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var childlogsql = "select uuid,logmessage,childuuid,lastmodified,editor from childslog where logdate=date('" + tmpdate + "') and childuuid='"+ pconfig.childuuid+"';"; - var chdata = appdb.dbquery(childlogsql); - $("#btnadd").hide(); - $("#btnedit").hide(); -// $("#btnprotection").hide(); - //dump(childlogsql + " -> " +JSON.stringify(chdata) + "\n"); - $("#childlogmessage").html(""); - if (chdata.sqldata.length > 0){ -// if (chdata.sqldata[0].editor == '' || chdata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); -// } -// if (chdata.sqldata[0].editor != '' && chdata.sqldata[0].editor != myhostname){ -// $("#btnprotection").show(); -// } - //dump("load data from db\n"); - $("#childloguuid").val(chdata.sqldata[0].uuid); - $("#childlogmessage").html(htmlUnescape(chdata.sqldata[0].logmessage)); - }else { - //$("#childlogmessage").html(""); - $("#btnadd").show(); - } - var childname = ""; - if (pconfig.childuuid){ - var chxdata = appdb.dbquery("select prename || ' ' || surname AS childname from childs where uuid='"+ pconfig.childuuid +"'"); - if (chxdata.sqldata.length > 0){ - childname = chxdata.sqldata[0].childname + " - "; - } - } - set_infoheader(childname + " Date du: " + pconfig.logdate); -} - - -function edit_childlog(){ - var childlogsql = "select uuid,logmessage,childuuid,editor from childslog where uuid='"+$("#childloguuid").val()+"';"; - var chdata = appdb.dbquery(childlogsql); -// if ((chdata.sqldata[0].editor != '') && (chdata.sqldata[0].editor != myhostname)){ -// system.popup("cette fiche d'évaluation est bloqué par l'editeur: " + chdata.sqldata[0].editor); -// load_logchild_table(); -// return; -// } - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); -// seteditorhost(); - if (chdata.sqldata.length > 0){ - //$('#frmeditchildlog #logmessage').summernote('reset'); - $('#frmeditchildlog #uuid').val(chdata.sqldata[0].uuid); - $('#frmeditchildlog #childuuid').val(chdata.sqldata[0].childuuid); - $("#frmeditchildlog #logmessage").summernote('reset'); - $("#frmeditchildlog #logmessage").summernote('code',htmlUnescape(chdata.sqldata[0].logmessage)); - //$('#frmeditchildlog #logmessage').val(htmlUnescape(chdata.sqldata[0].logmessage)); - } - $("#edit_childlog").modal('show'); -} - -function save_childlog(){ - var lsql = ""; - if ($('#frmeditchildlog #uuid').val() == '0'){ - //new childlog - var nuuid = appdb.generate_uuid(); - $("#childloguuid").val(nuuid); - var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - lsql = "INSERT INTO childslog (uuid,childuuid,logmessage,logdate) VALUES ('"+nuuid+"','"+pconfig.childuuid+"'," + encodeparam($('#frmeditchildlog #logmessage').val(),"richtextarea")+",date('"+tmpdate+"'));"; - }else { - //update childlog; - lsql = "UPDATE childslog set logmessage="+encodeparam($('#frmeditchildlog #logmessage').val(),"richtextarea")+" where uuid='"+$("#frmeditchildlog #uuid").val()+"';"; - } - appdb.dbexec(lsql); -// removeeditorhost(); - load_logchild_table(); - load_childlog(); - $("#edit_childlog").modal('hide'); -} -//$('#childlogmessage').on('summernote.focus', function() { -// seteditorhost(); -// $("#childlogmessage").summernote('enable'); -// }); -// -// -//$('#childlogmessage').on('summernote.blur', function() { -// //dump("New Data\n"); -// var lsql = ""; -// if ($("#childloguuid").val() != "0"){ -// //UPDATE -// lsql = "UPDATE childslog set logmessage="+encodeparam($('#childlogmessage').val(),"richtextarea")+" where uuid='"+$("#childloguuid").val()+"';"; -// //dump("UPDATE:" + lsql + "\n"); -// } else { -// //INSERT -// var nuuid = appdb.generate_uuid(); -// $("#childloguuid").val(nuuid); -// var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); -// lsql = "INSERT INTO childslog (uuid,childuuid,logmessage,logdate) VALUES ('"+nuuid+"','"+pconfig.childuuid+"'," + encodeparam($('#childlogmessage').val(),"richtextarea")+",date('"+tmpdate+"'));"; -// //dump("INSERT:" + lsql + "\n"); -// } -// appdb.dbexec(lsql); -// removeeditorhost(); -// //load_logchild_table(); -// -//}); - -function addchildlog(){ - var nuuid = appdb.generate_uuid(); - var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - $("#childloguuid").val(nuuid); - var lsql = "INSERT INTO childslog (uuid,childuuid,logmessage,logdate) VALUES ('"+nuuid+"','"+pconfig.childuuid+"',null,date('"+tmpdate+"'));"; - appdb.dbexec(lsql); - edit_childlog(); - -} - - -function set_logdate(){ - pconfig.logdate =$("#logdate").val(); - //dump("set_logdate:" + JSON.stringify(pconfig) + "\n"); - apppref.setpreference("pageconfig.logchild",pconfig); -// removeeditorhost(); - globelreq.send_request({ - page: 'logchild_free', - module: 'logbook', - data: null, - header: 'Livret d\'évaluation des enfants par date' - }); -} - - -function onnextdate() { - var tmpmonth = new Date(encodeparam(pconfig.logdate, 'date').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth(), tmpmonth.getDate()+1); - pconfig.logdate = nmonth.toLocaleFormat('%d.%m.%Y'); - apppref.setpreference("pageconfig.logchild", pconfig); -// removeeditorhost(); - globelreq.send_request({ - page: 'logchild_free', - module: 'logbook', - header: 'Livret d\'évaluation des enfants par date' - }, null); -} - -function onpreviousdate() { - var tmpmonth = new Date(encodeparam(pconfig.logdate, 'date').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth(), tmpmonth.getDate()-1); - pconfig.logdate = nmonth.toLocaleFormat('%d.%m.%Y'); - apppref.setpreference("pageconfig.logchild", pconfig); -// removeeditorhost(); - globelreq.send_request({ - page: 'logchild_free', - module: 'logbook', - header: 'Livret d\'évaluation des enfants par date' - }, null); -} - -//function seteditorhost(){ -// //dump('BLOCK editor '+ myhostname +"->"+ $('#childloguuid').val() +"\n"); -// appdb.dbexec("UPDATE childslog set editor=null where editor='"+myhostname+"';"); -// appdb.dbexec("UPDATE childslog set editor='"+myhostname+"' where uuid='"+$('#childloguuid').val()+"';"); -// //load_logchild_table(); -//} -//// -// function removeeditorhost(){ -// appdb.dbexec("UPDATE childslog set editor=null where editor='"+myhostname+"';"); -// //load_logchild_table(); -//} -// -// -// -//function confirm_delete_protection(){ -// $("#confirm_delete_protection").modal('show'); -//} -// -//function delete_protection(){ -// appdb.dbexec("UPDATE childslog set editor=null where uuid='"+$('#childloguuid').val()+"';"); -// $('#editorhost').html(''); -// $('#btneditorhost').removeClass('btn-danger'); -// $('#btneditorhost').addClass('btn-default'); -//// $('#btnprotection').hide(); -// load_logchild_table(); -// $("#confirm_delete_protection").modal('hide'); -//} diff --git a/app_v3/chrome/content/modules/logbook/js/logcominterne_free.js b/app_v3/chrome/content/modules/logbook/js/logcominterne_free.js deleted file mode 100644 index e609ef7..0000000 --- a/app_v3/chrome/content/modules/logbook/js/logcominterne_free.js +++ /dev/null @@ -1,328 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var xcurdate = new Date(); -var deluuid = ""; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre', 'Octobre','Novembre', 'Décembre']; -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logcominterne"); - //dump("cfdata:" + configdata +"\n"); - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - - pconfig.printlayout = 'book'; - apppref.setpreference("pageconfig.logcominterne",pconfig); - - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - var edith = 270; - myhostname = system.hostname(); - //dump("Current Hostname:" + myhostname + "\n"); - loadtextareas(edith); - if (pconfig.logmonth) { - - initdate = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - $("#logmonth").val(pconfig.logmonth); - } else { - $("#logmonth").val(initdate.toLocaleFormat('%m.%Y')); - - pconfig.logmonth=initdate.toLocaleFormat("%m.%Y"); - apppref.setpreference("pageconfig.logcominterne",pconfig); - } - var acttitle = ""; - if (pconfig.activityuuid){ - var chdata = appdb.dbquery("select logtitle from messagelog where uuid='"+ pconfig.messageuuid +"'"); - if (chdata.sqldata.length > 0){ - acttitle = chdata.sqldata[0].logtitle + " - "; - } - } - if (xcurdate.toLocaleFormat("%m.%Y") == pconfig.logmonth){ - $('#btnaddmessage').show(); - } else{ - $('#btnaddmessage').hide(); - } - set_infoheader(acttitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - $('#logmonth').on('dp.hide', function(e) { - set_logmonth(); - }); - $("#btnedit").hide(); -// $("#btnprotection").hide(); - $("#btndelete").hide(); - load_logmessage_table(); - -} - -//function seteditorhost(){ -// //dump('BLOCK editor '+ myhostname +"->"+ $('#loguuid').val() +"\n"); -// appdb.dbexec("UPDATE messagelog set editor=null where editor='"+myhostname+"';"); -// appdb.dbexec("UPDATE messagelog set editor='"+myhostname+"' where uuid='"+$('#cominterneloguuid').val()+"';"); -// load_logmessage_table(); -//} -// -//function removeeditorhost(){ -// appdb.dbexec("UPDATE messagelog set editor=null where editor='"+myhostname+"';"); -// load_logmessage_table(); -//} - - -function load_logmessage_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var logsql = "SELECT uuid, logtitle,'' || logdate || '' || strftime('%d.%m.%Y',logdate) as logdate,'' || lastmodified || '' || strftime('%d.%m.%Y %H:%M',lastmodified,'"+mins+" minutes') as lastmodified,editor FROM messagelog where date(logdate) between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day');"; - var logdata = appdb.dbquery(logsql); - var headerdata = getlabels("subject,daydate,lastmodified"); - $("#tbl_logcominterne").html(""); - //tbllog = null; - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logcominterne").append("" + tblheader + ""); - $("#tbl_logcominterne").append("" + tblheader + ""); - $("#tbl_logcominterne").append(""); - - - for (var i in logdata.sqldata){ - var sel = ""; - var row = logdata.sqldata[i]; - if (pconfig.messageuuid && row.uuid == pconfig.messageuuid) { - sel = "selected"; - load_messagelog(); - } - - var tr = '' + row.logtitle + ''+ - '' + row.logdate + ''+ - ''+ row.lastmodified+''+ -// ''+ row.editor +''+ - ''; - - $("#tbl_logcominterne").append(tr); - } - - $("#tbl_logcominterne").append(""); - - - tbllog = $("#tbl_logcominterne").dataTable({ - "language": { - "url": "../../web/js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - - - - $('#tbl_logcominterne').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logcominterne",pconfig); - - } ); - - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - - -$('#tbl_logcominterne tbody').on( 'click', 'tr', function () { - //dump("select activity\n"); - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - $("#btnedit").hide(); -// $("#btnprotection").hide(); - $("#btndelete").hide(); - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curmessage = $(this).attr('data-message'); - //setforeigneditor($(this).attr('data-editor')); - pconfig.messageuuid = curmessage; - var cilogsql = "SELECT editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var cdata = appdb.dbquery(cilogsql); -// if (cdata.sqldata[0].editor == '' || cdata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); -// } -// if (cdata.sqldata[0].editor != '' && cdata.sqldata[0].editor != myhostname){ -// $("#btnprotection").show(); -// } - apppref.setpreference("pageconfig.logcominterne",pconfig); - load_messagelog(); - } - } ); -} - -function newlogmessage(){ - var nuuid = appdb.generate_uuid(); - var sql = "INSERT INTO messagelog (uuid,logtitle,logdate) VALUES ('"+nuuid+"','nouveau message',date('"+xcurdate.toLocaleFormat('%Y-%m-%d')+"'));"; - //dump(sql + "\n"); - appdb.dbexec(sql); - pconfig.messageuuid=nuuid; - apppref.setpreference("pageconfig.logcominterne",pconfig); - edit_cominternelog(); -} - -function edit_cominternelog(){ - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdate) as logdate, logtitle, logmessage,editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var adata = appdb.dbquery(actlogsql); - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); -// if ((adata.sqldata[0].editor != '') && (adata.sqldata[0].editor != myhostname)){ -// system.popup("cette communication est bloqué par l'editeur: " + adata.sqldata[0].editor); -// load_logmessage_table(); -// return; -// } -// seteditorhost(); - if (adata.sqldata.length > 0){ - $('#frmeditcominterne #loguuid').val(adata.sqldata[0].uuid); - $("#frmeditcominterne #logtitle").val(adata.sqldata[0].logtitle); - $("#frmeditcominterne #logdate").val(adata.sqldata[0].logdate); - $("#frmeditcominterne #logmessage").summernote('reset'); - $("#frmeditcominterne #logmessage").summernote('code',htmlUnescape(adata.sqldata[0].logmessage)); - } - $("#edit_cominternelog").modal('show'); -} - -function load_messagelog(){ - $("#btnedit").hide(); -// $("#btnprotection").hide(); - $("#btndelete").hide(); - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdate) as logdate, logtitle, logmessage,editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var adata = appdb.dbquery(actlogsql); - //dump(childlogsql + " -> " +JSON.stringify(chdata) + "\n"); - var inftitle = ""; - if (adata.sqldata.length > 0){ - //dump("load data from db\n"); - $("#cominterneloguuid").val(adata.sqldata[0].uuid); - $("#cominternelogmessage").html(htmlUnescape(adata.sqldata[0].logmessage)); - $("#cominternelogtitle").html(adata.sqldata[0].logtitle); - $("#cominternelogdate").html(adata.sqldata[0].logdate); - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } -// if (adata.sqldata[0].editor != '' && adata.sqldata[0].editor != myhostname){ -// $("#btnprotection").show(); -// } - inftitle=adata.sqldata[0].logtitle; - }else { - //dump("set data to empty fields\n"); - $("#cominterneloguuid").val('0'); - $("#cominternelogmessage").html(""); - $("#cominternelogtitle").html(""); - $("#cominternelogdate").html(""); - - } - - set_infoheader(inftitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - -} - -function save_cominternelog(){ - var ld = encodeparam($("#frmeditcominterne #logdate").val(),"date"); - $("#cominterneloguuid").val($("#frmeditcominterne #loguuid").val()); - //var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var lsql = "UPDATE messagelog set logtitle="+encodeparam($('#frmeditcominterne #logtitle').val(),"text")+ - ",logmessage="+encodeparam($('#frmeditcominterne #logmessage').val(),"richtextarea")+ - ",logdate=date("+ld+") where uuid='"+$("#frmeditcominterne #loguuid").val()+"';"; - //dump("SV cominterne: "+ lsql + "\n"); - appdb.dbexec(lsql); - //removeeditorhost(); - $("#edit_cominternelog").modal('hide'); - //load_logmessage_table(); - load_messagelog(); - -} - -function confirm_delete_cominterne() { - - deluuid = $("#cominterneloguuid").val(); - $('#confirm_delete_logcominterne').modal('show'); -} - -function delete_logcominterne() { - appdb.dbexec("delete from messagelog where uuid='"+ deluuid+"';"); - load_logmessage_table(); - $('#confirm_delete_logcominterne').modal('hide'); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logcominterne", pconfig); - removeeditorhost(); - //dump("Next Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne_free', - module: 'logbook', - header: 'Communication interne' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logcominterne", pconfig); - removeeditorhost(); - //dump("previous Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne_free', - module: 'logbook', - header: 'Communication interne' - }, null); -} - -function set_logmonth(){ - pconfig.logmonth =$("#logmonth").val(); - apppref.setpreference("pageconfig.logcominterne",pconfig); - removeeditorhost(); - //dump("Set Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne_free', - module: 'logbook', - header: 'Communication interne' - }); -} - -//function confirm_delete_protection(){ -// $("#confirm_delete_protection").modal('show'); -//} -// -//function delete_protection(){ -// //dump("DELPROT: UPDATE messagelog set editor=null where uuid='"+$('#loguuid').val()+"';\n"); -// appdb.dbexec("UPDATE messagelog set editor=null where uuid='"+$('#cominterneloguuid').val()+"';"); -// $('#editorhost').html(''); -// $('#btneditorhost').removeClass('btn-danger'); -// $('#btneditorhost').addClass('btn-default'); -// $('#btnprotection').hide(); -// load_logmessage_table(); -// $("#confirm_delete_protection").modal('hide'); -//} \ No newline at end of file diff --git a/app_v3/chrome/content/modules/staff/coworker.html b/app_v3/chrome/content/modules/staff/coworker.html index ddefafb..13f2ba0 100644 --- a/app_v3/chrome/content/modules/staff/coworker.html +++ b/app_v3/chrome/content/modules/staff/coworker.html @@ -633,8 +633,6 @@ - - diff --git a/app_v3/chrome/content/web/childs_basic.html b/app_v3/chrome/content/web/childs_basic.html deleted file mode 100644 index 00a15b3..0000000 --- a/app_v3/chrome/content/web/childs_basic.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - Enfants - - - - - - - - - - - - - - - - -
- -
- - -
- - -
-
- - - -
- - - - - -
-
- - - - - - - - - - - - - - - diff --git a/app_v3/chrome/content/web/js/childs.js b/app_v3/chrome/content/web/js/childs.js index 38ad613..9b8056f 100644 --- a/app_v3/chrome/content/web/js/childs.js +++ b/app_v3/chrome/content/web/js/childs.js @@ -11,7 +11,7 @@ var childtbl = null; var wh= window.innerHeight -125; //var a = {}; //var btnprintchild = ""; - +var candelete = 1; function initdata(){ var configdata = apppref.getpreference("pageconfig.childs"); if (configdata !== '') { @@ -21,7 +21,9 @@ function initdata(){ pconfig.printlayout = 'list'; apppref.setpreference("pageconfig.childs",pconfig); } - + if (system.appinfo().ID.indexOf("director")){ + candelete = 1; + } var filters = getallfilters(); var strfilters = ""; for (var f in filters) { @@ -50,7 +52,10 @@ function initdata(){ function loadtable() { - var actionbtnsql = ""; + var actionbtnsql = ""; + if (candelete == 1){ + actionbtnsql += ""; + } var sql = filter.sql; sql = sql.replace('%%ACTION%%',actionbtnsql); var actionbtnsql2 = ""; diff --git a/app_v3/chrome/content/web/js/childs_basic.js b/app_v3/chrome/content/web/js/childs_basic.js deleted file mode 100644 index da9df51..0000000 --- a/app_v3/chrome/content/web/js/childs_basic.js +++ /dev/null @@ -1,140 +0,0 @@ -//Source-code licensed under EUPL v1.1 ( Copyright 2016 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var idfilter = null; -var filter = null; -var delchild = null; -//var printchild = null; -//var pagename = "childs"; -var pconfig = {}; -var childtbl = null; -//var printchilddef = {}; -var wh= window.innerHeight -125; -//var a = {}; -//var btnprintchild = ""; - -function initdata(){ - var configdata = apppref.getpreference("pageconfig.childs"); - if (configdata !== '') { - pconfig = JSON.parse(configdata); - } - if (!pconfig.printlayout) { - pconfig.printlayout = 'list'; - apppref.setpreference("pageconfig.childs",pconfig); - } - - var filters = getallfilters(); - var strfilters = ""; - for (var f in filters) { - if (pconfig.filterid === "") { - idfilter = 0; - filter = filters[0]; - set_infoheader(filter.description); - - pconfig.idfilter = 0; - apppref.setpreference("pageconfig.childs",pconfig); - } - if (pconfig.filterid == f) { - idfilter = f; - filter = filters[f]; - set_infoheader(filter.description); - - } - strfilters += '
  • ' + filters[f].description + '
  • '; - } - - - $("#cmb_childsfilter").html(strfilters); - - loadtable(); -} - - -function loadtable() { - var actionbtnsql = ""; - var sql = filter.sql; - sql = sql.replace('%%ACTION%%',actionbtnsql); - var actionbtnsql2 = ""; - sql = sql.replace('%%ACTION2%%',actionbtnsql2); - var data = appdb.dbqueryarray(sql); - - - var headerdata = null; - - headerdata = getlabels(data.sqlhead.join(",")); - - $("#tbl_childs").html(""); - var nhd = []; - for (var i in headerdata){ - nhd.push({"title":headerdata[i]["title"],"class":headerdata[i]["class"]}); - } - - $("#tbl_childs").append(); - childtbl = $("#tbl_childs").dataTable({ - "language": { - "url": "js/locale/datatable_fr.json" - }, - "data": data.sqldata, - "columns": nhd, - "scrollY": wh + "px", - "scrollCollapse": true, - "paging": false, - "ordering": true, - "info": true, - "filter": true, - "destroy": true - }); - -// if (pconfig.filter) { -// childtbl.fnFilter(pconfig.filter); -// } - if (pconfig.order) { - childtbl.fnSort(pconfig.order); - } - -} - -//$('#tbl_childs').on( 'search.dt', function () { -// pconfig.filter = childtbl.api().search(); -// apppref.setpreference("pageconfig.childs",pconfig); -// } ); - - $('#tbl_childs').on( 'order.dt', function () { - pconfig.order= childtbl.fnSettings().aaSorting; - apppref.setpreference("pageconfig.childs",pconfig); - } ); - - - - - - -function setfilter(fid) { - idfilter = fid; - filter = getfilter(fid); - //cond = fnew.filtersql; - pconfig.filterid = fid; - apppref.setpreference("pageconfig.childs",pconfig); - globelreq.send_request({ - page: 'childs_basic', - data: null, - header: 'Enfants' - }); - //set_infoheader(filter.description); - //loadtable(); -} - -function addchild() { - var newuuid = appdb.generate_uuid(); - appdb.dbexec("insert into childs (uuid,birthday,entrydate,leavedate) VALUES ('" + newuuid + "',date('now','-2 months'),date('now'),date('now'));"); - globelreq.send_request({ - page: 'child', - data: { - "uuid": newuuid - }, - header: 'Enfant' - }); -} - - - - diff --git a/install/create_setup_windows.pl b/install/create_setup_windows.pl index 4748910..c34987e 100644 --- a/install/create_setup_windows.pl +++ b/install/create_setup_windows.pl @@ -5,16 +5,18 @@ use File::Copy; use File::Copy::Recursive qw(rcopy); use File::Find::Rule; use Getopt::Long; +use File::Basename; +use FindBin qw($Bin); use File::Path qw(make_path remove_tree); use Data::Dumper; my $tag=""; -#my $showtags = 0; my $setup = ""; -#GetOptions("tag|t=s" => \$tag, "showtags|s" => \$showtags,"version|v=s" => \$setup); - - -chdir "C:\\Users\\ksaff\\Workspace\\creorga"; -my $strtags = `"C:\\Program Files\\Git\\bin\\git.exe" for-each-ref --sort=-creatordate --format="%(refname)" refs/tags`; +my $reppath = dirname($Bin); +my $releasepath = $ENV{"USERPROFILE"}."\\Release"; +my $setuppath = $ENV{"USERPROFILE"}."\\Setups"; +print "Repository Path:".$reppath."\n"; +chdir $reppath; +my $strtags = `"git.exe" for-each-ref --sort=-creatordate --format="%(refname)" refs/tags`; my @modes = ("director","staff","localmanager"); print "Select Mode:\n"; @@ -43,118 +45,99 @@ $tag = ; chomp($tag); print "Compiling Creorga ".$setup." version ".$tag."\n"; +if (! -d $releasepath){ + mkdir($releasepath); +} +else { + remove_tree($releasepath,{keep_root => 1}); +} -remove_tree("C:\\Users\\ksaff\\Release",{keep_root => 1}); if (scalar(@tex) > 0) { print "Tag $tag exists!\n"; }else { print "Tag $tag does not exist!\n"; - chdir "C:\\Users\\ksaff\\Workspace\\creorga\\Creorga"; - system('"C:\\Program Files\\Git\\bin\\git.exe" tag '.$tag.' -m "Version '.$tag.'";'); + chdir $reppath; + system('"git.exe" tag '.$tag.' -m "Version '.$tag.'";'); } -system('"C:\\Program Files\\Git\\bin\\git.exe" archive -o "C:\\Users\\ksaff\\Release\\Creorga_'.$tag.'.zip" '.$tag.''); -make_path("C:\\Users\\ksaff\\Release\\tag"); -chdir "C:\\Users\\ksaff\\Release\\tag"; +system('"git.exe" archive -o "$releasepath\\Creorga_'.$tag.'.zip" '.$tag.''); +make_path("$releasepath\\tag"); +chdir "$releasepath\\tag"; + +system('"C:\\Tools\\7za.exe" x "$releasepath\\Creorga_'.$tag.'.zip"'); +chdir "$releasepath\\tag\\app_v3"; -system('"C:\\Tools\\7za.exe" x "C:\\Users\\ksaff\\Release\\Creorga_'.$tag.'.zip"'); -chdir "C:\\Users\\ksaff\\Release\\tag\\app_v3"; if ($setup eq "director"){ my @unused_files = File::Find::Rule->file() ->name( qr/.+_basic.*/ ) - ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3"); - foreach my $a (@unused_files){ - print "unlink $a\n"; - unlink($a); - } - @unused_files = File::Find::Rule->file() - ->name( qr/.+_free.*/ ) - ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3"); + ->in("$releasepath\\tag\\app_v3"); foreach my $a (@unused_files){ print "unlink $a\n"; unlink($a); } - remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\staff_basic"); - #remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\default_free"); + + remove_tree("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\staff_basic"); + } elsif ($setup eq "staff"){ my @unused_files = File::Find::Rule->file() ->name( qr/.+_standard.*/ ) - ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3"); + ->in("$releasepath\\tag\\app_v3"); foreach my $a (@unused_files){ print "unlink $a\n"; unlink($a); } - @unused_files = File::Find::Rule->file() - ->name( qr/.+_free.*/ ) - ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3"); - foreach my $a (@unused_files){ - print "unlink $a\n"; - unlink($a); - } - unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logbook.xul"); - unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logactivity.html"); - unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logactivity.js"); - remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\default_standard"); - remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\accounting"); - #remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\staff"); + + unlink("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logbook.xul"); + unlink("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logactivity.html"); + unlink("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logactivity.js"); + remove_tree("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\default_standard"); + remove_tree("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\accounting"); } elsif ($setup eq "localmanager"){ my @unused_files = File::Find::Rule->file() ->name( qr/.+_standard.*/ ) - ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3"); - foreach my $a (@unused_files){ - print "unlink $a\n"; - unlink($a); - } - @unused_files = File::Find::Rule->file() - ->name( qr/.+_free.*/ ) - ->in("C:\\Users\\ksaff\\Release\\tag\\app_v3"); + ->in("$releasepath\\tag\\app_v3"); foreach my $a (@unused_files){ print "unlink $a\n"; unlink($a); } - unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logbook.xul"); - unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logactivity.html"); - unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logactivity.js"); - remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\default_standard"); - remove_tree("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome\\content\\modules\\accounting"); - #remove_tree("C:\\Users\\ksaff\\Release\\tag\\app\\chrome\\content\\modules\\staff"); + unlink("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logbook.xul"); + unlink("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\logbook\\logactivity.html"); + unlink("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\logbook\\js\\logactivity.js"); + remove_tree("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\default_standard"); + remove_tree("$releasepath\\tag\\app_v3\\chrome\\content\\modules\\accounting"); } system('"C:\\Tools\\7za.exe" a -r creorga_'.$setup.'.jar chrome'); -make_path("C:\\Users\\ksaff\\Release\\dist"); -rcopy("C:\\Users\\ksaff\\Workspace\\xulrunner\\xulrunner","C:\\Users\\ksaff\\Release\\dist\\xulrunner"); +make_path("$releasepath\\dist"); +rcopy("C:\\Users\\ksaff\\Workspace\\xulrunner\\xulrunner","$releasepath\\dist\\xulrunner"); -copy("C:\\Users\\ksaff\\Workspace\\xulrunner\\Creorga.exe","C:\\Users\\ksaff\\Release\\dist\\Creorga.exe"); -copy("C:\\Users\\ksaff\\Workspace\\xulrunner\\vc_redist.x86.exe","C:\\Users\\ksaff\\Release\\dist\\vcredist_x86.exe"); -copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\creorga_".$setup.".jar","C:\\Users\\ksaff\\Release\\dist\\creorga.jar"); +copy("C:\\Users\\ksaff\\Workspace\\xulrunner\\Creorga.exe","$releasepath\\dist\\Creorga.exe"); +copy("C:\\Users\\ksaff\\Workspace\\xulrunner\\vc_redist.x86.exe","$releasepath\\dist\\vcredist_x86.exe"); +copy("$releasepath\\tag\\app_v3\\creorga_".$setup.".jar","$releasepath\\dist\\creorga.jar"); if ($setup eq "staff"){ - copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome.manifest_basic","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest"); + copy("$releasepath\\tag\\app_v3\\chrome.manifest_basic","$releasepath\\dist\\chrome.manifest"); } elsif ($setup eq "localmanager") { - copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome.manifest_localmanager","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest"); + copy("$releasepath\\tag\\app_v3\\chrome.manifest_localmanager","$releasepath\\dist\\chrome.manifest"); } else { - copy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\chrome.manifest","C:\\Users\\ksaff\\Release\\dist\\chrome.manifest"); + copy("$releasepath\\tag\\app_v3\\chrome.manifest","$releasepath\\dist\\chrome.manifest"); } -rcopy("C:\\Users\\ksaff\\Release\\tag\\app_v3\\defaults","C:\\Users\\ksaff\\Release\\dist\\defaults"); +rcopy("$releasepath\\tag\\app_v3\\defaults","$releasepath\\dist\\defaults"); if ($tag !~ /beta/) { - unlink("C:\\Users\\ksaff\\Release\\dist\\defaults\\preferences\\debug.js"); + unlink("$releasepath\\dist\\defaults\\preferences\\debug.js"); } -unlink("C:\\Users\\ksaff\\Release\\dist\\xulrunner\\redit.exe"); -unlink("C:\\Users\\ksaff\\Release\\dist\\xulrunner\\xulrunner-stub.exe"); -#my $fmanif="C:\\Users\\ksaff\\Release\\dist\\chrome.manifest"; -#if ($setup eq "basic"){ -# $fmanif = "C:\\Users\\ksaff\\Release\\dist\\chrome.manifest_basic"; -#} -open(CHR,"C:\\Users\\ksaff\\Release\\dist\\chrome.manifest"); +unlink("$releasepath\\dist\\xulrunner\\redit.exe"); +unlink("$releasepath\\dist\\xulrunner\\xulrunner-stub.exe"); +open(CHR,"$releasepath\\dist\\chrome.manifest"); my $nf = ""; while (my $l = ) { $l =~ s|chrome\/|jar:creorga.jar!\/chrome\/|g; $nf .= $l; } -open(NCHR,">C:\\Users\\ksaff\\Release\\dist\\chrome.manifest"); +open(NCHR,">$releasepath\\dist\\chrome.manifest"); print NCHR $nf; close(NCHR); @@ -164,7 +147,7 @@ $ct[4] = $ct[4] + 1; if ($ct[4] < 10) { $ct[4] = "0".$ct[4]} if ($ct[3] < 10) { $ct[3] = "0".$ct[3]} -open(APP,">C:\\Users\\ksaff\\Release\\dist\\application.ini"); +open(APP,">$releasepath\\dist\\application.ini"); print APP "[App]\n"; print APP "Vendor=DKS\n"; print APP "Name=Creorga\n"; @@ -178,56 +161,42 @@ print APP "MinVersion=38.0.6\n"; print APP "MaxVersion=38.0.6\n"; close(APP); -make_path("C:\\Users\\ksaff\\Release\\dist\\Tools"); -chdir("C:\\Users\\ksaff\\Release\\tag\\Tools"); -system('"C:\\Strawberry\\perl\\site\\bin\\pp" -o "C:\\Users\\ksaff\\Release\\dist\\Tools\\ovpn.exe" ovpn.pl'); +make_path("$releasepath\\dist\\Tools"); +chdir("$releasepath\\tag\\Tools"); +system('"C:\\Strawberry\\perl\\site\\bin\\pp" -o "$releasepath\\dist\\Tools\\ovpn.exe" ovpn.pl'); if (($setup eq "director")){ -# open(CHKS,">C:\\Users\\ksaff\\Release\\dist\\checkschema.txt"); -# close(CHKS); - - copy("C:\\Debug\\Creorga\\Tools\\pdftotext.exe","C:\\Users\\ksaff\\Release\\dist\\Tools\\pdftotext.exe"); - #chdir("C:\\Users\\ksaff\\Release\\tag\\tools\\perl"); -# chdir("C:\\Users\\ksaff\\Release\\tag\\app_v3\\Tools"); -# unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\Tools\\vpnclose.sh"); -# unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\Tools\\vpnconnect.sh"); -# unlink("C:\\Users\\ksaff\\Release\\tag\\app_v3\\Tools\\vpncfg.txt"); + + copy("C:\\Debug\\Creorga\\Tools\\pdftotext.exe","$releasepath\\dist\\Tools\\pdftotext.exe"); + #chdir("$releasepath\\tag\\tools\\perl"); +# chdir("$releasepath\\tag\\app_v3\\Tools"); +# unlink("$releasepath\\tag\\app_v3\\Tools\\vpnclose.sh"); +# unlink("$releasepath\\tag\\app_v3\\Tools\\vpnconnect.sh"); +# unlink("$releasepath\\tag\\app_v3\\Tools\\vpncfg.txt"); #compile executeables - chdir("C:\\Users\\ksaff\\Release\\tag\\Tools"); - system('"C:\\Strawberry\\perl\\site\\bin\\pp" -o "C:\\Users\\ksaff\\Release\\dist\\Tools\\creorgadb.exe" creorgadb.pl'); - system('"C:\\Strawberry\\perl\\site\\bin\\pp" -o "C:\\Users\\ksaff\\Release\\dist\\Tools\\pdfextract.exe" --module="XML::Simple" --compress 6 pdfextract.pl'); - #copy("C:\\Debug\\Creorga\\Tools\\pdfextract2.exe","C:\\Users\\ksaff\\Release\\dist\\Tools\\pdfextract.exe"); - #system('"C:\\Strawberry\\perl\\site\\bin\\pp" -o "C:\\Debug\\Creorga\\Tools\\pdfextract.exe" --module="XML::LibXML" pdfextract.pl'); + chdir("$releasepath\\tag\\Tools"); + system('"C:\\Strawberry\\perl\\site\\bin\\pp" -o "$releasepath\\dist\\Tools\\creorgadb.exe" creorgadb.pl'); + system('"C:\\Strawberry\\perl\\site\\bin\\pp" -o "$releasepath\\dist\\Tools\\pdfextract.exe" --module="XML::Simple" --compress 6 pdfextract.pl'); } print "Release compiled!\n"; -chdir("C:\\Users\\ksaff\\Release"); +chdir("$releasepath"); -system('"C:\\Program Files (x86)\\Inno Setup 5\\ISCC.exe" /dMyAppVersion='.$tag.' "C:\\Users\\ksaff\\Workspace\\creorga\\install\\windows\\creorga_setup_'.$setup.'.iss"'); -if (-e "C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag."_".$setup.".exe"){ +system('"C:\\Program Files (x86)\\Inno Setup 5\\ISCC.exe" /dMyAppVersion='.$tag.' "$reppath\\install\\windows\\creorga_setup_'.$setup.'.iss"'); +if (-e "$releasepath\\Setup_Creorga_".$tag."_".$setup.".exe"){ print "Setup created\n"; - copy("C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag."_".$setup.".exe","C:\\Users\\ksaff\\Setups\\Setup_Creorga_".$tag."_".$setup.".exe"); - print "copied to C:\\Users\\ksaff\\Setups\n"; + copy("$releasepath\\Setup_Creorga_".$tag."_".$setup.".exe","$setuppath\\Setup_Creorga_".$tag."_".$setup.".exe"); + print "copied to $setuppath\n"; } else { - #move("C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag.".exe","C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag."_".$setup.".exe"); print "FAILED to create Setup!!\n"; } -system('"C:\\Program Files (x86)\\Inno Setup 5\\ISCC.exe" /dMyAppVersion='.$tag.' "C:\\Users\\ksaff\\Workspace\\creorga\\install\\windows\\creorga_update_'.$setup.'.iss"'); -if (-e "C:\\Users\\ksaff\\Release\\Update_Creorga_".$tag."_".$setup.".exe"){ +system('"C:\\Program Files (x86)\\Inno Setup 5\\ISCC.exe" /dMyAppVersion='.$tag.' "$reppath\\install\\windows\\creorga_update_'.$setup.'.iss"'); +if (-e "$releasepath\\Update_Creorga_".$tag."_".$setup.".exe"){ print "Setup created\n"; - copy("C:\\Users\\ksaff\\Release\\Update_Creorga_".$tag."_".$setup.".exe","C:\\Users\\ksaff\\Setups\\Update_Creorga_".$tag."_".$setup.".exe"); - print "copied to C:\\Users\\ksaff\\Setups\n"; + copy("$releasepath\\Update_Creorga_".$tag."_".$setup.".exe","$setuppath\\Update_Creorga_".$tag."_".$setup.".exe"); + print "copied to $setuppath\n"; } else { - #move("C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag.".exe","C:\\Users\\ksaff\\Release\\Setup_Creorga_".$tag."_".$setup.".exe"); print "FAILED to create Setup!!\n"; } print "normal END!\n"; - -#system('"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86\\signtool.exe" sign /v /f "C:\\DKS\\Dokumente\\Certificates\\OS201603168961.pfx" /p "ltUedPZPjTTDke7pONAa" /v "C:\\Users\\ksaff\\Release\\Setup_Creorga_'.$tag.'_'.$setup.'.exe"'); -#system('"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86\\signtool.exe" sign /v /f "C:\\DKS\\Dokumente\\Certificates\\OS201603168961.pfx" /p "ltUedPZPjTTDke7pONAa" /t http://timestamp.globalsign.com/scripts/timestamp.dll /v "C:\\Users\\ksaff\\Release\\Setup_Creorga_'.$tag.'_'.$setup.'.exe"'); -#system('"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86\\signtool.exe" sign /v /f "C:\\DKS\\Dokumente\\Certificates\\OS201603168961.pfx" /p "ltUedPZPjTTDke7pONAa" /t http://timestamp.verisign.com/scripts/timestamp.dll /v "C:\\Users\\ksaff\\Release\\Setup_Creorga_'.$tag.'_'.$setup.'.exe"'); - -#print "Setup signed\n"; - -#set SERVERLIST=(http://timestamp.comodoca.com/authenticode http://timestamp.verisign.com/scripts/timestamp.dll http://timestamp.globalsign.com/scripts/timestamp.dll http://tsa.starfieldtech.com) -- 2.39.5