From fac60d88d302925fe1f079e92a9ac3d1c1fcdc4b Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 17 Jan 2011 14:34:36 +0000 Subject: [PATCH] --- inc/commons/class.common.ajax.php | 12 ++++++++++++ inc/extranet/Controlleur/class.extranet.url.php | 12 ++++++++---- inc/extranet/DAO/class.extranet.dao.projet.php | 6 ++++++ inc/ws/Controlleur/class.ws.url.php | 1 + 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/inc/commons/class.common.ajax.php b/inc/commons/class.common.ajax.php index 3ae84b620..61aa6f153 100644 --- a/inc/commons/class.common.ajax.php +++ b/inc/commons/class.common.ajax.php @@ -149,6 +149,18 @@ class commonAjax { $x->addAlert(__('Votre mot de passe a été modifié')); } } + + public static function connectAs($args, &$x) + { + global $core; + $dao = new commonDAOUtilisateur($core->con); + $utilisateur = $dao->selectById($args[1]); + + $_SESSION['user_email'] = $utilisateur->email; + $_SESSION['user_password'] = $utilisateur->password; + + $x->addRedirection(SITE_PATH); + } } ?> \ No newline at end of file diff --git a/inc/extranet/Controlleur/class.extranet.url.php b/inc/extranet/Controlleur/class.extranet.url.php index 9cf503f84..e80079052 100644 --- a/inc/extranet/Controlleur/class.extranet.url.php +++ b/inc/extranet/Controlleur/class.extranet.url.php @@ -208,13 +208,14 @@ class extranetUrl { $contacts = $dao->getContacts($entreprise_id); $res = ''; - $res .= ''; + $res .= ''; $i = 0; foreach($contacts as $contact) { $odd = cubeMath::isOdd($i)?' class="odd"':''; $res .= ''; $res .= ''; $res .= ''; + $res .= ''; $res .= ''; $i++; } @@ -250,6 +251,7 @@ class extranetUrl { if ($client_id != 'new') { $res .= ''; $res .= ''; + $res .= ''; $res .= ''; $res .= ''; // $res .= ''; @@ -440,6 +442,8 @@ class extranetUrl { $dao = new extranetDAOProjet($core->con); $projet = $dao->selectById($projet_id); + $hasFacture = $dao->projectHasFacture($projet_id); + $droits = extranetDroits::projet($projet, false); $projet->progression = !$projet->progression?'-':$projet->progression . '%'; @@ -465,7 +469,7 @@ class extranetUrl { $res .= ''; if ($droits) { $res .= ''; - if (!count($projet->taches)) { + if (!count($projet->taches) && !$hasFacture) { $res .= ''; } else { $res .= ''; @@ -1852,7 +1856,7 @@ class extranetUrl { $body = 'Tous les fichiers de ' . $core->user->prenom . ' ' . $core->user->nom . ' : http://extranet.cubedesigners.com/fichiers/' . $core->user->utilisateur_id . "\n\n"; $body .= 'Fichiers chargés : ' . "\n"; foreach($_SESSION['files_uploaded'] as $f) { - $body .= ' - http://extranet.cubedesigners.com/telecharger/' . $f . "\n"; + $body .= ' - http://' . $_SERVER['HTTP_HOST'] . '/telecharger/' . $f . "\n"; } } else { $dao = new commonDAOClient($core->con); @@ -1867,7 +1871,7 @@ class extranetUrl { $body .= ' - http://extranet.cubedesigners.com/telecharger/' . $f . "\n"; } $body .= "\n" . 'Rappel des identifiants de connexion à l\'extranet Cubedesigners : ' . "\n"; - $body .= ' - Adresse : http://extranet.cubedesigners.com/' . "\n"; + $body .= ' - Adresse : http://' . $_SERVER['HTTP_HOST'] . '/' . "\n"; $body .= ' - Login : ' . $client->email . "\n"; $body .= ' - Mot de passe : ' . $client->password . "\n"; } diff --git a/inc/extranet/DAO/class.extranet.dao.projet.php b/inc/extranet/DAO/class.extranet.dao.projet.php index e6097433d..6328fd54d 100644 --- a/inc/extranet/DAO/class.extranet.dao.projet.php +++ b/inc/extranet/DAO/class.extranet.dao.projet.php @@ -159,6 +159,12 @@ class extranetDAOProjet extends commonDAO { return $this->factory($r); } + public function hasFacture($projet_id) + { + $r = $this->con->select('SELECT * FROM factures WHERE projet=\'' . $core->con->escape($projet_id) . '\''); + return $r->count() > 0; + } + public function getProjetsForTimereport($orderby, $sens, $limit, $utilisateur_id) { if (!is_null($this->q)) { diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index d957549cb..fac416cf4 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -431,6 +431,7 @@ html{height:100%}' . "\n"; $res .= ''; $res .= ''; + $res .= ''; $res .= ''; $i++; } -- 2.39.5
' . $core->typo->Contact('Ajouter un contact') . '
' . $core->typo->Contact('Ajouter un contact') . '
' . trim($contact->prenom . ' ' . $contact->nom) . '' . $contact->email . 'FTPSe connecter comme ...' . cubeMedia::image(IMG . '/edit.png') . '
' . cubeMedia::spacer(10, 10) . '
' . __('FTP') . '
' . __('Se connecter comme ...') . '
' . __("Paramètres de connexion à l'extranet") . '' . __('Adresse') . ' : http://extranet.cubedesigners.com/
' . __("Nom d'utilisateur") . ' : ' . $client->email . '
' . __('Mot de passe') . ' : ' . $client->password . '
' . cubeMedia::spacer(10, 10) . '
' . __("Paramètres de connexion au FTP") . '' . __('Serveur FTP') . ' : extranet.cubedesigners.com (ftp://extranet.cubedesigners.com)
' . __("Nom d'utilisateur") . ' : ' . $client->email . '
' . __('Mot de passe') . ' : ' . $client->password . '
' . $projet->progression . '' . cubeMedia::image(IMG . '/edit.png') . '' . cubeMedia::image(IMG . '/delete.png') . ''; $res .= '' . cubeMedia::image(IMG . '/edit.png') . '' . cubeMedia::image(IMG . '/edit.png') . '