print '</tr>';
 // Type
 print '<tr><td>' . $langs->trans("Type") . '</td><td class="valeur">' . $adht->getNomUrl(1) . "</td></tr>\n";
 // Company
 print '<tr><td>' . $langs->trans("Company") . '</td><td class="valeur">' . $object->societe . '</td></tr>';
 // Civility
 print '<tr><td>' . $langs->trans("UserTitle") . '</td><td class="valeur">' . $object->getCivilityLabel() . '&nbsp;</td>';
 print '</tr>';
 // Lastname
 print '<tr><td>' . $langs->trans("Lastname") . '</td><td class="valeur">' . $object->lastname . '&nbsp;</td>';
 print '</tr>';
 // Firstname
 print '<tr><td>' . $langs->trans("Firstname") . '</td><td class="valeur">' . $object->firstname . '&nbsp;</td>';
 print '</tr>';
 // EMail
 print '<tr><td>' . $langs->trans("EMail") . '</td><td class="valeur">' . dol_print_email($object->email, 0, $object->fk_soc, 1) . '</td></tr>';
 // Status
 print '<tr><td>' . $langs->trans("Status") . '</td><td class="valeur">' . $object->getLibStatut(4) . '</td></tr>';
 // Date end subscription
 print '<tr><td>' . $langs->trans("SubscriptionEndDate") . '</td><td class="valeur">';
 if ($object->datefin) {
     print dol_print_date($object->datefin, 'day');
     if ($object->datefin < $now - $conf->adherent->cotisation->warning_delay && $object->statut > 0) {
         print " " . img_warning($langs->trans("Late"));
     }
     // Affiche picto retard uniquement si non brouillon et non resilie
 } else {
     print $langs->trans("SubscriptionNotReceived");
     if ($object->statut > 0) {
         print " " . img_warning($langs->trans("Late"));
     }
Example #2
0
 }
 // Phone perso
 if (!empty($arrayfields['p.phone_perso']['checked'])) {
     print '<td>' . dol_print_phone($obj->phone_perso, $obj->country_code, $obj->cidp, $obj->socid, 'AC_TEL') . '</td>';
 }
 // Phone mobile
 if (!empty($arrayfields['p.phone_mobile']['checked'])) {
     print '<td>' . dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->cidp, $obj->socid, 'AC_TEL') . '</td>';
 }
 // Fax
 if (!empty($arrayfields['p.fax']['checked'])) {
     print '<td>' . dol_print_phone($obj->fax, $obj->country_code, $obj->cidp, $obj->socid, 'AC_TEL') . '</td>';
 }
 // EMail
 if (!empty($arrayfields['p.email']['checked'])) {
     print '<td>' . dol_print_email($obj->email, $obj->cidp, $obj->socid, 'AC_EMAIL', 18) . '</td>';
 }
 // Skype
 if (!empty($arrayfields['p.skype']['checked'])) {
     if (!empty($conf->skype->enabled)) {
         print '<td>' . dol_print_skype($obj->skype, $obj->cidp, $obj->socid, 'AC_SKYPE', 18) . '</td>';
     }
 }
 // Company
 if (!empty($arrayfields['p.thirdparty']['checked'])) {
     print '<td>';
     if ($obj->socid) {
         print '<a href="' . DOL_URL_ROOT . '/comm/card.php?socid=' . $obj->socid . '">';
         print img_object($langs->trans("ShowCompany"), "company") . ' ' . dol_trunc($obj->name, 20) . '</a>';
     } else {
         print '&nbsp;';
Example #3
0
llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES:M&oacute;dulo_Mailing');
$form = new Form($db);
$formmailing = new FormMailing($db);
if ($object->fetch($id) >= 0) {
    $head = emailing_prepare_head($object);
    dol_fiche_head($head, 'targets', $langs->trans("Mailing"), 0, 'email');
    print '<table class="border" width="100%">';
    $linkback = '<a href="' . DOL_URL_ROOT . '/comm/mailing/list.php">' . $langs->trans("BackToList") . '</a>';
    print '<tr><td width="25%">' . $langs->trans("Ref") . '</td>';
    print '<td colspan="3">';
    print $form->showrefnav($object, 'id', $linkback);
    print '</td></tr>';
    print '<tr><td width="25%">' . $langs->trans("MailTitle") . '</td><td colspan="3">' . $object->titre . '</td></tr>';
    print '<tr><td width="25%">' . $langs->trans("MailFrom") . '</td><td colspan="3">' . dol_print_email($object->email_from, 0, 0, 0, 0, 1) . '</td></tr>';
    // Errors to
    print '<tr><td width="25%">' . $langs->trans("MailErrorsTo") . '</td><td colspan="3">' . dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1);
    print '</td></tr>';
    // Status
    print '<tr><td width="25%">' . $langs->trans("Status") . '</td><td colspan="3">' . $object->getLibStatut(4) . '</td></tr>';
    // Nb of distinct emails
    print '<tr><td width="25%">';
    print $langs->trans("TotalNbOfDistinctRecipients");
    print '</td><td colspan="3">';
    $nbemail = $object->nbemail ? $object->nbemail : '0';
    if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) {
        $text = $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
        print $form->textwithpicto($nbemail, $text, 1, 'warning');
    } else {
        print $nbemail;
    }
    print '</td></tr>';
dol_print_address($soc->address, 'gmap', 'thirdparty', $soc->id);
print "</td></tr>";
// Zip / Town
print '<tr><td width="25%">' . $langs->trans('Zip') . '</td><td width="25%">' . $soc->zip . "</td>";
print '<td width="25%">' . $langs->trans('Town') . '</td><td width="25%">' . $soc->town . "</td></tr>";
// Country
if ($soc->country) {
    print '<tr><td>' . $langs->trans('Country') . '</td><td colspan="3">';
    $img = picto_from_langcode($soc->country_code);
    print $img ? $img . ' ' : '';
    print $soc->country;
    print '</td></tr>';
}
// EMail
print '<tr><td>' . $langs->trans('EMail') . '</td><td colspan="3">';
print dol_print_email($soc->email, 0, $soc->id, 'AC_EMAIL');
print '</td></tr>';
// Web
print '<tr><td>' . $langs->trans('Web') . '</td><td colspan="3">';
print dol_print_url($soc->url);
print '</td></tr>';
// Phone / Fax
print '<tr><td>' . $langs->trans('Phone') . '</td><td>' . dol_print_phone($soc->tel, $soc->country_code, 0, $soc->id, 'AC_TEL') . '</td>';
print '<td>' . $langs->trans('Fax') . '</td><td>' . dol_print_phone($soc->fax, $soc->country_code, 0, $soc->id, 'AC_FAX') . '</td></tr>';
print '</table>';
print '</div>';
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
    $prodcustprice = new Productcustomerprice($db);
    $sortfield = GETPOST("sortfield", 'alpha');
    $sortorder = GETPOST("sortorder", 'alpha');
    $page = GETPOST("page", 'int');
Example #5
0
/**
 * 		Show html area for list of contacts
 *
 *		@param	Conf		$conf		Object conf
 * 		@param	Translate	$langs		Object langs
 * 		@param	DoliDB		$db			Database handler
 * 		@param	Object		$object		Third party object
 *      @param  string		$backtopage	Url to go once contact is created
 *      @return	void
 */
function show_contacts($conf, $langs, $db, $object, $backtopage = '')
{
    global $user;
    global $bc;
    $i = -1;
    $contactstatic = new Contact($db);
    if ($conf->clicktodial->enabled) {
        $user->fetch_clicktodial();
        // lecture des infos de clicktodial
    }
    $buttoncreate = '';
    if ($user->rights->societe->contact->creer) {
        $addcontact = !empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress");
        $buttoncreate = '<a class="addnewrecord" href="' . DOL_URL_ROOT . '/contact/fiche.php?socid=' . $object->id . '&amp;action=create&amp;backtopage=' . urlencode($backtopage) . '">' . $addcontact . ' ' . img_picto($addcontact, 'filenew') . '</a>' . "\n";
    }
    print "\n";
    $title = !empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany");
    print_fiche_titre($title, $buttoncreate, '');
    print "\n" . '<table class="noborder" width="100%">' . "\n";
    print '<tr class="liste_titre"><td>' . $langs->trans("Name") . '</td>';
    print '<td>' . $langs->trans("Poste") . '</td><td>' . $langs->trans("Tel") . '</td>';
    print '<td>' . $langs->trans("Fax") . '</td><td>' . $langs->trans("EMail") . '</td>';
    print "<td>&nbsp;</td>";
    if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
        print '<td>&nbsp;</td>';
    }
    print "</tr>";
    $sql = "SELECT p.rowid, p.name, p.firstname, p.fk_pays, p.poste, p.phone, p.fax, p.email, p.note ";
    $sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as p";
    $sql .= " WHERE p.fk_soc = " . $object->id;
    $sql .= " ORDER by p.datec";
    $result = $db->query($sql);
    $num = $db->num_rows($result);
    if ($num) {
        $i = 0;
        $var = true;
        while ($i < $num) {
            $obj = $db->fetch_object($result);
            $var = !$var;
            print "<tr " . $bc[$var] . ">";
            print '<td>';
            $contactstatic->id = $obj->rowid;
            $contactstatic->name = $obj->name;
            $contactstatic->firstname = $obj->firstname;
            print $contactstatic->getNomUrl(1);
            print '</td>';
            print '<td>' . $obj->poste . '</td>';
            $country_code = getCountry($obj->fk_pays, 2);
            // Lien click to dial
            print '<td>';
            print dol_print_phone($obj->phone, $country_code, $obj->rowid, $object->id, 'AC_TEL');
            print '</td>';
            print '<td>';
            print dol_print_phone($obj->fax, $country_code, $obj->rowid, $object->id, 'AC_FAX');
            print '</td>';
            print '<td>';
            print dol_print_email($obj->email, $obj->rowid, $object->id, 'AC_EMAIL');
            print '</td>';
            if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) {
                print '<td align="center"><a href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
                print img_object($langs->trans("Rendez-Vous"), "action");
                print '</a></td>';
            }
            if ($user->rights->societe->contact->creer) {
                print '<td align="right">';
                print '<a href="' . DOL_URL_ROOT . '/contact/fiche.php?action=edit&amp;id=' . $obj->rowid . '&amp;backtopage=' . urlencode($backtopage) . '">';
                print img_edit();
                print '</a></td>';
            }
            print "</tr>\n";
            $i++;
        }
    } else {
        //print "<tr ".$bc[$var].">";
        //print '<td>'.$langs->trans("NoContactsYetDefined").'</td>';
        //print "</tr>\n";
    }
    print "\n</table>\n";
    print "<br>\n";
    return $i;
}
    /**
     *    Assign custom values for canvas (for example into this->tpl to be used by templates)
     *
     *    @param	string	$action    Type of action
     *    @param	string	$id			Id of object
     *    @param	string	$ref		Ref of object
     *    @return	void
     */
    function assign_values(&$action, $id = 0, $ref = '')
    {
        global $conf, $langs, $user, $mysoc, $canvas;
        global $form, $formadmin, $formcompany;
        if ($action == 'add' || $action == 'update') {
            $this->assign_post($action);
        }
        if ($_GET["type"] == 'f') {
            $this->object->fournisseur = 1;
        }
        if ($_GET["type"] == 'c') {
            $this->object->client = 1;
        }
        if ($_GET["type"] == 'p') {
            $this->object->client = 2;
        }
        if ($_GET["type"] == 'cp') {
            $this->object->client = 3;
        }
        if ($_REQUEST["private"] == 1) {
            $this->object->particulier = 1;
        }
        foreach ($this->object as $key => $value) {
            $this->tpl[$key] = $value;
        }
        $this->tpl['error'] = get_htmloutput_errors($this->object->error, $this->object->errors);
        if (is_array($GLOBALS['errors'])) {
            $this->tpl['error'] = get_htmloutput_mesg('', $GLOBALS['errors'], 'error');
        }
        if ($action == 'create') {
            if ($conf->use_javascript_ajax) {
                $this->tpl['ajax_selecttype'] = "\n" . '<script type="text/javascript" language="javascript">
				$(document).ready(function () {
		              $("#radiocompany").click(function() {
                            document.formsoc.action.value="create";
                            document.formsoc.canvas.value="company";
                            document.formsoc.private.value=0;
                            document.formsoc.submit();
		              });
		               $("#radioprivate").click(function() {
                            document.formsoc.action.value="create";
                            document.formsoc.canvas.value="individual";
                            document.formsoc.private.value=1;
                            document.formsoc.submit();
                      });
		          });
                </script>' . "\n";
            }
        }
        if ($action == 'create' || $action == 'edit') {
            if ($conf->use_javascript_ajax) {
                $this->tpl['ajax_selectcountry'] = "\n" . '<script type="text/javascript" language="javascript">
				$(document).ready(function () {
						$("#selectcountry_id").change(function() {
							document.formsoc.action.value="' . $action . '";
							document.formsoc.canvas.value="' . $canvas . '";
							document.formsoc.submit();
						});
					})
				</script>' . "\n";
            }
            // Load object modCodeClient
            $module = !empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard';
            if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
                $module = substr($module, 0, dol_strlen($module) - 4);
            }
            $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
            foreach ($dirsociete as $dirroot) {
                $res = dol_include_once($dirroot . $module . '.php');
                if ($res) {
                    break;
                }
            }
            $modCodeClient = new $module($db);
            $this->tpl['auto_customercode'] = $modCodeClient->code_auto;
            // We verified if the tag prefix is used
            if ($modCodeClient->code_auto) {
                $this->tpl['prefix_customercode'] = $modCodeClient->verif_prefixIsUsed();
            }
            // TODO create a function
            $this->tpl['select_customertype'] = '<select class="flat" name="client">';
            $this->tpl['select_customertype'] .= '<option value="2"' . ($this->object->client == 2 ? ' selected="selected"' : '') . '>' . $langs->trans('Prospect') . '</option>';
            $this->tpl['select_customertype'] .= '<option value="3"' . ($this->object->client == 3 ? ' selected="selected"' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>';
            $this->tpl['select_customertype'] .= '<option value="1"' . ($this->object->client == 1 ? ' selected="selected"' : '') . '>' . $langs->trans('Customer') . '</option>';
            $this->tpl['select_customertype'] .= '<option value="0"' . ($this->object->client == 0 ? ' selected="selected"' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>';
            $this->tpl['select_customertype'] .= '</select>';
            // Customer
            $this->tpl['customercode'] = $this->object->code_client;
            if ((!$this->object->code_client || $this->object->code_client == -1) && $modCodeClient->code_auto) {
                $this->tpl['customercode'] = $modCodeClient->getNextValue($this->object, 0);
            }
            $this->tpl['ismodifiable_customercode'] = $this->object->codeclient_modifiable();
            $s = $modCodeClient->getToolTip($langs, $this->object, 0);
            $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1);
            if (!empty($conf->fournisseur->enabled)) {
                $this->tpl['supplier_enabled'] = 1;
                // Load object modCodeFournisseur
                $module = $conf->global->SOCIETE_CODECLIENT_ADDON;
                if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
                    $module = substr($module, 0, dol_strlen($module) - 4);
                }
                $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
                foreach ($dirsociete as $dirroot) {
                    $res = dol_include_once($dirroot . $module . '.php');
                    if ($res) {
                        break;
                    }
                }
                $modCodeFournisseur = new $module();
                $this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto;
                // We verified if the tag prefix is used
                if ($modCodeFournisseur->code_auto) {
                    $this->tpl['prefix_suppliercode'] = $modCodeFournisseur->verif_prefixIsUsed();
                }
                // Supplier
                $this->tpl['yn_supplier'] = $form->selectyesno("fournisseur", $this->object->fournisseur, 1);
                $this->tpl['suppliercode'] = $this->object->code_fournisseur;
                if ((!$this->object->code_fournisseur || $this->object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) {
                    $this->tpl['suppliercode'] = $modCodeFournisseur->getNextValue($this->object, 1);
                }
                $this->tpl['ismodifiable_suppliercode'] = $this->object->codefournisseur_modifiable();
                $s = $modCodeFournisseur->getToolTip($langs, $this->object, 1);
                $this->tpl['help_suppliercode'] = $form->textwithpicto('', $s, 1);
                $this->object->LoadSupplierCateg();
                $this->tpl['suppliercategory'] = $this->object->SupplierCategories;
            }
            // Zip
            $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
            // Town
            $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
            // Country
            $this->object->country_id = $this->object->country_id ? $this->object->country_id : $mysoc->country_id;
            $this->object->country_code = $this->object->country_code ? $this->object->country_code : $mysoc->country_code;
            $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id');
            $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')';
            if ($user->admin) {
                $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
            }
            // State
            if ($this->object->country_id) {
                $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id, $this->object->country_code);
            } else {
                $this->tpl['select_state'] = $countrynotdefined;
            }
            // Language
            if (!empty($conf->global->MAIN_MULTILANGS)) {
                $this->tpl['select_lang'] = $formadmin->select_language($this->object->default_lang ? $this->object->default_lang : $conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1);
            }
            // VAT
            $this->tpl['yn_assujtva'] = $form->selectyesno('assujtva_value', $this->tpl['tva_assuj'], 1);
            // Assujeti par defaut en creation
            // Select users
            $this->tpl['select_users'] = $form->select_dolusers($this->object->commercial_id, 'commercial_id', 1);
            // Local Tax
            // TODO mettre dans une classe propre au pays
            if ($mysoc->country_code == 'ES') {
                $this->tpl['localtax'] = '';
                if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td>';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td>';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td></tr>';
                } elseif ($mysoc->localtax1_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td colspan="3">';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><tr>';
                } elseif ($mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td colspan="3">';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><tr>';
                }
            }
        } else {
            $head = societe_prepare_head($this->object);
            $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company');
            $this->tpl['showend'] = dol_get_fiche_end();
            $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'socid', '', $user->societe_id ? 0 : 1, 'rowid', 'nom');
            $this->tpl['checkcustomercode'] = $this->object->check_codeclient();
            $this->tpl['checksuppliercode'] = $this->object->check_codefournisseur();
            $this->tpl['address'] = dol_nl2br($this->object->address);
            $img = picto_from_langcode($this->object->country_code);
            if ($this->object->isInEEC()) {
                $this->tpl['country'] = $form->textwithpicto(($img ? $img . ' ' : '') . $this->object->country, $langs->trans("CountryIsInEEC"), 1, 0);
            }
            $this->tpl['country'] = ($img ? $img . ' ' : '') . $this->object->country;
            $this->tpl['phone'] = dol_print_phone($this->object->phone, $this->object->country_code, 0, $this->object->id, 'AC_TEL');
            $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX');
            $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL');
            $this->tpl['url'] = dol_print_url($this->object->url);
            $this->tpl['tva_assuj'] = yn($this->object->tva_assuj);
            // Third party type
            $arr = $formcompany->typent_array(1);
            $this->tpl['typent'] = $arr[$this->object->typent_code];
            if (!empty($conf->global->MAIN_MULTILANGS)) {
                require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
                //$s=picto_from_langcode($this->default_lang);
                //print ($s?$s.' ':'');
                $langs->load("languages");
                $this->tpl['default_lang'] = $this->default_lang ? $langs->trans('Language_' . $this->object->default_lang) : '';
            }
            $this->tpl['image_edit'] = img_edit();
            $this->tpl['display_rib'] = $this->object->display_rib();
            // Sales representatives
            $this->tpl['sales_representatives'] = '';
            $listsalesrepresentatives = $this->object->getSalesRepresentatives($user);
            $nbofsalesrepresentative = count($listsalesrepresentatives);
            if ($nbofsalesrepresentative > 3) {
                $this->tpl['sales_representatives'] .= '<a href="' . DOL_URL_ROOT . '/societe/commerciaux.php?socid=' . $this->object->id . '">';
                $this->tpl['sales_representatives'] .= $nbofsalesrepresentative;
                $this->tpl['sales_representatives'] .= '</a>';
            } else {
                if ($nbofsalesrepresentative > 0) {
                    $userstatic = new User($this->db);
                    $i = 0;
                    foreach ($listsalesrepresentatives as $val) {
                        $userstatic->id = $val['id'];
                        $userstatic->lastname = $val['name'];
                        $userstatic->firstname = $val['firstname'];
                        $this->tpl['sales_representatives'] .= $userstatic->getNomUrl(1);
                        $i++;
                        if ($i < $nbofsalesrepresentative) {
                            $this->tpl['sales_representatives'] .= ', ';
                        }
                    }
                } else {
                    $this->tpl['sales_representatives'] .= $langs->trans("NoSalesRepresentativeAffected");
                }
            }
            // Linked member
            if (!empty($conf->adherent->enabled)) {
                $langs->load("members");
                $adh = new Adherent($this->db);
                $result = $adh->fetch('', '', $this->object->id);
                if ($result > 0) {
                    $adh->ref = $adh->getFullName($langs);
                    $this->tpl['linked_member'] = $adh->getNomUrl(1);
                } else {
                    $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember");
                }
            }
            // Local Tax
            // TODO mettre dans une classe propre au pays
            if ($mysoc->country_code == 'ES') {
                $this->tpl['localtax'] = '';
                if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax1_assuj) . '</td>';
                    $this->tpl['localtax'] .= '<td>' . $langs->trans("LocalTax2IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax2_assuj) . '</td></tr>';
                } elseif ($mysoc->localtax1_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax1_assuj) . '</td></tr>';
                } elseif ($mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax2_assuj) . '</td></tr>';
                }
            }
        }
    }
 print '<td rowspan="' . $nbrows . '" valign="top" width="50%">' . $langs->trans("Comments") . ' :<br>';
 print nl2br($don->note_private) . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Amount") . '</td><td>' . price($don->amount, 0, $langs, 0, 0, -1, $conf->currency) . '</td></tr>';
 print "<tr><td>" . $langs->trans("PublicDonation") . "</td><td>";
 print yn($don->public);
 print "</td></tr>\n";
 print "<tr>" . '<td>' . $langs->trans("Company") . '</td><td>' . $don->societe . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Firstname") . '</td><td>' . $don->firstname . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Lastname") . '</td><td>' . $don->lastname . '</td></tr>';
 print "<tr>" . '<td>' . $langs->trans("Address") . '</td><td>' . dol_nl2br($don->address) . '</td></tr>';
 // Zip / Town
 print "<tr>" . '<td>' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td>' . $don->zip . ($don->zip && $don->town ? ' / ' : '') . $don->town . '</td></tr>';
 // Country
 print "<tr>" . '<td>' . $langs->trans("Country") . '</td><td>' . $don->country . '</td></tr>';
 // EMail
 print "<tr>" . '<td>' . $langs->trans("EMail") . '</td><td>' . dol_print_email($don->email) . '</td></tr>';
 // Payment mode
 print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>";
 print $form->form_modes_reglement(null, $don->modepaiementid, 'none');
 print "</td></tr>\n";
 print "<tr>" . '<td>' . $langs->trans("Status") . '</td><td>' . $don->getLibStatut(4) . '</td></tr>';
 // Project
 if (!empty($conf->projet->enabled)) {
     print "<tr>" . '<td>' . $langs->trans("Project") . '</td><td>' . $don->projet . '</td></tr>';
 }
 // Other attributes
 $parameters = array('colspan' => ' colspan="1"');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $don, $action);
 // Note that $action and $object may have been modified by hook
 print "</table>\n";
 print "</form>\n";
Example #8
0
 /**
  *	Output val field for an editable field
  * 	@param		text			Text of label (not used in this function)
  * 	@param		htmlname		Name of select field
  * 	@param		preselected		Preselected value for parameter
  * 	@param		paramkey		Key of parameter (unique if there is several parameter to show)
  * 	@param		perm			Permission to allow button to edit parameter
  * 	@param		typeofdata		Type of data ('string' by default, 'email', 'text', ...)
  * 	@param		editvalue		Use this value instead $preselected
  *  @return     string          HTML edit field
  *  TODO no GET or POST in class file, use a param
  */
 function editfieldval($text, $htmlname, $preselected, $paramkey, $paramvalue, $perm, $typeofdata = 'string', $editvalue = '')
 {
     global $langs;
     $ret = '';
     if (GETPOST('action') == 'edit' . $htmlname) {
         $ret .= "\n";
         $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . '">';
         $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
         $ret .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
         $ret .= '<input type="hidden" name="' . $paramkey . '" value="' . $paramvalue . '">';
         $ret .= '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
         $ret .= '<tr><td>';
         if (in_array($typeofdata, array('string', 'email'))) {
             $ret .= '<input type="text" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $preselected) . '">';
         } else {
             if ($typeofdata == 'text') {
                 $ret .= '<textarea name="' . $htmlname . '">' . ($editvalue ? $editvalue : $preselected) . '</textarea>';
             }
         }
         $ret .= '</td>';
         $ret .= '<td align="left"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td>';
         $ret .= '</tr></table>' . "\n";
         $ret .= '</form>' . "\n";
     } else {
         if ($typeofdata == 'email') {
             $ret .= dol_print_email($preselected, 0, 0, 0, 0, 1);
         } else {
             $ret .= $preselected;
         }
     }
     return $ret;
 }
    if (empty($conf->fckeditor->enabled)) {
        print dol_htmlentitiesbr($object->commentaires);
    } else {
        $doleditor = new DolEditor('nouveauxcommentaires', dol_htmlentities($object->commentaires), '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, 120, 1);
        $doleditor->Create(0, '');
    }
}
print '</td></tr>';
// EMail
//If linked user, then emails are going to be sent to users' email
if (!$object->fk_user_creat) {
    print '<tr><td>' . $langs->trans("EMail") . '</td><td colspan="2">';
    if ($action == 'edit') {
        print '<input type="text" name="nouvelleadresse" size="40" value="' . $object->mail_admin . '">';
    } else {
        print dol_print_email($object->mail_admin, 0, 0, 1);
    }
    print '</td></tr>';
}
// Receive an email with each vote
print '<tr><td>' . $langs->trans('ToReceiveEMailForEachVote') . '</td><td colspan="2">';
if ($action == 'edit') {
    print '<input type="checkbox" name="mailsonde" size="40"' . ($object->mailsonde ? ' checked="true"' : '') . '">';
} else {
    print yn($object->mailsonde);
    //If option is active and linked user does not have an email, we show a warning
    if ($object->fk_user_creat && $object->mailsonde) {
        if (!$userstatic->email) {
            print ' ' . img_warning($langs->trans('NoEMail'));
        }
    }
Example #10
0
 print '<tr><td valign="top">' . $langs->trans("PhoneMobile") . '</td>';
 print '<td colspan="2">' . dol_print_phone($object->user_mobile, '', 0, 0, 1) . '</td>';
 print '</tr>' . "\n";
 // Fax
 print '<tr><td valign="top">' . $langs->trans("Fax") . '</td>';
 print '<td colspan="2">' . dol_print_phone($object->office_fax, '', 0, 0, 1) . '</td>';
 print '</tr>' . "\n";
 // Skype
 if (!empty($conf->skype->enabled)) {
     print '<tr><td valign="top">' . $langs->trans("Skype") . '</td>';
     print '<td colspan="2">' . dol_print_skype($object->skype, 0, 0, 1) . '</td>';
     print "</tr>\n";
 }
 // EMail
 print '<tr><td valign="top">' . $langs->trans("EMail") . '</td>';
 print '<td colspan="2">' . dol_print_email($object->email, 0, 0, 1) . '</td>';
 print "</tr>\n";
 // Signature
 print '<tr><td valign="top">' . $langs->trans('Signature') . '</td><td colspan="2">';
 print dol_htmlentitiesbr($object->signature);
 print "</td></tr>\n";
 // Hierarchy
 print '<tr><td valign="top">' . $langs->trans("HierarchicalResponsible") . '</td>';
 print '<td colspan="2">';
 if (empty($object->fk_user)) {
     print $langs->trans("None");
 } else {
     $huser = new User($db);
     $huser->fetch($object->fk_user);
     print $huser->getNomUrl(1);
 }
/**
 * 		Show html area for list of contacts
 *
 *		@param	Conf		$conf		Object conf
 * 		@param	Translate	$langs		Object langs
 * 		@param	DoliDB		$db			Database handler
 * 		@param	Object		$object		Third party object
 *      @param  string		$backtopage	Url to go once contact is created
 *      @return	void
 */
function show_contacts($conf, $langs, $db, $object, $backtopage = '')
{
    global $user, $conf;
    global $bc;
    $form = new Form($db);
    $sortfield = GETPOST("sortfield", 'alpha');
    $sortorder = GETPOST("sortorder", 'alpha');
    $search_status = GETPOST("search_status", 'int');
    if ($search_status == '') {
        $search_status = 1;
    }
    // always display activ customer first
    $search_name = GETPOST("search_name", 'alpha');
    if (!$sortorder) {
        $sortorder = "ASC";
    }
    if (!$sortfield) {
        $sortfield = "p.lastname";
    }
    $i = -1;
    $contactstatic = new Contact($db);
    if (!empty($conf->clicktodial->enabled)) {
        $user->fetch_clicktodial();
        // lecture des infos de clicktodial
    }
    $buttoncreate = '';
    if ($user->rights->societe->contact->creer) {
        $addcontact = !empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress");
        $buttoncreate = '<a class="addnewrecord" href="' . DOL_URL_ROOT . '/contact/fiche.php?socid=' . $object->id . '&amp;action=create&amp;backtopage=' . urlencode($backtopage) . '">' . $addcontact;
        if (empty($conf->dol_optimize_smallscreen)) {
            $buttoncreate .= ' ' . img_picto($addcontact, 'filenew');
        }
        $buttoncreate .= '</a>' . "\n";
    }
    print "\n";
    $title = !empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany");
    print_fiche_titre($title, $buttoncreate, '');
    print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '" name="formfilter">';
    print '<input type="hidden" name="socid" value="' . $object->id . '">';
    print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
    print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
    print "\n" . '<table class="noborder" width="100%">' . "\n";
    $param = "socid=" . $object->id;
    if ($search_status != '') {
        $param .= '&amp;search_status=' . $search_status;
    }
    if ($search_name != '') {
        $param .= '&amp;search_name=' . urlencode($search_name);
    }
    $colspan = 9;
    print '<tr class="liste_titre">';
    print_liste_field_titre($langs->trans("Name"), $_SERVER["PHP_SELF"], "p.lastname", "", $param, '', $sortfield, $sortorder);
    print_liste_field_titre($langs->trans("Poste"), $_SERVER["PHP_SELF"], "p.poste", "", $param, '', $sortfield, $sortorder);
    print_liste_field_titre($langs->trans("PhonePro"), $_SERVER["PHP_SELF"], "p.phone", "", $param, '', $sortfield, $sortorder);
    print_liste_field_titre($langs->trans("PhoneMobile"), $_SERVER["PHP_SELF"], "p.phone_mobile", "", $param, '', $sortfield, $sortorder);
    print_liste_field_titre($langs->trans("Fax"), $_SERVER["PHP_SELF"], "p.fax", "", $param, '', $sortfield, $sortorder);
    print_liste_field_titre($langs->trans("EMail"), $_SERVER["PHP_SELF"], "p.email", "", $param, '', $sortfield, $sortorder);
    if (!empty($conf->skype->enabled)) {
        $colspan++;
        print '<td>' . $langs->trans("Skype") . '</td>';
    }
    print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder);
    // Copy to clipboard
    print "<td>&nbsp;</td>";
    // Add to agenda
    if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) {
        $colspan++;
        print '<td>&nbsp;</td>';
    }
    // Edit
    print '<td>&nbsp;</td>';
    print "</tr>";
    print '<tr class="liste_titre">';
    print '<td class="liste_titre">';
    print '<input type="text" class="flat" name="search_name" size="20" value="' . $search_name . '">';
    print '</td>';
    print '<td>&nbsp;</td>';
    print '<td>&nbsp;</td>';
    print '<td>&nbsp;</td>';
    print '<td>&nbsp;</td>';
    print '<td>&nbsp;</td>';
    if (!empty($conf->skype->enabled)) {
        $colspan++;
        print '<td>&nbsp;</td>';
    }
    // Status
    print '<td class="liste_titre maxwidthonsmartphone">';
    print $form->selectarray('search_status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $search_status);
    print '</td>';
    // Copy to clipboard
    print "<td>&nbsp;</td>";
    // Add to agenda
    if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
        $colspan++;
        print '<td>&nbsp;</td>';
    }
    // Edit
    print '<td class="liste_titre" align="right">';
    print '<input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
    print '</td>';
    print "</tr>";
    $sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.skype, p.statut ";
    $sql .= ", p.civilite as civility_id, p.address, p.zip, p.town";
    $sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as p";
    $sql .= " WHERE p.fk_soc = " . $object->id;
    if ($search_status != '') {
        $sql .= " AND p.statut = " . $db->escape($search_status);
    }
    if ($search_name) {
        $sql .= " AND (p.lastname LIKE '%" . $db->escape($search_name) . "%' OR p.firstname LIKE '%" . $db->escape($search_name) . "%')";
    }
    $sql .= " ORDER BY {$sortfield} {$sortorder}";
    dol_syslog('core/lib/company.lib.php :: show_contacts sql=' . $sql, LOG_DEBUG);
    $result = $db->query($sql);
    $num = $db->num_rows($result);
    $var = true;
    if ($num) {
        $i = 0;
        while ($i < $num) {
            $obj = $db->fetch_object($result);
            $var = !$var;
            print "<tr " . $bc[$var] . ">";
            print '<td>';
            $contactstatic->id = $obj->rowid;
            $contactstatic->statut = $obj->statut;
            $contactstatic->lastname = $obj->lastname;
            $contactstatic->firstname = $obj->firstname;
            $contactstatic->civility_id = $obj->civility_id;
            print $contactstatic->getNomUrl(1);
            print '</td>';
            print '<td>' . $obj->poste . '</td>';
            $country_code = getCountry($obj->country_id, 'all');
            // Lien click to dial
            print '<td>';
            print dol_print_phone($obj->phone, $country_code['code'], $obj->rowid, $object->id, 'AC_TEL');
            print '</td>';
            print '<td>';
            print dol_print_phone($obj->phone_mobile, $country_code['code'], $obj->rowid, $object->id, 'AC_TEL');
            print '</td>';
            print '<td>';
            print dol_print_phone($obj->fax, $country_code['code'], $obj->rowid, $object->id, 'AC_FAX');
            print '</td>';
            print '<td>';
            print dol_print_email($obj->email, $obj->rowid, $object->id, 'AC_EMAIL');
            print '</td>';
            if (!empty($conf->skype->enabled)) {
                print '<td>';
                print dol_print_skype($obj->skype, $obj->rowid, $object->id, 'AC_SKYPE');
                print '</td>';
            }
            // Status
            print '<td>' . $contactstatic->getLibStatut(5) . '</td>';
            print '<td align="center">';
            if (!empty($conf->use_javascript_ajax)) {
                // Copy to clipboard
                $coords = '';
                if (!empty($object->name)) {
                    $coords .= $object->name . "<br>";
                }
                $coords .= $contactstatic->getFullName($langs, 1) . ' ';
                $coords .= "<br>";
                if (!empty($obj->address)) {
                    $coords .= dol_nl2br($obj->address, 1, true) . "<br>";
                    if (!empty($obj->zip)) {
                        $coords .= $obj->zip . ' ';
                    }
                    if (!empty($obj->town)) {
                        $coords .= $obj->town;
                    }
                    if (!empty($obj->country_id)) {
                        $coords .= "<br>" . $country_code['label'];
                    }
                } else {
                    if (!empty($object->address)) {
                        $coords .= dol_nl2br($object->address, 1, true) . "<br>";
                        if (!empty($object->zip)) {
                            $coords .= $object->zip . ' ';
                        }
                        if (!empty($object->town)) {
                            $coords .= $object->town;
                        }
                        if (!empty($object->country_id)) {
                            $coords .= "<br>" . $country_code['label'];
                        }
                    }
                }
                // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile
                print '<a href="#" class="hideonsmartphone" onclick="return copyToClipboard(\'' . dol_escape_js($coords) . '\',\'' . dol_escape_js($langs->trans("HelpCopyToClipboard")) . '\');">';
                print img_picto($langs->trans("Address"), 'object_address.png');
                print '</a>';
            }
            print '</td>';
            // Add to agenda
            if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
                print '<td align="center">';
                if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
                    print '<a class="hideonsmartphone" href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
                    print img_object($langs->trans("Rendez-Vous"), "action_rdv");
                    print '</a> ';
                }
                print '<a href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create&actioncode=&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">';
                print img_object($langs->trans("Event"), "action");
                print '</a></td>';
            }
            // Edit
            if ($user->rights->societe->contact->creer) {
                print '<td align="right">';
                print '<a href="' . DOL_URL_ROOT . '/contact/fiche.php?action=edit&amp;id=' . $obj->rowid . '&amp;backtopage=' . urlencode($backtopage) . '">';
                print img_edit();
                print '</a></td>';
            } else {
                print '<td>&nbsp;</td>';
            }
            print "</tr>\n";
            $i++;
        }
    } else {
        print "<tr " . $bc[$var] . ">";
        print '<td colspan="' . $colspan . '">' . $langs->trans("None") . '</td>';
        print "</tr>\n";
    }
    print "\n</table>\n";
    print '</form>' . "\n";
    print "<br>\n";
    ?>
<div id="dialog" title="<?php 
    echo dol_escape_htmltag($langs->trans('Address'));
    ?>
" style="display: none;"></div>
<?php 
    return $i;
}
Example #12
0
     print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT);
 } else {
     print '&nbsp;';
 }
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("CompanyCurrency") . '</td><td>';
 print currency_name($conf->currency, 1);
 print ' (' . getCurrencySymbol($conf->currency) . ')';
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Tel") . '</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL, $mysoc->country_code) . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Fax") . '</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX, $mysoc->country_code) . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Mail") . '</td><td>' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL, 0, 0, 0, 80) . '</td></tr>';
 // Web
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Web") . '</td><td>' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB, '_blank', 80) . '</td></tr>';
 // Barcode
 if (!empty($conf->barcode->enabled)) {
     $var = !$var;
     print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Gencod") . '</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
 }
 // Logo
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Logo") . '</td><td>';
 print '<table width="100%" class="nocellnopadd"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
 print $mysoc->logo;
 print '</td><td valign="center" align="right">';
 // On propose la generation de la vignette si elle n'existe pas
Example #13
0
 $row = array();
 for ($i = 0; $i < count($aColumns); $i++) {
     if ($aColumns[$i] == "name") {
         $contactstatic->name = $aRow->name;
         $contactstatic->firstname = '';
         $contactstatic->id = $aRow->cidp;
         $row[] = $contactstatic->getNomUrl(1, '', 20);
     } else {
         if ($aColumns[$i] == "tms") {
             $row[] = dol_print_date($db->jdate($aRow->tms), "day");
         } else {
             if ($aColumns[$i] == "categorie") {
                 $row[] = $categoriesDeChaqueContact[$aRow->cidp];
             } else {
                 if ($aColumns[$i] == "email") {
                     $row[] = dol_print_email($aRow->email, $aRow->cidp, $aRow->socid, 'AC_EMAIL', 18);
                 } else {
                     if ($aColumns[$i] == "priv") {
                         $row[] = $contactstatic->LibPubPriv($aRow->priv);
                     } else {
                         if ($i == 0) {
                             $row[] = '<img id="' . $aRow->cidp . '" class="plus" src="../theme/cameleo/img/details_open.png">';
                         } else {
                             if ($i == count($aColumns) - 1) {
                                 //last
                                 $row[] = '<a href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create&amp;backtopage=1&amp;contactid=' . $aRow->cidp . '&amp;socid=' . $aRow->socid . '">' . img_object($langs->trans("AddAction"), "action") . '</a>' . ' &nbsp;' . ' &nbsp;' . '<a href="' . DOL_URL_ROOT . '/contact/vcard.php?id=' . $aRow->cidp . '">' . img_picto($langs->trans("VCard"), 'vcard.png') . ' ' . '</a>';
                             } else {
                                 if ($aColumns[$i] != ' ') {
                                     /* General output */
                                     $attribut = $aColumns[$i];
                                     $row[] = $aRow->{$attribut};
Example #14
0
 /**
  * Output val field for an editable field
  *
  * @param	string	$text			Text of label (not used in this function)
  * @param	string	$htmlname		Name of select field
  * @param	string	$value			Value to show/edit
  * @param	object	$object			Object
  * @param	boolean	$perm			Permission to allow button to edit parameter
  * @param	string	$typeofdata		Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
  * @param	string	$editvalue		When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
  * @param	object	$extObject		External object
  * @param	mixed	$custommsg		String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
  * @param	string	$moreparam		More param to add on a href URL
  * @return  string					HTML edit field
  */
 function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata = 'string', $editvalue = '', $extObject = null, $custommsg = null, $moreparam = '')
 {
     global $conf, $langs, $db;
     $ret = '';
     // Check parameters
     if (empty($typeofdata)) {
         return 'ErrorBadParameter';
     }
     // When option to edit inline is activated
     if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|datehourpicker/', $typeofdata)) {
         $ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
     } else {
         if (GETPOST('action') == 'edit' . $htmlname) {
             $ret .= "\n";
             $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">';
             $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">';
             $ret .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
             $ret .= '<input type="hidden" name="id" value="' . $object->id . '">';
             $ret .= '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
             $ret .= '<tr><td>';
             if (preg_match('/^(string|email|numeric|amount)/', $typeofdata)) {
                 $tmp = explode(':', $typeofdata);
                 $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . ($tmp[1] ? ' size="' . $tmp[1] . '"' : '') . '>';
             } else {
                 if (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
                     $tmp = explode(':', $typeofdata);
                     $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . ($tmp[1] ? $tmp[1] : '20') . '" cols="' . ($tmp[2] ? $tmp[2] : '100') . '">' . ($editvalue ? $editvalue : $value) . '</textarea>';
                 } else {
                     if ($typeofdata == 'day' || $typeofdata == 'datepicker') {
                         $ret .= $this->form_date($_SERVER['PHP_SELF'] . '?id=' . $object->id, $value, $htmlname);
                     } else {
                         if ($typeofdata == 'datehourpicker') {
                             $ret .= $this->form_date($_SERVER['PHP_SELF'] . '?id=' . $object->id, $value, $htmlname, 1, 1);
                         } else {
                             if (preg_match('/^select;/', $typeofdata)) {
                                 $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
                                 foreach ($arraydata as $val) {
                                     $tmp = explode(':', $val);
                                     $arraylist[$tmp[0]] = $tmp[1];
                                 }
                                 $ret .= $this->selectarray($htmlname, $arraylist, $value);
                             } else {
                                 if (preg_match('/^ckeditor/', $typeofdata)) {
                                     $tmp = explode(':', $typeofdata);
                                     require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                                     $doleditor = new DolEditor($htmlname, $editvalue ? $editvalue : $value, $tmp[2] ? $tmp[2] : '', $tmp[3] ? $tmp[3] : '100', $tmp[1] ? $tmp[1] : 'dolibarr_notes', 'In', $tmp[5] ? $tmp[5] : 0, true, true, $tmp[6] ? $tmp[6] : '20', $tmp[7] ? $tmp[7] : '100');
                                     $ret .= $doleditor->Create(1);
                                 }
                             }
                         }
                     }
                 }
             }
             $ret .= '</td>';
             if ($typeofdata != 'day' && $typeofdata != 'datepicker' && $typeofdata != 'datehourpicker') {
                 $ret .= '<td align="left">';
                 $ret .= '<input type="submit" class="button" name="modify" value="' . $langs->trans("Modify") . '">';
                 if (preg_match('/ckeditor|textarea/', $typeofdata)) {
                     $ret .= '<br>' . "\n";
                 }
                 $ret .= '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
                 $ret .= '</td>';
             }
             $ret .= '</tr></table>' . "\n";
             $ret .= '</form>' . "\n";
         } else {
             if ($typeofdata == 'email') {
                 $ret .= dol_print_email($value, 0, 0, 0, 0, 1);
             } elseif ($typeofdata == 'amount') {
                 $ret .= $value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '';
             } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
                 $ret .= dol_htmlentitiesbr($value);
             } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') {
                 $ret .= dol_print_date($value, 'day');
             } elseif ($typeofdata == 'datehourpicker') {
                 $ret .= dol_print_date($value, 'dayhour');
             } else {
                 if (preg_match('/^select;/', $typeofdata)) {
                     $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
                     foreach ($arraydata as $val) {
                         $tmp = explode(':', $val);
                         $arraylist[$tmp[0]] = $tmp[1];
                     }
                     $ret .= $arraylist[$value];
                 } else {
                     if (preg_match('/^ckeditor/', $typeofdata)) {
                         $tmpcontent = dol_htmlentitiesbr($value);
                         if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
                             $firstline = preg_replace('/<br>.*/', '', $tmpcontent);
                             $firstline = preg_replace('/[\\n\\r].*/', '', $firstline);
                             $tmpcontent = $firstline . (strlen($firstline) != strlen($tmpcontent) ? '...' : '');
                         }
                         $ret .= $tmpcontent;
                     } else {
                         $ret .= $value;
                     }
                 }
             }
         }
     }
     return $ret;
 }
Example #15
0
 print '</td></tr>' . "\n";
 // Tel pro
 print '<tr><td valign="top">' . $langs->trans("PhonePro") . '</td>';
 print '<td>' . dol_print_phone($fuser->office_phone, '', 0, 0, 1) . '</td>';
 print '</tr>' . "\n";
 // Tel mobile
 print '<tr><td valign="top">' . $langs->trans("PhoneMobile") . '</td>';
 print '<td>' . dol_print_phone($fuser->user_mobile, '', 0, 0, 1) . '</td>';
 print '</tr>' . "\n";
 // Fax
 print '<tr><td valign="top">' . $langs->trans("Fax") . '</td>';
 print '<td>' . dol_print_phone($fuser->office_fax, '', 0, 0, 1) . '</td>';
 print '</tr>' . "\n";
 // EMail
 print '<tr><td valign="top">' . $langs->trans("EMail") . '</td>';
 print '<td>' . dol_print_email($fuser->email, 0, 0, 1) . '</td>';
 print "</tr>\n";
 // Signature
 print '<tr><td valign="top">' . $langs->trans('Signature') . '</td>';
 print '<td>' . $fuser->signature . '</td>';
 print "</tr>\n";
 // Statut
 print '<tr><td valign="top">' . $langs->trans("Status") . '</td>';
 print '<td>';
 print $fuser->getLibStatut(4);
 print '</td>';
 print '</tr>' . "\n";
 print '<tr><td valign="top">' . $langs->trans("LastConnexion") . '</td>';
 print '<td>' . dol_print_date($fuser->datelastlogin, "dayhour") . '</td>';
 print "</tr>\n";
 print '<tr><td valign="top">' . $langs->trans("PreviousConnexion") . '</td>';
Example #16
0
 /**
  * 	Return full address of contact
  *
  * 	@param		string		$htmlkey            HTML id to make banner content unique
  *  @param      Object      $object				Object (thirdparty, thirdparty of contact for contact, null for a member)
  *	@return		string							Full address string
  */
 function getBannerAddress($htmlkey, $object)
 {
     global $conf, $langs;
     $countriesusingstate = array('AU', 'US', 'IN', 'GB', 'ES', 'UK', 'TR');
     $contactid = 0;
     $thirdpartyid = 0;
     if ($this->element == 'societe') {
         $thirdpartyid = $this->id;
     }
     if ($this->element == 'contact') {
         $contactid = $this->id;
         $thirdpartyid = $object->fk_soc;
     }
     if ($this->element == 'user') {
         $contactid = $this->contact_id;
         $thirdpartyid = $object->fk_soc;
     }
     $out = '<!-- BEGIN part to show address block -->';
     $outdone = 0;
     $coords = $this->getFullAddress(1, ', ');
     if ($coords) {
         if (!empty($conf->use_javascript_ajax)) {
             $namecoords = $this->getFullName($langs, 1) . '<br>' . $coords;
             // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile
             $out .= '<a href="#" class="hideonsmartphone" onclick="return copyToClipboard(\'' . dol_escape_js($namecoords) . '\',\'' . dol_escape_js($langs->trans("HelpCopyToClipboard")) . '\');">';
             $out .= img_picto($langs->trans("Address"), 'object_address.png');
             $out .= '</a> ';
         }
         $out .= dol_print_address($coords, 'address_' . $htmlkey . '_' . $this->id, $this->element, $this->id, 1);
         $outdone++;
         $outdone++;
     }
     if (!in_array($this->country_code, $countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) && !empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state) {
         $out .= ($outdone ? '<br>' : '') . $this->state;
         $outdone++;
     }
     if (!empty($this->phone_pro) || !empty($this->phone_mobile) || !empty($this->phone_perso) || !empty($this->fax) || !empty($this->office_phone) || !empty($this->user_mobile) || !empty($this->office_fax)) {
         $out .= $outdone ? '<br>' : '';
     }
     if (!empty($this->phone) && empty($this->phone_pro)) {
         // For objects that store pro phone into ->phone
         $out .= dol_print_phone($this->phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', '&nbsp;', 'phone', $langs->trans("PhonePro"));
         $outdone++;
     }
     if (!empty($this->phone_pro)) {
         $out .= dol_print_phone($this->phone_pro, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', '&nbsp;', 'phone', $langs->trans("PhonePro"));
         $outdone++;
     }
     if (!empty($this->phone_mobile)) {
         $out .= dol_print_phone($this->phone_mobile, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', '&nbsp;', 'phone', $langs->trans("PhoneMobile"));
         $outdone++;
     }
     if (!empty($this->phone_perso)) {
         $out .= dol_print_phone($this->phone_perso, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', '&nbsp;', 'phone', $langs->trans("PhonePerso"));
         $outdone++;
     }
     if (!empty($this->fax)) {
         $out .= dol_print_phone($this->fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', '&nbsp;', 'fax', $langs->trans("Fax"));
         $outdone++;
     }
     if (!empty($this->office_phone)) {
         $out .= dol_print_phone($this->office_phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', '&nbsp;', 'phone', $langs->trans("PhonePro"));
         $outdone++;
     }
     if (!empty($this->user_mobile)) {
         $out .= dol_print_phone($this->user_mobile, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', '&nbsp;', 'phone', $langs->trans("PhoneMobile"));
         $outdone++;
     }
     if (!empty($this->office_fax)) {
         $out .= dol_print_phone($this->fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', '&nbsp;', 'fax', $langs->trans("Fax"));
         $outdone++;
     }
     $out .= '<div style="clear: both;"></div>';
     $outdone = 0;
     if (!empty($this->email)) {
         $out .= dol_print_email($this->email, $this->id, $object->id, 'AC_EMAIL', 0, 0, 1);
         $outdone++;
     }
     if (!empty($this->url)) {
         $out .= dol_print_url($this->url, '', 0, 1);
         $outdone++;
     }
     if (!empty($conf->skype->enabled)) {
         $out .= '<div style="clear: both;"></div>';
         if ($this->skype) {
             $out .= dol_print_skype($this->skype, $this->id, $object->id, 'AC_SKYPE');
         }
         $outdone++;
     }
     $out .= '<!-- END Part to show address block -->';
     return $out;
 }
Example #17
0
		// Login
		print "<td>".$objp->login."</td>\n";

		// Type
		print '<td nowrap="nowrap">';
		$membertypestatic->id=$objp->type_id;
		$membertypestatic->libelle=$objp->type;
		print $membertypestatic->getNomUrl(1,12);
		print '</td>';

		// Moral/Physique
		print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";

		// EMail
		print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";

		// Statut
		print '<td nowrap="nowrap">';
		print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
		print "</td>";

		// End of subscription date
		if ($datefin)
		{
			print '<td align="center" nowrap="nowrap">';
			print dol_print_date($datefin,'day');
			if ($datefin < ($now -  $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate"));
			print '</td>';
		}
		else
    /**
     *  Set content of ->tpl array, to use into template
     *
     *  @param	string		$action    Type of action
     *  @param	int			$id			Id
     *  @return	string					HTML output
     */
    function assign_values(&$action, $id)
    {
        global $conf, $langs, $user, $canvas;
        global $form, $formcompany, $objsoc;
        if ($action == 'add' || $action == 'update') {
            $this->assign_post();
        }
        foreach ($this->object as $key => $value) {
            $this->tpl[$key] = $value;
        }
        $this->tpl['error'] = $this->error;
        $this->tpl['errors'] = $this->errors;
        if ($action == 'create' || $action == 'edit') {
            if ($conf->use_javascript_ajax) {
                $this->tpl['ajax_selectcountry'] = "\n" . '<script type="text/javascript" language="javascript">
				jQuery(document).ready(function () {
						jQuery("#selectcountry_id").change(function() {
							document.formsoc.action.value="' . $action . '";
							document.formsoc.canvas.value="' . $canvas . '";
							document.formsoc.submit();
						});
					})
				</script>' . "\n";
            }
            if (is_object($objsoc) && $objsoc->id > 0) {
                $this->tpl['company'] = $objsoc->getNomUrl(1);
                $this->tpl['company_id'] = $objsoc->id;
            } else {
                $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1);
            }
            // Civility
            $this->tpl['select_civility'] = $formcompany->select_civility($this->object->civility_id);
            // Predefined with third party
            if (isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) {
                if (dol_strlen(trim($this->object->address)) == 0) {
                    $this->tpl['address'] = $objsoc->address;
                }
                if (dol_strlen(trim($this->object->zip)) == 0) {
                    $this->object->zip = $objsoc->zip;
                }
                if (dol_strlen(trim($this->object->town)) == 0) {
                    $this->object->town = $objsoc->town;
                }
                if (dol_strlen(trim($this->object->phone_pro)) == 0) {
                    $this->object->phone_pro = $objsoc->phone;
                }
                if (dol_strlen(trim($this->object->fax)) == 0) {
                    $this->object->fax = $objsoc->fax;
                }
                if (dol_strlen(trim($this->object->email)) == 0) {
                    $this->object->email = $objsoc->email;
                }
            }
            // Zip
            $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
            // Town
            $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
            if (dol_strlen(trim($this->object->country_id)) == 0) {
                $this->object->country_id = $objsoc->country_id;
            }
            // Country
            $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id');
            $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')';
            if ($user->admin) {
                $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
            }
            // State
            if ($this->object->country_id) {
                $this->tpl['select_state'] = $formcompany->select_state($this->object->fk_departement, $this->object->country_code);
            } else {
                $this->tpl['select_state'] = $countrynotdefined;
            }
            // Public or private
            $selectarray = array('0' => $langs->trans("ContactPublic"), '1' => $langs->trans("ContactPrivate"));
            $this->tpl['select_visibility'] = $form->selectarray('priv', $selectarray, $this->object->priv, 0);
        }
        if ($action == 'view' || $action == 'edit' || $action == 'delete') {
            // Emailing
            if (!empty($conf->mailing->enabled)) {
                $langs->load("mails");
                $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings();
            }
            // Linked element
            $this->tpl['contact_element'] = array();
            $i = 0;
            $this->object->load_ref_elements();
            if (!empty($conf->commande->enabled)) {
                $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders");
                $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder");
                $i++;
            }
            if (!empty($conf->propal->enabled)) {
                $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals");
                $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal");
                $i++;
            }
            if (!empty($conf->contrat->enabled)) {
                $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts");
                $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract");
                $i++;
            }
            if (!empty($conf->facture->enabled)) {
                $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices");
                $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice");
                $i++;
            }
            // Dolibarr user
            if ($this->object->user_id) {
                $dolibarr_user = new User($this->db);
                $result = $dolibarr_user->fetch($this->object->user_id);
                $this->tpl['dolibarr_user'] = $dolibarr_user->getLoginUrl(1);
            } else {
                $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess");
            }
        }
        if ($action == 'view' || $action == 'delete') {
            $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'id');
            if ($this->object->socid > 0) {
                $objsoc = new Societe($this->db);
                $objsoc->fetch($this->object->socid);
                $this->tpl['company'] = $objsoc->getNomUrl(1);
            } else {
                $this->tpl['company'] = $langs->trans("ContactNotLinkedToCompany");
            }
            $this->tpl['civility'] = $this->object->getCivilityLabel();
            $this->tpl['address'] = dol_nl2br($this->object->address);
            $this->tpl['zip'] = $this->object->zip ? $this->object->zip . '&nbsp;' : '';
            $img = picto_from_langcode($this->object->country_code);
            $this->tpl['country'] = ($img ? $img . ' ' : '') . $this->object->country;
            $this->tpl['phone_pro'] = dol_print_phone($this->object->phone_pro, $this->object->country_code, 0, $this->object->id, 'AC_TEL');
            $this->tpl['phone_perso'] = dol_print_phone($this->object->phone_perso, $this->object->country_code, 0, $this->object->id, 'AC_TEL');
            $this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile, $this->object->country_code, 0, $this->object->id, 'AC_TEL');
            $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX');
            $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL');
            $this->tpl['visibility'] = $this->object->LibPubPriv($this->object->priv);
            $this->tpl['note'] = nl2br($this->object->note);
        }
        if ($action == 'create_user') {
            // Full firstname and lastname separated with a dot : firstname.lastname
            include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
            require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
            $login = dol_buildlogin($this->object->lastname, $this->object->firstname);
            $generated_password = getRandomPassword(false);
            $password = $generated_password;
            // Create a form array
            $formquestion = array(array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password));
            $this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"] . "?id=" . $this->object->id, $langs->trans("CreateDolibarrLogin"), $langs->trans("ConfirmCreateContact"), "confirm_create_user", $formquestion, 'no');
        }
    }
Example #19
0
 print '</tr>';
 // Country
 print '<tr><td>' . $langs->trans("Country") . '</td><td colspan="3">';
 $img = picto_from_langcode($objsoc->pays_code);
 if ($objsoc->isInEEC()) {
     print $form->textwithpicto(($img ? $img . ' ' : '') . $objsoc->pays, $langs->trans("CountryIsInEEC"), 1, 0);
 } else {
     print ($img ? $img . ' ' : '') . $objsoc->pays;
 }
 print '</td></tr>';
 // Phone
 print '<tr><td>' . $langs->trans('Phone') . '</td><td style="min-width: 25%;">' . dol_print_phone($objsoc->tel, $objsoc->pays_code, 0, $objsoc->id, 'AC_TEL') . '</td>';
 // Fax
 print '<td>' . $langs->trans('Fax') . '</td><td style="min-width: 25%;">' . dol_print_phone($objsoc->fax, $objsoc->pays_code, 0, $objsoc->id, 'AC_FAX') . '</td></tr>';
 // EMail
 print '<td>' . $langs->trans('EMail') . '</td><td colspan="3">' . dol_print_email($objsoc->email, 0, $objsoc->id, 'AC_EMAIL') . '</td></tr>';
 // Web
 print '<tr><td>' . $langs->trans("Web") . '</td><td colspan="3">' . dol_print_url($objsoc->url, '_blank') . '</td></tr>';
 // Assujeti a TVA ou pas
 print '<tr>';
 print '<td nowrap="nowrap">' . $langs->trans('VATIsUsed') . '</td><td colspan="3">';
 print yn($objsoc->tva_assuj);
 print '</td>';
 print '</tr>';
 // Local Taxes
 if ($mysoc->pays_code == 'ES') {
     if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
         print '<tr><td nowrap="nowrap">' . $langs->trans('LocalTax1IsUsedES') . '</td><td colspan="3">';
         print yn($objsoc->localtax1_assuj);
         print '</td></tr>';
         print '<tr><td nowrap="nowrap">' . $langs->trans('LocalTax2IsUsedES') . '</td><td colspan="3">';
Example #20
0
			print '<td>' . dol_print_phone($fuser->values->PhonePro, '', 0, 0, 1) . '</td>';
			print '</tr>' . "\n";

			// Tel mobile
			print '<tr><td valign="top">' . $langs->trans("PhoneMobile") . '</td>';
			print '<td>' . dol_print_phone($fuser->values->PhoneMobile, '', 0, 0, 1) . '</td>';
			print '</tr>' . "\n";

			// Fax
			print '<tr><td valign="top">' . $langs->trans("Fax") . '</td>';
			print '<td>' . dol_print_phone($fuser->values->Fax, '', 0, 0, 1) . '</td>';
			print '</tr>' . "\n";

			// EMail
			print '<tr><td valign="top">' . $langs->trans("EMail") . '</td>';
			print '<td>' . dol_print_email($fuser->values->EMail, 0, 0, 1) . '</td>';
			print "</tr>\n";

			// Signature
			print '<tr><td valign="top">' . $langs->trans('Signature') . '</td>';
			print '<td>' . $fuser->values->Signature . '</td>';
			print "</tr>\n";

			// Statut
			print '<tr><td valign="top">' . $langs->trans("Status") . '</td>';
			print '<td>';
			print $fuser->getLibStatus();
			print '</td>';
			print '</tr>' . "\n";

			print '<tr><td valign="top">' . $langs->trans("LastConnexion") . '</td>';
Example #21
0
        // Country
        print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'" nowrap="nowrap">';
        $img=picto_from_langcode($object->country_code);
        if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
        else print ($img?$img.' ':'').$object->country;
        print '</td></tr>';

        // State
        if (empty($conf->global->SOCIETE_DISABLE_STATE)) print '<tr><td>'.$langs->trans('State').'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">'.$object->state.'</td>';

        print '<tr><td>'.$langs->trans('Phone').'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
        print '<td>'.$langs->trans('Fax').'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'</td></tr>';

        // EMail
        print '<tr><td>'.$langs->trans('EMail').'</td><td width="25%">';
        print dol_print_email($object->email,0,$object->id,'AC_EMAIL');
        print '</td>';

        // Web
        print '<td>'.$langs->trans('Web').'</td><td>';
        print dol_print_url($object->url);
        print '</td></tr>';

        // Prof ids
        $i=1; $j=0;
        while ($i <= 6)
        {
            $idprof=$langs->transcountry('ProfId'.$i,$object->country_code);
            if ($idprof!='-')
            {
                if (($j % 2) == 0) print '<tr>';
Example #22
0
 if ($img) {
     print $img . ' ';
 }
 print $object->country;
 print '</td></tr>';
 // State
 if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
     print '<tr><td>' . $langs->trans('State') . '</td><td colspan="3">' . $object->state . '</td>';
 }
 // Phone
 print '<tr><td>' . $langs->trans("PhonePro") . '</td><td>' . dol_print_phone($object->phone_pro, $object->country_code, $object->id, $object->socid, 'AC_TEL') . '</td>';
 print '<td>' . $langs->trans("PhonePerso") . '</td><td>' . dol_print_phone($object->phone_perso, $object->country_code, $object->id, $object->socid, 'AC_TEL') . '</td></tr>';
 print '<tr><td>' . $langs->trans("PhoneMobile") . '</td><td>' . dol_print_phone($object->phone_mobile, $object->country_code, $object->id, $object->socid, 'AC_TEL') . '</td>';
 print '<td>' . $langs->trans("Fax") . '</td><td>' . dol_print_phone($object->fax, $object->country_code, $object->id, $object->socid, 'AC_FAX') . '</td></tr>';
 // Email
 print '<tr><td>' . $langs->trans("EMail") . '</td><td>' . dol_print_email($object->email, $object->id, $object->socid, 'AC_EMAIL') . '</td>';
 if (!empty($conf->mailing->enabled)) {
     $langs->load("mails");
     print '<td class="nowrap">' . $langs->trans("NbOfEMailingsSend") . '</td>';
     print '<td><a href="' . DOL_URL_ROOT . '/comm/mailing/list.php?filteremail=' . urlencode($object->email) . '">' . $object->getNbOfEMailings() . '</a></td>';
 } else {
     print '<td colspan="2">&nbsp;</td>';
 }
 print '</tr>';
 // Instant message and no email
 print '<tr><td>' . $langs->trans("IM") . '</td><td>' . $object->jabberid . '</td>';
 if (!empty($conf->mailing->enabled)) {
     print '<td>' . $langs->trans("No_Email") . '</td><td>' . yn($object->no_email) . '</td>';
 } else {
     print '<td colspan="2">&nbsp;</td>';
 }
Example #23
0
 /**
  * Return HTML string to put an output field into a page
  *
  * @param   string	$key            Key of attribute
  * @param   string	$value          Value to show
  * @param	string	$moreparam		To add more parametes on html input tag (only checkbox use html input for output rendering)
  * @return	string					Formated value
  */
 function showOutputField($key, $value, $moreparam = '')
 {
     global $conf, $langs;
     $label = $this->attribute_label[$key];
     $type = $this->attribute_type[$key];
     $size = $this->attribute_size[$key];
     $elementtype = $this->attribute_elementtype[$key];
     $unique = $this->attribute_unique[$key];
     $required = $this->attribute_required[$key];
     $params = $this->attribute_param[$key];
     $perms = $this->attribute_perms[$key];
     $list = $this->attribute_list[$key];
     $showsize = 0;
     if ($type == 'date') {
         $showsize = 10;
         $value = dol_print_date($value, 'day');
     } elseif ($type == 'datetime') {
         $showsize = 19;
         $value = dol_print_date($value, 'dayhour');
     } elseif ($type == 'int') {
         $showsize = 10;
     } elseif ($type == 'double') {
         if (!empty($value)) {
             $value = price($value);
         }
     } elseif ($type == 'boolean') {
         $checked = '';
         if (!empty($value)) {
             $checked = ' checked ';
         }
         $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>';
     } elseif ($type == 'mail') {
         $value = dol_print_email($value);
     } elseif ($type == 'phone') {
         $value = dol_print_phone($value);
     } elseif ($type == 'price') {
         $value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
     } elseif ($type == 'select') {
         $value = $params['options'][$value];
     } elseif ($type == 'sellist') {
         $param_list = array_keys($params['options']);
         $InfoFieldList = explode(":", $param_list[0]);
         $selectkey = "rowid";
         $keyList = 'rowid';
         if (count($InfoFieldList) >= 3) {
             $selectkey = $InfoFieldList[2];
             $keyList = $InfoFieldList[2] . ' as rowid';
         }
         $fields_label = explode('|', $InfoFieldList[1]);
         if (is_array($fields_label)) {
             $keyList .= ', ';
             $keyList .= implode(', ', $fields_label);
         }
         $sql = 'SELECT ' . $keyList;
         $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[0];
         if (strpos($InfoFieldList[4], 'extra') !== false) {
             $sql .= ' as main';
         }
         $sql .= " WHERE " . $selectkey . "='" . $this->db->escape($value) . "'";
         //$sql.= ' AND entity = '.$conf->entity;
         dol_syslog(get_class($this) . ':showOutputField:$type=sellist', LOG_DEBUG);
         $resql = $this->db->query($sql);
         if ($resql) {
             $value = '';
             // value was used, so now we reste it to use it to build final output
             $obj = $this->db->fetch_object($resql);
             // Several field into label (eq table:code|libelle:rowid)
             $fields_label = explode('|', $InfoFieldList[1]);
             if (is_array($fields_label) && count($fields_label) > 1) {
                 foreach ($fields_label as $field_toshow) {
                     $translabel = '';
                     if (!empty($obj->{$field_toshow})) {
                         $translabel = $langs->trans($obj->{$field_toshow});
                     }
                     if ($translabel != $field_toshow) {
                         $value .= dol_trunc($translabel, 18) . ' ';
                     } else {
                         $value .= $obj->{$field_toshow} . ' ';
                     }
                 }
             } else {
                 $translabel = '';
                 if (!empty($obj->{$InfoFieldList}[1])) {
                     $translabel = $langs->trans($obj->{$InfoFieldList}[1]);
                 }
                 if ($translabel != $obj->{$InfoFieldList}[1]) {
                     $value = dol_trunc($translabel, 18);
                 } else {
                     $value = $obj->{$InfoFieldList}[1];
                 }
             }
         } else {
             dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
         }
     } elseif ($type == 'radio') {
         $value = $params['options'][$value];
     } elseif ($type == 'checkbox') {
         $value_arr = explode(',', $value);
         $value = '';
         if (is_array($value_arr)) {
             foreach ($value_arr as $keyval => $valueval) {
                 $value .= $params['options'][$valueval] . '<br>';
             }
         }
     } elseif ($type == 'chkbxlst') {
         $value_arr = explode(',', $value);
         $param_list = array_keys($params['options']);
         $InfoFieldList = explode(":", $param_list[0]);
         $selectkey = "rowid";
         $keyList = 'rowid';
         if (count($InfoFieldList) >= 3) {
             $selectkey = $InfoFieldList[2];
             $keyList = $InfoFieldList[2] . ' as rowid';
         }
         $fields_label = explode('|', $InfoFieldList[1]);
         if (is_array($fields_label)) {
             $keyList .= ', ';
             $keyList .= implode(', ', $fields_label);
         }
         $sql = 'SELECT ' . $keyList;
         $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[0];
         if (strpos($InfoFieldList[4], 'extra') !== false) {
             $sql .= ' as main';
         }
         // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
         // $sql.= ' AND entity = '.$conf->entity;
         dol_syslog(get_class($this) . ':showOutputField:$type=chkbxlst', LOG_DEBUG);
         $resql = $this->db->query($sql);
         if ($resql) {
             $value = '';
             // value was used, so now we reste it to use it to build final output
             while ($obj = $this->db->fetch_object($resql)) {
                 // Several field into label (eq table:code|libelle:rowid)
                 $fields_label = explode('|', $InfoFieldList[1]);
                 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
                     if (is_array($fields_label) && count($fields_label) > 1) {
                         foreach ($fields_label as $field_toshow) {
                             $translabel = '';
                             if (!empty($obj->{$field_toshow})) {
                                 $translabel = $langs->trans($obj->{$field_toshow});
                             }
                             if ($translabel != $field_toshow) {
                                 $value .= dol_trunc($translabel, 18) . '<BR>';
                             } else {
                                 $value .= $obj->{$field_toshow} . '<BR>';
                             }
                         }
                     } else {
                         $translabel = '';
                         if (!empty($obj->{$InfoFieldList}[1])) {
                             $translabel = $langs->trans($obj->{$InfoFieldList}[1]);
                         }
                         if ($translabel != $obj->{$InfoFieldList}[1]) {
                             $value .= dol_trunc($translabel, 18) . '<BR>';
                         } else {
                             $value .= $obj->{$InfoFieldList}[1] . '<BR>';
                         }
                     }
                 }
             }
         } else {
             dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
         }
     } elseif ($type == 'link') {
         $out = '';
         // only if something to display (perf)
         if ($value) {
             $param_list = array_keys($params['options']);
             // 0 : ObjectName
             // 1 : classPath
             $InfoFieldList = explode(":", $param_list[0]);
             dol_include_once($InfoFieldList[1]);
             if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) {
                 $object = new $InfoFieldList[0]($this->db);
                 $object->fetch($value);
                 $value = $object->getNomUrl(3);
             } else {
                 dol_syslog('Error bad setup of extrafield', LOG_WARNING);
                 $out .= 'Error bad setup of extrafield';
             }
         }
     } elseif ($type == 'text') {
         $value = dol_htmlentitiesbr($value);
     } else {
         $showsize = round($size);
         if ($showsize > 48) {
             $showsize = 48;
         }
     }
     //print $type.'-'.$size;
     $out = $value;
     return $out;
 }
 print '<tr><td valign="top">' . $langs->trans("PhoneMobile") . '</td>';
 print '<td>' . dol_print_phone($object->user_mobile, '', 0, 0, 1) . '</td>';
 print '</tr>' . "\n";
 // Fax
 print '<tr><td valign="top">' . $langs->trans("Fax") . '</td>';
 print '<td>' . dol_print_phone($object->office_fax, '', 0, 0, 1) . '</td>';
 print '</tr>' . "\n";
 // Skype
 if (!empty($conf->skype->enabled)) {
     print '<tr><td valign="top">' . $langs->trans("Skype") . '</td>';
     print '<td>' . dol_print_skype($object->skype, 0, 0, 1) . '</td>';
     print "</tr>\n";
 }
 // EMail
 print '<tr><td valign="top">' . $langs->trans("EMail") . '</td>';
 print '<td>' . dol_print_email($object->email, 0, 0, 1) . '</td>';
 print "</tr>\n";
 // Signature
 print '<tr><td valign="top">' . $langs->trans('Signature') . '</td><td>';
 if (empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)) {
     print dol_htmlentitiesbr($object->signature);
 } else {
     print $object->signature;
 }
 print "</td></tr>\n";
 // Hierarchy
 print '<tr><td valign="top">' . $langs->trans("HierarchicalResponsible") . '</td>';
 print '<td>';
 if (empty($object->fk_user)) {
     print $langs->trans("None");
 } else {