Example #1
0
Copyright (C) 2003-2012 by the Projet Development Team.

https://forge.indepnet.net/projects/projet
-------------------------------------------------------------------------

LICENSE
		
This file is part of Projet.

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

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

You should have received a copy of the GNU General Public License
along with Projet. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Session::checkRight("profile", "r");
$prof = new PluginProjetProfile();
//Save profile
if (isset($_POST['update'])) {
    $prof->update($_POST);
    Html::back();
}
Example #2
0
function plugin_projet_install()
{
    global $DB;
    foreach (glob(GLPI_ROOT . '/plugins/projet/inc/*.php') as $file) {
        if (!preg_match('/projetpdf/', $file)) {
            include_once $file;
        }
    }
    if (!TableExists("glpi_plugin_projet_projets") && !TableExists("glpi_plugin_projet") && !TableExists("glpi_plugin_project") && !TableExists("glpi_project")) {
        $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/empty-1.4.1.sql");
        include_once GLPI_ROOT . "/plugins/projet/install/install_141.php";
        install141();
    } else {
        if (TableExists("glpi_project") && !FieldExists("glpi_plugin_project_profiles", "task")) {
            $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.6.sql");
            plugin_projet_updatev62();
            plugin_projet_updatev7();
            $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.7.sql");
            $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.8.sql");
            $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.9.sql");
            $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-1.0.0.sql");
            include_once GLPI_ROOT . "/plugins/projet/install/update_101_110.php";
            update101to110();
            include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
            update110to120();
            include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
            update120to130();
            include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
            update130to133();
            include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
            update140to141();
        } else {
            if (TableExists("glpi_plugin_project") && !FieldExists("glpi_plugin_project_profiles", "task")) {
                plugin_projet_updatev62();
                plugin_projet_updatev7();
                $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.7.sql");
                $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.8.sql");
                $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.9.sql");
                $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-1.0.0.sql");
                include_once GLPI_ROOT . "/plugins/projet/install/update_101_110.php";
                update101to110();
                include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
                update110to120();
                include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                update120to130();
                include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                update130to133();
                include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                update140to141();
            } else {
                if (TableExists("glpi_plugin_project") && !TableExists("glpi_dropdown_plugin_project_status")) {
                    plugin_projet_updatev7();
                    $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.7.sql");
                    $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.8.sql");
                    $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.9.sql");
                    $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-1.0.0.sql");
                    include_once GLPI_ROOT . "/plugins/projet/install/update_101_110.php";
                    update101to110();
                    include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
                    update110to120();
                    include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                    update120to130();
                    include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                    update130to133();
                    include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                    update140to141();
                } else {
                    if (TableExists("glpi_plugin_project") && !TableExists("glpi_plugin_projet")) {
                        $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.8.sql");
                        $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.9.sql");
                        $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-1.0.0.sql");
                        include_once GLPI_ROOT . "/plugins/projet/install/update_101_110.php";
                        update101to110();
                        include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
                        update110to120();
                        include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                        update120to130();
                        include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                        update130to133();
                        include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                        update140to141();
                    } else {
                        if (TableExists("glpi_plugin_projet") && !FieldExists("glpi_plugin_projet_tasks", "location")) {
                            $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-0.9.sql");
                            $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-1.0.0.sql");
                            include_once GLPI_ROOT . "/plugins/projet/install/update_101_110.php";
                            update101to110();
                            include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
                            update110to120();
                            include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                            update120to130();
                            include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                            update130to133();
                            include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                            update140to141();
                        } else {
                            if (TableExists("glpi_plugin_projet_profiles") && FieldExists("glpi_plugin_projet_profiles", "interface")) {
                                $DB->runFile(GLPI_ROOT . "/plugins/projet/sql/update-1.0.0.sql");
                                include_once GLPI_ROOT . "/plugins/projet/install/update_101_110.php";
                                update101to110();
                                include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
                                update110to120();
                                include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                                update120to130();
                                include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                                update130to133();
                                include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                                update140to141();
                            } else {
                                if (!TableExists("glpi_plugin_projet_tasktypes")) {
                                    include_once GLPI_ROOT . "/plugins/projet/install/update_101_110.php";
                                    update101to110();
                                    include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
                                    update110to120();
                                    include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                                    update120to130();
                                    include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                                    update130to133();
                                    include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                                    update140to141();
                                } else {
                                    if (!TableExists("glpi_plugin_projet_taskplannings")) {
                                        include_once GLPI_ROOT . "/plugins/projet/install/update_110_120.php";
                                        update110to120();
                                        include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                                        update120to130();
                                        include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                                        update130to133();
                                        include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                                        update140to141();
                                    } else {
                                        if (!TableExists("glpi_plugin_projet_projets_projets")) {
                                            include_once GLPI_ROOT . "/plugins/projet/install/update_120_130.php";
                                            update120to130();
                                            include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                                            update130to133();
                                            include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                                            update140to141();
                                        } else {
                                            if (TableExists("glpi_plugin_projet_projets") && !FieldExists("glpi_plugin_projet_projets", "estimatedtime")) {
                                                include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                                                update130to133();
                                                include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                                                update140to141();
                                            } else {
                                                if (!TableExists("glpi_plugin_projet_followups")) {
                                                    include_once GLPI_ROOT . "/plugins/projet/install/update_130_133.php";
                                                    update130to133();
                                                    include_once GLPI_ROOT . "/plugins/projet/install/update_140_141.php";
                                                    update140to141();
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $rep_files_projet = GLPI_PLUGIN_DOC_DIR . "/projet";
    if (!is_dir($rep_files_projet)) {
        mkdir($rep_files_projet);
    }
    PluginProjetProfile::createFirstAccess($_SESSION['glpiactiveprofile']['id']);
    return true;
}