diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 5f1cbebd752..7db0dd9ebf9 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -1,424 +1 @@ - - * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file htdocs/contact/index.php - * \ingroup societe - * \brief Page to list all contacts - * \version $Id: index.php,v 1.106 2011/07/31 23:54:12 eldy Exp $ - */ - -require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); - -$langs->load("companies"); -$langs->load("suppliers"); - -// Security check -$contactid = isset($_GET["id"])?$_GET["id"]:''; -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $contactid,''); - -$search_nom=GETPOST("search_nom"); -$search_prenom=GETPOST("search_prenom"); -$search_societe=GETPOST("search_societe"); -$search_poste=GETPOST("search_poste"); -$search_phone=GETPOST("search_phone"); -$search_phoneper=GETPOST("search_phoneper"); -$search_phonepro=GETPOST("search_phonepro"); -$search_phonemob=GETPOST("search_phonemob"); -$search_fax=GETPOST("search_fax"); -$search_email=GETPOST("search_email"); -$search_priv=GETPOST("search_priv"); - -$type=GETPOST("type"); -$view=GETPOST("view"); - -$sall=GETPOST("contactname"); -$sortfield = GETPOST("sortfield"); -$sortorder = GETPOST("sortorder"); -$page = GETPOST("page"); - -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="p.name"; -if ($page < 0) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -$langs->load("companies"); -$titre=$langs->trans("ListOfContacts"); -if ($type == "c") -{ - $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartyCustomers").')'; - $urlfiche="fiche.php"; -} -if ($type == "p") -{ - $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartyProspects").')'; - $urlfiche="prospect/fiche.php"; -} -if ($type == "f") { - $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartySuppliers").')'; - $urlfiche="fiche.php"; -} -if ($type == "o") { - $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("OthersNotLinkedToThirdParty").')'; - $urlfiche=""; -} -if ($view == 'phone') { $text=" (Vue Telephones)"; } -if ($view == 'mail') { $text=" (Vue EMail)"; } -if ($view == 'recent') { $text=" (Recents)"; } -$titre = $titre." $text"; - -if ($_POST["button_removefilter"]) -{ - $search_nom=""; - $search_prenom=""; - $search_societe=""; - $search_poste=""; - $search_phone=""; - $search_phoneper=""; - $search_phonepro=""; - $search_phonemob=""; - $search_fax=""; - $search_email=""; - $search_priv=""; - $sall=""; -} -if ($search_priv < 0) $search_priv=''; - - - -/* - * View - */ - -llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); - -$form=new Form($db); - -$sql = "SELECT s.rowid as socid, s.nom,"; -$sql.= " p.rowid as cidp, p.name, p.firstname, p.poste, p.email,"; -$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv,"; -$sql.= " p.tms,"; -$sql.= " cp.code as pays_code"; -$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; -$sql.= " WHERE p.entity = ".$conf->entity; -if (!$user->rights->societe->client->voir && !$socid) //restriction -{ - $sql .= " AND (sc.fk_user = " .$user->id." OR p.fk_soc IS NULL)"; -} -if ($_GET["userid"]) // propre au commercial -{ - $sql .= " AND p.fk_user_creat=".$_GET["userid"]; -} - -// Filter to exclude not owned private contacts -if ($search_priv != '0' && $search_priv != '1') -{ - $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".$user->id."))"; -} -else -{ - if ($search_priv == '0') $sql .= " AND p.priv='0'"; - if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; -} - -if ($search_nom) // filtre sur le nom -{ - $sql .= " AND p.name like '%".$db->escape($search_nom)."%'"; -} -if ($search_prenom) // filtre sur le prenom -{ - $sql .= " AND p.firstname like '%".$db->escape($search_prenom)."%'"; -} -if ($search_societe) // filtre sur la societe -{ - $sql .= " AND s.nom like '%".$db->escape($search_societe)."%'"; -} -if (strlen($search_poste)) // filtre sur la societe -{ - $sql .= " AND p.poste like '%".$db->escape($search_poste)."%'"; -} -if (strlen($search_phone)) -{ - $sql .= " AND (p.phone like '%".$db->escape($search_phone)."%' OR p.phone_perso like '%".$db->escape($search_phone)."%' OR p.phone_mobile like '%".$db->escape($search_phone)."%')"; -} -if (strlen($search_phoneper)) -{ - $sql .= " AND p.phone like '%".$db->escape($search_phoneper)."%'"; -} -if (strlen($search_phonepro)) -{ - $sql .= " AND p.phone_perso like '%".$db->escape($search_phonepro)."%'"; -} -if (strlen($search_phonemob)) -{ - $sql .= " AND p.phone_mobile like '%".$db->escape($search_phonemob)."%'"; -} -if (strlen($search_fax)) -{ - $sql .= " AND p.fax like '%".$db->escape($search_fax)."%'"; -} -if (strlen($search_email)) // filtre sur l'email -{ - $sql .= " AND p.email like '%".$db->escape($search_email)."%'"; -} -if ($type == "o") // filtre sur type -{ - $sql .= " AND p.fk_soc IS NULL"; -} -if ($type == "f") // filtre sur type -{ - $sql .= " AND fournisseur = 1"; -} -if ($type == "c") // filtre sur type -{ - $sql .= " AND client IN (1, 3)"; -} -if ($type == "p") // filtre sur type -{ - $sql .= " AND client IN (2, 3)"; -} -if ($sall) -{ - $sql .= " AND (p.name like '%".$db->escape($sall)."%' OR p.firstname like '%".$db->escape($sall)."%' OR p.email like '%".$db->escape($sall)."%') "; -} -if ($socid) -{ - $sql .= " AND s.rowid = ".$socid; -} -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} -// Add order and limit -if($view == "recent") -{ - $sql.= " ORDER BY p.datec DESC "; - $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); -} -else -{ - $sql.= " ORDER BY $sortfield $sortorder "; - $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); -} - -//print $sql; -dol_syslog("contact/index.php sql=".$sql); -$result = $db->query($sql); -if ($result) -{ - $contactstatic=new Contact($db); - - $begin=$_GET["begin"]; - $param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($_GET["userid"]).'&contactname='.urlencode($sall); - $param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_nom='.urlencode($search_nom).'&search_prenom='.urlencode($search_prenom).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email); - if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); - - $num = $db->num_rows($result); - $i = 0; - - print_barre_liste($titre ,$page, "index.php", $param, $sortfield, $sortorder,'',$num,$nbtotalofrecords); - - print '
'; - print ''; - print ''; - print ''; - print ''; - - if ($sall) - { - print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".$sall; - } - - print ''; - - // Ligne des titres - print ''; - print_liste_field_titre($langs->trans("Lastname"),"index.php","p.name", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Firstname"),"index.php","p.firstname", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("PostOrFunction"),"index.php","p.poste", $begin, $param, '', $sortfield,$sortorder); - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),"index.php","s.nom", $begin, $param, '', $sortfield,$sortorder); - if ($view == 'phone') - { - print_liste_field_titre($langs->trans("Phone"),"index.php","p.phone", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Mobile"),"index.php","p.phone_mob", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Fax"),"index.php","p.fax", $begin, $param, '', $sortfield,$sortorder); - } - else - { - print_liste_field_titre($langs->trans("Phone"),"index.php","p.phone", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("EMail"),"index.php","p.email", $begin, $param, '', $sortfield,$sortorder); - } - print_liste_field_titre($langs->trans("DateModificationShort"),"index.php","p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("ContactVisibility"),"index.php","p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); - print ''; - print "\n"; - - // Ligne des champs de filtres - print ''; - print ''; - print ''; - print ''; - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) - { - print ''; - } - if ($view == 'phone') - { - print ''; - print ''; - print ''; - } - else - { - print ''; - print ''; - } - print ''; - print ''; - print ''; - print ''; - - $var=True; - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($result); - - $var=!$var; - - print ""; - - // Name - print ''; - - // Firstname - print ''; - - // Function - print ''; - - // Company - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) - { - print ''; - } - - if ($view == 'phone') - { - // Phone - print ''; - // Phone mobile - print ''; - // Fax - print ''; - } - else - { - // Phone - print ''; - // EMail - print ''; - } - - // Date - print ''; - - // Private/Public - print ''; - - // Links Add action and Export vcard - print ''; - - print "\n"; - $i++; - } - - print "
 
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ' '; - $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); - print $form->selectarray('search_priv',$selectarray,$search_priv,1); - print ''; - print ''; - print '  '; - print ''; - print '
'; - $contactstatic->name=$obj->name; - $contactstatic->firstname=''; - $contactstatic->id=$obj->cidp; - print $contactstatic->getNomUrl(1,'',20); - print ''.dol_trunc($obj->firstname,20).''.dol_trunc($obj->poste,20).''; - if ($obj->socid) - { - print ''; - print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,20).''; - } - else - { - print ' '; - } - print ''.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->phone_mobile,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->fax,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).''.dol_print_date($db->jdate($obj->tms),"day").''.$contactstatic->LibPubPriv($obj->priv).''; - print ''.img_object($langs->trans("AddAction"),"action").''; - print '   '; - print ''; - print img_picto($langs->trans("VCard"),'vcard.png').' '; - print '
"; - - print '
'; - - if ($num > $limit) print_barre_liste('' ,$page, "index.php", '&begin='.$begin.'&view='.$view.'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num,$nbtotalofrecords, ''); - - $db->free($result); -} -else -{ - dol_print_error($db); -} - -print '
'; - -$db->close(); - -llxFooter('$Date: 2011/07/31 23:54:12 $ - $Revision: 1.106 $'); -?> +Url not available \ No newline at end of file diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php new file mode 100755 index 00000000000..2d7dfb83d64 --- /dev/null +++ b/htdocs/contact/list.php @@ -0,0 +1,424 @@ + + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin + * + * This program 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. + * + * This program 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 this program. If not, see . + */ + +/** + * \file htdocs/contact/list.php + * \ingroup societe + * \brief Page to list all contacts + * \version $Id: list.php,v 1.1 2011/08/21 13:19:26 eldy Exp $ + */ + +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); + +$langs->load("companies"); +$langs->load("suppliers"); + +// Security check +$contactid = isset($_GET["id"])?$_GET["id"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'contact', $contactid,''); + +$search_nom=GETPOST("search_nom"); +$search_prenom=GETPOST("search_prenom"); +$search_societe=GETPOST("search_societe"); +$search_poste=GETPOST("search_poste"); +$search_phone=GETPOST("search_phone"); +$search_phoneper=GETPOST("search_phoneper"); +$search_phonepro=GETPOST("search_phonepro"); +$search_phonemob=GETPOST("search_phonemob"); +$search_fax=GETPOST("search_fax"); +$search_email=GETPOST("search_email"); +$search_priv=GETPOST("search_priv"); + +$type=GETPOST("type"); +$view=GETPOST("view"); + +$sall=GETPOST("contactname"); +$sortfield = GETPOST("sortfield"); +$sortorder = GETPOST("sortorder"); +$page = GETPOST("page"); + +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="p.name"; +if ($page < 0) { $page = 0 ; } +$limit = $conf->liste_limit; +$offset = $limit * $page ; + +$langs->load("companies"); +$titre=$langs->trans("ListOfContacts"); +if ($type == "c") +{ + $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartyCustomers").')'; + $urlfiche="fiche.php"; +} +if ($type == "p") +{ + $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartyProspects").')'; + $urlfiche="prospect/fiche.php"; +} +if ($type == "f") { + $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartySuppliers").')'; + $urlfiche="fiche.php"; +} +if ($type == "o") { + $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("OthersNotLinkedToThirdParty").')'; + $urlfiche=""; +} +if ($view == 'phone') { $text=" (Vue Telephones)"; } +if ($view == 'mail') { $text=" (Vue EMail)"; } +if ($view == 'recent') { $text=" (Recents)"; } +$titre = $titre." $text"; + +if ($_POST["button_removefilter"]) +{ + $search_nom=""; + $search_prenom=""; + $search_societe=""; + $search_poste=""; + $search_phone=""; + $search_phoneper=""; + $search_phonepro=""; + $search_phonemob=""; + $search_fax=""; + $search_email=""; + $search_priv=""; + $sall=""; +} +if ($search_priv < 0) $search_priv=''; + + + +/* + * View + */ + +llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); + +$form=new Form($db); + +$sql = "SELECT s.rowid as socid, s.nom,"; +$sql.= " p.rowid as cidp, p.name, p.firstname, p.poste, p.email,"; +$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv,"; +$sql.= " p.tms,"; +$sql.= " cp.code as pays_code"; +$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; +if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; +$sql.= " WHERE p.entity = ".$conf->entity; +if (!$user->rights->societe->client->voir && !$socid) //restriction +{ + $sql .= " AND (sc.fk_user = " .$user->id." OR p.fk_soc IS NULL)"; +} +if ($_GET["userid"]) // propre au commercial +{ + $sql .= " AND p.fk_user_creat=".$_GET["userid"]; +} + +// Filter to exclude not owned private contacts +if ($search_priv != '0' && $search_priv != '1') +{ + $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".$user->id."))"; +} +else +{ + if ($search_priv == '0') $sql .= " AND p.priv='0'"; + if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; +} + +if ($search_nom) // filtre sur le nom +{ + $sql .= " AND p.name like '%".$db->escape($search_nom)."%'"; +} +if ($search_prenom) // filtre sur le prenom +{ + $sql .= " AND p.firstname like '%".$db->escape($search_prenom)."%'"; +} +if ($search_societe) // filtre sur la societe +{ + $sql .= " AND s.nom like '%".$db->escape($search_societe)."%'"; +} +if (strlen($search_poste)) // filtre sur la societe +{ + $sql .= " AND p.poste like '%".$db->escape($search_poste)."%'"; +} +if (strlen($search_phone)) +{ + $sql .= " AND (p.phone like '%".$db->escape($search_phone)."%' OR p.phone_perso like '%".$db->escape($search_phone)."%' OR p.phone_mobile like '%".$db->escape($search_phone)."%')"; +} +if (strlen($search_phoneper)) +{ + $sql .= " AND p.phone like '%".$db->escape($search_phoneper)."%'"; +} +if (strlen($search_phonepro)) +{ + $sql .= " AND p.phone_perso like '%".$db->escape($search_phonepro)."%'"; +} +if (strlen($search_phonemob)) +{ + $sql .= " AND p.phone_mobile like '%".$db->escape($search_phonemob)."%'"; +} +if (strlen($search_fax)) +{ + $sql .= " AND p.fax like '%".$db->escape($search_fax)."%'"; +} +if (strlen($search_email)) // filtre sur l'email +{ + $sql .= " AND p.email like '%".$db->escape($search_email)."%'"; +} +if ($type == "o") // filtre sur type +{ + $sql .= " AND p.fk_soc IS NULL"; +} +if ($type == "f") // filtre sur type +{ + $sql .= " AND fournisseur = 1"; +} +if ($type == "c") // filtre sur type +{ + $sql .= " AND client IN (1, 3)"; +} +if ($type == "p") // filtre sur type +{ + $sql .= " AND client IN (2, 3)"; +} +if ($sall) +{ + $sql .= " AND (p.name like '%".$db->escape($sall)."%' OR p.firstname like '%".$db->escape($sall)."%' OR p.email like '%".$db->escape($sall)."%') "; +} +if ($socid) +{ + $sql .= " AND s.rowid = ".$socid; +} +// Count total nb of records +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} +// Add order and limit +if($view == "recent") +{ + $sql.= " ORDER BY p.datec DESC "; + $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); +} +else +{ + $sql.= " ORDER BY $sortfield $sortorder "; + $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); +} + +//print $sql; +dol_syslog("contact/list.php sql=".$sql); +$result = $db->query($sql); +if ($result) +{ + $contactstatic=new Contact($db); + + $begin=$_GET["begin"]; + $param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($_GET["userid"]).'&contactname='.urlencode($sall); + $param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_nom='.urlencode($search_nom).'&search_prenom='.urlencode($search_prenom).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email); + if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); + + $num = $db->num_rows($result); + $i = 0; + + print_barre_liste($titre ,$page, "index.php", $param, $sortfield, $sortorder,'',$num,$nbtotalofrecords); + + print '
'; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".$sall; + } + + print ''; + + // Ligne des titres + print ''; + print_liste_field_titre($langs->trans("Lastname"),"index.php","p.name", $begin, $param, '', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("Firstname"),"index.php","p.firstname", $begin, $param, '', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("PostOrFunction"),"index.php","p.poste", $begin, $param, '', $sortfield,$sortorder); + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),"index.php","s.nom", $begin, $param, '', $sortfield,$sortorder); + if ($view == 'phone') + { + print_liste_field_titre($langs->trans("Phone"),"index.php","p.phone", $begin, $param, '', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("Mobile"),"index.php","p.phone_mob", $begin, $param, '', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("Fax"),"index.php","p.fax", $begin, $param, '', $sortfield,$sortorder); + } + else + { + print_liste_field_titre($langs->trans("Phone"),"index.php","p.phone", $begin, $param, '', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("EMail"),"index.php","p.email", $begin, $param, '', $sortfield,$sortorder); + } + print_liste_field_titre($langs->trans("DateModificationShort"),"index.php","p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("ContactVisibility"),"index.php","p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); + print ''; + print "\n"; + + // Ligne des champs de filtres + print ''; + print ''; + print ''; + print ''; + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + print ''; + } + if ($view == 'phone') + { + print ''; + print ''; + print ''; + } + else + { + print ''; + print ''; + } + print ''; + print ''; + print ''; + print ''; + + $var=True; + while ($i < min($num,$limit)) + { + $obj = $db->fetch_object($result); + + $var=!$var; + + print ""; + + // Name + print ''; + + // Firstname + print ''; + + // Function + print ''; + + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + print ''; + } + + if ($view == 'phone') + { + // Phone + print ''; + // Phone mobile + print ''; + // Fax + print ''; + } + else + { + // Phone + print ''; + // EMail + print ''; + } + + // Date + print ''; + + // Private/Public + print ''; + + // Links Add action and Export vcard + print ''; + + print "\n"; + $i++; + } + + print "
 
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ' '; + $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); + print $form->selectarray('search_priv',$selectarray,$search_priv,1); + print ''; + print ''; + print '  '; + print ''; + print '
'; + $contactstatic->name=$obj->name; + $contactstatic->firstname=''; + $contactstatic->id=$obj->cidp; + print $contactstatic->getNomUrl(1,'',20); + print ''.dol_trunc($obj->firstname,20).''.dol_trunc($obj->poste,20).''; + if ($obj->socid) + { + print ''; + print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,20).''; + } + else + { + print ' '; + } + print ''.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->phone_mobile,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->fax,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).''.dol_print_date($db->jdate($obj->tms),"day").''.$contactstatic->LibPubPriv($obj->priv).''; + print ''.img_object($langs->trans("AddAction"),"action").''; + print '   '; + print ''; + print img_picto($langs->trans("VCard"),'vcard.png').' '; + print '
"; + + print '
'; + + if ($num > $limit) print_barre_liste('' ,$page, "index.php", '&begin='.$begin.'&view='.$view.'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num,$nbtotalofrecords, ''); + + $db->free($result); +} +else +{ + dol_print_error($db); +} + +print '
'; + +$db->close(); + +llxFooter('$Date: 2011/08/21 13:19:26 $ - $Revision: 1.1 $'); +?> diff --git a/htdocs/includes/menus/init_menu_auguria.sql b/htdocs/includes/menus/init_menu_auguria.sql index 3a5d4f15f85..d3a8ba2db67 100644 --- a/htdocs/includes/menus/init_menu_auguria.sql +++ b/htdocs/includes/menus/init_menu_auguria.sql @@ -1,6 +1,6 @@ -- --- $Id: init_menu_auguria.sql,v 1.131 2011/08/21 13:12:48 eldy Exp $ --- $Revision: 1.131 $ +-- $Id: init_menu_auguria.sql,v 1.132 2011/08/21 13:19:26 eldy Exp $ +-- $Revision: 1.132 $ -- -- Menu base entries -- This file is loaded when a menu handler base is activated (auguria, etc..) @@ -74,13 +74,13 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/list.php?leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/soc.php?leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -- Third parties - Contacts -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', '', 2__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', '', 2__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/fiche.php?leftmenu=contacts&action=create', 'NewContact', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=p', 'Prospects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=c', 'Customers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=f', 'Suppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=p', 'Prospects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=c', 'Customers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=f', 'Suppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__); -- Third parties - Category customer insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', '', 2__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 651__+MAX_llx_menu__, 'companies', '', 650__+MAX_llx_menu__, '/categories/fiche.php?action=create&type=1', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); diff --git a/htdocs/includes/menus/init_menu_smartphone.sql b/htdocs/includes/menus/init_menu_smartphone.sql index effe25f54ab..cbe41d4c891 100755 --- a/htdocs/includes/menus/init_menu_smartphone.sql +++ b/htdocs/includes/menus/init_menu_smartphone.sql @@ -1,6 +1,6 @@ -- --- $Id: init_menu_smartphone.sql,v 1.10 2011/08/21 13:12:48 eldy Exp $ --- $Revision: 1.10 $ +-- $Id: init_menu_smartphone.sql,v 1.11 2011/08/21 13:19:26 eldy Exp $ +-- $Revision: 1.11 $ -- -- Menu base entries -- This file is loaded when a menu handler base is activated (auguria, etc..) @@ -71,13 +71,13 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/list.php?leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/soc.php?leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -- Third parties - Contacts -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', '', 2__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', '', 2__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/fiche.php?leftmenu=contacts&action=create', 'NewContact', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=p', 'Prospects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=c', 'Customers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=f', 'Suppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=p', 'Prospects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=c', 'Customers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=f', 'Suppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__); -- Third parties - Category customer insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', '', 2__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 651__+MAX_llx_menu__, 'companies', '', 650__+MAX_llx_menu__, '/categories/fiche.php?action=create&type=1', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); @@ -111,7 +111,7 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->fournisseur->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'commercial', '', 5__+MAX_llx_menu__, '/compta/index.php?leftmenu=suppliers', 'Suppliers', 0, 'companies', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 0, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->fournisseur->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'commercial', '', 5000__+MAX_llx_menu__, '/societe/soc.php?leftmenu=suppliers&action=create&type=f', 'NewSupplier', 1, 'companies', '$user->rights->societe->creer && $user->rights->fournisseur->lire', '', 2, 0, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->fournisseur->enabled', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'commercial', '', 5000__+MAX_llx_menu__, '/fourn/liste.php?leftmenu=suppliers', 'List', 1, 'companies', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->fournisseur->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'commercial', '', 5000__+MAX_llx_menu__, '/contact/index.php?leftmenu=suppliers&type=f', 'Contacts', 1, 'companies', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->fournisseur->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'commercial', '', 5000__+MAX_llx_menu__, '/contact/list.php?leftmenu=suppliers&type=f', 'Contacts', 1, 'companies', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 2, __ENTITY__); -- Commercial - Prospects insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 700__+MAX_llx_menu__, 'commercial', '', 5__+MAX_llx_menu__, '/comm/prospect/index.php?leftmenu=prospects', 'Prospects', 0, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 701__+MAX_llx_menu__, 'commercial', '', 700__+MAX_llx_menu__, '/societe/soc.php?leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 1, 'companies', '$user->rights->societe->creer', '', 0, 0, __ENTITY__); @@ -121,20 +121,20 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 705__+MAX_llx_menu__, 'commercial', '', 702__+MAX_llx_menu__, '/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=1', 'LastProspectToContact', 2, 'companies', '$user->rights->societe->lire', '', 0, 2, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 706__+MAX_llx_menu__, 'commercial', '', 702__+MAX_llx_menu__, '/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=2', 'LastProspectContactInProcess', 2, 'companies', '$user->rights->societe->lire', '', 0, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 707__+MAX_llx_menu__, 'commercial', '', 702__+MAX_llx_menu__, '/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=3', 'LastProspectContactDone', 2, 'companies', '$user->rights->societe->lire', '', 0, 4, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 708__+MAX_llx_menu__, 'commercial', '', 700__+MAX_llx_menu__, '/contact/index.php?leftmenu=prospects&type=p', 'Contacts', 1, 'companies', '$user->rights->societe->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 708__+MAX_llx_menu__, 'commercial', '', 700__+MAX_llx_menu__, '/contact/list.php?leftmenu=prospects&type=p', 'Contacts', 1, 'companies', '$user->rights->societe->lire', '', 0, 2, __ENTITY__); -- Commercial - Customers insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 800__+MAX_llx_menu__, 'commercial', '', 5__+MAX_llx_menu__, '/comm/index.php?leftmenu=customers', 'Customers', 0, 'companies', '$user->rights->societe->lire', '', 0, 2, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 801__+MAX_llx_menu__, 'commercial', '', 800__+MAX_llx_menu__, '/societe/soc.php?leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 1, 'companies', '$user->rights->societe->creer', '', 0, 0, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 802__+MAX_llx_menu__, 'commercial', '', 800__+MAX_llx_menu__, '/comm/list.php?leftmenu=customers', 'List', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 803__+MAX_llx_menu__, 'commercial', '', 800__+MAX_llx_menu__, '/contact/index.php?leftmenu=customers&type=c', 'Contacts', 1, 'companies', '$user->rights->societe->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 803__+MAX_llx_menu__, 'commercial', '', 800__+MAX_llx_menu__, '/contact/list.php?leftmenu=customers&type=c', 'Contacts', 1, 'companies', '$user->rights->societe->lire', '', 0, 2, __ENTITY__); -- Commercial - Contacts -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 900__+MAX_llx_menu__, 'commercial', '', 5__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts', 'Contacts', 0, 'companies', '$user->rights->societe->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 900__+MAX_llx_menu__, 'commercial', '', 5__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts', 'Contacts', 0, 'companies', '$user->rights->societe->lire', '', 0, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 901__+MAX_llx_menu__, 'commercial', '', 900__+MAX_llx_menu__, '/contact/fiche.php?leftmenu=contacts&action=create', 'NewContact', 1, 'companies', '$user->rights->societe->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 902__+MAX_llx_menu__, 'commercial', '', 900__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 910__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=p', 'Prospects', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 911__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=c', 'Customers', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->fournisseur->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 912__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=f', 'Suppliers', 1, 'companies', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 913__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/index.php?leftmenu=contacts&type=o', 'Other', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', __HANDLER__, 'left', 902__+MAX_llx_menu__, 'commercial', '', 900__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 910__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=p', 'Prospects', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 911__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=c', 'Customers', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $conf->fournisseur->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 912__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=f', 'Suppliers', 1, 'companies', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled && $leftmenu=="prospects"', __HANDLER__, 'left', 913__+MAX_llx_menu__, 'commercial', '', 902__+MAX_llx_menu__, '/contact/list.php?leftmenu=contacts&type=o', 'Other', 1, 'companies', '$user->rights->societe->lire', '', 0, 1, __ENTITY__); -- Commercial - Proposals insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', '', 5__+MAX_llx_menu__, '/comm/propal.php?leftmenu=propals', 'Prop', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/societe/societe.php?leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); diff --git a/htdocs/includes/menus/standard/eldy.lib.php b/htdocs/includes/menus/standard/eldy.lib.php index f37bed2396c..69ed71b8bc1 100644 --- a/htdocs/includes/menus/standard/eldy.lib.php +++ b/htdocs/includes/menus/standard/eldy.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/includes/menus/standard/eldy.lib.php * \brief Library for file eldy menus - * \version $Id: eldy.lib.php,v 1.68 2011/08/21 13:12:48 eldy Exp $ + * \version $Id: eldy.lib.php,v 1.69 2011/08/21 13:19:26 eldy Exp $ */ @@ -713,7 +713,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) if ($leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); $newmenu->add("/societe/soc.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer); - //$newmenu->add("/contact/index.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); + //$newmenu->add("/contact/list.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); } // Clients @@ -723,7 +723,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/comm/list.php?leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire); $newmenu->add("/societe/soc.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 2, $user->rights->societe->creer); - //$newmenu->add("/contact/index.php?leftmenu=customers&type=c", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); + //$newmenu->add("/contact/list.php?leftmenu=customers&type=c", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire); } // Fournisseurs @@ -737,18 +737,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire); } //$newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("List"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire); - //$newmenu->add("/contact/index.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire && $user->rights->societe->contact->lire); + //$newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire && $user->rights->societe->contact->lire); } // Contacts - $newmenu->add("/contact/index.php?leftmenu=contacts", $langs->trans("ContactsAddresses"), 0, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("ContactsAddresses"), 0, $user->rights->societe->contact->lire); $newmenu->add("/contact/fiche.php?leftmenu=contacts&action=create", $langs->trans("NewContact"), 1, $user->rights->societe->contact->creer); - $newmenu->add("/contact/index.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); - if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $newmenu->add("/contact/index.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); - $newmenu->add("/contact/index.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); - if ($conf->fournisseur->enabled) $newmenu->add("/contact/index.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); - $newmenu->add("/contact/index.php?leftmenu=contacts&type=o", $langs->trans("Others"), 2, $user->rights->societe->contact->lire); - //$newmenu->add("/contact/index.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); + if ($conf->fournisseur->enabled) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("Others"), 2, $user->rights->societe->contact->lire); + //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); // Categories if ($conf->categorie->enabled) @@ -1142,7 +1142,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/societe/soc.php?leftmenu=suppliers&action=create&type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire); } $newmenu->add("/fourn/liste.php",$langs->trans("List"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); - $newmenu->add("/contact/index.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 1, $user->rights->societe->contact->lire && $user->rights->fournisseur->lire); + $newmenu->add("/contact/list.php?leftmenu=suppliers&type=f",$langs->trans("Contacts"), 1, $user->rights->societe->contact->lire && $user->rights->fournisseur->lire); $newmenu->add("/fourn/stats.php",$langs->trans("Statistics"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire); }