print $form->selectarray("clos", array(0 => $account->status[0], 1 => $account->status[1]), isset($_POST["clos"]) ? $_POST["clos"] : $account->clos); print '</td></tr>'; // Country $selectedcode = ''; if (isset($_POST["account_country_id"])) { $selectedcode = $_POST["account_country_id"] ? $_POST["account_country_id"] : $account->country_code; } else { if (empty($selectedcode)) { $selectedcode = $mysoc->country_code; } } $account->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print '<tr><td class="fieldrequired">' . $langs->trans("BankAccountCountry") . '</td>'; print '<td colspan="3">'; print $form->select_country($selectedcode, 'account_country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '</td></tr>'; // State print '<tr><td>' . $langs->trans('State') . '</td><td colspan="3">'; if ($selectedcode) { $formcompany->select_departement(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : '', $selectedcode, 'account_state_id'); } else { print $countrynotdefined; } print '</td></tr>'; // Web print '<tr><td>' . $langs->trans("Web") . '</td>'; print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="' . $_POST["url"] . '"></td></tr>';
print $formproduct->select_measuring_units("volume_units", "volume"); print '</td></tr>'; } // Units if ($conf->global->PRODUCT_USE_UNITS) { print '<tr><td>' . $langs->trans('DefaultUnitToShow') . '</td>'; print '<td colspan="3">'; print $form->selectUnits('', 'units'); print '</td></tr>'; } // Custom code if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { print '<tr><td>' . $langs->trans("CustomCode") . '</td><td><input name="customcode" size="10" value="' . GETPOST('customcode') . '"></td>'; // Origin country print '<td>' . $langs->trans("CountryOrigin") . '</td><td>'; print $form->select_country(GETPOST('country_id', 'int'), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '</td></tr>'; } // Other attributes $parameters = array('colspan' => 3); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook) && !empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit', $parameters); } // Note (private, no output on invoices, propales...) print '<tr><td class="tdtop">' . $langs->trans("NoteNotVisibleOnBill") . '</td><td colspan="3">'; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
/** * \brief Show field * \param fieldlist Array of fields * \param obj If we show a particular record, obj is filled with record fields */ function fieldList($fieldlist, $obj = '') { global $conf, $langs, $db; global $region_id; global $elementList, $sourceList; $html = new Form($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); foreach ($fieldlist as $field => $value) { if ($fieldlist[$field] == 'pays') { if (in_array('region_id', $fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input print '<td>'; print $html->select_country($obj->pays_code ? $obj->pays_code : $obj->pays, 'pays'); print '</td>'; } elseif ($fieldlist[$field] == 'pays_id') { $pays_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0; print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $pays_id . '">'; } elseif ($fieldlist[$field] == 'region') { print '<td>'; $formcompany->select_region($region_id, 'region'); print '</td>'; } elseif ($fieldlist[$field] == 'region_id') { $region_id = $obj->{$fieldlist}[$field] ? $obj->{$fieldlist}[$field] : 0; print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">'; } elseif ($fieldlist[$field] == 'lang') { print '<td>'; print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print '</td>'; } elseif ($fieldlist[$field] == 'element') { print '<td>'; print $html->selectarray('element', $elementList, $obj->{$fieldlist}[$field]); print '</td>'; } elseif ($fieldlist[$field] == 'source') { print '<td>'; print $html->selectarray('source', $sourceList, $obj->{$fieldlist}[$field]); print '</td>'; } elseif ($fieldlist[$field] == 'type' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX . "c_actioncomm") { print '<td>'; print 'user<input type="hidden" name="type" value="user">'; print '</td>'; } elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm') { print '<td>'; print $html->selectyesno($fieldlist[$field], $obj->{$fieldlist}[$field], 1); print '</td>'; } elseif ($fieldlist[$field] == 'nbjour' || $fieldlist[$field] == 'decalage' || $fieldlist[$field] == 'taux') { print '<td><input type="text" class="flat" value="' . $obj->{$fieldlist}[$field] . '" size="3" name="' . $fieldlist[$field] . '"></td>'; } elseif ($fieldlist[$field] == 'libelle_facture') { print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . $obj->{$fieldlist}[$field] . '</textarea></td>'; } elseif ($fieldlist[$field] == 'price') { print '<td><input type="text" class="flat" value="' . price($obj->{$fieldlist}[$field]) . '" size="8" name="' . $fieldlist[$field] . '"></td>'; } elseif ($fieldlist[$field] == 'code') { print '<td><input type="text" class="flat" value="' . $obj->{$fieldlist}[$field] . '" size="10" name="' . $fieldlist[$field] . '"></td>'; } elseif ($fieldlist[$field] == 'unit') { print '<td>'; print $html->selectarray('unit', array('mm', 'cm', 'point', 'inch'), $obj->{$fieldlist}[$field], 0, 0, 1); print '</td>'; } else { print '<td>'; print '<input type="text" ' . ($fieldlist[$field] == 'libelle' ? 'size="32" ' : '') . ' class="flat" value="' . $obj->{$fieldlist}[$field] . '" name="' . $fieldlist[$field] . '">'; print '</td>'; } } }
print $object->address; print '</textarea></td></tr>'; // Zip print '<tr><td>'.fieldLabel('Zip','zipcode').'</td><td>'; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); print '</td></tr>'; // Town print '<tr><td>'.fieldLabel('Town','town').'</td><td>'; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print '</td></tr>'; // Country print '<tr><td>'.fieldLabel('Country','selectcountry_id').'</td><td class="maxwidthonsmartphone">'; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '</td></tr>'; // State if (empty($conf->global->USER_DISABLE_STATE)) { print '<tr><td>'.fieldLabel('State','state_id').'</td><td class="maxwidthonsmartphone">'; print $formcompany->select_state($object->state_id,$object->country_code, 'state_id'); print '</td></tr>'; } // Tel print '<tr><td>'.$langs->trans("PhonePro").'</td>'; print '<td>'; if (! empty($ldap_phone))
/** * @var City */ global $edited_City; // Determine if we are creating or updating... global $action; $creating = is_create_action($action); $Form = new Form(NULL, 'city_checkchanges', 'post', 'compact'); $Form->global_icon(T_('Delete this city!'), 'delete', regenerate_url('action', 'action=delete&' . url_crumb('city'))); $Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action')); $Form->begin_form('fform', ($creating ? T_('New city') : T_('City')) . get_manual_link('cities-editing')); $Form->add_crumb('city'); $Form->hiddens_by_key(get_memorized('action' . ($creating ? ',city_ID' : ''))); // (this allows to come back to the right list order & page) $CountryCache =& get_CountryCache(); $Form->select_country('city_ctry_ID', $edited_City->ctry_ID, $CountryCache, T_('Country'), array('allow_none' => true, 'required' => true)); $Form->select_input_options('city_rgn_ID', get_regions_option_list($edited_City->ctry_ID, $edited_City->rgn_ID, array('none_option_text' => T_('Unknown'))), T_('Region')); $Form->select_input_options('city_subrg_ID', get_subregions_option_list($edited_City->rgn_ID, $edited_City->subrg_ID, array('none_option_text' => T_('Unknown'))), T_('Sub-region')); $Form->text_input('city_postcode', $edited_City->postcode, 12, T_('Post code'), '', array('maxlength' => 12, 'required' => true)); $Form->text_input('city_name', $edited_City->name, 40, T_('Name'), '', array('maxlength' => 40, 'required' => true)); if ($creating) { $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton'))); } else { $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton'))); } ?> <script type="text/javascript"> jQuery( '#city_ctry_ID' ).change( function () { // Load option list with regions for seleted country jQuery.ajax( { type: 'POST',
/** * @var Sub-region */ global $edited_Subregion; // Determine if we are creating or updating... global $action; $creating = is_create_action($action); $Form = new Form(NULL, 'subregion_checkchanges', 'post', 'compact'); $Form->global_icon(T_('Delete this sub-region!'), 'delete', regenerate_url('action', 'action=delete&' . url_crumb('subregion'))); $Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action')); $Form->begin_form('fform', ($creating ? T_('New sub-region') : T_('Sub-region')) . get_manual_link('subregions-editing')); $Form->add_crumb('subregion'); $Form->hiddens_by_key(get_memorized('action' . ($creating ? ',subrg_ID' : ''))); // (this allows to come back to the right list order & page) $CountryCache =& get_CountryCache(); $Form->select_country('subrg_ctry_ID', $edited_Subregion->ctry_ID, $CountryCache, T_('Country'), array('allow_none' => true, 'required' => true)); $Form->select_input_options('subrg_rgn_ID', get_regions_option_list($edited_Subregion->ctry_ID, $edited_Subregion->rgn_ID, array('none_option_text' => T_('Unknown'))), T_('Region'), '', array('required' => true)); $Form->text_input('subrg_code', $edited_Subregion->code, 6, T_('Code'), '', array('maxlength' => 6, 'required' => true)); $Form->text_input('subrg_name', $edited_Subregion->name, 40, T_('Name'), '', array('maxlength' => 40, 'required' => true)); if ($creating) { $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton'))); } else { $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton'))); } ?> <script type="text/javascript"> jQuery( '#subrg_ctry_ID' ).change( function () { // Load option list with regions for seleted country jQuery.ajax( { type: 'POST', url: '<?php
// Display info field (when invitation code is correct) $Form->info(T_('Your invitation code'), get_param('invitation')); $Form->hidden('invitation', get_param('invitation')); } // Login $Form->text_input($dummy_fields['login'], $login, 22, T_('Login'), $params['register_use_placeholders'] ? '' : T_('Choose an username') . '.', array('placeholder' => $params['register_use_placeholders'] ? T_('Choose an username') : '', 'maxlength' => 20, 'class' => 'input_text', 'required' => true, 'input_suffix' => ' <span id="login_status"></span>', 'style' => 'width:' . ($params['register_field_width'] - 2) . 'px')); // Passwords $Form->password_input($dummy_fields['pass1'], '', 18, T_('Password'), array('note' => $params['register_use_placeholders'] ? '' : T_('Choose a password') . '.', 'placeholder' => $params['register_use_placeholders'] ? T_('Choose a password') : '', 'maxlength' => 70, 'class' => 'input_text', 'required' => true, 'style' => 'width:' . $params['register_field_width'] . 'px', 'autocomplete' => 'off')); $Form->password_input($dummy_fields['pass2'], '', 18, '', array('note' => ($params['register_use_placeholders'] ? '' : T_('Please type your password again') . '.') . '<div id="pass2_status" class="red"></div>', 'placeholder' => $params['register_use_placeholders'] ? T_('Please type your password again') : '', 'maxlength' => 70, 'class' => 'input_text', 'required' => true, 'style' => 'width:' . $params['register_field_width'] . 'px', 'autocomplete' => 'off')); // Email $Form->text_input($dummy_fields['email'], $email, 50, T_('Email'), '<br />' . T_('We respect your privacy. Your email will remain strictly confidential.'), array('placeholder' => $params['register_use_placeholders'] ? T_('Email address') : '', 'maxlength' => 255, 'class' => 'input_text wide_input', 'required' => true)); $registration_require_country = (bool) $Settings->get('registration_require_country'); if ($registration_require_country) { // country required $CountryCache =& get_CountryCache(); $Form->select_country('country', param('country', 'integer', 0), $CountryCache, T_('Country'), array('allow_none' => true, 'required' => true)); } $registration_require_firstname = (bool) $Settings->get('registration_require_firstname'); if ($registration_require_firstname) { // firstname required $Form->text_input('firstname', $firstname, 18, T_('First name'), T_('Your real first name.'), array('maxlength' => 50, 'class' => 'input_text', 'required' => true)); } $registration_require_gender = $Settings->get('registration_require_gender'); if ($registration_require_gender != 'hidden') { // Display a gender field if it is not hidden $Form->radio_input('gender', $gender, array(array('value' => 'M', 'label' => T_('A man')), array('value' => 'F', 'label' => T_('A woman'))), T_('I am'), array('required' => $registration_require_gender == 'required')); } if ($Settings->get('registration_ask_locale')) { // ask user language $locale = 'en_US'; $Form->select('locale', $locale, 'locale_options_return', T_('Locale'), T_('Preferred language'));
// Address print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">'; print $object->address; print '</textarea></td></tr>'; // Zip / Town print '<tr><td>'.$langs->trans('Zip').'</td><td>'; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); print '</td><td>'.$langs->trans('Town').'</td><td>'; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id')); print '</td></tr>'; // Country print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; print $form->select_country($object->country_code,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '</td></tr>'; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; print $formcompany->select_state($object->state_id,$object->country_code); print '</td></tr>'; } // Phone / Fax print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$object->tel.'"></td>'; print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$object->fax.'"></td></tr>';
print '<tr ' . $bc[$var] . '><td class="fieldrequired">' . $langs->trans("CompanyName") . '</td><td>'; print '<input name="nom" size="30" value="' . ($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM : $_POST["nom"]) . '"></td></tr>' . "\n"; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CompanyAddress") . '</td><td>'; print '<textarea name="address" cols="80" rows="' . ROWS_3 . '">' . ($conf->global->MAIN_INFO_SOCIETE_ADRESSE ? $conf->global->MAIN_INFO_SOCIETE_ADRESSE : $_POST["address"]) . '</textarea></td></tr>' . "\n"; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CompanyZip") . '</td><td>'; print '<input name="cp" value="' . ($conf->global->MAIN_INFO_SOCIETE_CP ? $conf->global->MAIN_INFO_SOCIETE_CP : $_POST["cp"]) . '" size="10"></td></tr>' . "\n"; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CompanyTown") . '</td><td>'; print '<input name="ville" size="30" value="' . ($conf->global->MAIN_INFO_SOCIETE_VILLE ? $conf->global->MAIN_INFO_SOCIETE_VILLE : $_POST["ville"]) . '"></td></tr>' . "\n"; // Country $var = !$var; print '<tr ' . $bc[$var] . '><td class="fieldrequired">' . $langs->trans("Country") . '</td><td>'; //if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation print $form->select_country($mysoc->country_id, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"), 1); } print '</td></tr>' . "\n"; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("State") . '</td><td>'; $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT, $mysoc->country_code, 'departement_id'); print '</td></tr>' . "\n"; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CompanyCurrency") . '</td><td>'; $form->select_currency($conf->currency, "currency"); print '</td></tr>' . "\n"; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("Tel") . '</td><td>'; print '<input name="tel" value="' . $conf->global->MAIN_INFO_SOCIETE_TEL . '"></td></tr>';
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>'; $pays_id=GETPOST('pays_id'); if (! $pays_id && ! empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) $pays_id=getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE,2,$db,$langs); if (! $pays_id && ! empty($conf->geoipmaxmind->enabled)) { $pays_code=dol_user_country(); //print $pays_code; if ($pays_code) { $new_pays_id=getCountry($pays_code,3,$db,$langs); //print 'xxx'.$pays_code.' - '.$new_pays_id; if ($new_pays_id) $pays_id=$new_pays_id; } } $pays_code=getCountry($pays_id,2,$db,$langs); print $html->select_country($pays_id,'pays_id'); print '</td></tr>'; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '<tr><td>'.$langs->trans('State').'</td><td>'; if ($pays_code) print $formcompany->select_state(GETPOST("departement_id"),$pays_code); else print ''; print '</td></tr>'; } // EMail print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n"; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print '<tr><td>'.$langs->trans("Login").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" size="20" value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n";
print '<td>'; print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array('town', 'selectcountry_id'), 6); print '</td>'; print '</tr>'; // Town print '<tr>'; print '<td>' . fieldLabel('Town', 'town', 0) . '</td>'; print '<td>'; print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array('zipcode', 'selectcountry_id')); print '</td>'; print '</tr>'; // Country print '<tr>'; print '<td>' . fieldLabel('Country', 'selectcountry_id', 0) . '</td>'; print '<td class="maxwidthonsmartphone">'; print $form->select_country($mysoc->country_id, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '</td>'; print '</tr>'; // Status print '<tr>'; print '<td>' . fieldLabel('Status', 'status', 1) . '</td>'; print '<td>'; print $form->selectarray('status', $status2label, GETPOST('status')); print '</td></tr>'; print '</table>'; dol_fiche_end(); print '<div class="center">'; print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
print $form->selectyesno("public", isset($_POST["public"]) ? $_POST["public"] : 1, 1); print "</td></tr>\n"; print "<tr>" . '<td>' . $langs->trans("Company") . '</td><td><input type="text" name="societe" value="' . GETPOST("societe") . '" size="40"></td></tr>'; print "<tr>" . '<td>' . $langs->trans("Lastname") . '</td><td><input type="text" name="lastname" value="' . GETPOST("lastname") . '" size="40"></td></tr>'; print "<tr>" . '<td>' . $langs->trans("Firstname") . '</td><td><input type="text" name="firstname" value="' . GETPOST("firstname") . '" size="40"></td></tr>'; print "<tr>" . '<td>' . $langs->trans("Address") . '</td><td>'; print '<textarea name="address" wrap="soft" cols="40" rows="3">' . GETPOST("address") . '</textarea></td></tr>'; // Zip / Town print '<tr><td>' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td>'; print $formcompany->select_ziptown(isset($_POST["zipcode"]) ? $_POST["zipcode"] : $object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); print ' '; print $formcompany->select_ziptown(isset($_POST["town"]) ? $_POST["town"] : $object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '</tr>'; // Country print '<tr><td width="25%"><label for="selectcountry_id">' . $langs->trans('Country') . '</label></td><td colspan="3" class="maxwidthonsmartphone">'; print $form->select_country(GETPOST('country_id') != '' ? GETPOST('country_id') : $object->country_id); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '</td></tr>'; print "<tr>" . '<td>' . $langs->trans("EMail") . '</td><td><input type="text" name="email" value="' . GETPOST("email") . '" size="40"></td></tr>'; // Public note print '<tr>'; print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>'; print '<td valign="top" colspan="2">'; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); print '</td></tr>'; // Private note if (empty($user->societe_id)) { print '<tr>';
/** * This file is part of the evoCore framework - {@link http://evocore.net/} * See also {@link https://github.com/b2evolution/b2evolution}. * * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license} * * @copyright (c)2009-2015 by Francois Planque - {@link http://fplanque.com/} * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}. * * @package evocore */ if (!defined('EVO_MAIN_INIT')) { die('Please, do not access this page directly.'); } load_class('regional/model/_country.class.php', 'Country'); $Form = new Form(NULL, 'city_checkchanges', 'post', 'compact', 'multipart/form-data'); $Form->global_icon(T_('Cancel importing!'), 'close', regenerate_url('action')); $Form->begin_form('fform', T_('Import cities') . get_manual_link('cities-import')); echo T_('Select a country and upload a CSV file with the following columns:'); echo '<div style="padding:10px 0 10px 40px">'; echo T_('1. Postcode') . '<br />'; echo T_('2. City name') . '<br />'; echo T_('3. Optional: sub region code'); echo '</div>'; $Form->add_crumb('city'); $Form->hiddens_by_key(get_memorized('action')); // (this allows to come back to the right list order & page) $CountryCache =& get_CountryCache(); $Form->select_country('ctry_ID', get_param('ctry_ID'), $CountryCache, T_('Country'), array('allow_none' => true, 'required' => true)); $Form->input_field(array('label' => T_('CSV File'), 'name' => 'csv', 'type' => 'file', 'required' => true)); $Form->end_form(array(array('submit', 'actionArray[import]', T_('Import'), 'SaveButton')));
print '<table class="border" width="100%">'; print '<tr><td class="fieldrequired">' . $langs->trans('Label') . '</td><td><input type="text" size="30" name="label" id="label" value="' . ($object->label ? $object->label : $langs->trans('RequiredField')) . '"></td></tr>'; print '<tr><td class="fieldrequired">' . $langs->trans('Name') . '</td><td><input type="text" size="30" name="name" id="name" value="' . ($object->name ? $object->name : $langs->trans('RequiredField')) . '"></td></tr>'; print '<tr><td valign="top">' . $langs->trans('Address') . '</td><td colspan="3"><textarea name="address" cols="40" rows="3" wrap="soft">'; print $object->address; print '</textarea></td></tr>'; // Zip print '<tr><td>' . $langs->trans('Zip') . '</td><td>'; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id'), 6); print '</td></tr>'; // Town print '<tr><td>' . $langs->trans('Town') . '</td><td>'; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id')); print '</td></tr>'; print '<tr><td width="25%">' . $langs->trans('Country') . '</td><td colspan="3">'; print $form->select_country($object->country_id, 'selectcountry_id'); print '</td></tr>'; print '<tr><td>' . $langs->trans('Phone') . '</td><td><input type="text" name="phone" value="' . $object->phone . '"></td></tr>'; print '<tr><td>' . $langs->trans('Fax') . '</td><td><input type="text" name="fax" value="' . $object->fax . '"></td></tr>'; print '<tr><td>' . $langs->trans('Note') . '</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">'; print $object->note; print '</textarea></td></tr>'; print '</table>' . "\n"; print '<br><center>'; print '<input type="submit" class="button" value="' . $langs->trans('Add') . '">'; if (!empty($backtopage)) { print ' '; print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">'; } print '</center>' . "\n"; print '</form>' . "\n";
if (empty($conf->global->SOCIETE_DISABLE_STATE)) { $rowspan++; } print '<td valign="middle" align="center" rowspan="' . $rowspan . '">'; if ($conf->use_javascript_ajax) { print '<a href="#" id="copyaddressfromsoc">' . $langs->trans('CopyAddressFromSoc') . '</a>'; } print '</td></tr>'; // Zip / Town print '<tr><td><label for="zipcode">' . $langs->trans("Zip") . '</label> / <label for="town">' . $langs->trans("Town") . '</label></td><td colspan="2" class="maxwidthonsmartphone">'; print $formcompany->select_ziptown(isset($_POST["zipcode"]) ? $_POST["zipcode"] : $object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6) . ' '; print $formcompany->select_ziptown(isset($_POST["town"]) ? $_POST["town"] : $object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '</td></tr>'; // Country print '<tr><td><label for="selectcountry_id">' . $langs->trans("Country") . '</label></td><td colspan="2" class="maxwidthonsmartphone">'; print $form->select_country(isset($_POST["country_id"]) ? $_POST["country_id"] : $object->country_id, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '</td></tr>'; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '<tr><td><label for="state_id">' . $langs->trans('State') . '</label></td><td colspan="2" class="maxwidthonsmartphone">'; print $formcompany->select_state($object->state_id, isset($_POST["country_id"]) ? $_POST["country_id"] : $object->country_id, 'state_id'); print '</td></tr>'; } // Phone print '<tr><td><label for="phone_pro">' . $langs->trans("PhonePro") . '</label></td>'; print '<td><input name="phone_pro" id="phone_pro" type="text" size="18" maxlength="80" value="' . (isset($_POST["phone_pro"]) ? $_POST["phone_pro"] : $object->phone_pro) . '"></td>'; print '<td><label for="phone_perso">' . $langs->trans("PhonePerso") . '</label></td>'; print '<td><input name="phone_perso" id="phone_perso" type="text" size="18" maxlength="80" value="' . (isset($_POST["phone_perso"]) ? $_POST["phone_perso"] : $object->phone_perso) . '"></td></tr>';
if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); } if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { $country_code = dol_user_country(); //print $country_code; if ($country_code) { $new_country_id = getCountry($country_code, 3, $db, $langs); //print 'xxx'.$country_code.' - '.$new_country_id; if ($new_country_id) { $country_id = $new_country_id; } } } $country_code = getCountry($country_id, 2, $db, $langs); print $form->select_country($country_id, 'country_id'); print '</td></tr>'; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '<tr><td>' . $langs->trans('State') . '</td><td>'; if ($country_code) { print $formcompany->select_state(GETPOST("state_id"), $country_code); } else { print ''; } print '</td></tr>'; } // EMail print '<tr><td>' . $langs->trans("Email") . ' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" size="40" value="' . dol_escape_htmltag(GETPOST('email')) . '"></td></tr>' . "\n"; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
// Town if (!empty($arrayfields['s.town']['checked'])) { print '<td class="liste_titre">'; print '<input class="flat" size="6" type="text" name="search_town" value="' . dol_escape_htmltag($search_town) . '">'; print '</td>'; } // Zip if (!empty($arrayfields['s.zip']['checked'])) { print '<td class="liste_titre">'; print '<input class="flat" size="4" type="text" name="search_zip" value="' . dol_escape_htmltag($search_zip) . '">'; print '</td>'; } // Country if (!empty($arrayfields['country.code_iso']['checked'])) { print '<td class="liste_titre" align="center">'; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth100'); print '</td>'; } // Company type if (!empty($arrayfields['typent.code']['checked'])) { print '<td class="liste_titre maxwidthonsmartphone" align="center">'; print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); print '</td>'; } if (!empty($arrayfields['s.siren']['checked'])) { // IdProf1 print '<td class="liste_titre">'; print '<input class="flat" size="4" type="text" name="search_idprof1" value="' . dol_escape_htmltag($search_idprof1) . '">'; print '</td>'; } if (!empty($arrayfields['s.siret']['checked'])) {
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $doleditor = new DolEditor('desc', $object->description, '', 180, 'dolibarr_notes', 'In', false, true, $conf->fckeditor->enabled, 5, 70); $doleditor->Create(); print '</td></tr>'; print '<tr><td>' . $langs->trans('Address') . '</td><td colspan="3"><textarea name="address" cols="60" rows="3" wrap="soft">'; print $object->address; print '</textarea></td></tr>'; // Zip / Town print '<tr><td>' . $langs->trans('Zip') . '</td><td>'; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); print '</td><td>' . $langs->trans('Town') . '</td><td>'; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '</td></tr>'; // Country print '<tr><td width="25%">' . $langs->trans('Country') . '</td><td colspan="3">'; print $form->select_country($object->country_id ? $object->country_id : $mysoc->country_code, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '</td></tr>'; print '<tr><td>' . $langs->trans("Status") . '</td><td colspan="3">'; print '<select name="statut" class="flat">'; print '<option value="0">' . $langs->trans("WarehouseClosed") . '</option>'; print '<option value="1" selected="selected">' . $langs->trans("WarehouseOpened") . '</option>'; print '</select>'; print '</td></tr>'; print '</table>'; print '<center><br><input type="submit" class="button" value="' . $langs->trans("Create") . '"></center>'; print '</form>'; } else { $id = GETPOST("id", 'int');
print '</td></tr>'; } // Address print '<tr><td valign="top">' . $langs->trans("Address") . '</td><td>'; print '<textarea name="address" wrap="soft" cols="40" rows="2">' . (GETPOST('address', 'alpha') ? GETPOST('address', 'alpha') : $object->address) . '</textarea>'; print '</td></tr>'; // Zip / Town print '<tr><td>' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td>'; print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha') ? GETPOST('zipcode', 'alpha') : $object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); print ' '; print $formcompany->select_ziptown(GETPOST('town', 'alpha') ? GETPOST('town', 'alpha') : $object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '</td></tr>'; // Country $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id; print '<tr><td width="25%">' . $langs->trans('Country') . '</td><td>'; print $form->select_country(GETPOST('country_id', 'alpha') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '</td></tr>'; // State if (empty($conf->global->MEMBER_DISABLE_STATE)) { print '<tr><td>' . $langs->trans('State') . '</td><td>'; if ($object->country_id) { print $formcompany->select_state(GETPOST('state_id', 'int') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code); } else { print $countrynotdefined; } print '</td></tr>'; } // Pro phone