コード例 #1
0
ファイル: soc.php プロジェクト: nrjacker4/crm-php
        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>';
                print '<td>'.$idprof.'</td><td>';
                $key='idprof'.$i;
                print $object->$key;
                if ($object->$key)
                {
コード例 #2
0
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');
    if ($page == -1) {
        $page = 0;
    }
    $offset = $conf->liste_limit * $page;
コード例 #3
0
    /**
     *    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>';
                }
            }
        }
    }
コード例 #4
0
ファイル: fiche.php プロジェクト: netors/dolibarr
 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">';
         print yn($objsoc->localtax2_assuj);
         print '</td></tr>';
コード例 #5
0
ファイル: fiche.php プロジェクト: nrjacker4/crm-php
 print '<tr><td>' . $langs->trans("Country") . '</td><td colspan="3">';
 $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>';
 // Phone
 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>';
 // Fax
 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 '<td>' . $langs->trans('EMail') . '</td><td colspan="3">' . dol_print_email($object->email, 0, $object->id, 'AC_EMAIL') . '</td></tr>';
 // Web
 print '<tr><td>' . $langs->trans("Web") . "</td><td colspan=\"3\">" . dol_print_url($object->url) . "</td></tr>";
 // Assujetti a TVA ou pas
 print '<tr>';
 print '<td nowrap="nowrap">' . $langs->trans('VATIsUsed') . '</td><td colspan="3">';
 print yn($object->tva_assuj);
 print '</td>';
 print '</tr>';
 // Local Taxes
 if ($mysoc->country_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($object->localtax1_assuj);
         print '</td></tr>';
         print '<tr><td nowrap="nowrap">' . $langs->trans('LocalTax2IsUsedES') . '</td><td colspan="3">';
         print yn($object->localtax2_assuj);
         print '</td></tr>';
コード例 #6
0
ファイル: societe.class.php プロジェクト: nrjacker4/crm-php
	/**
	 * return div with list of information content block (see extrafields block)
	 * 
	 *  @param  int	    $blockid	    id of the block in the extrafiels block attribute
	 *  @return	@string
	 */
	function content_box($blockid) {
		global $conf, $user, $langs;

		// List of tel, fax, mail...
		$rtr = '<div class="row vcard sepH_b">';
		$rtr.= '<table class="display noborder">';
		$rtr.= '<tbody>';

		// list tel, fax, mail
		for ($i = 0; $i < count($this->fk_extrafields->place[$blockid]); $i++) { // Block
			foreach ($this->fk_extrafields->place[$blockid][$i] as $key) {
				$aRow = $this->fk_extrafields->fields->$key;
				if (is_object($aRow) && $aRow->enable) {
					$rtr.='<tr>';
					$label = (empty($aRow->label) ? $langs->trans($key) : $langs->trans($aRow->label));
					if (isset($aRow->ico))
						$rtr.= '<td><img src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/ico/' . $aRow->ico . '.png" title="' . $label . '" /></td>';
					else
						$rtr.= '<td><img src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/ico/icSw2/16-Money.png" title="' . $label . '" /></td>';

					if ($aRow->type == "AC_EMAIL")
						$rtr.= '<td class="s_color">' . $label . '</td></td><td class="ttip_r edit_text">' . $this->$key . '</td>';
					elseif ($aRow->type == "AC_TEL" || $aRow->type == "AC_FAX")
						$rtr.= '<td class="s_color">' . $label . '</td><td class="ttip_r edit_text">' . dol_print_phone($this->$key, $this->Country, 0, $this->id(), $aRow->type) . '</td>';
					elseif ($aRow->type == "AC_URL") {
						$rtr.= '<td>' . dol_print_url($label, $this->$key->value) . '</td><td class="ttip_r edit_text">' . $this->$key . '</td>';
					}
					else
						$rtr.= '<td class="s_color">' . $label . '</td><td class="ttip_r edit_text">' . $this->$key . '</td>';

					$rtr.='</tr>';
				}
			}
		}

		$rtr.= '</tbody>';
		$rtr.= '</table>';

		$rtr.= '</div>';

		return $rtr;
	}
コード例 #7
0
ファイル: soc.php プロジェクト: ADDAdev/Dolibarr
     print '<tr><td width="25%" valign="top">' . $langs->trans("LinkedToDolibarrMember") . '</td>';
     print '<td colspan="3">';
     $adh = new Adherent($db);
     $result = $adh->fetch('', '', $object->id);
     if ($result > 0) {
         $adh->ref = $adh->getFullName($langs);
         print $adh->getNomUrl(1);
     } else {
         print $langs->trans("ThirdpartyNotLinkedToMember");
     }
     print '</td>';
     print "</tr>\n";
 }
 // Webservices url/key
 if (!empty($conf->syncsupplierwebservices->enabled)) {
     print '<tr><td>' . $langs->trans("WebServiceURL") . '</td><td>' . dol_print_url($object->webservices_url) . '</td>';
     print '<td class="nowrap">' . $langs->trans('WebServiceKey') . '</td><td>' . $object->webservices_key . '</td></tr>';
 }
 print '</table>';
 dol_fiche_end();
 /*
  *  Actions
  */
 print '<div class="tabsAction">' . "\n";
 $parameters = array();
 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
 if (empty($reshook)) {
     if (!empty($object->email)) {
         $langs->load("mails");
         print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?socid=' . $object->id . '&amp;action=presend&amp;mode=init">' . $langs->trans('SendMail') . '</a></div>';
コード例 #8
0
ファイル: card.php プロジェクト: Samara94/dolibarr
     }
 }
 if ($mode == "init") {
     //Table/form header
     print '<table class="border" width="100%">';
     print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
     print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
     print '<input type="hidden" name="action" value="webservice">';
     print '<input type="hidden" name="mode" value="check">';
     if ($error_occurred) {
         print "<br>" . $langs->trans("ErrorOccurredReviseAndRetry") . "<br>";
         print '<input class="button" type="submit" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
     } else {
         $textinput_size = "50";
         // Webservice url
         print '<tr><td>' . $langs->trans("WebServiceURL") . '</td><td colspan="3">' . dol_print_url($ws_url) . '</td></tr>';
         //Remote User
         print '<tr><td>' . $langs->trans("User") . '</td><td><input size="' . $textinput_size . '" type="text" name="ws_user"></td></tr>';
         //Remote Password
         print '<tr><td>' . $langs->trans("Password") . '</td><td><input size="' . $textinput_size . '" type="text" name="ws_password"></td></tr>';
         //Submit button
         print '<tr><td align="center" colspan="2">';
         print '<input class="button" type="submit" id="ws_submit" name="ws_submit" value="' . $langs->trans("CreateRemoteOrder") . '">';
         print ' &nbsp; &nbsp; ';
         //Cancel button
         print '<input class="button" type="submit" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
         print '</td></tr>';
     }
     //End table/form
     print '</form>';
     print '</table>';
コード例 #9
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;
 }
コード例 #10
0
ファイル: company.php プロジェクト: nrjacker4/crm-php
 }
 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
 if (!is_file($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_mini) && preg_match('/(\\.jpg|\\.jpeg|\\.png)$/i', $mysoc->logo)) {
     print '<a href="' . $_SERVER["PHP_SELF"] . '?action=addthumb&amp;file=' . urlencode($mysoc->logo) . '">' . img_picto($langs->trans('GenerateThumb'), 'refresh') . '&nbsp;&nbsp;</a>';
 } else {
コード例 #11
0
 // Zip / Town
 print '<tr><td class="nowrap">' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td colspan="3">' . $object->zip . ($object->zip && $object->town ? ' / ' : '') . $object->town . '</td>';
 print '</tr>';
 // Country
 print '<tr><td>' . $langs->trans("Country") . '</td><td colspan="3">';
 $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>';
 // EMail
 print '<td>' . $langs->trans('EMail') . '</td><td colspan="3">' . dol_print_email($object->email, 0, $object->id, 'AC_EMAIL') . '</td></tr>';
 // Web
 print '<tr><td>' . $langs->trans("Web") . '</td><td colspan="3">' . dol_print_url($object->url) . '</td></tr>';
 // Phone
 print '<tr><td>' . $langs->trans("Phone") . '</td><td style="min-width: 25%;">' . dol_print_phone($object->phone, $object->country_code, 0, $object->id, 'AC_TEL') . '</td>';
 // Fax
 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>';
 // Assujetti a TVA ou pas
 print '<tr>';
 print '<td class="nowrap">' . $langs->trans('VATIsUsed') . '</td><td colspan="3">';
 print yn($object->tva_assuj);
 print '</td>';
 print '</tr>';
 // Local Taxes
 //TODO: Place into a function to control showing by country or study better option
 if ($mysoc->country_code == 'ES') {
     if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
         print '<tr><td class="nowrap">' . $langs->trans('LocalTax1IsUsedES') . '</td><td colspan="3">';