diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index aad5298e586..468c0aef28f 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -50,27 +50,34 @@ class Canvas } /** - * \brief Load canvas - * \param Name of first part of canvas - * \canvas Name of second part of canvas + * Load canvas + * @param $element Element of canvas + * @param $canvas Name of canvas */ - function load_canvas($object,$canvas) + function load_canvas($element,$canvas) { global $langs; - $part1=$object; + $part1=$part3=$element; $part2=$canvas; + + // For compatibility + if (preg_match('/^([^@]+)@([^@]+)$/i',$element,$regs)) + { + $part1=$regs[2]; + $part3=$regs[1]; + } if (preg_match('/^([^@]+)@([^@]+)$/i',$canvas,$regs)) { - $part1=$regs[2]; + $part1=$part3=$regs[2]; $part2=$regs[1]; } - if (file_exists(DOL_DOCUMENT_ROOT.'/'.$part1.'/canvas/'.$part2.'/'.$part1.'.'.$part2.'.class.php')) + if (file_exists(DOL_DOCUMENT_ROOT.'/'.$part1.'/canvas/'.$part2.'/'.$part3.'.'.$part2.'.class.php')) { - $filecanvas = DOL_DOCUMENT_ROOT.'/'.$part1.'/canvas/'.$part2.'/'.$part1.'.'.$part2.'.class.php'; - $classname = ucfirst($part1).ucfirst($part2); + $filecanvas = DOL_DOCUMENT_ROOT.'/'.$part1.'/canvas/'.$part2.'/'.$part3.'.'.$part2.'.class.php'; + $classname = ucfirst($part3).ucfirst($part2); $this->template_dir = DOL_DOCUMENT_ROOT.'/'.$part1.'/canvas/'.$part2.'/tpl/'; include_once($filecanvas); @@ -121,7 +128,7 @@ class Canvas */ function display_canvas() { - global $conf, $langs; + global $conf, $langs, $user; if (!empty($this->smarty)) { diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index cf60ffa0494..b29e4d0b6cf 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -49,22 +49,21 @@ function societe_prepare_head($objsoc) $head[$h][2] = 'agenda'; $h++; - - if ($objsoc->client==1 || $objsoc->client==3) + if ($objsoc->client==1 || $objsoc->client==3 || $objsoc->object->client==1 || $objsoc->object->client==3) { $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id; $head[$h][1] = $langs->trans("Customer"); $head[$h][2] = 'customer'; $h++; } - if ($objsoc->client==2 || $objsoc->client==3) + if ($objsoc->client==2 || $objsoc->client==3 || $objsoc->object->client==2 || $objsoc->object->client==3) { $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$objsoc->id; $head[$h][1] = $langs->trans("Prospect"); $head[$h][2] = 'prospect'; $h++; } - if ($objsoc->fournisseur) + if ($objsoc->fournisseur || $objsoc->object->fournisseur) { $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id; $head[$h][1] = $langs->trans("Supplier"); diff --git a/htdocs/societe/canvas/default/thirdparty.default.class.php b/htdocs/societe/canvas/default/thirdparty.default.class.php index 36fc53b84d9..d98a46ddf0c 100644 --- a/htdocs/societe/canvas/default/thirdparty.default.class.php +++ b/htdocs/societe/canvas/default/thirdparty.default.class.php @@ -50,8 +50,6 @@ class ThirdPartyDefault extends Societe $this->name = "default"; $this->definition = "Canvas des tiers (défaut)"; $this->fieldListName = "thirdparty_default"; - - $this->next_prev_filter = "canvas='default'"; } function getTitle() @@ -73,13 +71,12 @@ class ThirdPartyDefault extends Societe } /** - * \brief Assigne les valeurs pour les templates - * \param object object + * \brief Assigne les valeurs complementaires pour le canvas + * \param action Type of action */ function assign_values($action='') { - global $conf,$langs; - + parent::assign_values($action); } /** diff --git a/htdocs/societe/canvas/default/tpl/view.tpl.php b/htdocs/societe/canvas/default/tpl/view.tpl.php index 3f9dea8ca20..f5d76fd6e49 100644 --- a/htdocs/societe/canvas/default/tpl/view.tpl.php +++ b/htdocs/societe/canvas/default/tpl/view.tpl.php @@ -31,30 +31,30 @@ trans('Name'); ?> - showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); ?> + object->tpl['showrefnav']; ?> trans('Prefix'); ?> - prefix_comm; ?> + object->tpl['prefix_comm']; ?> -client) { ?> +object->tpl['client']) { ?> trans('CustomerCode'); ?> - code_client; ?> - check_codeclient() <> 0) { ?> + object->tpl['code_client']; ?> + object->tpl['checkcustomercode'] <> 0) { ?> (trans("WrongCustomerCode"); ?>) -fournisseur) { ?> +object->tpl['fournisseur']) { ?> trans('SupplierCode'); ?> - code_fournisseur; ?> - check_codefournisseur() <> 0) { ?> + object->tpl['code_fournisseur']; ?> + object->tpl['checksuppliercode'] <> 0) { ?> (trans("WrongSupplierCode"); ?>) @@ -64,119 +64,70 @@ global->MAIN_MODULE_BARCODE) { ?> trans('Gencod'); ?> - gencod; ?> + object->tpl['gencod']; ?> trans('Address'); ?> - address); ?> + object->tpl['address']; ?> trans('Zip'); ?> - cp; ?> + object->tpl['cp']; ?> trans('Town'); ?> - ville; ?> + object->tpl['ville']; ?> trans("Country"); ?> - - pays_code); - if ($soc->isInEEC()) echo $form->textwithpicto(($img?$img.' ':'').$soc->pays,$langs->trans("CountryIsInEEC"),1,0); - else echo ($img?$img.' ':'').$soc->pays; - ?> - + object->tpl['country']; ?> trans('State'); ?> - departement; ?> + object->tpl['departement']; ?> trans('Phone'); ?> - tel,$soc->pays_code,0,$soc->id,'AC_TEL'); ?> + object->tpl['phone']; ?> trans('Fax'); ?> - fax,$soc->pays_code,0,$soc->id,'AC_FAX'); ?> + object->tpl['fax']; ?> trans('EMail'); ?> - email,0,$soc->id,'AC_EMAIL'); ?> + object->tpl['email'];; ?> trans('Web'); ?> - url); ?> + object->tpl['url']; ?> -transcountry('ProfId1',$soc->pays_code); ?> - - - - siren; ?> - siren) { - if ($soc->id_prof_check(1,$soc) > 0) print '   '.$soc->id_prof_url(1,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } ?> - - - -   -   - - -transcountry('ProfId2',$soc->pays_code); ?> - - - siret; ?> - siret) { - if ($soc->id_prof_check(2,$soc) > 0) print '   '.$soc->id_prof_url(2,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } ?> - - - -   -   - - - -transcountry('ProfId3',$soc->pays_code); ?> - - - - ape; ?> - ape) { - if ($soc->id_prof_check(3,$soc) > 0) print '   '.$soc->id_prof_url(3,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } ?> - - - -   -   - - -transcountry('ProfId4',$soc->pays_code); ?> - - - idprof4; ?> - idprof4) { - if ($soc->id_prof_check(4,$soc) > 0) print '   '.$soc->id_prof_url(4,$soc); - else print ' ('.$langs->trans("ErrorWrongValue").')'; - } ?> - - - -   -   - - +object->tpl['langprofid'.$i]!='-') { + if ($i==1 || $i==3) echo ''; + echo ''.$this->object->tpl['langprofid'.$i].''; + echo ''.$this->object->tpl['profid'.$i]; + if ($this->object->tpl['profid'.$i]) { + if ($this->object->tpl['checkprofid'.$i] > 0) echo '   '.$this->object->tpl['urlprofid'.$i]; + else echo ' ('.$langs->trans("ErrorWrongValue").')'; + } + echo ''; + if ($i==2 || $i==4) echo ''; + } else { + if ($i==1 || $i==3) echo ''; + echo ' '; + echo ' '; + if ($i==2 || $i==4) echo ''; + } +} +?> trans('VATIsUsed'); ?> - tva_assuj); ?> + object->tpl['tva_assuj']; ?> use_javascript_ajax) { ?>