├── tpl ├── sessionFormation.tpl.php ├── statCompetence.tpl.php ├── rechercheProfil.tpl.php ├── rechercheCompetence.tpl.php ├── formationCompetence.tpl.php ├── resultat.tpl.php ├── productivite.tpl.php ├── dif.tpl.php ├── productivite_user_fiche.tpl.php ├── planFormation.tpl.php ├── remuneration_prime.tpl.php ├── fiche_poste.tpl.php ├── productivite_user_indice.tpl.php ├── grille_salaire.tpl.php ├── cv.tpl.php ├── formation.tpl.php ├── remuneration.tpl.php ├── remuneration.tpl.php.1 └── statCompetenceResult.tpl.php ├── .gitignore ├── config.php ├── GPEC.xmind ├── img ├── delete.png ├── competence.png ├── delete_tag.png ├── img_module.png ├── competence_over.png └── object_competence.png ├── Plan de formation.xmind ├── script ├── importsBSI │ ├── Imports_BSI.pdf │ ├── Sal_dif_130606 │ ├── Sal_info_130606 │ ├── Sal_form_130606 │ ├── Sal_rem_130606 │ ├── importDif.php │ ├── importFormation.php │ ├── importRem.php │ └── importInfo.php ├── loadUtilisateurs.php ├── create-maj-base.php └── interface.php ├── index.php ├── test ├── config.default.php ├── AllTests.php ├── ScriptTest.php └── CompetenceTest.php ├── class ├── type_poste.class.php ├── productivite.class.php ├── formation.class.php └── competence.class.php ├── config.default.php ├── lib └── competence.lib.php ├── sessionFormation.php ├── formation.php ├── productivite_liste.php ├── liste_types_postes.php ├── grille_salaire.php ├── productivite_user_indice.php ├── planFormation.php ├── fiche_type_poste.php ├── productivite_user_fiche.php ├── statCompetence.php ├── productivite.php ├── rechercheCompetence.php ├── productivite_user.php └── experience.php /tpl/sessionFormation.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings/* 2 | .project 3 | .buildpath 4 | -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | = 3.7) 5 | header('location:'.DOL_URL_ROOT.'/user/card.php?id='.$user->id); 6 | else 7 | header('location:'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id); 8 | llxHeader('','Informations salarié'); 9 | llxFooter(); 10 | exit; 11 | -------------------------------------------------------------------------------- /script/importsBSI/Sal_dif_130606: -------------------------------------------------------------------------------- 1 | "DHR";"2012";"20";"70";"55" 2 | "PJU";"2012";"0";"0";"120" 3 | "LMN";"2012";"0";"0";"120" 4 | "SRE";"2012";"0";"0";"120" 5 | "GSR";"2012";"0";"0";"120" 6 | "LDX";"2012";"0";"0";"120" 7 | "WBN";"2012";"0";"0";"120" 8 | "JVA";"2012";"20";"0";"101" 9 | "RML";"2012";"20";"32";"108" 10 | "VJY";"2012";"20";"49";"91" 11 | -------------------------------------------------------------------------------- /test/config.default.php: -------------------------------------------------------------------------------- 1 | 3 | [competence.titreRecherche;block=tr;strconv=no;protect=no] 4 |
5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 |
Veuillez renseigner les paramètres pour la recherche de statistiques
Libellé compétence [competence.Tlibelle;block=tr;strconv=no;protect=no] 11 | Groupe [competence.TGroupe;block=tr;strconv=no;protect=no] 12 | [competence.btValider;block=tr;strconv=no;protect=no]
16 | 17 | 18 | 19 | [onshow;block=begin;when [userCourant.droitRecherche]!='1'] 20 | Vous ne possédez pas les droits pour connaître les statistiques des compétences dans l'entreprise. 21 | [onshow;block=end] 22 | 23 | -------------------------------------------------------------------------------- /class/type_poste.class.php: -------------------------------------------------------------------------------- 1 | setChild('TRH_grilleSalaire','fk_type_poste'); 17 | 18 | } 19 | 20 | } 21 | 22 | class TRH_grilleSalaire extends TObjetStd { 23 | function __construct() { 24 | 25 | parent::set_table(MAIN_DB_PREFIX.'rh_grille_salaire'); 26 | parent::add_champs('fk_type_poste','type=chaine;'); 27 | parent::add_champs('salaire_min,salaire_max,salaire_conventionnel,salaire_constate','type=float;'); 28 | 29 | parent::add_champs('entity,nb_annees_anciennete','type=entier;'); 30 | 31 | parent::_init_vars(); 32 | parent::start(); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /config.default.php: -------------------------------------------------------------------------------- 1 | global->RH_DOL_ADMIN_USER, 'admin') ); -------------------------------------------------------------------------------- /script/loadUtilisateurs.php: -------------------------------------------------------------------------------- 1 | entity." 14 | AND g.fk_user=u.rowid"; 15 | }else{ 16 | $sqlReq="SELECT u.rowid,u.lastname, u.firstname FROM ".MAIN_DB_PREFIX."user as u,".MAIN_DB_PREFIX."usergroup_user as g 17 | WHERE u.entity=".$conf->entity." 18 | AND g.fk_user=u.rowid AND g.fk_usergroup=".$_REQUEST['groupe']; 19 | 20 | } 21 | 22 | $ATMdb->Execute($sqlReq); 23 | while($ATMdb->Get_line()) { 24 | $TUser[$ATMdb->Get_field('rowid')] = html_entity_decode(htmlentities($ATMdb->Get_field('lastname'), ENT_COMPAT , 'ISO8859-1')).' '.html_entity_decode(htmlentities($ATMdb->Get_field('firstname'), ENT_COMPAT , 'ISO8859-1')); 25 | } 26 | 27 | echo json_encode($TUser); 28 | 29 | exit(); 30 | } 31 | -------------------------------------------------------------------------------- /script/importsBSI/Sal_info_130606: -------------------------------------------------------------------------------- 1 | "DHR";"1966-07-04";"MARIÉ(E)";"2";"";"151,67";"Cadre";"7 / 300";"CDI";"CPROINFO";"INGENIEUR SYSTEME ET RESEAU" 2 | "PJU";"1957-03-22";"VIE MARITALE";"4";"";"151,67";"Cadre";"7 / 300";"CDI";"CPROINFO";"INGENIEUR COMMERCIAL" 3 | "LMN";"1969-04-12";"CÉLIBATAIRE";"0";"";"151,67";"Employé";"3 / 170";"CDI";"CPROINFO";"ASSISTANTE COMMERCIALE" 4 | "SRE";"1971-04-14";"CÉLIBATAIRE";"1";"1997-07-01";"151,67";"Employé";"5 / 220";"CDI";"CPROINFO";"ASSISTANTE C'PRO INFORMATIQUE" 5 | "GSR";"1978-06-02";"CÉLIBATAIRE";"0";"1999-05-03";"151,67";"Cadre";"7 / 300";"CDI";"CPROINFO";"ARCHITECTE SYSTEME ET RESEAU" 6 | "LDX";"1975-07-31";"MARIÉ(E)";"1";"";"151,67";"Cadre";"7 / 300";"CDI";"CPROINFO";"CHEF DE PROJET IT" 7 | "WBN";"1978-03-21";"MARIÉ(E)";"4";"";"151,67";"Employé";"5 / 220";"CDI";"CPROINFO";"ARCHITECTE SYSTEME ET RESEAU" 8 | "JVA";"1980-06-30";"MARIÉ(E)";"1";"2002-08-22";"151,67";"Employé";"4 / 190";"CDI";"CPROINFO";"TECHNICIEN RESEAUX" 9 | "RML";"1977-04-11";"CÉLIBATAIRE";"1";"2002-10-01";"151,67";"Employé";"5 / 220";"CDI";"CPROINFO";"INGENIEUR RESEAU" 10 | "VJY";"1980-08-12";"MARIÉ(E)";"2";"2002-12-19";"151,67";"Cadre";"7 / 300";"CDI";"CPROINFO";"RESPE CELLULE OPERATIONNELLE" 11 | -------------------------------------------------------------------------------- /tpl/rechercheProfil.tpl.php: -------------------------------------------------------------------------------- 1 | [onshow;block=begin;when [userCourant.droitRecherche]=='1'] 2 |
3 |

Recherche d'un profil

4 |
5 | 6 | 7 | 8 | 9 | 10 | 27 | 28 | 29 |
Veuillez saisir les compétences du collaborateur recherché
[recherche.libelle;block=tr;strconv=no;protect=no] 11 | [onshow;block=begin;when [view.mode]=='edit'] 12 | 13 | [onshow;block=end] 14 | 15 |



16 | Exemples de recherches prises en compte : 17 |
18 | 19 |
  • Excel
  • 20 |
  • Excel niveau
  • avec (niveau = {Faible, Bon, Moyen, Excellent}) 21 |
  • Excel niveau OU Word
  • 22 |
  • Excel niveau OU Word niveau OU...
  • 23 |
  • Excel niveau ET Word niveau OU...
  • 24 |
    25 | 26 |
    30 |
    31 | [onshow;block=end] 32 | 33 | [onshow;block=begin;when [userCourant.droitRecherche]!='1'] 34 | Vous ne possédez pas les droits pour effectuer une recherche de profil. 35 | [onshow;block=end] 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /tpl/rechercheCompetence.tpl.php: -------------------------------------------------------------------------------- 1 | [onshow;block=begin;when [userCourant.droitRecherche]=='1'] 2 |
    3 | [recherche.titreRecherche;block=tr;strconv=no;protect=no] 4 |
    5 | 6 | 7 | 8 | 9 | 10 | 27 | 28 | 29 |
    Veuillez saisir les compétences du collaborateur recherché
    [recherche.libelle;block=tr;strconv=no;protect=no] 11 | [onshow;block=begin;when [view.mode]=='edit'] 12 | 13 | [onshow;block=end] 14 | 15 |



    16 | Exemples de recherches prises en compte : 17 |
    18 | 19 |
  • Excel
  • 20 |
  • Excel niveau
  • avec (niveau = {Faible, Bon, Moyen, Excellent}) 21 |
  • Excel niveau OU Word
  • 22 |
  • Excel niveau OU Word niveau OU...
  • 23 |
  • Excel niveau ET Word niveau OU...
  • 24 |
    25 | 26 |
    30 |
    31 | [onshow;block=end] 32 | 33 | [onshow;block=begin;when [userCourant.droitRecherche]!='1'] 34 | Vous ne possédez pas les droits pour effectuer une recherche de profil. 35 | [onshow;block=end] 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /lib/competence.lib.php: -------------------------------------------------------------------------------- 1 | getId()."&action=view",1), 'Fiche','fiche') 9 | ); 10 | break; 11 | 12 | case 'planFormation': 13 | return array( 14 | array(dol_buildpath('/competence/planFormation.php?id='.$obj->getId()."&action=view",1), 'Fiche','fiche') 15 | ); 16 | break; 17 | 18 | case 'productivite': 19 | return array( 20 | array(dol_buildpath('/competence/productivite.php?id='.$obj->getId()."&action=view",1), 'Fiche','fiche') 21 | ); 22 | break; 23 | 24 | case 'productivite_user': 25 | return array( 26 | array(dol_buildpath('/competence/productivite_user_fiche.php?id='.$obj->getId()."&fk_user=".$_REQUEST['fk_user']."&action=view",1), 'Fiche','fiche') 27 | ); 28 | break; 29 | 30 | case 'chiffre_user': 31 | return array( 32 | array(dol_buildpath('/competence/productivite_user_indice.php?id='.$obj->getId()."&fk_user=".$_REQUEST['fk_user']."&fk_productivite=".$_REQUEST['fk_productivite']."&action=view",1), 'Fiche','fiche') 33 | ); 34 | break; 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /script/importsBSI/Sal_form_130606: -------------------------------------------------------------------------------- 1 | "DHR";"ACTUALISER SES COMPETENCES D`ADMINISTRATEUR VERS EXCHANGE SERVER 2010";"2012-02-06";"2012-02-10";"1662,5";"0";"1662,5";"" 2 | "DHR";"CONCEVOIR ET DEPLOYER UNE SOLUTION DE MESSAGERIE EXCHANGE SERVER 2010";"2012-11-12";"2012-11-16";"1781,5";"0";"1781,5";"" 3 | "DHR";"SELLING HP SMB STORAGE";"2012-01-01";"2012-12-31";"72,33";"0";"72,33";"" 4 | "PJU";"VENTE STRATEGIQUE";"2012-01-04";"2012-01-04";"159,29";"0";"159,29";"" 5 | "PJU";"COMITE D`ENTREPRISE";"2012-07-03";"2012-07-03";"137,5";"0";"137,5";"" 6 | "PJU";"SELLING HP SMB STORAGE";"2012-01-01";"2012-12-31";"72,33";"0";"72,33";"" 7 | "LMN";"COMITE D`ENTREPRISE";"2012-07-03";"2012-07-03";"137,5";"0";"137,5";"" 8 | "SRE";"EVACUATION DES LOCAUX";"2012-06-26";"2012-06-26";"32,14";"0";"32,14";"" 9 | "JVA";"CERTIFICATION OLFEO";"2012-10-22";"2012-10-23";"900";"0";"900";"" 10 | "RML";"V9 EXPERT UTM M1 ET M2 NETASQ";"2012-03-20";"2012-03-28";"2360";"0";"2360";"" 11 | "RML";"COMITE D`ENTREPRISE";"2012-07-03";"2012-07-03";"137,5";"0";"137,5";"" 12 | "RML";"FORMATION EXPERT PLUS";"2012-11-05";"2012-11-07";"1920";"0";"1920";"" 13 | "VJY";"MANAGER JUSTE: LES OUTILS";"2012-03-01";"2012-05-04";"2350";"0";"2350";"" 14 | "VJY";"EVACUATION DES LOCAUX";"2012-06-26";"2012-06-26";"32,14";"0";"32,14";"" 15 | "VJY";"SUPERVISION ET PILOTAGE DES SYSTEMES D`INFORMATION";"2012-09-28";"2012-09-28";"500";"0";"500";"" 16 | -------------------------------------------------------------------------------- /script/importsBSI/Sal_rem_130606: -------------------------------------------------------------------------------- 1 | "DHR";"2012-01-01";"2012-12-31";"38872";"3080";"0";"240";"1672";"240";"0";"0";"0";"757,08";"6847,3";"1816,21";"0";"0";"757,08";"10171,29";"2773,01" 2 | "PJU";"2012-01-01";"2012-12-31";"43621,21";"1930";"0";"0";"19059,37";"2451,84";"0";"0";"0";"757,08";"7376,69000000001";"2263,14";"0";"0";"757,08";"11045,12";"3473,41" 3 | "LMN";"2012-01-01";"2012-12-31";"25526,2";"2101";"80";"240";"0";"497,2";"0";"0";"0";"326,16";"4566,76";"1059,33";"0";"0";"326,16";"6815,49";"1544,34" 4 | "SRE";"2012-01-01";"2012-12-31";"23423,12";"1700";"64";"240";"2400";"923,12";"0";"0";"0";"757,08";"4227,07";"972,07";"0";"0";"757,08";"6254,01";"1417,1" 5 | "GSR";"2012-01-01";"2012-12-31";"34166";"2757";"0";"240";"1172";"240";"0";"0";"0";"326,16";"6139,4";"1649,75";"0";"0";"326,16";"9122,34";"2523,75" 6 | "LDX";"2012-01-01";"2012-12-31";"33017,08";"2706";"0";"240";"2364";"-409,66";"0";"0";"0";"505,71";"5948,12";"161,04";"0";"0";"505,71";"8815,5";"0" 7 | "WBN";"2012-01-01";"2012-12-31";"13365,66";"2450";"65";"0";"0";"-15054,46";"0";"0";"0";"757,08";"2438,02";"554,66";"0";"0";"757,08";"3568,62";"808,61" 8 | "JVA";"2012-01-01";"2012-12-31";"24723,08";"1927";"50";"240";"1012";"818,08";"0";"0";"0";"757,08";"4458,29";"1026";"0";"0";"757,08";"6601,03";"1495,74" 9 | "RML";"2012-01-01";"2012-12-31";"27043,88";"2147";"50";"240";"1172";"533,88";"0";"0";"0";"757,08";"4871,08";"1122,31";"0";"0";"757,08";"7220,69";"1636,13" 10 | "VJY";"2012-01-01";"2012-12-31";"32194";"2500";"0";"240";"2344";"240";"0";"0";"0";"757,08";"5821";"1571,74";"0";"0";"757,08";"8595,8";"2406,3" 11 | -------------------------------------------------------------------------------- /sessionFormation.php: -------------------------------------------------------------------------------- 1 | load('competence@competence'); 5 | 6 | $ATMdb=new TPDOdb; 7 | $sessionFormation = new TRH_formation_session; 8 | 9 | if(isset($_REQUEST['action'])) { 10 | switch($_REQUEST['action']) { 11 | case 'add': 12 | _liste($ATMdb); 13 | break; 14 | 15 | case 'new': 16 | $sessionFormation->load($ATMdb, $_REQUEST['id']); 17 | _fiche($ATMdb,$sessionFormation); 18 | break; 19 | 20 | case 'edit': 21 | $sessionFormation->load($ATMdb, $_REQUEST['id']); 22 | _fiche($ATMdb,$sessionFormation); 23 | break; 24 | 25 | case 'save': 26 | $sessionFormation->load($ATMdb, $_REQUEST['id']); 27 | _fiche($ATMdb,$sessionFormation); 28 | break; 29 | 30 | case 'view': 31 | $sessionFormation->load($ATMdb, $_REQUEST['id']); 32 | _fiche($ATMdb,$sessionFormation); 33 | break; 34 | 35 | case 'delete': 36 | _liste($ATMdb); 37 | break; 38 | } 39 | } 40 | elseif(isset($_REQUEST['id'])) { 41 | $sessionFormation->load($ATMdb, $_REQUEST['id']); 42 | _fiche($ATMdb,$sessionFormation); 43 | } 44 | else { 45 | _liste($ATMdb); 46 | } 47 | 48 | $ATMdb->close(); 49 | llxFooter(); 50 | 51 | 52 | function _liste(&$ATMdb) { 53 | global $langs,$conf,$db,$user; 54 | 55 | llxHeader('','Liste Sessions de Formations'); 56 | print dol_get_fiche_head(array() , '', 'Liste Sessions de Formations'); 57 | 58 | llxFooter(); 59 | } 60 | 61 | function _fiche(&$ATMdb,&$sessionFormation) { 62 | global $langs,$conf,$db,$user; 63 | 64 | llxHeader('', 'Session de Formation'); 65 | print dol_get_fiche_head(array() , '', 'Session de Formation'); 66 | 67 | llxFooter(); 68 | } -------------------------------------------------------------------------------- /tpl/formationCompetence.tpl.php: -------------------------------------------------------------------------------- 1 | [onshow;block=begin;when [view.mode]=='view'] 2 | [view.head;strconv=no] 3 | [onshow;block=end] 4 | 5 | [onshow;block=begin;when [view.mode]!='view'] 6 | [view.onglet;strconv=no] 7 | [onshow;block=end] 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
    Intitulé de la formation[formation.libelle;strconv=no;protect=no]
    Description[formation.description;strconv=no;protect=no]
    Budget[formation.budget;strconv=no;protect=no] €
    Budget Consommé[formation.budgetConsomme;strconv=no;protect=no] €
    30 | 31 |
    32 | 33 |
    34 | [onshow;block=begin;when [view.mode]!='view'] 35 | 36 |    37 | [onshow;block=end] 38 | [onshow;block=begin;when [view.mode]=='view'] 39 | Modifier 40 |   Ajouter une Session de Formation 41 |   Supprimer 42 | [onshow;block=end] 43 |
    44 | 45 | 46 | [onshow;block=begin;when [view.mode]=='view'] 47 | [onshow;block=end] 48 | 49 |
    50 | 51 | -------------------------------------------------------------------------------- /tpl/resultat.tpl.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | [formation.titreResultat;strconv=no;protect=no] 4 |
    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
    NomPrénomDate débutDate finDate d'expiration de la formation
    [userCourant.nom;block=tr;strconv=no;protect=no][userCourant.prenom;block=tr;strconv=no;protect=no][formation.date_debut;block=tr;strconv=no;protect=no][formation.date_fin;strconv=no;protect=no][formation.date_formationEcheance;strconv=no;protect=no]
    21 |

    22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
    Libellé de la formation[formation.libelleFormation;strconv=no;protect=no]
    Lieu de la formation[formation.lieuFormation;strconv=no;protect=no]
    Commentaires[formation.commentaireFormation;strconv=no;protect=no]
    36 | 37 |

    38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 |
    Compétences acquises
    45 | [TCompetence.libelleCompetence;block=tr;strconv=no;protect=no] 46 | [TCompetence.niveauCompetence;block=tr;strconv=no;protect=no] 47 |
    51 | 52 |

    53 | 54 | [onshow;block=begin;when [view.mode]=='view'] 55 | Retour 56 | [onshow;block=end] 57 |
    58 |
    59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /tpl/productivite.tpl.php: -------------------------------------------------------------------------------- 1 | [onshow;block=begin;when [view.mode]=='view'] 2 | [view.head;strconv=no] 3 | [onshow;block=end] 4 | 5 | [onshow;block=begin;when [view.mode]!='view'] 6 | [view.onglet;strconv=no] 7 | [onshow;block=end] 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    Date objectif[productivite.date_objectif;block=tr;strconv=no;protect=no]
    Libellé[productivite.indice;block=tr;strconv=no;protect=no]
    Objectif[productivite.objectif;block=tr;strconv=no;protect=no]
    23 | 24 | 25 | [onshow;block=begin;when [view.mode]=='view'] 26 |
    27 | Retour 28 | Modifier 29 | Supprimer 30 |
    31 | [onshow;block=end] 32 |
    33 | 34 | 35 | [onshow;block=begin;when [view.mode]=='edit'] 36 |
    37 | 38 |     39 |
    40 | [onshow;block=end] 41 | 42 | -------------------------------------------------------------------------------- /tpl/dif.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
    Réf.[user.id]
    Nom[user.lastname]
    Prénom[user.firstname]
    6 |
    7 | [dif.titre;strconv=no;protect=no] 8 |
    9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    AnnéeNombre d'heures acquisesNombre d'heures prisesNombre d'heures restantes
    [dif.annee;block=tr;strconv=no;protect=no][dif.nb_heures_acquises;block=tr;strconv=no;protect=no] heures[dif.nb_heures_prises;strconv=no;protect=no] heures[dif.nb_heures_restantes;strconv=no;protect=no] heures
    23 | 24 | 25 | [onshow;block=begin;when [view.mode]=='view'] 26 | [onshow;block=begin;when [view.userRight]==1] 27 | Supprimer 28 | [onshow;block=end] 29 | Annuler 30 | [onshow;block=begin;when [view.userRight]==1] 31 | Modifier 32 | [onshow;block=end] 33 | [onshow;block=end] 34 |
    35 | 36 | [onshow;block=begin;when [view.mode]=='edit'] 37 |
    38 | 39 |     40 |
    41 | [onshow;block=end] 42 | -------------------------------------------------------------------------------- /script/create-maj-base.php: -------------------------------------------------------------------------------- 1 | db->debug=true; 24 | 25 | //Competence 26 | $o=new TRH_ligne_cv; 27 | $o->init_db_by_vars($ATMdb); 28 | 29 | $p=new TRH_formation_cv; 30 | $p->init_db_by_vars($ATMdb); 31 | 32 | $q=new TRH_competence_cv; 33 | $q->init_db_by_vars($ATMdb); 34 | 35 | $r=new TRH_remuneration; 36 | $r->init_db_by_vars($ATMdb); 37 | 38 | $r=new TRH_remunerationPrime; 39 | $r->init_db_by_vars($ATMdb); 40 | 41 | $r=new TRH_dif; 42 | $r->init_db_by_vars($ATMdb); 43 | 44 | // Productivité 45 | $r=new TRH_productivite; 46 | $r->init_db_by_vars($ATMdb); 47 | 48 | $r=new TRH_productiviteUser; 49 | $r->init_db_by_vars($ATMdb); 50 | 51 | $r=new TRH_productiviteIndice; 52 | $r->init_db_by_vars($ATMdb); 53 | 54 | $r=new TRH_fichePoste; 55 | $r->init_db_by_vars($ATMdb); 56 | 57 | $r=new TRH_grilleSalaire; 58 | $r->init_db_by_vars($ATMdb); 59 | 60 | /* //Formation 61 | $r=new TRH_formation_plan; 62 | $r->init_db_by_vars($ATMdb); 63 | 64 | $r=new TRH_formation_section; 65 | $r->init_db_by_vars($ATMdb); 66 | 67 | $r=new TRH_formation; 68 | $r->init_db_by_vars($ATMdb); 69 | 70 | $r=new TRH_formation_type_priorite; 71 | $r->init_db_by_vars($ATMdb); 72 | 73 | $r=new TRH_formation_session; 74 | $r->init_db_by_vars($ATMdb); 75 | 76 | $r=new TRH_formation_participant; 77 | $r->init_db_by_vars($ATMdb); 78 | 79 | $r=new TRH_formation_participant_statut; 80 | $r->init_db_by_vars($ATMdb);*/ -------------------------------------------------------------------------------- /tpl/productivite_user_fiche.tpl.php: -------------------------------------------------------------------------------- 1 | [onshow;block=begin;when [view.mode]=='view'] 2 | [view.head;strconv=no] 3 | [onshow;block=end] 4 | 5 | [onshow;block=begin;when [view.mode]!='view'] 6 | [view.onglet;strconv=no] 7 | [onshow;block=end] 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    Indice[productivite_user.indice;block=tr;strconv=no;protect=no]
    Date objectif[productivite_user.date_objectif;block=tr;strconv=no;protect=no]
    Objectif[productivite_user.objectif;block=tr;strconv=no;protect=no]
    23 | 24 |
    25 | 26 | [onshow;block=begin;when [view.mode]=='view'] 27 | Retour 28 | Modifier 29 | Supprimer 30 | [onshow;block=end] 31 |
    32 |
    33 | 34 | 35 | [onshow;block=begin;when [view.mode]=='edit'] 36 |
    37 | 38 |     39 |
    40 | [onshow;block=end] 41 | 42 | -------------------------------------------------------------------------------- /script/importsBSI/importDif.php: -------------------------------------------------------------------------------- 1 |
    '; 16 | 17 | $TTrigramme = array(); 18 | $sql="SELECT rowid, login FROM ".MAIN_DB_PREFIX."user WHERE entity IN (0,".$conf->entity.")"; 19 | $ATMdb->Execute($sql); 20 | while($row = $ATMdb->Get_line()) { 21 | $TTrigramme[strtolower($row->login)] = $row->rowid; 22 | } 23 | //print_r($TTrigramme);exit(); 24 | 25 | 26 | 27 | $nomFichier = "Sal_dif_130606"; 28 | echo 'Traitement du fichier '.$nomFichier.' :
    '; 29 | $cpt = 0; 30 | //début du parsing 31 | $numLigne = 0; 32 | if (($handle = fopen("./".$nomFichier, "r")) !== FALSE) { 33 | while(($data = fgetcsv($handle, 0,'\r')) != false){ 34 | //echo 'Traitement de la ligne '.$numLigne.'...'; 35 | 36 | $infos = explode(';', str_replace('"', '', $data[0])) ; 37 | print_r($infos); 38 | echo '
    '; 39 | $trigramme = strtolower($infos[0]); 40 | $annee = $infos[1]; 41 | 42 | 43 | if (!empty($TTrigramme[$trigramme])){ 44 | $dif = new TRH_dif; 45 | $dif->load_by_user_and_annee($ATMdb, $TTrigramme[$trigramme], $annee); 46 | 47 | $dif->fk_user = $TTrigramme[$trigramme]; 48 | 49 | $dif->annee = intval($annee); 50 | $dif->nb_heures_acquises = intval($infos[2]); 51 | $dif->nb_heures_prises = intval($infos[3]); 52 | $dif->nb_heures_restantes = intval($infos[4]); 53 | 54 | $dif->entity = $conf->entity; 55 | $dif->save($ATMdb); 56 | $cpt++; 57 | } 58 | else{ 59 | echo "Attention : ".$trigramme." non trouvé. La dif de la ligne ".$numLigne." n'a pas été importé.
    "; 60 | } 61 | $numLigne++; 62 | } 63 | } 64 | 65 | 66 | //Fin du code PHP : Afficher le temps d'éxecution 67 | $timeend=microtime(true); 68 | $page_load_time = number_format($timeend-$timestart, 3); 69 | echo $cpt." dif importées.
    "; 70 | echo 'Fin du traitement. Durée : '.$page_load_time . " sec

    "; 71 | $ATMdb->close(); 72 | 73 | 74 | -------------------------------------------------------------------------------- /test/AllTests.php: -------------------------------------------------------------------------------- 1 | 3 | * Copyright (C) 2011-2012 Regis Houssin 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * or see http://www.gnu.org/ 18 | */ 19 | 20 | /** 21 | * \file test/phpunit/AllTest.php 22 | * \ingroup test 23 | * \brief This file is a test suite to run all unit tests 24 | * \remarks To run this script as CLI: phpunit filename.php 25 | */ 26 | 27 | global $conf,$user,$langs,$db; 28 | //inclusion de config des tests. 29 | require('./config.php'); 30 | require('../lib/competence.lib.php'); 31 | require('../class/competence.class.php'); 32 | require('../script/interface.php'); 33 | 34 | global $conf,$user,$langs,$db; 35 | 36 | $cv=new TRH_ligne_cv; 37 | $formation=new TRH_formation_cv; 38 | $competence=new TRH_competence_cv; 39 | $remuneration = new TRH_remuneration; 40 | $dif = new TRH_dif; 41 | 42 | $ATMdb = new TPDOdb; 43 | 44 | 45 | /** 46 | * Class for the All test suite 47 | */ 48 | class AllTests 49 | { 50 | /** 51 | * Function suite to make all PHPUnit tests 52 | * 53 | * @return void 54 | */ 55 | public static function suite() 56 | { 57 | $suite = new PHPUnit_Framework_TestSuite('PHPUnit Framework'); 58 | 59 | require_once './CompetenceTest.php'; 60 | $suite->addTestSuite('CompetenceTest'); 61 | 62 | require_once './ScriptTest.php'; 63 | $suite->addTestSuite('ScriptTest'); 64 | 65 | return $suite; 66 | } 67 | } 68 | 69 | ?> 70 | -------------------------------------------------------------------------------- /tpl/planFormation.tpl.php: -------------------------------------------------------------------------------- 1 | [onshow;block=begin;when [view.mode]=='view'] 2 | [view.head;strconv=no] 3 | [onshow;block=end] 4 | 5 | [onshow;block=begin;when [view.mode]!='view'] 6 | [view.onglet;strconv=no] 7 | [onshow;block=end] 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
    Date début[planFormation.date_debut;strconv=no;protect=no]
    Date fin[planFormation.date_fin;strconv=no;protect=no]
    Intitulé du Plan[planFormation.libelle;strconv=no;protect=no]
    Description[planFormation.description;strconv=no;protect=no]
    Budget[planFormation.budget;strconv=no;protect=no] €
    Budget accepté par l'OPCA[planFormation.budget_opca;strconv=no;protect=no] €
    Budget consommé[planFormation.budget_final;strconv=no;protect=no] €
    43 | 44 |
    45 | 46 |
    47 | [onshow;block=begin;strconv=no;when [view.mode]!='view'] 48 | 49 |    50 | [onshow;block=end] 51 | [onshow;block=begin;strconv=no;when [view.mode]=='view'] 52 | Modifier 53 |   Supprimer 54 | [onshow;block=end] 55 |
    56 | 57 | 58 | [onshow;block=begin;when [view.mode]=='view'] 59 | [listeFormation.liste;strconv=no;protect=no] 60 | Ajouter une Formation 61 | [onshow;block=end] 62 | 63 |
    64 | 65 | -------------------------------------------------------------------------------- /tpl/remuneration_prime.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
    Réf.[user.id]
    Nom[user.lastname]
    Prénom[user.firstname]
    6 |
    7 | 8 |
    9 |
    10 | 11 |

    Ajout d'une prime

    12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
    Date prime[remunerationPrime.date_prime;block=tr;strconv=no;protect=no]
    Montant prime[remunerationPrime.montant_prime;block=tr;strconv=no;protect=no] €
    Motif[remunerationPrime.motif;block=tr;strconv=no;protect=no]
    25 |

    26 | 27 |
    28 | 29 | 30 | [onshow;block=begin;when [view.mode]=='view'] 31 | Retour 32 | [onshow;block=begin;when [userCourant.ajoutRem]=='1'] 33 | Modifier 34 | Supprimer 35 | [onshow;block=end] 36 | [onshow;block=end] 37 |
    38 |
    39 | 40 |
    41 | 42 | 43 | 44 | [onshow;block=begin;when [view.mode]=='edit'] 45 |
    46 | 47 |     48 |
    49 | [onshow;block=end] 50 | 51 | -------------------------------------------------------------------------------- /tpl/fiche_poste.tpl.php: -------------------------------------------------------------------------------- 1 |
    2 | 3 | [onshow;block=begin;when [view.mode]=='edit'] 4 |

    Création d'un type de poste

    5 | [onshow;block=end] 6 | [onshow;block=begin;when [view.mode]=='view'] 7 |

    Fiche type de poste

    8 | [onshow;block=end] 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
    Libellé type poste[fiche_poste.type_poste;block=tr;strconv=no;protect=no]
    Numéro convention[fiche_poste.numero_convention;block=tr;strconv=no;protect=no]
    Descriptif[fiche_poste.descriptif;block=tr;strconv=no;protect=no]
    24 |

    25 | 26 |
    27 | 28 | 29 | [onshow;block=begin;when [view.mode]=='view'] 30 | Retour 31 | Modifier 32 | Supprimer 33 | [onshow;block=end] 34 |
    35 |
    36 | 37 | 38 |
    39 | 40 | [onshow;block=begin;when [view.mode]=='edit'] 41 |
    42 | 43 | [onshow;block=begin;when [view.action]=='new'] 44 |     45 | [onshow;block=end] 46 | [onshow;block=begin;when [view.action]=='edit'] 47 |     48 | [onshow;block=end] 49 | 50 |
    51 | [onshow;block=end] 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /tpl/productivite_user_indice.tpl.php: -------------------------------------------------------------------------------- 1 | [onshow;block=begin;when [view.mode]=='view'] 2 | [view.head;strconv=no] 3 | [onshow;block=end] 4 | 5 | [onshow;block=begin;when [view.mode]!='view'] 6 | [view.onglet;strconv=no] 7 | [onshow;block=end] 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
    Indice[productivite_indice.indice;block=tr;strconv=no;protect=no]
    Date[productivite_indice.date_indice;block=tr;strconv=no;protect=no]
    Chiffre réalisé[productivite_indice.chiffre_realise;block=tr;strconv=no;protect=no]
    25 | 26 |
    27 | 28 | 29 | [onshow;block=begin;when [view.mode]=='view'] 30 | Retour 31 | Modifier 32 | Supprimer 33 | [onshow;block=end] 34 |
    35 | 36 |
    37 | 38 | [onshow;block=begin;when [view.mode]=='edit'] 39 |
    40 | 41 |     42 |
    43 | [onshow;block=end] 44 | 45 | -------------------------------------------------------------------------------- /script/importsBSI/importFormation.php: -------------------------------------------------------------------------------- 1 |
    '; 16 | 17 | $TTrigramme = array(); 18 | $sql="SELECT rowid, login FROM ".MAIN_DB_PREFIX."user WHERE entity IN (0,".$conf->entity.")"; 19 | $ATMdb->Execute($sql); 20 | while($row = $ATMdb->Get_line()) { 21 | $TTrigramme[strtolower($row->login)] = $row->rowid; 22 | } 23 | //print_r($TTrigramme);exit(); 24 | 25 | 26 | 27 | $nomFichier = "Sal_form_130606"; 28 | echo 'Traitement du fichier '.$nomFichier.' :
    '; 29 | $cpt = 0; 30 | //début du parsing 31 | $numLigne = 0; 32 | if (($handle = fopen("./".$nomFichier, "r")) !== FALSE) { 33 | while(($data = fgetcsv($handle, 0,'\r')) != false){ 34 | //echo 'Traitement de la ligne '.$numLigne.'...'; 35 | 36 | $infos = explode(';', str_replace('"', '', $data[0])) ; 37 | print_r($infos); 38 | echo '
    '; 39 | $trigramme = strtolower($infos[0]); 40 | $libelleFormation = $infos[1]; 41 | 42 | 43 | if (!empty($TTrigramme[$trigramme])){ 44 | $forma = new TRH_formation_cv; 45 | $forma->load_by_user_and_libelle($ATMdb, $TTrigramme[$trigramme], $libelleFormation); 46 | 47 | $forma->fk_user = $TTrigramme[$trigramme]; 48 | $forma->libelleFormation = $libelleFormation; 49 | $forma->set_date('date_debut', $infos[2]);//$forma->date_debut = $infos[2]; 50 | $forma->set_date('date_fin', $infos[3]); 51 | $forma->coutFormation = floatval(str_replace(',','.',$infos[4])); 52 | $forma->montantOrganisme = floatval(str_replace(',','.',$infos[5])); 53 | $forma->montantEntreprise = floatval(str_replace(',','.',$infos[6])); 54 | $forma->lieuFormation = $infos[7]; 55 | 56 | /* 57 | $forma->competenceFormation; non renseigné dans le fichier 58 | $forma->commentaireFormation; 59 | */ 60 | 61 | $forma->entity = $conf->entity; 62 | $forma->save($ATMdb); 63 | $cpt++; 64 | } 65 | else{ 66 | echo "Attention : ".$trigramme." non trouvé. La formation de la ligne ".$numLigne." n'a pas été importé.
    "; 67 | } 68 | $numLigne++; 69 | } 70 | } 71 | 72 | 73 | //Fin du code PHP : Afficher le temps d'éxecution 74 | $timeend=microtime(true); 75 | $page_load_time = number_format($timeend-$timestart, 3); 76 | echo $cpt." formations importées.
    "; 77 | echo 'Fin du traitement. Durée : '.$page_load_time . " sec

    "; 78 | $ATMdb->close(); 79 | 80 | 81 | -------------------------------------------------------------------------------- /tpl/grille_salaire.tpl.php: -------------------------------------------------------------------------------- 1 |
    2 | 3 | [onshow;block=begin;when [view.mode]=='edit'] 4 |

    Création d'une entrée sur la grille de salaire

    5 | [onshow;block=end] 6 | [onshow;block=begin;when [view.mode]=='view'] 7 |

    Fiche grille salaire

    8 | [onshow;block=end] 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
    Nombre d'annees d'anciennete ou Echelon[grille_salaire.nb_annees_anciennete;block=tr;strconv=no;protect=no]
    Salaire minimum[grille_salaire.salaire_min;block=tr;strconv=no;protect=no]
    Salaire maximum[grille_salaire.salaire_max;block=tr;strconv=no;protect=no]
    Salaire conventionnel[grille_salaire.salaire_conventionnel;block=tr;strconv=no;protect=no]
    Salaire constaté[grille_salaire.salaire_constate;block=tr;strconv=no;protect=no]
    32 |

    33 | 34 |
    35 | 36 | 37 | [onshow;block=begin;when [view.mode]=='view'] 38 | Retour 39 | Modifier 40 | Supprimer 41 | [onshow;block=end] 42 |
    43 |
    44 | 45 |
    46 | 47 | 48 | 49 | [onshow;block=begin;when [view.mode]=='edit'] 50 |
    51 | 52 |     53 | [onshow;block=begin;when [view.action]=='new'] 54 | 55 | 56 | 57 | [onshow;block=end] 58 | [onshow;block=begin;when [view.action]=='edit'] 59 | 60 | 61 | 62 | [onshow;block=end] 63 |
    64 | [onshow;block=end] 65 | 66 | -------------------------------------------------------------------------------- /formation.php: -------------------------------------------------------------------------------- 1 | load('competence@competence'); 6 | 7 | $ATMdb=new TPDOdb; 8 | $formation = new TRH_formation; 9 | $planFormation = new TRH_formation_plan; 10 | 11 | (!empty($_REQUEST['idPlan'])) ? $planFormation->load($ATMdb, $_REQUEST['idPlan']) : '' ; 12 | (!empty($_REQUEST['id'])) ? $formation->load($ATMdb, $_REQUEST['id']) : '' ; 13 | 14 | if(isset($_REQUEST['action'])) { 15 | switch($_REQUEST['action']) { 16 | case 'add': 17 | case 'new': 18 | $formation->set_values($_REQUEST); 19 | _fiche($ATMdb,$formation,$planFormation,'new'); 20 | break; 21 | 22 | case 'edit': 23 | _fiche($ATMdb,$formation,$planFormation,'edit'); 24 | break; 25 | 26 | case 'save': 27 | $formation->set_values($_REQUEST); 28 | $formation->save($ATMdb); 29 | _fiche($ATMdb,$formation,$planFormation,'view'); 30 | break; 31 | 32 | case 'view': 33 | _fiche($ATMdb,$formation,$planFormation,'view'); 34 | break; 35 | 36 | case 'delete': 37 | _liste($planFormation); 38 | break; 39 | } 40 | } 41 | elseif(isset($_REQUEST['id'])) 42 | _fiche($ATMdb,$formation,$planFormation); 43 | else 44 | _liste($planFormation); 45 | 46 | $ATMdb->close(); 47 | 48 | 49 | function _liste(&$ATMdb,$planFormation) { 50 | header('Location: planFormation.php?id='.$planFormation->getId()); 51 | } 52 | 53 | function _fiche(&$ATMdb,&$formation,&$planFormation,$mode = 'view') { 54 | global $langs,$conf,$db,$user; 55 | 56 | llxHeader('', 'Formation'); 57 | 58 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 59 | $form->Set_typeaff($mode); 60 | 61 | echo $form->hidden('action', 'save'); 62 | echo $form->hidden('fk_formation_plan',$planFormation->getId()); 63 | 64 | //Chargement de la liste des Sessions de Formation associé à la Formation en cours 65 | $listeSessionFormation = $formation->getListeSessionFormation($ATMdb); 66 | 67 | $TBS=new TTemplateTBS(); 68 | print $TBS->render('./tpl/formationCompetence.tpl.php' 69 | ,array() 70 | ,array( 71 | 'formation'=>array( 72 | 'ID'=>$formation->rowid 73 | ,'libelle'=>$form->texte('','libelle', $formation->libelle,50,255,'','','-') 74 | ,'description'=>$form->zonetexte('','description',$formation->description,50) 75 | ,'budget'=>$form->texte('','budget',$formation->budget,10,255,'','') 76 | ,'budgetConsomme'=>$form->texte('','budget_consomme',$formation->budget_consomme,10,255,'','') 77 | ) 78 | ,'listeSessionFormation'=>array( 79 | 'liste' => $listeSessionFormation 80 | ) 81 | ,'view'=>array( 82 | 'mode'=>$mode 83 | ,'userRight'=>((int)$user->rights->ressource->ressource->createRessource) 84 | ,'head'=>dol_get_fiche_head(competencePrepareHead($planFormation,'formation'),'fiche','Formation') 85 | ,'onglet'=>dol_get_fiche_head(array(),'','Création de formation') 86 | ) 87 | ) 88 | ); 89 | 90 | echo $form->end_form(); 91 | 92 | llxFooter(); 93 | } -------------------------------------------------------------------------------- /tpl/cv.tpl.php: -------------------------------------------------------------------------------- 1 |
    2 | [cv.titre;strconv=no;protect=no] 3 |
    4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
    Date début[cv.date_debut;block=tr;strconv=no;protect=no]
    Date fin[cv.date_fin;strconv=no;protect=no]
    Libellé Expérience[cv.libelleExperience;strconv=no;protect=no]
    Description [cv.descriptionExperience;strconv=no;protect=no]
    Lieu Expérience[cv.lieuExperience;strconv=no;protect=no]
    26 |
    27 |

    28 | 29 | 30 | [newCompetence.hidden;strconv=no;protect=no] 31 | [newCompetence.fk_user_lignecv;strconv=no;protect=no] 32 | 33 | 34 | 35 | [onshow;block=begin;when [view.mode]=='edit'] 36 | 37 | [onshow;block=end] 38 | 39 | 40 | 41 | [onshow;block=begin;when [view.mode]=='edit'] 42 | 45 | [onshow;block=end] 46 | 47 | 48 | [onshow;block=begin;when [view.mode]=='edit'] 49 | 50 | 51 | 52 | 53 | 54 | [onshow;block=end] 55 |
    Compétences acquisesNiveau acquisAction
    [TCompetence.libelleCompetence;block=tr;strconv=no;protect=no][TCompetence.niveauCompetence;block=tr;strconv=no;protect=no] 43 | 44 |
    [newCompetence.libelleCompetence;strconv=no;protect=no][newCompetence.niveauCompetence;strconv=no;protect=no]
    56 |

    57 | 58 | [onshow;block=begin;when [view.mode]=='view'] 59 | 60 | [onshow;block=begin;when [view.mode]=='view'] 61 | Supprimer 62 | Annuler 63 | Modifier 64 | [onshow;block=end] 65 |
    66 | [onshow;block=end] 67 | 68 | 69 | [onshow;block=begin;when [view.mode]=='edit'] 70 | 71 | 72 |
    73 | 74 |     75 |
    76 | [onshow;block=end] 77 | -------------------------------------------------------------------------------- /productivite_liste.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 7 | 8 | $ATMdb=new TPDOdb; 9 | $productivite=new TRH_productivite; 10 | 11 | _liste($ATMdb, $productivite); 12 | 13 | function _liste(&$ATMdb, $productivite) { 14 | global $langs, $conf, $db, $user; 15 | llxHeader('','Liste des indices de productivité'); 16 | 17 | ////////////AFFICHAGE DES LIGNES DE REMUNERATION 18 | $r = new TSSRenderControler($productivite); 19 | $sql = 'SELECT rowid as "ID", indice as "Libellé", DATE_FORMAT(date_objectif, "%d-%m-%Y") as "Date objectif"'; 20 | $sql.=" FROM ".MAIN_DB_PREFIX."rh_productivite"; 21 | 22 | $TOrder = array('rowid'=>'ASC'); 23 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 24 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 25 | 26 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 27 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 28 | 29 | $r->liste($ATMdb, $sql, array( 30 | 'limit'=>array( 31 | 'page'=>$page 32 | ,'nbLine'=>'30' 33 | ) 34 | ,'link'=>array( 35 | //'Rémunération brute annuelle'=>'@val@' 36 | 'ID'=>'@val@' 37 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?'':'' 38 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?"":'' 39 | ) 40 | ,'translate'=>array( 41 | 42 | ) 43 | ,'hide'=>array('DateCre', 'fk_user') 44 | ,'type'=>array() 45 | ,'liste'=>array( 46 | 'titre'=>'Visualisation des indices de productivité' 47 | ,'image'=>img_picto('','title.png', '', 0) 48 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 49 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 50 | ,'noheader'=> (int)isset($_REQUEST['socid']) 51 | ,'messageNothing'=>"Aucun type de poste" 52 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 53 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 54 | ,'picto_search'=>'' 55 | ) 56 | ,'title'=>array( 57 | 'label'=>'Type poste' 58 | ,'date'=>'Numero convention' 59 | ,'indice'=>'Descriptif' 60 | ) 61 | ,'search'=>array( 62 | ) 63 | ,'orderBy'=>$TOrder 64 | 65 | )); 66 | if($user->rights->curriculumvitae->myactions->ajoutRemuneration==1){ 67 | ?> 68 | 69 | 72 | 73 | end(); 78 | 79 | llxFooter(); 80 | } -------------------------------------------------------------------------------- /script/importsBSI/importRem.php: -------------------------------------------------------------------------------- 1 |
    '; 16 | 17 | $TTrigramme = array(); 18 | $sql="SELECT rowid, login FROM ".MAIN_DB_PREFIX."user WHERE entity IN (0,".$conf->entity.")"; 19 | $ATMdb->Execute($sql); 20 | while($row = $ATMdb->Get_line()) { 21 | $TTrigramme[strtolower($row->login)] = $row->rowid; 22 | } 23 | //print_r($TTrigramme);exit(); 24 | 25 | 26 | 27 | $nomFichier = "Sal_rem_130606"; 28 | echo 'Traitement du fichier '.$nomFichier.' :
    '; 29 | $cpt = 0; 30 | //début du parsing 31 | $numLigne = 0; 32 | if (($handle = fopen("./".$nomFichier, "r")) !== FALSE) { 33 | while(($data = fgetcsv($handle, 0,'\r')) != false){ 34 | //echo 'Traitement de la ligne '.$numLigne.'...'; 35 | 36 | $infos = explode(';', str_replace('"', '', $data[0])) ; 37 | print_r($infos); 38 | echo '
    '; 39 | $trigramme = strtolower($infos[0]); 40 | $deb = mktime(0,0,0,substr($infos[1],5,2), substr($infos[1],8,2), substr($infos[1], 0,4)); 41 | $fin = mktime(0,0,0,substr($infos[2],5,2), substr($infos[2],8,2), substr($infos[2], 0,4)); 42 | 43 | if (!empty($TTrigramme[$trigramme])){ 44 | $rem = new TRH_remuneration; 45 | $rem->load_by_user_and_dates($ATMdb, $TTrigramme[$trigramme], $deb, $fin); 46 | 47 | $rem->fk_user = $TTrigramme[$trigramme]; 48 | 49 | $rem->date_debutRemuneration = $deb; 50 | $rem->date_finRemuneration = $fin; 51 | $r = 3; 52 | $rem->bruteAnnuelle = $infos[$r];$r++; 53 | $rem->salaireMensuel = $infos[$r];$r++; 54 | $rem->primeAnciennete = $infos[$r];$r++; 55 | $rem->primeNoel = $infos[$r];$r++; 56 | $rem->commission = $infos[$r];$r++; 57 | $rem->autre = $infos[$r];$r++; 58 | 59 | $rem->participation = $infos[$r];$r++; 60 | 61 | 62 | $rem->prevoyancePartSalariale = $infos[$r];$r++; 63 | $rem->retraitePartSalariale = $infos[$r];$r++; 64 | $rem->mutuellePartSalariale = $infos[$r];$r++; 65 | $rem->urssafPartSalariale = $infos[$r];$r++; 66 | $rem->diversPartSalariale = $infos[$r];$r++; 67 | 68 | $rem->prevoyancePartPatronale = $infos[$r];$r++; 69 | $rem->retraitePartPatronale = $infos[$r];$r++; 70 | $rem->mutuellePartPatronale = $infos[$r];$r++; 71 | $rem->urssafPartPatronale = $infos[$r];$r++; 72 | $rem->diversPartPatronale = $infos[$r];$r++; 73 | 74 | 75 | $rem->entity = $conf->entity; 76 | $rem->save($ATMdb); 77 | $cpt++; 78 | } 79 | else{ 80 | echo "Attention : ".$trigramme." non trouvé. La rem de la ligne ".$numLigne." n'a pas été importée.
    "; 81 | } 82 | $numLigne++; 83 | } 84 | } 85 | 86 | 87 | //Fin du code PHP : Afficher le temps d'éxecution 88 | $timeend=microtime(true); 89 | $page_load_time = number_format($timeend-$timestart, 3); 90 | echo $cpt." rem importées.
    "; 91 | echo 'Fin du traitement. Durée : '.$page_load_time . " sec

    "; 92 | $ATMdb->close(); 93 | 94 | 95 | -------------------------------------------------------------------------------- /liste_types_postes.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 7 | 8 | $ATMdb=new TPDOdb; 9 | $fiche_poste=new TRH_fichePoste; 10 | 11 | _liste($ATMdb, $fiche_poste); 12 | 13 | function _liste(&$ATMdb, $fiche_poste) { 14 | global $langs, $conf, $db, $user; 15 | llxHeader('','Liste des types de postes'); 16 | 17 | $fuser = new User($db); 18 | $fuser->fetch($_REQUEST['fk_user']); 19 | $fuser->getrights(); 20 | 21 | ////////////AFFICHAGE DES LIGNES DE REMUNERATION 22 | $r = new TSSRenderControler($fiche_poste); 23 | $sql = "SELECT rowid as 'ID', type_poste as 'Type poste', numero_convention as 'Numero convention', descriptif as 'Descriptif'"; 24 | $sql.=" FROM ".MAIN_DB_PREFIX."rh_fiche_poste"; 25 | 26 | $TOrder = array('rowid'=>'ASC'); 27 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 28 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 29 | 30 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 31 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 32 | 33 | $r->liste($ATMdb, $sql, array( 34 | 'limit'=>array( 35 | 'page'=>$page 36 | ,'nbLine'=>'30' 37 | ) 38 | ,'link'=>array( 39 | //'Rémunération brute annuelle'=>'@val@' 40 | 'ID'=>'@val@' 41 | ,'Type poste'=>'@val@' 42 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?'':'' 43 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?"":'' 44 | ) 45 | ,'translate'=>array( 46 | 47 | ) 48 | ,'hide'=>array('DateCre', 'fk_user') 49 | ,'type'=>array() 50 | ,'liste'=>array( 51 | 'titre'=>'Visualisation des types de postes' 52 | ,'image'=>img_picto('','title.png', '', 0) 53 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 54 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 55 | ,'noheader'=> (int)isset($_REQUEST['socid']) 56 | ,'messageNothing'=>"Aucun type de poste" 57 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 58 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 59 | ,'picto_search'=>'' 60 | ) 61 | ,'title'=>array( 62 | 'type_poste'=>'Type poste' 63 | ,'numero_convention'=>'Numero convention' 64 | ,'descriptif'=>'Descriptif' 65 | ) 66 | ,'search'=>array( 67 | ) 68 | ,'orderBy'=>$TOrder 69 | 70 | )); 71 | if($user->rights->curriculumvitae->poste->admin){ 72 | ?> 73 | 76 | end(); 81 | 82 | llxFooter(); 83 | } -------------------------------------------------------------------------------- /test/ScriptTest.php: -------------------------------------------------------------------------------- 1 | 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | * or see http://www.gnu.org/ 17 | */ 18 | 19 | /** 20 | * \file test/phpunit/UserTest.php 21 | * \ingroup test 22 | * \brief PHPUnit test 23 | * \remarks To run this script as CLI: phpunit filename.php 24 | */ 25 | 26 | 27 | 28 | /** 29 | * Class for PHPUnit tests 30 | * 31 | * @backupGlobals disabled 32 | * @backupStaticAttributes enabled 33 | * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. 34 | */ 35 | class ScriptTest extends PHPUnit_Framework_TestCase 36 | { 37 | 38 | /*public function testInterface(){ 39 | global $ATMdb; 40 | 41 | $fk_user=3; 42 | $date_debut=date('Y').'-01-02'; 43 | $date_fin=date('Y').'-12-30'; 44 | 45 | // ---- Formations 46 | $url = DOLHTTP."/competence/script/interface.php?get=formation&fk_user=".$fk_user."&date_debut=".$date_debut."&date_fin=".$date_fin; 47 | $resultForm = file_get_contents($url); 48 | $TForm = unserialize($resultForm); 49 | $this->assertNotEmpty($TForm); 50 | 51 | // ---- Rémunérations 52 | $url = DOLHTTP."/competence/script/interface.php?get=remuneration&fk_user=".$fk_user."&date_debut=".$date_debut."&date_fin=".$date_fin; 53 | $resultRem = file_get_contents($url); 54 | $TRem = unserialize($resultRem); 55 | $this->assertNotEmpty($TRem); 56 | 57 | // ---- DIF 58 | $url = DOLHTTP."/competence/script/interface.php?get=dif&fk_user=".$fk_user."&date_debut=".$date_debut."&date_fin=".$date_fin; 59 | $resultDif = file_get_contents($url); 60 | $TDif = unserialize($resultDif); 61 | $this->assertNotEmpty($TDif); 62 | 63 | print __METHOD__."\n"; 64 | }*/ 65 | 66 | public function testFormation(){ 67 | global $ATMdb; 68 | 69 | $fk_user=3; 70 | $date_debut=date('Y').'-01-02'; 71 | $date_fin=date('Y').'-12-30'; 72 | 73 | $result = _formation($ATMdb, $fk_user, $date_debut, $date_fin); 74 | $this->assertNotNull($result); 75 | 76 | print __METHOD__."\n"; 77 | } 78 | 79 | public function testRemuneration(){ 80 | global $ATMdb; 81 | 82 | $fk_user=3; 83 | $date_debut=date('Y').'-01-02'; 84 | $date_fin=date('Y').'-12-30'; 85 | 86 | $result = _remuneration($ATMdb, $fk_user, $date_debut, $date_fin); 87 | $this->assertNotNull($result); 88 | 89 | print __METHOD__."\n"; 90 | } 91 | 92 | public function testDif(){ 93 | global $ATMdb; 94 | 95 | $fk_user=3; 96 | $date_debut=date('Y').'-01-02'; 97 | $date_fin=date('Y').'-12-30'; 98 | 99 | $result = _dif($ATMdb, $fk_user, $date_debut, $date_fin); 100 | $this->assertNotNull($result); 101 | 102 | print __METHOD__."\n"; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /grille_salaire.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 10 | 11 | $ATMdb=new TPDOdb; 12 | $grille_salaire = new TRH_grilleSalaire; 13 | 14 | if(isset($_REQUEST['action'])) { 15 | 16 | switch($_REQUEST['action']) { 17 | 18 | case 'save': 19 | $grille_salaire->load($ATMdb, $_REQUEST['id']); 20 | $grille_salaire->set_values($_REQUEST); 21 | 22 | $mesg = '
    Grille de salaire enregistrée avec succès
    '; 23 | 24 | $grille_salaire->save($ATMdb); 25 | $grille_salaire->load($ATMdb, $_REQUEST['id']); 26 | _fiche($ATMdb, $grille_salaire, 'view'); 27 | break; 28 | 29 | case 'delete': 30 | $grille_salaire->load($ATMdb, $_REQUEST['id']); 31 | $grille_salaire->delete($ATMdb, $_REQUEST['id']); 32 | $mesg = '
    Grille de salaire enregistrée avec succès
    '; 33 | 34 | $grille_salaire->save($ATMdb); 35 | ?> 36 | 39 | load($ATMdb, $_REQUEST['id']); 44 | _fiche($ATMdb, $grille_salaire, 'view'); 45 | break; 46 | 47 | case 'edit': 48 | $grille_salaire->load($ATMdb, $_REQUEST['id']); 49 | _fiche($ATMdb, $grille_salaire); 50 | break; 51 | 52 | default: 53 | _fiche($ATMdb, $grille_salaire); 54 | break; 55 | 56 | } 57 | 58 | } 59 | 60 | function _fiche(&$ATMdb, $grille_salaire, $mode="edit") { 61 | 62 | global $db,$user,$langs,$conf; 63 | llxHeader('','Types de postes'); 64 | 65 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 66 | $form->Set_typeaff($mode); 67 | 68 | echo $form->hidden('id', $grille_salaire->getId()); 69 | echo $form->hidden('action', 'save'); 70 | echo $form->hidden('fk_type_poste', $_REQUEST['fk_type_poste']); 71 | 72 | $TBS=new TTemplateTBS(); 73 | 74 | print $TBS->render('./tpl/grille_salaire.tpl.php' 75 | ,array() 76 | ,array( 77 | 'grille_salaire'=>array( 78 | 'id'=>$grille_salaire->getId() 79 | ,'nb_annees_anciennete'=>$form->texte('', 'nb_annees_anciennete', $grille_salaire->nb_annees_anciennete, 20,255,'','','à saisir') 80 | ,'montant'=>$form->texte('', 'montant', $grille_salaire->montant, 20,255,'','','à saisir') 81 | ,'salaire_min'=>$form->texte('', 'salaire_min', $grille_salaire->salaire_min, 20,255,'','','à saisir') 82 | ,'salaire_max'=>$form->texte('', 'salaire_max', $grille_salaire->salaire_max, 20,255,'','','à saisir') 83 | ,'salaire_conventionnel'=>$form->texte('', 'salaire_conventionnel', $grille_salaire->salaire_conventionnel, 20,255,'','','à saisir') 84 | ,'salaire_constate'=>$form->texte('', 'salaire_constate', $grille_salaire->salaire_constate, 20,255,'','','à saisir') 85 | ,'id_fiche_poste'=>!empty($grille_salaire->fk_type_poste)?$grille_salaire->fk_type_poste:$_REQUEST['fk_type_poste'] 86 | //,'supprimable'=>$form->hidden('supprimable', 1) 87 | ) 88 | ,'view'=>array( 89 | 'mode'=>$mode 90 | ,'head'=>dol_get_fiche_head(array() , '', 'Création d\'un type de poste') 91 | ,'action'=>$_REQUEST['action'] 92 | ) 93 | 94 | ) 95 | 96 | ); 97 | 98 | } -------------------------------------------------------------------------------- /script/importsBSI/importInfo.php: -------------------------------------------------------------------------------- 1 |
    '; 16 | 17 | $TTrigramme = array(); 18 | $sql="SELECT rowid, login FROM ".MAIN_DB_PREFIX."user WHERE entity IN (0,".$conf->entity.")"; 19 | $ATMdb->Execute($sql); 20 | while($row = $ATMdb->Get_line()) { 21 | $TTrigramme[strtolower($row->login)] = $row->rowid; 22 | } 23 | //print_r($TTrigramme);exit(); 24 | 25 | 26 | 27 | $nomFichier = "Sal_info_130606"; 28 | echo 'Traitement du fichier '.$nomFichier.' :
    '; 29 | $cpt = 0; 30 | //début du parsing 31 | $numLigne = 0; 32 | if (($handle = fopen("./".$nomFichier, "r")) !== FALSE) { 33 | while(($data = fgetcsv($handle, 0,'\r')) != false){ 34 | $infos = explode(';', str_replace('"', '', $data[0])) ; 35 | 36 | //print_r($infos);echo '
    '; 37 | 38 | $trigramme = strtolower($infos[0]); 39 | 40 | if (!empty($TTrigramme[$trigramme])){ 41 | //récupération des données 42 | $fk_user = $TTrigramme[$trigramme]; 43 | $r = 1; 44 | $ddn = $infos[$r];$r++; 45 | $sitFam = ucwords(htmlentities($infos[$r]));$r++; 46 | $nbEnfCharge = $infos[$r];$r++; 47 | $dda = $infos[$r];$r++; 48 | $horaire = $infos[$r];$r++; 49 | $statut = ucwords(htmlentities($infos[$r]));$r++; 50 | $niveau = $infos[$r];$r++; 51 | $contrat = $infos[$r];$r++; 52 | $r++; //la colonne affectation à un groupe, c'est pas ici 53 | $fonction = $infos[$r];$r++; 54 | 55 | 56 | //on regarde si une ligne de l'user existe déjà. 57 | $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."user_extrafields 58 | WHERE fk_object=".$TTrigramme[$trigramme]; 59 | $ATMdb->Execute($sql); 60 | if ($ATMdb->Get_line()) { 61 | //la ligne existe déjà : on fait un UPDATE 62 | $req = "UPDATE ".MAIN_DB_PREFIX."user_extrafields SET 63 | DDN='".$ddn."' 64 | ,SIT_FAM='".$sitFam."' 65 | ,NB_ENF_CHARGE=".$nbEnfCharge." 66 | ,DDA='".$dda."' 67 | ,HORAIRE='".$horaire."' 68 | ,STATUT='".$statut."' 69 | ,NIVEAU='".$niveau."' 70 | ,CONTRAT='".$contrat."' 71 | ,FONCTION='".$fonction." ' 72 | WHERE fk_object = ".$fk_user; 73 | } 74 | else{ 75 | //la ligne n'existe pas, on fait un INSERT 76 | "INSERT INTO llx_user_extrafields ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],[value-8],[value-9],[value-10],[value-11],[value-12],[value-13],[value-14],[value-15])"; 77 | $req = "INSERT INTO ".MAIN_DB_PREFIX."user_extrafields 78 | (fk_object, DDN, SIT_FAM, NB_ENF_CHARGE, DDA, HORAIRE, STATUT, NIVEAU, CONTRAT, FONCTION) VALUES 79 | (".$fk_user.",'".$ddn."','".$sitFam."',".$nbEnfCharge.",'".$dda."','".$horaire."','".$statut."','".$niveau."','".$contrat."','".$fonction."')"; 80 | } 81 | $ATMdb->Execute($req); 82 | $cpt++; 83 | } 84 | else{ 85 | echo "Attention : ".$trigramme." non trouvé. La rem de la ligne ".$numLigne." n'a pas été importée.
    "; 86 | } 87 | $numLigne++; 88 | } 89 | } 90 | 91 | 92 | //Fin du code PHP : Afficher le temps d'éxecution 93 | $timeend=microtime(true); 94 | $page_load_time = number_format($timeend-$timestart, 3); 95 | echo $cpt." infos utilisateurs importées.
    "; 96 | echo 'Fin du traitement. Durée : '.$page_load_time . " sec

    "; 97 | $ATMdb->close(); 98 | 99 | 100 | -------------------------------------------------------------------------------- /tpl/formation.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
    Réf.[user.id]
    Nom[user.lastname]
    Prénom[user.firstname]
    6 |
    7 |
    8 | [formation.titre;strconv=no;protect=no] 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
    Date débutDate finDate d'expiration de la formation
    [formation.date_debut;block=tr;strconv=no;protect=no][formation.date_fin;strconv=no;protect=no][formation.date_formationEcheance;strconv=no;protect=no]
    22 | 23 |

    24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
    Coût de la formation[formation.coutFormation;strconv=no;protect=no]€
    Montant pris en charge par l'organisme[formation.montantOrganisme;strconv=no;protect=no]€
    Montant pris en charge par l'entreprise[formation.montantEntreprise;strconv=no;protect=no]€
    38 | 39 |

    40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
    Libellé de la formation[formation.libelleFormation;strconv=no;protect=no]
    Lieu de la formation[formation.lieuFormation;strconv=no;protect=no]
    Commentaires[formation.commentaireFormation;strconv=no;protect=no]
    54 | 55 |

    56 | 57 | 58 | [newCompetence.hidden;strconv=no;protect=no] 59 | [newCompetence.fk_user_formation;strconv=no;protect=no] 60 | 61 | 62 | 63 | [onshow;block=begin;when [view.mode]=='edit'] 64 | 65 | [onshow;block=end] 66 | 67 | 68 | 69 | [onshow;block=begin;when [view.mode]=='edit'] 70 | 73 | [onshow;block=end] 74 | 75 | 76 | [onshow;block=begin;when [view.mode]=='edit'] 77 | 78 | 79 | 80 | 81 | 82 | [onshow;block=end] 83 |
    Compétences acquisesNiveau acquisAction
    [TCompetence.libelleCompetence;block=tr;strconv=no;protect=no][TCompetence.niveauCompetence;block=tr;strconv=no;protect=no] 71 | 72 |
    [newCompetence.libelleCompetence;strconv=no;protect=no][newCompetence.niveauCompetence;strconv=no;protect=no]
    84 |

    85 | 86 | 87 | [onshow;block=begin;when [view.mode]=='view'] 88 | Supprimer 89 | Annuler 90 | Modifier 91 | 92 | [onshow;block=end] 93 |
    94 |
    95 | 96 | [onshow;block=begin;when [view.mode]=='edit'] 97 |
    98 | 99 |     100 |
    101 | [onshow;block=end] 102 | -------------------------------------------------------------------------------- /productivite_user_indice.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 11 | 12 | $ATMdb=new TPDOdb; 13 | $productivite_indice = new TRH_productiviteIndice; 14 | 15 | if(isset($_REQUEST['action'])) { 16 | 17 | switch($_REQUEST['action']) { 18 | 19 | case 'save': 20 | 21 | $productivite_indice->load($ATMdb, $_REQUEST['id']); 22 | 23 | $productivite_indice->set_values($_REQUEST); 24 | 25 | $mesg = '
    Indice de productivité enregistré avec succès
    '; 26 | 27 | $productivite_indice->save($ATMdb); 28 | $productivite_indice->load($ATMdb, $_REQUEST['id']); 29 | _fiche($ATMdb, $productivite_indice, 'view'); 30 | break; 31 | 32 | case 'delete': 33 | $productivite_indice->load($ATMdb, $_REQUEST['id']); 34 | $productivite_indice->delete($ATMdb, $_REQUEST['id']); 35 | 36 | ?> 37 | 42 | load($ATMdb, $_REQUEST['id']); 48 | _fiche($ATMdb, $productivite_indice, 'view'); 49 | break; 50 | 51 | case 'edit': 52 | $productivite_indice->load($ATMdb, $_REQUEST['id']); 53 | _fiche($ATMdb, $productivite_indice); 54 | break; 55 | 56 | default: 57 | _fiche($ATMdb, $productivite_indice); 58 | break; 59 | 60 | } 61 | 62 | } 63 | 64 | function _fiche(&$ATMdb, $productivite_indice, $mode="edit") { 65 | 66 | global $db,$user,$langs,$conf; 67 | llxHeader('','Données de productivité'); 68 | 69 | $fuser = new User($db); 70 | $fuser->fetch($_REQUEST['fk_user']); 71 | $fuser->getrights(); 72 | 73 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 74 | $form->Set_typeaff($mode); 75 | 76 | echo $form->hidden('id', $productivite_indice->getId()); 77 | echo $form->hidden('action', 'save'); 78 | echo $form->hidden('fk_user', $fuser->id); 79 | echo $form->hidden('fk_productivite', $_REQUEST['fk_productivite']); 80 | 81 | $TBS=new TTemplateTBS(); 82 | 83 | print $TBS->render('./tpl/productivite_user_indice.tpl.php' 84 | ,array() 85 | ,array( 86 | 'user'=>array( 87 | 'id'=>$fuser->id 88 | ,'lastname'=>$fuser->lastname 89 | ,'firstname'=>$fuser->firstname 90 | ) 91 | ,'productivite_indice'=>array( 92 | 'id'=>$productivite_indice->getId() 93 | ,'date_indice'=>$form->calendrier('', 'date_indice', $productivite_indice->date_indice, 12) 94 | ,'fk_productivite'=>$_REQUEST['fk_productivite'] 95 | //,'date_objectif'=>$form->calendrier('', 'date_objectif', $productivite_indice->date_objectif, 12) 96 | ,'indice'=>$form->texteRO('', 'indice', _getLibIndice($_REQUEST['fk_productivite']), 20,255) 97 | ,'chiffre_realise'=>$form->texte('', 'chiffre_realise', $productivite_indice->chiffre_realise, 20,255,'','','à saisir') 98 | //,'label'=>$form->texte('', 'label', $productivite_indice->label, 20,255,'','','à saisir') 99 | //,'supprimable'=>$form->hidden('supprimable', 1) 100 | ) 101 | ,'view'=>array( 102 | 'mode'=>$mode 103 | ,'action'=>$_REQUEST['action'] 104 | ,'head'=>dol_get_fiche_head(competencePrepareHead($productivite_indice, 'chiffre_user'),'fiche','Chiffre utilisateur') 105 | ,'onglet'=>dol_get_fiche_head(array(),'','Edition chiffre réalisé') 106 | ) 107 | 108 | ) 109 | 110 | ); 111 | 112 | } 113 | 114 | function _getLibIndice($id_productivite) { 115 | 116 | global $db; 117 | 118 | $sql = "SELECT indice FROM ".MAIN_DB_PREFIX."rh_productivite_user WHERE rowid = ".$id_productivite; 119 | $resql = $db->query($sql); 120 | 121 | if($resql) { 122 | while($res = $db->fetch_object($resql)) { 123 | return $res->indice; 124 | } 125 | } 126 | 127 | } 128 | -------------------------------------------------------------------------------- /tpl/remuneration.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
    Réf.[user.id]
    Nom[user.lastname]
    Prénom[user.firstname]
    6 |
    7 | 8 |
    9 |
    10 | 11 |

    Description de vos rémunérations

    12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
    Commentaire
    [remuneration.commentaire;block=tr;strconv=no;protect=no]
    20 |

    21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
    Date d'entrée dans l'entreprise
    [remuneration.date_entreeEntreprise;block=tr;strconv=no;protect=no]
    29 |

    30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
    Date début rémunérationDate fin rémunérationRémunération brute annuelleSalaire MensuelNet à payer
    [remuneration.date_debutRemuneration;block=tr;strconv=no;protect=no][remuneration.date_finRemuneration;block=tr;strconv=no;protect=no][remuneration.bruteAnnuelle;strconv=no;protect=no]€[remuneration.salaireMensuel;strconv=no;protect=no]€[remuneration.net_a_payer;strconv=no;protect=no]€
    47 |

    48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
    Prime d'anciennetéPrime de NoëlCommissionParticipationAutre
    [remuneration.primeAnciennete;strconv=no;protect=no]€[remuneration.primeNoel;strconv=no;protect=no]€[remuneration.commission;strconv=no;protect=no]€[remuneration.participation;strconv=no;protect=no]€[remuneration.autre;strconv=no;protect=no]€
    64 |

    65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
    Nombre d'heures/moisANCout globalCumul heures travailléesCumul heures supHS
    [remuneration.nbHeuresMois;strconv=no;protect=no][remuneration.an;strconv=no;protect=no][remuneration.coutGlobal;strconv=no;protect=no]€[remuneration.cumHeureTrav;strconv=no;protect=no][remuneration.cumHSup;strconv=no;protect=no][remuneration.HS;strconv=no;protect=no]
    83 |

    84 |

    Charges

    85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
    Montant
    [remuneration.charges;block=tr;strconv=no;protect=no]€
    93 |
    94 | 95 | 96 | [onshow;block=begin;when [view.mode]=='view'] 97 | Retour 98 | [onshow;block=begin;when [userCourant.ajoutRem]=='1'] 99 | Modifier 100 | Supprimer 101 | [onshow;block=end] 102 | [onshow;block=end] 103 |
    104 |
    105 | 106 |
    107 | 108 | 109 | 110 | [onshow;block=begin;when [view.mode]=='edit'] 111 |
    112 | 113 |     114 |
    115 | [onshow;block=end] 116 | 117 | -------------------------------------------------------------------------------- /planFormation.php: -------------------------------------------------------------------------------- 1 | load('competence@competence'); 7 | 8 | $ATMdb=new TPDOdb; 9 | $planFormation = new TRH_formation_plan; 10 | 11 | $action = __get('action','list'); 12 | 13 | if(isset($_REQUEST['action'])) { 14 | switch($_REQUEST['action']) { 15 | case 'new': 16 | $planFormation->set_values($_REQUEST); 17 | _fiche($ATMdb,$planFormation,'new'); 18 | break; 19 | 20 | case 'edit': 21 | $planFormation->load($ATMdb, __get('id',0,'int')); 22 | 23 | _fiche($ATMdb,$planFormation,'edit'); 24 | break; 25 | 26 | case 'save': 27 | $planFormation->load($ATMdb, __get('id',0,'int')); 28 | 29 | $planFormation->set_values($_REQUEST); 30 | $planFormation->save($ATMdb); 31 | _fiche($ATMdb,$planFormation,'view'); 32 | break; 33 | 34 | case 'view': 35 | $planFormation->load($ATMdb, __get('id',0,'int')); 36 | 37 | _fiche($ATMdb,$planFormation,'view'); 38 | break; 39 | 40 | case 'delete': 41 | $planFormation->load($ATMdb, __get('id',0,'int')); 42 | 43 | $planFormation->delete($ATMdb); 44 | _liste($ATMdb,$planFormation,'view'); 45 | break; 46 | case 'list': 47 | _liste($ATMdb,$planFormation,'view'); 48 | break; 49 | } 50 | } 51 | 52 | $ATMdb->close(); 53 | 54 | 55 | function _liste(&$ATMdb,$planFormation) { 56 | global $langs,$conf,$db,$user; 57 | 58 | llxHeader('','Plan de Formation'); 59 | print dol_get_fiche_head(array() , '', 'Plan de Formation'); 60 | 61 | $r = new TSSRenderControler($planFormation); 62 | 63 | $sql = "SELECT fp.rowid AS 'IdPlan', fp.libelle AS 'LibellePlan', fp.description AS 'DescriptionPlan', fp.budget AS 'BudgetPlan' 64 | FROM ".MAIN_DB_PREFIX."rh_formation_plan AS fp 65 | ORDER BY fp.rowid ASC"; 66 | 67 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 68 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 69 | $r->liste($ATMdb, $sql, array( 70 | 'limit'=>array( 71 | 'page'=>$page 72 | ,'nbLine'=>'50' 73 | ) 74 | ,'hide'=>array('IdPlan') 75 | ,'type'=>array('LibellePlan'=>'string') 76 | ,'link'=>array( 77 | 'LibellePlan'=>'@val@' 78 | ) 79 | ,'liste'=>array( 80 | 'titre'=>'Liste des PLans de Formations' 81 | ,'image'=>img_picto('','title.png', '', 0) 82 | ,'picto_precedent'=>img_picto('','previous.png', '', 0) 83 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 84 | ,'noheader'=> (int)isset($_REQUEST['socid']) 85 | ,'messageNothing'=>"Il n'y aucun plan à afficher" 86 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 87 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 88 | ,'picto_search'=>'' 89 | ) 90 | ,'title'=>array( 91 | 'LibellePlan'=>'Libellé' 92 | ,'DescriptionPlan'=>'Description' 93 | ,'BudgetPlan'=> 'Budget générale' 94 | ) 95 | ,'search'=>array( 96 | 'LibellePlan'=>true 97 | ,'BudgetPlan'=>true 98 | ) 99 | )); 100 | 101 | llxFooter(); 102 | } 103 | 104 | function _fiche(&$ATMdb,&$planFormation,$mode = 'view') { 105 | global $langs,$conf,$db,$user; 106 | 107 | llxHeader('', 'Plan de Formation'); 108 | 109 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 110 | $form->Set_typeaff($mode); 111 | 112 | if($mode=="edit") 113 | echo $form->hidden('id',$planFormation->getId()); 114 | echo $form->hidden('action', 'save'); 115 | 116 | //Chargement de la liste des Formation associé au plan 117 | $listeFormation = $planFormation->getListeFormation($ATMdb); 118 | 119 | $TBS=new TTemplateTBS(); 120 | print $TBS->render('./tpl/planFormation.tpl.php' 121 | ,array() 122 | ,array( 123 | 'planFormation'=>array( 124 | 'ID'=>$planFormation->rowid 125 | ,'libelle'=>$form->texte('','libelle', $planFormation->libelle,50,255,'','','-') 126 | ,'description'=>$form->zonetexte('','description',$planFormation->description,50) 127 | ,'date_debut'=>$form->calendrier('','date_debut', $planFormation->date_debut,12, 12) 128 | ,'date_fin'=>$form->calendrier('','date_fin', $planFormation->date_fin,12, 12) 129 | ,'budget'=>$form->texte('','budget',$planFormation->budget,10,255,'','') 130 | ,'budget_opca'=>$planFormation->budget_opca 131 | ,'budget_final'=>$planFormation->budget_final 132 | ) 133 | ,'listeFormation'=>array( 134 | 'liste' => $listeFormation 135 | ) 136 | ,'view'=>array( 137 | 'mode'=>$mode 138 | ,'userRight'=>((int)$user->rights->ressource->ressource->createRessource) 139 | ,'head'=>dol_get_fiche_head(competencePrepareHead($planFormation,'planFormation'),'fiche','Plan de Formation') 140 | ,'onglet'=>dol_get_fiche_head(array(),'','Plan de formation') 141 | ) 142 | ) 143 | ); 144 | 145 | echo $form->end_form(); 146 | 147 | llxFooter(); 148 | } -------------------------------------------------------------------------------- /class/productivite.class.php: -------------------------------------------------------------------------------- 1 | "" 24 | ,"login"=>"login" 25 | ,'date_indice'=>'date_indice' 26 | ); 27 | 28 | $sql = "SELECT rowid, indice "; 29 | $sql.= "FROM ".MAIN_DB_PREFIX."rh_productivite "; 30 | $resql = $db->query($sql); 31 | 32 | while($res = $db->fetch_object($resql)) { 33 | 34 | $TIndices[$res->rowid] = $res->indice; 35 | 36 | } 37 | 38 | return $TIndices; 39 | 40 | } 41 | 42 | static function get_libelle_indice($id_indice) { 43 | 44 | global $db; 45 | 46 | $sql = "SELECT indice "; 47 | $sql.= "FROM ".MAIN_DB_PREFIX."rh_productivite "; 48 | $sql.= "WHERE rowid = ".$id_indice; 49 | 50 | $resql = $db->query($sql); 51 | 52 | $res = $db->fetch_object($resql); 53 | 54 | return $res->indice; 55 | 56 | } 57 | 58 | } 59 | 60 | 61 | class TRH_productiviteUser extends TObjetStd { 62 | function __construct() { 63 | 64 | parent::set_table(MAIN_DB_PREFIX.'rh_productivite_user'); 65 | parent::add_champs('date_objectif','type=date;'); 66 | parent::add_champs('indice'); 67 | 68 | parent::add_champs('objectif','type=float;'); 69 | 70 | 71 | parent::add_champs('fk_user,fk_productivite','type=entier;index;'); 72 | 73 | parent::_init_vars(); 74 | parent::start(); 75 | } 76 | 77 | 78 | function load_by_user(&$ATMdb, $fk_user, $fk_productivite){ 79 | $sql="SELECT rowid FROM ".$this->get_table()." 80 | WHERE fk_user=".$fk_user." AND fk_productivite=".$fk_productivite; 81 | $ATMdb->Execute($sql); 82 | if ($ATMdb->Get_line()) { 83 | return $this->load($ATMdb, $ATMdb->Get_field('rowid')); 84 | } 85 | return false; 86 | 87 | } 88 | 89 | function delete(&$ATMdb) { 90 | 91 | // On récupère les chiffres réalisés par cet utilisateur sur cet indice pour les supprimer 92 | $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."rh_productivite_indice 93 | WHERE fk_user=".$this->fk_user." AND fk_productivite=".$this->fk_productivite; 94 | 95 | $TChiffres_user = TRequeteCore::get_keyval_by_sql($ATMdb, $sql, 'rowid', 'rowid'); 96 | 97 | $ATMdb->Execute($sql); 98 | foreach ($TChiffres_user as $id_chiffre) { 99 | 100 | $obj = new TRH_productiviteIndice; 101 | $obj->load($ATMdb, $id_chiffre); 102 | $obj->delete($ATMdb); 103 | 104 | } 105 | 106 | parent::delete($ATMdb); 107 | 108 | } 109 | 110 | static function existe_indice_user($id_productivite, $id_user) { 111 | 112 | global $db; 113 | 114 | $sql = "SELECT rowid "; 115 | $sql.= "FROM ".MAIN_DB_PREFIX."rh_productivite_user "; 116 | $sql.= "WHERE fk_productivite = ".$id_productivite." "; 117 | $sql.= "AND fk_user = ".$id_user; 118 | $resql = $db->query($sql); 119 | 120 | if($resql) { 121 | while($res = $db->fetch_object($resql)) 122 | return true; 123 | } 124 | 125 | return false; 126 | 127 | } 128 | 129 | static function get_array_indices_user($id_user) { 130 | 131 | global $db; 132 | 133 | $TIndicesuser = array(); 134 | 135 | $sql = "SELECT DISTINCT indice "; 136 | $sql.= "FROM ".MAIN_DB_PREFIX."rh_productivite_indice "; 137 | $sql.= "WHERE fk_user = ".$id_user; 138 | $resql = $db->query($sql); 139 | if ($resql) { 140 | while($res = $db->fetch_object($resql)) { 141 | 142 | $TIndicesuser[] = $res->indice; 143 | 144 | } 145 | }else { 146 | setEventMessage($db->lasterror,'errors'); 147 | } 148 | 149 | return $TIndicesuser; 150 | 151 | } 152 | 153 | } 154 | 155 | 156 | class TRH_productiviteIndice extends TObjetStd { 157 | function __construct() { 158 | 159 | parent::set_table(MAIN_DB_PREFIX.'rh_productivite_indice'); 160 | parent::add_champs('date_indice','type=date;'); 161 | parent::add_champs('indice'); 162 | 163 | parent::add_champs('chiffre_realise','type=float;'); 164 | 165 | parent::add_champs('fk_user,fk_productivite,entity','type=entier;'); 166 | 167 | parent::_init_vars(); 168 | parent::start(); 169 | } 170 | 171 | function existeIndice() { 172 | 173 | global $db; 174 | 175 | $sql = 'SELECT rowid 176 | FROM '.MAIN_DB_PREFIX.'rh_productivite_indice 177 | WHERE fk_user = '.$this->fk_user.' 178 | AND fk_productivite = '.$this->fk_productivite.' 179 | AND MONTH(date_indice) = '.date('m', $this->date_indice).' 180 | AND YEAR(date_indice) = '.date('Y', $this->date_indice).' 181 | LIMIT 1'; 182 | 183 | $resql = $db->query($sql); 184 | $res = $db->fetch_object($resql); 185 | 186 | return ($res->rowid > 0); 187 | 188 | } 189 | 190 | function save(&$ATMdb) { 191 | 192 | if(!$this->existeIndice()) parent::save($ATMdb); 193 | 194 | } 195 | 196 | } -------------------------------------------------------------------------------- /tpl/remuneration.tpl.php.1: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
    Réf.[user.id]
    Nom[user.lastname]
    Prénom[user.firstname]
    6 |
    7 | 8 |
    9 |
    10 | 11 |

    Description de vos rémunérations

    12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
    Commentaire
    [remuneration.commentaire;block=tr;strconv=no;protect=no]
    20 |

    21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
    Date d'entrée dans l'entreprise
    [remuneration.date_entreeEntreprise;block=tr;strconv=no;protect=no]
    29 |

    30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
    Date début rémunérationDate fin rémunérationRémunération brute annuelleSalaire Mensuel
    [remuneration.date_debutRemuneration;block=tr;strconv=no;protect=no][remuneration.date_finRemuneration;block=tr;strconv=no;protect=no][remuneration.bruteAnnuelle;strconv=no;protect=no]€[remuneration.salaireMensuel;strconv=no;protect=no]€
    44 |

    45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
    Prime d'anciennetéPrime de NoëlCommissionParticipationAutre
    [remuneration.primeAnciennete;strconv=no;protect=no]€[remuneration.primeNoel;strconv=no;protect=no]€[remuneration.commission;strconv=no;protect=no]€[remuneration.participation;strconv=no;protect=no]€[remuneration.autre;strconv=no;protect=no]€
    61 |

    62 |

    Vos cotisations

    63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
    Part SalarialePart Patronale
    PREVOYANCE[remuneration.prevoyancePartSalariale;block=tr;strconv=no;protect=no]€[remuneration.prevoyancePartPatronale;strconv=no;protect=no]€
    URSSAF[remuneration.urssafPartSalariale;strconv=no;protect=no]€[remuneration.urssafPartPatronale;strconv=no;protect=no]€
    RETRAITE[remuneration.retraitePartSalariale;strconv=no;protect=no]€[remuneration.retraitePartPatronale;strconv=no;protect=no]€
    MUTUELLE[remuneration.mutuellePartSalariale;strconv=no;protect=no]€[remuneration.mutuellePartPatronale;strconv=no;protect=no]€
    DIVERS[remuneration.diversPartSalariale;strconv=no;protect=no]€[remuneration.diversPartPatronale;strconv=no;protect=no]€
    TOTAL[remuneration.totalRemSalariale;strconv=no;protect=no]€[remuneration.totalRemPatronale;strconv=no;protect=no]€
    100 |
    101 | 102 | 103 | [onshow;block=begin;when [view.mode]=='view'] 104 | Retour 105 | [onshow;block=begin;when [userCourant.ajoutRem]=='1'] 106 | Modifier 107 | Supprimer 108 | [onshow;block=end] 109 | [onshow;block=end] 110 |
    111 |
    112 | 113 |
    114 | 115 | 116 | 117 | [onshow;block=begin;when [view.mode]=='edit'] 118 |
    119 | 120 |     121 |
    122 | [onshow;block=end] 123 | 124 | -------------------------------------------------------------------------------- /script/interface.php: -------------------------------------------------------------------------------- 1 | '".$date_debut."' AND f.date_fin<'".$date_fin."') 40 | ORDER BY f.date_fin DESC"; 41 | 42 | $k=1; 43 | $ATMdb->Execute($sql); 44 | while($ATMdb->Get_line()) { 45 | $TabRecapFormation[]=array('libelleFormation'=>$ATMdb->Get_field('libelleFormation'),'coutFormation'=>round($ATMdb->Get_field('coutFormation'),2),'montantOrganisme'=>round($ATMdb->Get_field('montantOrganisme'),2),'montantEntreprise'=>round($ATMdb->Get_field('montantEntreprise'),2)); 46 | } 47 | 48 | return $TabRecapFormation; 49 | } 50 | 51 | function _remuneration(&$ATMdb, $userId, $date_debut, $date_fin){ 52 | global $user, $conf; 53 | 54 | $TabRecapRem=array(); 55 | 56 | $sql="SELECT * 57 | FROM ".MAIN_DB_PREFIX."rh_remuneration as a 58 | WHERE a.fk_user=".$userId." 59 | AND (a.date_debutRemuneration<='".$date_debut."' AND a.date_finRemuneration>='".$date_fin."')"; 60 | 61 | $ATMdb->Execute($sql); 62 | while($ATMdb->Get_line()) { 63 | $TabRecapRem['date_debutRemuneration']=dol_print_date($ATMdb->Get_field('date_debutRemuneration'), '%d/%m/%Y'); 64 | $TabRecapRem['date_finRemuneration']=dol_print_date($ATMdb->Get_field('date_finRemuneration'), '%d/%m/%Y'); 65 | $TabRecapRem['bruteAnnuelle']=round($ATMdb->Get_field('bruteAnnuelle'),2); 66 | $TabRecapRem['salaireMensuel']=round($ATMdb->Get_field('salaireMensuel'),2); 67 | $TabRecapRem['primeAnciennete']=round($ATMdb->Get_field('primeAnciennete'),2); 68 | $TabRecapRem['participation']=round($ATMdb->Get_field('participation'),2); 69 | $TabRecapRem['autre']=round($ATMdb->Get_field('autre'),2); 70 | $TabRecapRem['prevoyancePartSalariale']=round($ATMdb->Get_field('prevoyancePartSalariale'),2); 71 | $TabRecapRem['prevoyancePartPatronale']=round($ATMdb->Get_field('prevoyancePartPatronale'),2); 72 | $TabRecapRem['urssafPartSalariale']=round($ATMdb->Get_field('urssafPartSalariale'),2); 73 | $TabRecapRem['urssafPartPatronale']=round($ATMdb->Get_field('urssafPartPatronale'),2); 74 | $TabRecapRem['retraitePartSalariale']=round($ATMdb->Get_field('retraitePartSalariale'),2); 75 | $TabRecapRem['retraitePartPatronale']=round($ATMdb->Get_field('retraitePartPatronale'),2); 76 | $TabRecapRem['mutuellePartSalariale']=round($ATMdb->Get_field('mutuellePartSalariale'),2); 77 | $TabRecapRem['mutuellePartPatronale']=round($ATMdb->Get_field('mutuellePartPatronale'),2); 78 | $TabRecapRem['diversPartSalariale']=round($ATMdb->Get_field('diversPartSalariale'),2); 79 | $TabRecapRem['diversPartPatronale']=round($ATMdb->Get_field('diversPartPatronale'),2); 80 | $TabRecapRem['totalPartSalariale']=round($ATMdb->Get_field('prevoyancePartSalariale')+$ATMdb->Get_field('urssafPartSalariale')+$ATMdb->Get_field('retraitePartSalariale')+$ATMdb->Get_field('mutuellePartSalariale')+$ATMdb->Get_field('diversPartSalariale'),2); 81 | $TabRecapRem['totalPartPatronale']=round($ATMdb->Get_field('prevoyancePartPatronale')+$ATMdb->Get_field('urssafPartPatronale')+$ATMdb->Get_field('retraitePartPatronale')+$ATMdb->Get_field('mutuellePartPatronale')+$ATMdb->Get_field('diversPartPatronale'),2); 82 | $TabRecapRem['pourcentagePartSalariale']=round(($TabRecapRem['totalPartSalariale']*100)/($TabRecapRem['totalPartSalariale']+$TabRecapRem['totalPartPatronale']),2); 83 | $TabRecapRem['totalPartFixe']=$TabRecapRem['bruteAnnuelle']+$TabRecapRem['primeAnciennete']; 84 | $TabRecapRem['totalPartVariable']=$TabRecapRem['participation']+$TabRecapRem['autre']; 85 | } 86 | 87 | return $TabRecapRem; 88 | } 89 | 90 | function _dif(&$ATMdb, $userId, $date_debut, $date_fin){ 91 | global $user, $conf; 92 | 93 | $TabRecapDif=array(); 94 | 95 | $sql="SELECT * 96 | FROM ".MAIN_DB_PREFIX."rh_dif as a 97 | WHERE a.fk_user=".$userId." 98 | AND a.annee = ".substr($date_fin,0,4); 99 | 100 | $ATMdb->Execute($sql); 101 | while($ATMdb->Get_line()) { 102 | $TabRecapDif['nb_heures_acquises']=$ATMdb->Get_field('nb_heures_acquises'); 103 | $TabRecapDif['nb_heures_prises']=$ATMdb->Get_field('nb_heures_prises'); 104 | $TabRecapDif['nb_heures_restantes']=$ATMdb->Get_field('nb_heures_restantes'); 105 | } 106 | 107 | return $TabRecapDif; 108 | } 109 | 110 | -------------------------------------------------------------------------------- /test/CompetenceTest.php: -------------------------------------------------------------------------------- 1 | 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | * or see http://www.gnu.org/ 17 | */ 18 | 19 | /** 20 | * \file test/phpunit/UserTest.php 21 | * \ingroup test 22 | * \brief PHPUnit test 23 | * \remarks To run this script as CLI: phpunit filename.php 24 | */ 25 | 26 | 27 | 28 | /** 29 | * Class for PHPUnit tests 30 | * 31 | * @backupGlobals disabled 32 | * @backupStaticAttributes enabled 33 | * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. 34 | */ 35 | class CompetenceTest extends PHPUnit_Framework_TestCase 36 | { 37 | 38 | public static function setUpBeforeClass() 39 | { 40 | print "Début du test du module Compétence.\n"; 41 | } 42 | 43 | public static function tearDownAfterClass() 44 | { 45 | print "\nFin du test du module Compétence.\n"; 46 | } 47 | 48 | public function testLoad_by_user_and_libelle_cv(){ 49 | global $cv, $ATMdb; 50 | 51 | $fk_user=3; 52 | $libelleExperience='Test'; 53 | 54 | $result = $cv->load_by_user_and_libelle($ATMdb, $fk_user, $libelleExperience); 55 | $this->assertNotNull($result); 56 | 57 | $result = $cv->load_by_user_and_libelle($ATMdb,0,''); 58 | $this->assertFalse($result); 59 | 60 | print __METHOD__."\n"; 61 | } 62 | 63 | public function testLoad_by_user_and_libelle_formation(){ 64 | global $formation, $ATMdb; 65 | 66 | $fk_user=3; 67 | $libelleFormation='Test'; 68 | 69 | $result = $formation->load_by_user_and_libelle($ATMdb, $fk_user, $libelleFormation); 70 | $this->assertNotNull($result); 71 | 72 | $result = $formation->load_by_user_and_libelle($ATMdb,0,''); 73 | $this->assertFalse($result); 74 | 75 | print __METHOD__."\n"; 76 | } 77 | 78 | public function testLoad_by_user_and_libelle_competence(){ 79 | global $competence, $ATMdb; 80 | 81 | $fk_user=3; 82 | $libelleCompetence='Test'; 83 | 84 | $result = $competence->load_by_user_and_libelle($ATMdb, $fk_user, $libelleCompetence); 85 | $this->assertNotNull($result); 86 | 87 | $result = $competence->load_by_user_and_libelle($ATMdb,0,''); 88 | $this->assertFalse($result); 89 | 90 | print __METHOD__."\n"; 91 | } 92 | 93 | public function testReplaceEspaceEnPourcentage(){ 94 | global $competence; 95 | 96 | $result = $competence->replaceEspaceEnPourcentage('Test1 ET Test2'); 97 | $this->assertNotEmpty($result); 98 | 99 | print __METHOD__."\n"; 100 | } 101 | 102 | public function testSeparerOu(){ 103 | global $competence; 104 | 105 | $result = $competence->separerOu('Test1%ou%Test2'); 106 | $this->assertNotNull($result); 107 | 108 | print __METHOD__."\n"; 109 | } 110 | 111 | public function testSeparerEt(){ 112 | global $competence; 113 | 114 | $result = $competence->separerEt('Test1%et%Test2'); 115 | $this->assertNotNull($result); 116 | 117 | print __METHOD__."\n"; 118 | } 119 | 120 | public function testRequeteRecherche(){ 121 | global $competence, $ATMdb; 122 | 123 | $recherche=array('Test1%et%Test2'); 124 | 125 | $result = $competence->requeteRecherche($ATMdb,$recherche); 126 | $this->assertNotEmpty($result); 127 | 128 | print __METHOD__."\n"; 129 | } 130 | 131 | public function testRequeteStatistique(){ 132 | global $competence, $ATMdb; 133 | 134 | $result = $competence->requeteStatistique($ATMdb,0,1,'Test'); 135 | $this->assertNotEmpty($result); 136 | 137 | $result = $competence->requeteStatistique($ATMdb,1,1,'Test'); 138 | $this->assertNotEmpty($result); 139 | 140 | $result = $competence->requeteStatistique($ATMdb,0,0,'Test'); 141 | $this->assertNotEmpty($result); 142 | 143 | $result = $competence->requeteStatistique($ATMdb,1,0,'Test'); 144 | $this->assertEmpty($result); 145 | 146 | print __METHOD__."\n"; 147 | } 148 | 149 | public function testLoad_by_user_and_dates(){ 150 | global $remuneration, $ATMdb; 151 | 152 | $fk_user=3; 153 | $date_debut=date('Y').'-01-02'; 154 | $date_debut=strtotime($date_debut); 155 | $date_fin=date('Y').'-12-30'; 156 | $date_fin=strtotime($date_fin); 157 | 158 | $result = $remuneration->load_by_user_and_dates($ATMdb, $fk_user, $date_debut, $date_fin); 159 | $this->assertNotNull($result); 160 | 161 | $result = $remuneration->load_by_user_and_dates($ATMdb,0,0,0); 162 | $this->assertFalse($result); 163 | 164 | print __METHOD__."\n"; 165 | } 166 | 167 | public function testLoad_by_user_and_annee(){ 168 | global $dif, $ATMdb; 169 | 170 | $fk_user=3; 171 | 172 | $result = $dif->load_by_user_and_annee($ATMdb, $fk_user, '2013'); 173 | $this->assertNotNull($result); 174 | 175 | $result = $dif->load_by_user_and_annee($ATMdb,0,''); 176 | $this->assertFalse($result); 177 | 178 | print __METHOD__."\n"; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /fiche_type_poste.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 10 | 11 | $ATMdb=new TPDOdb; 12 | $fiche_poste=new TRH_fichePoste; 13 | 14 | if(isset($_REQUEST['action'])) { 15 | 16 | switch($_REQUEST['action']) { 17 | 18 | case 'save': 19 | $fiche_poste->load($ATMdb, $_REQUEST['id']); 20 | $fiche_poste->set_values($_REQUEST); 21 | 22 | $mesg = '
    Type de poste enregistré avec succès
    '; 23 | 24 | $fiche_poste->save($ATMdb); 25 | //$fiche_poste->load($ATMdb, $_REQUEST['id']); 26 | _fiche($ATMdb, $fiche_poste, 'view'); 27 | break; 28 | 29 | case 'delete': 30 | $fiche_poste->load($ATMdb, $_REQUEST['id']); 31 | $fiche_poste->delete($ATMdb, $_REQUEST['id']); 32 | $mesg = '
    Type de poste enregistré avec succès
    '; 33 | 34 | $fiche_poste->save($ATMdb); 35 | ?> 36 | 39 | load($ATMdb, $_REQUEST['id']); 44 | _fiche($ATMdb, $fiche_poste, 'view'); 45 | break; 46 | 47 | case 'edit': 48 | $fiche_poste->load($ATMdb, $_REQUEST['id']); 49 | _fiche($ATMdb, $fiche_poste); 50 | break; 51 | 52 | default: 53 | _fiche($ATMdb, $fiche_poste); 54 | break; 55 | 56 | } 57 | 58 | } 59 | 60 | function _fiche(&$ATMdb, $fiche_poste, $mode="edit") { 61 | 62 | global $db,$user,$langs,$conf,$grille_salaire; 63 | llxHeader('','Types de postes'); 64 | 65 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 66 | $form->Set_typeaff($mode); 67 | 68 | echo $form->hidden('id', $fiche_poste->getId()); 69 | echo $form->hidden('action', 'save'); 70 | 71 | $TBS=new TTemplateTBS(); 72 | 73 | print $TBS->render('./tpl/fiche_poste.tpl.php' 74 | ,array() 75 | ,array( 76 | 'fiche_poste'=>array( 77 | 'id'=>$fiche_poste->getId() 78 | ,'type_poste'=>$form->texte('', 'type_poste', $fiche_poste->type_poste, 80,255,'','','à saisir') 79 | ,'numero_convention'=>$form->texte('', 'numero_convention', $fiche_poste->numero_convention, 20,255,'','','à saisir') 80 | ,'descriptif'=>$form->zonetexte('', 'descriptif', $fiche_poste->descriptif, 80,5) 81 | //,'supprimable'=>$form->hidden('supprimable', 1) 82 | ) 83 | ,'view'=>array( 84 | 'mode'=>$mode 85 | ,'head'=>dol_get_fiche_head(array() , '', 'Création d\'un type de poste') 86 | ,'action'=>$_REQUEST['action'] 87 | ) 88 | 89 | ) 90 | 91 | ); 92 | 93 | $grille_salaire = new TRH_grilleSalaire; 94 | $grille_salaire->fk_type_poste = $fiche_poste->getId(); 95 | if($mode === 'view') _listeGrillesSalaire($ATMdb, $grille_salaire, $fiche_poste->rowid); 96 | 97 | } 98 | 99 | function _listeGrillesSalaire(&$ATMdb, $grille_salaire, $id_fiche_poste) { 100 | global $langs, $conf, $db, $user; 101 | 102 | $fuser = new User($db); 103 | $fuser->fetch($_REQUEST['fk_user']); 104 | $fuser->getrights(); 105 | 106 | ////////////AFFICHAGE DES LIGNES DE REMUNERATION 107 | $r = new TSSRenderControler($grille_salaire); 108 | $sql = "SELECT rowid as 'ID', nb_annees_anciennete as 'Années d\'ancienneté ou Echelon', salaire_min as 'Salaire min.', salaire_max as 'Salaire max.'"; 109 | $sql.= " FROM ".MAIN_DB_PREFIX."rh_grille_salaire"; 110 | $sql.= " WHERE fk_type_poste = ".$grille_salaire->fk_type_poste; 111 | 112 | $TOrder = array('rowid'=>'ASC'); 113 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 114 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 115 | 116 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 117 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 118 | 119 | $r->liste($ATMdb, $sql, array( 120 | 'limit'=>array( 121 | 'page'=>$page 122 | ,'nbLine'=>'30' 123 | ) 124 | ,'link'=>array( 125 | 'ID'=>'@val@' 126 | ) 127 | ,'translate'=>array( 128 | 129 | ) 130 | ,'hide'=>array('DateCre', 'fk_user') 131 | ,'type'=>array() 132 | ,'liste'=>array( 133 | 'titre'=>'Grille de salaires associée' 134 | ,'image'=>img_picto('','title.png', '', 0) 135 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 136 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 137 | ,'noheader'=> (int)isset($_REQUEST['socid']) 138 | ,'messageNothing'=>"Aucune grille de salaire" 139 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 140 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 141 | ,'picto_search'=>'' 142 | ) 143 | ,'title'=>array( 144 | 'nb_annees_anciennete'=>"Années d'ancienneté" 145 | ,'montant'=>'Montant' 146 | ) 147 | ,'search'=>array( 148 | ) 149 | ,'orderBy'=>$TOrder 150 | 151 | )); 152 | if($user->rights->curriculumvitae->myactions->ajoutRemuneration==1){ 153 | ?> 154 |
    155 | Ajouter salaire
    156 |
    157 | end(); 162 | 163 | llxFooter(); 164 | } -------------------------------------------------------------------------------- /productivite_user_fiche.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 11 | 12 | $ATMdb=new TPDOdb; 13 | $productivite_user = new TRH_productiviteUser; 14 | 15 | if(isset($_REQUEST['action'])) { 16 | 17 | switch($_REQUEST['action']) { 18 | 19 | case 'save': 20 | 21 | $productivite_user->load($ATMdb, $_REQUEST['id']); 22 | $productivite_user->set_values($_REQUEST); 23 | 24 | $productivite_user->save($ATMdb); 25 | $productivite_user->load($ATMdb, $_REQUEST['id']); 26 | _fiche($ATMdb, $productivite_user, 'view'); 27 | break; 28 | 29 | case 'delete': 30 | $productivite_user->load($ATMdb, $_REQUEST['id']); 31 | $productivite_user->fk_productivite=$_REQUEST['id']; 32 | $productivite_user->delete($ATMdb); 33 | 34 | $productivite_user->save($ATMdb); 35 | ?> 36 | 39 | load($ATMdb, $_REQUEST['id']); 44 | _fiche($ATMdb, $productivite_user, 'view'); 45 | break; 46 | 47 | case 'edit': 48 | $productivite_user->load($ATMdb, $_REQUEST['id']); 49 | _fiche($ATMdb, $productivite_user); 50 | break; 51 | 52 | default: 53 | _fiche($ATMdb, $productivite_user); 54 | break; 55 | 56 | } 57 | 58 | } 59 | 60 | function _fiche(&$ATMdb, $productivite_user, $mode="edit") { 61 | 62 | global $db,$user,$langs,$conf; 63 | llxHeader('','Données de productivité'); 64 | 65 | $fuser = new User($db); 66 | $fuser->fetch($_REQUEST['fk_user']); 67 | $fuser->getrights(); 68 | 69 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 70 | $form->Set_typeaff($mode); 71 | 72 | echo $form->hidden('id', $productivite_user->getId()); 73 | echo $form->hidden('action', 'save'); 74 | echo $form->hidden('fk_user', $fuser->id); 75 | 76 | $TBS=new TTemplateTBS(); 77 | 78 | print $TBS->render('./tpl/productivite_user_fiche.tpl.php' 79 | ,array() 80 | ,array( 81 | 'user'=>array( 82 | 'id'=>$fuser->id 83 | ,'lastname'=>$fuser->lastname 84 | ,'firstname'=>$fuser->firstname 85 | ) 86 | ,'productivite_user'=>array( 87 | 'id'=>$productivite_user->getId() 88 | ,'date_objectif'=>$form->calendrier('', 'date_objectif', $productivite_user->date_objectif, 12) 89 | ,'indice'=>$form->texteRO('', 'indice', $productivite_user->indice, 20,"") 90 | ,'objectif'=>$form->texte('', 'objectif', $productivite_user->objectif, 20,255,'','','à saisir') 91 | //,'supprimable'=>$form->hidden('supprimable', 1) 92 | ) 93 | ,'view'=>array( 94 | 'mode'=>$mode 95 | ,'action'=>$_REQUEST['action'] 96 | ,'head'=>dol_get_fiche_head(competencePrepareHead($productivite_user, 'productivite_user'),'fiche','Productivité utilisateur') 97 | ,'onglet'=>dol_get_fiche_head(array(),'','Edition indice de productivité utilisateur') 98 | ) 99 | 100 | ) 101 | 102 | ); 103 | if($_REQUEST['action'] === 'view') 104 | _listeChiffresUser($ATMdb, $productivite_user); 105 | 106 | } 107 | 108 | function _listeChiffresUser(&$ATMdb, $productivite_user) { 109 | global $langs, $conf, $db, $user; 110 | 111 | $fuser = new User($db); 112 | $fuser->fetch($_REQUEST['fk_user']); 113 | $fuser->getrights(); 114 | 115 | ////////////AFFICHAGE DES LIGNES DE REMUNERATION 116 | $r = new TSSRenderControler($productivite_user); 117 | $sql = "SELECT rowid as 'ID', chiffre_realise as 'Chiffre réalisé', DATE_FORMAT(date_indice, \"%d-%m-%Y\") as 'Date'"; 118 | $sql.= 'FROM '.MAIN_DB_PREFIX.'rh_productivite_indice '; 119 | $sql.= 'WHERE fk_user = '.$_REQUEST['fk_user']; 120 | $sql.= ' AND fk_productivite = '.$productivite_user->fk_productivite; 121 | 122 | $TOrder = array('rowid'=>'ASC'); 123 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 124 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 125 | 126 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 127 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 128 | 129 | $r->liste($ATMdb, $sql, array( 130 | 'limit'=>array( 131 | 'page'=>$page 132 | ,'nbLine'=>'30' 133 | ) 134 | ,'link'=>array( 135 | //'Rémunération brute annuelle'=>'@val@' 136 | 'ID'=>'@val@' 137 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?'':'' 138 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?"":'' 139 | ) 140 | ,'translate'=>array( 141 | 142 | ) 143 | ,'hide'=>array('DateCre', 'fk_user') 144 | ,'type'=>array() 145 | ,'liste'=>array( 146 | 'titre'=>'Chiffres réalisés par l\'utilisateur' 147 | ,'image'=>img_picto('','title.png', '', 0) 148 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 149 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 150 | ,'noheader'=> (int)isset($_REQUEST['socid']) 151 | ,'messageNothing'=>"Aucun chiffre" 152 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 153 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 154 | ,'picto_search'=>'' 155 | ) 156 | ,'title'=>array( 157 | 'nb_annees_anciennete'=>"Années d'ancienneté" 158 | ,'montant'=>'Montant' 159 | ) 160 | ,'search'=>array( 161 | ) 162 | ,'orderBy'=>$TOrder 163 | 164 | )); 165 | 166 | $form->end(); 167 | 168 | ?> 169 |
    170 | Ajouter un chiffre
    171 |
    172 | statut = 'TODO'; 15 | 16 | $this->TStatut =array( 17 | 'TODO'=>'A faire' 18 | ,'OK'=>'Fait' 19 | ,'KO'=>'Abandonné' 20 | ); 21 | 22 | 23 | } 24 | 25 | 26 | } 27 | 28 | class TRH_formation_plan extends TObjetStd { 29 | function __construct() { 30 | 31 | parent::set_table(MAIN_DB_PREFIX.'rh_formation_plan'); 32 | parent::add_champs('date_debut,date_fin','type=date;'); 33 | parent::add_champs('libelle','type=chaine'); 34 | parent::add_champs('description','type=chaine'); 35 | parent::add_champs('budget','type=float;'); 36 | parent::add_champs('entity','type=entier;'); 37 | 38 | parent::_init_vars(); 39 | parent::start(); 40 | 41 | $this->date_debut =strtotime( date('Y-01-01') ); 42 | $this->date_fin =strtotime( date('Y-12-31') ); 43 | 44 | $this->libelle = 'Plan de formation '.date('Y'); 45 | 46 | } 47 | 48 | //Retourne la liste des Formation associées au plan TODO utile en class ? 49 | static function getListeFormation(&$ATMdb, $id_plan){ 50 | global $user, $conf; 51 | 52 | $r = new TListviewTBS('listeFormation'); 53 | 54 | $sql = "SELECT f.rowid AS 'ID', f.fk_formation_plan AS 'idPlan', f.libelle AS 'Intitule', f.description AS 'Description', f.budget AS 'Budget', f.budget_consomme AS 'Consomme', ftp.libelle AS 'LibelleType' 55 | FROM ".MAIN_DB_PREFIX."rh_formation AS f 56 | LEFT JOIN ".MAIN_DB_PREFIX."rh_formation_type_priorite AS ftp ON (f.fk_priorite = ftp.rowid) 57 | WHERE f.fk_formation_plan = ".$id_plan." 58 | ORDER BY ftp.rowid ASC"; 59 | 60 | $res = $r->render($ATMdb, $sql, array( 61 | 'limit'=>array( 62 | 'nbLine'=>'30' 63 | ) 64 | ,'link'=>array( 65 | 'Intitule'=>'@val@' 66 | ) 67 | ,'translate'=>array() 68 | ,'hide'=>array('ID','idPlan') 69 | ,'liste'=>array( 70 | 'titre'=>'Liste des formations' 71 | ,'image'=>img_picto('','title.png', '', 0) 72 | ,'picto_precedent'=>img_picto('','previous.png', '', 0) 73 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 74 | ,'noheader'=> (int)isset($_REQUEST['socid']) 75 | ,'messageNothing'=>"Il n'y a aucunes formations à afficher" 76 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 77 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 78 | ) 79 | )); 80 | 81 | return $res; 82 | } 83 | } 84 | 85 | class TRH_formation_section extends TObjetStd { 86 | function __construct() { 87 | 88 | parent::set_table(MAIN_DB_PREFIX.'rh_formation_section'); 89 | parent::add_champs('libelle','type=chaine'); 90 | parent::add_champs('description','type=chaine'); 91 | parent::add_champs('budget','type=float'); 92 | parent::add_champs('fk_usergroup, fk_formation_plan','type=entier;'); 93 | parent::add_champs('entity','type=entier;'); 94 | 95 | parent::_init_vars(); 96 | parent::start(); 97 | } 98 | } 99 | /* 100 | * 101 | * Géré dans le module AGEFODD 102 | * 103 | class TRH_formation extends TObjetStd { 104 | function __construct() { 105 | 106 | parent::set_table(MAIN_DB_PREFIX.'rh_formation'); 107 | parent::add_champs('libelle','type=chaine'); 108 | parent::add_champs('description','type=chaine'); 109 | parent::add_champs('budget','type=float'); 110 | parent::add_champs('budget_consomme','type=float'); 111 | parent::add_champs('fk_priorite, fk_formation_plan','type=entier;'); 112 | parent::add_champs('entity','type=entier;'); 113 | 114 | parent::_init_vars(); 115 | parent::start(); 116 | } 117 | 118 | //Retourne la liste des Sessions associées à la formation 119 | function getListeSessionFormation($ATMdb){ 120 | global $user, $conf; 121 | 122 | $r = new TListviewTBS('listeSessionFormation'); 123 | 124 | $sql = "SELECT fs.rowid AS 'ID', fs.libelle AS 'Intitule', fs.description AS 'Description', fs.budget AS 'Budget', fs.budget_consomme AS 'Consomme' 125 | FROM ".MAIN_DB_PREFIX."rh_formation_session AS fs 126 | WHERE fs.fk_formation = ".$this->getId(); 127 | 128 | $res = $r->render($ATMdb, $sql, array( 129 | 'limit'=>array( 130 | 'nbLine'=>'30' 131 | ) 132 | ,'link'=>array( 133 | 'Libellé'=>'@val@' 134 | ) 135 | ,'translate'=>array() 136 | ,'hide'=>array('ID') 137 | ,'liste'=>array( 138 | 'titre'=>'Liste des Sessions de Formation' 139 | ,'image'=>img_picto('','title.png', '', 0) 140 | ,'picto_precedent'=>img_picto('','previous.png', '', 0) 141 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 142 | ,'noheader'=> (int)isset($_REQUEST['socid']) 143 | ,'messageNothing'=>"Il n'y a aucunes session à afficher" 144 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 145 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 146 | ) 147 | )); 148 | 149 | return $res; 150 | } 151 | } 152 | 153 | class TRH_formation_type_priorite extends TObjetStd { 154 | function __construct() { 155 | 156 | parent::set_table(MAIN_DB_PREFIX.'rh_formation_type_priorite'); 157 | parent::add_champs('libelle','type=chaine'); 158 | 159 | parent::_init_vars(); 160 | parent::start(); 161 | } 162 | } 163 | 164 | class TRH_formation_session extends TObjetStd { 165 | function __construct() { 166 | 167 | parent::set_table(MAIN_DB_PREFIX.'rh_formation_session'); 168 | parent::add_champs('date_debut,date_fin','type=date;'); 169 | parent::add_champs('libelle','type=chaine'); 170 | parent::add_champs('description','type=chaine'); 171 | parent::add_champs('budget','type=float'); 172 | parent::add_champs('budget_consomme','type=float'); 173 | parent::add_champs('fk_formation','type=entier;'); 174 | parent::add_champs('entity','type=entier;'); 175 | 176 | parent::_init_vars(); 177 | parent::start(); 178 | } 179 | } 180 | 181 | class TRH_formation_participant extends TObjetStd { 182 | function __construct() { 183 | 184 | parent::set_table(MAIN_DB_PREFIX.'rh_formation_participant'); 185 | parent::add_champs('description','type=chaine'); 186 | parent::add_champs('fk_statut, fk_formation_session, fk_user, fk_responsable','type=entier;'); 187 | parent::add_champs('entity','type=entier;'); 188 | 189 | parent::_init_vars(); 190 | parent::start(); 191 | } 192 | } 193 | 194 | class TRH_formation_participant_statut extends TObjetStd { 195 | function __construct() { 196 | 197 | parent::set_table(MAIN_DB_PREFIX.'rh_formation_participant_statut'); 198 | parent::add_champs('libelle','type=chaine'); 199 | parent::add_champs('entity','type=entier;'); 200 | 201 | parent::_init_vars(); 202 | parent::start(); 203 | } 204 | } 205 | * 206 | * */ 207 | 208 | -------------------------------------------------------------------------------- /statCompetence.php: -------------------------------------------------------------------------------- 1 | load('competence@competence'); 7 | $langs->load("users"); 8 | 9 | $ATMdb=new TPDOdb; 10 | $lignecv=new TRH_ligne_cv; 11 | $tagCompetence=new TRH_competence_cv; 12 | 13 | if(isset($_REQUEST['action'])) { 14 | switch($_REQUEST['action']) { 15 | case 'view': 16 | break; 17 | case 'edit': 18 | break; 19 | } 20 | }else if(isset($_REQUEST['valider'])){ 21 | _ficheResult($ATMdb,$tagCompetence, 'edit'); 22 | }else{ 23 | _fiche($ATMdb,$tagCompetence, 'edit'); 24 | } 25 | 26 | $ATMdb->close(); 27 | llxFooter(); 28 | 29 | 30 | function _fiche(&$ATMdb, $tagCompetence, $mode) { 31 | global $db,$user, $langs, $conf; 32 | llxHeader('','Formations'); 33 | 34 | print dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Statistiques'); 35 | 36 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 37 | $form->Set_typeaff($mode); 38 | echo $form->hidden('fk_user', $user->id); 39 | echo $form->hidden('entity', $conf->entity); 40 | $fuser = new User($db); 41 | $fuser->fetch(isset($_REQUEST['fk_user']) ? $_REQUEST['fk_user'] : $user->id); 42 | $fuser->getrights(); 43 | 44 | $idTagRecherche=isset($_REQUEST['libelle']) ? $_REQUEST['libelle'] : 0; 45 | $idGroupeRecherche=isset($_REQUEST['groupe']) ? $_REQUEST['groupe'] : 0; 46 | 47 | //tableau pour la combobox des tags de compétences 48 | $sql="SELECT DISTINCT(c.libelleCompetence) FROM ".MAIN_DB_PREFIX."rh_competence_cv as c 49 | WHERE c.entity IN (0,".$conf->entity.")"; 50 | $ATMdb->Execute($sql); 51 | $k=1; 52 | $TTagCompetence=array(); 53 | while($ATMdb->Get_line()) { 54 | $TTagCompetence[$k]=$ATMdb->Get_field('libelleCompetence'); 55 | $k++; 56 | } 57 | 58 | //tableau pour la combobox des groupes 59 | $TGroupe = array(); 60 | $TGroupe[0]='Tous'; 61 | $sqlReq="SELECT rowid, nom FROM ".MAIN_DB_PREFIX."usergroup WHERE entity IN (0,".$conf->entity.")"; 62 | $ATMdb->Execute($sqlReq); 63 | while($ATMdb->Get_line()) { 64 | $TGroupe[$ATMdb->Get_field('rowid')] = htmlentities($ATMdb->Get_field('nom'), ENT_COMPAT , 'ISO8859-1'); 65 | } 66 | 67 | $TBS=new TTemplateTBS(); 68 | print $TBS->render('./tpl/statCompetence.tpl.php' 69 | ,array( 70 | 71 | ) 72 | ,array( 73 | 'competence'=>array( 74 | 'Tlibelle'=>$form->combo('','libelle',$TTagCompetence,$idTagRecherche) 75 | ,'TGroupe'=>$form->combo('','groupe',$TGroupe,$idGroupeRecherche) 76 | ,'btValider'=>$form->btsubmit('Valider', 'valider') 77 | ,'titreRecherche'=>load_fiche_titre("Statistiques sur les compétences des collaborateurs de l'entreprise",'', 'title.png', 0, '') 78 | ) 79 | ,'userCourant'=>array( 80 | 'id'=>$fuser->id 81 | ,'nom'=>$fuser->lastname 82 | ,'prenom'=>$fuser->firstname 83 | ,'droitRecherche'=>$user->rights->curriculumvitae->myactions->rechercheProfil?1:0 84 | ) 85 | ,'view'=>array( 86 | 'mode'=>$mode 87 | ,'head'=>dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Compétences') 88 | ) 89 | ) 90 | ); 91 | 92 | echo $form->end_form(); 93 | 94 | global $mesg, $error; 95 | dol_htmloutput_mesg($mesg, '', ($error ? 'error' : 'ok')); 96 | llxFooter(); 97 | } 98 | 99 | 100 | function _ficheResult(&$ATMdb, $tagCompetence, $mode) { 101 | global $db,$user, $langs, $conf; 102 | llxHeader('','Formations'); 103 | 104 | print dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Statistiques'); 105 | 106 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 107 | $form->Set_typeaff($mode); 108 | echo $form->hidden('fk_user', $user->id); 109 | echo $form->hidden('entity', $conf->entity); 110 | $fuser = new User($db); 111 | $fuser->fetch(isset($_REQUEST['fk_user']) ? $_REQUEST['fk_user'] : $user->id); 112 | $fuser->getrights(); 113 | 114 | $idTagRecherche=isset($_REQUEST['libelle']) ? $_REQUEST['libelle'] : 0; 115 | $idGroupeRecherche=isset($_REQUEST['groupe']) ? $_REQUEST['groupe'] : 0; 116 | 117 | if($idGroupeRecherche!=0){ //on recherche le nom du groupe 118 | //echo $idGroupeRecherche;exit; 119 | $sql="SELECT nom FROM ".MAIN_DB_PREFIX."usergroup 120 | WHERE rowid =".$idGroupeRecherche." AND entity IN (0,".$conf->entity.")"; 121 | $ATMdb->Execute($sql); 122 | while($ATMdb->Get_line()) { 123 | $nomGroupeRecherche=$ATMdb->Get_field('nom'); 124 | } 125 | }else{ 126 | $nomGroupeRecherche='Tous'; 127 | } 128 | 129 | if($idTagRecherche!=0){ //on recherche le nom du tag 130 | $sql="SELECT DISTINCT(c.libelleCompetence) FROM ".MAIN_DB_PREFIX."rh_competence_cv as c 131 | WHERE c.entity IN (0,".$conf->entity.")"; 132 | $ATMdb->Execute($sql); 133 | $k=1; 134 | $TTagCompetence=array(); 135 | while($ATMdb->Get_line()) { 136 | $TTagCompetence[$k]=$ATMdb->Get_field('libelleCompetence'); 137 | $k++; 138 | } 139 | 140 | $nomTagRecherche=$TTagCompetence[$idTagRecherche]; 141 | 142 | }else{ 143 | $nomTagRecherche='Tous'; 144 | } 145 | 146 | //on va obtenir un tableau permettant d'avoir les stats des compétences suivant la recherche 147 | $requeteRecherche=$tagCompetence->requeteStatistique($ATMdb, $idGroupeRecherche, $idTagRecherche, $nomTagRecherche); 148 | 149 | $taux_resultat_faible=$requeteRecherche['nbUserFaible']*100/$requeteRecherche['nbUser']; 150 | $taux_resultat_moyen=$requeteRecherche['nbUserMoyen']*100/$requeteRecherche['nbUser']; 151 | $taux_resultat_bon=$requeteRecherche['nbUserBon']*100/$requeteRecherche['nbUser']; 152 | $taux_resultat_excellent=$requeteRecherche['nbUserExcellent']*100/$requeteRecherche['nbUser']; 153 | $taux_resultat_autres=100-$taux_resultat_faible-$taux_resultat_moyen-$taux_resultat_bon-$taux_resultat_excellent; 154 | 155 | $nb_resultat_autres=$requeteRecherche['nbUser']-$requeteRecherche['nbUserFaible']-$requeteRecherche['nbUserMoyen']-$requeteRecherche['nbUserBon']-$requeteRecherche['nbUserExcellent']; 156 | 157 | $TBS=new TTemplateTBS(); 158 | print $TBS->render('./tpl/statCompetenceResult.tpl.php' 159 | ,array( 160 | ) 161 | ,array( 162 | 'demande'=>array( 163 | 'idTagRecherche'=>$idTagRecherche 164 | ,'idGroupeRecherche'=>$idGroupeRecherche 165 | ,'idUserRecherche'=>$idUserRecherche 166 | ,'nomTagRecherche'=>$nomTagRecherche 167 | ,'nomGroupeRecherche'=>$nomGroupeRecherche 168 | ) 169 | ,'resultat'=>array( 170 | 'total'=>$requeteRecherche['nbUser'] 171 | ,'faible'=>$taux_resultat_faible 172 | ,'moyen'=>$taux_resultat_moyen 173 | ,'bon'=>$taux_resultat_bon 174 | ,'excellent'=>$taux_resultat_excellent 175 | ,'autres'=>$taux_resultat_autres 176 | ,'nb_faible'=>$requeteRecherche['nbUserFaible'] 177 | ,'nb_moyen'=>$requeteRecherche['nbUserMoyen'] 178 | ,'nb_bon'=>$requeteRecherche['nbUserBon'] 179 | ,'nb_excellent'=>$requeteRecherche['nbUserExcellent'] 180 | ,'nb_autres'=>$nb_resultat_autres 181 | ,'titreRecherche'=>load_fiche_titre("Résultat de votre recherche",'', 'title.png', 0, '') 182 | 183 | ) 184 | ,'userCourant'=>array( 185 | 'id'=>$fuser->id 186 | ,'nom'=>$fuser->lastname 187 | ,'prenom'=>$fuser->firstname 188 | ) 189 | ,'view'=>array( 190 | 'mode'=>$mode 191 | ,'head'=>dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Compétences') 192 | ) 193 | ) 194 | ); 195 | 196 | echo $form->end_form(); 197 | 198 | global $mesg, $error; 199 | dol_htmloutput_mesg($mesg, '', ($error ? 'error' : 'ok')); 200 | llxFooter(); 201 | } 202 | 203 | -------------------------------------------------------------------------------- /tpl/statCompetenceResult.tpl.php: -------------------------------------------------------------------------------- 1 | 146 | 147 |
    148 | [resultat.titreRecherche;block=tr;strconv=no;protect=no] 149 |
    150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 |
    Mots clés utilisés
    Libellé compétence [demande.nomTagRecherche;block=tr;strconv=no;protect=no]
    Groupe [demande.nomGroupeRecherche;block=tr;strconv=no;protect=no]
    167 | 168 |

    169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 |
    Statistiques
    Niveau Faible [resultat.faible;block=tr;strconv=no;protect=no;frm=0,00]% ([resultat.nb_faible;strconv=no;protect=no] utilisateur(s))
    Niveau Moyen [resultat.moyen;block=tr;strconv=no;protect=no;frm=0,00]% ([resultat.nb_moyen;strconv=no;protect=no] utilisateur(s))
    Niveau Bon [resultat.bon;block=tr;strconv=no;protect=no;frm=0,00]% ([resultat.nb_bon;strconv=no;protect=no] utilisateur(s))
    Niveau Excellent [resultat.excellent;block=tr;strconv=no;protect=no;frm=0,00]% ([resultat.nb_excellent;strconv=no;protect=no] utilisateur(s))
    Sans la compétence [resultat.autres;block=tr;strconv=no;protect=no;frm=0,00]% ([resultat.nb_autres;strconv=no;protect=no] utilisateur(s))
    198 |
    199 | 200 |
    201 | 202 |
    203 |

    204 |
    205 | 206 |
    207 |

    208 | Retour 209 |
    210 | 211 |
    -------------------------------------------------------------------------------- /productivite.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 11 | 12 | $ATMdb=new TPDOdb; 13 | $productivite = new TRH_productivite; 14 | 15 | if(isset($_REQUEST['action'])) { 16 | 17 | switch($_REQUEST['action']) { 18 | 19 | case 'save': 20 | 21 | $productivite->load($ATMdb, $_REQUEST['id']); 22 | $productivite->set_values($_REQUEST); 23 | 24 | $mesg = '
    Indice de productivité enregistré avec succès
    '; 25 | 26 | $productivite->save($ATMdb); 27 | $productivite->load($ATMdb, $_REQUEST['id']); 28 | _fiche($ATMdb, $productivite, 'view'); 29 | break; 30 | 31 | case 'delete': 32 | $productivite->load($ATMdb, $_REQUEST['id']); 33 | $productivite->delete($ATMdb, $_REQUEST['id']); 34 | 35 | ?> 36 | 41 | load($ATMdb, $_REQUEST['id']); 47 | _fiche($ATMdb, $productivite, 'view'); 48 | break; 49 | 50 | case 'edit': 51 | $productivite->load($ATMdb, $_REQUEST['id']); 52 | _fiche($ATMdb, $productivite); 53 | break; 54 | 55 | case 'stat': 56 | _stat($ATMdb, $productivite); 57 | break; 58 | default: 59 | _fiche($ATMdb, $productivite); 60 | break; 61 | 62 | } 63 | 64 | } 65 | 66 | 67 | function _stat(&$ATMdb,& $productivite) { 68 | 69 | global $conf, $langs, $db; 70 | 71 | dol_include_once('/core/class/html.form.class.php'); 72 | 73 | if(GETPOST('date_start') != '' ) { 74 | $date_start = date('Y-m-d', Tools::get_time(GETPOST('date_start'))); 75 | } 76 | else{ 77 | $date_start = date('Y-m-01'); 78 | } 79 | 80 | if(GETPOST('date_end') != '' ) { 81 | $date_end = date('Y-m-d', Tools::get_time(GETPOST('date_end'))); 82 | } 83 | else{ 84 | $date_end = date('Y-m-t'); 85 | } 86 | 87 | $fk_group = GETPOST('fk_group', 'int'); 88 | 89 | llxHeader('','Statistique de productivité'); 90 | 91 | print_fiche_titre("Statistiques productivité"); 92 | 93 | $formATM=new TFormCore('auto', 'formStat'); 94 | echo $formATM->hidden('action', 'stat'); 95 | 96 | echo $formATM->calendrier('Début', 'date_start', strtotime( $date_start ) ); 97 | echo $formATM->calendrier('Fin', 'date_end',strtotime( $date_end )); 98 | 99 | $form=new Form($db); 100 | echo $form->select_dolgroups($fk_group,'fk_group',1); 101 | 102 | echo $formATM->btsubmit('Go', 'bt_go'); 103 | 104 | $formATM->end(); 105 | 106 | 107 | $sql="SELECT u.rowid as idUser, p.rowid as idProductivite ,p.indice, SUM(pi.chiffre_realise) as 'nb' 108 | FROM ".MAIN_DB_PREFIX."rh_productivite_indice pi 109 | INNER JOIN ".MAIN_DB_PREFIX."rh_productivite p ON (p.rowid=pi.fk_productivite) 110 | INNER JOIN ".MAIN_DB_PREFIX."user u ON (pi.fk_user=u.rowid) 111 | "; 112 | if($fk_group>0) { 113 | $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user ugu ON (u.rowid=ugu.fk_user) "; 114 | } 115 | 116 | $sql.=" WHERE date_indice BETWEEN '$date_start' AND '$date_end' "; 117 | 118 | if($fk_group>0) { 119 | $sql.=" AND ugu.fk_usergroup IN (".$fk_group.") "; 120 | } 121 | 122 | $sql.=" GROUP BY u.rowid, p.rowid 123 | "; 124 | 125 | $Tab = $ATMdb->ExecuteAsArray($sql); 126 | 127 | $TData = array(); 128 | foreach ($Tab as $row) { 129 | 130 | $TData[$row->idUser][$row->idProductivite] = $row->nb; 131 | 132 | } 133 | 134 | $sql="SELECT rowid, indice FROM ".MAIN_DB_PREFIX."rh_productivite ORDER BY indice"; 135 | $TProductivite = TRequeteCore::get_keyval_by_sql($ATMdb, $sql, 'rowid', 'indice'); 136 | 137 | print ''; 141 | } 142 | 143 | print ''; 144 | 145 | print ''; 146 | 147 | $idFacturable = __val($conf->global->RH_PRODUCTIVITE_FACTURABLE, 10, 'int', true); 148 | $idFacturee = __val($conf->global->RH_PRODUCTIVITE_FACTUREE, 7, 'int', true); 149 | $idImproductivite = __val($conf->global->RH_PRODUCTIVITE_IMPRODUCTIVITE, 9, 'int', true); 150 | 151 | $TTotal = array(); 152 | foreach($TData as $idUser=>$TP) { 153 | 154 | $u=new User($db); 155 | $u->fetch($idUser); 156 | 157 | print ''; 158 | 159 | foreach($TProductivite as $idProductivite=>$label) { 160 | 161 | $nb = (empty($TP[$idProductivite]) ? 0 : $TP[$idProductivite] ); 162 | @$TTotal[$idProductivite]+=$nb; 163 | 164 | print ''; 165 | 166 | } 167 | 168 | $rendement = ($TP[$idFacturee]>0 ? $TP[$idFacturable] / $TP[$idFacturee] : 0); 169 | $productivite = ($TP[$idFacturable]>0 ? $TP[$idFacturee] / ($TP[$idFacturable]+$TP[$idImproductivite] ): 0); 170 | 171 | @$TTotal['rendement']+= $rendement; 172 | @$TTotal['productivite']+= $productivite; 173 | 174 | print ''; 175 | print ''; 176 | 177 | print ''; 178 | 179 | } 180 | 181 | print ''; 182 | 183 | foreach($TProductivite as $idProductivite=>$label) { 184 | print ''; 185 | } 186 | 187 | $rendement = ($TTotal[$idFacturee]>0 ? $TTotal[$idFacturable] / $TTotal[$idFacturee] : 0); 188 | $productivite = ($TTotal[$idFacturable]>0 ? $TTotal[$idFacturee] / ($TTotal[$idFacturable]+$TTotal[$idImproductivite] ): 0); 189 | 190 | print ''; 191 | print ''; 192 | 193 | print ''; 194 | 195 | 196 | print '
    '.$langs->trans('Users').''; 138 | 139 | foreach($TProductivite as $idProductivite=>$label) { 140 | print ''.$label.'RendementProductivité
    '.$u->getNomUrl(1).''.$nb.''. round( $rendement,2) .''. round($productivite,2) .'
    Total'.$TTotal[$idProductivite].''.round($rendement,2).''.round($productivite,2).'
    '; 197 | 198 | llxFooter(); 199 | } 200 | 201 | function _fiche(&$ATMdb, $productivite, $mode="edit") { 202 | 203 | global $db,$user,$langs,$conf; 204 | llxHeader('','Données de productivité'); 205 | 206 | $fuser = new User($db); 207 | $fuser->fetch($_REQUEST['fk_user']); 208 | $fuser->getrights(); 209 | 210 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 211 | $form->Set_typeaff($mode); 212 | 213 | echo $form->hidden('id', $productivite->getId()); 214 | echo $form->hidden('action', 'save'); 215 | echo $form->hidden('fk_user', $fuser->id); 216 | 217 | $TBS=new TTemplateTBS(); 218 | 219 | print $TBS->render('./tpl/productivite.tpl.php' 220 | ,array() 221 | ,array( 222 | 'user'=>array( 223 | 'id'=>$fuser->id 224 | ,'lastname'=>$fuser->lastname 225 | ,'firstname'=>$fuser->firstname 226 | ) 227 | ,'productivite'=>array( 228 | 'id'=>$productivite->getId() 229 | ,'date_objectif'=>$form->calendrier('', 'date_objectif', $productivite->date_objectif, 12) 230 | ,'indice'=>$form->texte('', 'indice', $productivite->indice, 20,255,'','','à saisir') 231 | ,'label'=>$form->texte('', 'label', $productivite->label, 20,255,'','','à saisir') 232 | ,'objectif'=>$form->texte('', 'objectif', $productivite->objectif, 20,255,'','','à saisir') 233 | //,'supprimable'=>$form->hidden('supprimable', 1) 234 | ) 235 | ,'view'=>array( 236 | 'mode'=>$mode 237 | ,'action'=>$_REQUEST['action'] 238 | ,'head'=>dol_get_fiche_head(competencePrepareHead($productivite, 'productivite'),'fiche','Productivité') 239 | ,'onglet'=>dol_get_fiche_head(array(),'','Edition indice de productivité') 240 | ) 241 | 242 | ) 243 | 244 | ); 245 | 246 | } 247 | -------------------------------------------------------------------------------- /rechercheCompetence.php: -------------------------------------------------------------------------------- 1 | load('competence@competence'); 7 | $langs->load("users"); 8 | 9 | $ATMdb=new TPDOdb; 10 | $lignecv=new TRH_ligne_cv; 11 | $formation=new TRH_formation_cv; 12 | $tagCompetence=new TRH_competence_cv; 13 | 14 | if(isset($_REQUEST['action'])) { 15 | switch($_REQUEST['action']) { 16 | 17 | case 'view': 18 | $formation->load($ATMdb, $_REQUEST['id']); 19 | _ficheFormation($ATMdb, $formation, $tagCompetence,'view'); 20 | break; 21 | case 'edit': 22 | 23 | break; 24 | } 25 | } 26 | elseif(($_REQUEST['libelleCompetence'])!="") { 27 | $recherche=$tagCompetence->replaceEspaceEnPourcentage($_REQUEST['libelleCompetence']); 28 | //print($recherche);print "
    "; 29 | $competenceOu=$tagCompetence->separerOu($recherche); 30 | //print_r($competenceOu);print "
    "; 31 | 32 | _liste($ATMdb, $tagCompetence, $competenceOu); 33 | } 34 | else { 35 | //$ATMdb->db->debug=true; 36 | _fiche($ATMdb,$tagCompetence, 'edit'); 37 | } 38 | 39 | $ATMdb->close(); 40 | 41 | llxFooter(); 42 | 43 | 44 | function _liste(&$ATMdb, $tagCompetence, $recherche ) { 45 | global $langs, $conf, $db, $user; 46 | llxHeader('','Résultat de la recherche'); 47 | print dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Compétences'); 48 | 49 | ////////////AFFICHAGE DES LIGNES DE CV 50 | $r = new TSSRenderControler($tagCompetence); 51 | 52 | $sql=$tagCompetence->requeteRecherche($ATMdb, $recherche); 53 | 54 | 55 | $TOrder = array('Niveau'=>'DESC'); 56 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 57 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 58 | 59 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 60 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 61 | 62 | $r->liste($ATMdb, $sql, array( 63 | 'limit'=>array( 64 | 'page'=>$page 65 | ,'nbLine'=>'30' 66 | ) 67 | ,'link'=>array( 68 | 'name'=>'@val@' 69 | ,'firstname'=>'@val@' 70 | ) 71 | ,'translate'=>array( 72 | ) 73 | ,'hide'=>array('DateCre', 'fk_user', 'rowid', 'fkuser', 'ID') 74 | ,'type'=>array('date_debut'=>'date', 'date_fin'=>'date') 75 | ,'liste'=>array( 76 | 'titre'=>'RESULTAT DE VOTRE RECHERCHE' 77 | ,'image'=>img_picto('','title.png', '', 0) 78 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 79 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 80 | ,'noheader'=> (int)isset($_REQUEST['socid']) 81 | ,'messageNothing'=>"Aucun résultat au sein de l'entreprise pour votre recherche " 82 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 83 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 84 | ,'picto_search'=>'' 85 | 86 | ) 87 | ,'title'=>array( 88 | 'libelleCompetence'=>'Compétence(s)' 89 | ,'name'=>'Utilisateur' 90 | ,'Niveau'=>'Nombre de compétences recherchées' 91 | 92 | ) 93 | ,'eval'=>array( 94 | 'libelleCompetence'=>'_get_competence_user(@fkuser@)' 95 | ) 96 | ,'search'=>array( 97 | 'libelleExperience'=>array('recherche'=>'calendar') 98 | 99 | ) 100 | ,'orderBy'=>$TOrder 101 | 102 | )); 103 | 104 | 105 | $form->end(); 106 | 107 | 108 | llxFooter(); 109 | } 110 | function _get_competence_user($fk_user) { 111 | global $ATMdb; 112 | 113 | $sql="SELECT DISTINCT libelleCompetence FROM ".MAIN_DB_PREFIX."rh_competence_cv WHERE fk_user=".$fk_user; 114 | $ATMdb->Execute($sql); 115 | $Tab = $ATMdb->Get_All(); 116 | 117 | $competences=''; 118 | foreach ($Tab as $c) { 119 | if(!empty($competences))$competences.=', '; 120 | $competences.=$c->libelleCompetence; 121 | } 122 | 123 | return $competences; 124 | } 125 | 126 | function _fiche(&$ATMdb,$tagCompetence, $mode) { 127 | global $db,$user, $langs, $conf; 128 | llxHeader('','Recherche Profil'); 129 | print dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Compétences'); 130 | 131 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','GET'); 132 | $form->Set_typeaff($mode); 133 | echo $form->hidden('fk_user', $user->id); 134 | echo $form->hidden('entity', $conf->entity); 135 | 136 | $TBS=new TTemplateTBS(); 137 | print $TBS->render('./tpl/rechercheCompetence.tpl.php' 138 | ,array( 139 | 140 | ) 141 | ,array( 142 | 'recherche'=>array( 143 | 'libelle'=>$form->texte('','libelleCompetence','', 30,100,'','','-') 144 | ,'titreRecherche'=>load_fiche_titre("Recherche d'un profil",'', 'title.png', 0, '') 145 | ) 146 | ,'userCourant'=>array( 147 | 'id'=>$user->id 148 | ,'droitRecherche'=>$user->rights->curriculumvitae->myactions->rechercheProfil 149 | 150 | ) 151 | ,'view'=>array( 152 | 'mode'=>$mode 153 | ,'head'=>dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Compétences') 154 | ) 155 | ) 156 | ); 157 | 158 | echo $form->end_form(); 159 | 160 | global $mesg, $error; 161 | dol_htmloutput_mesg($mesg, '', ($error ? 'error' : 'ok')); 162 | llxFooter(); 163 | } 164 | 165 | 166 | 167 | function _ficheFormation(&$ATMdb, $formation, $tagCompetence, $mode) { 168 | global $db,$user, $langs, $conf; 169 | llxHeader('','Formations'); 170 | print dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Compétences'); 171 | 172 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 173 | $form->Set_typeaff($mode); 174 | echo $form->hidden('id', $formation->getId()); 175 | echo $form->hidden('action', 'saveformation'); 176 | echo $form->hidden('fk_user', $user->id); 177 | echo $form->hidden('entity', $conf->entity); 178 | 179 | $fuser = new User($db); 180 | $fuser->fetch(isset($_REQUEST['fk_user']) ? $_REQUEST['fk_user'] : $formation->fk_user); 181 | $fuser->getrights(); 182 | 183 | $sql="SELECT c.rowid, c.libelleCompetence, c.niveauCompetence FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."rh_formation_cv as f 184 | WHERE c.fk_user_formation=".$formation->getID(). " AND c.fk_user_formation=f.rowid AND c.fk_user=".$formation->fk_user; 185 | 186 | $k=0; 187 | $ATMdb->Execute($sql); 188 | $TTagCompetence=array(); 189 | while($ATMdb->Get_line()) { 190 | $TTagCompetence[]=array( 191 | 'id'=>$ATMdb->Get_field('rowid') 192 | ,'libelleCompetence'=>$form->texte('','libelleCompetence',$ATMdb->Get_field('libelleCompetence'), 30,100,'','','-') 193 | ,'niveauCompetence'=>$form->texte('','niveauCompetence',$ATMdb->Get_field('niveauCompetence'), 10,50,'','','-') 194 | 195 | ); 196 | $k++; 197 | } 198 | 199 | $TNComp=array(); 200 | 201 | 202 | 203 | $TBS=new TTemplateTBS(); 204 | print $TBS->render('./tpl/resultat.tpl.php' 205 | ,array( 206 | 'TCompetence'=>$TTagCompetence 207 | ) 208 | ,array( 209 | 'formation'=>array( 210 | 'id'=>$formation->getId() 211 | ,'date_debut'=>$form->calendrier('', 'date_debut', $formation->date_debut, 12) 212 | ,'date_fin'=>$form->calendrier('', 'date_fin', $formation->date_fin, 12) 213 | ,'libelleFormation'=>$form->texte('','libelleFormation',$formation->libelleFormation, 30,100,'','','-') 214 | ,'commentaireFormation'=>$form->texte('','commentaireFormation',$formation->commentaireFormation, 50,300,'style="width:400px;height:80px;"','','-') 215 | ,'lieuFormation'=>$form->texte('','lieuFormation',$formation->lieuFormation, 30,100,'','','-') 216 | ,'date_formationEcheance'=>$form->calendrier('', 'date_formationEcheance', $formation->date_formationEcheance, 12) 217 | ,'titreResultat'=>load_fiche_titre("Description de la formation correspondant à la compétence recherchée",'', 'title.png', 0, '') 218 | ) 219 | ,'userCourant'=>array( 220 | 'id'=>$fuser->id 221 | ,'nom'=>$fuser->lastname 222 | ,'prenom'=>$fuser->firstname 223 | ) 224 | ,'view'=>array( 225 | 'mode'=>$mode 226 | ,'head'=>dol_get_fiche_head(competencePrepareHead($tagCompetence, '') , '', 'Compétences') 227 | ) 228 | ,'newCompetence'=>array( 229 | 'hidden'=>$form->hidden('action', 'newCompetence') 230 | ,'id'=>$k 231 | ,'libelleCompetence'=>$form->texte('','TNComp[libelle]','', 30,100,'','','-') 232 | ,'fk_user_formation'=>$form->hidden('TNComp[fk_user_formation]', $formation->getId()) 233 | ,'niveauCompetence'=>$form->combo(' Niveau ','niveauCompetence',$tagCompetence->TNiveauCompetence,'') 234 | ) 235 | ) 236 | ); 237 | 238 | echo $form->end_form(); 239 | 240 | global $mesg, $error; 241 | dol_htmloutput_mesg($mesg, '', ($error ? 'error' : 'ok')); 242 | llxFooter(); 243 | } 244 | -------------------------------------------------------------------------------- /productivite_user.php: -------------------------------------------------------------------------------- 1 | load('formulaire@formulaire'); 10 | 11 | $ATMdb=new TPDOdb; 12 | $productivite_user = new TRH_productiviteUser; 13 | $productivite = new TRH_productivite; 14 | 15 | if(isset($_REQUEST['action'])) { 16 | 17 | switch($_REQUEST['action']) { 18 | 19 | case 'add_indice': 20 | 21 | $id_indice = $_REQUEST['fk_indice_prod']; 22 | 23 | if($id_indice != 0 && !TRH_productiviteUser::existe_indice_user($id_indice, $_REQUEST['fk_user'])) { 24 | 25 | $productivite->load($ATMdb, $id_indice); 26 | $TChamps = array( 27 | 'fk_user'=>$_REQUEST['fk_user'] 28 | ,'fk_productivite'=>$productivite->rowid 29 | ,'indice'=>$productivite->indice 30 | ,'objectif'=>$productivite->objectif 31 | ,'date_objectif'=>date("Y-m-d H:i:s", $productivite->date_objectif) 32 | ); 33 | 34 | $productivite_user->set_values($TChamps); 35 | $productivite_user->save($ATMdb); 36 | 37 | } 38 | 39 | _liste($ATMdb, $productivite_user, 'view'); 40 | break; 41 | 42 | case 'save': 43 | 44 | $productivite_user->load($ATMdb, $_REQUEST['id']); 45 | $productivite_user->set_values($_REQUEST); 46 | 47 | $mesg = '
    Grille de salaire enregistrée avec succès
    '; 48 | 49 | $productivite_user->save($ATMdb); 50 | $productivite_user->load($ATMdb, $_REQUEST['id']); 51 | _fiche($ATMdb, $productivite_user, 'view'); 52 | break; 53 | 54 | case 'delete': 55 | $productivite_user->load($ATMdb, $_REQUEST['id']); 56 | $productivite_user->delete($ATMdb, $_REQUEST['id']); 57 | $mesg = '
    Grille de salaire enregistrée avec succès
    '; 58 | 59 | $productivite_user->save($ATMdb); 60 | ?> 61 | 64 | load($ATMdb, $_REQUEST['id']); 73 | _fiche($ATMdb, $productivite_user); 74 | break; 75 | 76 | default: 77 | _fiche($ATMdb, $productivite_user); 78 | break; 79 | 80 | } 81 | 82 | } 83 | 84 | function _fiche(&$ATMdb, $productivite_user, $mode="edit") { 85 | 86 | global $db,$user,$langs,$conf; 87 | llxHeader('','Données de productivité'); 88 | 89 | $fuser = new User($db); 90 | $fuser->fetch($_REQUEST['fk_user']); 91 | $fuser->getrights(); 92 | 93 | $head = user_prepare_head($fuser); 94 | $current_head = 'productivite'; 95 | dol_fiche_head($head, $current_head, $langs->trans('Utilisateur'),0, 'user'); 96 | 97 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 98 | $form->Set_typeaff($mode); 99 | 100 | echo $form->hidden('id', $productivite_user->getId()); 101 | echo $form->hidden('action', 'save'); 102 | echo $form->hidden('fk_user', $fuser->id); 103 | 104 | $TBS=new TTemplateTBS(); 105 | 106 | print $TBS->render('./tpl/productivite_user.tpl.php' 107 | ,array() 108 | ,array( 109 | 'user'=>array( 110 | 'id'=>$fuser->id 111 | ,'lastname'=>$fuser->lastname 112 | ,'firstname'=>$fuser->firstname 113 | ) 114 | ,'productivite_user'=>array( 115 | 'id'=>$productivite_user->getId() 116 | ,'date_objectif'=>$form->calendrier('', 'date_objectif', $productivite_user->date_objectif, 12) 117 | ,'indice'=>$form->texte('', 'indice', $productivite_user->indice, 20,255,'','','à saisir') 118 | ,'objectif'=>$form->texte('', 'objectif', $productivite_user->objectif, 20,255,'','','à saisir') 119 | //,'supprimable'=>$form->hidden('supprimable', 1) 120 | ) 121 | ,'view'=>array( 122 | 'mode'=>$mode 123 | ,'action'=>$_REQUEST['action'] 124 | ) 125 | 126 | ) 127 | 128 | ); 129 | 130 | } 131 | 132 | function _liste(&$ATMdb, $productivite_user) { 133 | global $langs, $conf, $db, $user; 134 | llxHeader('','Indices de productivité utilisateur'); 135 | 136 | $fuser = new User($db); 137 | $fuser->fetch($_REQUEST['fk_user']); 138 | $fuser->getrights(); 139 | 140 | $head = user_prepare_head($fuser); 141 | dol_fiche_head($head, 'productivite', $langs->trans('Utilisateur'),0, 'user'); 142 | 143 | // On récupère la liste des indices de productivité existants 144 | $TIndices = array(0=>"(Sélectionnez un indice)"); 145 | $sql = 'SELECT p.rowid, p.indice '; 146 | $sql.= 'FROM '.MAIN_DB_PREFIX.'rh_productivite p '; 147 | $sql.= 'WHERE p.rowid NOT IN ('; 148 | $sql.= 'SELECT p.rowid '; 149 | $sql.= 'FROM '.MAIN_DB_PREFIX.'rh_productivite p '; 150 | $sql.= 'INNER JOIN '.MAIN_DB_PREFIX.'rh_productivite_user pu on (p.rowid = pu.fk_productivite)'; 151 | $sql.= 'WHERE pu.fk_user = '.$_REQUEST['fk_user']; 152 | $sql.= ')'; 153 | 154 | $resql = $db->query($sql); 155 | if($resql) { 156 | while($res = $db->fetch_object($resql)) { 157 | $TIndices[$res->rowid] = $res->rowid." : ".$res->indice; 158 | } 159 | } 160 | 161 | $r = new TSSRenderControler($productivite_user); 162 | $sql = "SELECT rowid as 'ID', indice as 'Indice', objectif as 'Objectif'"; 163 | $sql.=" FROM ".MAIN_DB_PREFIX."rh_productivite_user"; 164 | $sql.= ' WHERE fk_user = '.$_REQUEST['fk_user']; 165 | 166 | $TOrder = array('rowid'=>'ASC'); 167 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 168 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 169 | 170 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 171 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 172 | 173 | print ''; 174 | print ''; 175 | print ''; 176 | print ''; 177 | print '
    Réf.'.$fuser->ref.'
    Nom'.$fuser->lastname.'
    Prénom'.$fuser->firstname.'
    '; 178 | print '
    '; 179 | 180 | print $form->combo('Indices de productivité disponibles', 'fk_indice_prod',$TIndices, 0); 181 | 182 | print $form->hidden('action', 'add_indice'); 183 | print $form->hidden('fk_user', $_REQUEST['fk_user']); 184 | 185 | print $form->btsubmit('Ajouter indice', 'add_indice'); 186 | 187 | print '

    '; 188 | 189 | //function btsubmit($pLib,$pName,$plus="", $class='button'){ 190 | 191 | $r->liste($ATMdb, $sql, array( 192 | 'limit'=>array( 193 | 'page'=>$page 194 | ,'nbLine'=>'30' 195 | ) 196 | ,'link'=>array( 197 | //'Rémunération brute annuelle'=>'@val@' 198 | 'ID'=>'@val@' 199 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?'':'' 200 | //,'Supprimer'=>$user->rights->curriculumvitae->myactions->ajoutRemuneration?"":'' 201 | ) 202 | ,'translate'=>array( 203 | 204 | ) 205 | ,'hide'=>array('DateCre', 'fk_user') 206 | ,'type'=>array() 207 | ,'liste'=>array( 208 | 'titre'=>'Visualisation des indices de productivité de l\'utilisateur' 209 | ,'image'=>img_picto('','title.png', '', 0) 210 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 211 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 212 | ,'noheader'=> (int)isset($_REQUEST['socid']) 213 | ,'messageNothing'=>"Aucun indice de productivité pour l'utilisateur" 214 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 215 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 216 | ,'picto_search'=>'' 217 | ) 218 | ,'title'=>array( 219 | 'type_poste'=>'Type poste' 220 | ,'numero_convention'=>'Numero convention' 221 | ,'descriptif'=>'Descriptif' 222 | ) 223 | ,'search'=>array( 224 | ) 225 | ,'orderBy'=>$TOrder 226 | 227 | )); 228 | 229 | 230 | $form->end(); 231 | 232 | if(_displayChartProductivite($ATMdb)) { 233 | 234 | print '
    '; 235 | _displayFormProductivityChart(); 236 | print '
    '; 237 | 238 | } 239 | 240 | llxFooter(); 241 | } 242 | 243 | function _displayChartProductivite(&$ATMdb) { 244 | 245 | global $conf,$langs,$db; 246 | 247 | $langs->load('report@report'); 248 | dol_include_once("/report/class/dashboard.class.php"); 249 | //llxHeader('', '', '', '', 0, 0, array('http://www.google.com/jsapi')); 250 | 251 | if(GETPOST('date_deb')){ 252 | $date_deb = GETPOST('date_deb'); 253 | $date_deb = explode('/', $date_deb); 254 | $date_deb = $date_deb[2].'-'.$date_deb[1].'-'.$date_deb[0].' 00:00:00'; 255 | } 256 | 257 | if(GETPOST('date_fin')){ 258 | $date_fin = GETPOST('date_fin'); 259 | $date_fin = explode('/', $date_fin); 260 | $date_fin = $date_fin[2].'-'.$date_fin[1].'-'.$date_fin[0].' 23:59:59'; 261 | } 262 | 263 | $dash=new TReport_dashboard; 264 | 265 | $TIndicesuser = TRH_productiviteUser::get_array_indices_user($_REQUEST['fk_user']); 266 | 267 | $TData = array(); 268 | 269 | foreach($TIndicesuser as $indice_user) { 270 | $sql = "SELECT DATE_FORMAT(date_indice, \"%Y-%m\" ) AS 'mois' 271 | , SUM( chiffre_realise ) AS '".strtr($indice_user, array("'"=>"\'"))."' 272 | FROM ".MAIN_DB_PREFIX."rh_productivite_indice 273 | WHERE fk_user=".$_REQUEST['fk_user']." 274 | AND indice='".strtr($indice_user, array("'"=>"\'"))."' "; 275 | 276 | if(!empty($date_deb)) $sql .= "AND date_indice >= \"".$date_deb."\" "; 277 | if(!empty($date_fin)) $sql .= "AND date_indice <= \"".$date_fin."\" "; 278 | 279 | $sql .= " GROUP BY `mois`"; 280 | 281 | $TData[] = array("code" => 'CHIFFRESUSER' 282 | ,'yDataKey' => $indice_user 283 | ,"sql" => $sql 284 | ,'hauteur'=>dolibarr_get_const($db, 'COMPETENCE_HAUTEURGRAPHIQUES')); 285 | } 286 | 287 | if(isset($_REQUEST['fk_usergroup'])) _addLinesGroup($TData, $TIndicesuser, $_REQUEST['fk_usergroup'], $date_deb,$date_fin); 288 | 289 | if(count($TIndicesuser) > 0) { 290 | 291 | $title = $langs->trans('Productivité utilisateur'); 292 | print_fiche_titre($title, '', 'report.png@report'); 293 | 294 | $dash->concat_title = false; 295 | 296 | $dash->initByData($ATMdb,$TData); 297 | 298 | ?>
    get('chart_productivite_user'); 301 | 302 | return true; 303 | 304 | } 305 | 306 | return false; 307 | 308 | } 309 | 310 | /** 311 | * Affiche le formulaire permettant de comparer les chiffres de l'utilisateur 312 | * avec ceux des autres utilisateur ou ceux d'un groupe en particulier 313 | */ 314 | function _displayFormProductivityChart() { 315 | 316 | $form = new TFormCore("", "formProductivityChart"); 317 | print $form->calendrier('Date début', 'date_deb', GETPOST('date_deb')); 318 | print $form->calendrier('Date fin', 'date_fin', GETPOST('date_fin')); 319 | print $form->btsubmit("Comparer chiffres","subFormProductivityChart"); 320 | print $form->combo($pLib, "fk_usergroup", _getUserGroups(), $_REQUEST['fk_usergroup']); 321 | 322 | print ''; 323 | 324 | } 325 | 326 | function _getUserGroups() { 327 | 328 | global $db; 329 | 330 | $TGroups = array(0 => "Tous"); 331 | 332 | $sql = "SELECT ug.rowid, ug.nom"; 333 | $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as ug"; 334 | $resql = $db->query($sql); 335 | 336 | if($resql) { 337 | while($res = $db->fetch_object($resql)) { 338 | $TGroups[$res->rowid] = 'Groupe "'.$res->nom.'"'; 339 | } 340 | } 341 | 342 | return $TGroups; 343 | 344 | } 345 | 346 | function _addLinesGroup(&$TData, $TIndicesuser, $fk_usergroup, $date_deb, $date_fin) { 347 | 348 | global $db; 349 | 350 | //if($fk_usergroup == 0) { 351 | 352 | foreach($TIndicesuser as $indice_user) { 353 | 354 | $sql = "SELECT DATE_FORMAT(i.date_indice, \"%Y-%m\" ) AS 'mois' "; 355 | $sql.= ", AVG( i.chiffre_realise ) AS 'Moyenne indice : ".strtr($indice_user, array("'" => "\'"))."' "; 356 | $sql.= "FROM ".MAIN_DB_PREFIX."rh_productivite_indice i "; 357 | if($fk_usergroup > 0) $sql.= "INNER JOIN ".MAIN_DB_PREFIX."usergroup_user u on (u.fk_user = i.fk_user) "; 358 | $sql.= "WHERE i.indice='".strtr($indice_user, array("'" => "\'"))."' "; 359 | if($fk_usergroup > 0) $sql.= "AND fk_usergroup = ".$fk_usergroup." "; 360 | 361 | if(!empty($date_deb)) $sql .= "AND i.date_indice >= \"".$date_deb."\" "; 362 | if(!empty($date_fin)) $sql .= "AND i.date_indice <= \"".$date_fin."\" "; 363 | 364 | $sql.= "GROUP BY `mois`"; 365 | 366 | $TData[] = array("code" => 'CHIFFRESUSER' 367 | ,'yDataKey' => 'Moyenne indice : '.$indice_user 368 | ,"sql" => $sql 369 | ,'hauteur'=>dolibarr_get_const($db, 'COMPETENCE_HAUTEURGRAPHIQUES')); 370 | 371 | } 372 | 373 | //} 374 | 375 | } 376 | -------------------------------------------------------------------------------- /class/competence.class.php: -------------------------------------------------------------------------------- 1 | Execute($sql); 24 | if ($ATMdb->Get_line()) { 25 | return $this->load($ATMdb, $ATMdb->Get_field('rowid')); 26 | } 27 | return false; 28 | 29 | } 30 | } 31 | 32 | //TRH_FORMATION 33 | //définition de la classe pour rentrer les compétences d'un utilisateur 34 | class TRH_formation_cv extends TObjetStd { 35 | function __construct() { 36 | 37 | parent::set_table(MAIN_DB_PREFIX.'rh_formation_cv'); 38 | parent::add_champs('date_debut,date_fin','type=date;'); //dates de début et de fin de la formation suivie 39 | parent::add_champs('libelleFormation','type=chaine;'); 40 | parent::add_champs('competenceFormation','type=chaine;'); 41 | parent::add_champs('commentaireFormation','type=chaine;'); //commentaire associé 42 | parent::add_champs('lieuFormation','type=chaine;'); 43 | parent::add_champs('coutFormation','type=float;'); 44 | parent::add_champs('montantOrganisme','type=float;'); 45 | parent::add_champs('montantEntreprise','type=float;'); 46 | parent::add_champs('fk_user','type=entier;'); //utilisateur concerné 47 | parent::add_champs('entity','type=entier;'); 48 | parent::_init_vars(); 49 | parent::start(); 50 | } 51 | 52 | function load_by_user_and_libelle(&$ATMdb, $fk_user, $libelleFormation){ 53 | $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."rh_formation_cv 54 | WHERE libelleFormation='".$libelleFormation."' AND fk_user=".$fk_user; 55 | $ATMdb->Execute($sql); 56 | if ($ATMdb->Get_line()) { 57 | return $this->load($ATMdb, $ATMdb->Get_field('rowid')); 58 | } 59 | return false; 60 | 61 | } 62 | } 63 | 64 | //TRH_COMPETENCES 65 | //définition de la classe pour rentrer les compétences d'un utilisateur 66 | class TRH_competence_cv extends TObjetStd { 67 | function __construct() { 68 | 69 | parent::set_table(MAIN_DB_PREFIX.'rh_competence_cv'); 70 | 71 | parent::add_champs('libelleCompetence','type=chaine;'); 72 | parent::add_champs('niveauCompetence','type=chaine;'); 73 | parent::add_champs('fk_user_formation','type=entier;'); 74 | parent::add_champs('fk_user_lignecv,fk_soc,fk_contact','type=entier;'); 75 | parent::add_champs('fk_user','type=entier;'); //utilisateur concerné 76 | parent::add_champs('entity','type=entier;'); 77 | parent::_init_vars(); 78 | parent::start(); 79 | 80 | $this->TNiveauCompetence = array('faible'=>'Faible','moyen'=>'Moyen','bon'=>'Bon','excellent'=>'Excellent'); 81 | } 82 | 83 | function load_by_user_and_libelle(&$ATMdb, $fk_user, $libelleCompetence){ 84 | $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."rh_competence_cv 85 | WHERE libelleCompetence='".$libelleCompetence."' AND fk_user=".$fk_user; 86 | $ATMdb->Execute($sql); 87 | if ($ATMdb->Get_line()) { 88 | return $this->load($ATMdb, $ATMdb->Get_field('rowid')); 89 | } 90 | return false; 91 | 92 | } 93 | 94 | function replaceEspaceEnPourcentage($competence){ 95 | $competence=strtolower($competence); 96 | $compSansEspace=str_replace(' ','%',$competence); 97 | return "%".$compSansEspace."%"; 98 | } 99 | 100 | //mise en forme de la recherche : suppression des espaces, rajout des % 101 | function miseEnForme($competence){ 102 | $Tcompetence=array(); 103 | foreach ($competence as $comp){ 104 | $Tcompetence[]="%".$comp."%"; 105 | } 106 | return $Tcompetence; 107 | } 108 | 109 | function separerOu($competenceOu){ 110 | $competenceOu=explode("%ou%",$competenceOu); 111 | return $competenceOu=$this->miseEnForme($competenceOu); 112 | } 113 | 114 | function separerEt($competenceEt){ 115 | $competenceEt=explode("%et%",$competenceEt); 116 | $competenceEt=$this->miseEnForme($competenceEt); 117 | //print_r($competenceEt); 118 | $k=0; 119 | foreach($competenceEt as $Comp){ 120 | if($k==0){ 121 | $sql.= "c.libelleCompetence LIKE '".$this->separerNiveau($Comp); 122 | 123 | }else{ 124 | $sql.= " OR c.libelleCompetence LIKE '".$this->separerNiveau($Comp); 125 | } 126 | $k++; 127 | } 128 | 129 | return $sql; 130 | } 131 | 132 | function separerNiveau($competence){ 133 | 134 | foreach($this->TNiveauCompetence as $niveau){ 135 | 136 | $niveau=strstr($competence,strtolower($niveau)); 137 | if($niveau!=""){ 138 | $competence=str_replace($niveau,'%',$competence); 139 | return $competence."' AND c.niveauCompetence LIKE '".$niveau."' "; 140 | } 141 | } 142 | return $competence."'"; 143 | 144 | } 145 | 146 | 147 | //renvoie la requête finale de la recherche (onglet recherche compétences) 148 | function requeteRecherche(&$ATMdb, $recherche){ 149 | global $conf; 150 | 151 | $k=0; 152 | //print_r($recherche); 153 | $sql=""; 154 | foreach($recherche as $tagRecherche){ 155 | 156 | /* TODO réécrire */ 157 | 158 | if($k==0){ 159 | $sql.="SELECT c.fk_user_formation as 'ID' , u.rowid as 'fkuser', c.rowid , c.date_cre as 'DateCre', 160 | CONCAT(u.firstname,' ',u.lastname) as 'name' ,c.libelleCompetence, c.fk_user, COUNT(*) as 'Niveau' 161 | FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."user as u 162 | WHERE c.fk_user=u.rowid AND( "; 163 | $sql.=$this->separerEt($tagRecherche). ") GROUP BY c.fk_user "; 164 | 165 | }else{ 166 | $sql.=" UNION SELECT c.fk_user_formation as 'ID' , u.rowid as 'fkuser', c.rowid , c.date_cre as 'DateCre', 167 | CONCAT(u.firstname,' ',u.lastname) as 'name' ,c.libelleCompetence, c.fk_user, COUNT(*) as 'Niveau' 168 | FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."user as u 169 | WHERE c.fk_user=u.rowid AND( "; 170 | $sql.=$this->separerEt($tagRecherche). ") GROUP BY c.fk_user "; 171 | } 172 | $k++; 173 | } 174 | 175 | $k=0; 176 | 177 | 178 | return $sql; 179 | } 180 | 181 | //va permettre la création de la requête pour les recherches stats et effectuer la recherche et obtenir les pourcentages désirés 182 | function requeteStatistique(&$ATMdb, $idGroupeRecherche, $idTagRecherche, $nomTagRecherche){ 183 | if($idTagRecherche!=0&&$idGroupeRecherche==0){ //on recherche uniquement une compétence 184 | $sql=$this->rechercheCompetenceStat($ATMdb,$nomTagRecherche); 185 | } 186 | else if($idTagRecherche!=0&&$idGroupeRecherche!=0){ //on recherche une compétence et un groupe 187 | $sql=$this->rechercheCompetenceGroupeStat($ATMdb,$nomTagRecherche, $idGroupeRecherche); 188 | } 189 | else if($idTagRecherche==0&&$idGroupeRecherche==0){ //on recherche toutes les stats dans l'entreprise 190 | $sql=$this->rechercheStatComplete($ATMdb); 191 | } 192 | return $sql; 193 | } 194 | 195 | //requete avec un tag précis recherché 196 | function rechercheCompetenceStat(&$ATMdb, $nomTagRecherche){ 197 | global $conf; 198 | 199 | $TabStat=array(); 200 | 201 | $nomTagRecherche="%".strtolower($nomTagRecherche)."%"; 202 | 203 | //on calcule le nombre d'utilisateurs total en vue des stats 204 | $sql="SELECT COUNT(rowid) as 'NombreUser' FROM ".MAIN_DB_PREFIX."user"; 205 | $ATMdb->Execute($sql); 206 | while($ATMdb->Get_line()) { 207 | $TabStat['nbUser']=$ATMdb->Get_field('NombreUser'); 208 | } 209 | 210 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 211 | //faible 212 | $sql="SELECT COUNT(rowid) as 'NombreUserFaible' FROM ".MAIN_DB_PREFIX."rh_competence_cv 213 | WHERE libelleCompetence LIKE '".$nomTagRecherche."' AND niveauCompetence LIKE 'faible'"; 214 | $ATMdb->Execute($sql); 215 | while($ATMdb->Get_line()) { 216 | $TabStat['nbUserFaible']=$ATMdb->Get_field('NombreUserFaible'); 217 | } 218 | 219 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 220 | //moyen 221 | $sql="SELECT COUNT(rowid) as 'NombreUserMoyen' FROM ".MAIN_DB_PREFIX."rh_competence_cv 222 | WHERE libelleCompetence LIKE '".$nomTagRecherche."' AND niveauCompetence LIKE 'moyen'"; 223 | $ATMdb->Execute($sql); 224 | while($ATMdb->Get_line()) { 225 | $TabStat['nbUserMoyen']=$ATMdb->Get_field('NombreUserMoyen'); 226 | } 227 | 228 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 229 | //bon 230 | $sql="SELECT COUNT(rowid) as 'NombreUserBon' FROM ".MAIN_DB_PREFIX."rh_competence_cv 231 | WHERE libelleCompetence LIKE '".$nomTagRecherche."' AND niveauCompetence LIKE 'bon'"; 232 | $ATMdb->Execute($sql); 233 | while($ATMdb->Get_line()) { 234 | $TabStat['nbUserBon']=$ATMdb->Get_field('NombreUserBon'); 235 | } 236 | 237 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 238 | //excellent 239 | $sql="SELECT COUNT(rowid) as 'NombreUserExcellent' FROM ".MAIN_DB_PREFIX."rh_competence_cv 240 | WHERE libelleCompetence LIKE '".$nomTagRecherche."' AND niveauCompetence LIKE 'excellent'"; 241 | $ATMdb->Execute($sql); 242 | while($ATMdb->Get_line()) { 243 | $TabStat['nbUserExcellent']=$ATMdb->Get_field('NombreUserExcellent'); 244 | } 245 | 246 | return $TabStat; 247 | } 248 | 249 | 250 | //requete avec un tag précis recherché et groupe précis 251 | function rechercheCompetenceGroupeStat(&$ATMdb, $nomTagRecherche, $idGroupeRecherche){ 252 | global $conf; 253 | 254 | $TabStat=array(); 255 | 256 | $nomTagRecherche="%".strtolower($nomTagRecherche)."%"; 257 | 258 | //on calcule le nombre d'utilisateurs total du groupe en vue des stats 259 | $sql="SELECT COUNT(u.rowid) as 'NombreUser' FROM ".MAIN_DB_PREFIX."user as u 260 | LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as g ON (g.fk_user = u.rowid) 261 | WHERE g.fk_usergroup = ".$idGroupeRecherche; 262 | $ATMdb->Execute($sql); 263 | while($ATMdb->Get_line()) { 264 | $TabStat['nbUser']=$ATMdb->Get_field('NombreUser'); 265 | } 266 | 267 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 268 | //faible 269 | $sql="SELECT COUNT(c.rowid) as 'NombreUserFaible' FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."usergroup_user as g 270 | WHERE g.fk_usergroup=".$idGroupeRecherche." 271 | AND g.fk_user=c.fk_user 272 | AND c.libelleCompetence LIKE '".$nomTagRecherche."' 273 | AND c.niveauCompetence LIKE 'faible'"; 274 | $ATMdb->Execute($sql); 275 | while($ATMdb->Get_line()) { 276 | $TabStat['nbUserFaible']=$ATMdb->Get_field('NombreUserFaible'); 277 | } 278 | 279 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 280 | //moyen 281 | $sql="SELECT COUNT(c.rowid) as 'NombreUserMoyen' FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."usergroup_user as g 282 | WHERE g.fk_usergroup=".$idGroupeRecherche." 283 | AND g.fk_user=c.fk_user 284 | AND c.libelleCompetence LIKE '".$nomTagRecherche."' 285 | AND c.niveauCompetence LIKE 'moyen'"; 286 | $ATMdb->Execute($sql); 287 | while($ATMdb->Get_line()) { 288 | $TabStat['nbUserMoyen']=$ATMdb->Get_field('NombreUserMoyen'); 289 | } 290 | 291 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 292 | //bon 293 | $sql="SELECT COUNT(c.rowid) as 'NombreUserBon' FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."usergroup_user as g 294 | WHERE g.fk_usergroup=".$idGroupeRecherche." 295 | AND g.fk_user=c.fk_user 296 | AND c.libelleCompetence LIKE '".$nomTagRecherche."' 297 | AND c.niveauCompetence LIKE 'bon'"; 298 | $ATMdb->Execute($sql); 299 | while($ATMdb->Get_line()) { 300 | $TabStat['nbUserBon']=$ATMdb->Get_field('NombreUserBon'); 301 | } 302 | 303 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 304 | //excellent 305 | $sql="SELECT COUNT(c.rowid) as 'NombreUserExcellent' FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."usergroup_user as g 306 | WHERE g.fk_usergroup=".$idGroupeRecherche." 307 | AND g.fk_user=c.fk_user 308 | AND c.libelleCompetence LIKE '".$nomTagRecherche."' 309 | AND c.niveauCompetence LIKE 'excellent'"; 310 | $ATMdb->Execute($sql); 311 | while($ATMdb->Get_line()) { 312 | $TabStat['nbUserExcellent']=$ATMdb->Get_field('NombreUserExcellent'); 313 | } 314 | 315 | return $TabStat; 316 | } 317 | 318 | //requete totale de statistiques 319 | function rechercheStatComplete(&$ATMdb){ 320 | global $conf; 321 | 322 | $TabStat=array(); 323 | 324 | //on récupère toutes les compétences existantes, et on en sort des stats. 325 | 326 | $sql="SELECT c.rowid, c.libelleCompetence FROM ".MAIN_DB_PREFIX."rh_competence_cv as c"; 327 | $ATMdb->Execute($sql); 328 | $TTagCompetence=array(); 329 | $TTagCompetence[0]='Tous'; 330 | while($ATMdb->Get_line()) { 331 | $TTagCompetence[$ATMdb->Get_field('rowid')]="%".strtolower($ATMdb->Get_field('libelleCompetence'))."%"; 332 | } 333 | 334 | $k=0; 335 | foreach($TTagCompetence as $tag){ //pour chaque coméptences, on recherche les stats de niveau pour tous les utilisateurs 336 | 337 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 338 | //faible 339 | $sql="SELECT COUNT(rowid) as 'NombreUserFaible' FROM ".MAIN_DB_PREFIX."rh_competence_cv 340 | WHERE libelleCompetence LIKE '".$tag."' AND niveauCompetence LIKE 'faible'"; 341 | $ATMdb->Execute($sql); 342 | while($ATMdb->Get_line()) { 343 | $TabStat[$k]['nbUserFaible']=$ATMdb->Get_field('NombreUserFaible'); 344 | } 345 | 346 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 347 | //moyen 348 | $sql="SELECT COUNT(rowid) as 'NombreUserMoyen' FROM ".MAIN_DB_PREFIX."rh_competence_cv 349 | WHERE libelleCompetence LIKE '".$tag."' AND niveauCompetence LIKE 'moyen'"; 350 | $ATMdb->Execute($sql); 351 | while($ATMdb->Get_line()) { 352 | $TabStat[$k]['nbUserMoyen']=$ATMdb->Get_field('NombreUserMoyen'); 353 | } 354 | 355 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 356 | //bon 357 | $sql="SELECT COUNT(rowid) as 'NombreUserBon' FROM ".MAIN_DB_PREFIX."rh_competence_cv 358 | WHERE libelleCompetence LIKE '".$tag."' AND niveauCompetence LIKE 'bon'"; 359 | $ATMdb->Execute($sql); 360 | while($ATMdb->Get_line()) { 361 | $TabStat[$k]['nbUserBon']=$ATMdb->Get_field('NombreUserBon'); 362 | } 363 | 364 | //on teste pour chaque difficulté, la proportion des collaborateurs concernés 365 | //excellent 366 | $sql="SELECT COUNT(rowid) as 'NombreUserExcellent' FROM ".MAIN_DB_PREFIX."rh_competence_cv 367 | WHERE libelleCompetence LIKE '".$tag."' AND niveauCompetence LIKE 'excellent'"; 368 | $ATMdb->Execute($sql); 369 | while($ATMdb->Get_line()) { 370 | $TabStat[$k]['nbUserExcellent']=$ATMdb->Get_field('NombreUserExcellent'); 371 | } 372 | $k++; 373 | } 374 | 375 | //on calcule le nombre d'utilisateurs total en vue des stats 376 | $sql="SELECT COUNT(rowid) as 'NombreUser' FROM ".MAIN_DB_PREFIX."user"; 377 | $ATMdb->Execute($sql); 378 | while($ATMdb->Get_line()){ 379 | $TabStat[$k]['nbUser']=$ATMdb->Get_field('NombreUser'); 380 | } 381 | 382 | return $TabStat; 383 | } 384 | 385 | 386 | 387 | 388 | } 389 | 390 | 391 | //TRH_REMUNERATION 392 | //définition de la classe pour rentrer les compétences d'un utilisateur 393 | class TRH_remuneration extends TObjetStd { 394 | function __construct() { 395 | 396 | parent::set_table(MAIN_DB_PREFIX.'rh_remuneration'); 397 | parent::add_champs('date_entreeEntreprise','type=date;'); 398 | 399 | parent::add_champs('date_debutRemuneration','type=date;'); 400 | parent::add_champs('date_finRemuneration','type=date;'); 401 | 402 | parent::add_champs('bruteAnnuelle','type=float;'); 403 | parent::add_champs('salaireMensuel','type=float;'); 404 | parent::add_champs('primeAnciennete','type=float;'); 405 | parent::add_champs('participation','type=float;'); 406 | parent::add_champs('autre','type=float;'); 407 | 408 | parent::add_champs('primeNoel','type=float;'); 409 | parent::add_champs('commission','type=float;'); 410 | 411 | // Nouveaux champs 412 | parent::add_champs('nbHeuresMois','type=float;'); 413 | parent::add_champs('an','type=float;'); 414 | parent::add_champs('coutGlobal','type=float;'); 415 | parent::add_champs('cumHeureTrav','type=float;'); 416 | parent::add_champs('cumHSup','type=float;'); 417 | parent::add_champs('HS,net_a_payer','type=float;'); 418 | 419 | 420 | /*parent::add_champs('prevoyancePartSalariale','type=chaine;'); 421 | parent::add_champs('prevoyancePartPatronale','type=chaine;'); 422 | parent::add_champs('urssafPartSalariale','type=chaine;'); 423 | parent::add_champs('urssafPartPatronale','type=chaine;'); 424 | parent::add_champs('retraitePartSalariale','type=chaine;'); 425 | parent::add_champs('retraitePartPatronale','type=chaine;'); 426 | parent::add_champs('mutuellePartSalariale','type=chaine;'); 427 | parent::add_champs('mutuellePartPatronale','type=chaine;'); 428 | parent::add_champs('diversPartSalariale','type=chaine;'); 429 | parent::add_champs('diversPartPatronale','type=chaine;');*/ 430 | 431 | parent::add_champs('charges','type=float;'); 432 | 433 | parent::add_champs('commentaire','type=chaine;'); 434 | parent::add_champs('fk_user','type=entier;'); 435 | parent::add_champs('entity','type=entier;'); 436 | 437 | parent::_init_vars(); 438 | parent::start(); 439 | } 440 | 441 | 442 | function load_by_user_and_dates(&$ATMdb, $fk_user, $debut, $fin, $verif_date_fin=true){ 443 | $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."rh_remuneration 444 | WHERE date_debutRemuneration = '".date("Y-m-d",$debut)."'"; 445 | if($verif_date_fin) $sql.= " AND date_finRemuneration = '".date("Y-m-d",$fin)."' "; 446 | $sql.= " AND fk_user=".$fk_user; 447 | $ATMdb->Execute($sql); 448 | if ($ATMdb->Get_line()) { 449 | return $this->load($ATMdb, $ATMdb->Get_field('rowid')); 450 | } 451 | return false; 452 | 453 | } 454 | 455 | static function getFields(&$ATMdb) { 456 | $fields = array( 457 | -1=>"" 458 | ,'nom_user'=>'nom_user' 459 | ,'prenom_user'=>'prenom_user' 460 | ,'prime_user'=>'prime_user' 461 | ); 462 | 463 | $sql = 'SHOW COLUMNS FROM ' . MAIN_DB_PREFIX . 'rh_remuneration'; 464 | 465 | $ATMdb->Execute($sql); 466 | 467 | while ($column = $ATMdb->Get_line()) { 468 | $fields[] = $column->Field; 469 | } 470 | 471 | return $fields; 472 | } 473 | 474 | } 475 | 476 | 477 | //TRH_REMUNERATION 478 | //définition de la classe pour rentrer les compétences d'un utilisateur 479 | class TRH_remunerationPrime extends TObjetStd { 480 | function __construct() { 481 | 482 | parent::set_table(MAIN_DB_PREFIX.'rh_remuneration_prime'); 483 | parent::add_champs('date_prime','type=date;'); 484 | parent::add_champs('montant','type=float;'); 485 | 486 | parent::add_champs('motif'); 487 | 488 | 489 | parent::add_champs('fk_user','type=entier;'); 490 | parent::add_champs('entity','type=entier;'); 491 | 492 | parent::_init_vars(); 493 | parent::start(); 494 | } 495 | 496 | 497 | function load_by_user_and_dates(&$ATMdb, $fk_user, $date){ 498 | $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."rh_remuneration_prime 499 | WHERE date_prime = '".date("Y-m-d",$date)."' 500 | AND fk_user=".$fk_user; 501 | $ATMdb->Execute($sql); 502 | if ($ATMdb->Get_line()) { 503 | return $this->load($ATMdb, $ATMdb->Get_field('rowid')); 504 | } 505 | return false; 506 | 507 | } 508 | 509 | } 510 | 511 | //TRH_DIF 512 | //définition de la classe décrivant les lignes de CV d'un utilisateur 513 | class TRH_dif extends TObjetStd { 514 | function __construct() { 515 | 516 | parent::set_table(MAIN_DB_PREFIX.'rh_dif'); 517 | parent::add_champs('annee','type=entier;'); 518 | parent::add_champs('nb_heures_acquises','type=entier;'); 519 | parent::add_champs('nb_heures_prises','type=entier;'); 520 | parent::add_champs('nb_heures_restantes','type=entier;'); 521 | parent::add_champs('fk_user','type=entier;'); 522 | parent::add_champs('entity','type=entier;'); 523 | 524 | parent::_init_vars(); 525 | parent::start(); 526 | } 527 | 528 | function load_by_user_and_annee(&$ATMdb, $fk_user, $annee){ 529 | $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."rh_dif 530 | WHERE annee='".$annee."' AND fk_user=".$fk_user; 531 | $ATMdb->Execute($sql); 532 | if ($ATMdb->Get_line()) { 533 | return $this->load($ATMdb, $ATMdb->Get_field('rowid')); 534 | } 535 | return false; 536 | 537 | } 538 | } 539 | -------------------------------------------------------------------------------- /experience.php: -------------------------------------------------------------------------------- 1 | load('competence@competence'); 10 | $langs->load("users"); 11 | 12 | if (!$user->rights->curriculumvitae->myactions->skill) accessforbidden(); 13 | 14 | $ATMdb=new TPDOdb; 15 | $lignecv=new TRH_ligne_cv; 16 | $formation=new TRH_formation_cv; 17 | $tagCompetence=new TRH_competence_cv; 18 | $tagCompetenceCV=new TRH_competence_cv; 19 | $dif=new TRH_dif; 20 | 21 | if(isset($_REQUEST['action'])) { 22 | 23 | switch($_REQUEST['action']) { 24 | case 'add': 25 | case 'newlignecv': 26 | //$ATMdb->db->debug=true; 27 | $lignecv->load($ATMdb, $_REQUEST['id']); 28 | $lignecv->set_values($_REQUEST); 29 | _ficheCV($ATMdb, $lignecv, $tagCompetenceCV,'edit'); 30 | break; 31 | case 'newformationcv': 32 | //$ATMdb->db->debug=true; 33 | $formation->load($ATMdb, $_REQUEST['id']); 34 | $formation->set_values($_REQUEST); 35 | _ficheFormation($ATMdb, $formation, $tagCompetence, 'edit'); 36 | break; 37 | case 'newDIF': 38 | //$ATMdb->db->debug=true; 39 | $dif->load($ATMdb, $_REQUEST['id']); 40 | $dif->set_values($_REQUEST); 41 | _ficheDIF($ATMdb, $dif, 'edit'); 42 | break; 43 | 44 | case 'editFormation': 45 | //$ATMdb->db->debug=true; 46 | $formation->load($ATMdb, $_REQUEST['id']); 47 | _ficheFormation($ATMdb, $formation,$tagCompetence,'edit'); 48 | break; 49 | case 'editCv': 50 | //$ATMdb->db->debug=true; 51 | $lignecv->load($ATMdb, $_REQUEST['id']); 52 | _ficheCV($ATMdb, $lignecv, $tagCompetenceCV,'edit'); 53 | break; 54 | case 'editDIF': 55 | //$ATMdb->db->debug=true; 56 | $dif->load($ATMdb, $_REQUEST['id']); 57 | _ficheDIF($ATMdb, $dif,'edit'); 58 | break; 59 | 60 | case 'savecv': 61 | $lignecv->load($ATMdb, $_REQUEST['id']); 62 | $lignecv->set_values($_REQUEST); 63 | $mesg = '
    Ligne de CV ajoutée
    '; 64 | $lignecv->save($ATMdb); 65 | _liste($ATMdb, $lignecv, $formation, $dif); 66 | //_ficheCV($ATMdb, $lignecv,$mode); 67 | break; 68 | case 'saveformation': 69 | $formation->load($ATMdb, $_REQUEST['id']); 70 | $formation->set_values($_REQUEST); 71 | $mesg = '
    Nouvelle formation ajoutée
    '; 72 | $mode = 'view'; 73 | $formation->save($ATMdb); 74 | _liste($ATMdb, $lignecv, $formation, $dif); 75 | break; 76 | case 'savecompetence': 77 | $formation->load($ATMdb, $_REQUEST['idForm']); 78 | $formation->set_values($_REQUEST); 79 | $formation->save($ATMdb); 80 | 81 | $tagCompetence->load($ATMdb, $_REQUEST['addId']); 82 | $tagCompetence->set_values($_REQUEST); 83 | $tagCompetence->save($ATMdb); 84 | 85 | $mesg = '
    Nouvelle compétence ajoutée
    '; 86 | $mode = 'view'; 87 | 88 | _ficheFormation($ATMdb, $formation , $tagCompetence, 'edit'); 89 | //_ficheCV($ATMdb, $competence,$mode); 90 | break; 91 | case 'saveDIF': 92 | $dif->load($ATMdb, $_REQUEST['id']); 93 | $dif->set_values($_REQUEST); 94 | $mesg = '
    Nouvelle fiche de DIF ajoutée
    '; 95 | $mode = 'view'; 96 | $dif->save($ATMdb); 97 | _liste($ATMdb, $lignecv, $formation, $dif); 98 | break; 99 | 100 | case 'newCompetence': 101 | if ($_REQUEST['TNComp']['libelle']!=''){ 102 | if($_REQUEST['id']!=0){ 103 | $formation->load($ATMdb, $_REQUEST['id']); 104 | $formation->set_values($_REQUEST); 105 | $formation->save($ATMdb); 106 | 107 | $tagCompetence->set_values($_REQUEST); 108 | $tagCompetence->libelleCompetence=$_REQUEST['TNComp']['libelle']; 109 | $tagCompetence->fk_user_formation=$_REQUEST['TNComp']['fk_user_formation']; 110 | $tagCompetence->save($ATMdb); 111 | } 112 | else{ 113 | $formation->set_values($_REQUEST); 114 | $formation->save($ATMdb); 115 | 116 | $tagCompetence->set_values($_REQUEST); 117 | $tagCompetence->libelleCompetence=$_REQUEST['TNComp']['libelle']; 118 | $tagCompetence->fk_user_formation=$formation->getId(); 119 | $tagCompetence->save($ATMdb); 120 | } 121 | 122 | _ficheFormation($ATMdb, $formation,$tagCompetence,'edit'); 123 | } 124 | else{ 125 | $formation->load($ATMdb, $_REQUEST['id']); 126 | $formation->set_values($_REQUEST); 127 | $mesg = '
    Nouvelle formation ajoutée
    '; 128 | $mode = 'view'; 129 | 130 | $formation->save($ATMdb); 131 | _liste($ATMdb, $lignecv, $formation, $dif); 132 | } 133 | break; 134 | 135 | case 'newCompetenceCV': 136 | 137 | if ($_REQUEST['TNComp']['libelle']!=''){ 138 | if($_REQUEST['id']!=0){ 139 | $lignecv->load($ATMdb, $_REQUEST['id']); 140 | $lignecv->set_values($_REQUEST); 141 | $lignecv->save($ATMdb); 142 | 143 | $tagCompetenceCV->set_values($_REQUEST); 144 | $tagCompetenceCV->libelleCompetence=$_REQUEST['TNComp']['libelle']; 145 | $tagCompetenceCV->fk_user_lignecv=$_REQUEST['TNComp']['fk_user_lignecv']; 146 | $tagCompetenceCV->save($ATMdb); 147 | } 148 | else{ 149 | $lignecv->set_values($_REQUEST); 150 | $lignecv->save($ATMdb); 151 | 152 | $tagCompetenceCV->set_values($_REQUEST); 153 | $tagCompetenceCV->libelleCompetence=$_REQUEST['TNComp']['libelle']; 154 | $tagCompetenceCV->fk_user_lignecv=$lignecv->getId(); 155 | $tagCompetenceCV->save($ATMdb); 156 | } 157 | 158 | _ficheCV($ATMdb, $lignecv,$tagCompetenceCV,'edit'); 159 | } 160 | else{ 161 | $lignecv->load($ATMdb, $_REQUEST['id']); 162 | $lignecv->set_values($_REQUEST); 163 | $mesg = '
    Nouvelle expérience ajoutée
    '; 164 | $mode = 'view'; 165 | $lignecv->save($ATMdb); 166 | _liste($ATMdb, $lignecv, $formation, $dif); 167 | } 168 | break; 169 | 170 | case 'viewCV': 171 | $lignecv->load($ATMdb, $_REQUEST['id']); 172 | _ficheCV($ATMdb, $lignecv, $tagCompetence,'view'); 173 | break; 174 | case 'viewFormation': 175 | $formation->load($ATMdb, $_REQUEST['id']); 176 | _ficheFormation($ATMdb, $formation, $tagCompetence,'view'); 177 | break; 178 | case 'viewDIF': 179 | $dif->load($ATMdb, $_REQUEST['id']); 180 | _ficheDIF($ATMdb, $dif, 'view'); 181 | break; 182 | 183 | case 'deleteCV': 184 | //$ATMdb->db->debug=true; 185 | $sql="DELETE FROM ".MAIN_DB_PREFIX."rh_competence_cv WHERE fk_user_lignecv =".$_REQUEST['id']; 186 | $ATMdb->Execute($sql); 187 | $lignecv->load($ATMdb, $_REQUEST['id']); 188 | $lignecv->delete($ATMdb, $_REQUEST['id']); 189 | $mesg = '
    La ligne de CV a bien été supprimée
    '; 190 | _liste($ATMdb, $lignecv, $formation, $dif); 191 | break; 192 | case 'deleteFormation': 193 | //$ATMdb->db->debug=true; 194 | //on supprime tous les tags de compétences associés à cette formation 195 | $sql="DELETE FROM ".MAIN_DB_PREFIX."rh_competence_cv WHERE fk_user_formation =".$_REQUEST['id']; 196 | $ATMdb->Execute($sql); 197 | 198 | $formation->load($ATMdb, $_REQUEST['id']); 199 | $formation->delete($ATMdb, $_REQUEST['id']); 200 | $mesg = '
    La ligne de compétence a bien été supprimée
    '; 201 | _liste($ATMdb, $lignecv, $formation, $dif); 202 | break; 203 | case 'deleteDIF': 204 | //$ATMdb->db->debug=true; 205 | $dif->load($ATMdb, $_REQUEST['id']); 206 | $dif->delete($ATMdb, $_REQUEST['id']); 207 | $mesg = '
    La ligne de DIF a bien été supprimée
    '; 208 | _liste($ATMdb, $lignecv, $formation, $dif); 209 | break; 210 | 211 | case 'deleteCompetence': 212 | //$ATMdb->db->debug=true; 213 | //on supprime la compétence 214 | 215 | $tagCompetence->load($ATMdb, $_REQUEST['idForm']); 216 | $tagCompetence->delete($ATMdb, $_REQUEST['idForm']); 217 | $formation->load($ATMdb, $_REQUEST['id']); 218 | $mesg = '
    Le tag de formation a bien été supprimé
    '; 219 | _ficheFormation($ATMdb, $formation, $tagCompetence,'edit'); 220 | break; 221 | 222 | case 'deleteCompetenceCV': 223 | //$ATMdb->db->debug=true; 224 | //on supprime la compétence 225 | $tagCompetenceCV->load($ATMdb, $_REQUEST['idForm']); 226 | $tagCompetenceCV->delete($ATMdb, $_REQUEST['idForm']); 227 | $lignecv->load($ATMdb, $_REQUEST['id']); 228 | $mesg = '
    Le tag de formation a bien été supprimé
    '; 229 | _ficheCV($ATMdb, $lignecv, $tagCompetenceCV,'edit'); 230 | break; 231 | } 232 | } 233 | elseif(isset($_REQUEST['id'])) { 234 | $lignecv->load($ATMdb, $_REQUEST['id']); 235 | $formation->load($ATMdb, $_REQUEST['id']); 236 | _liste($ATMdb, $lignecv, $formation, $dif); 237 | } 238 | else { 239 | //$ATMdb->db->debug=true; 240 | $lignecv->load($ATMdb, $_REQUEST['id']); 241 | $formation->load($ATMdb, $_REQUEST['id']); 242 | _liste($ATMdb, $lignecv, $formation, $dif); 243 | } 244 | 245 | $ATMdb->close(); 246 | 247 | llxFooter(); 248 | 249 | 250 | function _liste(&$ATMdb, $lignecv, $formation, $dif) { 251 | global $langs, $conf, $db, $user; 252 | llxHeader('','Liste de vos expériences'); 253 | 254 | $fuser = new User($db); 255 | $fuser->fetch($_REQUEST['fk_user']?$_REQUEST['fk_user']:$user->id); 256 | $fuser->getrights(); 257 | 258 | $head = user_prepare_head($fuser); 259 | dol_fiche_head($head, 'competence', $langs->trans('Utilisateur'),0, 'user'); 260 | 261 | ?> 262 | 263 | 264 | 265 |
    Réf.id ?>
    Nomlastname ?>
    Prénomfirstname ?>
    266 |
    entity 274 | ." GROUP BY cv.rowid"; 275 | 276 | $TOrder = array('date_fin'=>'ASC'); 277 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 278 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 279 | 280 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 281 | //print $page; 282 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 283 | 284 | $r->liste($ATMdb, $sql, array( 285 | 'limit'=>array( 286 | 'page'=>$page 287 | ,'nbLine'=>'30' 288 | ) 289 | ,'link'=>array( 290 | 'libelleExperience'=>'@val@' 291 | ,'Supprimer'=>'' 292 | ) 293 | ,'translate'=>array( 294 | ) 295 | ,'hide'=>array('DateCre', 'fk_user', 'ID') 296 | ,'type'=>array('date_debut'=>'date', 'date_fin'=>'date') 297 | ,'liste'=>array( 298 | 'titre'=>'Visualisation de votre CV' 299 | ,'image'=>img_picto('','title.png', '', 0) 300 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 301 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 302 | ,'noheader'=> (int)isset($_REQUEST['socid']) 303 | ,'messageNothing'=>"Aucune expérience professionnelle" 304 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 305 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 306 | ,'picto_search'=>'' 307 | 308 | ) 309 | ,'title'=>array( 310 | 'date_debut'=>'Date début' 311 | ,'date_fin'=>'Date Fin' 312 | ,'libelleExperience'=>'Libellé Expérience' 313 | ,'descriptionExperience'=>'Description Expérience' 314 | ,'lieuExperience'=>'Lieu' 315 | ) 316 | ,'search'=>array( 317 | 'date_debut'=>array('recherche'=>'calendar') 318 | 319 | ) 320 | ,'orderBy'=>$TOrder 321 | 322 | )); 323 | 324 | ?> 325 | Ajouter une expérience
    326 |
    327 | end(); 329 | 330 | 331 | ////////////AFFICHAGE DES FORMATIONS 332 | $r = new TSSRenderControler($formation); 333 | $sql="SELECT cv.rowid as 'ID', cv.date_cre as 'DateCre', 334 | cv.date_debut, date_fin, cv.libelleFormation, GROUP_CONCAT(tag.libelleCompetence) as 'Compétences', cv.commentaireFormation,cv.lieuFormation 335 | , CONCAT(CAST(cv.coutFormation as DECIMAL(16,2)),' €') as 'Coût total' 336 | , CONCAT(CAST(cv.montantOrganisme as DECIMAL(16,2)),' €') as 'Pris en charge par l\'organisme' 337 | , CONCAT(CAST(cv.montantEntreprise as DECIMAL(16,2)),' €') as 'Pris pris en charge par l\'entreprise' 338 | , cv.fk_user, '' as 'Supprimer' 339 | FROM ".MAIN_DB_PREFIX."rh_formation_cv cv LEFT JOIN ".MAIN_DB_PREFIX."rh_competence_cv tag ON (tag.fk_user_formation = cv.rowid) 340 | WHERE cv.fk_user=".$_REQUEST['fk_user']." AND cv.entity=".$conf->entity; 341 | 342 | $TOrder = array('ID'=>'DESC'); 343 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 344 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 345 | 346 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 347 | //print $page; 348 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 349 | 350 | $r->liste($ATMdb, $sql, array( 351 | 'limit'=>array( 352 | 'page'=>$page 353 | ,'nbLine'=>'30' 354 | ) 355 | ,'link'=>array( 356 | 'libelleFormation'=>'@val@' 357 | ,'ID'=>'@val@' 358 | ,'Supprimer'=>'' 359 | ) 360 | ,'translate'=>array( 361 | ) 362 | ,'hide'=>array('DateCre','fk_user', 'commentaireFormation', 'ID') 363 | ,'type'=>array('date_debut'=>'date', 'date_fin'=>'date', 'date_formationEcheance'=>'date') 364 | ,'liste'=>array( 365 | 'titre'=>'Liste de vos formations effectuées' 366 | ,'image'=>img_picto('','title.png', '', 0) 367 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 368 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 369 | ,'noheader'=> (int)isset($_REQUEST['socid']) 370 | ,'messageNothing'=>"Aucune formation suivie" 371 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 372 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 373 | ,'picto_search'=>'' 374 | 375 | ) 376 | ,'title'=>array( 377 | 'date_debut'=>'Date début' 378 | ,'date_fin'=>'Date Fin' 379 | ,'libelleFormation'=>'Libellé Formation' 380 | ,'competenceFormation'=>'Compétences' 381 | ,'commentaireFormation'=>'Commentaires' 382 | ,'lieuFormation'=>'Lieu' 383 | ,'date_formationEcheance'=>'Date d\'échéance' 384 | ) 385 | ,'search'=>array( 386 | 'date_debut'=>array('recherche'=>'calendar') 387 | 388 | ) 389 | ,'orderBy'=>$TOrder 390 | 391 | )); 392 | ?> 393 | Ajouter une formation
    394 |
    395 | rights->curriculumvitae->myactions->consulterOwnDif=="1")&&($user->id==$fuser->id))||($user->rights->curriculumvitae->myactions->consulterAllDif=="1")){ 399 | $r = new TSSRenderControler($dif); 400 | $sql="SELECT rowid as 'ID' 401 | ,annee 402 | ,nb_heures_acquises 403 | ,nb_heures_prises 404 | ,nb_heures_restantes 405 | ,fk_user"; 406 | if($user->rights->curriculumvitae->myactions->gererDif=="1"){ 407 | $sql.=",'' as 'Supprimer'"; 408 | } 409 | $sql.=" FROM ".MAIN_DB_PREFIX."rh_dif 410 | WHERE fk_user=".$_REQUEST['fk_user']." AND entity=".$conf->entity; 411 | 412 | $TOrder = array('ID'=>'DESC'); 413 | if(isset($_REQUEST['orderDown']))$TOrder = array($_REQUEST['orderDown']=>'DESC'); 414 | if(isset($_REQUEST['orderUp']))$TOrder = array($_REQUEST['orderUp']=>'ASC'); 415 | 416 | $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; 417 | $form=new TFormCore($_SERVER['PHP_SELF'],'formtranslateList','GET'); 418 | 419 | $r->liste($ATMdb, $sql, array( 420 | 'limit'=>array( 421 | 'page'=>$page 422 | ,'nbLine'=>'30' 423 | ) 424 | ,'link'=>array( 425 | 'annee'=>'@val@' 426 | ,'nb_heures_acquises'=>'@val@h' 427 | ,'nb_heures_prises'=>'@val@h' 428 | ,'nb_heures_restantes'=>'@val@h' 429 | ,'ID'=>'@val@' 430 | ,'Supprimer'=>'' 431 | ) 432 | ,'translate'=>array( 433 | ) 434 | ,'hide'=>array('fk_user', 'ID') 435 | ,'type'=>array() 436 | ,'liste'=>array( 437 | 'titre'=>'Liste de vos fiches de DIF' 438 | ,'image'=>img_picto('','title.png', '', 0) 439 | ,'picto_precedent'=>img_picto('','back.png', '', 0) 440 | ,'picto_suivant'=>img_picto('','next.png', '', 0) 441 | ,'noheader'=> (int)isset($_REQUEST['socid']) 442 | ,'messageNothing'=>"Aucune fiche de DIF disponible" 443 | ,'order_down'=>img_picto('','1downarrow.png', '', 0) 444 | ,'order_up'=>img_picto('','1uparrow.png', '', 0) 445 | ,'picto_search'=>'' 446 | 447 | ) 448 | ,'title'=>array( 449 | 'annee'=>'Année' 450 | ,'nb_heures_acquises'=>'Nombre d\'heures acquises' 451 | ,'nb_heures_prises'=>'Nombre d\'heures prises' 452 | ,'nb_heures_restantes'=>'Nombre d\'heures restantes' 453 | ) 454 | ,'search'=>array() 455 | ,'orderBy'=>$TOrder 456 | 457 | )); 458 | 459 | if($user->rights->curriculumvitae->myactions->gererDif=="1"){ 460 | ?>Ajouter une fiche de DIF


    fetch(isset($_REQUEST['fk_user']) ? $_REQUEST['fk_user'] : $lignecv->fk_user); 476 | $fuser->getrights(); 477 | 478 | $head = user_prepare_head($fuser); 479 | $current_head = 'competence'; 480 | dol_fiche_head($head, $current_head, $langs->trans('Utilisateur'),0, 'user'); 481 | 482 | ?> 483 | 484 | 485 | 486 |
    Réf.id ?>
    Nomlastname ?>
    Prénomfirstname ?>
    487 |
    Set_typeaff($mode); 491 | echo $form->hidden('id', $lignecv->getId()); 492 | echo $form->hidden('fk_user', $_REQUEST['fk_user'] ? $_REQUEST['fk_user'] : $user->id); 493 | echo $form->hidden('entity', $conf->entity); 494 | echo $form->hidden('action', 'savecv'); 495 | 496 | 497 | $sql="SELECT c.rowid, c.libelleCompetence, c.niveauCompetence FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."rh_ligne_cv as f 498 | WHERE c.fk_user_lignecv=".$lignecv->getID(). " AND c.fk_user_lignecv=f.rowid AND c.fk_user=".$fuser->id; 499 | $k=0; 500 | $ATMdb->Execute($sql); 501 | $TTagCompetence=array(); 502 | while($ATMdb->Get_line()) { 503 | $TTagCompetence[]=array( 504 | 'id'=>$ATMdb->Get_field('rowid') 505 | ,'libelleCompetence'=>$ATMdb->Get_field('libelleCompetence') 506 | ,'niveauCompetence'=>$ATMdb->Get_field('niveauCompetence') 507 | ); 508 | $k++; 509 | } 510 | 511 | $TNComp=array(); 512 | 513 | 514 | $TBS=new TTemplateTBS(); 515 | print $TBS->render('./tpl/cv.tpl.php' 516 | ,array( 517 | 'TCompetence'=>$TTagCompetence 518 | ) 519 | ,array( 520 | 'cv'=>array( 521 | 'id'=>$lignecv->getId() 522 | ,'date_debut'=>$form->calendrier('', 'date_debut', $lignecv->date_debut, 12) 523 | ,'date_fin'=>$form->calendrier('', 'date_fin', $lignecv->date_fin, 12) 524 | ,'libelleExperience'=>$form->texte('','libelleExperience',$lignecv->libelleExperience, 50,100,'','','-') 525 | ,'descriptionExperience'=>$form->zonetexte('','descriptionExperience',$lignecv->descriptionExperience, 44,3,'','','-') 526 | ,'lieuExperience'=>$form->texte('','lieuExperience',$lignecv->lieuExperience, 50,100,'','','-') 527 | ,'titre'=>load_fiche_titre("Expérience professionnelle",'', 'title.png', 0, '') 528 | ) 529 | ,'userCourant'=>array( 530 | 'id'=>$_REQUEST['fk_user'] ? $_REQUEST['fk_user'] : $user->id 531 | ) 532 | ,'user'=>array( 533 | 'id'=>$fuser->id 534 | ,'lastname'=>$fuser->lastname 535 | ,'firstname'=>$fuser->firstname 536 | ) 537 | ,'view'=>array( 538 | 'mode'=>$mode 539 | ) 540 | ,'newCompetence'=>array( 541 | 'hidden'=>$form->hidden('action', 'newCompetenceCV') 542 | ,'id'=>$k 543 | ,'libelleCompetence'=>$form->texte('Libellé','TNComp[libelle]','', 40,100,'','','-') 544 | ,'fk_user_lignecv'=>$form->hidden('TNComp[fk_user_lignecv]', $lignecv->getId()) 545 | ,'niveauCompetence'=>$form->combo(' Niveau ','niveauCompetence',$tagCompetence->TNiveauCompetence,'') 546 | ) 547 | ) 548 | ); 549 | 550 | echo $form->end_form(); 551 | 552 | global $mesg, $error; 553 | dol_htmloutput_mesg($mesg, '', ($error ? 'error' : 'ok')); 554 | llxFooter(); 555 | } 556 | 557 | 558 | 559 | 560 | function _ficheFormation(&$ATMdb, $formation, $tagCompetence, $mode) { 561 | global $db,$user, $langs, $conf; 562 | llxHeader('','Formations'); 563 | 564 | $fuser = new User($db); 565 | $fuser->fetch(isset($_REQUEST['fk_user']) ? $_REQUEST['fk_user'] : $formation->fk_user); 566 | $fuser->getrights(); 567 | 568 | $head = user_prepare_head($fuser); 569 | $current_head = 'competence'; 570 | dol_fiche_head($head, $current_head, $langs->trans('Utilisateur'),0, 'user'); 571 | 572 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 573 | $form->Set_typeaff($mode); 574 | echo $form->hidden('id', $formation->getId()); 575 | echo $form->hidden('action', 'saveformation'); 576 | echo $form->hidden('fk_user',$_REQUEST['fk_user'] ? $_REQUEST['fk_user'] : $user->id); 577 | echo $form->hidden('entity', $conf->entity); 578 | 579 | $sql="SELECT c.rowid, c.libelleCompetence, c.niveauCompetence FROM ".MAIN_DB_PREFIX."rh_competence_cv as c, ".MAIN_DB_PREFIX."rh_formation_cv as f 580 | WHERE c.fk_user_formation=".$formation->getID(). " AND c.fk_user_formation=f.rowid AND c.fk_user=".$fuser->id; 581 | 582 | $k=0; 583 | $ATMdb->Execute($sql); 584 | $TTagCompetence=array(); 585 | while($ATMdb->Get_line()) { 586 | $TTagCompetence[]=array( 587 | 'id'=>$ATMdb->Get_field('rowid') 588 | ,'libelleCompetence'=>$ATMdb->Get_field('libelleCompetence') 589 | ,'niveauCompetence'=>$ATMdb->Get_field('niveauCompetence') 590 | ); 591 | $k++; 592 | } 593 | 594 | $TNComp=array(); 595 | 596 | $TBS=new TTemplateTBS(); 597 | print $TBS->render('./tpl/formation.tpl.php' 598 | ,array( 599 | 'TCompetence'=>$TTagCompetence 600 | ) 601 | ,array( 602 | 'formation'=>array( 603 | 'id'=>$formation->getId() 604 | ,'date_debut'=>$form->calendrier('', 'date_debut', $formation->date_debut, 12) 605 | ,'date_fin'=>$form->calendrier('', 'date_fin', $formation->date_fin, 12) 606 | ,'libelleFormation'=>$form->texte('','libelleFormation',$formation->libelleFormation, 50,100,'','','') 607 | ,'coutFormation'=>$form->texte('','coutFormation',$formation->coutFormation, 10,50,'','','0') 608 | ,'montantOrganisme'=>$form->texte('','montantOrganisme',$formation->montantOrganisme, 10,50,'','','0') 609 | ,'montantEntreprise'=>$form->texte('','montantEntreprise',$formation->montantEntreprise, 10,50,'','','0') 610 | ,'commentaireFormation'=>$form->zonetexte('','commentaireFormation',$lignecv->commentaireFormation, 45,3,'','','') 611 | ,'lieuFormation'=>$form->texte('','lieuFormation',$formation->lieuFormation, 50,100,'','','') 612 | ,'date_formationEcheance'=>$form->calendrier('', 'date_formationEcheance', $formation->date_formationEcheance, 12) 613 | ,'titre'=>load_fiche_titre("Description de la formation",'', 'title.png', 0, '') 614 | ) 615 | ,'userCourant'=>array( 616 | 'id'=>$fuser->id 617 | ,'nom'=>$fuser->lastname 618 | ,'prenom'=>$fuser->firstname 619 | ) 620 | ,'user'=>array( 621 | 'id'=>$fuser->id 622 | ,'lastname'=>$fuser->lastname 623 | ,'firstname'=>$fuser->firstname 624 | ) 625 | ,'view'=>array( 626 | 'mode'=>$mode 627 | ) 628 | ,'newCompetence'=>array( 629 | 'hidden'=>$form->hidden('action', 'newCompetence') 630 | ,'id'=>$k 631 | ,'libelleCompetence'=>$form->texte('Libellé','TNComp[libelle]','', 40,100,'','','-') 632 | ,'fk_user_formation'=>$form->hidden('TNComp[fk_user_formation]', $formation->getId()) 633 | ,'niveauCompetence'=>$form->combo(' Niveau ','niveauCompetence',$tagCompetence->TNiveauCompetence,'') 634 | ) 635 | ) 636 | ); 637 | 638 | echo $form->end_form(); 639 | 640 | global $mesg, $error; 641 | dol_htmloutput_mesg($mesg, '', ($error ? 'error' : 'ok')); 642 | llxFooter(); 643 | } 644 | 645 | 646 | 647 | function _ficheDIF(&$ATMdb, $dif, $mode) { 648 | global $db,$user, $langs, $conf; 649 | llxHeader('','DIF'); 650 | 651 | $fuser = new User($db); 652 | $fuser->fetch(isset($_REQUEST['fk_user']) ? $_REQUEST['fk_user'] : $dif->fk_user); 653 | $fuser->getrights(); 654 | 655 | $head = user_prepare_head($fuser); 656 | $current_head = 'competence'; 657 | dol_fiche_head($head, $current_head, $langs->trans('Utilisateur'),0, 'user'); 658 | 659 | $form=new TFormCore($_SERVER['PHP_SELF'],'form1','POST'); 660 | $form->Set_typeaff($mode); 661 | echo $form->hidden('id', $dif->getId()); 662 | echo $form->hidden('action', 'saveDIF'); 663 | echo $form->hidden('fk_user',$_REQUEST['fk_user'] ? $_REQUEST['fk_user'] : $user->id); 664 | echo $form->hidden('entity', $conf->entity); 665 | 666 | $TBS=new TTemplateTBS(); 667 | print $TBS->render('./tpl/dif.tpl.php' 668 | ,array( 669 | ) 670 | ,array( 671 | 'dif'=>array( 672 | 'id'=>$dif->getId() 673 | ,'annee'=>$form->texte('','annee',$dif->annee, 10,50,'','','-') 674 | ,'nb_heures_acquises'=>$form->texte('','nb_heures_acquises',$dif->nb_heures_acquises, 10,50,'','','-') 675 | ,'nb_heures_prises'=>$form->texte('','nb_heures_prises',$dif->nb_heures_prises, 10,50,'','','-') 676 | ,'nb_heures_restantes'=>$form->texte('','nb_heures_restantes',$dif->nb_heures_restantes, 10,50,'','','-') 677 | ,'titre'=>load_fiche_titre("Fiche de DIF",'', 'title.png', 0, '') 678 | ) 679 | ,'userCourant'=>array( 680 | 'id'=>$fuser->id 681 | ,'nom'=>$fuser->lastname 682 | ,'prenom'=>$fuser->firstname 683 | ) 684 | ,'user'=>array( 685 | 'id'=>$fuser->id 686 | ,'lastname'=>$fuser->lastname 687 | ,'firstname'=>$fuser->firstname 688 | ) 689 | ,'view'=>array( 690 | 'mode'=>$mode 691 | ,'userRight'=>((int)$user->rights->curriculumvitae->myactions->gererDif) 692 | ) 693 | ) 694 | ); 695 | 696 | echo $form->end_form(); 697 | 698 | global $mesg, $error; 699 | dol_htmloutput_mesg($mesg, '', ($error ? 'error' : 'ok')); 700 | llxFooter(); 701 | } 702 | 703 | --------------------------------------------------------------------------------