diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 4b88fc37db8..f7792a61748 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -29,68 +29,6 @@ llxHeader(); $user->getrights('propale'); $user->getrights('projet'); -if ($sortorder == "") { - $sortorder="ASC"; -} -if ($sortfield == "") { - $sortfield="nom"; -} - - -if ($action == 'attribute_prefix') { - $societe = new Societe($db, $socid); - $societe->attribute_prefix($db, $socid); -} - -if ($action == 'recontact') { - $dr = mktime(0, 0, 0, $remonth, $reday, $reyear); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."soc_recontact (fk_soc, datere, author) VALUES ($socid, $dr,'". $GLOBALS["REMOTE_USER"]."')"; - $result = $db->query($sql); -} - -if ($action == 'stcomm') { - if ($stcommid <> 'null' && $stcommid <> $oldstcomm) { - $sql = "INSERT INTO socstatutlog (datel, fk_soc, fk_statut, author) "; - $sql .= " VALUES ('$dateaction',$socid,$stcommid,'" . $GLOBALS["REMOTE_USER"] . "')"; - $result = @$db->query($sql); - - if ($result) { - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=$stcommid WHERE idp=$socid"; - $result = $db->query($sql); - } else { - $errmesg = "ERREUR DE DATE !"; - } - } - - if ($actioncommid) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; - $result = @$db->query($sql); - - if (!$result) { - $errmesg = "ERREUR DE DATE !"; - } - } -} - -/* - * Recherche - * - * - */ -if ($mode == 'search') { - if ($mode-search == 'soc') { - $sql = "SELECT s.idp FROM ".MAIN_DB_PREFIX."societe as s "; - $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'"; - } - - if ( $db->query($sql) ) { - if ( $db->num_rows() == 1) { - $obj = $db->fetch_object(0); - $socid = $obj->idp; - } - $db->free(); - } -} /* * */ @@ -153,16 +91,7 @@ if ($socid > 0) dolibarr_fiche_head($head, 1); - /* - * - */ - print ''; - - print ""; - - print ""; - - print "
Fiche prospect : $societe->nom
[id&action=add_bookmark\">Bookmark]
"; + print_titre("Fiche prospect : $societe->nom"); /* * * @@ -171,11 +100,10 @@ if ($socid > 0) print ''; print ''; - print ""; print ""; - print ""; + print '"; - print ""; + print ""; print ""; @@ -183,6 +111,8 @@ if ($socid > 0) print ''; print ''; + print ""; + if ($societe->url) { print ""; @@ -193,6 +123,8 @@ if ($socid > 0) print ""; } + print ""; + print "
Type $societe->typentEffectif$societe->effectif
Téléphone $societe->tel fax$societe->fax 
Ville".nl2br($societe->address)."
$societe->cp $societe->ville
Adresse'.nl2br($societe->address)."
$societe->cp $societe->ville
sirensiren\">$societe->siren 
Sirensiren\">$societe->siren APE"; print $societe->ape; print "
Siret'.$societe->siret.'Capital'.$societe->capital.'
Type $societe->typentEffectif$societe->effectif
Siteurl\">$societe->url 
Rubrique$societe->rubrique
Forme juridique$societe->forme_juridique
"; /* @@ -245,81 +177,48 @@ if ($socid > 0) * */ print ""; - print "\n"; + print "\n\n"; /* * Barre d'action * */ - print '
'; + print '
'; if ($conf->propal->enabled && defined("MAIN_MODULE_PROPALE") && MAIN_MODULE_PROPALE && $user->rights->propale->creer) { - print "
"; + print 'Créer une proposition'; } - else - { - print ''; - } - print ''; - - - print ''; if ($conf->projet->enabled && $user->rights->projet->creer) { - print ''; + print 'Créer un projet'; } - else - { - print ''; - } - - - - print '
id&action=create\">Créer une proposition---Créer un projet-

'; + print ''; /* * - * + * Liste des contacts * */ - if ($action == 'changevalue') { - print "
"; - print "
id\" method=\"post\">"; - print ""; - print "Cette société est un cabinet de recrutement : "; - print ""; - print ""; - print "
\n"; - } else { - /* - * - * Liste des contacts - * - */ - print ''; + print '
'; - print ''; - print ''; - print ""; - print ""; + print ''; + print ''; + print ""; + print ""; - $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $societe->id ORDER by p.datec"; - $result = $db->query($sql); - $i = 0 ; $num = $db->num_rows(); $tag = True; - while ($i < $num) - { + $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $societe->id ORDER by p.datec"; + $result = $db->query($sql); + $i = 0 ; $num = $db->num_rows(); $tag = True; + while ($i < $num) + { $obj = $db->fetch_object( $i); $var = !$var; print ""; - + print '"; print ""; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print "'; print "\n"; @@ -369,12 +268,15 @@ if ($socid > 0) $obj = $db->fetch_object( $i); print ""; - if ($oldyear == strftime("%Y",$obj->da) ) { - print ''; - } else { - print "\n"; + if ($oldyear == strftime("%Y",$obj->da) ) + { + print ''; + } + else + { + print '\n"; $oldyear = strftime("%Y",$obj->da); - } + } if ($oldmonth == strftime("%Y%b",$obj->da) ) { print ''; @@ -394,7 +296,7 @@ if ($socid > 0) } else { - print ''; + print ''; } /* * Contact pour cette action @@ -480,11 +382,11 @@ if ($socid > 0) if ($obj->propalrowid) { - print ''; + print ''; } else { - print ''; + print ''; } /* * Contact pour cette action @@ -494,7 +396,7 @@ if ($socid > 0) { $contact = new Contact($db); $contact->fetch($obj->fk_contact); - print ''; + print ''; } else { @@ -520,7 +422,7 @@ if ($socid > 0) * Notes sur la societe * */ - if ($societe->note) + if (strlen(trim($societe->note))) { print '
Prénom NomPosteTélFaxEmailid&action=create\">Ajouter
Prénom NomPosteTélFaxEmailid&action=create\">Ajouter
'; - - print ''.$obj->firstname.' '. $obj->name.' '; + + print ''.$obj->firstname.' '. $obj->name.' '; if ($obj->note) { @@ -327,11 +226,11 @@ if ($socid > 0) } print "$obj->poste '.$obj->phone.' '.$obj->fax.' '.$obj->email.' '.$obj->phone.' '.$obj->fax.' '.$obj->email.' "; - print "id\">"; + print ''; print img_edit(); print '
|" .strftime("%Y",$obj->da)."|' .strftime("%Y",$obj->da)."|'.$obj->libelle.''.$obj->libelle.''.$obj->libelle.''.$obj->libelle.''.$obj->libelle.''.$obj->libelle.''.$contact->fullname.''.$contact->fullname.'
'; print ""; @@ -532,11 +434,15 @@ if ($socid > 0) * */ + + } + else + { + print $db->error() . "
" . $sql; } - } else { - print $db->error() . "
" . $sql; - } -} else { +} +else +{ print "Erreur"; } $db->close();
".nl2br($societe->note)."