dol_delete_file($logosmallfile); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $conf->entity); $mysoc->logo_small = ''; $logominifile = $conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_mini; dol_delete_file($logominifile); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $conf->entity); $mysoc->logo_mini = ''; } /* * View */ $wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('', $langs->trans("Setup"), $wikihelp); $form = new Form($db); $formother = new FormOther($db); $formcompany = new FormCompany($db); $countrynotdefined = '<font class="error">' . $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')</font>'; print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); print $langs->trans("CompanyFundationDesc") . "<br>\n"; print "<br>\n"; if ($action == 'edit' || $action == 'updateedit') { /** * Edition des parametres */ print "\n" . '<script type="text/javascript" language="javascript">'; print '$(document).ready(function () { $("#selectcountry_id").change(function() { document.form_index.action.value="updateedit"; document.form_index.submit(); }); });';
// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. if ($action == 'added') { llxHeaderVierge($langs->trans("NewMemberForm")); // Si on a pas ete redirige print '<br>'; print '<center>'; print $langs->trans("NewMemberbyWeb"); print '</center>'; llxFooterVierge(); exit; } /* * View */ $form = new Form($db); $formcompany = new FormCompany($db); $adht = new AdherentType($db); $extrafields->fetch_name_optionals_label('adherent'); // fetch optionals attributes and labels llxHeaderVierge($langs->trans("NewSubscription")); print_titre($langs->trans("NewSubscription")); if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) { print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT) . "<br>\n"; } else { print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL) . "<br>\n"; } dol_htmloutput_errors($errmsg); print '<div align="center">'; print '<br>' . $langs->trans("FieldsWithAreMandatory", '*') . '<br>'; //print $langs->trans("FieldsWithIsForPublic",'**').'<br>'; print '<script type="text/javascript">
$mesg = '<div class="error">' . $object->error . '</div>'; } } else { $action = 'edit'; $mesg = '<div class="error">' . $object->error . '</div>'; } } if ($_POST["cancel"] == $langs->trans("Cancel")) { $action = ''; } /* * View */ $productstatic = new Product($db); $form = new Form($db); $formcompany = new FormCompany($db); $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("", $langs->trans("WarehouseCard"), $help_url); if ($action == 'create') { print_fiche_titre($langs->trans("NewWarehouse")); print "<form action=\"fiche.php\" method=\"post\">\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="type" value="' . $type . '">' . "\n"; dol_htmloutput_mesg($mesg); print '<table class="border" width="100%">'; // Ref print '<tr><td width="25%" class="fieldrequired">' . $langs->trans("Ref") . '</td><td colspan="3"><input name="libelle" size="20" value=""></td></tr>'; print '<tr><td >' . $langs->trans("LocationSummary") . '</td><td colspan="3"><input name="lieu" size="40" value="' . $object->lieu . '"></td></tr>'; // Description print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td colspan="3">';
if (!$error) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); // Redirect to avoid submit twice on back header('Location: ' . $_SERVER["PHP_SELF"] . ($projectid ? '?id=' . $projectid : '?') . ($mode ? '&mode=' . $mode : '') . '&year=' . $yearofday . '&month=' . $monthofday . '&day=' . $dayofday); exit; } } else { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); } } /* * View */ $form = new Form($db); $formother = new FormOther($db); $formcompany = new FormCompany($db); $formproject = new FormProjets($db); $projectstatic = new Project($db); $project = new Project($db); $taskstatic = new Task($db); $prev = dol_getdate($daytoparse - 24 * 3600); $prev_year = $prev['year']; $prev_month = $prev['mon']; $prev_day = $prev['mday']; $next = dol_getdate($daytoparse + 24 * 3600); $next_year = $next['year']; $next_month = $next['mon']; $next_day = $next['mday']; $title = $langs->trans("TimeSpent"); if ($mine) { $title = $langs->trans("MyTimeSpent");
/** * Show fields in insert/edit mode * * @param array $fieldlist Array of fields * @param Object $obj If we show a particular record, obj is filled with record fields * @param string $tabname Name of SQL table * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf, $langs, $db; global $form; global $region_id; global $elementList, $sourceList, $localtax_typeList; global $bc; $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); foreach ($fieldlist as $field => $value) { if ($fieldlist[$field] == 'country') { if (in_array('region_id', $fieldlist)) { print '<td>'; //print join(',',$fieldlist); print '</td>'; continue; } // For state page, we do not show the country input (we link to region, not country) print '<td>'; $fieldname = 'country'; print $form->select_country(!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : ''), $fieldname, '', 28, 'maxwidth300'); print '</td>'; } elseif ($fieldlist[$field] == 'country_id') { if (!in_array('country', $fieldlist)) { $country_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0; print '<td>'; print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $country_id . '">'; print '</td>'; } } elseif ($fieldlist[$field] == 'region') { print '<td>'; $formcompany->select_region($region_id, 'region'); print '</td>'; } elseif ($fieldlist[$field] == 'region_id') { $region_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0; print '<td>'; print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">'; print '</td>'; } elseif ($fieldlist[$field] == 'lang') { print '<td>'; print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print '</td>'; } elseif ($fieldlist[$field] == 'type_template') { print '<td>'; print $form->selectarray('type_template', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : ''); print '</td>'; } elseif ($fieldlist[$field] == 'element') { print '<td>'; print $form->selectarray('element', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : ''); print '</td>'; } elseif ($fieldlist[$field] == 'source') { print '<td>'; print $form->selectarray('source', $sourceList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : ''); print '</td>'; } elseif ($fieldlist[$field] == 'type' && $tabname == 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' || $fieldlist[$field] == 'deductible') { print '<td>'; print $form->selectyesno($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 1); print '</td>'; } elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) { $align = "left"; if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) { $align = "right"; } // Fields aligned on right print '<td align="' . $align . '">'; print '<input type="text" class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="3" name="' . $fieldlist[$field] . '">'; print '</td>'; } elseif (in_array($fieldlist[$field], array('libelle_facture'))) { print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '</textarea></td>'; } elseif (in_array($fieldlist[$field], array('content'))) { if ($tabname == MAIN_DB_PREFIX . 'c_email_templates') { print '<td colspan="4"></td></tr><tr class="pair nohover"><td colspan="5">'; // To create an artificial CR for the current tr we are on } else { print '<td>'; } if ($context != 'hide') { //print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea>'; $doleditor = new DolEditor($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', '', 140, 'dolibarr_mailings', 'In', 0, false, true, ROWS_5, '90%'); print $doleditor->Create(1); } else { print ' '; } print '</td>'; } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) { print '<td><input type="text" class="flat" value="' . price(!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="8" name="' . $fieldlist[$field] . '"></td>'; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist}[$field])) { print '<td><input type="text" class="flat" value="' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="10" name="' . $fieldlist[$field] . '"></td>'; } elseif ($fieldlist[$field] == 'unit') { print '<td>'; $units = array('mm' => $langs->trans('SizeUnitmm'), 'cm' => $langs->trans('SizeUnitcm'), 'point' => $langs->trans('SizeUnitpoint'), 'inch' => $langs->trans('SizeUnitinch')); print $form->selectarray('unit', $units, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 0, 0, 0); print '</td>'; } elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type') { print '<td align="center">'; print $form->selectarray($fieldlist[$field], $localtax_typeList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : ''); print '</td>'; } else { print '<td>'; $size = ''; if ($fieldlist[$field] == 'code') { $size = 'size="8" '; } if ($fieldlist[$field] == 'position') { $size = 'size="4" '; } if ($fieldlist[$field] == 'libelle') { $size = 'size="32" '; } if ($fieldlist[$field] == 'tracking') { $size = 'size="92" '; } if ($fieldlist[$field] == 'accountancy_code') { $size = 'size="10" '; } if ($fieldlist[$field] == 'accountancy_code_sell') { $size = 'size="10" '; } if ($fieldlist[$field] == 'accountancy_code_buy') { $size = 'size="10" '; } if ($fieldlist[$field] == 'sortorder') { $size = 'size="2" '; } print '<input type="text" ' . $size . ' class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" name="' . $fieldlist[$field] . '">'; print '</td>'; } } }
/** * \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>'; } } }
exit; } else { dol_print_error($db); } } /* * View */ llxHeader('', $langs->trans("Bill"), "Facture"); $html = new Form($db); $formcompany = new FormCompany($db); $contactstatic=new Contact($db); $userstatic=new User($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ if (isset($mesg)) print $mesg; $id = $_GET["facid"]; if ($id > 0) { $facture = new FactureFournisseur($db); if ($facture->fetch($_GET['facid'], $user->societe_id) > 0)
header("Location: ".DOL_URL_ROOT."/compta/bank/index.php"); exit; } /* * View */ $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; llxHeader(); $form = new Form($db); $htmlcompany = new FormCompany($db); /* ************************************************************************** */ /* */ /* Affichage page en mode creation */ /* */ /* ************************************************************************** */ if ($action == 'create') { $account=new Account($db); print_fiche_titre($langs->trans("NewFinancialAccount")); if ($message) { print "$message<br>\n"; }
dol_delete_file($logosmallfile); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $conf->entity); $mysoc->logo_small = ''; $logominifile = $conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_mini; dol_delete_file($logominifile); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $conf->entity); $mysoc->logo_mini = ''; } /* * View */ $wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('', $langs->trans("Setup"), $wikihelp); $form = new Form($db); $formother = new FormOther($db); $formcompany = new FormCompany($db); $countrynotdefined = '<font class="error">' . $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')</font>'; print_fiche_titre($langs->trans("CompanyFoundation"), '', 'setup'); print $langs->trans("CompanyFundationDesc") . "<br>\n"; print "<br>\n"; if ($action == 'edit' || $action == 'updateedit') { /** * Edition des parametres */ print "\n" . '<script type="text/javascript" language="javascript">'; print '$(document).ready(function () { $("#selectcountry_id").change(function() { document.form_index.action.value="updateedit"; document.form_index.submit(); }); });';
} } } if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes') { if (!count($object->errors)) { if (!$mailmanspip->add_to_spip($object)) { setEventMessages($langs->trans('AddIntoSpipError') . ': ' . $mailmanspip->error, null, 'errors'); } } } } /* * View */ $form = new Form($db); $formcompany = new FormCompany($db); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; llxHeader('', $langs->trans("Member"), $help_url); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if (empty($object->error) && $rowid) { $object = new Adherent($db); $result = $object->fetch($rowid); if ($result <= 0) { dol_print_error('', $object->error); } } $objcanvas->assign_values($action, $object->id, $object->ref);
setEventMessages($object->error, $object->errors, 'errors'); } } } else { header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $_POST['id']); exit; } } } } /* * View */ llxHeader(); $form = new Form($db); $formcompany = new FormCompany($db); /* * Action create */ if ($action == 'create') { print load_fiche_titre($langs->trans("NewEstablishment")); print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; dol_fiche_head(); print '<table class="border" width="100%">'; // Name print '<tr><td>' . fieldLabel('Name', 'name', 1) . '</td><td><input name="name" id="name" size="32" value="' . GETPOST("name") . '"></td></tr>'; // Address print '<tr>'; print '<td>' . fieldLabel('Address', 'address', 0) . '</td>';
if ($action == 'setoutstanding_limit') { $object->fetch($id); $object->outstanding_limit = GETPOST('outstanding_limit'); $result = $object->set_OutstandingBill($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } } /* * View */ $contactstatic = new Contact($db); $userstatic = new User($db); $form = new Form($db); $formcompany = new FormCompany($db); if ($id > 0 && empty($object->id)) { // Load data of third party $res = $object->fetch($id); if ($object->id <= 0) { dol_print_error($db, $object->error); } } $title = $langs->trans("CustomerCard"); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->name; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); /* if ($mode == 'search')
/* * View */ // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('company'); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ThirdParty"),$help_url); $form = new Form($db); $formfile = new FormFile($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if ($action == 'create') { $objcanvas->assign_post(); // TODO: Put code of assign_post into assign_values to keep only assign_values $objcanvas->assign_values($action); // Set value for templates $objcanvas->display_canvas($action,0); // Show template } elseif ($action == 'edit')
$object->old_name = ''; $object->old_firstname = ''; } else { $error = $object->error; $errors = $object->errors; } } } } /* * View */ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $langs->trans("ContactsAddresses"), $help_url); $form = new Form($db); $formcompany = new FormCompany($db); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; if ($socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($socid); } if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if ($action == 'create') { $objcanvas->assign_post(); // TODO: Put code of assign_post into assign_values to keep only assign_values $objcanvas->assign_values($action); // Set value for templates $objcanvas->display_canvas($action);
exit; } else { dol_print_error($db); } } /* * View */ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'); $html = new Form($db); $formcompany = new FormCompany($db); $contactstatic=new Contact($db); $userstatic=new User($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ if (isset($mesg)) print $mesg; $id = $_GET['id']; $ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) {
$error=$object->error; $errors=$object->errors; } } } } /* * View */ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ContactsAddresses"),$help_url); $form = new Form($db); $formcompany = new FormCompany($db); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; if ($socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($socid); } if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if ($action == 'create')
// always display active thirdparty first /* * View */ /* REM: Rules on permissions to see thirdparties Internal or External user + No permission to see customers => See nothing Internal user socid=0 + Permission to see ALL customers => See all thirdparties Internal user socid=0 + No permission to see ALL customers => See only thirdparties linked to user that are sale representative External user socid=x + Permission to see ALL customers => Can see only himself External user socid=x + No permission to see ALL customers => Can see only himself */ $form = new Form($db); $formother = new FormOther($db); $companystatic = new Societe($db); $formcompany = new FormCompany($db); $prospectstatic = new Client($db); $prospectstatic->client = 2; $prospectstatic->loadCacheOfProspStatus(); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $langs->trans("ThirdParty"), $help_url); $title = $langs->trans("ListOfThirdParties"); if ($type == 'c' && (empty($search_type) || $search_type == '1,3')) { $title = $langs->trans("ListOfCustomers"); } if ($type == 'p' && (empty($search_type) || $search_type == '2,3')) { $title = $langs->trans("ListOfProspects"); } if ($type == 'f' && (empty($search_type) || $search_type == '4')) { $title = $langs->trans("ListOfSuppliers"); }
else { dol_print_error($db); } } /* * View */ $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader('', $langs->trans("Project"), $help_url); $form = new Form($db); $formcompany= new FormCompany($db); $contactstatic=new Contact($db); $userstatic=new User($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ dol_htmloutput_mesg($mesg); if ($id > 0 || ! empty($ref)) { if ( $project->fetch($id,$ref) > 0) {
} } if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer) { // Delete $account = new Account($db); $account->fetch($_GET["id"]); $account->delete(); header("Location: " . DOL_URL_ROOT . "/compta/bank/index.php"); exit; } /* * View */ $form = new Form($db); $formbank = new FormBank($db); $formcompany = new FormCompany($db); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; llxHeader(); // Creation if ($action == 'create') { $account = new Account($db); print load_fiche_titre($langs->trans("NewFinancialAccount"), '', 'title_bank.png'); if ($conf->use_javascript_ajax) { print "\n" . '<script type="text/javascript" language="javascript">'; print 'jQuery(document).ready(function () { jQuery("#selecttype").change(function() { document.formsoc.action.value="create"; document.formsoc.submit(); }); jQuery("#selectaccount_country_id").change(function() { document.formsoc.action.value="create";
//header('Cache-Control: Public, must-revalidate'); //header('Pragma: public'); //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header. top_httphead(); //print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n"; dol_syslog("GET is ".join(',',$_GET)); //var_dump($_GET); // Generation of list of zip-town if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) { $return_arr = array(); $formcompany = new FormCompany($db); // Define filter on text typed $zipcode = $_GET['zipcode']?$_GET['zipcode']:''; $town = $_GET['town']?$_GET['town']:''; if ($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY) // Use zip-town table { $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; $sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country"; $sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county"; $sql.= " FROM (".MAIN_DB_PREFIX."c_ziptown as z,".MAIN_DB_PREFIX."c_pays as p)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region"; $sql.= " WHERE z.fk_pays = p.rowid"; $sql.= " AND z.active = 1 AND p.active = 1";
print '<td>'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '</td>'; print '<td>'.$langs->trans('MARGIN_METHODE_FOR_DISCOUNT_DETAILS').'</td>'; print '</tr>'; print '</form>'; // INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT $var=!$var; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print "<input type=\"hidden\" name=\"action\" value=\"contact\">"; print '<tr '.$bc[$var].'>'; print '<td>'.$langs->trans("AgentContactType").'</td>'; print '<td align="left">'; $formcompany = new FormCompany($db); $facture = new Facture($db); print $formcompany->selectTypeContact($facture, $conf->global->AGENT_CONTACT_TYPE, "AGENT_CONTACT_TYPE","internal","code",1); print '</td>'; print '<td>'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '</td>'; print '<td>'.$langs->trans('AgentContactTypeDetails').'</td>'; print '</tr>'; print '</form>'; print '</table>'; dol_fiche_end(); print '<br>';
print '<center>'; print $langs->trans("NewMemberbyWeb"); print '</center>'; llxFooterVierge('$Date: 2011/07/31 23:23:21 $ - $Revision: 1.43 $'); exit; } /* * View */ $html = new Form($db); $formcompany = new FormCompany($db); $adht = new AdherentType($db); $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label('member'); // fetch optionals attributes and labels llxHeaderVierge($langs->trans("NewSubscription")); print_titre($langs->trans("NewSubscription")); if (! empty($conf->global->MEMBER_NEWFORM_TEXT)) print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT)."<br>\n"; else print $langs->trans("NewSubscriptionDesc",$conf->global->MAIN_INFO_SOCIETE_MAIL)."<br>\n"; dol_htmloutput_errors($errmsg); print '<br>'.$langs->trans("FieldsWithAreMandatory",'*').'<br>';
else { dol_print_error($db); } } /* * View */ $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader('', $langs->trans("Project"), $help_url); $html = new Form($db); $formcompany= new FormCompany($db); $contactstatic=new Contact($db); $userstatic=new User($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ if (isset($mesg)) print $mesg; $id = $_GET['id']; $ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) {
if ($projectstatic->fetch(0, $project_ref) > 0) { $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0); if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; } else { header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); exit; } } } /* * View */ llxHeader('', $langs->trans("Task")); $form = new Form($db); $formcompany = new FormCompany($db); $contactstatic = new Contact($db); $userstatic = new User($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ if ($id > 0 || !empty($ref)) { if ($object->fetch($id, $ref) > 0) { $id = $object->id; // So when doing a search from ref, id is also set correctly. $result = $projectstatic->fetch($object->fk_project); if (!empty($projectstatic->socid)) { $projectstatic->fetch_thirdparty(); }
$outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } $result = don_create($db, $object->id, '', $object->modelpdf, $outputlangs); if ($result <= 0) { dol_print_error($db, $result); exit; } } /* * View */ llxHeader('', $langs->trans("Donations"), 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones'); $form = new Form($db); $formfile = new FormFile($db); $formcompany = new FormCompany($db); /* ************************************************************************** */ /* */ /* Creation */ /* */ /* ************************************************************************** */ if ($action == 'create') { print_fiche_titre($langs->trans("AddDonation")); dol_htmloutput_errors($mesg, $mesgs); print '<form name="add" action="fiche.php" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<table class="border" width="100%">'; print '<input type="hidden" name="action" value="add">'; $nbrows = 11; if (!empty($conf->projet->enabled)) { $nbrows++;
} else { setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } } } } } /* * View */ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $langs->trans("ThirdParty"), $help_url); $form = new Form($db); $formfile = new FormFile($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if (empty($object->error) && $socid) { $object = new Societe($db); $result = $object->fetch($socid); if ($result <= 0) { dol_print_error('', $object->error); } } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action);
/* * View */ // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('company'); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ThirdParty"),$help_url); $form = new Form($db); $formfile = new FormFile($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if (empty($object->error) && $socid) { $object = new Societe($db); $object->load($socid); } $objcanvas->assign_values($action, $socid); // Set value for templates
$action = 'view'; } else { setEventMessage($object->error, 'errors'); setEventMessage($object->errors, 'errors'); $action = 'edit'; } } } } /* * View */ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $langs->trans("ContactsAddresses"), $help_url); $form = new Form($db); $formcompany = new FormCompany($db); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; if ($socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($socid); } if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- if (empty($object->error) && $id) { $object = new Contact($db); $result = $object->fetch($id); if ($result <= 0) { dol_print_error('', $object->error); }
$permission = $user->rights->fournisseur->facture->creer; } elseif ($module == 'order_supplier') { $permission = $user->rights->fournisseur->commande->creer; } elseif ($module == 'project') { $permission = $user->rights->projet->creer; } elseif ($module == 'action') { $permission = $user->rights->agenda->myactions->create; } elseif ($module == 'shipping') { $permission = $user->rights->expedition->creer; } elseif ($module == 'project_task') { $permission = $user->rights->projet->creer; } elseif (!isset($permission)) { $permission = $user->rights->{$module}->creer; } // If already defined by caller page $formcompany = new FormCompany($db); $companystatic = new Societe($db); $contactstatic = new Contact($db); $userstatic = new User($db); ?> <!-- BEGIN PHP TEMPLATE CONTACTS --> <div class="tagtable centpercent noborder allwidth"> <?php if ($permission) { ?> <form class="tagtr liste_titre"> <div class="tagtd"><?php echo $langs->trans("Source"); ?>
if ($action == 'setaddress' && $user->rights->expedition->creer) { $object->fetch($id); $result = $object->setDeliveryAddress($_POST['fk_address']); if ($result < 0) { dol_print_error($db, $object->error); } } } } } /* * View */ llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:expeditions_Clients|ES:Pedidos de clientes'); $form = new Form($db); $formcompany = new FormCompany($db); $formother = new FormOther($db); $contactstatic = new Contact($db); $userstatic = new User($db); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ dol_htmloutput_mesg($mesg); if ($id > 0 || !empty($ref)) { $langs->trans("OrderCard"); $soc = new Societe($db); $soc->fetch($object->socid); $head = shipping_prepare_head($object); dol_fiche_head($head, 'contact', $langs->trans("Sending"), 0, 'sending');