diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..4ec11ed --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,63 @@ +Les dernières améliorations de STUdS + Changelog version 0.6.7 (mai 2011) + - fork du projet STUdS (https://sourcesup.cru.fr/projects/studs/) de la version trunk du 15 mai 2011) + Changelog version 0.6.6 (XXX 2011) : + - internationalisation avec gettext + - abstraction de la base de données avec ADOdb + - support de mysql (fichier d'initialisation disponible) + - meilleure compatibilité avec le mode strict de PHP + - factorisation de code et de CSS + - moins de boutons de formulaire, plus de liens + + Changelog version 0.6.5 (juin 2010) : + - Changement de deux icones dans la creation d'un sondage. + + Changelog version 0.6.4 (mars 2010) : + - Corrections de bug + + Changelog version 0.6.3 (janvier 2010) : + - Corrections de bug + + Changelog version 0.6.2 (novembre 2009) : + - Correction dans l'affichage des bandeaux, + - Modification de la partie "A propos", + - Préparation à l'authentification, + - De UdSification de l'application dans certains fichiers. + + Changelog version 0.6.1 (octobre 2009) : + - Corrections d'erreurs dans les traductions et d'oublis de traduction dans certaines pages. + + Changelog version 0.6 (août 2009) : + - Mise sous la licence CeCILL-B du code source de STUdS, + - Passage de STUdS en encodage UTF8, + - Ajout des icones des menus dans toutes les pages et non pas seulement sur la page d'accueil, + - Correction d'un bug lors du rajout d'une colonne dans l'interface d'administration des sondages. + + Changelog version 0.5 (février 2009) : + - Traduction de STUdS en anglais, allemand et espagnol, + - Changement de la CSS avec ajout du logo de l'Université de Strasbourg, + - Possibilité d'ajouter un commentaire pour les sondés. + + Changelog version 0.4 (janvier 2009) : + - Possibilité de faire un export PDF pour envoyer la lettre de convocation à la date de réunion, + - Possibilité de rajouter des colonnes dans la partie administration de sondage, + - Correction de bugs d'affichage avec les caractères ' et " . + + Changelog version 0.3 (novembre 2008) : + - Possibilité de faire un export CSV pour exploiter le sondage dans un tableur, + - Mise en place d'un repository Subversion pour partager les nouvelles versions de STUdS, + - Amélioration de la CSS pour un meilleur affichage, + - Modification du code source pour le rendre portable vers une autre machine. + + Changelog version 0.2 (novembre 2008) : + - Lors de la création d'un sondage DATE, classement des dates par ordre croissant, + - Lors de la création d'un sondage DATE, accepter les horaires au format "8h" ou "8H", + - Lors de la création d'un sondage DATE, possibilité de copier des horaires entre les dates, + - Lors d'une modification de ligne, cocher les cases initialement choisies et non pas des cases vides, + - Changement du format d'affichage des dates pour un formatage type : "Mardi 13/06", + - Meilleure visualisation des choix les plus votés, + - Possibilité pour l'administrateur du sondage de choisir de recevoir un mail d'alerte à chaque participation d'un sondé, + - Remplacement des boutons de formulaire par des images moins austères, + - Correction de quelques petits bugs d'affichage, + - Possibilité de rajouter des cases supplémentaires lors de la création d'un sondage AUTRE, + - Possibilité de rajouter des cases supplémentaires lors de la création d'un sondage DATE. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..d207a6f --- /dev/null +++ b/INSTALL @@ -0,0 +1,186 @@ +========================================================================== + +Université de Strasbourg - Direction Informatique +Auteur : Guilhem BORGHESI +Création : Février 2008 + +borghesi@unistra.fr + +Ce logiciel est régi par la licence CeCILL-B soumise au droit français et +respectant les principes de diffusion des logiciels libres. Vous pouvez +utiliser, modifier et/ou redistribuer ce programme sous les conditions +de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +sur le site "http://www.cecill.info". + +Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +pris connaissance de la licence CeCILL-B, et que vous en avez accepté les +termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. + +========================================================================== + +Université de Strasbourg - Direction Informatique +Author : Guilhem BORGHESI +Creation : Feb 2008 + +borghesi@unistra.fr + +This software is governed by the CeCILL-B license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL-B +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL-B license and that you accept its terms. You can +find a copy of this license in the file LICENSE. + +========================================================================== + + +Paramètres +========== + +Le fichier variables.php.template contient le paramétrage par défaut de +l'application STUdS. Pour personnaliser votre installation, copiez +ce fichier sous le nom variables.php et modifiez ce dernier. + +Configuration du fichier php.ini +================================ + +Pour que les quotes simples soient acceptées dans la partie "Création de sondage", il faut que la variable magic_quotes_gpc soit activée ("On") dans le fichier php.ini. + + +Base de données +=============== + +STUdS fonctionne indépendemment de la base SQL utilisée, sous réserve que +le serveur dispose de l'extension ADOdb (http://sourceforge.net/projects/adodb) + +Cependant la base de donnée doit être créée au préalable. +Deux scripts le faisant sont fournis : +install.sql: pour postgresql +install.mysql.sql: pour mysql + +Pour postgresql : +Après avoir renseigné les paramètres de la base de données, créez la +base et pré-chargez les données par défaut. Ceci ressemble à : + +% su - pgsql +% createdb studs +% psql -d studs -f install.sql + +Attention : Si vous créez la base de données avec l'utilisateur "pgsql", il vous faudra faire un "grant all on to studs" pour donner les droits à l'utilisateur studs de lire et modifier la base. Les tables de l'applications sont décrites plus loin dans ce fichier dans la partie "Tables de la base de données". + + +Accès à la page administrateur +============================== + +Le répertoire admin/ contient un fichier .htaccess pour Apache, qui restreint l'accès +à la page d'administration de l'application. +Modifiez le contenu de ce fichier .htaccess pour l'adapter au chemin du fichier .htpasswd +sur votre serveur. +Le fichier .htpasswd à besoin d'être créé par vos soins en utilisant par exemple la commande +suivante : +htpasswd -mnb + +Un fichier admin/logs_studs.txt doit être créé et accessible en écriture +par votre serveur Web. Quelque chose comme : + +% touch admin/logs_studs.txt +% chmod 700 admin/logs_studs.txt +% chown www-data admin/logs_studs.txt + +devrait convenir. + +Maintenance +=========== +Studs dispose d'une possibilité de mise en maintenance par le biais +d'un fichier .htaccess. +La section relative à Studs, dans la configuration d'Apache +doit au moins contenir : +AllowOverride AuthConfig Options +Le fichier .htaccess correspondant doit être modifier pour y configurer +l'adresse IP depuis laquelle s'effectue la maintenance. +N'oubliez pas de le recommenter en intégralité une fois la maintenance effectuée. + +Tables de la base de données +============================ + +Voici la structure des tables de l'application. La base se compose de trois tables : + +- sondage : Le contenu de chacun des sondages, +- sujet_studs : les sujets ou dates de tous les sondages, +- user_studs : les identifiants des sondés de tous les sondages. + +Chacune des tables contient les champs suivants : + +SONDAGE + + Nom du champ format description + + id_sondage (clé primaire) alpha-numérique numéro du sondage aléatoire + commentaires text commentaires liés au sondage + mail_admin text adresse de l'auteur du sondage + nom_admin text nom de l'auteur du sondage + titre text titre du sondage + id_sondage_admin alpha-numérique numéro du sondage pour le lien d'administration + date_fin alpha-numérique date de fin su sondage au format SQL + format text format du sondage : D/D+ pour Date, A/A+ pour Autre + mailsonde text envoi de mail a l'auteur du sondage a chaque participation ("yes" ou vide) + +SUJET_STUDS + + Nom du champ format description + + id_sondage (clé primaire) alpha-numérique numéro du sondage aléatoire + sujet text tous les sujets du sondage + +USER_STUDS + + Nom du champ format description + + user text nom du participant + id_sondage (clé primaire) alpha-numérique numéro du sondage aléatoire + reponses text reponses a chacun des sujets proposés au vote (0 pour non, 1 pour OK) + id_users alpha-numérique numéro d'utilisateur par ordre croissant de participation pour garder l'ordre de participation + +COMMENTS + Nom du champ format description + + id_sondage (clé primaire) alpha-numérique numéro du sondage aléatoire + comment text commentaires d'un participant + usercomment text nom de l'utilisateur qui laisse le commentaire + id_comment alpha-numérique numéro de commentaire par ordre croissant de participation pour garder l'ordre de remplissage + + +Traductions +=========== + +Pour pouvoir bénéficier de toutes les traductions en FR, EN, DE et ES +il faut avoir installé les locales fr_FR, de_DE, en_US et es_ES sur le +serveur qui héberge l'application ainsi que disposer de l'extension PHP Gettext. + +Export +====== + +Pour pouvoir bénéficier de l'export au format PDF, l'extension PHP PEAR +FPDF (php-fpdf) doit être installée. + +Synthèses des librairies utilisées +================================== + +ADOdb +http://sourceforge.net/projects/adodb +paquet: php5-adodb + +fpdf +http://www.fpdf.org +paquet: php-fpdf + +gettext +https://launchpad.net/php-gettext +paquet: php-gettext + +Sous GNU/Linux, +disposer des locales utf-8 suivantes pour la glibc: +FR, EN, ES, DE (/etc/locales.gen) diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..e313d19 --- /dev/null +++ b/LICENCE @@ -0,0 +1,519 @@ +CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B + + + Avertissement + +Ce contrat est une licence de logiciel libre issue d'une concertation +entre ses auteurs afin que le respect de deux grands principes préside à +sa rédaction: + + * d'une part, le respect des principes de diffusion des logiciels + libres: accès au code source, droits étendus conférés aux + utilisateurs, + * d'autre part, la désignation d'un droit applicable, le droit + français, auquel elle est conforme, tant au regard du droit de la + responsabilité civile que du droit de la propriété intellectuelle + et de la protection qu'il offre aux auteurs et titulaires des + droits patrimoniaux sur un logiciel. + +Les auteurs de la licence CeCILL-B (pour Ce[a] C[nrs] I[nria] L[ogiciel] +L[ibre]) sont: + +Commissariat à l'Energie Atomique - CEA, établissement public de +recherche à caractère scientifique, technique et industriel, dont le +siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris. + +Centre National de la Recherche Scientifique - CNRS, établissement +public à caractère scientifique et technologique, dont le siège est +situé 3 rue Michel-Ange, 75794 Paris cedex 16. + +Institut National de Recherche en Informatique et en Automatique - +INRIA, établissement public à caractère scientifique et technologique, +dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153 +Le Chesnay cedex. + + + Préambule + +Ce contrat est une licence de logiciel libre dont l'objectif est de +conférer aux utilisateurs une très large liberté de modification et de +redistribution du logiciel régi par cette licence. + +L'exercice de cette liberté est assorti d'une obligation forte de +citation à la charge de ceux qui distribueraient un logiciel incorporant +un logiciel régi par la présente licence afin d'assurer que les +contributions de tous soient correctement identifiées et reconnues. + +L'accessibilité au code source et les droits de copie, de modification +et de redistribution qui découlent de ce contrat ont pour contrepartie +de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire +peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et +les concédants successifs qu'une responsabilité restreinte. + +A cet égard l'attention de l'utilisateur est attirée sur les risques +associés au chargement, à l'utilisation, à la modification et/ou au +développement et à la reproduction du logiciel par l'utilisateur étant +donné sa spécificité de logiciel libre, qui peut le rendre complexe à +manipuler et qui le réserve donc à des développeurs ou des +professionnels avertis possédant des connaissances informatiques +approfondies. Les utilisateurs sont donc invités à charger et tester +l'adéquation du logiciel à leurs besoins dans des conditions permettant +d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus +généralement, à l'utiliser et l'exploiter dans les mêmes conditions de +sécurité. Ce contrat peut être reproduit et diffusé librement, sous +réserve de le conserver en l'état, sans ajout ni suppression de clauses. + +Ce contrat est susceptible de s'appliquer à tout logiciel dont le +titulaire des droits patrimoniaux décide de soumettre l'exploitation aux +dispositions qu'il contient. + + + Article 1 - DEFINITIONS + +Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une +lettre capitale, auront la signification suivante: + +Contrat: désigne le présent contrat de licence, ses éventuelles versions +postérieures et annexes. + +Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code +Source et le cas échéant sa documentation, dans leur état au moment de +l'acceptation du Contrat par le Licencié. + +Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et +éventuellement de Code Objet et le cas échéant sa documentation, dans +leur état au moment de leur première diffusion sous les termes du Contrat. + +Logiciel Modifié: désigne le Logiciel modifié par au moins une +Contribution. + +Code Source: désigne l'ensemble des instructions et des lignes de +programme du Logiciel et auquel l'accès est nécessaire en vue de +modifier le Logiciel. + +Code Objet: désigne les fichiers binaires issus de la compilation du +Code Source. + +Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur +sur le Logiciel Initial. + +Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le +Contrat. + +Contributeur: désigne le Licencié auteur d'au moins une Contribution. + +Concédant: désigne le Titulaire ou toute personne physique ou morale +distribuant le Logiciel sous le Contrat. + +Contribution: désigne l'ensemble des modifications, corrections, +traductions, adaptations et/ou nouvelles fonctionnalités intégrées dans +le Logiciel par tout Contributeur, ainsi que tout Module Interne. + +Module: désigne un ensemble de fichiers sources y compris leur +documentation qui permet de réaliser des fonctionnalités ou services +supplémentaires à ceux fournis par le Logiciel. + +Module Externe: désigne tout Module, non dérivé du Logiciel, tel que ce +Module et le Logiciel s'exécutent dans des espaces d'adressage +différents, l'un appelant l'autre au moment de leur exécution. + +Module Interne: désigne tout Module lié au Logiciel de telle sorte +qu'ils s'exécutent dans le même espace d'adressage. + +Parties: désigne collectivement le Licencié et le Concédant. + +Ces termes s'entendent au singulier comme au pluriel. + + + Article 2 - OBJET + +Le Contrat a pour objet la concession par le Concédant au Licencié d'une +licence non exclusive, cessible et mondiale du Logiciel telle que +définie ci-après à l'article 5 pour toute la durée de protection des droits +portant sur ce Logiciel. + + + Article 3 - ACCEPTATION + +3.1 L'acceptation par le Licencié des termes du Contrat est réputée +acquise du fait du premier des faits suivants: + + * (i) le chargement du Logiciel par tout moyen notamment par + téléchargement à partir d'un serveur distant ou par chargement à + partir d'un support physique; + * (ii) le premier exercice par le Licencié de l'un quelconque des + droits concédés par le Contrat. + +3.2 Un exemplaire du Contrat, contenant notamment un avertissement +relatif aux spécificités du Logiciel, à la restriction de garantie et à +la limitation à un usage par des utilisateurs expérimentés a été mis à +disposition du Licencié préalablement à son acceptation telle que +définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris +connaissance. + + + Article 4 - ENTREE EN VIGUEUR ET DUREE + + + 4.1 ENTREE EN VIGUEUR + +Le Contrat entre en vigueur à la date de son acceptation par le Licencié +telle que définie en 3.1. + + + 4.2 DUREE + +Le Contrat produira ses effets pendant toute la durée légale de +protection des droits patrimoniaux portant sur le Logiciel. + + + Article 5 - ETENDUE DES DROITS CONCEDES + +Le Concédant concède au Licencié, qui accepte, les droits suivants sur +le Logiciel pour toutes destinations et pour la durée du Contrat dans +les conditions ci-après détaillées. + +Par ailleurs, si le Concédant détient ou venait à détenir un ou +plusieurs brevets d'invention protégeant tout ou partie des +fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas +opposer les éventuels droits conférés par ces brevets aux Licenciés +successifs qui utiliseraient, exploiteraient ou modifieraient le +Logiciel. En cas de cession de ces brevets, le Concédant s'engage à +faire reprendre les obligations du présent alinéa aux cessionnaires. + + + 5.1 DROIT D'UTILISATION + +Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant +aux domaines d'application, étant ci-après précisé que cela comporte: + + 1. la reproduction permanente ou provisoire du Logiciel en tout ou + partie par tout moyen et sous toute forme. + + 2. le chargement, l'affichage, l'exécution, ou le stockage du + Logiciel sur tout support. + + 3. la possibilité d'en observer, d'en étudier, ou d'en tester le + fonctionnement afin de déterminer les idées et principes qui sont + à la base de n'importe quel élément de ce Logiciel; et ceci, + lorsque le Licencié effectue toute opération de chargement, + d'affichage, d'exécution, de transmission ou de stockage du + Logiciel qu'il est en droit d'effectuer en vertu du Contrat. + + + 5.2 DROIT D'APPORTER DES CONTRIBUTIONS + +Le droit d'apporter des Contributions comporte le droit de traduire, +d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel +et le droit de reproduire le logiciel en résultant. + +Le Licencié est autorisé à apporter toute Contribution au Logiciel sous +réserve de mentionner, de façon explicite, son nom en tant qu'auteur de +cette Contribution et la date de création de celle-ci. + + + 5.3 DROIT DE DISTRIBUTION + +Le droit de distribution comporte notamment le droit de diffuser, de +transmettre et de communiquer le Logiciel au public sur tout support et +par tout moyen ainsi que le droit de mettre sur le marché à titre +onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé. + +Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou +non, à des tiers dans les conditions ci-après détaillées. + + + 5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION + +Le Licencié est autorisé à distribuer des copies conformes du Logiciel, +sous forme de Code Source ou de Code Objet, à condition que cette +distribution respecte les dispositions du Contrat dans leur totalité et +soit accompagnée: + + 1. d'un exemplaire du Contrat, + + 2. d'un avertissement relatif à la restriction de garantie et de + responsabilité du Concédant telle que prévue aux articles 8 + et 9, + +et que, dans le cas où seul le Code Objet du Logiciel est redistribué, +le Licencié permette un accès effectif au Code Source complet du +Logiciel pendant au moins toute la durée de sa distribution du Logiciel, +étant entendu que le coût additionnel d'acquisition du Code Source ne +devra pas excéder le simple coût de transfert des données. + + + 5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE + +Lorsque le Licencié apporte une Contribution au Logiciel, le Logiciel +Modifié peut être distribué sous un contrat de licence autre que le +présent Contrat sous réserve du respect des dispositions de l'article +5.3.4. + + + 5.3.3 DISTRIBUTION DES MODULES EXTERNES + +Lorsque le Licencié a développé un Module Externe les conditions du +Contrat ne s'appliquent pas à ce Module Externe, qui peut être distribué +sous un contrat de licence différent. + + + 5.3.4 CITATIONS + +Le Licencié qui distribue un Logiciel Modifié s'engage expressément: + + 1. à indiquer dans sa documentation qu'il a été réalisé à partir du + Logiciel régi par le Contrat, en reproduisant les mentions de + propriété intellectuelle du Logiciel, + + 2. à faire en sorte que l'utilisation du Logiciel, ses mentions de + propriété intellectuelle et le fait qu'il est régi par le Contrat + soient indiqués dans un texte facilement accessible depuis + l'interface du Logiciel Modifié, + + 3. à mentionner, sur un site Web librement accessible décrivant le + Logiciel Modifié, et pendant au moins toute la durée de sa + distribution, qu'il a été réalisé à partir du Logiciel régi par le + Contrat, en reproduisant les mentions de propriété intellectuelle + du Logiciel, + + 4. lorsqu'il le distribue à un tiers susceptible de distribuer + lui-même un Logiciel Modifié, sans avoir à en distribuer le code + source, à faire ses meilleurs efforts pour que les obligations du + présent article 5.3.4 soient reprises par le dit tiers. + +Lorsque le Logiciel modifié ou non est distribué avec un Module Externe +qui a été conçu pour l'utiliser, le Licencié doit soumettre le dit +Module Externe aux obligations précédentes. + + + 5.3.5 COMPATIBILITE AVEC LES LICENCES CeCILL et CeCILL-C + +Lorsqu'un Logiciel Modifié contient une Contribution soumise au contrat +de licence CeCILL, les stipulations prévues à l'article 5.3.4 sont +facultatives. + +Un Logiciel Modifié peut être distribué sous le contrat de licence +CeCILL-C. Les stipulations prévues à l'article 5.3.4 sont alors +facultatives. + + + Article 6 - PROPRIETE INTELLECTUELLE + + + 6.1 SUR LE LOGICIEL INITIAL + +Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel +Initial. Toute utilisation du Logiciel Initial est soumise au respect +des conditions dans lesquelles le Titulaire a choisi de diffuser son +oeuvre et nul autre n'a la faculté de modifier les conditions de +diffusion de ce Logiciel Initial. + +Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi +par le Contrat et ce, pour la durée visée à l'article 4.2. + + + 6.2 SUR LES CONTRIBUTIONS + +Le Licencié qui a développé une Contribution est titulaire sur celle-ci +des droits de propriété intellectuelle dans les conditions définies par +la législation applicable. + + + 6.3 SUR LES MODULES EXTERNES + +Le Licencié qui a développé un Module Externe est titulaire sur celui-ci +des droits de propriété intellectuelle dans les conditions définies par +la législation applicable et reste libre du choix du contrat régissant +sa diffusion. + + + 6.4 DISPOSITIONS COMMUNES + +Le Licencié s'engage expressément: + + 1. à ne pas supprimer ou modifier de quelque manière que ce soit les + mentions de propriété intellectuelle apposées sur le Logiciel; + + 2. à reproduire à l'identique lesdites mentions de propriété + intellectuelle sur les copies du Logiciel modifié ou non. + +Le Licencié s'engage à ne pas porter atteinte, directement ou +indirectement, aux droits de propriété intellectuelle du Titulaire et/ou +des Contributeurs sur le Logiciel et à prendre, le cas échéant, à +l'égard de son personnel toutes les mesures nécessaires pour assurer le +respect des dits droits de propriété intellectuelle du Titulaire et/ou +des Contributeurs. + + + Article 7 - SERVICES ASSOCIES + +7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de +prestations d'assistance technique ou de maintenance du Logiciel. + +Cependant le Concédant reste libre de proposer ce type de services. Les +termes et conditions d'une telle assistance technique et/ou d'une telle +maintenance seront alors déterminés dans un acte séparé. Ces actes de +maintenance et/ou assistance technique n'engageront que la seule +responsabilité du Concédant qui les propose. + +7.2 De même, tout Concédant est libre de proposer, sous sa seule +responsabilité, à ses licenciés une garantie, qui n'engagera que lui, +lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce, +dans les conditions qu'il souhaite. Cette garantie et les modalités +financières de son application feront l'objet d'un acte séparé entre le +Concédant et le Licencié. + + + Article 8 - RESPONSABILITE + +8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la +faculté, sous réserve de prouver la faute du Concédant concerné, de +solliciter la réparation du préjudice direct qu'il subirait du fait du +Logiciel et dont il apportera la preuve. + +8.2 La responsabilité du Concédant est limitée aux engagements pris en +application du Contrat et ne saurait être engagée en raison notamment: +(i) des dommages dus à l'inexécution, totale ou partielle, de ses +obligations par le Licencié, (ii) des dommages directs ou indirects +découlant de l'utilisation ou des performances du Logiciel subis par le +Licencié et (iii) plus généralement d'un quelconque dommage indirect. En +particulier, les Parties conviennent expressément que tout préjudice +financier ou commercial (par exemple perte de données, perte de +bénéfices, perte d'exploitation, perte de clientèle ou de commandes, +manque à gagner, trouble commercial quelconque) ou toute action dirigée +contre le Licencié par un tiers, constitue un dommage indirect et +n'ouvre pas droit à réparation par le Concédant. + + + Article 9 - GARANTIE + +9.1 Le Licencié reconnaît que l'état actuel des connaissances +scientifiques et techniques au moment de la mise en circulation du +Logiciel ne permet pas d'en tester et d'en vérifier toutes les +utilisations ni de détecter l'existence d'éventuels défauts. L'attention +du Licencié a été attirée sur ce point sur les risques associés au +chargement, à l'utilisation, la modification et/ou au développement et à +la reproduction du Logiciel qui sont réservés à des utilisateurs avertis. + +Il relève de la responsabilité du Licencié de contrôler, par tous +moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et +de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens. + +9.2 Le Concédant déclare de bonne foi être en droit de concéder +l'ensemble des droits attachés au Logiciel (comprenant notamment les +droits visés à l'article 5). + +9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le +Concédant sans autre garantie, expresse ou tacite, que celle prévue à +l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, +son caractère sécurisé, innovant ou pertinent. + +En particulier, le Concédant ne garantit pas que le Logiciel est exempt +d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible +avec l'équipement du Licencié et sa configuration logicielle ni qu'il +remplira les besoins du Licencié. + +9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le +Logiciel ne porte pas atteinte à un quelconque droit de propriété +intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout +autre droit de propriété. Ainsi, le Concédant exclut toute garantie au +profit du Licencié contre les actions en contrefaçon qui pourraient être +diligentées au titre de l'utilisation, de la modification, et de la +redistribution du Logiciel. Néanmoins, si de telles actions sont +exercées contre le Licencié, le Concédant lui apportera son aide +technique et juridique pour sa défense. Cette aide technique et +juridique est déterminée au cas par cas entre le Concédant concerné et +le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage +toute responsabilité quant à l'utilisation de la dénomination du +Logiciel par le Licencié. Aucune garantie n'est apportée quant à +l'existence de droits antérieurs sur le nom du Logiciel et sur +l'existence d'une marque. + + + Article 10 - RESILIATION + +10.1 En cas de manquement par le Licencié aux obligations mises à sa +charge par le Contrat, le Concédant pourra résilier de plein droit le +Contrat trente (30) jours après notification adressée au Licencié et +restée sans effet. + +10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à +utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les +licences qu'il aura concédées antérieurement à la résiliation du Contrat +resteront valides sous réserve qu'elles aient été effectuées en +conformité avec le Contrat. + + + Article 11 - DISPOSITIONS DIVERSES + + + 11.1 CAUSE EXTERIEURE + +Aucune des Parties ne sera responsable d'un retard ou d'une défaillance +d'exécution du Contrat qui serait dû à un cas de force majeure, un cas +fortuit ou une cause extérieure, telle que, notamment, le mauvais +fonctionnement ou les interruptions du réseau électrique ou de +télécommunication, la paralysie du réseau liée à une attaque +informatique, l'intervention des autorités gouvernementales, les +catastrophes naturelles, les dégâts des eaux, les tremblements de terre, +le feu, les explosions, les grèves et les conflits sociaux, l'état de +guerre... + +11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou +plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du +Contrat, ne pourra en aucun cas impliquer renonciation par la Partie +intéressée à s'en prévaloir ultérieurement. + +11.3 Le Contrat annule et remplace toute convention antérieure, écrite +ou orale, entre les Parties sur le même objet et constitue l'accord +entier entre les Parties sur cet objet. Aucune addition ou modification +aux termes du Contrat n'aura d'effet à l'égard des Parties à moins +d'être faite par écrit et signée par leurs représentants dûment habilités. + +11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat +s'avèrerait contraire à une loi ou à un texte applicable, existants ou +futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les +amendements nécessaires pour se conformer à cette loi ou à ce texte. +Toutes les autres dispositions resteront en vigueur. De même, la +nullité, pour quelque raison que ce soit, d'une des dispositions du +Contrat ne saurait entraîner la nullité de l'ensemble du Contrat. + + + 11.5 LANGUE + +Le Contrat est rédigé en langue française et en langue anglaise, ces +deux versions faisant également foi. + + + Article 12 - NOUVELLES VERSIONS DU CONTRAT + +12.1 Toute personne est autorisée à copier et distribuer des copies de +ce Contrat. + +12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé +et ne peut être modifié que par les auteurs de la licence, lesquels se +réservent le droit de publier périodiquement des mises à jour ou de +nouvelles versions du Contrat, qui posséderont chacune un numéro +distinct. Ces versions ultérieures seront susceptibles de prendre en +compte de nouvelles problématiques rencontrées par les logiciels libres. + +12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra +faire l'objet d'une diffusion ultérieure que sous la même version du +Contrat ou une version postérieure. + + + Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE + +13.1 Le Contrat est régi par la loi française. Les Parties conviennent +de tenter de régler à l'amiable les différends ou litiges qui +viendraient à se produire par suite ou à l'occasion du Contrat. + +13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter +de leur survenance et sauf situation relevant d'une procédure d'urgence, +les différends ou litiges seront portés par la Partie la plus diligente +devant les Tribunaux compétents de Paris. + + +Version 1.0 du 2006-09-05. + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0a20a7b --- /dev/null +++ b/LICENSE @@ -0,0 +1,515 @@ +CeCILL-B FREE SOFTWARE LICENSE AGREEMENT + + + Notice + +This Agreement is a Free Software license agreement that is the result +of discussions between its authors in order to ensure compliance with +the two main principles guiding its drafting: + + * firstly, compliance with the principles governing the distribution + of Free Software: access to source code, broad rights granted to + users, + * secondly, the election of a governing law, French law, with which + it is conformant, both as regards the law of torts and + intellectual property law, and the protection that it offers to + both authors and holders of the economic rights over software. + +The authors of the CeCILL-B (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) +license are: + +Commissariat à l'Energie Atomique - CEA, a public scientific, technical +and industrial research establishment, having its principal place of +business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France. + +Centre National de la Recherche Scientifique - CNRS, a public scientific +and technological establishment, having its principal place of business +at 3 rue Michel-Ange, 75794 Paris cedex 16, France. + +Institut National de Recherche en Informatique et en Automatique - +INRIA, a public scientific and technological establishment, having its +principal place of business at Domaine de Voluceau, Rocquencourt, BP +105, 78153 Le Chesnay cedex, France. + + + Preamble + +This Agreement is an open source software license intended to give users +significant freedom to modify and redistribute the software licensed +hereunder. + +The exercising of this freedom is conditional upon a strong obligation +of giving credits for everybody that distributes a software +incorporating a software ruled by the current license so as all +contributions to be properly identified and acknowledged. + +In consideration of access to the source code and the rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors only have limited liability. + +In this respect, the risks associated with loading, using, modifying +and/or developing or reproducing the software by the user are brought to +the user's attention, given its Free Software status, which may make it +complicated to use, with the result that its use is reserved for +developers and experienced professionals having in-depth computer +knowledge. Users are therefore encouraged to load and test the +suitability of the software as regards their requirements in conditions +enabling the security of their systems and/or data to be ensured and, +more generally, to use and operate it in the same conditions of +security. This Agreement may be freely reproduced and published, +provided it is not altered, and that no provisions are either added or +removed herefrom. + +This Agreement may apply to any or all software for which the holder of +the economic rights decides to submit the use thereof to its provisions. + + + Article 1 - DEFINITIONS + +For the purpose of this Agreement, when the following expressions +commence with a capital letter, they shall have the following meaning: + +Agreement: means this license agreement, and its possible subsequent +versions and annexes. + +Software: means the software in its Object Code and/or Source Code form +and, where applicable, its documentation, "as is" when the Licensee +accepts the Agreement. + +Initial Software: means the Software in its Source Code and possibly its +Object Code form and, where applicable, its documentation, "as is" when +it is first distributed under the terms and conditions of the Agreement. + +Modified Software: means the Software modified by at least one +Contribution. + +Source Code: means all the Software's instructions and program lines to +which access is required so as to modify the Software. + +Object Code: means the binary files originating from the compilation of +the Source Code. + +Holder: means the holder(s) of the economic rights over the Initial +Software. + +Licensee: means the Software user(s) having accepted the Agreement. + +Contributor: means a Licensee having made at least one Contribution. + +Licensor: means the Holder, or any other individual or legal entity, who +distributes the Software under the Agreement. + +Contribution: means any or all modifications, corrections, translations, +adaptations and/or new functions integrated into the Software by any or +all Contributors, as well as any or all Internal Modules. + +Module: means a set of sources files including their documentation that +enables supplementary functions or services in addition to those offered +by the Software. + +External Module: means any or all Modules, not derived from the +Software, so that this Module and the Software run in separate address +spaces, with one calling the other when they are run. + +Internal Module: means any or all Module, connected to the Software so +that they both execute in the same address space. + +Parties: mean both the Licensee and the Licensor. + +These expressions may be used both in singular and plural form. + + + Article 2 - PURPOSE + +The purpose of the Agreement is the grant by the Licensor to the +Licensee of a non-exclusive, transferable and worldwide license for the +Software as set forth in Article 5 hereinafter for the whole term of the +protection granted by the rights over said Software. + + + Article 3 - ACCEPTANCE + +3.1 The Licensee shall be deemed as having accepted the terms and +conditions of this Agreement upon the occurrence of the first of the +following events: + + * (i) loading the Software by any or all means, notably, by + downloading from a remote server, or by loading from a physical + medium; + * (ii) the first time the Licensee exercises any of the rights + granted hereunder. + +3.2 One copy of the Agreement, containing a notice relating to the +characteristics of the Software, to the limited warranty, and to the +fact that its use is restricted to experienced users has been provided +to the Licensee prior to its acceptance as set forth in Article 3.1 +hereinabove, and the Licensee hereby acknowledges that it has read and +understood it. + + + Article 4 - EFFECTIVE DATE AND TERM + + + 4.1 EFFECTIVE DATE + +The Agreement shall become effective on the date when it is accepted by +the Licensee as set forth in Article 3.1. + + + 4.2 TERM + +The Agreement shall remain in force for the entire legal term of +protection of the economic rights over the Software. + + + Article 5 - SCOPE OF RIGHTS GRANTED + +The Licensor hereby grants to the Licensee, who accepts, the following +rights over the Software for any or all use, and for the term of the +Agreement, on the basis of the terms and conditions set forth hereinafter. + +Besides, if the Licensor owns or comes to own one or more patents +protecting all or part of the functions of the Software or of its +components, the Licensor undertakes not to enforce the rights granted by +these patents against successive Licensees using, exploiting or +modifying the Software. If these patents are transferred, the Licensor +undertakes to have the transferees subscribe to the obligations set +forth in this paragraph. + + + 5.1 RIGHT OF USE + +The Licensee is authorized to use the Software, without any limitation +as to its fields of application, with it being hereinafter specified +that this comprises: + + 1. permanent or temporary reproduction of all or part of the Software + by any or all means and in any or all form. + + 2. loading, displaying, running, or storing the Software on any or + all medium. + + 3. entitlement to observe, study or test its operation so as to + determine the ideas and principles behind any or all constituent + elements of said Software. This shall apply when the Licensee + carries out any or all loading, displaying, running, transmission + or storage operation as regards the Software, that it is entitled + to carry out hereunder. + + + 5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS + +The right to make Contributions includes the right to translate, adapt, +arrange, or make any or all modifications to the Software, and the right +to reproduce the resulting software. + +The Licensee is authorized to make any or all Contributions to the +Software provided that it includes an explicit notice that it is the +author of said Contribution and indicates the date of the creation thereof. + + + 5.3 RIGHT OF DISTRIBUTION + +In particular, the right of distribution includes the right to publish, +transmit and communicate the Software to the general public on any or +all medium, and by any or all means, and the right to market, either in +consideration of a fee, or free of charge, one or more copies of the +Software by any means. + +The Licensee is further authorized to distribute copies of the modified +or unmodified Software to third parties according to the terms and +conditions set forth hereinafter. + + + 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION + +The Licensee is authorized to distribute true copies of the Software in +Source Code or Object Code form, provided that said distribution +complies with all the provisions of the Agreement and is accompanied by: + + 1. a copy of the Agreement, + + 2. a notice relating to the limitation of both the Licensor's + warranty and liability as set forth in Articles 8 and 9, + +and that, in the event that only the Object Code of the Software is +redistributed, the Licensee allows effective access to the full Source +Code of the Software at a minimum during the entire period of its +distribution of the Software, it being understood that the additional +cost of acquiring the Source Code shall not exceed the cost of +transferring the data. + + + 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE + +If the Licensee makes any Contribution to the Software, the resulting +Modified Software may be distributed under a license agreement other +than this Agreement subject to compliance with the provisions of Article +5.3.4. + + + 5.3.3 DISTRIBUTION OF EXTERNAL MODULES + +When the Licensee has developed an External Module, the terms and +conditions of this Agreement do not apply to said External Module, that +may be distributed under a separate license agreement. + + + 5.3.4 CREDITS + +Any Licensee who may distribute a Modified Software hereby expressly +agrees to: + + 1. indicate in the related documentation that it is based on the + Software licensed hereunder, and reproduce the intellectual + property notice for the Software, + + 2. ensure that written indications of the Software intended use, + intellectual property notice and license hereunder are included in + easily accessible format from the Modified Software interface, + + 3. mention, on a freely accessible website describing the Modified + Software, at least throughout the distribution term thereof, that + it is based on the Software licensed hereunder, and reproduce the + Software intellectual property notice, + + 4. where it is distributed to a third party that may distribute a + Modified Software without having to make its source code + available, make its best efforts to ensure that said third party + agrees to comply with the obligations set forth in this Article . + +If the Software, whether or not modified, is distributed with an +External Module designed for use in connection with the Software, the +Licensee shall submit said External Module to the foregoing obligations. + + + 5.3.5 COMPATIBILITY WITH THE CeCILL AND CeCILL-C LICENSES + +Where a Modified Software contains a Contribution subject to the CeCILL +license, the provisions set forth in Article 5.3.4 shall be optional. + +A Modified Software may be distributed under the CeCILL-C license. In +such a case the provisions set forth in Article 5.3.4 shall be optional. + + + Article 6 - INTELLECTUAL PROPERTY + + + 6.1 OVER THE INITIAL SOFTWARE + +The Holder owns the economic rights over the Initial Software. Any or +all use of the Initial Software is subject to compliance with the terms +and conditions under which the Holder has elected to distribute its work +and no one shall be entitled to modify the terms and conditions for the +distribution of said Initial Software. + +The Holder undertakes that the Initial Software will remain ruled at +least by this Agreement, for the duration set forth in Article 4.2. + + + 6.2 OVER THE CONTRIBUTIONS + +The Licensee who develops a Contribution is the owner of the +intellectual property rights over this Contribution as defined by +applicable law. + + + 6.3 OVER THE EXTERNAL MODULES + +The Licensee who develops an External Module is the owner of the +intellectual property rights over this External Module as defined by +applicable law and is free to choose the type of agreement that shall +govern its distribution. + + + 6.4 JOINT PROVISIONS + +The Licensee expressly undertakes: + + 1. not to remove, or modify, in any manner, the intellectual property + notices attached to the Software; + + 2. to reproduce said notices, in an identical manner, in the copies + of the Software modified or not. + +The Licensee undertakes not to directly or indirectly infringe the +intellectual property rights of the Holder and/or Contributors on the +Software and to take, where applicable, vis-à-vis its staff, any and all +measures required to ensure respect of said intellectual property rights +of the Holder and/or Contributors. + + + Article 7 - RELATED SERVICES + +7.1 Under no circumstances shall the Agreement oblige the Licensor to +provide technical assistance or maintenance services for the Software. + +However, the Licensor is entitled to offer this type of services. The +terms and conditions of such technical assistance, and/or such +maintenance, shall be set forth in a separate instrument. Only the +Licensor offering said maintenance and/or technical assistance services +shall incur liability therefor. + +7.2 Similarly, any Licensor is entitled to offer to its licensees, under +its sole responsibility, a warranty, that shall only be binding upon +itself, for the redistribution of the Software and/or the Modified +Software, under terms and conditions that it is free to decide. Said +warranty, and the financial terms and conditions of its application, +shall be subject of a separate instrument executed between the Licensor +and the Licensee. + + + Article 8 - LIABILITY + +8.1 Subject to the provisions of Article 8.2, the Licensee shall be +entitled to claim compensation for any direct loss it may have suffered +from the Software as a result of a fault on the part of the relevant +Licensor, subject to providing evidence thereof. + +8.2 The Licensor's liability is limited to the commitments made under +this Agreement and shall not be incurred as a result of in particular: +(i) loss due the Licensee's total or partial failure to fulfill its +obligations, (ii) direct or consequential loss that is suffered by the +Licensee due to the use or performance of the Software, and (iii) more +generally, any consequential loss. In particular the Parties expressly +agree that any or all pecuniary or business loss (i.e. loss of data, +loss of profits, operating loss, loss of customers or orders, +opportunity cost, any disturbance to business activities) or any or all +legal proceedings instituted against the Licensee by a third party, +shall constitute consequential loss and shall not provide entitlement to +any or all compensation from the Licensor. + + + Article 9 - WARRANTY + +9.1 The Licensee acknowledges that the scientific and technical +state-of-the-art when the Software was distributed did not enable all +possible uses to be tested and verified, nor for the presence of +possible defects to be detected. In this respect, the Licensee's +attention has been drawn to the risks associated with loading, using, +modifying and/or developing and reproducing the Software which are +reserved for experienced users. + +The Licensee shall be responsible for verifying, by any or all means, +the suitability of the product for its requirements, its good working +order, and for ensuring that it shall not cause damage to either persons +or properties. + +9.2 The Licensor hereby represents, in good faith, that it is entitled +to grant all the rights over the Software (including in particular the +rights set forth in Article 5). + +9.3 The Licensee acknowledges that the Software is supplied "as is" by +the Licensor without any other express or tacit warranty, other than +that provided for in Article 9.2 and, in particular, without any warranty +as to its commercial value, its secured, safe, innovative or relevant +nature. + +Specifically, the Licensor does not warrant that the Software is free +from any error, that it will operate without interruption, that it will +be compatible with the Licensee's own equipment and software +configuration, nor that it will meet the Licensee's requirements. + +9.4 The Licensor does not either expressly or tacitly warrant that the +Software does not infringe any third party intellectual property right +relating to a patent, software or any other property right. Therefore, +the Licensor disclaims any and all liability towards the Licensee +arising out of any or all proceedings for infringement that may be +instituted in respect of the use, modification and redistribution of the +Software. Nevertheless, should such proceedings be instituted against +the Licensee, the Licensor shall provide it with technical and legal +assistance for its defense. Such technical and legal assistance shall be +decided on a case-by-case basis between the relevant Licensor and the +Licensee pursuant to a memorandum of understanding. The Licensor +disclaims any and all liability as regards the Licensee's use of the +name of the Software. No warranty is given as regards the existence of +prior rights over the name of the Software or as regards the existence +of a trademark. + + + Article 10 - TERMINATION + +10.1 In the event of a breach by the Licensee of its obligations +hereunder, the Licensor may automatically terminate this Agreement +thirty (30) days after notice has been sent to the Licensee and has +remained ineffective. + +10.2 A Licensee whose Agreement is terminated shall no longer be +authorized to use, modify or distribute the Software. However, any +licenses that it may have granted prior to termination of the Agreement +shall remain valid subject to their having been granted in compliance +with the terms and conditions hereof. + + + Article 11 - MISCELLANEOUS + + + 11.1 EXCUSABLE EVENTS + +Neither Party shall be liable for any or all delay, or failure to +perform the Agreement, that may be attributable to an event of force +majeure, an act of God or an outside cause, such as defective +functioning or interruptions of the electricity or telecommunications +networks, network paralysis following a virus attack, intervention by +government authorities, natural disasters, water damage, earthquakes, +fire, explosions, strikes and labor unrest, war, etc. + +11.2 Any failure by either Party, on one or more occasions, to invoke +one or more of the provisions hereof, shall under no circumstances be +interpreted as being a waiver by the interested Party of its right to +invoke said provision(s) subsequently. + +11.3 The Agreement cancels and replaces any or all previous agreements, +whether written or oral, between the Parties and having the same +purpose, and constitutes the entirety of the agreement between said +Parties concerning said purpose. No supplement or modification to the +terms and conditions hereof shall be effective as between the Parties +unless it is made in writing and signed by their duly authorized +representatives. + +11.4 In the event that one or more of the provisions hereof were to +conflict with a current or future applicable act or legislative text, +said act or legislative text shall prevail, and the Parties shall make +the necessary amendments so as to comply with said act or legislative +text. All other provisions shall remain effective. Similarly, invalidity +of a provision of the Agreement, for any reason whatsoever, shall not +cause the Agreement as a whole to be invalid. + + + 11.5 LANGUAGE + +The Agreement is drafted in both French and English and both versions +are deemed authentic. + + + Article 12 - NEW VERSIONS OF THE AGREEMENT + +12.1 Any person is authorized to duplicate and distribute copies of this +Agreement. + +12.2 So as to ensure coherence, the wording of this Agreement is +protected and may only be modified by the authors of the License, who +reserve the right to periodically publish updates or new versions of the +Agreement, each with a separate number. These subsequent versions may +address new issues encountered by Free Software. + +12.3 Any Software distributed under a given version of the Agreement may +only be subsequently distributed under the same version of the Agreement +or a subsequent version. + + + Article 13 - GOVERNING LAW AND JURISDICTION + +13.1 The Agreement is governed by French law. The Parties agree to +endeavor to seek an amicable solution to any disagreements or disputes +that may arise during the performance of the Agreement. + +13.2 Failing an amicable solution within two (2) months as from their +occurrence, and unless emergency proceedings are necessary, the +disagreements or disputes shall be referred to the Paris Courts having +jurisdiction, by the more diligent Party. + + +Version 1.0 dated 2006-09-05. + diff --git a/README b/README index e69de29..cd9c2b2 100644 --- a/README +++ b/README @@ -0,0 +1,169 @@ +OpenSondage est un fork du projet STUdS : https://sourcesup.cru.fr/projects/studs/ + +Les auteurs principaux du projet STUdS sont : +- Guilhem BORGHESI +- Raphaël DROZ + + +========================================================================== + +Université de Strasbourg - Direction Informatique +Auteur : Guilhem BORGHESI +Création : Février 2008 + +borghesi@unistra.fr + +Ce logiciel est régi par la licence CeCILL-B soumise au droit français et +respectant les principes de diffusion des logiciels libres. Vous pouvez +utiliser, modifier et/ou redistribuer ce programme sous les conditions +de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +sur le site "http://www.cecill.info". + +Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +pris connaissance de la licence CeCILL-B, et que vous en avez accepté les +termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. + +========================================================================== + +Université de Strasbourg - Direction Informatique +Author : Guilhem BORGHESI +Creation : Feb 2008 + +borghesi@unistra.fr + +This software is governed by the CeCILL-B license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL-B +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL-B license and that you accept its terms. You can +find a copy of this license in the file LICENSE. + +========================================================================== + +============================================================================= +Fichiers de l'application +============================================================================= + +index.php + La page d'accueil de STUdS +studs.php + La page de présentation de sondage +adminstuds.php + La page d'administration réservée à l'auteur du sondage +infos_sondage.php + La page (1/2) de création de sondage récupérant les informations générales +choix_date.php + La page de création (2/2) pour un sondage pour déterminer une date +choix_autre.php + La page de création (2/2) pour un sondage sur un sujet quelconque +creation_sondage.php + Le fichier qui récupérent les informations des pages précédentes pour procéder à l'insertion du nouveau sondage dans la base PostgreSQL +style.css + Le fichier CSS de style pour toute l'application +variables.php + Le fichier contenant les variables à changer en fonction de la machine locale +fonctions.php + Le fichier contenant quelques fonctions récurrentes de l'application +i18n.php + Le fichier contenant quelques fonctions récurrentes de l'application relatives à l'internationalisation +README + Ce fichier +INSTALL + Le fichier contenant les informations d'installation sur l'application +CHANGELOG + Le fichier contenant toutes les modifications de l'application entre les différentes versions +contacts.php + La page permettant aux usagers de poser une question à l'administrateur de l'application +apropos.php + La page expliquant les détails techniques relatifs à l'application et les dernieres modifications et celles à venir sur l'application +bandeaux.php + Le fichier contenant tous les bandeaux des pages PHP de l'application +favicon.ico + L'icone de favoris de l'application +sources.php + La page qui propose les sources de l'application +exportics.php + Le fichier d'export de la meilleure date au format iCAL (fichier .ICS) +exportcsv.php + Le fichier d'export de tous le tableau des participants avec leurs réponses dans un tableur (format .CSV) +exportpdf.php + Le fichier d'export de la lettre de convocation que le créateur du sondage pourra envoyer aux participants (format .PDF) + +admin/ + Le répertoire réservé à l'administrateur de l'application +admin/.htaccess + Le fichier gérant les droits restreints du répertoire ADMIN +admin/.htpasswd + Le fichier contenant les passwd des logins ayant accès au répertoire ADMIN +admin/index.php + La page présentant tous les sondages actuellement dans la base à l'administrateur +admin/log_studs.txt + Le fichier contenant un historique de toutes les creations/suppressions de sondage dans la base + +errors/ + Le répertoire contenant toutes les pages d'erreurs +errors/error-forbidden.php + La page qui indique dans la charte graphique de l'application l'erreur "501 forbidden" +errors/maintenance.php + La page qui indique que l'application est en maintenance temporaire + +export/ + Le répertoire qui contient tous les exports ICS + +iCalcreator/ + Le répertoire qui contient les librairies d'export en iCal + +php2pdf/ + Le répertoire qui contient les librairies d'export en PDF + +scripts/ + Le répertoire qui contient tous les scripts de l'application + +sources/ + Le répertoire qui contient les sources de l'application disponible sur la page sources.php + +locale/ + Le répertoire qui contient les fichiers de traduction modifiables (.po) et compilés (.mo) + au format gettext + +============================================================================= + Validations des pages +============================================================================= + +Toutes les pages de STUdS sont validées HTML 4.01 Strict. +La CSS de STUdS est validée CSS 2.1. + +============================================================================= +Technologies utilisées +============================================================================= + +- PHP, php-fpdf, php-adodb, php-gettext +- PostgreSQL, mysql +- Apache +- Subversion +- iCalcreator +- POedit +- Icônes : Deleket (http://deleket.deviantart.com/) et DryIcons (http://dryicons.com) + +============================================================================= +Compatibilités des navigateurs +============================================================================= + +- Firefox +- Opera +- Konqueror +- Links +- Safari +- IE + +----------------- +Janvier 2008 +Guilhem BORGHESI +Université de Strasbourg + +Mai 2010 +Raphaël DROZ, raphael.droz@gmail.com + diff --git a/TODO b/TODO new file mode 100644 index 0000000..8aaf261 --- /dev/null +++ b/TODO @@ -0,0 +1,8 @@ +- case "Tout cocher" +- nom modifiable +- taille de colonne fixe lorsqu'un sondage ne spécifie pas les heures + (ou sondage à choix multiples "autre") +- vérifier la duplication de commentaires +- gestion auth intranet +- ajout de colonne de date graphique dans l'administration + diff --git a/admin/.htaccess b/admin/.htaccess new file mode 100644 index 0000000..c6b0600 --- /dev/null +++ b/admin/.htaccess @@ -0,0 +1,7 @@ +AuthType basic +AuthName "Administration de STUDS" +# replace with your server path here +# added content to the .htpasswd file with +# htpasswd -mnb +AuthUserFile /var/www/studs/admin/.htpasswd +Require valid-user diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..9ce186e --- /dev/null +++ b/admin/index.php @@ -0,0 +1,151 @@ +'."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +echo 'ADMINISTRATEUR de la base '.NOMAPPLICATION.''."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; + +//Affichage des bandeaux et début du formulaire +logo(); +bandeau_tete(); +bandeau_titre(_("Polls administrator")); +sous_bandeau_admin(); + +$sondage=$connect->Execute("select * from sondage"); + +echo'
'."\n"; +echo '
'."\n"; +// Test et affichage du bouton de confirmation en cas de suppression de sondage +$i=0; +while($dsondage = $sondage->FetchNextObject(false)) { + if ($_POST["supprimersondage$i"]){ + echo ''."\n"; + echo ''."\n"; + echo '
'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'" : '."\n"; + echo '
'."\n"; + echo '
'."\n"; + } + // Traitement de la confirmation de suppression + + if ($_POST["confirmesuppression$i"]){ + + $date=date('H:i:s d/m/Y'); + + // requetes SQL qui font le ménage dans la base + $connect->Execute('DELETE FROM sondage LEFT INNER JOIN sujet_studs ON sujet_studs.id_sondage = sondage.id_sondage '. + 'LEFT INNER JOIN user_studs ON user_studs.id_sondage = sondage.id_sondage ' . + 'LEFT INNER JOIN comments ON comments.id_sondage = sondage.id_sondage ' . + "WHERE id_sondage = '$dsondage->id_sondage' "); + + // ecriture des traces dans le fichier de logs + error_log($date . " SUPPRESSION: $dsondage->id_sondage\t$dsondage->format\t$dsondage->nom_admin\t$dsondage->mail_admin\t$nbuser\t$dsujets->sujet\n", 'logs_studs.txt'); + + } + $i++; +} + + +$sondage=$connect->Execute("select * from sondage"); +$nbsondages=$sondage->RecordCount(); + +echo $nbsondages.' '. _("polls in the database at this time") .'

'."\n"; + +// tableau qui affiche tous les sondages de la base +echo ''."\n"; + +echo ''."\n"; + + +$i = 0; +while($dsondage = $sondage->FetchNextObject(false)) { + /* possible en 1 bonne requête dans $sondage */ + $sujets=$connect->Execute( "select * from sujet_studs where id_sondage='$dsondage->id_sondage'"); + $dsujets=$sujets->FetchObject(false); + + $user_studs=$connect->Execute( "select * from user_studs where id_sondage='$dsondage->id_sondage'"); + $nbuser=$user_studs->RecordCount(); + + echo ''; + + if (strtotime($dsondage->date_fin) > time()){ + echo ''; + } + else{ + echo ''; + } + + echo''."\n"; + + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + echo ''."\n"; + $i++; +} + +echo '
'. _("Poll ID") .''. _("Format") .''. _("Title") .''. _("Author") .''. _("Expiration's date") .''. _("Users") .''. _("Actions") .'
'.$dsondage->id_sondage.''.$dsondage->format.''.$dsondage->titre.''.$dsondage->nom_admin.''.date("d/m/y",strtotime($dsondage->date_fin)).''.date("d/m/y",strtotime($dsondage->date_fin)).''.$nbuser.''. _("See the poll") .''. _("Change the poll") .'
'."\n"; +echo'
'."\n"; +// fin du formulaire et de la page web +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; + +// si on annule la suppression, rafraichissement de la page +if ($_POST["annulesuppression"]){ +} + +?> diff --git a/admin/logs_studs.txt b/admin/logs_studs.txt new file mode 100644 index 0000000..d8abac4 --- /dev/null +++ b/admin/logs_studs.txt @@ -0,0 +1,2 @@ + +16:34:47 06/06/2010: SUPPRESSION: u5rbpzr2aja7eajb D+ Raph raph@aze.com 3 17:02:51 06/06/2010: CREATION: pii9tzo2dku973qa A+ azeazeaz zezerer@azedqs.com bloup,plop,foo,bar,pz,wx diff --git a/adminstuds.php b/adminstuds.php new file mode 100644 index 0000000..924fd6c --- /dev/null +++ b/adminstuds.php @@ -0,0 +1,1050 @@ +Execute("SELECT * FROM sondage WHERE id_sondage_admin = '$numsondageadmin'"); + $sujets=$connect->Execute("SELECT * FROM sujet_studs WHERE id_sondage='$numsondage'"); + $user_studs=$connect->Execute("SELECT * FROM user_studs WHERE id_sondage='$numsondage' order by id_users"); + +} + +//verification de l'existence du sondage, s'il n'existe pas on met une page d'erreur +if (!$sondage || $sondage->RecordCount() != 1){ + print_header(false); + echo ''."\n"; + + logo(); + bandeau_tete(); + bandeau_titre(_("Error!")); + echo '
'."\n"; + print "

" . _("This poll doesn't exist !") . "



"."\n"; + print "" . _("Back to the homepage of ") . "
".NOMAPPLICATION.". "."\n"; + echo '



'."\n"; + echo '
'."\n"; +# sur_bandeau_pied(); + bandeau_pied(); + + echo''."\n"; + echo ''."\n"; + die(); +} + +$dsujet=$sujets->FetchObject(false); +$dsondage=$sondage->FetchObject(false); + + +//si la valeur du nouveau titre est valide et que le bouton est activé +$adresseadmin = $dsondage->mail_admin; +$headers_str = << +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +EOF; +$header = sprintf($headers_str, NOMAPPLICATION, ADRESSEMAILADMIN ); + + +if (isset($_POST["boutonnouveautitre"])) { + if(! isset($_POST["nouveautitre"]) || empty($_POST["nouveautitre"])) + $err |= TITLE_EMPTY; + else { + //envoi du mail pour prevenir l'admin de sondage + mail ($adresseadmin, + _("[ADMINISTRATOR] New title for your poll") . ' ' . NOMAPPLICATION, + _("You have changed the title of your poll. \nYou can modify this poll with this link") . + " :\n\n".get_server_name()."/adminstuds.php?sondage=$numsondageadmin\n\n" . + _("Thanks for your confidence.") . "\n" . NOMAPPLICATION, + $headers); + + //modification de la base SQL avec le nouveau titre + $connect->Execute("UPDATE sondage SET titre = '" . $connect->qstr(strip_tags($_POST['nouveautitre'])) . "' WHERE id_sondage = '" . $numsondage . "'"); + } +} + +// si le bouton est activé, quelque soit la valeur du champ textarea +if (isset($_POST["boutonnouveauxcommentaires"])) { + if(! isset($_POST["nouveautitre"]) || empty($_POST["nouveautitre"])) + $err |= COMMENT_EMPTY; + else { + //envoi du mail pour prevenir l'admin de sondage + mail ($adresseadmin, + _("[ADMINISTRATOR] New comments for your poll") . ' ' . NOMAPPLICATION, + _("You have changed the comments of your poll. \nYou can modify this poll with this link") . + " :\n\n".get_server_name()."/adminstuds.php?sondage=$numsondageadmin \n\n" . + _("Thanks for your confidence.") . "\n" . NOMAPPLICATION, + $headers); + + //modification de la base SQL avec les nouveaux commentaires + $connect->Execute("UPDATE sondage SET commentaires = '" . $connect->qstr(strip_tags($nouveauxcommentaires)) . "' WHERE id_sondage = '" . $numsondage . "'"); + } +} + +//si la valeur de la nouvelle adresse est valide et que le bouton est activé +if (isset($_POST["boutonnouvelleadresse"])){ + if(! isset($_POST["nouvelleadresse"]) || empty($_POST["nouvelleadresse"]) || + ! filter_var($_POST["nouvelleadresse"], FILTER_VALIDATE_EMAIL) || strpos($_POST["nouvelleadresse"], '@') === false) + $err |= INVALID_EMAIL; + else { + //envoi du mail pour prevenir l'admin de sondage + mail ($_POST['nouvelleadresse'], + _("[ADMINISTRATOR] New email address for your poll") . ' ' . NOMAPPLICATION, + _("You have changed your email address in your poll. \nYou can modify this poll with this link") . + " :\n\n".get_server_name()."/adminstuds.php?sondage=$numsondageadmin\n\n" . + _("Thanks for your confidence.") . "\n" . NOMAPPLICATION, + $headers); + //modification de la base SQL avec la nouvelle adresse + $connect->Execute("UPDATE sondage SET mail_admin = '" . $_POST['nouvelleadresse'] . "' WHERE id_sondage = '" . $numsondage . "'"); + } +} + +// reload +$dsujet=$sujets->FetchObject(false); +$dsondage=$sondage->FetchObject(false); + +if ($_POST["ajoutsujet_x"]){ + + print_header(true); + echo ''."\n"; + logo(); + bandeau_tete(); + bandeau_titre(_("Make your polls")); + sous_bandeau(); + + //on recupere les données et les sujets du sondage + echo '
'."\n"; + + echo '
'."\n"; + print "

" . _("Column's adding") . "



"."\n"; + + if ($dsondage->format=="A"||$dsondage->format=="A+"){ + echo _("Add a new column") .' :


'."\n"; + } + else{ +//ajout d'une date avec creneau horaire + echo _("You can add a new scheduling date to your poll.
If you just want to add a new hour to an existant date, put the same date and choose a new hour.") .'

'."\n"; + echo _("Add a date") .' :

'."\n"; + echo ''."\n"; + + echo ''."\n"; + + + echo ''."\n"; + echo '

'. _("Add a start hour (optional)") .' :

'."\n"; + echo ''."\n"; + echo ''."\n"; + echo '

'. _("Add a end hour (optional)") .' :

'."\n"; + echo ''."\n"; + echo ''."\n"; + + + echo '

'."\n"; + echo' '."\n"; + + } + + echo ''."\n"; + echo '



'."\n"; + echo '
'."\n"; + + bandeau_pied(); + + echo''."\n"; + echo ''."\n"; + die(); +} + +//action si bouton confirmation de suppression est activé +if ($_POST["confirmesuppression"]){ + $nbuser=$user_studs->RecordCount(); + $date=date('H:i:s d/m/Y:'); + + // on ecrit dans le fichier de logs la suppression du sondage + error_log($date . " SUPPRESSION: $dsondage->id_sondage\t$dsondage->format\t$dsondage->nom_admin\t$dsondage->mail_admin\t$nbuser\t$dsujets->sujet\n", 3, 'admin/logs_studs.txt'); + + //envoi du mail a l'administrateur du sondage + mail ($adresseadmin, + _("[ADMINISTRATOR] Removing of your poll") . ' ' . NOMAPPLICATION, + _("You have removed your poll. \nYou can make new polls with this link") . + " :\n\n".get_server_name()."index.php \n\n" . + _("Thanks for your confidence.") . "\n" . NOMAPPLICATION, + $headers); + + //destruction des données dans la base SQL + $connect->Execute('DELETE FROM sondage LEFT INNER JOIN sujet_studs ON sujet_studs.id_sondage = sondage.id_sondage '. + 'LEFT INNER JOIN user_studs ON user_studs.id_sondage = sondage.id_sondage ' . + 'LEFT INNER JOIN comments ON comments.id_sondage = sondage.id_sondage ' . + "WHERE id_sondage = '$numsondage' "); + + //affichage de l'ecran de confirmation de suppression de sondage + print_header(); + echo ''."\n"; + logo(); + bandeau_tete(); + bandeau_titre(_("Make your polls")); + + echo '
'."\n"; + print "

" . _("Your poll has been removed!") . "



"; + print _("Back to the homepage of ") . " ".NOMAPPLICATION."."."\n"; + echo '


'."\n"; + echo '
'."\n"; + sur_bandeau_pied(); + bandeau_pied(); + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + die(); +} + +// quand on ajoute un commentaire utilisateur +if(isset($_POST['ajoutcomment'])) { + if(!isset($_POST["commentuser"]) || empty($_POST["commentuser"])) + $err |= COMMENT_USER_EMPTY; + else + $comment_user = $connect->qstr(strip_tags($_POST["commentuser"])); + if(empty($_POST["comment"])) + $err |= COMMENT_EMPTY; + + if (isset($_POST["comment"]) && + ! is_error(COMMENT_EMPTY) && ! is_error(NO_POLL) && + ! is_error(COMMENT_USER_EMPTY)) { + if( ! $connect->Execute('INSERT INTO comments ' . + '(id_sondage, comment, usercomment) VALUES ("'. + $numsondage . '","'. + $connect->qstr(strip_tags($_POST['comment'])). + '","' . + $comment_user .'")') ); + $err |= COMMENT_INSERT_FAILED; + } +} + + +//s'il existe on affiche la page normale +// DEBUT DE L'AFFICHAGE DE LA PAGE HTML +print_header(true); +echo ''."\n"; +logo(); +bandeau_tete(); +bandeau_titre(_("Make your polls")); +sous_bandeau(); + +echo '
'."\n"; + +//affichage du titre du sondage +$titre=str_replace("\\","",$dsondage->titre); +echo '

'.$titre.'

'."\n"; + +//affichage du nom de l'auteur du sondage +echo _("Initiator of the poll") .' : '.$dsondage->nom_admin.'
'."\n"; + +//affichage des commentaires du sondage +if ($dsondage->commentaires){ + echo '
'. _("Comments") .' :
'."\n"; + $commentaires=$dsondage->commentaires; + $commentaires=str_replace("\\","",$commentaires); + echo $commentaires; + echo '
'."\n"; +} +echo '
'."\n"; +echo '
'."\n"; + + +$nbcolonnes=substr_count($dsujet->sujet,',')+1; +$nblignes=$user_studs->RecordCount(); + +//si il n'y a pas suppression alors on peut afficher normalement le tableau + + //action si le bouton participer est cliqué + if ($_POST["boutonp"]||$_POST["boutonp_x"]){ + //si on a un nom dans la case texte + if ($_POST["nom"]){ + + for ($i=0;$i<$nbcolonnes;$i++){ + //si la checkbox est cochée alors valeur est egale à 1 + if (isset($_POST["choix$i"])){ + $nouveauchoix.="1"; + } + //sinon 0 + else { + $nouveauchoix.="0"; + } + } + + while( $user=$user_studs->FetchNextObject(false)) { + if ($_POST["nom"]==$user->nom){ + $erreur_prenom="yes"; + } + } + + if (preg_match(';<|>|"|\';i', $_POST["nom"])){ + $erreur_injection="yes"; + } + + + // Ecriture des choix de l'utilisateur dans la base + if (!$erreur_prenom&&!$erreur_injection){ + $nom=str_replace("'","°",$_POST["nom"]); + $connect->Execute("INSERT INTO user_studs VALUES ('$nom', '$numsondage', '$nouveauchoix')"); + } + } + + } + + + //action quand on ajoute une colonne au format AUTRE + if ($_POST["ajoutercolonne_x"] && $_POST["nouvellecolonne"]!=""&&($dsondage->format=="A"||$dsondage->format=="A+")){ + + $nouveauxsujets=$dsujet->sujet; + + //on rajoute la valeur a la fin de tous les sujets deja entrés + $nouveauxsujets.=","; + $nouveauxsujets.=str_replace(","," ",$_POST["nouvellecolonne"]); + $nouveauxsujets=str_replace("'","°",$nouveauxsujets); + + //mise a jour avec les nouveaux sujets dans la base + $connect->Execute("UPDATE sujet_studs SET sujet = '$nouveauxsujets' WHERE id_sondage = '$numsondage' "); + + //envoi d'un mail pour prévenir l'administrateur du changement + $headers="From: ".NOMAPPLICATION." <".ADRESSEMAILADMIN.">\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; + mail ("$adresseadmin", "" . _("[ADMINISTRATOR] New column for your poll").NOMAPPLICATION, "" . _("You have added a new column in your poll. \nYou can inform the voters of this change with this link") . " : \n\n".get_server_name()."/studs.php?sondage=$numsondage \n\n " . _("Thanks for your confidence.") . "\n".NOMAPPLICATION,$headers); + + } + + //action quand on ajoute une colonne au format DATE + if ($_POST["ajoutercolonne_x"] &&($dsondage->format=="D"||$dsondage->format=="D+")){ + + $nouveauxsujets=$dsujet->sujet; + + if ($_POST["nouveaujour"]!="vide"&&$_POST["nouveaumois"]!="vide"&&$_POST["nouvelleannee"]!="vide"){ + + $nouvelledate=mktime(0,0,0,$_POST["nouveaumois"],$_POST["nouveaujour"],$_POST["nouvelleannee"]); + + if ($_POST["nouvelleheuredebut"]!="vide"){ + + $nouvelledate.="@"; + $nouvelledate.=$_POST["nouvelleheuredebut"]; + $nouvelledate.="h"; + + if ($_POST["nouvelleminutedebut"]!="vide"){ + $nouvelledate.=$_POST["nouvelleminutedebut"]; + } + } + if ($_POST["nouvelleheurefin"]!="vide"){ + $nouvelledate.="-"; + $nouvelledate.=$_POST["nouvelleheurefin"]; + $nouvelledate.="h"; + + if ($_POST["nouvelleminutefin"]!="vide"){ + $nouvelledate.=$_POST["nouvelleminutefin"]; + } + } + if($_POST["nouvelleheuredebut"]=="vide"||($_POST["nouvelleheuredebut"]&&$_POST["nouvelleheurefin"]&&(($_POST["nouvelleheuredebut"]<$_POST["nouvelleheurefin"])||(($_POST["nouvelleheuredebut"]==$_POST["nouvelleheurefin"])&&($_POST["nouvelleminutedebut"]<$_POST["nouvelleminutefin"]))))){ + + } + else {$erreur_ajout_date="yes";} + + //on rajoute la valeur dans les valeurs + $datesbase=explode(",",$dsujet->sujet); + $taillebase=sizeof($datesbase); + + //recherche de l'endroit de l'insertion de la nouvelle date dans les dates deja entrées dans le tableau + + if ($nouvelledate<$datesbase[0]){ + $cleinsertion=0; + } + elseif ($nouvelledate>$datesbase[$taillebase-1]){ + $cleinsertion=count($datesbase); + } + else{ + for ($i=0;$i$datesbase[$i]&&$nouvelledate<$datesbase[$j]){ + $cleinsertion=$j; + } + } + } + + + array_splice($datesbase,$cleinsertion,0,$nouvelledate); + + $cle=array_search ($nouvelledate,$datesbase); + + for ($i=0;$iExecute("UPDATE sujet_studs SET sujet = '$dateinsertion' WHERE id_sondage = '$numsondage' "); + if ($nouvelledate > strtotime($dsondage->date_fin)){ + $date_fin=$nouvelledate+200000; + $connect->Execute("UPDATE sondage SET date_fin = '$date_fin' WHERE id_sondage = '$numsondage' "); + } + } + + //mise a jour des reponses actuelles correspondant au sujet ajouté + while ( $data=$user_studs->FetchNextObject(false)) { + $ensemblereponses=$data->reponses; + + //parcours de toutes les réponses actuelles + for ($j=0;$j<$nbcolonnes;$j++){ + $car=substr($ensemblereponses,$j,1); + + //si les reponses ne concerne pas la colonne ajoutée, on concatene + if ($j==$cle){ + $newcar.="0"; + } + $newcar.=$car; + } + //mise a jour des reponses utilisateurs dans la base + if (!$erreur_ajout_date){ + $connect->Execute("update user_studs set reponses='$newcar' where nom='$data->nom' and id_users=$data->id_users"); + } + $newcar=""; + } + + //envoi d'un mail pour prévenir l'administrateur du changement + $adresseadmin=$dsondage->mail_admin; + + mail ($adresseadmin, + _("[ADMINISTRATOR] New column for your poll"), + _("You have added a new column in your poll. \nYou can inform the voters of this change with this link") . " : \n\n".get_server_name()."/studs.php?sondage=$numsondage \n\n " . _("Thanks for your confidence.") . "\n".NOMAPPLICATION, + $headers); + + } + else {$erreur_ajout_date="yes";} + } + + //suppression de ligne dans la base + for ($i=0;$i<$nblignes;$i++){ + if ($_POST["effaceligne$i"]||$_POST['effaceligne'.$i.'_x']){ + $compteur=0; + while ($data=$user_studs->FetchNextObject(false)) { + + if ($compteur==$i){ + $connect->Execute("delete from user_studs where nom = '$data->nom' and id_users = '$data->id_users'"); + } + $compteur++; + } + } + } + + //suppression d'un commentaire utilisateur + + $comment_user=$connect->Execute("select * from comments where id_sondage='$numsondage' order by id_comment"); + $i = 0; + while ($dcomment = $comment_user->FetchNextObject(false)) { + if ($_POST['suppressioncomment'.$i.'_x']){ + $connect->Execute("delete from comments where id_comment = '$dcomment->id_comment'"); + } + $i++; + } + + //on teste pour voir si une ligne doit etre modifiée + for ($i=0;$i<$nblignes;$i++){ + if (isset($_POST["modifierligne$i"])||isset($_POST['modifierligne'.$i.'_x'])){ + $ligneamodifier=$i; + $testligneamodifier="true"; + } + //test pour voir si une ligne est a modifier + if (isset($_POST["validermodifier$i"])){ + $modifier=$i; + $testmodifier="true"; + } + } + + //si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs + if ($testmodifier){ + + for ($i=0;$i<$nbcolonnes;$i++){ + //recuperation des nouveaux choix de l'utilisateur + if (isset($_POST["choix$i"])){ + $nouveauchoix.="1"; + } + else { + $nouveauchoix.="0"; + } + } + + $compteur=0; + while ( $data=$user_studs->FetchNextObject(false)) { + //mise a jour des données de l'utilisateur dans la base SQL + if ($compteur==$modifier){ + $connect->Execute("update user_studs set reponses='$nouveauchoix' where nom='$data->nom' and id_users='$data->id_users'"); + } + $compteur++; + } + } + + //suppression de colonnes dans la base + for ($i=0;$i<$nbcolonnes;$i++){ + if ((isset($_POST["effacecolonne$i"])||isset($_POST['effacecolonne'.$i.'_x']))&&$nbcolonnes>1){ + + $toutsujet=explode(",",$dsujet->sujet); + $j=0; + + //parcours de tous les sujets actuels + while ($toutsujet[$j]){ + //si le sujet n'est pas celui qui a été effacé alors on concatene + if ($i!=$j){ + $nouveauxsujets.=','; + $nouveauxsujets.=$toutsujet[$j]; + } + $j++; + } + //on enleve la virgule au début + $nouveauxsujets=substr("$nouveauxsujets",1); + + //nettoyage des reponses actuelles correspondant au sujet effacé + $compteur = 0; + while ($data=$user_studs->FetchNextObject(false)) { + + $ensemblereponses=$data->reponses; + + //parcours de toutes les réponses actuelles + for ($j=0;$j<$nbcolonnes;$j++){ + $car=substr($ensemblereponses,$j,1); + //si les reponses ne concerne pas la colonne effacée, on concatene + if ($i!=$j){ + $newcar.=$car; + } + } + + $compteur++; + + //mise a jour des reponses utilisateurs dans la base + $connect->Execute("update user_studs set reponses='$newcar' where nom='$data->nom' and id_users=$data->id_users"); + $newcar=""; + } + //mise a jour des sujets dans la base + $connect->Execute("update sujet_studs set sujet = '$nouveauxsujets' where id_sondage = '$numsondage' "); + + } + + } + + //recuperation des donnes de la base + $sondage=$connect->Execute("select * from sondage where id_sondage_admin = '$numsondageadmin'"); + $sujets=$connect->Execute("select * from sujet_studs where id_sondage='$numsondage'"); + $user_studs=$connect->Execute("select * from user_studs where id_sondage='$numsondage' order by id_users"); + //on recupere les données et les sujets du sondage + $dsujet=$sujets->FetchObject(false); + $dsondage=$sondage->FetchObject(false); + + $toutsujet=explode(",",$dsujet->sujet); + $toutsujet=str_replace("@","
",$toutsujet); + $toutsujet=str_replace("°","'",$toutsujet); + $nbcolonnes=substr_count($dsujet->sujet,',')+1; + + echo '
'."\n"; + echo '
'."\n"; + echo _('As poll administrator, you can change all the lines of this poll with infos.
You can, as well, remove a column or a line with Cancel.
You can also add a new column with Add column.
Finally, you can change the informations of this poll like the title, the comments or your email address.') ."\n"; + + echo '

'."\n"; + + //debut de l'affichage de résultats + echo ''."\n"; + + //reformatage des données des sujets du sondage + $toutsujet=explode(",",$dsujet->sujet); + + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + //boucle pour l'affichage des boutons de suppression de colonne + for ($i=0;$toutsujet[$i];$i++){ + echo ''."\n"; + } + echo ''."\n"; + +//si le sondage est un sondage de date +if ($dsondage->format=="D"||$dsondage->format=="D+"){ + +//affichage des sujets du sondage + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + //affichage des années + $colspan=1; + for ($i=0;$i'.strftime("%Y",$toutsujet[$i]).''."\n"; + $colspan=1; + } + } + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + //affichage des mois + $colspan=1; + for ($i=0;$i'.date("F",$toutsujet[$i]).''."\n"; + else + echo ''."\n"; + $colspan=1; + } + } + + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + //affichage des jours + $colspan=1; + for ($i=0;$i'.date("D jS",$toutsujet[$i]).''."\n"; + else + echo ''."\n"; + $colspan=1; + } + } + echo ''."\n"; + echo ''."\n"; + //affichage des horaires + if (strpos($dsujet->sujet,'@') !== false){ + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + for ($i=0;$toutsujet[$i];$i++){ + $heures=explode("@",$toutsujet[$i]); + echo ''."\n"; + } + echo ''."\n"; + echo ''."\n"; + } + +} + +else { + $toutsujet=str_replace("°","'",$toutsujet); + +//affichage des sujets du sondage + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + for ($i=0;$toutsujet[$i];$i++){ + + echo ''."\n"; + } + echo ''."\n"; + echo ''."\n"; + +} + + + //affichage des resultats + $somme[]=0; + $compteur = 0; + while ( $data=$user_studs->FetchNextObject(false)) { + $ensemblereponses=$data->reponses; + + echo ''."\n"; + + echo ''."\n"; + + + //affichage du nom + $nombase=str_replace("°","'",$data->nom); + + echo ''."\n"; + + //si la ligne n'est pas a changer, on affiche les données + if (!$testligneamodifier){ + for ($k=0;$k<$nbcolonnes;$k++){ + $car=substr($ensemblereponses,$k,1); + if ($car=="1"){ + echo ''."\n"; + $somme[$k]++; + } + else { + echo ''."\n"; + } + } + } + //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs + else { + //si c'est bien la ligne a modifier on met les checkbox + if ($compteur=="$ligneamodifier"){ + for ($j=0;$j<$nbcolonnes;$j++){ + + $car=substr($ensemblereponses,$j,1); + if ($car=="1"){ + echo ''."\n"; + } + else { + echo ''."\n"; + } + } + } + //sinon on affiche les lignes normales + else { + for ($k=0;$k<$nbcolonnes;$k++){ + $car=substr($ensemblereponses,$k,1); + if ($car=="1"){ + echo ''."\n"; + $somme[$k]++; + } + else { + echo ''."\n"; + } + } + } + + } + + //a la fin de chaque ligne se trouve les boutons modifier + if (!$testligneamodifier=="true"){ + echo ''."\n"; + } + + //demande de confirmation pour modification de ligne + for ($i=0;$i<$nblignes;$i++){ + if (isset($_POST["modifierligne$i"])||isset($_POST['modifierligne'.$i.'_x'])){ + if ($compteur==$i){ + echo ''."\n"; + } + } + } + + + + $compteur++; + echo ''."\n"; + + } + + //affichage de la case vide de texte pour un nouvel utilisateur + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + //une ligne de checkbox pour le choix du nouvel utilisateur + for ($i=0;$i<$nbcolonnes;$i++){ + echo ''."\n"; + } + // Affichage du bouton de formulaire pour inscrire un nouvel utilisateur dans la base + echo ''."\n"; + + echo ''."\n"; + + //determination du meilleur choix + for ($i=0;$i<$nbcolonnes+1;$i++){ + if ($i=="0"){ + $meilleurecolonne=$somme[$i]; + } + if ($somme[$i]>$meilleurecolonne){ + $meilleurecolonne=$somme[$i]; + } + } + + //affichage de la ligne contenant les sommes de chaque colonne + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + for ($i=0;$i<$nbcolonnes;$i++){ + $affichesomme=$somme[$i]; + if ($affichesomme==""){$affichesomme="0";} + if ($somme[$i]==$meilleurecolonne){ + echo ''."\n"; + } + else { + echo ''."\n"; + } + } + + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + for ($i=0;$i<$nbcolonnes;$i++){ + if ($somme[$i]==$meilleurecolonne&&$somme[$i]){ + echo ''."\n"; + } + else { + echo ''."\n"; + } + } + echo ''."\n"; + + + // S'il a oublié de remplir un nom + if (($_POST["boutonp"]||$_POST["boutonp_x"])&&$_POST["nom"]=="") { + echo ''."\n"; + print "'."\n"; + } + if ($erreur_prenom){ + echo ''."\n"; + print "\n"; + echo ''."\n"; + } + if ($erreur_injection){ + echo ''."\n"; + print "\n"; + echo ''."\n"; + } + if ($erreur_ajout_date){ + echo ''."\n"; + print "\n"; + echo ''."\n"; + } + //fin du tableau + echo '
'.strftime("%B",$toutsujet[$i]).'
'.strftime("%a %e",$toutsujet[$i]).'
'.$heures[1].'
'.$toutsujet[$i].'
'.$nombase.'OKOK
'."\n"; + echo '
'."\n"; + echo '
'. _("Addition") .''.$affichesomme.''.$affichesomme.'
Meilleur resultat
" . _("Enter a name !") . "\n"; + echo '
" . _("The name you've chosen already exist in this poll!") . "
" . _("Characters \" ' < et > are not permitted") . "
" . _("The date is not correct !") . "
'."\n"; + echo '
'."\n"; + + //focus en javascript sur le champ texte pour le nom d'utilisateur + echo ''."\n"; + + //recuperation des valeurs des sujets et adaptation pour affichage + $toutsujet=explode(",",$dsujet->sujet); + + //recuperation des sujets des meilleures colonnes + $compteursujet=0; + for ($i=0;$i<$nbcolonnes;$i++){ + if ($somme[$i]==$meilleurecolonne){ + $meilleursujet.=", "; + if ($dsondage->format=="D"||$dsondage->format=="D+"){ + $meilleursujetexport=$toutsujet[$i]; + if (strpos($toutsujet[$i],'@') !== false){ + $toutsujetdate=explode("@",$toutsujet[$i]); + if ($_SESSION["langue"]=="EN") + $meilleursujet.=date("l, F jS Y",$toutsujetdate[0])." " . _("for") ." ".$toutsujetdate[1]; + else + $meilleursujet.=strftime(_("%A, den %e. %B %Y"),$toutsujetdate[0]). ' ' . _("for") . ' ' . $toutsujetdate[1]; + } + else{ + if ($_SESSION["langue"]=="EN") + $meilleursujet.=date("l, F jS Y",$toutsujet[$i]); + else + $meilleursujet.=strftime(_("%A, den %e. %B %Y"),$toutsujet[$i]); + } + } + else{ + $meilleursujet.=$toutsujet[$i]; + } + $compteursujet++; + } + } + + //adaptation pour affichage des valeurs + $meilleursujet=substr("$meilleursujet",1); + $meilleursujet=str_replace("°","'",$meilleursujet); + + //ajout du S si plusieurs votes + $vote_str = _('vote'); + if ($meilleurecolonne!="1") + $vote_str = _('votes'); + echo '

'."\n"; + //affichage de la phrase annoncant le meilleur sujet + if ($compteursujet=="1"&&$meilleurecolonne){ + print "\"Meilleur" . _("The best choice at this time is") . " : $meilleursujet " . _("with") . " $meilleurecolonne " . $vote_str . ".
\n"; + } + elseif ($meilleurecolonne){ + print "\"Meilleur " . _("The bests choices at this time are") . " : $meilleursujet " . _("with") . " $meilleurecolonne " . $vote_str . ".
\n"; + } + + echo '

'."\n"; + echo '

'."\n"; + echo '
'."\n"; + echo '
'."\n"; + //Gestion du sondage + echo '
'. _("Poll's management") .' :
'."\n"; + echo '

'."\n"; + echo '
'."\n"; + //Changer le titre du sondage + $adresseadmin=$dsondage->mail_admin; + echo _("Change the title") .' :
' . + ''. + '

'."\n"; + echo '

'."\n"; + + if ($dsondage->format=="D"||$dsondage->format=="D+"){ + echo '
'."\n"; + echo _("Generate the convocation letter (.PDF), choose the place to meet and validate") .'
'; + echo ''; + echo ''; + echo ''; + echo '

'; + echo '
'."\n"; + // ''. _("Enter a meeting place!") .'

'."\n"; + } + + // TODO + if ($_POST["exportpdf_x"]&&!$_POST["lieureunion"]){ + echo ''. _("Enter a meeting place!") .'

'."\n"; + } + + //si la valeur du nouveau titre est invalide : message d'erreur + if (($_POST["boutonnouveautitre"]||$_POST["boutonnouveautitre_x"]) && $_POST["nouveautitre"]==""){ + echo ''. _("Enter a new title!") .'

'."\n"; + } + + //Changer les commentaires du sondage + echo _("Change the comments") .' :



'."\n"; + + + //Changer l'adresse de l'administrateur + echo _("Change your email address") .' :

'."\n"; + + //si l'adresse est invalide ou le champ vide : message d'erreur + if (($_POST["boutonnouvelleadresse"]||$_POST["boutonnouvelleadresse_x"]) && $_POST["nouvelleadresse"]==""){ + echo ''. _("Enter a new email address!") .'

'."\n"; + + } + + //affichage des commentaires des utilisateurs existants + $comment_user=$connect->Execute("select * from comments where id_sondage='$numsondage' order by id_comment"); + if ($comment_user->RecordCount() != 0){ + + print "
" . _("Comments") . " :
\n"; + $i = 0; + while ( $dcomment=$comment_user->FetchNextObject(false)) { + print " $dcomment->usercomment : $dcomment->comment
"; + $i++; + } + echo '
'; + } + + if ($erreur_commentaire_vide=="yes"){ + print "" . _("Enter a name and a comment!") . ""; + } + + //affichage de la case permettant de rajouter un commentaire par les utilisateurs + print "
" . _("Add a comment in the poll") . " :
\n"; + echo _("Name") .' :
'."\n"; + echo ''."\n"; + echo '
'."\n"; + + //suppression du sondage + echo '
'."\n"; + echo _("Remove your poll") .' :

'."\n"; + if ($_POST["suppressionsondage"]){ + + echo _("Confirm removal of your poll") .' : '."\n"; + echo '

'."\n"; + } + echo ''."\n"; + echo '

'."\n"; + //fin de la partie GESTION et beandeau de pied + echo '

'."\n"; + bandeau_pied_mobile(); + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + + +?> + diff --git a/apropos.php b/apropos.php new file mode 100644 index 0000000..425abc7 --- /dev/null +++ b/apropos.php @@ -0,0 +1,120 @@ +'."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''.NOMAPPLICATION.''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + //debut du formulaire + echo '
'."\n"; + + //bandeaux de tete + logo(); + bandeau_tete(); +bandeau_titre(_("About")); + sous_bandeau(); + + //blablabla + echo '
'."\n"; + + if (NOMAPPLICATION!="STUdS !"){ + echo 'Application d\'origine

'."\n"; + echo 'L\'application '.NOMAPPLICATION.' est une instance du logiciel STUdS ! développé à l\'Université de Strasbourg depuis 2008.

'."\n"; + } + + echo 'Licence Logicielle de '.NOMAPPLICATION.'

'."\n"; + echo NOMAPPLICATION.' est placé sous la licence logicielle libre CeCILL-B.

'."\n"; + + echo 'Technologies utilisées

'."\n"; + echo '- PHP
'."\n"; + echo '- PostgreSQL
'."\n"; + echo '- Apache
'."\n"; + echo '- Subversion
'."\n"; + echo '- iCalcreator
'."\n"; + echo '- FPDF
'."\n"; + echo '- Icônes : Deleket, PixelMixer et DryIcons

'."\n"; + + echo 'Compatibilités des navigateurs

'."\n"; + echo '- Firefox
'."\n"; + echo '- Opéra
'."\n"; + echo '- Konqueror
'."\n"; + echo '- Links
'."\n"; + echo '- Safari
'."\n"; + echo '- IE

'."\n"; + + echo 'Validations des pages

'."\n"; + echo '- Toutes les pages disposent de la validation HTML 4.01 Strict du W3C.
- La CSS dispose de la validation CSS 2.1 du W3C.'."\n"; + echo '

'."\n"; + echo 'Valid HTML 4.01 StrictCSS Valide !'."\n"; + echo'

'."\n"; + + echo 'Propositions améliorations de '.NOMAPPLICATION.'

'."\n"; + + echo 'Si quelquechose venait à vous manquer, vous pouvez nous en faire part via le formulaire en ligne.
'."\n"; + + echo 'Les dernières améliorations de '.NOMAPPLICATION.' sont visibles dans le fichier CHANGELOG.

'."\n"; + + echo 'Remerciements

'."\n"; + echo 'Pour leurs contributions techniques ou ergonomiques : Guy, Christophe, Julien, Pierre, Romaric, Matthieu, Catherine, Christine, Olivier, Emmanuel et Florence

'."\n"; + + + + echo '
'."\n"; + + bandeau_pied_mobile(); + echo '
'."\n"; + echo ''."\n"; + echo ''."\n"; + +?> diff --git a/bandeaux.php b/bandeaux.php new file mode 100644 index 0000000..2824125 --- /dev/null +++ b/bandeaux.php @@ -0,0 +1,115 @@ +logo'."\n"; +} + +#le bandeau principal +function bandeau_tete(){ + echo '
'.NOMAPPLICATION.'
'."\n"; +} + +// bandeaux de titre +function bandeau_titre($titre){ + echo '
'. $titre .'
'."\n"; +} + +function liste_lang() { + global $ALLOWED_LANGUAGES; + $str = ''; + foreach ($ALLOWED_LANGUAGES as $k => $v ) + $str .= '' . $v . '' . "\n" ; + return $str; +} + +#Les sous-bandeaux contenant les boutons de navigation +function sous_bandeau(){ + echo '
' . + ''. _("Home") .'' . + ''. _("Example") .'' . + ''. _("Contact") .'' . + //''. _("Sources") .'' . //not implemented + ''. _("About") .'' . + ''. _("Admin") .'' . + + '' . + liste_lang() . ''. + + '
' . "\n"; +} +function sous_bandeau_admin(){ + echo '
' . + ''. _("Home") .''; + if(is_readable('logs_studs.txt')) + echo ''. _("Logs") .''; + echo ''. _("Cleaning") .'' . + + '' . + liste_lang() . ''. + + '
'."\n"; +} +function sous_bandeau_choix(){ + echo '
' . + ''. _("Home") .'' . + '
'."\n"; +} + + +#les bandeaux de pied +function sur_bandeau_pied(){ + echo '
'."\n"; +} +function bandeau_pied(){ + echo '
'. _("Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009") .'
'."\n"; +} +function bandeau_pied_mobile(){ + echo '
'."\n" . + '
'. _("Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009") .'
'."\n"; +} + + + +?> diff --git a/block_enter.js b/block_enter.js new file mode 100644 index 0000000..9e25913 --- /dev/null +++ b/block_enter.js @@ -0,0 +1,14 @@ +if (document.layers) + document.captureEvents(Event.KEYPRESS); + +function process_keypress(e) { + if(window.event){ + if (window.event.type == "keypress" & window.event.keyCode == 13) + return !(window.event.type == "keypress" & window.event.keyCode == 13); + } + if(e){ + if (e.type == "keypress" & e.keyCode == 13) + return !e; + } +} +document.onkeypress = process_keypress; diff --git a/choix_autre.php b/choix_autre.php new file mode 100644 index 0000000..37f304d --- /dev/null +++ b/choix_autre.php @@ -0,0 +1,219 @@ +'."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''.NOMAPPLICATION.''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + logo(); + bandeau_tete(); + bandeau_titre(_("Error!")); + echo '
'."\n"; + print "

" . _("You haven't filled the first section of the poll creation.") . " !

"."\n"; + print "" . _("Back to the homepage of ") . " ".NOMAPPLICATION."."."\n"; + echo '


'."\n"; + echo '
'."\n"; + //bandeau de pied + bandeau_pied(); + echo ''."\n"; + echo ''."\n"; + +} +else { + + //partie creation du sondage dans la base SQL + //On prépare les données pour les inserer dans la base + if ($_POST["confirmecreation_x"]){ + + //recuperation des données de champs textes + for ($i=0;$i<$_SESSION["nbrecases"]+1;$i++){ + if ($_POST["choix"][$i]){ + $toutchoix.=','; + $toutchoix.=str_replace(","," ",$_POST["choix"][$i]); + } + } + + $toutchoix=str_replace("'","°",$toutchoix); + $toutchoix=substr("$toutchoix",1); + + $_SESSION["toutchoix"]=$toutchoix; + + if ($_POST["champdatefin"]){ + $registredate=explode("/",$_POST["champdatefin"]); + if (mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2])>time()+250000){ + $_SESSION["champdatefin"]=mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); + } + } + else{ + $_SESSION["champdatefin"]=time()+15552000; + } + + //format du sondage AUTRE + $_SESSION["formatsondage"]="A".$_SESSION["studsplus"]; + + ajouter_sondage(); + + } + + + // recuperation des sujets pour sondage AUTRE + for ($i=0;$i<$_SESSION["nbrecases"];$i++){ + if (!preg_match(';<|>|";',$_POST["choix"][$i])){ + $_SESSION["choix$i"]=$_POST["choix"][$i]; + } + else {$erreur_injection="yes";} + } + + //nombre de cases par défaut + if(!$_SESSION["nbrecases"]){ + $_SESSION["nbrecases"]=10; + } + if ($_POST["ajoutcases"]||$_POST["ajoutcases_x"]){ + $_SESSION["nbrecases"]=$_SESSION["nbrecases"]+5; + } + + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''.NOMAPPLICATION.''."\n"; + echo ''."\n"; + echo ''; + + echo ''."\n"; + echo ''."\n"; + + + echo '
'."\n"; + logo(); + bandeau_tete(); + bandeau_titre(_("Poll subjects (2 on 2)")); + sous_bandeau_choix(); + + echo '
'."\n"; + echo '
'. _("Your poll aim is to make a choice between different subjects.
Enter the subjects to vote for:") .'

'."\n"; + echo ''."\n"; + + //affichage des cases texte de formulaire + for ($i=0;$i<$_SESSION["nbrecases"];$i++){ + $j=$i+1; + echo ''."\n"; + } + + echo '
'. _("Choice") .' '.$j.' :
'."\n"; + + //focus javascript sur premiere case + echo ''."\n"; + + //ajout de cases supplementaires + echo ''."\n"; + echo ''."\n"; + echo '
'. _("5 choices more") .'
'."\n"; + echo'
'."\n"; + + echo ''."\n"; + echo ''."\n"; + echo '
'. _("Next") .'
'."\n"; + + //test de remplissage des cases + for ($i=0;$i<$_SESSION["nbrecases"];$i++){ + if ($_POST["choix"][$i]!=""){$testremplissage="ok";} + } + + //message d'erreur si aucun champ renseigné + if ($testremplissage!="ok"&&($_POST["fin_sondage_autre"]||$_POST["fin_sondage_autre_x"])){ + print "
" . _("Enter at least one choice") . "

"."\n"; + $erreur="yes"; + } + + if ($erreur_injection){ + print "" . _("Characters \" < and > are not permitted") . "

\n"; + } + + if (($_POST["fin_sondage_autre"]||$_POST["fin_sondage_autre_x"])&&!$erreur&&!$erreur_injection){ + + //demande de la date de fin du sondage + + echo '
'."\n"; + echo '
'."\n"; + echo '
'. _("Your poll will be automatically removed after 6 months.
You can fix another removal date for it.") .'

'."\n"; + + echo _("Removal date (optional)") .' : '. _("(DD/MM/YYYY)") ."\n"; + echo '
'."\n"; + echo '
'."\n"; + echo ''. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters.") .'
'."\n"; + echo '
'."\n"; + echo '
'."\n"; + + echo ''."\n"; + echo ''."\n"; + echo '
'. _("Create the poll") .'
'."\n"; + } + + + //fin du formulaire et bandeau de pied + echo ''."\n"; + echo ''."\n"; + echo '


'."\n"; + echo '
'."\n"; + //bandeau de pied + bandeau_pied_mobile(); + + echo ''."\n"; + echo ''."\n"; + +} + +?> diff --git a/choix_date.php b/choix_date.php new file mode 100644 index 0000000..2bd4891 --- /dev/null +++ b/choix_date.php @@ -0,0 +1,594 @@ +'."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''.NOMAPPLICATION.''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + logo(); + bandeau_tete(); + bandeau_titre(_("Error!")); + echo '
'."\n"; + print "

" . _("You haven't filled the first section of the poll creation.") . " !

"."\n"; + print _("Back to the homepage of ") . ' ' . '' . NOMAPPLICATION . '.' . "\n"; + echo '


'."\n"; + echo '
'."\n"; + //bandeau de pied + //sur_bandeau_pied(); + bandeau_pied(); + + echo ''."\n"; + echo ''."\n"; + +} + +//sinon on peut afficher le calendrier normalement +else { + +//partie creation du sondage dans la base SQL +//On prépare les données pour les inserer dans la base +if ($_POST["confirmation"]||$_POST["confirmation_x"]){ + for ($i=0;$i 0 && $_SESSION["mois"] < 13) + $motmois=strftime('%B', mktime(0, 0, 0, $_SESSION["mois"], 10)); +else + $motmois=strftime('%B'); + +//debut de la page web +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''.NOMAPPLICATION.''."\n"; +echo ''."\n"; +echo ''; + +echo ''."\n"; +echo ''."\n"; + +//Debut du formulaire et bandeaux de tete +echo '
'."\n"; +logo(); +bandeau_tete(); +bandeau_titre(_("Poll dates (2 on 2)")); +sous_bandeau_choix(); + +//affichage de l'aide pour les jours +echo '
'."\n"; +echo _("Select your dates amoung the free days (green). The selected days are in blue.
You can unselect a day previously selected by clicking again on it.") ."\n"; +echo '
'."\n"; + +//debut du tableau qui affiche le calendrier +echo '
'."\n"; +echo ''."\n"; +echo ''."\n"; +echo '
'.$motmois.' '.$_SESSION["annee"].'
'."\n"; +echo ''."\n"; + +echo ''."\n"; +//affichage des jours de la semaine en haut du tableau +for($i = 0; $i < 7; $i++) + echo ''; +echo ''."\n"; + + +//ajout d'une entrée dans la variable de session qui contient toutes les dates +if ($_POST["choixjourajout"]){ + if (!isset($_SESSION["totalchoixjour"])){ + $_SESSION["totalchoixjour"]=array(); + } + +// Test pour éviter les doublons dans la variable qui contient toutes les dates + $journeuf=true; + for ($i=0;$i'."\n"; + +for ($i=0;$i<$nbrejourmois+$premierjourmois;$i++){ + + $numerojour=$i-$premierjourmois+1; + +// On saute a la ligne tous les 7 jours + if (($i%7)==0&&$i!=0){ + echo ''."\n"; + } + +// On affiche les jours precedants en gris et incliquables + if ($i<$premierjourmois){ + echo ''."\n"; + } + else{ + + for ($j=0;$j'."\n"; + $dejafait=$numerojour; + } + } + //Si pas de bouton ROUGE alors on affiche un bouton VERT ou GRIS avec le numéro du jour dessus + if ($dejafait!=$numerojour){ + + //bouton vert + if (($numerojour>=$jourAJ&&$_SESSION["mois"]==$moisAJ&&$_SESSION["annee"]==$anneeAJ)||($_SESSION["mois"]>$moisAJ&&$_SESSION["annee"]==$anneeAJ)||$_SESSION["annee"]>$anneeAJ){ + echo ''."\n"; + } + //bouton gris + else{ + echo ''."\n"; + } + } + } +} + +//fin du tableau +echo ''."\n"; +echo '
'. strftime('%A',mktime(0,0,0,0,$i,10)) .'
'.$numerojour.'
'."\n"; +echo '
'."\n"; + +//traitement de l'entrée des heures dans les cases texte +$errheure = $erreur = false; +if ($_POST["choixheures"]||$_POST["choixheures_x"]){ + //On sauvegarde les heures deja entrées + for ($i=0;$i'."\n"; + +//affichage de tous les jours choisis +if ($_SESSION["totalchoixjour"]&&(!$_POST["choixheures_x"]||$erreur)){ + + //affichage des jours + echo '
'."\n"; + echo '

'. _("Selected days") .' :

'."\n"; + //affichage de l'aide pour les jours + echo _("For each selected day, you can choose, or not, meeting hours in the following format :
- empty,
- \"8h\", \"8H\" or \"8:00\" to give a meeting's start hour,
- \"8-11\", \"8h-11h\", \"8H-11H\" ou \"8:00-11:00\" to give a meeting's start and end hour,
- \"8h15-11h15\", \"8H15-11H15\" ou \"8:15-11:15\" for the same thing but with minutes.") .'

'."\n"; + echo ''."\n"; + + echo ''."\n"; + echo ''."\n"; + for ($i=0;$i<$_SESSION["nbrecaseshoraires"];$i++){ + $j=$i+1; + echo ''."\n"; + } + if ($_SESSION["nbrecaseshoraires"]<10){ + echo ''."\n"; + } + echo ''."\n"; + + //affichage de la liste des jours choisis + for ($i=0;$i'."\n"; + if ($_SESSION["langue"]=="EN") + echo ''."\n"; + else + echo ''."\n"; + $affichageerreurfindeligne=false; + //affichage des cases d'horaires + for ($j=0;$j<$_SESSION["nbrecaseshoraires"];$j++){ + //si on voit une erreur, le fond de la case est rouge + if ($errheure[$i][$j]){ + echo ''."\n"; + $affichageerreurfindeligne=true; + } + //sinon la case est vide normalement + else { + echo ''."\n"; + } + } + if ($affichageerreurfindeligne){ + echo ''."\n"; + } + echo ''."\n"; + } + echo '
'. _("Time") .' '.$j.'
'.date("l, F jS Y",$_SESSION["totalchoixjour"][$i]).' : '.strftime(_("%A, den %e. %B %Y"),$_SESSION["totalchoixjour"][$i]).' : '. _("Bad format!") .'
'."\n"; + + //affichage des boutons de formulaire pour annuler, effacer les jours ou créer le sondage + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo''."\n"; + echo ''."\n"; + echo '

'. _("Next") .'
'."\n"; + //si un seul jour et aucunes horaires choisies, : message d'erreur + if (($_POST["choixheures"]||$_POST["choixheures_x"])&&(count($_SESSION["totalchoixjour"])=="1"&&$_POST["horaires0"][0]==""&&$_POST["horaires0"][1]==""&&$_POST["horaires0"][2]==""&&$_POST["horaires0"][3]==""&&$_POST["horaires0"][4]=="")){ + echo '
'. _("Enter more choices for the voters") .'
'."\n"; + $erreur=true; + } +} + //s'il n'y a pas d'erreur et que le bouton de creation est activé, on demande confirmation + if ( ! $erreur &&($_POST["choixheures"]||$_POST["choixheures_x"])){ + $taille_tableau=sizeof($_SESSION["totalchoixjour"])-1; + $jour_arret=$_SESSION["totalchoixjour"][$taille_tableau]+200000; + if ($_SESSION["langue"]=="EN") + $date_fin=date("l, F jS Y",$jour_arret); + else + $date_fin=strftime(_("%A, den %e. %B %Y"),$jour_arret); + echo '
'. _("Your poll will expire automatically 2 days after the last date of your poll.") .'

'. _("Removal date") .' : '.$date_fin.'

'."\n"; + echo '
'."\n"; + echo '
'."\n"; + echo ''. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters.") .'
'."\n"; + echo'
'."\n"; + // echo'

'."\n"; + // echo 'Pour finir la création du sondage, cliquez sur le bouton ajout ci-dessous'."\n"; + // echo '

'."\n"; + echo ''."\n"; + echo ''."\n"; + echo''."\n"; + echo '
'. _("Back to hours") .'
'. _("Create the poll") .'
'."\n"; + } + echo ''."\n"; + echo ''."\n"; + +echo ''."\n"; +//fin du formulaire et bandeau de pied +echo ''."\n"; +//bandeau de pied +echo '



'."\n"; + +echo ''."\n"; +bandeau_pied_mobile(); +echo ''."\n"; +echo ''."\n"; + +//bouton de nettoyage de tous les jours choisis +if ($_POST["reset"]){ + + for ($i=0;$i'; +} + +} + +?> diff --git a/contacts.php b/contacts.php new file mode 100644 index 0000000..229e040 --- /dev/null +++ b/contacts.php @@ -0,0 +1,152 @@ +\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; + mail (ADRESSEMAILADMIN, "" . _("[CONTACT] You have sent a question ") . "".NOMAPPLICATION, "" . _("You have a question from a user ") . " ".NOMAPPLICATION."\n\n" . _("User") . " : ".$_POST["nom"]."\n\n" . _("User's email address") . " : $_POST[adresse_mail]\n\n" . _("Message") . " :".$message,$headers); + if ($_POST["adresse_mail"]!=""){ + $headers="From: ".NOMAPPLICATION." <".ADRESSEMAILADMIN.">\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; + mail ("$_POST[adresse_mail]", "" . _("[COPY] Someone has sent a question ") . "".NOMAPPLICATION, "" . _("Here is a copy of your question") . " :\n\n".$message." \n\n" . _("We're going to answer your question shortly.") . "\n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION,$headers); + } + + //affichage de la page de confirmation d'envoi + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''.NOMAPPLICATION.''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + logo(); + bandeau_tete(); + bandeau_titre(_("Make your polls")); + + echo '
'."\n"; + print "

" . _("Your message has been sent!") . "



"."\n"; + print "" . _("Back to the homepage of ") . " ".NOMAPPLICATION."."."\n"; + echo '


'."\n"; + echo '
'."\n"; + + bandeau_pied(); + + session_unset(); + +} + +else { + $_SESSION["question"]=$_POST["question"]; + $_SESSION["nom"]=$_POST["nom"]; + $_SESSION["adresse_mail"]=$_POST["adresse_mail"]; + + //affichage de la page + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''.NOMAPPLICATION.''."\n"; + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + + //debut du formulaire + echo '
'."\n"; + + //bandeaux de tete + logo(); + bandeau_tete(); + bandeau_titre(_("Contact us")); + sous_bandeau(); + + //blablabla + echo '
'."\n"; + echo _("If you have questions, you can send a message here.") .'

'."\n"; + + echo _("Your name") .' :
'."\n"; + echo ''; + + if ($_POST["envoiquestion"]&&$_SESSION["nom"]==""){ + echo ' '. _("Enter a name") .''; + } + + echo '

'."\n"; + echo _("Your email address ") .' :
'."\n"; + echo ''."\n"; + + + echo '

'; + + echo _("Question") .' :
'."\n"; + echo ''; + + if ($_POST["envoiquestion"]&&$_SESSION["question"]==""){ + echo '  Il faut poser une question !'; + } + + echo '


'."\n"; + echo ''."\n"; + echo ''."\n"; + echo '
'. _("Send your question") .'
'."\n"; + echo '


'."\n"; + echo '
'."\n"; + echo '
'."\n"; + + //bandeau de pied + bandeau_pied(); + + echo ''."\n"; + echo ''."\n"; + +} + +?> diff --git a/creation_sondage.php b/creation_sondage.php new file mode 100644 index 0000000..c0ce1f9 --- /dev/null +++ b/creation_sondage.php @@ -0,0 +1,101 @@ +time()+250000){ + $date_fin=$_SESSION["champdatefin"]; + } + } + else{$date_fin=time()+15552000;} +} + +if ($_SESSION["formatsondage"]=="D"||$_SESSION["formatsondage"]=="D+"){ + + //Calcul de la date de fin du sondage + $taille_tableau=sizeof($_SESSION["totalchoixjour"])-1; + $date_fin=$_SESSION["totalchoixjour"][$taille_tableau]+200000; +} + + $headers="From: ".NOMAPPLICATION." <".ADRESSEMAILADMIN.">\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; + + global $connect; + $connect->Execute('insert into sondage ' . + '(id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde) ' . + 'VALUES '. + "('$sondage','$_SESSION[commentaires]', '$_SESSION[adresse]', '$_SESSION[nom]', '$_SESSION[titre]','$sondage_admin', FROM_UNIXTIME('$date_fin'), '$_SESSION[formatsondage]','$_SESSION[mailsonde]' )"); + $connect->Execute("insert into sujet_studs values ('$sondage', '$_SESSION[toutchoix]' )"); + + + mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), "" . _("This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll.") . "\n\n".stripslashes($_SESSION["nom"])." " . _("hast just created a poll called") . " : \"".stripslashes($_SESSION["titre"])."\".\n" . _("Thanks for filling the poll at the link above") . " :\n\n".get_server_name()."studs.php?sondage=$sondage \n\n" . _("Thanks for your confidence") . ",\n".NOMAPPLICATION,$headers); + mail ("$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes($_SESSION["titre"]), + _("This message should NOT be sended to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above") . + " :\n\n".get_server_name()."adminstuds.php?sondage=$sondage_admin \n\n" . _("Thanks for your confidence") . ",\n".NOMAPPLICATION,$headers); + + $date=date('H:i:s d/m/Y:'); + error_log($date . " CREATION: $sondage\t$_SESSION[formatsondage]\t$_SESSION[nom]\t$_SESSION[adresse]\t \t$_SESSION[toutchoix]\n", 3, 'admin/logs_studs.txt'); + + header("Location:studs.php?sondage=$sondage"); + + exit(); + session_unset(); +} +?> diff --git a/errors/error-forbidden.php b/errors/error-forbidden.php new file mode 100644 index 0000000..edc9f15 --- /dev/null +++ b/errors/error-forbidden.php @@ -0,0 +1,67 @@ +'."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +echo 'Erreur !'."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +logo(); +bandeau_tete(); +bandeau_titre(_("Make your polls")); +echo '
'."\n"; +print "

Vous n'avez pas l'autorisation de voir ce répertoire.

Vous devez, pour cela, initier votre connexion depuis une machine de l'Université.
Si vous avez un compte à l'Université, vous pouvez également utiliser le VPN sécurisé.

"."\n"; +print "Vous pouvez retourner à la page d'accueil de ".NOMAPPLICATION."."."\n"; +echo '


'."\n"; +echo '
'."\n"; + + +// Affichage du bandeau de pied +sur_bandeau_pied(); +bandeau_pied(); +echo ''."\n"; +echo ''."\n"; + +?> diff --git a/exportcsv.php b/exportcsv.php new file mode 100644 index 0000000..750c707 --- /dev/null +++ b/exportcsv.php @@ -0,0 +1,103 @@ +Execute("SELECT * FROM user_studs WHERE id_sondage=" . $_GET['numsondage'] . " ORDER BY id_users"); + +$dsondage = get_sondage_from_id($_GET['numsondage']); +$nbcolonnes=substr_count($dsondage->sujet,',')+1; + +$toutsujet=explode(",",$dsondage->sujet); +#$toutsujet=str_replace("°","'",$toutsujet); + +//affichage des sujets du sondage + +$input.=";"; +for ($i=0;$toutsujet[$i];$i++){ + if ($dsondage->format=="D"||$dsondage->format=="D+"){ + $input.=''.date("j/n/Y",$toutsujet[$i]).';'; + } + else{ + $input.=''.$toutsujet[$i].';'; + } +} +$input.="\r\n"; + +if (strpos($dsondage->sujet,'@') !== false){ + $input.=";"; + for ($i=0;$toutsujet[$i];$i++){ + $heures=explode("@",$toutsujet[$i]); + $input.=''.$heures[1].';'; + } + $input.="\r\n"; +} + +while ( $data=$user_studs->FetchNextObject(false)) { +// Le nom de l'utilisateur + $nombase=str_replace("°","'",$data->nom); + $input.=$nombase.';'; +//affichage des resultats + $ensemblereponses=$data->reponses; + for ($k=0;$k<$nbcolonnes;$k++){ + $car=substr($ensemblereponses,$k,1); + if ($car=="1"){ + $input.='OK;'; + $somme[$k]++; + } + else { + $input.=';'; + } + } + $input.="\r\n"; +} + +$filesize = strlen( $input ); +$filename=$_GET["numsondage"].".csv"; + + header( 'Content-Type: text/csv; charset=utf-8' ); + header( 'Content-Length: '.$filesize ); + header( 'Content-Disposition: attachment; filename="'.$filename.'"' ); + header( 'Cache-Control: max-age=10' ); +echo $input; + die(); +?> diff --git a/exportics.php b/exportics.php new file mode 100644 index 0000000..6df0a42 --- /dev/null +++ b/exportics.php @@ -0,0 +1,105 @@ +setConfig( 'unique_id', $_SESSION["numsondage"] ); // set Your unique id +$v->setProperty( 'method', 'PUBLISH' ); // required of some calendar software + + +$vevent = new vevent(); // create an event calendar component + +/* + tested with : + $test = array( '1275818164@12h-15h', '1275818164@12h15-15h57', '1275818164@12:15-15:57', '1275818164@8:30', '1275818164@8h30'); + foreach($test as $meilleursujet) { +*/ +$adate = strtok($meilleursujet, "@"); +$dtstart = $dtend = array( + 'year'=>intval(date("Y",$adate)), + 'month'=>intval(date("n",$adate)), + 'day'=>intval(date("j",$adate)), + 'hour'=>0, + 'min'=>0, + 'sec'=>0 + ); +$double_time = false; +if(strpos($meilleursujet, '-') !== false) + $double_time = true; + +$dtstart['hour'] = intval(strtok(":Hh")); +$a = intval(strtok(":Hh-")); +$b = intval(strtok(":Hh-")); +if($b === false) { + if($double_time) + $dtend['hour'] = $a; + else + $dtstart['min'] = $a; +} else { + $dtstart['min'] = $a; + $dtend['hour'] = $b; + $dtend['min'] = intval(strtok(":Hh-")); +} + +if(! $double_time ) { + $dtend['hour'] = $dtstart['hour'] + 1; + $dtend['min'] = $dtstart['min']; +} + +$vevent->setProperty( 'dtstart', $dtstart); +$vevent->setProperty( 'dtend', $dtend); +$vevent->setProperty( 'summary', $_SESSION["sondagetitre"] ); + +$v->setComponent ( $vevent ); // add event to calendar +$v->setConfig( "language", "fr" ); +$v->setConfig( "directory", "export" ); +$v->setConfig( "filename", $_SESSION["numsondage"].".ics" ); // set file name + +$v->returnCalendar(); + +?> diff --git a/exportpdf.php b/exportpdf.php new file mode 100644 index 0000000..342d39e --- /dev/null +++ b/exportpdf.php @@ -0,0 +1,86 @@ +AddPage(); +$PDF->SetFont('Arial','',11); + +//affichage de la date de convocation +$PDF->Text(140,30,"Le ".date("d/m/Y")); + +$PDF->Image("./".LOGOLETTRE."",20,20,65,40); + +$PDF->SetFont('Arial','U',11); +$PDF->Text(40,120,"Objet : "); +$PDF->SetFont('Arial','',11); +$PDF->Text(55,120,_(' Convocation')); + +$PDF->Text(55,140,_('Hello,')); + +$PDF->Text(40,150,_("You're invited at the meeting") . ' "'.utf8_decode($dsondage->titre).'".'); + +$PDF->SetFont('Arial','B',11); +$PDF->Text(40,170,_('Informations about the meeting')); + +$PDF->SetFont('Arial','',11); +$PDF->Text(60,180,_('Date') . ' : '.date("d/m/Y", "$datereunion[0]").' ' . _('at') . ' '.$datereunion[1]); +$PDF->Text(60,185,_('Place') . ' : ' . utf8_decode($lieureunion)); + +$PDF->Text(55,220,_('Cordially,')); + +$PDF->Text(140,240,utf8_decode($dsondage->nom_admin)); + +$PDF->SetFont('Arial','B',8); +// TODO: translate +$PDF->Text(35,275,"Cette lettre de convocation a été générée automatiquement par ".NOMAPPLICATION." sur ".get_server_name()); + +//Sortie +$PDF->Output(); + +?> diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..551344a Binary files /dev/null and b/favicon.ico differ diff --git a/fonctions.php b/fonctions.php new file mode 100644 index 0000000..2eca39f --- /dev/null +++ b/fonctions.php @@ -0,0 +1,127 @@ +Connect(SERVEURBASE, USERBASE, USERPASSWD, BASE); + //$DB->debug = true; + return $DB; +} + +function get_server_name() { + $scheme = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? 'https' : 'http'; + $url = sprintf("%s://%s%s", $scheme, + STUDS_URL, + dirname($_SERVER["SCRIPT_NAME"])); + if (!preg_match("|/$|", $url)){ + $url = $url."/"; + } + return $url; +} + +function get_sondage_from_id($id) { + global $connect; + // Ouverture de la base de données + if(preg_match(";^[\w\d]{16}$;i",$id)) { + $sondage=$connect->Execute("SELECT sondage.*,sujet_studs.sujet FROM sondage". + " LEFT OUTER JOIN sujet_studs ON sondage.id_sondage = sujet_studs.id_sondage". + " WHERE sondage.id_sondage = $id"); + $psondage = $sondage->FetchObject(false); + $psondage->date_fin = strtotime($psondage->date_fin); + return $psondage; + } + return false; +} + +$connect=connexion_base(); + +define('COMMENT_EMPTY', 0x0000000001); +define('COMMENT_USER_EMPTY', 0x0000000010); +define('COMMENT_INSERT_FAILED', 0x0000000100); +define('NAME_EMPTY', 0x0000001000); +define('NAME_TAKEN', 0x0000010000); +define('NO_POLL', 0x0000100000); +define('NO_POLL_ID', 0x0001000000); +define('INVALID_EMAIL', 0x0010000000); +define('TITLE_EMPTY', 0x0100000000); +define('INVALID_DATE', 0x1000000000); +$err = 0; + +function is_error($cerr) { + global $err; + if ( $err == 0 ) + return false; + return (($err & $cerr) != 0 ); +} + + +function is_user() { + return isset($_SERVER['REMOTE_USER']) || (isset($_SESSION['nom'])); +} + +function print_header($js = false) { + ?> + + + + + <?php echo NOMAPPLICATION; ?> + +'; +echo ''; +} + +function check_table_sondage() { + global $connect; + $tables = $connect->MetaTables('TABLES'); + if (in_array("sondage", $tables)) + return true; + return false; +} + +?> diff --git a/i18n.php b/i18n.php new file mode 100644 index 0000000..fbb2709 --- /dev/null +++ b/i18n.php @@ -0,0 +1,31 @@ + diff --git a/iCalcreator/iCalUtilityFunctions.class.php b/iCalcreator/iCalUtilityFunctions.class.php new file mode 100644 index 0000000..84ad0e6 --- /dev/null +++ b/iCalcreator/iCalUtilityFunctions.class.php @@ -0,0 +1,1340 @@ + + * @since 2.6.22 - 2010-09-25 + * + */ +class iCalUtilityFunctions { + // Store the single instance of iCalUtilityFunctions + private static $m_pInstance; + + // Private constructor to limit object instantiation to within the class + private function __construct() { + $m_pInstance = FALSE; + } + + // Getter method for creating/returning the single instance of this class + public static function getInstance() { + if (!self::$m_pInstance) + self::$m_pInstance = new iCalUtilityFunctions(); + + return self::$m_pInstance; + } +/** + * check a date(-time) for an opt. timezone and if it is a DATE-TIME or DATE + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-25 + * @param array $date, date to check + * @param int $parno, no of date parts (i.e. year, month.. .) + * @return array $params, property parameters + */ + public static function _chkdatecfg( $theDate, & $parno, & $params ) { + if( isset( $params['TZID'] )) + $parno = 6; + elseif( isset( $params['VALUE'] ) && ( 'DATE' == $params['VALUE'] )) + $parno = 3; + else { + if( isset( $params['VALUE'] ) && ( 'PERIOD' == $params['VALUE'] )) + $parno = 7; + if( is_array( $theDate )) { + if( isset( $theDate['timestamp'] )) + $tzid = ( isset( $theDate['tz'] )) ? $theDate['tz'] : null; + else + $tzid = ( isset( $theDate['tz'] )) ? $theDate['tz'] : ( 7 == count( $theDate )) ? end( $theDate ) : null; + if( !empty( $tzid )) { + $parno = 7; + if( !iCalUtilityFunctions::_isOffset( $tzid )) + $params['TZID'] = $tzid; // save only timezone + } + elseif( !$parno && ( 3 == count( $theDate )) && + ( isset( $params['VALUE'] ) && ( 'DATE' == $params['VALUE'] ))) + $parno = 3; + else + $parno = 6; + } + else { // string + $date = trim( $theDate ); + if( 'Z' == substr( $date, -1 )) + $parno = 7; // UTC DATE-TIME + elseif((( 8 == strlen( $date ) && ctype_digit( $date )) || ( 11 >= strlen( $date ))) && + ( !isset( $params['VALUE'] ) || !in_array( $params['VALUE'], array( 'DATE-TIME', 'PERIOD' )))) + $parno = 3; // DATE + $date = iCalUtilityFunctions::_date_time_string( $date, $parno ); + if( !empty( $date['tz'] )) { + $parno = 7; + if( !iCalUtilityFunctions::_isOffset( $date['tz'] )) + $params['TZID'] = $date['tz']; // save only timezone + } + elseif( empty( $parno )) + $parno = 6; + } + if( isset( $params['TZID'] )) + $parno = 6; + } + } +/** + * convert date/datetime to timestamp + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-30 + * @param array $datetime datetime/(date) + * @param string $tz timezone + * @return timestamp + */ + public static function _date2timestamp( $datetime, $tz=null ) { + $output = null; + if( !isset( $datetime['hour'] )) $datetime['hour'] = '0'; + if( !isset( $datetime['min'] )) $datetime['min'] = '0'; + if( !isset( $datetime['sec'] )) $datetime['sec'] = '0'; + foreach( $datetime as $dkey => $dvalue ) { + if( 'tz' != $dkey ) + $datetime[$dkey] = (integer) $dvalue; + } + if( $tz ) + $datetime['tz'] = $tz; + $offset = ( isset( $datetime['tz'] ) && ( '' < trim ( $datetime['tz'] ))) ? iCalUtilityFunctions::_tz2offset( $datetime['tz'] ) : 0; + $output = mktime( $datetime['hour'], $datetime['min'], ($datetime['sec'] + $offset), $datetime['month'], $datetime['day'], $datetime['year'] ); + return $output; + } +/** + * ensures internal date-time/date format for input date-time/date in array format + * + * @author Kjell-Inge Gustafsson + * @since 0.3.0 - 2006-08-15 + * @param array $datetime + * @param int $parno optional, default FALSE + * @return array + */ + public static function _date_time_array( $datetime, $parno=FALSE ) { + $output = array(); + foreach( $datetime as $dateKey => $datePart ) { + switch ( $dateKey ) { + case '0': case 'year': $output['year'] = $datePart; break; + case '1': case 'month': $output['month'] = $datePart; break; + case '2': case 'day': $output['day'] = $datePart; break; + } + if( 3 != $parno ) { + switch ( $dateKey ) { + case '0': + case '1': + case '2': break; + case '3': case 'hour': $output['hour'] = $datePart; break; + case '4': case 'min' : $output['min'] = $datePart; break; + case '5': case 'sec' : $output['sec'] = $datePart; break; + case '6': case 'tz' : $output['tz'] = $datePart; break; + } + } + } + if( 3 != $parno ) { + if( !isset( $output['hour'] )) + $output['hour'] = 0; + if( !isset( $output['min'] )) + $output['min'] = 0; + if( !isset( $output['sec'] )) + $output['sec'] = 0; + } + return $output; + } +/** + * ensures internal date-time/date format for input date-time/date in string fromat + * + * @author Kjell-Inge Gustafsson + * @since 2.6.35 - 2010-12-03 + * @param array $datetime + * @param int $parno optional, default FALSE + * @return array + */ + public static function _date_time_string( $datetime, $parno=FALSE ) { + $datetime = (string) trim( $datetime ); + $tz = null; + $len = strlen( $datetime ) - 1; + if( 'Z' == substr( $datetime, -1 )) { + $tz = 'Z'; + $datetime = trim( substr( $datetime, 0, $len )); + } + elseif( ( ctype_digit( substr( $datetime, -2, 2 ))) && // time or date + ( '-' == substr( $datetime, -3, 1 )) || + ( ':' == substr( $datetime, -3, 1 )) || + ( '.' == substr( $datetime, -3, 1 ))) { + $continue = TRUE; + } + elseif( ( ctype_digit( substr( $datetime, -4, 4 ))) && // 4 pos offset + ( ' +' == substr( $datetime, -6, 2 )) || + ( ' -' == substr( $datetime, -6, 2 ))) { + $tz = substr( $datetime, -5, 5 ); + $datetime = substr( $datetime, 0, ($len - 5)); + } + elseif( ( ctype_digit( substr( $datetime, -6, 6 ))) && // 6 pos offset + ( ' +' == substr( $datetime, -8, 2 )) || + ( ' -' == substr( $datetime, -8, 2 ))) { + $tz = substr( $datetime, -7, 7 ); + $datetime = substr( $datetime, 0, ($len - 7)); + } + elseif( ( 6 < $len ) && ( ctype_digit( substr( $datetime, -6, 6 )))) { + $continue = TRUE; + } + elseif( 'T' == substr( $datetime, -7, 1 )) { + $continue = TRUE; + } + else { + $cx = $tx = 0; // 19970415T133000 US-Eastern + for( $cx = -1; $cx > ( 9 - $len ); $cx-- ) { + $char = substr( $datetime, $cx, 1 ); + if(( ' ' == $char) || ctype_digit( $char)) + break; // if exists, tz ends here.. . ? + else + $tx--; // tz length counter + } + if( 0 > $tx ) { + $tz = substr( $datetime, $tx ); + $datetime = trim( substr( $datetime, 0, $len + $tx + 1 )); + } + } + if( 0 < substr_count( $datetime, '-' )) { + $datetime = str_replace( '-', '/', $datetime ); + } + elseif( ctype_digit( substr( $datetime, 0, 8 )) && + ( 'T' == substr( $datetime, 8, 1 )) && + ctype_digit( substr( $datetime, 9, 6 ))) { + $datetime = substr( $datetime, 4, 2 ) + .'/'.substr( $datetime, 6, 2 ) + .'/'.substr( $datetime, 0, 4 ) + .' '.substr( $datetime, 9, 2 ) + .':'.substr( $datetime, 11, 2 ) + .':'.substr( $datetime, 13); + } + $datestring = date( 'Y-m-d H:i:s', strtotime( $datetime )); + $tz = trim( $tz ); + $output = array(); + $output['year'] = substr( $datestring, 0, 4 ); + $output['month'] = substr( $datestring, 5, 2 ); + $output['day'] = substr( $datestring, 8, 2 ); + if(( 6 == $parno ) || ( 7 == $parno ) || ( !$parno && ( 'Z' == $tz ))) { + $output['hour'] = substr( $datestring, 11, 2 ); + $output['min'] = substr( $datestring, 14, 2 ); + $output['sec'] = substr( $datestring, 17, 2 ); + if( !empty( $tz )) + $output['tz'] = $tz; + } + elseif( 3 != $parno ) { + if(( '00' < substr( $datestring, 11, 2 )) || + ( '00' < substr( $datestring, 14, 2 )) || + ( '00' < substr( $datestring, 17, 2 ))) { + $output['hour'] = substr( $datestring, 11, 2 ); + $output['min'] = substr( $datestring, 14, 2 ); + $output['sec'] = substr( $datestring, 17, 2 ); + } + if( !empty( $tz )) + $output['tz'] = $tz; + } + return $output; + } +/** + * convert local startdate/enddate (Ymd[His]) to duration array + * + * uses this component dates if missing input dates + * + * @author Kjell-Inge Gustafsson + * @since 2.6.11 - 2010-10-21 + * @param array $startdate + * @param array $duration + * @return array duration + */ + function _date2duration( $startdate, $enddate ) { + $startWdate = mktime( 0, 0, 0, $startdate['month'], $startdate['day'], $startdate['year'] ); + $endWdate = mktime( 0, 0, 0, $enddate['month'], $enddate['day'], $enddate['year'] ); + $wduration = $endWdate - $startWdate; + $dur = array(); + $dur['week'] = (int) floor( $wduration / ( 7 * 24 * 60 * 60 )); + $wduration = $wduration % ( 7 * 24 * 60 * 60 ); + $dur['day'] = (int) floor( $wduration / ( 24 * 60 * 60 )); + $wduration = $wduration % ( 24 * 60 * 60 ); + $dur['hour'] = (int) floor( $wduration / ( 60 * 60 )); + $wduration = $wduration % ( 60 * 60 ); + $dur['min'] = (int) floor( $wduration / ( 60 )); + $dur['sec'] = (int) $wduration % ( 60 ); + return $dur; + } +/** + * ensures internal duration format for input in array format + * + * @author Kjell-Inge Gustafsson + * @since 2.1.1 - 2007-06-24 + * @param array $duration + * @return array + */ + public static function _duration_array( $duration ) { + $output = array(); + if( is_array( $duration ) && + ( 1 == count( $duration )) && + isset( $duration['sec'] ) && + ( 60 < $duration['sec'] )) { + $durseconds = $duration['sec']; + $output['week'] = floor( $durseconds / ( 60 * 60 * 24 * 7 )); + $durseconds = $durseconds % ( 60 * 60 * 24 * 7 ); + $output['day'] = floor( $durseconds / ( 60 * 60 * 24 )); + $durseconds = $durseconds % ( 60 * 60 * 24 ); + $output['hour'] = floor( $durseconds / ( 60 * 60 )); + $durseconds = $durseconds % ( 60 * 60 ); + $output['min'] = floor( $durseconds / ( 60 )); + $output['sec'] = ( $durseconds % ( 60 )); + } + else { + foreach( $duration as $durKey => $durValue ) { + if( empty( $durValue )) continue; + switch ( $durKey ) { + case '0': case 'week': $output['week'] = $durValue; break; + case '1': case 'day': $output['day'] = $durValue; break; + case '2': case 'hour': $output['hour'] = $durValue; break; + case '3': case 'min': $output['min'] = $durValue; break; + case '4': case 'sec': $output['sec'] = $durValue; break; + } + } + } + if( isset( $output['week'] ) && ( 0 < $output['week'] )) { + unset( $output['day'], $output['hour'], $output['min'], $output['sec'] ); + return $output; + } + unset( $output['week'] ); + if( empty( $output['day'] )) + unset( $output['day'] ); + if ( isset( $output['hour'] ) || isset( $output['min'] ) || isset( $output['sec'] )) { + if( !isset( $output['hour'] )) $output['hour'] = 0; + if( !isset( $output['min'] )) $output['min'] = 0; + if( !isset( $output['sec'] )) $output['sec'] = 0; + if(( 0 == $output['hour'] ) && ( 0 == $output['min'] ) && ( 0 == $output['sec'] )) + unset( $output['hour'], $output['min'], $output['sec'] ); + } + return $output; + } +/** + * ensures internal duration format for input in string format + * + * @author Kjell-Inge Gustafsson + * @since 2.0.5 - 2007-03-14 + * @param string $duration + * @return array + */ + public static function _duration_string( $duration ) { + $duration = (string) trim( $duration ); + while( 'P' != strtoupper( substr( $duration, 0, 1 ))) { + if( 0 < strlen( $duration )) + $duration = substr( $duration, 1 ); + else + return false; // no leading P !?!? + } + $duration = substr( $duration, 1 ); // skip P + $duration = str_replace ( 't', 'T', $duration ); + $duration = str_replace ( 'T', '', $duration ); + $output = array(); + $val = null; + for( $ix=0; $ix < strlen( $duration ); $ix++ ) { + switch( strtoupper( substr( $duration, $ix, 1 ))) { + case 'W': + $output['week'] = $val; + $val = null; + break; + case 'D': + $output['day'] = $val; + $val = null; + break; + case 'H': + $output['hour'] = $val; + $val = null; + break; + case 'M': + $output['min'] = $val; + $val = null; + break; + case 'S': + $output['sec'] = $val; + $val = null; + break; + default: + if( !ctype_digit( substr( $duration, $ix, 1 ))) + return false; // unknown duration controll character !?!? + else + $val .= substr( $duration, $ix, 1 ); + } + } + return iCalUtilityFunctions::_duration_array( $output ); + } +/** + * convert duration to date in array format + * + * @author Kjell-Inge Gustafsson + * @since 2.6.23 - 2010-10-23 + * @param array $startdate + * @param array $duration + * @return array, date format + */ + function _duration2date( $startdate=null, $duration=null ) { + if( empty( $startdate )) return FALSE; + if( empty( $duration )) return FALSE; + $dateOnly = ( isset( $startdate['hour'] ) || isset( $startdate['min'] ) || isset( $startdate['sec'] )) ? FALSE : TRUE; + $startdate['hour'] = ( isset( $startdate['hour'] )) ? $startdate['hour'] : 0; + $startdate['min'] = ( isset( $startdate['min'] )) ? $startdate['min'] : 0; + $startdate['sec'] = ( isset( $startdate['sec'] )) ? $startdate['sec'] : 0; + $dtend = 0; + if( isset( $duration['week'] )) + $dtend += ( $duration['week'] * 7 * 24 * 60 * 60 ); + if( isset( $duration['day'] )) + $dtend += ( $duration['day'] * 24 * 60 * 60 ); + if( isset( $duration['hour'] )) + $dtend += ( $duration['hour'] * 60 *60 ); + if( isset( $duration['min'] )) + $dtend += ( $duration['min'] * 60 ); + if( isset( $duration['sec'] )) + $dtend += $duration['sec']; + if(( 24 * 60 * 60 ) < $dtend ) + $dtend -= ( 24 * 60 * 60 ); // exclude start day + $dtend += mktime( $startdate['hour'], $startdate['min'], $startdate['sec'], $startdate['month'], $startdate['day'], $startdate['year'] ); + $dtend2 = array(); + $dtend2['year'] = date('Y', $dtend ); + $dtend2['month'] = date('m', $dtend ); + $dtend2['day'] = date('d', $dtend ); + $dtend2['hour'] = date('H', $dtend ); + $dtend2['min'] = date('i', $dtend ); + $dtend2['sec'] = date('s', $dtend ); + if( isset( $startdate['tz'] )) + $dtend2['tz'] = $startdate['tz']; + if( $dateOnly && (( 0 == $dtend2['hour'] ) && ( 0 == $dtend2['min'] ) && ( 0 == $dtend2['sec'] ))) + unset( $dtend2['hour'], $dtend2['min'], $dtend2['sec'] ); + return $dtend2; + } +/** + * if not preSet, if exist, remove key with expected value from array and return hit value else return elseValue + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-11-08 + * @param array $array + * @param string $expkey, expected key + * @param string $expval, expected value + * @param int $hitVal optional, return value if found + * @param int $elseVal optional, return value if not found + * @param int $preSet optional, return value if already preset + * @return int + */ + public static function _existRem( &$array, $expkey, $expval=FALSE, $hitVal=null, $elseVal=null, $preSet=null ) { + if( $preSet ) + return $preSet; + if( !is_array( $array ) || ( 0 == count( $array ))) + return $elseVal; + foreach( $array as $key => $value ) { + if( strtoupper( $expkey ) == strtoupper( $key )) { + if( !$expval || ( strtoupper( $expval ) == strtoupper( $array[$key] ))) { + unset( $array[$key] ); + return $hitVal; + } + } + } + return $elseVal; + } +/** + * creates formatted output for calendar component property data value type date/date-time + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-30 + * @param array $datetime + * @param int $parno, optional, default 6 + * @return string + */ + public static function _format_date_time( $datetime, $parno=6 ) { + if( !isset( $datetime['year'] ) && + !isset( $datetime['month'] ) && + !isset( $datetime['day'] ) && + !isset( $datetime['hour'] ) && + !isset( $datetime['min'] ) && + !isset( $datetime['sec'] )) + return ; + $output = null; + // if( !isset( $datetime['day'] )) { $o=''; foreach($datetime as $k=>$v) {if(is_array($v)) $v=implode('-',$v);$o.=" $k=>$v";} echo " day SAKNAS : $o
\n"; } + foreach( $datetime as $dkey => & $dvalue ) + if( 'tz' != $dkey ) $dvalue = (integer) $dvalue; + $output = date('Ymd', mktime( 0, 0, 0, $datetime['month'], $datetime['day'], $datetime['year'])); + if( isset( $datetime['hour'] ) || + isset( $datetime['min'] ) || + isset( $datetime['sec'] ) || + isset( $datetime['tz'] )) { + if( isset( $datetime['tz'] ) && + !isset( $datetime['hour'] )) + $datetime['hour'] = 0; + if( isset( $datetime['hour'] ) && + !isset( $datetime['min'] )) + $datetime['min'] = 0; + if( isset( $datetime['hour'] ) && + isset( $datetime['min'] ) && + !isset( $datetime['sec'] )) + $datetime['sec'] = 0; + $date = mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year']); + $output .= date('\THis', $date ); + if( isset( $datetime['tz'] ) && ( '' < trim ( $datetime['tz'] ))) { + $datetime['tz'] = trim( $datetime['tz'] ); + if( 'Z' == $datetime['tz'] ) + $output .= 'Z'; + $offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] ); + if( 0 != $offset ) { + $date = mktime( $datetime['hour'], $datetime['min'], ($datetime['sec'] + $offset), $datetime['month'], $datetime['day'], $datetime['year']); + $output = date( 'Ymd\THis\Z', $date ); + } + } + elseif( 7 == $parno ) + $output .= 'Z'; + } + return $output; + } +/** + * creates formatted output for calendar component property data value type duration + * + * @author Kjell-Inge Gustafsson + * @since 2.6.10 - 2010-11-28 + * @param array $duration ( week, day, hour, min, sec ) + * @return string + */ + public static function _format_duration( $duration ) { + if( isset( $duration['week'] ) || + isset( $duration['day'] ) || + isset( $duration['hour'] ) || + isset( $duration['min'] ) || + isset( $duration['sec'] )) + $ok = TRUE; + else + return; + if( isset( $duration['week'] ) && ( 0 < $duration['week'] )) + return 'P'.$duration['week'].'W'; + $output = 'P'; + if( isset($duration['day'] ) && ( 0 < $duration['day'] )) + $output .= $duration['day'].'D'; + if(( isset( $duration['hour']) && ( 0 < $duration['hour'] )) || + ( isset( $duration['min']) && ( 0 < $duration['min'] )) || + ( isset( $duration['sec']) && ( 0 < $duration['sec'] ))) + $output .= 'T'; + $output .= ( isset( $duration['hour']) && ( 0 < $duration['hour'] )) ? $duration['hour'].'H' : ''; + $output .= ( isset( $duration['min']) && ( 0 < $duration['min'] )) ? $duration['min']. 'M' : ''; + $output .= ( isset( $duration['sec']) && ( 0 < $duration['sec'] )) ? $duration['sec']. 'S' : ''; + return $output; + } +/** + * checks if input array contains a date + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-25 + * @param array $input + * @return bool + */ + public static function _isArrayDate( $input ) { + if( isset( $input['week'] ) || ( !in_array( count( $input ), array( 3, 6, 7 )))) + return FALSE; + if( 7 == count( $input )) + return TRUE; + if( isset( $input['year'] ) && isset( $input['month'] ) && isset( $input['day'] )) + return checkdate( (int) $input['month'], (int) $input['day'], (int) $input['year'] ); + if( isset( $input['day'] ) || isset( $input['hour'] ) || isset( $input['min'] ) || isset( $input['sec'] )) + return FALSE; + if( in_array( 0, $input )) + return FALSE; + if(( 1970 > $input[0] ) || ( 12 < $input[1] ) || ( 31 < $input[2] )) + return FALSE; + if(( isset( $input[0] ) && isset( $input[1] ) && isset( $input[2] )) && + checkdate( (int) $input[1], (int) $input[2], (int) $input[0] )) + return TRUE; + $input = iCalUtilityFunctions::_date_time_string( $input[1].'/'.$input[2].'/'.$input[0], 3 ); // m - d - Y + if( isset( $input['year'] ) && isset( $input['month'] ) && isset( $input['day'] )) + return checkdate( (int) $input['month'], (int) $input['day'], (int) $input['year'] ); + return FALSE; + } +/** + * checks if input array contains a timestamp date + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-18 + * @param array $input + * @return bool + */ + public static function _isArrayTimestampDate( $input ) { + return ( is_array( $input ) && isset( $input['timestamp'] )) ? TRUE : FALSE ; + } +/** + * controll if input string contains trailing UTC offset + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-19 + * @param string $input + * @return bool + */ + public static function _isOffset( $input ) { + $input = trim( (string) $input ); + if( 'Z' == substr( $input, -1 )) + return TRUE; + elseif(( 5 <= strlen( $input )) && + ( in_array( substr( $input, -5, 1 ), array( '+', '-' ))) && + ( '0000' < substr( $input, -4 )) && ( '9999' >= substr( $input, -4 ))) + return TRUE; + elseif(( 7 <= strlen( $input )) && + ( in_array( substr( $input, -7, 1 ), array( '+', '-' ))) && + ( '000000' < substr( $input, -6 )) && ( '999999' >= substr( $input, -6 ))) + return TRUE; + return FALSE; + + } +/** + * remakes a recur pattern to an array of dates + * + * if missing, UNTIL is set 1 year from startdate (emergency break) + * + * @author Kjell-Inge Gustafsson + * @since 2.4.23 - 2010-10-24 + * @param array $result, array to update, array([timestamp] => timestamp) + * @param array $recur, pattern for recurrency (only value part, params ignored) + * @param array $wdate, component start date + * @param array $startdate, start date + * @param array $enddate, optional + * @return array of recurrence (start-)dates as index + * @todo BYHOUR, BYMINUTE, BYSECOND, ev. BYSETPOS due to ambiguity, WEEKLY at year end/start + */ + public static function _recur2date( & $result, $recur, $wdate, $startdate, $enddate=FALSE ) { + foreach( $wdate as $k => $v ) if( ctype_digit( $v )) $wdate[$k] = (int) $v; + $wdatets = iCalUtilityFunctions::_date2timestamp( $wdate ); + $startdatets = iCalUtilityFunctions::_date2timestamp( $startdate ); + if( !$enddate ) { + $enddate = $startdate; + $enddate['year'] += 1; +// echo "recur __in_ ".implode('-',$startdate)." period start ".implode('-',$wdate)." period end ".implode('-',$enddate)."
\n";print_r($recur);echo "
\n";//test### + } + $endDatets = iCalUtilityFunctions::_date2timestamp( $enddate ); // fix break + if( !isset( $recur['COUNT'] ) && !isset( $recur['UNTIL'] )) + $recur['UNTIL'] = $enddate; // create break + if( isset( $recur['UNTIL'] )) { + $tdatets = iCalUtilityFunctions::_date2timestamp( $recur['UNTIL'] ); + if( $endDatets > $tdatets ) { + $endDatets = $tdatets; // emergency break + $enddate = iCalUtilityFunctions::_timestamp2date( $endDatets, 6 ); + } + else + $recur['UNTIL'] = iCalUtilityFunctions::_timestamp2date( $endDatets, 6 ); + } + if( $wdatets > $endDatets ) { + //echo "recur out of date ".implode('-',iCalUtilityFunctions::_date_time_string(date('Y-m-d H:i:s',$wdatets),6))."
\n";//test + return array(); // nothing to do.. . + } + if( !isset( $recur['FREQ'] )) // "MUST be specified.. ." + $recur['FREQ'] = 'DAILY'; // ?? + $wkst = ( isset( $recur['WKST'] ) && ( 'SU' == $recur['WKST'] )) ? 24*60*60 : 0; // ?? + if( !isset( $recur['INTERVAL'] )) + $recur['INTERVAL'] = 1; + $countcnt = ( !isset( $recur['BYSETPOS'] )) ? 1 : 0; // DTSTART counts as the first occurrence + /* find out how to step up dates and set index for interval count */ + $step = array(); + if( 'YEARLY' == $recur['FREQ'] ) + $step['year'] = 1; + elseif( 'MONTHLY' == $recur['FREQ'] ) + $step['month'] = 1; + elseif( 'WEEKLY' == $recur['FREQ'] ) + $step['day'] = 7; + else + $step['day'] = 1; + if( isset( $step['year'] ) && isset( $recur['BYMONTH'] )) + $step = array( 'month' => 1 ); + if( empty( $step ) && isset( $recur['BYWEEKNO'] )) // ?? + $step = array( 'day' => 7 ); + if( isset( $recur['BYYEARDAY'] ) || isset( $recur['BYMONTHDAY'] ) || isset( $recur['BYDAY'] )) + $step = array( 'day' => 1 ); + $intervalarr = array(); + if( 1 < $recur['INTERVAL'] ) { + $intervalix = iCalUtilityFunctions::_recurIntervalIx( $recur['FREQ'], $wdate, $wkst ); + $intervalarr = array( $intervalix => 0 ); + } + if( isset( $recur['BYSETPOS'] )) { // save start date + weekno + $bysetposymd1 = $bysetposymd2 = $bysetposw1 = $bysetposw2 = array(); + $bysetposWold = (int) date( 'W', ( $wdatets + $wkst )); + $bysetposYold = $wdate['year']; + $bysetposMold = $wdate['month']; + $bysetposDold = $wdate['day']; + if( is_array( $recur['BYSETPOS'] )) { + foreach( $recur['BYSETPOS'] as $bix => $bval ) + $recur['BYSETPOS'][$bix] = (int) $bval; + } + else + $recur['BYSETPOS'] = array( (int) $recur['BYSETPOS'] ); + iCalUtilityFunctions::_stepdate( $enddate, $endDatets, $step); // make sure to count whole last period + } + iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step); + $year_old = null; + $daynames = array( 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA' ); + /* MAIN LOOP */ + // echo "recur start ".implode('-',$wdate)." end ".implode('-',$enddate)."
\n";//test + while( TRUE ) { + if( isset( $endDatets ) && ( $wdatets > $endDatets )) + break; + if( isset( $recur['COUNT'] ) && ( $countcnt >= $recur['COUNT'] )) + break; + if( $year_old != $wdate['year'] ) { + $year_old = $wdate['year']; + $daycnts = array(); + $yeardays = $weekno = 0; + $yeardaycnt = array(); + for( $m = 1; $m <= 12; $m++ ) { // count up and update up-counters + $daycnts[$m] = array(); + $weekdaycnt = array(); + foreach( $daynames as $dn ) + $yeardaycnt[$dn] = $weekdaycnt[$dn] = 0; + $mcnt = date( 't', mktime( 0, 0, 0, $m, 1, $wdate['year'] )); + for( $d = 1; $d <= $mcnt; $d++ ) { + $daycnts[$m][$d] = array(); + if( isset( $recur['BYYEARDAY'] )) { + $yeardays++; + $daycnts[$m][$d]['yearcnt_up'] = $yeardays; + } + if( isset( $recur['BYDAY'] )) { + $day = date( 'w', mktime( 0, 0, 0, $m, $d, $wdate['year'] )); + $day = $daynames[$day]; + $daycnts[$m][$d]['DAY'] = $day; + $weekdaycnt[$day]++; + $daycnts[$m][$d]['monthdayno_up'] = $weekdaycnt[$day]; + $yeardaycnt[$day]++; + $daycnts[$m][$d]['yeardayno_up'] = $yeardaycnt[$day]; + } + if( isset( $recur['BYWEEKNO'] ) || ( $recur['FREQ'] == 'WEEKLY' )) + $daycnts[$m][$d]['weekno_up'] =(int)date('W',mktime(0,0,$wkst,$m,$d,$wdate['year'])); + } + } + $daycnt = 0; + $yeardaycnt = array(); + if( isset( $recur['BYWEEKNO'] ) || ( $recur['FREQ'] == 'WEEKLY' )) { + $weekno = null; + for( $d=31; $d > 25; $d-- ) { // get last weekno for year + if( !$weekno ) + $weekno = $daycnts[12][$d]['weekno_up']; + elseif( $weekno < $daycnts[12][$d]['weekno_up'] ) { + $weekno = $daycnts[12][$d]['weekno_up']; + break; + } + } + } + for( $m = 12; $m > 0; $m-- ) { // count down and update down-counters + $weekdaycnt = array(); + foreach( $daynames as $dn ) + $yeardaycnt[$dn] = $weekdaycnt[$dn] = 0; + $monthcnt = 0; + $mcnt = date( 't', mktime( 0, 0, 0, $m, 1, $wdate['year'] )); + for( $d = $mcnt; $d > 0; $d-- ) { + if( isset( $recur['BYYEARDAY'] )) { + $daycnt -= 1; + $daycnts[$m][$d]['yearcnt_down'] = $daycnt; + } + if( isset( $recur['BYMONTHDAY'] )) { + $monthcnt -= 1; + $daycnts[$m][$d]['monthcnt_down'] = $monthcnt; + } + if( isset( $recur['BYDAY'] )) { + $day = $daycnts[$m][$d]['DAY']; + $weekdaycnt[$day] -= 1; + $daycnts[$m][$d]['monthdayno_down'] = $weekdaycnt[$day]; + $yeardaycnt[$day] -= 1; + $daycnts[$m][$d]['yeardayno_down'] = $yeardaycnt[$day]; + } + if( isset( $recur['BYWEEKNO'] ) || ( $recur['FREQ'] == 'WEEKLY' )) + $daycnts[$m][$d]['weekno_down'] = ($daycnts[$m][$d]['weekno_up'] - $weekno - 1); + } + } + } + /* check interval */ + if( 1 < $recur['INTERVAL'] ) { + /* create interval index */ + $intervalix = iCalUtilityFunctions::_recurIntervalIx( $recur['FREQ'], $wdate, $wkst ); + /* check interval */ + $currentKey = array_keys( $intervalarr ); + $currentKey = end( $currentKey ); // get last index + if( $currentKey != $intervalix ) + $intervalarr = array( $intervalix => ( $intervalarr[$currentKey] + 1 )); + if(( $recur['INTERVAL'] != $intervalarr[$intervalix] ) && + ( 0 != $intervalarr[$intervalix] )) { + /* step up date */ + //echo "skip: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."
\n";//test + iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step); + continue; + } + else // continue within the selected interval + $intervalarr[$intervalix] = 0; + //echo "cont: ".implode('-',$wdate)." ix=$intervalix old=$currentKey interval=".$intervalarr[$intervalix]."
\n";//test + } + $updateOK = TRUE; + if( $updateOK && isset( $recur['BYMONTH'] )) + $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYMONTH'] + , $wdate['month'] + ,($wdate['month'] - 13)); + if( $updateOK && isset( $recur['BYWEEKNO'] )) + $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYWEEKNO'] + , $daycnts[$wdate['month']][$wdate['day']]['weekno_up'] + , $daycnts[$wdate['month']][$wdate['day']]['weekno_down'] ); + if( $updateOK && isset( $recur['BYYEARDAY'] )) + $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYYEARDAY'] + , $daycnts[$wdate['month']][$wdate['day']]['yearcnt_up'] + , $daycnts[$wdate['month']][$wdate['day']]['yearcnt_down'] ); + if( $updateOK && isset( $recur['BYMONTHDAY'] )) + $updateOK = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYMONTHDAY'] + , $wdate['day'] + , $daycnts[$wdate['month']][$wdate['day']]['monthcnt_down'] ); + //echo "efter BYMONTHDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "
\n";//test### + if( $updateOK && isset( $recur['BYDAY'] )) { + $updateOK = FALSE; + $m = $wdate['month']; + $d = $wdate['day']; + if( isset( $recur['BYDAY']['DAY'] )) { // single day, opt with year/month day order no + $daynoexists = $daynosw = $daynamesw = FALSE; + if( $recur['BYDAY']['DAY'] == $daycnts[$m][$d]['DAY'] ) + $daynamesw = TRUE; + if( isset( $recur['BYDAY'][0] )) { + $daynoexists = TRUE; + if(( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'MONTHLY' )) || isset( $recur['BYMONTH'] )) + $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYDAY'][0] + , $daycnts[$m][$d]['monthdayno_up'] + , $daycnts[$m][$d]['monthdayno_down'] ); + elseif( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'YEARLY' )) + $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $recur['BYDAY'][0] + , $daycnts[$m][$d]['yeardayno_up'] + , $daycnts[$m][$d]['yeardayno_down'] ); + } + if(( $daynoexists && $daynosw && $daynamesw ) || + ( !$daynoexists && !$daynosw && $daynamesw )) { + $updateOK = TRUE; + } + //echo "daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw
\n"; // test ### + } + else { + foreach( $recur['BYDAY'] as $bydayvalue ) { + $daynoexists = $daynosw = $daynamesw = FALSE; + if( isset( $bydayvalue['DAY'] ) && + ( $bydayvalue['DAY'] == $daycnts[$m][$d]['DAY'] )) + $daynamesw = TRUE; + if( isset( $bydayvalue[0] )) { + $daynoexists = TRUE; + if(( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'MONTHLY' )) || + isset( $recur['BYMONTH'] )) + $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $bydayvalue['0'] + , $daycnts[$m][$d]['monthdayno_up'] + , $daycnts[$m][$d]['monthdayno_down'] ); + elseif( isset( $recur['FREQ'] ) && ( $recur['FREQ'] == 'YEARLY' )) + $daynosw = iCalUtilityFunctions::_recurBYcntcheck( $bydayvalue['0'] + , $daycnts[$m][$d]['yeardayno_up'] + , $daycnts[$m][$d]['yeardayno_down'] ); + } + //echo "daynoexists:$daynoexists daynosw:$daynosw daynamesw:$daynamesw
\n"; // test ### + if(( $daynoexists && $daynosw && $daynamesw ) || + ( !$daynoexists && !$daynosw && $daynamesw )) { + $updateOK = TRUE; + break; + } + } + } + } + //echo "efter BYDAY: ".implode('-',$wdate).' status: '; echo ($updateOK) ? 'TRUE' : 'FALSE'; echo "
\n"; // test ### + /* check BYSETPOS */ + if( $updateOK ) { + if( isset( $recur['BYSETPOS'] ) && + ( in_array( $recur['FREQ'], array( 'YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY' )))) { + if( isset( $recur['WEEKLY'] )) { + if( $bysetposWold == $daycnts[$wdate['month']][$wdate['day']]['weekno_up'] ) + $bysetposw1[] = $wdatets; + else + $bysetposw2[] = $wdatets; + } + else { + if(( isset( $recur['FREQ'] ) && ( 'YEARLY' == $recur['FREQ'] ) && + ( $bysetposYold == $wdate['year'] )) || + ( isset( $recur['FREQ'] ) && ( 'MONTHLY' == $recur['FREQ'] ) && + (( $bysetposYold == $wdate['year'] ) && + ( $bysetposMold == $wdate['month'] ))) || + ( isset( $recur['FREQ'] ) && ( 'DAILY' == $recur['FREQ'] ) && + (( $bysetposYold == $wdate['year'] ) && + ( $bysetposMold == $wdate['month']) && + ( $bysetposDold == $wdate['day'] )))) + $bysetposymd1[] = $wdatets; + else + $bysetposymd2[] = $wdatets; + } + } + else { + /* update result array if BYSETPOS is set */ + $countcnt++; + if( $startdatets <= $wdatets ) { // only output within period + $result[$wdatets] = TRUE; + //echo "recur ".implode('-',iCalUtilityFunctions::_date_time_string(date('Y-m-d H:i:s',$wdatets),6))."
\n";//test + } + //else echo "recur undate ".implode('-',iCalUtilityFunctions::_date_time_string(date('Y-m-d H:i:s',$wdatets),6))." okdatstart ".implode('-',iCalUtilityFunctions::_date_time_string(date('Y-m-d H:i:s',$startdatets),6))."
\n";//test + $updateOK = FALSE; + } + } + /* step up date */ + iCalUtilityFunctions::_stepdate( $wdate, $wdatets, $step); + /* check if BYSETPOS is set for updating result array */ + if( $updateOK && isset( $recur['BYSETPOS'] )) { + $bysetpos = FALSE; + if( isset( $recur['FREQ'] ) && ( 'YEARLY' == $recur['FREQ'] ) && + ( $bysetposYold != $wdate['year'] )) { + $bysetpos = TRUE; + $bysetposYold = $wdate['year']; + } + elseif( isset( $recur['FREQ'] ) && ( 'MONTHLY' == $recur['FREQ'] && + (( $bysetposYold != $wdate['year'] ) || ( $bysetposMold != $wdate['month'] )))) { + $bysetpos = TRUE; + $bysetposYold = $wdate['year']; + $bysetposMold = $wdate['month']; + } + elseif( isset( $recur['FREQ'] ) && ( 'WEEKLY' == $recur['FREQ'] )) { + $weekno = (int) date( 'W', mktime( 0, 0, $wkst, $wdate['month'], $wdate['day'], $wdate['year'])); + if( $bysetposWold != $weekno ) { + $bysetposWold = $weekno; + $bysetpos = TRUE; + } + } + elseif( isset( $recur['FREQ'] ) && ( 'DAILY' == $recur['FREQ'] ) && + (( $bysetposYold != $wdate['year'] ) || + ( $bysetposMold != $wdate['month'] ) || + ( $bysetposDold != $wdate['day'] ))) { + $bysetpos = TRUE; + $bysetposYold = $wdate['year']; + $bysetposMold = $wdate['month']; + $bysetposDold = $wdate['day']; + } + if( $bysetpos ) { + if( isset( $recur['BYWEEKNO'] )) { + $bysetposarr1 = & $bysetposw1; + $bysetposarr2 = & $bysetposw2; + } + else { + $bysetposarr1 = & $bysetposymd1; + $bysetposarr2 = & $bysetposymd2; + } + foreach( $recur['BYSETPOS'] as $ix ) { + if( 0 > $ix ) // both positive and negative BYSETPOS allowed + $ix = ( count( $bysetposarr1 ) + $ix + 1); + $ix--; + if( isset( $bysetposarr1[$ix] )) { + if( $startdatets <= $bysetposarr1[$ix] ) { // only output within period + $result[$bysetposarr1[$ix]] = TRUE; + //echo "recur ".implode('-',iCalUtilityFunctions::_date_time_string(date('Y-m-d H:i:s',$bysetposarr1[$ix]),6))."
\n";//test + } + $countcnt++; + } + if( isset( $recur['COUNT'] ) && ( $countcnt >= $recur['COUNT'] )) + break; + } + $bysetposarr1 = $bysetposarr2; + $bysetposarr2 = array(); + } + } + } + } + public static function _recurBYcntcheck( $BYvalue, $upValue, $downValue ) { + if( is_array( $BYvalue ) && + ( in_array( $upValue, $BYvalue ) || in_array( $downValue, $BYvalue ))) + return TRUE; + elseif(( $BYvalue == $upValue ) || ( $BYvalue == $downValue )) + return TRUE; + else + return FALSE; + } + public static function _recurIntervalIx( $freq, $date, $wkst ) { + /* create interval index */ + switch( $freq ) { + case 'YEARLY': + $intervalix = $date['year']; + break; + case 'MONTHLY': + $intervalix = $date['year'].'-'.$date['month']; + break; + case 'WEEKLY': + $wdatets = iCalUtilityFunctions::_date2timestamp( $date ); + $intervalix = (int) date( 'W', ( $wdatets + $wkst )); + break; + case 'DAILY': + default: + $intervalix = $date['year'].'-'.$date['month'].'-'.$date['day']; + break; + } + return $intervalix; + } +/** + * convert input format for exrule and rrule to internal format + * + * @author Kjell-Inge Gustafsson + * @since 2.6.23 - 2010-12-07 + * @param array $rexrule + * @return array + */ + public static function _setRexrule( $rexrule ) { + $input = array(); + if( empty( $rexrule )) + return $input; + foreach( $rexrule as $rexrulelabel => $rexrulevalue ) { + $rexrulelabel = strtoupper( $rexrulelabel ); + if( 'UNTIL' != $rexrulelabel ) + $input[$rexrulelabel] = $rexrulevalue; + else { + if( iCalUtilityFunctions::_isArrayTimestampDate( $rexrulevalue )) // timestamp date + $input[$rexrulelabel] = iCalUtilityFunctions::_timestamp2date( $rexrulevalue, 6 ); + elseif( iCalUtilityFunctions::_isArrayDate( $rexrulevalue )) // date-time + $input[$rexrulelabel] = iCalUtilityFunctions::_date_time_array( $rexrulevalue, 6 ); + elseif( 8 <= strlen( trim( $rexrulevalue ))) // ex. 2006-08-03 10:12:18 + $input[$rexrulelabel] = iCalUtilityFunctions::_date_time_string( $rexrulevalue ); + if(( 3 < count( $input[$rexrulelabel] )) && !isset( $input[$rexrulelabel]['tz'] )) + $input[$rexrulelabel]['tz'] = 'Z'; + } + } + /* set recurrence rule specification in rfc2445 order */ + $input2 = array(); + if( isset( $input['FREQ'] )) + $input2['FREQ'] = $input['FREQ']; + if( isset( $input['UNTIL'] )) + $input2['UNTIL'] = $input['UNTIL']; + elseif( isset( $input['COUNT'] )) + $input2['COUNT'] = $input['COUNT']; + if( isset( $input['INTERVAL'] )) + $input2['INTERVAL'] = $input['INTERVAL']; + if( isset( $input['BYSECOND'] )) + $input2['BYSECOND'] = $input['BYSECOND']; + if( isset( $input['BYMINUTE'] )) + $input2['BYMINUTE'] = $input['BYMINUTE']; + if( isset( $input['BYHOUR'] )) + $input2['BYHOUR'] = $input['BYHOUR']; + if( isset( $input['BYDAY'] )) + $input2['BYDAY'] = $input['BYDAY']; + if( isset( $input['BYMONTHDAY'] )) + $input2['BYMONTHDAY'] = $input['BYMONTHDAY']; + if( isset( $input['BYYEARDAY'] )) + $input2['BYYEARDAY'] = $input['BYYEARDAY']; + if( isset( $input['BYWEEKNO'] )) + $input2['BYWEEKNO'] = $input['BYWEEKNO']; + if( isset( $input['BYMONTH'] )) + $input2['BYMONTH'] = $input['BYMONTH']; + if( isset( $input['BYSETPOS'] )) + $input2['BYSETPOS'] = $input['BYSETPOS']; + if( isset( $input['WKST'] )) + $input2['WKST'] = $input['WKST']; + return $input2; + } +/** + * convert format for input date to internal date with parameters + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-09-25 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param string $tz optional + * @param array $params optional + * @param string $caller optional + * @param string $objName optional + * @return array + */ + public static function _setDate( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE, $caller=null, $objName=null ) { + $input = $parno = null; + $localtime = (( 'dtstart' == $caller ) && in_array( $objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE; + if( iCalUtilityFunctions::_isArrayDate( $year )) { + if( $localtime ) unset ( $month['VALUE'], $month['TZID'] ); + $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' )); + if( isset( $input['params']['TZID'] )) { + $input['params']['VALUE'] = 'DATE-TIME'; + unset( $year['tz'] ); + } + $hitval = (( !empty( $year['tz'] ) || !empty( $year[6] ))) ? 7 : 6; + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval ); + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, count( $year ), $parno ); + $input['value'] = iCalUtilityFunctions::_date_time_array( $year, $parno ); + } + elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year )) { + if( $localtime ) unset ( $month['VALUE'], $month['TZID'] ); + $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' )); + if( isset( $input['params']['TZID'] )) { + $input['params']['VALUE'] = 'DATE-TIME'; + unset( $year['tz'] ); + } + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3 ); + $hitval = ( isset( $year['tz'] )) ? 7 : 6; + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval, $parno ); + $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, $parno ); + } + elseif( 8 <= strlen( trim( $year ))) { // ex. 2006-08-03 10:12:18 + if( $localtime ) unset ( $month['VALUE'], $month['TZID'] ); + $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' )); + if( isset( $input['params']['TZID'] )) { + $input['params']['VALUE'] = 'DATE-TIME'; + $parno = 6; + } + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7, $parno ); + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3, $parno, $parno ); + $input['value'] = iCalUtilityFunctions::_date_time_string( $year, $parno ); + } + else { + if( is_array( $params )) { + if( $localtime ) unset ( $params['VALUE'], $params['TZID'] ); + $input['params'] = iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' )); + } + elseif( is_array( $tz )) { + $input['params'] = iCalUtilityFunctions::_setParams( $tz, array( 'VALUE' => 'DATE-TIME' )); + $tz = FALSE; + } + elseif( is_array( $hour )) { + $input['params'] = iCalUtilityFunctions::_setParams( $hour, array( 'VALUE' => 'DATE-TIME' )); + $hour = $min = $sec = $tz = FALSE; + } + if( isset( $input['params']['TZID'] )) { + $tz = null; + $input['params']['VALUE'] = 'DATE-TIME'; + } + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE', 3 ); + $hitval = ( !empty( $tz )) ? 7 : 6; + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', $hitval, $parno, $parno ); + $input['value'] = array( 'year' => $year, 'month' => $month, 'day' => $day ); + if( 3 != $parno ) { + $input['value']['hour'] = ( $hour ) ? $hour : '0'; + $input['value']['min'] = ( $min ) ? $min : '0'; + $input['value']['sec'] = ( $sec ) ? $sec : '0'; + if( !empty( $tz )) + $input['value']['tz'] = $tz; + } + } + if( 3 == $parno ) { + $input['params']['VALUE'] = 'DATE'; + unset( $input['value']['tz'] ); + unset( $input['params']['TZID'] ); + } + elseif( isset( $input['params']['TZID'] )) + unset( $input['value']['tz'] ); + if( $localtime ) unset( $input['value']['tz'], $input['params']['TZID'] ); + if( isset( $input['value']['tz'] )) + $input['value']['tz'] = (string) $input['value']['tz']; + if( !empty( $input['value']['tz'] ) && ( 'Z' != $input['value']['tz'] ) && + ( !iCalUtilityFunctions::_isOffset( $input['value']['tz'] ))) + $input['params']['TZID'] = $input['value']['tz']; + return $input; + } +/** + * convert format for input date (UTC) to internal date with parameters + * + * @author Kjell-Inge Gustafsson + * @since 2.4.17 - 2008-10-31 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param array $params optional + * @return array + */ + public static function _setDate2( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { + $input = null; + if( iCalUtilityFunctions::_isArrayDate( $year )) { + $input['value'] = iCalUtilityFunctions::_date_time_array( $year, 7 ); + $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ) ); + } + elseif( iCalUtilityFunctions::_isArrayTimestampDate( $year )) { + $input['value'] = iCalUtilityFunctions::_timestamp2date( $year, 7 ); + $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ) ); + } + elseif( 8 <= strlen( trim( $year ))) { // ex. 2006-08-03 10:12:18 + $input['value'] = iCalUtilityFunctions::_date_time_string( $year, 7 ); + $input['params'] = iCalUtilityFunctions::_setParams( $month, array( 'VALUE' => 'DATE-TIME' ) ); + } + else { + $input['value'] = array( 'year' => $year + , 'month' => $month + , 'day' => $day + , 'hour' => $hour + , 'min' => $min + , 'sec' => $sec ); + $input['params'] = iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' )); + } + $parno = iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME', 7 ); // remove default + if( !isset( $input['value']['hour'] )) + $input['value']['hour'] = 0; + if( !isset( $input['value']['min'] )) + $input['value']['min'] = 0; + if( !isset( $input['value']['sec'] )) + $input['value']['sec'] = 0; + if( !isset( $input['value']['tz'] ) || !iCalUtilityFunctions::_isOffset( $input['value']['tz'] )) + $input['value']['tz'] = 'Z'; + return $input; + } +/** + * check index and set (an indexed) content in multiple value array + * + * @author Kjell-Inge Gustafsson + * @since 2.6.12 - 2011-01-03 + * @param array $valArr + * @param mixed $value + * @param array $params + * @param array $defaults + * @param int $index + * @return void + */ + public static function _setMval( & $valArr, $value, $params=FALSE, $defaults=FALSE, $index=FALSE ) { + if( !is_array( $valArr )) $valArr = array(); + if( $index ) + $index = $index - 1; + elseif( 0 < count( $valArr )) { + $keys = array_keys( $valArr ); + $index = end( $keys ) + 1; + } + else + $index = 0; + $valArr[$index] = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params, $defaults )); + ksort( $valArr ); + } +/** + * set input (formatted) parameters- component property attributes + * + * default parameters can be set, if missing + * + * @author Kjell-Inge Gustafsson + * @since 1.x.x - 2007-05-01 + * @param array $params + * @param array $defaults + * @return array + */ + public static function _setParams( $params, $defaults=FALSE ) { + if( !is_array( $params)) + $params = array(); + $input = array(); + foreach( $params as $paramKey => $paramValue ) { + if( is_array( $paramValue )) { + foreach( $paramValue as $pkey => $pValue ) { + if(( '"' == substr( $pValue, 0, 1 )) && ( '"' == substr( $pValue, -1 ))) + $paramValue[$pkey] = substr( $pValue, 1, ( strlen( $pValue ) - 2 )); + } + } + elseif(( '"' == substr( $paramValue, 0, 1 )) && ( '"' == substr( $paramValue, -1 ))) + $paramValue = substr( $paramValue, 1, ( strlen( $paramValue ) - 2 )); + if( 'VALUE' == strtoupper( $paramKey )) + $input['VALUE'] = strtoupper( $paramValue ); + else + $input[strtoupper( $paramKey )] = $paramValue; + } + if( is_array( $defaults )) { + foreach( $defaults as $paramKey => $paramValue ) { + if( !isset( $input[$paramKey] )) + $input[$paramKey] = $paramValue; + } + } + return (0 < count( $input )) ? $input : null; + } +/** + * step date, return updated date, array and timpstamp + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-18 + * @param array $date, date to step + * @param int $timestamp + * @param array $step, default array( 'day' => 1 ) + * @return void + */ + public static function _stepdate( &$date, &$timestamp, $step=array( 'day' => 1 )) { + foreach( $step as $stepix => $stepvalue ) + $date[$stepix] += $stepvalue; + $timestamp = iCalUtilityFunctions::_date2timestamp( $date ); + $date = iCalUtilityFunctions::_timestamp2date( $timestamp, 6 ); + foreach( $date as $k => $v ) { + if( ctype_digit( $v )) + $date[$k] = (int) $v; + } + } +/** + * convert timestamp to date array + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-11-01 + * @param mixed $timestamp + * @param int $parno + * @return array + */ + public static function _timestamp2date( $timestamp, $parno=6 ) { + if( is_array( $timestamp )) { + if(( 7 == $parno ) && !empty( $timestamp['tz'] )) + $tz = $timestamp['tz']; + $timestamp = $timestamp['timestamp']; + } + $output = array( 'year' => date( 'Y', $timestamp ) + , 'month' => date( 'm', $timestamp ) + , 'day' => date( 'd', $timestamp )); + if( 3 != $parno ) { + $output['hour'] = date( 'H', $timestamp ); + $output['min'] = date( 'i', $timestamp ); + $output['sec'] = date( 's', $timestamp ); + if( isset( $tz )) + $output['tz'] = $tz; + } + return $output; + } +/** + * convert timestamp to duration in array format + * + * @author Kjell-Inge Gustafsson + * @since 2.6.23 - 2010-10-23 + * @param int $timestamp + * @return array, duration format + */ + function _timestamp2duration( $timestamp ) { + $dur = array(); + $dur['week'] = (int) floor( $timestamp / ( 7 * 24 * 60 * 60 )); + $timestamp = $timestamp % ( 7 * 24 * 60 * 60 ); + $dur['day'] = (int) floor( $timestamp / ( 24 * 60 * 60 )); + $timestamp = $timestamp % ( 24 * 60 * 60 ); + $dur['hour'] = (int) floor( $timestamp / ( 60 * 60 )); + $timestamp = $timestamp % ( 60 * 60 ); + $dur['min'] = (int) floor( $timestamp / ( 60 )); + $dur['sec'] = (int) $timestamp % ( 60 ); + return $dur; + } +/** + * convert (numeric) local time offset to seconds correcting localtime to GMT + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-19 + * @param string $offset + * @return integer + */ + public static function _tz2offset( $tz ) { + $tz = trim( (string) $tz ); + $offset = 0; + if((( 5 != strlen( $tz )) && ( 7 != strlen( $tz ))) || + (( '+' != substr( $tz, 0, 1 )) && ( '-' != substr( $tz, 0, 1 ))) || + (( '0000' >= substr( $tz, 1, 4 )) && ( '9999' < substr( $tz, 1, 4 ))) || + (( 7 == strlen( $tz )) && ( '00' > substr( $tz, 5, 2 )) && ( '99' < substr( $tz, 5, 2 )))) + return $offset; + $hours2sec = (int) substr( $tz, 1, 2 ) * 3600; + $min2sec = (int) substr( $tz, 3, 2 ) * 60; + $sec = ( 7 == strlen( $tz )) ? (int) substr( $tz, -2 ) : '00'; + $offset = $hours2sec + $min2sec + $sec; + $offset = ('-' == substr( $tz, 0, 1 )) ? $offset : -1 * $offset; + return $offset; + } +} +?> \ No newline at end of file diff --git a/iCalcreator/iCalcreator.class.php b/iCalcreator/iCalcreator.class.php new file mode 100644 index 0000000..b8be8d6 --- /dev/null +++ b/iCalcreator/iCalcreator.class.php @@ -0,0 +1,6490 @@ += '5.1' ) + // && ( 'UTC' == date_default_timezone_get())) + date_default_timezone_set( 'Europe/Stockholm' ); +/*********************************************************************************/ +/* since 2.6.22 - 2010-09-25, do NOT remove!! */ +require_once ( 'iCalUtilityFunctions.class.php' ); +/*********************************************************************************/ +/* version string, do NOT remove!! */ +define( 'ICALCREATOR_VERSION', 'iCalcreator 2.8' ); +/*********************************************************************************/ +/*********************************************************************************/ +/** + * vcalendar class + * + * @author Kjell-Inge Gustafsson + * @since 2.2.13 - 2007-12-30 + */ +class vcalendar { + // calendar property variables + var $calscale; + var $method; + var $prodid; + var $version; + var $xprop; + // container for calendar components + var $components; + // component config variables + var $allowEmpty; + var $unique_id; + var $language; + var $directory; + var $filename; + var $url; + var $delimiter; + var $nl; + var $format; + // component internal variables + var $attributeDelimiter; + var $valueInit; + // component xCal declaration container + var $xcaldecl; +/* + * constructor for calendar object + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-20 + * @param array $config + * @return void + */ + function vcalendar ( $config = array()) { + $this->_makeVersion(); + $this->calscale = null; + $this->method = null; + $this->_makeUnique_id(); + $this->prodid = null; + $this->xprop = array(); + $this->language = null; + $this->directory = null; + $this->filename = null; + $this->url = null; +/** + * language = + */ + if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) + $config['language'] = ICAL_LANG; + if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; + if( !isset( $config['nl'] )) $config['nl'] = PHP_EOL; + if( !isset( $config['format'] )) $config['format'] = 'iCal'; + if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; + $this->setConfig( $config ); + + $this->xcaldecl = array(); + $this->components = array(); + } +/*********************************************************************************/ +/** + * Property Name: CALSCALE + */ +/** + * creates formatted output for calendar property calscale + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createCalscale() { + if( empty( $this->calscale )) return FALSE; + switch( $this->format ) { + case 'xcal': + return ' calscale="'.$this->calscale.'"'.$this->nl; + break; + default: + return 'CALSCALE:'.$this->calscale.$this->nl; + break; + } + } +/** + * set calendar property calscale + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @param string $value + * @return void + */ + function setCalscale( $value ) { + if( empty( $value )) return FALSE; + $this->calscale = $value; + } +/*********************************************************************************/ +/** + * Property Name: METHOD + */ +/** + * creates formatted output for calendar property method + * + * @author Kjell-Inge Gustafsson + * @since 0.9.7 - 2006-11-20 + * @return string + */ + function createMethod() { + if( empty( $this->method )) return FALSE; + switch( $this->format ) { + case 'xcal': + return ' method="'.$this->method.'"'.$this->nl; + break; + default: + return 'METHOD:'.$this->method.$this->nl; + break; + } + } +/** + * set calendar property method + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-20-23 + * @param string $value + * @return bool + */ + function setMethod( $value ) { + if( empty( $value )) return FALSE; + $this->method = $value; + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: PRODID + * + * The identifier is RECOMMENDED to be the identical syntax to the + * [RFC 822] addr-spec. A good method to assure uniqueness is to put the + * domain name or a domain literal IP address of the host on which.. . + */ +/** + * creates formatted output for calendar property prodid + * + * @author Kjell-Inge Gustafsson + * @since 0.9.7 - 2006-11-20 + * @return string + */ + function createProdid() { + if( !isset( $this->prodid )) + $this->_makeProdid(); + switch( $this->format ) { + case 'xcal': + return ' prodid="'.$this->prodid.'"'.$this->nl; + break; + default: + return 'PRODID:'.$this->prodid.$this->nl; + break; + } + } +/** + * make default value for calendar prodid + * + * @author Kjell-Inge Gustafsson + * @since 2.6.8 - 2009-12-30 + * @return void + */ + function _makeProdid() { + $this->prodid = '-//'.$this->unique_id.'//NONSGML kigkonsult.se '.ICALCREATOR_VERSION.'//'.strtoupper( $this->language ); + } +/** + * Conformance: The property MUST be specified once in an iCalendar object. + * Description: The vendor of the implementation SHOULD assure that this + * is a globally unique identifier; using some technique such as an FPI + * value, as defined in [ISO 9070]. + */ +/** + * make default unique_id for calendar prodid + * + * @author Kjell-Inge Gustafsson + * @since 0.3.0 - 2006-08-10 + * @return void + */ + function _makeUnique_id() { + $this->unique_id = ( isset( $_SERVER['SERVER_NAME'] )) ? gethostbyname( $_SERVER['SERVER_NAME'] ) : 'localhost'; + } +/*********************************************************************************/ +/** + * Property Name: VERSION + * + * Description: A value of "2.0" corresponds to this memo. + */ +/** + * creates formatted output for calendar property version + + * + * @author Kjell-Inge Gustafsson + * @since 0.9.7 - 2006-11-20 + * @return string + */ + function createVersion() { + if( empty( $this->version )) + $this->_makeVersion(); + switch( $this->format ) { + case 'xcal': + return ' version="'.$this->version.'"'.$this->nl; + break; + default: + return 'VERSION:'.$this->version.$this->nl; + break; + } + } +/** + * set default calendar version + * + * @author Kjell-Inge Gustafsson + * @since 0.3.0 - 2006-08-10 + * @return void + */ + function _makeVersion() { + $this->version = '2.0'; + } +/** + * set calendar version + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @param string $value + * @return void + */ + function setVersion( $value ) { + if( empty( $value )) return FALSE; + $this->version = $value; + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: x-prop + */ +/** + * creates formatted output for calendar property x-prop, iCal format only + * + * @author Kjell-Inge Gustafsson + * @since 2.4.11 - 2008-11-03 + * @return string + */ + function createXprop() { + if( 'xcal' == $this->format ) + return false; + if( 0 >= count( $this->xprop )) + return; + $output = null; + $toolbox = new calendarComponent(); + $toolbox->setConfig( 'language', $this->getConfig( 'language' )); + $toolbox->setConfig( 'nl', $this->getConfig( 'nl' )); + $toolbox->_createFormat( $this->getConfig( 'format' )); + foreach( $this->xprop as $label => $xpropPart ) { + if( empty( $xpropPart['value'] )) { + $output .= $toolbox->_createElement( $label ); + continue; + } + $attributes = $toolbox->_createParams( $xpropPart['params'], array( 'LANGUAGE' )); + if( is_array( $xpropPart['value'] )) { + foreach( $xpropPart['value'] as $pix => $theXpart ) + $xpropPart['value'][$pix] = $toolbox->_strrep( $theXpart ); + $xpropPart['value'] = implode( ',', $xpropPart['value'] ); + } + else + $xpropPart['value'] = $toolbox->_strrep( $xpropPart['value'] ); + $output .= $toolbox->_createElement( $label, $attributes, $xpropPart['value'] ); + } + return $output; + } +/** + * set calendar property x-prop + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-09-25 + * @param string $label + * @param string $value + * @param array $params optional + * @return bool + */ + function setXprop( $label, $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + if( empty( $label )) return FALSE; + $xprop = array( 'value' => $value ); + $xprop['params'] = iCalUtilityFunctions::_setParams( $params ); + if( !is_array( $this->xprop )) $this->xprop = array(); + $this->xprop[strtoupper( $label )] = $xprop; + return TRUE; + } +/*********************************************************************************/ +/** + * delete calendar property value + * + * @author Kjell-Inge Gustafsson + * @since 2.6.4 - 2011-01-05 + * @param mixed $propName, bool FALSE => X-property + * @param int $propix, optional, if specific property is wanted in case of multiply occurences + * @return bool, if successfull delete + */ + function deleteProperty( $propName=FALSE, $propix=FALSE ) { + $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP'; + if( !$propix ) + $propix = ( isset( $this->propdelix[$propName] ) && ( 'X-PROP' != $propName )) ? $this->propdelix[$propName] + 2 : 1; + $this->propdelix[$propName] = --$propix; + $return = FALSE; + switch( $propName ) { + case 'CALSCALE': + if( isset( $this->calscale )) { + $this->calscale = null; + $return = TRUE; + } + break; + case 'METHOD': + if( isset( $this->method )) { + $this->method = null; + $return = TRUE; + } + break; + default: + $reduced = array(); + if( $propName != 'X-PROP' ) { + if( !isset( $this->xprop[$propName] )) return FALSE; + foreach( $this->xprop as $k => $a ) { + if(( $k != $propName ) && !empty( $a )) + $reduced[$k] = $a; + } + } + else { + if( count( $this->xprop ) <= $propix ) return FALSE; + $xpropno = 0; + foreach( $this->xprop as $xpropkey => $xpropvalue ) { + if( $propix != $xpropno ) + $reduced[$xpropkey] = $xpropvalue; + $xpropno++; + } + } + $this->xprop = $reduced; + if( empty( $this->xprop )) + return FALSE; + return TRUE; + } + return $return; + } +/** + * get calendar property value/params + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-02 + * @param string $propName, optional + * @param int $propix, optional, if specific property is wanted in case of multiply occurences + * @param bool $inclParam=FALSE + * @return mixed + */ + function getProperty( $propName=FALSE, $propix=FALSE, $inclParam=FALSE ) { + $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP'; + if( 'X-PROP' == $propName ) { + if( !$propix ) + $propix = ( isset( $this->propix[$propName] )) ? $this->propix[$propName] + 2 : 1; + $this->propix[$propName] = --$propix; + } + switch( $propName ) { + case 'CALSCALE': + return ( !empty( $this->calscale )) ? $this->calscale : null; + break; + case 'METHOD': + return ( !empty( $this->method )) ? $this->method : null; + break; + case 'PRODID': + if( empty( $this->prodid )) + $this->_makeProdid(); + return $this->prodid; + break; + case 'VERSION': + return ( !empty( $this->version )) ? $this->version : null; + break; + default: + if( $propName != 'X-PROP' ) { + if( !isset( $this->xprop[$propName] )) return FALSE; + return ( $inclParam ) ? array( $propName, $this->xprop[$propName] ) + : array( $propName, $this->xprop[$propName]['value'] ); + } + else { + if( empty( $this->xprop )) return FALSE; + $xpropno = 0; + foreach( $this->xprop as $xpropkey => $xpropvalue ) { + if( $propix == $xpropno ) + return ( $inclParam ) ? array( $xpropkey, $this->xprop[$xpropkey] ) + : array( $xpropkey, $this->xprop[$xpropkey]['value'] ); + else + $xpropno++; + } + return FALSE; // not found ?? + } + } + return FALSE; + } +/** + * general vcalendar property setting + * + * @author Kjell-Inge Gustafsson + * @since 2.2.13 - 2007-11-04 + * @param mixed $args variable number of function arguments, + * first argument is ALWAYS component name, + * second ALWAYS component value! + * @return bool + */ + function setProperty () { + $numargs = func_num_args(); + if( 1 > $numargs ) + return FALSE; + $arglist = func_get_args(); + $arglist[0] = strtoupper( $arglist[0] ); + switch( $arglist[0] ) { + case 'CALSCALE': + return $this->setCalscale( $arglist[1] ); + case 'METHOD': + return $this->setMethod( $arglist[1] ); + case 'VERSION': + return $this->setVersion( $arglist[1] ); + default: + if( !isset( $arglist[1] )) $arglist[1] = null; + if( !isset( $arglist[2] )) $arglist[2] = null; + return $this->setXprop( $arglist[0], $arglist[1], $arglist[2] ); + } + return FALSE; + } +/*********************************************************************************/ +/** + * get vcalendar config values or * calendar components + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-27 + * @param mixed $config + * @return value + */ + function getConfig( $config = FALSE ) { + if( !$config ) { + $return = array(); + $return['ALLOWEMPTY'] = $this->getConfig( 'ALLOWEMPTY' ); + $return['DELIMITER'] = $this->getConfig( 'DELIMITER' ); + $return['DIRECTORY'] = $this->getConfig( 'DIRECTORY' ); + $return['FILENAME'] = $this->getConfig( 'FILENAME' ); + $return['DIRFILE'] = $this->getConfig( 'DIRFILE' ); + $return['FILESIZE'] = $this->getConfig( 'FILESIZE' ); + $return['FORMAT'] = $this->getConfig( 'FORMAT' ); + if( FALSE !== ( $lang = $this->getConfig( 'LANGUAGE' ))) + $return['LANGUAGE'] = $lang; + $return['NEWLINECHAR'] = $this->getConfig( 'NEWLINECHAR' ); + $return['UNIQUE_ID'] = $this->getConfig( 'UNIQUE_ID' ); + if( FALSE !== ( $url = $this->getConfig( 'URL' ))) + $return['URL'] = $url; + return $return; + } + switch( strtoupper( $config )) { + case 'ALLOWEMPTY': + return $this->allowEmpty; + break; + case 'COMPSINFO': + unset( $this->compix ); + $info = array(); + foreach( $this->components as $cix => $component ) { + if( empty( $component )) continue; + unset( $component->propix ); + $info[$cix]['ordno'] = $cix + 1; + $info[$cix]['type'] = $component->objName; + $info[$cix]['uid'] = $component->getProperty( 'uid' ); + $info[$cix]['props'] = $component->getConfig( 'propinfo' ); + $info[$cix]['sub'] = $component->getConfig( 'compsinfo' ); + unset( $component->propix ); + } + return $info; + break; + case 'DELIMITER': + return $this->delimiter; + break; + case 'DIRECTORY': + if( empty( $this->directory )) + $this->directory = '.'; + return $this->directory; + break; + case 'DIRFILE': + return $this->getConfig( 'directory' ).$this->getConfig( 'delimiter' ).$this->getConfig( 'filename' ); + break; + case 'FILEINFO': + return array( $this->getConfig( 'directory' ) + , $this->getConfig( 'filename' ) + , $this->getConfig( 'filesize' )); + break; + case 'FILENAME': + if( empty( $this->filename )) { + if( 'xcal' == $this->format ) + $this->filename = date( 'YmdHis' ).'.xml'; // recommended xcs.. . + else + $this->filename = date( 'YmdHis' ).'.ics'; + } + return $this->filename; + break; + case 'FILESIZE': + $size = 0; + if( empty( $this->url )) { + $dirfile = $this->getConfig( 'dirfile' ); + if( !is_file( $dirfile ) || ( FALSE === ( $size = filesize( $dirfile )))) + $size = 0; + clearstatcache(); + } + return $size; + break; + case 'FORMAT': + return ( $this->format == 'xcal' ) ? 'xCal' : 'iCal'; + break; + case 'LANGUAGE': + /* get language for calendar component as defined in [RFC 1766] */ + return $this->language; + break; + case 'NL': + case 'NEWLINECHAR': + return $this->nl; + break; + case 'UNIQUE_ID': + return $this->unique_id; + break; + case 'URL': + if( !empty( $this->url )) + return $this->url; + else + return FALSE; + break; + } + } +/** + * general vcalendar config setting + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-12-12 + * @param mixed $config + * @param string $value + * @return void + */ + function setConfig( $config, $value = FALSE) { + if( is_array( $config )) { + foreach( $config as $cKey => $cValue ) { + if( FALSE === $this->setConfig( $cKey, $cValue )) + return FALSE; + } + return TRUE; + } + $res = FALSE; + switch( strtoupper( $config )) { + case 'ALLOWEMPTY': + $this->allowEmpty = $value; + $subcfg = array( 'ALLOWEMPTY' => $value ); + $res = TRUE; + break; + case 'DELIMITER': + $this->delimiter = $value; + return TRUE; + break; + case 'DIRECTORY': + $value = trim( $value ); + $del = $this->getConfig('delimiter'); + if( $del == substr( $value, ( 0 - strlen( $del )))) + $value = substr( $value, 0, ( strlen( $value ) - strlen( $del ))); + if( is_dir( $value )) { + /* local directory */ + clearstatcache(); + $this->directory = $value; + $this->url = null; + return TRUE; + } + else + return FALSE; + break; + case 'FILENAME': + $value = trim( $value ); + if( !empty( $this->url )) { + /* remote directory+file -> URL */ + $this->filename = $value; + return TRUE; + } + $dirfile = $this->getConfig( 'directory' ).$this->getConfig( 'delimiter' ).$value; + if( file_exists( $dirfile )) { + /* local file exists */ + if( is_readable( $dirfile ) || is_writable( $dirfile )) { + clearstatcache(); + $this->filename = $value; + return TRUE; + } + else + return FALSE; + } + elseif( is_readable($this->getConfig( 'directory' ) ) || is_writable( $this->getConfig( 'directory' ) )) { + /* read- or writable directory */ + $this->filename = $value; + return TRUE; + } + else + return FALSE; + break; + case 'FORMAT': + $value = trim( strtolower( $value )); + if( 'xcal' == $value ) { + $this->format = 'xcal'; + $this->attributeDelimiter = $this->nl; + $this->valueInit = null; + } + else { + $this->format = null; + $this->attributeDelimiter = ';'; + $this->valueInit = ':'; + } + $subcfg = array( 'FORMAT' => $value ); + $res = TRUE; + break; + case 'LANGUAGE': + // set language for calendar component as defined in [RFC 1766] + $value = trim( $value ); + $this->language = $value; + $subcfg = array( 'LANGUAGE' => $value ); + $res = TRUE; + break; + case 'NL': + case 'NEWLINECHAR': + $this->nl = $value; + $subcfg = array( 'NL' => $value ); + $res = TRUE; + break; + case 'UNIQUE_ID': + $value = trim( $value ); + $this->unique_id = $value; + $subcfg = array( 'UNIQUE_ID' => $value ); + $res = TRUE; + break; + case 'URL': + /* remote file - URL */ + $value = trim( $value ); + $value = str_replace( 'HTTP://', 'http://', $value ); + $value = str_replace( 'WEBCAL://', 'http://', $value ); + $value = str_replace( 'webcal://', 'http://', $value ); + $this->url = $value; + $this->directory = null; + $parts = pathinfo( $value ); + return $this->setConfig( 'filename', $parts['basename'] ); + break; + default: // any unvalid config key.. . + return TRUE; + } + if( !$res ) return FALSE; + if( isset( $subcfg ) && !empty( $this->components )) { + foreach( $subcfg as $cfgkey => $cfgvalue ) { + foreach( $this->components as $cix => $component ) { + $res = $component->setConfig( $cfgkey, $cfgvalue, TRUE ); + if( !$res ) + break 2; + $this->components[$cix] = $component->copy(); // PHP4 compliant + } + } + } + return $res; + } +/*********************************************************************************/ +/** + * add calendar component to container + * + * alias to setComponent + * + * @author Kjell-Inge Gustafsson + * @since 1.x.x - 2007-04-24 + * @param object $component calendar component + * @return void + */ + function addComponent( $component ) { + $this->setComponent( $component ); + } +/** + * delete calendar component from container + * + * @author Kjell-Inge Gustafsson + * @since 2.4.10 - 2008-08-05 + * @param mixed $arg1 ordno / component type / component uid + * @param mixed $arg2 optional, ordno if arg1 = component type + * @return void + */ + function deleteComponent( $arg1, $arg2=FALSE ) { + $argType = $index = null; + if ( ctype_digit( (string) $arg1 )) { + $argType = 'INDEX'; + $index = (int) $arg1 - 1; + } + elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { + $argType = strtolower( $arg1 ); + $index = ( !empty( $arg2 ) && ctype_digit( (string) $arg2 )) ? (( int ) $arg2 - 1 ) : 0; + } + $cix1dC = 0; + foreach ( $this->components as $cix => $component) { + if( empty( $component )) continue; + unset( $component->propix ); + if(( 'INDEX' == $argType ) && ( $index == $cix )) { + unset( $this->components[$cix] ); + return TRUE; + } + elseif( $argType == $component->objName ) { + if( $index == $cix1dC ) { + unset( $this->components[$cix] ); + return TRUE; + } + $cix1dC++; + } + elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { + unset( $this->components[$cix] ); + return TRUE; + } + } + return FALSE; + } +/** + * get calendar component from container + * + * @author Kjell-Inge Gustafsson + * @since 2.4.10 - 2008-08-06 + * @param mixed $arg1 optional, ordno/component type/ component uid + * @param mixed $arg2 optional, ordno if arg1 = component type + * @return object + */ + function getComponent( $arg1=FALSE, $arg2=FALSE ) { + $index = $argType = null; + if ( !$arg1 ) { + $argType = 'INDEX'; + $index = $this->compix['INDEX'] = + ( isset( $this->compix['INDEX'] )) ? $this->compix['INDEX'] + 1 : 1; + } + elseif ( ctype_digit( (string) $arg1 )) { + $argType = 'INDEX'; + $index = (int) $arg1; + unset( $this->compix ); + } + elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { + unset( $this->compix['INDEX'] ); + $argType = strtolower( $arg1 ); + if( !$arg2 ) + $index = $this->compix[$argType] = ( isset( $this->compix[$argType] )) ? $this->compix[$argType] + 1 : 1; + else + $index = (int) $arg2; + } + $index -= 1; + $ckeys = array_keys( $this->components ); + if( !empty( $index) && ( $index > end( $ckeys ))) + return FALSE; + $cix1gC = 0; + foreach ( $this->components as $cix => $component) { + if( empty( $component )) continue; + unset( $component->propix ); + if(( 'INDEX' == $argType ) && ( $index == $cix )) + return $component->copy(); + elseif( $argType == $component->objName ) { + if( $index == $cix1gC ) + return $component->copy(); + $cix1gC++; + } + elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { + unset( $component->propix ); + return $component->copy(); + } + } + /* not found.. . */ + unset( $this->compix ); + return FALSE; + } +/** + * create new calendar component, already included within calendar + * + * @author Kjell-Inge Gustafsson + * @since 2.6.33 - 2011-01-03 + * @param string $compType component type + * @return object (reference) + */ + function & newComponent( $compType ) { + $config = $this->getConfig(); + $keys = array_keys( $this->components ); + $ix = end( $keys) + 1; + switch( strtoupper( $compType )) { + case 'EVENT': + case 'VEVENT': + $this->components[$ix] = new vevent( $config ); + break; + case 'TODO': + case 'VTODO': + $this->components[$ix] = new vtodo( $config ); + break; + case 'JOURNAL': + case 'VJOURNAL': + $this->components[$ix] = new vjournal( $config ); + break; + case 'FREEBUSY': + case 'VFREEBUSY': + $this->components[$ix] = new vfreebusy( $config ); + break; + case 'TIMEZONE': + case 'VTIMEZONE': + array_unshift( $this->components, new vtimezone( $config )); + $ix = 0; + break; + default: + return FALSE; + } + return $this->components[$ix]; + } +/** + * select components from calendar on date basis + * + * Ensure DTSTART is set for every component. + * No date controls occurs. + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-10-21 + * @param int $startY optional, start Year, default current Year + * @param int $startM optional, start Month, default current Month + * @param int $startD optional, start Day, default current Day + * @param int $endY optional, end Year, default $startY + * @param int $endY optional, end Month, default $startM + * @param int $endY optional, end Day, default $startD + * @param mixed $cType optional, calendar component type(-s), default FALSE=all else string/array type(-s) + * @param bool $flat optional, FALSE (default) => output : array[Year][Month][Day][] + * TRUE => output : array[] (ignores split) + * @param bool $any optional, TRUE (default) - select component that take place within period + * FALSE - only components that starts within period + * @param bool $split optional, TRUE (default) - one component copy every day it take place during the + * period (implies flat=FALSE) + * FALSE - one occurance of component only in output array + * @return array or FALSE + */ + function selectComponents( $startY=FALSE, $startM=FALSE, $startD=FALSE, $endY=FALSE, $endM=FALSE, $endD=FALSE, $cType=FALSE, $flat=FALSE, $any=TRUE, $split=TRUE ) { + /* check if empty calendar */ + if( 0 >= count( $this->components )) return FALSE; + /* check default dates */ + if( !$startY ) $startY = date( 'Y' ); + if( !$startM ) $startM = date( 'm' ); + if( !$startD ) $startD = date( 'd' ); + $startDate = mktime( 0, 0, 0, $startM, $startD, $startY ); + if( !$endY ) $endY = $startY; + if( !$endM ) $endM = $startM; + if( !$endD ) $endD = $startD; + $endDate = mktime( 23, 59, 59, $endM, $endD, $endY ); + /* check component types */ + $validTypes = array('vevent', 'vtodo', 'vjournal', 'vfreebusy' ); + if( is_array( $cType )) { + foreach( $cType as $cix => $theType ) { + $cType[$cix] = $theType = strtolower( $theType ); + if( !in_array( $theType, $validTypes )) + $cType[$cix] = 'vevent'; + } + $cType = array_unique( $cType ); + } + elseif( !empty( $cType )) { + $cType = strtolower( $cType ); + if( !in_array( $cType, $validTypes )) + $cType = array( 'vevent' ); + else + $cType = array( $cType ); + } + else + $cType = $validTypes; + if( 0 >= count( $cType )) + $cType = $validTypes; + /* iterate components */ + $result = array(); + foreach ( $this->components as $cix => $component ) { + if( empty( $component )) continue; + unset( $component->propix, $start ); + /* deselect unvalid type components */ + if( !in_array( $component->objName, $cType )) continue; + $start = $component->getProperty( 'dtstart' ); + /* select due when dtstart is missing */ + if( empty( $start ) && ( $component->objName == 'vtodo' ) && ( FALSE === ( $start = $component->getProperty( 'due' )))) + continue; + $dtendExist = $dueExist = $durationExist = $endAllDayEvent = FALSE; + unset( $end, $startWdate, $endWdate, $rdurWsecs, $rdur, $exdatelist, $workstart, $workend, $endDateFormat ); // clean up + $startWdate = iCalUtilityFunctions::_date2timestamp( $start ); + $startDateFormat = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; + /* get end date from dtend/due/duration properties */ + $end = $component->getProperty( 'dtend' ); + if( !empty( $end )) { + $dtendExist = TRUE; + $endDateFormat = ( isset( $end['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; + } + // if( !empty($end)) echo 'selectComp 1 start='.implode('-',$start).' end='.implode('-',$end)."
\n"; // test ### + if( empty( $end ) && ( $component->objName == 'vtodo' )) { + $end = $component->getProperty( 'due' ); + if( !empty( $end )) { + $dueExist = TRUE; + $endDateFormat = ( isset( $end['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; + } + // if( !empty($end)) echo 'selectComp 2 start='.implode('-',$start).' end='.implode('-',$end)."
\n"; // test ### + } + if( !empty( $end ) && !isset( $end['hour'] )) { + /* a DTEND without time part regards an event that ends the day before, + for an all-day event DTSTART=20071201 DTEND=20071202 (taking place 20071201!!! */ + $endAllDayEvent = TRUE; + $endWdate = mktime( 23, 59, 59, $end['month'], ($end['day'] - 1), $end['year'] ); + $end['year'] = date( 'Y', $endWdate ); + $end['month'] = date( 'm', $endWdate ); + $end['day'] = date( 'd', $endWdate ); + $end['hour'] = 23; + $end['min'] = $end['sec'] = 59; + // if( !empty($end)) echo 'selectComp 3 start='.implode('-',$start).' end='.implode('-',$end)."
\n"; // test ### + } + if( empty( $end )) { + $end = $component->getProperty( 'duration', FALSE, FALSE, TRUE );// in dtend (array) format + if( !empty( $end )) + $durationExist = TRUE; + $endDateFormat = ( isset( $start['hour'] )) ? 'Y-m-d H:i:s' : 'Y-m-d'; + // if( !empty($end)) echo 'selectComp 4 start='.implode('-',$start).' end='.implode('-',$end)."
\n"; // test ### + } + if( empty( $end )) { // assume one day duration if missing end date + $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 ); + // if( isset($end)) echo 'selectComp 5 start='.implode('-',$start).' end='.implode('-',$end)."
\n"; // test ### + } + $endWdate = iCalUtilityFunctions::_date2timestamp( $end ); + if( $endWdate < $startWdate ) { // MUST be after start date!! + $end = array( 'year' => $start['year'], 'month' => $start['month'], 'day' => $start['day'], 'hour' => 23, 'min' => 59, 'sec' => 59 ); + $endWdate = iCalUtilityFunctions::_date2timestamp( $end ); + } + $rdurWsecs = $endWdate - $startWdate; // compute component duration in seconds + /* make a list of optional exclude dates for component occurence from exrule and exdate */ + $exdatelist = array(); + $workstart = iCalUtilityFunctions::_timestamp2date(( $startDate - $rdurWsecs ), 6); + $workend = iCalUtilityFunctions::_timestamp2date(( $endDate + $rdurWsecs ), 6); + while( FALSE !== ( $exrule = $component->getProperty( 'exrule' ))) // check exrule + iCalUtilityFunctions::_recur2date( $exdatelist, $exrule, $start, $workstart, $workend ); + while( FALSE !== ( $exdate = $component->getProperty( 'exdate' ))) { // check exdate + foreach( $exdate as $theExdate ) { + $exWdate = iCalUtilityFunctions::_date2timestamp( $theExdate ); + $exWdate = mktime( 0, 0, 0, date( 'm', $exWdate ), date( 'd', $exWdate ), date( 'Y', $exWdate ) ); // on a day-basis !!! + if((( $startDate - $rdurWsecs ) <= $exWdate ) && ( $endDate >= $exWdate )) + $exdatelist[$exWdate] = TRUE; + } + } + /* if 'any' components, check repeating components, removing all excluding dates */ + if( TRUE === $any ) { + /* make a list of optional repeating dates for component occurence, rrule, rdate */ + $recurlist = array(); + while( FALSE !== ( $rrule = $component->getProperty( 'rrule' ))) // check rrule + iCalUtilityFunctions::_recur2date( $recurlist, $rrule, $start, $workstart, $workend ); + foreach( $recurlist as $recurkey => $recurvalue ) // key=match date as timestamp + $recurlist[$recurkey] = $rdurWsecs; // add duration in seconds + while( FALSE !== ( $rdate = $component->getProperty( 'rdate' ))) { // check rdate + foreach( $rdate as $theRdate ) { + if( is_array( $theRdate ) && ( 2 == count( $theRdate )) && // all days within PERIOD + array_key_exists( '0', $theRdate ) && array_key_exists( '1', $theRdate )) { + $rstart = iCalUtilityFunctions::_date2timestamp( $theRdate[0] ); + if(( $rstart < ( $startDate - $rdurWsecs )) || ( $rstart > $endDate )) + continue; + if( isset( $theRdate[1]['year'] )) // date-date period + $rend = iCalUtilityFunctions::_date2timestamp( $theRdate[1] ); + else { // date-duration period + $rend = iCalUtilityFunctions::_duration2date( $theRdate[0], $theRdate[1] ); + $rend = iCalUtilityFunctions::_date2timestamp( $rend ); + } + while( $rstart < $rend ) { + $recurlist[$rstart] = $rdurWsecs; // set start date for recurrence instance + rdate duration in seconds + $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day + } + } // PERIOD end + else { // single date + $theRdate = iCalUtilityFunctions::_date2timestamp( $theRdate ); + if((( $startDate - $rdurWsecs ) <= $theRdate ) && ( $endDate >= $theRdate )) + $recurlist[$theRdate] = $rdurWsecs; // set start date for recurrence instance + event duration in seconds + } + } + } + if( 0 < count( $recurlist )) { + ksort( $recurlist ); + $xRecurrence = 1; + foreach( $recurlist as $recurkey => $durvalue ) { + if((( $startDate - $rdurWsecs ) > $recurkey ) || ( $endDate < $recurkey )) // not within period + continue; + $checkDate = mktime( 0, 0, 0, date( 'm', $recurkey ), date( 'd', $recurkey ), date( 'Y', $recurkey ) ); // on a day-basis !!! + if( isset( $exdatelist[$checkDate] )) // check excluded dates + continue; + if( $startWdate >= $recurkey ) // exclude component start date + continue; + $component2 = $component->copy(); + $rstart = $recurkey; + $rend = $recurkey + $durvalue; + /* add repeating components within valid dates to output array, only start date set */ + if( $flat ) { + $datestring = date( $startDateFormat, $recurkey ); + if( isset( $start['tz'] )) + $datestring .= ' '.$start['tz']; + $component2->setProperty( 'X-CURRENT-DTSTART', $datestring ); + if( $dtendExist || $dueExist || $durationExist ) { + $datestring = date( $endDateFormat, $recurkey + $durvalue ); // fixa korrekt sluttid + if( isset( $end['tz'] )) + $datestring .= ' '.$end['tz']; + $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE'; + $component2->setProperty( $propName, $datestring ); + } // end if( $dtendExist || $dueExist || $durationExist ) + $component2->setProperty( 'X-RECURRENCE', ++$xRecurrence ); + $result[$component2->getProperty( 'UID' )] = $component2->copy(); // copy to output + } + /* add repeating components within valid dates to output array, one each day */ + elseif( $split ) { + $xRecurrence += 1; + if( $rend > $endDate ) + $rend = $endDate; + while( $rstart <= $rend ) { // iterate.. . + $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! + if( isset( $exdatelist[$checkDate] )) // exclude any recurrence START date, found in exdatelist + break; + if( $rstart > $startDate ) { // date after dtstart + $datestring = date( $startDateFormat, $rstart ); + if( isset( $start['tz'] )) + $datestring .= ' '.$start['tz']; + $component2->setProperty( 'X-CURRENT-DTSTART', $datestring ); + if( $dtendExist || $dueExist || $durationExist ) { + $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! + $datestring = date( $endDateFormat, $tend ); + if( isset( $end['tz'] )) + $datestring .= ' '.$end['tz']; + $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE'; + $component2->setProperty( $propName, $datestring ); + } // end if( $dtendExist || $dueExist || $durationExist ) + $component2->setProperty( 'X-RECURRENCE', $xRecurrence ); + $wd = getdate( $rstart ); + $result[$wd['year']][$wd['mon']][$wd['mday']][$component2->getProperty( 'UID' )] = $component2->copy(); // copy to output + } + $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day + } // end while( $rstart <= $rend ) + } // end elseif( $split ) + elseif( $rstart >= $startDate ) { // date within period //* flat=FALSE && split=FALSE *// + $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! + if( !isset( $exdatelist[$checkDate] )) { // exclude any recurrence START date, found in exdatelist + $xRecurrence += 1; + $datestring = date( $startDateFormat, $rstart ); + if( isset( $start['tz'] )) + $datestring .= ' '.$start['tz']; + $component2->setProperty( 'X-CURRENT-DTSTART', $datestring ); + if( $dtendExist || $dueExist || $durationExist ) { + $rstart += $rdurWsecs; + $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! + $datestring = date( $endDateFormat, $tend ); + if( isset( $end['tz'] )) + $datestring .= ' '.$end['tz']; + $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE'; + $component2->setProperty( $propName, $datestring ); + } // end if( $dtendExist || $dueExist || $durationExist ) + $component2->setProperty( 'X-RECURRENCE', $xRecurrence ); + $wd = getdate( $rstart ); + $result[$wd['year']][$wd['mon']][$wd['mday']][$component2->getProperty( 'UID' )] = $component2->copy(); // copy to output + } // end if( !isset( $exdatelist[$checkDate] )) + } // end elseif( $rstart >= $startDate ) + } // end foreach( $recurlist as $recurkey => $durvalue ) + } // end if( 0 < count( $recurlist )) + /* deselect components with startdate/enddate not within period */ + if(( $endWdate < $startDate ) || ( $startWdate > $endDate )) + continue; + } // end if( TRUE === $any ) + /* deselect components with startdate not within period */ + elseif(( $startWdate < $startDate ) || ( $startWdate > $endDate )) + continue; + /* add the selected component (WITHIN valid dates) to output array */ + if( $flat ) + $result[$component->getProperty( 'UID' )] = $component->copy(); // copy to output; + elseif( $split ) { + if( $endWdate > $endDate ) + $endWdate = $endDate; // use period end date + $rstart = $startWdate; + if( $rstart < $startDate ) + $rstart = $startDate; // use period start date + $checkDate = mktime( 0, 0, 0, date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! + if( !isset( $exdatelist[$checkDate] )) { // exclude any recurrence START date, found in exdatelist + while( $rstart <= $endWdate ) { // iterate + if( $rstart > $startWdate ) { // if NOT startdate, set X-properties + $datestring = date( $startDateFormat, $rstart ); + if( isset( $start['tz'] )) + $datestring .= ' '.$start['tz']; + $component->setProperty( 'X-CURRENT-DTSTART', $datestring ); + if( $dtendExist || $dueExist || $durationExist ) { + $tend = mktime( date( 'H', $endWdate ), date( 'i', $endWdate ), date( 's', $endWdate ), date( 'm', $rstart ), date( 'd', $rstart ), date( 'Y', $rstart ) ); // on a day-basis !!! + $datestring = date( $endDateFormat, $tend ); + if( isset( $end['tz'] )) + $datestring .= ' '.$end['tz']; + $propName = ( !$dueExist ) ? 'X-CURRENT-DTEND' : 'X-CURRENT-DUE'; + $component->setProperty( $propName, $datestring ); + } // end if( $dtendExist || $dueExist || $durationExist ) + } // end if( $rstart > $startWdate ) + $wd = getdate( $rstart ); + $result[$wd['year']][$wd['mon']][$wd['mday']][$component->getProperty( 'UID' )] = $component->copy(); // copy to output + $rstart = mktime( date( 'H', $rstart ), date( 'i', $rstart ), date( 's', $rstart ), date( 'm', $rstart ), date( 'd', $rstart ) + 1, date( 'Y', $rstart ) ); // step one day + } // end while( $rstart <= $endWdate ) + } // end if( !isset( $exdatelist[$checkDate] )) + } // end if( $split ) - else use component date + elseif( $startWdate >= $startDate ) { // within period + $checkDate = mktime( 0, 0, 0, date( 'm', $startWdate ), date( 'd', $startWdate ), date( 'Y', $startWdate ) ); // on a day-basis !!! + if( !isset( $exdatelist[$checkDate] )) { // exclude any recurrence START date, found in exdatelist + $wd = getdate( $startWdate ); + $result[$wd['year']][$wd['mon']][$wd['mday']][$component->getProperty( 'UID' )] = $component->copy(); // copy to output + } + } + } // end foreach ( $this->components as $cix => $component ) + if( 0 >= count( $result )) return FALSE; + elseif( !$flat ) { + foreach( $result as $y => $yeararr ) { + foreach( $yeararr as $m => $montharr ) { + foreach( $montharr as $d => $dayarr ) + $result[$y][$m][$d] = array_values( $dayarr ); // skip tricky UID-index + ksort( $result[$y][$m] ); + } + ksort( $result[$y] ); + } + ksort( $result ); + } // end elseif( !$flat ) + return $result; + } +/** + * add calendar component to container + * + * @author Kjell-Inge Gustafsson + * @since 2.6.28 - 2011-01-01 + * @param object $component calendar component + * @param mixed $arg1 optional, ordno/component type/ component uid + * @param mixed $arg2 optional, ordno if arg1 = component type + * @return void + */ + function setComponent( $component, $arg1=FALSE, $arg2=FALSE ) { + $component->setConfig( $this->getConfig(), FALSE, TRUE ); + if( !in_array( $component->objName, array( 'valarm', 'vtimezone' ))) { + unset( $component->propix ); + /* make sure dtstamp and uid is set */ + $dummy1 = $component->getProperty( 'dtstamp' ); + $dummy2 = $component->getProperty( 'uid' ); + } + if( !$arg1 ) { // plain insert, last in chain + $this->components[] = $component->copy(); + return TRUE; + } + $argType = $index = null; + if ( ctype_digit( (string) $arg1 )) { // index insert/replace + $argType = 'INDEX'; + $index = (int) $arg1 - 1; + } + elseif( in_array( strtolower( $arg1 ), array( 'vevent', 'vtodo', 'vjournal', 'vfreebusy', 'valarm', 'vtimezone' ))) { + $argType = strtolower( $arg1 ); + $index = ( ctype_digit( (string) $arg2 )) ? ((int) $arg2) - 1 : 0; + } + // else if arg1 is set, arg1 must be an UID + $cix1sC = 0; + foreach ( $this->components as $cix => $component2) { + if( empty( $component2 )) continue; + unset( $component2->propix ); + if(( 'INDEX' == $argType ) && ( $index == $cix )) { // index insert/replace + $this->components[$cix] = $component->copy(); + return TRUE; + } + elseif( $argType == $component2->objName ) { // component Type index insert/replace + if( $index == $cix1sC ) { + $this->components[$cix] = $component->copy(); + return TRUE; + } + $cix1sC++; + } + elseif( !$argType && ( $arg1 == $component2->getProperty( 'uid' ))) { // UID insert/replace + $this->components[$cix] = $component->copy(); + return TRUE; + } + } + /* arg1=index and not found.. . insert at index .. .*/ + if( 'INDEX' == $argType ) { + $this->components[$index] = $component->copy(); + ksort( $this->components, SORT_NUMERIC ); + } + else /* not found.. . insert last in chain anyway .. .*/ + $this->components[] = $component->copy(); + return TRUE; + } +/** + * sort iCal compoments, only local date sort + * + * ascending sort on properties (if exist) x-current-dtstart, dtstart, + * x-current-dtend, dtend, x-current-due, due, duration, created, dtstamp, uid + * + * @author Kjell-Inge Gustafsson + * @since 2.6.3 - 2010-12-05 + * @return void + * + */ + function sort() { + if( is_array( $this->components )) { + /* set sort parameters for each component */ + foreach( $this->components as & $c ) { + $c->srtk = array( '0', '0', '0', '0' ); + if( 'vtimezone' == $c->objName ) { + if( FALSE === ( $c->srtk[0] = $c->getProperty( 'tzid' ))) + $c->srtk[0] = 0; + continue; + } + if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTSTART' ))) + $c->srtk[0] = iCalUtilityFunctions::_date_time_string( $d[1] ); + elseif( FALSE === ( $c->srtk[0] = $c->getProperty( 'dtstart' ))) + $c->srtk[1] = 0; // sortkey 0 : dtstart + if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DTEND' ))) + $c->srtk[1] = iCalUtilityFunctions::_date_time_string( $d[1] ); // sortkey 1 : dtend/due(/dtstart+duration) + elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'dtend' ))) { + if( FALSE !== ( $d = $c->getProperty( 'X-CURRENT-DUE' ))) + $c->srtk[1] = iCalUtilityFunctions::_date_time_string( $d[1] ); + elseif( FALSE === ( $c->srtk[1] = $c->getProperty( 'due' ))) + if( FALSE === ( $c->srtk[1] = $c->getProperty( 'duration', FALSE, FALSE, TRUE ))) + $c->srtk[1] = 0; + } + if( FALSE === ( $c->srtk[2] = $c->getProperty( 'created' ))) // sortkey 2 : created/dtstamp + if( FALSE === ( $c->srtk[2] = $c->getProperty( 'dtstamp' ))) + $c->srtk[2] = 0; + if( FALSE === ( $c->srtk[3] = $c->getProperty( 'uid' ))) // sortkey 3 : uid + $c->srtk[3] = 0; + } // end foreach( $this->components as & $c + /* sort */ + usort( $this->components, array( $this, '_cmpfcn' )); + } + } + function _cmpfcn( $a, $b ) { + if( empty( $a )) return -1; + if( empty( $b )) return 1; + if( 'vtimezone' == $a->objName ) { + if( 'vtimezone' != $b->objName ) return -1; + elseif( $a->srtk[0] <= $b->srtk[0] ) return -1; + else return 1; + } + elseif( 'vtimezone' == $b->objName ) return 1; + $sortkeys = array( 'year', 'month', 'day', 'hour', 'min', 'sec' ); + for( $k = 0; $k < 4 ; $k++ ) { + if( empty( $a->srtk[$k] )) return -1; + elseif( empty( $b->srtk[$k] )) return 1; + if( is_array( $a->srtk[$k] )) { + if( is_array( $b->srtk[$k] )) { + foreach( $sortkeys as $key ) { + if ( empty( $a->srtk[$k][$key] )) return -1; + elseif( empty( $b->srtk[$k][$key] )) return 1; + if ( $a->srtk[$k][$key] == $b->srtk[$k][$key]) + continue; + if (( (int) $a->srtk[$k][$key] ) < ((int) $b->srtk[$k][$key] )) + return -1; + elseif(( (int) $a->srtk[$k][$key] ) > ((int) $b->srtk[$k][$key] )) + return 1; + } + } + else return -1; + } + elseif( is_array( $b->srtk[$k] )) return 1; + elseif( $a->srtk[$k] < $b->srtk[$k] ) return -1; + elseif( $a->srtk[$k] > $b->srtk[$k] ) return 1; + } + return 0; + } +/** + * parse iCal text/file into vcalendar, components, properties and parameters + * + * @author Kjell-Inge Gustafsson + * @since 2.6.32 - 2010-12-19 + * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of property strings + * @return bool FALSE if error occurs during parsing + * + */ + function parse( $unparsedtext=FALSE ) { + $nl = $this->getConfig( 'nl' ); + if( FALSE === $unparsedtext ) { + /* directory+filename is set previously via setConfig directory+filename or url */ + if( FALSE === ( $filename = $this->getConfig( 'url' ))) + $filename = $this->getConfig( 'dirfile' ); + /* READ FILE */ + if( FALSE === ( $rows = file( $filename ))) + return FALSE; /* err 1 */ + } + elseif( !is_array( $unparsedtext )) + $rows = explode( $nl, $unparsedtext ); + else + $rows = & $unparsedtext; + /* identify BEGIN:VCALENDAR, MUST be first row */ + if( 'BEGIN:VCALENDAR' != strtoupper( trim( $rows[0] ))) + return FALSE; /* err 8 */ + /* skip trailing empty lines */ + $lix = count( $rows ) - 1; + while( empty( $rows[$lix] ) && ( 0 < $lix )) + $lix--; + /* identify ending END:VCALENDAR row, MUST be last row */ + if( 'END:VCALENDAR' != strtoupper( trim( $rows[ $lix ] ))) + return FALSE; /* err 9 */ + if( 3 > count( $rows )) + return FALSE; /* err 10 */ + $comp = & $this; + $calsync = 0; + /* identify components and update unparsed data within component */ + foreach( $rows as $line ) { + if( '' == trim( $line )) + continue; + if( $nl == substr( $line, 0 - strlen( $nl ))) + $line = substr( $line, 0, ( strlen( $line ) - strlen( $nl ))).'\n'; + elseif( "\n\r" == substr( $line, 0 - strlen( "\n\r" ))) + $line = substr( $line, 0, ( strlen( $line ) - strlen( "\n\r" ))).'\n'; + if( 'BEGIN:VCALENDAR' == strtoupper( substr( $line, 0, 15 ))) { + $calsync++; + continue; + } + elseif( 'END:VCALENDAR' == strtoupper( substr( $line, 0, 13 ))) { + $calsync--; + break; + } + elseif( 1 != $calsync ) + return FALSE; /* err 20 */ + elseif( in_array( strtoupper( substr( $line, 0, 6 )), array( 'END:VE', 'END:VF', 'END:VJ', 'END:VT' ))) { + $this->components[] = $comp->copy(); + continue; + } + if( 'BEGIN:VEVENT' == strtoupper( substr( $line, 0, 12 ))) + $comp = new vevent(); + elseif( 'BEGIN:VFREEBUSY' == strtoupper( substr( $line, 0, 15 ))) + $comp = new vfreebusy(); + elseif( 'BEGIN:VJOURNAL' == strtoupper( substr( $line, 0, 14 ))) + $comp = new vjournal(); + elseif( 'BEGIN:VTODO' == strtoupper( substr( $line, 0, 11 ))) + $comp = new vtodo(); + elseif( 'BEGIN:VTIMEZONE' == strtoupper( substr( $line, 0, 15 ))) + $comp = new vtimezone(); + else /* update component with unparsed data */ + $comp->unparsed[] = $line; + } // end - foreach( rows.. . + /* parse data for calendar (this) object */ + if( is_array( $this->unparsed ) && ( 0 < count( $this->unparsed ))) { + /* concatenate property values spread over several lines */ + $lastix = -1; + $propnames = array( 'calscale','method','prodid','version','x-' ); + $proprows = array(); + foreach( $this->unparsed as $line ) { + if( '' == trim( $line )) + continue; + $newProp = FALSE; + foreach ( $propnames as $propname ) { + if( $propname == strtolower( substr( $line, 0, strlen( $propname )))) { + $newProp = TRUE; + break; + } + } + if( $newProp ) { + $newProp = FALSE; + $lastix++; + $proprows[$lastix] = $line; + } + else { + /* todo: fix count for multibyte characters.. . */ + $strlen = ( defined( MB_OVERLOAD_STRING )) ? mb_strlen( $proprows[$lastix] ) : strlen( $proprows[$lastix] ); + /* remove line breaks */ +// if(( 1 < strlen( $proprows[$lastix] )) && + if(( 73 < $strlen ) && + ( '\n' == substr( $proprows[$lastix], -2 )) && + ( ' ' == substr( $line, 0, 1 ))) { +// $proprows[$lastix] = substr( $proprows[$lastix], 0, strlen( $proprows[$lastix] ) - 2 ); + $proprows[$lastix] = substr( $proprows[$lastix], 0, ( $strlen - 2 )); + $line = substr( $line, 1 ); + } + /* concatenate lines within the same property */ + $proprows[$lastix] .= $line; + } + } + foreach( $proprows as $line ) { + if( '\n' == substr( $line, -2 )) + $line = substr( $line, 0, strlen( $line ) - 2 ); + /* get propname */ + $cix = $propname = null; + for( $cix=0, $clen = strlen( $line ); $cix < $clen; $cix++ ) { + if( in_array( $line[$cix], array( ':', ';' ))) + break; + else + $propname .= $line[$cix]; + } + /* ignore version/prodid properties */ + if( in_array( strtoupper( $propname ), array( 'VERSION', 'PRODID' ))) + continue; + $line = substr( $line, $cix); + /* separate attributes from value */ + $attr = array(); + $attrix = -1; + $strlen = strlen( $line ); + for( $cix=0; $cix < $strlen; $cix++ ) { + if(( ':' == $line[$cix] ) && + ( '://' != substr( $line, $cix, 3 )) && + ( !in_array( strtolower( substr( $line, $cix - 3, 4 )), array( 'fax:', 'cid:', 'sms:', 'tel:', 'urn:' ))) && + ( !in_array( strtolower( substr( $line, $cix - 4, 5 )), array( 'crid:', 'news:', 'pres:' ))) && + ( 'mailto:' != strtolower( substr( $line, $cix - 6, 7 )))) { + $attrEnd = TRUE; + if(( $cix < ( $strlen - 4 )) && + ctype_digit( substr( $line, $cix+1, 4 ))) { // an URI with a (4pos) portnr?? + for( $c2ix = $cix; 3 < $c2ix; $c2ix-- ) { + if( '://' == substr( $line, $c2ix - 2, 3 )) { + $attrEnd = FALSE; + break; // an URI with a portnr!! + } + } + } + if( $attrEnd) { + $line = substr( $line, $cix + 1 ); + break; + } + } + if( ';' == $line[$cix] ) + $attr[++$attrix] = null; + else + $attr[$attrix] .= $line[$cix]; + } + + /* make attributes in array format */ + $propattr = array(); + foreach( $attr as $attribute ) { + $attrsplit = explode( '=', $attribute, 2 ); + if( 1 < count( $attrsplit )) + $propattr[$attrsplit[0]] = $attrsplit[1]; + else + $propattr[] = $attribute; + } + /* update Property */ + if( FALSE !== strpos( $line, ',' )) { + $content = explode( ',', $line ); + $clen = count( $content ); + for( $cix = 0; $cix < $clen; $cix++ ) { + if( "\\" == substr( $content[$cix], -1 )) { + $content[$cix] .= ','.$content[$cix + 1]; + unset( $content[$cix + 1] ); + $cix++; + } + } + if( 1 < count( $content )) { + foreach( $content as $cix => $contentPart ) + $content[$cix] = calendarComponent::_strunrep( $contentPart ); + $this->setProperty( $propname, $content, $propattr ); + continue; + } + else + $line = reset( $content ); + $line = calendarComponent::_strunrep( $line ); + } + $this->setProperty( $propname, trim( $line ), $propattr ); + } // end - foreach( $this->unparsed.. . + } // end - if( is_array( $this->unparsed.. . + unset( $unparsedtext, $rows, $this->unparsed, $proprows ); + /* parse Components */ + if( is_array( $this->components ) && ( 0 < count( $this->components ))) { + $ckeys = array_keys( $this->components ); + foreach( $ckeys as $ckey ) { + if( !empty( $this->components[$ckey] ) && !empty( $this->components[$ckey]->unparsed )) { + $this->components[$ckey]->parse(); + } + } + } + else + return FALSE; /* err 91 or something.. . */ + return TRUE; + } +/*********************************************************************************/ +/** + * creates formatted output for calendar object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-12-12 + * @return string + */ + function createCalendar() { + $calendarInit1 = $calendarInit2 = $calendarxCaldecl = $calendarStart = $calendar = null; + switch( $this->format ) { + case 'xcal': + $calendarInit1 = ''.$this->nl. + 'nl. + '"http://www.ietf.org/internet-drafts/draft-ietf-calsch-many-xcal-01.txt"'; + $calendarInit2 = '>'.$this->nl; + $calendarStart = 'nl; + break; + } + $calendarStart .= $this->createProdid(); + $calendarStart .= $this->createVersion(); + $calendarStart .= $this->createCalscale(); + $calendarStart .= $this->createMethod(); + switch( $this->format ) { + case 'xcal': + $nlstrlen = strlen( $this->nl ); + if( $this->nl == substr( $calendarStart, ( 0 - $nlstrlen ))) + $calendarStart = substr( $calendarStart, 0, ( strlen( $calendarStart ) - $nlstrlen )); + $calendarStart .= '>'.$this->nl; + break; + default: + break; + } + $calendar .= $this->createXprop(); + foreach( $this->components as $component ) { + if( empty( $component )) continue; + $component->setConfig( $this->getConfig(), FALSE, TRUE ); + $calendar .= $component->createComponent( $this->xcaldecl ); + } + if(( 0 < count( $this->xcaldecl )) && ( 'xcal' == $this->format )) { // xCal only + $calendarInit1 .= $this->nl.'['.$this->nl; + $old_xcaldecl = array(); + foreach( $this->xcaldecl as $declix => $declPart ) { + if(( 0 < count( $old_xcaldecl)) && + ( in_array( $declPart['uri'], $old_xcaldecl['uri'] )) && + ( in_array( $declPart['external'], $old_xcaldecl['external'] ))) + continue; // no duplicate uri and ext. references + $calendarxCaldecl .= ' $declValue ) { + switch( $declKey ) { // index + case 'xmldecl': // no 1 + $calendarxCaldecl .= $declValue.' '; + break; + case 'uri': // no 2 + $calendarxCaldecl .= $declValue.' '; + $old_xcaldecl['uri'][] = $declValue; + break; + case 'ref': // no 3 + $calendarxCaldecl .= $declValue.' '; + break; + case 'external': // no 4 + $calendarxCaldecl .= '"'.$declValue.'" '; + $old_xcaldecl['external'][] = $declValue; + break; + case 'type': // no 5 + $calendarxCaldecl .= $declValue.' '; + break; + case 'type2': // no 6 + $calendarxCaldecl .= $declValue; + break; + } + } + $calendarxCaldecl .= '>'.$this->nl; + } + $calendarInit2 = ']'.$calendarInit2; + } + switch( $this->format ) { + case 'xcal': + $calendar .= ''.$this->nl; + break; + default: + $calendar .= 'END:VCALENDAR'.$this->nl; + break; + } + return $calendarInit1.$calendarxCaldecl.$calendarInit2.$calendarStart.$calendar; + } +/** + * a HTTP redirect header is sent with created, updated and/or parsed calendar + * + * @author Kjell-Inge Gustafsson + * @since 2.2.12 - 2007-10-23 + * @return redirect + */ + function returnCalendar() { + $filename = $this->getConfig( 'filename' ); + $output = $this->createCalendar(); + $filesize = strlen( $output ); +// if( headers_sent( $filename, $linenum )) +// die( "Headers already sent in $filename on line $linenum\n" ); + if( 'xcal' == $this->format ) + header( 'Content-Type: application/calendar+xml; charset=utf-8' ); + else + header( 'Content-Type: text/calendar; charset=utf-8' ); + header( 'Content-Length: '.$filesize ); + header( 'Content-Disposition: attachment; filename="'.$filename.'"' ); + header( 'Cache-Control: max-age=10' ); + echo $output; + die(); + } +/** + * save content in a file + * + * @author Kjell-Inge Gustafsson + * @since 2.2.12 - 2007-12-30 + * @param string $directory optional + * @param string $filename optional + * @param string $delimiter optional + * @return bool + */ + function saveCalendar( $directory=FALSE, $filename=FALSE, $delimiter=FALSE ) { + if( $directory ) + $this->setConfig( 'directory', $directory ); + if( $filename ) + $this->setConfig( 'filename', $filename ); + if( $delimiter && ($delimiter != DIRECTORY_SEPARATOR )) + $this->setConfig( 'delimiter', $delimiter ); + if( FALSE === ( $dirfile = $this->getConfig( 'url' ))) + $dirfile = $this->getConfig( 'dirfile' ); + $iCalFile = @fopen( $dirfile, 'w' ); + if( $iCalFile ) { + if( FALSE === fwrite( $iCalFile, $this->createCalendar() )) + return FALSE; + fclose( $iCalFile ); + return TRUE; + } + else + return FALSE; + } +/** + * if recent version of calendar file exists (default one hour), an HTTP redirect header is sent + * else FALSE is returned + * + * @author Kjell-Inge Gustafsson + * @since 2.2.12 - 2007-10-28 + * @param string $directory optional alt. int timeout + * @param string $filename optional + * @param string $delimiter optional + * @param int timeout optional, default 3600 sec + * @return redirect/FALSE + */ + function useCachedCalendar( $directory=FALSE, $filename=FALSE, $delimiter=FALSE, $timeout=3600) { + if ( $directory && ctype_digit( (string) $directory ) && !$filename ) { + $timeout = (int) $directory; + $directory = FALSE; + } + if( $directory ) + $this->setConfig( 'directory', $directory ); + if( $filename ) + $this->setConfig( 'filename', $filename ); + if( $delimiter && ( $delimiter != DIRECTORY_SEPARATOR )) + $this->setConfig( 'delimiter', $delimiter ); + $filesize = $this->getConfig( 'filesize' ); + if( 0 >= $filesize ) + return FALSE; + $dirfile = $this->getConfig( 'dirfile' ); + if( time() - filemtime( $dirfile ) < $timeout) { + clearstatcache(); + $dirfile = $this->getConfig( 'dirfile' ); + $filename = $this->getConfig( 'filename' ); +// if( headers_sent( $filename, $linenum )) +// die( "Headers already sent in $filename on line $linenum\n" ); + if( 'xcal' == $this->format ) + header( 'Content-Type: application/calendar+xml; charset=utf-8' ); + else + header( 'Content-Type: text/calendar; charset=utf-8' ); + header( 'Content-Length: '.$filesize ); + header( 'Content-Disposition: attachment; filename="'.$filename.'"' ); + header( 'Cache-Control: max-age=10' ); + $fp = @fopen( $dirfile, 'r' ); + if( $fp ) { + fpassthru( $fp ); + fclose( $fp ); + } + die(); + } + else + return FALSE; + } +} +/*********************************************************************************/ +/*********************************************************************************/ +/** + * abstract class for calendar components + * + * @author Kjell-Inge Gustafsson + * @since 2.4.19 - 2008-10-12 + */ +class calendarComponent { + // component property variables + var $uid; + var $dtstamp; + + // component config variables + var $allowEmpty; + var $language; + var $nl; + var $unique_id; + var $format; + var $objName; // created automatically at instance creation + // component internal variables + var $componentStart1; + var $componentStart2; + var $componentEnd1; + var $componentEnd2; + var $elementStart1; + var $elementStart2; + var $elementEnd1; + var $elementEnd2; + var $intAttrDelimiter; + var $attributeDelimiter; + var $valueInit; + // component xCal declaration container + var $xcaldecl; +/** + * constructor for calendar component object + * + * @author Kjell-Inge Gustafsson + * @since 2.4.19 - 2008-10-23 + */ + function calendarComponent() { + $this->objName = ( isset( $this->timezonetype )) ? + strtolower( $this->timezonetype ) : get_class ( $this ); + $this->uid = array(); + $this->dtstamp = array(); + + $this->language = null; + $this->nl = null; + $this->unique_id = null; + $this->format = null; + $this->allowEmpty = TRUE; + $this->xcaldecl = array(); + + $this->_createFormat(); + $this->_makeDtstamp(); + } +/*********************************************************************************/ +/** + * Property Name: ACTION + */ +/** + * creates formatted output for calendar component property action + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createAction() { + if( empty( $this->action )) return FALSE; + if( empty( $this->action['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'ACTION' ) : FALSE; + $attributes = $this->_createParams( $this->action['params'] ); + return $this->_createElement( 'ACTION', $attributes, $this->action['value'] ); + } +/** + * set calendar component property action + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE" + * @param mixed $params + * @return bool + */ + function setAction( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->action = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: ATTACH + */ +/** + * creates formatted output for calendar component property attach + * + * @author Kjell-Inge Gustafsson + * @since 0.9.7 - 2006-11-23 + * @return string + */ + function createAttach() { + if( empty( $this->attach )) return FALSE; + $output = null; + foreach( $this->attach as $attachPart ) { + if(! empty( $attachPart['value'] )) { + $attributes = $this->_createParams( $attachPart['params'] ); + $output .= $this->_createElement( 'ATTACH', $attributes, $attachPart['value'] ); + } + elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'ATTACH' ); + } + return $output; + } +/** + * set calendar component property attach + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-06 + * @param string $value + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setAttach( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->attach, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: ATTENDEE + */ +/** + * creates formatted output for calendar component property attendee + * + * @author Kjell-Inge Gustafsson + * @since 2.6.29 - 2010-11-29 + * @return string + */ + function createAttendee() { + if( empty( $this->attendee )) return FALSE; + $output = null; + foreach( $this->attendee as $attendeePart ) { // start foreach 1 + if( empty( $attendeePart['value'] )) { + if( $this->getConfig( 'allowEmpty' )) + $output .= $this->_createElement( 'ATTENDEE' ); + continue; + } + $attendee1 = $attendee2 = null; + foreach( $attendeePart as $paramlabel => $paramvalue ) { // start foreach 2 + if( 'value' == $paramlabel ) + $attendee2 .= $paramvalue; + elseif(( 'params' == $paramlabel ) && ( is_array( $paramvalue ))) { // start elseif + // set attenddee parameters in rfc2445 order + if( isset( $paramvalue['CUTYPE'] )) + $attendee1 .= $this->intAttrDelimiter.'CUTYPE="'.$paramvalue['CUTYPE'].'"'; + if( isset( $paramvalue['MEMBER'] )) { + $attendee1 .= $this->intAttrDelimiter.'MEMBER='; + foreach( $paramvalue['MEMBER'] as $cix => $opv ) + $attendee1 .= ( $cix ) ? ', "'.$opv.'"' : '"'.$opv.'"' ; + } + if( isset( $paramvalue['ROLE'] )) + $attendee1 .= $this->intAttrDelimiter.'ROLE="'.$paramvalue['ROLE'].'"'; + if( isset( $paramvalue['PARTSTAT'] )) + $attendee1 .= $this->intAttrDelimiter.'PARTSTAT="'.$paramvalue['PARTSTAT'].'"'; + if( isset( $paramvalue['RSVP'] )) + $attendee1 .= $this->intAttrDelimiter.'RSVP="'.$paramvalue['RSVP'].'"'; + if( isset( $paramvalue['DELEGATED-TO'] )) { + $attendee1 .= $this->intAttrDelimiter.'DELEGATED-TO='; + foreach( $paramvalue['DELEGATED-TO'] as $cix => $opv ) + $attendee1 .= ( $cix ) ? ', "'.$opv.'"' : '"'.$opv.'"' ; + } + if( isset( $paramvalue['DELEGATED-FROM'] )) { + $attendee1 .= $this->intAttrDelimiter.'DELEGATED-FROM='; + foreach( $paramvalue['DELEGATED-FROM'] as $cix => $opv ) + $attendee1 .= ( $cix ) ? ', "'.$opv.'"' : '"'.$opv.'"' ; + } + if( isset( $paramvalue['SENT-BY'] )) + $attendee1 .= $this->intAttrDelimiter.'SENT-BY="'.$paramvalue['SENT-BY'].'"'; + if( isset( $paramvalue['CN'] )) + $attendee1 .= $this->intAttrDelimiter.'CN="'.$paramvalue['CN'].'"'; + if( isset( $paramvalue['DIR'] )) + $attendee1 .= $this->intAttrDelimiter.'DIR="'.$paramvalue['DIR'].'"'; + if( isset( $paramvalue['LANGUAGE'] )) + $attendee1 .= $this->intAttrDelimiter.'LANGUAGE='.$paramvalue['LANGUAGE']; + $xparams = array(); + foreach( $paramvalue as $optparamlabel => $optparamvalue ) { // start foreach 3 + if( ctype_digit( (string) $optparamlabel )) { + $xparams[] = $optparamvalue; + continue; + } + if( !in_array( $optparamlabel, array( 'CUTYPE', 'MEMBER', 'ROLE', 'PARTSTAT', 'RSVP', 'DELEGATED-TO', 'DELEGATED-FROM', 'SENT-BY', 'CN', 'DIR', 'LANGUAGE' ))) + $xparams[$optparamlabel] = $optparamvalue; + } // end foreach 3 + ksort( $xparams, SORT_STRING ); + foreach( $xparams as $paramKey => $paramValue ) { + if( ctype_digit( (string) $paramKey )) + $attendee1 .= $this->intAttrDelimiter.$paramValue; + else + $attendee1 .= $this->intAttrDelimiter."$paramKey=$paramValue"; + } // end foreach 3 + } // end elseif(( 'params' == $paramlabel ) && ( is_array( $paramvalue ))) + } // end foreach 2 + $output .= $this->_createElement( 'ATTENDEE', $attendee1, $attendee2 ); + } // end foreach 1 + return $output; + } +/** + * set calendar component property attach + * + * @author Kjell-Inge Gustafsson + * @since 2.6.34 - 2010-12-18 + * @param string $value + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setAttendee( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + // ftp://, http://, mailto:, file://, gopher://, news:, nntp://, telnet://, wais://, prospero:// may exist.. . also in params + if( FALSE !== ( $pos = strpos( substr( $value, 0, 9 ), ':' ))) + $value = strtoupper( substr( $value, 0, $pos )).substr( $value, $pos ); + elseif( !empty( $value )) + $value = 'MAILTO:'.$value; + $params2 = array(); + if( is_array($params )) { + $optarrays = array(); + foreach( $params as $optparamlabel => $optparamvalue ) { + $optparamlabel = strtoupper( $optparamlabel ); + switch( $optparamlabel ) { + case 'MEMBER': + case 'DELEGATED-TO': + case 'DELEGATED-FROM': + if( !is_array( $optparamvalue )) + $optparamvalue = array( $optparamvalue ); + foreach( $optparamvalue as $part ) { + $part = trim( $part ); + if(( '"' == substr( $part, 0, 1 )) && + ( '"' == substr( $part, -1 ))) + $part = substr( $part, 1, ( strlen( $part ) - 2 )); + if( 'mailto:' != strtolower( substr( $part, 0, 7 ))) + $part = "MAILTO:$part"; + else + $part = 'MAILTO:'.substr( $part, 7 ); + $optarrays[$optparamlabel][] = $part; + } + break; + default: + if(( '"' == substr( $optparamvalue, 0, 1 )) && + ( '"' == substr( $optparamvalue, -1 ))) + $optparamvalue = substr( $optparamvalue, 1, ( strlen( $optparamvalue ) - 2 )); + if( 'SENT-BY' == $optparamlabel ) { + if( 'mailto:' != strtolower( substr( $optparamvalue, 0, 7 ))) + $optparamvalue = "MAILTO:$optparamvalue"; + else + $optparamvalue = 'MAILTO:'.substr( $optparamvalue, 7 ); + } + $params2[$optparamlabel] = $optparamvalue; + break; + } // end switch( $optparamlabel.. . + } // end foreach( $optparam.. . + foreach( $optarrays as $optparamlabel => $optparams ) + $params2[$optparamlabel] = $optparams; + } + // remove defaults + iCalUtilityFunctions::_existRem( $params2, 'CUTYPE', 'INDIVIDUAL' ); + iCalUtilityFunctions::_existRem( $params2, 'PARTSTAT', 'NEEDS-ACTION' ); + iCalUtilityFunctions::_existRem( $params2, 'ROLE', 'REQ-PARTICIPANT' ); + iCalUtilityFunctions::_existRem( $params2, 'RSVP', 'FALSE' ); + // check language setting + if( isset( $params2['CN' ] )) { + $lang = $this->getConfig( 'language' ); + if( !isset( $params2['LANGUAGE' ] ) && !empty( $lang )) + $params2['LANGUAGE' ] = $lang; + } + iCalUtilityFunctions::_setMval( $this->attendee, $value, $params2, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: CATEGORIES + */ +/** + * creates formatted output for calendar component property categories + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createCategories() { + if( empty( $this->categories )) return FALSE; + $output = null; + foreach( $this->categories as $category ) { + if( empty( $category['value'] )) { + if ( $this->getConfig( 'allowEmpty' )) + $output .= $this->_createElement( 'CATEGORIES' ); + continue; + } + $attributes = $this->_createParams( $category['params'], array( 'LANGUAGE' )); + if( is_array( $category['value'] )) { + foreach( $category['value'] as $cix => $categoryPart ) + $category['value'][$cix] = $this->_strrep( $categoryPart ); + $content = implode( ',', $category['value'] ); + } + else + $content = $this->_strrep( $category['value'] ); + $output .= $this->_createElement( 'CATEGORIES', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property categories + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-06 + * @param mixed $value + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setCategories( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->categories, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: CLASS + */ +/** + * creates formatted output for calendar component property class + * + * @author Kjell-Inge Gustafsson + * @since 0.9.7 - 2006-11-20 + * @return string + */ + function createClass() { + if( empty( $this->class )) return FALSE; + if( empty( $this->class['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'CLASS' ) : FALSE; + $attributes = $this->_createParams( $this->class['params'] ); + return $this->_createElement( 'CLASS', $attributes, $this->class['value'] ); + } +/** + * set calendar component property class + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token / x-name + * @param array $params optional + * @return bool + */ + function setClass( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->class = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: COMMENT + */ +/** + * creates formatted output for calendar component property comment + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createComment() { + if( empty( $this->comment )) return FALSE; + $output = null; + foreach( $this->comment as $commentPart ) { + if( empty( $commentPart['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'COMMENT' ); + continue; + } + $attributes = $this->_createParams( $commentPart['params'], array( 'ALTREP', 'LANGUAGE' )); + $content = $this->_strrep( $commentPart['value'] ); + $output .= $this->_createElement( 'COMMENT', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property comment + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-06 + * @param string $value + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setComment( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->comment, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: COMPLETED + */ +/** + * creates formatted output for calendar component property completed + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createCompleted( ) { + if( empty( $this->completed )) return FALSE; + if( !isset( $this->completed['value']['year'] ) && + !isset( $this->completed['value']['month'] ) && + !isset( $this->completed['value']['day'] ) && + !isset( $this->completed['value']['hour'] ) && + !isset( $this->completed['value']['min'] ) && + !isset( $this->completed['value']['sec'] )) + if( $this->getConfig( 'allowEmpty' )) + return $this->_createElement( 'COMPLETED' ); + else return FALSE; + $formatted = iCalUtilityFunctions::_format_date_time( $this->completed['value'], 7 ); + $attributes = $this->_createParams( $this->completed['params'] ); + return $this->_createElement( 'COMPLETED', $attributes, $formatted ); + } +/** + * set calendar component property completed + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param array $params optional + * @return bool + */ + function setCompleted( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { + if( empty( $year )) { + if( $this->getConfig( 'allowEmpty' )) { + $this->completed = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } + else + return FALSE; + } + $this->completed = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: CONTACT + */ +/** + * creates formatted output for calendar component property contact + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @return string + */ + function createContact() { + if( empty( $this->contact )) return FALSE; + $output = null; + foreach( $this->contact as $contact ) { + if( !empty( $contact['value'] )) { + $attributes = $this->_createParams( $contact['params'], array( 'ALTREP', 'LANGUAGE' )); + $content = $this->_strrep( $contact['value'] ); + $output .= $this->_createElement( 'CONTACT', $attributes, $content ); + } + elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'CONTACT' ); + } + return $output; + } +/** + * set calendar component property contact + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param string $value + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setContact( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->contact, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: CREATED + */ +/** + * creates formatted output for calendar component property created + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createCreated() { + if( empty( $this->created )) return FALSE; + $formatted = iCalUtilityFunctions::_format_date_time( $this->created['value'], 7 ); + $attributes = $this->_createParams( $this->created['params'] ); + return $this->_createElement( 'CREATED', $attributes, $formatted ); + } +/** + * set calendar component property created + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @param mixed $year optional + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param mixed $params optional + * @return bool + */ + function setCreated( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { + if( !isset( $year )) { + $year = date('Ymd\THis', mktime( date( 'H' ), date( 'i' ), date( 's' ) - date( 'Z'), date( 'm' ), date( 'd' ), date( 'Y' ))); + } + $this->created = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: DESCRIPTION + */ +/** + * creates formatted output for calendar component property description + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createDescription() { + if( empty( $this->description )) return FALSE; + $output = null; + foreach( $this->description as $description ) { + if( !empty( $description['value'] )) { + $attributes = $this->_createParams( $description['params'], array( 'ALTREP', 'LANGUAGE' )); + $content = $this->_strrep( $description['value'] ); + $output .= $this->_createElement( 'DESCRIPTION', $attributes, $content ); + } + elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'DESCRIPTION' ); + } + return $output; + } +/** + * set calendar component property description + * + * @author Kjell-Inge Gustafsson + * @since 2.6.24 - 2010-11-06 + * @param string $value + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setDescription( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) { if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; } + if( 'vjournal' != $this->objName ) + $index = 1; + iCalUtilityFunctions::_setMval( $this->description, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: DTEND + */ +/** + * creates formatted output for calendar component property dtend + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createDtend() { + if( empty( $this->dtend )) return FALSE; + if( !isset( $this->dtend['value']['year'] ) && + !isset( $this->dtend['value']['month'] ) && + !isset( $this->dtend['value']['day'] ) && + !isset( $this->dtend['value']['hour'] ) && + !isset( $this->dtend['value']['min'] ) && + !isset( $this->dtend['value']['sec'] )) + if( $this->getConfig( 'allowEmpty' )) + return $this->_createElement( 'DTEND' ); + else return FALSE; + $formatted = iCalUtilityFunctions::_format_date_time( $this->dtend['value'] ); + $attributes = $this->_createParams( $this->dtend['params'] ); + return $this->_createElement( 'DTEND', $attributes, $formatted ); + } +/** + * set calendar component property dtend + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param string $tz optional + * @param array params optional + * @return bool + */ + function setDtend( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { + if( empty( $year )) { + if( $this->getConfig( 'allowEmpty' )) { + $this->dtend = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } + else + return FALSE; + } + $this->dtend = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: DTSTAMP + */ +/** + * creates formatted output for calendar component property dtstamp + * + * @author Kjell-Inge Gustafsson + * @since 2.4.4 - 2008-03-07 + * @return string + */ + function createDtstamp() { + if( !isset( $this->dtstamp['value']['year'] ) && + !isset( $this->dtstamp['value']['month'] ) && + !isset( $this->dtstamp['value']['day'] ) && + !isset( $this->dtstamp['value']['hour'] ) && + !isset( $this->dtstamp['value']['min'] ) && + !isset( $this->dtstamp['value']['sec'] )) + $this->_makeDtstamp(); + $formatted = iCalUtilityFunctions::_format_date_time( $this->dtstamp['value'], 7 ); + $attributes = $this->_createParams( $this->dtstamp['params'] ); + return $this->_createElement( 'DTSTAMP', $attributes, $formatted ); + } +/** + * computes datestamp for calendar component object instance dtstamp + * + * @author Kjell-Inge Gustafsson + * @since 2.6.25 - 2010-11-09 + * @return void + */ + function _makeDtstamp() { + $d = mktime( date('H'), date('m'), (date('s') - date( 'Z' )), date('m'), date('d'), date('Y')); + $this->dtstamp['value'] = array( 'year' => date( 'Y', $d ) + , 'month' => date( 'm', $d ) + , 'day' => date( 'd', $d ) + , 'hour' => date( 'H', $d ) + , 'min' => date( 'i', $d ) + , 'sec' => date( 's', $d )); + $this->dtstamp['params'] = null; + } +/** + * set calendar component property dtstamp + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param array $params optional + * @return TRUE + */ + function setDtstamp( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { + if( empty( $year )) + $this->_makeDtstamp(); + else + $this->dtstamp = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: DTSTART + */ +/** + * creates formatted output for calendar component property dtstart + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-26 + * @return string + */ + function createDtstart() { + if( empty( $this->dtstart )) return FALSE; + if( !isset( $this->dtstart['value']['year'] ) && + !isset( $this->dtstart['value']['month'] ) && + !isset( $this->dtstart['value']['day'] ) && + !isset( $this->dtstart['value']['hour'] ) && + !isset( $this->dtstart['value']['min'] ) && + !isset( $this->dtstart['value']['sec'] )) + if( $this->getConfig( 'allowEmpty' )) + return $this->_createElement( 'DTSTART' ); + else return FALSE; + if( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) + unset( $this->dtstart['value']['tz'], $this->dtstart['params']['TZID'] ); + $formatted = iCalUtilityFunctions::_format_date_time( $this->dtstart['value'] ); + $attributes = $this->_createParams( $this->dtstart['params'] ); + return $this->_createElement( 'DTSTART', $attributes, $formatted ); + } +/** + * set calendar component property dtstart + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-09-22 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param string $tz optional + * @param array $params optional + * @return bool + */ + function setDtstart( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { + if( empty( $year )) { + if( $this->getConfig( 'allowEmpty' )) { + $this->dtstart = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } + else + return FALSE; + } + $this->dtstart = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params, 'dtstart', $this->objName ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: DUE + */ +/** + * creates formatted output for calendar component property due + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createDue() { + if( empty( $this->due )) return FALSE; + if( !isset( $this->due['value']['year'] ) && + !isset( $this->due['value']['month'] ) && + !isset( $this->due['value']['day'] ) && + !isset( $this->due['value']['hour'] ) && + !isset( $this->due['value']['min'] ) && + !isset( $this->due['value']['sec'] )) + if( $this->getConfig( 'allowEmpty' )) + return $this->_createElement( 'DUE' ); + else return FALSE; + $formatted = iCalUtilityFunctions::_format_date_time( $this->due['value'] ); + $attributes = $this->_createParams( $this->due['params'] ); + return $this->_createElement( 'DUE', $attributes, $formatted ); + } +/** + * set calendar component property due + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param array $params optional + * @return bool + */ + function setDue( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { + if( empty( $year )) { + if( $this->getConfig( 'allowEmpty' )) { + $this->due = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } + else + return FALSE; + } + $this->due = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: DURATION + */ +/** + * creates formatted output for calendar component property duration + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createDuration() { + if( empty( $this->duration )) return FALSE; + if( !isset( $this->duration['value']['week'] ) && + !isset( $this->duration['value']['day'] ) && + !isset( $this->duration['value']['hour'] ) && + !isset( $this->duration['value']['min'] ) && + !isset( $this->duration['value']['sec'] )) + if( $this->getConfig( 'allowEmpty' )) + return $this->_createElement( 'DURATION', array(), null ); + else return FALSE; + $attributes = $this->_createParams( $this->duration['params'] ); + return $this->_createElement( 'DURATION', $attributes, iCalUtilityFunctions::_format_duration( $this->duration['value'] )); + } +/** + * set calendar component property duration + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param mixed $week + * @param mixed $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param array $params optional + * @return bool + */ + function setDuration( $week, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { + if( empty( $week )) if( $this->getConfig( 'allowEmpty' )) $week = null; else return FALSE; + if( is_array( $week ) && ( 1 <= count( $week ))) + $this->duration = array( 'value' => iCalUtilityFunctions::_duration_array( $week ), 'params' => iCalUtilityFunctions::_setParams( $day )); + elseif( is_string( $week ) && ( 3 <= strlen( trim( $week )))) { + $week = trim( $week ); + if( in_array( substr( $week, 0, 1 ), array( '+', '-' ))) + $week = substr( $week, 1 ); + $this->duration = array( 'value' => iCalUtilityFunctions::_duration_string( $week ), 'params' => iCalUtilityFunctions::_setParams( $day )); + } + elseif( empty( $week ) && empty( $day ) && empty( $hour ) && empty( $min ) && empty( $sec )) + return FALSE; + else + $this->duration = array( 'value' => iCalUtilityFunctions::_duration_array( array( $week, $day, $hour, $min, $sec )), 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: EXDATE + */ +/** + * creates formatted output for calendar component property exdate + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createExdate() { + if( empty( $this->exdate )) return FALSE; + $output = null; + foreach( $this->exdate as $ex => $theExdate ) { + if( empty( $theExdate['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'EXDATE' ); + continue; + } + $content = $attributes = null; + foreach( $theExdate['value'] as $eix => $exdatePart ) { + $parno = count( $exdatePart ); + $formatted = iCalUtilityFunctions::_format_date_time( $exdatePart, $parno ); + if( isset( $theExdate['params']['TZID'] )) + $formatted = str_replace( 'Z', '', $formatted); + if( 0 < $eix ) { + if( isset( $theExdate['value'][0]['tz'] )) { + if( ctype_digit( substr( $theExdate['value'][0]['tz'], -4 )) || + ( 'Z' == $theExdate['value'][0]['tz'] )) { + if( 'Z' != substr( $formatted, -1 )) + $formatted .= 'Z'; + } + else + $formatted = str_replace( 'Z', '', $formatted ); + } + else + $formatted = str_replace( 'Z', '', $formatted ); + } + $content .= ( 0 < $eix ) ? ','.$formatted : $formatted; + } + $attributes .= $this->_createParams( $theExdate['params'] ); + $output .= $this->_createElement( 'EXDATE', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property exdate + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param array exdates + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setExdate( $exdates, $params=FALSE, $index=FALSE ) { + if( empty( $exdates )) { + if( $this->getConfig( 'allowEmpty' )) { + iCalUtilityFunctions::_setMval( $this->exdate, null, $params, FALSE, $index ); + return TRUE; + } + else + return FALSE; + } + $input = array( 'params' => iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' ))); + /* ev. check 1:st date and save ev. timezone **/ + iCalUtilityFunctions::_chkdatecfg( reset( $exdates ), $parno, $input['params'] ); + iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME' ); // remove default parameter + foreach( $exdates as $eix => $theExdate ) { + if( iCalUtilityFunctions::_isArrayTimestampDate( $theExdate )) + $exdatea = iCalUtilityFunctions::_timestamp2date( $theExdate, $parno ); + elseif( is_array( $theExdate )) + $exdatea = iCalUtilityFunctions::_date_time_array( $theExdate, $parno ); + elseif( 8 <= strlen( trim( $theExdate ))) // ex. 2006-08-03 10:12:18 + $exdatea = iCalUtilityFunctions::_date_time_string( $theExdate, $parno ); + if( 3 == $parno ) + unset( $exdatea['hour'], $exdatea['min'], $exdatea['sec'], $exdatea['tz'] ); + elseif( isset( $exdatea['tz'] )) + $exdatea['tz'] = (string) $exdatea['tz']; + if( isset( $input['params']['TZID'] ) || + ( isset( $exdatea['tz'] ) && !iCalUtilityFunctions::_isOffset( $exdatea['tz'] )) || + ( isset( $input['value'][0] ) && ( !isset( $input['value'][0]['tz'] ))) || + ( isset( $input['value'][0]['tz'] ) && !iCalUtilityFunctions::_isOffset( $input['value'][0]['tz'] ))) + unset( $exdatea['tz'] ); + $input['value'][] = $exdatea; + } + if( 0 >= count( $input['value'] )) + return FALSE; + if( 3 == $parno ) { + $input['params']['VALUE'] = 'DATE'; + unset( $input['params']['TZID'] ); + } + iCalUtilityFunctions::_setMval( $this->exdate, $input['value'], $input['params'], FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: EXRULE + */ +/** + * creates formatted output for calendar component property exrule + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createExrule() { + if( empty( $this->exrule )) return FALSE; + return $this->_format_recur( 'EXRULE', $this->exrule ); + } +/** + * set calendar component property exdate + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param array $exruleset + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setExrule( $exruleset, $params=FALSE, $index=FALSE ) { + if( empty( $exruleset )) if( $this->getConfig( 'allowEmpty' )) $exruleset = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->exrule, iCalUtilityFunctions::_setRexrule( $exruleset ), $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: FREEBUSY + */ +/** + * creates formatted output for calendar component property freebusy + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createFreebusy() { + if( empty( $this->freebusy )) return FALSE; + $output = null; + foreach( $this->freebusy as $freebusyPart ) { + if( empty( $freebusyPart['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'FREEBUSY' ); + continue; + } + $attributes = $content = null; + if( isset( $freebusyPart['value']['fbtype'] )) { + $attributes .= $this->intAttrDelimiter.'FBTYPE='.$freebusyPart['value']['fbtype']; + unset( $freebusyPart['value']['fbtype'] ); + $freebusyPart['value'] = array_values( $freebusyPart['value'] ); + } + else + $attributes .= $this->intAttrDelimiter.'FBTYPE=BUSY'; + $attributes .= $this->_createParams( $freebusyPart['params'] ); + $fno = 1; + $cnt = count( $freebusyPart['value']); + foreach( $freebusyPart['value'] as $periodix => $freebusyPeriod ) { + $formatted = iCalUtilityFunctions::_format_date_time( $freebusyPeriod[0] ); + $content .= $formatted; + $content .= '/'; + $cnt2 = count( $freebusyPeriod[1]); + if( array_key_exists( 'year', $freebusyPeriod[1] )) // date-time + $cnt2 = 7; + elseif( array_key_exists( 'week', $freebusyPeriod[1] )) // duration + $cnt2 = 5; + if(( 7 == $cnt2 ) && // period= -> date-time + isset( $freebusyPeriod[1]['year'] ) && + isset( $freebusyPeriod[1]['month'] ) && + isset( $freebusyPeriod[1]['day'] )) { + $content .= iCalUtilityFunctions::_format_date_time( $freebusyPeriod[1] ); + } + else { // period= -> dur-time + $content .= iCalUtilityFunctions::_format_duration( $freebusyPeriod[1] ); + } + if( $fno < $cnt ) + $content .= ','; + $fno++; + } + $output .= $this->_createElement( 'FREEBUSY', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property freebusy + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param string $fbType + * @param array $fbValues + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setFreebusy( $fbType, $fbValues, $params=FALSE, $index=FALSE ) { + if( empty( $fbValues )) { + if( $this->getConfig( 'allowEmpty' )) { + iCalUtilityFunctions::_setMval( $this->freebusy, null, $params, FALSE, $index ); + return TRUE; + } + else + return FALSE; + } + $fbType = strtoupper( $fbType ); + if(( !in_array( $fbType, array( 'FREE', 'BUSY', 'BUSY-UNAVAILABLE', 'BUSY-TENTATIVE' ))) && + ( 'X-' != substr( $fbType, 0, 2 ))) + $fbType = 'BUSY'; + $input = array( 'fbtype' => $fbType ); + foreach( $fbValues as $fbPeriod ) { // periods => period + $freebusyPeriod = array(); + foreach( $fbPeriod as $fbMember ) { // pairs => singlepart + $freebusyPairMember = array(); + if( is_array( $fbMember )) { + if( iCalUtilityFunctions::_isArrayDate( $fbMember )) { // date-time value + $freebusyPairMember = iCalUtilityFunctions::_date_time_array( $fbMember, 7 ); + $freebusyPairMember['tz'] = 'Z'; + } + elseif( iCalUtilityFunctions::_isArrayTimestampDate( $fbMember )) { // timestamp value + $freebusyPairMember = iCalUtilityFunctions::_timestamp2date( $fbMember['timestamp'], 7 ); + $freebusyPairMember['tz'] = 'Z'; + } + else { // array format duration + $freebusyPairMember = iCalUtilityFunctions::_duration_array( $fbMember ); + } + } + elseif(( 3 <= strlen( trim( $fbMember ))) && // string format duration + ( in_array( $fbMember{0}, array( 'P', '+', '-' )))) { + if( 'P' != $fbMember{0} ) + $fbmember = substr( $fbMember, 1 ); + $freebusyPairMember = iCalUtilityFunctions::_duration_string( $fbMember ); + } + elseif( 8 <= strlen( trim( $fbMember ))) { // text date ex. 2006-08-03 10:12:18 + $freebusyPairMember = iCalUtilityFunctions::_date_time_string( $fbMember, 7 ); + $freebusyPairMember['tz'] = 'Z'; + } + $freebusyPeriod[] = $freebusyPairMember; + } + $input[] = $freebusyPeriod; + } + iCalUtilityFunctions::_setMval( $this->freebusy, $input, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: GEO + */ +/** + * creates formatted output for calendar component property geo + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createGeo() { + if( empty( $this->geo )) return FALSE; + if( empty( $this->geo['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'GEO' ) : FALSE; + $attributes = $this->_createParams( $this->geo['params'] ); + $content = null; + $content .= number_format( (float) $this->geo['value']['latitude'], 6, '.', ''); + $content .= ';'; + $content .= number_format( (float) $this->geo['value']['longitude'], 6, '.', ''); + return $this->_createElement( 'GEO', $attributes, $content ); + } +/** + * set calendar component property geo + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param float $latitude + * @param float $longitude + * @param array $params optional + * @return bool + */ + function setGeo( $latitude, $longitude, $params=FALSE ) { + if( !empty( $latitude ) && !empty( $longitude )) { + if( !is_array( $this->geo )) $this->geo = array(); + $this->geo['value']['latitude'] = $latitude; + $this->geo['value']['longitude'] = $longitude; + $this->geo['params'] = iCalUtilityFunctions::_setParams( $params ); + } + elseif( $this->getConfig( 'allowEmpty' )) + $this->geo = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ) ); + else + return FALSE; + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: LAST-MODIFIED + */ +/** + * creates formatted output for calendar component property last-modified + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createLastModified() { + if( empty( $this->lastmodified )) return FALSE; + $attributes = $this->_createParams( $this->lastmodified['params'] ); + $formatted = iCalUtilityFunctions::_format_date_time( $this->lastmodified['value'], 7 ); + return $this->_createElement( 'LAST-MODIFIED', $attributes, $formatted ); + } +/** + * set calendar component property completed + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @param mixed $year optional + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param array $params optional + * @return boll + */ + function setLastModified( $year=FALSE, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $params=FALSE ) { + if( empty( $year )) + $year = date('Ymd\THis', mktime( date( 'H' ), date( 'i' ), date( 's' ) - date( 'Z'), date( 'm' ), date( 'd' ), date( 'Y' ))); + $this->lastmodified = iCalUtilityFunctions::_setDate2( $year, $month, $day, $hour, $min, $sec, $params ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: LOCATION + */ +/** + * creates formatted output for calendar component property location + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createLocation() { + if( empty( $this->location )) return FALSE; + if( empty( $this->location['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'LOCATION' ) : FALSE; + $attributes = $this->_createParams( $this->location['params'], array( 'ALTREP', 'LANGUAGE' )); + $content = $this->_strrep( $this->location['value'] ); + return $this->_createElement( 'LOCATION', $attributes, $content ); + } +/** + * set calendar component property location + ' + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param array params optional + * @return bool + */ + function setLocation( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->location = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: ORGANIZER + */ +/** + * creates formatted output for calendar component property organizer + * + * @author Kjell-Inge Gustafsson + * @since 2.6.33 - 2010-12-17 + * @return string + */ + function createOrganizer() { + if( empty( $this->organizer )) return FALSE; + if( empty( $this->organizer['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'ORGANIZER' ) : FALSE; + $attributes = $this->_createParams( $this->organizer['params'] + , array( 'CN', 'DIR', 'SENT-BY', 'LANGUAGE' )); + return $this->_createElement( 'ORGANIZER', $attributes, $this->organizer['value'] ); + } +/** + * set calendar component property organizer + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-29 + * @param string $value + * @param array params optional + * @return bool + */ + function setOrganizer( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + if( FALSE === ( $pos = strpos( substr( $value, 0, 9 ), ':' ))) + $value = 'MAILTO:'.$value; + else + $value = strtolower( substr( $value, 0, $pos )).substr( $value, $pos ); + $value = str_replace( 'mailto:', 'MAILTO:', $value ); + $this->organizer = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + if( isset( $this->organizer['params']['SENT-BY'] )){ + if( 'mailto:' !== strtolower( substr( $this->organizer['params']['SENT-BY'], 0, 7 ))) + $this->organizer['params']['SENT-BY'] = 'MAILTO:'.$this->organizer['params']['SENT-BY']; + else + $this->organizer['params']['SENT-BY'] = 'MAILTO:'.substr( $this->organizer['params']['SENT-BY'], 7 ); + } + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: PERCENT-COMPLETE + */ +/** + * creates formatted output for calendar component property percent-complete + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @return string + */ + function createPercentComplete() { + if( empty( $this->percentcomplete )) return FALSE; + if( empty( $this->percentcomplete['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'PERCENT-COMPLETE' ) : FALSE; + $attributes = $this->_createParams( $this->percentcomplete['params'] ); + return $this->_createElement( 'PERCENT-COMPLETE', $attributes, $this->percentcomplete['value'] ); + } +/** + * set calendar component property percent-complete + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param int $value + * @param array $params optional + * @return bool + */ + function setPercentComplete( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->percentcomplete = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: PRIORITY + */ +/** + * creates formatted output for calendar component property priority + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createPriority() { + if( empty( $this->priority )) return FALSE; + if( empty( $this->priority['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'PRIORITY' ) : FALSE; + $attributes = $this->_createParams( $this->priority['params'] ); + return $this->_createElement( 'PRIORITY', $attributes, $this->priority['value'] ); + } +/** + * set calendar component property priority + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param int $value + * @param array $params optional + * @return bool + */ + function setPriority( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->priority = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: RDATE + */ +/** + * creates formatted output for calendar component property rdate + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-26 + * @return string + */ + function createRdate() { + if( empty( $this->rdate )) return FALSE; + $utctime = ( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) ? TRUE : FALSE; + $output = null; + if( $utctime ) + unset( $this->rdate['params']['TZID'] ); + foreach( $this->rdate as $theRdate ) { + if( empty( $theRdate['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RDATE' ); + continue; + } + if( $utctime ) + unset( $theRdate['params']['TZID'] ); + $attributes = $this->_createParams( $theRdate['params'] ); + $cnt = count( $theRdate['value'] ); + $content = null; + $rno = 1; + foreach( $theRdate['value'] as $rpix => $rdatePart ) { + $contentPart = null; + if( is_array( $rdatePart ) && + isset( $theRdate['params']['VALUE'] ) && ( 'PERIOD' == $theRdate['params']['VALUE'] )) { // PERIOD + if( $utctime ) + unset( $rdatePart[0]['tz'] ); + $formatted = iCalUtilityFunctions::_format_date_time( $rdatePart[0]); // PERIOD part 1 + if( $utctime || !empty( $theRdate['params']['TZID'] )) + $formatted = str_replace( 'Z', '', $formatted); + if( 0 < $rpix ) { + if( !empty( $rdatePart[0]['tz'] ) && iCalUtilityFunctions::_isOffset( $rdatePart[0]['tz'] )) { + if( 'Z' != substr( $formatted, -1 )) $formatted .= 'Z'; + } + else + $formatted = str_replace( 'Z', '', $formatted ); + } + $contentPart .= $formatted; + $contentPart .= '/'; + $cnt2 = count( $rdatePart[1]); + if( array_key_exists( 'year', $rdatePart[1] )) { + if( array_key_exists( 'hour', $rdatePart[1] )) + $cnt2 = 7; // date-time + else + $cnt2 = 3; // date + } + elseif( array_key_exists( 'week', $rdatePart[1] )) // duration + $cnt2 = 5; + if(( 7 == $cnt2 ) && // period= -> date-time + isset( $rdatePart[1]['year'] ) && + isset( $rdatePart[1]['month'] ) && + isset( $rdatePart[1]['day'] )) { + if( $utctime ) + unset( $rdatePart[1]['tz'] ); + $formatted = iCalUtilityFunctions::_format_date_time( $rdatePart[1] ); // PERIOD part 2 + if( $utctime || !empty( $theRdate['params']['TZID'] )) + $formatted = str_replace( 'Z', '', $formatted); + if( !empty( $rdatePart[0]['tz'] ) && iCalUtilityFunctions::_isOffset( $rdatePart[0]['tz'] )) { + if( 'Z' != substr( $formatted, -1 )) $formatted .= 'Z'; + } + else + $formatted = str_replace( 'Z', '', $formatted ); + $contentPart .= $formatted; + } + else { // period= -> dur-time + $contentPart .= iCalUtilityFunctions::_format_duration( $rdatePart[1] ); + } + } // PERIOD end + else { // SINGLE date start + if( $utctime ) + unset( $rdatePart['tz'] ); + $formatted = iCalUtilityFunctions::_format_date_time( $rdatePart); + if( $utctime || !empty( $theRdate['params']['TZID'] )) + $formatted = str_replace( 'Z', '', $formatted); + if( !$utctime && ( 0 < $rpix )) { + if( !empty( $theRdate['value'][0]['tz'] ) && iCalUtilityFunctions::_isOffset( $theRdate['value'][0]['tz'] )) { + if( 'Z' != substr( $formatted, -1 )) + $formatted .= 'Z'; + } + else + $formatted = str_replace( 'Z', '', $formatted ); + } + $contentPart .= $formatted; + } + $content .= $contentPart; + if( $rno < $cnt ) + $content .= ','; + $rno++; + } + $output .= $this->_createElement( 'RDATE', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property rdate + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-07 + * @param array $rdates + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setRdate( $rdates, $params=FALSE, $index=FALSE ) { + if( empty( $rdates )) { + if( $this->getConfig( 'allowEmpty' )) { + iCalUtilityFunctions::_setMval( $this->rdate, null, $params, FALSE, $index ); + return TRUE; + } + else + return FALSE; + } + $input = array( 'params' => iCalUtilityFunctions::_setParams( $params, array( 'VALUE' => 'DATE-TIME' ))); + if( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) { + unset( $input['params']['TZID'] ); + $input['params']['VALUE'] = 'DATE-TIME'; + } + /* check if PERIOD, if not set */ + if((!isset( $input['params']['VALUE'] ) || !in_array( $input['params']['VALUE'], array( 'DATE', 'PERIOD' ))) && + isset( $rdates[0] ) && is_array( $rdates[0] ) && ( 2 == count( $rdates[0] )) && + isset( $rdates[0][0] ) && isset( $rdates[0][1] ) && !isset( $rdates[0]['timestamp'] ) && + (( is_array( $rdates[0][0] ) && ( isset( $rdates[0][0]['timestamp'] ) || + iCalUtilityFunctions::_isArrayDate( $rdates[0][0] ))) || + ( is_string( $rdates[0][0] ) && ( 8 <= strlen( trim( $rdates[0][0] ))))) && + ( is_array( $rdates[0][1] ) || ( is_string( $rdates[0][1] ) && ( 3 <= strlen( trim( $rdates[0][1] )))))) + $input['params']['VALUE'] = 'PERIOD'; + /* check 1:st date, upd. $parno (opt) and save ev. timezone **/ + $date = reset( $rdates ); + if( isset( $input['params']['VALUE'] ) && ( 'PERIOD' == $input['params']['VALUE'] )) // PERIOD + $date = reset( $date ); + iCalUtilityFunctions::_chkdatecfg( $date, $parno, $input['params'] ); + if( in_array( $this->objName, array( 'vtimezone', 'standard', 'daylight' ))) + unset( $input['params']['TZID'] ); + iCalUtilityFunctions::_existRem( $input['params'], 'VALUE', 'DATE-TIME' ); // remove default + foreach( $rdates as $rpix => $theRdate ) { + $inputa = null; + if( is_array( $theRdate )) { + if( isset( $input['params']['VALUE'] ) && ( 'PERIOD' == $input['params']['VALUE'] )) { // PERIOD + foreach( $theRdate as $rix => $rPeriod ) { + if( is_array( $rPeriod )) { + if( iCalUtilityFunctions::_isArrayTimestampDate( $rPeriod )) // timestamp + $inputab = ( isset( $rPeriod['tz'] )) ? iCalUtilityFunctions::_timestamp2date( $rPeriod, $parno ) : iCalUtilityFunctions::_timestamp2date( $rPeriod, 6 ); + elseif( iCalUtilityFunctions::_isArrayDate( $rPeriod )) + $inputab = ( 3 < count ( $rPeriod )) ? iCalUtilityFunctions::_date_time_array( $rPeriod, $parno ) : iCalUtilityFunctions::_date_time_array( $rPeriod, 6 ); + elseif (( 1 == count( $rPeriod )) && ( 8 <= strlen( reset( $rPeriod )))) // text-date + $inputab = iCalUtilityFunctions::_date_time_string( reset( $rPeriod ), $parno ); + else // array format duration + $inputab = iCalUtilityFunctions::_duration_array( $rPeriod ); + } + elseif(( 3 <= strlen( trim( $rPeriod ))) && // string format duration + ( in_array( $rPeriod[0], array( 'P', '+', '-' )))) { + if( 'P' != $rPeriod[0] ) + $rPeriod = substr( $rPeriod, 1 ); + $inputab = iCalUtilityFunctions::_duration_string( $rPeriod ); + } + elseif( 8 <= strlen( trim( $rPeriod ))) // text date ex. 2006-08-03 10:12:18 + $inputab = iCalUtilityFunctions::_date_time_string( $rPeriod, $parno ); + if( isset( $input['params']['TZID'] ) || + ( isset( $inputab['tz'] ) && !iCalUtilityFunctions::_isOffset( $inputab['tz'] )) || + ( isset( $inputa[0] ) && ( !isset( $inputa[0]['tz'] ))) || + ( isset( $inputa[0]['tz'] ) && !iCalUtilityFunctions::_isOffset( $inputa[0]['tz'] ))) + unset( $inputab['tz'] ); + $inputa[] = $inputab; + } + } // PERIOD end + elseif ( iCalUtilityFunctions::_isArrayTimestampDate( $theRdate )) // timestamp + $inputa = iCalUtilityFunctions::_timestamp2date( $theRdate, $parno ); + else // date[-time] + $inputa = iCalUtilityFunctions::_date_time_array( $theRdate, $parno ); + } + elseif( 8 <= strlen( trim( $theRdate ))) // text date ex. 2006-08-03 10:12:18 + $inputa = iCalUtilityFunctions::_date_time_string( $theRdate, $parno ); + if( !isset( $input['params']['VALUE'] ) || ( 'PERIOD' != $input['params']['VALUE'] )) { // no PERIOD + if( 3 == $parno ) + unset( $inputa['hour'], $inputa['min'], $inputa['sec'], $inputa['tz'] ); + elseif( isset( $inputa['tz'] )) + $inputa['tz'] = (string) $inputa['tz']; + if( isset( $input['params']['TZID'] ) || + ( isset( $inputa['tz'] ) && !iCalUtilityFunctions::_isOffset( $inputa['tz'] )) || + ( isset( $input['value'][0] ) && ( !isset( $input['value'][0]['tz'] ))) || + ( isset( $input['value'][0]['tz'] ) && !iCalUtilityFunctions::_isOffset( $input['value'][0]['tz'] ))) + unset( $inputa['tz'] ); + } + $input['value'][] = $inputa; + } + if( 3 == $parno ) { + $input['params']['VALUE'] = 'DATE'; + unset( $input['params']['TZID'] ); + } + iCalUtilityFunctions::_setMval( $this->rdate, $input['value'], $input['params'], FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: RECURRENCE-ID + */ +/** + * creates formatted output for calendar component property recurrence-id + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createRecurrenceid() { + if( empty( $this->recurrenceid )) return FALSE; + if( empty( $this->recurrenceid['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'RECURRENCE-ID' ) : FALSE; + $formatted = iCalUtilityFunctions::_format_date_time( $this->recurrenceid['value'] ); + $attributes = $this->_createParams( $this->recurrenceid['params'] ); + return $this->_createElement( 'RECURRENCE-ID', $attributes, $formatted ); + } +/** + * set calendar component property recurrence-id + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param array $params optional + * @return bool + */ + function setRecurrenceid( $year, $month=FALSE, $day=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $tz=FALSE, $params=FALSE ) { + if( empty( $year )) { + if( $this->getConfig( 'allowEmpty' )) { + $this->recurrenceid = array( 'value' => null, 'params' => null ); + return TRUE; + } + else + return FALSE; + } + $this->recurrenceid = iCalUtilityFunctions::_setDate( $year, $month, $day, $hour, $min, $sec, $tz, $params ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: RELATED-TO + */ +/** + * creates formatted output for calendar component property related-to + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @return string + */ + function createRelatedTo() { + if( empty( $this->relatedto )) return FALSE; + $output = null; + foreach( $this->relatedto as $relation ) { + if( empty( $relation['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output.= $this->_createElement( 'RELATED-TO', $this->_createParams( $relation['params'] )); + continue; + } + $attributes = $this->_createParams( $relation['params'] ); + $content = ( 'xcal' != $this->format ) ? '<' : ''; + $content .= $this->_strrep( $relation['value'] ); + $content .= ( 'xcal' != $this->format ) ? '>' : ''; + $output .= $this->_createElement( 'RELATED-TO', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property related-to + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-07 + * @param float $relid + * @param array $params, optional + * @param index $index, optional + * @return bool + */ + function setRelatedTo( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + if(( '<' == substr( $value, 0, 1 )) && ( '>' == substr( $value, -1 ))) + $value = substr( $value, 1, ( strlen( $value ) - 2 )); + iCalUtilityFunctions::_existRem( $params, 'RELTYPE', 'PARENT', TRUE ); // remove default + iCalUtilityFunctions::_setMval( $this->relatedto, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: REPEAT + */ +/** + * creates formatted output for calendar component property repeat + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createRepeat() { + if( empty( $this->repeat )) return FALSE; + if( empty( $this->repeat['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'REPEAT' ) : FALSE; + $attributes = $this->_createParams( $this->repeat['params'] ); + return $this->_createElement( 'REPEAT', $attributes, $this->repeat['value'] ); + } +/** + * set calendar component property transp + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param array $params optional + * @return void + */ + function setRepeat( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->repeat = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: REQUEST-STATUS + */ +/** + * creates formatted output for calendar component property request-status + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @return string + */ + function createRequestStatus() { + if( empty( $this->requeststatus )) return FALSE; + $output = null; + foreach( $this->requeststatus as $rstat ) { + if( empty( $rstat['value']['statcode'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'REQUEST-STATUS' ); + continue; + } + $attributes = $this->_createParams( $rstat['params'], array( 'LANGUAGE' )); + $content = number_format( (float) $rstat['value']['statcode'], 2, '.', ''); + $content .= ';'.$this->_strrep( $rstat['value']['text'] ); + if( isset( $rstat['value']['extdata'] )) + $content .= ';'.$this->_strrep( $rstat['value']['extdata'] ); + $output .= $this->_createElement( 'REQUEST-STATUS', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property request-status + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param float $statcode + * @param string $text + * @param string $extdata, optional + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setRequestStatus( $statcode, $text, $extdata=FALSE, $params=FALSE, $index=FALSE ) { + if( empty( $statcode ) || empty( $text )) if( $this->getConfig( 'allowEmpty' )) $statcode = $text = null; else return FALSE; + $input = array( 'statcode' => $statcode, 'text' => $text ); + if( $extdata ) + $input['extdata'] = $extdata; + iCalUtilityFunctions::_setMval( $this->requeststatus, $input, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: RESOURCES + */ +/** + * creates formatted output for calendar component property resources + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-23 + * @return string + */ + function createResources() { + if( empty( $this->resources )) return FALSE; + $output = null; + foreach( $this->resources as $resource ) { + if( empty( $resource['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'RESOURCES' ); + continue; + } + $attributes = $this->_createParams( $resource['params'], array( 'ALTREP', 'LANGUAGE' )); + if( is_array( $resource['value'] )) { + foreach( $resource['value'] as $rix => $resourcePart ) + $resource['value'][$rix] = $this->_strrep( $resourcePart ); + $content = implode( ',', $resource['value'] ); + } + else + $content = $this->_strrep( $resource['value'] ); + $output .= $this->_createElement( 'RESOURCES', $attributes, $content ); + } + return $output; + } +/** + * set calendar component property recources + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param mixed $value + * @param array $params, optional + * @param integer $index, optional + * @return bool + */ + function setResources( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->resources, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: RRULE + */ +/** + * creates formatted output for calendar component property rrule + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createRrule() { + if( empty( $this->rrule )) return FALSE; + return $this->_format_recur( 'RRULE', $this->rrule ); + } +/** + * set calendar component property rrule + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param array $rruleset + * @param array $params, optional + * @param integer $index, optional + * @return void + */ + function setRrule( $rruleset, $params=FALSE, $index=FALSE ) { + if( empty( $rruleset )) if( $this->getConfig( 'allowEmpty' )) $rruleset = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->rrule, iCalUtilityFunctions::_setRexrule( $rruleset ), $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: SEQUENCE + */ +/** + * creates formatted output for calendar component property sequence + * @author Kjell-Inge Gustafsson + * @since 2.6.9 - 2009-12-30 + * @return string + */ + function createSequence() { + if( empty( $this->sequence )) return FALSE; + if( empty( $this->sequence['value'] ) && ( '0' != $this->sequence['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'SEQUENCE' ) : FALSE; + $attributes = $this->_createParams( $this->sequence['params'] ); + return $this->_createElement( 'SEQUENCE', $attributes, $this->sequence['value'] ); + } +/** + * set calendar component property sequence + * @author Kjell-Inge Gustafsson + * @since 2.6.9 - 2009-12-30 + * @param int $value optional + * @param array $params optional + * @return bool + */ + function setSequence( $value=FALSE, $params=FALSE ) { + if( empty( $value ) && ( '0' != $value )) + $value = ( isset( $this->sequence['value'] ) && ( 0 < $this->sequence['value'] )) ? $this->sequence['value'] + 1 : 1; + $this->sequence = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: STATUS + */ +/** + * creates formatted output for calendar component property status + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createStatus() { + if( empty( $this->status )) return FALSE; + if( empty( $this->status['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'STATUS' ) : FALSE; + $attributes = $this->_createParams( $this->status['params'] ); + return $this->_createElement( 'STATUS', $attributes, $this->status['value'] ); + } +/** + * set calendar component property status + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param array $params optional + * @return bool + */ + function setStatus( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->status = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: SUMMARY + */ +/** + * creates formatted output for calendar component property summary + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createSummary() { + if( empty( $this->summary )) return FALSE; + if( empty( $this->summary['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'SUMMARY' ) : FALSE; + $attributes = $this->_createParams( $this->summary['params'], array( 'ALTREP', 'LANGUAGE' )); + $content = $this->_strrep( $this->summary['value'] ); + return $this->_createElement( 'SUMMARY', $attributes, $content ); + } +/** + * set calendar component property summary + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param string $params optional + * @return bool + */ + function setSummary( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->summary = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: TRANSP + */ +/** + * creates formatted output for calendar component property transp + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createTransp() { + if( empty( $this->transp )) return FALSE; + if( empty( $this->transp['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TRANSP' ) : FALSE; + $attributes = $this->_createParams( $this->transp['params'] ); + return $this->_createElement( 'TRANSP', $attributes, $this->transp['value'] ); + } +/** + * set calendar component property transp + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param string $params optional + * @return bool + */ + function setTransp( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->transp = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: TRIGGER + */ +/** + * creates formatted output for calendar component property trigger + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-10-21 + * @return string + */ + function createTrigger() { + if( empty( $this->trigger )) return FALSE; + if( empty( $this->trigger['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TRIGGER' ) : FALSE; + $content = $attributes = null; + if( isset( $this->trigger['value']['year'] ) && + isset( $this->trigger['value']['month'] ) && + isset( $this->trigger['value']['day'] )) + $content .= iCalUtilityFunctions::_format_date_time( $this->trigger['value'] ); + else { + if( TRUE !== $this->trigger['value']['relatedStart'] ) + $attributes .= $this->intAttrDelimiter.'RELATED=END'; + if( $this->trigger['value']['before'] ) + $content .= '-'; + $content .= iCalUtilityFunctions::_format_duration( $this->trigger['value'] ); + } + $attributes .= $this->_createParams( $this->trigger['params'] ); + return $this->_createElement( 'TRIGGER', $attributes, $content ); + } +/** + * set calendar component property trigger + * + * @author Kjell-Inge Gustafsson + * @since 2.4.16 - 2008-11-04 + * @param mixed $year + * @param mixed $month optional + * @param int $day optional + * @param int $week optional + * @param int $hour optional + * @param int $min optional + * @param int $sec optional + * @param bool $relatedStart optional + * @param bool $before optional + * @param array $params optional + * @return bool + */ + function setTrigger( $year, $month=null, $day=null, $week=FALSE, $hour=FALSE, $min=FALSE, $sec=FALSE, $relatedStart=TRUE, $before=TRUE, $params=FALSE ) { + if( empty( $year ) && empty( $month ) && empty( $day ) && empty( $week ) && empty( $hour ) && empty( $min ) && empty( $sec )) + if( $this->getConfig( 'allowEmpty' )) { + $this->trigger = array( 'value' => null, 'params' => iCalUtilityFunctions::_setParams( $params ) ); + return TRUE; + } + else + return FALSE; + if( iCalUtilityFunctions::_isArrayTimestampDate( $year )) { // timestamp + $params = iCalUtilityFunctions::_setParams( $month ); + $date = iCalUtilityFunctions::_timestamp2date( $year, 7 ); + foreach( $date as $k => $v ) + $$k = $v; + } + elseif( is_array( $year ) && ( is_array( $month ) || empty( $month ))) { + $params = iCalUtilityFunctions::_setParams( $month ); + if(!(array_key_exists( 'year', $year ) && // exclude date-time + array_key_exists( 'month', $year ) && + array_key_exists( 'day', $year ))) { // so this must be a duration + if( isset( $params['RELATED'] ) && ( 'END' == $params['RELATED'] )) + $relatedStart = FALSE; + else + $relatedStart = ( array_key_exists( 'relatedStart', $year ) && ( TRUE !== $year['relatedStart'] )) ? FALSE : TRUE; + $before = ( array_key_exists( 'before', $year ) && ( TRUE !== $year['before'] )) ? FALSE : TRUE; + } + $SSYY = ( array_key_exists( 'year', $year )) ? $year['year'] : null; + $month = ( array_key_exists( 'month', $year )) ? $year['month'] : null; + $day = ( array_key_exists( 'day', $year )) ? $year['day'] : null; + $week = ( array_key_exists( 'week', $year )) ? $year['week'] : null; + $hour = ( array_key_exists( 'hour', $year )) ? $year['hour'] : 0; //null; + $min = ( array_key_exists( 'min', $year )) ? $year['min'] : 0; //null; + $sec = ( array_key_exists( 'sec', $year )) ? $year['sec'] : 0; //null; + $year = $SSYY; + } + elseif(is_string( $year ) && ( is_array( $month ) || empty( $month ))) { // duration or date in a string + $params = iCalUtilityFunctions::_setParams( $month ); + if( in_array( $year{0}, array( 'P', '+', '-' ))) { // duration + $relatedStart = ( isset( $params['RELATED'] ) && ( 'END' == $params['RELATED'] )) ? FALSE : TRUE; + $before = ( '-' == $year{0} ) ? TRUE : FALSE; + if( 'P' != $year{0} ) + $year = substr( $year, 1 ); + $date = iCalUtilityFunctions::_duration_string( $year); + } + else // date + $date = iCalUtilityFunctions::_date_time_string( $year, 7 ); + unset( $year, $month, $day ); + foreach( $date as $k => $v ) + $$k = $v; + } + else // single values in function input parameters + $params = iCalUtilityFunctions::_setParams( $params ); + if( !empty( $year ) && !empty( $month ) && !empty( $day )) { // date + $params['VALUE'] = 'DATE-TIME'; + $hour = ( $hour ) ? $hour : 0; + $min = ( $min ) ? $min : 0; + $sec = ( $sec ) ? $sec : 0; + $this->trigger = array( 'params' => $params ); + $this->trigger['value'] = array( 'year' => $year + , 'month' => $month + , 'day' => $day + , 'hour' => $hour + , 'min' => $min + , 'sec' => $sec + , 'tz' => 'Z' ); + return TRUE; + } + elseif(( empty( $year ) && empty( $month )) && // duration + (!empty( $week ) || !empty( $day ) || !empty( $hour ) || !empty( $min ) || !empty( $sec ))) { + unset( $params['RELATED'] ); // set at output creation (END only) + unset( $params['VALUE'] ); // 'DURATION' default + $this->trigger = array( 'params' => $params ); + $relatedStart = ( FALSE !== $relatedStart ) ? TRUE : FALSE; + $before = ( FALSE !== $before ) ? TRUE : FALSE; + $this->trigger['value'] = array( 'relatedStart' => $relatedStart + , 'before' => $before ); + if( !empty( $week )) $this->trigger['value']['week'] = $week; + if( !empty( $day )) $this->trigger['value']['day'] = $day; + if( !empty( $hour )) $this->trigger['value']['hour'] = $hour; + if( !empty( $min )) $this->trigger['value']['min'] = $min; + if( !empty( $sec )) $this->trigger['value']['sec'] = $sec; + return TRUE; + } + return FALSE; + } +/*********************************************************************************/ +/** + * Property Name: TZID + */ +/** + * creates formatted output for calendar component property tzid + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createTzid() { + if( empty( $this->tzid )) return FALSE; + if( empty( $this->tzid['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZID' ) : FALSE; + $attributes = $this->_createParams( $this->tzid['params'] ); + return $this->_createElement( 'TZID', $attributes, $this->_strrep( $this->tzid['value'] )); + } +/** + * set calendar component property tzid + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param array $params optional + * @return bool + */ + function setTzid( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->tzid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * .. . + * Property Name: TZNAME + */ +/** + * creates formatted output for calendar component property tzname + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createTzname() { + if( empty( $this->tzname )) return FALSE; + $output = null; + foreach( $this->tzname as $theName ) { + if( !empty( $theName['value'] )) { + $attributes = $this->_createParams( $theName['params'], array( 'LANGUAGE' )); + $output .= $this->_createElement( 'TZNAME', $attributes, $this->_strrep( $theName['value'] )); + } + elseif( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( 'TZNAME' ); + } + return $output; + } +/** + * set calendar component property tzname + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param string $value + * @param string $params, optional + * @param integer $index, optional + * @return bool + */ + function setTzname( $value, $params=FALSE, $index=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + iCalUtilityFunctions::_setMval( $this->tzname, $value, $params, FALSE, $index ); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: TZOFFSETFROM + */ +/** + * creates formatted output for calendar component property tzoffsetfrom + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createTzoffsetfrom() { + if( empty( $this->tzoffsetfrom )) return FALSE; + if( empty( $this->tzoffsetfrom['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZOFFSETFROM' ) : FALSE; + $attributes = $this->_createParams( $this->tzoffsetfrom['params'] ); + return $this->_createElement( 'TZOFFSETFROM', $attributes, $this->tzoffsetfrom['value'] ); + } +/** + * set calendar component property tzoffsetfrom + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param string $params optional + * @return bool + */ + function setTzoffsetfrom( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->tzoffsetfrom = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: TZOFFSETTO + */ +/** + * creates formatted output for calendar component property tzoffsetto + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createTzoffsetto() { + if( empty( $this->tzoffsetto )) return FALSE; + if( empty( $this->tzoffsetto['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZOFFSETTO' ) : FALSE; + $attributes = $this->_createParams( $this->tzoffsetto['params'] ); + return $this->_createElement( 'TZOFFSETTO', $attributes, $this->tzoffsetto['value'] ); + } +/** + * set calendar component property tzoffsetto + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param string $params optional + * @return bool + */ + function setTzoffsetto( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->tzoffsetto = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: TZURL + */ +/** + * creates formatted output for calendar component property tzurl + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createTzurl() { + if( empty( $this->tzurl )) return FALSE; + if( empty( $this->tzurl['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'TZURL' ) : FALSE; + $attributes = $this->_createParams( $this->tzurl['params'] ); + return $this->_createElement( 'TZURL', $attributes, $this->tzurl['value'] ); + } +/** + * set calendar component property tzurl + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param string $params optional + * @return boll + */ + function setTzurl( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->tzurl = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: UID + */ +/** + * creates formatted output for calendar component property uid + * + * @author Kjell-Inge Gustafsson + * @since 0.9.7 - 2006-11-20 + * @return string + */ + function createUid() { + if( 0 >= count( $this->uid )) + $this->_makeuid(); + $attributes = $this->_createParams( $this->uid['params'] ); + return $this->_createElement( 'UID', $attributes, $this->uid['value'] ); + } +/** + * create an unique id for this calendar component object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.2.7 - 2007-09-04 + * @return void + */ + function _makeUid() { + $date = date('Ymd\THisT'); + $unique = substr(microtime(), 2, 4); + $base = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPrRsStTuUvVxXuUvVwWzZ1234567890'; + $start = 0; + $end = strlen( $base ) - 1; + $length = 6; + $str = null; + for( $p = 0; $p < $length; $p++ ) + $unique .= $base{mt_rand( $start, $end )}; + $this->uid = array( 'params' => null ); + $this->uid['value'] = $date.'-'.$unique.'@'.$this->getConfig( 'unique_id' ); + } +/** + * set calendar component property uid + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param string $params optional + * @return bool + */ + function setUid( $value, $params=FALSE ) { + if( empty( $value )) return FALSE; // no allowEmpty check here !!!! + $this->uid = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: URL + */ +/** + * creates formatted output for calendar component property url + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-21 + * @return string + */ + function createUrl() { + if( empty( $this->url )) return FALSE; + if( empty( $this->url['value'] )) + return ( $this->getConfig( 'allowEmpty' )) ? $this->_createElement( 'URL' ) : FALSE; + $attributes = $this->_createParams( $this->url['params'] ); + return $this->_createElement( 'URL', $attributes, $this->url['value'] ); + } +/** + * set calendar component property url + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-11-04 + * @param string $value + * @param string $params optional + * @return bool + */ + function setUrl( $value, $params=FALSE ) { + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $this->url = array( 'value' => $value, 'params' => iCalUtilityFunctions::_setParams( $params )); + return TRUE; + } +/*********************************************************************************/ +/** + * Property Name: x-prop + */ +/** + * creates formatted output for calendar component property x-prop + * + * @author Kjell-Inge Gustafsson + * @since 2.4.11 - 2008-10-22 + * @return string + */ + function createXprop() { + if( empty( $this->xprop )) return FALSE; + $output = null; + foreach( $this->xprop as $label => $xpropPart ) { + if( empty( $xpropPart['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( $label ); + continue; + } + $attributes = $this->_createParams( $xpropPart['params'], array( 'LANGUAGE' )); + if( is_array( $xpropPart['value'] )) { + foreach( $xpropPart['value'] as $pix => $theXpart ) + $xpropPart['value'][$pix] = $this->_strrep( $theXpart ); + $xpropPart['value'] = implode( ',', $xpropPart['value'] ); + } + else + $xpropPart['value'] = $this->_strrep( $xpropPart['value'] ); + $output .= $this->_createElement( $label, $attributes, $xpropPart['value'] ); + } + return $output; + } +/** + * set calendar component property x-prop + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-09-25 + * @param string $label + * @param mixed $value + * @param array $params optional + * @return bool + */ + function setXprop( $label, $value, $params=FALSE ) { + if( empty( $label )) return; + if( empty( $value )) if( $this->getConfig( 'allowEmpty' )) $value = null; else return FALSE; + $xprop = array( 'value' => $value ); + $xprop['params'] = iCalUtilityFunctions::_setParams( $params ); + if( !is_array( $this->xprop )) $this->xprop = array(); + $this->xprop[strtoupper( $label )] = $xprop; + return TRUE; + } +/*********************************************************************************/ +/*********************************************************************************/ +/** + * create element format parts + * + * @author Kjell-Inge Gustafsson + * @since 2.0.6 - 2006-06-20 + * @return string + */ + function _createFormat() { + $objectname = null; + switch( $this->format ) { + case 'xcal': + $objectname = ( isset( $this->timezonetype )) ? + strtolower( $this->timezonetype ) : strtolower( $this->objName ); + $this->componentStart1 = $this->elementStart1 = '<'; + $this->componentStart2 = $this->elementStart2 = '>'; + $this->componentEnd1 = $this->elementEnd1 = 'componentEnd2 = $this->elementEnd2 = '>'.$this->nl; + $this->intAttrDelimiter = ''; + $this->attributeDelimiter = $this->nl; + $this->valueInit = null; + break; + default: + $objectname = ( isset( $this->timezonetype )) ? + strtoupper( $this->timezonetype ) : strtoupper( $this->objName ); + $this->componentStart1 = 'BEGIN:'; + $this->componentStart2 = null; + $this->componentEnd1 = 'END:'; + $this->componentEnd2 = $this->nl; + $this->elementStart1 = null; + $this->elementStart2 = null; + $this->elementEnd1 = null; + $this->elementEnd2 = $this->nl; + $this->intAttrDelimiter = ''; + $this->attributeDelimiter = ';'; + $this->valueInit = ':'; + break; + } + return $objectname; + } +/** + * creates formatted output for calendar component property + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-12-06 + * @param string $label property name + * @param string $attributes property attributes + * @param string $content property content (optional) + * @return string + */ + function _createElement( $label, $attributes=null, $content=FALSE ) { + switch( $this->format ) { + case 'xcal': + $label = strtolower( $label ); + break; + default: + $label = strtoupper( $label ); + break; + } + $output = $this->elementStart1.$label; + $categoriesAttrLang = null; + $attachInlineBinary = FALSE; + $attachfmttype = null; + if( !empty( $attributes )) { + $attributes = trim( $attributes ); + if ( 'xcal' == $this->format) { + $attributes2 = explode( $this->intAttrDelimiter, $attributes ); + $attributes = null; + foreach( $attributes2 as $attribute ) { + $attrKVarr = explode( '=', $attribute ); + if( empty( $attrKVarr[0] )) + continue; + if( !isset( $attrKVarr[1] )) { + $attrValue = $attrKVarr[0]; + $attrKey = null; + } + elseif( 2 == count( $attrKVarr)) { + $attrKey = strtolower( $attrKVarr[0] ); + $attrValue = $attrKVarr[1]; + } + else { + $attrKey = strtolower( $attrKVarr[0] ); + unset( $attrKVarr[0] ); + $attrValue = implode( '=', $attrKVarr ); + } + if(( 'attach' == $label ) && ( in_array( $attrKey, array( 'fmttype', 'encoding', 'value' )))) { + $attachInlineBinary = TRUE; + if( 'fmttype' == $attrKey ) + $attachfmttype = $attrKey.'='.$attrValue; + continue; + } + elseif(( 'categories' == $label ) && ( 'language' == $attrKey )) + $categoriesAttrLang = $attrKey.'='.$attrValue; + else { + $attributes .= ( empty( $attributes )) ? ' ' : $this->attributeDelimiter.' '; + $attributes .= ( !empty( $attrKey )) ? $attrKey.'=' : null; + if(( '"' == substr( $attrValue, 0, 1 )) && ( '"' == substr( $attrValue, -1 ))) { + $attrValue = substr( $attrValue, 1, ( strlen( $attrValue ) - 2 )); + $attrValue = str_replace( '"', '', $attrValue ); + } + $attributes .= '"'.htmlspecialchars( $attrValue ).'"'; + } + } + } + else { + $attributes = str_replace( $this->intAttrDelimiter, $this->attributeDelimiter, $attributes ); + } + } + if(((( 'attach' == $label ) && !$attachInlineBinary ) || + ( in_array( $label, array( 'tzurl', 'url' )))) && ( 'xcal' == $this->format)) { + $pos = strrpos($content, "/"); + $docname = ( $pos !== false) ? substr( $content, (1 - strlen( $content ) + $pos )) : $content; + $this->xcaldecl[] = array( 'xmldecl' => 'ENTITY' + , 'uri' => $docname + , 'ref' => 'SYSTEM' + , 'external' => $content + , 'type' => 'NDATA' + , 'type2' => 'BINERY' ); + $attributes .= ( empty( $attributes )) ? ' ' : $this->attributeDelimiter.' '; + $attributes .= 'uri="'.$docname.'"'; + $content = null; + if( 'attach' == $label ) { + $attributes = str_replace( $this->attributeDelimiter, $this->intAttrDelimiter, $attributes ); + $content = $this->_createElement( 'extref', $attributes, null ); + $attributes = null; + } + } + elseif(( 'attach' == $label ) && $attachInlineBinary && ( 'xcal' == $this->format)) { + $content = $this->nl.$this->_createElement( 'b64bin', $attachfmttype, $content ); // max one attribute + } + $output .= $attributes; + if( !$content && ( '0' != $content )) { + switch( $this->format ) { + case 'xcal': + $output .= ' /'; + $output .= $this->elementStart2; + return $output; + break; + default: + $output .= $this->elementStart2.$this->valueInit; + return $this->_size75( $output ); + break; + } + } + $output .= $this->elementStart2; + $output .= $this->valueInit.$content; + switch( $this->format ) { + case 'xcal': + return $output.$this->elementEnd1.$label.$this->elementEnd2; + break; + default: + return $this->_size75( $output ); + break; + } + } +/** + * creates formatted output for calendar component property parameters + * + * @author Kjell-Inge Gustafsson + * @since 2.6.33 - 2010-12-18 + * @param array $params optional + * @param array $ctrKeys optional + * @return string + */ + function _createParams( $params=array(), $ctrKeys=array() ) { + if( !is_array( $params ) || empty( $params )) + $params = array(); + $attrLANG = $attr1 = $attr2 = $lang = null; + $CNattrKey = ( in_array( 'CN', $ctrKeys )) ? TRUE : FALSE ; + $LANGattrKey = ( in_array( 'LANGUAGE', $ctrKeys )) ? TRUE : FALSE ; + $CNattrExist = $LANGattrExist = FALSE; + $xparams = array(); + foreach( $params as $paramKey => $paramValue ) { + if( ctype_digit( (string) $paramKey )) { + $xparams[] = $paramValue; + continue; + } + $paramKey = strtoupper( $paramKey ); + if( !in_array( $paramKey, array( 'ALTREP', 'CN', 'DIR', 'ENCODING', 'FMTTYPE', 'LANGUAGE', 'RANGE', 'RELTYPE', 'SENT-BY', 'TZID', 'VALUE' ))) + $xparams[$paramKey] = $paramValue; + else + $params[$paramKey] = $paramValue; + } + ksort( $xparams, SORT_STRING ); + foreach( $xparams as $paramKey => $paramValue ) { + if( ctype_digit( (string) $paramKey )) + $attr2 .= $this->intAttrDelimiter.$paramValue; + else + $attr2 .= $this->intAttrDelimiter."$paramKey=$paramValue"; + } + if( isset( $params['FMTTYPE'] ) && !in_array( 'FMTTYPE', $ctrKeys )) { + $attr1 .= $this->intAttrDelimiter.'FMTTYPE='.$params['FMTTYPE'].$attr2; + $attr2 = null; + } + if( isset( $params['ENCODING'] ) && !in_array( 'ENCODING', $ctrKeys )) { + if( !empty( $attr2 )) { + $attr1 .= $attr2; + $attr2 = null; + } + $attr1 .= $this->intAttrDelimiter.'ENCODING='.$params['ENCODING']; + } + if( isset( $params['VALUE'] ) && !in_array( 'VALUE', $ctrKeys )) + $attr1 .= $this->intAttrDelimiter.'VALUE='.$params['VALUE']; + if( isset( $params['TZID'] ) && !in_array( 'TZID', $ctrKeys )) + $attr1 .= $this->intAttrDelimiter.'TZID='.$params['TZID']; + if( isset( $params['RANGE'] ) && !in_array( 'RANGE', $ctrKeys )) + $attr1 .= $this->intAttrDelimiter.'RANGE='.$params['RANGE']; + if( isset( $params['RELTYPE'] ) && !in_array( 'RELTYPE', $ctrKeys )) + $attr1 .= $this->intAttrDelimiter.'RELTYPE='.$params['RELTYPE']; + if( isset( $params['CN'] ) && $CNattrKey ) { + $attr1 = $this->intAttrDelimiter.'CN="'.$params['CN'].'"'; + $CNattrExist = TRUE; + } + if( isset( $params['DIR'] ) && in_array( 'DIR', $ctrKeys )) + $attr1 .= $this->intAttrDelimiter.'DIR="'.$params['DIR'].'"'; + if( isset( $params['SENT-BY'] ) && in_array( 'SENT-BY', $ctrKeys )) + $attr1 .= $this->intAttrDelimiter.'SENT-BY="'.$params['SENT-BY'].'"'; + if( isset( $params['ALTREP'] ) && in_array( 'ALTREP', $ctrKeys )) + $attr1 .= $this->intAttrDelimiter.'ALTREP="'.$params['ALTREP'].'"'; + if( isset( $params['LANGUAGE'] ) && $LANGattrKey ) { + $attrLANG .= $this->intAttrDelimiter.'LANGUAGE='.$params['LANGUAGE']; + $LANGattrExist = TRUE; + } + if( !$LANGattrExist ) { + $lang = $this->getConfig( 'language' ); + if(( $CNattrExist || $LANGattrKey ) && $lang ) + $attrLANG .= $this->intAttrDelimiter.'LANGUAGE='.$lang; + } + return $attr1.$attrLANG.$attr2; + } +/** + * creates formatted output for calendar component property data value type recur + * + * @author Kjell-Inge Gustafsson + * @since 2.4.8 - 2008-10-22 + * @param array $recurlabel + * @param array $recurdata + * @return string + */ + function _format_recur( $recurlabel, $recurdata ) { + $output = null; + foreach( $recurdata as $therule ) { + if( empty( $therule['value'] )) { + if( $this->getConfig( 'allowEmpty' )) $output .= $this->_createElement( $recurlabel ); + continue; + } + $attributes = ( isset( $therule['params'] )) ? $this->_createParams( $therule['params'] ) : null; + $content1 = $content2 = null; + foreach( $therule['value'] as $rulelabel => $rulevalue ) { + switch( $rulelabel ) { + case 'FREQ': { + $content1 .= "FREQ=$rulevalue"; + break; + } + case 'UNTIL': { + $content2 .= ";UNTIL="; + $content2 .= iCalUtilityFunctions::_format_date_time( $rulevalue ); + break; + } + case 'COUNT': + case 'INTERVAL': + case 'WKST': { + $content2 .= ";$rulelabel=$rulevalue"; + break; + } + case 'BYSECOND': + case 'BYMINUTE': + case 'BYHOUR': + case 'BYMONTHDAY': + case 'BYYEARDAY': + case 'BYWEEKNO': + case 'BYMONTH': + case 'BYSETPOS': { + $content2 .= ";$rulelabel="; + if( is_array( $rulevalue )) { + foreach( $rulevalue as $vix => $valuePart ) { + $content2 .= ( $vix ) ? ',' : null; + $content2 .= $valuePart; + } + } + else + $content2 .= $rulevalue; + break; + } + case 'BYDAY': { + $content2 .= ";$rulelabel="; + $bydaycnt = 0; + foreach( $rulevalue as $vix => $valuePart ) { + $content21 = $content22 = null; + if( is_array( $valuePart )) { + $content2 .= ( $bydaycnt ) ? ',' : null; + foreach( $valuePart as $vix2 => $valuePart2 ) { + if( 'DAY' != strtoupper( $vix2 )) + $content21 .= $valuePart2; + else + $content22 .= $valuePart2; + } + $content2 .= $content21.$content22; + $bydaycnt++; + } + else { + $content2 .= ( $bydaycnt ) ? ',' : null; + if( 'DAY' != strtoupper( $vix )) + $content21 .= $valuePart; + else { + $content22 .= $valuePart; + $bydaycnt++; + } + $content2 .= $content21.$content22; + } + } + break; + } + default: { + $content2 .= ";$rulelabel=$rulevalue"; + break; + } + } + } + $output .= $this->_createElement( $recurlabel, $attributes, $content1.$content2 ); + } + return $output; + } +/** + * check if property not exists within component + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-15 + * @param string $propName + * @return bool + */ + function _notExistProp( $propName ) { + if( empty( $propName )) return FALSE; // when deleting x-prop, an empty propName may be used=allowed + $propName = strtolower( $propName ); + if( 'last-modified' == $propName ) { if( !isset( $this->lastmodified )) return TRUE; } + elseif( 'percent-complete' == $propName ) { if( !isset( $this->percentcomplete )) return TRUE; } + elseif( 'recurrence-id' == $propName ) { if( !isset( $this->recurrenceid )) return TRUE; } + elseif( 'related-to' == $propName ) { if( !isset( $this->relatedto )) return TRUE; } + elseif( 'request-status' == $propName ) { if( !isset( $this->requeststatus )) return TRUE; } + elseif(( 'x-' != substr($propName,0,2)) && !isset( $this->$propName )) return TRUE; + return FALSE; + } +/*********************************************************************************/ +/*********************************************************************************/ +/** + * get general component config variables or info about subcomponents + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-27 + * @param mixed $config + * @return value + */ + function getConfig( $config = FALSE) { + if( !$config ) { + $return = array(); + $return['ALLOWEMPTY'] = $this->getConfig( 'ALLOWEMPTY' ); + $return['FORMAT'] = $this->getConfig( 'FORMAT' ); + if( FALSE !== ( $lang = $this->getConfig( 'LANGUAGE' ))) + $return['LANGUAGE'] = $lang; + $return['NEWLINECHAR'] = $this->getConfig( 'NEWLINECHAR' ); + $return['UNIQUE_ID'] = $this->getConfig( 'UNIQUE_ID' ); + return $return; + } + switch( strtoupper( $config )) { + case 'ALLOWEMPTY': + return $this->allowEmpty; + break; + case 'COMPSINFO': + unset( $this->compix ); + $info = array(); + if( isset( $this->components )) { + foreach( $this->components as $cix => $component ) { + if( empty( $component )) continue; + unset( $component->propix ); + $info[$cix]['ordno'] = $cix + 1; + $info[$cix]['type'] = $component->objName; + $info[$cix]['uid'] = $component->getProperty( 'uid' ); + $info[$cix]['props'] = $component->getConfig( 'propinfo' ); + $info[$cix]['sub'] = $component->getConfig( 'compsinfo' ); + unset( $component->propix ); + } + } + return $info; + break; + case 'FORMAT': + return $this->format; + break; + case 'LANGUAGE': + // get language for calendar component as defined in [RFC 1766] + return $this->language; + break; + case 'NL': + case 'NEWLINECHAR': + return $this->nl; + break; + case 'PROPINFO': + $output = array(); + if( !in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) { + if( empty( $this->uid['value'] )) $this->_makeuid(); + $output['UID'] = 1; + } + if( !empty( $this->dtstamp )) $output['DTSTAMP'] = 1; + if( !empty( $this->summary )) $output['SUMMARY'] = 1; + if( !empty( $this->description )) $output['DESCRIPTION'] = count( $this->description ); + if( !empty( $this->dtstart )) $output['DTSTART'] = 1; + if( !empty( $this->dtend )) $output['DTEND'] = 1; + if( !empty( $this->due )) $output['DUE'] = 1; + if( !empty( $this->duration )) $output['DURATION'] = 1; + if( !empty( $this->rrule )) $output['RRULE'] = count( $this->rrule ); + if( !empty( $this->rdate )) $output['RDATE'] = count( $this->rdate ); + if( !empty( $this->exdate )) $output['EXDATE'] = count( $this->exdate ); + if( !empty( $this->exrule )) $output['EXRULE'] = count( $this->exrule ); + if( !empty( $this->action )) $output['ACTION'] = 1; + if( !empty( $this->attach )) $output['ATTACH'] = count( $this->attach ); + if( !empty( $this->attendee )) $output['ATTENDEE'] = count( $this->attendee ); + if( !empty( $this->categories )) $output['CATEGORIES'] = count( $this->categories ); + if( !empty( $this->class )) $output['CLASS'] = 1; + if( !empty( $this->comment )) $output['COMMENT'] = count( $this->comment ); + if( !empty( $this->completed )) $output['COMPLETED'] = 1; + if( !empty( $this->contact )) $output['CONTACT'] = count( $this->contact ); + if( !empty( $this->created )) $output['CREATED'] = 1; + if( !empty( $this->freebusy )) $output['FREEBUSY'] = count( $this->freebusy ); + if( !empty( $this->geo )) $output['GEO'] = 1; + if( !empty( $this->lastmodified )) $output['LAST-MODIFIED'] = 1; + if( !empty( $this->location )) $output['LOCATION'] = 1; + if( !empty( $this->organizer )) $output['ORGANIZER'] = 1; + if( !empty( $this->percentcomplete )) $output['PERCENT-COMPLETE'] = 1; + if( !empty( $this->priority )) $output['PRIORITY'] = 1; + if( !empty( $this->recurrenceid )) $output['RECURRENCE-ID'] = 1; + if( !empty( $this->relatedto )) $output['RELATED-TO'] = count( $this->relatedto ); + if( !empty( $this->repeat )) $output['REPEAT'] = 1; + if( !empty( $this->requeststatus )) $output['REQUEST-STATUS'] = count( $this->requeststatus ); + if( !empty( $this->resources )) $output['RESOURCES'] = count( $this->resources ); + if( !empty( $this->sequence )) $output['SEQUENCE'] = 1; + if( !empty( $this->sequence )) $output['SEQUENCE'] = 1; + if( !empty( $this->status )) $output['STATUS'] = 1; + if( !empty( $this->transp )) $output['TRANSP'] = 1; + if( !empty( $this->trigger )) $output['TRIGGER'] = 1; + if( !empty( $this->tzid )) $output['TZID'] = 1; + if( !empty( $this->tzname )) $output['TZNAME'] = count( $this->tzname ); + if( !empty( $this->tzoffsetfrom )) $output['TZOFFSETFROM'] = 1; + if( !empty( $this->tzoffsetto )) $output['TZOFFSETTO'] = 1; + if( !empty( $this->tzurl )) $output['TZURL'] = 1; + if( !empty( $this->url )) $output['URL'] = 1; + if( !empty( $this->xprop )) $output['X-PROP'] = count( $this->xprop ); + return $output; + break; + case 'UNIQUE_ID': + if( empty( $this->unique_id )) + $this->unique_id = ( isset( $_SERVER['SERVER_NAME'] )) ? gethostbyname( $_SERVER['SERVER_NAME'] ) : 'localhost'; + return $this->unique_id; + break; + } + } +/** + * general component config setting + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-12-12 + * @param mixed $config + * @param string $value + * @param bool $softUpdate + * @return void + */ + function setConfig( $config, $value = FALSE, $softUpdate = FALSE ) { + if( is_array( $config )) { + foreach( $config as $cKey => $cValue ) { + if( FALSE === $this->setConfig( $cKey, $cValue, $softUpdate )) + return FALSE; + } + return TRUE; + } + $res = FALSE; + switch( strtoupper( $config )) { + case 'ALLOWEMPTY': + $this->allowEmpty = $value; + $subcfg = array( 'ALLOWEMPTY' => $value ); + $res = TRUE; + break; + case 'FORMAT': + $value = trim( strtolower( $value )); + $this->format = $value; + $this->_createFormat(); + $subcfg = array( 'FORMAT' => $value ); + $res = TRUE; + break; + case 'LANGUAGE': + // set language for calendar component as defined in [RFC 1766] + $value = trim( $value ); + if( empty( $this->language ) || !$softUpdate ) + $this->language = $value; + $subcfg = array( 'LANGUAGE' => $value ); + $res = TRUE; + break; + case 'NL': + case 'NEWLINECHAR': + $this->nl = $value; + $subcfg = array( 'NL' => $value ); + $res = TRUE; + break; + case 'UNIQUE_ID': + $value = trim( $value ); + $this->unique_id = $value; + $subcfg = array( 'UNIQUE_ID' => $value ); + $res = TRUE; + break; + default: // any unvalid config key.. . + return TRUE; + } + if( !$res ) return FALSE; + if( isset( $subcfg ) && !empty( $this->components )) { + foreach( $subcfg as $cfgkey => $cfgvalue ) { + foreach( $this->components as $cix => $component ) { + $res = $component->setConfig( $cfgkey, $cfgvalue, $softUpdate ); + if( !$res ) + break 2; + $this->components[$cix] = $component->copy(); // PHP4 compliant + } + } + } + return $res; + } +/*********************************************************************************/ +/** + * delete component property value + * + * @author Kjell-Inge Gustafsson + * @since 2.6.4 - 2011-01-05 + * @param mixed $propName, bool FALSE => X-property + * @param int $propix, optional, if specific property is wanted in case of multiply occurences + * @return bool, if successfull delete TRUE + */ + function deleteProperty( $propName=FALSE, $propix=FALSE ) { + if( $this->_notExistProp( $propName )) return FALSE; + $propName = strtoupper( $propName ); + if( in_array( $propName, array( 'ATTACH', 'ATTENDEE', 'CATEGORIES', 'COMMENT', 'CONTACT', 'DESCRIPTION', 'EXDATE', 'EXRULE', + 'FREEBUSY', 'RDATE', 'RELATED-TO', 'RESOURCES', 'RRULE', 'REQUEST-STATUS', 'TZNAME', 'X-PROP' ))) { + if( !$propix ) + $propix = ( isset( $this->propdelix[$propName] ) && ( 'X-PROP' != $propName )) ? $this->propdelix[$propName] + 2 : 1; + $this->propdelix[$propName] = --$propix; + } + $return = FALSE; + switch( $propName ) { + case 'ACTION': + if( !empty( $this->action )) { + $this->action = ''; + $return = TRUE; + } + break; + case 'ATTACH': + return $this->deletePropertyM( $this->attach, $propix ); + break; + case 'ATTENDEE': + return $this->deletePropertyM( $this->attendee, $propix ); + break; + case 'CATEGORIES': + return $this->deletePropertyM( $this->categories, $propix ); + break; + case 'CLASS': + if( !empty( $this->class )) { + $this->class = ''; + $return = TRUE; + } + break; + case 'COMMENT': + return $this->deletePropertyM( $this->comment, $propix ); + break; + case 'COMPLETED': + if( !empty( $this->completed )) { + $this->completed = ''; + $return = TRUE; + } + break; + case 'CONTACT': + return $this->deletePropertyM( $this->contact, $propix ); + break; + case 'CREATED': + if( !empty( $this->created )) { + $this->created = ''; + $return = TRUE; + } + break; + case 'DESCRIPTION': + return $this->deletePropertyM( $this->description, $propix ); + break; + case 'DTEND': + if( !empty( $this->dtend )) { + $this->dtend = ''; + $return = TRUE; + } + break; + case 'DTSTAMP': + if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) + return FALSE; + if( !empty( $this->dtstamp )) { + $this->dtstamp = ''; + $return = TRUE; + } + break; + case 'DTSTART': + if( !empty( $this->dtstart )) { + $this->dtstart = ''; + $return = TRUE; + } + break; + case 'DUE': + if( !empty( $this->due )) { + $this->due = ''; + $return = TRUE; + } + break; + case 'DURATION': + if( !empty( $this->duration )) { + $this->duration = ''; + $return = TRUE; + } + break; + case 'EXDATE': + return $this->deletePropertyM( $this->exdate, $propix ); + break; + case 'EXRULE': + return $this->deletePropertyM( $this->exrule, $propix ); + break; + case 'FREEBUSY': + return $this->deletePropertyM( $this->freebusy, $propix ); + break; + case 'GEO': + if( !empty( $this->geo )) { + $this->geo = ''; + $return = TRUE; + } + break; + case 'LAST-MODIFIED': + if( !empty( $this->lastmodified )) { + $this->lastmodified = ''; + $return = TRUE; + } + break; + case 'LOCATION': + if( !empty( $this->location )) { + $this->location = ''; + $return = TRUE; + } + break; + case 'ORGANIZER': + if( !empty( $this->organizer )) { + $this->organizer = ''; + $return = TRUE; + } + break; + case 'PERCENT-COMPLETE': + if( !empty( $this->percentcomplete )) { + $this->percentcomplete = ''; + $return = TRUE; + } + break; + case 'PRIORITY': + if( !empty( $this->priority )) { + $this->priority = ''; + $return = TRUE; + } + break; + case 'RDATE': + return $this->deletePropertyM( $this->rdate, $propix ); + break; + case 'RECURRENCE-ID': + if( !empty( $this->recurrenceid )) { + $this->recurrenceid = ''; + $return = TRUE; + } + break; + case 'RELATED-TO': + return $this->deletePropertyM( $this->relatedto, $propix ); + break; + case 'REPEAT': + if( !empty( $this->repeat )) { + $this->repeat = ''; + $return = TRUE; + } + break; + case 'REQUEST-STATUS': + return $this->deletePropertyM( $this->requeststatus, $propix ); + break; + case 'RESOURCES': + return $this->deletePropertyM( $this->resources, $propix ); + break; + case 'RRULE': + return $this->deletePropertyM( $this->rrule, $propix ); + break; + case 'SEQUENCE': + if( !empty( $this->sequence )) { + $this->sequence = ''; + $return = TRUE; + } + break; + case 'STATUS': + if( !empty( $this->status )) { + $this->status = ''; + $return = TRUE; + } + break; + case 'SUMMARY': + if( !empty( $this->summary )) { + $this->summary = ''; + $return = TRUE; + } + break; + case 'TRANSP': + if( !empty( $this->transp )) { + $this->transp = ''; + $return = TRUE; + } + break; + case 'TRIGGER': + if( !empty( $this->trigger )) { + $this->trigger = ''; + $return = TRUE; + } + break; + case 'TZID': + if( !empty( $this->tzid )) { + $this->tzid = ''; + $return = TRUE; + } + break; + case 'TZNAME': + return $this->deletePropertyM( $this->tzname, $propix ); + break; + case 'TZOFFSETFROM': + if( !empty( $this->tzoffsetfrom )) { + $this->tzoffsetfrom = ''; + $return = TRUE; + } + break; + case 'TZOFFSETTO': + if( !empty( $this->tzoffsetto )) { + $this->tzoffsetto = ''; + $return = TRUE; + } + break; + case 'TZURL': + if( !empty( $this->tzurl )) { + $this->tzurl = ''; + $return = TRUE; + } + break; + case 'UID': + if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) + return FALSE; + if( !empty( $this->uid )) { + $this->uid = ''; + $return = TRUE; + } + break; + case 'URL': + if( !empty( $this->url )) { + $this->url = ''; + $return = TRUE; + } + break; + default: + $reduced = ''; + if( $propName != 'X-PROP' ) { + if( !isset( $this->xprop[$propName] )) return FALSE; + foreach( $this->xprop as $k => $a ) { + if(( $k != $propName ) && !empty( $a )) + $reduced[$k] = $a; + } + } + else { + if( count( $this->xprop ) <= $propix ) return FALSE; + $xpropno = 0; + foreach( $this->xprop as $xpropkey => $xpropvalue ) { + if( $propix != $xpropno ) + $reduced[$xpropkey] = $xpropvalue; + $xpropno++; + } + } + $this->xprop = $reduced; + if( empty( $this->xprop )) + return FALSE; + return TRUE; + } + return $return; + } +/*********************************************************************************/ +/** + * delete component property value, fixing components with multiple occurencies + * + * @author Kjell-Inge Gustafsson + * @since 2.6.19 - 2009-12-30 + * @param array $multiprop, reference to a component property + * @param int $propix, default 0 + * @return bool TRUE + */ + function deletePropertyM( & $multiprop, $propix=0 ) { + if( !isset( $multiprop[$propix])) return FALSE; + unset( $multiprop[$propix] ); + if( empty( $multiprop )) $multiprop = ''; + return ( isset( $multiprop[$propix] )) ? FALSE : TRUE; + } +/** + * get component property value/params + * + * if property has multiply values, consequtive function calls are needed + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-10-21 + * @param string $propName, optional + * @param int @propix, optional, if specific property is wanted in case of multiply occurences + * @param bool $inclParam=FALSE + * @param bool $specform=FALSE + * @return mixed + */ + function getProperty( $propName=FALSE, $propix=FALSE, $inclParam=FALSE, $specform=FALSE ) { + if( $this->_notExistProp( $propName )) return FALSE; + $propName = ( $propName ) ? strtoupper( $propName ) : 'X-PROP'; + if( in_array( $propName, array( 'ATTACH', 'ATTENDEE', 'CATEGORIES', 'COMMENT', 'CONTACT', 'DESCRIPTION', 'EXDATE', 'EXRULE', + 'FREEBUSY', 'RDATE', 'RELATED-TO', 'RESOURCES', 'RRULE', 'REQUEST-STATUS', 'TZNAME', 'X-PROP' ))) { + if( !$propix ) + $propix = ( isset( $this->propix[$propName] )) ? $this->propix[$propName] + 2 : 1; + $this->propix[$propName] = --$propix; + } + switch( $propName ) { + case 'ACTION': + if( !empty( $this->action['value'] )) return ( $inclParam ) ? $this->action : $this->action['value']; + break; + case 'ATTACH': + if( !isset( $this->attach[$propix] )) return FALSE; + return ( $inclParam ) ? $this->attach[$propix] : $this->attach[$propix]['value']; + break; + case 'ATTENDEE': + if( !isset( $this->attendee[$propix] )) return FALSE; + return ( $inclParam ) ? $this->attendee[$propix] : $this->attendee[$propix]['value']; + break; + case 'CATEGORIES': + if( !isset( $this->categories[$propix] )) return FALSE; + return ( $inclParam ) ? $this->categories[$propix] : $this->categories[$propix]['value']; + break; + case 'CLASS': + if( !empty( $this->class['value'] )) return ( $inclParam ) ? $this->class : $this->class['value']; + break; + case 'COMMENT': + if( !isset( $this->comment[$propix] )) return FALSE; + return ( $inclParam ) ? $this->comment[$propix] : $this->comment[$propix]['value']; + break; + case 'COMPLETED': + if( !empty( $this->completed['value'] )) return ( $inclParam ) ? $this->completed : $this->completed['value']; + break; + case 'CONTACT': + if( !isset( $this->contact[$propix] )) return FALSE; + return ( $inclParam ) ? $this->contact[$propix] : $this->contact[$propix]['value']; + break; + case 'CREATED': + if( !empty( $this->created['value'] )) return ( $inclParam ) ? $this->created : $this->created['value']; + break; + case 'DESCRIPTION': + if( !isset( $this->description[$propix] )) return FALSE; + return ( $inclParam ) ? $this->description[$propix] : $this->description[$propix]['value']; + break; + case 'DTEND': + if( !empty( $this->dtend['value'] )) return ( $inclParam ) ? $this->dtend : $this->dtend['value']; + break; + case 'DTSTAMP': + if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) + return; + if( !isset( $this->dtstamp['value'] )) + $this->_makeDtstamp(); + return ( $inclParam ) ? $this->dtstamp : $this->dtstamp['value']; + break; + case 'DTSTART': + if( !empty( $this->dtstart['value'] )) return ( $inclParam ) ? $this->dtstart : $this->dtstart['value']; + break; + case 'DUE': + if( !empty( $this->due['value'] )) return ( $inclParam ) ? $this->due : $this->due['value']; + break; + case 'DURATION': + if( !isset( $this->duration['value'] )) return FALSE; + $value = ( $specform && isset( $this->dtstart['value'] ) && isset( $this->duration['value'] )) ? iCalUtilityFunctions::_duration2date( $this->dtstart['value'], $this->duration['value'] ) : $this->duration['value']; + return ( $inclParam ) ? array( 'value' => $value, 'params' => $this->duration['params'] ) : $value; + break; + case 'EXDATE': + if( !isset( $this->exdate[$propix] )) return FALSE; + return ( $inclParam ) ? $this->exdate[$propix] : $this->exdate[$propix]['value']; + break; + case 'EXRULE': + if( !isset( $this->exrule[$propix] )) return FALSE; + return ( $inclParam ) ? $this->exrule[$propix] : $this->exrule[$propix]['value']; + break; + case 'FREEBUSY': + if( !isset( $this->freebusy[$propix] )) return FALSE; + return ( $inclParam ) ? $this->freebusy[$propix] : $this->freebusy[$propix]['value']; + break; + case 'GEO': + if( !empty( $this->geo['value'] )) return ( $inclParam ) ? $this->geo : $this->geo['value']; + break; + case 'LAST-MODIFIED': + if( !empty( $this->lastmodified['value'] )) return ( $inclParam ) ? $this->lastmodified : $this->lastmodified['value']; + break; + case 'LOCATION': + if( !empty( $this->location['value'] )) return ( $inclParam ) ? $this->location : $this->location['value']; + break; + case 'ORGANIZER': + if( !empty( $this->organizer['value'] )) return ( $inclParam ) ? $this->organizer : $this->organizer['value']; + break; + case 'PERCENT-COMPLETE': + if( !empty( $this->percentcomplete['value'] )) return ( $inclParam ) ? $this->percentcomplete : $this->percentcomplete['value']; + break; + case 'PRIORITY': + if( !empty( $this->priority['value'] )) return ( $inclParam ) ? $this->priority : $this->priority['value']; + break; + case 'RDATE': + if( !isset( $this->rdate[$propix] )) return FALSE; + return ( $inclParam ) ? $this->rdate[$propix] : $this->rdate[$propix]['value']; + break; + case 'RECURRENCE-ID': + if( !empty( $this->recurrenceid['value'] )) return ( $inclParam ) ? $this->recurrenceid : $this->recurrenceid['value']; + break; + case 'RELATED-TO': + if( !isset( $this->relatedto[$propix] )) return FALSE; + return ( $inclParam ) ? $this->relatedto[$propix] : $this->relatedto[$propix]['value']; + break; + case 'REPEAT': + if( !empty( $this->repeat['value'] )) return ( $inclParam ) ? $this->repeat : $this->repeat['value']; + break; + case 'REQUEST-STATUS': + if( !isset( $this->requeststatus[$propix] )) return FALSE; + return ( $inclParam ) ? $this->requeststatus[$propix] : $this->requeststatus[$propix]['value']; + break; + case 'RESOURCES': + if( !isset( $this->resources[$propix] )) return FALSE; + return ( $inclParam ) ? $this->resources[$propix] : $this->resources[$propix]['value']; + break; + case 'RRULE': + if( !isset( $this->rrule[$propix] )) return FALSE; + return ( $inclParam ) ? $this->rrule[$propix] : $this->rrule[$propix]['value']; + break; + case 'SEQUENCE': + if( isset( $this->sequence['value'] ) && ( '0' <= $this->sequence['value'] )) return ( $inclParam ) ? $this->sequence : $this->sequence['value']; + break; + case 'STATUS': + if( !empty( $this->status['value'] )) return ( $inclParam ) ? $this->status : $this->status['value']; + break; + case 'SUMMARY': + if( !empty( $this->summary['value'] )) return ( $inclParam ) ? $this->summary : $this->summary['value']; + break; + case 'TRANSP': + if( !empty( $this->transp['value'] )) return ( $inclParam ) ? $this->transp : $this->transp['value']; + break; + case 'TRIGGER': + if( !empty( $this->trigger['value'] )) return ( $inclParam ) ? $this->trigger : $this->trigger['value']; + break; + case 'TZID': + if( !empty( $this->tzid['value'] )) return ( $inclParam ) ? $this->tzid : $this->tzid['value']; + break; + case 'TZNAME': + if( !isset( $this->tzname[$propix] )) return FALSE; + return ( $inclParam ) ? $this->tzname[$propix] : $this->tzname[$propix]['value']; + break; + case 'TZOFFSETFROM': + if( !empty( $this->tzoffsetfrom['value'] )) return ( $inclParam ) ? $this->tzoffsetfrom : $this->tzoffsetfrom['value']; + break; + case 'TZOFFSETTO': + if( !empty( $this->tzoffsetto['value'] )) return ( $inclParam ) ? $this->tzoffsetto : $this->tzoffsetto['value']; + break; + case 'TZURL': + if( !empty( $this->tzurl['value'] )) return ( $inclParam ) ? $this->tzurl : $this->tzurl['value']; + break; + case 'UID': + if( in_array( $this->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) + return FALSE; + if( empty( $this->uid['value'] )) + $this->_makeuid(); + return ( $inclParam ) ? $this->uid : $this->uid['value']; + break; + case 'URL': + if( !empty( $this->url['value'] )) return ( $inclParam ) ? $this->url : $this->url['value']; + break; + default: + if( $propName != 'X-PROP' ) { + if( !isset( $this->xprop[$propName] )) return FALSE; + return ( $inclParam ) ? array( $propName, $this->xprop[$propName] ) + : array( $propName, $this->xprop[$propName]['value'] ); + } + else { + if( empty( $this->xprop )) return FALSE; + $xpropno = 0; + foreach( $this->xprop as $xpropkey => $xpropvalue ) { + if( $propix == $xpropno ) + return ( $inclParam ) ? array( $xpropkey, $this->xprop[$xpropkey] ) + : array( $xpropkey, $this->xprop[$xpropkey]['value'] ); + else + $xpropno++; + } + return FALSE; // not found ?? + } + } + return FALSE; + } +/** + * general component property setting + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-05 + * @param mixed $args variable number of function arguments, + * first argument is ALWAYS component name, + * second ALWAYS component value! + * @return void + */ + function setProperty() { + $numargs = func_num_args(); + if( 1 > $numargs ) return FALSE; + $arglist = func_get_args(); + if( $this->_notExistProp( $arglist[0] )) return FALSE; + if( !$this->getConfig( 'allowEmpty' ) && ( !isset( $arglist[1] ) || empty( $arglist[1] ))) + return FALSE; + $arglist[0] = strtoupper( $arglist[0] ); + for( $argix=$numargs; $argix < 12; $argix++ ) { + if( !isset( $arglist[$argix] )) + $arglist[$argix] = null; + } + switch( $arglist[0] ) { + case 'ACTION': + return $this->setAction( $arglist[1], $arglist[2] ); + case 'ATTACH': + return $this->setAttach( $arglist[1], $arglist[2], $arglist[3] ); + case 'ATTENDEE': + return $this->setAttendee( $arglist[1], $arglist[2], $arglist[3] ); + case 'CATEGORIES': + return $this->setCategories( $arglist[1], $arglist[2], $arglist[3] ); + case 'CLASS': + return $this->setClass( $arglist[1], $arglist[2] ); + case 'COMMENT': + return $this->setComment( $arglist[1], $arglist[2], $arglist[3] ); + case 'COMPLETED': + return $this->setCompleted( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); + case 'CONTACT': + return $this->setContact( $arglist[1], $arglist[2], $arglist[3] ); + case 'CREATED': + return $this->setCreated( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); + case 'DESCRIPTION': + return $this->setDescription( $arglist[1], $arglist[2], $arglist[3] ); + case 'DTEND': + return $this->setDtend( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); + case 'DTSTAMP': + return $this->setDtstamp( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); + case 'DTSTART': + return $this->setDtstart( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); + case 'DUE': + return $this->setDue( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); + case 'DURATION': + return $this->setDuration( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6] ); + case 'EXDATE': + return $this->setExdate( $arglist[1], $arglist[2], $arglist[3] ); + case 'EXRULE': + return $this->setExrule( $arglist[1], $arglist[2], $arglist[3] ); + case 'FREEBUSY': + return $this->setFreebusy( $arglist[1], $arglist[2], $arglist[3], $arglist[4] ); + case 'GEO': + return $this->setGeo( $arglist[1], $arglist[2], $arglist[3] ); + case 'LAST-MODIFIED': + return $this->setLastModified( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7] ); + case 'LOCATION': + return $this->setLocation( $arglist[1], $arglist[2] ); + case 'ORGANIZER': + return $this->setOrganizer( $arglist[1], $arglist[2] ); + case 'PERCENT-COMPLETE': + return $this->setPercentComplete( $arglist[1], $arglist[2] ); + case 'PRIORITY': + return $this->setPriority( $arglist[1], $arglist[2] ); + case 'RDATE': + return $this->setRdate( $arglist[1], $arglist[2], $arglist[3] ); + case 'RECURRENCE-ID': + return $this->setRecurrenceid( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8] ); + case 'RELATED-TO': + return $this->setRelatedTo( $arglist[1], $arglist[2], $arglist[3] ); + case 'REPEAT': + return $this->setRepeat( $arglist[1], $arglist[2] ); + case 'REQUEST-STATUS': + return $this->setRequestStatus( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5] ); + case 'RESOURCES': + return $this->setResources( $arglist[1], $arglist[2], $arglist[3] ); + case 'RRULE': + return $this->setRrule( $arglist[1], $arglist[2], $arglist[3] ); + case 'SEQUENCE': + return $this->setSequence( $arglist[1], $arglist[2] ); + case 'STATUS': + return $this->setStatus( $arglist[1], $arglist[2] ); + case 'SUMMARY': + return $this->setSummary( $arglist[1], $arglist[2] ); + case 'TRANSP': + return $this->setTransp( $arglist[1], $arglist[2] ); + case 'TRIGGER': + return $this->setTrigger( $arglist[1], $arglist[2], $arglist[3], $arglist[4], $arglist[5], $arglist[6], $arglist[7], $arglist[8], $arglist[9], $arglist[10], $arglist[11] ); + case 'TZID': + return $this->setTzid( $arglist[1], $arglist[2] ); + case 'TZNAME': + return $this->setTzname( $arglist[1], $arglist[2], $arglist[3] ); + case 'TZOFFSETFROM': + return $this->setTzoffsetfrom( $arglist[1], $arglist[2] ); + case 'TZOFFSETTO': + return $this->setTzoffsetto( $arglist[1], $arglist[2] ); + case 'TZURL': + return $this->setTzurl( $arglist[1], $arglist[2] ); + case 'UID': + return $this->setUid( $arglist[1], $arglist[2] ); + case 'URL': + return $this->setUrl( $arglist[1], $arglist[2] ); + default: + return $this->setXprop( $arglist[0], $arglist[1], $arglist[2] ); + } + return FALSE; + } +/*********************************************************************************/ +/** + * parse component unparsed data into properties + * + * @author Kjell-Inge Gustafsson + * @since 2.6.33 - 2010-12-14 + * @param mixed $unparsedtext, optional, strict rfc2445 formatted, single property string or array of property strings + * @return bool FALSE if error occurs during parsing + * + */ + function parse( $unparsedtext=null ) { + if( $unparsedtext ) { + if( !is_array( $unparsedtext )) + $unparsedtext = array( $unparsedtext ); + } + elseif( !isset( $this->unparsed )) + $unparsedtext = array(); + else + $unparsedtext = $this->unparsed; + $this->unparsed = array(); + $comp = & $this; + foreach ( $unparsedtext as $line ) { +// echo $comp->objName.": $line
"; // test ### + if( in_array( strtoupper( substr( $line, 0, 6 )), array( 'END:VA', 'END:ST', 'END:DA' ))) + $this->components[] = $comp->copy(); + elseif( 'END:' == strtoupper( substr( $line, 0, 4 ))) + break; + elseif( 'BEGIN:VALARM' == strtoupper( substr( $line, 0, 12 ))) + $comp = new valarm(); + elseif( 'BEGIN:STANDARD' == strtoupper( substr( $line, 0, 14 ))) + $comp = new vtimezone( 'standard' ); + elseif( 'BEGIN:DAYLIGHT' == strtoupper( substr( $line, 0, 14 ))) + $comp = new vtimezone( 'daylight' ); + elseif( 'BEGIN:' == strtoupper( substr( $line, 0, 6 ))) + continue; + else { + $comp->unparsed[] = $line; +// echo $comp->objName.": $line
\n"; // test ### + } + } +// echo $this->objName.'
'.var_export( $this->unparsed, TRUE )."
\n"; // test ### + /* concatenate property values spread over several lines */ + $lastix = -1; + $propnames = array( 'action', 'attach', 'attendee', 'categories', 'comment', 'completed' + , 'contact', 'class', 'created', 'description', 'dtend', 'dtstart' + , 'dtstamp', 'due', 'duration', 'exdate', 'exrule', 'freebusy', 'geo' + , 'last-modified', 'location', 'organizer', 'percent-complete' + , 'priority', 'rdate', 'recurrence-id', 'related-to', 'repeat' + , 'request-status', 'resources', 'rrule', 'sequence', 'status' + , 'summary', 'transp', 'trigger', 'tzid', 'tzname', 'tzoffsetfrom' + , 'tzoffsetto', 'tzurl', 'uid', 'url', 'x-' ); + $proprows = array(); + foreach( $this->unparsed as $line ) { + $newProp = FALSE; + foreach ( $propnames as $propname ) { + if( $propname == strtolower( substr( $line, 0, strlen( $propname )))) { + $newProp = TRUE; + break; + } + } + if( $newProp ) { + $newProp = FALSE; + $lastix++; + $proprows[$lastix] = $line; + } + else { + /* remove line breaks */ + if(( 1 < strlen( $proprows[$lastix] )) && + ( '\n' == substr( $proprows[$lastix], -2 )) && + ( ' ' == substr( $line, 0, 1 ))) { + $proprows[$lastix] = substr( $proprows[$lastix], 0, strlen( $proprows[$lastix] ) - 2 ); + $line = substr( $line, 1 ); + } + $proprows[$lastix] .= $line; + } + } + /* parse each property 'line' */ + foreach( $proprows as $line ) { + $line = str_replace( "\n ", '', $line ); + if( '\n' == substr( $line, -2 )) + $line = substr( $line, 0, strlen( $line ) - 2 ); + /* get propname, (problem with x-properties, otherwise in previous loop) */ + $cix = $propname = null; + for( $cix=0, $clen = strlen( $line ); $cix < $clen; $cix++ ) { + if( in_array( $line[$cix], array( ':', ';' ))) + break; + else { + $propname .= $line[$cix]; + } + } + if(( 'x-' == substr( $propname, 0, 2 )) || ( 'X-' == substr( $propname, 0, 2 ))) { + $propname2 = $propname; + $propname = 'X-'; + } + /* rest of the line is opt.params and value */ + $line = substr( $line, $cix ); + /* separate attributes from value */ + $attr = array(); + $attrix = -1; + $clen = strlen( $line ); + for( $cix=0; $cix < $clen; $cix++ ) { + if(( ':' == $line[$cix] ) && + ( '://' != substr( $line, $cix, 3 )) && + ( !in_array( strtolower( substr( $line, $cix - 3, 4 )), array( 'fax:', 'cid:', 'sms:', 'tel:', 'urn:' ))) && + ( !in_array( strtolower( substr( $line, $cix - 4, 5 )), array( 'crid:', 'news:', 'pres:' ))) && + ( 'mailto:' != strtolower( substr( $line, $cix - 6, 7 )))) { + $attrEnd = TRUE; + if(( $cix < ( $clen - 4 )) && + ctype_digit( substr( $line, $cix+1, 4 ))) { // an URI with a (4pos) portnr?? + for( $c2ix = $cix; 3 < $c2ix; $c2ix-- ) { + if( '://' == substr( $line, $c2ix - 2, 3 )) { + $attrEnd = FALSE; + break; // an URI with a portnr!! + } + } + } + if( $attrEnd) { + $line = substr( $line, $cix + 1 ); + break; + } + } + if( ';' == $line[$cix] ) + $attr[++$attrix] = null; + else + $attr[$attrix] .= $line[$cix]; + } + /* make attributes in array format */ + $propattr = array(); + foreach( $attr as $attribute ) { + $attrsplit = explode( '=', $attribute, 2 ); + if( 1 < count( $attrsplit )) + $propattr[$attrsplit[0]] = $attrsplit[1]; + else + $propattr[] = $attribute; + } + /* call setProperty( $propname.. . */ + switch( strtoupper( $propname )) { + case 'ATTENDEE': + foreach( $propattr as $pix => $attr ) { + $attr2 = explode( ',', $attr ); + if( 1 < count( $attr2 )) + $propattr[$pix] = $attr2; + } + $this->setProperty( $propname, $line, $propattr ); + break; + case 'CATEGORIES': + case 'RESOURCES': + if( FALSE !== strpos( $line, ',' )) { + $content = explode( ',', $line ); + $clen = count( $content ); + for( $cix = 0; $cix < $clen; $cix++ ) { + if( "\\" == substr($content[$cix], -1)) { + $content[$cix] .= ','.$content[$cix + 1]; + unset($content[$cix + 1]); + $cix++; + } + } + if( 1 < count( $content )) { + $content = array_values( $content ); + foreach( $content as $cix => $contentPart ) + $content[$cix] = calendarComponent::_strunrep( $contentPart ); + $this->setProperty( $propname, $content, $propattr ); + break; + } + else + $line = reset( $content ); + } + case 'X-': + $propname = ( isset( $propname2 )) ? $propname2 : $propname; + case 'COMMENT': + case 'CONTACT': + case 'DESCRIPTION': + case 'LOCATION': + case 'SUMMARY': + if( empty( $line )) + $propattr = null; + $this->setProperty( $propname, calendarComponent::_strunrep( $line ), $propattr ); + unset( $propname2 ); + break; + case 'REQUEST-STATUS': + $values = explode( ';', $line, 3 ); + $values[1] = ( !isset( $values[1] )) ? null : calendarComponent::_strunrep( $values[1] ); + $values[2] = ( !isset( $values[2] )) ? null : calendarComponent::_strunrep( $values[2] ); + $this->setProperty( $propname + , $values[0] // statcode + , $values[1] // statdesc + , $values[2] // extdata + , $propattr ); + break; + case 'FREEBUSY': + $fbtype = ( isset( $propattr['FBTYPE'] )) ? $propattr['FBTYPE'] : ''; // force setting default, if missing + unset( $propattr['FBTYPE'] ); + $values = explode( ',', $line ); + foreach( $values as $vix => $value ) { + $value2 = explode( '/', $value ); + if( 1 < count( $value2 )) + $values[$vix] = $value2; + } + $this->setProperty( $propname, $fbtype, $values, $propattr ); + break; + case 'GEO': + $value = explode( ';', $line, 2 ); + if( 2 > count( $value )) + $value[1] = null; + $this->setProperty( $propname, $value[0], $value[1], $propattr ); + break; + case 'EXDATE': + $values = ( !empty( $line )) ? explode( ',', $line ) : null; + $this->setProperty( $propname, $values, $propattr ); + break; + case 'RDATE': + if( empty( $line )) { + $this->setProperty( $propname, $line, $propattr ); + break; + } + $values = explode( ',', $line ); + foreach( $values as $vix => $value ) { + $value2 = explode( '/', $value ); + if( 1 < count( $value2 )) + $values[$vix] = $value2; + } + $this->setProperty( $propname, $values, $propattr ); + break; + case 'EXRULE': + case 'RRULE': + $values = explode( ';', $line ); + $recur = array(); + foreach( $values as $value2 ) { + if( empty( $value2 )) + continue; // ;-char in ending position ??? + $value3 = explode( '=', $value2, 2 ); + $rulelabel = strtoupper( $value3[0] ); + switch( $rulelabel ) { + case 'BYDAY': { + $value4 = explode( ',', $value3[1] ); + if( 1 < count( $value4 )) { + foreach( $value4 as $v5ix => $value5 ) { + $value6 = array(); + $dayno = $dayname = null; + $value5 = trim( (string) $value5 ); + if(( ctype_alpha( substr( $value5, -1 ))) && + ( ctype_alpha( substr( $value5, -2, 1 )))) { + $dayname = substr( $value5, -2, 2 ); + if( 2 < strlen( $value5 )) + $dayno = substr( $value5, 0, ( strlen( $value5 ) - 2 )); + } + if( $dayno ) + $value6[] = $dayno; + if( $dayname ) + $value6['DAY'] = $dayname; + $value4[$v5ix] = $value6; + } + } + else { + $value4 = array(); + $dayno = $dayname = null; + $value5 = trim( (string) $value3[1] ); + if(( ctype_alpha( substr( $value5, -1 ))) && + ( ctype_alpha( substr( $value5, -2, 1 )))) { + $dayname = substr( $value5, -2, 2 ); + if( 2 < strlen( $value5 )) + $dayno = substr( $value5, 0, ( strlen( $value5 ) - 2 )); + } + if( $dayno ) + $value4[] = $dayno; + if( $dayname ) + $value4['DAY'] = $dayname; + } + $recur[$rulelabel] = $value4; + break; + } + default: { + $value4 = explode( ',', $value3[1] ); + if( 1 < count( $value4 )) + $value3[1] = $value4; + $recur[$rulelabel] = $value3[1]; + break; + } + } // end - switch $rulelabel + } // end - foreach( $values.. . + $this->setProperty( $propname, $recur, $propattr ); + break; + case 'ACTION': + case 'CLASSIFICATION': + case 'STATUS': + case 'TRANSP': + case 'UID': + case 'TZID': + case 'RELATED-TO': + case 'TZNAME': + $line = calendarComponent::_strunrep( $line ); + default: + $this->setProperty( $propname, $line, $propattr ); + break; + } // end switch( $propname.. . + } // end - foreach( $proprows.. . + unset( $unparsedtext, $this->unparsed, $proprows ); + if( isset( $this->components ) && is_array( $this->components ) && ( 0 < count( $this->components ))) { + $ckeys = array_keys( $this->components ); + foreach( $ckeys as $ckey ) { + if( !empty( $this->components[$ckey] ) && !empty( $this->components[$ckey]->unparsed )) { + $this->components[$ckey]->parse(); + } + } + } + return TRUE; + } +/*********************************************************************************/ +/*********************************************************************************/ +/** + * return a copy of this component + * + * @author Kjell-Inge Gustafsson + * @since 2.2.16 - 2007-11-07 + * @return object + */ + function copy() { + $serialized_contents = serialize( $this ); + $copy = unserialize( $serialized_contents ); + unset( $copy->propix ); + return $copy; + } +/*********************************************************************************/ +/*********************************************************************************/ +/** + * delete calendar subcomponent from component container + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-15 + * @param mixed $arg1 ordno / component type / component uid + * @param mixed $arg2 optional, ordno if arg1 = component type + * @return void + */ + function deleteComponent( $arg1, $arg2=FALSE ) { + if( !isset( $this->components )) return FALSE; + $argType = $index = null; + if ( ctype_digit( (string) $arg1 )) { + $argType = 'INDEX'; + $index = (int) $arg1 - 1; + } + elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { + $argType = strtolower( $arg1 ); + $index = ( !empty( $arg2 ) && ctype_digit( (string) $arg2 )) ? (( int ) $arg2 - 1 ) : 0; + } + $cix2dC = 0; + foreach ( $this->components as $cix => $component) { + if( empty( $component )) continue; + unset( $component->propix ); + if(( 'INDEX' == $argType ) && ( $index == $cix )) { + unset( $this->components[$cix] ); + return TRUE; + } + elseif( $argType == $component->objName ) { + if( $index == $cix2dC ) { + unset( $this->components[$cix] ); + return TRUE; + } + $cix2dC++; + } + elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { + unset( $this->components[$cix] ); + return TRUE; + } + } + return FALSE; + } +/** + * get calendar component subcomponent from component container + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-15 + * @param mixed $arg1 optional, ordno/component type/ component uid + * @param mixed $arg2 optional, ordno if arg1 = component type + * @return object + */ + function getComponent ( $arg1=FALSE, $arg2=FALSE ) { + if( !isset( $this->components )) return FALSE; + $index = $argType = null; + if ( !$arg1 ) { + $argType = 'INDEX'; + $index = $this->compix['INDEX'] = + ( isset( $this->compix['INDEX'] )) ? $this->compix['INDEX'] + 1 : 1; + } + elseif ( ctype_digit( (string) $arg1 )) { + $argType = 'INDEX'; + $index = (int) $arg1; + unset( $this->compix ); + } + elseif(( strlen( $arg1 ) <= strlen( 'vfreebusy' )) && ( FALSE === strpos( $arg1, '@' ))) { + unset( $this->compix['INDEX'] ); + $argType = strtolower( $arg1 ); + if( !$arg2 ) + $index = $this->compix[$argType] = ( isset( $this->compix[$argType] )) ? $this->compix[$argType] + 1 : 1; + else + $index = (int) $arg2; + } + $index -= 1; + $ckeys = array_keys( $this->components ); + if( !empty( $index) && ( $index > end( $ckeys ))) + return FALSE; + $cix2gC = 0; + foreach( $this->components as $cix => $component ) { + if( empty( $component )) continue; + unset( $component->propix ); + if(( 'INDEX' == $argType ) && ( $index == $cix )) + return $component->copy(); + elseif( $argType == $component->objName ) { + if( $index == $cix2gC ) + return $component->copy(); + $cix2gC++; + } + elseif( !$argType && ( $arg1 == $component->getProperty( 'uid' ))) { + unset( $component->propix ); + return $component->copy(); + } + } + /* not found.. . */ + unset( $this->compix ); + return false; + } +/** + * add calendar component as subcomponent to container for subcomponents + * + * @author Kjell-Inge Gustafsson + * @since 1.x.x - 2007-04-24 + * @param object $component calendar component + * @return void + */ + function addSubComponent ( $component ) { + $this->setComponent( $component ); + } +/** + * create new calendar component subcomponent, already included within component + * + * @author Kjell-Inge Gustafsson + * @since 2.6.33 - 2011-01-03 + * @param string $compType subcomponent type + * @return object (reference) + */ + function & newComponent( $compType ) { + $config = $this->getConfig(); + $keys = array_keys( $this->components ); + $ix = end( $keys) + 1; + switch( strtoupper( $compType )) { + case 'ALARM': + case 'VALARM': + $this->components[$ix] = new valarm( $config ); + break; + case 'STANDARD': + array_unshift( $this->components, new vtimezone( 'STANDARD', $config )); + $ix = 0; + break; + case 'DAYLIGHT': + $this->components[$ix] = new vtimezone( 'DAYLIGHT', $config ); + break; + default: + return FALSE; + } + return $this->components[$ix]; + } +/** + * add calendar component as subcomponent to container for subcomponents + * + * @author Kjell-Inge Gustafsson + * @since 2.6.28 - 2011-01-01 + * @param object $component calendar component + * @param mixed $arg1 optional, ordno/component type/ component uid + * @param mixed $arg2 optional, ordno if arg1 = component type + * @return bool + */ + function setComponent( $component, $arg1=FALSE, $arg2=FALSE ) { + if( !isset( $this->components )) return FALSE; + $component->setConfig( $this->getConfig(), FALSE, TRUE ); + if( !in_array( $component->objName, array( 'valarm', 'vtimezone', 'standard', 'daylight' ))) { + unset( $component->propix ); + /* make sure dtstamp and uid is set */ + $dummy = $component->getProperty( 'dtstamp' ); + $dummy = $component->getProperty( 'uid' ); + } + if( !$arg1 ) { // plain insert, last in chain + $this->components[] = $component->copy(); + return TRUE; + } + $argType = $index = null; + if ( ctype_digit( (string) $arg1 )) { // index insert/replace + $argType = 'INDEX'; + $index = (int) $arg1 - 1; + } + elseif( in_array( strtolower( $arg1 ), array( 'vevent', 'vtodo', 'vjournal', 'vfreebusy', 'valarm', 'vtimezone' ))) { + $argType = strtolower( $arg1 ); + $index = ( ctype_digit( (string) $arg2 )) ? ((int) $arg2) - 1 : 0; + } + // else if arg1 is set, arg1 must be an UID + $cix2sC = 0; + foreach ( $this->components as $cix => $component2 ) { + if( empty( $component2 )) continue; + unset( $component2->propix ); + if(( 'INDEX' == $argType ) && ( $index == $cix )) { // index insert/replace + $this->components[$cix] = $component->copy(); + return TRUE; + } + elseif( $argType == $component2->objName ) { // component Type index insert/replace + if( $index == $cix2sC ) { + $this->components[$cix] = $component->copy(); + return TRUE; + } + $cix2sC++; + } + elseif( !$argType && ( $arg1 == $component2->getProperty( 'uid' ))) { // UID insert/replace + $this->components[$cix] = $component->copy(); + return TRUE; + } + } + /* arg1=index and not found.. . insert at index .. .*/ + if( 'INDEX' == $argType ) { + $this->components[$index] = $component->copy(); + ksort( $this->components, SORT_NUMERIC ); + } + else /* not found.. . insert last in chain anyway .. .*/ + $this->components[] = $component->copy(); + return TRUE; + } +/** + * creates formatted output for subcomponents + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-12-12 + * @return string + */ + function createSubComponent() { + $output = null; + foreach( $this->components as $component ) { + if( empty( $component )) continue; + $component->setConfig( $this->getConfig(), FALSE, TRUE ); + $output .= $component->createComponent( $this->xcaldecl ); + } + return $output; + } +/********************************************************************************/ +/** + * break lines at pos 75 + * + * Lines of text SHOULD NOT be longer than 75 octets, excluding the line + * break. Long content lines SHOULD be split into a multiple line + * representations using a line "folding" technique. That is, a long + * line can be split between any two characters by inserting a CRLF + * immediately followed by a single linear white space character (i.e., + * SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence + * of CRLF followed immediately by a single linear white space character + * is ignored (i.e., removed) when processing the content type. + * + * Edited 2007-08-26 by Anders Litzell, anders@litzell.se to fix bug where + * the reserved expression "\n" in the arg $string could be broken up by the + * folding of lines, causing ambiguity in the return string. + * Fix uses var $breakAtChar=75 and breaks the line at $breakAtChar-1 if need be. + * + * @author Kjell-Inge Gustafsson + * @since 2.6.13 - 2010-12-06 + * @param string $value + * @return string + */ + function _size75( $string ) { + $tmp = $string; + $string = null; + /* if PHP is config with mb_string.. . */ + if( defined( MB_OVERLOAD_STRING )) { + $strlen = mb_strlen( $tmp ); + while( $strlen > 75 ) { + $breakAtChar = 75; + if( substr( $tmp, ( $breakAtChar - 1 ), strlen( '\n' )) == '\n' ) + $breakAtChar = $breakAtChar - 1; + $string .= mb_substr( $tmp, 0, $breakAtChar ).$this->nl; + $tmp = ' '.mb_substr( $tmp, $breakAtChar ); + $strlen = mb_strlen( $tmp ); + } // end while + $string .= rtrim( $tmp ); // the rest + if( $this->nl != mb_substr( $string, ( 0 - strlen( $this->nl )))) + $string .= $this->nl; + return $string; + } + /* if PHP is not config with mb_string.. . */ + $eolcharlen = strlen( '\n' ); + $eolchrxlen = strlen( "\n" ); + while( TRUE ) { + $bytecnt = strlen( $tmp ); + $charCnt = $ix = 0; + for( $ix = 0; $ix < $bytecnt; $ix++ ) { + if(( 73 < $charCnt ) && ( '\n' == substr( $tmp, $ix, $eolcharlen ))) { + $ix += $eolcharlen; + break; // break when '\n' and eol + } + elseif( 74 < $charCnt ) + break; // always break for-loop here + else { + $byte = ord( $tmp[$ix] ); + if ($byte <= 127) { // add a one byte character + $string .= substr( $tmp, $ix, 1 ); + $charCnt += 1; + } + else if ($byte >= 194 && $byte <= 223) { // start byte in two byte character + $string .= substr( $tmp, $ix, 2 ); // add a two bytes character + $charCnt += 1; + } + else if ($byte >= 224 && $byte <= 239) { // start byte in three bytes character + $string .= substr( $tmp, $ix, 3 ); // add a three bytes character + $charCnt += 1; + } + else if ($byte >= 240 && $byte <= 244) { // start byte in four bytes character + $string .= substr( $tmp, $ix, 4 ); // add a four bytes character + $charCnt += 1; + } + } + } // end for + $string .= $this->nl; + $tmp = substr( $tmp, $ix ); + if( empty( $tmp )) + break; // while-loop breakes here + else + $tmp = ' '.$tmp; + } // end while + $string .= rtrim( $tmp ); // the rest + $string = str_replace( "\\\\n", "\\n", $string ); + if( $this->nl != substr( $string, ( 0 - strlen( $this->nl )))) + $string .= $this->nl; + return $string; + } +/** + * special characters management output + * + * @author Kjell-Inge Gustafsson + * @since 2.6.15 - 2010-09-24 + * @param string $string + * @return string + */ + function _strrep( $string ) { + switch( $this->format ) { + case 'xcal': + $string = str_replace( '\n', $this->nl, $string); + $string = htmlspecialchars( strip_tags( stripslashes( urldecode ( $string )))); + break; + default: + $pos = 0; + $specChars = array( 'n', 'N', 'r', ',', ';' ); + while( $pos <= strlen( $string )) { + $pos = strpos( $string, "\\", $pos ); + if( FALSE === $pos ) + break; + if( !in_array( substr( $string, $pos, 1 ), $specChars )) { + $string = substr( $string, 0, $pos )."\\".substr( $string, ( $pos + 1 )); + $pos += 1; + } + $pos += 1; + } + if( FALSE !== strpos( $string, '"' )) + $string = str_replace('"', "'", $string); + if( FALSE !== strpos( $string, ',' )) + $string = str_replace(',', '\,', $string); + if( FALSE !== strpos( $string, ';' )) + $string = str_replace(';', '\;', $string); + if( FALSE !== strpos( $string, "\r\n" )) + $string = str_replace( "\r\n", '\n', $string); + elseif( FALSE !== strpos( $string, "\r" )) + $string = str_replace( "\r", '\n', $string); + + elseif( FALSE !== strpos( $string, "\n" )) + $string = str_replace( "\n", '\n', $string); + + if( FALSE !== strpos( $string, '\N' )) + $string = str_replace( '\N', '\n', $string); +// if( FALSE !== strpos( $string, $this->nl )) + $string = str_replace( $this->nl, '\n', $string); + break; + } + return $string; + } +/** + * special characters management input (from iCal file) + * + * @author Kjell-Inge Gustafsson + * @since 2.6.22 - 2010-10-17 + * @param string $string + * @return string + */ + static function _strunrep( $string ) { + $string = str_replace( '\\\\', '\\', $string); + $string = str_replace( '\,', ',', $string); + $string = str_replace( '\;', ';', $string); +// $string = str_replace( '\n', $this->nl, $string); // ?? + return $string; + } +} +/*********************************************************************************/ +/*********************************************************************************/ +/** + * class for calendar component VEVENT + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-12 + */ +class vevent extends calendarComponent { + var $attach; + var $attendee; + var $categories; + var $comment; + var $contact; + var $class; + var $created; + var $description; + var $dtend; + var $dtstart; + var $duration; + var $exdate; + var $exrule; + var $geo; + var $lastmodified; + var $location; + var $organizer; + var $priority; + var $rdate; + var $recurrenceid; + var $relatedto; + var $requeststatus; + var $resources; + var $rrule; + var $sequence; + var $status; + var $summary; + var $transp; + var $url; + var $xprop; + // component subcomponents container + var $components; +/** + * constructor for calendar component VEVENT object + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-20 + * @param array $config + * @return void + */ + function vevent( $config = array()) { + $this->calendarComponent(); + + $this->attach = ''; + $this->attendee = ''; + $this->categories = ''; + $this->class = ''; + $this->comment = ''; + $this->contact = ''; + $this->created = ''; + $this->description = ''; + $this->dtstart = ''; + $this->dtend = ''; + $this->duration = ''; + $this->exdate = ''; + $this->exrule = ''; + $this->geo = ''; + $this->lastmodified = ''; + $this->location = ''; + $this->organizer = ''; + $this->priority = ''; + $this->rdate = ''; + $this->recurrenceid = ''; + $this->relatedto = ''; + $this->requeststatus = ''; + $this->resources = ''; + $this->rrule = ''; + $this->sequence = ''; + $this->status = ''; + $this->summary = ''; + $this->transp = ''; + $this->url = ''; + $this->xprop = ''; + + $this->components = array(); + + if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) + $config['language'] = ICAL_LANG; + if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; + if( !isset( $config['nl'] )) $config['nl'] = PHP_EOL; + if( !isset( $config['format'] )) $config['format'] = 'iCal'; + if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; + $this->setConfig( $config ); + + } +/** + * create formatted output for calendar component VEVENT object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-07 + * @param array $xcaldecl + * @return string + */ + function createComponent( &$xcaldecl ) { + $objectname = $this->_createFormat(); + $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; + $component .= $this->createUid(); + $component .= $this->createDtstamp(); + $component .= $this->createAttach(); + $component .= $this->createAttendee(); + $component .= $this->createCategories(); + $component .= $this->createComment(); + $component .= $this->createContact(); + $component .= $this->createClass(); + $component .= $this->createCreated(); + $component .= $this->createDescription(); + $component .= $this->createDtstart(); + $component .= $this->createDtend(); + $component .= $this->createDuration(); + $component .= $this->createExdate(); + $component .= $this->createExrule(); + $component .= $this->createGeo(); + $component .= $this->createLastModified(); + $component .= $this->createLocation(); + $component .= $this->createOrganizer(); + $component .= $this->createPriority(); + $component .= $this->createRdate(); + $component .= $this->createRrule(); + $component .= $this->createRelatedTo(); + $component .= $this->createRequestStatus(); + $component .= $this->createRecurrenceid(); + $component .= $this->createResources(); + $component .= $this->createSequence(); + $component .= $this->createStatus(); + $component .= $this->createSummary(); + $component .= $this->createTransp(); + $component .= $this->createUrl(); + $component .= $this->createXprop(); + $component .= $this->createSubComponent(); + $component .= $this->componentEnd1.$objectname.$this->componentEnd2; + if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { + foreach( $this->xcaldecl as $localxcaldecl ) + $xcaldecl[] = $localxcaldecl; + } + return $component; + } +} +/*********************************************************************************/ +/*********************************************************************************/ +/** + * class for calendar component VTODO + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-12 + */ +class vtodo extends calendarComponent { + var $attach; + var $attendee; + var $categories; + var $comment; + var $completed; + var $contact; + var $class; + var $created; + var $description; + var $dtstart; + var $due; + var $duration; + var $exdate; + var $exrule; + var $geo; + var $lastmodified; + var $location; + var $organizer; + var $percentcomplete; + var $priority; + var $rdate; + var $recurrenceid; + var $relatedto; + var $requeststatus; + var $resources; + var $rrule; + var $sequence; + var $status; + var $summary; + var $url; + var $xprop; + // component subcomponents container + var $components; +/** + * constructor for calendar component VTODO object + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-20 + * @param array $config + * @return void + */ + function vtodo( $config = array()) { + $this->calendarComponent(); + + $this->attach = ''; + $this->attendee = ''; + $this->categories = ''; + $this->class = ''; + $this->comment = ''; + $this->completed = ''; + $this->contact = ''; + $this->created = ''; + $this->description = ''; + $this->dtstart = ''; + $this->due = ''; + $this->duration = ''; + $this->exdate = ''; + $this->exrule = ''; + $this->geo = ''; + $this->lastmodified = ''; + $this->location = ''; + $this->organizer = ''; + $this->percentcomplete = ''; + $this->priority = ''; + $this->rdate = ''; + $this->recurrenceid = ''; + $this->relatedto = ''; + $this->requeststatus = ''; + $this->resources = ''; + $this->rrule = ''; + $this->sequence = ''; + $this->status = ''; + $this->summary = ''; + $this->url = ''; + $this->xprop = ''; + + $this->components = array(); + + if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) + $config['language'] = ICAL_LANG; + if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; + if( !isset( $config['nl'] )) $config['nl'] = PHP_EOL; + if( !isset( $config['format'] )) $config['format'] = 'iCal'; + if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; + $this->setConfig( $config ); + + } +/** + * create formatted output for calendar component VTODO object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-11-07 + * @param array $xcaldecl + * @return string + */ + function createComponent( &$xcaldecl ) { + $objectname = $this->_createFormat(); + $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; + $component .= $this->createUid(); + $component .= $this->createDtstamp(); + $component .= $this->createAttach(); + $component .= $this->createAttendee(); + $component .= $this->createCategories(); + $component .= $this->createClass(); + $component .= $this->createComment(); + $component .= $this->createCompleted(); + $component .= $this->createContact(); + $component .= $this->createCreated(); + $component .= $this->createDescription(); + $component .= $this->createDtstart(); + $component .= $this->createDue(); + $component .= $this->createDuration(); + $component .= $this->createExdate(); + $component .= $this->createExrule(); + $component .= $this->createGeo(); + $component .= $this->createLastModified(); + $component .= $this->createLocation(); + $component .= $this->createOrganizer(); + $component .= $this->createPercentComplete(); + $component .= $this->createPriority(); + $component .= $this->createRdate(); + $component .= $this->createRelatedTo(); + $component .= $this->createRequestStatus(); + $component .= $this->createRecurrenceid(); + $component .= $this->createResources(); + $component .= $this->createRrule(); + $component .= $this->createSequence(); + $component .= $this->createStatus(); + $component .= $this->createSummary(); + $component .= $this->createUrl(); + $component .= $this->createXprop(); + $component .= $this->createSubComponent(); + $component .= $this->componentEnd1.$objectname.$this->componentEnd2; + if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { + foreach( $this->xcaldecl as $localxcaldecl ) + $xcaldecl[] = $localxcaldecl; + } + return $component; + } +} +/*********************************************************************************/ +/*********************************************************************************/ +/** + * class for calendar component VJOURNAL + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-12 + */ +class vjournal extends calendarComponent { + var $attach; + var $attendee; + var $categories; + var $comment; + var $contact; + var $class; + var $created; + var $description; + var $dtstart; + var $exdate; + var $exrule; + var $lastmodified; + var $organizer; + var $rdate; + var $recurrenceid; + var $relatedto; + var $requeststatus; + var $rrule; + var $sequence; + var $status; + var $summary; + var $url; + var $xprop; +/** + * constructor for calendar component VJOURNAL object + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-20 + * @param array $config + * @return void + */ + function vjournal( $config = array()) { + $this->calendarComponent(); + + $this->attach = ''; + $this->attendee = ''; + $this->categories = ''; + $this->class = ''; + $this->comment = ''; + $this->contact = ''; + $this->created = ''; + $this->description = ''; + $this->dtstart = ''; + $this->exdate = ''; + $this->exrule = ''; + $this->lastmodified = ''; + $this->organizer = ''; + $this->rdate = ''; + $this->recurrenceid = ''; + $this->relatedto = ''; + $this->requeststatus = ''; + $this->rrule = ''; + $this->sequence = ''; + $this->status = ''; + $this->summary = ''; + $this->url = ''; + $this->xprop = ''; + + if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) + $config['language'] = ICAL_LANG; + if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; + if( !isset( $config['nl'] )) $config['nl'] = PHP_EOL; + if( !isset( $config['format'] )) $config['format'] = 'iCal'; + if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; + $this->setConfig( $config ); + + } +/** + * create formatted output for calendar component VJOURNAL object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-12 + * @param array $xcaldecl + * @return string + */ + function createComponent( &$xcaldecl ) { + $objectname = $this->_createFormat(); + $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; + $component .= $this->createUid(); + $component .= $this->createDtstamp(); + $component .= $this->createAttach(); + $component .= $this->createAttendee(); + $component .= $this->createCategories(); + $component .= $this->createClass(); + $component .= $this->createComment(); + $component .= $this->createContact(); + $component .= $this->createCreated(); + $component .= $this->createDescription(); + $component .= $this->createDtstart(); + $component .= $this->createExdate(); + $component .= $this->createExrule(); + $component .= $this->createLastModified(); + $component .= $this->createOrganizer(); + $component .= $this->createRdate(); + $component .= $this->createRequestStatus(); + $component .= $this->createRecurrenceid(); + $component .= $this->createRelatedTo(); + $component .= $this->createRrule(); + $component .= $this->createSequence(); + $component .= $this->createStatus(); + $component .= $this->createSummary(); + $component .= $this->createUrl(); + $component .= $this->createXprop(); + $component .= $this->componentEnd1.$objectname.$this->componentEnd2; + if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { + foreach( $this->xcaldecl as $localxcaldecl ) + $xcaldecl[] = $localxcaldecl; + } + return $component; + } +} +/*********************************************************************************/ +/*********************************************************************************/ +/** + * class for calendar component VFREEBUSY + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-12 + */ +class vfreebusy extends calendarComponent { + var $attendee; + var $comment; + var $contact; + var $dtend; + var $dtstart; + var $duration; + var $freebusy; + var $organizer; + var $requeststatus; + var $url; + var $xprop; + // component subcomponents container + var $components; +/** + * constructor for calendar component VFREEBUSY object + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-10 + * @param array $config + * @return void + */ + function vfreebusy( $config = array()) { + $this->calendarComponent(); + + $this->attendee = ''; + $this->comment = ''; + $this->contact = ''; + $this->dtend = ''; + $this->dtstart = ''; + $this->duration = ''; + $this->freebusy = ''; + $this->organizer = ''; + $this->requeststatus = ''; + $this->url = ''; + $this->xprop = ''; + + if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) + $config['language'] = ICAL_LANG; + if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; + if( !isset( $config['nl'] )) $config['nl'] = PHP_EOL; + if( !isset( $config['format'] )) $config['format'] = 'iCal'; + if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; + $this->setConfig( $config ); + + } +/** + * create formatted output for calendar component VFREEBUSY object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.3.1 - 2007-11-19 + * @param array $xcaldecl + * @return string + */ + function createComponent( &$xcaldecl ) { + $objectname = $this->_createFormat(); + $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; + $component .= $this->createUid(); + $component .= $this->createDtstamp(); + $component .= $this->createAttendee(); + $component .= $this->createComment(); + $component .= $this->createContact(); + $component .= $this->createDtstart(); + $component .= $this->createDtend(); + $component .= $this->createDuration(); + $component .= $this->createFreebusy(); + $component .= $this->createOrganizer(); + $component .= $this->createRequestStatus(); + $component .= $this->createUrl(); + $component .= $this->createXprop(); + $component .= $this->componentEnd1.$objectname.$this->componentEnd2; + if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { + foreach( $this->xcaldecl as $localxcaldecl ) + $xcaldecl[] = $localxcaldecl; + } + return $component; + } +} +/*********************************************************************************/ +/*********************************************************************************/ +/** + * class for calendar component VALARM + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-12 + */ +class valarm extends calendarComponent { + var $action; + var $attach; + var $attendee; + var $description; + var $duration; + var $repeat; + var $summary; + var $trigger; + var $xprop; +/** + * constructor for calendar component VALARM object + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-20 + * @param array $config + * @return void + */ + function valarm( $config = array()) { + $this->calendarComponent(); + + $this->action = ''; + $this->attach = ''; + $this->attendee = ''; + $this->description = ''; + $this->duration = ''; + $this->repeat = ''; + $this->summary = ''; + $this->trigger = ''; + $this->xprop = ''; + + if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) + $config['language'] = ICAL_LANG; + if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; + if( !isset( $config['nl'] )) $config['nl'] = PHP_EOL; + if( !isset( $config['format'] )) $config['format'] = 'iCal'; + if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; + $this->setConfig( $config ); + + } +/** + * create formatted output for calendar component VALARM object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-22 + * @param array $xcaldecl + * @return string + */ + function createComponent( &$xcaldecl ) { + $objectname = $this->_createFormat(); + $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; + $component .= $this->createAction(); + $component .= $this->createAttach(); + $component .= $this->createAttendee(); + $component .= $this->createDescription(); + $component .= $this->createDuration(); + $component .= $this->createRepeat(); + $component .= $this->createSummary(); + $component .= $this->createTrigger(); + $component .= $this->createXprop(); + $component .= $this->componentEnd1.$objectname.$this->componentEnd2; + return $component; + } +} +/********************************************************************************** +/*********************************************************************************/ +/** + * class for calendar component VTIMEZONE + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-12 + */ +class vtimezone extends calendarComponent { + var $timezonetype; + + var $comment; + var $dtstart; + var $lastmodified; + var $rdate; + var $rrule; + var $tzid; + var $tzname; + var $tzoffsetfrom; + var $tzoffsetto; + var $tzurl; + var $xprop; + // component subcomponents container + var $components; +/** + * constructor for calendar component VTIMEZONE object + * + * @author Kjell-Inge Gustafsson + * @since 2.6.27 - 2010-11-20 + * @param mixed $timezonetype optional, default FALSE ( STANDARD / DAYLIGHT ) + * @param array $config + * @return void + */ + function vtimezone( $timezonetype=FALSE, $config = array()) { + if( is_array( $timezonetype )) { + $config = $timezonetype; + $timezonetype = FALSE; + } + if( !$timezonetype ) + $this->timezonetype = 'VTIMEZONE'; + else + $this->timezonetype = strtoupper( $timezonetype ); + $this->calendarComponent(); + + $this->comment = ''; + $this->dtstart = ''; + $this->lastmodified = ''; + $this->rdate = ''; + $this->rrule = ''; + $this->tzid = ''; + $this->tzname = ''; + $this->tzoffsetfrom = ''; + $this->tzoffsetto = ''; + $this->tzurl = ''; + $this->xprop = ''; + + $this->components = array(); + + if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) + $config['language'] = ICAL_LANG; + if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; + if( !isset( $config['nl'] )) $config['nl'] = PHP_EOL; + if( !isset( $config['format'] )) $config['format'] = 'iCal'; + if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; + $this->setConfig( $config ); + + } +/** + * create formatted output for calendar component VTIMEZONE object instance + * + * @author Kjell-Inge Gustafsson + * @since 2.5.1 - 2008-10-25 + * @param array $xcaldecl + * @return string + */ + function createComponent( &$xcaldecl ) { + $objectname = $this->_createFormat(); + $component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; + $component .= $this->createTzid(); + $component .= $this->createLastModified(); + $component .= $this->createTzurl(); + $component .= $this->createDtstart(); + $component .= $this->createTzoffsetfrom(); + $component .= $this->createTzoffsetto(); + $component .= $this->createComment(); + $component .= $this->createRdate(); + $component .= $this->createRrule(); + $component .= $this->createTzname(); + $component .= $this->createXprop(); + $component .= $this->createSubComponent(); + $component .= $this->componentEnd1.$objectname.$this->componentEnd2; + if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { + foreach( $this->xcaldecl as $localxcaldecl ) + $xcaldecl[] = $localxcaldecl; + } + return $component; + } +} +?> \ No newline at end of file diff --git a/iCalcreator/lgpl.txt b/iCalcreator/lgpl.txt new file mode 100644 index 0000000..5ab7695 --- /dev/null +++ b/iCalcreator/lgpl.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/iCalcreator/releaseNotes-2.8.txt b/iCalcreator/releaseNotes-2.8.txt new file mode 100644 index 0000000..8e07fd8 --- /dev/null +++ b/iCalcreator/releaseNotes-2.8.txt @@ -0,0 +1,100 @@ +2.6.1 ###################### +config 'nl' default set to PHP_EOL +function vcalendar, parse + +2.6.2 ###################### /thanks, Simon L. +function selectComponents, select components with (latest) recurrence_id + +2.6.3 ###################### +function sort, refactored + +2.6.4 ###################### +function deleteProperty (removal of x-properties) + +2.6.5 ###################### +function getConfig, typo error + +2.6.6 ###################### +function setConfig, no longer creates file (on disc) when setting 'filename' + +2.6.7 ###################### /thanks Steve S. +using.html, typo errors + +2.6.8 ###################### +Updated calendar properties PRODID and VERSION + +2.6.9 ###################### +function createSequence, setSequence, getProperty, allow SEQUENCE '0' + +2.6.10 ###################### +function _format_duration, fix duration format, skip trailing ..0S, ..0M0S etc. + +2.6.11 ###################### +function (component) parse and management of all TEXT-properties + +2.6.12 ###################### /thanks Enrico T. +function _setMval, PHP error + +2.6.13 ###################### /thanks Ivar N. and Robert S. +function _size75, support for multibyte characters +alt. using mb_string, if installed and configured + +2.6.15 ###################### +function _strrep, eol character management + +2.6.19 ###################### +function deletePropertyM typo errror + +2.6.20 ###################### +function (component) parse, return value + +2.6.20 ###################### +function selectComponent, accepts DUE in vtodo if DTSTART is missing + +2.6.22 ###################### +utility (static) functions collected in support class, +iCalUtilityFunctions.class.php + +2.6.23 ###################### +function selectComponents, RDATE/EXDATE bug + +2.6.24 ###################### +function setDescription, force index=1 if NOT vjournal +DESCRIPTION MAY occur more than once only in VJOURNAL component + +2.6.25 ###################### +function makeDtstamp, bug in date creation + +2.6.26 ###################### +function setComponent, insert at index position + +2.6.27 ###################### +function setConfig, accepts array as single argument +function getConfig. returns array if called without arguments +create vcalendar/components and accept config array as argument + +2.6.28 ###################### /Damian R. +function setComponent, bugfix when using a short UID + +2.6.29 ###################### +function setOrganizer, value prefix (protocol) + +2.6.31 ###################### /thanks Nate +function _date_time_string, Time Zone incorrectly detected + +2.6.32 ###################### /thanks Mauro B. +function (calendar ) parse, removed argument filename, accepts string/array (calendar) + +2.6.33 ###################### +new function newComponent, factory-method for creating components + +2.6.34 ###################### +function setAttendee, setRdate, all TEXT-properties etc +property parameters in rfc 2445 order + +2.6.35 ###################### +function _date_time_string, bug when datetime ends with 'T000000Z' + +2.6.36 ###################### /thanks Greg L. +date_default_timezone_set is available from PHP 5.1.0, updated + diff --git a/iCalcreator/samples.php b/iCalcreator/samples.php new file mode 100644 index 0000000..6e6be6c --- /dev/null +++ b/iCalcreator/samples.php @@ -0,0 +1,275 @@ +\n
\n"; + +$v = new vcalendar( array( 'unique_id' => 'test.org' )); + // initiate new CALENDAR + +$e = & $v->newComponent( 'vevent' ); // initiate a new EVENT +$e->setProperty( 'categories' + , 'FAMILY' ); // catagorize +$e->setProperty( 'dtstart' + , 2006, 12, 24, 19, 30, 00 ); // 24 dec 2006 19.30 +$e->setProperty( 'duration' + , 0, 0, 3 ); // 3 hours +$e->setProperty( 'description' + , 'x-mas evening - diner' ); // describe the event +$e->setProperty( 'location' + , 'Home' ); // locate the event + +/* alt. production */ +// $v->returnCalendar(); // generate and redirect output to user browser + +/* alt. dev. and test */ +$str = $v->createCalendar(); // generate and get output in string, for testing? +echo $str; +echo "
\n\n"; + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +$v = new vcalendar( array( 'unique_id' => 'test.org' )); + // initiate new CALENDAR + +$v->setProperty( 'X-WR-CALNAME' + , 'Sample calendar' ); // set some X-properties, name, content.. . +$v->setProperty( 'X-WR-CALDESC' + , 'Description of the calendar' ); +$v->setProperty( 'X-WR-TIMEZONE' + , 'Europe/Stockholm' ); + +$e = & $v->newComponent( 'vevent' ); // initiate a new EVENT +$e->setProperty( 'categories' + , 'FAMILY' ); // catagorize +$e->setProperty( 'dtstart' + , 2007, 12, 24, 19, 30, 00 ); // 24 dec 2007 19.30 +$e->setProperty( 'duration' + , 0, 0, 3 ); // 3 hours +$e->setProperty( 'description' + , 'x-mas evening - diner' ); // describe the event +$e->setProperty( 'location' + , 'Home' ); // locate the event + +$a = & $e->newComponent( 'valarm' ); // initiate ALARM +$a->setProperty( 'action' + , 'DISPLAY' ); // set what to do +$a->setProperty( 'description' + , 'Buy X-mas gifts' ); // describe alarm +$a->setProperty( 'trigger' + , array( 'week' => 1 )); // set trigger one week before + +/* alt. production */ +// $v->returnCalendar(); // generate and redirect output to user browser +/* alt. dev. and test */ +$str = $v->createCalendar(); // generate and get output in string, for testing? +echo $str; +echo "
\n\n"; + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +/* define timezone */ +$v = new vcalendar( array( 'unique_id' => 'test.org' )); +$t = & $v->newComponent( 'vtimezone' ); +$t->setProperty( 'tzid' + , 'US-Eastern'); +$t->setProperty( 'last-modified' + , 1987, 1, 1 ); + +$ts = & $t->newComponent( 'standard' ); // initiate timezone standard +$ts->setProperty( 'dtstart' + , 1997, 10, 26, 2 ); +$rdate1 = array ( 'year' => 1997, 'month' => 10, 'day' => 26, 'hour' => 02, 'min' => 0, 'sec' => 0 ); +$ts->setProperty( 'rdate' + , array( $rdate1 )); +$ts->setProperty( 'tzoffsetfrom' + , '-0400' ); +$ts->setProperty( 'tzoffsetto' + , '-0500' ); +$ts->setProperty( 'tzname' + , 'EST' ); + +$td = & $t->newComponent( 'daylight' ); // initiate timezone daylight +$td->setProperty( 'dtstart' + , 1997, 10, 26, 2 ); +$rdate1 = array ( 'year' => 1997, 'month' => 4, 'day' => 6, 'hour' => 02, 'min' => 0, 'sec' => 0 ); +$td->setProperty( 'rdate' + , array( $rdate1 )); +$td->setProperty( 'tzoffsetfrom' + , '-0500' ); +$td->setProperty( 'tzoffsetto' + , '-0400' ); +$td->setProperty( 'tzname' + , 'EDT' ); + +/* alt. production +$v->returnCalendar(); // generate and redirect output to user browser +*/ +/* alt. dev. and test */ +$str = $v->createCalendar(); // generate and get output in string, for testing? +echo $str; +echo "
\n\n"; + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* + * Samples from RFC2445, all output as strings to display + */ + +/* + * Example: The following is an example of the "VEVENT" calendar + * component used to represent a meeting that will also be opaque to + * searches for busy time: + * BEGIN:VEVENT + * UID:19970901T130000Z-123401@host.com + * DTSTAMP:19970901T1300Z + * DTSTART:19970903T163000Z + * DTEND:19970903T190000Z + * SUMMARY:Annual Employee Review + * CLASS:PRIVATE + * CATEGORIES:BUSINESS,HUMAN RESOURCES + * END:VEVENT + */ +$c = new vcalendar( array( 'unique_id' => 'test.org' )); +$e = & $c->newComponent( 'vevent' ); +$e->setProperty( 'dtstart' + , '19970901T163000Z' ); +$e->setProperty( 'dtend' + , '19970903T190000Z' ); +$e->setProperty( 'summary' + , 'Annual Employee Review' ); +$e->setProperty( 'class' + , 'PRIVATE' ); +$e->setProperty( 'categories' + , 'BUSINESS' ); +$e->setProperty( 'categories' + , 'HUMAN RESOURCES' ); + +$str = $c->createCalendar(); +echo $str; +echo "
\n\n"; +/* + * The following is an example of the "VEVENT" calendar component used + * to represent a reminder that will not be opaque, but rather + * transparent, to searches for busy time: + * + * BEGIN:VEVENT + * UID:19970901T130000Z-123402@host.com + * DTSTAMP:19970901T1300Z + * DTSTART:19970401T163000Z + * DTEND:19970402T010000Z + * SUMMARY:Laurel is in sensitivity awareness class. + * CLASS:PUBLIC + * CATEGORIES:BUSINESS,HUMAN RESOURCES + * TRANSP:TRANSPARENT + * END:VEVENT + */ + +$c = new vcalendar( array( 'unique_id' => 'test.org' )); +$e = & $c->newComponent( 'vevent' ); +$e->setProperty( 'dtstart' + , '19970401T163000Z' ); +$e->setProperty( 'dtend' + , '19970402T010000Z' ); +$e->setProperty( 'summary' + , 'Laurel is in sensitivity awareness class.' ); +$e->setProperty( 'class' + , 'PUBLIC' ); +$e->setProperty( 'categories' + , 'BUSINESS' ); +$e->setProperty( 'categories' + , 'HUMAN RESOURCES' ); +$e->setProperty( 'transp' + , 'TRANSPARENT' ); +$str = $c->createCalendar(); +echo $str; +echo "
\n\n"; +/* + * The following is an example of the "VEVENT" calendar component used + * to represent an anniversary that will occur annually. Since it takes + * up no time, it will not appear as opaque in a search for busy time; + * no matter what the value of the "TRANSP" property indicates: + * + * BEGIN:VEVENT + * UID:19970901T130000Z-123403@host.com + * DTSTAMP:19970901T1300Z + * DTSTART:19971102 + * SUMMARY:Our Blissful Anniversary + * CLASS:CONFIDENTIAL + * CATEGORIES:ANNIVERSARY,PERSONAL,SPECIAL OCCASION + * RRULE:FREQ=YEARLY + * END:VEVENT + */ + +$c = new vcalendar( array( 'unique_id' => 'test.org' )); +$e = & $c->newComponent( 'vevent' ); +$e->setProperty( 'dtstart' + , '19971102' ); +$e->setProperty( 'summary' + , 'Our Blissful Anniversary' ); +$e->setProperty( 'class' + , 'CONFIDENTIAL' ); +$e->setProperty( 'categories' + , 'ANNIVERSARY' ); +$e->setProperty( 'categories' + , 'PERSONAL' ); +$e->setProperty( 'categories' + , 'SPECIAL OCCASION' ); +$e->setProperty( 'rrule' + , array( 'FREQ' => 'YEARLY' )); + +$str = $c->createCalendar(); +echo $str; +echo "
\n\n"; +/* + * BEGIN:VTODO + * UID:19970901T130000Z-123404@host.com + * DTSTAMP:19970901T1300Z + * DTSTART:19970415T133000Z + * DUE:19970416T045959Z + * SUMMARY:1996 Income Tax Preparation + * CLASS:CONFIDENTIAL + * CATEGORIES:FAMILY,FINANCE + * PRIORITY:1 + * STATUS:NEEDS-ACTION + * END:VTODO + */ +$c = new vcalendar( array( 'unique_id' => 'test.org' )); +$t = & $c->newComponent( 'vtodo' ); +$t->setProperty( 'dtstart' + , '19970415T133000 GMT' ); +$t->setProperty( 'due' + , '19970416T045959 GMT' ); +$t->setProperty( 'summary' + , '1996 Income Tax Preparation' ); +$t->setProperty( 'class' + , 'CONFIDENTIAL' ); +$t->setProperty( 'categories' + , 'FAMILY' ); +$t->setProperty( 'categories' + , 'FINANCE' ); +$t->setProperty( 'priority' + , 1 ); +$t->setProperty( 'status' + , 'NEEDS-ACTION' ); + +$str = $c->createCalendar(); +echo $str; +?> \ No newline at end of file diff --git a/iCalcreator/summary.html b/iCalcreator/summary.html new file mode 100644 index 0000000..d55eb1d --- /dev/null +++ b/iCalcreator/summary.html @@ -0,0 +1,263 @@ + + + +iCalcreator 2.8 summary + + + + + + + +

iCalcreator 2.8

+iCalcreator class v2.8
+copyright (c) 2007-2011 Kjell-Inge Gustafsson, kigkonsult
+www.kigkonsult.se/iCalcreator
+ical@kigkonsult.se
+
+iCalcreator is a PHP class managing iCal formatted files for non-calendar +systems like CMS, project management systems and other applications able +to process calendar information like agendas, tasks, reports, totos, +journaling data and for communication with calendar systems and applications. +

+This is a short summary how to use iCalcreator; create, parse, edit, select and output functionality. +

+iCalcreator is built of a class file with support of a function class file and are calendar component property oriented. +Development environment is PHP version 5.x but coding is done to meet 4.x backward compatibility and may work. +

iCal

+A short iCal description is found at Wikipedia. If You are not familiar with iCal, read this first!
+Knowledge of calendar protocol rfc2445/rfc2446 is to recommend;
+rfc2445 + - Internet Calendaring and Scheduling Core Object Specification (iCalendar)
+rfc2446 + - iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries
+All functions calls are made as simple as possible BUT (, !!!,) read these rfc's properly!
+

Downloads

+Download +complete manual +and +coding samples. +from www.kigkonsult.se/iCalcreator. +

INSTALL

+Unpack to any folder
+- add this folder to your include-path
+- or unpack to your application-(include)-folder
+Add "require_once [folder/]iCalcreator.class.php;" to your php-script. +
+
+If using php version 5.1 or higher, the default timezone need to be set/altered, now "Europe/Stockholm", +line 50 in the iCalcreator.class.php file. +
+When creating a new calendar/component instance, review config settings. + +

CREATE

+ +

require_once( 'iCalcreator.class.php' ); +$config = array( 'unique_id' => 'icaldomain.com' ); // set Your unique id +$v = new vcalendar( $config ); // create a new calendar instance + +$v->setProperty( 'method', 'PUBLISH' ); // required of some calendar software +$v->setProperty( "x-wr-calname", "Calendar Sample" ); // required of some calendar software +$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // required of some calendar software +$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // required of some calendar software +.. . +$vevent = & $v->newComponent( 'vevent' ); // create an event calendar component +$vevent->setProperty( 'dtstart', array( 'year'=>2007, 'month'=>4, 'day'=>1, 'hour'=>19, 'min'=>0, 'sec'=>0 )); +$vevent->setProperty( 'dtend', array( 'year'=>2007, 'month'=>4, 'day'=>1, 'hour'=>22, 'min'=>30, 'sec'=>0 )); +$vevent->setProperty( 'LOCATION', 'Central Placa' ); // property name - case independent +$vevent->setProperty( 'summary', 'PHP summit' ); +$vevent->setProperty( 'description', 'This is a description' ); +$vevent->setProperty( 'comment', 'This is a comment' ); +$vevent->setProperty( 'attendee', 'attendee1@icaldomain.net' ); +.. . +$vevent = & $v->newComponent( 'vevent' ); // create next event calendar component +$vevent->setProperty( 'dtstart', '20070401', array('VALUE' => 'DATE'));// alt. date format, now for an all-day event +$vevent->setProperty( "organizer" , 'boss@icaldomain.com' ); +$vevent->setProperty( 'summary', 'ALL-DAY event' ); +$vevent->setProperty( 'description', 'This is a description for an all-day event' ); +$vevent->setProperty( 'resources', 'COMPUTER PROJECTOR' ); +$vevent->setProperty( 'rrule', array( 'FREQ' => 'WEEKLY', 'count' => 4));// weekly, four occasions +$vevent->parse( 'LOCATION:1CP Conference Room 4350' ); // supporting parse of strict rfc2445 formatted text +.. . +.. .// all calendar components are described in rfc2445 +.. .// a complete iCalcreator function list (ex. setProperty) in iCalcreator manual +.. . +$v->returnCalendar(); // redirect calendar file to browser +

+

PARSE

+

require_once( 'iCalcreator.class.php' ); +$config = array( 'unique_id', 'icaldomain.com' ); // set Your unique id, required if any component UID is missing +$v = new vcalendar( $config ); // create a new calendar instance + + /* start parse of local file */ +$config = array( 'directory' => 'calendar', 'filename' => 'file.ics' ); +$v->setConfig( $config ); // set directory and file name +$v->parse(); + + /* start parse of remote file */ +$v->setConfig( 'url', 'http://www.aDomain.net/file.ics' ); // iCalcreator also support parse from or write to remote files +$v->parse(); + +$v->setProperty( 'method', 'PUBLISH' ); // required of some calendar software +$v->setProperty( "x-wr-calname", "Calendar Sample" ); // required of some calendar software +$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // required of some calendar software +$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // required of some calendar software + +.. . +$v->sort(); // ensure start date order +.. . +

+

EDIT

+

require_once( 'iCalcreator.class.php' ); +$config = array( 'unique_id' => 'icaldomain.com', 'directory' => 'calendar', 'filename' => 'file.ics' ); + // set Your unique id, import directory and file name +$v = new vcalendar( $config ); // create a new calendar instance + +$v->parse(); + +$v->setProperty( 'method', 'PUBLISH' ); // required of some calendar software +$v->setProperty( "x-wr-calname", "Calendar Sample" ); // required of some calendar software +$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // required of some calendar software +$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // required of some calendar software + +while( $vevent = $v->getComponent( 'vevent' )) { // read events, one by one + $uid = $vevent->getProperty( 'uid' ); // uid required, one occurence (unique id/key for component) + .. . + $dtstart = $vevent->getProperty( 'dtstart' ); // dtstart required, one occurence + .. . + if( $description = $vevent->getProperty( 'description', 1 )) { // description optional, first occurence + .. . // edit the description + $vevent->setProperty( 'description', $description, FALSE, 1 ); // update/replace the description + } + while( $comment = $vevent->getProperty( 'comment' )) { // comment optional, may occur more than once + .. . // manage comments + } + .. . + while( $vevent->deleteProperty( 'attendee' )) + continue; // remove all ATTENDEE properties .. . + .. . + $v->setComponent ( $vevent, $uid ); // update/replace event in calendar with uid as key +} +.. . +.. .// a complete iCalcreator function list (ex. getProperty, deleteProperty) in iCalcreator manual +.. . +

+

SELECT

+

require_once( 'iCalcreator.class.php' ); +$config = array( 'unique_id' => 'icaldomain.com' ); // set Your unique id +$v = new vcalendar( $config ); // create a new calendar instance + +$v->setConfig( 'url', 'http://www.aDomain.net/file.ics' ); // iCalcreator also support remote files +$v->parse(); +$v->sort(); // ensure start date order + +$v->setProperty( 'method', 'PUBLISH' ); // required of some calendar software +$v->setProperty( "x-wr-calname", "Calendar Sample" ); // required of some calendar software +$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // required of some calendar software +$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // required of some calendar software + +$eventArray = $v->selectComponents(); // select components occuring today + // (including components with recurrence pattern) +foreach( $eventArray as $year => $yearArray) { + foreach( $yearArray as $month => $monthArray ) { + foreach( $monthArray as $day => $dailyEventsArray ) { + foreach( $dailyEventsArray as $vevent ) { + $currddate = $event->getProperty( 'x-current-dtstart' ); + // if member of a recurrence set (2nd occurence etc) + // returns array( 'x-current-dtstart' + // , <(string) date("Y-m-d [H:i:s][timezone/UTC offset]")>) + $dtstart = $vevent->getProperty( 'dtstart' ); // dtstart required, one occurence, (orig. start date) + $summary = $vevent->getProperty( 'summary' ); + $description = $vevent->getProperty( 'description' ); + .. . + .. . +

+

OUTPUT

+

require_once( 'iCalcreator.class.php' ); +$config = array( 'unique_id' => 'icaldomain.com' ); // set Your unique id +$v = new vcalendar( $config ); // create a new calendar instance + +$v->setProperty( 'method', 'PUBLISH' ); // required of some calendar software +$v->setProperty( "x-wr-calname", "Calendar Sample" ); // required of some calendar software +$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // required of some calendar software +$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // required of some calendar software +.. . +.. .// parse calendar file(s) and/or edit/create calendar components.. . +.. . +

+

// opt 1

+

.. . +$v->returnCalendar(); // redirect calendar file to browser +

+

// opt 2

+

.. . +$config = array( 'directory' => 'depot', 'filename' => 'calendar.ics' ); +$v->setConfig( $config ); // set output directory and file name +$v->saveCalendar(); // save calendar to (local) file +

+

// opt 3

+

.. . +$config = array( 'url' => 'http://www.aDomain.net/file.ics' ); +$v->setConfig( $config ); // set output url +$v->saveCalendar(); // save calendar to remote url +

+ +

COPYRIGHT AND LICENSE

+ +

Copyright

+iCalcreator class
+copyright (c) 2007-2011 Kjell-Inge Gustafsson, kigkonsult
+www.kigkonsult.se/iCalcreator
+ical@kigkonsult.se
+ +

License

+ +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. +

+This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. +

+You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or download it here. +
+
+ + \ No newline at end of file diff --git a/images/accept-24.png b/images/accept-24.png new file mode 100644 index 0000000..65ca043 Binary files /dev/null and b/images/accept-24.png differ diff --git a/images/accept-32.png b/images/accept-32.png new file mode 100644 index 0000000..c94c066 Binary files /dev/null and b/images/accept-32.png differ diff --git a/images/accept.png b/images/accept.png new file mode 100644 index 0000000..ada57a9 Binary files /dev/null and b/images/accept.png differ diff --git a/images/add-16.png b/images/add-16.png new file mode 100644 index 0000000..23d5bed Binary files /dev/null and b/images/add-16.png differ diff --git a/images/add-24.png b/images/add-24.png new file mode 100644 index 0000000..c63af7f Binary files /dev/null and b/images/add-24.png differ diff --git a/images/add.png b/images/add.png new file mode 100644 index 0000000..7409ef3 Binary files /dev/null and b/images/add.png differ diff --git a/images/back-32.png b/images/back-32.png new file mode 100644 index 0000000..b44fbb2 Binary files /dev/null and b/images/back-32.png differ diff --git a/images/calendar-32.png b/images/calendar-32.png new file mode 100644 index 0000000..8976115 Binary files /dev/null and b/images/calendar-32.png differ diff --git a/images/cancel.png b/images/cancel.png new file mode 100644 index 0000000..c149c2b Binary files /dev/null and b/images/cancel.png differ diff --git a/images/chart-32.png b/images/chart-32.png new file mode 100644 index 0000000..1406b8d Binary files /dev/null and b/images/chart-32.png differ diff --git a/images/csv.png b/images/csv.png new file mode 100644 index 0000000..f90ef25 Binary files /dev/null and b/images/csv.png differ diff --git a/images/fforward.png b/images/fforward.png new file mode 100644 index 0000000..369084c Binary files /dev/null and b/images/fforward.png differ diff --git a/images/ical.png b/images/ical.png new file mode 100644 index 0000000..b092a75 Binary files /dev/null and b/images/ical.png differ diff --git a/images/info.png b/images/info.png new file mode 100644 index 0000000..4c665a4 Binary files /dev/null and b/images/info.png differ diff --git a/images/logo_uds_bandeau.gif b/images/logo_uds_bandeau.gif new file mode 100644 index 0000000..3132c13 Binary files /dev/null and b/images/logo_uds_bandeau.gif differ diff --git a/images/logo_uds_lettre.jpg b/images/logo_uds_lettre.jpg new file mode 100644 index 0000000..d8a3169 Binary files /dev/null and b/images/logo_uds_lettre.jpg differ diff --git a/images/medaille.png b/images/medaille.png new file mode 100644 index 0000000..97a22b7 Binary files /dev/null and b/images/medaille.png differ diff --git a/images/next-32.png b/images/next-32.png new file mode 100644 index 0000000..934a254 Binary files /dev/null and b/images/next-32.png differ diff --git a/images/next.png b/images/next.png new file mode 100644 index 0000000..24d94e8 Binary files /dev/null and b/images/next.png differ diff --git a/images/previous.png b/images/previous.png new file mode 100644 index 0000000..b4b79ae Binary files /dev/null and b/images/previous.png differ diff --git a/images/reload.png b/images/reload.png new file mode 100644 index 0000000..9a2b2e8 Binary files /dev/null and b/images/reload.png differ diff --git a/images/rewind.png b/images/rewind.png new file mode 100644 index 0000000..99ed78c Binary files /dev/null and b/images/rewind.png differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..3cce186 --- /dev/null +++ b/index.php @@ -0,0 +1,90 @@ +'."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''.NOMAPPLICATION.''."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; + +//debut du formulaire +echo '
'."\n"; + +//bandeaux de tete +logo(); +bandeau_tete(); +bandeau_titre(_("Make your polls")); +sous_bandeau(); + +echo '
'."\n"; + +echo '

'.NOMAPPLICATION.'
'. _("What is it about?") .'

'; +echo '

'. _("Making polls to schedule meetings or events, quickly and easily.
You can also run polls to determine what will be your next meeting place, the meeting topic or anything like the country you would like to visit during your next holidays.") .'

'."\n".'
'."\n"; + +echo '
'. _("Make a poll") .'' . + '' . + '' . _('Make a poll') . '' . + '
' . "\n"; + +echo '
'."\n"; +echo '

'."\n"; +echo '
'."\n"; +echo '
'."\n"; +//bandeau de pied +//sur_bandeau_pied(); +bandeau_pied(); + +echo ''."\n"; +echo ''."\n"; + + + +?> diff --git a/infos_sondage.php b/infos_sondage.php new file mode 100644 index 0000000..1348fa0 --- /dev/null +++ b/infos_sondage.php @@ -0,0 +1,201 @@ +|";',$_POST["titre"])){ + $erreur_injection_titre = true; + } + if (preg_match(';<|>|";',$_POST["nom"])){ + $erreur_injection_nom = true; + } + if (preg_match(';<|>|";',$_POST["commentaires"])){ + $erreur_injection_commentaires = true; + } + + // Si pas d'erreur dans l'adresse alors on change de page vers date ou autre + if ($_POST["titre"] && $_POST["nom"] && $_POST["adresse"] && + ! $erreur_adresse && ! $erreur_injection_titre && ! $erreur_injection_commentaires && ! $erreur_injection_nom ){ + if ($_POST["creation_sondage_date"]||$_POST["creation_sondage_date_x"]){ + header("Location:choix_date.php"); + exit(); + } + + if ($_POST["creation_sondage_autre"]||$_POST["creation_sondage_autre_x"]){ + header("Location:choix_autre.php"); + exit(); + } + } + + //En cas d'erreur, recuperation des variables deja entrées + if (empty($_POST["titre"]) || empty($_POST["adresse"]) || empty($_POST["nom"])) { + $_SESSION["titre"]=$_POST["titre"]; + $_SESSION["nom"]=$_POST["nom"]; + $_SESSION["adresse"]=$_POST["adresse"]; + $_SESSION["commentaires"]=$_POST["commentaires"]; + } + +} + +//affichage de la page + +print_header(true); +echo ''."\n"; + +//affichage des bandeaux de tete +logo(); +bandeau_tete(); +echo '
'. _("Poll creation (1 on 2)") .'
'."\n"; +sous_bandeau(); + +// premier sondage ? test l'existence des schémas SQL avant d'aller plus loin +if(! check_table_sondage() ) { + echo '

' . + _("STUdS is not properly installed, please check the 'INSTALL' to setup the database before continuing") . + "

"."\n"; + bandeau_pied(); + echo ''."\n"; + echo ''."\n"; + die(); +} + +//debut du formulaire +echo '
'."\n"; + +echo '
'."\n"; +echo '
'. _("You are in the poll creation section.
Required fields cannot be left blank") .'

'."\n"; + +//Affichage des différents champs textes a remplir +echo ''."\n"; + +echo ''."\n"; +if (!$_SESSION["titre"]&&($_POST["creation_sondage_date"]||$_POST["creation_sondage_autre"]||$_POST["creation_sondage_date_x"]||$_POST["creation_sondage_autre_x"])){ + print ""."\n"; +} +elseif ($erreur_injection_titre){ + print "
"."\n"; +} +echo ''."\n"; +echo ''."\n"; +if ($erreur_injection_commentaires){ + print "
"."\n"; +} +echo ''."\n"; +echo ''."\n"; +else + echo ''."\n"; +if (!$_SESSION["nom"]&&($_POST["creation_sondage_date"]||$_POST["creation_sondage_autre"]||$_POST["creation_sondage_date_x"]||$_POST["creation_sondage_autre_x"])){ + print ""."\n"; +} +elseif ($erreur_injection_nom){ + print "
"."\n"; +} +echo ''."\n"; +echo ''."\n"; +else + echo ''."\n"; +if (!$_SESSION["adresse"]&&($_POST["creation_sondage_date"]||$_POST["creation_sondage_autre"]||$_POST["creation_sondage_date_x"]||$_POST["creation_sondage_autre_x"])){ + print ""."\n"; +} +elseif ($erreur_adresse&&($_POST["creation_sondage_date"]||$_POST["creation_sondage_autre"]||$_POST["creation_sondage_date_x"]||$_POST["creation_sondage_autre_x"])){ + print ""."\n"; +} + +echo ''."\n"; + +echo '
'. _("Poll title *: ") .'" . _("Enter a title") . "" . _("Characters < > and \" are not permitted") . "
'. _("Comments: ") .'" . _("Characters < > and \" are not permitted") . "
'. _("Your name*: ") .''; +if (isset($_SERVER['REMOTE_USER'])) + echo ''.$_SESSION["nom"].'" . _("Enter a name") . "" . _("Characters < > and \" are not permitted") . "
'. _("Your e-mail address *: ") .''; +if (isset($_SERVER['REMOTE_USER'])) + echo ''.$_SESSION["adresse"].'" . _("Enter an email address") . " " . _("The address is not correct! (You should enter a valid email address in order to receive the link to your poll)") . "
'."\n"; + +//focus javascript sur le premier champ +echo ''."\n"; + +echo '
'. _("The fields marked with * are required!") .'

'."\n"; + +#affichage du cochage par défaut +if (!$_SESSION["studsplus"]&&!$_POST["creation_sondage_date"]&&!$_POST["creation_sondage_autre"]&&!$_POST["creation_sondage_date_x"]&&!$_POST["creation_sondage_autre_x"]){$_SESSION["studsplus"]="+";} + +if ($_SESSION["studsplus"]=="+"){$cocheplus="checked";} +echo ''. _(" Voters can modify their vote themselves.") .'
'."\n"; +if ($_SESSION["mailsonde"]){$cochemail="checked";} +echo ''. _(" To receive an email for each new vote.") .'
'."\n"; + +//affichage des boutons pour choisir sondage date ou autre +echo '
'."\n"; +echo ' '."\n"; +echo ''."\n"; +echo ' '."\n"; +echo ''."\n"; +echo '
'. _("Schedule an event") .'
'. _("Make a choice") .'
'."\n"; +echo '


'."\n"; +echo '
'."\n"; +echo '
'."\n"; +//bandeau de pied +bandeau_pied(); +echo ''."\n"; +echo ''."\n"; +?> diff --git a/install.mysql.sql b/install.mysql.sql new file mode 100644 index 0000000..bd0f086 --- /dev/null +++ b/install.mysql.sql @@ -0,0 +1,89 @@ +CREATE TABLE IF NOT EXISTS `sondage` ( + `id_sondage` CHAR(16) NOT NULL, + `commentaires` text, + `mail_admin` VARCHAR(128), + `nom_admin` VARCHAR(64), + `titre` text, + `id_sondage_admin` CHAR(24), + `date_fin` TIMESTAMP, + `format` VARCHAR(2), + `mailsonde` BOOLEAN DEFAULT '0', + UNIQUE KEY (`id_sondage`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +-- +-- Name: sujet_studs; Type: TABLE; +-- + +CREATE TABLE IF NOT EXISTS `sujet_studs` ( + `id_sondage` CHAR(16) NOT NULL, + `sujet` TEXT, + FOREIGN KEY (`id_sondage`) REFERENCES sondage(id_sondage) on delete cascade +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +-- +-- Name: user_studs; Type: TABLE; +-- + +CREATE TABLE IF NOT EXISTS `user_studs` ( + `id_users` INT(11) unsigned NOT NULL AUTO_INCREMENT, + `nom` VARCHAR(64) NOT NULL, + `id_sondage` CHAR(16) NOT NULL, + `reponses` text NOT NULL, + PRIMARY KEY (`id_users`), + FOREIGN KEY (`id_sondage`) REFERENCES sondage(id_sondage) on delete cascade +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +-- +-- Name: comments; Type: TABLE; +-- + +CREATE TABLE IF NOT EXISTS `comments` ( + `id_comment` INT(11) unsigned NOT NULL AUTO_INCREMENT, + `id_sondage` CHAR(16) NOT NULL, + `comment` text NOT NULL, + `usercomment` text, + PRIMARY KEY (`id_comment`), + FOREIGN KEY (`id_sondage`) REFERENCES sondage(id_sondage) on delete cascade +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +-- +-- Data for Name: sondage; Type: TABLE DATA; +-- + +INSERT INTO `sondage` +(`id_sondage`, `commentaires`, `mail_admin`, `nom_admin`, + `titre`, `id_sondage_admin`, + `date_fin`, `format`) +VALUES +('aqg259dth55iuhwm','Repas de Noel du service','Stephanie@saillard.com','Stephanie', + 'Repas de Noel','aqg259dth55iuhwmy9d8jlwk', + FROM_UNIXTIME('1627100361'),'D+'); + +-- +-- Data for Name: sujet_studs; Type: TABLE DATA; +-- + +INSERT INTO `sujet_studs` (`id_sondage`, `sujet`) VALUES +('aqg259dth55iuhwm','1225839600@12h,1225839600@19h,1226012400@12h,1226012400@19h,1226876400@12h,1226876400@19h,1227049200@12h,1227049200@19h,1227826800@12h,1227826800@19h'); + +-- +-- Data for Name: user_studs; Type: TABLE DATA; +-- + +INSERT INTO `user_studs` (`nom`, `id_sondage`, `reponses`, `id_users`) VALUES +('marcel','aqg259dth55iuhwm','0110111101','933'), +('paul','aqg259dth55iuhwm','1011010111','935'), +('sophie','aqg259dth55iuhwm','1110110000','945'), +('barack','aqg259dth55iuhwm','0110000','948'), +('takashi','aqg259dth55iuhwm','0000110100','951'), +('albert','aqg259dth55iuhwm','1010110','975'), +('alfred','aqg259dth55iuhwm','0110010','1135'), +('marcs','aqg259dth55iuhwm','0100001010','1143'), +('laure','aqg259dth55iuhwm','0011000','1347'), +('benda','aqg259dth55iuhwm','1101101100','1667'), +('Albert','aqg259dth55iuhwm','1111110011','1668'); diff --git a/install.sql b/install.sql new file mode 100644 index 0000000..b02c955 --- /dev/null +++ b/install.sql @@ -0,0 +1,147 @@ +--========================================================================== +-- +--Université de Strasbourg - Direction Informatique +--Auteur : Guilhem BORGHESI +--Création : Février 2008 +-- +--borghesi@unistra.fr +-- +--Ce logiciel est régi par la licence CeCILL-B soumise au droit français et +--respectant les principes de diffusion des logiciels libres. Vous pouvez +--utiliser, modifier et/ou redistribuer ce programme sous les conditions +--de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +--sur le site "http://www.cecill.info". +-- +--Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +--pris connaissance de la licence CeCILL-B, et que vous en avez accepté les +--termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. +-- +--========================================================================== +-- +--Université de Strasbourg - Direction Informatique +--Author : Guilhem BORGHESI +--Creation : Feb 2008 +-- +--borghesi@unistra.fr +-- +--This software is governed by the CeCILL-B license under French law and +--abiding by the rules of distribution of free software. You can use, +--modify and/ or redistribute the software under the terms of the CeCILL-B +--license as circulated by CEA, CNRS and INRIA at the following URL +--"http://www.cecill.info". +-- +--The fact that you are presently reading this means that you have had +--knowledge of the CeCILL-B license and that you accept its terms. You can +--find a copy of this license in the file LICENSE. +-- +--========================================================================== + +-- +-- PostgreSQL database dump +-- + +-- +-- Name: sondage; Type: TABLE; +-- + +CREATE TABLE sondage ( + id_sondage text NOT NULL, + commentaires text, + mail_admin text, + nom_admin text, + titre text, + id_sondage_admin text, + date_fin text, + format text, + mailsonde text +); + + +-- +-- Name: sujet_studs; Type: TABLE; +-- + +CREATE TABLE sujet_studs ( + id_sondage text, + sujet text +); + + +-- +-- Name: user_studs; Type: TABLE; +-- + +CREATE TABLE user_studs ( + nom text, + id_sondage text, + reponses text, + id_users serial NOT NULL +); + + +-- +-- Name: comments; Type: TABLE; +-- + +CREATE TABLE comments ( + id_sondage text, + comment text, + usercomment text, + id_comment serial NOT NULL +); + +CREATE OR REPLACE FUNCTION from_unixtime(integer) RETURNS timestamp AS +'SELECT $1::abstime::timestamp without time zone AS result' LANGUAGE 'SQL'; + +-- +-- Data for Name: sondage; Type: TABLE DATA; +-- + +COPY sondage (id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde) FROM stdin; +aqg259dth55iuhwm Repas de Noel du service Stephanie@saillard.com Stephanie Repas de Noel aqg259dth55iuhwmy9d8jlwk 1627100361 D+ +\. + + +-- +-- Data for Name: sujet_studs; Type: TABLE DATA; +-- + +COPY sujet_studs (id_sondage, sujet) FROM stdin; +aqg259dth55iuhwm 1225839600@12h,1225839600@19h,1226012400@12h,1226012400@19h,1226876400@12h,1226876400@19h,1227049200@12h,1227049200@19h,1227826800@12h,1227826800@19h +\. + + +-- +-- Data for Name: user_studs; Type: TABLE DATA; +-- + +COPY user_studs (nom, id_sondage, reponses, id_users) FROM stdin; +marcel aqg259dth55iuhwm 0110111101 933 +paul aqg259dth55iuhwm 1011010111 935 +sophie aqg259dth55iuhwm 1110110000 945 +barack aqg259dth55iuhwm 0110000 948 +takashi aqg259dth55iuhwm 0000110100 951 +albert aqg259dth55iuhwm 1010110 975 +alfred aqg259dth55iuhwm 0110010 1135 +marcs aqg259dth55iuhwm 0100001010 1143 +laure aqg259dth55iuhwm 0011000 1347 +benda aqg259dth55iuhwm 1101101100 1667 +Albert aqg259dth55iuhwm 1111110011 1668 +\. + + +-- +-- Name: sondage_pkey; Type: CONSTRAINT; +-- + +ALTER TABLE ONLY sondage + ADD CONSTRAINT sondage_pkey PRIMARY KEY (id_sondage); + + +-- +-- Name: user_studs_pkey; Type: CONSTRAINT; +-- + +ALTER TABLE ONLY user_studs + ADD CONSTRAINT user_studs_pkey PRIMARY KEY (id_users); + diff --git a/locale/de_DE/LC_MESSAGES/Studs.mo b/locale/de_DE/LC_MESSAGES/Studs.mo new file mode 100644 index 0000000..87e4b0a Binary files /dev/null and b/locale/de_DE/LC_MESSAGES/Studs.mo differ diff --git a/locale/de_DE/LC_MESSAGES/Studs.po b/locale/de_DE/LC_MESSAGES/Studs.po new file mode 100644 index 0000000..fe3da6b --- /dev/null +++ b/locale/de_DE/LC_MESSAGES/Studs.po @@ -0,0 +1,754 @@ +msgid "" +msgstr "" +"Project-Id-Version: Studs 0.6.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-05 21:39+0100\n" +"PO-Revision-Date: 2010-06-05 21:39+0100\n" +"Last-Translator: Raphaël Droz \n" +"Language-Team: Guilhem Borghesi, Raphaël Droz\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: German\n" +"X-Poedit-Country: GERMANY\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-Basepath: /var/www/studs\n" +"X-Poedit-SearchPath-0: .\n" + +#: bandeaux.php:59 +msgid "Make your polls" +msgstr "Ihre Umfrage erstellen" + +#: bandeaux.php:62 +msgid "Poll dates (2 on 2)" +msgstr "Terminforschläge (2 / 2)" + +#: bandeaux.php:65 +msgid "Poll subjects (2 on 2)" +msgstr "Themaforschläge (2 / 2)" + +#: bandeaux.php:68 +msgid "Polls administrator" +msgstr "Datenbankadministrator" + +#: bandeaux.php:71 +msgid "Contact us" +msgstr "Kontakt" + +#: bandeaux.php:77 +msgid "Error!" +msgstr "Fehler!" + +#: bandeaux.php:80 +#: bandeaux.php:98 +msgid "About" +msgstr "Allgemeine Informationen" + +#: bandeaux.php:94 +#: bandeaux.php:108 +#: bandeaux.php:119 +msgid "Home" +msgstr "Startseite" + +#: bandeaux.php:95 +msgid "Example" +msgstr "Beispiel" + +#: bandeaux.php:96 +msgid "Contact" +msgstr "Kontakt" + +#: bandeaux.php:99 +msgid "Admin" +msgstr "Admin" + +#: bandeaux.php:109 +msgid "Logs" +msgstr "Logs" + +#: bandeaux.php:110 +msgid "Cleaning" +msgstr "Reinigung" + +#: bandeaux.php:129 +#: bandeaux.php:135 +msgid "Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009" +msgstr "Universität Strassburg. Autor : Guilhem BORGHESI. 2008-2009" + +#: creation_sondage.php:89 +msgid "For sending to the polled users" +msgstr "Für Verbreiterung an den Befragten" + +#: creation_sondage.php:89 +#: creation_sondage.php:90 +msgid "Poll" +msgstr "Umfrage" + +#: creation_sondage.php:89 +msgid "" +"This is the message you have to send to the people you want to poll. \n" +"Now, you have to send this message to everyone you want to poll." +msgstr "" +"Das ist die Botschaft die den Befragten gesendet werden soll. \n" +"Sie können jetzt diese Botschaft allen Personnen die an der Abstimmung teilnehmen könnten weitergeben." + +#: creation_sondage.php:89 +msgid "hast just created a poll called" +msgstr "hat eine betitelte Umfrage erstellt" + +#: creation_sondage.php:89 +msgid "Thanks for filling the poll at the link above" +msgstr "Bitte erkundigen Sie die Umfrage an dem folgende Weblink" + +#: creation_sondage.php:89 +#: creation_sondage.php:92 +msgid "Thanks for your confidence" +msgstr "Danke fur ihr vertrauen" + +#: creation_sondage.php:90 +msgid "Author's message" +msgstr "Fur den Autor reserviert" + +#: creation_sondage.php:91 +msgid "" +"This message should NOT be sended to the polled people. It is private for the poll's creator.\n" +"\n" +"You can now modify it at the link above" +msgstr "" +"Diese Botschaft soll nicht weitergegeben werden, sie ist fur den Autor reserviert.\n" +"\n" +"Sie können diese Umfrage an dem folgenden Weblink ändern" + +#: choix_date.php:63 +#: choix_autre.php:62 +msgid "You haven't filled the first section of the poll creation." +msgstr "Die erste Seite wurde nicht ausgefullt" + +#: choix_date.php:64 +#: contacts.php:77 +#: studs.php:88 +#: choix_autre.php:63 +#: adminstuds.php:79 +#: adminstuds.php:1044 +msgid "Back to the homepage of " +msgstr "Kehren sie zur Startseite zurück " + +#: choix_date.php:220 +msgid "Select your dates amoung the free days (green). The selected days are in blue.
You can unselect a day previously selected by clicking again on it." +msgstr "Wählen sie ihr Termin unter den in grün angegebenen Tagen an. Die Felder erscheinen in blau wen sie ausgew heltsind.
Sie können ihre Wahl wiederufen in dem sie das Feld wiederauswählen." + +#: choix_date.php:233 +msgid "monday" +msgstr "Montag" + +#: choix_date.php:233 +msgid "tuesday" +msgstr "Dienstag" + +#: choix_date.php:233 +msgid "wednesday" +msgstr "Mittwoch" + +#: choix_date.php:233 +msgid "thursday" +msgstr "Donnerstag" + +#: choix_date.php:233 +msgid "friday" +msgstr "Freitag" + +#: choix_date.php:233 +msgid "saturday" +msgstr "Samstag" + +#: choix_date.php:233 +msgid "sunday" +msgstr "Sonntag" + +#: choix_date.php:485 +msgid "Selected days" +msgstr "Gewälhter Tag" + +#: choix_date.php:487 +msgid "For each selected day, you can choose, or not, meeting hours in the following format :
- empty,
- \"8h\", \"8H\" or \"8:00\" to give a meeting's start hour,
- \"8-11\", \"8h-11h\", \"8H-11H\" ou \"8:00-11:00\" to give a meeting's start and end hour,
- \"8h15-11h15\", \"8H15-11H15\" ou \"8:15-11:15\" for the same thing but with minutes." +msgstr "Für jeden ausgewählten Tag, haben Sie die Möglichkeit die Uhrzeit der Versammlung zu bestimmen in einem der folgenden Formaten :
- lehr, wenn Sie keine bestimmte Uhrzeit möchten,
- \"8h\", \"8H\" oder \"8:00\" um den Beginn der Versammlung vorzuschlagen,
- \"8-11\", \"8h-11h\", \"8H-11H\" oder \"8:00-11:00\" für eine Zeitspanne,
- \"8h15-11h15\", \"8H15-11H15\" oder \"8:15-11:15\" für ein Zeitspanne mit minuten." + +#: choix_date.php:494 +msgid "Time" +msgstr "Uhrzeit" + +#: choix_date.php:522 +msgid "Bad format!" +msgstr "Inkorrektes Format!" + +#: choix_date.php:531 +msgid "Remove all days" +msgstr "Alle Tage löschen" + +#: choix_date.php:531 +msgid "Copy hours of the first day" +msgstr "Uhrzeiten des ersten Tages auch für die folgende Tage übernehmen" + +#: choix_date.php:531 +msgid "Remove all hours" +msgstr "Alle Uhrzeiten löschen" + +#: choix_date.php:533 +#: choix_autre.php:167 +msgid "Next" +msgstr "Weiter" + +#: choix_date.php:537 +msgid "Enter more choices for the voters" +msgstr "Sie lassen den Beteiligten nicht genügend Möglichkeiten!" + +#: choix_date.php:549 +msgid "Your poll will expire automatically 2 days after the last date of your poll." +msgstr "Ihre Umfrage wird automatisch nach dem letzten eingetragenen Datum gelöscht." + +#: choix_date.php:549 +msgid "Removal date" +msgstr "Datum an dem die Umfrage gelöscht werden soll" + +#: choix_date.php:552 +#: choix_autre.php:196 +msgid "Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters." +msgstr "Als Sie die Herschtelung der Umfrage bestätigt haben werden, werden Sie zur Webseite Ihrer Umfrage automatisch wieder geleitet sein

Gleichzeitig werden Sie ein E-Mail bekommen in dem ein Link zu ihrer Umfrage ist, um in der erforschten Zukunft zu folgen." + +#: choix_date.php:558 +msgid "Back to hours" +msgstr "Zurück zu den Uhrzeiten" + +#: choix_date.php:559 +#: choix_autre.php:201 +msgid "Create the poll" +msgstr "Umfrage erstellen" + +#: infos_sondage.php:119 +msgid "Poll creation (1 on 2)" +msgstr "Erstellen einer Umfrage (1 / 2)" + +#: infos_sondage.php:123 +msgid "You are in the poll creation section.
Required fields cannot be left blank" +msgstr "Sie machten eine neue umfrage erstellen !
Fullen sie die folgenden Felder aus." + +#: infos_sondage.php:128 +msgid "Poll title *: " +msgstr "Titel der Umfrage *: " + +#: infos_sondage.php:130 +msgid "Enter a title" +msgstr "Geben sie einen Titel an!" + +#: infos_sondage.php:133 +#: infos_sondage.php:138 +#: infos_sondage.php:150 +msgid "Characters < > and \" are not permitted" +msgstr "Die Schriftzeichen < > und \" sind nicht genehmigt!" + +#: infos_sondage.php:136 +msgid "Comments: " +msgstr "Komentar (optional): " + +#: infos_sondage.php:141 +msgid "Your name*: " +msgstr "Name *: " + +#: infos_sondage.php:147 +#: contacts.php:119 +msgid "Enter a name" +msgstr "Geben sie einen Namen an!" + +#: infos_sondage.php:153 +msgid "Your e-mail address *: " +msgstr "E-mail Adresse *: " + +#: infos_sondage.php:159 +msgid "Enter an email address" +msgstr "Geben sie eine e-mail Adresse an!" + +#: infos_sondage.php:162 +msgid "The address is not correct! (You should enter a valid email address in order to receive the link to your poll)" +msgstr "Die e-mail adresse ist nicht korrekt! (Sie müssen eine gütlige e-mail Adresse eintragen)" + +#: infos_sondage.php:173 +msgid "The fields marked with * are required!" +msgstr "Die mit * markierten Felder sind obligatorisch!" + +#: infos_sondage.php:179 +msgid " Voters can modify their vote themselves." +msgstr " Sie erlauben eine Änderung der linien durch die Befragten" + +#: infos_sondage.php:181 +msgid " To receive an email for each new vote." +msgstr " Sie möchten eine e-mail bei jeder Beteiligung erhalten" + +#: infos_sondage.php:185 +msgid "Schedule an event" +msgstr "Terminumfrage" + +#: infos_sondage.php:187 +msgid "Make a choice" +msgstr "Andere Umfragen" + +#: infos_sondage.php:188 +#: index.php:73 +msgid "Make a poll" +msgstr "Umfrage erstellen" + +#: contacts.php:56 +msgid "[CONTACT] You have sent a question " +msgstr "[KONTAKT] Senden von Fragen " + +#: contacts.php:56 +msgid "You have a question from a user " +msgstr "Sie haben eine benützer Frager " + +#: contacts.php:56 +msgid "User" +msgstr "Benützer" + +#: contacts.php:56 +msgid "User's email address" +msgstr "Email adresse des Benützers" + +#: contacts.php:56 +msgid "Message" +msgstr "Email" + +#: contacts.php:59 +msgid "[COPY] Someone has sent a question " +msgstr "[KOPIE] Senden einer frage " + +#: contacts.php:59 +msgid "Here is a copy of your question" +msgstr "Kopie ihrer frage" + +#: contacts.php:59 +msgid "We're going to answer your question shortly." +msgstr "Ihre email wird schnell bearbeitet." + +#: contacts.php:59 +#: studs.php:171 +#: studs.php:211 +#: adminstuds.php:273 +#: adminstuds.php:379 +#: adminstuds.php:500 +#: adminstuds.php:510 +#: adminstuds.php:522 +#: adminstuds.php:1022 +msgid "Thanks for your confidence." +msgstr "Wir dancken ihnen für Ihr Vertrauen." + +#: contacts.php:76 +msgid "Your message has been sent!" +msgstr "Ihre email wurde erfolgreich gesendet!" + +#: contacts.php:113 +msgid "If you have questions, you can send a message here." +msgstr "Fragen oder Vorschläge in bezug auf können sie uns mit diesem Formular zukommen lassen." + +#: contacts.php:115 +msgid "Your name" +msgstr "Ihr Name" + +#: contacts.php:123 +msgid "Your email address " +msgstr "Ihre Email Adresse " + +#: contacts.php:129 +msgid "Question" +msgstr "Frage (english speaking please)" + +#: contacts.php:138 +msgid "Send your question" +msgstr "Senden sie ihre Frage" + +#: studs.php:87 +#: adminstuds.php:78 +msgid "This poll doesn't exist !" +msgstr "Diese Umfrage gibt es nicht!" + +#: studs.php:118 +msgid "anonyme" +msgstr "" + +#: studs.php:171 +#: studs.php:211 +msgid "Poll's participation" +msgstr "Umfragebeteiligung" + +#: studs.php:171 +#: studs.php:211 +msgid "" +"has filled a line.\n" +"You can find your poll at the link" +msgstr " hat einen Eintrag gemacht. Sie finden ihre Umfrage unter folgender Adresse" + +#: studs.php:246 +#: adminstuds.php:567 +msgid "Initiator of the poll" +msgstr "Autor der Umfrage" + +#: studs.php:250 +#: studs.php:540 +#: adminstuds.php:571 +#: adminstuds.php:964 +msgid "Comments" +msgstr "Kommentar" + +#: studs.php:261 +msgid "If you want to vote in this poll, you have to give your name, choose the values that fit best for you
(without paying attention to the choices of the other voters) and validate with the plus button at the end of the line." +msgstr "Um an dieser Umfrage Teilzunehmen tragen sie bitte ihren Namen, wählen sie die ihnen passenden Wehrte (ohne die dispo der anderen Teilnehmer zu beachten)
und bestätigen sie ihre Wahl mit dem Knopf am ende der Ligne." + +#: studs.php:445 +#: adminstuds.php:806 +msgid "Addition" +msgstr "Summe" + +#: studs.php:473 +#: adminstuds.php:836 +msgid "Enter a name !" +msgstr "Sie haben keinen Namen eingetragen!" + +#: studs.php:476 +#: adminstuds.php:841 +msgid "The name you've chosen already exist in this poll!" +msgstr "Den gewählten Namen gibt es schon!" + +#: studs.php:479 +#: adminstuds.php:846 +msgid "Characters \" ' < et > are not permitted" +msgstr "Die Schriftzeichen < und > sind nicht genehmigt!" + +#: studs.php:503 +#: studs.php:505 +#: adminstuds.php:876 +#: adminstuds.php:878 +msgid "for" +msgstr "bis" + +#: studs.php:505 +#: studs.php:511 +msgid "%A, den %e. %B %Y" +msgstr "%A, den %e. %B %Y" + +#: studs.php:522 +#: adminstuds.php:899 +msgid "vote" +msgstr "wähle" + +#: studs.php:524 +#: adminstuds.php:901 +#, fuzzy +msgid "votes" +msgstr "wähle" + +#: studs.php:528 +#: adminstuds.php:905 +msgid "The best choice at this time is" +msgstr "Vorlaufig ist die beste Wahl:" + +#: studs.php:528 +#: studs.php:531 +#: adminstuds.php:905 +#: adminstuds.php:908 +msgid "with" +msgstr "mit" + +#: studs.php:531 +#: adminstuds.php:908 +msgid "The bests choices at this time are" +msgstr "Vorläufig sind die besten Wahlen: " + +#: studs.php:548 +#: adminstuds.php:974 +msgid "Enter a name and a comment!" +msgstr "Geben sie irhen Name und ein Kommentar ein bitte!" + +#: studs.php:552 +#: adminstuds.php:978 +msgid "Add a comment in the poll" +msgstr "Geben sie ein Kommentar ein bitte" + +#: studs.php:555 +#: adminstuds.php:979 +msgid "Name" +msgstr "Name" + +#: studs.php:563 +msgid "Export: Spreadsheet" +msgstr "Export : Tabellenkalkulationprogram" + +#: studs.php:565 +msgid "Agenda" +msgstr "Agenda" + +#: index.php:70 +msgid "What is it about?" +msgstr "Warum dies ?" + +#: index.php:71 +msgid "Making polls to schedule meetings or events, quickly and easily.
You can also run polls to determine what will be your next meeting place, the meeting topic or anything like the country you would like to visit during your next holidays." +msgstr "Ein Datum zu finden das allen Betroffenen passt.
Sie können ebenfalls benötigen um gemeinsam eine Wahl zu treffen für ein Termin ein Treffpunkt, ein Besprechungsthema oder die Marke ihrer nächsten Kaffeemaschine " + +#: choix_autre.php:144 +msgid "Your poll aim is to make a choice between different subjects.
Enter the subjects to vote for:" +msgstr "Sie erstellen eine Umfrage mit mehreren Wahlmglichkeiten
Geben sie die verschiedenen Wahlmglichkeiten an :" + +#: choix_autre.php:150 +msgid "Choice" +msgstr "Wahl" + +#: choix_autre.php:162 +msgid "5 choices more" +msgstr "Um 5 weitere Felder zu erstellen" + +#: choix_autre.php:177 +msgid "Enter at least one choice" +msgstr "Mindestens 1 Feld muss ausgefüllt sein !" + +#: choix_autre.php:182 +msgid "Characters \" < and > are not permitted" +msgstr "Die Schriftzeichen < > und \" sind nicht genehmigt !" + +#: choix_autre.php:191 +msgid "Your poll will be automatically removed after 6 months.
You can fix another removal date for it." +msgstr "Ihre Umfrage wird automatisch nach 6 Monaten gelscht.
Sie können dennoch eine andere Frist wählen." + +#: choix_autre.php:193 +msgid "Removal date (optional)" +msgstr "Enddatum (optional)" + +#: choix_autre.php:193 +msgid "(DD/MM/YYYY)" +msgstr "(TT/MM/JJJJ)" + +#: adminstuds.php:114 +msgid "Column's adding" +msgstr "Einfügen einer Spalte" + +#: adminstuds.php:117 +msgid "Add a new column" +msgstr "Wenn sie eine Spalte einfügen möchten" + +#: adminstuds.php:121 +msgid "You can add a new scheduling date to your poll.
If you just want to add a new hour to an existant date, put the same date and choose a new hour." +msgstr "Sie können in ihrer Umfrage ein Datum einfügen. Falls das Datum bereits schon besteht und sie eine Uhrzeit eingeben möchten tragen sie bitte das ganze Datum ein mit der gewünschten Uhrzeit so das dieser in der Umfrage erscheinen kann." + +#: adminstuds.php:122 +msgid "Add a date" +msgstr "Einfügen eines datums" + +#: adminstuds.php:143 +msgid "Add a start hour (optional)" +msgstr "Einfügen einer Startuhrtzeit (optional)" + +#: adminstuds.php:157 +msgid "Add a end hour (optional)" +msgstr "Einfügen einer Enduhrzeit (optional)" + +#: adminstuds.php:273 +#: adminstuds.php:378 +msgid "[ADMINISTRATOR] New column for your poll" +msgstr "[ADMINISTRATOR] Einfügen einer neuen Spalte in die Umfrage " + +#: adminstuds.php:273 +#: adminstuds.php:379 +msgid "" +"You have added a new column in your poll. \n" +"You can inform the voters of this change with this link" +msgstr "" +"Sie haben eine neue Spalte in die Umfrage eingefügt. \n" +"Sie können die Beteiligten über diese änderung informieren in dem sie ihen folgende Adresse schicken. " + +#: adminstuds.php:498 +msgid "[ADMINISTRATOR] New title for your poll" +msgstr "[ADMINISTRATOR] änderung des Titels der " + +#: adminstuds.php:499 +msgid "" +"You have changed the title of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Sie haben den Titel ihrer Umfrage geändert. \n" +"Sie können diese Umfrage mit dem fogenden Link ändern " + +#: adminstuds.php:510 +msgid "[ADMINISTRATOR] New comments for your poll" +msgstr "[ADMINISTRATOR] änderung der Kommentare der Umfrage mit " + +#: adminstuds.php:510 +msgid "" +"You have changed the comments of your poll. \n" +"You can modify this poll with this link" +msgstr "" +" Sie haben die Kommentare ihrer Umfrage geändert. \n" +"Sie können diese Umfrage mit dem fogenden Link ändern " + +#: adminstuds.php:520 +msgid "[ADMINISTRATOR] New email address for your poll" +msgstr "[ADMINISTRATOR] änderung der email Adresse des administrator " + +#: adminstuds.php:521 +msgid "" +"You have changed your email address in your poll. \n" +"You can modify this poll with this link" +msgstr "" + +#: adminstuds.php:582 +msgid "As poll administrator, you can change all the lines of this poll with \"infos\".
You can, as well, remove a column or a line with \"Cancel\".
You can also add a new column with \"Add.
Finally, you can change the informations of this poll like the title, the comments or your email address." +msgstr "Als administrator können sie alle linien ihrer Umfrage mit \"Icone ändern.
Sie haben auch die möglichkeit eine Spalte oder eine Linie mit \"Annuler\" zu löschen.
Falls sie vergessen haben eine Wahlmöglichkeit einzutragen können sie eine Spalte zufügen in dem sie \"rückgängig\"
auswählen. en bout de ligne des noms de colonne. Sie können ebenfalls informationen wie den Titel die Kommentare oder ihre email adresse ändern. " + +#: adminstuds.php:851 +msgid "The date is not correct !" +msgstr "Das gewählte Datum ist nicht korrekt!" + +#: adminstuds.php:916 +msgid "Poll's management" +msgstr "Verwaltung ihrer Umfrage" + +#: adminstuds.php:921 +msgid "Change the title" +msgstr "Wenn sie den Titel der Umfrage ändern möchten" + +#: adminstuds.php:928 +msgid "Generate the convocation letter (.PDF), choose the place to meet and validate" +msgstr "Wenn sie die Einladung (in PDF) erstellen möchten, wählen sie bitte einen Versammlungsort und bestätigen" + +#: adminstuds.php:939 +msgid "Enter a meeting place!" +msgstr "Geben sie den Versammlungsort an!" + +#: adminstuds.php:944 +msgid "Enter a new title!" +msgstr "Geben sie einen neuen Titel an!" + +#: adminstuds.php:948 +msgid "Change the comments" +msgstr "Wenn sie die Kommentare der Umfrage ändern möchten" + +#: adminstuds.php:952 +msgid "Change your email address" +msgstr "Wenn sie ihre email adresse ändern möchten" + +#: adminstuds.php:956 +msgid "Enter a new email address!" +msgstr "Geben sie eine neue Adresse an!" + +#: adminstuds.php:985 +msgid "Remove your poll" +msgstr "Wenn sie ihre Umfrage löschen möchten" + +#: adminstuds.php:985 +msgid "Remove the poll" +msgstr "Löschen der Umfrage" + +#: adminstuds.php:988 +msgid "Confirm removal of your poll" +msgstr "Bestätigen sie bitte das löschen der Umfrage" + +#: adminstuds.php:988 +msgid "Remove this poll!" +msgstr "Ich lösche die Umfrage!" + +#: adminstuds.php:989 +msgid "Keep this poll!" +msgstr "Ich behalte die Umfrage!" + +#: adminstuds.php:1022 +msgid "[ADMINISTRATOR] Removing of your poll" +msgstr "[ADMINISTRATOR] Löschen der Umfrage mit " + +#: adminstuds.php:1022 +msgid "" +"You have removed your poll. \n" +"You can make new polls with this link" +msgstr "" +"Sie haben eine Umfrage. \n" +"Mit folgendem können sie ein neue Umfrage erstellen." + +#: adminstuds.php:1043 +msgid "Your poll has been removed!" +msgstr "Ihre Umfrage wurde gelöscht!" + +#: admin/index.php:82 +msgid "Confirm removal of the poll " +msgstr "Löschen dieser Umfrage bestätigen" + +#: admin/index.php:112 +msgid "polls in the database at this time" +msgstr " In der Basis vorhandene Umfragen" + +#: admin/index.php:117 +msgid "Poll ID" +msgstr "Umfrage ID" + +#: admin/index.php:117 +msgid "Format" +msgstr "Format" + +#: admin/index.php:117 +msgid "Title" +msgstr "Titel" + +#: admin/index.php:117 +msgid "Author" +msgstr "Autor" + +#: admin/index.php:117 +msgid "Expiration's date" +msgstr "Enddatum" + +#: admin/index.php:117 +msgid "Users" +msgstr "Anzahl der Benutzer" + +#: admin/index.php:117 +msgid "Actions" +msgstr "Aktionen" + +#: admin/index.php:140 +msgid "See the poll" +msgstr "Umfrage ansehen" + +#: admin/index.php:141 +msgid "Change the poll" +msgstr "Umfrage ändern" + +#~ msgid "january" +#~ msgstr "Januar" +#~ msgid "february" +#~ msgstr "Februar" +#~ msgid "march" +#~ msgstr "März" +#~ msgid "april" +#~ msgstr "April" +#~ msgid "may" +#~ msgstr "May" +#~ msgid "june" +#~ msgstr "Juni" +#~ msgid "july" +#~ msgstr "Juli" +#~ msgid "august" +#~ msgstr "August" +#~ msgid "september" +#~ msgstr "September" +#~ msgid "october" +#~ msgstr "Oktober" +#~ msgid "november" +#~ msgstr "November" +#~ msgid "december" +#~ msgstr "December" +#~ msgid "Sources" +#~ msgstr "Quellen" +#~ msgid "Back" +#~ msgstr "Zurück" +#~ msgid "" +#~ "Here are the sources of " +#~ msgstr "" +#~ "Die Quellen von " + diff --git a/locale/en_GB/LC_MESSAGES/Studs.mo b/locale/en_GB/LC_MESSAGES/Studs.mo new file mode 100644 index 0000000..5ccc44f Binary files /dev/null and b/locale/en_GB/LC_MESSAGES/Studs.mo differ diff --git a/locale/en_GB/LC_MESSAGES/Studs.po b/locale/en_GB/LC_MESSAGES/Studs.po new file mode 100644 index 0000000..cd1a11e --- /dev/null +++ b/locale/en_GB/LC_MESSAGES/Studs.po @@ -0,0 +1,751 @@ +msgid "" +msgstr "" +"Project-Id-Version: Studs 0.6.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-02 11:21+0100\n" +"PO-Revision-Date: 2010-05-02 11:32+0100\n" +"Last-Translator: Raphaël Droz \n" +"Language-Team: Guilhem Borghesi, Raphaël Droz\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: EN\n" +"X-Poedit-Country: UNITED KINGDOM\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-Basepath: /var/www/studs\n" +"X-Poedit-SearchPath-0: .\n" + +#: creation_sondage.php:98 +msgid "For sending to the polled users" +msgstr "For sending to the polled users" + +#: creation_sondage.php:98 +#: creation_sondage.php:99 +msgid "Poll" +msgstr "Poll" + +#: creation_sondage.php:98 +msgid "" +"This is the message you have to send to the people you want to poll. \n" +"Now, you have to send this message to everyone you want to poll." +msgstr "" +"This is the message you have to send to the people you want to poll. \n" +"Now, you have to send this message to everyone you want to poll." + +#: creation_sondage.php:98 +msgid "hast just created a poll called" +msgstr "hast just created a poll called" + +#: creation_sondage.php:98 +msgid "Thanks for filling the poll at the link above" +msgstr "Thanks for filling the poll at the link above" + +#: creation_sondage.php:98 +#: creation_sondage.php:101 +msgid "Thanks for your confidence" +msgstr "Thanks for your confidence" + +#: creation_sondage.php:99 +msgid "Author's message" +msgstr "Author's message" + +#: creation_sondage.php:100 +msgid "" +"This message should NOT be sended to the polled people. It is private for the poll's creator.\n" +"\n" +"You can now modify it at the link above" +msgstr "" +"This message should NOT be sended to the polled people. It is private for the poll's creator.\n" +"\n" +"You can now modify it at the link above" + +#: choix_date.php:71 +#: choix_autre.php:70 +msgid "You haven't filled the first section of the poll creation." +msgstr "You haven't filled the first section of the poll creation." + +#: choix_date.php:72 +#: contacts.php:132 +#: studs.php:107 +#: choix_autre.php:71 +#: adminstuds.php:109 +#: adminstuds.php:1118 +msgid "Back to the homepage of " +msgstr "Back to the homepage of " + +#: choix_date.php:218 +#: adminstuds.php:161 +msgid "january" +msgstr "january" + +#: choix_date.php:219 +#: adminstuds.php:162 +msgid "february" +msgstr "february" + +#: choix_date.php:220 +#: adminstuds.php:163 +msgid "march" +msgstr "march" + +#: choix_date.php:221 +#: adminstuds.php:164 +msgid "april" +msgstr "april" + +#: choix_date.php:222 +#: adminstuds.php:165 +msgid "may" +msgstr "may" + +#: choix_date.php:223 +#: adminstuds.php:166 +msgid "june" +msgstr "june" + +#: choix_date.php:224 +#: adminstuds.php:167 +msgid "july" +msgstr "july" + +#: choix_date.php:225 +#: adminstuds.php:168 +msgid "august" +msgstr "august" + +#: choix_date.php:226 +#: adminstuds.php:169 +msgid "september" +msgstr "september" + +#: choix_date.php:227 +#: adminstuds.php:170 +msgid "october" +msgstr "october" + +#: choix_date.php:228 +#: adminstuds.php:171 +msgid "november" +msgstr "november" + +#: choix_date.php:229 +#: adminstuds.php:172 +msgid "december" +msgstr "december" + +#: choix_date.php:253 +msgid "Select your dates amoung the free days (green). The selected days are in blue.
You can unselect a day previously selected by clicking again on it." +msgstr "Select your dates amoung the free days (green). The selected days are in blue.
You can unselect a day previously selected by clicking again on it." + +#: choix_date.php:266 +msgid "monday" +msgstr "monday" + +#: choix_date.php:266 +msgid "tuesday" +msgstr "tuesday" + +#: choix_date.php:266 +msgid "wednesday" +msgstr "wednesday" + +#: choix_date.php:266 +msgid "thursday" +msgstr "thursday" + +#: choix_date.php:266 +msgid "friday" +msgstr "friday" + +#: choix_date.php:266 +msgid "saturday" +msgstr "saturday" + +#: choix_date.php:266 +msgid "sunday" +msgstr "sunday" + +#: choix_date.php:519 +msgid "Selected days" +msgstr "Selected days" + +#: choix_date.php:521 +msgid "For each selected day, you can choose, or not, meeting hours in the following format :
- empty,
- " +msgstr "" + +#: choix_date.php:528 +msgid "Time" +msgstr "Time" + +#: choix_date.php:556 +msgid "Bad format!" +msgstr "Bad format!" + +#: choix_date.php:565 +msgid "Remove all days" +msgstr "Remove all days" + +#: choix_date.php:565 +msgid "Copy hours of the first day" +msgstr "Copy hours of the first day" + +#: choix_date.php:565 +msgid "Remove all hours" +msgstr "Remove all hours" + +#: choix_date.php:567 +#: choix_autre.php:188 +msgid "Next" +msgstr "Next" + +#: choix_date.php:571 +msgid "Enter more choices for the voters" +msgstr "Enter more choices for the voters" + +#: choix_date.php:583 +msgid "Your poll will expire automatically 2 days after the last date of your poll." +msgstr "Your poll will expire automatically 2 days after the last date of your poll." + +#: choix_date.php:583 +msgid "Removal date" +msgstr "Removal date" + +#: choix_date.php:586 +#: choix_autre.php:217 +msgid "Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters." +msgstr "Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters." + +#: choix_date.php:592 +msgid "Back to hours" +msgstr "Back to hours" + +#: choix_date.php:593 +#: choix_autre.php:222 +msgid "Create the poll" +msgstr "Create the poll" + +#: infos_sondage.php:187 +msgid "You are in the poll creation section.
Required fields cannot be left blank" +msgstr "You are in the poll creation section.
Required fields cannot be left blank" + +#: infos_sondage.php:192 +msgid "Poll title *: " +msgstr "Poll title *: " + +#: infos_sondage.php:194 +msgid "Enter a title" +msgstr "Enter a title" + +#: infos_sondage.php:197 +#: infos_sondage.php:202 +#: infos_sondage.php:214 +msgid "Characters < > and \" are not permitted" +msgstr "Characters < > and \" are not permitted" + +#: infos_sondage.php:200 +msgid "Comments: " +msgstr "Comments: " + +#: infos_sondage.php:205 +msgid "Your name*: " +msgstr "Your name*: " + +#: infos_sondage.php:211 +#: contacts.php:174 +msgid "Enter a name" +msgstr "Enter a name" + +#: infos_sondage.php:217 +msgid "Your e-mail address *: " +msgstr "Your e-mail address *: " + +#: infos_sondage.php:223 +msgid "Enter an email address" +msgstr "Enter an email address" + +#: infos_sondage.php:226 +msgid "The address is not correct! (You should enter a valid email address in order to receive the link to your poll)" +msgstr "The address is not correct! (You should enter a valid email address in order to receive the link to your poll)" + +#: infos_sondage.php:237 +msgid "The fields marked with * are required!" +msgstr "The fields marked with * are required!" + +#: infos_sondage.php:243 +msgid " Voters can modify their vote themselves." +msgstr " Voters can modify their vote themselves." + +#: infos_sondage.php:245 +msgid " To receive an email for each new vote." +msgstr " To receive an email for each new vote." + +#: infos_sondage.php:249 +msgid "Schedule an event" +msgstr "Schedule an event" + +#: infos_sondage.php:251 +msgid "Make a choice" +msgstr "Make a choice" + +#: contacts.php:111 +msgid "[CONTACT] You have sent a question " +msgstr "[CONTACT] You have sent a question " + +#: contacts.php:111 +msgid "You have a question from a user " +msgstr "You have a question from a user " + +#: contacts.php:111 +msgid "User" +msgstr "User" + +#: contacts.php:111 +msgid "User's email address" +msgstr "User's email address" + +#: contacts.php:111 +msgid "Message" +msgstr "Message" + +#: contacts.php:114 +msgid "[COPY] Someone has sent a question " +msgstr "[COPY] Someone has sent a question " + +#: contacts.php:114 +msgid "Here is a copy of your question" +msgstr "Here is a copy of your question" + +#: contacts.php:114 +msgid "We're going to answer your question shortly." +msgstr "We're going to answer your question shortly." + +#: contacts.php:114 +#: studs.php:219 +#: studs.php:258 +#: adminstuds.php:354 +#: adminstuds.php:458 +#: adminstuds.php:578 +#: adminstuds.php:588 +#: adminstuds.php:600 +#: adminstuds.php:1096 +msgid "Thanks for your confidence." +msgstr "Thanks for your confidence." + +#: contacts.php:131 +msgid "Your message has been sent!" +msgstr "Your message has been sent!" + +#: contacts.php:168 +msgid "If you have questions, you can send a message here." +msgstr "If you have questions, you can send a message here." + +#: contacts.php:170 +msgid "Your name" +msgstr "Your name" + +#: contacts.php:178 +msgid "Your email address " +msgstr "Your email address " + +#: contacts.php:184 +msgid "Question" +msgstr "Question" + +#: contacts.php:193 +msgid "Send your question" +msgstr "Send your question" + +#: studs.php:106 +#: adminstuds.php:108 +msgid "This poll doesn't exist !" +msgstr "This poll doesn't exist !" + +#: studs.php:219 +#: studs.php:258 +msgid "Poll's participation" +msgstr "Poll's participation" + +#: studs.php:219 +#: studs.php:258 +msgid "" +"has filled a line.\n" +"You can find your poll at the link" +msgstr "" +"has filled a line.\n" +"You can find your poll at the link" + +#: studs.php:295 +#: adminstuds.php:647 +msgid "Initiator of the poll" +msgstr "Initiator of the poll" + +#: studs.php:299 +#: studs.php:613 +#: adminstuds.php:651 +#: adminstuds.php:1038 +msgid "Comments" +msgstr "Comments" + +#: studs.php:310 +msgid "If you want to vote in this poll, you have to give your name, choose the values that fit best for you
(without paying attention to the choices of the other voters) and validate with the plus button at the end of the line." +msgstr "If you want to vote in this poll, you have to give your name, choose the values that fit best for you
(without paying attention to the choices of the other voters) and validate with the plus button at the end of the line." + +#: studs.php:517 +#: adminstuds.php:886 +msgid "Addition" +msgstr "Addition" + +#: studs.php:545 +#: adminstuds.php:916 +msgid "Enter a name !" +msgstr "Enter a name !" + +#: studs.php:548 +#: adminstuds.php:921 +msgid "The name you've chosen already exist in this poll!" +msgstr "The name you've chosen already exist in this poll!" + +#: studs.php:551 +#: adminstuds.php:926 +msgid "Characters \" ' < et > are not permitted" +msgstr "Characters \" ' < et > are not permitted" + +#: studs.php:601 +#: adminstuds.php:985 +msgid "The best choice at this time is" +msgstr "The best choice at this time is" + +#: studs.php:601 +#: studs.php:604 +#: adminstuds.php:985 +#: adminstuds.php:988 +msgid "with" +msgstr "with" + +#: studs.php:601 +#: studs.php:604 +#: adminstuds.php:985 +#: adminstuds.php:988 +msgid "vote" +msgstr "vote" + +#: studs.php:604 +#: adminstuds.php:988 +msgid "The bests choices at this time are" +msgstr "The bests choices at this time are" + +#: studs.php:621 +#: adminstuds.php:1048 +msgid "Enter a name and a comment!" +msgstr "Enter a name and a comment!" + +#: studs.php:625 +#: adminstuds.php:1052 +msgid "Add a comment in the poll" +msgstr "Add a comment in the poll" + +#: studs.php:626 +#: adminstuds.php:1053 +msgid "Name" +msgstr "Name" + +#: studs.php:636 +msgid "Export: Spreadsheet" +msgstr "Export: Spreadsheet" + +#: studs.php:638 +msgid "Agenda" +msgstr "Agenda" + +#: index.php:127 +msgid "What is it about?" +msgstr "What is it about?" + +#: index.php:128 +msgid "Making polls to schedule meetings or events, quickly and easily.
You can also run polls to determine what will be your next meeting place, the meeting topic or anything like the country you would like to visit during your next holidays." +msgstr "Making polls to schedule meetings or events, quickly and easily.
You can also run polls to determine what will be your next meeting place, the meeting topic or anything like the country you would like to visit during your next holidays." + +#: index.php:131 +msgid "Make a poll" +msgstr "Make a poll" + +#: choix_autre.php:165 +msgid "Your poll aim is to make a choice between different subjects.
Enter the subjects to vote for:" +msgstr "Your poll aim is to make a choice between different subjects.
Enter the subjects to vote for:" + +#: choix_autre.php:171 +msgid "Choice" +msgstr "Choice" + +#: choix_autre.php:183 +msgid "5 choices more" +msgstr "5 choices more" + +#: choix_autre.php:198 +msgid "Enter at least one choice" +msgstr "Enter at least one choice" + +#: choix_autre.php:203 +msgid "Characters \" < and > are not permitted" +msgstr "Characters \" < and > are not permitted" + +#: choix_autre.php:212 +msgid "Your poll will be automatically removed after 6 months.
You can fix another removal date for it." +msgstr "Your poll will be automatically removed after 6 months.
You can fix another removal date for it." + +#: choix_autre.php:214 +msgid "Removal date (optional)" +msgstr "Removal date (optional)" + +#: choix_autre.php:214 +msgid "(DD/MM/YYYY)" +msgstr "(DD/MM/YYYY)" + +#: adminstuds.php:143 +msgid "Column's adding" +msgstr "Column's adding" + +#: adminstuds.php:146 +msgid "Add a new column" +msgstr "Add a new column" + +#: adminstuds.php:150 +msgid "You can add a new scheduling date to your poll.
If you just want to add a new hour to an existant date, put the same date and choose a new hour." +msgstr "You can add a new scheduling date to your poll.
If you just want to add a new hour to an existant date, put the same date and choose a new hour." + +#: adminstuds.php:151 +msgid "Add a date" +msgstr "Add a date" + +#: adminstuds.php:182 +msgid "Add a start hour (optional)" +msgstr "Add a start hour (optional)" + +#: adminstuds.php:196 +msgid "Add a end hour (optional)" +msgstr "Add a end hour (optional)" + +#: adminstuds.php:354 +#: adminstuds.php:458 +msgid "[ADMINISTRATOR] New column for your poll" +msgstr "[ADMINISTRATOR] New column for your poll" + +#: adminstuds.php:354 +#: adminstuds.php:458 +msgid "" +"You have added a new column in your poll. \n" +"You can inform the voters of this change with this link" +msgstr "" +"You have added a new column in your poll. \n" +"You can inform the voters of this change with this link" + +#: adminstuds.php:576 +msgid "[ADMINISTRATOR] New title for your poll" +msgstr "[ADMINISTRATOR] New title for your poll" + +#: adminstuds.php:577 +msgid "" +"You have changed the title of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"You have changed the title of your poll. \n" +"You can modify this poll with this link" + +#: adminstuds.php:588 +msgid "[ADMINISTRATOR] New comments for your poll" +msgstr "[ADMINISTRATOR] New comments for your poll" + +#: adminstuds.php:588 +msgid "" +"You have changed the comments of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"You have changed the comments of your poll. \n" +"You can modify this poll with this link" + +#: adminstuds.php:598 +msgid "[ADMINISTRATOR] New email address for your poll" +msgstr "[ADMINISTRATOR] New email address for your poll" + +#: adminstuds.php:599 +msgid "" +"You have changed your email address in your poll. \n" +"You can modify this poll with this link" +msgstr "" +"You have changed your email address in your poll. \n" +"You can modify this poll with this link" + +#: adminstuds.php:662 +msgid "As poll administrator, you can change all the lines of this poll with - empty,
- \"8h\", \"8H\" or \"8:00\" to give a " +#~ "meeting's start hour,
- \"8-11\", \"8h-11h\", \"8H-11H\" ou \"8:00-" +#~ "11:00\" to give a meeting's start and end hour,
- \"8h15-11h15\", " +#~ "\"8H15-11H15\" ou \"8:15-11:15\" for the same thing but with minutes." +#~ msgstr "" +#~ "For each selected day, you can choose, or not, meeting hours in the " +#~ "following format :
- empty,
- \"8h\", \"8H\" or \"8:00\" to give a " +#~ "meeting's start hour,
- \"8-11\", \"8h-11h\", \"8H-11H\" ou \"8:00-" +#~ "11:00\" to give a meeting's start and end hour,
- \"8h15-11h15\", " +#~ "\"8H15-11H15\" ou \"8:15-11:15\" for the same thing but with minutes." +#~ msgid "Confirm removal of the poll " +#~ msgstr "Confirm removal of the poll " +#~ msgid "" +#~ "As poll administrator, you can change all the lines of this poll with " +#~ "\"infos\".
You can, as well, remove " +#~ "a column or a line with \"Cancel\". " +#~ "
You can also add a new column with 
+#~ .
Finally, you can change the informations of this " +#~ "poll like the title, the comments or your email address." +#~ msgstr "" +#~ "As poll administrator, you can change all the lines of this poll with " +#~ "\"infos\".
You can, as well, remove " +#~ "a column or a line with \"Cancel\". " +#~ "
You can also add a new column with 
+#~ .
Finally, you can change the informations of this " +#~ "poll like the title, the comments or your email address." +#~ msgid "Users" +#~ msgstr "Users" +#~ msgid "About" +#~ msgstr "About" +#~ msgid "Contact us" +#~ msgstr "Contact us" +#~ msgid "Actions" +#~ msgstr "Actions" +#~ msgid "Expiration's date" +#~ msgstr "Expiration's date" +#~ msgid "Error!" +#~ msgstr "Error!" +#~ msgid "Format" +#~ msgstr "Format" +#~ msgid "Author" +#~ msgstr "Author" +#~ msgid "Poll creation (1 on 2)" +#~ msgstr "Poll creation (1 on 2)" +#~ msgid "Title" +#~ msgstr "Title" +#~ msgid "Polls administrator" +#~ msgstr "Polls administrator" +#~ msgid "Change the poll" +#~ msgstr "Change the poll" +#~ msgid "Poll subjects (2 on 2)" +#~ msgstr "Poll subjects (2 on 2)" +#~ msgid "Poll dates (2 on 2)" +#~ msgstr "Poll dates (2 on 2)" +#~ msgid "polls in the database at this time" +#~ msgstr "polls in the database at this time" +#~ msgid "Logs" +#~ msgstr "Logs" +#~ msgid "Poll ID" +#~ msgstr "Poll ID" +#~ msgid "Cleaning" +#~ msgstr "Cleaning" +#~ msgid "Admin" +#~ msgstr "Admin" +#~ msgid "See the poll" +#~ msgstr "See the poll" +#~ msgid "Sources" +#~ msgstr "Sources" +#~ msgid "Contact" +#~ msgstr "Contact" +#~ msgid "Home" +#~ msgstr "Home" +#~ msgid "Example" +#~ msgstr "Example" +#~ msgid "Make your polls" +#~ msgstr "Make your polls" +#~ msgid "Back" +#~ msgstr "Back" +#~ msgid "" +#~ "Here are the sources of " +#~ msgstr "" +#~ "Here are the sources of " +#~ msgid "" +#~ "Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009" +#~ msgstr "" +#~ "Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009" + diff --git a/locale/es_ES/LC_MESSAGES/Studs.mo b/locale/es_ES/LC_MESSAGES/Studs.mo new file mode 100644 index 0000000..ab0a92d Binary files /dev/null and b/locale/es_ES/LC_MESSAGES/Studs.mo differ diff --git a/locale/es_ES/LC_MESSAGES/Studs.po b/locale/es_ES/LC_MESSAGES/Studs.po new file mode 100644 index 0000000..3084fce --- /dev/null +++ b/locale/es_ES/LC_MESSAGES/Studs.po @@ -0,0 +1,755 @@ +msgid "" +msgstr "" +"Project-Id-Version: Studs 0.6.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-05 21:37+0100\n" +"PO-Revision-Date: 2010-06-05 21:38+0100\n" +"Last-Translator: Raphaël Droz \n" +"Language-Team: Guilhem Borghesi, Raphaël Droz\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: ES\n" +"X-Poedit-Country: SPAIN\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-Basepath: /var/www/studs\n" +"X-Poedit-SearchPath-0: .\n" + +#: bandeaux.php:59 +msgid "Make your polls" +msgstr "Encuestas para la universidad" + +#: bandeaux.php:62 +msgid "Poll dates (2 on 2)" +msgstr "Elección de dís (2 de 2)" + +#: bandeaux.php:65 +msgid "Poll subjects (2 on 2)" +msgstr "Elección de temas (2 de 2)" + +#: bandeaux.php:68 +msgid "Polls administrator" +msgstr "Administrador de la base" + +#: bandeaux.php:71 +msgid "Contact us" +msgstr "Contáctenos" + +#: bandeaux.php:77 +msgid "Error!" +msgstr "Error!" + +#: bandeaux.php:80 +#: bandeaux.php:98 +msgid "About" +msgstr "Informaciones generales" + +#: bandeaux.php:94 +#: bandeaux.php:108 +#: bandeaux.php:119 +msgid "Home" +msgstr "Inicio" + +#: bandeaux.php:95 +msgid "Example" +msgstr "Ejemplo" + +#: bandeaux.php:96 +msgid "Contact" +msgstr "Contáctenos" + +#: bandeaux.php:99 +msgid "Admin" +msgstr "Admin" + +#: bandeaux.php:109 +msgid "Logs" +msgstr "Histórico" + +#: bandeaux.php:110 +msgid "Cleaning" +msgstr "Limpieza" + +#: bandeaux.php:129 +#: bandeaux.php:135 +msgid "Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009" +msgstr "Université de Strasbourg. Creación: Guilhem BORGHESI. 2008-2009" + +#: creation_sondage.php:89 +msgid "For sending to the polled users" +msgstr "Para enviar a los encuestados" + +#: creation_sondage.php:89 +#: creation_sondage.php:90 +msgid "Poll" +msgstr "Encuesta" + +#: creation_sondage.php:89 +msgid "" +"This is the message you have to send to the people you want to poll. \n" +"Now, you have to send this message to everyone you want to poll." +msgstr "Eso es el mensaje que debe estar enviado ahora a los encuestados." + +#: creation_sondage.php:89 +msgid "hast just created a poll called" +msgstr "ha creado una encuesta titulado" + +#: creation_sondage.php:89 +msgid "Thanks for filling the poll at the link above" +msgstr "Gracias de llenar esta encuesta al enlace siguiente" + +#: creation_sondage.php:89 +#: creation_sondage.php:92 +msgid "Thanks for your confidence" +msgstr "Gracias por su confianza" + +#: creation_sondage.php:90 +msgid "Author's message" +msgstr "Reservado al autor" + +#: creation_sondage.php:91 +msgid "" +"This message should NOT be sended to the polled people. It is private for the poll's creator.\n" +"\n" +"You can now modify it at the link above" +msgstr "" +"Este mensaje no debe estar enviado a los encuestados. Esta reservado al autor dela encuesta.\n" +"\n" +"Usted puede editar esta encuesta al enlace siguiente" + +#: choix_date.php:63 +#: choix_autre.php:62 +msgid "You haven't filled the first section of the poll creation." +msgstr "Usted no habia llenado la primera pagina dela encuesta" + +#: choix_date.php:64 +#: contacts.php:77 +#: studs.php:88 +#: choix_autre.php:63 +#: adminstuds.php:79 +#: adminstuds.php:1044 +msgid "Back to the homepage of " +msgstr "Retroceder al inicio de" + +#: choix_date.php:220 +msgid "Select your dates amoung the free days (green). The selected days are in blue.
You can unselect a day previously selected by clicking again on it." +msgstr "Seleccionar sus fechas entre los días disponibles que aparecen en verde. Cuando son seleccionados los días aparecen en azul.
Usted puede egalemente borrar días en seleccionarlos de nuevo." + +#: choix_date.php:233 +msgid "monday" +msgstr "lunes" + +#: choix_date.php:233 +msgid "tuesday" +msgstr "martes" + +#: choix_date.php:233 +msgid "wednesday" +msgstr "miécoles" + +#: choix_date.php:233 +msgid "thursday" +msgstr "jueves" + +#: choix_date.php:233 +msgid "friday" +msgstr "vienes" + +#: choix_date.php:233 +msgid "saturday" +msgstr "sábado" + +#: choix_date.php:233 +msgid "sunday" +msgstr "domingo" + +#: choix_date.php:485 +msgid "Selected days" +msgstr "Días seleccionados" + +#: choix_date.php:487 +msgid "For each selected day, you can choose, or not, meeting hours in the following format :
- empty,
- \"8h\", \"8H\" or \"8:00\" to give a meeting's start hour,
- \"8-11\", \"8h-11h\", \"8H-11H\" ou \"8:00-11:00\" to give a meeting's start and end hour,
- \"8h15-11h15\", \"8H15-11H15\" ou \"8:15-11:15\" for the same thing but with minutes." +msgstr "Para algún día que había seleccionado, Usted puede escoger, o no, de horas de reunión con este formato:
- vacío,
- \"8h\", \"8H\" o \"8:00\" para proponer una hora de principio de reunión,
- \"8-11\", \"8h-11h\", \"8H-11H\" o \"8:00-11:00\" para un hueco,
- \"8h15-11h15\", \"8H15-11H15\" o \"8:15-11:15\" para un hueco con minutos." + +#: choix_date.php:494 +msgid "Time" +msgstr "Horario" + +#: choix_date.php:522 +msgid "Bad format!" +msgstr "Formato incorrecto !" + +#: choix_date.php:531 +msgid "Remove all days" +msgstr "Borrar todos los días" + +#: choix_date.php:531 +msgid "Copy hours of the first day" +msgstr "Copiar los horarios del primer día" + +#: choix_date.php:531 +msgid "Remove all hours" +msgstr "Borrar todos los horarios" + +#: choix_date.php:533 +#: choix_autre.php:167 +msgid "Next" +msgstr "Seguir" + +#: choix_date.php:537 +msgid "Enter more choices for the voters" +msgstr "Introduzca más posibilidades por la encuesta!" + +#: choix_date.php:549 +msgid "Your poll will expire automatically 2 days after the last date of your poll." +msgstr "Su encuesta será automaticamente borrado 2 días despúes de la última fecha." + +#: choix_date.php:549 +msgid "Removal date" +msgstr "Fecha de borrado" + +#: choix_date.php:552 +#: choix_autre.php:196 +msgid "Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters." +msgstr "Cuando Usted confirmarà la creacion de su encuesta, Usted serà automaticamente redigiriendo a la pagina de su encuesta.

Alora, Usted recibirà rapidamente uno correo electrinico conteniendo el enlace de su encuesta para darlo a los encuestados." + +#: choix_date.php:558 +msgid "Back to hours" +msgstr "Retroceder a los horarios" + +#: choix_date.php:559 +#: choix_autre.php:201 +msgid "Create the poll" +msgstr "Crear la encuesta" + +#: infos_sondage.php:119 +msgid "Poll creation (1 on 2)" +msgstr "Creación de encuesta (1 de 2)" + +#: infos_sondage.php:123 +msgid "You are in the poll creation section.
Required fields cannot be left blank" +msgstr "Usted ha eligiendo de crear une nueva encuesta!
Gracias por completar los campos con una *." + +#: infos_sondage.php:128 +msgid "Poll title *: " +msgstr "Título dela encuesta *: " + +#: infos_sondage.php:130 +msgid "Enter a title" +msgstr "Introducza un título" + +#: infos_sondage.php:133 +#: infos_sondage.php:138 +#: infos_sondage.php:150 +msgid "Characters < > and \" are not permitted" +msgstr "Los caracteres < > y \" no estan autorizados!" + +#: infos_sondage.php:136 +msgid "Comments: " +msgstr "Comentarios : " + +#: infos_sondage.php:141 +msgid "Your name*: " +msgstr "Su nombre *: " + +#: infos_sondage.php:147 +#: contacts.php:119 +msgid "Enter a name" +msgstr "Introduzca un nombre" + +#: infos_sondage.php:153 +msgid "Your e-mail address *: " +msgstr "Su dirección electrónica *: " + +#: infos_sondage.php:159 +msgid "Enter an email address" +msgstr "Introduzca una dirección electrónica" + +#: infos_sondage.php:162 +msgid "The address is not correct! (You should enter a valid email address in order to receive the link to your poll)" +msgstr "La dirección electrónica no está correcta! (Introduzca una dirección electrónica valida para recibir el enlace de su encuesta)" + +#: infos_sondage.php:173 +msgid "The fields marked with * are required!" +msgstr "Los campos con una * estan obligatorios!" + +#: infos_sondage.php:179 +msgid " Voters can modify their vote themselves." +msgstr " Los encuentados pueden cambiar su línea ellos mismos." + +#: infos_sondage.php:181 +msgid " To receive an email for each new vote." +msgstr " Usted quiere recibir un correo electónico cada vez que alguien participe a la encuesta." + +#: infos_sondage.php:185 +msgid "Schedule an event" +msgstr "Encuesta para planificar un evento" + +#: infos_sondage.php:187 +msgid "Make a choice" +msgstr "Encuesta para otras cosas" + +#: infos_sondage.php:188 +#: index.php:73 +msgid "Make a poll" +msgstr "Crear una encuesta" + +#: contacts.php:56 +msgid "[CONTACT] You have sent a question " +msgstr "[CONTACT] Envia de pregunta " + +#: contacts.php:56 +msgid "You have a question from a user " +msgstr "Hay une pregunta de usuario de " + +#: contacts.php:56 +msgid "User" +msgstr "Usuario" + +#: contacts.php:56 +msgid "User's email address" +msgstr "Dirección electrónica del usuario" + +#: contacts.php:56 +msgid "Message" +msgstr "Mensaje" + +#: contacts.php:59 +msgid "[COPY] Someone has sent a question " +msgstr "[COPIA] Envia de pregunta " + +#: contacts.php:59 +msgid "Here is a copy of your question" +msgstr "Eso es una copia de su pregunta" + +#: contacts.php:59 +msgid "We're going to answer your question shortly." +msgstr "Nos tomaremos en cuenta vuestro mensaje rapidamente." + +#: contacts.php:59 +#: studs.php:171 +#: studs.php:211 +#: adminstuds.php:273 +#: adminstuds.php:379 +#: adminstuds.php:500 +#: adminstuds.php:510 +#: adminstuds.php:522 +#: adminstuds.php:1022 +msgid "Thanks for your confidence." +msgstr "Gracias por su confianza." + +#: contacts.php:76 +msgid "Your message has been sent!" +msgstr "Su mensaje ha sido buen expedido!" + +#: contacts.php:113 +msgid "If you have questions, you can send a message here." +msgstr "Para todas preguntas, Usted puede dejar un mensaje con este pagina." + +#: contacts.php:115 +msgid "Your name" +msgstr "Su nombre" + +#: contacts.php:123 +msgid "Your email address " +msgstr "Su dirección electrónica " + +#: contacts.php:129 +msgid "Question" +msgstr "Pregunta" + +#: contacts.php:138 +msgid "Send your question" +msgstr "Enviar su pregunta" + +#: studs.php:87 +#: adminstuds.php:78 +msgid "This poll doesn't exist !" +msgstr "Este encuesta no existe!" + +#: studs.php:118 +msgid "anonyme" +msgstr "" + +#: studs.php:171 +#: studs.php:211 +msgid "Poll's participation" +msgstr "Participación a la encuesta" + +#: studs.php:171 +#: studs.php:211 +msgid "" +"has filled a line.\n" +"You can find your poll at the link" +msgstr "" +"acaba de llenar una línea.\n" +"Usted puede retroceder a su encuesta con el enlace siguiente" + +#: studs.php:246 +#: adminstuds.php:567 +msgid "Initiator of the poll" +msgstr "Autor dela encuesta" + +#: studs.php:250 +#: studs.php:540 +#: adminstuds.php:571 +#: adminstuds.php:964 +msgid "Comments" +msgstr "Comentarios" + +#: studs.php:261 +msgid "If you want to vote in this poll, you have to give your name, choose the values that fit best for you
(without paying attention to the choices of the other voters) and validate with the plus button at the end of the line." +msgstr "Para participar a esta encuesta, introduzca su nombre, elige todas las valores que son apriopriadas
(sin tener en cuenta los otros encuestados) y validar su seleccion con el botón verde a la fin de línea." + +#: studs.php:445 +#: adminstuds.php:806 +msgid "Addition" +msgstr "Suma" + +#: studs.php:473 +#: adminstuds.php:836 +msgid "Enter a name !" +msgstr "Introduzca un nombre!" + +#: studs.php:476 +#: adminstuds.php:841 +msgid "The name you've chosen already exist in this poll!" +msgstr "El nombre entrado existe ya!" + +#: studs.php:479 +#: adminstuds.php:846 +msgid "Characters \" ' < et > are not permitted" +msgstr "Los caracteres \" ' < y > no estan autorizados!" + +#: studs.php:503 +#: studs.php:505 +#: adminstuds.php:876 +#: adminstuds.php:878 +msgid "for" +msgstr "por" + +#: studs.php:505 +#: studs.php:511 +msgid "%A, den %e. %B %Y" +msgstr "%A %e de %B %Y" + +#: studs.php:522 +#: adminstuds.php:899 +msgid "vote" +msgstr "voto" + +#: studs.php:524 +#: adminstuds.php:901 +msgid "votes" +msgstr "votos" + +#: studs.php:528 +#: adminstuds.php:905 +msgid "The best choice at this time is" +msgstr "El mejor elección por el momento esta" + +#: studs.php:528 +#: studs.php:531 +#: adminstuds.php:905 +#: adminstuds.php:908 +msgid "with" +msgstr "con" + +#: studs.php:531 +#: adminstuds.php:908 +msgid "The bests choices at this time are" +msgstr "Los mejores elecciones por el momento estan" + +#: studs.php:548 +#: adminstuds.php:974 +msgid "Enter a name and a comment!" +msgstr "Introduzca su nombre y un comentario!" + +#: studs.php:552 +#: adminstuds.php:978 +msgid "Add a comment in the poll" +msgstr "Dejar un comentario en la encuesta" + +#: studs.php:555 +#: adminstuds.php:979 +msgid "Name" +msgstr "Su nombre" + +#: studs.php:563 +msgid "Export: Spreadsheet" +msgstr "Exportar : Hoja de cálculo" + +#: studs.php:565 +msgid "Agenda" +msgstr "Agenda" + +#: index.php:70 +msgid "What is it about?" +msgstr "¿Por qué esto?" + +#: index.php:71 +msgid "Making polls to schedule meetings or events, quickly and easily.
You can also run polls to determine what will be your next meeting place, the meeting topic or anything like the country you would like to visit during your next holidays." +msgstr "Hacer encuestas para planificar un evento como una reuníon de trabajo o una sortida al cine. Sirve de definir la mejora fecha por todos.
Usted puede también utilizarlo para espicificar su preferencia entre películas, destinos de viaje o cualquier otra selección." + +#: choix_autre.php:144 +msgid "Your poll aim is to make a choice between different subjects.
Enter the subjects to vote for:" +msgstr "Usted ha eligiendo de crear une nueva encuesta!
Introducza las differentes opciones :" + +#: choix_autre.php:150 +msgid "Choice" +msgstr "Opciòn" + +#: choix_autre.php:162 +msgid "5 choices more" +msgstr "Para añadir 5 campos de texto" + +#: choix_autre.php:177 +msgid "Enter at least one choice" +msgstr "Introduzca por lo menos un campo!" + +#: choix_autre.php:182 +msgid "Characters \" < and > are not permitted" +msgstr "Los caracteres \" < y > no estan autorizados!" + +#: choix_autre.php:191 +msgid "Your poll will be automatically removed after 6 months.
You can fix another removal date for it." +msgstr "Su encuesta será automaticamente borrado dentro de 6 meses.
Mientras, usted puede cambiar este fecha aquí." + +#: choix_autre.php:193 +msgid "Removal date (optional)" +msgstr "Fecha de fin (opcional)" + +#: choix_autre.php:193 +msgid "(DD/MM/YYYY)" +msgstr "(DD/MM/AAAA)" + +#: adminstuds.php:114 +msgid "Column's adding" +msgstr "Añadido de columna" + +#: adminstuds.php:117 +msgid "Add a new column" +msgstr "Para añadir una columna" + +#: adminstuds.php:121 +msgid "You can add a new scheduling date to your poll.
If you just want to add a new hour to an existant date, put the same date and choose a new hour." +msgstr "Usted puede añadir una fecha por su encuesta. Si la fecha existe ya y que usted vuele solamente añadire un horario,
pone la fecha entera con el nuevo horario o el nuevo hueco y fuera normalemente añado a la encuesta." + +#: adminstuds.php:122 +msgid "Add a date" +msgstr "Para añadir una fecha" + +#: adminstuds.php:143 +msgid "Add a start hour (optional)" +msgstr "Para añadir un horario de principio (optional)" + +#: adminstuds.php:157 +msgid "Add a end hour (optional)" +msgstr "Para añadir un horario de fin (optional)" + +#: adminstuds.php:273 +#: adminstuds.php:378 +msgid "[ADMINISTRATOR] New column for your poll" +msgstr "[ADMINISTRADOR] Añado de una nueva columna a la encuesta" + +#: adminstuds.php:273 +#: adminstuds.php:379 +msgid "" +"You have added a new column in your poll. \n" +"You can inform the voters of this change with this link" +msgstr "" +"Usted ha añado una nueva columna en su encuesta. \n" +"Usted puede informar sus usuarios de este cambio con el enlace siguiente" + +#: adminstuds.php:498 +msgid "[ADMINISTRATOR] New title for your poll" +msgstr "[ADMINISTRADOR] Cambio del titulo dela encuesta" + +#: adminstuds.php:499 +msgid "" +"You have changed the title of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Usted ha añado el titulo de su encuesta. \n" +"Usted puede cambiar su encuesta al enlace siguiente" + +#: adminstuds.php:510 +msgid "[ADMINISTRATOR] New comments for your poll" +msgstr "[ADMINISTRADOR] Cambio des los comentarios dela encuesta" + +#: adminstuds.php:510 +msgid "" +"You have changed the comments of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Usted ha cambiado los commentarios de su encuesta. \n" +"Usted puede cambiar su encuesta al enlace siguiente" + +#: adminstuds.php:520 +msgid "[ADMINISTRATOR] New email address for your poll" +msgstr "[ADMINISTRADOR] Cambio de su Dirección electrónica" + +#: adminstuds.php:521 +msgid "" +"You have changed your email address in your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Usted ha cambiado su dirección elestrónica. \n" +"Usted puede cambiar su encuesta al enlace siguiente" + +#: adminstuds.php:582 +msgid "As poll administrator, you can change all the lines of this poll with \"infos\".
You can, as well, remove a column or a line with \"Cancel\".
You can also add a new column with \"Add.
Finally, you can change the informations of this poll like the title, the comments or your email address." +msgstr "En calidad de administrador, Usted puede cambiar todas la líneas de este encuesta con \"Icone.
Usted puede también borrar una columna o una línea con \"Annuler\".
Usted puede añadir une nueva columna con \"Annuler\"
. Para acabar, Usted puede cambiar las informaciones relativas
a su encuesta como el titulo, los comentarios o ademas su dirección electrónica." + +#: adminstuds.php:851 +msgid "The date is not correct !" +msgstr "La fecha no esta correcta!" + +#: adminstuds.php:916 +msgid "Poll's management" +msgstr "Administración de su encuesta" + +#: adminstuds.php:921 +msgid "Change the title" +msgstr "Cambiar el titulo dela encuesta" + +#: adminstuds.php:928 +msgid "Generate the convocation letter (.PDF), choose the place to meet and validate" +msgstr "Producir la letra de convocación (en PDF), elige un lugar de reunión y valida" + +#: adminstuds.php:939 +msgid "Enter a meeting place!" +msgstr "Introduzca un lugar de reunión !" + +#: adminstuds.php:944 +msgid "Enter a new title!" +msgstr "Introduzca un nuevo titulo!" + +#: adminstuds.php:948 +msgid "Change the comments" +msgstr "Cambiar los commentarios dela encuesta" + +#: adminstuds.php:952 +msgid "Change your email address" +msgstr "Cambiar su dirección eletrónica" + +#: adminstuds.php:956 +msgid "Enter a new email address!" +msgstr "Introduzca una nuva dirección eletrónica!" + +#: adminstuds.php:985 +msgid "Remove your poll" +msgstr "Borrar su encuesta" + +#: adminstuds.php:985 +msgid "Remove the poll" +msgstr "Borrada de encuesta" + +#: adminstuds.php:988 +msgid "Confirm removal of your poll" +msgstr "Confirmar la borrada de su encuesta" + +#: adminstuds.php:988 +msgid "Remove this poll!" +msgstr "Borrar este encuesta!" + +#: adminstuds.php:989 +msgid "Keep this poll!" +msgstr "Dejar este encuesta!" + +#: adminstuds.php:1022 +msgid "[ADMINISTRATOR] Removing of your poll" +msgstr "[ADMINISTRADOR] Borrada de su encuesta" + +#: adminstuds.php:1022 +msgid "" +"You have removed your poll. \n" +"You can make new polls with this link" +msgstr "" +"Usted ha sido la borrada de su encuesta. \n" +"Usted puede hacer nuevas encuestas al enlace siguiente" + +#: adminstuds.php:1043 +msgid "Your poll has been removed!" +msgstr "Su encuesta ha sido borrado!" + +#: admin/index.php:82 +msgid "Confirm removal of the poll " +msgstr "Confirmar el borrado dela encuesta" + +#: admin/index.php:112 +msgid "polls in the database at this time" +msgstr "encuestas en la basa por el momento" + +#: admin/index.php:117 +msgid "Poll ID" +msgstr "ID encuesta" + +#: admin/index.php:117 +msgid "Format" +msgstr "Formato" + +#: admin/index.php:117 +msgid "Title" +msgstr "Titulo" + +#: admin/index.php:117 +msgid "Author" +msgstr "Autor" + +#: admin/index.php:117 +msgid "Expiration's date" +msgstr "Fecha de fin" + +#: admin/index.php:117 +msgid "Users" +msgstr "Usuarios" + +#: admin/index.php:117 +msgid "Actions" +msgstr "Acciones" + +#: admin/index.php:140 +msgid "See the poll" +msgstr "Ver la encuesta" + +#: admin/index.php:141 +msgid "Change the poll" +msgstr "Cambiar la encuesta" + +#~ msgid "january" +#~ msgstr "enero" +#~ msgid "february" +#~ msgstr "febrero" +#~ msgid "march" +#~ msgstr "marzo" +#~ msgid "april" +#~ msgstr "abril" +#~ msgid "may" +#~ msgstr "mayo" +#~ msgid "june" +#~ msgstr "junio" +#~ msgid "july" +#~ msgstr "julio" +#~ msgid "august" +#~ msgstr "agosto" +#~ msgid "september" +#~ msgstr "septiembre" +#~ msgid "october" +#~ msgstr "octubre" +#~ msgid "november" +#~ msgstr "noviembre" +#~ msgid "december" +#~ msgstr "diciembre" +#~ msgid "Sources" +#~ msgstr "Fuentes" +#~ msgid "Back" +#~ msgstr "Retroceder" +#~ msgid "" +#~ "Here are the sources of " +#~ msgstr "" +#~ "Las fuentes de " + diff --git a/locale/fr_FR/LC_MESSAGES/Studs.mo b/locale/fr_FR/LC_MESSAGES/Studs.mo new file mode 100644 index 0000000..8129fa9 Binary files /dev/null and b/locale/fr_FR/LC_MESSAGES/Studs.mo differ diff --git a/locale/fr_FR/LC_MESSAGES/Studs.po b/locale/fr_FR/LC_MESSAGES/Studs.po new file mode 100644 index 0000000..8ba13ae --- /dev/null +++ b/locale/fr_FR/LC_MESSAGES/Studs.po @@ -0,0 +1,859 @@ +msgid "" +msgstr "" +"Project-Id-Version: Studs 0.6.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-02-23 16:15+0100\n" +"PO-Revision-Date: 2011-02-23 16:16+0100\n" +"Last-Translator: Raphaël Droz \n" +"Language-Team: Guilhem Borghesi, Raphaël Droz\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: French\n" +"X-Poedit-Country: FRANCE\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-Basepath: /var/www/studs\n" +"X-Poedit-SearchPath-0: .\n" + +#: exportpdf.php:62 +msgid " Convocation" +msgstr "Convocation" + +#: exportpdf.php:64 +msgid "Hello," +msgstr "Bonjour," + +#: exportpdf.php:66 +msgid "You're invited at the meeting" +msgstr "Vous êtes invité à la réunion" + +#: exportpdf.php:69 +msgid "Informations about the meeting" +msgstr "Information à propos de la réunion" + +#: exportpdf.php:72 +msgid "Date" +msgstr "Date" + +#: exportpdf.php:72 +msgid "at" +msgstr "à" + +#: exportpdf.php:73 +msgid "Place" +msgstr "Lieu" + +#: exportpdf.php:75 +msgid "Cordially," +msgstr "Cordiallement" + +#: choix_autre.php:60 +#: choix_date.php:61 +#: studs.php:175 +#: adminstuds.php:70 +msgid "Error!" +msgstr "Erreur !" + +#: choix_autre.php:62 +#: choix_date.php:63 +msgid "You haven't filled the first section of the poll creation." +msgstr "Vous n'avez pas renseigné la première page du sondage" + +#: choix_autre.php:63 +#: choix_date.php:64 +#: adminstuds.php:73 +#: adminstuds.php:274 +msgid "Back to the homepage of " +msgstr "Retournez à la page d'accueil de" + +#: choix_autre.php:140 +msgid "Poll subjects (2 on 2)" +msgstr "Choix des sujets (2 sur 2)" + +#: choix_autre.php:144 +msgid "Your poll aim is to make a choice between different subjects.
Enter the subjects to vote for:" +msgstr "Vous avez créé un sondage pour déterminer un choix entre plusieurs choses
Entrez les différents choix à proposer au vote :" + +#: choix_autre.php:150 +msgid "Choice" +msgstr "Choix" + +#: choix_autre.php:162 +msgid "5 choices more" +msgstr "Pour ajouter 5 cases supplémentaires" + +#: choix_autre.php:167 +#: choix_date.php:535 +msgid "Next" +msgstr "Continuer" + +#: choix_autre.php:177 +msgid "Enter at least one choice" +msgstr "Il faut remplir au moins un champ !" + +#: choix_autre.php:182 +msgid "Characters \" < and > are not permitted" +msgstr "Les caractères \" < et > ne sont pas autorisés !" + +#: choix_autre.php:191 +msgid "Your poll will be automatically removed after 6 months.
You can fix another removal date for it." +msgstr "Votre sondage sera automatiquement effacé dans 6 mois.
Néanmoins vous pouvez décider ci-dessous d'une date plus rapprochée pour la destruction de votre sondage." + +#: choix_autre.php:193 +msgid "Removal date (optional)" +msgstr "Date de fin (optionnelle)" + +#: choix_autre.php:193 +msgid "(DD/MM/YYYY)" +msgstr "(JJ/MM/AAAA)" + +#: choix_autre.php:196 +#: choix_date.php:554 +msgid "Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters." +msgstr "Une fois que vous aurez confirmé la création du sondage, vous serez redirigé automatiquement vers la page de votre sondage.

En même temps, vous recevrez un courrier électronique contenant le lien vers votre sondage pour le faire suivre aux futurs sondés." + +#: choix_autre.php:201 +#: choix_date.php:561 +msgid "Create the poll" +msgstr "Créer le sondage" + +#: infos_sondage.php:107 +msgid "Poll creation (1 on 2)" +msgstr "Création de sondage (1 sur 2)" + +#: infos_sondage.php:113 +msgid "STUdS is not properly installed, please check the 'INSTALL' to setup the database before continuing" +msgstr "STUdS n'est pas correctement installé, merci de vous référer au fichier INSTALL pour initialiser la base de données avant de continuer." + +#: infos_sondage.php:125 +msgid "You are in the poll creation section.
Required fields cannot be left blank" +msgstr "Vous avez choisi de créer un nouveau sondage !
Merci de remplir les champs obligatoires." + +#: infos_sondage.php:130 +msgid "Poll title *: " +msgstr "Titre du sondage * : " + +#: infos_sondage.php:132 +msgid "Enter a title" +msgstr "Il faut remplir un titre !" + +#: infos_sondage.php:135 +#: infos_sondage.php:140 +#: infos_sondage.php:152 +msgid "Characters < > and \" are not permitted" +msgstr "Les caractères < > et \" ne sont pas autorisés !" + +#: infos_sondage.php:138 +msgid "Comments: " +msgstr "Commentaires : " + +#: infos_sondage.php:143 +msgid "Your name*: " +msgstr "Votre nom * : " + +#: infos_sondage.php:149 +msgid "Enter a name" +msgstr "Il faut remplir un nom !" + +#: infos_sondage.php:155 +msgid "Your e-mail address *: " +msgstr "Votre adresse e-mail * : " + +#: infos_sondage.php:161 +msgid "Enter an email address" +msgstr "Il faut remplir une adresse !" + +#: infos_sondage.php:164 +msgid "The address is not correct! (You should enter a valid email address in order to receive the link to your poll)" +msgstr "L'adresse saisie n'est pas correcte ! (Il faut une adresse valide pour recevoir le lien vers le sondage)" + +#: infos_sondage.php:176 +msgid "The fields marked with * are required!" +msgstr "Les champs marqués d'une étoile * sont obligatoires !" + +#: infos_sondage.php:182 +msgid " Voters can modify their vote themselves." +msgstr " Vous souhaitez que les sondés puissent modifier leur ligne eux-mêmes." + +#: infos_sondage.php:184 +msgid " To receive an email for each new vote." +msgstr " Vous souhaitez recevoir un mail à chaque participation d'un sondé." + +#: infos_sondage.php:188 +msgid "Schedule an event" +msgstr "Sondage pour choisir une date" + +#: infos_sondage.php:190 +msgid "Make a choice" +msgstr "Autre sondage" + +#: infos_sondage.php:192 +#: index.php:72 +#: index.php:74 +msgid "Make a poll" +msgstr "Créer un sondage" + +#: choix_date.php:217 +msgid "Poll dates (2 on 2)" +msgstr "Choix des dates (2 sur 2)" + +#: choix_date.php:222 +msgid "Select your dates amoung the free days (green). The selected days are in blue.
You can unselect a day previously selected by clicking again on it." +msgstr "Selectionnez vos dates parmi les jours disponibles qui sont en vert. Une fois selectionnés, les jours apparaissent en bleu.
Vous pouvez également enlever des jours déjà choisis en recliquant sur la case." + +#: choix_date.php:487 +msgid "Selected days" +msgstr "Jour retenus" + +#: choix_date.php:489 +msgid "For each selected day, you can choose, or not, meeting hours in the following format :
- empty,
- \"8h\", \"8H\" or \"8:00\" to give a meeting's start hour,
- \"8-11\", \"8h-11h\", \"8H-11H\" ou \"8:00-11:00\" to give a meeting's start and end hour,
- \"8h15-11h15\", \"8H15-11H15\" ou \"8:15-11:15\" for the same thing but with minutes." +msgstr "Pour chacun des jours que vous avez sélectionné, vous avez la possibilité de choisir ou non, des heures de réunion avec ce format :
- vide, si vous ne désirez pas mettre d'horaires particuliers,
- \"8h\", \"8H\" ou \"8:00\" pour proposer une heure de début de réunion,
- \"8-11\", \"8h-11h\", \"8H-11H\" ou \"8:00-11:00\" pour un créneau,
- \"8h15-11h15\", \"8H15-11H15\" ou \"8:15-11:15\" pour un créneau avec minutes." + +#: choix_date.php:496 +msgid "Time" +msgstr "Horaire" + +#: choix_date.php:509 +#: choix_date.php:550 +#: studs.php:517 +#: studs.php:523 +#: adminstuds.php:926 +#: adminstuds.php:932 +msgid "%A, den %e. %B %Y" +msgstr "%A %e %B %Y" + +#: choix_date.php:524 +msgid "Bad format!" +msgstr "Format incorrect !" + +#: choix_date.php:533 +msgid "Remove all days" +msgstr "Effacer tous les jours" + +#: choix_date.php:533 +msgid "Copy hours of the first day" +msgstr "Reporter les horaires du premier jour" + +#: choix_date.php:533 +msgid "Remove all hours" +msgstr "Effacer tous les horaires" + +#: choix_date.php:539 +msgid "Enter more choices for the voters" +msgstr "Cela ne laisse pas assez de choix aux participants !" + +#: choix_date.php:551 +msgid "Your poll will expire automatically 2 days after the last date of your poll." +msgstr "Votre sondage sera automatiquement effacé après la date la plus tardive." + +#: choix_date.php:551 +msgid "Removal date" +msgstr "Date de destruction" + +#: choix_date.php:560 +msgid "Back to hours" +msgstr "Retourner aux horaires" + +#: apropos.php:65 +#: bandeaux.php:74 +msgid "About" +msgstr "Informations générales" + +#: bandeaux.php:70 +#: bandeaux.php:84 +#: bandeaux.php:96 +msgid "Home" +msgstr "Accueil" + +#: bandeaux.php:71 +msgid "Example" +msgstr "Exemple" + +#: bandeaux.php:72 +msgid "Contact" +msgstr "Contact" + +#: bandeaux.php:75 +msgid "Admin" +msgstr "Admin" + +#: bandeaux.php:86 +msgid "Logs" +msgstr "Historique" + +#: bandeaux.php:87 +msgid "Cleaning" +msgstr "Nettoyage" + +#: bandeaux.php:106 +#: bandeaux.php:110 +msgid "Université de Strasbourg. Creation: Guilhem BORGHESI. 2008-2009" +msgstr "Université de Strasbourg. Création : Guilhem BORGHESI. 2008-2009" + +#: studs.php:95 +msgid "anonyme" +msgstr "anonyme" + +#: studs.php:153 +#: studs.php:283 +msgid "Poll's participation" +msgstr "Participation au sondage" + +#: studs.php:156 +#: studs.php:283 +msgid "" +"has filled a line.\n" +"You can find your poll at the link" +msgstr "" +" vient de remplir une ligne.\n" +"Vous pouvez retrouver votre sondage au lien suivant" + +#: studs.php:158 +#: studs.php:283 +#: adminstuds.php:107 +#: adminstuds.php:125 +#: adminstuds.php:144 +#: adminstuds.php:256 +#: adminstuds.php:395 +#: adminstuds.php:500 +msgid "Thanks for your confidence." +msgstr "Merci de votre confiance." + +#: studs.php:171 +#: index.php:64 +#: adminstuds.php:161 +#: adminstuds.php:270 +#: adminstuds.php:314 +msgid "Make your polls" +msgstr "Se Trouver à l'Université de Strasbourg" + +#: studs.php:179 +#: adminstuds.php:884 +msgid "Enter a name !" +msgstr "Vous n'avez pas saisi de nom !" + +#: studs.php:182 +#: adminstuds.php:889 +msgid "The name you've chosen already exist in this poll!" +msgstr "Le nom que vous avez choisi existe déjà !" + +#: studs.php:186 +#: adminstuds.php:1022 +msgid "Enter a name and a comment!" +msgstr "Merci de remplir les deux champs !" + +#: studs.php:190 +msgid "Failed to insert the comment!" +msgstr "Échec à l'insertion du commentaire !" + +#: studs.php:197 +#: adminstuds.php:72 +msgid "This poll doesn't exist !" +msgstr "Ce sondage n'existe pas !" + +#: studs.php:198 +msgid "Back to the homepage of" +msgstr "Retournez à la page d'accueil de" + +#: studs.php:217 +#: adminstuds.php:324 +msgid "Initiator of the poll" +msgstr "Auteur du sondage" + +#: studs.php:221 +#: adminstuds.php:328 +#: adminstuds.php:1012 +msgid "Comments" +msgstr "Commentaires des sondés" + +#: studs.php:238 +msgid "If you want to vote in this poll, you have to give your name, choose the values that fit best for you
(without paying attention to the choices of the other voters) and validate with the plus button at the end of the line." +msgstr "Pour participer à ce sondage, veuillez entrer votre nom, choisir toutes les valeurs qui vous conviennent
(sans tenir compte des disponibilités des autres sondés) et valider votre choix avec le bouton en bout de ligne." + +#: studs.php:456 +msgid "Participate" +msgstr "Participation au sondage" + +#: studs.php:474 +#: adminstuds.php:854 +msgid "Addition" +msgstr "Somme" + +#: studs.php:487 +msgid "Best choice" +msgstr "Meilleur choix" + +#: studs.php:515 +#: studs.php:517 +#: adminstuds.php:924 +#: adminstuds.php:926 +msgid "for" +msgstr "à" + +#: studs.php:534 +#: adminstuds.php:947 +msgid "vote" +msgstr "vote" + +#: studs.php:536 +#: adminstuds.php:949 +msgid "votes" +msgstr "votes" + +#: studs.php:542 +msgid "The best choice at this time is:" +msgstr "Le meilleur choix pour l'instant est :" + +#: studs.php:542 +#: studs.php:545 +#: adminstuds.php:953 +#: adminstuds.php:956 +msgid "with" +msgstr "avec" + +#: studs.php:545 +msgid "The bests choices at this time are:" +msgstr "Les meilleurs choix pour l'instant sont :" + +#: studs.php:554 +msgid "Comments of polled people" +msgstr "Commentaires de sondés" + +#: studs.php:563 +msgid "Add a comment in the poll:" +msgstr "Ajoutez un commentaire dans ce sondage :" + +#: studs.php:566 +#: adminstuds.php:1027 +msgid "Name" +msgstr "Nom" + +#: studs.php:578 +msgid "Export to CSV" +msgstr "Export to CSV" + +#: studs.php:580 +msgid "Export: Spreadsheet" +msgstr "Export : Tableur" + +#: studs.php:587 +msgid "Export iCal" +msgstr "Export iCal" + +#: studs.php:589 +msgid "Agenda" +msgstr "Agenda" + +#: index.php:69 +msgid "What is it about?" +msgstr "A quoi ça sert ?" + +#: index.php:70 +msgid "Making polls to schedule meetings or events, quickly and easily.
You can also run polls to determine what will be your next meeting place, the meeting topic or anything like the country you would like to visit during your next holidays." +msgstr "A faire des sondages pour que vous puissiez trouver une date de réunion qui convienne à toutes les personnes concernées.
Vous pouvez également utiliser cette application pour déterminer à plusieurs un choix quelconque comme un lieu de RV, un thème de réunion ou la marque de votre prochaine machine à café." + +#: creation_sondage.php:88 +msgid "For sending to the polled users" +msgstr "Pour diffusion aux sondés" + +#: creation_sondage.php:88 +#: creation_sondage.php:89 +msgid "Poll" +msgstr "Sondage" + +#: creation_sondage.php:88 +msgid "" +"This is the message you have to send to the people you want to poll. \n" +"Now, you have to send this message to everyone you want to poll." +msgstr "" +"Ceci est le message qui doit être envoyé aux sondés. \n" +"Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote." + +#: creation_sondage.php:88 +msgid "hast just created a poll called" +msgstr " vient de créer un sondage intitulé " + +#: creation_sondage.php:88 +msgid "Thanks for filling the poll at the link above" +msgstr "Merci de bien vouloir remplir le sondage à l'adresse suivante" + +#: creation_sondage.php:88 +#: creation_sondage.php:91 +msgid "Thanks for your confidence" +msgstr "Merci de votre confiance" + +#: creation_sondage.php:89 +msgid "Author's message" +msgstr "Réservé à l'auteur" + +#: creation_sondage.php:90 +msgid "" +"This message should NOT be sended to the polled people. It is private for the poll's creator.\n" +"\n" +"You can now modify it at the link above" +msgstr "" +"Ce message ne doit PAS être diffusé aux sondés. Il est réservé à l'auteur du sondage.\n" +"\n" +"Vous pouvez modifier ce sondage à l'adresse suivante " + +#: adminstuds.php:104 +msgid "[ADMINISTRATOR] New title for your poll" +msgstr "[ADMINISTRATEUR] Changement du titre du sondage avec " + +#: adminstuds.php:105 +msgid "" +"You have changed the title of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Vous avez fait la modification du titre de votre sondage. \n" +"Vous pouvez modifier ce sondage au lien suivant" + +#: adminstuds.php:122 +msgid "[ADMINISTRATOR] New comments for your poll" +msgstr "[ADMINISTRATEUR] Changement des commentaires du sondage avec " + +#: adminstuds.php:123 +msgid "" +"You have changed the comments of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Vous avez fait la modification des commentaires de votre sondage. \n" +"Vous pouvez modifier ce sondage au lien suivant" + +#: adminstuds.php:141 +msgid "[ADMINISTRATOR] New email address for your poll" +msgstr "[ADMINISTRATEUR] Changement d'adresse électronique de l'administrateur avec " + +#: adminstuds.php:142 +msgid "" +"You have changed your email address in your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Vous avez fait la modification de votre adresse mail. \n" +"Vous pouvez modifier ce sondage au lien suivant" + +#: adminstuds.php:168 +msgid "Column's adding" +msgstr "Ajout de colonne" + +#: adminstuds.php:171 +msgid "Add a new column" +msgstr "Si vous souhaitez ajouter une colonne" + +#: adminstuds.php:175 +msgid "You can add a new scheduling date to your poll.
If you just want to add a new hour to an existant date, put the same date and choose a new hour." +msgstr "Vous pouvez ajouter une date à votre sondage. Si la date existe déjà et que vous ne voulez que rajouter un horaire,
mettez le jour en entier avec l'horaire ou le créneau supplémentaire il sera intégré normalement au sondage existant." + +#: adminstuds.php:176 +msgid "Add a date" +msgstr "Pour ajouter une date" + +#: adminstuds.php:197 +msgid "Add a start hour (optional)" +msgstr "Pour ajouter un horaire de début (optionnel)" + +#: adminstuds.php:211 +msgid "Add a end hour (optional)" +msgstr "Pour ajouter un horaire de fin (optionnel)" + +#: adminstuds.php:253 +msgid "[ADMINISTRATOR] Removing of your poll" +msgstr "[ADMINISTRATEUR] Suppression de sondage avec " + +#: adminstuds.php:254 +msgid "" +"You have removed your poll. \n" +"You can make new polls with this link" +msgstr "" +"Vous avez fait la suppression d'un sondage. \n" +"Vous pouvez faire de nouveaux sondages au lien suivant" + +#: adminstuds.php:273 +msgid "Your poll has been removed!" +msgstr "Votre sondage a été supprimé !" + +#: adminstuds.php:395 +#: adminstuds.php:499 +msgid "[ADMINISTRATOR] New column for your poll" +msgstr "[ADMINISTRATEUR] Ajout d'une nouvelle colonne au sondage " + +#: adminstuds.php:395 +#: adminstuds.php:500 +msgid "" +"You have added a new column in your poll. \n" +"You can inform the voters of this change with this link" +msgstr "" +"Vous avez fait l'ajout d'une colonne dans votre sondage. \n" +"Vous pouvez informer vos utilisateurs de ce changement en leur envoyant l'adresse suivante" + +#: adminstuds.php:630 +msgid "As poll administrator, you can change all the lines of this poll with \"infos\".
You can, as well, remove a column or a line with \"Cancel\".
You can also add a new column with \"Add.
Finally, you can change the informations of this poll like the title, the comments or your email address." +msgstr "En tant qu'administrateur, vous pouvez modifier toutes les lignes de ce sondage avec \"Icone.
Vous avez aussi la possibilité d'effacer une colonne ou une ligne avec \"Annuler\".
Si vous avez oublié de mettre un choix vous pouvez rajouter une colonne en cliquant sur \"Annuler\"
en bout de ligne des noms de colonne. Vous pouvez enfin également modifier les informations
relatives à ce sondage comme le titre, les commentaires ou encore votre adresse électronique." + +#: adminstuds.php:669 +#: adminstuds.php:689 +#: adminstuds.php:708 +#: adminstuds.php:720 +#: adminstuds.php:738 +#: adminstuds.php:837 +msgid "Add" +msgstr "Ajouter" + +#: adminstuds.php:894 +msgid "Characters \" ' < et > are not permitted" +msgstr "Les caractères \" ' < et > ne sont pas autorisés !" + +#: adminstuds.php:899 +msgid "The date is not correct !" +msgstr "La date choisie n'est pas correcte !" + +#: adminstuds.php:953 +msgid "The best choice at this time is" +msgstr "Le meilleur choix pour l'instant est" + +#: adminstuds.php:956 +msgid "The bests choices at this time are" +msgstr "Les meilleurs choix pour l'instant sont" + +#: adminstuds.php:964 +msgid "Poll's management" +msgstr "Gestion de votre sondage" + +#: adminstuds.php:969 +msgid "Change the title" +msgstr "Si vous souhaitez changer le titre du sondage" + +#: adminstuds.php:976 +msgid "Generate the convocation letter (.PDF), choose the place to meet and validate" +msgstr "Si vous souhaitez produire la lettre de convocation (en PDF), choississez un lieu de réunion et validez" + +#: adminstuds.php:987 +msgid "Enter a meeting place!" +msgstr "Veuillez entrer un lieu de réunion !" + +#: adminstuds.php:992 +msgid "Enter a new title!" +msgstr "Veuillez entrer un nouveau titre !" + +#: adminstuds.php:996 +msgid "Change the comments" +msgstr "Si vous souhaitez changer les commentaires du sondage" + +#: adminstuds.php:1000 +msgid "Change your email address" +msgstr "Si vous souhaitez changer votre adresse de courrier électronique" + +#: adminstuds.php:1004 +msgid "Enter a new email address!" +msgstr "Veuillez entrer une nouvelle adresse !" + +#: adminstuds.php:1026 +msgid "Add a comment in the poll" +msgstr "Ajoutez un commentaire dans ce sondage" + +#: adminstuds.php:1033 +msgid "Remove your poll" +msgstr "Si vous souhaitez supprimer votre sondage" + +#: adminstuds.php:1033 +msgid "Remove the poll" +msgstr "Suppression du sondage" + +#: adminstuds.php:1033 +msgid "Cancel" +msgstr "Annuler" + +#: adminstuds.php:1036 +msgid "Confirm removal of your poll" +msgstr "Confirmer la suppression de votre sondage" + +#: adminstuds.php:1036 +msgid "Remove this poll!" +msgstr "Je supprime ce sondage !" + +#: adminstuds.php:1037 +msgid "Keep this poll!" +msgstr "Je garde ce sondage !" + +#: contacts.php:56 +msgid "[CONTACT] You have sent a question " +msgstr "[CONTACT] Envoi de question " + +#: contacts.php:56 +msgid "You have a question from a user " +msgstr "Vous avez une question d'utilisateur de " + +#: contacts.php:56 +msgid "User" +msgstr "Utilisateur" + +#: contacts.php:56 +msgid "User's email address" +msgstr "Adresse utilisateur" + +#: contacts.php:56 +msgid "Message" +msgstr "Message" + +#: contacts.php:59 +msgid "[COPY] Someone has sent a question " +msgstr "[COPIE] Envoi de question " + +#: contacts.php:59 +msgid "Here is a copy of your question" +msgstr "Voici une copie de votre question" + +#: contacts.php:59 +msgid "We're going to answer your question shortly." +msgstr "Nous allons prendre en compte votre message rapidement." + +#: contacts.php:76 +msgid "Your message has been sent!" +msgstr "Votre message a bien été envoyé !" + +#: contacts.php:108 +msgid "Contact us" +msgstr "Nous contacter" + +#: contacts.php:113 +msgid "If you have questions, you can send a message here." +msgstr "Pour toutes questions ou suggestions vous pouvez laisser un message via ce formulaire." + +#: contacts.php:115 +msgid "Your name" +msgstr "Votre nom" + +#: contacts.php:123 +msgid "Your email address " +msgstr "Votre adresse électronique " + +#: contacts.php:129 +msgid "Question" +msgstr "Question" + +#: contacts.php:138 +msgid "Send your question" +msgstr "Envoyer votre question" + +#: admin/index.php:64 +msgid "Polls administrator" +msgstr "Administrateur de la base" + +#: admin/index.php:76 +msgid "Confirm removal of the poll " +msgstr "Confirmer la suppression du sondage " + +#: admin/index.php:104 +msgid "polls in the database at this time" +msgstr "sondages dans la base actuellement" + +#: admin/index.php:109 +msgid "Poll ID" +msgstr "ID sondage" + +#: admin/index.php:109 +msgid "Format" +msgstr "Format" + +#: admin/index.php:109 +msgid "Title" +msgstr "Titre" + +#: admin/index.php:109 +msgid "Author" +msgstr "Auteur" + +#: admin/index.php:109 +msgid "Expiration's date" +msgstr "Date d'expiration" + +#: admin/index.php:109 +msgid "Users" +msgstr "Nombre d'utilisateurs" + +#: admin/index.php:109 +msgid "Actions" +msgstr "Actions" + +#: admin/index.php:132 +msgid "See the poll" +msgstr "Voir le sondage" + +#: admin/index.php:133 +msgid "Change the poll" +msgstr "Modifier le sondage" + +#~ msgid "Enter a name!" +#~ msgstr "Vous n'avez pas saisi de nom !" + +#~ msgid "monday" +#~ msgstr "lundi" + +#~ msgid "tuesday" +#~ msgstr "mardi" + +#~ msgid "wednesday" +#~ msgstr "mercredi" + +#~ msgid "thursday" +#~ msgstr "jeudi" + +#~ msgid "friday" +#~ msgstr "vendredi" + +#~ msgid "saturday" +#~ msgstr "samedi" + +#~ msgid "sunday" +#~ msgstr "dimanche" + +#~ msgid "january" +#~ msgstr "janvier" + +#~ msgid "february" +#~ msgstr "février" + +#~ msgid "march" +#~ msgstr "mars" + +#~ msgid "april" +#~ msgstr "avril" + +#~ msgid "may" +#~ msgstr "mai" + +#~ msgid "june" +#~ msgstr "juin" + +#~ msgid "july" +#~ msgstr "juillet" + +#~ msgid "august" +#~ msgstr "août" + +#~ msgid "september" +#~ msgstr "septembre" + +#~ msgid "october" +#~ msgstr "octobre" + +#~ msgid "november" +#~ msgstr "novembre" + +#~ msgid "december" +#~ msgstr "décembre" + +#~ msgid "Sources" +#~ msgstr "Sources" + +#~ msgid "Back" +#~ msgstr "Retour" + +#~ msgid "" +#~ "Here are the sources of " +#~ msgstr "" +#~ "Voila les sources de " diff --git a/maintenance.php b/maintenance.php new file mode 100644 index 0000000..738e013 --- /dev/null +++ b/maintenance.php @@ -0,0 +1,65 @@ +'."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +echo 'Maintenance '.NOMAPPLICATION.' '."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +logo(); +bandeau_tete(); + +echo '
'."\n"; +print "

L'application ".NOMAPPLICATION." est pour l'instant en maintenance.

"."\n"; +print "Merci de votre compréhension."."\n"; +echo '


'."\n"; +echo '
'."\n"; + +// Affichage du bandeau de pied +sur_bandeau_pied(); +bandeau_pied(); +echo ''."\n"; +echo ''."\n"; + +?> diff --git a/php2pdf/font/courier.php b/php2pdf/font/courier.php new file mode 100644 index 0000000..4c009f3 --- /dev/null +++ b/php2pdf/font/courier.php @@ -0,0 +1,7 @@ + diff --git a/php2pdf/font/helvetica.php b/php2pdf/font/helvetica.php new file mode 100644 index 0000000..8fa7683 --- /dev/null +++ b/php2pdf/font/helvetica.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/php2pdf/font/helveticab.php b/php2pdf/font/helveticab.php new file mode 100644 index 0000000..a8473c9 --- /dev/null +++ b/php2pdf/font/helveticab.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/php2pdf/font/helveticabi.php b/php2pdf/font/helveticabi.php new file mode 100644 index 0000000..4137953 --- /dev/null +++ b/php2pdf/font/helveticabi.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/php2pdf/font/helveticai.php b/php2pdf/font/helveticai.php new file mode 100644 index 0000000..d5bb6e0 --- /dev/null +++ b/php2pdf/font/helveticai.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/php2pdf/font/makefont/cp1250.map b/php2pdf/font/makefont/cp1250.map new file mode 100644 index 0000000..ec110af --- /dev/null +++ b/php2pdf/font/makefont/cp1250.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+015A Sacute +!8D U+0164 Tcaron +!8E U+017D Zcaron +!8F U+0179 Zacute +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+015B sacute +!9D U+0165 tcaron +!9E U+017E zcaron +!9F U+017A zacute +!A0 U+00A0 space +!A1 U+02C7 caron +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+0104 Aogonek +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+015E Scedilla +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+0105 aogonek +!BA U+015F scedilla +!BB U+00BB guillemotright +!BC U+013D Lcaron +!BD U+02DD hungarumlaut +!BE U+013E lcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/php2pdf/font/makefont/cp1251.map b/php2pdf/font/makefont/cp1251.map new file mode 100644 index 0000000..de6a198 --- /dev/null +++ b/php2pdf/font/makefont/cp1251.map @@ -0,0 +1,255 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0402 afii10051 +!81 U+0403 afii10052 +!82 U+201A quotesinglbase +!83 U+0453 afii10100 +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+20AC Euro +!89 U+2030 perthousand +!8A U+0409 afii10058 +!8B U+2039 guilsinglleft +!8C U+040A afii10059 +!8D U+040C afii10061 +!8E U+040B afii10060 +!8F U+040F afii10145 +!90 U+0452 afii10099 +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0459 afii10106 +!9B U+203A guilsinglright +!9C U+045A afii10107 +!9D U+045C afii10109 +!9E U+045B afii10108 +!9F U+045F afii10193 +!A0 U+00A0 space +!A1 U+040E afii10062 +!A2 U+045E afii10110 +!A3 U+0408 afii10057 +!A4 U+00A4 currency +!A5 U+0490 afii10050 +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+0401 afii10023 +!A9 U+00A9 copyright +!AA U+0404 afii10053 +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+0407 afii10056 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+0406 afii10055 +!B3 U+0456 afii10103 +!B4 U+0491 afii10098 +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0451 afii10071 +!B9 U+2116 afii61352 +!BA U+0454 afii10101 +!BB U+00BB guillemotright +!BC U+0458 afii10105 +!BD U+0405 afii10054 +!BE U+0455 afii10102 +!BF U+0457 afii10104 +!C0 U+0410 afii10017 +!C1 U+0411 afii10018 +!C2 U+0412 afii10019 +!C3 U+0413 afii10020 +!C4 U+0414 afii10021 +!C5 U+0415 afii10022 +!C6 U+0416 afii10024 +!C7 U+0417 afii10025 +!C8 U+0418 afii10026 +!C9 U+0419 afii10027 +!CA U+041A afii10028 +!CB U+041B afii10029 +!CC U+041C afii10030 +!CD U+041D afii10031 +!CE U+041E afii10032 +!CF U+041F afii10033 +!D0 U+0420 afii10034 +!D1 U+0421 afii10035 +!D2 U+0422 afii10036 +!D3 U+0423 afii10037 +!D4 U+0424 afii10038 +!D5 U+0425 afii10039 +!D6 U+0426 afii10040 +!D7 U+0427 afii10041 +!D8 U+0428 afii10042 +!D9 U+0429 afii10043 +!DA U+042A afii10044 +!DB U+042B afii10045 +!DC U+042C afii10046 +!DD U+042D afii10047 +!DE U+042E afii10048 +!DF U+042F afii10049 +!E0 U+0430 afii10065 +!E1 U+0431 afii10066 +!E2 U+0432 afii10067 +!E3 U+0433 afii10068 +!E4 U+0434 afii10069 +!E5 U+0435 afii10070 +!E6 U+0436 afii10072 +!E7 U+0437 afii10073 +!E8 U+0438 afii10074 +!E9 U+0439 afii10075 +!EA U+043A afii10076 +!EB U+043B afii10077 +!EC U+043C afii10078 +!ED U+043D afii10079 +!EE U+043E afii10080 +!EF U+043F afii10081 +!F0 U+0440 afii10082 +!F1 U+0441 afii10083 +!F2 U+0442 afii10084 +!F3 U+0443 afii10085 +!F4 U+0444 afii10086 +!F5 U+0445 afii10087 +!F6 U+0446 afii10088 +!F7 U+0447 afii10089 +!F8 U+0448 afii10090 +!F9 U+0449 afii10091 +!FA U+044A afii10092 +!FB U+044B afii10093 +!FC U+044C afii10094 +!FD U+044D afii10095 +!FE U+044E afii10096 +!FF U+044F afii10097 diff --git a/php2pdf/font/makefont/cp1252.map b/php2pdf/font/makefont/cp1252.map new file mode 100644 index 0000000..dd490e5 --- /dev/null +++ b/php2pdf/font/makefont/cp1252.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!8E U+017D Zcaron +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9E U+017E zcaron +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/php2pdf/font/makefont/cp1253.map b/php2pdf/font/makefont/cp1253.map new file mode 100644 index 0000000..4bd826f --- /dev/null +++ b/php2pdf/font/makefont/cp1253.map @@ -0,0 +1,239 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+0385 dieresistonos +!A2 U+0386 Alphatonos +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/php2pdf/font/makefont/cp1254.map b/php2pdf/font/makefont/cp1254.map new file mode 100644 index 0000000..829473b --- /dev/null +++ b/php2pdf/font/makefont/cp1254.map @@ -0,0 +1,249 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/php2pdf/font/makefont/cp1255.map b/php2pdf/font/makefont/cp1255.map new file mode 100644 index 0000000..079e10c --- /dev/null +++ b/php2pdf/font/makefont/cp1255.map @@ -0,0 +1,233 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AA afii57636 +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00D7 multiply +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD sfthyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 middot +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00F7 divide +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+05B0 afii57799 +!C1 U+05B1 afii57801 +!C2 U+05B2 afii57800 +!C3 U+05B3 afii57802 +!C4 U+05B4 afii57793 +!C5 U+05B5 afii57794 +!C6 U+05B6 afii57795 +!C7 U+05B7 afii57798 +!C8 U+05B8 afii57797 +!C9 U+05B9 afii57806 +!CB U+05BB afii57796 +!CC U+05BC afii57807 +!CD U+05BD afii57839 +!CE U+05BE afii57645 +!CF U+05BF afii57841 +!D0 U+05C0 afii57842 +!D1 U+05C1 afii57804 +!D2 U+05C2 afii57803 +!D3 U+05C3 afii57658 +!D4 U+05F0 afii57716 +!D5 U+05F1 afii57717 +!D6 U+05F2 afii57718 +!D7 U+05F3 gereshhebrew +!D8 U+05F4 gershayimhebrew +!E0 U+05D0 afii57664 +!E1 U+05D1 afii57665 +!E2 U+05D2 afii57666 +!E3 U+05D3 afii57667 +!E4 U+05D4 afii57668 +!E5 U+05D5 afii57669 +!E6 U+05D6 afii57670 +!E7 U+05D7 afii57671 +!E8 U+05D8 afii57672 +!E9 U+05D9 afii57673 +!EA U+05DA afii57674 +!EB U+05DB afii57675 +!EC U+05DC afii57676 +!ED U+05DD afii57677 +!EE U+05DE afii57678 +!EF U+05DF afii57679 +!F0 U+05E0 afii57680 +!F1 U+05E1 afii57681 +!F2 U+05E2 afii57682 +!F3 U+05E3 afii57683 +!F4 U+05E4 afii57684 +!F5 U+05E5 afii57685 +!F6 U+05E6 afii57686 +!F7 U+05E7 afii57687 +!F8 U+05E8 afii57688 +!F9 U+05E9 afii57689 +!FA U+05EA afii57690 +!FD U+200E afii299 +!FE U+200F afii300 diff --git a/php2pdf/font/makefont/cp1257.map b/php2pdf/font/makefont/cp1257.map new file mode 100644 index 0000000..2f2ecfa --- /dev/null +++ b/php2pdf/font/makefont/cp1257.map @@ -0,0 +1,244 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8D U+00A8 dieresis +!8E U+02C7 caron +!8F U+00B8 cedilla +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!9D U+00AF macron +!9E U+02DB ogonek +!A0 U+00A0 space +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00D8 Oslash +!A9 U+00A9 copyright +!AA U+0156 Rcommaaccent +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00C6 AE +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00F8 oslash +!B9 U+00B9 onesuperior +!BA U+0157 rcommaaccent +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00E6 ae +!C0 U+0104 Aogonek +!C1 U+012E Iogonek +!C2 U+0100 Amacron +!C3 U+0106 Cacute +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+0118 Eogonek +!C7 U+0112 Emacron +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0179 Zacute +!CB U+0116 Edotaccent +!CC U+0122 Gcommaaccent +!CD U+0136 Kcommaaccent +!CE U+012A Imacron +!CF U+013B Lcommaaccent +!D0 U+0160 Scaron +!D1 U+0143 Nacute +!D2 U+0145 Ncommaaccent +!D3 U+00D3 Oacute +!D4 U+014C Omacron +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0172 Uogonek +!D9 U+0141 Lslash +!DA U+015A Sacute +!DB U+016A Umacron +!DC U+00DC Udieresis +!DD U+017B Zdotaccent +!DE U+017D Zcaron +!DF U+00DF germandbls +!E0 U+0105 aogonek +!E1 U+012F iogonek +!E2 U+0101 amacron +!E3 U+0107 cacute +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+0119 eogonek +!E7 U+0113 emacron +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+017A zacute +!EB U+0117 edotaccent +!EC U+0123 gcommaaccent +!ED U+0137 kcommaaccent +!EE U+012B imacron +!EF U+013C lcommaaccent +!F0 U+0161 scaron +!F1 U+0144 nacute +!F2 U+0146 ncommaaccent +!F3 U+00F3 oacute +!F4 U+014D omacron +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0173 uogonek +!F9 U+0142 lslash +!FA U+015B sacute +!FB U+016B umacron +!FC U+00FC udieresis +!FD U+017C zdotaccent +!FE U+017E zcaron +!FF U+02D9 dotaccent diff --git a/php2pdf/font/makefont/cp1258.map b/php2pdf/font/makefont/cp1258.map new file mode 100644 index 0000000..fed915f --- /dev/null +++ b/php2pdf/font/makefont/cp1258.map @@ -0,0 +1,247 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+0300 gravecomb +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+00D1 Ntilde +!D2 U+0309 hookabovecomb +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+01A0 Ohorn +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+01AF Uhorn +!DE U+0303 tildecomb +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+0301 acutecomb +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+00F1 ntilde +!F2 U+0323 dotbelowcomb +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+01A1 ohorn +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+01B0 uhorn +!FE U+20AB dong +!FF U+00FF ydieresis diff --git a/php2pdf/font/makefont/cp874.map b/php2pdf/font/makefont/cp874.map new file mode 100644 index 0000000..1006e6b --- /dev/null +++ b/php2pdf/font/makefont/cp874.map @@ -0,0 +1,225 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!85 U+2026 ellipsis +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/php2pdf/font/makefont/iso-8859-1.map b/php2pdf/font/makefont/iso-8859-1.map new file mode 100644 index 0000000..61740a3 --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-1.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/php2pdf/font/makefont/iso-8859-11.map b/php2pdf/font/makefont/iso-8859-11.map new file mode 100644 index 0000000..9168812 --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-11.map @@ -0,0 +1,248 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/php2pdf/font/makefont/iso-8859-15.map b/php2pdf/font/makefont/iso-8859-15.map new file mode 100644 index 0000000..6c2b571 --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-15.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AC Euro +!A5 U+00A5 yen +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+017D Zcaron +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/php2pdf/font/makefont/iso-8859-16.map b/php2pdf/font/makefont/iso-8859-16.map new file mode 100644 index 0000000..202c8fe --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-16.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0105 aogonek +!A3 U+0141 Lslash +!A4 U+20AC Euro +!A5 U+201E quotedblbase +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+0218 Scommaaccent +!AB U+00AB guillemotleft +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017A zacute +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+010C Ccaron +!B3 U+0142 lslash +!B4 U+017D Zcaron +!B5 U+201D quotedblright +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+010D ccaron +!BA U+0219 scommaaccent +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+017C zdotaccent +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0106 Cacute +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+015A Sacute +!D8 U+0170 Uhungarumlaut +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0118 Eogonek +!DE U+021A Tcommaaccent +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+0107 cacute +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+015B sacute +!F8 U+0171 uhungarumlaut +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0119 eogonek +!FE U+021B tcommaaccent +!FF U+00FF ydieresis diff --git a/php2pdf/font/makefont/iso-8859-2.map b/php2pdf/font/makefont/iso-8859-2.map new file mode 100644 index 0000000..65ae09f --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-2.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+013D Lcaron +!A6 U+015A Sacute +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+015E Scedilla +!AB U+0164 Tcaron +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+013E lcaron +!B6 U+015B sacute +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+015F scedilla +!BB U+0165 tcaron +!BC U+017A zacute +!BD U+02DD hungarumlaut +!BE U+017E zcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/php2pdf/font/makefont/iso-8859-4.map b/php2pdf/font/makefont/iso-8859-4.map new file mode 100644 index 0000000..a7d87bf --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-4.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0138 kgreenlandic +!A3 U+0156 Rcommaaccent +!A4 U+00A4 currency +!A5 U+0128 Itilde +!A6 U+013B Lcommaaccent +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+0112 Emacron +!AB U+0122 Gcommaaccent +!AC U+0166 Tbar +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0157 rcommaaccent +!B4 U+00B4 acute +!B5 U+0129 itilde +!B6 U+013C lcommaaccent +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+0113 emacron +!BB U+0123 gcommaaccent +!BC U+0167 tbar +!BD U+014A Eng +!BE U+017E zcaron +!BF U+014B eng +!C0 U+0100 Amacron +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+012E Iogonek +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+0116 Edotaccent +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+012A Imacron +!D0 U+0110 Dcroat +!D1 U+0145 Ncommaaccent +!D2 U+014C Omacron +!D3 U+0136 Kcommaaccent +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+0172 Uogonek +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0168 Utilde +!DE U+016A Umacron +!DF U+00DF germandbls +!E0 U+0101 amacron +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+012F iogonek +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+0117 edotaccent +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+012B imacron +!F0 U+0111 dcroat +!F1 U+0146 ncommaaccent +!F2 U+014D omacron +!F3 U+0137 kcommaaccent +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+0173 uogonek +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0169 utilde +!FE U+016B umacron +!FF U+02D9 dotaccent diff --git a/php2pdf/font/makefont/iso-8859-5.map b/php2pdf/font/makefont/iso-8859-5.map new file mode 100644 index 0000000..f9cd4ed --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-5.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0401 afii10023 +!A2 U+0402 afii10051 +!A3 U+0403 afii10052 +!A4 U+0404 afii10053 +!A5 U+0405 afii10054 +!A6 U+0406 afii10055 +!A7 U+0407 afii10056 +!A8 U+0408 afii10057 +!A9 U+0409 afii10058 +!AA U+040A afii10059 +!AB U+040B afii10060 +!AC U+040C afii10061 +!AD U+00AD hyphen +!AE U+040E afii10062 +!AF U+040F afii10145 +!B0 U+0410 afii10017 +!B1 U+0411 afii10018 +!B2 U+0412 afii10019 +!B3 U+0413 afii10020 +!B4 U+0414 afii10021 +!B5 U+0415 afii10022 +!B6 U+0416 afii10024 +!B7 U+0417 afii10025 +!B8 U+0418 afii10026 +!B9 U+0419 afii10027 +!BA U+041A afii10028 +!BB U+041B afii10029 +!BC U+041C afii10030 +!BD U+041D afii10031 +!BE U+041E afii10032 +!BF U+041F afii10033 +!C0 U+0420 afii10034 +!C1 U+0421 afii10035 +!C2 U+0422 afii10036 +!C3 U+0423 afii10037 +!C4 U+0424 afii10038 +!C5 U+0425 afii10039 +!C6 U+0426 afii10040 +!C7 U+0427 afii10041 +!C8 U+0428 afii10042 +!C9 U+0429 afii10043 +!CA U+042A afii10044 +!CB U+042B afii10045 +!CC U+042C afii10046 +!CD U+042D afii10047 +!CE U+042E afii10048 +!CF U+042F afii10049 +!D0 U+0430 afii10065 +!D1 U+0431 afii10066 +!D2 U+0432 afii10067 +!D3 U+0433 afii10068 +!D4 U+0434 afii10069 +!D5 U+0435 afii10070 +!D6 U+0436 afii10072 +!D7 U+0437 afii10073 +!D8 U+0438 afii10074 +!D9 U+0439 afii10075 +!DA U+043A afii10076 +!DB U+043B afii10077 +!DC U+043C afii10078 +!DD U+043D afii10079 +!DE U+043E afii10080 +!DF U+043F afii10081 +!E0 U+0440 afii10082 +!E1 U+0441 afii10083 +!E2 U+0442 afii10084 +!E3 U+0443 afii10085 +!E4 U+0444 afii10086 +!E5 U+0445 afii10087 +!E6 U+0446 afii10088 +!E7 U+0447 afii10089 +!E8 U+0448 afii10090 +!E9 U+0449 afii10091 +!EA U+044A afii10092 +!EB U+044B afii10093 +!EC U+044C afii10094 +!ED U+044D afii10095 +!EE U+044E afii10096 +!EF U+044F afii10097 +!F0 U+2116 afii61352 +!F1 U+0451 afii10071 +!F2 U+0452 afii10099 +!F3 U+0453 afii10100 +!F4 U+0454 afii10101 +!F5 U+0455 afii10102 +!F6 U+0456 afii10103 +!F7 U+0457 afii10104 +!F8 U+0458 afii10105 +!F9 U+0459 afii10106 +!FA U+045A afii10107 +!FB U+045B afii10108 +!FC U+045C afii10109 +!FD U+00A7 section +!FE U+045E afii10110 +!FF U+045F afii10193 diff --git a/php2pdf/font/makefont/iso-8859-7.map b/php2pdf/font/makefont/iso-8859-7.map new file mode 100644 index 0000000..e163796 --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-7.map @@ -0,0 +1,250 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+2018 quoteleft +!A2 U+2019 quoteright +!A3 U+00A3 sterling +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+0385 dieresistonos +!B6 U+0386 Alphatonos +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/php2pdf/font/makefont/iso-8859-9.map b/php2pdf/font/makefont/iso-8859-9.map new file mode 100644 index 0000000..48c123a --- /dev/null +++ b/php2pdf/font/makefont/iso-8859-9.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/php2pdf/font/makefont/koi8-r.map b/php2pdf/font/makefont/koi8-r.map new file mode 100644 index 0000000..6ad5d05 --- /dev/null +++ b/php2pdf/font/makefont/koi8-r.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2219 periodcentered +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+2553 SF520000 +!A5 U+2554 SF390000 +!A6 U+2555 SF220000 +!A7 U+2556 SF210000 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+255C SF270000 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+2562 SF200000 +!B5 U+2563 SF230000 +!B6 U+2564 SF470000 +!B7 U+2565 SF480000 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+256B SF530000 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/php2pdf/font/makefont/koi8-u.map b/php2pdf/font/makefont/koi8-u.map new file mode 100644 index 0000000..40a7e4f --- /dev/null +++ b/php2pdf/font/makefont/koi8-u.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2022 bullet +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+0454 afii10101 +!A5 U+2554 SF390000 +!A6 U+0456 afii10103 +!A7 U+0457 afii10104 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+0491 afii10098 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+0404 afii10053 +!B5 U+2563 SF230000 +!B6 U+0406 afii10055 +!B7 U+0407 afii10056 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+0490 afii10050 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/php2pdf/font/makefont/makefont.php b/php2pdf/font/makefont/makefont.php new file mode 100644 index 0000000..7ac3efe --- /dev/null +++ b/php2pdf/font/makefont/makefont.php @@ -0,0 +1,416 @@ +Error: encoding not found: '.$enc); + $cc2gn=array(); + foreach($a as $l) + { + if($l{0}=='!') + { + $e=preg_split('/[ \\t]+/',rtrim($l)); + $cc=hexdec(substr($e[0],1)); + $gn=$e[2]; + $cc2gn[$cc]=$gn; + } + } + for($i=0;$i<=255;$i++) + { + if(!isset($cc2gn[$i])) + $cc2gn[$i]='.notdef'; + } + return $cc2gn; +} + +function ReadAFM($file,&$map) +{ + //Read a font metric file + $a=file($file); + if(empty($a)) + die('File not found'); + $widths=array(); + $fm=array(); + $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent', + 'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut', + 'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent', + 'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent', + 'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent', + 'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat', + 'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb', + 'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong'); + foreach($a as $l) + { + $e=explode(' ',rtrim($l)); + if(count($e)<2) + continue; + $code=$e[0]; + $param=$e[1]; + if($code=='C') + { + //Character metrics + $cc=(int)$e[1]; + $w=$e[4]; + $gn=$e[7]; + if(substr($gn,-4)=='20AC') + $gn='Euro'; + if(isset($fix[$gn])) + { + //Fix incorrect glyph name + foreach($map as $c=>$n) + { + if($n==$fix[$gn]) + $map[$c]=$gn; + } + } + if(empty($map)) + { + //Symbolic font: use built-in encoding + $widths[$cc]=$w; + } + else + { + $widths[$gn]=$w; + if($gn=='X') + $fm['CapXHeight']=$e[13]; + } + if($gn=='.notdef') + $fm['MissingWidth']=$w; + } + elseif($code=='FontName') + $fm['FontName']=$param; + elseif($code=='Weight') + $fm['Weight']=$param; + elseif($code=='ItalicAngle') + $fm['ItalicAngle']=(double)$param; + elseif($code=='Ascender') + $fm['Ascender']=(int)$param; + elseif($code=='Descender') + $fm['Descender']=(int)$param; + elseif($code=='UnderlineThickness') + $fm['UnderlineThickness']=(int)$param; + elseif($code=='UnderlinePosition') + $fm['UnderlinePosition']=(int)$param; + elseif($code=='IsFixedPitch') + $fm['IsFixedPitch']=($param=='true'); + elseif($code=='FontBBox') + $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]); + elseif($code=='CapHeight') + $fm['CapHeight']=(int)$param; + elseif($code=='StdVW') + $fm['StdVW']=(int)$param; + } + if(!isset($fm['FontName'])) + die('FontName not found'); + if(!empty($map)) + { + if(!isset($widths['.notdef'])) + $widths['.notdef']=600; + if(!isset($widths['Delta']) and isset($widths['increment'])) + $widths['Delta']=$widths['increment']; + //Order widths according to map + for($i=0;$i<=255;$i++) + { + if(!isset($widths[$map[$i]])) + { + echo 'Warning: character '.$map[$i].' is missing
'; + $widths[$i]=$widths['.notdef']; + } + else + $widths[$i]=$widths[$map[$i]]; + } + } + $fm['Widths']=$widths; + return $fm; +} + +function MakeFontDescriptor($fm,$symbolic) +{ + //Ascent + $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000); + $fd="array('Ascent'=>".$asc; + //Descent + $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200); + $fd.=",'Descent'=>".$desc; + //CapHeight + if(isset($fm['CapHeight'])) + $ch=$fm['CapHeight']; + elseif(isset($fm['CapXHeight'])) + $ch=$fm['CapXHeight']; + else + $ch=$asc; + $fd.=",'CapHeight'=>".$ch; + //Flags + $flags=0; + if(isset($fm['IsFixedPitch']) and $fm['IsFixedPitch']) + $flags+=1<<0; + if($symbolic) + $flags+=1<<2; + if(!$symbolic) + $flags+=1<<5; + if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0) + $flags+=1<<6; + $fd.=",'Flags'=>".$flags; + //FontBBox + if(isset($fm['FontBBox'])) + $fbb=$fm['FontBBox']; + else + $fbb=array(0,$des-100,1000,$asc+100); + $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'"; + //ItalicAngle + $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0); + $fd.=",'ItalicAngle'=>".$ia; + //StemV + if(isset($fm['StdVW'])) + $stemv=$fm['StdVW']; + elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight'])) + $stemv=120; + else + $stemv=70; + $fd.=",'StemV'=>".$stemv; + //MissingWidth + if(isset($fm['MissingWidth'])) + $fd.=",'MissingWidth'=>".$fm['MissingWidth']; + $fd.=')'; + return $fd; +} + +function MakeWidthArray($fm) +{ + //Make character width array + $s="array(\n\t"; + $cw=$fm['Widths']; + for($i=0;$i<=255;$i++) + { + if(chr($i)=="'") + $s.="'\\''"; + elseif(chr($i)=="\\") + $s.="'\\\\'"; + elseif($i>=32 and $i<=126) + $s.="'".chr($i)."'"; + else + $s.="chr($i)"; + $s.='=>'.$fm['Widths'][$i]; + if($i<255) + $s.=','; + if(($i+1)%22==0) + $s.="\n\t"; + } + $s.=')'; + return $s; +} + +function MakeFontEncoding($map) +{ + //Build differences from reference encoding + $ref=ReadMap('cp1252'); + $s=''; + $last=0; + for($i=32;$i<=255;$i++) + { + if($map[$i]!=$ref[$i]) + { + if($i!=$last+1) + $s.=$i.' '; + $last=$i; + $s.='/'.$map[$i].' '; + } + } + return rtrim($s); +} + +function SaveToFile($file,$s,$mode='t') +{ + $f=fopen($file,'w'.$mode); + if(!$f) + die('Can\'t write to file '.$file); + fwrite($f,$s,strlen($s)); + fclose($f); +} + +function ReadShort($f) +{ + $a=unpack('n1n',fread($f,2)); + return $a['n']; +} + +function ReadLong($f) +{ + $a=unpack('N1N',fread($f,4)); + return $a['N']; +} + +function CheckTTF($file) +{ + //Check if font license allows embedding + $f=fopen($file,'rb'); + if(!$f) + die('Error: Can\'t open '.$file); + //Extract number of tables + fseek($f,4,SEEK_CUR); + $nb=ReadShort($f); + fseek($f,6,SEEK_CUR); + //Seek OS/2 table + $found=false; + for($i=0;$i<$nb;$i++) + { + if(fread($f,4)=='OS/2') + { + $found=true; + break; + } + fseek($f,12,SEEK_CUR); + } + if(!$found) + { + fclose($f); + return; + } + fseek($f,4,SEEK_CUR); + $offset=ReadLong($f); + fseek($f,$offset,SEEK_SET); + //Extract fsType flags + fseek($f,8,SEEK_CUR); + $fsType=ReadShort($f); + $rl=($fsType & 0x02)!=0; + $pp=($fsType & 0x04)!=0; + $e=($fsType & 0x08)!=0; + fclose($f); + if($rl and !$pp and !$e) + echo 'Warning: font license does not allow embedding'; +} + +/******************************************************************************* +* $fontfile : chemin du fichier TTF (ou chaîne vide si pas d'incorporation) * +* $afmfile : chemin du fichier AFM * +* $enc : encodage (ou chaîne vide si la police est symbolique) * +* $patch : patch optionnel pour l'encodage * +* $type : type de la police si $fontfile est vide * +*******************************************************************************/ +function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType') +{ + //Generate a font definition file + set_magic_quotes_runtime(0); + ini_set('auto_detect_line_endings','1'); + if($enc) + { + $map=ReadMap($enc); + foreach($patch as $cc=>$gn) + $map[$cc]=$gn; + } + else + $map=array(); + if(!file_exists($afmfile)) + die('Error: AFM file not found: '.$afmfile); + $fm=ReadAFM($afmfile,$map); + if($enc) + $diff=MakeFontEncoding($map); + else + $diff=''; + $fd=MakeFontDescriptor($fm,empty($map)); + //Find font type + if($fontfile) + { + $ext=strtolower(substr($fontfile,-3)); + if($ext=='ttf') + $type='TrueType'; + elseif($ext=='pfb') + $type='Type1'; + else + die('Error: unrecognized font file extension: '.$ext); + } + else + { + if($type!='TrueType' and $type!='Type1') + die('Error: incorrect font type: '.$type); + } + //Start generation + $s='Error: font file not found: '.$fontfile); + if($type=='TrueType') + CheckTTF($fontfile); + $f=fopen($fontfile,'rb'); + if(!$f) + die('Error: Can\'t open '.$fontfile); + $file=fread($f,filesize($fontfile)); + fclose($f); + if($type=='Type1') + { + //Find first two sections and discard third one + $header=(ord($file{0})==128); + if($header) + { + //Strip first binary header + $file=substr($file,6); + } + $pos=strpos($file,'eexec'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size1=$pos+6; + if($header and ord($file{$size1})==128) + { + //Strip second binary header + $file=substr($file,0,$size1).substr($file,$size1+6); + } + $pos=strpos($file,'00000000'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size2=$pos-$size1; + $file=substr($file,0,$size1+$size2); + } + if(function_exists('gzcompress')) + { + $cmp=$basename.'.z'; + SaveToFile($cmp,gzcompress($file),'b'); + $s.='$file=\''.$cmp."';\n"; + echo 'Font file compressed ('.$cmp.')
'; + } + else + { + $s.='$file=\''.basename($fontfile)."';\n"; + echo 'Notice: font file could not be compressed (zlib extension not available)
'; + } + if($type=='Type1') + { + $s.='$size1='.$size1.";\n"; + $s.='$size2='.$size2.";\n"; + } + else + $s.='$originalsize='.filesize($fontfile).";\n"; + } + else + { + //Not embedded font + $s.='$file='."'';\n"; + } + $s.="?>\n"; + SaveToFile($basename.'.php',$s); + echo 'Font definition file generated ('.$basename.'.php'.')
'; +} +?> diff --git a/php2pdf/font/symbol.php b/php2pdf/font/symbol.php new file mode 100644 index 0000000..b556ed8 --- /dev/null +++ b/php2pdf/font/symbol.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549, + ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722, + 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768, + 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576, + 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0, + chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603, + chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768, + chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042, + chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329, + chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0); +?> diff --git a/php2pdf/font/times.php b/php2pdf/font/times.php new file mode 100644 index 0000000..b9be1b2 --- /dev/null +++ b/php2pdf/font/times.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722, + 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944, + 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500); +?> diff --git a/php2pdf/font/timesb.php b/php2pdf/font/timesb.php new file mode 100644 index 0000000..c3eb9fa --- /dev/null +++ b/php2pdf/font/timesb.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000, + 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833, + 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/php2pdf/font/timesbi.php b/php2pdf/font/timesbi.php new file mode 100644 index 0000000..161f630 --- /dev/null +++ b/php2pdf/font/timesbi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667, + 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889, + 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/php2pdf/font/timesi.php b/php2pdf/font/timesi.php new file mode 100644 index 0000000..de171fd --- /dev/null +++ b/php2pdf/font/timesi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611, + 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833, + 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/php2pdf/font/zapfdingbats.php b/php2pdf/font/zapfdingbats.php new file mode 100644 index 0000000..f2bdfd5 --- /dev/null +++ b/php2pdf/font/zapfdingbats.php @@ -0,0 +1,15 @@ +0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0, + chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939, + ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692, + 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776, + 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873, + 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317, + chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788, + chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788, + chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918, + chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874, + chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0); +?> diff --git a/php2pdf/fpdf.php b/php2pdf/fpdf.php new file mode 100644 index 0000000..c463aa6 --- /dev/null +++ b/php2pdf/fpdf.php @@ -0,0 +1,1647 @@ +_dochecks(); + //Initialization of properties + $this->page=0; + $this->n=2; + $this->buffer=''; + $this->pages=array(); + $this->OrientationChanges=array(); + $this->state=0; + $this->fonts=array(); + $this->FontFiles=array(); + $this->diffs=array(); + $this->images=array(); + $this->links=array(); + $this->InFooter=false; + $this->lasth=0; + $this->FontFamily=''; + $this->FontStyle=''; + $this->FontSizePt=12; + $this->underline=false; + $this->DrawColor='0 G'; + $this->FillColor='0 g'; + $this->TextColor='0 g'; + $this->ColorFlag=false; + $this->ws=0; + //Standard fonts + $this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique', + 'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique', + 'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic', + 'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats'); + //Scale factor + if($unit=='pt') + $this->k=1; + elseif($unit=='mm') + $this->k=72/25.4; + elseif($unit=='cm') + $this->k=72/2.54; + elseif($unit=='in') + $this->k=72; + else + $this->Error('Incorrect unit: '.$unit); + //Page format + if(is_string($format)) + { + $format=strtolower($format); + if($format=='a3') + $format=array(841.89,1190.55); + elseif($format=='a4') + $format=array(595.28,841.89); + elseif($format=='a5') + $format=array(420.94,595.28); + elseif($format=='letter') + $format=array(612,792); + elseif($format=='legal') + $format=array(612,1008); + else + $this->Error('Unknown page format: '.$format); + $this->fwPt=$format[0]; + $this->fhPt=$format[1]; + } + else + { + $this->fwPt=$format[0]*$this->k; + $this->fhPt=$format[1]*$this->k; + } + $this->fw=$this->fwPt/$this->k; + $this->fh=$this->fhPt/$this->k; + //Page orientation + $orientation=strtolower($orientation); + if($orientation=='p' || $orientation=='portrait') + { + $this->DefOrientation='P'; + $this->wPt=$this->fwPt; + $this->hPt=$this->fhPt; + } + elseif($orientation=='l' || $orientation=='landscape') + { + $this->DefOrientation='L'; + $this->wPt=$this->fhPt; + $this->hPt=$this->fwPt; + } + else + $this->Error('Incorrect orientation: '.$orientation); + $this->CurOrientation=$this->DefOrientation; + $this->w=$this->wPt/$this->k; + $this->h=$this->hPt/$this->k; + //Page margins (1 cm) + $margin=28.35/$this->k; + $this->SetMargins($margin,$margin); + //Interior cell margin (1 mm) + $this->cMargin=$margin/10; + //Line width (0.2 mm) + $this->LineWidth=.567/$this->k; + //Automatic page break + $this->SetAutoPageBreak(true,2*$margin); + //Full width display mode + $this->SetDisplayMode('fullwidth'); + //Enable compression + $this->SetCompression(true); + //Set default PDF version number + $this->PDFVersion='1.3'; +} + +function SetMargins($left,$top,$right=-1) +{ + //Set left, top and right margins + $this->lMargin=$left; + $this->tMargin=$top; + if($right==-1) + $right=$left; + $this->rMargin=$right; +} + +function SetLeftMargin($margin) +{ + //Set left margin + $this->lMargin=$margin; + if($this->page>0 && $this->x<$margin) + $this->x=$margin; +} + +function SetTopMargin($margin) +{ + //Set top margin + $this->tMargin=$margin; +} + +function SetRightMargin($margin) +{ + //Set right margin + $this->rMargin=$margin; +} + +function SetAutoPageBreak($auto,$margin=0) +{ + //Set auto page break mode and triggering margin + $this->AutoPageBreak=$auto; + $this->bMargin=$margin; + $this->PageBreakTrigger=$this->h-$margin; +} + +function SetDisplayMode($zoom,$layout='continuous') +{ + //Set display mode in viewer + if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) + $this->ZoomMode=$zoom; + else + $this->Error('Incorrect zoom display mode: '.$zoom); + if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') + $this->LayoutMode=$layout; + else + $this->Error('Incorrect layout display mode: '.$layout); +} + +function SetCompression($compress) +{ + //Set page compression + if(function_exists('gzcompress')) + $this->compress=$compress; + else + $this->compress=false; +} + +function SetTitle($title) +{ + //Title of document + $this->title=$title; +} + +function SetSubject($subject) +{ + //Subject of document + $this->subject=$subject; +} + +function SetAuthor($author) +{ + //Author of document + $this->author=$author; +} + +function SetKeywords($keywords) +{ + //Keywords of document + $this->keywords=$keywords; +} + +function SetCreator($creator) +{ + //Creator of document + $this->creator=$creator; +} + +function AliasNbPages($alias='{nb}') +{ + //Define an alias for total number of pages + $this->AliasNbPages=$alias; +} + +function Error($msg) +{ + //Fatal error + die('FPDF error: '.$msg); +} + +function Open() +{ + //Begin document + $this->state=1; +} + +function Close() +{ + //Terminate document + if($this->state==3) + return; + if($this->page==0) + $this->AddPage(); + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + //Close document + $this->_enddoc(); +} + +function AddPage($orientation='') +{ + //Start a new page + if($this->state==0) + $this->Open(); + $family=$this->FontFamily; + $style=$this->FontStyle.($this->underline ? 'U' : ''); + $size=$this->FontSizePt; + $lw=$this->LineWidth; + $dc=$this->DrawColor; + $fc=$this->FillColor; + $tc=$this->TextColor; + $cf=$this->ColorFlag; + if($this->page>0) + { + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + } + //Start new page + $this->_beginpage($orientation); + //Set line cap style to square + $this->_out('2 J'); + //Set line width + $this->LineWidth=$lw; + $this->_out(sprintf('%.2f w',$lw*$this->k)); + //Set font + if($family) + $this->SetFont($family,$style,$size); + //Set colors + $this->DrawColor=$dc; + if($dc!='0 G') + $this->_out($dc); + $this->FillColor=$fc; + if($fc!='0 g') + $this->_out($fc); + $this->TextColor=$tc; + $this->ColorFlag=$cf; + //Page header + $this->Header(); + //Restore line width + if($this->LineWidth!=$lw) + { + $this->LineWidth=$lw; + $this->_out(sprintf('%.2f w',$lw*$this->k)); + } + //Restore font + if($family) + $this->SetFont($family,$style,$size); + //Restore colors + if($this->DrawColor!=$dc) + { + $this->DrawColor=$dc; + $this->_out($dc); + } + if($this->FillColor!=$fc) + { + $this->FillColor=$fc; + $this->_out($fc); + } + $this->TextColor=$tc; + $this->ColorFlag=$cf; +} + +function Header() +{ + //To be implemented in your own inherited class +} + +function Footer() +{ + //To be implemented in your own inherited class +} + +function PageNo() +{ + //Get current page number + return $this->page; +} + +function SetDrawColor($r,$g=-1,$b=-1) +{ + //Set color for all stroking operations + if(($r==0 && $g==0 && $b==0) || $g==-1) + $this->DrawColor=sprintf('%.3f G',$r/255); + else + $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255); + if($this->page>0) + $this->_out($this->DrawColor); +} + +function SetFillColor($r,$g=-1,$b=-1) +{ + //Set color for all filling operations + if(($r==0 && $g==0 && $b==0) || $g==-1) + $this->FillColor=sprintf('%.3f g',$r/255); + else + $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); + if($this->page>0) + $this->_out($this->FillColor); +} + +function SetTextColor($r,$g=-1,$b=-1) +{ + //Set color for text + if(($r==0 && $g==0 && $b==0) || $g==-1) + $this->TextColor=sprintf('%.3f g',$r/255); + else + $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); +} + +function GetStringWidth($s) +{ + //Get width of a string in the current font + $s=(string)$s; + $cw=&$this->CurrentFont['cw']; + $w=0; + $l=strlen($s); + for($i=0;$i<$l;$i++) + $w+=$cw[$s{$i}]; + return $w*$this->FontSize/1000; +} + +function SetLineWidth($width) +{ + //Set line width + $this->LineWidth=$width; + if($this->page>0) + $this->_out(sprintf('%.2f w',$width*$this->k)); +} + +function Line($x1,$y1,$x2,$y2) +{ + //Draw a line + $this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k)); +} + +function Rect($x,$y,$w,$h,$style='') +{ + //Draw a rectangle + if($style=='F') + $op='f'; + elseif($style=='FD' || $style=='DF') + $op='B'; + else + $op='S'; + $this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op)); +} + +function AddFont($family,$style='',$file='') +{ + //Add a TrueType or Type1 font + $family=strtolower($family); + if($file=='') + $file=str_replace(' ','',$family).strtolower($style).'.php'; + if($family=='arial') + $family='helvetica'; + $style=strtoupper($style); + if($style=='IB') + $style='BI'; + $fontkey=$family.$style; + if(isset($this->fonts[$fontkey])) + $this->Error('Font already added: '.$family.' '.$style); + include($this->_getfontpath().$file); + if(!isset($name)) + $this->Error('Could not include font definition file'); + $i=count($this->fonts)+1; + $this->fonts[$fontkey]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file); + if($diff) + { + //Search existing encodings + $d=0; + $nb=count($this->diffs); + for($i=1;$i<=$nb;$i++) + { + if($this->diffs[$i]==$diff) + { + $d=$i; + break; + } + } + if($d==0) + { + $d=$nb+1; + $this->diffs[$d]=$diff; + } + $this->fonts[$fontkey]['diff']=$d; + } + if($file) + { + if($type=='TrueType') + $this->FontFiles[$file]=array('length1'=>$originalsize); + else + $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2); + } +} + +function SetFont($family,$style='',$size=0) +{ + //Select a font; size given in points + global $fpdf_charwidths; + + $family=strtolower($family); + if($family=='') + $family=$this->FontFamily; + if($family=='arial') + $family='helvetica'; + elseif($family=='symbol' || $family=='zapfdingbats') + $style=''; + $style=strtoupper($style); + if(strpos($style,'U')!==false) + { + $this->underline=true; + $style=str_replace('U','',$style); + } + else + $this->underline=false; + if($style=='IB') + $style='BI'; + if($size==0) + $size=$this->FontSizePt; + //Test if font is already selected + if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size) + return; + //Test if used for the first time + $fontkey=$family.$style; + if(!isset($this->fonts[$fontkey])) + { + //Check if one of the standard fonts + if(isset($this->CoreFonts[$fontkey])) + { + if(!isset($fpdf_charwidths[$fontkey])) + { + //Load metric file + $file=$family; + if($family=='times' || $family=='helvetica') + $file.=strtolower($style); + include($this->_getfontpath().$file.'.php'); + if(!isset($fpdf_charwidths[$fontkey])) + $this->Error('Could not include font metric file'); + } + $i=count($this->fonts)+1; + $this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]); + } + else + $this->Error('Undefined font: '.$family.' '.$style); + } + //Select it + $this->FontFamily=$family; + $this->FontStyle=$style; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + $this->CurrentFont=&$this->fonts[$fontkey]; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function SetFontSize($size) +{ + //Set font size in points + if($this->FontSizePt==$size) + return; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function AddLink() +{ + //Create a new internal link + $n=count($this->links)+1; + $this->links[$n]=array(0,0); + return $n; +} + +function SetLink($link,$y=0,$page=-1) +{ + //Set destination of internal link + if($y==-1) + $y=$this->y; + if($page==-1) + $page=$this->page; + $this->links[$link]=array($page,$y); +} + +function Link($x,$y,$w,$h,$link) +{ + //Put a link on the page + $this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link); +} + +function Text($x,$y,$txt) +{ + //Output a string + $s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); + if($this->underline && $txt!='') + $s.=' '.$this->_dounderline($x,$y,$txt); + if($this->ColorFlag) + $s='q '.$this->TextColor.' '.$s.' Q'; + $this->_out($s); +} + +function AcceptPageBreak() +{ + //Accept automatic page break or not + return $this->AutoPageBreak; +} + +function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='') +{ + //Output a cell + $k=$this->k; + if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak()) + { + //Automatic page break + $x=$this->x; + $ws=$this->ws; + if($ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->AddPage($this->CurOrientation); + $this->x=$x; + if($ws>0) + { + $this->ws=$ws; + $this->_out(sprintf('%.3f Tw',$ws*$k)); + } + } + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $s=''; + if($fill==1 || $border==1) + { + if($fill==1) + $op=($border==1) ? 'B' : 'f'; + else + $op='S'; + $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); + } + if(is_string($border)) + { + $x=$this->x; + $y=$this->y; + if(strpos($border,'L')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); + if(strpos($border,'T')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); + if(strpos($border,'R')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + if(strpos($border,'B')!==false) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + } + if($txt!=='') + { + if($align=='R') + $dx=$w-$this->cMargin-$this->GetStringWidth($txt); + elseif($align=='C') + $dx=($w-$this->GetStringWidth($txt))/2; + else + $dx=$this->cMargin; + if($this->ColorFlag) + $s.='q '.$this->TextColor.' '; + $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt))); + $s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2); + if($this->underline) + $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt); + if($this->ColorFlag) + $s.=' Q'; + if($link) + $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link); + } + if($s) + $this->_out($s); + $this->lasth=$h; + if($ln>0) + { + //Go to next line + $this->y+=$h; + if($ln==1) + $this->x=$this->lMargin; + } + else + $this->x+=$w; +} + +function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0) +{ + //Output text with automatic or explicit line breaks + $cw=&$this->CurrentFont['cw']; + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + if($nb>0 && $s[$nb-1]=="\n") + $nb--; + $b=0; + if($border) + { + if($border==1) + { + $border='LTRB'; + $b='LRT'; + $b2='LR'; + } + else + { + $b2=''; + if(strpos($border,'L')!==false) + $b2.='L'; + if(strpos($border,'R')!==false) + $b2.='R'; + $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2; + } + } + $sep=-1; + $i=0; + $j=0; + $l=0; + $ns=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s{$i}; + if($c=="\n") + { + //Explicit line break + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $i++; + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border && $nl==2) + $b=$b2; + continue; + } + if($c==' ') + { + $sep=$i; + $ls=$l; + $ns++; + } + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($i==$j) + $i++; + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + } + else + { + if($align=='J') + { + $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; + $this->_out(sprintf('%.3f Tw',$this->ws*$this->k)); + } + $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border && $nl==2) + $b=$b2; + } + else + $i++; + } + //Last chunk + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + if($border && strpos($border,'B')!==false) + $b.='B'; + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $this->x=$this->lMargin; +} + +function Write($h,$txt,$link='') +{ + //Output text in flowing mode + $cw=&$this->CurrentFont['cw']; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + $sep=-1; + $i=0; + $j=0; + $l=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s{$i}; + if($c=="\n") + { + //Explicit line break + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + $i++; + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + continue; + } + if($c==' ') + $sep=$i; + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($this->x>$this->lMargin) + { + //Move to next line + $this->x=$this->lMargin; + $this->y+=$h; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $i++; + $nl++; + continue; + } + if($i==$j) + $i++; + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + } + else + { + $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + } + else + $i++; + } + //Last chunk + if($i!=$j) + $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link); +} + +function Image($file,$x,$y,$w=0,$h=0,$type='',$link='') +{ + //Put an image on the page + if(!isset($this->images[$file])) + { + //First use of image, get info + if($type=='') + { + $pos=strrpos($file,'.'); + if(!$pos) + $this->Error('Image file has no extension and no type was specified: '.$file); + $type=substr($file,$pos+1); + } + $type=strtolower($type); + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + if($type=='jpg' || $type=='jpeg') + $info=$this->_parsejpg($file); + elseif($type=='png') + $info=$this->_parsepng($file); + else + { + //Allow for additional formats + $mtd='_parse'.$type; + if(!method_exists($this,$mtd)) + $this->Error('Unsupported image type: '.$type); + $info=$this->$mtd($file); + } + set_magic_quotes_runtime($mqr); + $info['i']=count($this->images)+1; + $this->images[$file]=$info; + } + else + $info=$this->images[$file]; + //Automatic width and height calculation if needed + if($w==0 && $h==0) + { + //Put image at 72 dpi + $w=$info['w']/$this->k; + $h=$info['h']/$this->k; + } + if($w==0) + $w=$h*$info['w']/$info['h']; + if($h==0) + $h=$w*$info['h']/$info['w']; + $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i'])); + if($link) + $this->Link($x,$y,$w,$h,$link); +} + +function Ln($h='') +{ + //Line feed; default value is last cell height + $this->x=$this->lMargin; + if(is_string($h)) + $this->y+=$this->lasth; + else + $this->y+=$h; +} + +function GetX() +{ + //Get x position + return $this->x; +} + +function SetX($x) +{ + //Set x position + if($x>=0) + $this->x=$x; + else + $this->x=$this->w+$x; +} + +function GetY() +{ + //Get y position + return $this->y; +} + +function SetY($y) +{ + //Set y position and reset x + $this->x=$this->lMargin; + if($y>=0) + $this->y=$y; + else + $this->y=$this->h+$y; +} + +function SetXY($x,$y) +{ + //Set x and y positions + $this->SetY($y); + $this->SetX($x); +} + +function Output($name='',$dest='') +{ + //Output PDF to some destination + //Finish document if necessary + if($this->state<3) + $this->Close(); + //Normalize parameters + if(is_bool($dest)) + $dest=$dest ? 'D' : 'F'; + $dest=strtoupper($dest); + if($dest=='') + { + if($name=='') + { + $name='doc.pdf'; + $dest='I'; + } + else + $dest='F'; + } + switch($dest) + { + case 'I': + //Send to standard output + if(ob_get_contents()) + $this->Error('Some data has already been output, can\'t send PDF file'); + if(php_sapi_name()!='cli') + { + //We send to a browser + header('Content-Type: application/pdf'); + if(headers_sent()) + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-disposition: inline; filename="'.$name.'"'); + } + echo $this->buffer; + break; + case 'D': + //Download file + if(ob_get_contents()) + $this->Error('Some data has already been output, can\'t send PDF file'); + if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) + header('Content-Type: application/force-download'); + else + header('Content-Type: application/octet-stream'); + if(headers_sent()) + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-disposition: attachment; filename="'.$name.'"'); + echo $this->buffer; + break; + case 'F': + //Save to local file + $f=fopen($name,'wb'); + if(!$f) + $this->Error('Unable to create output file: '.$name); + fwrite($f,$this->buffer,strlen($this->buffer)); + fclose($f); + break; + case 'S': + //Return as a string + return $this->buffer; + default: + $this->Error('Incorrect output destination: '.$dest); + } + return ''; +} + +/******************************************************************************* +* * +* Protected methods * +* * +*******************************************************************************/ +function _dochecks() +{ + //Check for locale-related bug + if(1.1==1) + $this->Error('Don\'t alter the locale before including class file'); + //Check for decimal separator + if(sprintf('%.1f',1.0)!='1.0') + setlocale(LC_NUMERIC,'C'); +} + +function _getfontpath() +{ + if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font')) + define('FPDF_FONTPATH',dirname(__FILE__).'/font/'); + return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : ''; +} + +function _putpages() +{ + $nb=$this->page; + if(!empty($this->AliasNbPages)) + { + //Replace number of pages + for($n=1;$n<=$nb;$n++) + $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]); + } + if($this->DefOrientation=='P') + { + $wPt=$this->fwPt; + $hPt=$this->fhPt; + } + else + { + $wPt=$this->fhPt; + $hPt=$this->fwPt; + } + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + for($n=1;$n<=$nb;$n++) + { + //Page + $this->_newobj(); + $this->_out('<_out('/Parent 1 0 R'); + if(isset($this->OrientationChanges[$n])) + $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt)); + $this->_out('/Resources 2 0 R'); + if(isset($this->PageLinks[$n])) + { + //Links + $annots='/Annots ['; + foreach($this->PageLinks[$n] as $pl) + { + $rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]); + $annots.='<_textstring($pl[4]).'>>>>'; + else + { + $l=$this->links[$pl[4]]; + $h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt; + $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k); + } + } + $this->_out($annots.']'); + } + $this->_out('/Contents '.($this->n+1).' 0 R>>'); + $this->_out('endobj'); + //Page content + $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; + $this->_newobj(); + $this->_out('<<'.$filter.'/Length '.strlen($p).'>>'); + $this->_putstream($p); + $this->_out('endobj'); + } + //Pages root + $this->offsets[1]=strlen($this->buffer); + $this->_out('1 0 obj'); + $this->_out('<_out($kids.']'); + $this->_out('/Count '.$nb); + $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt)); + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putfonts() +{ + $nf=$this->n; + foreach($this->diffs as $diff) + { + //Encodings + $this->_newobj(); + $this->_out('<>'); + $this->_out('endobj'); + } + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + foreach($this->FontFiles as $file=>$info) + { + //Font file embedding + $this->_newobj(); + $this->FontFiles[$file]['n']=$this->n; + $font=''; + $f=fopen($this->_getfontpath().$file,'rb',1); + if(!$f) + $this->Error('Font file not found'); + while(!feof($f)) + $font.=fread($f,8192); + fclose($f); + $compressed=(substr($file,-2)=='.z'); + if(!$compressed && isset($info['length2'])) + { + $header=(ord($font{0})==128); + if($header) + { + //Strip first binary header + $font=substr($font,6); + } + if($header && ord($font{$info['length1']})==128) + { + //Strip second binary header + $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6); + } + } + $this->_out('<_out('/Filter /FlateDecode'); + $this->_out('/Length1 '.$info['length1']); + if(isset($info['length2'])) + $this->_out('/Length2 '.$info['length2'].' /Length3 0'); + $this->_out('>>'); + $this->_putstream($font); + $this->_out('endobj'); + } + set_magic_quotes_runtime($mqr); + foreach($this->fonts as $k=>$font) + { + //Font objects + $this->fonts[$k]['n']=$this->n+1; + $type=$font['type']; + $name=$font['name']; + if($type=='core') + { + //Standard font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /Type1'); + if($name!='Symbol' && $name!='ZapfDingbats') + $this->_out('/Encoding /WinAnsiEncoding'); + $this->_out('>>'); + $this->_out('endobj'); + } + elseif($type=='Type1' || $type=='TrueType') + { + //Additional Type1 or TrueType font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /'.$type); + $this->_out('/FirstChar 32 /LastChar 255'); + $this->_out('/Widths '.($this->n+1).' 0 R'); + $this->_out('/FontDescriptor '.($this->n+2).' 0 R'); + if($font['enc']) + { + if(isset($font['diff'])) + $this->_out('/Encoding '.($nf+$font['diff']).' 0 R'); + else + $this->_out('/Encoding /WinAnsiEncoding'); + } + $this->_out('>>'); + $this->_out('endobj'); + //Widths + $this->_newobj(); + $cw=&$font['cw']; + $s='['; + for($i=32;$i<=255;$i++) + $s.=$cw[chr($i)].' '; + $this->_out($s.']'); + $this->_out('endobj'); + //Descriptor + $this->_newobj(); + $s='<$v) + $s.=' /'.$k.' '.$v; + $file=$font['file']; + if($file) + $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R'; + $this->_out($s.'>>'); + $this->_out('endobj'); + } + else + { + //Allow for additional types + $mtd='_put'.strtolower($type); + if(!method_exists($this,$mtd)) + $this->Error('Unsupported font type: '.$type); + $this->$mtd($font); + } + } +} + +function _putimages() +{ + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + reset($this->images); + while(list($file,$info)=each($this->images)) + { + $this->_newobj(); + $this->images[$file]['n']=$this->n; + $this->_out('<_out('/Subtype /Image'); + $this->_out('/Width '.$info['w']); + $this->_out('/Height '.$info['h']); + if($info['cs']=='Indexed') + $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); + else + { + $this->_out('/ColorSpace /'.$info['cs']); + if($info['cs']=='DeviceCMYK') + $this->_out('/Decode [1 0 1 0 1 0 1 0]'); + } + $this->_out('/BitsPerComponent '.$info['bpc']); + if(isset($info['f'])) + $this->_out('/Filter /'.$info['f']); + if(isset($info['parms'])) + $this->_out($info['parms']); + if(isset($info['trns']) && is_array($info['trns'])) + { + $trns=''; + for($i=0;$i_out('/Mask ['.$trns.']'); + } + $this->_out('/Length '.strlen($info['data']).'>>'); + $this->_putstream($info['data']); + unset($this->images[$file]['data']); + $this->_out('endobj'); + //Palette + if($info['cs']=='Indexed') + { + $this->_newobj(); + $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal']; + $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>'); + $this->_putstream($pal); + $this->_out('endobj'); + } + } +} + +function _putxobjectdict() +{ + foreach($this->images as $image) + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); +} + +function _putresourcedict() +{ + $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); + $this->_out('/Font <<'); + foreach($this->fonts as $font) + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_out('>>'); + $this->_out('/XObject <<'); + $this->_putxobjectdict(); + $this->_out('>>'); +} + +function _putresources() +{ + $this->_putfonts(); + $this->_putimages(); + //Resource dictionary + $this->offsets[2]=strlen($this->buffer); + $this->_out('2 0 obj'); + $this->_out('<<'); + $this->_putresourcedict(); + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putinfo() +{ + $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION)); + if(!empty($this->title)) + $this->_out('/Title '.$this->_textstring($this->title)); + if(!empty($this->subject)) + $this->_out('/Subject '.$this->_textstring($this->subject)); + if(!empty($this->author)) + $this->_out('/Author '.$this->_textstring($this->author)); + if(!empty($this->keywords)) + $this->_out('/Keywords '.$this->_textstring($this->keywords)); + if(!empty($this->creator)) + $this->_out('/Creator '.$this->_textstring($this->creator)); + $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis'))); +} + +function _putcatalog() +{ + $this->_out('/Type /Catalog'); + $this->_out('/Pages 1 0 R'); + if($this->ZoomMode=='fullpage') + $this->_out('/OpenAction [3 0 R /Fit]'); + elseif($this->ZoomMode=='fullwidth') + $this->_out('/OpenAction [3 0 R /FitH null]'); + elseif($this->ZoomMode=='real') + $this->_out('/OpenAction [3 0 R /XYZ null null 1]'); + elseif(!is_string($this->ZoomMode)) + $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']'); + if($this->LayoutMode=='single') + $this->_out('/PageLayout /SinglePage'); + elseif($this->LayoutMode=='continuous') + $this->_out('/PageLayout /OneColumn'); + elseif($this->LayoutMode=='two') + $this->_out('/PageLayout /TwoColumnLeft'); +} + +function _putheader() +{ + $this->_out('%PDF-'.$this->PDFVersion); +} + +function _puttrailer() +{ + $this->_out('/Size '.($this->n+1)); + $this->_out('/Root '.$this->n.' 0 R'); + $this->_out('/Info '.($this->n-1).' 0 R'); +} + +function _enddoc() +{ + $this->_putheader(); + $this->_putpages(); + $this->_putresources(); + //Info + $this->_newobj(); + $this->_out('<<'); + $this->_putinfo(); + $this->_out('>>'); + $this->_out('endobj'); + //Catalog + $this->_newobj(); + $this->_out('<<'); + $this->_putcatalog(); + $this->_out('>>'); + $this->_out('endobj'); + //Cross-ref + $o=strlen($this->buffer); + $this->_out('xref'); + $this->_out('0 '.($this->n+1)); + $this->_out('0000000000 65535 f '); + for($i=1;$i<=$this->n;$i++) + $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i])); + //Trailer + $this->_out('trailer'); + $this->_out('<<'); + $this->_puttrailer(); + $this->_out('>>'); + $this->_out('startxref'); + $this->_out($o); + $this->_out('%%EOF'); + $this->state=3; +} + +function _beginpage($orientation) +{ + $this->page++; + $this->pages[$this->page]=''; + $this->state=2; + $this->x=$this->lMargin; + $this->y=$this->tMargin; + $this->FontFamily=''; + //Page orientation + if(!$orientation) + $orientation=$this->DefOrientation; + else + { + $orientation=strtoupper($orientation{0}); + if($orientation!=$this->DefOrientation) + $this->OrientationChanges[$this->page]=true; + } + if($orientation!=$this->CurOrientation) + { + //Change orientation + if($orientation=='P') + { + $this->wPt=$this->fwPt; + $this->hPt=$this->fhPt; + $this->w=$this->fw; + $this->h=$this->fh; + } + else + { + $this->wPt=$this->fhPt; + $this->hPt=$this->fwPt; + $this->w=$this->fh; + $this->h=$this->fw; + } + $this->PageBreakTrigger=$this->h-$this->bMargin; + $this->CurOrientation=$orientation; + } +} + +function _endpage() +{ + //End of page contents + $this->state=1; +} + +function _newobj() +{ + //Begin a new object + $this->n++; + $this->offsets[$this->n]=strlen($this->buffer); + $this->_out($this->n.' 0 obj'); +} + +function _dounderline($x,$y,$txt) +{ + //Underline text + $up=$this->CurrentFont['up']; + $ut=$this->CurrentFont['ut']; + $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '); + return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); +} + +function _parsejpg($file) +{ + //Extract info from a JPEG file + $a=GetImageSize($file); + if(!$a) + $this->Error('Missing or incorrect image file: '.$file); + if($a[2]!=2) + $this->Error('Not a JPEG file: '.$file); + if(!isset($a['channels']) || $a['channels']==3) + $colspace='DeviceRGB'; + elseif($a['channels']==4) + $colspace='DeviceCMYK'; + else + $colspace='DeviceGray'; + $bpc=isset($a['bits']) ? $a['bits'] : 8; + //Read whole file + $f=fopen($file,'rb'); + $data=''; + while(!feof($f)) + $data.=fread($f,4096); + fclose($f); + return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data); +} + +function _parsepng($file) +{ + //Extract info from a PNG file + $f=fopen($file,'rb'); + if(!$f) + $this->Error('Can\'t open image file: '.$file); + //Check signature + if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) + $this->Error('Not a PNG file: '.$file); + //Read header chunk + fread($f,4); + if(fread($f,4)!='IHDR') + $this->Error('Incorrect PNG file: '.$file); + $w=$this->_freadint($f); + $h=$this->_freadint($f); + $bpc=ord(fread($f,1)); + if($bpc>8) + $this->Error('16-bit depth not supported: '.$file); + $ct=ord(fread($f,1)); + if($ct==0) + $colspace='DeviceGray'; + elseif($ct==2) + $colspace='DeviceRGB'; + elseif($ct==3) + $colspace='Indexed'; + else + $this->Error('Alpha channel not supported: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Unknown compression method: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Unknown filter method: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Interlacing not supported: '.$file); + fread($f,4); + $parms='/DecodeParms <>'; + //Scan chunks looking for palette, transparency and image data + $pal=''; + $trns=''; + $data=''; + do + { + $n=$this->_freadint($f); + $type=fread($f,4); + if($type=='PLTE') + { + //Read palette + $pal=fread($f,$n); + fread($f,4); + } + elseif($type=='tRNS') + { + //Read transparency info + $t=fread($f,$n); + if($ct==0) + $trns=array(ord(substr($t,1,1))); + elseif($ct==2) + $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1))); + else + { + $pos=strpos($t,chr(0)); + if($pos!==false) + $trns=array($pos); + } + fread($f,4); + } + elseif($type=='IDAT') + { + //Read image data block + $data.=fread($f,$n); + fread($f,4); + } + elseif($type=='IEND') + break; + else + fread($f,$n+4); + } + while($n); + if($colspace=='Indexed' && empty($pal)) + $this->Error('Missing palette in '.$file); + fclose($f); + return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data); +} + +function _freadint($f) +{ + //Read a 4-byte integer from file + $a=unpack('Ni',fread($f,4)); + return $a['i']; +} + +function _textstring($s) +{ + //Format a text string + return '('.$this->_escape($s).')'; +} + +function _escape($s) +{ + //Add \ before \, ( and ) + return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s))); +} + +function _putstream($s) +{ + $this->_out('stream'); + $this->_out($s); + $this->_out('endstream'); +} + +function _out($s) +{ + //Add a line to the document + if($this->state==2) + $this->pages[$this->page].=$s."\n"; + else + $this->buffer.=$s."\n"; +} +//End of class +} + +//Handle special IE contype request +if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype') +{ + header('Content-Type: application/pdf'); + exit; +} + +} +?> diff --git a/php2pdf/phpToPDF.php b/php2pdf/phpToPDF.php new file mode 100644 index 0000000..471dfae --- /dev/null +++ b/php2pdf/phpToPDF.php @@ -0,0 +1,1394 @@ + 10000) $ratio=1000; + else if ($valeur > 1000) $ratio=100; + else if ($valeur > 100) $ratio=10; + else $ratio=1; + + $res = $valeur + (0.1*$valeur); + $res = round($res/$ratio) * $ratio; + + return $res; +} + +function moins10pourcentArrondi($valeur) +{ + if ($valeur > 10000) $ratio=1000; + else if ($valeur > 1000) $ratio=100; + else if ($valeur > 100) $ratio=10; + else $ratio=1; + + if ($valeur >0) + $res = $valeur - (0.1*$valeur); + else $res = $valeur + (0.1*$valeur); + + $res = round($res/$ratio) * $ratio; + return $res; +} + +class phpToPDF extends FPDF +{ + var $legends; + var $wLegend; + var $sum; + var $NbVal; + + var $_toc=array(); + var $_numbering=false; + var $_numberingFooter=false; + var $_numPageNum=1; + + var $tb_columns; //number of columns of the table + var $tb_header_type; //array which contains the header characteristics and texts + var $tb_header_draw; //TRUE or FALSE, the header is drawed or not + var $tb_border_draw; //TRUE or FALSE, the table border is drawed or not + var $tb_data_type; //array which contains the data characteristics (only the characteristics) + var $tb_table_type; //array which contains the table charactersitics + var $table_startx, $table_starty; //the X and Y position where the table starts + + var $Draw_Header_Command; //command which determines in the DrawData first the header draw + var $New_Page_Commit; // = true/false if a new page has been comited + var $Data_On_Current_Page; // = true/false ... if on current page was some data written + + + function AddPage($orientation='') { + parent::AddPage($orientation); + if($this->_numbering) + $this->_numPageNum++; + } + + function startPageNums() { + $this->_numbering=true; + $this->_numberingFooter=true; + } + + function stopPageNums() { + $this->_numbering=false; + } + + function numPageNo() { + return $this->_numPageNum; + } + + function TOC_Entry($txt,$level=0) { + $this->_toc[]=array('t'=>$txt,'l'=>$level,'p'=>$this->numPageNo()); + } + + function insertTOC( $location=1, + $labelSize=20, + $entrySize=10, + $tocfont='Times', + $label='Table des matières' + ) { + //make toc at end + $this->stopPageNums(); + $this->AddPage(); + $tocstart=$this->page; + + $this->SetFont($tocfont,'B',$labelSize); + $this->Cell(0,5,$label,0,1,'C'); + $this->Ln(20); + + + $this->SetLeftMargin(20); + + + + foreach($this->_toc as $t) { + + //Offset + $level=$t['l']; + if($level>0) + $this->Cell($level*8); + $weight=''; + if($level==0) + $weight='B'; + $str=$t['t']; + $this->SetFont($tocfont,$weight,$entrySize); + $strsize=$this->GetStringWidth($str); + $this->Cell($strsize+2,$this->FontSize+2,$str); + + //Filling dots + $this->SetFont($tocfont,'',$entrySize); + $PageCellSize=$this->GetStringWidth($t['p'])+2; + $w=$this->w-$this->lMargin-$this->rMargin-$PageCellSize-($level*8)-($strsize+2); + $nb=$w/$this->GetStringWidth('.'); + $dots=str_repeat('.',$nb); + $this->Cell($w,$this->FontSize+2,$dots,0,0,'R'); + + //Page number + $this->Cell($PageCellSize,$this->FontSize+2,$t['p'],0,1,'R'); + + $this->Ln(2); + } + + //grab it and move to selected location + $n=$this->page; + $n_toc = $n - $tocstart + 1; + $last = array(); + + //store toc pages + for($i = $tocstart;$i <= $n;$i++) + $last[]=$this->pages[$i]; + + //move pages + for($i=$tocstart - 1;$i>=$location-1;$i--) + $this->pages[$i+$n_toc]=$this->pages[$i]; + + //Put toc pages at insert point + for($i = 0;$i < $n_toc;$i++) + $this->pages[$location + $i]=$last[$i]; + } + + function Footer() { + if($this->_numberingFooter==false) + return; + //Go to 1.5 cm from bottom + $this->SetY(-15); + //Select Arial italic 8 + $this->SetFont('Arial','I',8); + $this->Cell(0,7,$this->numPageNo(),0,0,'C'); + if($this->_numbering==false) + $this->_numberingFooter=false; + } + + function SetDash($black=false,$white=false) + { + if($black and $white) + $s=sprintf('[%.3f %.3f] 0 d',$black*$this->k,$white*$this->k); + else + $s='[] 0 d'; + $this->_out($s); + } + + function SetLegends($data, $format) + { + $this->legends=array(); + $this->wLegend=0; + $this->sum=array_sum($data); + $this->NbVal=count($data); + foreach($data as $l=>$val) + { + $p=sprintf('%.2f',$val/$this->sum*100).'%'; + $legend=str_replace(array('%l','%v','%p'),array($l,$val,$p),$format); + $this->legends[]=$legend; + $this->wLegend=max($this->GetStringWidth($legend),$this->wLegend); + } + } + + function DiagCirculaire($largeur, $hauteur, $data, $format, $couleurs=null, $legend=1) + { + $this->SetFont('Courier', '', 10); + $this->SetLegends($data,$format); + + $XPage = $this->GetX(); + $YPage = $this->GetY(); + $marge = 2; + $hLegende = 5; + $rayon = min($largeur - $marge * 4 - $hLegende - $this->wLegend, $hauteur - $marge * 2); + $rayon = floor($rayon / 2); + $XDiag = $XPage + $marge + $rayon; + $YDiag = $YPage + $marge + $rayon; + if($couleurs == null) { + for($i = 0;$i < $this->NbVal; $i++) { + $gray = $i * intval(255 / $this->NbVal); + $couleurs[$i] = array($gray,$gray,$gray); + } + } + + //Secteurs + $this->SetLineWidth(0.2); + $angleDebut = 0; + $angleFin = 0; + $i = 0; + foreach($data as $val) { + $angle = floor(($val * 360) / doubleval($this->sum)); + if ($angle != 0) { + $angleFin = $angleDebut + $angle; + $this->SetFillColor($couleurs[$i][0],$couleurs[$i][1],$couleurs[$i][2]); + $this->Sector($XDiag, $YDiag, $rayon, $angleDebut, $angleFin); + $angleDebut += $angle; + } + $i++; + } + if ($angleFin != 360) { + $this->Sector($XDiag, $YDiag, $rayon, $angleDebut - $angle, 360); + } + + //Légendes + if ($legend == 1) + { + $this->SetFont('Courier', '', 10); + $x1 = $XPage + 2 * $rayon + 4 * $marge; + $x2 = $x1 + $hLegende + $marge; + $y1 = $YDiag - $rayon + (2 * $rayon - $this->NbVal*($hLegende + $marge)) / 2; + for($i=0; $i<$this->NbVal; $i++) { + $this->SetFillColor($couleurs[$i][0],$couleurs[$i][1],$couleurs[$i][2]); + $this->Rect($x1, $y1, $hLegende, $hLegende, 'DF'); + $this->SetXY($x2,$y1); + $this->Cell(0,$hLegende,$this->legends[$i]); + $y1+=$hLegende + $marge; + } + } + } + + + function DiagBatons($largeur, $hauteur, $data, $format, $couleur=null, $maxValRepere=0, $nbIndRepere=4) + { + $this->SetFont('Courier', '', 10); + $this->SetLegends($data,$format); + + $XPage = $this->GetX(); + $YPage = $this->GetY(); + $marge = 2; + $YDiag = $YPage + $marge; + $hDiag = floor($hauteur - $marge * 2); + $XDiag = $XPage + $marge * 2 + $this->wLegend; + $lDiag = floor($largeur - $marge * 3 - $this->wLegend); + if($couleur == null) + $couleur=array(155,155,155); + if ($maxValRepere == 0) { + $maxValRepere = max($data); + } + $valIndRepere = ceil($maxValRepere / $nbIndRepere); + $maxValRepere = $valIndRepere * $nbIndRepere; + $lRepere = floor($lDiag / $nbIndRepere); + $lDiag = $lRepere * $nbIndRepere; + $unite = $lDiag / $maxValRepere; + $hBaton = floor($hDiag / ($this->NbVal + 1)); + $hDiag = $hBaton * ($this->NbVal + 1); + $eBaton = floor($hBaton * 80 / 100); + + $this->SetLineWidth(0.2); + $this->Rect($XDiag, $YDiag, $lDiag, $hDiag); + + $this->SetFont('Courier', '', 10); + $this->SetFillColor($couleur[0],$couleur[1],$couleur[2]); + $i=0; + foreach($data as $val) { + //Barre + $xval = $XDiag; + $lval = (int)($val * $unite); + $yval = $YDiag + ($i + 1) * $hBaton - $eBaton / 2; + $hval = $eBaton; + $this->Rect($xval, $yval, $lval, $hval, 'DF'); + //Légende + $this->SetXY(0, $yval); + $this->Cell($xval - $marge, $hval, $this->legends[$i],0,0,'R'); + $i++; + } + + //Echelles + for ($i = 0; $i <= $nbIndRepere; $i++) { + $xpos = $XDiag + $lRepere * $i; + $this->Line($xpos, $YDiag, $xpos, $YDiag + $hDiag); + $val = $i * $valIndRepere; + $xpos = $XDiag + $lRepere * $i - $this->GetStringWidth($val) / 2; + $ypos = $YDiag + $hDiag - $marge; + $this->Text($xpos, $ypos, $val); + } + } + + function Sector($xc, $yc, $r, $a, $b, $style='FD', $cw=true, $o=90) + { + if($cw){ + $d = $b; + $b = $o - $a; + $a = $o - $d; + }else{ + $b += $o; + $a += $o; + } + $a = ($a%360)+360; + $b = ($b%360)+360; + if ($a > $b) + $b +=360; + $b = $b/360*2*M_PI; + $a = $a/360*2*M_PI; + $d = $b-$a; + if ($d == 0 ) + $d =2*M_PI; + $k = $this->k; + $hp = $this->h; + if($style=='F') + $op='f'; + elseif($style=='FD' or $style=='DF') + $op='b'; + else + $op='s'; + if (sin($d/2)) + $MyArc = 4/3*(1-cos($d/2))/sin($d/2)*$r; + //first put the center + $this->_out(sprintf('%.2f %.2f m',($xc)*$k,($hp-$yc)*$k)); + //put the first point + $this->_out(sprintf('%.2f %.2f l',($xc+$r*cos($a))*$k,(($hp-($yc-$r*sin($a)))*$k))); + //draw the arc + if ($d < M_PI/2){ + $this->_Arc($xc+$r*cos($a)+$MyArc*cos(M_PI/2+$a), + $yc-$r*sin($a)-$MyArc*sin(M_PI/2+$a), + $xc+$r*cos($b)+$MyArc*cos($b-M_PI/2), + $yc-$r*sin($b)-$MyArc*sin($b-M_PI/2), + $xc+$r*cos($b), + $yc-$r*sin($b) + ); + }else{ + $b = $a + $d/4; + $MyArc = 4/3*(1-cos($d/8))/sin($d/8)*$r; + $this->_Arc($xc+$r*cos($a)+$MyArc*cos(M_PI/2+$a), + $yc-$r*sin($a)-$MyArc*sin(M_PI/2+$a), + $xc+$r*cos($b)+$MyArc*cos($b-M_PI/2), + $yc-$r*sin($b)-$MyArc*sin($b-M_PI/2), + $xc+$r*cos($b), + $yc-$r*sin($b) + ); + $a = $b; + $b = $a + $d/4; + $this->_Arc($xc+$r*cos($a)+$MyArc*cos(M_PI/2+$a), + $yc-$r*sin($a)-$MyArc*sin(M_PI/2+$a), + $xc+$r*cos($b)+$MyArc*cos($b-M_PI/2), + $yc-$r*sin($b)-$MyArc*sin($b-M_PI/2), + $xc+$r*cos($b), + $yc-$r*sin($b) + ); + $a = $b; + $b = $a + $d/4; + $this->_Arc($xc+$r*cos($a)+$MyArc*cos(M_PI/2+$a), + $yc-$r*sin($a)-$MyArc*sin(M_PI/2+$a), + $xc+$r*cos($b)+$MyArc*cos($b-M_PI/2), + $yc-$r*sin($b)-$MyArc*sin($b-M_PI/2), + $xc+$r*cos($b), + $yc-$r*sin($b) + ); + $a = $b; + $b = $a + $d/4; + $this->_Arc($xc+$r*cos($a)+$MyArc*cos(M_PI/2+$a), + $yc-$r*sin($a)-$MyArc*sin(M_PI/2+$a), + $xc+$r*cos($b)+$MyArc*cos($b-M_PI/2), + $yc-$r*sin($b)-$MyArc*sin($b-M_PI/2), + $xc+$r*cos($b), + $yc-$r*sin($b) + ); + } + //terminate drawing + $this->_out($op); + } + + function _Arc($x1, $y1, $x2, $y2, $x3, $y3 ) + { + $h = $this->h; + $this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c', + $x1*$this->k, + ($h-$y1)*$this->k, + $x2*$this->k, + ($h-$y2)*$this->k, + $x3*$this->k, + ($h-$y3)*$this->k)); + } + + //returns the width of the page in user units + function PageWidth(){ + return (int) $this->w-$this->rMargin-$this->lMargin; + } + + //constructor(not a real one, but have to call it first) + //we initialize all the variables that we use + function Table_Init($col_no = 0, $header_draw = true, $border_draw = true){ + $this->tb_columns = $col_no; + $this->tb_header_type = Array(); + $this->tb_header_draw = $header_draw; + $this->tb_border_draw = $border_draw; + $this->tb_data_type = Array(); + $this->tb_type = Array(); + $this->table_startx = $this->GetX(); + $this->table_starty = $this->GetY(); + + $this->Draw_Header_Command = false; //by default we don't draw the header + $this->New_Page_Commit = false; //NO we do not consider first time a new page + $this->Data_On_Current_Page = false; + } + + //Sets the number of columns of the table + function Set_Table_Columns($nr){ + $this->tb_columns = $nr; + } + + /* + Characteristics constants for Header Type: + EVERY CELL FROM THE TABLE IS A MULTICELL + + WIDTH - this is the cell width. This value must be sent only to the HEADER!!!!!!!! + T_COLOR - text color = array(r,g,b); + T_SIZE - text size + T_FONT - text font - font type = "Arial", "Times" + T_ALIGN - text align - "RLCJ" + V_ALIGN - text vertical alignment - "TMB" + T_TYPE - text type (Bold Italic etc) + LN_SPACE - space between lines + BG_COLOR - background color = array(r,g,b); + BRD_COLOR - border color = array(r,g,b); + BRD_SIZE - border size -- + BRD_TYPE - border size -- up down, with border without!!! etc + BRD_TYPE_NEW_PAGE - border type on new page - this is user only if specified(<>'') + TEXT - header text -- THIS ALSO BELONGS ONLY TO THE HEADER!!!! + + all these setting conform to the settings from the multicell functions!!!! + */ + + /* + Function: Set_Header_Type($type_arr) -- sets the array for the header type + + type array = + array( + 0=>array( + "WIDTH" => 10, + "T_COLOR" => array(120,120,120), + "T_SIZE" => 5, + ... + "TEXT" => "Header text 1" + ), + 1=>array( + ... + ), + ); + where 0,1... are the column number + */ + + function Set_Header_Type($type_arr){ + $this->tb_header_type = $type_arr; + } + + + /* + Characteristics constants for Data Type: + EVERY CELL FROM THE TABLE IS A MULTICELL + T_COLOR - text color = array(r,g,b); + T_SIZE - text size + T_FONT - text font - font type = "Arial", "Times" + T_ALIGN - text align - "RLCJ" + V_ALIGN - text vertical alignment - "TMB" + T_TYPE - text type (Bold Italic etc) + LN_SPACE - space between lines + BG_COLOR - background color = array(r,g,b); + BRD_COLOR - border color = array(r,g,b); + BRD_SIZE - border size -- + BRD_TYPE - border size -- up down, with border without!!! etc + BRD_TYPE_NEW_PAGE - border type on new page - this is user only if specified(<>'') + + all these settings conform to the settings from the multicell functions!!!! + */ + + /* + Function: Set_data_Type($type_arr) -- sets the array for the header type + + type array = + array( + 0=>array( + "T_COLOR" => array(120,120,120), + "T_SIZE" => 5, + ... + "BRD_TYPE" => 1 + ), + 1=>array( + ... + ), + ); + where 0,1... are the column number + */ + + function Set_Data_Type($type_arr){ + $this->tb_data_type = $type_arr; + } + + + + /* + Function Set_Table_Type + + $type_arr = array( + "BRD_COLOR"=> array (120,120,120), //border color + "BRD_SIZE"=>5), //border line width + "TB_COLUMNS"=>5), //the number of columns + "TB_ALIGN"=>"L"), //the align of the table, possible values = L, R, C equivalent to Left, Right, Center + 'L_MARGIN' => 0// left margin... reference from this->lmargin values + ) + */ + function Set_Table_Type($type_arr){ + + if (isset($type_arr['TB_COLUMNS'])) $this->tb_columns = $type_arr['TB_COLUMNS']; + if (!isset($type_arr['L_MARGIN'])) $type_arr['L_MARGIN']=0;//default values + + $this->tb_table_type = $type_arr; + + } + + //this functiondraws the exterior table border!!!! + function Draw_Table_Border(){ + /* "BRD_COLOR"=> array (120,120,120), //border color + "BRD_SIZE"=>5), //border line width + "TB_COLUMNS"=>5), //the number of columns + "TB_ALIGN"=>"L"), //the align of the table, possible values = L, R, C equivalent to Left, Right, Center + */ + + if ( ! $this->tb_border_draw ) return; + + if ( ! $this->Data_On_Current_Page) return; //there was no data on the current page + + //set the colors + list($r, $g, $b) = $this->tb_table_type['BRD_COLOR']; + $this->SetDrawColor($r, $g, $b); + + //set the line width + $this->SetLineWidth($this->tb_table_type['BRD_SIZE']); + + //draw the border + $this->Rect( + $this->table_startx, + $this->table_starty, + $this->Get_Table_Width(), + $this->GetY()-$this->table_starty); + + } + + function End_Page_Border(){ + if (isset($this->tb_table_type['BRD_TYPE_END_PAGE'])){ + + if (strpos($this->tb_table_type['BRD_TYPE_END_PAGE'], 'B') >= 0){ + + //set the colors + list($r, $g, $b) = $this->tb_table_type['BRD_COLOR']; + $this->SetDrawColor($r, $g, $b); + + //set the line width + $this->SetLineWidth($this->tb_table_type['BRD_SIZE']); + + //draw the line + $this->Line($this->table_startx, $this->GetY(), $this->table_startx + $this->Get_Table_Width(), $this->GetY()); + } + } + } + + //returns the table width in user units + function Get_Table_Width() + { + //calculate the table width + $tb_width = 0; + for ($i=0; $i < $this->tb_columns; $i++){ + $tb_width += $this->tb_header_type[$i]['WIDTH']; + } + return $tb_width; + } + + //alignes the table to C, L or R(default is L) + function Table_Align(){ + //check if the table is aligned + if (isset($this->tb_table_type['TB_ALIGN'])) $tb_align = $this->tb_table_type['TB_ALIGN']; else $tb_align=''; + + //set the table align + switch($tb_align){ + case 'C': + $this->SetX($this->lMargin + $this->tb_table_type['L_MARGIN'] + ($this->PageWidth() - $this->Get_Table_Width())/2); + break; + case 'R': + $this->SetX($this->lMargin + $this->tb_table_type['L_MARGIN'] + ($this->PageWidth() - $this->Get_Table_Width())); + break; + default: + $this->SetX($this->lMargin + $this->tb_table_type['L_MARGIN']); + break; + }//if (isset($this->tb_table_type['TB_ALIGN'])){ + } + + //Draws the Header + function Draw_Header(){ + $this->Draw_Header_Command = true; + } + + //Draws the Header + function Draw_Header_( $next_line_height = 0 ){ + + $this->Table_Align(); + + $this->table_startx = $this->GetX(); + $this->table_starty = $this->GetY(); + + //if the header will be showed + if ( ! $this->tb_header_draw ) return; + + $h = 0; + + //calculate the maximum height of the cells + for($i=0;$i<$this->tb_columns;$i++) + { + + $this->SetFont( $this->tb_header_type[$i]['T_FONT'], + $this->tb_header_type[$i]['T_TYPE'], + $this->tb_header_type[$i]['T_SIZE']); + + $this->tb_header_type[$i]['CELL_WIDTH'] = $this->tb_header_type[$i]['WIDTH']; + + if (isset($this->tb_header_type[$i]['COLSPAN'])){ + + $colspan = (int) $this->tb_header_type[$i]['COLSPAN'];//convert to integer + + for ($j = 1; $j < $colspan; $j++){ + //if there is a colspan, then calculate the number of lines also with the with of the next cell + if (($i + $j) < $this->tb_columns) + $this->tb_header_type[$i]['CELL_WIDTH'] += $this->tb_header_type[$i + $j]['WIDTH']; + } + } + + $this->tb_header_type[$i]['CELL_LINES'] = + $this->NbLines($this->tb_header_type[$i]['CELL_WIDTH'],$this->tb_header_type[$i]['TEXT']); + + //this is the maximum cell height + $h = max($h, $this->tb_header_type[$i]['LN_SIZE'] * $this->tb_header_type[$i]['CELL_LINES']); + +// if (isset($data[$i]['COLSPAN'])){ + //just skip the other cells +// $i = $i + $colspan - 1; +// } + + } + + //Issue a page break first if needed + //calculate the header hight and the next data line hight + $this->CheckPageBreak($h + $next_line_height, false); + + //Draw the cells of the row + for($i=0; $i<$this->tb_columns; $i++) + { + //border size BRD_SIZE + $this->SetLineWidth($this->tb_header_type[$i]['BRD_SIZE']); + + //fill color = BG_COLOR + list($r, $g, $b) = $this->tb_header_type[$i]['BG_COLOR']; + $this->SetFillColor($r, $g, $b); + + //Draw Color = BRD_COLOR + list($r, $g, $b) = $this->tb_header_type[$i]['BRD_COLOR']; + $this->SetDrawColor($r, $g, $b); + + //Text Color = T_COLOR + list($r, $g, $b) = $this->tb_header_type[$i]['T_COLOR']; + $this->SetTextColor($r, $g, $b); + + //Set the font, font type and size + $this->SetFont( $this->tb_header_type[$i]['T_FONT'], + $this->tb_header_type[$i]['T_TYPE'], + $this->tb_header_type[$i]['T_SIZE']); + + //Save the current position + $x=$this->GetX(); + $y=$this->GetY(); + + if ($this->New_Page_Commit){ + if (isset($this->tb_header_type[$i]['BRD_TYPE_NEW_PAGE'])){ + $this->tb_header_type[$i]['BRD_TYPE'] .= $this->tb_header_type[$i]['BRD_TYPE_NEW_PAGE']; + } + } + + //Print the text + $this->MultiCellTable( + $this->tb_header_type[$i]['CELL_WIDTH'], + $this->tb_header_type[$i]['LN_SIZE'], + $this->tb_header_type[$i]['TEXT'], + $this->tb_header_type[$i]['BRD_TYPE'], + $this->tb_header_type[$i]['T_ALIGN'], + $this->tb_header_type[$i]['V_ALIGN'], + 1, + $h - $this->tb_header_type[$i]['LN_SIZE'] * $this->tb_header_type[$i]['CELL_LINES'] + ); + + //Put the position to the right of the cell + $this->SetXY($x+$this->tb_header_type[$i]['CELL_WIDTH'],$y); + + if (isset($this->tb_header_type[$i]['COLSPAN'])){ + $i = $i + (int)$this->tb_header_type[$i]['COLSPAN'] - 1; + } + + + } + + //Go to the next line + $this->Ln($h); + + $this->Draw_Header_Command = false; + $this->New_Page_Commit = false; + $this->Data_On_Current_Page = true; + } + + //this function Draws the data's from the table + //have to call this function after the table initialization, after the table, header and data types are set + //and after the header is drawed + /* + $header = true -> on new page draws the header + = false - > the header is not drawed + */ + + function Draw_Data($data, $header = true){ + + $h = 0; + + //calculate the maximum height of the cells + for($i=0; $i < $this->tb_columns; $i++) + { + + if (!isset($data[$i]['T_FONT'])) $data[$i]['T_FONT'] = $this->tb_data_type[$i]['T_FONT']; + if (!isset($data[$i]['T_TYPE'])) $data[$i]['T_TYPE'] = $this->tb_data_type[$i]['T_TYPE']; + if (!isset($data[$i]['T_SIZE'])) $data[$i]['T_SIZE'] = $this->tb_data_type[$i]['T_SIZE']; + if (!isset($data[$i]['T_COLOR'])) $data[$i]['T_COLOR'] = $this->tb_data_type[$i]['T_COLOR']; + if (!isset($data[$i]['T_ALIGN'])) $data[$i]['T_ALIGN'] = $this->tb_data_type[$i]['T_ALIGN']; + if (!isset($data[$i]['V_ALIGN'])) $data[$i]['V_ALIGN'] = $this->tb_data_type[$i]['V_ALIGN']; + if (!isset($data[$i]['LN_SIZE'])) $data[$i]['LN_SIZE'] = $this->tb_data_type[$i]['LN_SIZE']; + if (!isset($data[$i]['BRD_SIZE'])) $data[$i]['BRD_SIZE'] = $this->tb_data_type[$i]['BRD_SIZE']; + if (!isset($data[$i]['BRD_COLOR'])) $data[$i]['BRD_COLOR'] = $this->tb_data_type[$i]['BRD_COLOR']; + if (!isset($data[$i]['BRD_TYPE'])) $data[$i]['BRD_TYPE'] = $this->tb_data_type[$i]['BRD_TYPE']; + if (!isset($data[$i]['BG_COLOR'])) $data[$i]['BG_COLOR'] = $this->tb_data_type[$i]['BG_COLOR']; + + $this->SetFont( $data[$i]['T_FONT'], + $data[$i]['T_TYPE'], + $data[$i]['T_SIZE']); + + $data[$i]['CELL_WIDTH'] = $this->tb_header_type[$i]['WIDTH']; + + if (isset($data[$i]['COLSPAN'])){ + + $colspan = (int) $data[$i]['COLSPAN'];//convert to integer + + for ($j = 1; $j < $colspan; $j++){ + //if there is a colspan, then calculate the number of lines also with the with of the next cell + if (($i + $j) < $this->tb_columns) + $data[$i]['CELL_WIDTH'] += $this->tb_header_type[$i + $j]['WIDTH']; + } + } + + $data[$i]['CELL_LINES'] = $this->NbLines($data[$i]['CELL_WIDTH'], $data[$i]['TEXT']); + + //this is the maximum cell height + $h = max($h, $data[$i]['LN_SIZE'] * $data[$i]['CELL_LINES']); + + if (isset($data[$i]['COLSPAN'])){ + //just skip the other cells + $i = $i + $colspan - 1; + } + + } + + + $this->CheckPageBreak($h, $header); + + if ($this->Draw_Header_Command){//draw the header + $this->Draw_Header_($h); + } + + $this->Table_Align(); + + //Draw the cells of the row + for($i=0;$i<$this->tb_columns;$i++) + { + + //border size BRD_SIZE + $this->SetLineWidth($data[$i]['BRD_SIZE']); + + //fill color = BG_COLOR + list($r, $g, $b) = $data[$i]['BG_COLOR']; + $this->SetFillColor($r, $g, $b); + + //Draw Color = BRD_COLOR + list($r, $g, $b) = $data[$i]['BRD_COLOR']; + $this->SetDrawColor($r, $g, $b); + + //Text Color = T_COLOR + list($r, $g, $b) = $data[$i]['T_COLOR']; + $this->SetTextColor($r, $g, $b); + + //Set the font, font type and size + $this->SetFont( $data[$i]['T_FONT'], + $data[$i]['T_TYPE'], + $data[$i]['T_SIZE']); + + //Save the current position + $x=$this->GetX(); + $y=$this->GetY(); + + //print the text + $this->MultiCellTable( + $data[$i]['CELL_WIDTH'], + $data[$i]['LN_SIZE'], + $data[$i]['TEXT'], + $data[$i]['BRD_TYPE'], + $data[$i]['T_ALIGN'], + $data[$i]['V_ALIGN'], + 1, + $h - $data[$i]['LN_SIZE'] * $data[$i]['CELL_LINES'] + ); + + //Put the position to the right of the cell + $this->SetXY($x + $data[$i]['CELL_WIDTH'],$y); + + //if we have colspan, just ignore the next cells + if (isset($data[$i]['COLSPAN'])){ + $i = $i + (int)$data[$i]['COLSPAN'] - 1; + } + + } + + $this->Data_On_Current_Page = true; + + //Go to the next line + $this->Ln($h); + } + + //if the table is bigger than a page then it jumps to next page and draws the header + /* + $h = is the height that if is overriden than the document jumps to a new page + $header = true/false = this specifies at a new page we write again the header or not. This variable + is used at the moment when the header draw makes the new page jump + */ + + function CheckPageBreak($h, $header = true) + { + //If the height h would cause an overflow, add a new page immediately + if($this->GetY()+$h > $this->PageBreakTrigger){ + + $this->Draw_Table_Border();//draw the table border + + $this->End_Page_Border();//if there is a special handling for end page??? this is specific for me + + $this->AddPage($this->CurOrientation);//add a new page + + $this->Data_On_Current_Page = false; + + $this->New_Page_Commit = true;//new page commit + + $this->table_startx = $this->GetX(); + $this->table_starty = $this->GetY(); + if ($header) $this ->Draw_Header();//if we have to draw the header!!! + } + + //align the table + $this->Table_Align(); + } + + /** This method returns the number of lines that will a text ocupy on the specified width + Call: + @param + $w - width + $txt - text + @return number + */ + function NbLines($w,$txt) + { + //Computes the number of lines a MultiCell of width w will take + $cw=&$this->CurrentFont['cw']; + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + if($nb>0 and $s[$nb-1]=="\n") + $nb--; + $sep=-1; + $i=0; + $j=0; + $l=0; + $nl=1; + while($i<$nb) + { + $c=$s[$i]; + if($c=="\n") + { + $i++; + $sep=-1; + $j=$i; + $l=0; + $nl++; + continue; + } + if($c==' ') + $sep=$i; + $l+=$cw[$c]; + if($l>$wmax) + { + if($sep==-1) + { + if($i==$j) + $i++; + } + else + $i=$sep+1; + $sep=-1; + $j=$i; + $l=0; + $nl++; + } + else + $i++; + } + return $nl; + } + + + /** This method allows printing text with line breaks. + It works like a modified MultiCell + Call: + @param + $w - width + $h - line height + $txt - the outputed text + $border - border(LRTB 0 or 1) + $align - horizontal align 'JLR' + $fill - fill (1/0) + $vh - vertical adjustment - the Multicell Height will be with this VH Higher!!!! + $valign - Vertical Alignment - Top, Middle, Bottom + @return nothing + */ + function MultiCellTable($w, $h, $txt, $border=0, $align='J', $valign='T', $fill=0, $vh=0) + { + + $b1 = '';//border for top cell + $b2 = '';//border for middle cell + $b3 = '';//border for bottom cell + + if($border) + { + if($border==1) + { + $border = 'LTRB'; + $b1 = 'LRT';//without the bottom + $b2 = 'LR';//without the top and bottom + $b3 = 'LRB';//without the top + } + else + { + $b2=''; + if(is_int(strpos($border,'L'))) + $b2.='L'; + if(is_int(strpos($border,'R'))) + $b2.='R'; + $b1=is_int(strpos($border,'T')) ? $b2.'T' : $b2; + $b3=is_int(strpos($border,'B')) ? $b2.'B' : $b2; + + } + } + + switch ($valign){ + case 'T': + $wh_T = 0;//Top width + $wh_B = $vh - $wh_T;//Bottom width + break; + case 'M': + $wh_T = $vh/2; + $wh_B = $vh/2; + break; + case 'B': + $wh_T = $vh; + $wh_B = 0; + break; + default://default is TOP ALIGN + $wh_T = 0;//Top width + $wh_B = $vh - $wh_T;//Bottom width + } + + //save the X position + $x = $this->x; + /* + if $wh_T == 0 that means that we have no vertical adjustments so I will skip the cells that + draws the top and bottom borders + */ + + if ($wh_T != 0)//only when there is a difference + { + //draw the top borders!!! + $this->Cell($w,$wh_T,'',$b1,2,$align,$fill); + } + + $b2 = is_int(strpos($border,'T')) && ($wh_T == 0) ? $b2.'T' : $b2; + $b2 = is_int(strpos($border,'B')) && ($wh_B == 0) ? $b2.'B' : $b2; + + $this->MultiCell($w,$h,$txt,$b2,$align,$fill); + + if ($wh_B != 0){//only when there is a difference + + //go to the saved X position + //a multicell always runs to the begin of line + $this->x = $x; + + $this->Cell($w, $wh_B, '', $b3, 2, $align,$fill); + + $this->x=$this->lMargin; + } + + } + + + + + + + + + //*************************************************************************************************************** + // LES FONCTIONS AJOUTEES PAR JC CORNIC + //*************************************************************************************************************** + + function setRepere($titre, $posX, $posY, $sizeX, $sizeY, $datasX, $datasY, $droites) + { + + $espaceX=25; + $espaceY=30; + + // Si le min=max alors on change le nombre de découpage d'ordonnée + if ($datasY[0] == $datasY[1]) + if ($datasY[0] == 0) $datasY[2] = 0; + else $datasY[2] = 1; + + // Le titre + $this->SetXY($posX+$espaceX, $posY - 10); + $this->Cell($sizeX , 10, $titre, 0, 2, "C"); + + if (($datasY[1]-$datasY[0]) != 0) + $ratioY = $sizeY/($datasY[1]-$datasY[0]); + else $ratioY = abs($sizeY/(2*$datasY[0])); + + if ($datasY[0] < 0) + $decalageYNeg = $datasY[0]*$ratioY; + else $decalageYNeg = 0; + + + $this->SetDrawColor(0, 0, 0); + $this->Line($posX+$espaceX, $posY+$sizeY+$decalageYNeg, $posX+$espaceX+$sizeX, $posY+$sizeY+$decalageYNeg); // X + $this->Line($posX+$espaceX, $posY+$sizeY, $posX+$espaceX, $posY); // Y + + $this->SetTextColor(0,0,0); + // Pour l'axe des X + switch (count($datasX)) + { + case 1: + // Mettre la valeur au milieu de l'axe + $this->SetXY($posX+$espaceX, $posY + $sizeY); + $this->Cell($sizeX, 10, $datasX[0], 0, 1, "C"); + + break; + case 2: + // Mettre les deux valeurs en début et fin d'axe + $this->Text($posX+$espaceX, $posY + $sizeY + 10, $datasX[0]); + $this->Text($posX+$espaceX + $sizeX, $posY + $sizeY + 10, $datasX[1]); + break; + default: + break; + } + + // Pour l'axe des Y + $yPos = $posY + $sizeY; + $xPos = $posX+$espaceX - 12; + $value = $datasY[0]; + $yInter = $sizeY / $datasY[2]; + $valueInter = ($datasY[1] - $datasY[0]) / $datasY[2]; + + if ($datasY[2] == 5) //**** minY et maxY différents ****// + for ($i=0 ; $i <= $datasY[2] ; $i++) + { + // Mettre les $i valeurs entre le début et la fin de l'axe + $this->Text($xPos, $yPos, $value); + + // Mettre les petites barres correspondantes... + $this->Line($posX+$espaceX-2, $yPos, $posX+$espaceX+2, $yPos); + + $yPos -= $yInter; + + if ($i==4) $value=$datasY[1]; + else $value += $valueInter; + } + else //**** minY et maxY égaux --> 1 ou 2 intervalles au lieu de 5 + { + //**** Droite horizontale y=0 + if ($datasY[0] == 0) + { + $this->Text($xPos, $yPos, $value); + $this->Line($posX-2, $yPos, $posX+2, $yPos); + } + else //**** Droite horizontale y=$datasY[0] + { + if ($datasY[0] <0) + { + //**** Y=$datasY[0] < 0 + $this->Text($xPos, $yPos, $value); + $this->Line($posX-2, $yPos, $posX+2, $yPos); + + $yPos -= $yInter/2; + $value = 0; + + //**** Y=0 + $this->Text($xPos, $yPos, $value); + $this->Line($posX-2, $yPos, $posX+2, $yPos); + } + else + { + //**** Y=0 + $this->Text($xPos, $yPos, $value); + $this->Line($posX-2, $yPos, $posX+2, $yPos); + + //**** Y=$datasY[0] > 0 + $this->Text($xPos, $yPos, $value); + $this->Line($posX-2, $yPos, $posX+2, $yPos); + } + } + } + + // Et on y met les droites... + $legendX = $posX+$espaceX + $sizeX/2; + $legendY = $posY + $sizeY + 20; + for ($i=0 ; $iSetDrawColor($droites[$i][2][0], $droites[$i][2][1], $droites[$i][2][2]); + $this->Line($posX+$espaceX, $y1, $posX+$sizeX, $y2); + + // ajouter la légende si elle doit être + if ($droites[$i][3] != "") + { + $this->Line($legendX - 20, $legendY, $legendX - 3, $legendY); + + $this->SetTextColor($droites[$i][2][0], $droites[$i][2][1], $droites[$i][2][2]); + $this->Text($legendX, $legendY, $droites[$i][3]); + $legendY += 5; + } + } + + // Et on encadre le repere... + $this->SetDrawColor(0,0,0); + $espace_Y = 15; + $this->Line($posX, $posY - $espace_Y, $posX+$espaceX + $sizeX + $espaceX, $posY - $espace_Y); // -Y + $this->Line($posX+$espaceX + $sizeX + $espaceX, $posY - $espace_Y, $posX+$espaceX + $sizeX + $espaceX, $posY + $sizeY + $espaceY); // +X + $this->Line($posX+$espaceX + $sizeX + $espaceX, $posY + $sizeY + $espaceY, $posX, $posY + $sizeY + $espaceY); // +Y + $this->Line($posX, $posY + $sizeY + $espaceY, $posX, $posY - $espace_Y); // -X + } + + //*********************************************************************************************************** + // Pour écrire un texte dans ue case... [BUI] pour le style de la police et [[LCR]] pour le centrage éventuel + // Par défault, le texte sera normal et à gauche... + // Fonction destinée à dessiner un tableau dans un file.pdf + function drawTableau(&$pdf, $tableType, $headerType, $headerDatas, $datasType, $datas) + { + $nbCol = count($headerDatas)/2; + + //we initialize the table class + $pdf->Table_Init($nbCol, true, true); + + //*************************************************************************** + //TABLE HEADER SETTINGS + //*************************************************************************** + $table_subtype = $tableType; + $pdf->Set_Table_Type($table_subtype); + + for($i=0; $i<$nbCol; $i++) + { + $header_type[$i] = $headerType; + $header_type[$i]['WIDTH'] = $headerDatas[$i]; + + // Les contenus + $j = $nbCol+$i; + $header_type[$i]['TEXT'] = $headerDatas[$j]; + + // Si une donnée == 0 alors on affiche rien... + if ($header_type[$i]['TEXT'] != "0") ; + else $header_type[$i]['TEXT'] = ""; + + // par défaut, le texte est centré à gauche, non italic, non souligné et non gras. + // par défaut, les cellules ne sont pas fusionnées. + $header_type[$i]['T_TYPE'] = ''; + $header_type[$i]['T_ALIGN'] = ''; + $header_type[$i]['COLSPAN'] = "1"; + } + + // Si l'utilisateur veut un alignement spécifique pour la première colonne. Sinon, T_ALIGN prend le dessus... + if (isset($headerType['T_ALIGN_COL0'])) + $header_type[0]['T_ALIGN'] = $headerType['T_ALIGN_COL0']; + + // Si l'utilisateur veut un fond coloré spécifique pour la première colonne. Sinon, BG_COLOR prend le dessus... + if (isset($headerType['BG_COLOR_COL0'])) + $header_type[0]['BG_COLOR'] = $headerType['BG_COLOR_COL0']; + + // Si l'utilisateur précise un type ou un alignement pour une cellule précise du tableau, on l'applique ici + // Il faut utiliser les balises [I], [B], [U] pour Italic, Bold et Underline + // Il faut utiliser les balises [L], [C], [R] pour left, centered et rigth + for($i=0; $i<$nbCol; $i++) + { + if (sscanf($header_type[$i]['TEXT'], "[%[a-zA-Z]]%s", $balise, $reste) != 0) + { + //echo "balise = " . $balise; + if ( (strpos($balise, "I")===FALSE) && (strpos($balise, "B")===FALSE) && (strpos($balise, "U")===FALSE) + && (strpos($balise, "L")===FALSE) && (strpos($balise, "C")===FALSE) && (strpos($balise, "R")===FALSE) ) + ; // Mauvaise balise ou l'utilisateur veut mettre des crochets dans son tableau, c'est son droit... + else + { + //echo "balise = " . $balise . "
"; + // On teste les différentes balises pour ajuster la cellule. + if (strpos($balise, "I") === FALSE) ; + else $header_type[$i]['T_TYPE'] .= 'I'; + if (strpos($balise, "B") === FALSE) ; + else $header_type[$i]['T_TYPE'] .= 'B'; + if (strpos($balise, "U") === FALSE) ; + else $header_type[$i]['T_TYPE'] .= 'U'; + if (strpos($balise, "L") === FALSE) ; + else $header_type[$i]['T_ALIGN'] .= 'L'; + if (strpos($balise, "C") === FALSE) ; + else $header_type[$i]['T_ALIGN'] .= 'C'; + if (strpos($balise, "R") === FALSE) ; + else $header_type[$i]['T_ALIGN'] .= 'R'; + } + + // On supprime la balise du texte de la cellule... + $header_type[$i]['TEXT'] = str_replace("[".$balise."]", "", $header_type[$i]['TEXT']); + } + } + // Si l'utilsateur ne veut pas de header pour son tableau, il met NULL dans la premiere cellule... + if ($header_type[0]['TEXT'] == NULL) + { + for($i=0; $i<$nbCol; $i++) + { + $header_type[$i]['LN_SIZE'] = 0; + $header_type[$i]['TEXT'] = ""; + } + } + + + // Test si l'utilisateur veut fusionner DEUX cellules dans le header de son tableau. Il doit mettre "COLSPAN2" dans la première cellule à fusionner. + for($i=0 ; $i<$nbCol ; $i++) + { + $k=$nbCol+$i; + $i_1 = $i-1; + if ( ($kSet_Header_Type($header_type); + $pdf->Draw_Header(); + + //*************************************************************************** + //TABLE DATA SETTINGS + //*************************************************************************** + $data_type = Array();//reset the array + for ($i=0; $i<$nbCol; $i++) $data_type[$i] = $datasType; + $pdf->Set_Data_Type($data_type); + + //********************************************************************* + // Ce qui suit est valable pour toutes les cellules du tableau (hors header bien entendu). + //********************************************************************* + $data = Array(); + for ($i=0 ; $i"; + // On teste les différentes balises pour ajuster la cellule. + if (strpos($balise, "I") === FALSE) ; + else $data[$k]['T_TYPE'] .= 'I'; + if (strpos($balise, "B") === FALSE) ; + else $data[$k]['T_TYPE'] .= 'B'; + if (strpos($balise, "U") === FALSE) ; + else $data[$k]['T_TYPE'] .= 'U'; + if (strpos($balise, "L") === FALSE) ; + else $data[$k]['T_ALIGN'] .= 'L'; + if (strpos($balise, "C") === FALSE) ; + else $data[$k]['T_ALIGN'] .= 'C'; + if (strpos($balise, "R") === FALSE) ; + else $data[$k]['T_ALIGN'] .= 'R'; + } + + // On supprime la balise du texte de la cellule... + $data[$k]['TEXT'] = str_replace("[".$balise."]", "", $data[$k]['TEXT']); + } + + // Si la valeur de la cellule est 0, le choix a été fait ICI de ne rien mettre dans la cellule. + if ($data[$k]['TEXT'] == "0") + $data[$k]['TEXT'] =""; + + // Test si l'utilisateur veut fusionner deux cellules dans le header de son tableau. Il doit mettre le contenu + // de la cellule fusionnée dans la première cellule et "COLSPAN2" dans la deuxième cellule. + if ( ($k<$nbCol) && ($data[$k]['TEXT'] === "COLSPAN2") ) + { + $k_1 = $k-1; + $data[$k_1]['COLSPAN'] = "2"; + $data[$k]['TEXT']= ""; + } + } + $pdf->Draw_Data($data); + } + + $pdf->Draw_Table_Border(); + } +} +?> \ No newline at end of file diff --git a/php2pdf/phpToPDF.zip b/php2pdf/phpToPDF.zip new file mode 100644 index 0000000..64b0d13 Binary files /dev/null and b/php2pdf/phpToPDF.zip differ diff --git a/scripts/migration_date.php b/scripts/migration_date.php new file mode 100644 index 0000000..230ab3f --- /dev/null +++ b/scripts/migration_date.php @@ -0,0 +1,90 @@ +id_sondage." "; + $sujets=pg_exec($connect, "select sujet from sujet_studs where id_sondage='$dsondage->id_sondage'"); + $dsujets=pg_fetch_object($sujets,0); + + $nouvelledateaffiche=""; + $anciensujethoraires=explode(",",$dsujets->sujet); + + for ($j=0;$j '.$nouvelledate.'@'.$ancientsujet[1].'
'; + $nouvelledateaffiche.=$nouvelledate.'@'.$ancientsujet[1].','; + + + } + } + + else{ + + if (preg_match(";(\d{1,2})/(\d{1,2})/(\d{4});",$anciensujethoraires[$j],$registredate)){ + $nouvelledate=mktime(0,0,0,$registredate[2],$registredate[1],$registredate[3]); +// echo $anciensujethoraires[$j].' ---- > '.$nouvelledate.'
'; + $nouvelledateaffiche.=$nouvelledate.','; + + } + } + } + $nouvelledateaffiche=substr($nouvelledateaffiche,0,-1); + print $dsujets->sujet.' donne '.$nouvelledateaffiche.'\n\n'; +// pg_exec($connect,"update sujet_studs set sujet='$nouvelledateaffiche' where id_sondage='$dsondage->id_sondage'"); + +} + + +?> diff --git a/scripts/nettoyage_sondage.php b/scripts/nettoyage_sondage.php new file mode 100644 index 0000000..e183b6d --- /dev/null +++ b/scripts/nettoyage_sondage.php @@ -0,0 +1,64 @@ +Execute("select * from sondage"); + +while ( $dsondage=$sondage->FetchNextObject(false)) { + + if ($date_courante > strtotime($dsondage->date_fin)){ + + //destruction des données dans la base + $connect->Execute('DELETE FROM sondage LEFT INNER JOIN sujet_studs ON sujet_studs.id_sondage = sondage.id_sondage '. + 'LEFT INNER JOIN user_studs ON user_studs.id_sondage = sondage.id_sondage ' . + 'LEFT INNER JOIN comments ON comments.id_sondage = sondage.id_sondage ' . + "WHERE id_sondage = '$dsondage->id_sondage' "); + + // ecriture des traces dans le fichier de logs + error_log($date . " SUPPRESSION: $dsondage->id_sondage\t$dsondage->format\t$dsondage->nom_admin\t$dsondage->mail_admin\n", '../admin/logs_studs.txt'); + } +} +?> diff --git a/scripts/phpVar2getText.php b/scripts/phpVar2getText.php new file mode 100644 index 0000000..be7e6bd --- /dev/null +++ b/scripts/phpVar2getText.php @@ -0,0 +1,129 @@ +.inc + build un assoc array + preg_replace les appels wrappés dans gettext() dans le php principal + + generate un .po + + ( + echo -e "\x27\2\x27,/p' lang/en.inc; + echo '); ?>' + ) > /tmp/lang.mod + (manually tweak 2 double quotes) + */ + + // drop a $l which contain the array +if(isset($_SERVER['PHP_SELF'])) + die(); // die if not run with php-cli +require_once('/tmp/lang.mod'); +$mypath = '/var/www/studs'; + +/* Language, country need to be adapted */ +$header = 'msgid "" +msgstr "" +"Project-Id-Version: Studs 0.6.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-01 18:32+0100\n" +"PO-Revision-Date: 2010-05-01 18:32+0100\n" +"Last-Translator: Raphaël Droz \n" +"Language-Team: Guilhem Borghesi, Raphaël Droz\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: FR\n" +"X-Poedit-Country: FRANCE\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-Basepath: /var/www/studs\n" +"X-Poedit-SearchPath-0: .\n" + +'; + + +/* helpers */ +function stripN($a) { + return preg_replace("/\n/","\\n", $a); +} +function addDQ($a) { + return addcslashes($a,'"'); +} + +/* low priority for weak regexps (small variable length) at the end, please */ +function cmp($a, $b) { + return (mb_strlen($a) < mb_strlen($b)); +} +uksort($l, 'cmp'); + +/* + 0: surely direct, like in: echo 'text ' . $var; + 1: wrap in, like in: echo "$var"; + 2: direct, like in: echo $var . "text"; +*/ +$match0 = $repl0 = $match1 = $repl1 = $match2 = $repl2 = $match3 = $repl3 = array(); +foreach($l as $k => $v) { + $match0[] = ';([\'"][ \.]|echo|print) *\$' . $k . ' *([\. ][\'"]|\;);' ; + $repl0[] = '\1 _("' . stripN(stripcslashes($v)) . '") \2' ; + + $match1[] = ';(["\'])(.*?)\$' . $k . ';' ; + $repl1[] = '\1\2" . _("' . stripN(addcslashes(stripcslashes($v),'"')) . '") . \1' ; + + $match2[] = ';\$' . $k . ';' ; + $repl2[] = '_("' . stripN(stripcslashes($v)) . '")' ; + + $match3[] = ';\. *\$GLOBALS\["' . $k . '"\] *\.;' ; + $repl3[] = '. _("' . stripN(stripcslashes($v)) . '") .' ; +} + +foreach (new DirectoryIterator('.') as $fileInfo) { + if($fileInfo->isDot()) continue; + $name = $fileInfo->getFilename(); + // process php files + if(!preg_match('/\.php$/' , $name) || + preg_match('/phpVar2getText/', $name)) + continue; + + $orig = file_get_contents($name); + $a = preg_replace($match0, $repl0, $orig, -1, $b); + $a = preg_replace($match1, $repl1, $a, -1, $c); + $a = preg_replace($match2, $repl2, $a, -1, $d); + $a = preg_replace($match3, $repl3, $a, -1, $e); + $tot = $b + $c + $e; + echo $name . ' --- ' . $tot . " (match1: $c)" . "\n"; + if($tot > 0) { + file_put_contents($name . '.save', $orig); + file_put_contents($name, $a); + } +} + + +foreach(array('fr_FR','es_ES','de_DE', 'en_GB') as $i) { + $ii = explode('_', $i); + $f = $ii[0]; $g = $ii[1]; + + // de.inc corrupted the whole process ! + unset($tt_adminstuds_mail_corps_changemail); + // now define each of the strings with a new langague + require_once($mypath . '/lang/' . $f . '.inc'); + $a = ''; + + /* duplicates are fatal to poedit */ + foreach(array_unique($l) as $k => $v) { + /* poedit is strict with its syntax */ + $po_ready_v = stripN(addDQ($v)); + if($f == 'en') + $a .= 'msgid "' . $po_ready_v . '"' . "\n" . + 'msgstr "' . $po_ready_v . '"' . "\n\n"; + else + $a .= 'msgid "' . $po_ready_v . '"' . "\n" . + /* ${$k} the key (var name) in the orig (EN) array + to look for as a raw $var while the .inc is included in the context */ + 'msgstr "' . stripN(addDQ(${$k})) . '"' . "\n\n"; + } + file_put_contents('locale/' . $f . '_' . $g . '/LC_MESSAGES/Studs.po', $header . $a); +} + +?> diff --git a/scripts/recherche_adresse.pl b/scripts/recherche_adresse.pl new file mode 100644 index 0000000..b7cd63c --- /dev/null +++ b/scripts/recherche_adresse.pl @@ -0,0 +1,53 @@ +#/========================================================================== +#/ +#/Université de Strasbourg - Direction Informatique +#/Auteur : Guilhem BORGHESI +#/Création : Février 2008 +#/ +#/borghesi@unistra.fr +#/ +#/Ce logiciel est régi par la licence CeCILL-B soumise au droit français et +#/respectant les principes de diffusion des logiciels libres. Vous pouvez +#/utiliser, modifier et/ou redistribuer ce programme sous les conditions +#/de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +#/sur le site "http://www.cecill.info". +#/ +#/Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +#/pris connaissance de la licence CeCILL-B, et que vous en avez accepté les +#/termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. +#/ +#/========================================================================== +#/ +#/Université de Strasbourg - Direction Informatique +#/Author : Guilhem BORGHESI +#/Creation : Feb 2008 +#/ +#/borghesi@unistra.fr +#/ +#/This software is governed by the CeCILL-B license under French law and +#/abiding by the rules of distribution of free software. You can use, +#/modify and/ or redistribute the software under the terms of the CeCILL-B +#/license as circulated by CEA, CNRS and INRIA at the following URL +#/"http://www.cecill.info". +#/ +#/The fact that you are presently reading this means that you have had +#/knowledge of the CeCILL-B license and that you accept its terms. You can +#/find a copy of this license in the file LICENSE. +#/ +#/========================================================================== + +#!/usr/bin/perl + + +open (FILE,"../admin/logs_studs.txt"); + +while (){ + + /.*\t(.*u-strasbg.fr)\t.*/; + + print $1."\n"; + + +} + + diff --git a/scripts/recherche_adresse_admin.php b/scripts/recherche_adresse_admin.php new file mode 100644 index 0000000..421aa31 --- /dev/null +++ b/scripts/recherche_adresse_admin.php @@ -0,0 +1,57 @@ +mail_admin, "; +// print "$dsondage->mail_admin\n"; + + +} + + +?> diff --git a/sources/sources.php b/sources/sources.php new file mode 100644 index 0000000..74a7587 --- /dev/null +++ b/sources/sources.php @@ -0,0 +1,66 @@ +'."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; +echo 'Sources '.NOMAPPLICATION.''."\n"; +echo ''."\n"; +echo ''."\n"; +echo ''."\n"; + +logo(); +bandeau_tete(); +bandeau_titre(_("Make your polls")); +sous_bandeau(); +echo '
'."\n"; + +// Affichage du bandeau de pied +bandeau_pied(); +echo ''."\n"; +echo ''."\n"; + +?> diff --git a/studs.php b/studs.php new file mode 100644 index 0000000..e96c1c1 --- /dev/null +++ b/studs.php @@ -0,0 +1,604 @@ +is_date) + require_once('exportics.php'); + die(); + } + +// quand on ajoute un commentaire utilisateur +if(isset($_POST['ajoutcomment'])) { + if (isset($_SERVER['REMOTE_USER'])) + $comment_user = $_SESSION['nom']; + elseif(isset($_POST["commentuser"]) && ! empty($_POST["commentuser"])) + $comment_user = $connect->qstr(strip_tags($_POST["commentuser"])); + elseif(isset($_POST["commentuser"])) + $err |= COMMENT_USER_EMPTY; + else + $comment_user = _('anonyme'); + if(empty($_POST["comment"])) + $err |= COMMENT_EMPTY; + + if (isset($_POST["comment"]) && + ! is_error(COMMENT_EMPTY) && ! is_error(NO_POLL) && + ! is_error(COMMENT_USER_EMPTY)) { + if( ! $connect->Execute('INSERT INTO comments ' . + '(id_sondage, comment, usercomment) VALUES ("'. + $numsondage . '","'. + $connect->qstr(strip_tags($_POST['comment'])). + '","' . + $comment_user .'")') ); + $err |= COMMENT_INSERT_FAILED; + } +} + + +// Action quand on clique le bouton participer +$user_studs=$connect->Execute("SELECT * FROM user_studs WHERE id_sondage='$numsondage' ORDER BY id_users"); +$nbcolonnes=substr_count($dsondage->sujet,',')+1; +if ( ! is_error(NO_POLL) && isset($_POST["boutonp"]) ){ + //Si le nom est bien entré + if (! isset($_POST["nom"]) || empty($_POST['nom'])) + $err |= NAME_EMPTY; + if(! is_error(NAME_EMPTY) && + (!isset($_SERVER['REMOTE_USER']) || $_POST["nom"] == $_SESSION["nom"]) ) { + for ($i=0;$i<$nbcolonnes;$i++){ + // Si la checkbox est enclenchée alors la valeur est 1 + if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '1'){ + $nouveauchoix.="1"; + } + // sinon c'est 0 + else { + $nouveauchoix.="0"; + } + } + + while($user = $user_studs->FetchNextObject(false)) { + if ($_POST["nom"]==$user->nom) + $err |= NAME_TAKEN; + } + + // Ecriture des choix de l'utilisateur dans la base + if (! is_error(NAME_TAKEN) && ! is_error(NAME_EMPTY)) { + // TODO: throw error + $nom=substr($_POST["nom"],0,64); + $connect->Execute('INSERT INTO user_studs (nom,id_sondage,reponses) VALUES ("' . + $nom . '","' . + $numsondage . '","' . + $nouveauchoix . '")'); + + if ($dsondage->mailsonde || + /* compatibility for non boolean DB */ + $dsondage->mailsonde=="yes" || $dsondage->mailsonde=="true") { + + $headers="From: ".NOMAPPLICATION." <".ADRESSEMAILADMIN.">\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; + mail ("$dsondage->mail_admin", + "[".NOMAPPLICATION."] "._("Poll's participation")." : $dsondage->titre", + + "\"$nom\" ". + _("has filled a line.\nYou can find your poll at the link") . " :\n\n". + get_server_name()."/studs.php?sondage=$numsondage \n\n" . + _("Thanks for your confidence.") . "\n". NOMAPPLICATION, + $headers); + } + } + } + else + $err |= NAME_EMPTY; +} + +print_header(true); +echo ''."\n"; +logo(); +bandeau_tete(); +bandeau_titre(_("Make your polls")); +sous_bandeau(); + +if($err != 0) { + bandeau_titre(_("Error!")); + + echo '
    '."\n"; + if(is_error(NAME_EMPTY)) + echo '
  • ' . _("Enter a name !") . "
  • \n"; + if(is_error(NAME_TAKEN)) + echo '
  • ' . + _("The name you've chosen already exist in this poll!") . + "
  • \n"; + if(is_error(COMMENT_EMPTY) || is_error(COMMENT_USER_EMPTY)) + echo '
  • ' . + _("Enter a name and a comment!") . + "
  • \n"; + if(is_error(COMMENT_INSERT_FAILED) ) + echo '
  • ' . + _("Failed to insert the comment!") . + "
  • \n"; + + echo '
'; + + if(is_error(NO_POLL_ID) || is_error(NO_POLL)) { + echo '
'."\n"; + print "

" . _("This poll doesn't exist !") . "

"."\n"; + print _("Back to the homepage of") . ' '. NOMAPPLICATION . + '.'."\n"; + echo '



'."\n"; + echo '
'."\n"; + bandeau_pied(); + + echo ''."\n"; + echo ''."\n"; + die(); + } + } + +echo '
'."\n"; + +//affichage du titre du sondage + $titre=str_replace("\\","",$dsondage->titre); + echo '

'.$titre.'

'."\n"; + +//affichage du nom de l'auteur du sondage +echo _("Initiator of the poll") .' : '.$dsondage->nom_admin.'

'."\n"; + +//affichage des commentaires du sondage + if ($dsondage->commentaires){ + echo _("Comments") .' :
'."\n"; + $commentaires=$dsondage->commentaires; + $commentaires=str_replace("\\","",$commentaires); + echo $commentaires; + + echo '
'."\n"; + } + echo '
'."\n"; +echo '
'."\n"; + +echo '
'."\n"; + +echo ''; + + echo '
'."\n"; + + echo _("If you want to vote in this poll, you have to give your name, choose the values that fit best for you
(without paying attention to the choices of the other voters) and validate with the plus button at the end of the line.") ."\n"; + + echo '

'."\n"; + +// Debut de l'affichage des resultats du sondage + echo ''."\n"; + +//On récupere les données et les sujets du sondage + $nblignes=$user_studs->RecordCount(); + + + //on teste pour voir si une ligne doit etre modifiée +$testmodifier = false; +$ligneamodifier = -1; + for ($i=0;$i<$nblignes;$i++){ + if (isset($_POST["modifierligne$i"]) || isset($_POST['modifierligne'.$i.'_x'])){ + $ligneamodifier=$i; + } + //test pour voir si une ligne est a modifier + if ($_POST['validermodifier'.$i.'_x']){ + $modifier=$i; + $testmodifier=true; + } + } + //si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs + if ($testmodifier){ + + for ($i=0;$i<$nbcolonnes;$i++){ + //recuperation des nouveaux choix de l'utilisateur + if (isset($_POST["choix$i"]) && $_POST["choix$i"] == 1){ + $nouveauchoix.="1"; + } + else { + $nouveauchoix.="0"; + } + } + + $compteur=0; + while ($data=$user_studs->FetchNextObject(false) ) { + //mise a jour des données de l'utilisateur dans la base SQL + if ($compteur==$modifier){ + $connect->Execute("UPDATE user_studs SET reponses='$nouveauchoix' WHERE nom='$data->nom' AND id_users='$data->id_users'"); + if ($dsondage->mailsonde=="yes"){ + + $headers="From: ".NOMAPPLICATION." <".ADRESSEMAILADMIN.">\r\nContent-Type: text/plain; charset=\"UTF-8\"\nContent-Transfer-Encoding: 8bit"; + mail ("$dsondage->mail_admin", "[".NOMAPPLICATION."] " . _("Poll's participation") . " : $dsondage->titre", "\"$data->nom\""."" . _("has filled a line.\nYou can find your poll at the link") . " :\n\n".get_server_name()."/studs.php?sondage=$numsondage \n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION,$headers); + } + } + $compteur++; + } + } + +//recuperation des utilisateurs du sondage + $user_studs=$connect->Execute("SELECT * FROM user_studs WHERE id_sondage='$numsondage' ORDER BY id_users"); + + +//reformatage des données des sujets du sondage + $toutsujet=explode(",",$dsondage->sujet); + +//si le sondage est un sondage de date +if ($dsondage->format=="D"||$dsondage->format=="D+"){ + +//affichage des sujets du sondage + echo ''."\n"; + echo ''."\n"; + + //affichage des années + $colspan=1; + for ($i=0;$i'.date('Y', intval($toutsujet[$i])).''."\n"; + $colspan=1; + } + } + echo ''."\n"; + + echo ''."\n"; + echo ''."\n"; + //affichage des mois + $colspan=1; + for ($i=0;$i'.date("F",$cur).''."\n"; + else + echo ''."\n"; + $colspan=1; + } + } + echo ''."\n"; + + echo ''."\n"; + echo ''."\n"; + //affichage des jours + $colspan=1; + for ($i=0;$i'.date("D jS",$cur).''."\n"; + else + echo ''."\n"; + $colspan=1; + } + } + echo ''."\n"; + //affichage des horaires + if (strpos($dsondage->sujet, '@') !== false){ + echo ''."\n"; + echo ''."\n"; + + for ($i=0;$toutsujet[$i];$i++){ + $heures=explode("@",$toutsujet[$i]); + echo ''."\n"; + } + echo ''."\n"; + } +} + +else { + $toutsujet=str_replace("°","'",$toutsujet); + +//affichage des sujets du sondage + echo ''."\n"; + echo ''."\n"; + + for ($i=0;$toutsujet[$i];$i++){ + + echo ''."\n"; + } + echo ''."\n"; + +} + +//Usager pré-authentifié dans la liste? + $user_mod = FALSE; +//affichage des resultats actuels +$somme = array(); + $compteur = 0; + + while ($data=$user_studs->FetchNextObject(false)) { + + echo ''."\n"; + echo ''."\n"; +// Les réponses qu'il a choisit + $ensemblereponses=$data->reponses; +// ligne d'un usager pré-authentifié + $mod_ok = !isset($_SERVER['REMOTE_USER']) || ($nombase == $_SESSION['nom']); + $user_mod |= $mod_ok; + // pour chaque colonne + for ($k=0; $k < $nbcolonnes; $k++){ + // on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs + if ($compteur == $ligneamodifier) { + echo ''."\n"; + } + else { + $car=substr($ensemblereponses,$k,1); + if ($car=="1"){ + echo ''."\n"; + $somme[$k]++; + } + else { + echo ''."\n"; + } + } + } + + //a la fin de chaque ligne se trouve les boutons modifier + if ($compteur != $ligneamodifier && ($dsondage->format=="A+"||$dsondage->format=="D+") && $mod_ok){ + echo ''."\n"; + } + + //demande de confirmation pour modification de ligne + for ($i=0;$i<$nblignes;$i++){ + if (isset($_POST["modifierligne$i"])||isset($_POST['modifierligne'.$i.'_x'])){ + if ($compteur==$i){ + echo ''."\n"; + } + } + } + $compteur++; + echo ''."\n"; + } + +// affichage de la ligne pour un nouvel utilisateur + if (!isset($_SERVER['REMOTE_USER']) || !$user_mod) { + echo ''."\n"; + echo ''."\n"; + +// affichage des cases de formulaire checkbox pour un nouveau choix + for ($i=0;$i<$nbcolonnes;$i++){ + echo ''."\n"; + } + // Affichage du bouton de formulaire pour inscrire un nouvel utilisateur dans la base + echo ''."\n"; + echo ''."\n"; + } + +//determination de la meilleure date + +// On cherche la meilleure colonne + for ($i=0;$i<$nbcolonnes;$i++){ + if ($i=="0"){ + $meilleurecolonne=$somme[$i]; + } + if ($somme[$i]>$meilleurecolonne){ + $meilleurecolonne=$somme[$i]; + } + } + +// Affichage des différentes sommes des colonnes existantes + echo ''."\n"; + echo ''."\n"; + + for ($i=0;$i<$nbcolonnes;$i++){ + $affichesomme=$somme[$i]; + if ($affichesomme==""){$affichesomme="0";} + echo ''."\n"; + } + echo ''."\n"; + + echo ''."\n"; + echo ''."\n"; + for ($i=0;$i<$nbcolonnes;$i++){ + if ($somme[$i]==$meilleurecolonne&&$somme[$i]){ + echo ''."\n"; + } + else { + echo ''."\n"; + } + + } + echo ''."\n"; + + echo '
'.strftime("%B",$cur).'
'.strftime("%a %e",$cur).'
'.$heures[1].'
'.$toutsujet[$i].'
'; + +// Le nom de l'utilisateur + $nombase=str_replace("°","'",$data->nom); + echo $nombase.'OK
'."\n"; + if (isset($_SERVER['REMOTE_USER'])) + echo ''.$_SESSION['nom']."\n"; + else + echo ''."\n"; + echo '
'. _("Addition") .''.$affichesomme.'
' . _('Best choice') . '
'."\n"; + echo '
'."\n"; + +// reformatage des données de la base pour les sujets + $toutsujet=explode(",",$dsondage->sujet); + $toutsujet=str_replace("°","'",$toutsujet); + +// On compare le nombre de résultat avec le meilleur et si le résultat est égal +// on concatene le resultat dans $meilleursujet + + $compteursujet=0; + for ($i=0;$i<$nbcolonnes;$i++){ + if ($somme[$i]==$meilleurecolonne){ + $meilleursujet.=", "; + if ($dsondage->format=="D"||$dsondage->format=="D+"){ + $meilleursujetexport=$toutsujet[$i]; + if (strpos($toutsujet[$i],'@') !== false){ + $toutsujetdate=explode("@",$toutsujet[$i]); + if ($_SESSION["langue"]=="EN") + $meilleursujet.=date("l, F jS Y",$toutsujetdate[0])." " . _("for") ." ".$toutsujetdate[1]; + else + $meilleursujet.=strftime(_("%A, den %e. %B %Y"),$toutsujetdate[0]). ' ' . _("for") . ' ' . $toutsujetdate[1]; + } + else { + if ($_SESSION["langue"]=="EN") + $meilleursujet.=date("l, F jS Y",$toutsujet[$i]); + else + $meilleursujet.=strftime(_("%A, den %e. %B %Y"),$toutsujet[$i]); + } + } + else + $meilleursujet.=$toutsujet[$i]; + + $compteursujet++; + } + } + $meilleursujet=substr("$meilleursujet",1); + +$vote_str = _('vote'); +if ($meilleurecolonne > 1) + $vote_str = _('votes'); + + echo '

'."\n"; + + // Affichage du meilleur choix + if ($compteursujet=="1"&&$meilleurecolonne){ + print 'Meilleur choix ' . _('The best choice at this time is:') . "$meilleursujet " . _('with') . " $meilleurecolonne " . $vote_str . ".\n"; + } + elseif ($meilleurecolonne){ + print 'Meilleur choix ' . _('The bests choices at this time are:') . " $meilleursujet " . _('with') . " $meilleurecolonne " . $vote_str . ".\n"; + } + + echo '

'; + + //affichage des commentaires des utilisateurs existants + $comment_user=$connect->Execute("select * from comments where id_sondage='$numsondage' order by id_comment"); + if ($comment_user->RecordCount() != 0) { + + print "
" . _("Comments of polled people") . " :
\n"; + while( $dcomment=$comment_user->FetchNextObject(false)) { + print $dcomment->usercomment . ' : ' . $dcomment->comment . '
'; + } + + } + + //affichage de la case permettant de rajouter un commentaire par les utilisateurs + print '
' . + '

' ._("Add a comment in the poll:") . '

' . "\n"; + +if (isset($_SERVER['REMOTE_USER']) || isset($_SESSION['nom'])) { + echo _("Name") .' : '; + echo '
'."\n"; +} +echo ''."\n"; +echo '
'."\n"; +echo ''."\n"; +// Focus javascript sur la case de texte du formulaire +echo ''."\n"; + +echo '
'."\n"; + +echo ''; +echo ''."\n"; + + bandeau_pied_mobile(); + // Affichage du bandeau de pied + echo ''."\n"; + echo ''."\n"; + +?> diff --git a/style.css b/style.css new file mode 100644 index 0000000..e7fe05d --- /dev/null +++ b/style.css @@ -0,0 +1,433 @@ +/* +========================================================================== + +Université de Strasbourg - Direction Informatique +Auteur : Guilhem BORGHESI +Création : Février 2008 + +borghesi@unistra.fr + +Ce logiciel est régi par la licence CeCILL-B soumise au droit français et +respectant les principes de diffusion des logiciels libres. Vous pouvez +utiliser, modifier et/ou redistribuer ce programme sous les conditions +de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +sur le site "http://www.cecill.info". + +Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +pris connaissance de la licence CeCILL-B, et que vous en avez accepté les +termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. + +========================================================================== + +Université de Strasbourg - Direction Informatique +Author : Guilhem BORGHESI +Creation : Feb 2008 + +borghesi@unistra.fr + +This software is governed by the CeCILL-B license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL-B +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL-B license and that you accept its terms. You can +find a copy of this license in the file LICENSE. + +========================================================================== +*/ + +/* +Le fichier style.css est le fichier de style de studs. Il se trouve à la racine +du répertoire studs. Il contient toutes les mises en forme des fichiers PHP +de Studs. +*/ +/*bandeau de titre*/ +div.bandeau{ + line-height:35px; + text-align:center; + background-color: #0b419b; + color:white; + vertical-align:middle; + font-size:35px; + font-family:arial; + padding:8px; + height:35px; + position:static; + top:6px; + left:6px; + right:6px; + +} +div.logo{ + height:64px; + float:right; + top:8px; + right:8px; + margin-left: 0; + margin-right:0; + margin-bottom:auto; +} +/*Sous bandeau avec bouton de navigation*/ +div.bandeautitre{ + height:17px; + background-color: #0077DD; + font-size:14px; + font-weight:bold; + text-align:center; + color:white; + vertical-align:middle; + font-family:arial; + padding:3px; + position:static; + top:57px; + left:6px; + right:6px; +} +div.sousbandeau{ + height:17px; + background-color: #DDDDDD; + font-size:11px; + color:black; + vertical-align:middle; + font-family:arial; + padding:3px; + position:static; + top:80px; + left:6px; + right:6px; +} +/*bandeau de pied*/ +div.surbandeaupied{ + background-color: #0077DD; + position:absolute; + bottom:30px; + left:6px; + right:6px; + height:6px; +} +div.bandeaupied{ + text-align:center; + background-color: #0b419b; + color:white; + font-size:11px; + font-family:arial; + padding:6px; + position:fixed; + bottom:6px; + left:6px; + right:6px; + margin:2px; +} +div.surbandeaupiedmobile{ + background-color: #0077DD; + position:static; + bottom:32px; + left:6px; + right:6px; + height:6px; +} +div.bandeaupiedmobile{ + text-align:center; + background-color: #0b419b; + color:white; + font-size:11px; + font-family:arial; + padding:6px; + position:static; +} +/*les boutons se trouvant dans le sousbandeau*/ +div.sousbandeau a, div.sousbandeau span.sousbandeaulangue a { + background-color: #0b419b; + height:16px; + padding: 2px 6px 2px 6px; + vertical-align:middle; + text-align:center; + margin-left:10px; + margin-right:10px; + font-family:arial; + color:white; + font-size:10px; + text-decoration:none; +} +span.sousbandeaulangue { + margin-left:6px; + margin-right:6px; + float:right; +} +/*corps de la page index.php*/ +div.corps{ + font-size:12px; + font-family:arial; + position:static; + top:170px; + left:20px; + right:20px; + padding:30px; +} +div.corps table{ + font-family:arial; + font-size:12px; + font-weight:bold; +} +div.corpscentre{ + font-size:12px; + font-family:arial; + text-align:center; + position:absolute; + top:150px; + margin-right:10%; + margin-left:10%; + width:80%; +} +/*affichage des jours*/ +div.jourschoisis { + background-color: #DDD; + padding:10px; + text-align: center; + position:static; + left:700px; + top:170px; + font-size:12px; + width:100%; +} +/*presenation des pages*/ +div.bodydate { + padding:10px; + font-family:arial; + font-size:12px; + text-align:center; + position:static; + top:330px; + left:20px; + right:20px; +} +div.bodydate table{ + font-family:arial; + font-size:12px; + font-weight:bold; +} +/*cadre de commentaires*/ +div.presentationdate { + width:40%; + font-family:arial; + text-align:center; + font-size:12px; + border-width:1px; + border-style:solid; + border-color:#969696; + position:static; + top:110px; + right:1px; + left:1px; + margin-top:10px; + margin-left:30%; + margin-right: 30%; +} +div.presentationdatefin { + width:40%; + padding:10px; + font-family:arial; + text-align:center; + font-size:12px; + border-width:1px; + border-style:solid; + margin-top: 10px; + margin-left: 30%; + margin-right: 30%; + position:static; +} +/*cadre principal de studs.php*/ +div.cadre { + padding:10px; + font-family:arial; + font-size:12px; + position:static; + top:235px; + text-align:center; + margin:0 auto; +} +/*la table des résultats dans l'affichage de sondage*/ +div.cadre table.resultats { + background-color: white; + text-align: center; + margin:0 auto; +} + +div.cadre td { + height:21px; +} +/*case de tableau OK dans affichage de sondage*/ +div.cadre td.ok { + background-color: #66FF99; + font-size:12px; + text-align:center; +} +/*Case de tableau NON dans affichage de sondage*/ +div.cadre td.non { + background-color: #FF7777; + width:35px; +} +/*Case de tableau VIDE dans affichage de sondage*/ +div.cadre td.vide { + background-color: #DDDDDD; + text-align:center; +} +/*Case de tableau contenant les noms dans affichage de sondage*/ +div.cadre td.nom { + background-color: #DDDDDD; + font-size:12px; + text-align:center; +} +div.cadre td.casevide { + background-color: white; + text-align:center; +} +/*les cases contenant les sommes de chaque colonne dans l'affichage de calendrier*/ +div.cadre td.somme { + background-color: white; + font-weight: bold; + font-size:14px; +} + +/*Case de tableau SUJET dans affichage de sondage*/ +div.cadre td.sujet, div.cadre td.jour, div.cadre td.heure { + border: 2px; + background-color: #DDDDDD; + font-weight: bold; + font-size:14px; + padding:1px 5px; +} + +div.cadre td.annee { + border: 2px; + background-color: #969696; + font-weight: bold; + font-size:14px; + padding:1px 5px; +} +div.cadre td.mois { + border: 2px; + background-color: #C0C0C0; + font-weight: bold; + font-size:14px; + padding:1px 5px; +} + +/*affichage du calendrier*/ +div.calendrier { + padding:10px; + background-color: #AAA; + width:490px; + font-size:12px; + font-family:arial; + margin-left: 30%; + margin-right: 30%; + position:static; +} +/*jour de la semaine dans calendrier*/ +div.calendrier td.joursemaine { + width:65px; + text-align: center; + font-family:arial; + font-size:14px; + border: 2px; + background-color: white; +} +div.calendrier td.jourwe { + width:65px; + text-align: center; + font-family:arial; + font-size:14px; + border: 2px; + background-color: #C0C0C0; +} +/*jour avant le premier jour du mois dans calendrier*/ +div.calendrier td.avant { + width:65px; + text-align: center; + border: 2px; + font-family:arial; + font-size:13px; + background-color: #DDDDDD; +} +/*jour libre dans calendrier*/ +div.calendrier td.libre { + width:65px; + text-align: center; + border: 2px; + background-color: #66FF99; +} +/*jour deja selectionné dans calendrier*/ +div.calendrier td.choisi { + width:65px; + text-align: center; + border: 2px; + background-color: #0077DD; +} +/* Le paragraphe de fin */ +p.affichageresultats{ + text-align: center; + font-family:arial; + font-size:13px; +} + +a.affichageexport{ + text-align: center; + font-family:arial; + font-size:10px; + margin-left:10px; + text-decoration: none; +} +div.titregestionadmin{ + text-align: center; + font-weight:bold; + font-size:18px; + padding:10px; +} + + +.bouton { + width: 65px; + border:0px; + padding:0px 0 0 0; + margin:0px; + cursor:pointer; + font-family:arial; + font-size:13px; +} +/*les boutons pour choisir un jour non selectionné*/ +.ON { + background-color: #66FF99; +} + +/*les boutons pour deselectionner un jour deja choisi*/ +.OFF { + background-color: #0077DD; +} + +div.nouveau_sondage a { + text-decoration: none; +} +div.nouveau_sondage span img { + vertical-align: middle; + border: 0px; +} +div.nouveau_sondage span { + margin-left: 20px; +} + +div.error, div.addcomment { + text-align:center; + border: 1px; + font-family: arial; + font-size: 13px; +} +ul.exports { + text-align:center; + list-style-type : none ; +} +li.error { + color: red; +} diff --git a/variables.php.template b/variables.php.template new file mode 100644 index 0000000..6cbc8ec --- /dev/null +++ b/variables.php.template @@ -0,0 +1,91 @@ +"); + +// adresse mail de l'administrateur de la base +define('ADRESSEMAILADMIN', ''); + +// nom de la base de donnees +define('BASE', ''); + +// nom de l'utilisateur de la base +define('USERBASE', ""); + +// passwd de l'utilisateur de la base +define('USERPASSWD', ''); + +// nom du serveur de base de donnees, laisser vide pour utiliser un socket +define('SERVEURBASE', ''); + +// Type de base de données à utiliser (mysql, postgres, ...) +// http://phplens.com/lens/adodb/docs-adodb.htm#drivers +define('BASE_TYPE', ''); + +// Langue par défaut de l'application (à choisir dans $ALLOWED_LANGUAGES) +define('LANGUE', 'fr_FR'); + +// Nom et emplacement du logo +define('LOGOBANDEAU', ''); + +// Nom et emplacement du logo de la lettre générée en PDF +define('LOGOLETTRE', ''); + +if (@file_exists('variables.local.php')) { + include('variables.local.php'); +} + +// Studs version +define('STUDS_VERSION', '0.6.6'); + +// Do not edit the following +$ALLOWED_LANGUAGES = array('fr_FR' => 'french', + 'en_GB' => 'english', + 'es_ES' => 'spanish', + 'de_DE' => 'german' ); + +?>