90 global
$conf, $langs, $user, $mysoc;
91 global $form, $formcompany;
95 parent::assign_values($action);
99 $this->tpl[
'profid1'] = $this->
object->idprof1;
100 $this->tpl[
'profid2'] = $this->
object->idprof2;
101 $this->tpl[
'profid3'] = $this->
object->idprof3;
102 $this->tpl[
'profid4'] = $this->
object->idprof4;
106 $js .=
'<script type="text/javascript">';
107 $js .=
"function CheckVAT(a) {\n";
108 $js .=
"newpopup('".DOL_URL_ROOT.
"/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".
dol_escape_js($langs->trans(
"VATIntraCheckableOnEUSite")).
"',500,230);\n";
112 $this->tpl[
'js_checkVatPopup'] = $js;
115 if ($action ==
'create' || $action ==
'edit') {
116 for ($i = 1; $i <= 4; $i++) {
117 $this->tpl[
'langprofid'.$i] = $langs->transcountry(
'ProfId'.$i, $this->object->country_code);
118 $this->tpl[
'showprofid'.$i] = $formcompany->get_input_id_prof($i,
'idprof'.$i, $this->tpl[
'profid'.$i], $this->object->country_code);
122 $this->tpl[
'select_companytype'] = $form->selectarray(
"typent_id", $formcompany->typent_array(0), $this->object->typent_id);
125 $this->tpl[
'select_juridicalstatus'] = $formcompany->select_juridicalstatus($this->object->forme_juridique_code, $this->object->country_code);
128 $this->tpl[
'select_workforce'] = $form->selectarray(
"effectif_id", $formcompany->effectif_array(0), $this->object->effectif_id);
131 $s =
'<input type="text" class="flat" name="tva_intra" size="12" maxlength="20" value="'.$this->object->tva_intra.
'">';
135 if (
$conf->use_javascript_ajax) {
136 $s .=
'<a href="#" onclick="CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans(
"VATIntraCheck").
'</a>';
137 $this->tpl[
'tva_intra'] = $form->textwithpicto($s, $langs->trans(
"VATIntraCheckDesc", $langs->transnoentitiesnoconv(
"VATIntraCheck")), 1);
139 $this->tpl[
'tva_intra'] = $s.
'<a href="'.$langs->transcountry(
"VATIntraCheckURL", $this->object->country_id).
'" target="_blank">'.
img_picto($langs->trans(
"VATIntraCheckableOnEUSite"),
'help').
'</a>';
142 $this->tpl[
'tva_intra'] = $s;
146 if ($action ==
'delete') {
147 $this->tpl[
'action_delete'] = $form->formconfirm($_SERVER[
"PHP_SELF"].
"?socid=".$this->object->id, $langs->trans(
"DeleteACompany"), $langs->trans(
"ConfirmDeleteCompany"),
"confirm_delete",
'', 0,
"1,action-delete");
150 for ($i = 1; $i <= 4; $i++) {
151 $this->tpl[
'langprofid'.$i] = $langs->transcountry(
'ProfId'.$i, $this->object->country_code);
152 $this->tpl[
'checkprofid'.$i] = $this->
object->id_prof_check($i, $this->
object);
153 $this->tpl[
'urlprofid'.$i] = $this->
object->id_prof_url($i, $this->
object);
157 if ($this->object->tva_intra) {
158 $s = $this->
object->tva_intra;
159 $s .=
'<input type="hidden" name="tva_intra" size="12" maxlength="20" value="'.$this->object->tva_intra.
'">';
163 if (
$conf->use_javascript_ajax) {
164 $s .=
'<a href="#" onclick="CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans(
"VATIntraCheck").
'</a>';
165 $this->tpl[
'tva_intra'] = $form->textwithpicto($s, $langs->trans(
"VATIntraCheckDesc", $langs->transnoentitiesnoconv(
"VATIntraCheck")), 1);
167 $this->tpl[
'tva_intra'] = $s.
'<a href="'.$langs->transcountry(
"VATIntraCheckURL", $this->object->country_id).
'" target="_blank">'.
img_picto($langs->trans(
"VATIntraCheckableOnEUSite"),
'help').
'</a>';
170 $this->tpl[
'tva_intra'] = $s;
173 $this->tpl[
'tva_intra'] =
' ';
177 if ($this->object->parent) {
178 $socm =
new Societe($this->db);
179 $socm->fetch($this->object->parent);
180 $this->tpl[
'parent_company'] = $socm->getNomUrl(1).
' '.($socm->code_client ?
"(".$socm->code_client.
")" :
"");
181 $this->tpl[
'parent_company'] .= ($socm->town ?
' - '.$socm->town :
'');
183 $this->tpl[
'parent_company'] = $langs->trans(
"NoParentCompany");
201 public function restrictedArea($user, $features =
'societe', $objectid = 0, $dbtablename =
'', $feature2 =
'', $dbt_keyfield =
'fk_soc', $dbt_select =
'rowid')
203 return restrictedArea($user, $features, $objectid, $dbtablename, $feature2, $dbt_keyfield, $dbt_select);