Subversion Repositories Applications.gtt

Compare Revisions

Ignore whitespace Rev 149 → Rev 161

/tags/v1.1-thales/documentation/gtt_installation.sql
New file
0,0 → 1,190
-- phpMyAdmin SQL Dump
-- version 2.11.4
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mar 17 Juin 2008 à 18:14
-- Version du serveur: 5.0.51
-- Version de PHP: 5.2.5
 
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
--
-- Base de données: `gtt_v4`
--
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_absence`
--
 
CREATE TABLE IF NOT EXISTS `gestion_absence` (
`ga_id_utilisateur` int(11) unsigned NOT NULL,
`ga_id_absence_motif` tinyint(3) unsigned NOT NULL,
`ga_id_date_absence` date NOT NULL default '0000-00-00',
`ga_duree` float NOT NULL default '0',
PRIMARY KEY (`ga_id_utilisateur`,`ga_id_absence_motif`,`ga_id_date_absence`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
--
-- Contenu de la table `gestion_absence`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_absence_motif`
--
 
CREATE TABLE IF NOT EXISTS `gestion_absence_motif` (
`gam_id_absence_motif` tinyint(3) unsigned NOT NULL auto_increment,
`gam_libelle` varchar(255) collate utf8_unicode_ci NOT NULL,
`gam_mark_cp_diminuer` tinyint(1) NOT NULL,
`gam_mark_hs_diminuer` tinyint(1) NOT NULL,
PRIMARY KEY (`gam_id_absence_motif`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
 
--
-- Contenu de la table `gestion_absence_motif`
--
 
INSERT INTO `gestion_absence_motif` (`gam_id_absence_motif`, `gam_libelle`, `gam_mark_cp_diminuer`, `gam_mark_hs_diminuer`) VALUES
(1, 'Congés payés', 1, 0),
(2, 'Récupération', 0, 1),
(3, 'Maladie', 0, 0);
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_projet`
--
 
CREATE TABLE IF NOT EXISTS `gestion_projet` (
`gp_id_projet` int(11) unsigned NOT NULL auto_increment,
`gp_ce_projet_parent` int(11) NOT NULL default '0',
`gp_ce_categorie` int(11) unsigned NOT NULL default '0',
`gp_nom` varchar(255) collate utf8_unicode_ci NOT NULL,
`gp_description` text collate utf8_unicode_ci,
`gp_date_debut` date default '0000-00-00',
`gp_date_fin` date NOT NULL default '0000-00-00',
`gp_duree_prevue` float default '0',
`gp_avancement` int(11) default '0',
PRIMARY KEY (`gp_id_projet`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
 
--
-- Contenu de la table `gestion_projet`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_projet_categorie`
--
 
CREATE TABLE IF NOT EXISTS `gestion_projet_categorie` (
`gpc_id_categorie` int(11) unsigned NOT NULL auto_increment,
`gpc_libelle` varchar(255) collate utf8_unicode_ci NOT NULL,
`gpc_abreviation` varchar(25) collate utf8_unicode_ci default NULL,
PRIMARY KEY (`gpc_id_categorie`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
 
--
-- Contenu de la table `gestion_projet_categorie`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_travail_projet`
--
 
CREATE TABLE IF NOT EXISTS `gestion_travail_projet` (
`gtp_id_utilisateur` int(11) unsigned NOT NULL,
`gtp_id_projet` int(11) unsigned NOT NULL,
`gtp_id_date_travail` date NOT NULL default '0000-00-00',
`gtp_duree` float NOT NULL default '0',
PRIMARY KEY (`gtp_id_utilisateur`,`gtp_id_projet`,`gtp_id_date_travail`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
--
-- Contenu de la table `gestion_travail_projet`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_utilisateur`
--
 
CREATE TABLE IF NOT EXISTS `gestion_utilisateur` (
`gu_id_utilisateur` int(11) unsigned NOT NULL auto_increment,
`gu_ce_statut` tinyint(3) unsigned NOT NULL,
`gu_nom` varchar(100) collate utf8_unicode_ci NOT NULL,
`gu_prenom` varchar(100) collate utf8_unicode_ci NOT NULL,
`gu_password` varchar(32) collate utf8_unicode_ci NOT NULL,
`gu_email` varchar(255) collate utf8_unicode_ci NOT NULL,
`gu_telephone` varchar(25) collate utf8_unicode_ci default NULL,
`gu_adresse` varchar(255) collate utf8_unicode_ci default NULL,
`gu_code_postal` varchar(6) collate utf8_unicode_ci default NULL,
`gu_ville` varchar(50) collate utf8_unicode_ci default NULL,
`gu_quota_heures_supp` float default NULL,
`gu_conges_payes` float default NULL,
`gu_temps_de_travail_jour` float default NULL,
`gu_temps_de_travail_mois` float default NULL,
`gu_mark_admin` tinyint(1) default NULL,
`gu_mark_recapitulatif` tinyint(1) default NULL,
`gu_notes` text collate utf8_unicode_ci,
PRIMARY KEY (`gu_id_utilisateur`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
 
--
-- Contenu de la table `gestion_utilisateur`
--
 
INSERT INTO `gestion_utilisateur` (`gu_id_utilisateur`, `gu_ce_statut`, `gu_nom`, `gu_prenom`, `gu_password`, `gu_email`, `gu_telephone`, `gu_adresse`, `gu_code_postal`, `gu_ville`, `gu_quota_heures_supp`, `gu_conges_payes`, `gu_temps_de_travail_jour`, `gu_temps_de_travail_mois`, `gu_mark_admin`, `gu_mark_recapitulatif`, `gu_notes`) VALUES
(1, 0, 'DÉMONSTRATION', 'Démo', 'c94a22169d9050aa369648f7bdbe144a', 'demo', '', '', '', '', 0, 0, 7, 0, 1, 0, NULL);
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_utilisateur_a_projet`
--
 
CREATE TABLE IF NOT EXISTS `gestion_utilisateur_a_projet` (
`guap_id_utilisateur` int(11) unsigned NOT NULL,
`guap_id_projet` int(11) unsigned NOT NULL,
PRIMARY KEY (`guap_id_utilisateur`,`guap_id_projet`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
--
-- Contenu de la table `gestion_utilisateur_a_projet`
--
 
 
-- --------------------------------------------------------
 
--
-- Structure de la table `gestion_utilisateur_statut`
--
 
CREATE TABLE IF NOT EXISTS `gestion_utilisateur_statut` (
`gus_id_utilisateur_statut` tinyint(3) unsigned NOT NULL auto_increment,
`gus_libelle` varchar(255) collate utf8_unicode_ci NOT NULL,
`gus_mark_recapitulatif` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`gus_id_utilisateur_statut`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
 
--
-- Contenu de la table `gestion_utilisateur_statut`
--
 
INSERT INTO `gestion_utilisateur_statut` (`gus_id_utilisateur_statut`, `gus_libelle`, `gus_mark_recapitulatif`) VALUES
(1, 'Salarié', 1),
(2, 'Président', 0),
(3, 'Stagiaire', 0);
/tags/v1.1-thales/documentation/gtt_maj_001.sql
New file
0,0 → 1,9
ALTER TABLE `gestion_projet` ADD `gp_duree_finance` FLOAT NOT NULL AFTER `gp_duree_prevue` ;
 
ALTER TABLE `gestion_utilisateur` ADD `gu_tdt_lundi` FLOAT NOT NULL DEFAULT '0' AFTER `gu_temps_de_travail_mois` ,
ADD `gu_tdt_mardi` FLOAT NOT NULL DEFAULT '0' AFTER `gu_tdt_lundi` ,
ADD `gu_tdt_mercredi` FLOAT NOT NULL DEFAULT '0' AFTER `gu_tdt_mardi` ,
ADD `gu_tdt_jeudi` FLOAT NOT NULL DEFAULT '0' AFTER `gu_tdt_mercredi` ,
ADD `gu_tdt_vendredi` FLOAT NOT NULL DEFAULT '0' AFTER `gu_tdt_jeudi` ,
ADD `gu_tdt_samedi` FLOAT NOT NULL DEFAULT '0' AFTER `gu_tdt_vendredi` ,
ADD `gu_tdt_dimanche` FLOAT NOT NULL DEFAULT '0' AFTER `gu_tdt_samedi` ;
/tags/v1.1-thales/documentation/gtt_v4.xml
New file
0,0 → 1,860
<?xml version="1.0" standalone="yes" ?>
<DBMODEL Version="4.0">
<SETTINGS>
<GLOBALSETTINGS ModelName="model_reverse_engineered" IDModel="0" IDVersion="0" VersionStr="1.0.0.0" Comments="" UseVersionHistroy="1" AutoIncVersion="1" DatabaseType="MySQL" ZoomFac="100.00" XPos="0" YPos="0" DefaultDataType="5" DefaultTablePrefix="0" DefSaveDBConn="" DefSyncDBConn="Gestion v4" DefQueryDBConn="" Printer="" HPageCount="4.0" PageAspectRatio="1.440892512336408" PageOrientation="1" PageFormat="A4 (210x297 mm, 8.26x11.7 inches)" SelectedPages="" UsePositionGrid="0" PositionGridX="20" PositionGridY="20" TableNameInRefs="0" DefaultTableType="0" ActivateRefDefForNewRelations="1" FKPrefix="" FKPostfix="" CreateFKRefDefIndex="0" DBQuoteCharacter="`" CreateSQLforLinkedObjects="0" DefModelFont="Nimbus Sans L" CanvasWidth="4096" CanvasHeight="2842" />
<DATATYPEGROUPS>
<DATATYPEGROUP Name="Numeric Types" Icon="1" />
<DATATYPEGROUP Name="Date and Time Types" Icon="2" />
<DATATYPEGROUP Name="String Types" Icon="3" />
<DATATYPEGROUP Name="Blob and Text Types" Icon="4" />
<DATATYPEGROUP Name="User defined Types" Icon="5" />
<DATATYPEGROUP Name="Geographic Types" Icon="6" />
</DATATYPEGROUPS>
<DATATYPES>
<DATATYPE ID="1" IDGroup="0" TypeName="TINYINT" Description="A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="2" IDGroup="0" TypeName="SMALLINT" Description="A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="3" IDGroup="0" TypeName="MEDIUMINT" Description="A medium-size integer. The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="4" IDGroup="0" TypeName="INT" Description="A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="1" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="0" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="5" IDGroup="0" TypeName="INTEGER" Description="A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="1" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="6" IDGroup="0" TypeName="BIGINT" Description="A large integer. The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="0" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="7" IDGroup="0" TypeName="FLOAT" Description="A small (single-precision) floating-point number. Cannot be unsigned. Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38." ParamCount="1" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="precision" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="8" IDGroup="0" TypeName="FLOAT" Description="A small (single-precision) floating-point number. Cannot be unsigned. Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="9" IDGroup="0" TypeName="DOUBLE" Description="A normal-size (double-precision) floating-point number. Cannot be unsigned. Allowable values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and 2.2250738585072014E-308 to 1.7976931348623157E+308." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="2" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="10" IDGroup="0" TypeName="DOUBLE PRECISION" Description="This is a synonym for DOUBLE." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="2" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="11" IDGroup="0" TypeName="REAL" Description="This is a synonym for DOUBLE." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="2" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="12" IDGroup="0" TypeName="DECIMAL" Description="An unpacked floating-point number. Cannot be unsigned. Behaves like a CHAR column." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="3" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="13" IDGroup="0" TypeName="NUMERIC" Description="This is a synonym for DECIMAL." ParamCount="2" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="3" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="14" IDGroup="1" TypeName="DATE" Description="A date. The supported range is \a1000-01-01\a to \a9999-12-31\a." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="15" IDGroup="1" TypeName="DATETIME" Description="A date and time combination. The supported range is \a1000-01-01 00:00:00\a to \a9999-12-31 23:59:59\a." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="16" IDGroup="1" TypeName="TIMESTAMP" Description="A timestamp. The range is \a1970-01-01 00:00:00\a to sometime in the year 2037. The length can be 14 (or missing), 12, 10, 8, 6, 4, or 2 representing YYYYMMDDHHMMSS, ... , YYYYMMDD, ... , YY formats." ParamCount="1" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="17" IDGroup="1" TypeName="TIME" Description="A time. The range is \a-838:59:59\a to \a838:59:59\a." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="18" IDGroup="1" TypeName="YEAR" Description="A year in 2- or 4-digit format (default is 4-digit)." ParamCount="1" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="19" IDGroup="2" TypeName="CHAR" Description="A fixed-length string (1 to 255 characters) that is always right-padded with spaces to the specified length when stored. values are sorted and compared in case-insensitive fashion according to the default character set unless the BINARY keyword is given." ParamCount="1" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="20" IDGroup="2" TypeName="VARCHAR" Description="A variable-length string (1 to 255 characters). Values are sorted and compared in case-sensitive fashion unless the BINARY keyword is given." ParamCount="1" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="21" IDGroup="2" TypeName="BIT" Description="This is a synonym for CHAR(1)." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="22" IDGroup="2" TypeName="BOOL" Description="This is a synonym for CHAR(1)." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="23" IDGroup="3" TypeName="TINYBLOB" Description="A column maximum length of 255 (2^8 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="24" IDGroup="3" TypeName="BLOB" Description="A column maximum length of 65535 (2^16 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="25" IDGroup="3" TypeName="MEDIUMBLOB" Description="A column maximum length of 16777215 (2^24 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="26" IDGroup="3" TypeName="LONGBLOB" Description="A column maximum length of 4294967295 (2^32 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="27" IDGroup="3" TypeName="TINYTEXT" Description="A column maximum length of 255 (2^8 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="28" IDGroup="3" TypeName="TEXT" Description="A column maximum length of 65535 (2^16 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="29" IDGroup="3" TypeName="MEDIUMTEXT" Description="A column maximum length of 16777215 (2^24 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="30" IDGroup="3" TypeName="LONGTEXT" Description="A column maximum length of 4294967295 (2^32 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="31" IDGroup="3" TypeName="ENUM" Description="An enumeration. A string object that can have only one value, chosen from the list of values." ParamCount="1" OptionCount="0" ParamRequired="1" EditParamsAsString="1" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="values" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="32" IDGroup="3" TypeName="SET" Description="A set. A string object that can have zero or more values, each of which must be chosen from the list of values." ParamCount="1" OptionCount="0" ParamRequired="1" EditParamsAsString="1" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="values" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="33" IDGroup="4" TypeName="Varchar(20)" Description="" ParamCount="0" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="34" IDGroup="4" TypeName="Varchar(45)" Description="" ParamCount="0" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="35" IDGroup="4" TypeName="Varchar(255)" Description="" ParamCount="0" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="36" IDGroup="5" TypeName="GEOMETRY" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="38" IDGroup="5" TypeName="LINESTRING" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="39" IDGroup="5" TypeName="POLYGON" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="40" IDGroup="5" TypeName="MULTIPOINT" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="41" IDGroup="5" TypeName="MULTILINESTRING" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="42" IDGroup="5" TypeName="MULTIPOLYGON" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="43" IDGroup="5" TypeName="GEOMETRYCOLLECTION" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
</DATATYPES>
<COMMON_DATATYPES>
<COMMON_DATATYPE ID="5" />
<COMMON_DATATYPE ID="8" />
<COMMON_DATATYPE ID="20" />
<COMMON_DATATYPE ID="15" />
<COMMON_DATATYPE ID="22" />
<COMMON_DATATYPE ID="28" />
<COMMON_DATATYPE ID="26" />
<COMMON_DATATYPE ID="33" />
<COMMON_DATATYPE ID="34" />
<COMMON_DATATYPE ID="35" />
</COMMON_DATATYPES>
<TABLEPREFIXES>
<TABLEPREFIX Name="Default (no prefix)" />
</TABLEPREFIXES>
<REGIONCOLORS>
<REGIONCOLOR Color="Red=#FFEEEC" />
<REGIONCOLOR Color="Yellow=#FEFDED" />
<REGIONCOLOR Color="Green=#EAFFE5" />
<REGIONCOLOR Color="Cyan=#ECFDFF" />
<REGIONCOLOR Color="Blue=#F0F1FE" />
<REGIONCOLOR Color="Magenta=#FFEBFA" />
</REGIONCOLORS>
<POSITIONMARKERS>
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
</POSITIONMARKERS>
</SETTINGS>
<METADATA>
<REGIONS>
<REGION ID="1777" RegionName="A impl\195\169menter" XPos="969" YPos="148" Width="340" Height="670" RegionColor="0" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="27" />
</REGIONS>
<TABLES>
<TABLE ID="1394" Tablename="gestion_absence" PrevTableName="" XPos="386" YPos="643" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="2" >
<COLUMNS>
<COLUMN ID="1761" ColName="ga_id_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1762" ColName="ga_id_absence_motif" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1411" ColName="ga_id_date_absence" PrevColName="" Pos="3" idDatatype="14" DatatypeParams="" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1413" ColName="ga_duree" PrevColName="" Pos="5" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="1583" />
<RELATION_END ID="1585" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1414" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1761" LengthParam="0" />
<INDEXCOLUMN idColumn="1762" LengthParam="0" />
<INDEXCOLUMN idColumn="1411" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1395" Tablename="gestion_projet_categorie" PrevTableName="gestion_categorie" XPos="43" YPos="71" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="3" >
<COLUMNS>
<COLUMN ID="1415" ColName="gpc_id_categorie" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1416" ColName="gpc_libelle" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1564" />
</RELATIONS_START>
<INDICES>
<INDEX ID="1417" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1415" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1396" Tablename="gestion_frais_km" PrevTableName="gestion_composer_utilisateur_frais_kilometrique" XPos="1027" YPos="349" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="4" >
<COLUMNS>
<COLUMN ID="1605" ColName="gfk_id_frais_km" PrevColName="gcufk_id_frais_km" Pos="7" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1737" ColName="gfkt_id_frais_km_taux" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1639" ColName="gfk_ce_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1420" ColName="gfk_date" PrevColName="gcufk_date_frais" Pos="3" idDatatype="14" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1421" ColName="gfk_nbre_km" PrevColName="gcufk_nb_kilometre" Pos="4" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1422" ColName="gfk_objet" PrevColName="gcufk_objet" Pos="5" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1423" ColName="gfk_trajet" PrevColName="gcufk_trajet" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1424" ColName="gfk_montant_total" PrevColName="gcufk_montant_total" Pos="7" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="1503" />
<RELATION_END ID="1505" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1425" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1605" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1397" Tablename="gestion_note_frais_ligne" PrevTableName="gestion_depense" XPos="1025" YPos="651" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="5" >
<COLUMNS>
<COLUMN ID="1617" ColName="gnfl_id_note_frais_ligne" PrevColName="gld_id_ligne_depense" Pos="3" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1634" ColName="gnfl_ce_note_frais" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1428" ColName="gnfl_date" PrevColName="gd_date_depense" Pos="3" idDatatype="14" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1429" ColName="gnfl_montant_ht" PrevColName="gd_montant_ht" Pos="4" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1620" ColName="gnfl_taux_tva" PrevColName="gld_taux_tva" Pos="5" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1430" ColName="gnfl_montant_ttc" PrevColName="gd_montant_ttc" Pos="5" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="1500" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1431" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1617" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1398" Tablename="gestion_frais_km_taux" PrevTableName="gestion_frais_kilometrique" XPos="1027" YPos="245" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="6" >
<COLUMNS>
<COLUMN ID="1432" ColName="gfkt_id_frais_km_taux" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1433" ColName="gfkt_taux" PrevColName="" Pos="2" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1505" />
</RELATIONS_START>
<INDICES>
<INDEX ID="1434" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1432" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1399" Tablename="gestion_absence_motif" PrevTableName="gestion_motif_absence" XPos="44" YPos="521" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="7" >
<COLUMNS>
<COLUMN ID="1435" ColName="gam_id_absence_motif" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1436" ColName="gam_libelle" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Libell\195\169 du motif d\aabscence.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1770" ColName="gam_mark_cp_diminuer" PrevColName="gam_cp_diminuer" Pos="2" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si ce motif diminue le nombre d\aheur de cong\195\169s pay\195\169s.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1772" ColName="gam_mark_hs_diminuer" PrevColName="gam_hs_diminuer" Pos="4" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si ce motif diminue le nombre d\aheures supl\195\169mentaires.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1583" />
</RELATIONS_START>
<INDICES>
<INDEX ID="1438" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1435" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1402" Tablename="gestion_utilisateur_a_projet" PrevTableName="gestion_preferences" XPos="384" YPos="357" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="10" >
<COLUMNS>
<COLUMN ID="1631" ColName="guap_id_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1632" ColName="guap_id_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="1494" />
<RELATION_END ID="1498" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1447" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1631" LengthParam="0" />
<INDEXCOLUMN idColumn="1632" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1404" Tablename="gestion_projet" PrevTableName="" XPos="44" YPos="195" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="12" >
<COLUMNS>
<COLUMN ID="1522" ColName="gp_id_projet" PrevColName="" Pos="6" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1766" ColName="gp_ce_projet_parent" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1629" ColName="gp_ce_categorie" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la cat\195\169gorie du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1455" ColName="gp_nom" PrevColName="gp_nom_projet" Pos="3" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1456" ColName="gp_description" PrevColName="" Pos="4" idDatatype="28" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Description d\195\169taill\195\169e du projet.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1457" ColName="gp_date_debut" PrevColName="" Pos="5" idDatatype="14" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00" Comments="Date de d\195\169but du projet">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1768" ColName="gp_date_fin" PrevColName="" Pos="8" idDatatype="14" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00" Comments="Date de fin du projet estim\195\169e.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1458" ColName="gp_duree_prevue" PrevColName="" Pos="6" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Dur\195\169e pr\195\169vue du projet en jour.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1787" ColName="gp_duree_finance" PrevColName="" Pos="9" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Dur\195\169e en jour financ\195\169 pour le projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1459" ColName="gp_avancement" PrevColName="" Pos="7" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Pourcentage d\aavancement du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1498" />
<RELATION_START ID="1511" />
<RELATION_START ID="1764" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="1564" />
<RELATION_END ID="1764" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1625" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1522" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1405" Tablename="gestion_utilisateur_statut" PrevTableName="gestion_statut" XPos="673" YPos="234" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="13" >
<COLUMNS>
<COLUMN ID="1461" ColName="gus_id_utilisateur_statut" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1462" ColName="gus_libelle" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1776" ColName="gus_mark_recapitulatif" PrevColName="" Pos="2" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="1" Comments="Indique si ce type d\autilisateur doit appara\195\174tre dans le r\195\169capitulatif ou pas.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1592" />
</RELATIONS_START>
<INDICES>
<INDEX ID="1463" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1461" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1407" Tablename="gestion_travail_projet" PrevTableName="gestion_travail" XPos="394" YPos="473" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="15" >
<COLUMNS>
<COLUMN ID="1742" ColName="gtp_id_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1743" ColName="gtp_id_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1474" ColName="gtp_id_date_travail" PrevColName="" Pos="3" idDatatype="14" DatatypeParams="" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1475" ColName="gtp_duree" PrevColName="" Pos="4" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="1510" />
<RELATION_END ID="1511" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1476" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1742" LengthParam="0" />
<INDEXCOLUMN idColumn="1743" LengthParam="0" />
<INDEXCOLUMN idColumn="1474" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1408" Tablename="gestion_utilisateur" PrevTableName="" XPos="686" YPos="365" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="16" >
<COLUMNS>
<COLUMN ID="1477" ColName="gu_id_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1763" ColName="gu_ce_statut" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1479" ColName="gu_nom" PrevColName="" Pos="3" idDatatype="20" DatatypeParams="(100)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1480" ColName="gu_prenom" PrevColName="" Pos="4" idDatatype="20" DatatypeParams="(100)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1481" ColName="gu_password" PrevColName="" Pos="5" idDatatype="20" DatatypeParams="(32)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1482" ColName="gu_email" PrevColName="" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1483" ColName="gu_telephone" PrevColName="" Pos="7" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1484" ColName="gu_adresse" PrevColName="" Pos="8" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1485" ColName="gu_code_postal" PrevColName="" Pos="9" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1486" ColName="gu_ville" PrevColName="" Pos="10" idDatatype="20" DatatypeParams="(50)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1487" ColName="gu_quota_heures_supp" PrevColName="" Pos="11" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1488" ColName="gu_conges_payes" PrevColName="" Pos="12" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1489" ColName="gu_temps_de_travail_jour" PrevColName="gu_temps_de_travail" Pos="13" idDatatype="7" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1789" ColName="gu_temps_de_travail_mois" PrevColName="" Pos="23" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1779" ColName="gu_tdt_lundi" PrevColName="" Pos="16" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1780" ColName="gu_tdt_mardi" PrevColName="" Pos="17" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1781" ColName="gu_tdt_mercredi" PrevColName="" Pos="18" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1782" ColName="gu_tdt_jeudi" PrevColName="" Pos="19" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1783" ColName="gu_tdt_vendredi" PrevColName="" Pos="20" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1784" ColName="gu_tdt_samedi" PrevColName="" Pos="21" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1785" ColName="gu_tdt_dimanche" PrevColName="" Pos="22" idDatatype="7" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1490" ColName="gu_mark_admin" PrevColName="" Pos="14" idDatatype="22" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1491" ColName="gu_mark_recapitulatif" PrevColName="" Pos="15" idDatatype="22" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1492" ColName="gu_notes" PrevColName="" Pos="16" idDatatype="28" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1494" />
<RELATION_START ID="1503" />
<RELATION_START ID="1510" />
<RELATION_START ID="1585" />
<RELATION_START ID="1612" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="1592" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1493" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1477" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1400" Tablename="gestion_note_frais" PrevTableName="" XPos="1030" YPos="525" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="8" >
<COLUMNS>
<COLUMN ID="1439" ColName="gnf_id_note_frais" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1614" ColName="gnf_ce_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1440" ColName="gnf_libelle" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1500" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="1612" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1441" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1439" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
</TABLES>
<RELATIONS>
<RELATION ID="1494" RelationName="fk_gu_guap" Kind="1" SrcTable="1408" DestTable="1402" FKFields="gu_id_utilisateur=guap_id_utilisateur\n" FKFieldsComments="\n" relDirection="4" MidOffset="-13" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="48" CaptionOffsetY="-33" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="17" />
<RELATION ID="1498" RelationName="fk_gp_guap" Kind="1" SrcTable="1404" DestTable="1402" FKFields="gp_id_projet=guap_id_projet\n" FKFieldsComments="\n" relDirection="2" MidOffset="19" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-53" CaptionOffsetY="-24" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="18" />
<RELATION ID="1503" RelationName="fk_gu_gfk" Kind="2" SrcTable="1408" DestTable="1396" FKFields="gu_id_utilisateur=gfk_ce_utilisateur\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="22" />
<RELATION ID="1505" RelationName="fk_gfkt_gfk" Kind="2" SrcTable="1398" DestTable="1396" FKFields="gfkt_id_frais_km_taux=gfkt_id_frais_km_taux\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-59" CaptionOffsetY="-22" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="23" />
<RELATION ID="1510" RelationName="fk_gu_gtp" Kind="1" SrcTable="1408" DestTable="1407" FKFields="gu_id_utilisateur=gtp_id_utilisateur\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-1" CaptionOffsetY="-46" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="26" />
<RELATION ID="1511" RelationName="fk_gp_gtp" Kind="1" SrcTable="1404" DestTable="1407" FKFields="gp_id_projet=gtp_id_projet\n" FKFieldsComments="\n" relDirection="2" MidOffset="-12" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="48" CaptionOffsetY="-23" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="27" />
<RELATION ID="1564" RelationName="fk_gpc_gp" Kind="5" SrcTable="1395" DestTable="1404" FKFields="gpc_id_categorie=gp_ce_categorie\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-47" CaptionOffsetY="-22" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="32" />
<RELATION ID="1583" RelationName="fk_gam_ga" Kind="1" SrcTable="1399" DestTable="1394" FKFields="gam_id_absence_motif=ga_id_absence_motif\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-47" CaptionOffsetY="-22" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="31" />
<RELATION ID="1585" RelationName="fk_gu_ga" Kind="1" SrcTable="1408" DestTable="1394" FKFields="gu_id_utilisateur=ga_id_utilisateur\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-45" CaptionOffsetY="-22" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="32" />
<RELATION ID="1592" RelationName="fk_gs_gu" Kind="2" SrcTable="1405" DestTable="1408" FKFields="gus_id_utilisateur_statut=gu_ce_statut\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-41" CaptionOffsetY="-24" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="32" />
<RELATION ID="1500" RelationName="fk_gnf_gnfl" Kind="5" SrcTable="1400" DestTable="1397" FKFields="gnf_id_note_frais=gnfl_ce_note_frais\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-48" CaptionOffsetY="-25" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="20" />
<RELATION ID="1612" RelationName="fk_gu_gnf" Kind="2" SrcTable="1408" DestTable="1400" FKFields="gu_id_utilisateur=gnf_ce_utilisateur\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="32" />
<RELATION ID="1764" RelationName="fk_gp_gp_parent" Kind="2" SrcTable="1404" DestTable="1404" FKFields="gp_id_projet=gp_ce_projet_parent\n" FKFieldsComments="\n" relDirection="2" MidOffset="23" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-71" CaptionOffsetY="-23" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="26" />
</RELATIONS>
<NOTES>
</NOTES>
<IMAGES>
</IMAGES>
</METADATA>
<PLUGINDATA>
<PLUGINDATARECORDS>
</PLUGINDATARECORDS>
</PLUGINDATA>
<QUERYDATA>
<QUERYRECORDS>
</QUERYRECORDS>
</QUERYDATA>
<LINKEDMODELS>
</LINKEDMODELS>
</DBMODEL>
/tags/v1.1-thales/config.inc.defaut.php
New file
0,0 → 1,10
<?php
// Base de données
define('GTT_BDD_NOM', 'gtt_v4');
define('GTT_BDD_DSN', 'mysql://utilsiateur:mot_de_passe@localhost/'.GTT_BDD_NOM);
// Débogage
/** Constante stockant si oui ou non on veut afficher le débogage.*/
define('GTT_DEBOGAGE', false);
/** Constante stockant si oui ou non on veut afficher les requêtes SQL.*/
define('GTT_DEBOGAGE_SQL', false);
?>
/tags/v1.1-thales/presentation/stat_tableau_global.tpl.csv
New file
0,0 → 1,19
<?php if ($categories || $absences) : ?>Projets <?php foreach ($utilisateurs as $utilisateur) : ?><?=$utilisateur['prenom_nom']?> <?php endforeach; ?>Total
Travail <?php foreach ($utilisateurs as $utilisateur) : ?><?=(isset($utilisateur['total_w'])) ? $utilisateur['total_w'] : ' ';?> <?php endforeach; ?><?=$total_projets;?>
 
<?foreach ($categories as $idc => $categorie):?>
<?=$categorie['nom'];?> [<?=$categorie['abreviation'];?>] <?php foreach ($utilisateurs as $utilisateur) : ?><?=(isset($utilisateur['projets'][$idc]['total'])) ? $utilisateur['projets'][$idc]['total'] : ' ';?> <?php endforeach; ?><?=$categorie['total'];?>
 
<?foreach ($categorie['projets'] as $idp => $projet):?><?=$projet['nom'];?> <?php foreach ($utilisateurs as $utilisateur) : ?><?=(isset($utilisateur['projets'][$idc][$idp])) ? $utilisateur['projets'][$idc][$idp]['duree'] : ' ';?> <?php endforeach; ?><?=$projet['total'];?>
 
<?php endforeach; ?><?php endforeach; ?><?php endif; ?>
<?php if ($absences) : ?>
Absences <?php foreach ($utilisateurs as $utilisateur) : ?><?=$utilisateur['total_a'];?> <?php endforeach; ?><?=$total_absences;?>
 
<?php foreach ($absences as $ida => $absence) : ?>
<?=$absence['nom'];?> <?php foreach ($utilisateurs as $utilisateur) : ?><?= (isset($utilisateur['ab'][$ida])) ? $utilisateur['ab'][$ida] : ' ';?> <?php endforeach; ?><?= (isset($absence['total'])) ? $absence['total'] : ' ';?>
 
<?php endforeach; ?>
<?php endif; ?>
Total <?php foreach ($utilisateurs as $utilisateur) : ?>
<?=(isset($utilisateur['total'])) ? $utilisateur['total'] : ' ';?> <?php endforeach; ?><?=$total_absences_projets;?>
/tags/v1.1-thales/presentation/principal.tpl.html
New file
0,0 → 1,53
<!DOCTYPE html>
 
<html lang="fr">
<head>
<title><?=$titre;?></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<!-- Feuille de styles -->
<style type="text/css" media="screen"><!-- @import "presentation/styles/disposition.css"; --></style>
<style type="text/css" media="print"><!-- @import "presentation/styles/impression.css"; --></style>
<link rel="stylesheet" type="text/css" href="presentation/styles/emeraude/emeraude.css" media="screen" title="Émeraude" />
<!-- Icone de la page -->
<link rel="shortcut icon" type="image/x-icon" href="presentation/images/favicones/gtt.ico" />
<link rel="icon" type="image/png" href="presentation/images/favicones/gtt.png" />
<!-- Fichiers Javascript-->
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="presentation/scripts/commun.js"></script>
</head>
<body>
<div id="zone_conteneur">
<div id="zone_entete">
<h1 id="titre_principal"><?=$titre;?></h1>
<div id="zone_accessibilite">
<a href="#zone_menu">Aller aux menus</a>
<a href="#zone_contenu">Aller au texte</a>
</div>
</div>
<div id="zone_tronc">
<div id="zone_gauche">
<div id="zone_calendrier"><?=$zone_calendrier;?></div>
<div id="zone_identification"><?=$zone_identification;?></div>
</div>
<div id="zone_centre">
<div id="zone_contenu"><?=$zone_contenu;?></div>
</div>
<div id="zone_droite">
<div id="zone_menu"><?=$zone_menu;?></div>
</div>
</div>
<div id="zone_pied">
<div id="zone_erreur">
<?php if (GTT_DEBOGAGE) : ?>
<?=$GLOBALS['_GTT_']['erreur']->retournerErreur();?>
<p><strong>Temps total d'exexution des requêtes SQL :</strong> <?=$GLOBALS['_GTT_']['chrono']->getTempsSql();?> s.</p>
<?php endif; ?>
</div>
<p>Merci, de signalez <a href="http://suivi.tela-botanica.org/index.php?project=19&amp;do=index" class="ext">les bogues et améliorations pour cette application</a>.</p>
</div>
</div>
</body>
</html>
/tags/v1.1-thales/presentation/stat_tableau_charge.tpl.html
New file
0,0 → 1,96
<div id="navigation">
<p>Navigation : <a href="<?=$url_mois_precedent;?>">&lt;&lt;</a> <?=$mois['mois'];?> <?=$mois['annee'];?> <a href="<?=$url_mois_suivant;?>">&gt;&gt;</a></p>
<?php if ($etre_admin) : ?>
<form id="form_utilisateur" name="form_utilisateur" action="<?=$form_url;?>" method="get">
<input type="hidden" name="action" value="<?=$form_param['action'];?>"/>
<input type="hidden" name="annee" value="<?=$form_param['annee'];?>"/>
<input type="hidden" name="mois" value="<?=$form_param['mois'];?>"/>
<label for="uid">Utilisateur :</label>
<select id="uid" name="uid" onchange="javascript:this.form.submit();">
<?php foreach ($utilisateurs as $id => $utilisateur) : ?>
<option value="<?php echo $id; ?>" <?php echo ($utilisateur['courant']) ? 'selected="selected"' : ''; ?>><?php echo $utilisateur['nom']; ?></option>
<?php endforeach; ?>
</select>
<input type="submit" name="btn_envoyer_utilisateur" value="OK"/>
</form>
<?php endif; ?>
</div>
<div id="export">
<p><a href="<?=$url_mois_courant;?>&amp;format=csv">Affichage au format CSV</a> - <a href="<?=$url_mois_courant;?>&amp;format=csv&amp;sortie=csvt">Export au format CSV</a></p>
</div>
<?php if (isset($projets) || isset($absences)) : ?>
<table id="tab_tps_w_mensuel_salarie" summary="Tableau du temps de travail mensuel par salarié.">
<caption>Plan de charge - <?=$mois['mois'];?> <?=$mois['annee'];?> - <?=$utilisateur_courant;?></caption>
<thead>
<tr>
<th>Projets</th>
<?php foreach ($elements as $jour) : ?>
<th class="<?=$jour['class']?>"><?=$jour['jour_nom']?> <?=$jour['jour']?></th>
<?php endforeach; ?>
<th>Total</th>
</tr>
</thead>
<tbody>
<?php if (isset($projets)) : ?>
<?php $ligne = "impair"; ?>
<tr class="total">
<th>Travail</th>
<?php foreach ($elements as $jour) : ?>
<td><?=(!empty($jour['travail'])) ? $jour['travail'] : "&nbsp;";?></td>
<?php endforeach; ?>
<td class="total"><?=$total_w;?></td>
</tr>
<?foreach ($projets as $categorie => $pr):?>
<tr class="categories <?=$ligne ; $ligne = ($ligne == "impair") ? "pair" : "impair" ;?>">
<th class="entete categories_titre"><?=$categorie;?> [<?=$categories[$categorie]['abreviation'];?>]</th>
<?php foreach ($elements as $jour_id => $jour) : ?>
<td class="categories_total"><?=(isset($categories[$categorie][$jour_id])) ? $categories[$categorie][$jour_id] : "&nbsp;";?></td>
<?php endforeach; ?>
<td class="total"><?=$categories[$categorie]['total'];?></td>
</tr>
<?foreach ($pr as $id => $projet):?>
<tr class="projets <?=$ligne ; $ligne = ($ligne == "impair") ? "pair" : "impair" ;?>">
<th id="pr:<?=$id;?>" class="entete projet_nom" title="<?=$projet['desc'];?>"><?=$projet['nom'];?></th>
<?php foreach ($elements as $jour_id => $jour) : ?>
<td class="projet"><?=(isset($projet['duree'][$jour_id])) ? $projet['duree'][$jour_id] : "&nbsp;";?></td>
<?php endforeach; ?>
<td class="total"><?=(isset($projet['total'])) ? $projet['total'] : "&nbsp;";?></td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (isset($absences)) : ?>
<tr class="total">
<th class="entete absences_titre">Absences</th>
<?php foreach ($elements as $jour) : ?>
<td><?=(!empty($jour['absence'])) ? $jour['absence'] : "&nbsp;";?></td>
<?php endforeach; ?>
<td class="total"><?=$total_a;?></td>
</tr>
<?php $ligne = "impair"; ?>
<?php foreach ($absences as $ab_id => $absence) : ?>
<tr class="<?=$ligne ; $ligne = ($ligne == "impair") ? "pair" : "impair" ;?>">
<th id="ab:<?=$ab_id;?>" class="entete absence_nom"><?=$absence['nom'];?></th>
<?php foreach ($elements as $jour_id => $jour) : ?>
<td><?= (isset($ab[$ab_id][$jour_id])) ? $ab[$ab_id][$jour_id] : "&nbsp;";?></td>
<?php endforeach; ?>
<td class="total"><?=(!empty($absence['total'])) ? $absence['total'] : '&nbsp;' ;?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<tr class="total">
<th>Total</th>
<?php foreach ($elements as $jour) : ?>
<td><?=(!empty($jour['w_et_a'])) ? $jour['w_et_a'] : "&nbsp;";?></td>
<?php endforeach; ?>
<td class="total"><?=$total;?></td>
</tr>
</tbody>
</table>
<?php endif; ?>
<?php if (isset($messages)) : ?>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
/tags/v1.1-thales/presentation/styles/disposition.css
New file
0,0 → 1,78
@CHARSET "ISO-8859-1";
/* GTT VERSION 4 */
 
/* Modif des balises */
body,h1,h2,p{
margin:0;
padding:0;}
legend{margin:0 0 0 1em;}
form {width:100%;}
label{
display:block;
float:left;
padding-right:5px;
min-width:150px;}
 
/* Disposition des éléments sur la page */
#zone_entete {
height:75px;}
#zone_conteneur {
position: absolute;
min-width:1200px;
width:100%;}
#zone_tronc {
position:relative;
padding:5px;}
#zone_gauche {
position:absolute;
left:0;
top:5px;
width:200px;
height:100%;}
#zone_centre {
position:relative;
margin:0 200px;
padding:0;
min-height:500px;
min-width:750px;
overflow:auto;}
#zone_droite {
position:absolute;
right:0;
top:5px;
width:205px;
height:100%;}
#zone_pied {
margin-top:10px;
height:100%;}
 
/* Autres zones mineures*/
#zone_accessibilite {
float:right;}
#zone_menu{
padding:0 0 0 5px;}
 
/* Détails */
#gestion input {width:80px;}
#gestion #btn_valider,.btn_large{
width:50%;
height:50px;
margin:5px auto;}
form.centre{
text-align:center;}
#calendrier_gestion table{
width:100%;
clear:both;}
#connexion input[type=submit]{width:100%}
#info{margin:0;
padding:0;}
#info_aujourdhui{
float:left;
margin:0;}
#info_semaine{text-align:right;}
 
/*Formulaires*/
.editer li{
display:block;
float:left;
margin:0 0 0 5px}
/tags/v1.1-thales/presentation/styles/impression.css
New file
0,0 → 1,10
#zone_droite, #zone_erreur,#navigation,#zone_accessibilite {display:none;}
#zone_gauche{page-break-after: always;}
table{
border: medium solid grey;
border-collapse: collapse;
margin:0}
td,th{border:thin solid grey;}
th{border-bottom: medium solid grey;}
td,th{text-align:center;}
.entete{text-align:left;}
/tags/v1.1-thales/presentation/styles/emeraude/emeraude.css
New file
0,0 → 1,235
/*
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
Contributor for GTT : Jean-Pascal MILCENT <jpm@tela-botanica.org>
*/
/* Basic */
* {
margin:0em;
padding:0em;}
body {
font-family:"trebuchet ms", sans-serif;
color:#555555;
font-size:0.8em;}
a{
color: #669911;}
/* Presentation des listes de definitions */
dl {width:100%;}
dt {
float:left;
font-weight: bold;
line-height:1.1em;
text-align:top left;
margin-right:0.3em;}
dd {
width:auto;
margin-left:0;
line-height:1.1em;
margin:0.5em 0;}
 
/* Presentation des formulaires */
form.editer{
padding:0 0 1em 0;}
form ul li{
list-style-type:none;}
form label{
font-weight:bold;}
legend{
font-size:1.1em;
font-weight:bold;
text-transform:uppercase;
color: #5D5F53;}
 
/* Présentation générale des tableaux */
table{
border:1px dotted black;
width:100%;}
thead th{
background-color:#486300;
color:white;}
tbody th{
text-align:left !important;
width:20%;}
td{text-align:center;}
tr.pair{background-color: #F1F2E7;}
caption{margin-top:1em;}
 
/* Présentation d'icones*/
a.ext:after {
content: " "url(../../images/icones/lien_externe.png);}
 
/*Présentation des bulles d'aide */
*[title]:after {content:" "url(images/help_view_16x16.gif);}
 
/* Zone entête */
#zone_entete{
background-image: url('images/a2.gif');
background-position: bottom left;
padding-left: 40px;
padding-top: 45px;}
#zone_entete h1{
text-transform:uppercase;
font-size:1.6em;
color:white;}
#zone_entete a{
position: relative;
top:-0.3em;
color:#E8EFC2;
font-weight:normal;
font-size:1.1em;
text-transform:lowercase;}
 
/* Zone menu */
#zone_menu h3{
margin:0.5em 0 0 0;}
#zone_menu li{
font-size: 1.1em;
font-weight: bold;
text-decoration: none;
margin-right: 0em;}
#zone_menu li a{
display:block;
font-size: 0.8em;
font-weight: bold;
color: #5D5F53;
text-decoration: none;
margin-right: 1em;}
#zone_menu li a:hover{
background-color: #6B7E09;
color:white;}
 
/* Zone tronc */
#zone_tronc{
padding: 0 15px 1em 15px;
line-height: 1.6em;
background: url('images/a4.gif') repeat-x top left;}
#zone_tronc h2,#zone_tronc h3{
text-transform:uppercase;}
 
 
/* Zone gauche */
#zone_gauche{
padding: 0 1.5em 1.5em 0.5em;}
#zone_gauche h2, #zone_gauche h3{
color: #5D5F53;
border-bottom: dotted 1px #ECEEDF;
margin-bottom:0;}
#zone_gauche hr{margin-bottom: 0.5em;}
 
/* Zone centre */
#zone_centre{
padding: 0;}
#zone_centre h2,h3,h4,h5,h6{
margin-bottom:1em;
text-transform:uppercase;}
#zone_centre p{
margin-bottom: 1.5em;}
#zone_centre ul{
margin-bottom: 1.5em;
padding-left: 1em;}
 
/* Zone droite */
#zone_droite h3, #zone_droite h3{
background: url('images/a1.gif') no-repeat;
width: 185px;
height: 27px;
font-size: 1.0em;
font-weight: bold;
padding-left: 15px;
padding-top: 5px;
color: #5D5F53;}
 
/* Zone pied */
#zone_pied{
background: url('images/a4.gif') repeat-x top left;
border-top: solid 1px #D0D4BB;
padding: 2.0em 3.5em 3.0em 3.5em;
font-size: 0.8em;}
/*------------------------------------------*/
/*Spécial Appli GTT*/
#info,.information{
background-image: url('images/a3.gif');
background-repeat: repeat-x;
background-position: bottom left;
padding: 0.5em;}
/* Presentation des informations */
.information{
text-align:center;
font-weight:bold;
border:2px solid red;}
/*Formulaires*/
.symbole_obligatoire{
font-size:1em;
font-weight:bold;
color:red;}
/*Liste de définition*/
.ajout_2_points dt:after {content:" : ";}
.ajout_2_points dt[title]:after {content:" "url(images/help_view_16x16.gif)" : ";}
/* Le calendrier */
.calendrier {
font-family:verdana, arial, helvetica, sans-serif;
font-size:0.9em;}
.calendrier table {background-color: silver;}
.calendrier table td {text-align: center;}
.calendrier caption {font-weight: bold;}
.categorie,.totaux_titre {
font-size:1.6em;
text-align:left !important;
padding:1px;
margin:0 0.2em;}
.projet, .absence_titre {
font-weight:bold;
width:350px;
text-align:left !important;
padding-left:30px;}
.utilisateur{
width:75px;
text-align:center;
background:white;}
.jour_courrant {
color:#BB0000;
background-color:yellow;
border:2px outset #74C054;}
.jour_ferie {
background-color:red;
border-width:2px outset #74C054;}
.jour_we {
color:black;
background-color: #F1F2E7;
border-width:2px outset #74C054;}
.jour_vide {
color:white;
background-color: grey;}
/* Tableau identification */
#connexion{border:0;}
#connexion td{
width:50%;}
/* Tableau stats*/
tbody td.total{
width:5%;}
tr.categories,tr.absences{
background-image: url('images/a2.gif');}
tr.total, tr.total th{
color:white;
font-weight:white;
background-color:#B30000;}
#tab_tps_w_mensuel_salarie{
width:100%;}
.entete{width:250px;}
#navigation{text-align:center;}
#navigation p{margin:0;}
#form_utilisateur label{
display:inline;
float:none;
min-width:0;
font-weight:normal;}
#preferences .pr_no {
font-weight:bold;
width:30%;
text-align:left;
padding-left:5px;}
#preferences .pr_de {
font-size:0.8em;
text-align:left;}
table#ut_tdt{width:50%;}
/tags/v1.1-thales/presentation/styles/emeraude/license.txt
New file
0,0 → 1,243
Creative Commons </>
 
Creative Commons Legal Code
 
*Attribution 2.5*
 
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION
ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
ITS USE.
 
/License/
 
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
 
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE
RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS
AND CONDITIONS.
 
*1. Definitions*
 
1. *"Collective Work"* means a work, such as a periodical issue,
anthology or encyclopedia, in which the Work in its entirety in
unmodified form, along with a number of other contributions,
constituting separate and independent works in themselves, are
assembled into a collective whole. A work that constitutes a
Collective Work will not be considered a Derivative Work (as
defined below) for the purposes of this License.
2. *"Derivative Work"* means a work based upon the Work or upon the
Work and other pre-existing works, such as a translation, musical
arrangement, dramatization, fictionalization, motion picture
version, sound recording, art reproduction, abridgment,
condensation, or any other form in which the Work may be recast,
transformed, or adapted, except that a work that constitutes a
Collective Work will not be considered a Derivative Work for the
purpose of this License. For the avoidance of doubt, where the
Work is a musical composition or sound recording, the
synchronization of the Work in timed-relation with a moving image
("synching") will be considered a Derivative Work for the purpose
of this License.
3. *"Licensor"* means the individual or entity that offers the Work
under the terms of this License.
4. *"Original Author"* means the individual or entity who created the
Work.
5. *"Work"* means the copyrightable work of authorship offered under
the terms of this License.
6. *"You"* means an individual or entity exercising rights under this
License who has not previously violated the terms of this License
with respect to the Work, or who has received express permission
from the Licensor to exercise rights under this License despite a
previous violation.
 
*2. Fair Use Rights.* Nothing in this license is intended to reduce,
limit, or restrict any rights arising from fair use, first sale or other
limitations on the exclusive rights of the copyright owner under
copyright law or other applicable laws.
 
*3. License Grant.* Subject to the terms and conditions of this License,
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:
 
1. to reproduce the Work, to incorporate the Work into one or more
Collective Works, and to reproduce the Work as incorporated in the
Collective Works;
2. to create and reproduce Derivative Works;
3. to distribute copies or phonorecords of, display publicly, perform
publicly, and perform publicly by means of a digital audio
transmission the Work including as incorporated in Collective Works;
4. to distribute copies or phonorecords of, display publicly, perform
publicly, and perform publicly by means of a digital audio
transmission Derivative Works.
5.
 
For the avoidance of doubt, where the work is a musical composition:
 
1. *Performance Royalties Under Blanket Licenses*. Licensor
waives the exclusive right to collect, whether individually
or via a performance rights society (e.g. ASCAP, BMI,
SESAC), royalties for the public performance or public
digital performance (e.g. webcast) of the Work.
2. *Mechanical Rights and Statutory Royalties*. Licensor waives
the exclusive right to collect, whether individually or via
a music rights agency or designated agent (e.g. Harry Fox
Agency), royalties for any phonorecord You create from the
Work ("cover version") and distribute, subject to the
compulsory license created by 17 USC Section 115 of the US
Copyright Act (or the equivalent in other jurisdictions).
6. *Webcasting Rights and Statutory Royalties*. For the avoidance of
doubt, where the Work is a sound recording, Licensor waives the
exclusive right to collect, whether individually or via a
performance-rights society (e.g. SoundExchange), royalties for the
public digital performance (e.g. webcast) of the Work, subject to
the compulsory license created by 17 USC Section 114 of the US
Copyright Act (or the equivalent in other jurisdictions).
 
The above rights may be exercised in all media and formats whether now
known or hereafter devised. The above rights include the right to make
such modifications as are technically necessary to exercise the rights
in other media and formats. All rights not expressly granted by Licensor
are hereby reserved.
 
*4. Restrictions.*The license granted in Section 3 above is expressly
made subject to and limited by the following restrictions:
 
1. You may distribute, publicly display, publicly perform, or
publicly digitally perform the Work only under the terms of this
License, and You must include a copy of, or the Uniform Resource
Identifier for, this License with every copy or phonorecord of the
Work You distribute, publicly display, publicly perform, or
publicly digitally perform. You may not offer or impose any terms
on the Work that alter or restrict the terms of this License or
the recipients' exercise of the rights granted hereunder. You may
not sublicense the Work. You must keep intact all notices that
refer to this License and to the disclaimer of warranties. You may
not distribute, publicly display, publicly perform, or publicly
digitally perform the Work with any technological measures that
control access or use of the Work in a manner inconsistent with
the terms of this License Agreement. The above applies to the Work
as incorporated in a Collective Work, but this does not require
the Collective Work apart from the Work itself to be made subject
to the terms of this License. If You create a Collective Work,
upon notice from any Licensor You must, to the extent practicable,
remove from the Collective Work any credit as required by clause
4(b), as requested. If You create a Derivative Work, upon notice
from any Licensor You must, to the extent practicable, remove from
the Derivative Work any credit as required by clause 4(b), as
requested.
2. If you distribute, publicly display, publicly perform, or publicly
digitally perform the Work or any Derivative Works or Collective
Works, You must keep intact all copyright notices for the Work and
provide, reasonable to the medium or means You are utilizing: (i)
the name of the Original Author (or pseudonym, if applicable) if
supplied, and/or (ii) if the Original Author and/or Licensor
designate another party or parties (e.g. a sponsor institute,
publishing entity, journal) for attribution in Licensor's
copyright notice, terms of service or by other reasonable means,
the name of such party or parties; the title of the Work if
supplied; to the extent reasonably practicable, the Uniform
Resource Identifier, if any, that Licensor specifies to be
associated with the Work, unless such URI does not refer to the
copyright notice or licensing information for the Work; and in the
case of a Derivative Work, a credit identifying the use of the
Work in the Derivative Work (e.g., "French translation of the Work
by Original Author," or "Screenplay based on original Work by
Original Author"). Such credit may be implemented in any
reasonable manner; provided, however, that in the case of a
Derivative Work or Collective Work, at a minimum such credit will
appear where any other comparable authorship credit appears and in
a manner at least as prominent as such other comparable authorship
credit.
 
*5. Representations, Warranties and Disclaimer*
 
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
 
*6. Limitation on Liability.* EXCEPT TO THE EXTENT REQUIRED BY
APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL
THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF
LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 
*7. Termination*
 
1. This License and the rights granted hereunder will terminate
automatically upon any breach by You of the terms of this License.
Individuals or entities who have received Derivative Works or
Collective Works from You under this License, however, will not
have their licenses terminated provided such individuals or
entities remain in full compliance with those licenses. Sections
1, 2, 5, 6, 7, and 8 will survive any termination of this License.
2. Subject to the above terms and conditions, the license granted
here is perpetual (for the duration of the applicable copyright in
the Work). Notwithstanding the above, Licensor reserves the right
to release the Work under different license terms or to stop
distributing the Work at any time; provided, however that any such
election will not serve to withdraw this License (or any other
license that has been, or is required to be, granted under the
terms of this License), and this License will continue in full
force and effect unless terminated as stated above.
 
*8. Miscellaneous*
 
1. Each time You distribute or publicly digitally perform the Work or
a Collective Work, the Licensor offers to the recipient a license
to the Work on the same terms and conditions as the license
granted to You under this License.
2. Each time You distribute or publicly digitally perform a
Derivative Work, Licensor offers to the recipient a license to the
original Work on the same terms and conditions as the license
granted to You under this License.
3. If any provision of this License is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability
of the remainder of the terms of this License, and without further
action by the parties to this agreement, such provision shall be
reformed to the minimum extent necessary to make such provision
valid and enforceable.
4. No term or provision of this License shall be deemed waived and no
breach consented to unless such waiver or consent shall be in
writing and signed by the party to be charged with such waiver or
consent.
5. This License constitutes the entire agreement between the parties
with respect to the Work licensed here. There are no
understandings, agreements or representations with respect to the
Work not specified here. Licensor shall not be bound by any
additional provisions that may appear in any communication from
You. This License may not be modified without the mutual written
agreement of the Licensor and You.
 
Creative Commons is not a party to this License, and makes no warranty
whatsoever in connection with the Work. Creative Commons will not be
liable to You or any party on any legal theory for any damages
whatsoever, including without limitation any general, special,
incidental or consequential damages arising in connection to this
license. Notwithstanding the foregoing two (2) sentences, if Creative
Commons has expressly identified itself as the Licensor hereunder, it
shall have all rights and obligations of Licensor.
 
Except for the limited purpose of indicating to the public that the Work
is licensed under the CCPL, neither party will use the trademark
"Creative Commons" or any related trademark or logo of Creative Commons
without the prior written consent of Creative Commons. Any permitted use
will be in compliance with Creative Commons' then-current trademark
usage guidelines, as may be published on its website or otherwise made
available upon request from time to time.
 
Creative Commons may be contacted at http://creativecommons.org/
<http://creativecommons.org>.
 
« Back to Commons Deed <./>
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: v1.1-thales/presentation/styles/emeraude/images/a1.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: v1.1-thales/presentation/styles/emeraude/images/a1.gif
===================================================================
--- v1.1-thales/presentation/styles/emeraude/images/a1.gif (revision 0)
+++ v1.1-thales/presentation/styles/emeraude/images/a1.gif (revision 161)
/v1.1-thales/presentation/styles/emeraude/images/a1.gif
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: v1.1-thales/presentation/styles/emeraude/images/a2.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: v1.1-thales/presentation/styles/emeraude/images/a2.gif
===================================================================
--- v1.1-thales/presentation/styles/emeraude/images/a2.gif (revision 0)
+++ v1.1-thales/presentation/styles/emeraude/images/a2.gif (revision 161)
/v1.1-thales/presentation/styles/emeraude/images/a2.gif
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: v1.1-thales/presentation/styles/emeraude/images/a3.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: v1.1-thales/presentation/styles/emeraude/images/a3.gif
===================================================================
--- v1.1-thales/presentation/styles/emeraude/images/a3.gif (revision 0)
+++ v1.1-thales/presentation/styles/emeraude/images/a3.gif (revision 161)
/v1.1-thales/presentation/styles/emeraude/images/a3.gif
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: v1.1-thales/presentation/styles/emeraude/images/a4.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: v1.1-thales/presentation/styles/emeraude/images/a4.gif
===================================================================
--- v1.1-thales/presentation/styles/emeraude/images/a4.gif (revision 0)
+++ v1.1-thales/presentation/styles/emeraude/images/a4.gif (revision 161)
/v1.1-thales/presentation/styles/emeraude/images/a4.gif
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: v1.1-thales/presentation/styles/emeraude/images/a5.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: v1.1-thales/presentation/styles/emeraude/images/a5.gif
===================================================================
--- v1.1-thales/presentation/styles/emeraude/images/a5.gif (revision 0)
+++ v1.1-thales/presentation/styles/emeraude/images/a5.gif (revision 161)
/v1.1-thales/presentation/styles/emeraude/images/a5.gif
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: v1.1-thales/presentation/styles/emeraude/images/help_view_16x16.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: v1.1-thales/presentation/styles/emeraude/images/help_view_16x16.gif
===================================================================
--- v1.1-thales/presentation/styles/emeraude/images/help_view_16x16.gif (revision 0)
+++ v1.1-thales/presentation/styles/emeraude/images/help_view_16x16.gif (revision 161)
/v1.1-thales/presentation/styles/emeraude/images/help_view_16x16.gif
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: v1.1-thales/presentation/admin_utilisateur.tpl.html
===================================================================
--- v1.1-thales/presentation/admin_utilisateur.tpl.html (revision 0)
+++ v1.1-thales/presentation/admin_utilisateur.tpl.html (revision 161)
@@ -0,0 +1,141 @@
+<?php if (isset($messages)) : ?>
+<?php foreach ($messages as $message) : ?>
+<p class="information"><?=$message;?></p>
+<?php endforeach; ?>
+<?php endif; ?>
+<form id="admin_utilisateur_editer" class="editer" name="admin_utilisateur_editer" action="index.php?action=admin-utilisateur_editer" method="post">
+ <fieldset>
+ <legend>Éditer un utilisateur</legend>
+ <ul>
+ <li>
+ <label for="utsu_id">Utilisateur :</label>
+ <select id="utsu_id" name="utsu_id">
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <option value="<?=$utilisateur['id'];?>"><?=$utilisateur['libelle'];?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li><input id="btn_utilisateur_supprimer" name="btn_utilisateur_supprimer" value="Supprimer" type="submit" onclick="javascript:return confirm('Êtes vous sûr de vouloir supprimer cet utilisateur ?');" /></li>
+ <li><input id="btn_utilisateur_modifier" name="btn_utilisateur_modifier" value="Modifier" type="submit" /></li>
+ </ul>
+ </fieldset>
+</form>
+<form id="admin_utilisateur_ajouter" name="admin_utilisateur_ajouter" action="<?=$form_url;?>" method="post">
+ <fieldset>
+ <legend><?=$form_legend;?></legend>
+ <ul>
+ <li>
+ <label for="ut_nom">Nom :</label>
+ <input size="50" name="ut_nom" type="text" value="<?=$Utilisateur->getNom();?>"/><span class="symbole_obligatoire">*</span>
+ </li>
+ <li>
+ <label for="ut_prenom">Prenom :</label>
+ <input size="50" name="ut_prenom" type="text" value="<?=$Utilisateur->getPrenom();?>"/><span class="symbole_obligatoire">*</span>
+ </li>
+ <li>
+ <label for="ut_adresse">Adresse :</label>
+ <input size="75" name="ut_adresse" type="text" value="<?=$Utilisateur->getAdresse();?>"/>
+ </li>
+ <li>
+ <label for="ut_ville">Ville :</label>
+ <input size="50" name="ut_ville" type="text" value="<?=$Utilisateur->getVille();?>"/>
+ </li>
+ <li>
+ <label for="ut_code_postal">Code postal :</label>
+ <input size="5" name="ut_code_postal" type="text" value="<?=$Utilisateur->getCodePostal();?>"/>
+ </li>
+ <li>
+ <label for="ut_telephone">Téléphone :</label>
+ <input size="10" name="ut_telephone" type="text" value="<?=$Utilisateur->getTelephone();?>"/>
+ </li>
+ <li>
+ <label for="ut_email">Courriel :</label>
+ <input size="50" name="ut_email" type="text" value="<?=$Utilisateur->getEmail();?>"/><span class="symbole_obligatoire">*</span>
+ </li>
+ <?php if ($mode == 'M') : ?>
+ <li>
+ <fieldset>
+ <legend>Mot de passe</legend>
+ <strong>Si vous ne voulez pas modifier le mot de passe :</strong> laisser vide les champs "Mot de passe" et "Confirmer mot de passe".
+ <ul>
+ <?php endif; ?>
+ <li>
+ <label for="ut_mot_de_passe">Mot de passe :</label>
+ <input size="20" name="ut_mot_de_passe" type="password"/><span class="symbole_obligatoire">*</span></li>
+ <li>
+ <label for="ut_mot_de_passe_confirmation">Confirmer mot de passe :</label>
+ <input size="20" name="ut_mot_de_passe_confirmation" type="password"/><span class="symbole_obligatoire">*</span>
+ </li>
+ <?php if ($mode == 'M') : ?>
+ </ul>
+ </fieldset>
+ </li>
+ <?php endif; ?>
+ <li>
+ <label for="ut_statut">Statut :</label>
+ <select id="ut_statut" name="ut_statut">
+ <?php foreach ($utilisateur_statuts as $statut) : ?>
+ <option value="<?=$statut['id'];?>"><?=$statut['libelle'];?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li>
+ <label for="ut_conges_payes">Congés payés initiaux (en heure) :</label>
+ <input size="3" name="ut_conges_payes" type="text" value="<?=$Utilisateur->getCongesPayes();?>"/>
+ </li>
+ <li>
+ <label for="ut_temps_de_travail_jour">Temps journalier de travail :</label>
+ <input size="3" name="ut_temps_de_travail_jour" type="text" value="<?=$Utilisateur->getTempsDeTravailJour();?>"/>
+ </li>
+ <li>
+ <label for="ut_temps_de_travail_mois">Temps de travail mensuel fixe :</label>
+ <input size="3" name="ut_temps_de_travail_mois" type="text" value="<?=$Utilisateur->getTempsDeTravailMois();?>"/>
+ </li>
+ <li>
+ <label for="ut_tdt">Temps de travail hebdomadaire :</label>
+ <table id="ut_tdt">
+ <thead>
+ <tr>
+ <th>Lundi</th>
+ <th>Mardi</th>
+ <th>Mercredi</th>
+ <th>Jeudi</th>
+ <th>Vendredi</th>
+ <th>Samedi</th>
+ <th>Dimanche</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><input size="3" name="ut_tdt_lundi" type="text" value="<?=$Utilisateur->getTdtLundi();?>"/></td>
+ <td><input size="3" name="ut_tdt_mardi" type="text" value="<?=$Utilisateur->getTdtMardi();?>"/></td>
+ <td><input size="3" name="ut_tdt_mercredi" type="text" value="<?=$Utilisateur->getTdtMercredi();?>"/></td>
+ <td><input size="3" name="ut_tdt_jeudi" type="text" value="<?=$Utilisateur->getTdtJeudi();?>"/></td>
+ <td><input size="3" name="ut_tdt_vendredi" type="text" value="<?=$Utilisateur->getTdtVendredi();?>"/></td>
+ <td><input size="3" name="ut_tdt_samedi" type="text" value="<?=$Utilisateur->getTdtSamedi();?>"/></td>
+ <td><input size="3" name="ut_tdt_dimanche" type="text" value="<?=$Utilisateur->getTdtDimanche();?>"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </li>
+ <li>
+ <label for="ut_quota_heures_sup">Heures supplémentaires initiales :</label>
+ <input size="3" name="ut_quota_heures_supp" type="text" value="<?=$Utilisateur->getQuotaHeuresSupp();?>"/>
+ </li>
+ <li>
+ <label for="ut_mark_admin">Adminitrateur :</label>
+ <input id="ut_mark_admin" name="ut_mark_admin" type="checkbox" value="1" <?=($bool_mark_admin)?'checked="checked"':'';?>/>
+ </li>
+ <li>
+ <label for="ut_mark_recapitulatif">Cet utilisateur ne doit pas apparaître dans les divers récapitulatif :</label>
+ <input id="ut_mark_recapitulatif" name="ut_mark_recapitulatif" type="checkbox" value="1" <?=($bool_mark_recapitulatif)?'checked="checked"':'';?>/>
+ </li>
+ <li>
+ <input name="ut_id_utilisateur" type="hidden" value="<?=$Utilisateur->getIdUtilisateur();?>"/>
+ <input id="<?=$form_bouton_id;?>" name="<?=$form_bouton_id;?>" value="<?=$form_bouton_value;?>" type="submit" />
+ <input id="btn_utilisateur_annuler" name="btn_utilisateur_annuler" value="Annuler" type="submit" />
+ </li>
+ <li><span class="symbole_obligatoire">*</span> =champs obligatoires</li>
+ </ul>
+ </fieldset>
+</form>
\ No newline at end of file
Index: v1.1-thales/presentation/calendrier_mini.tpl.html
===================================================================
--- v1.1-thales/presentation/calendrier_mini.tpl.html (revision 0)
+++ v1.1-thales/presentation/calendrier_mini.tpl.html (revision 161)
@@ -0,0 +1,30 @@
+<div id="calendrier_mini" class="calendrier">
+ <h2>Calendrier</h2>
+ <table>
+ <caption><a href="<?=$url_mois_precedent;?>">&lt;&lt;</a> <?=$mois['mois'];?>
+ <?=$mois['annee'];?> <a href="<?=$url_mois_suivant;?>">&gt;&gt;</a></caption>
+ <thead>
+ <tr>
+ <th>Lun</th>
+ <th>Mar</th>
+ <th>Mer</th>
+ <th>Jeu</th>
+ <th>Ven</th>
+ <th>Sam</th>
+ <th>Dim</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($elements as $semaine) : ?>
+ <tr>
+ <?php foreach ($semaine as $jour) : ?>
+ <td class="<?=$jour['class'];?>"> <? if ($jour['class'] == 'jour_vide') :?>
+ <?=$jour['jour'];?> <? else :?> <a href="<?=$jour['url'];?>"><?=$jour['jour'];?></a>
+ <? endif;?></td>
+ <?php endforeach; ?>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ <hr/>
+</div>
\ No newline at end of file
Index: v1.1-thales/presentation/admin_utilisateur_statut.tpl.html
===================================================================
--- v1.1-thales/presentation/admin_utilisateur_statut.tpl.html (revision 0)
+++ v1.1-thales/presentation/admin_utilisateur_statut.tpl.html (revision 161)
@@ -0,0 +1,34 @@
+<?php if (isset($message)) : ?>
+<p class="information"><?=$message;?></p>
+<?php endif; ?>
+<form id="admin_us_supprimer" class="editer" name="admin_us_supprimer" action="http://localhost/gestion/index.php?action=admin-utilisateur-statut_valider-supprimer" method="post">
+ <fieldset>
+ <legend>Supprimer un statut d'utilisateur</legend>
+ <ul>
+ <li>
+ <label for="ussu_id">Statut d'utilisateur :</label>
+ <select id="ussu_id" name="ussu_id">
+ <?php foreach ($statuts as $statut) : ?>
+ <option value="<?=$statut['id'];?>"><?=$statut['libelle'];?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li><input id="btn_us_supprimer" name="btn_us_supprimer" value="Supprimer" type="submit" onclick="javascript:return confirm('Êtes vous sûr de vouloir supprimer cet statut d\'utilisateur ?');" /></li>
+ </ul>
+ </fieldset>
+</form>
+<form id="admin_us_ajouter" name="admin_us_ajouter" action="http://localhost/gestion/index.php?action=admin-utilisateur-statut_valider-ajouter" method="post">
+ <fieldset>
+ <legend>Ajouter un statut d'utilisateur</legend>
+ <ul>
+ <li>
+ <label for="usaj_libelle">Libelle :</label>
+ <input size="30" id="usaj_libelle" name="usaj_libelle" type="text" />
+ <span class="symbole_obligatoire">*</span>
+ </li>
+ <li>
+ <input size="5" id="btn_us_ajouter" name="btn_us_ajouter" value="Ajouter" type="submit" /></li>
+ <li><span class="symbole_obligatoire">*</span> =champs obligatoires</li>
+ </ul>
+ </fieldset>
+</form>
\ No newline at end of file
Index: v1.1-thales/presentation/scripts/commun.js
===================================================================
--- v1.1-thales/presentation/scripts/commun.js (revision 0)
+++ v1.1-thales/presentation/scripts/commun.js (revision 161)
@@ -0,0 +1,78 @@
+// Fonction déclanchant l'ouverture d'une fenêtre externe pour les liens possédant la classe "ext"
+function ouvrirLienExterne() {
+ var liens = document.getElementsByTagName('a');
+ // On récupère tous les liens (<a>) du document dans une variable (un array), ici liens.
+ // Une boucle qui parcourt le tableau (array) liens du début à la fin.
+ for (var i = 0 ; i < liens.length ; ++i) {
+ // Si les liens ont un nom de class égal à lien_ext, alors on agit.
+ if (liens[i].className == 'ext') {
+ liens[i].title = liens[i].title + 'S\'ouvre dans une nouvelle fenêtre';
+ // Au clique de la souris.
+ liens[i].onclick = function() {
+ window.open(this.href);
+ return false; // On ouvre une nouvelle page ayant pour URL le href du lien cliqué et on inhibe le lien réel.
+ };
+ }
+ }
+}
+
+function caseACocherUnique() {
+ $('input.ab').on('click', function(){
+ var id = $(this).attr('id'),
+ name = $(this).attr('name'),
+ numJour = $(this).attr('data-num-jour'),
+ abId = $(this).attr('data-ab-id'),
+ dureeDefaut = $(this).attr('data-duree-defaut'),
+ checked = $(this).is(':checked');
+ if (checked) {
+ $(this).val(abId + ':' + dureeDefaut);
+ } else {
+ $(this).val(abId + ':0');
+ }
+
+ // Nous forçons une seul case cochable
+ $('input.ab[name="'+name+'"]:checked').each(function() {
+ if ($(this).attr('id') != id) {
+ $(this).removeAttr('checked');
+ }
+ });
+
+ // Mise à zéro des projets du jour
+ $('input.pr[data-num-jour="'+numJour+'"]').each(function() {
+ if (checked) {
+ if ($(this).attr('value') != '') {
+ $(this).attr('value', 0);
+ }
+ $(this).attr('disabled', 'disabled');
+ } else {
+ $(this).removeAttr('disabled');
+ }
+ });
+
+ // Mise à zéro des catégories du jour
+ $('td.categorie_total.pr[data-num-jour="'+numJour+'"]').each(function() {
+ if (checked) {
+ $(this).text('');
+ } else {
+ $(this).removeAttr('disabled');
+ }
+ });
+ });
+
+ $('form#gestion').bind('submit', function() {
+ $(this).find(':input').removeAttr('disabled');
+ });
+
+ // Nous rendons par défaut les champs projets inactifs pour chaque jour d'abscence
+ $('input.ab:checked').each(function() {
+ var numJour = $(this).attr('data-num-jour');
+ $('input.pr[data-num-jour="'+numJour+'"]').each(function() {
+ $(this).attr('disabled', 'disabled');
+ });
+ });
+}
+
+$(document).ready(function() {
+ ouvrirLienExterne();
+ caseACocherUnique();
+});
\ No newline at end of file
Index: v1.1-thales/presentation/stat_tableau_global.tpl.html
===================================================================
--- v1.1-thales/presentation/stat_tableau_global.tpl.html (revision 0)
+++ v1.1-thales/presentation/stat_tableau_global.tpl.html (revision 161)
@@ -0,0 +1,81 @@
+<div id="navigation">
+ <p>Navigation : <a href="<?=$url_mois_precedent;?>">&lt;&lt;</a> <?=$mois['mois'];?> <?=$mois['annee'];?> <a href="<?=$url_mois_suivant;?>">&gt;&gt;</a></p>
+</div>
+<div id="export">
+ <p><a href="<?=$url_mois_courant;?>&amp;format=csv">Affichage au format CSV</a> - <a href="<?=$url_mois_courant;?>&amp;format=csv&amp;sortie=csvt">Export au format CSV</a></p>
+</div>
+<?php if ($categories || $absences) : ?>
+<table id="tab_tps_w_mensuel_salarie" summary="Tableau du temps de travail mensuel par salarié.">
+ <caption>Tableaux global - <?=$mois['mois'];?> <?=$mois['annee'];?></caption>
+ <thead>
+ <tr>
+ <th>Projets</th>
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <th><?=$utilisateur['prenom_nom']?></th>
+ <?php endforeach; ?>
+ <th>Total</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $ligne = "impair"; ?>
+ <?php if ($categories) : ?>
+ <tr class="total">
+ <th>Travail</th>
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <td><?=(isset($utilisateur['total_w'])) ? $utilisateur['total_w'] : "&nbsp;";?></td>
+ <?php endforeach; ?>
+ <td class="total"><?=$total_projets;?></td>
+ </tr>
+ <?foreach ($categories as $idc => $categorie):?>
+ <tr class="categories">
+ <th class="categories_titre"><?=$categorie['nom'];?> [<?=$categorie['abreviation'];?>]</th>
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <td class="categories_total"><?=(isset($utilisateur['projets'][$idc]['total'])) ? $utilisateur['projets'][$idc]['total'] : "&nbsp;";?></td>
+ <?php endforeach; ?>
+ <td class="total"><?=$categorie['total'];?></td>
+ </tr>
+ <?foreach ($categorie['projets'] as $idp => $projet):?>
+ <tr class="utilisateur <?=$ligne ; $ligne = ($ligne == "impair") ? "pair" : "impair" ;?>">
+ <th id="pr:<?=$idp;?>" title="<?=$projet['desc'];?>"><?=$projet['nom'];?></th>
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <td class="projet"><?=(isset($utilisateur['projets'][$idc][$idp])) ? $utilisateur['projets'][$idc][$idp]['duree'] : "&nbsp;";?></td>
+ <?php endforeach; ?>
+ <td class="total"><?=$projet['total'];?></td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ <?php if ($absences) : ?>
+ <tr class="total">
+ <th class="absences_titre">Absences</th>
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <td><?=$utilisateur['total_a'];?></td>
+ <?php endforeach; ?>
+ <td class="total"><?=$total_absences;?></td>
+ </tr>
+ <?php foreach ($absences as $ida => $absence) : ?>
+ <tr class="utilisateur <?=$ligne ; $ligne = ($ligne == "impair") ? "pair" : "impair" ;?>">
+ <th id="ab:<?=$ida;?>" class="absence_nom"><?=$absence['nom'];?></th>
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <td class="absence"><?= (isset($utilisateur['ab'][$ida])) ? $utilisateur['ab'][$ida] : "&nbsp;";?></td>
+ <?php endforeach; ?>
+ <td class="total"><?= (isset($absence['total'])) ? $absence['total'] : "&nbsp;";?></td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ <tr class="total">
+ <th>Total</th>
+ <?php foreach ($utilisateurs as $utilisateur) : ?>
+ <td><?=(isset($utilisateur['total'])) ? $utilisateur['total'] : "&nbsp;";?></td>
+ <?php endforeach; ?>
+ <td class="total"><?=$total_absences_projets;?></td>
+ </tr>
+ </tbody>
+</table>
+<?php endif; ?>
+
+<?php if (isset($messages)) : ?>
+<?php foreach ($messages as $message) : ?>
+<p class="information"><?=$message;?></p>
+<?php endforeach; ?>
+<?php endif; ?>
\ No newline at end of file
Index: v1.1-thales/presentation/connexion.tpl.html
===================================================================
--- v1.1-thales/presentation/connexion.tpl.html (revision 0)
+++ v1.1-thales/presentation/connexion.tpl.html (revision 161)
@@ -0,0 +1,19 @@
+<form action="<?=$url;?>" method="post" name="login" id="login">
+<fieldset>
+ <legend>Identifiez vous</legend>
+ <table id="connexion">
+ <caption>Identification</caption>
+ <tr>
+ <th>Courriel</th>
+ <td><input name="username" type="text" /></td>
+ </tr>
+ <tr>
+ <th>Mot de passe</th>
+ <td><input name="password" type="password" /></td>
+ </tr>
+ <tr>
+ <td colspan="2"><input name="btn_submit" value="OK" type="submit" /></td>
+ </tr>
+ </table>
+</fieldset>
+</form>
\ No newline at end of file
Index: v1.1-thales/presentation/preferences.tpl.html
===================================================================
--- v1.1-thales/presentation/preferences.tpl.html (revision 0)
+++ v1.1-thales/presentation/preferences.tpl.html (revision 161)
@@ -0,0 +1,61 @@
+<?php if (isset($messages)) : ?>
+<?php foreach ($messages as $message) : ?>
+<p class="information"><?=$message;?></p>
+<?php endforeach; ?>
+<?php endif; ?>
+<?php if ($preferences) : ?>
+<div id="preferences">
+ <form class="centre" id="gestion_admin_pref" action="index.php?action=<?=GTT_ACTION_PREFERENCE_VALIDER;?>" name="gestion_admin_pref" method="post">
+ <input name="champ_nb_total_proj" value="<?=$nbre_projets;?>" type="hidden"/>
+ <table id="preference">
+ <thead>
+ <tr>
+ <th>&nbsp;</th>
+ <th>Nom</th>
+ <th>Description</th>
+ <th>Date début</th>
+ <th>Date fin</th>
+ <th>Durée prévue</th>
+ <th>Durée financée</th>
+ <th>Avancement (%)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?foreach ($preferences as $categorie => $projets):?>
+ <tr class="categories"><th colspan="8"><?=$categorie;?></th></tr>
+ <?php $ligne = "impair"; ?>
+ <?foreach ($projets as $projet):?>
+ <tr class="<?=$ligne ; $ligne = ($ligne == "impair") ? "pair" : "impair" ;?>">
+ <td class="check"><input id="pr:<?=$projet['id'];?>" name="pr:<?=$projet['id'];?>" value="<?=$projet['valeur'];?>" type="checkbox" <?=$projet['coche']?'checked="checked"':'';?>/></td>
+ <td class="pr_no"><?=$projet['no'];?></td>
+ <td class="pr_de"><?=$projet['de'];?></td>
+ <td class="pr_dade"><?=($projet['dade'] != '0000-00-00') ? $projet['dade'] : '&nbsp;' ;?></td>
+ <td class="pr_dafi"><?=($projet['dafi'] != '0000-00-00') ? $projet['dafi'] : '&nbsp;' ;?></td>
+ <td class="pr_dupr"><?=(!empty($projet['dupr'])) ? $projet['dupr'] : '&nbsp;' ;?></td>
+ <td class="pr_dufi"><?=(!empty($projet['dufi'])) ? $projet['dufi'] : '&nbsp;' ;?></td>
+ <td class="pr_av">
+ <?php if (!empty($projet['av'])) : ?>
+ <img height="10"
+ width="<?=$projet['av'];?>"
+ title="<?=$projet['av'];?> %"
+ src="presentation/images/pixels/avancement.png"
+ style="cursor:crosshair;padding-right:<?=(100 - $projet['av']);?>px;border:1px solid #DDD;"
+ alt="<?=$projet['av'];?> %" />
+ <?php else : ?>
+ <img height="10"
+ width="100"
+ style="cursor:crosshair;border:1px solid #DDD;"
+ src="presentation/images/pixels/vide.png"
+ title="<?=$projet['av'];?> %"
+ alt="0 %" />
+ <?php endif; ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ <input class="btn_large" id="btn_valider_editer" name="btn_valider_editer" value="<?=$i18n_general_valider;?>" type="submit" />
+ </form>
+</div>
+<?php endif; ?>
\ No newline at end of file
Index: v1.1-thales/presentation/images/pixels/vide.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: v1.1-thales/presentation/images/pixels/vide.png
===================================================================
--- v1.1-thales/presentation/images/pixels/vide.png (revision 0)
+++ v1.1-thales/presentation/images/pixels/vide.png (revision 161)
/v1.1-thales/presentation/images/pixels/vide.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: v1.1-thales/presentation/images/pixels/avancement.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: v1.1-thales/presentation/images/pixels/avancement.png
===================================================================
--- v1.1-thales/presentation/images/pixels/avancement.png (revision 0)
+++ v1.1-thales/presentation/images/pixels/avancement.png (revision 161)
/v1.1-thales/presentation/images/pixels/avancement.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: v1.1-thales/presentation/images/favicones/gtt.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: v1.1-thales/presentation/images/favicones/gtt.ico
===================================================================
--- v1.1-thales/presentation/images/favicones/gtt.ico (revision 0)
+++ v1.1-thales/presentation/images/favicones/gtt.ico (revision 161)
/v1.1-thales/presentation/images/favicones/gtt.ico
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: v1.1-thales/presentation/images/favicones/gtt.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: v1.1-thales/presentation/images/favicones/gtt.png
===================================================================
--- v1.1-thales/presentation/images/favicones/gtt.png (revision 0)
+++ v1.1-thales/presentation/images/favicones/gtt.png (revision 161)
/v1.1-thales/presentation/images/favicones/gtt.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: v1.1-thales/presentation/images/icones/lien_externe.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: v1.1-thales/presentation/images/icones/lien_externe.png
===================================================================
--- v1.1-thales/presentation/images/icones/lien_externe.png (revision 0)
+++ v1.1-thales/presentation/images/icones/lien_externe.png (revision 161)
/v1.1-thales/presentation/images/icones/lien_externe.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Index: v1.1-thales/presentation/menu.tpl.html
===================================================================
--- v1.1-thales/presentation/menu.tpl.html (revision 0)
+++ v1.1-thales/presentation/menu.tpl.html (revision 161)
@@ -0,0 +1,21 @@
+<h2>Menu</h2>
+<h3>Général</h3>
+<ul>
+ <li><a href="index.php?action=gestion">Gestion de mon temps</a></li>
+ <li><a href="index.php?action=preferences">Gestion de mes projets</a></li>
+</ul>
+<h3>Statistiques</h3>
+<ul>
+ <li><a href="index.php?action=stat-tableau-global">Tableau général</a></li>
+ <li><a href="index.php?action=stat-tableau-charge">Plan de charge</a></li>
+</ul>
+<?php if ($bool_admin) : ?>
+<h3>Administration</h3>
+<ul>
+ <li><a href="index.php?action=admin-projet">Projets</a></li>
+ <li><a href="index.php?action=admin-categorie" title="Modifier, supprimer et ajouter des catégories pour les projets">Categories des projets</a></li>
+ <li><a href="index.php?action=admin-absence-motif">Motifs des absences</a></li>
+ <li><a href="index.php?action=admin-utilisateur-statut">Statuts des utilisateurs</a></li>
+ <li><a href="index.php?action=admin-utilisateur">Utilisateurs</a></li>
+</ul>
+<?php endif; ?>
\ No newline at end of file
Index: v1.1-thales/presentation/identite.tpl.html
===================================================================
--- v1.1-thales/presentation/identite.tpl.html (revision 0)
+++ v1.1-thales/presentation/identite.tpl.html (revision 161)
@@ -0,0 +1,19 @@
+<div id="identite">
+ <h2>Votre identité</h2>
+ <dl class="ajout_2_points">
+ <dt>Prénom</dt>
+ <dd><?=$prenom;?></dd>
+ <dt>Nom</dt>
+ <dd><?=$nom;?></dd>
+ <dt title="Vous devez travailler le nombre d'heure indiqué par jour (pour un temps plein)">Temps travail</dt>
+ <dd><?=$tps_w;?> h. par j.</dd>
+ <!-- Nous ne l'affichons pas tant que nous ne le gérons pas mieux et automatiquement
+ <dt title="Nombre de congés payés vous restant à prendre">CP restants</dt>
+ <dd><?=$cp;?> h. (&asymp; <?=$cp_j;?> j.)</dd>
+ -->
+ <dt title="Nombre d'heures supplémentaires accumulées">Heures sup.</dt>
+ <dd><?=$rtt;?> h. (&asymp; <?=$rtt_j;?> j.)</dd>
+ </dl>
+ <p><a href="index.php?action=identification_deconnexion">Déconnexion</a></p>
+ <hr/>
+</div>
\ No newline at end of file
Index: v1.1-thales/presentation/admin_absence_motif.tpl.html
===================================================================
--- v1.1-thales/presentation/admin_absence_motif.tpl.html (revision 0)
+++ v1.1-thales/presentation/admin_absence_motif.tpl.html (revision 161)
@@ -0,0 +1,50 @@
+<?php if (isset($messages)) : ?>
+<?php foreach ($messages as $message) : ?>
+<p class="information"><?=$message;?></p>
+<?php endforeach; ?>
+<?php endif; ?>
+<?php if (isset($motifs)) : ?>
+<form id="admin_absence_motif_editer" class="editer" name="admin_absence_motif_editer" action="index.php?action=admin-absence-motif_editer" method="post">
+ <fieldset>
+ <legend>Éditer un motif d'absence</legend>
+ <ul>
+ <li>
+ <label for="amsu_id">Motif d'absence :</label>
+ <select id="amsu_id" name="amsu_id">
+ <?php foreach ($motifs as $motif) : ?>
+ <option value="<?=$motif['id'];?>"><?=$motif['libelle'];?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li><input id="btn_absence_motif_supprimer" name="btn_absence_motif_supprimer" value="Supprimer" type="submit" onclick="javascript:return confirm('Êtes vous sûr de vouloir supprimer ce motif d\'abscence ?');"/></li>
+ <li><input id="btn_absence_motif_modifier" name="btn_absence_motif_modifier" value="Modifier" type="submit" /></li>
+ </ul>
+ </fieldset>
+</form>
+<?php endif; ?>
+<form id="admin_absence_motif_ajouter" name="admin_absence_motif_ajouter" action="<?=$form_url;?>" method="post">
+ <fieldset>
+ <legend><?=$form_legend;?></legend>
+ <ul>
+ <li>
+ <label for="amaj_libelle">Libellé :</label>
+ <input size="30" id="amaj_libelle" name="amaj_libelle" type="text" value="<?=$AbsenceMotif->getLibelle();?>"/>
+ <span class="symbole_obligatoire">*</span>
+ </li>
+ <li>
+ <label for="amaj_mark_cp_diminuer">Diminue le nombre de congés payés :</label>
+ <input id="amaj_mark_cp_diminuer" name="amaj_mark_cp_diminuer" type="checkbox" value="1" <?=($AbsenceMotif->getMarkCpDiminuer())?'checked="checked"':'';?>/>
+ </li>
+ <li>
+ <label for="amaj_mark_hs_diminuer">Diminue le nombre d'heures suplémentaires :</label>
+ <input id="amaj_mark_hs_diminuer" name="amaj_mark_hs_diminuer" type="checkbox" value="1" <?=($AbsenceMotif->getMarkHsDiminuer())?'checked="checked"':'';?>/>
+ </li>
+ <li>
+ <input name="amaj_id_absence_motif" type="hidden" value="<?=$AbsenceMotif->getIdAbsenceMotif();?>"/>
+ <input id="<?=$form_bouton_id;?>" name="<?=$form_bouton_id;?>" value="<?=$form_bouton_value;?>" type="submit" />
+ <input id="btn_utilisateur_annuler" name="btn_utilisateur_annuler" value="Annuler" type="submit" />
+ </li>
+ <li><span class="symbole_obligatoire">*</span> =champs obligatoires</li>
+ </ul>
+ </fieldset>
+</form>
\ No newline at end of file
Index: v1.1-thales/presentation/gestion.tpl.html
===================================================================
--- v1.1-thales/presentation/gestion.tpl.html (revision 0)
+++ v1.1-thales/presentation/gestion.tpl.html (revision 161)
@@ -0,0 +1,83 @@
+<div id="info">
+ <p id="info_aujourdhui">Aujourd'hui, nous sommes le <a href="<?=$jc_url;?>"><?=$jc['jour'];?> <?=$jc['mois_nom'];?> <?=$jc['annee'];?></a></p>
+ <p id="info_semaine">Semaine du <a href="<?=$jc_url;?>"><?=$sjc_1['jour'];?> <?=$sjc_1['mois'];?> <?=$sjc_1['annee'];?> au <?=$sjc_7['jour'];?> <?=$sjc_7['mois'];?> <?=$sjc_7['annee'];?></a></p>
+</div>
+<div id="calendrier_gestion" class="calendrier">
+<?php if ($bool_projets) : ?>
+ <form class="centre" id="gestion" name="gestion" action="<?=$url_gestion_valider;?>" method="post">
+ <table id="tab_gestion">
+ <caption>
+ <a href="<?=$url_semaine_precedente;?>">&lt;&lt;</a>
+ <?=$sj_1['jour'];?> <?=$sj_1['mois'];?> <?=$sj_1['annee'];?> au <?=$sj_7['jour'];?> <?=$sj_7['mois'];?> <?=$sj_7['annee'];?>
+ <a href="<?=$url_semaine_suivante;?>">&gt;&gt;</a>
+ </caption>
+ <thead>
+ <tr>
+ <th>Projets</th>
+ <?php foreach ($elements[$s] as $jour) : ?>
+ <th class="<?=$jour['class'];?>">
+ <?=$jour['jour_nom'];?> <?=$jour['jour'];?>
+ </th>
+ <?php endforeach; ?>
+ </tr>
+ </thead>
+ <tbody>
+ <?php if ($bool_projets) : ?>
+ <?foreach ($preferences as $categorie => $projets):?>
+ <tr>
+ <td class="categorie"><?=$categorie;?></td>
+ <?php foreach ($elements[$s] as $num => $jour) : ?>
+ <td class="categorie_total pr" data-num-jour="<?=$num;?>"><?=$categorie_totaux[$categorie][$num];?></td>
+ <?php endforeach; ?>
+ </tr>
+ <?foreach ($projets as $projet):?>
+ <tr>
+ <td class="projet" title="<?=$projet['desc'];?>"><?=$projet['nom'];?></td>
+ <?php foreach ($elements[$s] as $num => $jour) : ?>
+ <td class="<?=$jour['class'];?>">
+ <input id="pr:<?=$projet['id'];?>:<?=$num;?>" class="pr" name="pr:<?=$projet['id'];?>:<?=$num;?>"
+ value="<?=$projet['date'][$num];?>" type="text" data-num-jour="<?=$num;?>"/>
+ </td>
+ <?php endforeach; ?>
+ </tr>
+ <?php endforeach; ?>
+ <?php endforeach; ?>
+ <? endif;?>
+ <tr>
+ <td class="categorie">Journées d'absences</td>
+ <?php foreach ($elements[$s] as $num => $jour) : ?>
+ <td class="categorie_total"><?=$ab_total[$num];?></td>
+ <?php endforeach; ?>
+ </tr>
+ <?php foreach ($ab as $ab_id => $tab_ab_jours) : ?>
+ <tr>
+ <td class="absence_titre"><?=$ab_libelle[$ab_id];?></td>
+ <?php foreach ($elements[$s] as $num => $jour) : ?>
+ <td class="ab <?=$jour['class'];?>">
+ <?php if ($tab_ab_jours[$num]['duree_defaut'] != 0) : ?>
+ <input id="ab:<?=$ab_id;?>:<?=$num;?>" class="ab" name="ab:<?=$num;?>"
+ value="<?=$ab_id;?>:<?=($tab_ab_jours[$num]['duree'] != '') ? $tab_ab_jours[$num]['duree'] : $tab_ab_jours[$num]['duree_defaut'];?>" type="checkbox"
+ <?=(!empty($tab_ab_jours[$num]['duree'])) ? 'checked="checked"' : '' ?>
+ data-num-jour="<?=$num;?>"
+ data-ab-id="<?=$ab_id;?>"
+ data-duree-defaut="<?=$tab_ab_jours[$num]['duree_defaut'];?>"/>
+ <?php endif; ?>
+ </td>
+ <?php endforeach; ?>
+ </tr>
+ <?php endforeach; ?>
+
+ <tr>
+ <td class="totaux_titre">Totaux journée</td>
+ <?php foreach ($elements[$s] as $num => $jour) : ?>
+ <td class="totaux"><?=$totaux[$num];?></td>
+ <?php endforeach; ?>
+ </tr>
+ </tbody>
+ </table>
+ <input class="btn_large" id="btn_valider" name="btn_valider" value="<?=$i18n_general_valider;?>" type="submit" />
+ </form>
+<?php else : ?>
+ <p class="information">Veuillez sélectionner des projets via le menu "Gestion de mes projets".</p>
+<? endif;?>
+</div>
\ No newline at end of file
Index: v1.1-thales/presentation/stat_tableau_charge.tpl.csv
===================================================================
--- v1.1-thales/presentation/stat_tableau_charge.tpl.csv (revision 0)
+++ v1.1-thales/presentation/stat_tableau_charge.tpl.csv (revision 161)
@@ -0,0 +1,22 @@
+<?php if (isset($projets) || isset($absences)) : ?>
+Projets <?php foreach ($elements as $jour) : ?><?=$jour['jour_nom']?> <?=$jour['jour']?> <?php endforeach; ?>Total
+<?php if (isset($projets)) : ?>
+Travail <?php foreach ($elements as $jour) : ?><?=(!empty($jour['travail'])) ? $jour['travail'] : ' ';?> <?php endforeach; ?><?=$total_w;?>
+<?foreach ($projets as $categorie => $pr):?>
+
+<?=$categorie;?> [<?=$categories[$categorie]['abreviation'];?>] <?php foreach ($elements as $jour_id => $jour) : ?><?=(isset($categories[$categorie][$jour_id])) ? $categories[$categorie][$jour_id] : ' ';?> <?php endforeach; ?><?=$categories[$categorie]['total'];?>
+
+<?foreach ($pr as $id => $projet):?>
+<?=$projet['nom'];?> <?php foreach ($elements as $jour_id => $jour) : ?><?=(isset($projet['duree'][$jour_id])) ? $projet['duree'][$jour_id] : ' ';?> <?php endforeach; ?><?=(isset($projet['total'])) ? $projet['total'] : ' ';?>
+
+<?php endforeach; ?><?php endforeach; ?><?php endif; ?>
+
+<?php if (isset($absences)) : ?>
+Absences <?php foreach ($elements as $jour) : ?><?=(!empty($jour['absence'])) ? $jour['absence'] : ' ';?> <?php endforeach; ?><?=$total_a;?>
+
+<?php foreach ($absences as $ab_id => $absence) : ?>
+<?=$absence['nom'];?> <?php foreach ($elements as $jour_id => $jour) : ?><?= (isset($ab[$ab_id][$jour_id])) ? $ab[$ab_id][$jour_id] : ' ';?> <?php endforeach; ?><?=(!empty($absence['total'])) ? $absence['total'] : '' ;?>
+
+<?php endforeach; ?><?php endif; ?>
+Total <?php foreach ($elements as $jour) : ?><?=(!empty($jour['w_et_a'])) ? $jour['w_et_a'] : ' ';?> <?php endforeach; ?><?=$total;?>
+<?php endif; ?>
\ No newline at end of file
Index: v1.1-thales/presentation/admin_categorie.tpl.html
===================================================================
--- v1.1-thales/presentation/admin_categorie.tpl.html (revision 0)
+++ v1.1-thales/presentation/admin_categorie.tpl.html (revision 161)
@@ -0,0 +1,43 @@
+<?php if (isset($message)) : ?>
+<p class="information"><?=$message;?></p>
+<?php endif; ?>
+<?php if ($categories) : ?>
+<form id="admin_categorie_editer" class="editer" name="admin_categorie_editer" action="index.php?action=admin-categorie_editer" method="post">
+ <fieldset>
+ <legend>Éditer une catégorie</legend>
+ <ul>
+ <li>
+ <label for="casu_id">Catégorie :</label>
+ <select id="casu_id" name="casu_id">
+ <?php foreach ($categories as $categorie) : ?>
+ <option value="<?=$categorie['id'];?>"><?=$categorie['libelle'];?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li><input id="btn_categorie_modifier" name="btn_categorie_modifier" value="Modifier" type="submit" /></li>
+ <li><input id="btn_categorie_supprimer" name="btn_categorie_supprimer" value="Supprimer" type="submit" onclick="javascript:return confirm('Êtes vous sûr de vouloir supprimer cette catégorie ?');" /></li>
+ </ul>
+ </fieldset>
+</form>
+<?php endif; ?>
+<form id="admin_categorie_ajouter" name="admin_categorie_ajouter" action="<?=$form_url;?>" method="post">
+ <fieldset>
+ <legend><?=$form_legend;?></legend>
+ <ul>
+ <li>
+ <label for="caaj_libelle">Libelle :</label>
+ <input size="30" id="caaj_libelle" name="caaj_libelle" type="text" value="<?=$ProjetCategorie->getLibelle();?>"/>
+ <span class="symbole_obligatoire">*</span>
+ </li>
+ <li>
+ <label for="caaj_abreviation">Abréviation :</label>
+ <input size="25" maxlength="25" id="caaj_abreviation" name="caaj_abreviation" type="text" value="<?=$ProjetCategorie->getAbreviation();?>"/>
+ </li>
+ <li>
+ <input name="caaj_id_categorie" type="hidden" value="<?=$ProjetCategorie->getIdCategorie();?>"/>
+ <input id="<?=$form_bouton_id;?>" name="<?=$form_bouton_id;?>" value="<?=$form_bouton_value;?>" type="submit" />
+ <input id="btn_categorie_annuler" name="btn_categorie_annuler" value="Annuler" type="submit" />
+ <li><span class="symbole_obligatoire">*</span> =champs obligatoires</li>
+ </ul>
+ </fieldset>
+</form>
\ No newline at end of file
Index: v1.1-thales/presentation/admin_projet.tpl.html
===================================================================
--- v1.1-thales/presentation/admin_projet.tpl.html (revision 0)
+++ v1.1-thales/presentation/admin_projet.tpl.html (revision 161)
@@ -0,0 +1,78 @@
+<?php if (isset($messages)) : ?>
+<?php foreach ($messages as $message) : ?>
+<p class="information"><?=$message;?></p>
+<?php endforeach; ?>
+<?php endif; ?>
+
+<?php if ($projets) : ?>
+<form id="admin_projet_editer" class="editer" name="admin_projet_editer" action="index.php?action=admin-projet_editer" method="post">
+ <fieldset>
+ <legend>Éditer un projet</legend>
+ <ul>
+ <li>
+ <label for="prsu_id">Projet :</label>
+ <select id="prsu_id" name="prsu_id">
+ <?php foreach ($projets as $projet) : ?>
+ <option value="<?=$projet['id'];?>"><?=$projet['nom'];?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li><input id="btn_projet_modifier" name="btn_projet_modifier" value="Modifier" type="submit" /></li>
+ <li><input id="btn_projet_supprimer" name="btn_projet_supprimer" value="Supprimer" type="submit" onclick="javascript:return confirm('Êtes vous sûr de vouloir supprimer ce projet ?');" /></li>
+ </ul>
+ </fieldset>
+</form>
+<?php endif; ?>
+<form id="admin_projet_ajouter" name="admin_projet_ajouter" action="<?=$form_url;?>" method="post">
+ <fieldset>
+ <legend><?=$form_legend;?></legend>
+ <ul>
+ <li>
+ <label for="praj_nom">Nom du projet :</label>
+ <input size="30" id="praj_nom" name="praj_nom" type="text" value="<?=$Projet->getNom();?>"/>
+ <span class="symbole_obligatoire">*</span>
+ </li>
+ <li>
+ <label for="praj_ce_categorie">Catégorie :</label>
+ <?php if ($categories) : ?>
+ <select id="praj_ce_categorie" name="praj_ce_categorie">
+ <?php foreach ($categories as $Categorie) : ?>
+ <option value="<?=$Categorie->getIdCategorie();?>" <?=(isset($CategorieDefaut) && $CategorieDefaut->getIdCategorie() == $Categorie->getIdCategorie()) ? 'selected="selected"' : '';?>><?=$Categorie->getLibelle();?></option>
+ <?php endforeach; ?>
+ </select>
+ <?php else : ?>
+ <input size="30" id="praj_ce_categorie" name="praj_ce_categorie" type="text" disabled="disabled" value="Veuillez définir des catégories..."/>
+ <?php endif; ?>
+ </li>
+ <li>
+ <label for="praj_description">Description :</label>
+ <textarea rows="10" cols="50" id="praj_description" name="praj_description"><?=$Projet->getDescription();?></textarea>
+ </li>
+ <li>
+ <label for="praj_date_debut">Date de début :</label>
+ <input size="30" id="praj_date_debut" name="praj_date_debut" type="text" value="<?=$Projet->getDateDebut();?>"/>
+ </li>
+ <li>
+ <label for="praj_date_fin">Date de fin :</label>
+ <input size="30" id="praj_date_fin" name="praj_date_fin" type="text" value="<?=$Projet->getDateFin();?>"/>
+ </li>
+ <li>
+ <label for="praj_duree_prevue">Durée prévue (en jour) :</label>
+ <input size="30" id="praj_duree_prevue" name="praj_duree_prevue" type="text" value="<?=$Projet->getDureePrevue();?>"/>
+ </li>
+ <li>
+ <label for="praj_duree_finance">Durée financée (en jour) :</label>
+ <input size="30" id="praj_duree_finance" name="praj_duree_finance" type="text" value="<?=$Projet->getDureeFinance();?>"/>
+ </li>
+ <li>
+ <label for="praj_avancement">Avancement (en %) :</label>
+ <input size="10" id="praj_avancement" name="praj_avancement" type="text" value="<?=$Projet->getAvancement();?>"/>
+ </li>
+ <li>
+ <input name="praj_id_projet" type="hidden" value="<?=$Projet->getIdProjet();?>"/>
+ <input id="<?=$form_bouton_id;?>" name="<?=$form_bouton_id;?>" value="<?=$form_bouton_value;?>" type="submit" />
+ <input id="btn_projet_annuler" name="btn_projet_annuler" value="Annuler" type="submit" />
+ <li><span class="symbole_obligatoire">*</span> =champs obligatoires</li>
+ </ul>
+ </fieldset>
+</form>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/FraisKm.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/FraisKm.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/FraisKm.class.php (revision 161)
@@ -0,0 +1,198 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe FraisKm
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class FraisKm : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class FraisKm extends aGttSql {
+ /*** Constantes : */
+ const GFK_ID = 'FRAISKM_ID';
+ const GFK_ID_MAX = 'FRAISKM_ID_MAX';
+
+ /*** Attributs : */
+ private $id_frais_km;
+ private $gfkt_id_frais_km_taux;
+ private $ce_utilisateur;
+ private $date;
+ private $nbre_km;
+ private $objet;
+ private $trajet;
+ private $montant_total;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_frais_km';
+ $this->dao_correspondance = array(
+ 'gfk_id_frais_km' => 'id_frais_km',
+ 'gfkt_id_frais_km_taux' => 'gfkt_id_frais_km_taux',
+ 'gfk_ce_utilisateur' => 'ce_utilisateur',
+ 'gfk_date' => 'date',
+ 'gfk_nbre_km' => 'nbre_km',
+ 'gfk_objet' => 'objet',
+ 'gfk_trajet' => 'trajet',
+ 'gfk_montant_total' => 'montant_total');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Frais Km
+ public function getIdFraisKm()
+ {
+ return $this->id_frais_km;
+ }
+ public function setIdFraisKm( $ifk )
+ {
+ $this->id_frais_km = $ifk;
+ }
+
+ // Gfkt Id Frais Km Taux
+ public function getGfktIdFraisKmTaux()
+ {
+ return $this->gfkt_id_frais_km_taux;
+ }
+ public function setGfktIdFraisKmTaux( $gifkt )
+ {
+ $this->gfkt_id_frais_km_taux = $gifkt;
+ }
+
+ // Ce Utilisateur
+ public function getCeUtilisateur()
+ {
+ return $this->ce_utilisateur;
+ }
+ public function setCeUtilisateur( $cu )
+ {
+ $this->ce_utilisateur = $cu;
+ }
+
+ // Date
+ public function getDate()
+ {
+ return $this->date;
+ }
+ public function setDate( $d )
+ {
+ $this->date = $d;
+ }
+
+ // Nbre Km
+ public function getNbreKm()
+ {
+ return $this->nbre_km;
+ }
+ public function setNbreKm( $nk )
+ {
+ $this->nbre_km = $nk;
+ }
+
+ // Objet
+ public function getObjet()
+ {
+ return $this->objet;
+ }
+ public function setObjet( $o )
+ {
+ $this->objet = $o;
+ }
+
+ // Trajet
+ public function getTrajet()
+ {
+ return $this->trajet;
+ }
+ public function setTrajet( $t )
+ {
+ $this->trajet = $t;
+ }
+
+ // Montant Total
+ public function getMontantTotal()
+ {
+ return $this->montant_total;
+ }
+ public function setMontantTotal( $mt )
+ {
+ $this->montant_total = $mt;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_frais_km.
+ * @return mixed un tableau d'objets FraisKm s'il y en a plusieurs, l'objet FraisKm s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case FraisKm::GFK_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_frais_km '.
+ 'WHERE gfk_id_frais_km = #0 ';
+ break;
+ case FraisKm::GFK_ID_MAX:
+ $requete = 'SELECT MAX(gfk_id_frais_km) '.
+ 'FROM gestion_frais_km ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/FraisKmTaux.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/FraisKmTaux.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/FraisKmTaux.class.php (revision 161)
@@ -0,0 +1,126 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe FraisKmTaux
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class FraisKmTaux : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class FraisKmTaux extends aGttSql {
+ /*** Constantes : */
+ const GFKT_ID = 'FRAISKMTAUX_ID';
+ const GFKT_ID_MAX = 'FRAISKMTAUX_ID_MAX';
+
+ /*** Attributs : */
+ private $id_frais_km_taux;
+ private $taux;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_frais_km_taux';
+ $this->dao_correspondance = array(
+ 'gfkt_id_frais_km_taux' => 'id_frais_km_taux',
+ 'gfkt_taux' => 'taux');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Frais Km Taux
+ public function getIdFraisKmTaux()
+ {
+ return $this->id_frais_km_taux;
+ }
+ public function setIdFraisKmTaux( $ifkt )
+ {
+ $this->id_frais_km_taux = $ifkt;
+ }
+
+ // Taux
+ public function getTaux()
+ {
+ return $this->taux;
+ }
+ public function setTaux( $t )
+ {
+ $this->taux = $t;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_frais_km_taux.
+ * @return mixed un tableau d'objets FraisKmTaux s'il y en a plusieurs, l'objet FraisKmTaux s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case FraisKmTaux::GFKT_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_frais_km_taux '.
+ 'WHERE gfkt_id_frais_km_taux = #0 ';
+ break;
+ case FraisKmTaux::GFKT_ID_MAX:
+ $requete = 'SELECT MAX(gfkt_id_frais_km_taux) '.
+ 'FROM gestion_frais_km_taux ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/AbsenceMotif.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/AbsenceMotif.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/AbsenceMotif.class.php (revision 161)
@@ -0,0 +1,161 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe AbsenceMotif
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class AbsenceMotif : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class AbsenceMotif extends aGttSql {
+ /*** Constantes : */
+ const GAM_TOUS = 'ABSENCEMOTIF_TOUS';
+ const GAM_ID = 'ABSENCEMOTIF_ID';
+ const GAM_ID_MAX = 'ABSENCEMOTIF_ID_MAX';
+ const GAM_LIBELLE = 'ABSENCEMOTIF_LIBELLE';
+
+ /*** Attributs : */
+ private $id_absence_motif;
+ private $libelle;
+ private $mark_cp_diminuer;
+ private $mark_hs_diminuer;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_absence_motif';
+ $this->dao_correspondance = array(
+ 'gam_id_absence_motif' => 'id_absence_motif',
+ 'gam_libelle' => 'libelle',
+ 'gam_mark_cp_diminuer' => 'mark_cp_diminuer',
+ 'gam_mark_hs_diminuer' => 'mark_hs_diminuer');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Absence Motif
+ public function getIdAbsenceMotif()
+ {
+ return $this->id_absence_motif;
+ }
+ public function setIdAbsenceMotif( $iam )
+ {
+ $this->id_absence_motif = $iam;
+ }
+
+ // Libelle
+ public function getLibelle()
+ {
+ return $this->libelle;
+ }
+ public function setLibelle( $l )
+ {
+ $this->libelle = $l;
+ }
+
+ // CP Diminuer
+ public function getMarkCpDiminuer()
+ {
+ return $this->mark_cp_diminuer;
+ }
+ public function setMarkCpDiminuer( $cd )
+ {
+ $this->mark_cp_diminuer = $cd;
+ }
+
+ // HS Diminuer
+ public function getMarkHsDiminuer()
+ {
+ return $this->mark_hs_diminuer;
+ }
+ public function setMarkHsDiminuer( $hd )
+ {
+ $this->mark_hs_diminuer = $hd;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_absence_motif.
+ * @return mixed un tableau d'objets AbsenceMotif s'il y en a plusieurs, l'objet AbsenceMotif s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case AbsenceMotif::GAM_TOUS:
+ $requete = 'SELECT * '.
+ 'FROM gestion_absence_motif ';
+ break;
+ case AbsenceMotif::GAM_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_absence_motif '.
+ 'WHERE gam_id_absence_motif = #0 ';
+ break;
+ case AbsenceMotif::GAM_ID_MAX:
+ $requete = 'SELECT MAX(gam_id_absence_motif) AS gam_id_absence_motif '.
+ 'FROM gestion_absence_motif ';
+ break;
+ case AbsenceMotif::GAM_LIBELLE:
+ $requete = 'SELECT * '.
+ 'FROM gestion_absence_motif '.
+ 'WHERE gam_libelle = "#0" ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/UtilisateurAProjet.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/UtilisateurAProjet.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/UtilisateurAProjet.class.php (revision 161)
@@ -0,0 +1,144 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe UtilisateurAProjet
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class UtilisateurAProjet : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class UtilisateurAProjet extends aGttSql {
+ /*** Constantes : */
+ const GUAP_ID = 'UTILISATEURAPROJET_ID';
+ const GUAP_ID_MAX_UTILISATEUR = 'UTILISATEURAPROJET_ID_MAX_UTILISATEUR';
+ const GUAP_ID_MAX_PROJET = 'UTILISATEURAPROJET_ID_MAX_PROJET';
+ const GUAP_UTILISATEUR = 'UTILISATEURAPROJET_ID_UTILISATEUR';
+ const GUAP_PROJET = 'UTILISATEURAPROJET_ID_PROJET';
+
+ /*** Attributs : */
+ private $id_utilisateur;
+ private $id_projet;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_utilisateur_a_projet';
+ $this->dao_correspondance = array(
+ 'guap_id_utilisateur' => 'id_utilisateur',
+ 'guap_id_projet' => 'id_projet');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Utilisateur
+ public function getIdUtilisateur()
+ {
+ return $this->id_utilisateur;
+ }
+ public function setIdUtilisateur( $iu )
+ {
+ $this->id_utilisateur = $iu;
+ }
+
+ // Id Projet
+ public function getIdProjet()
+ {
+ return $this->id_projet;
+ }
+ public function setIdProjet( $ip )
+ {
+ $this->id_projet = $ip;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_utilisateur_a_projet.
+ * @return mixed un tableau d'objets UtilisateurAProjet s'il y en a plusieurs, l'objet UtilisateurAProjet s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case UtilisateurAProjet::GUAP_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur_a_projet '.
+ 'WHERE guap_id_utilisateur = #0 '.
+ ' AND guap_id_projet = #1 ';
+ break;
+ case UtilisateurAProjet::GUAP_ID_MAX_UTILISATEUR:
+ $requete = 'SELECT MAX(guap_id_utilisateur) '.
+ 'FROM gestion_utilisateur_a_projet ';
+ break;
+ case UtilisateurAProjet::GUAP_ID_MAX_PROJET:
+ $requete = 'SELECT MAX(guap_id_projet) '.
+ 'FROM gestion_utilisateur_a_projet ';
+ break;
+ case UtilisateurAProjet::GUAP_UTILISATEUR:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur_a_projet '.
+ 'WHERE guap_id_utilisateur = #0 ';
+ break;
+ case UtilisateurAProjet::GUAP_PROJET:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur_a_projet '.
+ 'WHERE guap_id_projet = #0 ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/UtilisateurStatut.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/UtilisateurStatut.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/UtilisateurStatut.class.php (revision 161)
@@ -0,0 +1,149 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe UtilisateurStatut
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class UtilisateurStatut : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class UtilisateurStatut extends aGttSql {
+ /*** Constantes : */
+ const GUS_TOUS = 'UTILISATEURSTATUT_TOUS';
+ const GUS_ID = 'UTILISATEURSTATUT_ID';
+ const GUS_ID_MAX = 'UTILISATEURSTATUT_ID_MAX';
+ const GUS_LIBELLE = 'UTILISATEURSTATUT_LIBELLE';
+
+ /*** Attributs : */
+ private $id_utilisateur_statut;
+ private $libelle;
+ private $mark_recapitulatif;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_utilisateur_statut';
+ $this->dao_correspondance = array(
+ 'gus_id_utilisateur_statut' => 'id_utilisateur_statut',
+ 'gus_libelle' => 'libelle',
+ 'gus_mark_recapitulatif' => 'mark_recapitulatif');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Utilisateur Statut
+ public function getIdUtilisateurStatut()
+ {
+ return $this->id_utilisateur_statut;
+ }
+ public function setIdUtilisateurStatut( $ius )
+ {
+ $this->id_utilisateur_statut = $ius;
+ }
+
+ // Libelle
+ public function getLibelle()
+ {
+ return $this->libelle;
+ }
+ public function setLibelle( $l )
+ {
+ $this->libelle = $l;
+ }
+
+ // Mark Recapitulatif
+ public function getMarkRecapitulatif()
+ {
+ return $this->mark_recapitulatif;
+ }
+ public function setMarkRecapitulatif( $mr )
+ {
+ $this->mark_recapitulatif = $mr;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_utilisateur_statut.
+ * @return mixed un tableau d'objets UtilisateurStatut s'il y en a plusieurs, l'objet UtilisateurStatut s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case UtilisateurStatut::GUS_TOUS:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur_statut ';
+ break;
+ case UtilisateurStatut::GUS_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur_statut '.
+ 'WHERE gus_id_utilisateur_statut = #0 ';
+ break;
+ case UtilisateurStatut::GUS_ID_MAX:
+ $requete = 'SELECT MAX(gus_id_utilisateur_statut) AS gus_id_utilisateur_statut '.
+ 'FROM gestion_utilisateur_statut ';
+ break;
+ case UtilisateurStatut::GUS_LIBELLE:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur_statut '.
+ 'WHERE gus_libelle = "#0" ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/aGttSql.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/aGttSql.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/aGttSql.class.php (revision 161)
@@ -0,0 +1,274 @@
+<?php
+
+abstract class aGttSql {
+
+ /*** Attributs : */
+ private $base_de_donnees = GTT_BDD_NOM;
+ protected $table_nom;
+ protected $correspondance;
+
+ /*** Accesseurs : */
+
+ // Base De Donnees
+ function getBaseDeDonnees()
+ {
+ return $this->base_de_donnees;
+ }
+ function setBaseDeDonnees($bdd)
+ {
+ $this->base_de_donnees = $bdd;
+ }
+ // TableNom
+ function getTableNom()
+ {
+ return $this->dao_table_nom;
+ }
+ function setTableNom($tn)
+ {
+ $this->dao_table_nom = $tn;
+ }
+ // Correspondance
+ function getCorrespondance($champ = null)
+ {
+ if (!is_null($champ)) {
+ return $this->dao_correspondance[$champ];
+ }
+ return $this->dao_correspondance;
+ }
+ function setCorrespondance($c)
+ {
+ $this->dao_correspondance = $c;
+ }
+
+ /*** Méthodes : */
+
+ /** Instancie un objet utilisateur à partir d'un enregistrement issu de la base de donnée ou l'inverse.
+ * Cette métohode permet de s'abstraire des noms des champs présent dans la base de donnée.
+ */
+ protected function basculerEnregistrementObjet($donnees, $instancier = false)
+ {
+ $classe = get_class($this);
+ if (is_array($donnees)) {
+ if ($instancier) {
+ foreach ($this->getCorrespondance() as $champ => $attribut) {
+ if (isset($donnees[$champ]) && !is_null($donnees[$champ])) {
+ $methode = $this->donnerMethodeSetAvecAttribut($attribut);
+ $this->$methode($donnees[$champ]);
+ }
+ }
+ } else {
+ $Objet = new $classe;
+ foreach ($this->getCorrespondance() as $champ => $attribut) {
+ if (isset($donnees[$champ]) && !is_null($donnees[$champ])) {
+ $methode = $this->donnerMethodeSetAvecAttribut($attribut);
+ $Objet->$methode($donnees[$champ]);
+ }
+ }
+ return $Objet;
+ }
+ } else if ($donnees instanceof $classe) {
+ $enregistrement = array();
+ foreach ($this->getCorrespondance() as $champ => $attribut) {
+ $methode = $this->donnerMethodeGetAvecAttribut($attribut);
+ if (method_exists($donnees, $methode)) {
+ if (!is_null($donnees->$methode())) {
+ $enregistrement[$champ] = $donnees->$methode();
+ }
+ }
+ }
+ return $enregistrement;
+ }
+ }
+ private function donnerMethodeGetAvecAttribut($attribut)
+ {
+ return 'get'.str_replace(' ', '', ucwords(str_replace('_', ' ', $attribut)));
+ }
+ private function donnerMethodeGetAvecChamp($champ)
+ {
+ return 'get'.str_replace(' ', '', ucwords(str_replace('_', ' ', $this->getCorrespondance($champ))));
+ }
+ private function donnerMethodeSetAvecAttribut($attribut)
+ {
+ return 'set'.str_replace(' ', '', ucwords(str_replace('_', ' ', $attribut)));
+ }
+ private function donnerMethodeSetAvecChamp($champ)
+ {
+ return 'set'.str_replace(' ', '', ucwords(str_replace('_', ' ', $this->getCorrespondance($champ))));
+ }
+
+ /**
+ * Consulter un ou plusieurs enregistrements dans la base de données.
+ * Chaque requête comportant des paramêtre doivent les inclures sous la forme "#0" pour le paramêtre 0,
+ * puis "#1" pour le paramêtre 1 et ainsi de suite.
+ * Exemple : SELECT * FROM gestion_projet WHERE gp_id_projet = #0
+ * ou SELECT * FROM gestion_projet WHERE gp_nom_projet = "#0"
+ * @return mixed false, un objet, un tableau d'objet ou rien et instancie l'objet courant.
+ */
+ public function consulter($requete, $parametres = null, $instancier = false)
+ {
+ // Formatage de la requête avec les paramêtres s'il y en a
+ if (!is_null($parametres)) {
+ if (!is_array($parametres)) {
+ $parametres = array('#0' => $parametres);
+ } else {
+ // Ajout d'un # devant chaque clé numérique
+ if (count($parametres) > 0) {
+ foreach ($parametres as $c => $v) {
+ $parametres['#'.$c] = $v;
+ }
+ }
+ }
+ // Remplacement dans la requete par les valeurs des paramêtres
+ $requete = strtr($requete, $parametres);
+ }
+ if (GTT_DEBOGAGE_SQL) {
+ trigger_error($requete, E_USER_NOTICE);
+ }
+ $tps = microtime(true);
+ $resultat = $GLOBALS['db']->query($requete);
+ $GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true));
+ (DB::isError($resultat)) ? trigger_error(GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete), E_USER_ERROR) : '' ;
+ $tab_resultat = array();
+ while ($donnees =& $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
+ $tab_resultat[] = $this->basculerEnregistrementObjet($donnees, $instancier);
+ }
+ $resultat_nbre = count($tab_resultat);
+ if ($resultat_nbre >= 1) {
+ return $tab_resultat;
+ } else if ($resultat_nbre == 0) {
+ return false;
+ }
+ }
+
+ /**
+ * Ajouter un enregistrement dans la base de données.
+ * @return true si ok, false si aucun enregistrement effectué
+ */
+ public function ajouter()
+ {
+ $enregistrement = $this->basculerEnregistrementObjet($this);
+ $sql_attributs = '';
+ $sql_valeurs = '';
+ foreach($enregistrement as $champ => $val) {
+ if (!is_numeric($val)) {
+ $val = '"'.$val.'"';
+ }
+ $sql_attributs .= $champ.', ';
+ $sql_valeurs .= $val.', ';
+ }
+ $sql_attributs = trim($sql_attributs, ', ');
+ $sql_valeurs = trim($sql_valeurs, ', ');
+ $requete = 'INSERT INTO '.$this->getBaseDeDonnees().'.'.$this->getTableNom().' '.
+ '( '.$sql_attributs.' ) '.
+ 'VALUES '.
+ '( '.$sql_valeurs.' )';
+ if (GTT_DEBOGAGE_SQL) {
+ trigger_error($requete, E_USER_NOTICE);
+ }
+ $tps = microtime(true);
+ $resultat = $GLOBALS['db']->query($requete);
+ $GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true));
+ (DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
+ $nbre_enregistrement_ajoute = $GLOBALS['db']->affectedRows();
+ if ($nbre_enregistrement_ajoute == 1) {
+ return true;
+ } elseif ($nbre_enregistrement_ajoute == 0) {
+ return false;
+ }
+ }
+
+ /**
+ * Modifier un enregistrement dans la base de données.
+ * @param object l'ancien objet contenant les valeurs de clés primaires non modifiées. Laissé vide si on ne modifie pas les clés.
+ * @return true si ok, false si aucun enregistrement effectué.
+ */
+ public function modifier($Ancien = null)
+ {
+ $enregistrement = $this->basculerEnregistrementObjet($this);
+ $sql_where = '';
+ $sql_set = '';
+ foreach($enregistrement as $champ => $val) {
+ if (!is_numeric($val)) {
+ $val = '"'.$val.'"';
+ }
+ $sql_set .= $champ.' = '.$val.', ';
+ $classe = get_class($this);
+ if ($Ancien instanceof $classe) {
+ $methode = $this->donnerMethodeGetAvecChamp($champ);
+ $val = $Ancien->$methode();
+ if (!is_numeric($val)) {
+ $val = '"'.$val.'"';
+ }
+ }
+ if (preg_match('/_id_/', $champ)) {
+ $sql_where .= $champ.' = '.$val.' AND ';
+ }
+ }
+ $sql_set = trim($sql_set, ', ').' ';
+ $sql_where = trim($sql_where, ' AND ').' ';
+ $requete = 'UPDATE '.$this->getBaseDeDonnees().'.'.$this->getTableNom().' SET '.$sql_set.'WHERE '.$sql_where;
+ if (GTT_DEBOGAGE_SQL) {
+ trigger_error($requete, E_USER_NOTICE);
+ }
+ $tps = microtime(true);
+ $resultat = $GLOBALS['db']->query($requete);
+ $GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true));
+ (DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
+ $nbre_enregistrement_ajoute = $GLOBALS['db']->affectedRows();
+ if ($nbre_enregistrement_ajoute == 1) {
+ return true;
+ } elseif ($nbre_enregistrement_ajoute == 0) {
+ return false;
+ }
+ }
+
+ /**
+ * Supprimer un enregistrement dans la base de données.
+ * @return true si ok, false si aucun enregistrement effectué
+ */
+ public function supprimer()
+ {
+ $enregistrement = $this->basculerEnregistrementObjet($this);
+ $sql_where = '';
+ foreach($enregistrement as $champ => $val) {
+ if (!is_numeric($val)) {
+ $val = '"'.$val.'"';
+ }
+ //if (preg_match('/_id_/', $champ)) {
+ $sql_where .= $champ.' = '.$val.' AND ';
+ //}
+ }
+ $sql_where = trim($sql_where, ' AND ').' ';
+ $requete = 'DELETE FROM '.$this->getBaseDeDonnees().'.'.$this->getTableNom().' WHERE '.$sql_where ;
+ if (GTT_DEBOGAGE_SQL) {
+ trigger_error($requete, E_USER_NOTICE);
+ }
+ $tps = microtime(true);
+ $resultat = $GLOBALS['db']->query($requete);
+ $GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true));
+ (DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
+
+ $nbre_enregistrement_suppr = $GLOBALS['db']->affectedRows();
+ if ($nbre_enregistrement_suppr == 1) {
+ return true;
+ } elseif ($nbre_enregistrement_suppr == 0) {
+ return false;
+ }
+ }
+
+ /** Mettre à NULL les champs de l'objet*/
+ public function initialiser()
+ {
+ foreach ($this->getCorrespondance() as $champ => $attribut) {
+ $methode = $this->donnerMethodeSetAvecAttribut($attribut);
+ $this->$methode(null);
+ }
+ }
+
+ /** Afficher l'objet courrant. */
+ public function afficher()
+ {
+ echo '<pre>'.print_r($this, true).'</pre>';
+ }
+}
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/Absence.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/Absence.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/Absence.class.php (revision 161)
@@ -0,0 +1,182 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe Absence
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class Absence : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class Absence extends aGttSql {
+ /*** Constantes : */
+ const GA_ID = 'ABSENCE_ID';
+ const GA_ID_ABSENCE_MOTIF = 'ABSENCE_ID_ABSENCE_MOTIF';
+ const GA_ID_UTILISATEUR = 'ABSENCE_ID_UTILISATEUR';
+ const GA_ID_UTILISATEUR_DATE_DEB_FIN = 'ABSENCE_ID_UTILISATEUR_DATE_DEB_FIN';
+ const GA_ID_MAX_UTILISATEUR = 'ABSENCE_ID_MAX_UTILISATEUR';
+ const GA_ID_MAX_ABSENCE_MOTIF = 'ABSENCE_ID_MAX_ABSENCE_MOTIF';
+ const GA_ID_MAX_DATE_ABSENCE = 'ABSENCE_ID_MAX_DATE_ABSENCE';
+
+ /*** Attributs : */
+ private $id_utilisateur;
+ private $id_absence_motif;
+ private $id_date_absence;
+ private $duree;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_absence';
+ $this->dao_correspondance = array(
+ 'ga_id_utilisateur' => 'id_utilisateur',
+ 'ga_id_absence_motif' => 'id_absence_motif',
+ 'ga_id_date_absence' => 'id_date_absence',
+ 'ga_duree' => 'duree');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Utilisateur
+ public function getIdUtilisateur()
+ {
+ return $this->id_utilisateur;
+ }
+ public function setIdUtilisateur( $iu )
+ {
+ $this->id_utilisateur = $iu;
+ }
+
+ // Id Absence Motif
+ public function getIdAbsenceMotif()
+ {
+ return $this->id_absence_motif;
+ }
+ public function setIdAbsenceMotif( $iam )
+ {
+ $this->id_absence_motif = $iam;
+ }
+
+ // Id Date Absence
+ public function getIdDateAbsence()
+ {
+ return $this->id_date_absence;
+ }
+ public function setIdDateAbsence( $ida )
+ {
+ $this->id_date_absence = $ida;
+ }
+
+ // Duree
+ public function getDuree()
+ {
+ return $this->duree;
+ }
+ public function setDuree( $d )
+ {
+ $this->duree = $d;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_absence.
+ * @return mixed un tableau d'objets Absence s'il y en a plusieurs, l'objet Absence s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case Absence::GA_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_absence '.
+ 'WHERE ga_id_utilisateur = #0 '.
+ ' AND ga_id_absence_motif = #1 '.
+ ' AND ga_id_date_absence = #2 ';
+ break;
+ case Absence::GA_ID_ABSENCE_MOTIF:
+ $requete = 'SELECT * '.
+ 'FROM gestion_absence '.
+ 'WHERE ga_id_absence_motif = #0 ';
+ break;
+ case Absence::GA_ID_UTILISATEUR:
+ $requete = 'SELECT * '.
+ 'FROM gestion_absence '.
+ 'WHERE ga_id_utilisateur = #0 ';
+ break;
+ case Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN:
+ $requete = 'SELECT * '.
+ 'FROM gestion_absence '.
+ 'WHERE ga_id_utilisateur = #0 '.
+ ' AND ga_id_date_absence >= "#1" '.
+ ' AND ga_id_date_absence <= "#2" ';
+ break;
+ case Absence::GA_ID_MAX_UTILISATEUR:
+ $requete = 'SELECT MAX(ga_id_utilisateur) '.
+ 'FROM gestion_absence ';
+ break;
+ case Absence::GA_ID_MAX_ABSENCE_MOTIF:
+ $requete = 'SELECT MAX(ga_id_absence_motif) '.
+ 'FROM gestion_absence ';
+ break;
+ case Absence::GA_ID_MAX_DATE_ABSENCE:
+ $requete = 'SELECT MAX(ga_id_date_absence) '.
+ 'FROM gestion_absence ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/Nombre.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/Nombre.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/Nombre.class.php (revision 161)
@@ -0,0 +1,37 @@
+<?php
+
+class Nombre {
+
+ public static function formaterNbre($tableau, $format = 'fr', $debog = false) {
+ if (is_array($tableau)) {
+ if ($debog) {
+ trigger_error('pt2='.print_r($tableau, true), E_USER_NOTICE);
+ }
+ foreach ($tableau as $c => $v) {
+ $tableau[$c] = Nombre::formaterNbre($v, $format, $debog);
+ if ($debog) {
+ trigger_error('pt3='.print_r($tableau[$c], true), E_USER_NOTICE);
+ }
+ }
+ } else if (is_float($tableau) || is_int($tableau) || preg_match('/^(?:\d+|\d+\.\d+)$/', $tableau)) {
+ if ($debog) {
+ trigger_error('pt1='.print_r($tableau, true), E_USER_NOTICE);
+ }
+ switch ($format) {
+ case 'fr' :
+ if (is_float($tableau) || preg_match('/^\d+\.\d+$/', $tableau)) {
+ // Nous supprimons les 0 après la virgule puis la virgule s'il n'y pas de chifre après
+ $tableau = rtrim(rtrim(number_format($tableau, 2, ',', ' '), '0'), ',');
+ }
+ if (is_int($tableau) || preg_match('/^\d+$/', $tableau)) {
+ $tableau = number_format($tableau, 0, ',', ' ');
+ }
+ break;
+ default:
+ trigger_error("Format pour les nombres non pris en charge : $format", E_USER_WARNING);
+ }
+ }
+ return $tableau;
+ }
+}
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/Projet.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/Projet.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/Projet.class.php (revision 161)
@@ -0,0 +1,248 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe Projet
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class Projet : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class Projet extends aGttSql {
+ /*** Constantes : */
+ const GP_TOUS = 'PROJET_TOUS';
+ const GP_ID = 'PROJET_ID';
+ const GP_NOM = 'PROJET_NOM';
+ const GP_ID_MAX = 'PROJET_ID_MAX';
+ const GP_ID_LIST = 'PROJET_ID_LIST';
+ const GP_CE_CATEGORIE = 'PROJET_CE_CATEGORIE';
+
+ /*** Attributs : */
+ private $id_projet;
+ private $ce_projet_parent;
+ private $ce_categorie;
+ private $nom;
+ private $description;
+ private $date_debut;
+ private $date_fin;
+ private $duree_prevue;
+ private $duree_finance;
+ private $avancement;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_projet';
+ $this->dao_correspondance = array(
+ 'gp_id_projet' => 'id_projet',
+ 'gp_ce_projet_parent' => 'ce_projet_parent',
+ 'gp_ce_categorie' => 'ce_categorie',
+ 'gp_nom' => 'nom',
+ 'gp_description' => 'description',
+ 'gp_date_debut' => 'date_debut',
+ 'gp_date_fin' => 'date_fin',
+ 'gp_duree_prevue' => 'duree_prevue',
+ 'gp_duree_finance' => 'duree_finance',
+ 'gp_avancement' => 'avancement');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Projet
+ public function getIdProjet()
+ {
+ return $this->id_projet;
+ }
+ public function setIdProjet( $ip )
+ {
+ $this->id_projet = $ip;
+ }
+
+ // Ce Projet Parent
+ public function getCeProjetParent()
+ {
+ return $this->ce_projet_parent;
+ }
+ public function setCeProjetParent( $cpp )
+ {
+ $this->ce_projet_parent = $cpp;
+ }
+
+
+ // Ce Categorie
+ public function getCeCategorie()
+ {
+ return $this->ce_categorie;
+ }
+ public function setCeCategorie( $cc )
+ {
+ $this->ce_categorie = $cc;
+ }
+
+ // Nom
+ public function getNom()
+ {
+ return $this->nom;
+ }
+ public function setNom( $n )
+ {
+ $this->nom = $n;
+ }
+
+ // Description
+ public function getDescription()
+ {
+ return $this->description;
+ }
+ public function setDescription( $d )
+ {
+ $this->description = $d;
+ }
+
+ // Date Debut
+ public function getDateDebut()
+ {
+ return $this->date_debut;
+ }
+ public function setDateDebut( $dd )
+ {
+ $this->date_debut = $dd;
+ }
+
+ // Date Fin
+ public function getDateFin()
+ {
+ return $this->date_fin;
+ }
+ public function setDateFin( $df )
+ {
+ $this->date_fin = $df;
+ }
+
+ // Duree Prevue
+ public function getDureePrevue()
+ {
+ return $this->duree_prevue;
+ }
+ public function setDureePrevue( $dp )
+ {
+ $this->duree_prevue = $dp;
+ }
+
+ // Duree Finance
+ public function getDureeFinance()
+ {
+ return $this->duree_finance;
+ }
+ public function setDureeFinance( $df )
+ {
+ $this->duree_finance = $df;
+ }
+
+ // Avancement
+ public function getAvancement()
+ {
+ return $this->avancement;
+ }
+ public function setAvancement( $a )
+ {
+ $this->avancement = $a;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_projet.
+ * @return mixed un tableau d'objets Projet s'il y en a plusieurs, l'objet Projet s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case Projet::GP_TOUS:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet LEFT JOIN gestion_projet_categorie ON (gp_ce_categorie = gpc_id_categorie) '.
+ 'ORDER BY gpc_libelle, gp_nom ASC';
+ break;
+ case Projet::GP_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet '.
+ 'WHERE gp_id_projet = #0 ';
+ break;
+ case Projet::GP_NOM:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet '.
+ 'WHERE gp_nom = "#0" ';
+ break;
+ case Projet::GP_ID_MAX:
+ $requete = 'SELECT MAX(gp_id_projet) AS gp_id_projet '.
+ 'FROM gestion_projet ';
+ break;
+ case Projet::GP_ID_LIST:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet LEFT JOIN gestion_projet_categorie ON (gp_ce_categorie = gpc_id_categorie) '.
+ 'WHERE gp_id_projet IN (#0) '.
+ 'ORDER BY gpc_libelle, gp_nom ASC';
+ break;
+ case Projet::GP_CE_CATEGORIE:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet '.
+ 'WHERE gp_ce_categorie = #0 ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/ProjetCategorie.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/ProjetCategorie.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/ProjetCategorie.class.php (revision 161)
@@ -0,0 +1,151 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe ProjetCategorie
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class ProjetCategorie : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class ProjetCategorie extends aGttSql {
+ /*** Constantes : */
+ const GPC_TOUS = 'PROJETCATEGORIE_TOUS';
+ const GPC_ID = 'PROJETCATEGORIE_ID';
+ const GPC_ID_MAX = 'PROJETCATEGORIE_ID_MAX';
+ const GPC_LIBELLE = 'PROJETCATEGORIE_LIBELLE';
+
+ /*** Attributs : */
+ private $id_categorie;
+ private $libelle;
+ private $abreviation;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_projet_categorie';
+ $this->dao_correspondance = array(
+ 'gpc_id_categorie' => 'id_categorie',
+ 'gpc_libelle' => 'libelle',
+ 'gpc_abreviation' => 'abreviation');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Categorie
+ public function getIdCategorie()
+ {
+ return $this->id_categorie;
+ }
+ public function setIdCategorie( $ic )
+ {
+ $this->id_categorie = $ic;
+ }
+
+ // Libelle
+ public function getLibelle()
+ {
+ return $this->libelle;
+ }
+ public function setLibelle( $l )
+ {
+ $this->libelle = $l;
+ }
+
+ // Abreviation
+ public function getAbreviation()
+ {
+ return $this->abreviation;
+ }
+ public function setAbreviation( $a )
+ {
+ $this->abreviation = $a;
+ }
+
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_projet_categorie.
+ * @return mixed un tableau d'objets ProjetCategorie s'il y en a plusieurs, l'objet ProjetCategorie s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case ProjetCategorie::GPC_TOUS:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet_categorie '.
+ 'ORDER BY gpc_libelle';
+ break;
+ case ProjetCategorie::GPC_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet_categorie '.
+ 'WHERE gpc_id_categorie = #0 ';
+ break;
+ case ProjetCategorie::GPC_ID_MAX:
+ $requete = 'SELECT MAX(gpc_id_categorie) AS gpc_id_categorie '.
+ 'FROM gestion_projet_categorie ';
+ break;
+ case ProjetCategorie::GPC_LIBELLE:
+ $requete = 'SELECT * '.
+ 'FROM gestion_projet_categorie '.
+ 'WHERE gpc_libelle = "#0" ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/TravailProjet.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/TravailProjet.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/TravailProjet.class.php (revision 161)
@@ -0,0 +1,182 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe TravailProjet
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class TravailProjet : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class TravailProjet extends aGttSql {
+ /*** Constantes : */
+ const GTP_ID = 'TRAVAILPROJET_ID';
+ const GTP_ID_UTILISATEUR_DATE_DEB_FIN = 'TRAVAILPROJET_ID_UTILISATEUR_DATE';
+ const GTP_ID_MAX_UTILISATEUR = 'TRAVAILPROJET_ID_MAX_UTILISATEUR';
+ const GTP_ID_MAX_PROJET = 'TRAVAILPROJET_ID_MAX_PROJET';
+ const GTP_ID_MAX_DATE_TRAVAIL = 'TRAVAILPROJET_ID_MAX_DATE_TRAVAIL';
+ const GTP_PROJET = 'TRAVAILPROJET_ID_PROJET';
+ const GTP_UTILISATEUR = 'TRAVAILPROJET_ID_UTILISATEUR';
+
+ /*** Attributs : */
+ private $id_utilisateur;
+ private $id_projet;
+ private $id_date_travail;
+ private $duree;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_travail_projet';
+ $this->dao_correspondance = array(
+ 'gtp_id_utilisateur' => 'id_utilisateur',
+ 'gtp_id_projet' => 'id_projet',
+ 'gtp_id_date_travail' => 'id_date_travail',
+ 'gtp_duree' => 'duree');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Utilisateur
+ public function getIdUtilisateur()
+ {
+ return $this->id_utilisateur;
+ }
+ public function setIdUtilisateur( $iu )
+ {
+ $this->id_utilisateur = $iu;
+ }
+
+ // Id Projet
+ public function getIdProjet()
+ {
+ return $this->id_projet;
+ }
+ public function setIdProjet( $ip )
+ {
+ $this->id_projet = $ip;
+ }
+
+ // Id Date Travail
+ public function getIdDateTravail()
+ {
+ return $this->id_date_travail;
+ }
+ public function setIdDateTravail( $idt )
+ {
+ $this->id_date_travail = $idt;
+ }
+
+ // Duree
+ public function getDuree()
+ {
+ return $this->duree;
+ }
+ public function setDuree( $d )
+ {
+ $this->duree = $d;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_travail_projet.
+ * @return mixed un tableau d'objets TravailProjet s'il y en a plusieurs, l'objet TravailProjet s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case TravailProjet::GTP_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_travail_projet '.
+ 'WHERE gtp_id_utilisateur = #0 '.
+ ' AND gtp_id_projet = #1 '.
+ ' AND gtp_id_date_travail = "#2" ';
+ break;
+ case TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN:
+ $requete = 'SELECT * '.
+ 'FROM gestion_travail_projet '.
+ 'WHERE gtp_id_utilisateur = #0 '.
+ ' AND gtp_id_date_travail >= "#1" '.
+ ' AND gtp_id_date_travail <= "#2" ';
+ break;
+ case TravailProjet::GTP_ID_MAX_UTILISATEUR:
+ $requete = 'SELECT MAX(gtp_id_utilisateur) '.
+ 'FROM gestion_travail_projet ';
+ break;
+ case TravailProjet::GTP_ID_MAX_PROJET:
+ $requete = 'SELECT MAX(gtp_id_projet) '.
+ 'FROM gestion_travail_projet ';
+ break;
+ case TravailProjet::GTP_ID_MAX_DATE_TRAVAIL:
+ $requete = 'SELECT MAX(gtp_id_date_travail) '.
+ 'FROM gestion_travail_projet ';
+ break;
+ case TravailProjet::GTP_PROJET:
+ $requete = 'SELECT gtp_id_projet '.
+ 'FROM gestion_travail_projet '.
+ 'WHERE gtp_id_projet = #0 ';
+ break;
+ case TravailProjet::GTP_UTILISATEUR:
+ $requete = 'SELECT gtp_id_utilisateur '.
+ 'FROM gestion_travail_projet '.
+ 'WHERE gtp_id_utilisateur = #0 ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.' inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/Calendrier.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/Calendrier.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/Calendrier.class.php (revision 161)
@@ -0,0 +1,244 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe Calendrier
+*
+* Description
+*
+*@package Calendrier
+//Auteur original :
+*@version 1
+*@author Dorian BANNIER <dbannier@aol.com>
+//Autres auteurs :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* Classe calendrier pour gerer le calendrier pour un mois et une annee
+*
+*@param annee
+*@param mois
+*@param premier jour du mois
+*@param semaine
+*@param l'url du resultat affiche
+*@param liste de noms des jours
+*@param liste de noms des mois
+*@param liste des jours feries du mois
+*/
+class Calendrier
+{
+ private $annee;
+ private $mois;
+ private $semaine;
+ private $jour;
+ private $nom_jours = array();
+ private $nom_mois = array();
+ private $liste_feries = array();
+
+ /**
+ *constructeur de la classe calendrier
+ *toutes les variables sont initialises avec les donnees
+ *de la date du jour si on ne passe aucune date en parametre
+ *sinon on initialise le calendrier avec
+ *@param semaine
+ *@param annee
+ */
+ public function __construct($jour = null, $semaine = null, $mois = null, $annee = null)
+ {
+ if (is_null($jour)) {
+ $jour = date('d', time());
+ }
+ $this->jour = $jour;
+ if (is_null($semaine)) {
+ $semaine = date('W', time());
+ }
+ $this->semaine = $semaine;
+ if (is_null($mois)) {
+ $mois = date('m', time());
+ }
+ $this->mois = $mois;
+ if (is_null($annee)) {
+ // TODO : vérifier le standard ISO-8601
+ $annee = date('Y', time());
+ }
+ $this->annee = $annee;
+
+ $this->nom_jours = array (1 => GESTION_LUN_A, GESTION_MAR_A, GESTION_MER_A, GESTION_JEU_A, GESTION_VEN_A, GESTION_SAM_A ,GESTION_DIM_A);
+ $this->nom_jours_long = array (1 => GESTION_LUN_L, GESTION_MAR_L, GESTION_MER_L, GESTION_JEU_L, GESTION_VEN_L, GESTION_SAM_L ,GESTION_DIM_L);
+ $this->nom_mois = array(1 => "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
+
+ $this->liste_feries = $this->calculerJoursFeries($this->annee);
+ }
+
+ public function getAnnee()
+ {
+ return $this->annee;
+ }
+
+ public function getMois()
+ {
+ return $this->mois;
+ }
+
+ public function getSemaine()
+ {
+ return $this->semaine;
+ }
+
+ public function getJour()
+ {
+ return $this->jour;
+ }
+
+ public function getNomJours($j = null)
+ {
+ if (is_null($j)) {
+ return $this->nom_jours;
+ }
+ return $this->nom_jours[$j];
+ }
+
+ public function getNomJoursLong($j = null)
+ {
+ if (is_null($j)) {
+ return $this->nom_jours_long;
+ }
+ return $this->nom_jours_long[$j];
+ }
+
+ public function getNomMois($m = null)
+ {
+ if (is_null($m)) {
+ return $this->nom_mois;
+ }
+ return $this->nom_mois[$m];
+ }
+
+ public function getListeFeries()
+ {
+ return $this->liste_feries;
+ }
+
+ /**
+ *Calcule les dates des jours fériés pour la france.
+ *Renvoie un tableau contenant la liste de dates par mois.
+ *Les dates sont de la forme timestamp unix.
+ *
+ *@param integer l'année pour laquelle on veut les jours fériés.
+ *@return array tableau des dates fériées.
+ */
+ public function calculerJoursFeries($annee)
+ {
+ $tab = array( mktime(0,0,0,1,1,$annee),
+ $this->donnerDatePaques($annee),
+ mktime(0,0,0,5,1,$annee),
+ mktime(0,0,0,5,8,$annee),
+ $this->donnerDateAscension($annee),
+ // TODO : gérer les jours fériès depuis l'interface d'admin...
+ // N'est plus un jour férié...
+ //$this->donnerDatePentecote($annee),
+ mktime(0,0,0,7,14,$annee),
+ mktime(0,0,0,8,15,$annee),
+ mktime(0,0,0,11,1,$annee),
+ mktime(0,0,0,11,11,$annee),
+ mktime(0,0,0,12,25,$annee));
+ return $tab;
+ }
+
+ /**
+ *Calcule la date du lundi de Pâques.
+ *
+ *@param integer l'année pour laquelle on veut connaître la date de Pâques
+ *@return integer le timestamp du lundi de Pâques
+ */
+ public function donnerDatePaques($annee)
+ {
+ $date_paques = easter_date($annee);
+ $lundi_paques = mktime( date("H", $date_paques),
+ date("i", $date_paques),
+ date("s", $date_paques),
+ date("m", $date_paques),
+ date("d", $date_paques) + 1,
+ date("Y", $date_paques));
+ return $lundi_paques;
+ }
+ /**
+ *Calcule la date de l'ascension.
+ *
+ *@param integer l'année pour laquelle on veut connaître la date de l'ascencion
+ *@return integer le timestamp de l'ascencion
+ */
+ public function donnerDateAscension($annee)
+ {
+ $date_paques = easter_date($annee);
+ $date_ascension = mktime( date("H", $date_paques),
+ date("i", $date_paques),
+ date("s", $date_paques),
+ date("m", $date_paques),
+ date("d", $date_paques) + 39,
+ date("Y", $date_paques));
+ return $date_ascension;
+ }
+
+ /**
+ *Calcule la date du lundi de la pentecote
+ *Renvoie un timestamp
+ *renvoie cette derniere
+ */
+ public function donnerDatePentecote($annee)
+ {
+ $date_paques = easter_date($annee);
+ $date_ascension = $this->donnerDateAscension($annee);
+ $date_pentecote = mktime( date("H", $date_ascension),
+ date("i", $date_ascension),
+ date("s", $date_ascension),
+ date("m", $date_ascension),
+ date("d", $date_ascension) + 11,
+ date("Y", $date_ascension));
+ return $date_pentecote;
+ }
+
+ /**
+ *Indique si une date est fériée ou non
+ *
+ *@param integer le timestamp de la date à vérifier
+ *@return boolean true si vrai, false si le jour n'est pas férié.
+ */
+ function etreFerie($date)
+ {
+ if (in_array($date, $this->liste_feries)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/NoteFraisLigne.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/NoteFraisLigne.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/NoteFraisLigne.class.php (revision 161)
@@ -0,0 +1,174 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe NoteFraisLigne
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class NoteFraisLigne : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class NoteFraisLigne extends aGttSql {
+ /*** Constantes : */
+ const GNFL_ID = 'NOTEFRAISLIGNE_ID';
+ const GNFL_ID_MAX = 'NOTEFRAISLIGNE_ID_MAX';
+
+ /*** Attributs : */
+ private $id_note_frais_ligne;
+ private $ce_note_frais;
+ private $date;
+ private $montant_ht;
+ private $taux_tva;
+ private $montant_ttc;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_note_frais_ligne';
+ $this->dao_correspondance = array(
+ 'gnfl_id_note_frais_ligne' => 'id_note_frais_ligne',
+ 'gnfl_ce_note_frais' => 'ce_note_frais',
+ 'gnfl_date' => 'date',
+ 'gnfl_montant_ht' => 'montant_ht',
+ 'gnfl_taux_tva' => 'taux_tva',
+ 'gnfl_montant_ttc' => 'montant_ttc');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Note Frais Ligne
+ public function getIdNoteFraisLigne()
+ {
+ return $this->id_note_frais_ligne;
+ }
+ public function setIdNoteFraisLigne( $infl )
+ {
+ $this->id_note_frais_ligne = $infl;
+ }
+
+ // Ce Note Frais
+ public function getCeNoteFrais()
+ {
+ return $this->ce_note_frais;
+ }
+ public function setCeNoteFrais( $cnf )
+ {
+ $this->ce_note_frais = $cnf;
+ }
+
+ // Date
+ public function getDate()
+ {
+ return $this->date;
+ }
+ public function setDate( $d )
+ {
+ $this->date = $d;
+ }
+
+ // Montant Ht
+ public function getMontantHt()
+ {
+ return $this->montant_ht;
+ }
+ public function setMontantHt( $mh )
+ {
+ $this->montant_ht = $mh;
+ }
+
+ // Taux Tva
+ public function getTauxTva()
+ {
+ return $this->taux_tva;
+ }
+ public function setTauxTva( $tt )
+ {
+ $this->taux_tva = $tt;
+ }
+
+ // Montant Ttc
+ public function getMontantTtc()
+ {
+ return $this->montant_ttc;
+ }
+ public function setMontantTtc( $mt )
+ {
+ $this->montant_ttc = $mt;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_note_frais_ligne.
+ * @return mixed un tableau d'objets NoteFraisLigne s'il y en a plusieurs, l'objet NoteFraisLigne s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case NoteFraisLigne::GNFL_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_note_frais_ligne '.
+ 'WHERE gnfl_id_note_frais_ligne = #0 ';
+ break;
+ case NoteFraisLigne::GNFL_ID_MAX:
+ $requete = 'SELECT MAX(gnfl_id_note_frais_ligne) '.
+ 'FROM gestion_note_frais_ligne ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/NoteFrais.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/NoteFrais.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/NoteFrais.class.php (revision 161)
@@ -0,0 +1,138 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe NoteFrais
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class NoteFrais : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class NoteFrais extends aGttSql {
+ /*** Constantes : */
+ const GNF_ID = 'NOTEFRAIS_ID';
+ const GNF_ID_MAX = 'NOTEFRAIS_ID_MAX';
+
+ /*** Attributs : */
+ private $id_note_frais;
+ private $ce_utilisateur;
+ private $libelle;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_note_frais';
+ $this->dao_correspondance = array(
+ 'gnf_id_note_frais' => 'id_note_frais',
+ 'gnf_ce_utilisateur' => 'ce_utilisateur',
+ 'gnf_libelle' => 'libelle');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Note Frais
+ public function getIdNoteFrais()
+ {
+ return $this->id_note_frais;
+ }
+ public function setIdNoteFrais( $inf )
+ {
+ $this->id_note_frais = $inf;
+ }
+
+ // Ce Utilisateur
+ public function getCeUtilisateur()
+ {
+ return $this->ce_utilisateur;
+ }
+ public function setCeUtilisateur( $cu )
+ {
+ $this->ce_utilisateur = $cu;
+ }
+
+ // Libelle
+ public function getLibelle()
+ {
+ return $this->libelle;
+ }
+ public function setLibelle( $l )
+ {
+ $this->libelle = $l;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_note_frais.
+ * @return mixed un tableau d'objets NoteFrais s'il y en a plusieurs, l'objet NoteFrais s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case NoteFrais::GNF_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_note_frais '.
+ 'WHERE gnf_id_note_frais = #0 ';
+ break;
+ case NoteFrais::GNF_ID_MAX:
+ $requete = 'SELECT MAX(gnf_id_note_frais) '.
+ 'FROM gestion_note_frais ';
+ break;
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/metier/Utilisateur.class.php
===================================================================
--- v1.1-thales/bibliotheque/metier/Utilisateur.class.php (revision 0)
+++ v1.1-thales/bibliotheque/metier/Utilisateur.class.php (revision 161)
@@ -0,0 +1,494 @@
+<?php
+// +------------------------------------------------------------------------------------------------------+
+// | PHP version 5.1.1 |
+// +------------------------------------------------------------------------------------------------------+
+// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org) |
+// +------------------------------------------------------------------------------------------------------+
+// | This file is part of eFlore. |
+// | |
+// | Foobar is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation; either version 2 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Foobar 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 General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Foobar; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +------------------------------------------------------------------------------------------------------+
+// CVS : $Id$
+/**
+* Classe Utilisateur
+*
+* Description
+*
+*@package eFlore
+*@subpackage modele
+//Auteur original :
+*@version 3
+*@author Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
+//Autres auteurs :
+*@version 4
+*@author Jean-Pascal MILCENT <jpm@clapas.org>
+*@author aucun
+*@copyright Tela-Botanica 2000-2006
+*@version $Revision$ $Date$
+// +------------------------------------------------------------------------------------------------------+
+*/
+
+/**
+* class Utilisateur : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
+* classe métier
+*/
+class Utilisateur extends aGttSql {
+ /*** Constantes : */
+ const GU_TOUS = 'UTILISATEUR_TOUS';
+ const GU_ID = 'UTILISATEUR_ID';
+ const GU_ID_MAX = 'UTILISATEUR_ID_MAX';
+ const GU_CE_STATUT = 'UTILISATEUR_CE_STATUT';
+ const GU_MAIL = 'UTILISATEUR_MAIL';
+ const GU_TOUS_AFFICHABLE = 'UTILISATEUR_TOUS_AFFICHABLE';
+ const GU_ADMIN = 'UTILISATEUR_ADMIN';
+
+ /*** Attributs : */
+ private $id_utilisateur;
+ private $ce_statut = 0;
+ private $nom;
+ private $prenom;
+ private $password;
+ private $email;
+ private $telephone;
+ private $adresse;
+ private $code_postal;
+ private $ville;
+ private $quota_heures_supp = 0;
+ private $conges_payes = 0;
+ private $temps_de_travail_jour = 7;
+ private $temps_de_travail_mois = 0;
+ private $tdt_lundi = 0;
+ private $tdt_mardi = 0;
+ private $tdt_mercredi = 0;
+ private $tdt_jeudi = 0;
+ private $tdt_vendredi = 0;
+ private $tdt_samedi = 0;
+ private $tdt_dimanche = 0;
+ private $mark_admin = 0;
+ private $mark_recapitulatif = 1;
+ private $notes;
+
+ /*** Aggregations : */
+
+ /*** Constructeur : */
+ public function __construct($cmd = null, $parametres = null)
+ {
+ $this->dao_table_nom = 'gestion_utilisateur';
+ $this->dao_correspondance = array(
+ 'gu_id_utilisateur' => 'id_utilisateur',
+ 'gu_ce_statut' => 'ce_statut',
+ 'gu_nom' => 'nom',
+ 'gu_prenom' => 'prenom',
+ 'gu_password' => 'password',
+ 'gu_email' => 'email',
+ 'gu_telephone' => 'telephone',
+ 'gu_adresse' => 'adresse',
+ 'gu_code_postal' => 'code_postal',
+ 'gu_ville' => 'ville',
+ 'gu_quota_heures_supp' => 'quota_heures_supp',
+ 'gu_conges_payes' => 'conges_payes',
+ 'gu_temps_de_travail_jour' => 'temps_de_travail_jour',
+ 'gu_temps_de_travail_mois' => 'temps_de_travail_mois',
+ 'gu_tdt_lundi' => 'tdt_lundi',
+ 'gu_tdt_mardi' => 'tdt_mardi',
+ 'gu_tdt_mercredi' => 'tdt_mercredi',
+ 'gu_tdt_jeudi' => 'tdt_jeudi',
+ 'gu_tdt_vendredi' => 'tdt_vendredi',
+ 'gu_tdt_samedi' => 'tdt_samedi',
+ 'gu_tdt_dimanche' => 'tdt_dimanche',
+ 'gu_mark_admin' => 'mark_admin',
+ 'gu_mark_recapitulatif' => 'mark_recapitulatif',
+ 'gu_notes' => 'notes');
+
+ // Si l'on veut remplir l'objet à la création on lance la requete correspondante
+ if (!is_null($cmd)) {
+ $this->consulter($cmd, $parametres, true);
+ }
+ }
+
+ /*** Accesseurs : */
+ // Id Utilisateur
+ public function getIdUtilisateur()
+ {
+ return $this->id_utilisateur;
+ }
+ public function setIdUtilisateur( $iu )
+ {
+ $this->id_utilisateur = $iu;
+ }
+
+ // Gus Id Utilisateur Statut
+ public function getCeStatut()
+ {
+ return $this->ce_statut;
+ }
+ public function setCeStatut( $cs )
+ {
+ $this->ce_statut = $cs;
+ }
+
+ // Nom
+ public function getNom()
+ {
+ return $this->nom;
+ }
+ public function setNom( $n )
+ {
+ if (!is_null($n)) {
+ $this->nom = strtoupper($n);
+ } else {
+ $this->nom = $n;
+ }
+ }
+
+ // Prenom
+ public function getPrenom()
+ {
+ return $this->prenom;
+ }
+ public function setPrenom( $p )
+ {
+ $this->prenom = $p;
+ }
+
+ // Password
+ public function getPassword()
+ {
+ return $this->password;
+ }
+ public function setPassword( $p )
+ {
+ if (!is_null($p)) {
+ $this->password = md5($p);
+ } else {
+ $this->password = $p;
+ }
+ }
+
+ // Email
+ public function getEmail()
+ {
+ return $this->email;
+ }
+ public function setEmail( $e )
+ {
+ $this->email = $e;
+ }
+
+ // Telephone
+ public function getTelephone()
+ {
+ return $this->telephone;
+ }
+ public function setTelephone( $t )
+ {
+ $this->telephone = (string) $t;
+ }
+
+ // Adresse
+ public function getAdresse()
+ {
+ return $this->adresse;
+ }
+ public function setAdresse( $a )
+ {
+ $this->adresse = $a;
+ }
+
+ // Code Postal
+ public function getCodePostal()
+ {
+ return $this->code_postal;
+ }
+ public function setCodePostal( $cp )
+ {
+ $this->code_postal = $cp;
+ }
+
+ // Ville
+ public function getVille()
+ {
+ return $this->ville;
+ }
+ public function setVille( $v )
+ {
+ $this->ville = $v;
+ }
+
+ // Quota Heures Supp
+ public function getQuotaHeuresSupp()
+ {
+ return $this->quota_heures_supp;
+ }
+ public function setQuotaHeuresSupp( $qhs )
+ {
+ $this->quota_heures_supp = $qhs;
+ }
+
+ // Conges Payes
+ public function getCongesPayes()
+ {
+ return $this->conges_payes;
+ }
+ public function setCongesPayes( $cp )
+ {
+ $this->conges_payes = $cp;
+ }
+
+ // Temps De Travail Jour
+ public function getTempsDeTravailJour()
+ {
+ return $this->temps_de_travail_jour;
+ }
+ public function setTempsDeTravailJour( $tdt )
+ {
+ $this->temps_de_travail_jour = $tdt;
+ }
+
+ // Temps De Travail Mois
+ public function getTempsDeTravailMois()
+ {
+ return $this->temps_de_travail_mois;
+ }
+ public function setTempsDeTravailMois( $tdt )
+ {
+ $this->temps_de_travail_mois = $tdt;
+ }
+
+ // Tdt Lundi
+ public function getTdtLundi()
+ {
+ return $this->tdt_lundi;
+ }
+ public function setTdtLundi( $tdt )
+ {
+ $this->tdt_lundi = $tdt;
+ }
+
+ // Tdt Mardi
+ public function getTdtMardi()
+ {
+ return $this->tdt_mardi;
+ }
+ public function setTdtMardi( $tdt )
+ {
+ $this->tdt_mardi = $tdt;
+ }
+
+ // Tdt Mercredi
+ public function getTdtMercredi()
+ {
+ return $this->tdt_mercredi;
+ }
+ public function setTdtMercredi( $tdt )
+ {
+ $this->tdt_mercredi = $tdt;
+ }
+
+ // Tdt Jeudi
+ public function getTdtJeudi()
+ {
+ return $this->tdt_jeudi;
+ }
+ public function setTdtJeudi( $tdt )
+ {
+ $this->tdt_jeudi = $tdt;
+ }
+
+ // Tdt Vendredi
+ public function getTdtVendredi()
+ {
+ return $this->tdt_vendredi;
+ }
+ public function setTdtVendredi( $tdt )
+ {
+ $this->tdt_vendredi = $tdt;
+ }
+
+ // Tdt Samedi
+ public function getTdtSamedi()
+ {
+ return $this->tdt_samedi;
+ }
+ public function setTdtSamedi( $tdt )
+ {
+ $this->tdt_samedi = $tdt;
+ }
+
+ // Tdt Dimanche
+ public function getTdtDimanche()
+ {
+ return $this->tdt_dimanche;
+ }
+ public function setTdtDimanche( $tdt )
+ {
+ $this->tdt_dimanche = $tdt;
+ }
+
+ // Tdt Par Numéro du jour
+ public function getTdtParNumJour($num)
+ {
+ $tdt = 0;
+ if ($num == 1) {
+ $tdt = $this->getTdtLundi();
+ } else if ($num == 2) {
+ $tdt = $this->getTdtMardi();
+ } else if ($num == 3) {
+ $tdt = $this->getTdtMercredi();
+ } else if ($num == 4) {
+ $tdt = $this->getTdtJeudi();
+ } else if ($num == 5) {
+ $tdt = $this->getTdtVendredi();
+ } else if ($num == 6) {
+ $tdt = $this->getTdtSamedi();
+ } else if ($num == 7) {
+ $tdt = $this->getTdtDimanche();
+ }
+
+ return $tdt;
+ }
+
+ // Mark Admin
+ public function getMarkAdmin()
+ {
+ return $this->mark_admin;
+ }
+ public function setMarkAdmin( $ma )
+ {
+ $this->mark_admin = $ma;
+ }
+
+ // Mark Recapitulatif
+ public function getMarkRecapitulatif()
+ {
+ return $this->mark_recapitulatif;
+ }
+ public function setMarkRecapitulatif( $mr )
+ {
+ $this->mark_recapitulatif = $mr;
+ }
+
+ // Notes
+ public function getNotes()
+ {
+ return $this->notes;
+ }
+ public function setNotes( $n )
+ {
+ $this->notes = $n;
+ }
+
+ /*** Méthodes : */
+
+ /**
+ * Consulter la table gestion_utilisateur.
+ * @return mixed un tableau d'objets Utilisateur s'il y en a plusieurs, l'objet Utilisateur s'il y en a 1 seul sinon false.
+ */
+ public function consulter($cmd = '', $parametres = array(), $instancier = false)
+ {
+ switch ($cmd) {
+ case Utilisateur::GU_TOUS:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur '.
+ 'ORDER BY gu_nom, gu_prenom ASC';
+ break;
+ case Utilisateur::GU_ID:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur '.
+ 'WHERE gu_id_utilisateur = #0 ';
+ break;
+ case Utilisateur::GU_ID_MAX:
+ $requete = 'SELECT MAX(gu_id_utilisateur) AS gu_id_utilisateur '.
+ 'FROM gestion_utilisateur ';
+ break;
+ case Utilisateur::GU_CE_STATUT:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur '.
+ 'WHERE gu_ce_statut = "#0" ';
+ break;
+ case Utilisateur::GU_MAIL:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur '.
+ 'WHERE gu_email = "#0" ';
+ break;
+ case Utilisateur::GU_TOUS_AFFICHABLE:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur '.
+ 'WHERE gu_mark_recapitulatif = 0 '.
+ 'ORDER BY gu_nom, gu_prenom ASC';
+ break;
+ case Utilisateur::GU_ADMIN:
+ $requete = 'SELECT * '.
+ 'FROM gestion_utilisateur '.
+ 'WHERE gu_mark_admin = 1 ';
+ break;
+
+ default :
+ $message = 'Commande '.$cmd.'inconnue!';
+ $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
+ trigger_error($e, E_USER_ERROR);
+ }
+ return parent::consulter($requete, $parametres, $instancier);
+ }
+
+ public function supprimer()
+ {
+ $requete = 'DELETE FROM gestion_utilisateur '.
+ 'WHERE gu_id_utilisateur = '.$this->getIdUtilisateur();
+ $resultat = $GLOBALS['db']->query($requete);
+ (DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
+
+ if ($GLOBALS['db']->affectedRows() == 1) {
+ return true;
+ } elseif ($GLOBALS['db']->affectedRows() == 0) {
+ return false;
+ }
+ }
+
+ /**augmenter le nombre d'heure sup
+ *un acces est fait a la bse de donnees pour enregistrer les changements en temps reel
+ */
+ public function augmenterQuotaHeuresSup($nb)
+ {
+ $this->quota_heures_supp = $this->quota_heures_supp + abs($nb);
+ }
+
+ /**diminuer le nb d'heures sup*/
+ public function diminuerQuotaHeuresSup($nb)
+ {
+ $this->quota_heures_supp = $this->quota_heures_supp - abs($nb);
+ /*un quota heure supp negatif implique qu'il y a des heures a rattraper*/
+ }
+
+ /**augmenter le nombre de jours de conges */
+ public function augmenterCongesPayes($nb)
+ {
+ $this->conges_payes = $this->conges_payes + abs($nb);
+ }
+
+ /**diminuer le nombre de jour de conges */
+ public function diminuerCongesPayes($nb)
+ {
+ $this->conges_payes = $this->conges_payes - abs($nb);
+ }
+}
+
+/* +--Fin du code ----------------------------------------------------------------------------------------+
+*
+* $Log$
+*
+* +-- Fin du code ----------------------------------------------------------------------------------------+
+*/
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/pear/DB/fbsql.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/fbsql.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/fbsql.php (revision 161)
@@ -0,0 +1,770 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's fbsql extension
+ * for interacting with FrontBase databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB
+ * @author Frank M. Kromann <frank@frontbase.com>
+ * @author Daniel Convissor <danielc@php.net>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: fbsql.php,v 1.82 2005/03/04 23:12:36 danielc Exp $
+ * @link http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's fbsql extension
+ * for interacting with FrontBase databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * @category Database
+ * @package DB
+ * @author Frank M. Kromann <frank@frontbase.com>
+ * @author Daniel Convissor <danielc@php.net>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version Release: 1.7.6
+ * @link http://pear.php.net/package/DB
+ * @since Class functional since Release 1.7.0
+ */
+class DB_fbsql extends DB_common
+{
+ // {{{ properties
+
+ /**
+ * The DB driver type (mysql, oci8, odbc, etc.)
+ * @var string
+ */
+ var $phptype = 'fbsql';
+
+ /**
+ * The database syntax variant to be used (db2, access, etc.), if any
+ * @var string
+ */
+ var $dbsyntax = 'fbsql';
+
+ /**
+ * The capabilities of this DB implementation
+ *
+ * The 'new_link' element contains the PHP version that first provided
+ * new_link support for this DBMS. Contains false if it's unsupported.
+ *
+ * Meaning of the 'limit' element:
+ * + 'emulate' = emulate with fetch row by number
+ * + 'alter' = alter the query
+ * + false = skip rows
+ *
+ * @var array
+ */
+ var $features = array(
+ 'limit' => 'alter',
+ 'new_link' => false,
+ 'numrows' => true,
+ 'pconnect' => true,
+ 'prepare' => false,
+ 'ssl' => false,
+ 'transactions' => true,
+ );
+
+ /**
+ * A mapping of native error codes to DB error codes
+ * @var array
+ */
+ var $errorcode_map = array(
+ 22 => DB_ERROR_SYNTAX,
+ 85 => DB_ERROR_ALREADY_EXISTS,
+ 108 => DB_ERROR_SYNTAX,
+ 116 => DB_ERROR_NOSUCHTABLE,
+ 124 => DB_ERROR_VALUE_COUNT_ON_ROW,
+ 215 => DB_ERROR_NOSUCHFIELD,
+ 217 => DB_ERROR_INVALID_NUMBER,
+ 226 => DB_ERROR_NOSUCHFIELD,
+ 231 => DB_ERROR_INVALID,
+ 239 => DB_ERROR_TRUNCATED,
+ 251 => DB_ERROR_SYNTAX,
+ 266 => DB_ERROR_NOT_FOUND,
+ 357 => DB_ERROR_CONSTRAINT_NOT_NULL,
+ 358 => DB_ERROR_CONSTRAINT,
+ 360 => DB_ERROR_CONSTRAINT,
+ 361 => DB_ERROR_CONSTRAINT,
+ );
+
+ /**
+ * The raw database connection created by PHP
+ * @var resource
+ */
+ var $connection;
+
+ /**
+ * The DSN information for connecting to a database
+ * @var array
+ */
+ var $dsn = array();
+
+
+ // }}}
+ // {{{ constructor
+
+ /**
+ * This constructor calls <kbd>$this->DB_common()</kbd>
+ *
+ * @return void
+ */
+ function DB_fbsql()
+ {
+ $this->DB_common();
+ }
+
+ // }}}
+ // {{{ connect()
+
+ /**
+ * Connect to the database server, log in and open the database
+ *
+ * Don't call this method directly. Use DB::connect() instead.
+ *
+ * @param array $dsn the data source name
+ * @param bool $persistent should the connection be persistent?
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ */
+ function connect($dsn, $persistent = false)
+ {
+ if (!PEAR::loadExtension('fbsql')) {
+ return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+ }
+
+ $this->dsn = $dsn;
+ if ($dsn['dbsyntax']) {
+ $this->dbsyntax = $dsn['dbsyntax'];
+ }
+
+ $params = array(
+ $dsn['hostspec'] ? $dsn['hostspec'] : 'localhost',
+ $dsn['username'] ? $dsn['username'] : null,
+ $dsn['password'] ? $dsn['password'] : null,
+ );
+
+ $connect_function = $persistent ? 'fbsql_pconnect' : 'fbsql_connect';
+
+ $ini = ini_get('track_errors');
+ $php_errormsg = '';
+ if ($ini) {
+ $this->connection = @call_user_func_array($connect_function,
+ $params);
+ } else {
+ ini_set('track_errors', 1);
+ $this->connection = @call_user_func_array($connect_function,
+ $params);
+ ini_set('track_errors', $ini);
+ }
+
+ if (!$this->connection) {
+ return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+ null, null, null,
+ $php_errormsg);
+ }
+
+ if ($dsn['database']) {
+ if (!@fbsql_select_db($dsn['database'], $this->connection)) {
+ return $this->fbsqlRaiseError();
+ }
+ }
+
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ disconnect()
+
+ /**
+ * Disconnects from the database server
+ *
+ * @return bool TRUE on success, FALSE on failure
+ */
+ function disconnect()
+ {
+ $ret = @fbsql_close($this->connection);
+ $this->connection = null;
+ return $ret;
+ }
+
+ // }}}
+ // {{{ simpleQuery()
+
+ /**
+ * Sends a query to the database server
+ *
+ * @param string the SQL query string
+ *
+ * @return mixed + a PHP result resrouce for successful SELECT queries
+ * + the DB_OK constant for other successful queries
+ * + a DB_Error object on failure
+ */
+ function simpleQuery($query)
+ {
+ $this->last_query = $query;
+ $query = $this->modifyQuery($query);
+ $result = @fbsql_query("$query;", $this->connection);
+ if (!$result) {
+ return $this->fbsqlRaiseError();
+ }
+ // Determine which queries that should return data, and which
+ // should return an error code only.
+ if (DB::isManip($query)) {
+ return DB_OK;
+ }
+ return $result;
+ }
+
+ // }}}
+ // {{{ nextResult()
+
+ /**
+ * Move the internal fbsql result pointer to the next available result
+ *
+ * @param a valid fbsql result resource
+ *
+ * @access public
+ *
+ * @return true if a result is available otherwise return false
+ */
+ function nextResult($result)
+ {
+ return @fbsql_next_result($result);
+ }
+
+ // }}}
+ // {{{ fetchInto()
+
+ /**
+ * Places a row from the result set into the given array
+ *
+ * Formating of the array and the data therein are configurable.
+ * See DB_result::fetchInto() for more information.
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::fetchInto() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result the query result resource
+ * @param array $arr the referenced array to put the data in
+ * @param int $fetchmode how the resulting array should be indexed
+ * @param int $rownum the row number to fetch (0 = first row)
+ *
+ * @return mixed DB_OK on success, NULL when the end of a result set is
+ * reached or on failure
+ *
+ * @see DB_result::fetchInto()
+ */
+ function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+ {
+ if ($rownum !== null) {
+ if (!@fbsql_data_seek($result, $rownum)) {
+ return null;
+ }
+ }
+ if ($fetchmode & DB_FETCHMODE_ASSOC) {
+ $arr = @fbsql_fetch_array($result, FBSQL_ASSOC);
+ if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+ $arr = array_change_key_case($arr, CASE_LOWER);
+ }
+ } else {
+ $arr = @fbsql_fetch_row($result);
+ }
+ if (!$arr) {
+ return null;
+ }
+ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+ $this->_rtrimArrayValues($arr);
+ }
+ if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+ $this->_convertNullArrayValuesToEmpty($arr);
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ freeResult()
+
+ /**
+ * Deletes the result set and frees the memory occupied by the result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::free() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return bool TRUE on success, FALSE if $result is invalid
+ *
+ * @see DB_result::free()
+ */
+ function freeResult($result)
+ {
+ return @fbsql_free_result($result);
+ }
+
+ // }}}
+ // {{{ autoCommit()
+
+ /**
+ * Enables or disables automatic commits
+ *
+ * @param bool $onoff true turns it on, false turns it off
+ *
+ * @return int DB_OK on success. A DB_Error object if the driver
+ * doesn't support auto-committing transactions.
+ */
+ function autoCommit($onoff=false)
+ {
+ if ($onoff) {
+ $this->query("SET COMMIT TRUE");
+ } else {
+ $this->query("SET COMMIT FALSE");
+ }
+ }
+
+ // }}}
+ // {{{ commit()
+
+ /**
+ * Commits the current transaction
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ */
+ function commit()
+ {
+ @fbsql_commit();
+ }
+
+ // }}}
+ // {{{ rollback()
+
+ /**
+ * Reverts the current transaction
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ */
+ function rollback()
+ {
+ @fbsql_rollback();
+ }
+
+ // }}}
+ // {{{ numCols()
+
+ /**
+ * Gets the number of columns in a result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::numCols() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return int the number of columns. A DB_Error object on failure.
+ *
+ * @see DB_result::numCols()
+ */
+ function numCols($result)
+ {
+ $cols = @fbsql_num_fields($result);
+ if (!$cols) {
+ return $this->fbsqlRaiseError();
+ }
+ return $cols;
+ }
+
+ // }}}
+ // {{{ numRows()
+
+ /**
+ * Gets the number of rows in a result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::numRows() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return int the number of rows. A DB_Error object on failure.
+ *
+ * @see DB_result::numRows()
+ */
+ function numRows($result)
+ {
+ $rows = @fbsql_num_rows($result);
+ if ($rows === null) {
+ return $this->fbsqlRaiseError();
+ }
+ return $rows;
+ }
+
+ // }}}
+ // {{{ affectedRows()
+
+ /**
+ * Determines the number of rows affected by a data maniuplation query
+ *
+ * 0 is returned for queries that don't manipulate data.
+ *
+ * @return int the number of rows. A DB_Error object on failure.
+ */
+ function affectedRows()
+ {
+ if (DB::isManip($this->last_query)) {
+ $result = @fbsql_affected_rows($this->connection);
+ } else {
+ $result = 0;
+ }
+ return $result;
+ }
+
+ // }}}
+ // {{{ nextId()
+
+ /**
+ * Returns the next free id in a sequence
+ *
+ * @param string $seq_name name of the sequence
+ * @param boolean $ondemand when true, the seqence is automatically
+ * created if it does not exist
+ *
+ * @return int the next id number in the sequence.
+ * A DB_Error object on failure.
+ *
+ * @see DB_common::nextID(), DB_common::getSequenceName(),
+ * DB_fbsql::createSequence(), DB_fbsql::dropSequence()
+ */
+ function nextId($seq_name, $ondemand = true)
+ {
+ $seqname = $this->getSequenceName($seq_name);
+ do {
+ $repeat = 0;
+ $this->pushErrorHandling(PEAR_ERROR_RETURN);
+ $result = $this->query('SELECT UNIQUE FROM ' . $seqname);
+ $this->popErrorHandling();
+ if ($ondemand && DB::isError($result) &&
+ $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+ $repeat = 1;
+ $result = $this->createSequence($seq_name);
+ if (DB::isError($result)) {
+ return $result;
+ }
+ } else {
+ $repeat = 0;
+ }
+ } while ($repeat);
+ if (DB::isError($result)) {
+ return $this->fbsqlRaiseError();
+ }
+ $result->fetchInto($tmp, DB_FETCHMODE_ORDERED);
+ return $tmp[0];
+ }
+
+ /**
+ * Creates a new sequence
+ *
+ * @param string $seq_name name of the new sequence
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ *
+ * @see DB_common::createSequence(), DB_common::getSequenceName(),
+ * DB_fbsql::nextID(), DB_fbsql::dropSequence()
+ */
+ function createSequence($seq_name)
+ {
+ $seqname = $this->getSequenceName($seq_name);
+ $res = $this->query('CREATE TABLE ' . $seqname
+ . ' (id INTEGER NOT NULL,'
+ . ' PRIMARY KEY(id))');
+ if ($res) {
+ $res = $this->query('SET UNIQUE = 0 FOR ' . $seqname);
+ }
+ return $res;
+ }
+
+ // }}}
+ // {{{ dropSequence()
+
+ /**
+ * Deletes a sequence
+ *
+ * @param string $seq_name name of the sequence to be deleted
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ *
+ * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+ * DB_fbsql::nextID(), DB_fbsql::createSequence()
+ */
+ function dropSequence($seq_name)
+ {
+ return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name)
+ . ' RESTRICT');
+ }
+
+ // }}}
+ // {{{ modifyLimitQuery()
+
+ /**
+ * Adds LIMIT clauses to a query string according to current DBMS standards
+ *
+ * @param string $query the query to modify
+ * @param int $from the row to start to fetching (0 = the first row)
+ * @param int $count the numbers of rows to fetch
+ * @param mixed $params array, string or numeric data to be used in
+ * execution of the statement. Quantity of items
+ * passed must match quantity of placeholders in
+ * query: meaning 1 placeholder for non-array
+ * parameters or 1 placeholder per array element.
+ *
+ * @return string the query string with LIMIT clauses added
+ *
+ * @access protected
+ */
+ function modifyLimitQuery($query, $from, $count, $params = array())
+ {
+ if (DB::isManip($query)) {
+ return preg_replace('/^([\s(])*SELECT/i',
+ "\\1SELECT TOP($count)", $query);
+ } else {
+ return preg_replace('/([\s(])*SELECT/i',
+ "\\1SELECT TOP($from, $count)", $query);
+ }
+ }
+
+ // }}}
+ // {{{ quoteSmart()
+
+ /**
+ * Formats input so it can be safely used in a query
+ *
+ * @param mixed $in the data to be formatted
+ *
+ * @return mixed the formatted data. The format depends on the input's
+ * PHP type:
+ * + null = the string <samp>NULL</samp>
+ * + boolean = string <samp>TRUE</samp> or <samp>FALSE</samp>
+ * + integer or double = the unquoted number
+ * + other (including strings and numeric strings) =
+ * the data escaped according to FrontBase's settings
+ * then encapsulated between single quotes
+ *
+ * @see DB_common::quoteSmart()
+ * @since Method available since Release 1.6.0
+ */
+ function quoteSmart($in)
+ {
+ if (is_int($in) || is_double($in)) {
+ return $in;
+ } elseif (is_bool($in)) {
+ return $in ? 'TRUE' : 'FALSE';
+ } elseif (is_null($in)) {
+ return 'NULL';
+ } else {
+ return "'" . $this->escapeSimple($in) . "'";
+ }
+ }
+
+ // }}}
+ // {{{ fbsqlRaiseError()
+
+ /**
+ * Produces a DB_Error object regarding the current problem
+ *
+ * @param int $errno if the error is being manually raised pass a
+ * DB_ERROR* constant here. If this isn't passed
+ * the error information gathered from the DBMS.
+ *
+ * @return object the DB_Error object
+ *
+ * @see DB_common::raiseError(),
+ * DB_fbsql::errorNative(), DB_common::errorCode()
+ */
+ function fbsqlRaiseError($errno = null)
+ {
+ if ($errno === null) {
+ $errno = $this->errorCode(fbsql_errno($this->connection));
+ }
+ return $this->raiseError($errno, null, null, null,
+ @fbsql_error($this->connection));
+ }
+
+ // }}}
+ // {{{ errorNative()
+
+ /**
+ * Gets the DBMS' native error code produced by the last query
+ *
+ * @return int the DBMS' error code
+ */
+ function errorNative()
+ {
+ return @fbsql_errno($this->connection);
+ }
+
+ // }}}
+ // {{{ tableInfo()
+
+ /**
+ * Returns information about a table or a result set
+ *
+ * @param object|string $result DB_result object from a query or a
+ * string containing the name of a table.
+ * While this also accepts a query result
+ * resource identifier, this behavior is
+ * deprecated.
+ * @param int $mode a valid tableInfo mode
+ *
+ * @return array an associative array with the information requested.
+ * A DB_Error object on failure.
+ *
+ * @see DB_common::tableInfo()
+ */
+ function tableInfo($result, $mode = null)
+ {
+ if (is_string($result)) {
+ /*
+ * Probably received a table name.
+ * Create a result resource identifier.
+ */
+ $id = @fbsql_list_fields($this->dsn['database'],
+ $result, $this->connection);
+ $got_string = true;
+ } elseif (isset($result->result)) {
+ /*
+ * Probably received a result object.
+ * Extract the result resource identifier.
+ */
+ $id = $result->result;
+ $got_string = false;
+ } else {
+ /*
+ * Probably received a result resource identifier.
+ * Copy it.
+ * Deprecated. Here for compatibility only.
+ */
+ $id = $result;
+ $got_string = false;
+ }
+
+ if (!is_resource($id)) {
+ return $this->fbsqlRaiseError(DB_ERROR_NEED_MORE_DATA);
+ }
+
+ if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+ $case_func = 'strtolower';
+ } else {
+ $case_func = 'strval';
+ }
+
+ $count = @fbsql_num_fields($id);
+ $res = array();
+
+ if ($mode) {
+ $res['num_fields'] = $count;
+ }
+
+ for ($i = 0; $i < $count; $i++) {
+ $res[$i] = array(
+ 'table' => $case_func(@fbsql_field_table($id, $i)),
+ 'name' => $case_func(@fbsql_field_name($id, $i)),
+ 'type' => @fbsql_field_type($id, $i),
+ 'len' => @fbsql_field_len($id, $i),
+ 'flags' => @fbsql_field_flags($id, $i),
+ );
+ if ($mode & DB_TABLEINFO_ORDER) {
+ $res['order'][$res[$i]['name']] = $i;
+ }
+ if ($mode & DB_TABLEINFO_ORDERTABLE) {
+ $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+ }
+ }
+
+ // free the result only if we were called on a table
+ if ($got_string) {
+ @fbsql_free_result($id);
+ }
+ return $res;
+ }
+
+ // }}}
+ // {{{ getSpecialQuery()
+
+ /**
+ * Obtains the query string needed for listing a given type of objects
+ *
+ * @param string $type the kind of objects you want to retrieve
+ *
+ * @return string the SQL query string or null if the driver doesn't
+ * support the object type requested
+ *
+ * @access protected
+ * @see DB_common::getListOf()
+ */
+ function getSpecialQuery($type)
+ {
+ switch ($type) {
+ case 'tables':
+ return 'SELECT "table_name" FROM information_schema.tables'
+ . ' t0, information_schema.schemata t1'
+ . ' WHERE t0.schema_pk=t1.schema_pk AND'
+ . ' "table_type" = \'BASE TABLE\''
+ . ' AND "schema_name" = current_schema';
+ case 'views':
+ return 'SELECT "table_name" FROM information_schema.tables'
+ . ' t0, information_schema.schemata t1'
+ . ' WHERE t0.schema_pk=t1.schema_pk AND'
+ . ' "table_type" = \'VIEW\''
+ . ' AND "schema_name" = current_schema';
+ case 'users':
+ return 'SELECT "user_name" from information_schema.users';
+ case 'functions':
+ return 'SELECT "routine_name" FROM'
+ . ' information_schema.psm_routines'
+ . ' t0, information_schema.schemata t1'
+ . ' WHERE t0.schema_pk=t1.schema_pk'
+ . ' AND "routine_kind"=\'FUNCTION\''
+ . ' AND "schema_name" = current_schema';
+ case 'procedures':
+ return 'SELECT "routine_name" FROM'
+ . ' information_schema.psm_routines'
+ . ' t0, information_schema.schemata t1'
+ . ' WHERE t0.schema_pk=t1.schema_pk'
+ . ' AND "routine_kind"=\'PROCEDURE\''
+ . ' AND "schema_name" = current_schema';
+ default:
+ return null;
+ }
+ }
+
+ // }}}
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>
Index: v1.1-thales/bibliotheque/pear/DB/odbc.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/odbc.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/odbc.php (revision 161)
@@ -0,0 +1,883 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's odbc extension
+ * for interacting with databases via ODBC connections
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB
+ * @author Stig Bakken <ssb@php.net>
+ * @author Daniel Convissor <danielc@php.net>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: odbc.php,v 1.78 2005/02/28 01:42:17 danielc Exp $
+ * @link http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's odbc extension
+ * for interacting with databases via ODBC connections
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * More info on ODBC errors could be found here:
+ * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_err_odbc_5stz.asp
+ *
+ * @category Database
+ * @package DB
+ * @author Stig Bakken <ssb@php.net>
+ * @author Daniel Convissor <danielc@php.net>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version Release: 1.7.6
+ * @link http://pear.php.net/package/DB
+ */
+class DB_odbc extends DB_common
+{
+ // {{{ properties
+
+ /**
+ * The DB driver type (mysql, oci8, odbc, etc.)
+ * @var string
+ */
+ var $phptype = 'odbc';
+
+ /**
+ * The database syntax variant to be used (db2, access, etc.), if any
+ * @var string
+ */
+ var $dbsyntax = 'sql92';
+
+ /**
+ * The capabilities of this DB implementation
+ *
+ * The 'new_link' element contains the PHP version that first provided
+ * new_link support for this DBMS. Contains false if it's unsupported.
+ *
+ * Meaning of the 'limit' element:
+ * + 'emulate' = emulate with fetch row by number
+ * + 'alter' = alter the query
+ * + false = skip rows
+ *
+ * NOTE: The feature set of the following drivers are different than
+ * the default:
+ * + solid: 'transactions' = true
+ * + navision: 'limit' = false
+ *
+ * @var array
+ */
+ var $features = array(
+ 'limit' => 'emulate',
+ 'new_link' => false,
+ 'numrows' => true,
+ 'pconnect' => true,
+ 'prepare' => false,
+ 'ssl' => false,
+ 'transactions' => false,
+ );
+
+ /**
+ * A mapping of native error codes to DB error codes
+ * @var array
+ */
+ var $errorcode_map = array(
+ '01004' => DB_ERROR_TRUNCATED,
+ '07001' => DB_ERROR_MISMATCH,
+ '21S01' => DB_ERROR_VALUE_COUNT_ON_ROW,
+ '21S02' => DB_ERROR_MISMATCH,
+ '22001' => DB_ERROR_INVALID,
+ '22003' => DB_ERROR_INVALID_NUMBER,
+ '22005' => DB_ERROR_INVALID_NUMBER,
+ '22008' => DB_ERROR_INVALID_DATE,
+ '22012' => DB_ERROR_DIVZERO,
+ '23000' => DB_ERROR_CONSTRAINT,
+ '23502' => DB_ERROR_CONSTRAINT_NOT_NULL,
+ '23503' => DB_ERROR_CONSTRAINT,
+ '23504' => DB_ERROR_CONSTRAINT,
+ '23505' => DB_ERROR_CONSTRAINT,
+ '24000' => DB_ERROR_INVALID,
+ '34000' => DB_ERROR_INVALID,
+ '37000' => DB_ERROR_SYNTAX,
+ '42000' => DB_ERROR_SYNTAX,
+ '42601' => DB_ERROR_SYNTAX,
+ 'IM001' => DB_ERROR_UNSUPPORTED,
+ 'S0000' => DB_ERROR_NOSUCHTABLE,
+ 'S0001' => DB_ERROR_ALREADY_EXISTS,
+ 'S0002' => DB_ERROR_NOSUCHTABLE,
+ 'S0011' => DB_ERROR_ALREADY_EXISTS,
+ 'S0012' => DB_ERROR_NOT_FOUND,
+ 'S0021' => DB_ERROR_ALREADY_EXISTS,
+ 'S0022' => DB_ERROR_NOSUCHFIELD,
+ 'S1009' => DB_ERROR_INVALID,
+ 'S1090' => DB_ERROR_INVALID,
+ 'S1C00' => DB_ERROR_NOT_CAPABLE,
+ );
+
+ /**
+ * The raw database connection created by PHP
+ * @var resource
+ */
+ var $connection;
+
+ /**
+ * The DSN information for connecting to a database
+ * @var array
+ */
+ var $dsn = array();
+
+
+ /**
+ * The number of rows affected by a data manipulation query
+ * @var integer
+ * @access private
+ */
+ var $affected = 0;
+
+
+ // }}}
+ // {{{ constructor
+
+ /**
+ * This constructor calls <kbd>$this->DB_common()</kbd>
+ *
+ * @return void
+ */
+ function DB_odbc()
+ {
+ $this->DB_common();
+ }
+
+ // }}}
+ // {{{ connect()
+
+ /**
+ * Connect to the database server, log in and open the database
+ *
+ * Don't call this method directly. Use DB::connect() instead.
+ *
+ * PEAR DB's odbc driver supports the following extra DSN options:
+ * + cursor The type of cursor to be used for this connection.
+ *
+ * @param array $dsn the data source name
+ * @param bool $persistent should the connection be persistent?
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ */
+ function connect($dsn, $persistent = false)
+ {
+ if (!PEAR::loadExtension('odbc')) {
+ return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+ }
+
+ $this->dsn = $dsn;
+ if ($dsn['dbsyntax']) {
+ $this->dbsyntax = $dsn['dbsyntax'];
+ }
+ switch ($this->dbsyntax) {
+ case 'access':
+ case 'db2':
+ case 'solid':
+ $this->features['transactions'] = true;
+ break;
+ case 'navision':
+ $this->features['limit'] = false;
+ }
+
+ /*
+ * This is hear for backwards compatibility. Should have been using
+ * 'database' all along, but prior to 1.6.0RC3 'hostspec' was used.
+ */
+ if ($dsn['database']) {
+ $odbcdsn = $dsn['database'];
+ } elseif ($dsn['hostspec']) {
+ $odbcdsn = $dsn['hostspec'];
+ } else {
+ $odbcdsn = 'localhost';
+ }
+
+ $connect_function = $persistent ? 'odbc_pconnect' : 'odbc_connect';
+
+ if (empty($dsn['cursor'])) {
+ $this->connection = @$connect_function($odbcdsn, $dsn['username'],
+ $dsn['password']);
+ } else {
+ $this->connection = @$connect_function($odbcdsn, $dsn['username'],
+ $dsn['password'],
+ $dsn['cursor']);
+ }
+
+ if (!is_resource($this->connection)) {
+ return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+ null, null, null,
+ $this->errorNative());
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ disconnect()
+
+ /**
+ * Disconnects from the database server
+ *
+ * @return bool TRUE on success, FALSE on failure
+ */
+ function disconnect()
+ {
+ $err = @odbc_close($this->connection);
+ $this->connection = null;
+ return $err;
+ }
+
+ // }}}
+ // {{{ simpleQuery()
+
+ /**
+ * Sends a query to the database server
+ *
+ * @param string the SQL query string
+ *
+ * @return mixed + a PHP result resrouce for successful SELECT queries
+ * + the DB_OK constant for other successful queries
+ * + a DB_Error object on failure
+ */
+ function simpleQuery($query)
+ {
+ $this->last_query = $query;
+ $query = $this->modifyQuery($query);
+ $result = @odbc_exec($this->connection, $query);
+ if (!$result) {
+ return $this->odbcRaiseError(); // XXX ERRORMSG
+ }
+ // Determine which queries that should return data, and which
+ // should return an error code only.
+ if (DB::isManip($query)) {
+ $this->affected = $result; // For affectedRows()
+ return DB_OK;
+ }
+ $this->affected = 0;
+ return $result;
+ }
+
+ // }}}
+ // {{{ nextResult()
+
+ /**
+ * Move the internal odbc result pointer to the next available result
+ *
+ * @param a valid fbsql result resource
+ *
+ * @access public
+ *
+ * @return true if a result is available otherwise return false
+ */
+ function nextResult($result)
+ {
+ return @odbc_next_result($result);
+ }
+
+ // }}}
+ // {{{ fetchInto()
+
+ /**
+ * Places a row from the result set into the given array
+ *
+ * Formating of the array and the data therein are configurable.
+ * See DB_result::fetchInto() for more information.
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::fetchInto() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result the query result resource
+ * @param array $arr the referenced array to put the data in
+ * @param int $fetchmode how the resulting array should be indexed
+ * @param int $rownum the row number to fetch (0 = first row)
+ *
+ * @return mixed DB_OK on success, NULL when the end of a result set is
+ * reached or on failure
+ *
+ * @see DB_result::fetchInto()
+ */
+ function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+ {
+ $arr = array();
+ if ($rownum !== null) {
+ $rownum++; // ODBC first row is 1
+ if (version_compare(phpversion(), '4.2.0', 'ge')) {
+ $cols = @odbc_fetch_into($result, $arr, $rownum);
+ } else {
+ $cols = @odbc_fetch_into($result, $rownum, $arr);
+ }
+ } else {
+ $cols = @odbc_fetch_into($result, $arr);
+ }
+ if (!$cols) {
+ return null;
+ }
+ if ($fetchmode !== DB_FETCHMODE_ORDERED) {
+ for ($i = 0; $i < count($arr); $i++) {
+ $colName = @odbc_field_name($result, $i+1);
+ $a[$colName] = $arr[$i];
+ }
+ if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+ $a = array_change_key_case($a, CASE_LOWER);
+ }
+ $arr = $a;
+ }
+ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+ $this->_rtrimArrayValues($arr);
+ }
+ if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+ $this->_convertNullArrayValuesToEmpty($arr);
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ freeResult()
+
+ /**
+ * Deletes the result set and frees the memory occupied by the result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::free() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return bool TRUE on success, FALSE if $result is invalid
+ *
+ * @see DB_result::free()
+ */
+ function freeResult($result)
+ {
+ return @odbc_free_result($result);
+ }
+
+ // }}}
+ // {{{ numCols()
+
+ /**
+ * Gets the number of columns in a result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::numCols() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return int the number of columns. A DB_Error object on failure.
+ *
+ * @see DB_result::numCols()
+ */
+ function numCols($result)
+ {
+ $cols = @odbc_num_fields($result);
+ if (!$cols) {
+ return $this->odbcRaiseError();
+ }
+ return $cols;
+ }
+
+ // }}}
+ // {{{ affectedRows()
+
+ /**
+ * Determines the number of rows affected by a data maniuplation query
+ *
+ * 0 is returned for queries that don't manipulate data.
+ *
+ * @return int the number of rows. A DB_Error object on failure.
+ */
+ function affectedRows()
+ {
+ if (empty($this->affected)) { // In case of SELECT stms
+ return 0;
+ }
+ $nrows = @odbc_num_rows($this->affected);
+ if ($nrows == -1) {
+ return $this->odbcRaiseError();
+ }
+ return $nrows;
+ }
+
+ // }}}
+ // {{{ numRows()
+
+ /**
+ * Gets the number of rows in a result set
+ *
+ * Not all ODBC drivers support this functionality. If they don't
+ * a DB_Error object for DB_ERROR_UNSUPPORTED is returned.
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::numRows() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return int the number of rows. A DB_Error object on failure.
+ *
+ * @see DB_result::numRows()
+ */
+ function numRows($result)
+ {
+ $nrows = @odbc_num_rows($result);
+ if ($nrows == -1) {
+ return $this->odbcRaiseError(DB_ERROR_UNSUPPORTED);
+ }
+ if ($nrows === false) {
+ return $this->odbcRaiseError();
+ }
+ return $nrows;
+ }
+
+ // }}}
+ // {{{ quoteIdentifier()
+
+ /**
+ * Quotes a string so it can be safely used as a table or column name
+ *
+ * Use 'mssql' as the dbsyntax in the DB DSN only if you've unchecked
+ * "Use ANSI quoted identifiers" when setting up the ODBC data source.
+ *
+ * @param string $str identifier name to be quoted
+ *
+ * @return string quoted identifier string
+ *
+ * @see DB_common::quoteIdentifier()
+ * @since Method available since Release 1.6.0
+ */
+ function quoteIdentifier($str)
+ {
+ switch ($this->dsn['dbsyntax']) {
+ case 'access':
+ return '[' . $str . ']';
+ case 'mssql':
+ case 'sybase':
+ return '[' . str_replace(']', ']]', $str) . ']';
+ case 'mysql':
+ case 'mysqli':
+ return '`' . $str . '`';
+ default:
+ return '"' . str_replace('"', '""', $str) . '"';
+ }
+ }
+
+ // }}}
+ // {{{ quote()
+
+ /**
+ * @deprecated Deprecated in release 1.6.0
+ * @internal
+ */
+ function quote($str)
+ {
+ return $this->quoteSmart($str);
+ }
+
+ // }}}
+ // {{{ nextId()
+
+ /**
+ * Returns the next free id in a sequence
+ *
+ * @param string $seq_name name of the sequence
+ * @param boolean $ondemand when true, the seqence is automatically
+ * created if it does not exist
+ *
+ * @return int the next id number in the sequence.
+ * A DB_Error object on failure.
+ *
+ * @see DB_common::nextID(), DB_common::getSequenceName(),
+ * DB_odbc::createSequence(), DB_odbc::dropSequence()
+ */
+ function nextId($seq_name, $ondemand = true)
+ {
+ $seqname = $this->getSequenceName($seq_name);
+ $repeat = 0;
+ do {
+ $this->pushErrorHandling(PEAR_ERROR_RETURN);
+ $result = $this->query("update ${seqname} set id = id + 1");
+ $this->popErrorHandling();
+ if ($ondemand && DB::isError($result) &&
+ $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+ $repeat = 1;
+ $this->pushErrorHandling(PEAR_ERROR_RETURN);
+ $result = $this->createSequence($seq_name);
+ $this->popErrorHandling();
+ if (DB::isError($result)) {
+ return $this->raiseError($result);
+ }
+ $result = $this->query("insert into ${seqname} (id) values(0)");
+ } else {
+ $repeat = 0;
+ }
+ } while ($repeat);
+
+ if (DB::isError($result)) {
+ return $this->raiseError($result);
+ }
+
+ $result = $this->query("select id from ${seqname}");
+ if (DB::isError($result)) {
+ return $result;
+ }
+
+ $row = $result->fetchRow(DB_FETCHMODE_ORDERED);
+ if (DB::isError($row || !$row)) {
+ return $row;
+ }
+
+ return $row[0];
+ }
+
+ /**
+ * Creates a new sequence
+ *
+ * @param string $seq_name name of the new sequence
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ *
+ * @see DB_common::createSequence(), DB_common::getSequenceName(),
+ * DB_odbc::nextID(), DB_odbc::dropSequence()
+ */
+ function createSequence($seq_name)
+ {
+ return $this->query('CREATE TABLE '
+ . $this->getSequenceName($seq_name)
+ . ' (id integer NOT NULL,'
+ . ' PRIMARY KEY(id))');
+ }
+
+ // }}}
+ // {{{ dropSequence()
+
+ /**
+ * Deletes a sequence
+ *
+ * @param string $seq_name name of the sequence to be deleted
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ *
+ * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+ * DB_odbc::nextID(), DB_odbc::createSequence()
+ */
+ function dropSequence($seq_name)
+ {
+ return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+ }
+
+ // }}}
+ // {{{ autoCommit()
+
+ /**
+ * Enables or disables automatic commits
+ *
+ * @param bool $onoff true turns it on, false turns it off
+ *
+ * @return int DB_OK on success. A DB_Error object if the driver
+ * doesn't support auto-committing transactions.
+ */
+ function autoCommit($onoff = false)
+ {
+ if (!@odbc_autocommit($this->connection, $onoff)) {
+ return $this->odbcRaiseError();
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ commit()
+
+ /**
+ * Commits the current transaction
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ */
+ function commit()
+ {
+ if (!@odbc_commit($this->connection)) {
+ return $this->odbcRaiseError();
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ rollback()
+
+ /**
+ * Reverts the current transaction
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ */
+ function rollback()
+ {
+ if (!@odbc_rollback($this->connection)) {
+ return $this->odbcRaiseError();
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ odbcRaiseError()
+
+ /**
+ * Produces a DB_Error object regarding the current problem
+ *
+ * @param int $errno if the error is being manually raised pass a
+ * DB_ERROR* constant here. If this isn't passed
+ * the error information gathered from the DBMS.
+ *
+ * @return object the DB_Error object
+ *
+ * @see DB_common::raiseError(),
+ * DB_odbc::errorNative(), DB_common::errorCode()
+ */
+ function odbcRaiseError($errno = null)
+ {
+ if ($errno === null) {
+ switch ($this->dbsyntax) {
+ case 'access':
+ if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
+ $this->errorcode_map['07001'] = DB_ERROR_NOSUCHFIELD;
+ } else {
+ // Doing this in case mode changes during runtime.
+ $this->errorcode_map['07001'] = DB_ERROR_MISMATCH;
+ }
+
+ $native_code = odbc_error($this->connection);
+
+ // S1000 is for "General Error." Let's be more specific.
+ if ($native_code == 'S1000') {
+ $errormsg = odbc_errormsg($this->connection);
+ static $error_regexps;
+ if (!isset($error_regexps)) {
+ $error_regexps = array(
+ '/includes related records.$/i' => DB_ERROR_CONSTRAINT,
+ '/cannot contain a Null value/i' => DB_ERROR_CONSTRAINT_NOT_NULL,
+ );
+ }
+ foreach ($error_regexps as $regexp => $code) {
+ if (preg_match($regexp, $errormsg)) {
+ return $this->raiseError($code,
+ null, null, null,
+ $native_code . ' ' . $errormsg);
+ }
+ }
+ $errno = DB_ERROR;
+ } else {
+ $errno = $this->errorCode($native_code);
+ }
+ break;
+ default:
+ $errno = $this->errorCode(odbc_error($this->connection));
+ }
+ }
+ return $this->raiseError($errno, null, null, null,
+ $this->errorNative());
+ }
+
+ // }}}
+ // {{{ errorNative()
+
+ /**
+ * Gets the DBMS' native error code and message produced by the last query
+ *
+ * @return string the DBMS' error code and message
+ */
+ function errorNative()
+ {
+ if (!is_resource($this->connection)) {
+ return @odbc_error() . ' ' . @odbc_errormsg();
+ }
+ return @odbc_error($this->connection) . ' ' . @odbc_errormsg($this->connection);
+ }
+
+ // }}}
+ // {{{ tableInfo()
+
+ /**
+ * Returns information about a table or a result set
+ *
+ * @param object|string $result DB_result object from a query or a
+ * string containing the name of a table.
+ * While this also accepts a query result
+ * resource identifier, this behavior is
+ * deprecated.
+ * @param int $mode a valid tableInfo mode
+ *
+ * @return array an associative array with the information requested.
+ * A DB_Error object on failure.
+ *
+ * @see DB_common::tableInfo()
+ * @since Method available since Release 1.7.0
+ */
+ function tableInfo($result, $mode = null)
+ {
+ if (is_string($result)) {
+ /*
+ * Probably received a table name.
+ * Create a result resource identifier.
+ */
+ $id = @odbc_exec($this->connection, "SELECT * FROM $result");
+ if (!$id) {
+ return $this->odbcRaiseError();
+ }
+ $got_string = true;
+ } elseif (isset($result->result)) {
+ /*
+ * Probably received a result object.
+ * Extract the result resource identifier.
+ */
+ $id = $result->result;
+ $got_string = false;
+ } else {
+ /*
+ * Probably received a result resource identifier.
+ * Copy it.
+ * Deprecated. Here for compatibility only.
+ */
+ $id = $result;
+ $got_string = false;
+ }
+
+ if (!is_resource($id)) {
+ return $this->odbcRaiseError(DB_ERROR_NEED_MORE_DATA);
+ }
+
+ if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+ $case_func = 'strtolower';
+ } else {
+ $case_func = 'strval';
+ }
+
+ $count = @odbc_num_fields($id);
+ $res = array();
+
+ if ($mode) {
+ $res['num_fields'] = $count;
+ }
+
+ for ($i = 0; $i < $count; $i++) {
+ $col = $i + 1;
+ $res[$i] = array(
+ 'table' => $got_string ? $case_func($result) : '',
+ 'name' => $case_func(@odbc_field_name($id, $col)),
+ 'type' => @odbc_field_type($id, $col),
+ 'len' => @odbc_field_len($id, $col),
+ 'flags' => '',
+ );
+ if ($mode & DB_TABLEINFO_ORDER) {
+ $res['order'][$res[$i]['name']] = $i;
+ }
+ if ($mode & DB_TABLEINFO_ORDERTABLE) {
+ $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+ }
+ }
+
+ // free the result only if we were called on a table
+ if ($got_string) {
+ @odbc_free_result($id);
+ }
+ return $res;
+ }
+
+ // }}}
+ // {{{ getSpecialQuery()
+
+ /**
+ * Obtains the query string needed for listing a given type of objects
+ *
+ * Thanks to symbol1@gmail.com and Philippe.Jausions@11abacus.com.
+ *
+ * @param string $type the kind of objects you want to retrieve
+ *
+ * @return string the list of objects requested
+ *
+ * @access protected
+ * @see DB_common::getListOf()
+ * @since Method available since Release 1.7.0
+ */
+ function getSpecialQuery($type)
+ {
+ switch ($type) {
+ case 'databases':
+ if (!function_exists('odbc_data_source')) {
+ return null;
+ }
+ $res = @odbc_data_source($this->connection, SQL_FETCH_FIRST);
+ if (is_array($res)) {
+ $out = array($res['server']);
+ while($res = @odbc_data_source($this->connection,
+ SQL_FETCH_NEXT))
+ {
+ $out[] = $res['server'];
+ }
+ return $out;
+ } else {
+ return $this->odbcRaiseError();
+ }
+ break;
+ case 'tables':
+ case 'schema.tables':
+ $keep = 'TABLE';
+ break;
+ case 'views':
+ $keep = 'VIEW';
+ break;
+ default:
+ return null;
+ }
+
+ /*
+ * Removing non-conforming items in the while loop rather than
+ * in the odbc_tables() call because some backends choke on this:
+ * odbc_tables($this->connection, '', '', '', 'TABLE')
+ */
+ $res = @odbc_tables($this->connection);
+ if (!$res) {
+ return $this->odbcRaiseError();
+ }
+ $out = array();
+ while ($row = odbc_fetch_array($res)) {
+ if ($row['TABLE_TYPE'] != $keep) {
+ continue;
+ }
+ if ($type == 'schema.tables') {
+ $out[] = $row['TABLE_SCHEM'] . '.' . $row['TABLE_NAME'];
+ } else {
+ $out[] = $row['TABLE_NAME'];
+ }
+ }
+ return $out;
+ }
+
+ // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>
Index: v1.1-thales/bibliotheque/pear/DB/NestedSet/Output.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/NestedSet/Output.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/NestedSet/Output.php (revision 161)
@@ -0,0 +1,211 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PEAR :: DB_NestedSet_Output |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Daniel Khan <dk@webcluster.at> |
+// | Jason Rust <jason@rustyparts.com> |
+// +----------------------------------------------------------------------+
+// $Id: Output.php,v 1.11 2003/10/07 00:11:27 datenpunk Exp $
+//
+
+require_once 'PEAR.php';
+
+// {{{ constants
+
+define('NESEO_ERROR_NO_METHOD', 'E1000');
+define('NESEO_DRIVER_NOT_FOUND', 'E1100');
+define('NESEO_ERROR_NO_OPTIONS', 'E2100');
+
+// }}}
+// {{{ DB_NestedSet_Output:: class
+
+/**
+* DB_NestedSet_Output is a unified API for other output drivers
+* Status is beta
+*
+* At the moment PEAR::HTML_TreeMenu written by Jason Rust is supported
+* A driver for treemenu.org will follow soon.
+*
+* Usage example:
+*
+* require_once('DB_NestedSet/NestedSet/Output.php');
+* $icon = 'folder.gif';
+* $expandedIcon = 'folder-expanded.gif';
+* // get data (important to fetch it as an array, using the true flag)
+* $data = $NeSe->getAllNodes(true);
+* // change the events for one of the elements
+* $data[35]['events'] = array('onexpand' => 'alert("we expanded!");');
+* // add links to each item
+* foreach ($data as $a_data) {
+* $a_data['link'] = 'http://foo.com/foo.php?' . $a_data['id'];
+* }
+* $params = array(
+* 'structure' => $data,
+* 'options' => array(
+* 'icon' => $icon,
+* 'expandedIcon' => $expandedIcon,
+* ),
+* 'textField' => 'name',
+* 'linkField' => 'link',
+* );
+* $menu =& DB_NestedSet_Output::factory('TreeMenu', $params);
+* $menu->printListbox();
+*
+* @author Daniel Khan <dk@webcluster.at>
+* @package DB_NestedSet
+* @version $Revision: 1.11 $
+* @access public
+*
+*/
+
+// }}}
+class DB_NestedSet_Output {
+ // {{{ properties
+
+ /**
+ * @var object The tree menu structure
+ * @access private
+ */
+ var $_structTreeMenu = false;
+
+ /**
+ * @var array Array of options to be passed to the ouput methods
+ * @access public
+ */
+ var $options = array();
+
+ // }}}
+ // {{{ factory()
+
+ /**
+ * Returns a output driver object
+ *
+ * @param array $params A DB_NestedSet nodeset
+ * @param string $driver (optional) The driver, such as TreeMenu (default)
+ *
+ * @access public
+ * @return object The DB_NestedSet_Ouput object
+ */
+ function &factory ($params, $driver = 'TreeMenu') {
+
+ $path = dirname(__FILE__).'/'.$driver.'.php';
+
+ if(is_dir($path) || !file_exists($path)) {
+ PEAR::raiseError("The output driver '$driver' wasn't found", NESEO_DRIVER_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR);
+ }
+
+ require_once($path);
+ $driverClass = 'DB_NestedSet_'.$driver;
+ return new $driverClass($params);
+ }
+
+ // }}}
+ // {{{ setOptions()
+
+ /**
+ * Set's options for a specific output group (printTree, printListbox)
+ * This enables you to set specific options for each output method
+ *
+ * @param string $group Output group ATM 'printTree' or 'printListbox'
+ * @param array $options Hash with options
+ *
+ * @access public
+ * @return bool
+ */
+ function setOptions($group, $options) {
+ $this->options[$group] = $options;
+ return true;
+ }
+
+ // }}}
+ // {{{ _getOptions()
+
+ /**
+ * Get's all option for a specific output group (printTree, printListbox)
+ *
+ * @param string $group Output group ATM 'printTree' or 'printListbox'
+ *
+ * @access private
+ * @return array Options
+ */
+ function _getOptions($group) {
+
+ if (!isset($this->options[$group])) {
+ return array();
+ }
+ return $this->options[$group];
+ }
+
+ // }}}
+ // {{{ printTree()
+
+ /**
+ * Print's the current tree using the output driver
+ * Overriden by the driver class
+ *
+ * @access public
+ */
+ function printTree() {
+ PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
+ }
+
+ // }}}
+ // {{{ printListbox()
+
+ /**
+ * Print's a listbox representing the current tree
+ * Overriden by the driver class
+ *
+ * @access public
+ */
+ function printListbox() {
+ PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
+ }
+
+ // }}}
+
+ // {{{ toHTML()
+
+ /**
+ * Returns the HTML for the DHTML-menu. This method can be
+ * used instead of printMenu() to use the menu system
+ * with a template system.
+ *
+ * @access public
+ * @return string The HTML for the menu
+ * @author Emanuel Zueger
+ */
+ function tree_toHTML() {
+ PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
+ }
+
+ // }}}
+ // {{{ listbox_toHTML()
+
+ /**
+ * Returns the HTML for the listbox. This method can be
+ * used instead of printListbox() to use the menu system
+ * with a template system.
+ *
+ * @access public
+ * @return string The HTML for the listbox
+ * @author Emanuel Zueger
+ */
+ function listbox_toHTML() {
+ PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
+ }
+
+ // }}}
+}
+?>
Index: v1.1-thales/bibliotheque/pear/DB/NestedSet/Event.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/NestedSet/Event.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/NestedSet/Event.php (revision 161)
@@ -0,0 +1,79 @@
+<?php
+/**
+// +----------------------------------------------------------------------+
+// | PEAR :: DB_NestedSet_DB |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Daniel Khan <dk@webcluster.at> |
+// +----------------------------------------------------------------------+
+//
+// $Id: Event.php,v 1.3 2003/10/07 00:11:27 datenpunk Exp $
+//
+//
+*/
+
+/**
+* Poor mans event handler for DB_NestedSet
+*
+* Mostly for demo purposes or for extending it if
+* someone has ideas...
+*
+* @author Daniel Khan <dk@webcluster.at>
+* @package DB_NestedSet
+* @version $Revision: 1.3 $
+* @access public
+*/
+Class DB_NestedSetEvent extends PEAR {
+
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ function DB_NestedSetEvent() {
+
+ $this->PEAR();
+ }
+
+ /**
+ * Destructor
+ *
+ * @return void
+ */
+ function _DB_NestedSetEvent() {
+
+ $this->_PEAR();
+ }
+
+
+ /**
+ * Calls the event handler
+ *
+ * You may want to do a switch() here and call you methods
+ * depending on the event
+ *
+ * @param string $event The Event that occured
+ * @param object node $node A Reference to the node object which was subject to changes
+ * @param array $eparams A associative array of params which may be needed by the handler
+ * @return void
+ * @access private
+ */
+ function callEvent($event, &$node, $eparams = array()) {
+
+ echo "<br>Override callEvent() if you want to have custom event handlers<br>\n";
+ echo "Event $event was called with the following params:<br><br>\n";
+ echo "<PRE>";
+ print_r($eparams);
+ echo "</PRE><br>\n";
+ }
+}
+?>
Index: v1.1-thales/bibliotheque/pear/DB/NestedSet/MDB.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/NestedSet/MDB.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/NestedSet/MDB.php (revision 161)
@@ -0,0 +1,136 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PEAR :: DB_NestedSet_MDB |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Daniel Khan <dk@webcluster.at> |
+// +----------------------------------------------------------------------+
+// Thanks to Hans Lellelid for suggesting support for PEAR::MDB
+// and for his help in implementing this.
+//
+// $Id: MDB.php,v 1.7 2003/10/07 00:11:27 datenpunk Exp $
+//
+
+require_once 'MDB.php';
+
+// {{{ DB_NestedSet_MDB:: class
+
+/**
+* Wrapper class for PEAR::MDB
+*
+* @author Daniel Khan <dk@webcluster.at>
+* @package DB_NestedSet
+* @version $Revision: 1.7 $
+* @access public
+*/
+// }}}
+class DB_NestedSet_MDB extends DB_NestedSet {
+ // {{{ properties
+
+ /**
+ * @var object The MDB object
+ */
+ var $db;
+
+ // }}}
+ // {{{ constructor
+
+ /**
+ * Constructor
+ *
+ * @param mixed $dsn DSN as PEAR dsn URI or dsn Array
+ * @param array $params Database column fields which should be returned
+ *
+ */
+ function DB_NestedSet_MDB($dsn, $params = array())
+ {
+ $this->_debugMessage('DB_NestedSet_MDB($dsn, $params = array())');
+ $this->DB_NestedSet($params);
+ $this->db =& $this->_db_Connect($dsn);
+ $this->db->setFetchMode(MDB_FETCHMODE_ASSOC);
+ }
+
+ // }}}
+ // {{{ destructor
+
+ /**
+ * Destructor
+ */
+ function _DB_NestedSet_MDB()
+ {
+ $this->_debugMessage('_DB_NestedSet_MDB()');
+ $this->_DB_NestedSet();
+ $this->_db_Disconnect();
+ }
+
+ // }}}
+ // {{{ _db_Connect()
+
+ /**
+ * Connects to the db
+ *
+ * @return object DB The database object
+ * @access private
+ */
+ function &_db_Connect($dsn)
+ {
+ $this->_debugMessage('_db_Connect($dsn)');
+ if (is_object($this->db)) {
+ return $this->db;
+ }
+
+ $db =& MDB::connect($dsn);
+ $this->_testFatalAbort($db, __FILE__, __LINE__);
+
+ return $db;
+ }
+
+ // }}}
+
+ function _isDBError($err) {
+ if(!MDB::isError($err)) {
+ return false;
+ }
+ return true;
+ }
+
+ function _numRows($res) {
+ return $this->db->numRows($res);
+ }
+
+ function _quote($str) {
+ return $this->db->getTextValue($str);
+ }
+
+ // {{{ _db_Disconnect()
+
+ /**
+ * Disconnects from db
+ *
+ * @return void
+ * @access private
+ */
+ function _db_Disconnect()
+ {
+ $this->_debugMessage('_db_Disconnect()');
+ if (is_object($this->db)) {
+ @$this->db->disconnect();
+ }
+
+ return true;
+ }
+
+ // }}}
+}
+
+?>
Index: v1.1-thales/bibliotheque/pear/DB/NestedSet/TreeMenu.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/NestedSet/TreeMenu.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/NestedSet/TreeMenu.php (revision 161)
@@ -0,0 +1,205 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PEAR :: DB_NestedSet_TreeMenu |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Jason Rust <jrust@rustyparts.com> |
+// +----------------------------------------------------------------------+
+//
+// $Id: TreeMenu.php,v 1.13 2003/10/07 00:11:27 datenpunk Exp $
+//
+
+require_once 'HTML/TreeMenu.php';
+
+// {{{ DB_NestedSet_TreeMenu:: class
+
+/**
+* A helper class to translate the data from a nested set table into a HTML_TreeMenu object
+* so that it can be used to create a dynamic tree menu using the PEAR HTML_TreeMenu class.
+*
+* @see docs/TreeMenu_example.php
+* @author Jason Rust <jrust@rustyparts.com>
+* @package DB_NestedSet
+* @version $Revision: 1.13 $
+* @access public
+*/
+// }}}
+class DB_NestedSet_TreeMenu extends DB_NestedSet_Output {
+ // {{{ properties
+
+ /**
+ * @var array The current menu structure
+ * @access private
+ */
+ var $_structTreeMenu = false;
+
+ // }}}
+ // {{{ DB_NestedSet_TreeMenu
+
+ function &DB_NestedSet_TreeMenu($params) {
+ $this->_structTreeMenu =& $this->_createFromStructure($params);
+ }
+
+ // }}}
+ // {{{ _createFromStructure()
+
+ /**
+ * <pre>Creates a HTML_TreeMenu structure based off of the results from getAllNodes() method
+ * of the DB_NestedSet class. The needed parameters are:
+ * o 'structure' => the result from $nestedSet->getAllNodes(true)
+ * o 'textField' => the field in the table that has the text for node
+ * o 'linkField' => the field in the table that has the link for the node
+ * o 'options' => (optional) an array of any additional options to pass to the node when
+ * Additionally these parameters may be added to the individual nodes to control their
+ * behavior:
+ * o 'ensureVisible' => (optional) whether or not the field should be forced as visible
+ * creating it such as 'icon' or 'expandedIcon'
+ * o 'events' => (optional) an array of any events to pass to the node when creating it
+ * such as 'onclick' or 'onexpand'</pre>
+ * </pre>
+ * @access public
+ * @return object A HTML_TreeMenu object
+ */
+ function &_createFromStructure($params)
+ {
+ // Basically we go through the array of nodes checking to see
+ // if each node has children and if so recursing. The reason this
+ // works is because the data from getAllNodes() is ordered by level
+ // so a root node will always be first, and sub children will always
+ // be after them.
+ if (!isset($params['treeMenu'])) {
+ $treeMenu =& new HTML_TreeMenu();
+ } else {
+ $treeMenu =& $params['treeMenu'];
+ }
+
+ // always start at level 1
+ if (!isset($params['currentLevel'])) {
+ $params['currentLevel'] = 1;
+ }
+
+ // have to use a while loop here because foreach works on a copy of the array and
+ // the child nodes are passed by reference during the recursion so that the parent
+ // will know when they have been hit.
+ reset($params['structure']);
+ while(list($key, $node) = each($params['structure'])) {
+ // see if we've already been here before
+ if (isset($node['hit'])) {
+ continue;
+ }
+
+ // mark that we've hit this node
+ $params['structure'][$key]['hit'] = $node['hit'] = true;
+ $tag = array(
+ 'text' => $node[$params['textField']],
+ 'link' => $node[$params['linkField']],
+ 'ensureVisible' => isset($node['ensureVisible']) ? $node['ensureVisible'] : false,
+ );
+ $options = isset($params['options']) ? array_merge($params['options'], $tag) : $tag;
+ $events = isset($node['events']) ? $node['events'] : array();
+ $parentNode =& $treeMenu->addItem(new HTML_TreeNode($options, $events));
+ // see if it has children
+ if (($node['r'] - 1) != $node['l']) {
+ $children = array();
+ // harvest all the children
+ $tempStructure = $params['structure'];
+ foreach ($tempStructure as $childKey => $childNode) {
+ if (!isset($childNode['hit']) &&
+ $childNode['l'] > $node['l'] &&
+ $childNode['r'] < $node['r'] &&
+ $childNode['rootid'] == $node['rootid']) {
+ // important that we assign it by reference here, so that when the child
+ // marks itself 'hit' the parent loops will know
+ $children[] =& $params['structure'][$childKey];
+ }
+ }
+
+ $recurseParams = $params;
+ $recurseParams['structure'] = $children;
+ $recurseParams['treeMenu'] =& $parentNode;
+ $recurseParams['currentLevel']++;
+ $this->_createFromStructure($recurseParams);
+ }
+ }
+
+ return $treeMenu;
+ }
+
+ // }}}
+ // {{{ printTree()
+
+ /**
+ * Print's the current tree using the output driver
+ *
+ * @access public
+ */
+ function printTree() {
+ $options = $this->_getOptions('printTree');
+ $tree =& new HTML_TreeMenu_DHTML($this->_structTreeMenu, $options);
+ $tree->printMenu();
+ }
+
+ // }}}
+ // {{{ printListbox()
+
+ /**
+ * Print's a listbox representing the current tree
+ *
+ * @access public
+ */
+ function printListbox() {
+ $options = $this->_getOptions('printListbox');
+ $listBox =& new HTML_TreeMenu_Listbox($this->_structTreeMenu, $options);
+ $listBox->printMenu();
+ }
+ // }}}
+
+ // }}}
+ // {{{ tree_toHTML()
+
+ /**
+ * Returns the HTML for the DHTML-menu. This method can be
+ * used instead of printMenu() to use the menu system
+ * with a template system.
+ *
+ * @access public
+ * @return string The HTML for the menu
+ * @Author Emanuel Zueger
+ */
+ function tree_toHTML() {
+ $options = $this->_getOptions('toHTML');
+ $tree =& new HTML_TreeMenu_DHTML($this->_structTreeMenu, $options);
+ return $tree->toHTML();
+ }
+
+ // }}}
+ // {{{ listbox_toHTML()
+
+ /**
+ * Returns the HTML for the listbox. This method can be
+ * used instead of printListbox() to use the menu system
+ * with a template system.
+ *
+ * @access public
+ * @return string The HTML for the listbox
+ * @author Emanuel Zueger
+ */
+ function listbox_toHTML() {
+ $options = $this->_getOptions('toHTML');
+ $listBox =& new HTML_TreeMenu_Listbox($this->_structTreeMenu, $options);
+ return $listBox->toHTML();
+ }
+
+ // }}}
+}
+?>
Index: v1.1-thales/bibliotheque/pear/DB/NestedSet/DB.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/NestedSet/DB.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/NestedSet/DB.php (revision 161)
@@ -0,0 +1,135 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PEAR :: DB_NestedSet_DB |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Daniel Khan <dk@webcluster.at> |
+// +----------------------------------------------------------------------+
+//
+// $Id: DB.php,v 1.7 2003/10/07 00:11:27 datenpunk Exp $
+//
+
+require_once 'DB.php';
+
+// {{{ DB_NestedSet_DB:: class
+
+/**
+* Wrapper class for PEAR::DB
+*
+* @author Daniel Khan <dk@webcluster.at>
+* @package DB_NestedSet
+* @version $Revision: 1.7 $
+* @access public
+*/
+
+// }}}
+class DB_NestedSet_DB extends DB_NestedSet {
+ // {{{ properties
+
+ /**
+ * @var object Db object
+ */
+ var $db;
+
+ // }}}
+ // {{{ constructor
+
+ /**
+ * Constructor
+ *
+ * @param mixed $dsn DSN as PEAR dsn URI or dsn Array
+ * @param array $params Database column fields which should be returned
+ *
+ */
+ function DB_NestedSet_DB($dsn, $params = array())
+ {
+ $this->_debugMessage('DB_NestedSet_DB($dsn, $params = array())');
+ $this->DB_NestedSet($params);
+ $this->db =& $this->_db_Connect($dsn);
+ $this->db->setFetchMode(DB_FETCHMODE_ASSOC);
+ }
+
+ // }}}
+ // {{{ destructor
+
+ /**
+ * Destructor
+ */
+ function _DB_NestedSet_DB()
+ {
+ $this->_debugMessage('_DB_NestedSet_DB()');
+ $this->_DB_NestedSet();
+ $this->_db_Disconnect();
+ }
+
+ // }}}
+ // {{{ _db_Connect()
+
+ /**
+ * Connects to the db
+ *
+ * @return object DB The database object
+ * @access private
+ */
+ function &_db_Connect($dsn)
+ {
+ $this->_debugMessage('_db_Connect($dsn)');
+ if (is_object($this->db)) {
+ return $this->db;
+ }
+
+ $db =& DB::connect($dsn);
+ $this->_testFatalAbort($db, __FILE__, __LINE__);
+ return $db;
+ }
+
+ // }}}
+
+
+ function _numRows($res) {
+ return $res->numRows();
+ }
+
+ function _isDBError($err) {
+ if(!DB::isError($err)) {
+ return false;
+ }
+ return true;
+ }
+
+ function _quote($str) {
+ return $this->db->quote($str);
+ }
+
+ // {{{ _db_Disconnect()
+
+ /**
+ * Disconnects from db
+ *
+ * @return void
+ * @access private
+ */
+ function _db_Disconnect()
+ {
+ $this->_debugMessage('_db_Disconnect()');
+ if (is_object($this->db)) {
+ @$this->db->disconnect();
+ }
+
+ return true;
+ }
+
+ // }}}
+}
+
+?>
Index: v1.1-thales/bibliotheque/pear/DB/NestedSet/TigraMenu.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/NestedSet/TigraMenu.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/NestedSet/TigraMenu.php (revision 161)
@@ -0,0 +1,402 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PEAR :: DB_NestedSet_TigraMenu |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Daniel Khan <dk@webcluster.at> |
+// +----------------------------------------------------------------------+
+//
+// $Id: TigraMenu.php,v 1.8 2003/10/07 00:11:27 datenpunk Exp $
+//
+
+// {{{ DB_NestedSet_TigraMenu:: class
+
+/**
+* This class can be used to generate the data to build javascript popup menu
+* from a DB_NestedSet node array.
+* The Javascript part is done using the free available TigraMenu
+* available at http://www.softcomplex.com/products/tigra_menu/.
+* Currently version 1.0 is supported.
+* Parts of this class where taken ftom the TreemMenu driver by Jason Rust
+*
+* @author Daniel Khan <dk@webcluster.at>
+* @package DB_NestedSet
+* @version $Revision: 1.8 $
+* @access public
+*/
+// }}}
+class DB_NestedSet_TigraMenu extends DB_NestedSet_Output {
+ // {{{{ properties
+
+ /**
+ * @var integer The depth of the current menu.
+ * @access private
+ */
+ var $_levels = 1;
+
+ /**
+ * @var integer The level we started at
+ * @access private
+ */
+ var $_levelOffset = false;
+
+
+ /**
+ * @var array The current menu structure
+ * @access private
+ */
+ var $_structTigraMenu = false;
+
+ /**
+ * @var array The longest text for each level
+ * @access private
+ */
+ var $_strlenByLevel = array();
+
+ // }}}
+ // {{{ DB_NestedSet_TigraMenu
+
+ /**
+ * Constructor
+ *
+ * @param array $params A hash with parameters needed by the class
+ * @see _createFromStructure()
+ * @return bool
+ **/
+ function &DB_NestedSet_TigraMenu($params) {
+ $this->_menu_id = $params['menu_id'];
+ $this->_structTigraMenu = $this->_createFromStructure($params);
+ return true;
+ }
+
+ // }}}
+ // {{{ _createFromStructure()
+
+ /**
+ * Creates the JavaScript array for TigraMenu
+ * Initially this method was introduced for the TreeMenu driver by Jason Rust
+ *
+ * o 'structure' => the result from $nestedSet->getAllNodes(true)
+ * o 'textField' => the field in the table that has the text for node
+ * o 'linkField' => the field in the table that has the link for the node
+ *
+ * @access private
+ * @return string The TigraMenu JavaScript array
+ */
+ function &_createFromStructure($params)
+ {
+ // Basically we go through the array of nodes checking to see
+ // if each node has children and if so recursing. The reason this
+ // works is because the data from getAllNodes() is ordered by level
+ // so a root node will always be first, and sub children will always
+ // be after them.
+
+ static $rootlevel;
+
+ // always start at level 1
+ if (!isset($params['currentLevel'])) {
+ $params['currentLevel'] = 1;
+ }
+
+ if (!isset($rootlevel)) {
+ $rootlevel = $params['currentLevel'];
+ }
+
+ if (isset($params['tigraMenu'])) {
+ $tigraMenu = $tigraMenu.$params['tigraMenu'];
+ }
+
+ if(!$this->_levelOffset) {
+ $this->_levelOffset = $params['currentLevel'];
+ }
+
+ if($this->_levels < ($params['currentLevel']- $this->_levelOffset)) {
+ $this->_levels = $params['currentLevel'] - $this->_levelOffset;
+ }
+
+
+ // have to use a while loop here because foreach works on a copy of the array and
+ // the child nodes are passed by reference during the recursion so that the parent
+ // will know when they have been hit.
+ reset($params['structure']);
+ while(list($key, $node) = each($params['structure'])) {
+ // see if we've already been here before
+ if (isset($node['hit']) || $node['level'] < $params['currentLevel']) {
+ continue;
+ }
+
+ // mark that we've hit this node
+ $params['structure'][$key]['hit'] = $node['hit'] = true;
+
+ $tag = array(
+ isset($node[$params['textField']]) ? "'".$node[$params['textField']]."'" : 'null',
+ isset($node[$params['linkField']]) ? "'".$node[$params['linkField']]."'" : 'null'
+ );
+
+ if (!$this->_strlenByLevel[$params['currentLevel'] - $this->_levelOffset] ||
+ strlen($node[$params['textField']]) > $this->_strlenByLevel[$params['currentLevel'] - $this->_levelOffset]) {
+ $this->_strlenByLevel[$params['currentLevel'] - $this->_levelOffset] = strlen($node[$params['textField']]);
+ };
+
+ $tigraMenu = $tigraMenu.$this->_openSubMenu($tag);
+
+ // see if it has children
+ if (($node['r'] - 1) != $node['l']) {
+ $children = array();
+ // harvest all the children
+ $tempStructure = $params['structure'];
+ foreach ($tempStructure as $childKey => $childNode) {
+ if (!isset($childNode['hit']) &&
+ $node['rootid'] == $childNode['rootid'] &&
+ $node['l'] < $childNode['l'] &&
+ $node['r'] > $childNode['r'] &&
+ $childNode['level'] > $params['currentLevel']) {
+ // important that we assign it by reference here, so that when the child
+ // marks itself 'hit' the parent loops will know
+ $children[] =& $params['structure'][$childKey];
+ }
+ }
+
+ $recurseParams = $params;
+ $recurseParams['structure'] = $children;
+ $recurseParams['currentLevel']++;
+ $tigraMenu = $tigraMenu.$this->_createFromStructure($recurseParams);
+ }
+
+ $tigraMenu = $tigraMenu.$this->_closeSubMenu();
+ }
+ return $tigraMenu;
+ }
+
+ // }}}
+ // {{{ _openMenu()
+
+ /**
+ * Returns the string which opens the JavaScript menu
+ *
+ * @access private
+ * @param int $menu_id ID of the menu needed to use more than one menu on a page
+ * @return string The JavaScript piece
+ */
+ function _openMenu($menu_id=1)
+ {
+ $str = false;
+ $str = $str."var MENU_ITEMS".$menu_id." = new Array();\n";
+ $str = $str."MENU_ITEMS".$menu_id." = [\n";
+ return $str;
+ }
+
+ // }}}
+ // {{{ _openSubMenu()
+
+ /**
+ * Returns the string which opens a submenu within the JavaScript menu
+ *
+ * @access private
+ * @param array $tag Contains the content of the current item (name, link)
+ * @return string The JavaScript piece
+ */
+ function _openSubMenu($tag)
+ {
+ $rtag = implode(', ', $tag);
+ return "\n[".$rtag.',';
+ }
+
+ // }}}
+ // {{{ _closeMenu()
+
+ /**
+ * Closes the JavaScript array
+ *
+ * @access private
+ * @return string The JavaScript piece
+ */
+ function _closeMenu()
+ {
+
+ return '];';
+ }
+
+ // }}}
+ // {{{ _closeSubMenu()
+
+ /**
+ * Closes the JavaScript array of a submenu
+ *
+ * @access private
+ * @return string The JavaScript piece
+ */
+ function _closeSubMenu()
+ {
+ return "\n],";
+ }
+
+ // }}}
+ // {{{ _addStyles()
+
+ /**
+ * Creates the JavaScript code which sets the styles for each level
+ *
+ * @access private
+ * @param int $menu_id ID of the menu needed to use more than one menu on a page
+ * @param array $rootStyles Array of style attributes for the top items
+ * @param array $childStyles Array of style attributes for the sub items
+ * @return string The JavaScript piece
+ */
+ function _addStyles($menu_id, $rootStyles, $childStyles = false)
+ {
+ if (!$childStyles) {
+ $childStyles = $rootStyles;
+ }
+
+ $styles = array();
+ foreach ($rootStyles as $key => $val) {
+ foreach ($val as $skey => $sval) {
+ $styles["'$key'"][$skey][] = "'$sval'";
+ }
+ }
+
+ foreach ($childStyles as $key => $val) {
+ foreach ($val as $skey => $sval) {
+ for ($i = 1; $i <= $this->_levels; $i++) {
+ $styles["'$key'"][$skey][] = "'$sval'";
+ }
+ }
+ }
+
+ $menustyles = false;
+ $menustyles = $menustyles . 'var MENU_STYLES'.$menu_id." = new Array();\n";
+ foreach ($styles as $key => $val) {
+ $menustyles = $menustyles.'MENU_STYLES'.$menu_id."[$key] = [\n";
+ foreach ($val as $skey => $sval) {
+ $menustyles = $menustyles . "'$skey', [".implode(', ', $sval)."],\n";
+ }
+ $menustyles = $menustyles."];\n";
+ }
+
+ return $menustyles;
+ }
+
+ // }}}
+ // {{{ _addGeometry()
+
+ /**
+ * Creates the JavaScript code which sets the position and geometry of the menu
+ *
+ * @access private
+ * @param int $menu_id ID of the menu needed to use more than one menu on a page
+ * @param array $rootGeometry Array of geometry attributes for the top items
+ * @param array $childGeometry Array of geometry attributes for the sub items
+ * @return string The JavaScript piece
+ */
+ function _addGeometry($menu_id, $rootGeometry, $childGeometry = false)
+ {
+ if (!$childGeometry) {
+ $childGeometry = $rootGeometry;
+ }
+
+ $params = array();
+ $geometry = array();
+ foreach ($rootGeometry as $key => $val) {
+ $geometry["'$key'"][] = $val;
+ $incr = false;
+ if (strpos($val, ',') !== false) {
+ list($start, $interval) = explode(',',$val);
+ $incr = true;
+ }
+
+ $ratio = false;
+ if ($key == 'width' && strpos($val, '*') !== false) {
+ $ratio = trim(str_replace('*','', $val));
+ }
+ if ($incr) {
+ $val = trim($interval);
+ if ($key == 'left' && preg_match('/[+-]/', $interval)) {
+ $val = $params[0]['width'] + trim($val);
+ }
+ } elseif ($incr) {
+ $val = trim($start);
+ } elseif ($ratio) {
+ $val = $ratio * $this->_strlenByLevel[0];
+ }
+ $geometry["'$key'"][0] = $val;
+ $params[0][$key] = $val;
+ }
+
+ foreach($childGeometry as $key => $val) {
+ $incr = false;
+ if (strpos($val, ',') !== false) {
+ list($start, $interval) = explode(',', $val);
+ $incr = true;
+ }
+
+ $ratio = false;
+ if ($key == 'width' && strpos($val, '*') !== false) {
+ $ratio = trim(str_replace('*', '', $val));
+ }
+
+ for ($i = 1; $i <= $this->_levels; $i++) {
+ if ($incr && isset($lastval[$key])) {
+ $val = trim($interval);
+ if($key == 'block_left' && preg_match('/[+-]/', $interval)) {
+ $val = $params[$i - 1]['width'] + trim($val);
+ }
+ } elseif($incr) {
+ $val = trim($start);
+ } elseif ($ratio) {
+ $val = $ratio * $this->_strlenByLevel[$i];
+ if($val < $params[0]['width']) {
+ $val = $params[0]['width'];
+ }
+ }
+
+ $lastval[$key] = $val;
+ $geometry["'$key'"][] = $val;
+ $params[$i][$key] = $val;
+ }
+
+ }
+
+ $pos = false;
+ $pos = $pos . 'var MENU_POS'.$menu_id." = new Array();\n";
+ foreach ($geometry as $key => $val) {
+ $pos = $pos . 'MENU_POS' . $menu_id . "[$key] = [" . implode(', ', $val) . "];\n";
+ }
+
+ return $pos;
+ }
+
+ // }}}
+ // {{{ printTree()
+
+ /**
+ * Print's the current tree using the output driver
+ *
+ * @access public
+ */
+ function printTree()
+ {
+ if (!$options = $this->_getOptions('printTree')) {
+ return PEAR::raiseError("TigraMenu::printTree() needs options. See TigraMenu::setOptions()", NESEO_ERROR_NO_OPTIONS, PEAR_ERROR_TRIGGER, E_USER_ERROR);
+ }
+
+ echo $this->_openMenu($options['menu_id']) . $this->_structTigraMenu .$this->_closeMenu();
+ echo "\n\n";
+ echo $this->_addStyles($options['menu_id'], $options['rootStyles'], $options['childStyles']);
+ echo "\n\n";
+ echo $this->_addGeometry($options['menu_id'], $options['rootGeometry'], $options['childGeometry']);
+ }
+
+ // }}}
+}
+?>
Index: v1.1-thales/bibliotheque/pear/DB/DataObject/Generator.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/DataObject/Generator.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/DataObject/Generator.php (revision 161)
@@ -0,0 +1,929 @@
+<?php
+/**
+ * Generation tools for DB_DataObject
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB_DataObject
+ * @author Alan Knowles <alan@akbkhome.com>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: Generator.php,v 1.96 2005/06/16 02:03:45 alan_k Exp $
+ * @link http://pear.php.net/package/DB_DataObject
+ */
+
+/**
+ *
+ * Config _$ptions
+ * [DB_DataObject_Generator]
+ * ; optional default = DB/DataObject.php
+ * extends_location =
+ * ; optional default = DB_DataObject
+ * extends =
+ * ; alter the extends field when updating a class (defaults to only replacing DB_DataObject)
+ * generator_class_rewrite = ANY|specific_name // default is DB_DataObject
+ *
+ */
+
+/**
+ * Needed classes
+ */
+require_once 'DB/DataObject.php';
+//require_once('Config.php');
+
+/**
+ * Generator class
+ *
+ * @package DB_DataObject
+ */
+class DB_DataObject_Generator extends DB_DataObject
+{
+ /* =========================================================== */
+ /* Utility functions - for building db config files */
+ /* =========================================================== */
+
+ /**
+ * Array of table names
+ *
+ * @var array
+ * @access private
+ */
+ var $tables;
+
+ /**
+ * associative array table -> array of table row objects
+ *
+ * @var array
+ * @access private
+ */
+ var $_definitions;
+
+ /**
+ * active table being output
+ *
+ * @var string
+ * @access private
+ */
+ var $table; // active tablename
+
+
+ /**
+ * The 'starter' = call this to start the process
+ *
+ * @access public
+ * @return none
+ */
+ function start()
+ {
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ $databases = array();
+ foreach($options as $k=>$v) {
+ if (substr($k,0,9) == 'database_') {
+ $databases[substr($k,9)] = $v;
+ }
+ }
+
+ if (@$options['database']) {
+ require_once 'DB.php';
+ $dsn = DB::parseDSN($options['database']);
+ if (!isset($database[$dsn['database']])) {
+ $databases[$dsn['database']] = $options['database'];
+ }
+ }
+
+ foreach($databases as $databasename => $database) {
+ if (!$database) {
+ continue;
+ }
+ $this->debug("CREATING FOR $databasename\n");
+ $class = get_class($this);
+ $t = new $class;
+ $t->_database_dsn = $database;
+
+
+ $t->_database = $databasename;
+ $dsn = DB::parseDSN($database);
+ if (($dsn['phptype'] == 'sqlite') && is_file($databasename)) {
+ $t->_database = basename($t->_database);
+ }
+ $t->_createTableList();
+
+ foreach(get_class_methods($class) as $method) {
+ if (substr($method,0,8 ) != 'generate') {
+ continue;
+ }
+ $this->debug("calling $method");
+ $t->$method();
+ }
+ }
+ $this->debug("DONE\n\n");
+ }
+
+ /**
+ * Output File was config object, now just string
+ * Used to generate the Tables
+ *
+ * @var string outputbuffer for table definitions
+ * @access private
+ */
+ var $_newConfig;
+
+ /**
+ * Build a list of tables;
+ * Currently this is very Mysql Specific - ideas for more generic stiff welcome
+ *
+ * @access private
+ * @return none
+ */
+ function _createTableList()
+ {
+ $this->_connect();
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+
+ $__DB= &$GLOBALS['_DB_DATAOBJECT']['CONNECTIONS'][$this->_database_dsn_md5];
+
+ // try getting a list of schema tables first. (postgres)
+ $__DB->expectError(DB_ERROR_UNSUPPORTED);
+ $this->tables = $__DB->getListOf('schema.tables');
+ $__DB->popExpect();
+
+ if (empty($this->tables) || is_a($this->tables , 'PEAR_Error')) {
+ //if that fails fall back to clasic tables list.
+ $this->tables = $__DB->getListOf('tables');
+ }
+ if (is_a($this->tables , 'PEAR_Error')) {
+ return PEAR::raiseError($this->tables->toString(), null, PEAR_ERROR_DIE);
+ }
+ // build views as well if asked to.
+ if (!empty($options['build_views'])) {
+ $views = $__DB->getListOf('views');
+ if (is_a($views,'PEAR_Error')) {
+ return PEAR::raiseError(
+ 'Error getting Views (check the PEAR bug database for the fix to DB), ' .
+ $views->toString(),
+ null,
+ PEAR_ERROR_DIE
+ );
+ }
+ $this->tables = array_merge ($this->tables, $views);
+ }
+
+ // declare a temporary table to be filled with matching tables names
+ $tmp_table = array();
+
+
+ foreach($this->tables as $table) {
+ if (isset($options['generator_include_regex']) &&
+ !preg_match($options['generator_include_regex'],$table)) {
+ continue;
+ } else if (isset($options['generator_exclude_regex']) &&
+ preg_match($options['generator_exclude_regex'],$table)) {
+ continue;
+ }
+ // postgres strip the schema bit from the
+ if (!empty($options['generator_strip_schema'])) {
+ $bits = explode('.', $table,2);
+ $table = $bits[0];
+ if (count($bits) > 1) {
+ $table = $bits[1];
+ }
+ }
+
+ $defs = $__DB->tableInfo($table);
+ if (is_a($defs,'PEAR_Error')) {
+ echo $defs->toString();
+ exit;
+ }
+ // cast all definitions to objects - as we deal with that better.
+
+
+
+ foreach($defs as $def) {
+ if (!is_array($def)) {
+ continue;
+ }
+
+ $this->_definitions[$table][] = (object) $def;
+
+ }
+ // we find a matching table, just store it into a temporary array
+ $tmp_table[] = $table;
+
+
+ }
+ // the temporary table array is now the right one (tables names matching
+ // with regex expressions have been removed)
+ $this->tables = $tmp_table;
+ //print_r($this->_definitions);
+ }
+
+ /**
+ * Auto generation of table data.
+ *
+ * it will output to db_oo_{database} the table definitions
+ *
+ * @access private
+ * @return none
+ */
+ function generateDefinitions()
+ {
+ $this->debug("Generating Definitions file: ");
+ if (!$this->tables) {
+ $this->debug("-- NO TABLES -- \n");
+ return;
+ }
+
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+
+
+ //$this->_newConfig = new Config('IniFile');
+ $this->_newConfig = '';
+ foreach($this->tables as $this->table) {
+ $this->_generateDefinitionsTable();
+ }
+ $this->_connect();
+ // dont generate a schema if location is not set
+ // it's created on the fly!
+ if (!@$options['schema_location'] && @!$options["ini_{$this->_database}"] ) {
+ return;
+ }
+ $base = @$options['schema_location'];
+ if (isset($options["ini_{$this->_database}"])) {
+ $file = $options["ini_{$this->_database}"];
+ } else {
+ $file = "{$base}/{$this->_database}.ini";
+ }
+
+ if (!file_exists(dirname($file))) {
+ require_once 'System.php';
+ System::mkdir(array('-p','-m',0755,dirname($file)));
+ }
+ $this->debug("Writing ini as {$file}\n");
+ touch($file);
+ //print_r($this->_newConfig);
+ $fh = fopen($file,'w');
+ fwrite($fh,$this->_newConfig);
+ fclose($fh);
+ //$ret = $this->_newConfig->writeInput($file,false);
+
+ //if (PEAR::isError($ret) ) {
+ // return PEAR::raiseError($ret->message,null,PEAR_ERROR_DIE);
+ // }
+ }
+
+ /**
+ * The table geneation part
+ *
+ * @access private
+ * @return tabledef and keys array.
+ */
+ function _generateDefinitionsTable()
+ {
+ global $_DB_DATAOBJECT;
+
+ $defs = $this->_definitions[$this->table];
+ $this->_newConfig .= "\n[{$this->table}]\n";
+ $keys_out = "\n[{$this->table}__keys]\n";
+ $keys_out_primary = '';
+ $keys_out_secondary = '';
+ if (@$_DB_DATAOBJECT['CONFIG']['debug'] > 2) {
+ echo "TABLE STRUCTURE FOR {$this->table}\n";
+ print_r($defs);
+ }
+ $DB = $this->getDatabaseConnection();
+ $dbtype = $DB->phptype;
+
+ $ret = array(
+ 'table' => array(),
+ 'keys' => array(),
+ );
+
+ $ret_keys_primary = array();
+ $ret_keys_secondary = array();
+
+
+
+ foreach($defs as $t) {
+
+ $n=0;
+
+ switch (strtoupper($t->type)) {
+
+ case 'INT':
+ case 'INT2': // postgres
+ case 'INT4': // postgres
+ case 'INT8': // postgres
+ case 'SERIAL4': // postgres
+ case 'SERIAL8': // postgres
+ case 'INTEGER':
+ case 'TINYINT':
+ case 'SMALLINT':
+ case 'MEDIUMINT':
+ case 'BIGINT':
+ $type = DB_DATAOBJECT_INT;
+ if ($t->len == 1) {
+ $type += DB_DATAOBJECT_BOOL;
+ }
+ break;
+
+ case 'REAL':
+ case 'DOUBLE':
+ case 'FLOAT':
+ case 'FLOAT8': // double precision (postgres)
+ case 'DECIMAL':
+ case 'NUMERIC':
+ case 'NUMBER': // oci8
+ $type = DB_DATAOBJECT_INT; // should really by FLOAT!!! / MONEY...
+ break;
+
+ case 'YEAR':
+ $type = DB_DATAOBJECT_INT;
+ break;
+
+ case 'BIT':
+ case 'BOOL':
+ case 'BOOLEAN':
+
+ $type = DB_DATAOBJECT_BOOL;
+ // postgres needs to quote '0'
+ if ($dbtype == 'pgsql') {
+ $type += DB_DATAOBJECT_STR;
+ }
+ break;
+
+ case 'STRING':
+ case 'CHAR':
+ case 'VARCHAR':
+ case 'VARCHAR2':
+ case 'TINYTEXT':
+
+ case 'ENUM':
+ case 'SET': // not really but oh well
+ case 'TIMESTAMPTZ': // postgres
+ case 'BPCHAR': // postgres
+ case 'INTERVAL': // postgres (eg. '12 days')
+
+ case 'CIDR': // postgres IP net spec
+ case 'INET': // postgres IP
+ case 'MACADDR': // postgress network Mac address.
+
+
+ $type = DB_DATAOBJECT_STR;
+ break;
+
+ case 'TEXT':
+ case 'MEDIUMTEXT':
+ case 'LONGTEXT':
+
+ $type = DB_DATAOBJECT_STR + DB_DATAOBJECT_TXT;
+ break;
+
+
+ case 'DATE':
+ $type = DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE;
+ break;
+
+ case 'TIME':
+ $type = DB_DATAOBJECT_STR + DB_DATAOBJECT_TIME;
+ break;
+
+
+ case 'DATETIME':
+
+ $type = DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME;
+ break;
+
+ case 'TIMESTAMP': // do other databases use this???
+
+ $type = ($dbtype == 'mysql') ?
+ DB_DATAOBJECT_MYSQLTIMESTAMP :
+ DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME;
+ break;
+
+
+ case 'TINYBLOB':
+ case 'BLOB': /// these should really be ignored!!!???
+ case 'MEDIUMBLOB':
+ case 'LONGBLOB':
+ case 'BYTEA': // postgres blob support..
+ $type = DB_DATAOBJECT_STR + DB_DATAOBJECT_BLOB;
+ break;
+
+
+ }
+
+
+ if (!strlen(trim($t->name))) {
+ continue;
+ }
+
+ if (preg_match('/not_null/i',$t->flags)) {
+ $type += DB_DATAOBJECT_NOTNULL;
+ }
+
+ $write_ini = true;
+ if (in_array($t->name,array('null','yes','no','true','false'))) {
+ echo "*****************************************************************\n".
+ "** WARNING **\n".
+ "** Found column '{$t->name}', which is invalid in an .ini file **\n".
+ "** This line will not be writen to the file - you will have **\n".
+ "** define the keys()/method manually. **\n".
+ "*****************************************************************\n";
+ $write_ini = false;
+ } else {
+ $this->_newConfig .= "{$t->name} = $type\n";
+ }
+
+ $ret['table'][$t->name] = $type;
+ // i've no idea if this will work well on other databases?
+ // only use primary key or nextval(), cause the setFrom blocks you setting all key items...
+ // if no keys exist fall back to using unique
+ //echo "\n{$t->name} => {$t->flags}\n";
+ if (preg_match("/(auto_increment|nextval\()/i",rawurldecode($t->flags))) {
+ // native sequences = 2
+ if ($write_ini) {
+ $keys_out_primary .= "{$t->name} = N\n";
+ }
+ $ret_keys_primary[$t->name] = 'N';
+
+ } else if (preg_match("/(primary|unique)/i",$t->flags)) {
+ // keys.. = 1
+ if ($write_ini) {
+ $keys_out_secondary .= "{$t->name} = K\n";
+ }
+ $ret_keys_secondary[$t->name] = 'K';
+ }
+
+
+ }
+
+ $this->_newConfig .= $keys_out . (empty($keys_out_primary) ? $keys_out_secondary : $keys_out_primary);
+ $ret['keys'] = empty($keys_out_primary) ? $ret_keys_secondary : $ret_keys_primary;
+
+ if (@$_DB_DATAOBJECT['CONFIG']['debug'] > 2) {
+ print_r(array("dump for {$this->table}", $ret));
+ }
+
+ return $ret;
+
+
+ }
+
+ /*
+ * building the class files
+ * for each of the tables output a file!
+ */
+ function generateClasses()
+ {
+ //echo "Generating Class files: \n";
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ $base = $options['class_location'];
+ if (strpos($base,'%s') !== false) {
+ $base = dirname($base);
+ }
+
+
+ if (!file_exists($base)) {
+ require_once 'System.php';
+ System::mkdir(array('-p',$base));
+ }
+ $class_prefix = $options['class_prefix'];
+ if ($extends = @$options['extends']) {
+ $this->_extends = $extends;
+ $this->_extendsFile = $options['extends_location'];
+ }
+
+ foreach($this->tables as $this->table) {
+ $this->table = trim($this->table);
+ $this->classname = $class_prefix.preg_replace('/[^A-Z0-9]/i','_',ucfirst($this->table));
+ $i = '';
+
+ if (strpos($options['class_location'],'%s') !== false) {
+ $outfilename = sprintf($options['class_location'], preg_replace('/[^A-Z0-9]/i','_',ucfirst($this->table)));
+ } else {
+ $outfilename = "{$base}/".preg_replace('/[^A-Z0-9]/i','_',ucfirst($this->table)).".php";
+ }
+ $oldcontents = '';
+ if (file_exists($outfilename)) {
+ // file_get_contents???
+ $oldcontents = implode('',file($outfilename));
+ }
+ $out = $this->_generateClassTable($oldcontents);
+ $this->debug( "writing $this->classname\n");
+ $fh = fopen($outfilename, "w");
+ fputs($fh,$out);
+ fclose($fh);
+ }
+ //echo $out;
+ }
+
+ /**
+ * class being extended (can be overridden by [DB_DataObject_Generator] extends=xxxx
+ *
+ * @var string
+ * @access private
+ */
+ var $_extends = 'DB_DataObject';
+
+ /**
+ * line to use for require('DB/DataObject.php');
+ *
+ * @var string
+ * @access private
+ */
+ var $_extendsFile = "DB/DataObject.php";
+
+ /**
+ * class being generated
+ *
+ * @var string
+ * @access private
+ */
+ var $_className;
+
+ /**
+ * The table class geneation part - single file.
+ *
+ * @access private
+ * @return none
+ */
+ function _generateClassTable($input = '')
+ {
+ // title = expand me!
+ $foot = "";
+ $head = "<?php\n/**\n * Table Definition for {$this->table}\n */\n";
+ // requires
+ $head .= "require_once '{$this->_extendsFile}';\n\n";
+ // add dummy class header in...
+ // class
+ $head .= "class {$this->classname} extends {$this->_extends} \n{";
+
+ $body = "\n ###START_AUTOCODE\n";
+ $body .= " /* the code below is auto generated do not remove the above tag */\n\n";
+ // table
+ $padding = (30 - strlen($this->table));
+ if ($padding < 2) $padding =2;
+ $p = str_repeat(' ',$padding) ;
+
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+
+
+ $var = (substr(phpversion(),0,1) > 4) ? 'public' : 'var';
+ $body .= " {$var} \$__table = '{$this->table}'; {$p}// table name\n";
+
+
+ // if we are using the option database_{databasename} = dsn
+ // then we should add var $_database = here
+ // as database names may not always match..
+
+ if (isset($options["database_{$this->_database}"])) {
+ $body .= " {$var} \$_database = '{$this->_database}'; {$p}// database name (used with database_{*} config)\n";
+ }
+
+ $var = (substr(phpversion(),0,1) > 4) ? 'public' : 'var';
+ if (!empty($options['generator_novars'])) {
+ $var = '//'.$var;
+ }
+
+ $defs = $this->_definitions[$this->table];
+
+ // show nice information!
+ $connections = array();
+ $sets = array();
+ foreach($defs as $t) {
+ if (!strlen(trim($t->name))) {
+ continue;
+ }
+ $padding = (30 - strlen($t->name));
+ if ($padding < 2) $padding =2;
+ $p = str_repeat(' ',$padding) ;
+
+ $body .=" {$var} \${$t->name}; {$p}// {$t->type}({$t->len}) {$t->flags}\n";
+
+ // can not do set as PEAR::DB table info doesnt support it.
+ //if (substr($t->Type,0,3) == "set")
+ // $sets[$t->Field] = "array".substr($t->Type,3);
+ $body .= $this->derivedHookVar($t,$padding);
+ }
+
+ // THIS IS TOTALLY BORKED old FC creation
+ // IT WILL BE REMOVED!!!!! in DataObjects 1.6
+ // grep -r __clone * to find all it's uses
+ // and replace them with $x = clone($y);
+ // due to the change in the PHP5 clone design.
+
+ if ( substr(phpversion(),0,1) < 5) {
+ $body .= "\n";
+ $body .= " /* ZE2 compatibility trick*/\n";
+ $body .= " function __clone() { return \$this;}\n";
+ }
+
+ // simple creation tools ! (static stuff!)
+ $body .= "\n";
+ $body .= " /* Static get */\n";
+ $body .= " function staticGet(\$k,\$v=NULL) { return DB_DataObject::staticGet('{$this->classname}',\$k,\$v); }\n";
+
+ // generate getter and setter methods
+ $body .= $this->_generateGetters($input);
+ $body .= $this->_generateSetters($input);
+
+ /*
+ theoretically there is scope here to introduce 'list' methods
+ based up 'xxxx_up' column!!! for heiracitcal trees..
+ */
+
+ // set methods
+ //foreach ($sets as $k=>$v) {
+ // $kk = strtoupper($k);
+ // $body .=" function getSets{$k}() { return {$v}; }\n";
+ //}
+ $body .= $this->derivedHookFunctions();
+
+ $body .= "\n /* the code above is auto generated do not remove the tag below */";
+ $body .= "\n ###END_AUTOCODE\n";
+
+
+ // stubs..
+
+ if (!empty($options['generator_add_validate_stubs'])) {
+ foreach($defs as $t) {
+ if (!strlen(trim($t->name))) {
+ continue;
+ }
+ $validate_fname = 'validate' . ucfirst(strtolower($t->name));
+ // dont re-add it..
+ if (preg_match('/\s+function\s+' . $validate_fname . '\s*\(/i', $input)) {
+ continue;
+ }
+ $body .= "\n function {$validate_fname}()\n {\n return false;\n }\n";
+ }
+ }
+
+
+
+
+ $foot .= "}\n";
+ $full = $head . $body . $foot;
+
+ if (!$input) {
+ return $full;
+ }
+ if (!preg_match('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n)/s',$input)) {
+ return $full;
+ }
+ if (!preg_match('/(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s',$input)) {
+ return $full;
+ }
+
+
+ /* this will only replace extends DB_DataObject by default,
+ unless use set generator_class_rewrite to ANY or a name*/
+
+ $class_rewrite = 'DB_DataObject';
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ if (!($class_rewrite = @$options['generator_class_rewrite'])) {
+ $class_rewrite = 'DB_DataObject';
+ }
+ if ($class_rewrite == 'ANY') {
+ $class_rewrite = '[a-z_]+';
+ }
+
+ $input = preg_replace(
+ '/(\n|\r\n)class\s*[a-z0-9_]+\s*extends\s*' .$class_rewrite . '\s*\{(\n|\r\n)/si',
+ "\nclass {$this->classname} extends {$this->_extends} \n{\n",
+ $input);
+
+ return preg_replace(
+ '/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s',
+ $body,$input);
+ }
+
+ /**
+ * hook to add extra methods to all classes
+ *
+ * called once for each class, use with $this->table and
+ * $this->_definitions[$this->table], to get data out of the current table,
+ * use it to add extra methods to the default classes.
+ *
+ * @access public
+ * @return string added to class eg. functions.
+ */
+ function derivedHookFunctions()
+ {
+ // This is so derived generator classes can generate functions
+ // It MUST NOT be changed here!!!
+ return "";
+ }
+
+ /**
+ * hook for var lines
+ * called each time a var line is generated, override to add extra var
+ * lines
+ *
+ * @param object t containing type,len,flags etc. from tableInfo call
+ * @param int padding number of spaces
+ * @access public
+ * @return string added to class eg. functions.
+ */
+ function derivedHookVar(&$t,$padding)
+ {
+ // This is so derived generator classes can generate variabels
+ // It MUST NOT be changed here!!!
+ return "";
+ }
+
+
+ /**
+ * getProxyFull - create a class definition on the fly and instantate it..
+ *
+ * similar to generated files - but also evals the class definitoin code.
+ *
+ *
+ * @param string database name
+ * @param string table name of table to create proxy for.
+ *
+ *
+ * @return object Instance of class. or PEAR Error
+ * @access public
+ */
+ function getProxyFull($database,$table) {
+
+ if ($err = $this->fillTableSchema($database,$table)) {
+ return $err;
+ }
+
+
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ $class_prefix = $options['class_prefix'];
+
+ if ($extends = @$options['extends']) {
+ $this->_extends = $extends;
+ $this->_extendsFile = $options['extends_location'];
+ }
+
+
+ $classname = $this->classname = $class_prefix.preg_replace('/[^A-Z0-9]/i','_',ucfirst(trim($this->table)));
+
+ $out = $this->_generateClassTable();
+ //echo $out;
+ eval('?>'.$out);
+ return new $classname;
+
+ }
+
+ /**
+ * fillTableSchema - set the database schema on the fly
+ *
+ *
+ *
+ * @param string database name
+ * @param string table name of table to create schema info for
+ *
+ * @return none | PEAR::error()
+ * @access public
+ */
+ function fillTableSchema($database,$table) {
+ global $_DB_DATAOBJECT;
+ $this->_database = $database;
+
+ $this->_connect();
+ $table = trim($table);
+
+ $__DB= &$GLOBALS['_DB_DATAOBJECT']['CONNECTIONS'][$this->_database_dsn_md5];
+
+ $defs = $__DB->tableInfo($table);
+ if (PEAR::isError($defs)) {
+ return $defs;
+ }
+ if (@$_DB_DATAOBJECT['CONFIG']['debug'] > 2) {
+ $this->debug("getting def for $database/$table",'fillTable');
+ $this->debug(print_r($defs,true),'defs');
+ }
+ // cast all definitions to objects - as we deal with that better.
+
+
+ foreach($defs as $def) {
+ if (is_array($def)) {
+ $this->_definitions[$table][] = (object) $def;
+ }
+ }
+
+ $this->table = trim($table);
+ $ret = $this->_generateDefinitionsTable();
+
+ $_DB_DATAOBJECT['INI'][$database][$table] = $ret['table'];
+ $_DB_DATAOBJECT['INI'][$database][$table.'__keys'] = $ret['keys'];
+ return false;
+
+ }
+
+ /**
+ * Generate getter methods for class definition
+ *
+ * @param string $input Existing class contents
+ * @return string
+ * @access public
+ */
+ function _generateGetters($input) {
+
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ $getters = '';
+
+ // only generate if option is set to true
+ if (empty($options['generate_getters'])) {
+ return '';
+ }
+
+ // remove auto-generated code from input to be able to check if the method exists outside of the auto-code
+ $input = preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', '', $input);
+
+ $getters .= "\n\n";
+ $defs = $this->_definitions[$this->table];
+
+ // loop through properties and create getter methods
+ foreach ($defs = $defs as $t) {
+
+ // build mehtod name
+ $methodName = 'get' . ucfirst($t->name);
+
+ if (!strlen(trim($t->name)) || preg_match("/function[\s]+[&]?$methodName\(/i", $input)) {
+ continue;
+ }
+
+ $getters .= " /**\n";
+ $getters .= " * Getter for \${$t->name}\n";
+ $getters .= " *\n";
+ $getters .= (stristr($t->flags, 'multiple_key')) ? " * @return object\n"
+ : " * @return {$t->type}\n";
+ $getters .= " * @access public\n";
+ $getters .= " */\n";
+ $getters .= (substr(phpversion(),0,1) > 4) ? ' public '
+ : ' ';
+ $getters .= "function $methodName() {\n";
+ $getters .= " return \$this->{$t->name};\n";
+ $getters .= " }\n\n";
+ }
+
+
+ return $getters;
+ }
+
+
+ /**
+ * Generate setter methods for class definition
+ *
+ * @param string Existing class contents
+ * @return string
+ * @access public
+ */
+ function _generateSetters($input) {
+
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ $setters = '';
+
+ // only generate if option is set to true
+ if (empty($options['generate_setters'])) {
+ return '';
+ }
+
+ // remove auto-generated code from input to be able to check if the method exists outside of the auto-code
+ $input = preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', '', $input);
+
+ $setters .= "\n";
+ $defs = $this->_definitions[$this->table];
+
+ // loop through properties and create setter methods
+ foreach ($defs = $defs as $t) {
+
+ // build mehtod name
+ $methodName = 'set' . ucfirst($t->name);
+
+ if (!strlen(trim($t->name)) || preg_match("/function[\s]+[&]?$methodName\(/i", $input)) {
+ continue;
+ }
+
+ $setters .= " /**\n";
+ $setters .= " * Setter for \${$t->name}\n";
+ $setters .= " *\n";
+ $setters .= " * @param mixed input value\n";
+ $setters .= " * @access public\n";
+ $setters .= " */\n";
+ $setters .= (substr(phpversion(),0,1) > 4) ? ' public '
+ : ' ';
+ $setters .= "function $methodName(\$value) {\n";
+ $setters .= " \$this->{$t->name} = \$value;\n";
+ $setters .= " }\n\n";
+ }
+
+
+ return $setters;
+ }
+
+}
Index: v1.1-thales/bibliotheque/pear/DB/DataObject/Error.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/DataObject/Error.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/DataObject/Error.php (revision 161)
@@ -0,0 +1,53 @@
+<?php
+/**
+ * DataObjects error handler, loaded on demand...
+ *
+ * DB_DataObject_Error is a quick wrapper around pear error, so you can distinguish the
+ * error code source.
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB_DataObject
+ * @author Alan Knowles <alan@akbkhome.com>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: Error.php,v 1.3 2005/03/23 02:35:35 alan_k Exp $
+ * @link http://pear.php.net/package/DB_DataObject
+ */
+
+
+class DB_DataObject_Error extends PEAR_Error
+{
+
+ /**
+ * DB_DataObject_Error constructor.
+ *
+ * @param mixed $code DB error code, or string with error message.
+ * @param integer $mode what "error mode" to operate in
+ * @param integer $level what error level to use for $mode & PEAR_ERROR_TRIGGER
+ * @param mixed $debuginfo additional debug info, such as the last query
+ *
+ * @access public
+ *
+ * @see PEAR_Error
+ */
+ function DB_DataObject_Error($message = '', $code = DB_ERROR, $mode = PEAR_ERROR_RETURN,
+ $level = E_USER_NOTICE)
+ {
+ $this->PEAR_Error('DB_DataObject Error: ' . $message, $code, $mode, $level);
+
+ }
+
+
+ // todo : - support code -> message handling, and translated error messages...
+
+
+
+}
Index: v1.1-thales/bibliotheque/pear/DB/DataObject/Cast.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/DataObject/Cast.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/DataObject/Cast.php (revision 161)
@@ -0,0 +1,546 @@
+<?php
+/**
+ * Prototype Castable Object.. for DataObject queries
+ *
+ * Storage for Data that may be cast into a variety of formats.
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB_DataObject
+ * @author Alan Knowles <alan@akbkhome.com>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: Cast.php,v 1.15 2005/07/07 05:30:53 alan_k Exp $
+ * @link http://pear.php.net/package/DB_DataObject
+ */
+
+/**
+*
+* Common usages:
+* // blobs
+* $data = DB_DataObject_Cast::blob($somefile);
+* $data = DB_DataObject_Cast::string($somefile);
+* $dataObject->someblobfield = $data
+*
+* // dates?
+* $d1 = new DB_DataObject_Cast::date('12/12/2000');
+* $d2 = new DB_DataObject_Cast::date(2000,12,30);
+* $d3 = new DB_DataObject_Cast::date($d1->year, $d1->month+30, $d1->day+30);
+*
+* // time, datetime.. ?????????
+*
+* // raw sql????
+* $data = DB_DataObject_Cast::sql('cast("123123",datetime)');
+* $data = DB_DataObject_Cast::sql('NULL');
+*
+* // int's/string etc. are proably pretty pointless..!!!!
+*
+*
+* inside DB_DataObject,
+* if (is_a($v,'db_dataobject_class')) {
+* $value .= $v->toString(DB_DATAOBJECT_INT,'mysql');
+* }
+*
+*
+*
+*
+
+*/
+class DB_DataObject_Cast {
+
+ /**
+ * Type of data Stored in the object..
+ *
+ * @var string (date|blob|.....?)
+ * @access public
+ */
+ var $type;
+
+ /**
+ * Data For date representation
+ *
+ * @var int day/month/year
+ * @access public
+ */
+ var $day;
+ var $month;
+ var $year;
+
+
+ /**
+ * Generic Data..
+ *
+ * @var string
+ * @access public
+ */
+
+ var $value;
+
+
+
+ /**
+ * Blob consructor
+ *
+ * create a Cast object from some raw data.. (binary)
+ *
+ *
+ * @param string (with binary data!)
+ *
+ * @return object DB_DataObject_Cast
+ * @access public
+ */
+
+ function blob($value) {
+ $r = new DB_DataObject_Cast;
+ $r->type = 'blob';
+ $r->value = $value;
+ return $r;
+ }
+
+
+ /**
+ * String consructor (actually use if for ints and everything else!!!
+ *
+ * create a Cast object from some string (not binary)
+ *
+ *
+ * @param string (with binary data!)
+ *
+ * @return object DB_DataObject_Cast
+ * @access public
+ */
+
+ function string($value) {
+ $r = new DB_DataObject_Cast;
+ $r->type = 'string';
+ $r->value = $value;
+ return $r;
+ }
+
+ /**
+ * SQL constructor (for raw SQL insert)
+ *
+ * create a Cast object from some sql
+ *
+ * @param string (with binary data!)
+ *
+ * @return object DB_DataObject_Cast
+ * @access public
+ */
+
+ function sql($value)
+ {
+ $r = new DB_DataObject_Cast;
+ $r->type = 'sql';
+ $r->value = $value;
+ return $r;
+ }
+
+
+ /**
+ * Date Constructor
+ *
+ * create a Cast object from some string (not binary)
+ * NO VALIDATION DONE, although some crappy re-calcing done!
+ *
+ * @param vargs... accepts
+ * dd/mm
+ * dd/mm/yyyy
+ * yyyy-mm
+ * yyyy-mm-dd
+ * array(yyyy,dd)
+ * array(yyyy,dd,mm)
+ *
+ *
+ *
+ * @return object DB_DataObject_Cast
+ * @access public
+ */
+
+ function date()
+ {
+ $args = func_get_args();
+ switch(count($args)) {
+ case 0: // no args = today!
+ $bits = explode('-',date('Y-m-d'));
+ break;
+ case 1: // one arg = a string
+
+ if (strpos($args[0],'/') !== false) {
+ $bits = array_reverse(explode('/',$args[0]));
+ } else {
+ $bits = explode('-',$args[0]);
+ }
+ break;
+ default: // 2 or more..
+ $bits = $args;
+ }
+ if (count($bits) == 1) { // if YYYY set day = 1st..
+ $bits[] = 1;
+ }
+
+ if (count($bits) == 2) { // if YYYY-DD set day = 1st..
+ $bits[] = 1;
+ }
+
+ // if year < 1970 we cant use system tools to check it...
+ // so we make a few best gueses....
+ // basically do date calculations for the year 2000!!!
+ // fix me if anyone has more time...
+ if (($bits[0] < 1975) || ($bits[0] > 2030)) {
+ $oldyear = $bits[0];
+ $bits = explode('-',date('Y-m-d',mktime(1,1,1,$bits[1],$bits[2],2000)));
+ $bits[0] = ($bits[0] - 2000) + $oldyear;
+ } else {
+ // now mktime
+ $bits = explode('-',date('Y-m-d',mktime(1,1,1,$bits[1],$bits[2],$bits[0])));
+ }
+ $r = new DB_DataObject_Cast;
+ $r->type = 'date';
+ list($r->year,$r->month,$r->day) = $bits;
+ return $r;
+ }
+
+
+
+ /**
+ * Data For time representation ** does not handle timezones!!
+ *
+ * @var int hour/minute/second
+ * @access public
+ */
+ var $hour;
+ var $minute;
+ var $second;
+
+
+ /**
+ * DateTime Constructor
+ *
+ * create a Cast object from a Date/Time
+ * Maybe should accept a Date object.!
+ * NO VALIDATION DONE, although some crappy re-calcing done!
+ *
+ * @param vargs... accepts
+ * noargs (now)
+ * yyyy-mm-dd HH:MM:SS (Iso)
+ * array(yyyy,mm,dd,HH,MM,SS)
+ *
+ *
+ * @return object DB_DataObject_Cast
+ * @access public
+ * @author therion 5 at hotmail
+ */
+
+ function dateTime()
+ {
+ $args = func_get_args();
+ switch(count($args)) {
+ case 0: // no args = now!
+ $datetime = date('Y-m-d G:i:s', mktime());
+
+ case 1:
+ // continue on from 0 args.
+ if (!isset($datetime)) {
+ $datetime = $args[0];
+ }
+
+ $parts = explode(' ', $datetime);
+ $bits = explode('-', $parts[0]);
+ $bits = array_merge($bits, explode(':', $parts[1]));
+ break;
+
+ default: // 2 or more..
+ $bits = $args;
+
+ }
+
+ if (count($bits) != 6) {
+ // PEAR ERROR?
+ return false;
+ }
+
+ $r = DB_DataObject_Cast::date($bits[0], $bits[1], $bits[2]);
+ if (!$r) {
+ return $r; // pass thru error (False) - doesnt happen at present!
+ }
+ // change the type!
+ $r->type = 'datetime';
+
+ // should we mathematically sort this out..
+ // (or just assume that no-one's dumb enough to enter 26:90:90 as a time!
+ $r->hour = $bits[3];
+ $r->minute = $bits[4];
+ $r->second = $bits[5];
+ return $r;
+
+ }
+
+
+
+ /**
+ * time Constructor
+ *
+ * create a Cast object from a Date/Time
+ * Maybe should accept a Date object.!
+ * NO VALIDATION DONE, and no-recalcing done!
+ *
+ * @param vargs... accepts
+ * noargs (now)
+ * HH:MM:SS (Iso)
+ * array(HH,MM,SS)
+ *
+ *
+ * @return object DB_DataObject_Cast
+ * @access public
+ * @author therion 5 at hotmail
+ */
+ function time()
+ {
+ $args = func_get_args();
+ switch (count($args)) {
+ case 0: // no args = now!
+ $time = date('G:i:s', mktime());
+
+ case 1:
+ // continue on from 0 args.
+ if (!isset($time)) {
+ $time = $args[0];
+ }
+ $bits = explode(':', $time);
+ break;
+
+ default: // 2 or more..
+ $bits = $args;
+
+ }
+
+ if (count($bits) != 3) {
+ return false;
+ }
+
+ // now take data from bits into object fields
+ $r = new DB_DataObject_Cast;
+ $r->type = 'time';
+ $r->hour = $bits[0];
+ $r->minute = $bits[1];
+ $r->second = $bits[2];
+ return $r;
+
+ }
+
+
+
+ /**
+ * get the string to use in the SQL statement for this...
+ *
+ *
+ * @param int $to Type (DB_DATAOBJECT_*
+ * @param object $db DB Connection Object
+ *
+ *
+ * @return string
+ * @access public
+ */
+
+ function toString($to=false,$db)
+ {
+ // if $this->type is not set, we are in serious trouble!!!!
+ // values for to:
+ $method = 'toStringFrom'.$this->type;
+ return $this->$method($to,$db);
+ }
+
+ /**
+ * get the string to use in the SQL statement from a blob of binary data
+ * ** Suppots only blob->postgres::bytea
+ *
+ * @param int $to Type (DB_DATAOBJECT_*
+ * @param object $db DB Connection Object
+ *
+ *
+ * @return string
+ * @access public
+ */
+ function toStringFromBlob($to,$db)
+ {
+ // first weed out invalid casts..
+ // in blobs can only be cast to blobs.!
+
+ // perhaps we should support TEXT fields???
+
+ if (!($to & DB_DATAOBJECT_BLOB)) {
+ return PEAR::raiseError('Invalid Cast from a DB_DataObject_Cast::blob to something other than a blob!');
+ }
+
+ switch ($db->dsn["phptype"]) {
+ case 'pgsql':
+ return "'".pg_escape_bytea($this->value)."'::bytea";
+
+ case 'mysql':
+ return "'".mysql_real_escape_string($this->value,$db->connection)."'";
+
+ case 'mysqli':
+ // this is funny - the parameter order is reversed ;)
+ return "'".mysqli_real_escape_string($db->connection, $this->value)."'";
+
+
+
+ default:
+ return PEAR::raiseError("DB_DataObject_Cast cant handle blobs for Database:{$db->dsn['phptype']} Yet");
+ }
+
+ }
+
+ /**
+ * get the string to use in the SQL statement for a blob from a string!
+ * ** Suppots only string->postgres::bytea
+ *
+ *
+ * @param int $to Type (DB_DATAOBJECT_*
+ * @param object $db DB Connection Object
+ *
+ *
+ * @return string
+ * @access public
+ */
+ function toStringFromString($to,$db)
+ {
+ // first weed out invalid casts..
+ // in blobs can only be cast to blobs.!
+
+ // perhaps we should support TEXT fields???
+ //
+
+ if (!($to & DB_DATAOBJECT_BLOB)) {
+ return PEAR::raiseError('Invalid Cast from a DB_DataObject_Cast::string to something other than a blob!'.
+ ' (why not just use native features)');
+ }
+
+ switch ($db->dsn['phptype']) {
+ case 'pgsql':
+ return "'".pg_escape_string($this->value)."'::bytea";
+
+ case 'mysql':
+ return "'".mysql_real_escape_string($this->value,$db->connection)."'";
+
+
+ case 'mysqli':
+ return "'".mysqli_real_escape_string($db->connection, $this->value)."'";
+
+
+ default:
+ return PEAR::raiseError("DB_DataObject_Cast cant handle blobs for Database:{$db->dsn['phptype']} Yet");
+ }
+
+ }
+
+
+ /**
+ * get the string to use in the SQL statement for a date
+ *
+ *
+ *
+ * @param int $to Type (DB_DATAOBJECT_*
+ * @param object $db DB Connection Object
+ *
+ *
+ * @return string
+ * @access public
+ */
+ function toStringFromDate($to,$db)
+ {
+ // first weed out invalid casts..
+ // in blobs can only be cast to blobs.!
+ // perhaps we should support TEXT fields???
+ //
+
+ if (($to !== false) && !($to & DB_DATAOBJECT_DATE)) {
+ return PEAR::raiseError('Invalid Cast from a DB_DataObject_Cast::string to something other than a date!'.
+ ' (why not just use native features)');
+ }
+ return "'{$this->year}-{$this->month}-{$this->day}'";
+ }
+
+ /**
+ * get the string to use in the SQL statement for a datetime
+ *
+ *
+ *
+ * @param int $to Type (DB_DATAOBJECT_*
+ * @param object $db DB Connection Object
+ *
+ *
+ * @return string
+ * @access public
+ * @author therion 5 at hotmail
+ */
+
+ function toStringFromDateTime($to,$db)
+ {
+ // first weed out invalid casts..
+ // in blobs can only be cast to blobs.!
+ // perhaps we should support TEXT fields???
+ if (($to !== false) &&
+ !($to & (DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME))) {
+ return PEAR::raiseError('Invalid Cast from a ' .
+ ' DB_DataObject_Cast::dateTime to something other than a datetime!' .
+ ' (try using native features)');
+ }
+ return "'{$this->year}-{$this->month}-{$this->day} {$this->hour}:{$this->minute}:{$this->second}'";
+ }
+
+ /**
+ * get the string to use in the SQL statement for a time
+ *
+ *
+ *
+ * @param int $to Type (DB_DATAOBJECT_*
+ * @param object $db DB Connection Object
+ *
+ *
+ * @return string
+ * @access public
+ * @author therion 5 at hotmail
+ */
+
+ function toStringFromTime($to,$db)
+ {
+ // first weed out invalid casts..
+ // in blobs can only be cast to blobs.!
+ // perhaps we should support TEXT fields???
+ if (($to !== false) && !($to & DB_DATAOBJECT_TIME)) {
+ return PEAR::raiseError('Invalid Cast from a' .
+ ' DB_DataObject_Cast::time to something other than a time!'.
+ ' (try using native features)');
+ }
+ return "'{$this->hour}:{$this->minute}:{$this->second}'";
+ }
+
+ /**
+ * get the string to use in the SQL statement for a raw sql statement.
+ *
+ * @param int $to Type (DB_DATAOBJECT_*
+ * @param object $db DB Connection Object
+ *
+ *
+ * @return string
+ * @access public
+ */
+ function toStringFromSql($to,$db)
+ {
+ return $this->value;
+ }
+
+
+
+
+}
+
Index: v1.1-thales/bibliotheque/pear/DB/DataObject/createTables.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/DataObject/createTables.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/DataObject/createTables.php (revision 161)
@@ -0,0 +1,55 @@
+#!/usr/bin/php -q
+<?php
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Author: Alan Knowles <alan@akbkhome.com>
+// +----------------------------------------------------------------------+
+//
+// $Id: createTables.php,v 1.23 2005/05/04 14:13:57 alan_k Exp $
+//
+
+// since this version doesnt use overload,
+// and I assume anyone using custom generators should add this..
+
+define('DB_DATAOBJECT_NO_OVERLOAD',1);
+
+require_once 'DB/DataObject/Generator.php';
+
+if (!ini_get('register_argc_argv')) {
+ PEAR::raiseError("\nERROR: You must turn register_argc_argv On in you php.ini file for this to work\neg.\n\nregister_argc_argv = On\n\n", null, PEAR_ERROR_DIE);
+ exit;
+}
+
+if (!@$_SERVER['argv'][1]) {
+ PEAR::raiseError("\nERROR: createTable.php usage:\n\nC:\php\pear\DB\DataObjects\createTable.php example.ini\n\n", null, PEAR_ERROR_DIE);
+ exit;
+}
+
+$config = parse_ini_file($_SERVER['argv'][1], true);
+foreach($config as $class=>$values) {
+ $options = &PEAR::getStaticProperty($class,'options');
+ $options = $values;
+}
+
+
+$options = &PEAR::getStaticProperty('DB_DataObject','options');
+if (empty($options)) {
+ PEAR::raiseError("\nERROR: could not read ini file\n\n", null, PEAR_ERROR_DIE);
+ exit;
+}
+set_time_limit(0);
+DB_DataObject::debugLevel(1);
+$generator = new DB_DataObject_Generator;
+$generator->start();
+
Index: v1.1-thales/bibliotheque/pear/DB/msql.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/msql.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/msql.php (revision 161)
@@ -0,0 +1,810 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's msql extension
+ * for interacting with Mini SQL databases
+ *
+ * PHP's mSQL extension did weird things with NULL values prior to PHP
+ * 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
+ * those versions.
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB
+ * @author Daniel Convissor <danielc@php.net>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: msql.php,v 1.57 2005/02/22 07:26:46 danielc Exp $
+ * @link http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's msql extension
+ * for interacting with Mini SQL databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * PHP's mSQL extension did weird things with NULL values prior to PHP
+ * 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
+ * those versions.
+ *
+ * @category Database
+ * @package DB
+ * @author Daniel Convissor <danielc@php.net>
+ * @copyright 1997-2005 The PHP Group
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version Release: 1.7.6
+ * @link http://pear.php.net/package/DB
+ * @since Class not functional until Release 1.7.0
+ */
+class DB_msql extends DB_common
+{
+ // {{{ properties
+
+ /**
+ * The DB driver type (mysql, oci8, odbc, etc.)
+ * @var string
+ */
+ var $phptype = 'msql';
+
+ /**
+ * The database syntax variant to be used (db2, access, etc.), if any
+ * @var string
+ */
+ var $dbsyntax = 'msql';
+
+ /**
+ * The capabilities of this DB implementation
+ *
+ * The 'new_link' element contains the PHP version that first provided
+ * new_link support for this DBMS. Contains false if it's unsupported.
+ *
+ * Meaning of the 'limit' element:
+ * + 'emulate' = emulate with fetch row by number
+ * + 'alter' = alter the query
+ * + false = skip rows
+ *
+ * @var array
+ */
+ var $features = array(
+ 'limit' => 'emulate',
+ 'new_link' => false,
+ 'numrows' => true,
+ 'pconnect' => true,
+ 'prepare' => false,
+ 'ssl' => false,
+ 'transactions' => false,
+ );
+
+ /**
+ * A mapping of native error codes to DB error codes
+ * @var array
+ */
+ var $errorcode_map = array(
+ );
+
+ /**
+ * The raw database connection created by PHP
+ * @var resource
+ */
+ var $connection;
+
+ /**
+ * The DSN information for connecting to a database
+ * @var array
+ */
+ var $dsn = array();
+
+
+ /**
+ * The query result resource created by PHP
+ *
+ * Used to make affectedRows() work. Only contains the result for
+ * data manipulation queries. Contains false for other queries.
+ *
+ * @var resource
+ * @access private
+ */
+ var $_result;
+
+
+ // }}}
+ // {{{ constructor
+
+ /**
+ * This constructor calls <kbd>$this->DB_common()</kbd>
+ *
+ * @return void
+ */
+ function DB_msql()
+ {
+ $this->DB_common();
+ }
+
+ // }}}
+ // {{{ connect()
+
+ /**
+ * Connect to the database server, log in and open the database
+ *
+ * Don't call this method directly. Use DB::connect() instead.
+ *
+ * Example of how to connect:
+ * <code>
+ * require_once 'DB.php';
+ *
+ * // $dsn = 'msql://hostname/dbname'; // use a TCP connection
+ * $dsn = 'msql:///dbname'; // use a socket
+ * $options = array(
+ * 'portability' => DB_PORTABILITY_ALL,
+ * );
+ *
+ * $db =& DB::connect($dsn, $options);
+ * if (PEAR::isError($db)) {
+ * die($db->getMessage());
+ * }
+ * </code>
+ *
+ * @param array $dsn the data source name
+ * @param bool $persistent should the connection be persistent?
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ */
+ function connect($dsn, $persistent = false)
+ {
+ if (!PEAR::loadExtension('msql')) {
+ return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+ }
+
+ $this->dsn = $dsn;
+ if ($dsn['dbsyntax']) {
+ $this->dbsyntax = $dsn['dbsyntax'];
+ }
+
+ $params = array();
+ if ($dsn['hostspec']) {
+ $params[] = $dsn['port']
+ ? $dsn['hostspec'] . ',' . $dsn['port']
+ : $dsn['hostspec'];
+ }
+
+ $connect_function = $persistent ? 'msql_pconnect' : 'msql_connect';
+
+ $ini = ini_get('track_errors');
+ $php_errormsg = '';
+ if ($ini) {
+ $this->connection = @call_user_func_array($connect_function,
+ $params);
+ } else {
+ ini_set('track_errors', 1);
+ $this->connection = @call_user_func_array($connect_function,
+ $params);
+ ini_set('track_errors', $ini);
+ }
+
+ if (!$this->connection) {
+ if (($err = @msql_error()) != '') {
+ return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+ null, null, null,
+ $err);
+ } else {
+ return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+ null, null, null,
+ $php_errormsg);
+ }
+ }
+
+ if (!@msql_select_db($dsn['database'], $this->connection)) {
+ return $this->msqlRaiseError();
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ disconnect()
+
+ /**
+ * Disconnects from the database server
+ *
+ * @return bool TRUE on success, FALSE on failure
+ */
+ function disconnect()
+ {
+ $ret = @msql_close($this->connection);
+ $this->connection = null;
+ return $ret;
+ }
+
+ // }}}
+ // {{{ simpleQuery()
+
+ /**
+ * Sends a query to the database server
+ *
+ * @param string the SQL query string
+ *
+ * @return mixed + a PHP result resrouce for successful SELECT queries
+ * + the DB_OK constant for other successful queries
+ * + a DB_Error object on failure
+ */
+ function simpleQuery($query)
+ {
+ $this->last_query = $query;
+ $query = $this->modifyQuery($query);
+ $result = @msql_query($query, $this->connection);
+ if (!$result) {
+ return $this->msqlRaiseError();
+ }
+ // Determine which queries that should return data, and which
+ // should return an error code only.
+ if (DB::isManip($query)) {
+ $this->_result = $result;
+ return DB_OK;
+ } else {
+ $this->_result = false;
+ return $result;
+ }
+ }
+
+
+ // }}}
+ // {{{ nextResult()
+
+ /**
+ * Move the internal msql result pointer to the next available result
+ *
+ * @param a valid fbsql result resource
+ *
+ * @access public
+ *
+ * @return true if a result is available otherwise return false
+ */
+ function nextResult($result)
+ {
+ return false;
+ }
+
+ // }}}
+ // {{{ fetchInto()
+
+ /**
+ * Places a row from the result set into the given array
+ *
+ * Formating of the array and the data therein are configurable.
+ * See DB_result::fetchInto() for more information.
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::fetchInto() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * PHP's mSQL extension did weird things with NULL values prior to PHP
+ * 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
+ * those versions.
+ *
+ * @param resource $result the query result resource
+ * @param array $arr the referenced array to put the data in
+ * @param int $fetchmode how the resulting array should be indexed
+ * @param int $rownum the row number to fetch (0 = first row)
+ *
+ * @return mixed DB_OK on success, NULL when the end of a result set is
+ * reached or on failure
+ *
+ * @see DB_result::fetchInto()
+ */
+ function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+ {
+ if ($rownum !== null) {
+ if (!@msql_data_seek($result, $rownum)) {
+ return null;
+ }
+ }
+ if ($fetchmode & DB_FETCHMODE_ASSOC) {
+ $arr = @msql_fetch_array($result, MSQL_ASSOC);
+ if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+ $arr = array_change_key_case($arr, CASE_LOWER);
+ }
+ } else {
+ $arr = @msql_fetch_row($result);
+ }
+ if (!$arr) {
+ return null;
+ }
+ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+ $this->_rtrimArrayValues($arr);
+ }
+ if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+ $this->_convertNullArrayValuesToEmpty($arr);
+ }
+ return DB_OK;
+ }
+
+ // }}}
+ // {{{ freeResult()
+
+ /**
+ * Deletes the result set and frees the memory occupied by the result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::free() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return bool TRUE on success, FALSE if $result is invalid
+ *
+ * @see DB_result::free()
+ */
+ function freeResult($result)
+ {
+ return @msql_free_result($result);
+ }
+
+ // }}}
+ // {{{ numCols()
+
+ /**
+ * Gets the number of columns in a result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::numCols() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return int the number of columns. A DB_Error object on failure.
+ *
+ * @see DB_result::numCols()
+ */
+ function numCols($result)
+ {
+ $cols = @msql_num_fields($result);
+ if (!$cols) {
+ return $this->msqlRaiseError();
+ }
+ return $cols;
+ }
+
+ // }}}
+ // {{{ numRows()
+
+ /**
+ * Gets the number of rows in a result set
+ *
+ * This method is not meant to be called directly. Use
+ * DB_result::numRows() instead. It can't be declared "protected"
+ * because DB_result is a separate object.
+ *
+ * @param resource $result PHP's query result resource
+ *
+ * @return int the number of rows. A DB_Error object on failure.
+ *
+ * @see DB_result::numRows()
+ */
+ function numRows($result)
+ {
+ $rows = @msql_num_rows($result);
+ if ($rows === false) {
+ return $this->msqlRaiseError();
+ }
+ return $rows;
+ }
+
+ // }}}
+ // {{{ affected()
+
+ /**
+ * Determines the number of rows affected by a data maniuplation query
+ *
+ * 0 is returned for queries that don't manipulate data.
+ *
+ * @return int the number of rows. A DB_Error object on failure.
+ */
+ function affectedRows()
+ {
+ if (!$this->_result) {
+ return 0;
+ }
+ return msql_affected_rows($this->_result);
+ }
+
+ // }}}
+ // {{{ nextId()
+
+ /**
+ * Returns the next free id in a sequence
+ *
+ * @param string $seq_name name of the sequence
+ * @param boolean $ondemand when true, the seqence is automatically
+ * created if it does not exist
+ *
+ * @return int the next id number in the sequence.
+ * A DB_Error object on failure.
+ *
+ * @see DB_common::nextID(), DB_common::getSequenceName(),
+ * DB_msql::createSequence(), DB_msql::dropSequence()
+ */
+ function nextId($seq_name, $ondemand = true)
+ {
+ $seqname = $this->getSequenceName($seq_name);
+ $repeat = false;
+ do {
+ $this->pushErrorHandling(PEAR_ERROR_RETURN);
+ $result =& $this->query("SELECT _seq FROM ${seqname}");
+ $this->popErrorHandling();
+ if ($ondemand && DB::isError($result) &&
+ $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+ $repeat = true;
+ $this->pushErrorHandling(PEAR_ERROR_RETURN);
+ $result = $this->createSequence($seq_name);
+ $this->popErrorHandling();
+ if (DB::isError($result)) {
+ return $this->raiseError($result);
+ }
+ } else {
+ $repeat = false;
+ }
+ } while ($repeat);
+ if (DB::isError($result)) {
+ return $this->raiseError($result);
+ }
+ $arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
+ $result->free();
+ return $arr[0];
+ }
+
+ // }}}
+ // {{{ createSequence()
+
+ /**
+ * Creates a new sequence
+ *
+ * Also creates a new table to associate the sequence with. Uses
+ * a separate table to ensure portability with other drivers.
+ *
+ * @param string $seq_name name of the new sequence
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ *
+ * @see DB_common::createSequence(), DB_common::getSequenceName(),
+ * DB_msql::nextID(), DB_msql::dropSequence()
+ */
+ function createSequence($seq_name)
+ {
+ $seqname = $this->getSequenceName($seq_name);
+ $res = $this->query('CREATE TABLE ' . $seqname
+ . ' (id INTEGER NOT NULL)');
+ if (DB::isError($res)) {
+ return $res;
+ }
+ $res = $this->query("CREATE SEQUENCE ON ${seqname}");
+ return $res;
+ }
+
+ // }}}
+ // {{{ dropSequence()
+
+ /**
+ * Deletes a sequence
+ *
+ * @param string $seq_name name of the sequence to be deleted
+ *
+ * @return int DB_OK on success. A DB_Error object on failure.
+ *
+ * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+ * DB_msql::nextID(), DB_msql::createSequence()
+ */
+ function dropSequence($seq_name)
+ {
+ return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+ }
+
+ // }}}
+ // {{{ quoteIdentifier()
+
+ /**
+ * mSQL does not support delimited identifiers
+ *
+ * @param string $str the identifier name to be quoted
+ *
+ * @return object a DB_Error object
+ *
+ * @see DB_common::quoteIdentifier()
+ * @since Method available since Release 1.7.0
+ */
+ function quoteIdentifier($str)
+ {
+ return $this->raiseError(DB_ERROR_UNSUPPORTED);
+ }
+
+ // }}}
+ // {{{ escapeSimple()
+
+ /**
+ * Escapes a string according to the current DBMS's standards
+ *
+ * @param string $str the string to be escaped
+ *
+ * @return string the escaped string
+ *
+ * @see DB_common::quoteSmart()
+ * @since Method available since Release 1.7.0
+ */
+ function escapeSimple($str)
+ {
+ return addslashes($str);
+ }
+
+ // }}}
+ // {{{ msqlRaiseError()
+
+ /**
+ * Produces a DB_Error object regarding the current problem
+ *
+ * @param int $errno if the error is being manually raised pass a
+ * DB_ERROR* constant here. If this isn't passed
+ * the error information gathered from the DBMS.
+ *
+ * @return object the DB_Error object
+ *
+ * @see DB_common::raiseError(),
+ * DB_msql::errorNative(), DB_msql::errorCode()
+ */
+ function msqlRaiseError($errno = null)
+ {
+ $native = $this->errorNative();
+ if ($errno === null) {
+ $errno = $this->errorCode($native);
+ }
+ return $this->raiseError($errno, null, null, null, $native);
+ }
+
+ // }}}
+ // {{{ errorNative()
+
+ /**
+ * Gets the DBMS' native error message produced by the last query
+ *
+ * @return string the DBMS' error message
+ */
+ function errorNative()
+ {
+ return @msql_error();
+ }
+
+ // }}}
+ // {{{ errorCode()
+
+ /**
+ * Determines PEAR::DB error code from the database's text error message
+ *
+ * @param string $errormsg the error message returned from the database
+ *
+ * @return integer the error number from a DB_ERROR* constant
+ */
+ function errorCode($errormsg)
+ {
+ static $error_regexps;
+ if (!isset($error_regexps)) {
+ $error_regexps = array(
+ '/^Access to database denied/i'
+ => DB_ERROR_ACCESS_VIOLATION,
+ '/^Bad index name/i'
+ => DB_ERROR_ALREADY_EXISTS,
+ '/^Bad order field/i'
+ => DB_ERROR_SYNTAX,
+ '/^Bad type for comparison/i'
+ => DB_ERROR_SYNTAX,
+ '/^Can\'t perform LIKE on/i'
+ => DB_ERROR_SYNTAX,
+ '/^Can\'t use TEXT fields in LIKE comparison/i'
+ => DB_ERROR_SYNTAX,
+ '/^Couldn\'t create temporary table/i'
+ => DB_ERROR_CANNOT_CREATE,
+ '/^Error creating table file/i'
+ => DB_ERROR_CANNOT_CREATE,
+ '/^Field .* cannot be null$/i'
+ => DB_ERROR_CONSTRAINT_NOT_NULL,
+ '/^Index (field|condition) .* cannot be null$/i'
+ => DB_ERROR_SYNTAX,
+ '/^Invalid date format/i'
+ => DB_ERROR_INVALID_DATE,
+ '/^Invalid time format/i'
+ => DB_ERROR_INVALID,
+ '/^Literal value for .* is wrong type$/i'
+ => DB_ERROR_INVALID_NUMBER,
+ '/^No Database Selected/i'
+ => DB_ERROR_NODBSELECTED,
+ '/^No value specified for field/i'
+ => DB_ERROR_VALUE_COUNT_ON_ROW,
+ '/^Non unique value for unique index/i'
+ => DB_ERROR_CONSTRAINT,
+ '/^Out of memory for temporary table/i'
+ => DB_ERROR_CANNOT_CREATE,
+ '/^Permission denied/i'
+ => DB_ERROR_ACCESS_VIOLATION,
+ '/^Reference to un-selected table/i'
+ => DB_ERROR_SYNTAX,
+ '/^syntax error/i'
+ => DB_ERROR_SYNTAX,
+ '/^Table .* exists$/i'
+ => DB_ERROR_ALREADY_EXISTS,
+ '/^Unknown database/i'
+ => DB_ERROR_NOSUCHDB,
+ '/^Unknown field/i'
+ => DB_ERROR_NOSUCHFIELD,
+ '/^Unknown (index|system variable)/i'
+ => DB_ERROR_NOT_FOUND,
+ '/^Unknown table/i'
+ => DB_ERROR_NOSUCHTABLE,
+ '/^Unqualified field/i'
+ => DB_ERROR_SYNTAX,
+ );
+ }
+
+ foreach ($error_regexps as $regexp => $code) {
+ if (preg_match($regexp, $errormsg)) {
+ return $code;
+ }
+ }
+ return DB_ERROR;
+ }
+
+ // }}}
+ // {{{ tableInfo()
+
+ /**
+ * Returns information about a table or a result set
+ *
+ * @param object|string $result DB_result object from a query or a
+ * string containing the name of a table.
+ * While this also accepts a query result
+ * resource identifier, this behavior is
+ * deprecated.
+ * @param int $mode a valid tableInfo mode
+ *
+ * @return array an associative array with the information requested.
+ * A DB_Error object on failure.
+ *
+ * @see DB_common::setOption()
+ */
+ function tableInfo($result, $mode = null)
+ {
+ if (is_string($result)) {
+ /*
+ * Probably received a table name.
+ * Create a result resource identifier.
+ */
+ $id = @msql_query("SELECT * FROM $result",
+ $this->connection);
+ $got_string = true;
+ } elseif (isset($result->result)) {
+ /*
+ * Probably received a result object.
+ * Extract the result resource identifier.
+ */
+ $id = $result->result;
+ $got_string = false;
+ } else {
+ /*
+ * Probably received a result resource identifier.
+ * Copy it.
+ * Deprecated. Here for compatibility only.
+ */
+ $id = $result;
+ $got_string = false;
+ }
+
+ if (!is_resource($id)) {
+ return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
+ }
+
+ if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+ $case_func = 'strtolower';
+ } else {
+ $case_func = 'strval';
+ }
+
+ $count = @msql_num_fields($id);
+ $res = array();
+
+ if ($mode) {
+ $res['num_fields'] = $count;
+ }
+
+ for ($i = 0; $i < $count; $i++) {
+ $tmp = @msql_fetch_field($id);
+
+ $flags = '';
+ if ($tmp->not_null) {
+ $flags .= 'not_null ';
+ }
+ if ($tmp->unique) {
+ $flags .= 'unique_key ';
+ }
+ $flags = trim($flags);
+
+ $res[$i] = array(
+ 'table' => $case_func($tmp->table),
+ 'name' => $case_func($tmp->name),
+ 'type' => $tmp->type,
+ 'len' => msql_field_len($id, $i),
+ 'flags' => $flags,
+ );
+
+ if ($mode & DB_TABLEINFO_ORDER) {
+ $res['order'][$res[$i]['name']] = $i;
+ }
+ if ($mode & DB_TABLEINFO_ORDERTABLE) {
+ $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+ }
+ }
+
+ // free the result only if we were called on a table
+ if ($got_string) {
+ @msql_free_result($id);
+ }
+ return $res;
+ }
+
+ // }}}
+ // {{{ getSpecialQuery()
+
+ /**
+ * Obtain a list of a given type of objects
+ *
+ * @param string $type the kind of objects you want to retrieve
+ *
+ * @return array the array containing the list of objects requested
+ *
+ * @access protected
+ * @see DB_common::getListOf()
+ */
+ function getSpecialQuery($type)
+ {
+ switch ($type) {
+ case 'databases':
+ $id = @msql_list_dbs($this->connection);
+ break;
+ case 'tables':
+ $id = @msql_list_tables($this->dsn['database'],
+ $this->connection);
+ break;
+ default:
+ return null;
+ }
+ if (!$id) {
+ return $this->msqlRaiseError();
+ }
+ $out = array();
+ while ($row = @msql_fetch_row($id)) {
+ $out[] = $row[0];
+ }
+ return $out;
+ }
+
+ // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>
Index: v1.1-thales/bibliotheque/pear/DB/QueryTool/Result.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/QueryTool/Result.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/QueryTool/Result.php (revision 161)
@@ -0,0 +1,261 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Contains the DB_QueryTool_Result class
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB_QueryTool
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @author Paolo Panto <wk@visionp.de>
+ * @author Lorenzo Alberton <l dot alberton at quipo dot it>
+ * @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: Result.php,v 1.8 2005/02/25 16:38:28 quipo Exp $
+ * @link http://pear.php.net/package/DB_QueryTool
+ */
+
+/**
+ * DB_QueryTool_Result class
+ *
+ * This result actually contains the 'data' itself, the number of rows
+ * returned and some additional info
+ * using ZE2 you can also get retrieve data from the result doing the following:
+ * <DB_QueryTool_Common-instance>->getAll()->getCount()
+ * or
+ * <DB_QueryTool_Common-instance>->getAll()->getData()
+ *
+ * @category Database
+ * @package DB_QueryTool
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @author Paolo Panto <wk@visionp.de>
+ * @author Lorenzo Alberton <l dot alberton at quipo dot it>
+ * @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @link http://pear.php.net/package/DB_QueryTool
+ */
+class DB_QueryTool_Result
+{
+ // {{{ class vars
+
+ /**
+ * @var array
+ */
+ var $_data = array();
+
+ /**
+ * @var array
+ */
+ var $_dataKeys = array();
+
+ /**
+ * @var integer
+ */
+ var $_count = 0;
+
+ /**
+ * the counter for the methods getFirst, getNext
+ * @var array
+ */
+ var $_counter = null;
+
+ // }}}
+ // {{{ DB_QueryTool_Result()
+
+ /**
+ * create a new instance of result with the data returned by the query
+ *
+ * @version 2002/07/11
+ * @access public
+ * @author Wolfram Kriesing <wolfram@kriesing.de>
+ * @param array the data returned by the result
+ */
+ function DB_QueryTool_Result($data)
+ {
+ if (!count($data)) {
+ $this->_count = 0;
+ } else {
+ list($firstElement) = $data;
+ if (is_array($firstElement)) { // is the array a collection of rows?
+ $this->_count = sizeof($data);
+ } else {
+ if (sizeof($data) > 0) {
+ $this->_count = 1;
+ } else {
+ $this->_count = 0;
+ }
+ }
+ }
+ $this->_data = $data;
+ }
+
+ // }}}
+ // {{{ numRows
+
+ /**
+ * return the number of rows returned. This is an alias for getCount().
+ *
+ * @access public
+ * @return integer
+ */
+ function numRows()
+ {
+ return $this->_count;
+ }
+
+ // }}}
+ // {{{ getCount()
+
+ /**
+ * return the number of rows returned
+ *
+ * @version 2002/07/11
+ * @access public
+ * @author Wolfram Kriesing <wolfram@kriesing.de>
+ * @return integer the number of rows returned
+ */
+ function getCount()
+ {
+ return $this->_count;
+ }
+
+ // }}}
+ // {{{ getData()
+
+ /**
+ * get all the data returned
+ *
+ * @version 2002/07/11
+ * @access public
+ * @author Wolfram Kriesing <wolfram@kriesing.de>
+ * @param string $key
+ * @return mixed array or PEAR_Error
+ */
+ function getData($key=null)
+ {
+ if (is_null($key)) {
+ return $this->_data;
+ }
+ if ($this->_data[$key]) {
+ return $this->_data[$key];
+ }
+ return new PEAR_Error("there is no element with the key '$key'!");
+ }
+
+ // }}}
+ // {{{ getFirst()
+
+ /**
+ * get the first result set
+ * we are not using next, current, and reset, since those ignore keys
+ * which are empty or 0
+ *
+ * @version 2002/07/11
+ * @access public
+ * @author Wolfram Kriesing <wolfram@kriesing.de>
+ * @return mixed
+ */
+ function getFirst()
+ {
+ if ($this->getCount() > 0) {
+ $this->_dataKeys = array_keys($this->_data);
+ $this->_counter = 0;
+ return $this->_data[$this->_dataKeys[$this->_counter]];
+ }
+ return new PEAR_Error('There are no elements!');
+ }
+
+ // }}}
+ // {{{ getNext()
+
+ /**
+ * Get next result set. If getFirst() has never been called before,
+ * it calls that method.
+ * @return mixed
+ * @access public
+ */
+ function getNext()
+ {
+ if (!$this->initDone()) {
+ return $this->getFirst();
+ }
+ if ($this->hasMore()) {
+ $this->_counter++;
+ return $this->_data[$this->_dataKeys[$this->_counter]];
+ }
+ return new PEAR_Error('there are no more elements!');
+ }
+
+ // }}}
+ // {{{ hasMore()
+
+ /**
+ * check if there are other rows
+ *
+ * @return boolean
+ * @access public
+ */
+ function hasMore()
+ {
+ if ($this->_counter+1 < $this->getCount()) {
+ return true;
+ }
+ return false;
+ }
+
+ // }}}
+ // {{{ fetchRow
+
+ /**
+ * This function emulates PEAR::DB fetchRow() method.
+ * With this method, DB_QueryTool can transparently replace PEAR_DB
+ *
+ * @todo implement fetchmode support?
+ * @access public
+ * @return void
+ */
+ function fetchRow()
+ {
+ if ($this->hasMore()) {
+ $arr = $this->getNext();
+ if (!PEAR::isError($arr)) {
+ return $arr;
+ }
+ }
+ return false;
+ }
+
+ // }}}
+ // {{{ initDone
+
+ /**
+ * Helper method. Check if $this->_dataKeys has been initialized
+ *
+ * @return boolean
+ * @access private
+ */
+ function initDone()
+ {
+ return (
+ isset($this->_dataKeys) &&
+ is_array($this->_dataKeys) &&
+ count($this->_dataKeys)
+ );
+ }
+
+ // }}}
+
+ #TODO
+ #function getPrevious()
+ #function getLast()
+
+}
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/pear/DB/QueryTool/EasyJoin.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/QueryTool/EasyJoin.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/QueryTool/EasyJoin.php (revision 161)
@@ -0,0 +1,135 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Contains the DB_QueryTool_EasyJoin class
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB_QueryTool
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @author Paolo Panto <wk@visionp.de>
+ * @copyright 2003-2005 Wolfram Kriesing, Paolo Panto
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: EasyJoin.php,v 1.9 2005/02/27 17:15:05 quipo Exp $
+ * @link http://pear.php.net/package/DB_QueryTool
+ */
+
+/**
+ * require the DB_QueryTool_Query class
+ */
+require_once 'DB/QueryTool/Query.php';
+
+/**
+ * DB_QueryTool_EasyJoin class
+ *
+ * @category Database
+ * @package DB_QueryTool
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @copyright 2003-2005 Wolfram Kriesing
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @link http://pear.php.net/package/DB_QueryTool
+ */
+class DB_QueryTool_EasyJoin extends DB_QueryTool_Query
+{
+ // {{{ class vars
+
+ /**
+ * This is the regular expression that shall be used to find a table's shortName
+ * in a column name, the string found by using this regular expression will be removed
+ * from the column name and it will be checked if it is a table name
+ * i.e. the default '/_id$/' would find the table name 'user' from the column name 'user_id'
+ *
+ * @var string regexp
+ */
+ var $_tableNamePreg = '/_id$/';
+
+ /**
+ * This is to find the column name that is referred by it, so the default find
+ * from 'user_id' the column 'id' which will be used to refer to the 'user' table
+ *
+ * @var string regexp
+ */
+ var $_columnNamePreg = '/^.*_/';
+
+ // }}}
+ // {{{ __construct()
+
+ /**
+ * call parent constructor
+ * @param mixed $dsn DSN string, DSN array or DB object
+ * @param array $options
+ */
+ function __construct($dsn=false, $options=array())
+ {
+ parent::DB_QueryTool_Query($dsn, $options);
+ }
+
+ // }}}
+ // {{{ autoJoin()
+
+ /**
+ * Join the given tables, using the column names, to find out how to join the tables;
+ * i.e., if table1 has a column named &quot;table2_id&quot;, this method will join
+ * &quot;WHERE table1.table2_id=table2.id&quot;.
+ * All joins made here are only concatenated via AND.
+ * @param array $tables
+ */
+ function autoJoin($tables)
+ {
+// FIXXME if $tables is empty autoJoin all available tables that have a relation
+// to $this->table, starting to search in $this->table
+ settype($tables, 'array');
+ // add this->table to the tables array, so we go thru the current table first
+ $tables = array_merge(array($this->table), $tables);
+
+ $shortNameIndexed = $this->getTableSpec(true, $tables);
+ $nameIndexed = $this->getTableSpec(false, $tables);
+
+//print_r($shortNameIndexed);
+//print_r($tables); print '<br><br>';
+ if (sizeof($shortNameIndexed) != sizeof($tables)) {
+ $this->_errorLog("autoJoin-ERROR: not all the tables are in the tableSpec!<br />");
+ }
+
+ $joinTables = array();
+ $joinConditions = array();
+ foreach ($tables as $aTable) { // go through $this->table and all the given tables
+ if ($metadata = $this->metadata($aTable))
+ foreach ($metadata as $aCol => $x) { // go through each row to check which might be related to $aTable
+ $possibleTableShortName = preg_replace($this->_tableNamePreg, '' , $aCol);
+ $possibleColumnName = preg_replace($this->_columnNamePreg, '' , $aCol);
+//print "$aTable.$aCol .... possibleTableShortName=$possibleTableShortName .... possibleColumnName=$possibleColumnName<br />";
+ if (isset($shortNameIndexed[$possibleTableShortName])) {
+ // are the tables given in the tableSpec?
+ if (!$shortNameIndexed[$possibleTableShortName]['name'] ||
+ !$nameIndexed[$aTable]['name']) {
+ // its an error of the developer, so log the error, dont show it to the end user
+ $this->_errorLog("autoJoin-ERROR: '$aTable' is not given in the tableSpec!<br />");
+ } else {
+ // do only join different table.col combination,
+ // we should not join stuff like 'question.question=question.question'
+ // this would be quite stupid, but it used to be :-(
+ if ($shortNameIndexed[$possibleTableShortName]['name'] != $aTable ||
+ $possibleColumnName != $aCol
+ ) {
+ $where = $shortNameIndexed[$possibleTableShortName]['name'].".$possibleColumnName=$aTable.$aCol";
+ $this->addJoin($nameIndexed[$aTable]['name'], $where);
+ $this->addJoin($shortNameIndexed[$possibleTableShortName]['name'], $where);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // }}}
+}
+?>
\ No newline at end of file
Index: v1.1-thales/bibliotheque/pear/DB/QueryTool/Query.php
===================================================================
--- v1.1-thales/bibliotheque/pear/DB/QueryTool/Query.php (revision 0)
+++ v1.1-thales/bibliotheque/pear/DB/QueryTool/Query.php (revision 161)
@@ -0,0 +1,2395 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Contains the DB_QueryTool_Query class
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category Database
+ * @package DB_QueryTool
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @author Paolo Panto <wk@visionp.de>
+ * @author Lorenzo Alberton <l dot alberton at quipo dot it>
+ * @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @version CVS: $Id: Query.php,v 1.57 2005/02/27 19:13:19 quipo Exp $
+ * @link http://pear.php.net/package/DB_QueryTool
+ */
+
+/**
+ * require the PEAR and DB classes
+ */
+require_once 'PEAR.php';
+require_once 'DB.php';
+
+/**
+ * DB_QueryTool_Query class
+ *
+ * This class should be extended
+ *
+ * @category Database
+ * @package DB_QueryTool
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @author Paolo Panto <wk@visionp.de>
+ * @author Lorenzo Alberton <l dot alberton at quipo dot it>
+ * @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ * @link http://pear.php.net/package/DB_QueryTool
+ */
+class DB_QueryTool_Query
+{
+ // {{{ class vars
+
+ /**
+ * @var string the name of the primary column
+ */
+ var $primaryCol = 'id';
+
+ /**
+ * @var string the current table the class works on
+ */
+ var $table = '';
+
+ /**
+ * @var string the name of the sequence for this table
+ */
+ var $sequenceName = null;
+
+ /**
+ * @var object the db-object, a PEAR::DB instance
+ */
+ var $db = null;
+
+ /**
+ * @var string the where condition
+ * @access private
+ */
+ var $_where = '';
+
+ /**
+ * @var string the order condition
+ * @access private
+ */
+ var $_order = '';
+
+ /**
+ * @var string the having definition
+ * @access private
+ */
+ var $_having = '';
+
+ /**
+ * @var array contains the join content
+ * the key is the join type, for now we have 'default' and 'left'
+ * inside each key 'table' contains the table
+ * key 'where' contains the where clause for the join
+ * @access private
+ */
+ var $_join = array();
+
+ /**
+ * @var string which column to index the result by
+ * @access private
+ */
+ var $_index = null;
+
+ /**
+ * @var string the group-by clause
+ * @access private
+ */
+ var $_group = '';
+
+ /**
+ * @var array the limit
+ * @access private
+ */
+ var $_limit = array();
+
+ /**
+ * @var string type of result to return
+ * @access private
+ */
+ var $_resultType = 'none';
+
+ /**
+ * @var array the metadata temporary saved
+ * @access private
+ */
+ var $_metadata = array();
+
+ /**
+ * @var string
+ * @access private
+ */
+ var $_lastQuery = null;
+
+ /**
+ * @var string the rows that shall be selected
+ * @access private
+ */
+ var $_select = '*';
+
+ /**
+ * @var string the rows that shall not be selected
+ * @access private
+ */
+ var $_dontSelect = '';
+
+ /**
+ * @var array this array saves different modes in which this class works
+ * i.e. 'raw' means no quoting before saving/updating data
+ * @access private
+ */
+ var $options = array(
+ 'raw' => false,
+ 'verbose' => true, // set this to false in a productive environment
+ // it will produce error-logs if set to true
+ 'useCache' => false,
+ 'logFile' => false,
+ );
+
+ /**
+ * this array contains information about the tables
+ * those are
+ * - 'name' => the real table name
+ * - 'shortName' => the short name used, so that when moving the table i.e.
+ * onto a provider's db and u have to rename the tables to
+ * longer names this name will be relevant, i.e. when
+ * autoJoining, i.e. a table name on your local machine is:
+ * 'user' but online it has to be 'applName_user' then the
+ * shortName will be used to determine if a column refers to
+ * another table, if the colName is 'user_id', it knows the
+ * shortName 'user' refers to the table 'applName_user'
+ */
+ var $tableSpec = array();
+
+ /**
+ * this is the regular expression that shall be used to find a table's shortName
+ * in a column name, the string found by using this regular expression will be removed
+ * from the column name and it will be checked if it is a table name
+ * i.e. the default '/_id$/' would find the table name 'user' from the column name 'user_id'
+ */
+ var $_tableNameToShortNamePreg = '/^.*_/';
+
+ /**
+ * @var array this array caches queries that have already been built once
+ * to reduce the execution time
+ */
+ var $_queryCache = array();
+
+ /**
+ * The object that contains the log-instance
+ */
+ var $_logObject = null;
+
+ /**
+ * Some internal data the logging needs
+ */
+ var $_logData = array();
+
+ // }}}
+ // {{{ __construct()
+
+ /**
+ * this is the constructor, as it will be implemented in ZE2 (php5)
+ *
+ * @version 2002/04/02
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param object db-object
+ */
+/*
+ function __construct($dsn=false, $options=array())
+ {
+ if (!isset($options['autoConnect'])) {
+ $autoConnect = true;
+ } else {
+ $autoConnect = $options['autoConnect'];
+ }
+ if (isset($options['errorCallback'])) {
+ $this->setErrorCallback($options['errorCallback']);
+ }
+ if (isset($options['errorSetCallback'])) {
+ $this->setErrorSetCallback($options['errorSetCallback']);
+ }
+ if (isset($options['errorLogCallback'])) {
+ $this->setErrorLogCallback($options['errorLogCallback']);
+ }
+
+ if ($autoConnect && $dsn) {
+ $this->connect($dsn, $options);
+ }
+ //we would need to parse the dsn first ... i dont feel like now :-)
+ // oracle has all column names in upper case
+//FIXXXME make the class work only with upper case when we work with oracle
+ //if ($this->db->phptype=='oci8' && !$this->primaryCol) {
+ // $this->primaryCol = 'ID';
+ //}
+
+ if ($this->sequenceName == null) {
+ $this->sequenceName = $this->table;
+ }
+ }
+*/
+
+ // }}}
+ // {{{ DB_QueryTool_Query()
+
+ /**
+ * @version 2002/04/02
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param mixed $dsn DSN string, DSN array or DB object
+ * @param array $options
+ */
+ function DB_QueryTool_Query($dsn=false, $options=array())
+ {
+ //$this->__construct($dsn, $options);
+ if (!isset($options['autoConnect'])) {
+ $autoConnect = true;
+ } else {
+ $autoConnect = $options['autoConnect'];
+ unset($options['autoConnect']);
+ }
+ if (isset($options['errorCallback'])) {
+ $this->setErrorCallback($options['errorCallback']);
+ unset($options['errorCallback']);
+ }
+ if (isset($options['errorSetCallback'])) {
+ $this->setErrorSetCallback($options['errorSetCallback']);
+ unset($options['errorSetCallback']);
+ }
+ if (isset($options['errorLogCallback'])) {
+ $this->setErrorLogCallback($options['errorLogCallback']);
+ unset($options['errorLogCallback']);
+ }
+ if ($autoConnect && $dsn) {
+ $this->connect($dsn, $options);
+ }
+ if (is_null($this->sequenceName)) {
+ $this->sequenceName = $this->table;
+ }
+ }
+
+ // }}}
+ // {{{ connect()
+
+ /**
+ * use this method if you want to connect manually
+ * @param mixed $dsn DSN string, DSN array or MDB object
+ * @param array $options
+ */
+ function connect($dsn, $options=array())
+ {
+ if (is_object($dsn)) {
+ $res = $this->db =& $dsn;
+ } else {
+ $res = $this->db = DB::connect($dsn, $options);
+ }
+ if (DB::isError($res)) {
+// FIXXME what shall we do here?
+ $this->_errorLog($res->getUserInfo());
+ } else {
+ $this->db->setFetchMode(DB_FETCHMODE_ASSOC);
+ }
+ }
+
+ // }}}
+ // {{{ getDbInstance()
+
+ /**
+ * @return reference to current DB instance
+ */
+ function &getDbInstance()
+ {
+ return $this->db;
+ }
+
+ // }}}
+ // {{{ setDbInstance()
+
+ /**
+ * Setup using an existing connection.
+ * this also sets the DB_FETCHMODE_ASSOC since this class
+ * needs this to be set!
+ *
+ * @param object a reference to an existing DB-object
+ * @return void
+ */
+ function setDbInstance(&$dbh)
+ {
+ $this->db =& $dbh;
+ $this->db->setFetchMode(DB_FETCHMODE_ASSOC);
+ }
+
+ // }}}
+ // {{{ get()
+
+ /**
+ * get the data of a single entry
+ * if the second parameter is only one column the result will be returned
+ * directly not as an array!
+ *
+ * @version 2002/03/05
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param integer the id of the element to retrieve
+ * @param string if this is given only one row shall be returned, directly, not an array
+ * @return mixed (1) an array of the retrieved data
+ * (2) if the second parameter is given and its only one column,
+ * only this column's data will be returned
+ * (3) false in case of failure
+ */
+ function get($id, $column='')
+ {
+ $table = $this->table;
+ $getMethod = 'getRow';
+ if ($column && !strpos($column, ',')) { // if only one column shall be selected
+ $getMethod = 'getOne';
+ }
+ // we dont use 'setSelect' here, since this changes the setup of the class, we
+ // build the query directly
+ // if $column is '' then _buildSelect selects '*' anyway, so that's the same behaviour as before
+ $query['select'] = $this->_buildSelect($column);
+ $query['where'] = $this->_buildWhere($this->table.'.'.$this->primaryCol.'='.$id);
+ $queryString = $this->_buildSelectQuery($query);
+
+ return $this->returnResult($this->execute($queryString,$getMethod));
+ }
+
+ // }}}
+ // {{{ getMultiple()
+
+ /**
+ * gets the data of the given ids
+ *
+ * @version 2002/04/23
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param array this is an array of ids to retreive
+ * @param string the column to search in for
+ * @return mixed an array of the retreived data, or false in case of failure
+ * when failing an error is set in $this->_error
+ */
+ function getMultiple($ids, $column='')
+ {
+ $col = $this->primaryCol;
+ if ($column) {
+ $col = $column;
+ }
+// FIXXME if $ids has no table.col syntax and we are using joins, the table better be put in front!!!
+ $ids = $this->_quoteArray($ids);
+
+ $query['where'] = $this->_buildWhere($col.' IN ('.implode(',', $ids).')');
+ $queryString = $this->_buildSelectQuery($query);
+
+ return $this->returnResult($this->execute($queryString));
+ }
+
+ // }}}
+ // {{{ getAll()
+
+ /**
+ * get all entries from the DB
+ * for sorting use setOrder!!!, the last 2 parameters are deprecated
+ *
+ * @version 2002/03/05
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param int to start from
+ * @param int the number of rows to show
+ * @param string the DB-method to use, i dont know if we should leave this param here ...
+ * @return mixed an array of the retreived data, or false in case of failure
+ * when failing an error is set in $this->_error
+ */
+ function getAll($from=0,$count=0,$method='getAll')
+ {
+ $query = array();
+ if ($count) {
+ $query = array('limit' => array($from, $count));
+ }
+ return $this->returnResult($this->execute($this->_buildSelectQuery($query), $method));
+ }
+
+ // }}}
+ // {{{ getCol()
+
+ /**
+ * this method only returns one column, so the result will be a one dimensional array
+ * this does also mean that using setSelect() should be set to *one* column, the one you want to
+ * have returned a most common use case for this could be:
+ * $table->setSelect('id');
+ * $ids = $table->getCol();
+ * OR
+ * $ids = $table->getCol('id');
+ * so ids will be an array with all the id's
+ *
+ * @version 2003/02/25
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the column that shall be retreived
+ * @param int to start from
+ * @param int the number of rows to show
+ * @return mixed an array of the retreived data, or false in case of failure
+ * when failing an error is set in $this->_error
+ */
+ function getCol($column=null, $from=0, $count=0)
+ {
+ $query = array();
+ if (!is_null($column)) {
+ // by using _buildSelect() i can be sure that the table name will not be ambigious
+ // i.e. in a join, where all the joined tables have a col 'id'
+ // _buildSelect() will put the proper table name in front in case there is none
+ $query['select'] = $this->_buildSelect($column);
+ }
+ if ($count) {
+ $query['limit'] = array($from,$count);
+ }
+ return $this->returnResult($this->execute($this->_buildSelectQuery($query), 'getCol'));
+ }
+
+ // }}}
+ // {{{ getCount()
+
+ /**
+ * get the number of entries
+ *
+ * @version 2002/04/02
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param
+ * @return mixed an array of the retreived data, or false in case of failure
+ * when failing an error is set in $this->_error
+ */
+ function getCount()
+ {
+/* the following query works on mysql
+SELECT count(DISTINCT image.id) FROM image2tree
+RIGHT JOIN image ON image.id = image2tree.image_id
+the reason why this is needed - i just wanted to get the number of rows that do exist if the result is grouped by image.id
+the following query is what i tried first, but that returns the number of rows that have been grouped together
+for each image.id
+SELECT count(*) FROM image2tree
+RIGHT JOIN image ON image.id = image2tree.image_id GROUP BY image.id
+
+so that's why we do the following, i am not sure if that is standard SQL and absolutley correct!!!
+*/
+
+//FIXXME see comment above if this is absolutely correct!!!
+ if ($group = $this->_buildGroup()) {
+ $query['select'] = 'COUNT(DISTINCT '.$group.')';
+ $query['group'] = '';
+ } else {
+ $query['select'] = 'COUNT(*)';
+ }
+
+ $query['order'] = ''; // order is not of importance and might freak up the special group-handling up there, since the order-col is not be known
+/*# FIXXME use the following line, but watch out, then it has to be used in every method, or this
+# value will be used always, simply try calling getCount and getAll afterwards, getAll will return the count :-)
+# if getAll doesn't use setSelect!!!
+*/
+ //$this->setSelect('count(*)');
+ $queryString = $this->_buildSelectQuery($query, true);
+
+ return ($res = $this->execute($queryString, 'getOne')) ? $res : 0;
+ }
+
+ // }}}
+ // {{{ getDefaultValues()
+
+ /**
+ * return an empty element where all the array elements do already exist
+ * corresponding to the columns in the DB
+ *
+ * @version 2002/04/05
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @return array an empty, or pre-initialized element
+ */
+ function getDefaultValues()
+ {
+ $ret = array();
+ // here we read all the columns from the DB and initialize them
+ // with '' to prevent PHP-warnings in case we use error_reporting=E_ALL
+ foreach ($this->metadata() as $aCol=>$x) {
+ $ret[$aCol] = '';
+ }
+ return $ret;
+ }
+
+ // }}}
+ // {{{ getEmptyElement()
+
+ /**
+ * this is just for BC
+ * @deprecated
+ */
+ function getEmptyElement()
+ {
+ $this->getDefaultValues();
+ }
+
+ // }}}
+ // {{{ getQueryString()
+
+ /**
+ * Render the current query and return it as a string.
+ *
+ * @return string the current query
+ */
+ function getQueryString()
+ {
+ $ret = $this->_buildSelectQuery();
+ if (is_string($ret)) {
+ $ret = trim($ret);
+ }
+ return $ret;
+ }
+
+ // }}}
+ // {{{ save()
+
+ /**
+ * save data, calls either update or add
+ * if the primaryCol is given in the data this method knows that the
+ * data passed to it are meant to be updated (call 'update'), otherwise it will
+ * call the method 'add'.
+ * If you dont like this behaviour simply stick with the methods 'add'
+ * and 'update' and ignore this one here.
+ * This method is very useful when you have validation checks that have to
+ * be done for both adding and updating, then you can simply overwrite this
+ * method and do the checks in here, and both cases will be validated first.
+ *
+ * @version 2002/03/11
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param array contains the new data that shall be saved in the DB
+ * @return mixed the data returned by either add or update-method
+ */
+ function save($data)
+ {
+ if (!empty($data[$this->primaryCol])) {
+ return $this->update($data);
+ }
+ return $this->add($data);
+ }
+
+ // }}}
+ // {{{ update()
+
+ /**
+ * update the member data of a data set
+ *
+ * @version 2002/03/06
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param array contains the new data that shall be saved in the DB
+ * the id has to be given in the field with the key 'ID'
+ * @return mixed true on success, or false otherwise
+ */
+ function update($newData)
+ {
+ $query = array();
+ // do only set the 'where' part in $query, if a primary column is given
+ // if not the default 'where' clause is used
+ if (isset($newData[$this->primaryCol])) {
+ $query['where'] = $this->primaryCol.'='.$newData[$this->primaryCol];
+ }
+ $newData = $this->_checkColumns($newData, 'update');
+ $values = array();
+ $raw = $this->getOption('raw');
+ foreach ($newData as $key => $aData) { // quote the data
+ //$values[] = "{$this->table}.$key=". ($raw ? $aData : $this->db->quote($aData));
+ $values[] = "$key=". ($raw ? $aData : $this->db->quote($aData));
+ }
+
+ $query['set'] = implode(',', $values);
+//FIXXXME _buildUpdateQuery() seems to take joins into account, whcih is bullshit here
+ $updateString = $this->_buildUpdateQuery($query);
+#print '$updateString = '.$updateString;
+ return $this->execute($updateString, 'query') ? true : false;
+ }
+
+ // }}}
+ // {{{ add()
+
+ /**
+ * add a new member in the DB
+ *
+ * @version 2002/04/02
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param array contains the new data that shall be saved in the DB
+ * @return mixed the inserted id on success, or false otherwise
+ */
+ function add($newData)
+ {
+ // if no primary col is given, get next sequence value
+ if (empty($newData[$this->primaryCol])) {
+ if ($this->primaryCol) { // do only use the sequence if a primary column is given
+ // otherwise the data are written as given
+ $id = $this->db->nextId($this->sequenceName);
+ $newData[$this->primaryCol] = (int)$id;
+ } else {
+ // if no primary col is given return true on success
+ $id = true;
+ }
+ } else {
+ $id = $newData[$this->primaryCol];
+ }
+
+ //unset($newData[$this->primaryCol]);
+
+ $newData = $this->_checkColumns($newData, 'add');
+ $newData = $this->_quoteArray($newData);
+
+ $query = sprintf( 'INSERT INTO %s (%s) VALUES (%s)',
+ $this->table,
+ implode(', ', array_keys($newData)),
+ implode(', ', $newData)
+ );
+ return $this->execute($query, 'query') ? $id : false;
+ }
+
+ // }}}
+ // {{{ addMultiple()
+
+ /**
+ * adds multiple new members in the DB
+ *
+ * @version 2002/07/17
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param array contains an array of new data that shall be saved in the DB
+ * the key-value pairs have to be the same for all the data!!!
+ * @return mixed the inserted ids on success, or false otherwise
+ */
+ function addMultiple($data)
+ {
+ if (!sizeof($data)) {
+ return false;
+ }
+ // the inserted ids which will be returned or if no primaryCol is given
+ // we return true by default
+ $retIds = $this->primaryCol ? array() : true;
+ $allData = array(); // each row that will be inserted
+ foreach ($data as $key => $aData) {
+ $aData = $this->_checkColumns($aData, 'add');
+ $aData = $this->_quoteArray($aData);
+
+ if (empty($aData[$this->primaryCol])) {
+ if ($this->primaryCol) { // do only use the sequence if a primary column is given
+ // otherwise the data are written as given
+ $retIds[] = $id = (int)$this->db->nextId($this->sequenceName);
+ $aData[$this->primaryCol] = $id;
+ }
+ } else {
+ $retIds[] = $aData[$this->primaryCol];
+ }
+ $allData[] = '('.implode(', ', $aData).')';
+ }
+
+ $query = sprintf( 'INSERT INTO %s (%s) VALUES %s',
+ $this->table,
+ implode(', ', array_keys($aData)), // use the keys of the last element built
+ implode(', ', $allData)
+ );
+ return $this->execute($query, 'query') ? $retIds : false;
+ }
+
+ // }}}
+ // {{{ remove()
+
+ /**
+ * removes a member from the DB
+ *
+ * @version 2002/04/08
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param mixed integer/string - the value of the column that shall be removed
+ * array - multiple columns that shall be matched, the second parameter will be ignored
+ * @param string the column to match the data against, only if $data is not an array
+ * @return boolean
+ */
+ function remove($data, $whereCol='')
+ {
+ $raw = $this->getOption('raw');
+
+ if (is_array($data)) {
+//FIXXME check $data if it only contains columns that really exist in the table
+ $wheres = array();
+ foreach ($data as $key => $val) {
+ $wheres[] = $key.'='. ($raw ? $val : $this->db->quote($val));
+ }
+ $whereClause = implode(' AND ',$wheres);
+ } else {
+ if (empty($whereCol)) {
+ $whereCol = $this->primaryCol;
+ }
+ $whereClause = $whereCol.'='. ($raw ? $data : $this->db->quote($data));
+ }
+
+ $query = sprintf( 'DELETE FROM %s WHERE %s',
+ $this->table,
+ $whereClause
+ );
+ return $this->execute($query, 'query') ? true : false;
+// i think this method should return the ID's that it removed, this way we could simply use the result
+// for further actions that depend on those id ... or? make stuff easier, see ignaz::imail::remove
+ }
+
+ // }}}
+ // {{{ removeAll()
+
+ /**
+ * empty a table
+ *
+ * @version 2002/06/17
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @return
+ */
+ function removeAll()
+ {
+ $query = 'DELETE FROM '.$this->table;
+ return $this->execute($query, 'query') ? true : false;
+ }
+
+ // }}}
+ // {{{ removeMultiple()
+
+ /**
+ * remove the datasets with the given ids
+ *
+ * @version 2002/04/24
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param array the ids to remove
+ * @return
+ */
+ function removeMultiple($ids, $colName='')
+ {
+ if (empty($colName)) {
+ $colName = $this->primaryCol;
+ }
+ $ids = $this->_quoteArray($ids);
+
+ $query = sprintf( 'DELETE FROM %s WHERE %s IN (%s)',
+ $this->table,
+ $colName,
+ implode(',', $ids)
+ );
+ return $this->execute($query, 'query') ? true : false;
+ }
+
+ // }}}
+ // {{{ removePrimary()
+
+ /**
+ * removes a member from the DB and calls the remove methods of the given objects
+ * so all rows in another table that refer to this table are erased too
+ *
+ * @version 2002/04/08
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param integer the value of the primary key
+ * @param string the column name of the tables with the foreign keys
+ * @param object just for convinience, so nobody forgets to call this method
+ * with at least one object as a parameter
+ * @return boolean
+ */
+ function removePrimary($id, $colName, $atLeastOneObject)
+ {
+ $argCounter = 2; // we have 2 parameters that need to be given at least
+ // func_get_arg returns false and a warning if there are no more parameters, so
+ // we suppress the warning and check for false
+ while ($object = @func_get_arg($argCounter++)) {
+//FIXXXME let $object also simply be a table name
+ if (!$object->remove($id, $colName)) {
+//FIXXXME do this better
+ $this->_errorSet("Error removing '$colName=$id' from table {$object->table}.");
+ return false;
+ }
+ }
+
+ return ($this->remove($id) ? true : false);
+ }
+
+ // }}}
+ // {{{ setLimit()
+
+ /**
+ * @param integer $from
+ * @param integer $count
+ */
+ function setLimit($from=0, $count=0)
+ {
+ if ($from==0 && $count==0) {
+ $this->_limit = array();
+ } else {
+ $this->_limit = array($from, $count);
+ }
+ }
+
+ // }}}
+ // {{{ getLimit()
+
+ /**
+ * @return array
+ */
+ function getLimit()
+ {
+ return $this->_limit;
+ }
+
+ // }}}
+ // {{{ setWhere()
+
+ /**
+ * sets the where condition which is used for the current instance
+ *
+ * @version 2002/04/16
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the where condition, this can be complete like 'X=7 AND Y=8'
+ */
+ function setWhere($whereCondition='')
+ {
+ $this->_where = $whereCondition;
+//FIXXME parse the where condition and replace ambigious column names, such as "name='Deutschland'" with "country.name='Deutschland'"
+// then the users dont have to write that explicitly and can use the same name as in the setOrder i.e. setOrder('name,_net_name,_netPrefix_prefix');
+ }
+
+ // }}}
+ // {{{ getWhere()
+
+ /**
+ * gets the where condition which is used for the current instance
+ *
+ * @version 2002/04/22
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @return string the where condition, this can be complete like 'X=7 AND Y=8'
+ */
+ function getWhere()
+ {
+ return $this->_where;
+ }
+
+ // }}}
+ // {{{ addWhere()
+
+ /**
+ * only adds a string to the where clause
+ *
+ * @version 2002/07/22
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the where clause to add to the existing one
+ * @param string the condition for how to concatenate the new where clause
+ * to the existing one
+ */
+ function addWhere($where, $condition='AND')
+ {
+ if ($this->getWhere()) {
+ $where = $this->getWhere().' '.$condition.' '.$where;
+ }
+ $this->setWhere($where);
+ }
+
+ // }}}
+ // {{{ addWhereSearch()
+
+ /**
+ * add a where-like clause which works like a search for the given string
+ * i.e. calling it like this:
+ * $this->addWhereSearch('name', 'otto hans')
+ * produces a where clause like this one
+ * LOWER(name) LIKE "%otto%hans%"
+ * so the search finds the given string
+ *
+ * @version 2002/08/14
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the column to search in for
+ * @param string the string to search for
+ */
+ function addWhereSearch($column, $string, $condition='AND')
+ {
+ // if the column doesn't contain a tablename use the current table name
+ // in case it is a defined column to prevent ambiguous rows
+ if (strpos($column, '.') === false) {
+ $meta = $this->metadata();
+ if (isset($meta[$column])) {
+ $column = $this->table.".$column";
+ }
+ }
+
+ $string = $this->db->quote('%'.str_replace(' ', '%', strtolower($string)).'%');
+ $this->addWhere("LOWER($column) LIKE $string", $condition);
+ }
+
+ // }}}
+ // {{{ setOrder()
+
+ /**
+ * sets the order condition which is used for the current instance
+ *
+ * @version 2002/05/16
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the where condition, this can be complete like 'X=7 AND Y=8'
+ * @param boolean sorting order (TRUE => ASC, FALSE => DESC)
+ */
+ function setOrder($orderCondition='', $desc=false)
+ {
+ $this->_order = $orderCondition .($desc ? ' DESC' : '');
+ }
+
+ // }}}
+ // {{{ addOrder()
+
+ /**
+ * Add a order parameter to the query.
+ *
+ * @version 2003/05/28
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the where condition, this can be complete like 'X=7 AND Y=8'
+ * @param boolean sorting order (TRUE => ASC, FALSE => DESC)
+ */
+ function addOrder($orderCondition='', $desc=false)
+ {
+ $order = $orderCondition .($desc ? ' DESC' : '');
+ if ($this->_order) {
+ $this->_order = $this->_order.','.$order;
+ } else {
+ $this->_order = $order;
+ }
+ }
+
+ // }}}
+ // {{{ getOrder()
+
+ /**
+ * gets the order condition which is used for the current instance
+ *
+ * @version 2002/05/16
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @return string the order condition, this can be complete like 'ID,TIMESTAMP DESC'
+ */
+ function getOrder()
+ {
+ return $this->_order;
+ }
+
+ // }}}
+ // {{{ setHaving()
+
+ /**
+ * sets the having definition
+ *
+ * @version 2003/06/05
+ * @access public
+ * @author Johannes Schaefer <johnschaefer@gmx.de>
+ * @param string the having definition
+ */
+ function setHaving($having='')
+ {
+ $this->_having = $having;
+ }
+
+ // }}}
+ // {{{ getHaving()
+
+ /**
+ * gets the having definition which is used for the current instance
+ *
+ * @version 2003/06/05
+ * @access public
+ * @author Johannes Schaefer <johnschaefer@gmx.de>
+ * @return string the having definition
+ */
+ function getHaving()
+ {
+ return $this->_having;
+ }
+
+ // }}}
+ // {{{ addHaving()
+
+ /**
+ * Extend the current having clause. This is very useful, when you are building
+ * this clause from different places and don't want to overwrite the currently
+ * set having clause, but extend it.
+ *
+ * @param string this is a having clause, i.e. 'column' or 'table.column' or 'MAX(column)'
+ * @param string the connection string, which usually stays the default, which is ',' (a comma)
+ */
+ function addHaving($what='*', $connectString=' AND ')
+ {
+ if ($this->_having) {
+ $this->_having = $this->_having.$connectString.$what;
+ } else {
+ $this->_having = $what;
+ }
+ }
+
+ // }}}
+ // {{{ setJoin()
+
+ /**
+ * sets a join-condition
+ *
+ * @version 2002/06/10
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param mixed either a string or an array that contains
+ * the table(s) to join on the current table
+ * @param string the where clause for the join
+ */
+ function setJoin($table=null, $where=null, $joinType='default')
+ {
+//FIXXME make it possible to pass a table name as a string like this too 'user u'
+// where u is the string that can be used to refer to this table in a where/order
+// or whatever condition
+// this way it will be possible to join tables with itself, like setJoin(array('user u','user u1'))
+// this wouldnt work yet, but for doing so we would need to change the _build methods too!!!
+// because they use getJoin('tables') and this simply returns all the tables in use
+// but don't take care of the mentioned syntax
+
+ if (is_null($table) || is_null($where)) { // remove the join if not sufficient parameters are given
+ $this->_join[$joinType] = array();
+ return;
+ }
+/* this causes problems if we use the order-by, since it doenst know the name to order it by ... :-)
+ // replace the table names with the internal name used for the join
+ // this way we can also join one table multiple times if it will be implemented one day
+ $this->_join[$table] = preg_replace('/'.$table.'/','j1',$where);
+*/
+ $this->_join[$joinType][$table] = $where;
+ }
+
+ // }}}
+ // {{{ setJoin()
+
+ /**
+ * if you do a left join on $this->table you will get all entries
+ * from $this->table, also if there are no entries for them in the joined table
+ * if both parameters are not given the left-join will be removed
+ * NOTE: be sure to only use either a right or a left join
+ *
+ * @version 2002/07/22
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the table(s) to be left-joined
+ * @param string the where clause for the join
+ */
+ function setLeftJoin($table=null, $where=null)
+ {
+ $this->setJoin($table, $where, 'left');
+ }
+
+ // }}}
+ // {{{ addLeftJoin()
+
+ /**
+ * @param string the table to be left-joined
+ * @param string the where clause for the join
+ * @param string the join type
+ */
+ function addLeftJoin($table, $where, $type='left')
+ {
+ // init value, to prevent E_ALL-warning
+ if (!isset($this->_join[$type]) || !$this->_join[$type]) {
+ $this->_join[$type] = array();
+ }
+ $this->_join[$type][$table] = $where;
+ }
+
+ // }}}
+ // {{{ setRightJoin()
+
+ /**
+ * see setLeftJoin for further explaination on what a left/right join is
+ * NOTE: be sure to only use either a right or a left join
+//FIXXME check if the above sentence is necessary and if sql doesnt allow the use of both
+ *
+ * @see setLeftJoin()
+ * @version 2002/09/04
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the table(s) to be right-joined
+ * @param string the where clause for the join
+ */
+ function setRightJoin($table=null, $where=null)
+ {
+ $this->setJoin($table, $where, 'right');
+ }
+
+ // }}}
+ // {{{ getJoin()
+
+ /**
+ * gets the join-condition
+ *
+ * @access public
+ * @param string [null|''|'table'|'tables'|'right'|'left']
+ * @return array gets the join parameters
+ */
+ function getJoin($what=null)
+ {
+ // if the user requests all the join data or if the join is empty, return it
+ if (is_null($what) || empty($this->_join)) {
+ return $this->_join;
+ }
+
+ $ret = array();
+ switch (strtolower($what)) {
+ case 'table':
+ case 'tables':
+ foreach ($this->_join as $aJoin) {
+ if (count($aJoin)) {
+ $ret = array_merge($ret, array_keys($aJoin));
+ }
+ }
+ break;
+ case 'right': // return right-join data only
+ case 'left': // return left join data only
+ if (count($this->_join[$what])) {
+ $ret = array_merge($ret, $this->_join[$what]);
+ }
+ break;
+ }
+ return $ret;
+ }
+
+ // }}}
+ // {{{ addJoin()
+
+ /**
+ * adds a table and a where clause that shall be used for the join
+ * instead of calling
+ * setJoin(array(table1,table2),'<where clause1> AND <where clause2>')
+ * you can also call
+ * setJoin(table1,'<where clause1>')
+ * addJoin(table2,'<where clause2>')
+ * or where it makes more sense is to build a query which is made out of a
+ * left join and a standard join
+ * setLeftJoin(table1,'<where clause1>')
+ * // results in ... FROM $this->table LEFT JOIN table ON <where clause1>
+ * addJoin(table2,'<where clause2>')
+ * // results in ... FROM $this->table,table2 LEFT JOIN table ON <where clause1> WHERE <where clause2>
+ *
+ * @access public
+ * @param string the table to be joined
+ * @param string the where clause for the join
+ * @param string the join type
+ */
+ function addJoin($table, $where, $type='default')
+ {
+ if ($table == $this->table) {
+ return; //skip. Self joins are not supported.
+ }
+ // init value, to prevent E_ALL-warning
+ if (!isset($this->_join[$type]) || !$this->_join[$type]) {
+ $this->_join[$type] = array();
+ }
+ $this->_join[$type][$table] = $where;
+ }
+
+ // }}}
+ // {{{ setTable()
+
+ /**
+ * sets the table this class is currently working on
+ *
+ * @version 2002/07/11
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the table name
+ */
+ function setTable($table)
+ {
+ $this->table = $table;
+ }
+
+ // }}}
+ // {{{ getTable()
+
+ /**
+ * gets the table this class is currently working on
+ *
+ * @version 2002/07/11
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @return string the table name
+ */
+ function getTable()
+ {
+ return $this->table;
+ }
+
+ // }}}
+ // {{{ setGroup()
+
+ /**
+ * sets the group-by condition
+ *
+ * @version 2002/07/22
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the group condition
+ */
+ function setGroup($group='')
+ {
+ $this->_group = $group;
+//FIXXME parse the condition and replace ambigious column names, such as "name='Deutschland'" with "country.name='Deutschland'"
+// then the users dont have to write that explicitly and can use the same name as in the setOrder i.e. setOrder('name,_net_name,_netPrefix_prefix');
+ }
+
+ // }}}
+ // {{{ getGroup()
+
+ /**
+ * gets the group condition which is used for the current instance
+ *
+ * @version 2002/07/22
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @return string the group condition
+ */
+ function getGroup()
+ {
+ return $this->_group;
+ }
+
+ // }}}
+ // {{{ setSelect()
+
+ /**
+ * limit the result to return only the columns given in $what
+ * @param string fields that shall be selected
+ */
+ function setSelect($what='*')
+ {
+ $this->_select = $what;
+ }
+
+ // }}}
+ // {{{ addSelect()
+
+ /**
+ * add a string to the select part of the query
+ *
+ * add a string to the select-part of the query and connects it to an existing
+ * string using the $connectString, which by default is a comma.
+ * (SELECT xxx FROM - xxx is the select-part of a query)
+ *
+ * @version 2003/01/08
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the string that shall be added to the select-part
+ * @param string the string to connect the new string with the existing one
+ * @return void
+ */
+ function addSelect($what='*', $connectString=',')
+ {
+ // if the select string is not empty add the string, otherwise simply set it
+ if ($this->_select) {
+ $this->_select = $this->_select.$connectString.$what;
+ } else {
+ $this->_select = $what;
+ }
+ }
+
+ // }}}
+ // {{{ getSelect()
+
+ /**
+ * @return string
+ */
+ function getSelect()
+ {
+ return $this->_select;
+ }
+
+ // }}}
+ // {{{ setDontSelect()
+
+ /**
+ * @param string
+ */
+ function setDontSelect($what='')
+ {
+ $this->_dontSelect = $what;
+ }
+
+ // }}}
+ // {{{ getDontSelect()
+
+ /**
+ * @return string
+ */
+ function getDontSelect()
+ {
+ return $this->_dontSelect;
+ }
+
+ // }}}
+ // {{{ reset()
+
+ /**
+ * reset all the set* settings; with no parameter given, it resets them all
+ *
+ * @version 2002/09/16
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @return void
+ */
+ function reset($what=array())
+ {
+ if (!sizeof($what)) {
+ $what = array(
+ 'select',
+ 'dontSelect',
+ 'group',
+ 'having',
+ 'limit',
+ 'where',
+ 'index',
+ 'order',
+ 'join',
+ 'leftJoin',
+ 'rightJoin'
+ );
+ }
+
+ foreach ($what as $aReset) {
+ $this->{'set'.ucfirst($aReset)}();
+ }
+ }
+
+ // }}}
+ // {{{ setOption()
+
+ /**
+ * set mode the class shall work in
+ * currently we have the modes:
+ * 'raw' does not quote the data before building the query
+ *
+ * @version 2002/09/17
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the mode to be set
+ * @param mixed the value of the mode
+ * @return void
+ */
+ function setOption($option, $value)
+ {
+ $this->options[strtolower($option)] = $value;
+ }
+
+ // }}}
+ // {{{ getOption()
+
+ /**
+ * @return string
+ */
+ function getOption($option)
+ {
+ return $this->options[strtolower($option)];
+ }
+
+ // }}}
+ // {{{ _quoteArray()
+
+ /**
+ * quotes all the data in this array if we are not in raw mode!
+ * @param array
+ */
+ function _quoteArray($data)
+ {
+ if (!$this->getOption('raw')) {
+ foreach ($data as $key => $val) {
+ $data[$key] = $this->db->quote($val);
+ }
+ }
+ return $data;
+ }
+
+ // }}}
+ // {{{ _checkColumns()
+
+ /**
+ * checks if the columns which are given as the array's indexes really exist
+ * if not it will be unset anyway
+ *
+ * @version 2002/04/16
+ * @access public
+ * @author Wolfram Kriesing <wk@visionp.de>
+ * @param string the actual message, first word should always be the method name,
+ * to build the message like this: className::methodname
+ * @param integer the line number
+ */
+ function _checkColumns($newData, $method='unknown')
+ {
+ if (!$meta = $this->metadata()) { // if no metadata available, return data as given
+ return $newData;
+ }
+
+ foreach ($newData as $colName => $x) {
+ if (!isset($meta[$colName])) {
+ $this->_errorLog("$method, column {$this->table}.$colName doesnt exist, value was removed before '$method'",__LINE__);
+ unset($newData[$colName]);
+ } else {
+ // if the current column exists, check the length too, not to write content that is too long
+ // prevent DB-errors here
+ // do only check the data length if this field is given
+ if (isset($meta[$colName]['len']) && ($meta[$colName]['len'] != -1) &&
+ ($oldLength=strlen($newData[$colName])) > $meta[$colName]['len']
+ ) {
+ $this->_errorLog("_checkColumns, had to trim column '$colName' from $oldLength to ".
+ $meta[$colName]['DATA_LENGTH'].' characters.', __LINE__);
+ $newData[$colName] = substr($newData[$colName], 0, $meta[$colName]['len']);