From: vincent@cubedesigners.com Date: Mon, 31 Oct 2011 15:57:41 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5af37b858b5e728557f8341767b1aac1d6bc2d28;p=cubeextranet.git --- diff --git a/inc/commons/DAO/class.common.dao.entreprise.php b/inc/commons/DAO/class.common.dao.entreprise.php index aec6d8767..3c0cbcbf8 100644 --- a/inc/commons/DAO/class.common.dao.entreprise.php +++ b/inc/commons/DAO/class.common.dao.entreprise.php @@ -27,6 +27,9 @@ class commonDAOEntreprise extends commonDAO { if (isset($r->administrateur)) { $entreprise->ws_administrateur = $r->administrateur; } + if(isset($r->site)){ + $entreprise->site=$r->site; + } return $entreprise; } @@ -137,6 +140,7 @@ class commonDAOEntreprise extends commonDAO { $c->code_postal = $data['code_postal']; $c->ville = $data['ville']; $c->pays = $data['pays']; + $c->site=$data['site']; if (isset($data['tva_intra'])) { $c->tva_intra = $data['tva_intra']; } diff --git a/inc/commons/DAO/class.common.dao.utilisateur.php b/inc/commons/DAO/class.common.dao.utilisateur.php index 7dc2cdff4..1281cc053 100644 --- a/inc/commons/DAO/class.common.dao.utilisateur.php +++ b/inc/commons/DAO/class.common.dao.utilisateur.php @@ -64,6 +64,9 @@ class commonDAOUtilisateur extends commonDAO { if (isset($r->ws_admin)) { $utilisateur->ws_admin = $r->ws_admin; } + if(isset($r->site)){ + $utilisateur->site=$r->site; + } return $utilisateur; } diff --git a/inc/commons/Metier/class.common.entreprise.php b/inc/commons/Metier/class.common.entreprise.php index dc94e1858..bfbb0a2fe 100644 --- a/inc/commons/Metier/class.common.entreprise.php +++ b/inc/commons/Metier/class.common.entreprise.php @@ -11,6 +11,7 @@ class commonEntreprise extends cubeMetier { protected $tva_intra; protected $notes; protected $adresse_facturation; + protected $site; protected $ws_admin; protected $ws_grade; protected $ws_signatures; diff --git a/inc/commons/Metier/class.common.utilisateur.php b/inc/commons/Metier/class.common.utilisateur.php index da6f1fd60..ed08e5d06 100644 --- a/inc/commons/Metier/class.common.utilisateur.php +++ b/inc/commons/Metier/class.common.utilisateur.php @@ -22,6 +22,7 @@ class commonUtilisateur extends cubeMetier { protected $entreprise; protected $tva_intra; protected $rs; + protected $site; protected $collegues; protected $ws_admin; protected $ws_grade; diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index d9bc11340..b201fc487 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -7,6 +7,7 @@ class commonCore extends cubeCore { public $agences; public $categories; public $ws_grades; + public $demandes_type; public function __construct() { parent::__construct(); @@ -467,12 +468,12 @@ class commonCore extends cubeCore { . 'LEFT JOIN utilisateurs ur ON e.ws_admin=ur.utilisateur_id ' . 'LEFT JOIN entreprises r ON ur.entreprise=r.entreprise_id ' . 'LEFT JOIN utilisateurs a ON ri.administrateur_id=a.utilisateur_id '); - $this->views->createView('clients_entreprise', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation ' + $this->views->createView('clients_entreprise', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation, e.site AS site ' . 'FROM entreprises e LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id AND u.grade=0'); $this->views->createView('utilisateurs_entreprise', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation, ' - . 'e.ws_grade, e.ws_admin, e.ws_signatures AS ws_signatures ' + . 'e.ws_grade, e.ws_admin, e.ws_signatures AS ws_signatures, e.site AS site ' . 'FROM entreprises e LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id'); - $this->views->createView('clients', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation, i.impaye, ' + $this->views->createView('clients', 'SELECT u.*,e.nom AS rs, e.adresse_facturation AS adresse_facturation, e.site AS site, i.impaye, ' . 'SUM(f.total_ht) AS ca ' . 'FROM entreprises e LEFT JOIN impayes_entreprises i ON e.entreprise_id=i.entreprise LEFT JOIN utilisateurs u ON u.entreprise=e.entreprise_id AND u.grade=0 LEFT JOIN projets p ON p.client=u.utilisateur_id LEFT JOIN factures f ON f.projet=p.projet_id AND f.status IN(1,2) ' . 'GROUP BY u.utilisateur_id', 'TEMPTABLE'); diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index b0c622d41..812534d28 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -41,6 +41,7 @@ class wsAjax extends cubeAjax { $data['code_postal'] = $entreprise->code_postal; $data['ville'] = $entreprise->ville; $data['pays'] = $entreprise->pays; + $data['site']=$entreprise->site; $data['grade'] = 0; $daoClient = new commonDAOClient($core->con); try { @@ -410,6 +411,7 @@ class wsAjax extends cubeAjax { $datas['code_postal'] = $_POST['code_postal']; $datas['ville'] = $_POST['ville']; $datas['pays'] = $_POST['pays']; + $datas['site']=$_POST['site']; if ($_POST['rs'] == '') { $datas['nom'] = $_POST['prenom'] . ' ' . $_POST['nom']; } else { @@ -479,6 +481,8 @@ class wsAjax extends cubeAjax { if ($_POST[$f] != '') { if ($f == 'pays') { $body .= ' * ' . $d . ' : ' . cubeCountry::getCountry($_POST[$f], 'fr') . "\r\n"; + } else if ($f == 'type') { + $body .= ' * ' . $d . ' : ' . $core->demandes_type[$_POST[$f]] . "\r\n"; } else { $body .= ' * ' . $d . ' : ' . $_POST[$f] . "\r\n"; } @@ -714,7 +718,7 @@ class wsAjax extends cubeAjax { global $core; set_time_limit(0); - + $book_id = $args[1]; $time = $args[2]; @@ -724,7 +728,7 @@ class wsAjax extends cubeAjax { self::getLinksFromExcel($xls, $links, $rulers); - + $dao = new wsDAODocument($core->con); $dao->setLinksAndRulers($book_id, json_encode($links), json_encode($rulers), 'Restore links from ' . date('Y-m-d H:i:s', $time), $core->user->utilisateur_id); @@ -792,26 +796,25 @@ class wsAjax extends cubeAjax { $dao = new wsDAODocument($core->con); $dao->setLinksAndRulers($book_id, json_encode($links), json_encode($rulers), 'Import from excel', $core->user->utilisateur_id); - - $specialLinks=array(); - foreach($links as $l){ - if(is_int($l['page'])){ + + $specialLinks = array(); + foreach ($links as $l) { + if (is_int($l['page'])) { continue; } - $specialLinks[]=$l; + $specialLinks[] = $l; } - $specialRulers=array(); - foreach($rulers as $r){ - if(is_int($r['page'])){ + $specialRulers = array(); + foreach ($rulers as $r) { + if (is_int($r['page'])) { continue; } - $specialRulers[]=$r; + $specialRulers[] = $r; } - - + + $daoBook = new wsDAOBook($core->con); $daoBook->setSpecialLinksAndRulers($book_id, json_encode($specialLinks), json_encode($specialRulers)); - } } diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 4968148b1..34254b9c5 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -1193,6 +1193,7 @@ html{height:100%}' . "\n"; $res .= '' . __('Code postal') . '' . form::field('code_postal', 10, 20, $client->code_postal) . ''; $res .= '' . __('Ville') . '' . form::field('ville', 30, 128, $client->ville) . ''; $res .= '' . __('Pays') . '' . form::combo('pays', cubeCountry::getList(), $client->pays) . ''; + $res .= '' . __('Site internet') . '' . form::field('site', 30, 128, $client->site) . ''; if (wsDroits::admin(false)) { $res .= '' . __('Adresse de facturation') . '' . form::textarea('adresse_facturation', 40, 3, $client->adresse_facturation) . ''; $res .= '' . __('Numéro de TVA intracommunautaire') . '' . form::field('tva_intra', 15, 13, $client->tva_intra) . ''; diff --git a/inc/ws/Metier/class.ws.demande.php b/inc/ws/Metier/class.ws.demande.php index 30bd75acc..d6eb47096 100644 --- a/inc/ws/Metier/class.ws.demande.php +++ b/inc/ws/Metier/class.ws.demande.php @@ -37,13 +37,17 @@ class wsDemande extends cubeMetier { 'prenom' => __('Prenom'), 'nom' => __('Nom'), 'rs' => __('Entreprise'), + 'site' => __('Site internet'), + 'telephone' => __('Téléphone'), 'adresse' => __('Adresse'), 'code_postal' => __('Code postal'), 'ville' => __('Ville'), 'pays' => 'Pays'); foreach ($fields as $p => $t) { - if ($utilisateur->$p != '') { + if (isset($utilisateur->$p) && $utilisateur->$p != '') { $body .= ' * ' . $t . ' : ' . $utilisateur->$p . "\r\n"; + } else if (isset($demande->$p) && $demande->$p != '') { + $body .= ' * ' . $t . ' : ' . $demande->$p . "\r\n"; } } return $body;