Esempio n. 1
0
 function Arbo_construire($code_arbo = '', $type = 'article')
 {
     /*=============*/
     Lib_myLog("Recuperation de l'arbo a partir de la BDD");
     if ($type == 'tache') {
         // On récupère tous les taches de la base
         $args_taches['id_tache'] = '*';
         $liste_taches = Taches_chercher($args_taches);
         $tab_intitules = array();
         foreach ($liste_taches as $tache) {
             $tab_intitules[$tache['id_tache']] = $tache['titre'];
             $tab_etats[$tache['id_tache']] = $tache['etat'];
             $tab_priorites[$tache['id_tache']] = $tache['data1'];
         }
     }
     if ($type == 'article') {
         // On récupère tous les articles de la base
         $args_articles['id_article'] = '*';
         $liste_articles = Articles_chercher($args_articles);
         $tab_intitules = array();
         $tab_urls = array();
         foreach ($liste_articles as $article) {
             $tab_intitules[$article['id_article']] = $article['titre'];
             $tab_etats[$article['id_article']] = $article['etat'];
             $tab_urls[$article['id_article']] = $article['meta_url'];
         }
     }
     $sql = " SELECT * \n\t\t\tFROM " . $GLOBALS['prefix'] . "arbo\n\t\t\tWHERE code_arbo = '{$code_arbo}'\n\t\t\tORDER BY famille ASC, ordre ASC";
     $result = Sql_query($sql);
     $tab_sql = array();
     if ($result && Sql_errorCode($result) === "00000") {
         while ($row = Sql_fetch($result)) {
             $id = $row['id_arbo'];
             $id_pere = $row['id_pere'];
             $type_pere = $row['type_pere'];
             $tab_sql[$id]["id_arbo"] = $id;
             $tab_sql[$id]["id_arbo_pere"] = $row['id_arbo_pere'];
             $tab_sql[$id]["code_arbo"] = $row['code_arbo'];
             $tab_sql[$id]["famille"] = $row['famille'];
             $tab_sql[$id]["id_pere"] = $id_pere;
             if ($type == 'tache') {
                 $tab_sql[$id]["tache"] = $liste_taches[$id_pere];
             }
             if ($type == 'article') {
                 $tab_sql[$id]["article"] = $liste_articles[$id_pere];
             }
             $tab_sql[$id]["type_pere"] = $type_pere;
             $tab_sql[$id]["ordre"] = $row['ordre'];
             $tab_sql[$id]["couleur"] = $row['couleur'];
             $tab_sql[$id]["etat"] = ($type_pere == 'article' || $type_pere == 'tache') && isset($tab_etats[$id_pere]) && $tab_etats[$id_pere] != '' ? $tab_etats[$id_pere] : $row['etat'];
             $tab_sql[$id]["intitule"] = ($type_pere == 'article' || $type_pere == 'tache') && isset($tab_intitules[$id_pere]) && $tab_intitules[$id_pere] != '' ? $tab_intitules[$id_pere] : Sql_prepareTexteAffichage($row['intitule']);
             $tab_sql[$id]["intitule_canonize"] = $row['intitule_canonize'];
             $tab_sql[$id]["priorite"] = $type_pere == 'tache' && isset($tab_priorites[$id_pere]) && $tab_priorites[$id_pere] != '' ? $tab_priorites[$id_pere] : '';
             if ($type_pere == 'tache' && isset($tab_etats[$id_pere]) && $tab_etats[$id_pere] == 'inactif') {
                 if ($row['famille'] != '' && $row['id_arbo_pere'] == 0) {
                     $tab_famille = explode('-', $row['famille']);
                     $index_pere = count($tab_famille) - 2;
                     $tab_sql[$tab_famille[$index_pere]]['nb_taches_a_faire']++;
                     if (!empty($tab_famille[$index_pere - 1])) {
                         $tab_sql[$tab_famille[$index_pere - 1]]['nb_taches_a_faire']++;
                     }
                 } else {
                     $tab_sql[$id]['nb_taches_a_faire'] = 0;
                 }
             }
             if ($type_pere == 'tache' && isset($tab_etats[$id_pere]) && $tab_etats[$id_pere] == 'actif') {
                 if ($row['famille'] != '' && $row['id_arbo_pere'] == 0) {
                     $tab_famille = explode('-', $row['famille']);
                     $index_pere = count($tab_famille) - 2;
                     $tab_sql[$tab_famille[$index_pere]]['nb_taches_terminees']++;
                     if (!empty($tab_famille[$index_pere - 1])) {
                         $tab_sql[$tab_famille[$index_pere - 1]]['nb_taches_terminees']++;
                     }
                 } else {
                     $tab_sql[$id]['nb_taches_terminees'] = 0;
                 }
             }
             // On détermine le niveau de profondeur dans l'arborescence
             $tab_sql[$id]["niveau"] = substr_count($row['famille'], "-");
         }
     }
     /*=============*/
     Lib_myLog("Tab sql:", $tab_sql);
     /*=============*/
     Lib_myLog("Construction de l'arbo");
     $tab_result = Arbo_getTab($tab_sql, 0, '');
     return $tab_result;
 }
Esempio n. 2
0
/**
 Cette fonction est un grand switch qui sert à renvoyer vers une action donnée en paramètre. 
 @param Action : Action à accomplir…
*/
function ExecActions($action)
{
    /*=============*/
    Lib_myLog("action: ", $action);
    // On recupere la configuration issue de conf.php
    global $lang, $taille_ecran, $MSG, $secure, $cle, $config;
    // On recupere tous les objet contenant les donnees
    global $data_in, $data_out, $data_srv, $session;
    // Initialization des variables
    global $message, $tache;
    switch ($action) {
        /**
         * - Cas Site_Accueil :
         * . 
         *      Le cas (par défaut) Site_Accueil recherche tous les taches, s'occupent des critères de tri, et renvoie vers la vue (page) Site_Accueil.php....
         */
        case "Accueil":
            /*=============*/
            Lib_myLog("Recuperation de l'arborescence");
            $data_in['code_arbo'] = 'suivi';
            $data_out['liste_fils'] = Arbo_construire($data_in['code_arbo'], 'tache');
            if (isset($data_in['id_arbo_pere'])) {
                $data_out['id_arbo_pere'] = $data_in['id_arbo_pere'];
            }
            if (!isset($data_in['type_affichage'])) {
                $data_in['type_affichage'] = 'toutes';
            }
            $data_out['type_affichage'] = $data_in['type_affichage'];
            $data_out['code_arbo'] = $data_in['code_arbo'];
            $data_out['menu_gauche'] = 'arbo';
            $data_out['page'] = 'suivi.php';
            break;
        case "Element_Etat":
            $arbo = Arbo_recuperer($data_in['id_arbo']);
            $arbo->etat = $arbo->etat == 'actif' ? $arbo->etat = 'inactif' : ($arbo->etat = 'actif');
            $arbo->UPD();
            $data_out['message_ok'] = $MSG['fr']['%%arbo_UPD%%'];
            // On met à jour l'état de l'tache associé à l'élément de l'arbo sélectionné
            if ($arbo->id_pere != 0 && $arbo->type_pere == 'tache') {
                $tache = Tache_recuperer($arbo->id_pere);
                $tache->etat = $arbo->etat;
                $tache->UPD();
            }
            // On remet à 0 le fichier contenant le "cache" des taches pour l'affichage des blocs
            Lib_writeData('', "ARBO");
            //Enregistrement d'un zip par dossier racine contenant les fichiers
            $tab_ids_arbos = array($data_in['id_arbo'] => $data_in['id_arbo']);
            //			Arbo_zipDocuments('arbo_docs', $tab_ids_arbos);
            ExecActions('Accueil');
            break;
        case "Element_Bouger":
            $tab_positions = explode("|", $data_in['tab_list']);
            $i = 1;
            $tab_ids_arbos = array();
            foreach ($tab_positions as $position) {
                $projet = Arbo_recuperer($position);
                if ($projet->ordre != $i) {
                    $tab_ids_arbos[$projet->id_arbo] = $projet->id_arbo;
                }
                $projet->ordre = $i;
                $projet->UPD();
                $i++;
            }
            $data_out['message_ok'] = $MSG['fr']['%%arbo_UPD%%'];
            // On remet à 0 le fichier contenant le "cache" de l'arborescence
            Lib_writeData('', "ARBO");
            //Enregistrement d'un zip par dossier racine contenant les fichiers
            //			Arbo_zipDocuments('arbo_docs', $tab_ids_arbos);
            ExecActions('Accueil');
            break;
        case "Element_DEL":
            /*=============*/
            Lib_myLog("Recuperation de l'element");
            if ($data_in['id_arbo_pere'] != 0) {
                /*=============*/
                Lib_myLog("Suppression de de l'objet de type arbo");
                $obj_element_initial = Arbo_recuperer($data_in['id_arbo']);
                $data_out['message_ok'] = $MSG['fr']['%%arbo_DEL%%'];
            }
            if ($data_in['id_arbo_pere'] == 0) {
                /*=============*/
                Lib_myLog("Suppression des taches dans toutes les langues");
                $obj_element_initial = Arbo_recuperer_par_element($data_in['id_pere'], $data_in['type_pere'], $data_in['code_arbo']);
                // Le même tache peut être en pluisieurs langues. On les regroupe grâce au code tache
                $args_taches['code'] = 'tache-' . $obj_element_initial->id_pere;
                $liste_taches = Taches_chercher($args_taches);
                foreach ($liste_taches as $art) {
                    $tache = Tache_recuperer($art['id_tache']);
                    $tache->DEL();
                }
                $data_out['message_ok'] = $MSG['fr']['%%page_DEL%%'];
            }
            /*=============*/
            Lib_myLog("Retablissement de l'ordre sans coupure");
            $args_elements['famille'] = $obj_element_initial->famille;
            $args_elements['sup_ordre'] = $obj_element_initial->ordre;
            $args_elements['code_arbo'] = $data_in['code_arbo'];
            $elements = Arbos_chercher($args_elements);
            foreach ($elements as $element) {
                $obj_element = Arbo_recuperer($element['id_arbo']);
                $obj_element->ordre--;
                $obj_element->UPD();
            }
            $obj_element_initial->DEL();
            // On remet à 0 le fichier contenant le "cache" de l'arborescence
            Lib_writeData('', "ARBO");
            //Enregistrement d'un zip par dossier racine contenant les fichiers
            $tab_ids_arbos = array($data_in['id_arbo'] => $data_in['id_arbo']);
            //			Arbo_zipDocuments('arbo_docs',$tab_ids_arbos);
            ExecActions('Accueil');
            break;
        case "Categorie_ADD":
            $args_arbos['code_arbo'] = $data_in['code_arbo'];
            $args_arbos['famille'] = '';
            if ($data_in['id_arbo_pere'] != '') {
                /*=============*/
                Lib_myLog("Il s'agit d'un ajout de sous-element !");
                $arbo_pere = Arbo_recuperer($data_in['id_arbo_pere']);
                $args_arbos['famille'] = $arbo_pere->famille . $arbo_pere->id_arbo . '-';
            }
            /*=============*/
            Lib_myLog("On determine le nouvel ordre a attribuer au nouvel element");
            $arbos = Arbos_chercher($args_arbos);
            $ordre = count($arbos);
            $ordre++;
            /*=============*/
            Lib_myLog("Rajout d'un nouvel element");
            $arbo = new Arbo();
            if ($data_in['id_arbo_pere'] != '') {
                $arbo->famille .= $arbo_pere->famille . $arbo_pere->id_arbo . '-';
            }
            $arbo->code_arbo = $data_in['code_arbo'];
            $arbo->type_pere = 'arbo';
            $arbo->ordre = $ordre;
            $arbo->etat = 'inactif';
            $arbo->intitule = $data_in['intitule'];
            $id_arbo = $arbo->ADD();
            $data_out['message_ok'] = $MSG['fr']['%%arbo_ADD%%'];
            $arbo->id_arbo_pere = $data_in['id_arbo_pere'] != '' ? $data_in['id_arbo_pere'] : $id_arbo;
            /*=============*/
            Lib_myLog("Creation du nouvel tache associe a la categorie");
            $tache = new Tache();
            $tache->titre_page = $data_in['intitule'];
            $tache->titre = $data_in['intitule'];
            $tache->lang = 'fr';
            $tache->etat = 'actif';
            $id_tache = $tache->ADD();
            $tache = Tache_recuperer($id_tache);
            // On définit un code pour pouvoir retrouver le même tache en plusieurs langues
            $tache->code = 'tache-' . $id_tache;
            $tache->UPD();
            foreach ($GLOBALS['LANGUES'] as $langue) {
                /*=============*/
                Lib_myLog("Ajout de l'tache en {$langue}");
                $tache->lang = $langue;
                $tache->ADD();
            }
            $arbo->id_pere = $id_tache;
            $arbo->type_pere = 'tache';
            $arbo->UPD();
            // On remet à 0 le fichier contenant le "cache" de l'arborescence
            Lib_writeData('', "ARBO");
            //Enregistrement d'un zip par dossier racine contenant les fichiers
            $tab_ids_arbos = array($id_arbo => $id_arbo);
            //			Arbo_zipDocuments('arbo_docs', $tab_ids_arbos);
            ExecActions('Accueil');
            break;
        case "Categorie_UPD":
            /*=============*/
            Lib_myLog("Modification de l'intitule d'un element");
            $arbo = Arbo_recuperer($data_in['id_arbo']);
            $arbo->intitule = $data_in['intitule'];
            $arbo->UPD();
            /*=============*/
            Lib_myLog("Modification de l'tache lie a l'element");
            if ($arbo->id_pere) {
                $tache = Tache_recuperer($arbo->id_pere);
                $tache->titre = $data_in['intitule'];
                $tache->UPD();
            }
            // On remet à 0 le fichier contenant le "cache" de l'arborescence
            Lib_writeData('', "ARBO");
            //Enregistrement d'un zip par dossier racine contenant les fichiers
            $tab_ids_arbos = array($data_in['id_arbo'] => $data_in['id_arbo']);
            //			Arbo_zipDocuments('arbo_docs',$tab_ids_arbos);
            $data_out['message_ok'] = $MSG['fr']['%%arbo_UPD%%'];
            ExecActions('Accueil');
            break;
        case "SELECT_SsCategories":
            $data_out['liste_sous_categories'] = array();
            /*=============*/
            Lib_myLog("Recuperation du pere");
            $arbo_pere = Arbo_recuperer($data_in['id_arbo']);
            $args_sous['not_id_arbo_pere'] = 0;
            $args_sous['famille'] = $arbo_pere->famille . $arbo_pere->id_arbo . '-';
            $data_out['liste_sous_categories'] = Arbos_chercher($args_sous);
            $cle = 'ordre';
            $val = usort($data_out['liste_sous_categories'], "Lib_compareUp");
            $data_out['page'] = 'arbo_select_ss_categories.php';
            break;
        case "SELECT_SsSsCategories":
            $data_out['liste_sous_categories'] = array();
            /*=============*/
            Lib_myLog("Recuperation du pere");
            $arbo_pere = Arbo_recuperer($data_in['id_arbo']);
            $args_sous['not_id_arbo_pere'] = 0;
            $args_sous['famille'] = $arbo_pere->famille . $arbo_pere->id_arbo . '-';
            $data_out['liste_sous_categories'] = Arbos_chercher($args_sous);
            $cle = 'ordre';
            $val = usort($data_out['liste_sous_categories'], "Lib_compareUp");
            $data_out['page'] = 'arbo_select_ss_ss_categories.php';
            break;
        case "AJAX_ArboUPD":
            $tab_arbo = json_decode($data_in['arbo_json'], true);
            /*=============*/
            Lib_myLog("Arbo recuperee");
            Arbo_recalcul($tab_arbo);
            break;
        case "Tache_ADD":
            $F5 = Lib_checkF5($session, $data_in['timestamp']);
            $continue = $F5 ? false : true;
            if ($continue) {
                $args_arbos['code_arbo'] = $data_in['code_arbo'];
                $args_arbos['famille'] = '';
                if ($data_in['id_arbo_pere'] != 0) {
                    $arbo = Arbo_recuperer($data_in['id_arbo_pere']);
                    $args_arbos['famille'] = $arbo->famille . $arbo->id_arbo . '-';
                    $args_arbo['id_arbo'] = $data_in['id_arbo_pere'];
                    $id_categorie = $data_in['id_arbo_pere'];
                }
                // Si un id_arbo_fils est positionné, il "surclasse" l'id_pere!
                if (isset($data_in['id_arbo_fils']) && $data_in['id_arbo_fils'] != 0) {
                    $arbo = Arbo_recuperer($data_in['id_arbo_fils']);
                    $args_arbos['famille'] = $arbo->famille . $arbo->id_arbo . '-';
                    $args_arbo['id_arbo'] = $data_in['id_arbo_fils'];
                }
                if (isset($data_in['id_arbo_petit_fils']) && $data_in['id_arbo_petit_fils'] != 0) {
                    $arbo = Arbo_recuperer($data_in['id_arbo_petit_fils']);
                    $args_arbos['famille'] = $arbo->famille . $arbo->id_arbo . '-';
                    $args_arbo['id_arbo'] = $data_in['id_arbo_petit_fils'];
                }
                /*=============*/
                Lib_myLog("On determine le nouvel ordre a attribuer au nouvel element dans l'arbo");
                $arbos = Arbos_chercher($args_arbos);
                $ordre = count($arbos);
                $ordre++;
                /*=============*/
                Lib_myLog("On recupere la categorie dont va dependre l'tache");
                $arbo = Arbos_chercher($args_arbo);
                /*=============*/
                Lib_myLog("Creation du nouvel tache");
                $tache = new Tache();
                $tache->categorie = $data_in['categorie'];
                $tache->titre_page = $data_in['titre_page'];
                // On met dans le titre le titre_page par défaut. Celui-ci sera changé à l'édition de l'tache de toutes façons...
                $tache->titre = $data_in['titre_page'];
                for ($i = 1; $i <= 20; $i++) {
                    $tache->{'data' . $i} = $data_in['data' . $i];
                }
                $tache->date = $data_in['date'];
                $tache->texte = $data_in['texte'];
                $tache->lang = 'fr';
                $tache->etat = 'inactif';
                $id_tache = $tache->ADD();
                $tache = Tache_recuperer($id_tache);
                for ($i = 1; $i <= 5; $i++) {
                    if ($_FILES["fichier" . $i]["name"] != '') {
                        if ($_FILES["fichier" . $i]['error'] == 1) {
                            /*=============*/
                            Lib_myLog("Taille trop elevee");
                            $val = ini_get('upload_max_filesize');
                            $data_out['message_ko'] = $MSG['fr']['%%Erreur_Taille%%'] . " ({$val})";
                            $tache->{'fichier' . $i} = '';
                        } else {
                            if ($valid == 1) {
                                /*=============*/
                                Lib_myLog("Fichier non autorise");
                                $data_out['message_ko'] = $MSG['fr']['%%Fichier_non_autorise%%'];
                            } else {
                                /*=============*/
                                Lib_myLog("Telechargement du fichier");
                                $fichier = Lib_nettoie($_FILES["fichier" . $i]["name"]);
                                $fichier = $tache->id_tache . '_' . $fichier;
                                if (file_exists('../file_ftp/documents_suivi/' . $fichier)) {
                                    unlink('../file_ftp/documents_suivi/' . $fichier);
                                }
                                if (is_uploaded_file($_FILES["fichier" . $i]["tmp_name"])) {
                                    $tmp_fichier = $_FILES["fichier" . $i]["tmp_name"];
                                    rename($tmp_fichier, '../file_ftp/documents_suivi/' . $fichier);
                                    chmod("../file_ftp/documents_suivi/{$fichier}", 0644);
                                }
                                $tache->{'fichier' . $i} = $fichier;
                            }
                        }
                    }
                }
                // On définit un code pour pouvoir retrouver le même tache en plusieurs langues
                $tache->code = 'tache-' . $id_tache;
                $tache->UPD();
                foreach ($GLOBALS['LANGUES'] as $langue) {
                    /*=============*/
                    Lib_myLog("Ajout de l'tache en {$langue}");
                    $tache->lang = $langue;
                    $tache->ADD();
                }
                /*=============*/
                Lib_myLog("Rajout du nouvel tache dans l'arbo");
                $new_arbo = new Arbo();
                $new_arbo->code_arbo = $data_in['code_arbo'];
                $new_arbo->id_pere = $id_tache;
                $new_arbo->famille .= $arbo['famille'] . $arbo['id_arbo'] . '-';
                $new_arbo->type_pere = 'tache';
                $new_arbo->ordre = $ordre;
                $new_arbo->intitule = $data_in['titre_page'];
                $new_arbo->etat = 'inactif';
                $id_arbo = $new_arbo->ADD();
                // On remet à 0 le fichier contenant le "cache" des taches pour l'affichage des blocs
                Lib_writeData('', "TACHES");
                // On remet à 0 le fichier contenant le "cache" de l'arborescence
                Lib_writeData('', "ARBO");
                //Enregistrement d'un zip par dossier racine contenant les fichiers
                $tab_ids_arbos = array($id_arbo => $id_arbo);
                //				Arbo_zipDocuments('arbo_docs',$tab_ids_arbos);
            }
            if ($continue) {
                $data_in['id_tache'] = $id_tache;
                if (isset($data_in['code_arbo'])) {
                    header("Location: http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/actions.php?action=Accueil&code_arbo={$data_in['code_arbo']}");
                } else {
                    ExecActions('Site_Apercu');
                }
            } else {
                if ($F5) {
                    /*=============*/
                    Lib_myLog("Tentative de F5!");
                    $data_out['message_ko'] = $MSG[$lang]['%%Erreur_Revalidation%%'];
                    ExecActions('Site_Apercu');
                } else {
                    ExecActions('Site_Apercu');
                }
            }
            break;
        case "POPUP_TacheUPD":
            $data_out['tache'] = Taches_chercher(array('id_tache' => $data_in['id_tache']));
            $data_out['code_arbo'] = $data_in['code_arbo'];
            $data_out['page'] = 'popup_tache_upd.php';
            break;
        case "POPUP_CategorieUPD":
            $data_out = Arbos_chercher(array('id_arbo' => $data_in['id_arbo']));
            $data_out['code_arbo'] = $data_in['code_arbo'];
            $data_out['page'] = 'popup_arbo_categorie_upd.php';
            break;
        case "Tache_UPD":
            /*=============*/
            Lib_myLog("Modification de l'tache");
            $tache = Tache_recuperer($data_in['id_tache']);
            $tache->categorie = $data_in['categorie'];
            $tache->titre_page = $data_in['titre_page'];
            // On met dans le titre le titre_page par défaut. Celui-ci sera changé à l'édition de l'tache de toutes façons...
            $tache->titre = $data_in['titre_page'];
            for ($i = 1; $i <= 20; $i++) {
                $tache->{'data' . $i} = $data_in['data' . $i];
            }
            $tache->date = $data_in['date'];
            $tache->texte = $data_in['texte'];
            $tache->lang = 'fr';
            $tache->etat = 'inactif';
            //Si la date de mise en production est positionnee, alors la tâche est terminée
            if ($tache->data4 != '') {
                $tache->etat = 'actif';
            }
            for ($i = 1; $i <= 5; $i++) {
                if ($data_in['sup_fichier' . $i] == 1) {
                    if (file_exists('../file_ftp/documents_suivi/' . $tache->{'fichier' . $i})) {
                        unlink('../file_ftp/documents_suivi/' . $tache->{'fichier' . $i});
                    }
                    $tache->{'fichier' . $i} = '';
                }
                if ($_FILES["fichier" . $i]["name"] != '') {
                    if ($_FILES["fichier" . $i]['error'] == 1) {
                        /*=============*/
                        Lib_myLog("Taille trop elevee");
                        $val = ini_get('upload_max_filesize');
                        $data_out['message_ko'] = $MSG['fr']['%%Erreur_Taille%%'] . " ({$val})";
                        $tache->{'fichier' . $i} = '';
                    } else {
                        if ($valid == 1) {
                            /*=============*/
                            Lib_myLog("Fichier non autorise");
                            $data_out['message_ko'] = $MSG['fr']['%%Fichier_non_autorise%%'];
                        } else {
                            /*=============*/
                            Lib_myLog("Telechargement du fichier");
                            $fichier = Lib_nettoie($_FILES["fichier" . $i]["name"]);
                            $fichier = $tache->id_tache . '_' . $fichier;
                            if (file_exists('../file_ftp/documents_suivi/' . $fichier)) {
                                unlink('../file_ftp/documents_suivi/' . $fichier);
                            }
                            if (is_uploaded_file($_FILES["fichier" . $i]["tmp_name"])) {
                                $tmp_fichier = $_FILES["fichier" . $i]["tmp_name"];
                                rename($tmp_fichier, '../file_ftp/documents_suivi/' . $fichier);
                                chmod("../file_ftp/documents_suivi/{$fichier}", 0644);
                            }
                            $tache->{'fichier' . $i} = $fichier;
                        }
                    }
                }
            }
            $tache->UPD();
            // On remet à 0 le fichier contenant le "cache" des taches pour l'affichage des blocs
            Lib_writeData('', "TACHES");
            // On remet à 0 le fichier contenant le "cache" de l'arborescence
            Lib_writeData('', "ARBO");
            //Enregistrement d'un zip par dossier racine contenant les fichiers
            $arbo = Arbo_recuperer_par_element($data_in['id_tache'], 'tache', 'arbo_docs');
            $tab_ids_arbos = array($arbo->id_arbo => $arbo->id_arbo);
            //			Arbo_zipDocuments('arbo_docs',$tab_ids_arbos);
            if (isset($data_in['code_arbo'])) {
                header("Location: http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/actions.php?action=Accueil&code_arbo={$data_in['code_arbo']}");
            }
            break;
        default:
            ExecActions('Accueil');
            break;
    }
}