$db->free($result); } else { dol_print_error($db); } /* * Ecran ajout/suppression permission */ $linkback = '<a href="' . DOL_URL_ROOT . '/user/index.php">' . $langs->trans("BackToList") . '</a>'; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); print '<div class="underbanner clearboth"></div>'; if ($user->admin) { print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules")); } // Show warning about external users if (empty($user->societe_id)) { print info_admin(showModulesExludedForExternal($modules)) . "\n"; } // For multicompany transversal mode // TODO Place a hook here if (!empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode)) { $aEntities = array_keys($permsgroupbyentity); sort($aEntities); $entity = GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $aEntities[0]; $head = entity_prepare_head($object, $aEntities); $title = $langs->trans("Entities"); dol_fiche_head($head, $entity, $title, 1, 'multicompany@multicompany'); } print "\n"; print '<table width="100%" class="noborder">'; print '<tr class="liste_titre">'; print '<td>' . $langs->trans("Module") . '</td>';
print '</div>'; print '</form>'; } else { $var = true; // Language print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>' . $langs->trans("Parameters") . '</td><td>' . $langs->trans("Value") . '</td><td> </td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DefaultLanguage") . '</td><td>'; $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); print $s ? $s . ' ' : ''; print $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . $conf->global->MAIN_LANG_DEFAULT); print '</td>'; print '<td width="20">'; if ($user->admin && $conf->global->MAIN_LANG_DEFAULT != 'auto') { print info_admin($langs->trans("SubmitTranslation" . ($conf->global->MAIN_LANG_DEFAULT == 'en_US' ? 'ENUS' : ''), $conf->global->MAIN_LANG_DEFAULT), 1); } print '</td>'; print "</tr>"; $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("EnableMultilangInterface") . '</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>'; print '<td width="20"> </td>'; print "</tr>"; print '</table><br>' . "\n"; // Themes show_theme(null, 0); print '<br>'; // List of search forms to show if (!empty($searchform)) { print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td width="35%">' . $langs->trans("PermanentLeftSearchForm") . '</td><td>' . $langs->trans("Activated") . '</td><td> </td></tr>';
accessforbidden(); /* * View */ llxHeader(); $form = new Form($db); print_fiche_titre($langs->trans("SystemToolsArea"),'','setup'); print $langs->trans("SystemToolsAreaDesc").'<br>'; print "<br>"; if ($message) print $message.'<br>'; print info_admin($langs->trans("SystemAreaForAdminOnly")).'<br>'; $db->close(); llxFooter('$Date: 2011/08/03 00:45:43 $ - $Revision: 1.7 $'); ?>
print '</td><td>' . $langs->trans("LDAPFieldTownExample") . '</td>'; print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_TOWN"' . ($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS == $conf->global->LDAP_CONTACT_FIELD_TOWN ? ' checked="checked"' : '') . "></td>"; print '</tr>'; // COUNTRY $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("LDAPFieldCountry") . '</td><td>'; print '<input size="25" type="text" name="fieldcountry" value="' . $conf->global->LDAP_CONTACT_FIELD_COUNTRY . '">'; print '</td><td> </td>'; print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_COUNTRY"' . ($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS == $conf->global->LDAP_CONTACT_FIELD_COUNTRY ? ' checked="checked"' : '') . "></td>"; print '</tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td colspan="4" align="center"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td></tr>'; print '</table>'; print '</form>'; print '</div>'; print info_admin($langs->trans("LDAPDescValues")); /* * Test de la connexion */ $butlabel = $langs->trans("LDAPTestSynchroContact"); $testlabel = 'test'; $key = $conf->global->LDAP_KEY_CONTACTS; $dn = $conf->global->LDAP_CONTACT_DN; $objectclass = $conf->global->LDAP_CONTACT_OBJECT_CLASS; show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); if (function_exists("ldap_connect")) { if ($_GET["action"] == 'test') { // Creation objet $object = new Contact($db); $object->initAsSpecimen(); // Test synchro
/** * Show form to upload a new file * * @param string $url Url * @param string $title Title zone (Title or '' or 'none') * @param int $addcancel 1=Add 'Cancel' button * @param int $sectionid If upload must be done inside a particular ECM section * @param int $perm Value of permission to allow upload * @param int $size Length of input file area * @param Object $object Object to use (when attachment is done on an element) * @param string $options Add an option column * @param boolean $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * @param string $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param string $htmlname Name and id of HTML form * @return int <0 if KO, >0 if OK */ function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile') { global $conf, $langs, $hookmanager; $hookmanager->initHooks(array('formfile')); if (!empty($conf->browser->layout) && $conf->browser->layout != 'classic') { $useajax = 0; } if (!empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax || $useajax == 2) { // TODO: Check this works with 2 forms on same page // TODO: Check this works with GED module, otherwise, force useajax to 0 // TODO: This does not support option savingdocmask // TODO: This break feature to upload links too return $this->_formAjaxFileUpload($object); } else { $maxlength = $size; $out = "\n\n<!-- Start form attach new file -->\n"; if (empty($title)) { $title = $langs->trans("AttachANewFile"); } if ($title != 'none') { $out .= load_fiche_titre($title, null, null); } $out .= '<form name="' . $htmlname . '" id="' . $htmlname . '" action="' . $url . '" enctype="multipart/form-data" method="POST">'; $out .= '<input type="hidden" id="' . $htmlname . '_section_dir" name="section_dir" value="">'; $out .= '<input type="hidden" id="' . $htmlname . '_section_id" name="section_id" value="' . $sectionid . '">'; $out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; $out .= '<table width="100%" class="nobordernopadding">'; $out .= '<tr>'; if (!empty($options)) { $out .= '<td>' . $options . '</td>'; } $out .= '<td valign="middle" class="nowrap">'; $max = $conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp = @ini_get('upload_max_filesize'); // En inconnu if (preg_match('/m$/i', $maxphp)) { $maxphp = $maxphp * 1024; } // Now $max and $maxphp are in Kb if ($maxphp > 0) { $max = min($max, $maxphp); } if ($max > 0) { $out .= '<input type="hidden" name="max_file_size" value="' . $max * 1024 . '">'; } $out .= '<input class="flat" type="file" name="userfile" size="' . $maxlength . '"'; $out .= empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : ''; $out .= '>'; $out .= ' '; $out .= '<input type="submit" class="button" name="sendit" value="' . $langs->trans("Upload") . '"'; $out .= empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : ''; $out .= '>'; if ($addcancel) { $out .= ' '; $out .= '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">'; } if (!empty($conf->global->MAIN_UPLOAD_DOC)) { if ($perm) { $langs->load('other'); //$out .= ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); $out .= ' '; $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphp), 1); //$out .= ')'; } } else { $out .= ' (' . $langs->trans("UploadDisabled") . ')'; } $out .= "</td></tr>"; if ($savingdocmask) { $out .= '<tr>'; if (!empty($options)) { $out .= '<td>' . $options . '</td>'; } $out .= '<td valign="middle" class="nowrap">'; $out .= '<input type="checkbox" checked name="savingdocmask" value="' . dol_escape_js($savingdocmask) . '"> ' . $langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/', $langs->transnoentitiesnoconv("OriginFileName"), $savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); $out .= '</td>'; $out .= '</tr>'; } $out .= "</table>"; $out .= '</form>'; if (empty($sectionid)) { $out .= '<br>'; } $out .= "\n<!-- End form attach new file -->\n"; if ($linkfiles) { $out .= "\n<!-- Start form attach new link -->\n"; $langs->load('link'); $title = $langs->trans("LinkANewFile"); $out .= load_fiche_titre($title, null, null); $out .= '<form name="' . $htmlname . '_link" id="' . $htmlname . '_link" action="' . $url . '" method="POST">'; $out .= '<input type="hidden" id="' . $htmlname . '_link_section_dir" name="link_section_dir" value="">'; $out .= '<input type="hidden" id="' . $htmlname . '_link_section_id" name="link_section_id" value="' . $sectionid . '">'; $out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; $out .= '<div class="valignmiddle" >'; $out .= '<div class="inline-block" style="padding-right: 10px;">'; if (!empty($conf->global->OPTIMIZEFORTEXTBROWSER)) { $out .= '<label for="link">' . $langs->trans("URLToLink") . ':</label> '; } $out .= '<input type="text" name="link" size="' . $maxlength . '" id="link" placeholder="' . dol_escape_htmltag($langs->trans("URLToLink")) . '">'; $out .= '</div>'; $out .= '<div class="inline-block" style="padding-right: 10px;">'; if (!empty($conf->global->OPTIMIZEFORTEXTBROWSER)) { $out .= '<label for="label">' . $langs->trans("Label") . ':</label> '; } $out .= '<input type="text" name="label" id="label" placeholder="' . dol_escape_htmltag($langs->trans("Label")) . '">'; $out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">'; $out .= '<input type="hidden" name="objectid" value="' . $object->id . '">'; $out .= '</div>'; $out .= '<div class="inline-block" style="padding-right: 10px;">'; $out .= '<input type="submit" class="button" name="linkit" value="' . $langs->trans("ToLink") . '"'; $out .= empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : ''; $out .= '>'; $out .= '</div>'; $out .= '</div>'; $out .= '<div class="clearboth"></div>'; $out .= '</form><br>'; $parameters = array('socid' => isset($GLOBALS['socid']) ? $GLOBALS['socid'] : '', 'id' => isset($GLOBALS['id']) ? $GLOBALS['id'] : '', 'url' => $url, 'perm' => $perm); $res = $hookmanager->executeHooks('formattachOptions', $parameters, $object); $out .= "\n<!-- End form attach new file -->\n"; } if (empty($res)) { print '<div class="attacharea">'; print $out; print '</div>'; } print $hookmanager->resPrint; return 1; } }
/** * Output list of type of event * * @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx' * @param string $htmlname Nom champ formulaire * @param string $excludetype Type to exclude * @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) * @return void */ function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0) { global $langs, $user, $form; if (!is_object($form)) { $form = new Form($db); } require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; $caction = new CActionComm($this->db); // Suggest a list with manual events or all auto events $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot); array_unshift($arraylist, ' '); // Add empty line at start //asort($arraylist); if ($selected == 'manual') { $selected = 'AC_OTH'; } if ($selected == 'auto') { $selected = 'AC_OTH_AUTO'; } print $form->selectarray($htmlname, $arraylist, $selected); if ($user->admin && empty($onlyautoornot)) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } }
unset($liste[$key]); } $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td width="16">' . img_picto_common($key, $objmodelexport->getPictoForKey($key)) . '</td>'; $text = $objmodelexport->getDriverDescForKey($key); $label = $listeall[$key]; print '<td>' . $form->textwithpicto($label, $text) . '</td>'; print '<td>' . $objmodelexport->getLibLabelForKey($key) . '</td><td align="right">' . $objmodelexport->getLibVersionForKey($key) . '</td></tr>' . "\n"; } print '</table>'; print '</div>'; print '<table width="100%">'; if ($sqlusedforexport && $user->admin) { print '<tr><td>'; print info_admin($langs->trans("SQLUsedForExport") . ':<br> ' . $sqlusedforexport); print '</td></tr>'; } print '</table>'; print '<table width="100%"><tr><td width="50%">'; if (!is_dir($conf->export->dir_temp)) { dol_mkdir($conf->export->dir_temp); } // Affiche liste des documents // NB: La fonction show_documents rescanne les modules qd genallowed=1, sinon prend $liste $formfile->show_documents('export', '', $upload_dir, $_SERVER["PHP_SELF"] . '?step=5&datatoexport=' . $datatoexport, $liste, 1, !empty($_POST['model']) ? $_POST['model'] : 'csv', 1, 1); print '</td><td width="50%"> </td></tr>'; print '</table>'; } print '<br>'; llxFooter();
/** * Begin main area * * @param string $title Title * @return void */ function main_area($title = '') { global $conf, $langs; if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) { print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->' . "\n"; } if (empty($conf->dol_hide_leftmenu)) { print '<div id="id-right">'; } print "\n"; if (!empty($conf->dol_use_jmobile)) { print '<div data-role="page">'; } print '<div class="fiche"> <!-- begin div class="fiche" -->' . "\n"; if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) { print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); } }
print '</td></tr>'; print '</table>'; if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { print '<br>'; /* // Warning 1 if ($linuxlike) { $sendmailoption=ini_get('mail.force_extra_parameters'); if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) { print info_admin($langs->trans("SendmailOptionNotComplete")); } }*/ // Warning 2 print info_admin($langs->trans("SendmailOptionMayHurtBuggedMTA")); } // Boutons actions print '<div class="tabsAction">'; print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit">' . $langs->trans("Modify") . '</a>'; if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) { if (function_exists('fsockopen') && $port && $server) { print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testconnect">' . $langs->trans("DoTestServerAvailability") . '</a>'; } } else { print '<a class="butActionRefused" href="#" title="' . $langs->trans("FeatureNotAvailableOnLinux") . '">' . $langs->trans("DoTestServerAvailability") . '</a>'; } print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=test&mode=init">' . $langs->trans("DoTestSend") . '</a>'; if (!empty($conf->fckeditor->enabled)) { print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testhtml&mode=init">' . $langs->trans("DoTestSendHTML") . '</a>'; }
/** * Output html select list of type of event * * @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx') * @param string $htmlname Nom champ formulaire * @param string $excludetype A type to exclude ('systemauto', 'system', '') * @param string $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type * @param int $hideinfohelp 1=Do not show info help * @param int $multiselect 1=Allow multiselect of action type * @return void */ function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0) { global $langs, $user, $form, $conf; if (!is_object($form)) { $form = new Form($db); } require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; $caction = new CActionComm($this->db); // Suggest a list with manual events or all auto events $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot); array_unshift($arraylist, ' '); // Add empty line at start //asort($arraylist); if ($selected == 'manual') { $selected = 'AC_OTH'; } if ($selected == 'auto') { $selected = 'AC_OTH_AUTO'; } if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) { unset($arraylist['AC_OTH_AUTO']); } if (!empty($multiselect)) { if (!is_array($selected) && !empty($selected)) { $selected = explode(',', $selected); } print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0); } else { print $form->selectarray($htmlname, $arraylist, $selected); } if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } }
/** * Begin main area * * @param string $title Title * @return void */ function main_area($title = '') { global $conf, $langs; print '<div class="container">'; if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); }
/** * 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 . ' ' : ''; $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'); } }
// Security warning repertoire install existe (si utilisateur admin) if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { $message = ''; // Check if install lock file is present $lockfile = DOL_DATA_ROOT . '/install.lock'; if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT . "/install")) { $langs->load("errors"); //if (! empty($message)) $message.='<br>'; $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT) . ' ' . $langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT . "/install")); } // Conf files must be in read only mode if (is_writable($conffile)) { $langs->load("errors"); //$langs->load("other"); //if (! empty($message)) $message.='<br>'; $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly") . ' ' . $langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT . "/install")); } if ($message) { print $message; //$message.='<br>'; //print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); } } //print 'mem='.memory_get_usage().' - '.memory_get_peak_usage(); llxFooter(); $db->close(); /** * Show weather logo. Logo to show depends on $totallate and values for * $conf->global->MAIN_METEO_OFFSET * $conf->global->MAIN_METEO_GAP *
require_once '../../../core/lib/admin.lib.php'; } else { require_once '../../core/lib/admin.lib.php'; } require_once __DIR__ . '/../class/OtpTranslate.class.php'; $otplangs = new OtpTranslate('', $conf); $otplangs->setDefaultLang($langs->getDefaultLang()); $otplangs->load('otp@otp'); $title = $otplangs->trans('OTPAdminTitle'); llxHeader('', $title); $otplangs->load('admin'); $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $otplangs->trans("BackToModuleList") . '</a>'; print_fiche_titre($title, $linkback); print '<br />'; if (!function_exists('mcrypt_encrypt')) { echo info_admin($otplangs->trans('OTPAdminNotCompatible')); llxFooter(); die; } print '<div class="titre">' . $otplangs->trans('OTPAdminUsage') . '</div>'; print ' <p>' . sprintf($otplangs->trans('OTPAdminInfoDevices'), '<a href="http://en.wikipedia.org/wiki/HMAC-based_One-time_Password_Algorithm">', '</a>', '<a href="https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8">', '</a>', '<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=es">', '</a>', '<a href="https://support.google.com/accounts/answer/1066447?hl=es">', '</a>') . '</p> <p>' . $otplangs->trans('OTPAdminInfoRegenerate') . '</p> <p>' . $otplangs->trans('OTPAdminInfoConfig') . '</p> <p style="text-align:center">' . sprintf($otplangs->trans('OTPAdminInfoLine'), '<i style="font-family:monospace;font-weight:bold">$dolibarr_main_authentication=\'dolibarr\';</i>', '<i style="font-family:monospace;font-weight:bold">$dolibarr_main_authentication=\'otp\';</i>') . '</p> <p>' . $otplangs->trans('OTPAdminInfoLogin') . '</p>
/* 数据检查 */ post_admin_check(array($_POST['field'] => $_POST['val'])); /* 管理员信息 */ $info = info_admin(array('admin_id' => $_POST['id'])); /* 更新数据库 */ $db->update(tname('admin'), array($_POST['field'] => trim($_POST['val'])), 'admin_id=' . $info['admin_id']); /* 写入日志和系统提示 */ admin_log(admin_privilege_name_fk('admin.php', 'edit') . ': ' . $info['name']); make_json_ok(); } make_json_fail(); } elseif ($_REQUEST['act'] == 'del') { /* 权限检查 */ admin_privilege_valid('admin.php', 'del'); /* 管理员信息(连表角色,拥有信任的角色信息) */ $info = info_admin(array('admin_id' => $_POST['id'])); /* 允许删除检查 */ allow_del($info); /* 删除管理员 */ del_admin(array('admin_id' => $info['admin_id'])); /* 初始化管理员的权限文件 */ init_privilege_sys_pfile($info['username']); /* 写入日志和系统提示 */ admin_log(admin_privilege_name_fk('admin.php', 'del') . ': ' . $info['name']); make_json_ok(); } elseif ($_REQUEST['act'] == 'exportdo') { /* 权限检查 */ admin_privilege_valid('admin.php', 'list'); /* 要导出的字段 */ $fields['sql'] = tname('admin') . '.username,' . tname('admin') . '.name,' . tname('role') . '.name AS role_name'; $fields['filter'] = 'username,name,role_name';
$urlvcal = '<a href="' . $urlwithroot . '/public/agenda/agendaexport.php?format=vcal&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...') . '" target="_blank">' . $urlwithroot . '/public/agenda/agendaexport.php?format=vcal&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED') . '</a>'; $message .= img_picto('', 'object_globe.png') . ' ' . $langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal); $message .= '<br>'; $urlical = '<a href="' . $urlwithroot . '/public/agenda/agendaexport.php?format=ical&type=event&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...') . '" target="_blank">' . $urlwithroot . '/public/agenda/agendaexport.php?format=ical&type=event&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED') . '</a>'; $message .= img_picto('', 'object_globe.png') . ' ' . $langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical); $message .= '<br>'; $urlrss = '<a href="' . $urlwithroot . '/public/agenda/agendaexport.php?format=rss&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...') . '" target="_blank">' . $urlwithroot . '/public/agenda/agendaexport.php?format=rss&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED') . '</a>'; $message .= img_picto('', 'object_globe.png') . ' ' . $langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss); $message .= '<br>'; $message .= '<br>'; print $message; $message = $langs->trans("AgendaUrlOptions1", $user->login, $user->login) . '<br>'; $message .= $langs->trans("AgendaUrlOptions2", $user->login, $user->login) . '<br>'; $message .= $langs->trans("AgendaUrlOptions3", $user->login, $user->login) . '<br>'; $message .= $langs->trans("AgendaUrlOptions4", $user->login, $user->login) . '<br>'; print info_admin($message); if (!empty($conf->use_javascript_ajax)) { print "\n" . '<script type="text/javascript">'; print '$(document).ready(function () { $("#generate_token").click(function() { $.get( "' . DOL_URL_ROOT . '/core/ajax/security.php", { action: \'getrandompassword\', generic: true }, function(token) { $("#MAIN_AGENDA_XCAL_EXPORTKEY").val(token); }); }); });'; print '</script>'; }
/** * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays * @param selected Code forme juridique a pre-selectionne * @param pays_code 0=liste tous pays confondus, sinon code du pays a afficher * @param filter Add a SQL filter on list */ function select_juridicalstatus($selected='', $pays_code=0, $filter='') { global $conf,$langs,$user; $langs->load("dict"); $out=''; // On recherche les formes juridiques actives des pays actifs $sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays"; $sql .= " FROM llx_c_forme_juridique as f, llx_c_pays as p"; $sql .= " WHERE f.fk_pays=p.rowid"; $sql .= " AND f.active = 1 AND p.active = 1"; if ($pays_code) $sql .= " AND p.code = '".$pays_code."'"; if ($filter) $sql .= " ".$filter; $sql .= " ORDER BY p.code, f.code"; dol_syslog("Form::select_forme_juridique sql=".$sql); $result=$this->db->query($sql); if ($result) { $out.= '<div id="particulier2" class="visible">'; $out.= '<select class="flat" name="forme_juridique_code">'; if ($pays_code) $out.= '<option value="0"> </option>'; $num = $this->db->num_rows($result); $i = 0; if ($num) { $pays=''; while ($i < $num) { $obj = $this->db->fetch_object($result); if ($obj->code == 0) { $out.= '<option value="0"> </option>'; } else { if (! $pays || $pays != $obj->libelle_pays) { // Affiche la rupture si on est en mode liste multipays if (! $pays_code && $obj->code_pays) { $out.= '<option value="0">----- '.$obj->libelle_pays." -----</option>\n"; $pays=$obj->libelle_pays; } } if ($selected > 0 && $selected == $obj->code) { $out.= '<option value="'.$obj->code.'" selected="selected">'; } else { $out.= '<option value="'.$obj->code.'">'; } // Si translation exists, we use it, otherwise we use default label in database $out.= $obj->code . ' - '; $out.= ($langs->trans("JuridicalStatus".$obj->code)!="JuridicalStatus".$obj->code?$langs->trans("JuridicalStatus".$obj->code):($obj->nom!='-'?$obj->nom:'')); // $obj->nom is alreay in output charset (converted by database driver) $out.= '</option>'; } $i++; } } $out.= '</select>'; if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); $out.= '</div>'; } else { dol_print_error($this->db); } return $out; }
/** * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays * * @param string $selected Preselected code of juridical type * @param int $country_codeid 0=list for all countries, otherwise list only country requested * @param string $filter Add a SQL filter on list * @return string String with HTML select */ function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '') { global $conf, $langs, $user; $langs->load("dict"); $out = ''; // On recherche les formes juridiques actives des pays actifs $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_forme_juridique as f, " . MAIN_DB_PREFIX . "c_country as c"; $sql .= " WHERE f.fk_pays=c.rowid"; $sql .= " AND f.active = 1 AND c.active = 1"; if ($country_codeid) { $sql .= " AND c.code = '" . $country_codeid . "'"; } if ($filter) { $sql .= " " . $filter; } $sql .= " ORDER BY c.code"; dol_syslog(get_class($this) . "::select_juridicalstatus", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $out .= '<div id="particulier2" class="visible">'; $out .= '<select class="flat" name="forme_juridique_code" id="legal_form">'; if ($country_codeid) { $out .= '<option value="0"> </option>'; } $num = $this->db->num_rows($resql); if ($num) { $i = 0; $country = ''; $arraydata = array(); while ($i < $num) { $obj = $this->db->fetch_object($resql); $labelcountry = $langs->trans("Country" . $obj->country_code) != "Country" . $obj->country_code ? $langs->trans("Country" . $obj->country_code) : $obj->country; $labeljs = $langs->trans("JuridicalStatus" . $obj->code) != "JuridicalStatus" . $obj->code ? $langs->trans("JuridicalStatus" . $obj->code) : ($obj->label != '-' ? $obj->label : ''); // $obj->label is already in output charset (converted by database driver) $arraydata[$obj->code] = array('code' => $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry . '_' . $labeljs, 'country_code' => $obj->country_code, 'country' => $labelcountry); $i++; } $arraydata = dol_sort_array($arraydata, 'label_sort', 'ASC'); foreach ($arraydata as $key => $val) { if (!$country || $country != $val['country']) { // Show break when we are in multi country mode if (empty($country_codeid) && $val['country_code']) { $out .= '<option value="0">----- ' . $val['country'] . " -----</option>\n"; $country = $val['country']; } } if ($selected > 0 && $selected == $val['code']) { $out .= '<option value="' . $val['code'] . '" selected="selected">'; } else { $out .= '<option value="' . $val['code'] . '">'; } // If translation exists, we use it, otherwise we use default label in database $out .= $val['label']; $out .= '</option>'; } } $out .= '</select>'; if ($user->admin) { $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } $out .= '</div>'; } else { dol_print_error($this->db); } return $out; }
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>'; print '</table>'; print "</div>"; $var = !$var; $allowaddtarget = $object->statut == 0; // Show email selectors if ($allowaddtarget && $user->rights->mailing->creer) { print load_fiche_titre($langs->trans("ToAddRecipientsChooseHere"), $user->admin ? info_admin($langs->trans("YouCanAddYourOwnPredefindedListHere"), 1) : '', ''); print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td class="liste_titre">' . $langs->trans("RecipientSelectionModules") . '</td>'; print '<td class="liste_titre" align="center">' . $langs->trans("NbOfUniqueEMails") . '</td>'; print '<td class="liste_titre" align="left">' . $langs->trans("Filter") . '</td>'; print '<td class="liste_titre" align="center"> </td>'; print "</tr>\n"; clearstatcache(); $var = true; foreach ($modulesdir as $dir) { $modulenames = array(); // Load modules attributes in arrays (name, numero, orders) from dir directory //print $dir."\n<br>"; dol_syslog("Scan directory " . $dir . " for modules"); $handle = @opendir($dir);
$message = info_admin($langs->trans("ConfFileMuseContainCustom", DOL_DOCUMENT_ROOT . '/custom', DOL_DOCUMENT_ROOT)); $allowfromweb = -1; } else { if ($dirins_ok) { if (!is_writable(dol_osencode($dirins))) { $langs->load("errors"); $message = info_admin($langs->trans("ErrorFailedToWriteInDir", $dirins)); $allowfromweb = 0; } } else { $message = info_admin($langs->trans("NotExistsDirect", $dirins) . $langs->trans("InfDirAlt") . $langs->trans("InfDirExample")); $allowfromweb = 0; } } } else { $message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot . '/installmodules.lock')); $allowfromweb = 0; } print $langs->trans("AddExtensionThemeModuleOrOther") . '<br>'; print '<hr>'; if ($allowfromweb < 1) { print $langs->trans("SomethingMakeInstallFromWebNotPossible"); print $message; //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); print '<br>'; } if ($allowfromweb >= 0) { if ($allowfromweb == 1) { print $langs->trans("ThisIsProcessToFollow") . '<br>'; } else { print $langs->trans("ThisIsAlternativeProcessToFollow") . '<br>';
/** * Return list of social contributions. * Use mysoc->country_id or mysoc->country_code so they must be defined. * * @param string $selected Preselected type * @param string $htmlname Name of field in form * @param int $useempty Set to 1 if we want an empty value * @param int $maxlen Max length of text in combo box * @param int $help Add or not the admin help picto * @return void */ function select_type_socialcontrib($selected = '', $htmlname = 'actioncode', $useempty = 0, $maxlen = 40, $help = 1) { global $db, $langs, $user, $mysoc; if (empty($mysoc->country_id) && empty($mysoc->country_code)) { dol_print_error('', 'Call to select_type_socialcontrib with mysoc country not yet defined'); exit; } if (!empty($mysoc->country_id)) { $sql = "SELECT c.id, c.libelle as type"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales as c"; $sql .= " WHERE c.active = 1"; $sql .= " AND c.fk_pays = " . $mysoc->country_id; $sql .= " ORDER BY c.libelle ASC"; } else { $sql = "SELECT c.id, c.libelle as type"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales as c, " . MAIN_DB_PREFIX . "c_country as co"; $sql .= " WHERE c.active = 1 AND c.fk_pays = co.rowid"; $sql .= " AND co.code = '" . $mysoc->country_code . "'"; $sql .= " ORDER BY c.libelle ASC"; } dol_syslog("Form::select_type_socialcontrib", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); if ($num) { print '<select class="flat" name="' . $htmlname . '">'; $i = 0; if ($useempty) { print '<option value="0"> </option>'; } while ($i < $num) { $obj = $db->fetch_object($resql); print '<option value="' . $obj->id . '"'; if ($obj->id == $selected) { print ' selected="selected"'; } print '>' . dol_trunc($obj->type, $maxlen); $i++; } print '</select>'; if ($user->admin && $help) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } } else { print $langs->trans("ErrorNoSocialContributionForSellerCountry", $mysoc->country_code); } } else { dol_print_error($db, $db->lasterror()); } }
print "<tr {$bc['1']}><td>" . $langs->trans("PhpWebLink") . "</td><td>" . php_sapi_name() . "</td></tr>\n"; print '</table>'; print "<br>\n"; // Database print '<table class="noborder" width="100%">'; print "<tr class=\"liste_titre\"><td colspan=\"2\">" . $langs->trans("Database") . "</td></tr>\n"; $dblabel = $db::LABEL; $dbversion = $db->getVersion(); print "<tr {$bc['0']}><td width=\"280\">" . $langs->trans("Version") . "</td><td>" . $dblabel . " " . $dbversion . "</td></tr>\n"; print '</table>'; // Add checks on database options if ($db->type == 'pgsql') { // Check option standard_conforming_strings is on $paramarray = $db->getServerParametersValues('standard_conforming_strings'); // if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1) // { // $langs->load("errors"); // } } print '<br>'; // Browser print '<table class="noborder" width="100%">'; print "<tr class=\"liste_titre\"><td colspan=\"2\">" . $langs->trans("Browser") . "</td></tr>\n"; print "<tr {$bc['0']}><td width=\"280\">" . $langs->trans("UserAgent") . "</td><td>" . $_SERVER["HTTP_USER_AGENT"] . "</td></tr>\n"; print "<tr {$bc['1']}><td width=\"280\">" . $langs->trans("Smartphone") . "</td><td>" . (empty($conf->browser->phone) ? $langs->trans("No") : $conf->browser->phone) . "</td></tr>\n"; print '</table>'; print '<br>'; //print "<br>\n"; print info_admin($langs->trans("SystemInfoDesc")) . '<br>'; llxFooter(); $db->close();
/** * 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>'; } } } }
/* * View */ llxHeader('', $langs->trans("StockSetup")); $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>'; print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup'); $form = new Form($db); $disabled = ''; if (!empty($conf->productbatch->enabled)) { $langs->load("productbatch"); $disabled = ' disabled'; print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); } //if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) //{ print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); //} // Title rule for stock decrease print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print " <td>" . $langs->trans("RuleForStockManagementDecrease") . "</td>\n"; print " <td align=\"right\" width=\"160\"> </td>\n"; print '</tr>' . "\n"; $var = true; $found = 0; $var = !$var; print "<tr " . $bc[$var] . ">"; print '<td width="60%">' . $langs->trans("DeStockOnBill") . '</td>'; print '<td width="160" align="right">'; if (!empty($conf->facture->enabled)) { print "<form method=\"post\" action=\"stock.php\">";
{ $var=true; // Language print_fiche_titre($langs->trans("Language"),'','').'<br>'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td><td> </td></tr>'; $var=!$var; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>'; $s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); print ($s?$s.' ':''); print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print '</td>'; print '<td width="20">'; if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation",$conf->global->MAIN_LANG_DEFAULT),1); print '</td>'; print "</tr>"; $var=!$var; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>'; print '<td width="20"> </td>'; print "</tr>"; print '</table><br>'."\n"; // Themes show_theme('',0); print '<br>';
print '<strong>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?amount=<em>9.99</em>&tag=<em>your_free_tag'.$token.'</em></strong>'."<br>\n"; if ($conf->commande->enabled) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':<br>'; print '<strong>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=order&ref=<em>order_ref'.$token.'</em></strong>'."<br>\n"; } if ($conf->facture->enabled) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':<br>'; print '<strong>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=invoice&ref=<em>invoice_ref'.$token.'</em></strong>'."<br>\n"; // print $langs->trans("SetupPaypalToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."<br>\n"; } if ($conf->contrat->enabled) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':<br>'; print '<strong>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=contractline&ref=<em>contractline_ref'.$token.'</em></strong>'."<br>\n"; } if ($conf->adherent->enabled) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':<br>'; print '<strong>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=membersubscription&ref=<em>member_ref'.$token.'</em></strong>'."<br>\n"; } print "<br>"; print info_admin($langs->trans("YouCanAddTagOnUrl")); $db->close(); llxFooter('$Date: 2011/07/31 23:24:25 $ - $Revision: 1.23 $'); ?>
print '</td>'; print '</tr>'; // Nom print '<tr><td width="25%" valign="top">' . $langs->trans("Name") . '</td>'; print '<td colspan="2">' . $fgroup->name . ''; if (!$fgroup->entity) { print img_picto($langs->trans("GlobalGroup"), 'redstar'); } print "</td></tr>\n"; // Note print '<tr><td width="25%" valign="top">' . $langs->trans("Note") . '</td>'; print '<td class="valeur">' . dol_htmlentitiesbr($fgroup->note) . '</td>'; print "</tr>\n"; print '</table><br>'; if ($user->admin) { print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules")); } print '<table width="100%" class="noborder">'; print '<tr class="liste_titre">'; print '<td>' . $langs->trans("Module") . '</td>'; if ($caneditperms) { print '<td width="24"> </td>'; } print '<td align="center" width="24"> </td>'; print '<td>' . $langs->trans("Permissions") . '</td>'; print '</tr>'; $sql = "SELECT r.id, r.libelle, r.module"; $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def as r"; $sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" if (!empty($conf->multicompany->enabled)) {
print '<td align="center" width="100">'; if ($conf->global->MAIN_SUBMODULE_EXPEDITION == 0) { print '<a href="confexped.php?action=activate_sending">' . img_picto($langs->trans("Disabled"), 'off') . '</a>'; } else { if ($conf->global->MAIN_SUBMODULE_EXPEDITION == 1) { print '<a href="confexped.php?action=disable_sending">' . img_picto($langs->trans("Enabled"), 'on') . '</a>'; } } print "</td>"; print '</tr>'; // Bon de livraison activation/desactivation $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td>' . $langs->trans("DeliveriesOrderAbility") . '</td>'; print '<td align="center" width="20">'; print '</td>'; print '<td align="center" width="100">'; if ($conf->global->MAIN_SUBMODULE_LIVRAISON == 0) { print '<a href="confexped.php?action=activate_delivery">' . img_picto($langs->trans("Disabled"), 'off') . '</a>'; } else { if ($conf->global->MAIN_SUBMODULE_LIVRAISON == 1) { print '<a href="confexped.php?action=disable_delivery">' . img_picto($langs->trans("Enabled"), 'on') . '</a>'; } } print "</td>"; print '</tr>'; print '</table>'; print '</div>'; print info_admin($langs->trans("NoNeedForDeliveryReceipts")); $db->close(); llxFooter();
$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 width="20%">' . $langs->trans("Status") . '</td><td colspan="3">'; print '<select name="statut" class="flat">'; print '<option value="0" ' . ($object->statut == 0 ? 'selected="selected"' : '') . '>' . $langs->trans("WarehouseClosed") . '</option>'; print '<option value="1" ' . ($object->statut == 0 ? '' : 'selected="selected"') . '>' . $langs->trans("WarehouseOpened") . '</option>'; print '</select>'; print '</td></tr>'; print '</table>'; print '<center><br><input type="submit" class="button" value="' . $langs->trans("Save") . '"> '; print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></center>'; print '</form>'; } } }
$var=!$var; print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'</td>'; print '<td>'.$conf->global->MAIN_MAIL_AUTOCOPY_TO; if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && ! isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); print '</td></tr>'; print '</table>'; if ($linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { $sendmailoption=ini_get('mail.force_extra_parameters'); //print 'x'.$sendmailoption; if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) { print '<br>'.info_admin($langs->trans("SendmailOptionNotComplete")); } } // Boutons actions print '<div class="tabsAction">'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>'; if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || ! $linuxlike) { if (function_exists('fsockopen') && $port && $server) { print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>'; }