function grapefruitGetTasksForProject($name = 'fk_task', $socid = -1, $showempty = 1, $projectid = 0) { global $db; dol_include_once('/core/class/html.form.class.php'); $form = new Form($db); $TTask = getTaskByProjectId($projectid); $return = array(); $return['value'] = $form->selectarray('fk_task', $TTask, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100 maxwidth300', 1); echo json_encode($return); }
/** * Return list of input method (mode used to receive order, like order received by email, fax, online) * List found into table c_input_method. * * @param string $selected Id of preselected input method * @param string $htmlname Name of HTML select list * @param int $addempty 0=list with no empty value, 1=list with empty value * @return array Tableau des sources de commandes */ function selectInputMethod($selected = '', $htmlname = 'source_id', $addempty = 0) { global $conf, $langs, $form; if (!is_object($form)) { $form = new Form($this->db); } $listofmethods = array(); $sql = "SELECT rowid, code, libelle as label"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_input_method"; $sql .= " WHERE active = 1"; dol_syslog(get_class($this) . "::selectInputMethod", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $i = 0; $num = $this->db->num_rows($resql); while ($i < $num) { $obj = $this->db->fetch_object($resql); $listofmethods[$obj->rowid] = $langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : $obj->label; $i++; } } else { dol_print_error($this->db); return -1; } print $form->selectarray($htmlname, $listofmethods, $selected, $addempty); return 1; }
$moreforfilter .= '</div>'; } // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('LinkedToSpecificUsers') . ': '; $moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); $moreforfilter .= '</div>'; } // If the user can view prospects other than his' if ($conf->categorie->enabled && $user->rights->produit->lire) { include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('IncludingProductWithTag') . ': '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); $moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); $moreforfilter .= '</div>'; } if (!empty($moreforfilter)) { print '<tr class="liste_titre">'; print '<td class="liste_titre" colspan="10">'; print $moreforfilter; print '</td></tr>'; } print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('RefCustomer'), $_SERVER["PHP_SELF"], 'p.ref_client', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Company'), $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Town'), $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Date'), $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans('DateEndPropalShort'), $_SERVER["PHP_SELF"], 'dfv', '', $param, 'align="center"', $sortfield, $sortorder);
print "\n"; $s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>'; $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); } else { $s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$object->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>'; } } print $s; print '</td>'; print '</tr>'; // Type - Size print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>'."\n"; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '</td>'; print '<td>'.$langs->trans("Staff").'</td><td>'; print $form->selectarray("effectif_id",$formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '</td></tr>'; // Legal Form print '<tr><td>'.$langs->trans('JuridicalStatus').'</td>'; print '<td colspan="3">'; if ($object->country_id) { $formcompany->select_forme_juridique($object->forme_juridique_code,$object->country_code); } else
$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> '; print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { jQuery("#typedeposit, #valuedeposit").click(function() { jQuery("#radio_deposit").prop("checked", true); }); }); </script>'; $desc = $form->textwithpicto($tmp . $langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); print '<table class="nobordernopadding"><tr><td>'; print $desc; print '</td>'; if ($origin == 'propal' || $origin == 'commande') { print '<td class="nowrap" style="padding-left: 5px">'; $arraylist = array('amount' => 'FixAmount', 'variable' => 'VarAmount'); print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); print '</td>'; print '<td class="nowrap" style="padding-left: 5px">' . $langs->trans('Value') . ':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="' . GETPOST('valuedeposit', 'int') . '"/>'; } print '</td></tr></table>'; print '</div></div>'; } if ($socid > 0) { if (!empty($conf->global->INVOICE_USE_SITUATION)) { // First situation invoice print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; $tmp = '<input type="radio" name="type" value="5"' . (GETPOST('type') == 5 ? ' checked' : '') . '> '; $desc = $form->textwithpicto($tmp . $langs->trans("InvoiceFirstSituationAsk"), $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); print $desc; print '</div></div>'; // Next situation invoice
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="ventil">'; } print load_fiche_titre("Ventilation"); print '<table class="border" width="100%">'; // Ref facture print '<tr><td>' . $langs->trans("Invoice") . '</td>'; $facture_static->ref = $objp->facnumber; $facture_static->id = $objp->facid; print '<td>' . $facture_static->getNomUrl(1) . '</td>'; print '</tr>'; print '<tr><td width="20%">Ligne</td>'; print '<td>' . nl2br($objp->description) . '</td></tr>'; print '<tr><td width="20%">Ventiler dans le compte :</td><td>'; if ($objp->fk_code_ventilation == 0) { print $form->selectarray("codeventil", $cgs, $objp->fk_code_ventilation); } else { print $cgs[$objp->fk_code_ventilation]; } print '</td></tr>'; if ($objp->fk_code_ventilation == 0) { print '<tr><td> </td><td><input type="submit" class="button" value="' . $langs->trans("Ventiler") . '"></td></tr>'; } print '</table>'; print '</form>'; } else { print "Error"; } } else { print "Error"; }
print '<input type="hidden" name="entity" value="' . $entity . '" />'; print '<input type="hidden" name="action" value="add" />'; print '<div id="divsubscribe">'; print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n"; // Type if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { $listoftype = $adht->liste_array(); $tmp = array_keys($listoftype); $defaulttype = ''; $isempty = 1; if (count($listoftype) == 1) { $defaulttype = $tmp[0]; $isempty = 0; } print '<tr><td width="15%">' . $langs->trans("Type") . ' <FONT COLOR="red">*</FONT></td><td width="35%">'; print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ? GETPOST('type') : $defaulttype, $isempty); print '</td></tr>' . "\n"; } else { $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); //print $adht->libelle; print '<input type="hidden" id="type" name="type" value="' . $conf->global->MEMBER_NEWFORM_FORCETYPE . '">'; } // Moral/Physic attribute $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print '<tr class="morphy"><td>' . $langs->trans('Nature') . ' <FONT COLOR="red">*</FONT></td><td>' . "\n"; print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print '</td></tr>' . "\n"; } else { print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
*/ // User print '<tr><td>' . $langs->trans("User") . '</td><td>'; $include = ''; if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) { $include = 'hierarchy'; } print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '</td></tr>'; // Year print '<tr><td>' . $langs->trans("Year") . '</td><td>'; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '</td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="' . $langs->trans("Refresh") . '"></td></tr>'; print '</table>'; print '</form>'; print '<br><br>'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre" height="24">'; print '<td align="center">' . $langs->trans("Year") . '</td>'; print '<td align="center">' . $langs->trans("Number") . '</td>'; print '<td align="center">' . $langs->trans("AmountTotal") . '</td>'; print '<td align="center">' . $langs->trans("AmountAverage") . '</td>'; print '</tr>'; $oldyear = 0; foreach ($data as $val) { $year = $val['year'];
print '<td width="80%">'.$langs->trans("UseSearchToSelectCompany").'</td>'; if (! $conf->use_javascript_ajax) { print '<td nowrap="nowrap" align="right" colspan="2">'; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "</td>"; } else { print '<td width="60" align="right">'; $arrval=array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",1).')', '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",2).')', '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",3).')', ); print $html->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT",$arrval,$conf->global->COMPANY_USE_SEARCH_TO_SELECT); print '</td><td align="right">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print "</td>"; } print '</tr>'; print '</form>'; print '</table>'; dol_fiche_end(); $db->close(); llxFooter('$Date: 2011/07/31 22:23:23 $ - $Revision: 1.61 $');
print '</td></tr><tr><td>'; print $langs->trans("Width"); print ' </td><td><input name="sizeW" size="5" value="' . GETPOST('sizeW', 'int') . '"></td><td rowspan="3">'; print $formproduct->select_measuring_units("size_units", "size"); print '</td></tr><tr><td>'; print $langs->trans("Height"); print '</td><td><input name="sizeH" size="5" value="' . GETPOST('sizeH', 'int') . '"></td>'; print '</tr><tr><td>'; print $langs->trans("Depth"); print '</td><td><input name="sizeS" size="5" value="' . GETPOST('sizeS', 'int') . '"></td>'; print '</tr>'; // Delivery method print "<tr><td>" . $langs->trans("DeliveryMethod") . "</td>"; print '<td colspan="3">'; $expe->fetch_delivery_methods(); print $form->selectarray("shipping_method_id", $expe->meths, GETPOST('shipping_method_id', 'int'), 1, 0, 0, "", 1); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print "</td></tr>\n"; // Tracking number print "<tr><td>" . $langs->trans("TrackingNumber") . "</td>"; print '<td colspan="3">'; print '<input name="tracking_number" size="20" value="' . GETPOST('tracking_number', 'alpha') . '">'; print "</td></tr>\n"; // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid' => $socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $expe, $action); // Note that $action and $object may have been modified by hook if (empty($reshook) && !empty($extrafields->attribute_label)) { print $expe->showOptionals($extrafields, 'edit');
print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","d.datefin",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Action"),"liste.php","",$param,"",'width="60" align="center"',$sortfield,$sortorder); print "</tr>\n"; // Lignes des champs de filtre print '<tr class="liste_titre">'; print '<td class="liste_titre" align="left">'; print '<input class="flat" type="text" name="search_nom" value="'.$_REQUEST["search_nom"].'" size="12"></td>'; print '<td class="liste_titre" align="left">'; print '<input class="flat" type="text" name="search_login" value="'.$_REQUEST["search_login"].'" size="7"></td>'; print '<td class="liste_titre">'; $listetype=$membertypestatic->liste_array(); print $form->selectarray("type", $listetype, $_REQUEST["type"], 1, 0, 0, '', 0, 12); print '</td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre" align="left">'; print '<input class="flat" type="text" name="search_email" value="'.$_REQUEST["search_email"].'" size="12"></td>'; print '<td class="liste_titre"> </td>'; print '<td align="right" colspan="2" class="liste_titre">'; print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print ' '; print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>';
print "<br>"; print_titre($langs->trans('NewAttribute')); print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<table summary="listofattributes" class="border" width="100%">'; print '<input type="hidden" name="action" value="add">'; // Label print '<tr><td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.GETPOST('label').'"></td></tr>'; // Code print '<tr><td class="fieldrequired" required>'.$langs->trans("AttributeCode").' ('.$langs->trans("AlphaNumOnlyCharsAndNoSpace").')</td><td class="valeur"><input type="text" name="attrname" size="10" value"'.GETPOST('attrname').'"></td></tr>'; // Type print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td><td class="valeur">'; print $form->selectarray('type',$type2label,GETPOST('type')); print '</td></tr>'; // Size print '<tr><td class="fieldrequired" required>'.$langs->trans("Size").'</td><td><input type="text" name="size" size="5" value="'.(GETPOST('size')?GETPOST('size'):'255').'"></td></tr>'; print '<tr><td colspan="2" align="center"><input type="submit" name="button" class="button" value="'.$langs->trans("Save").'"> '; print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></td></tr>'; print "</form>\n"; print "</table>\n"; } /* ************************************************************************** */ /* */ /* Edition d'un champ optionnel */ /* */ /* ************************************************************************** */
$default_vat = $object->tva_tx; } } print '<input type="text" class="flat" size="5" name="tva_tx" value="' . (GETPOST("tva_tx") ? vatrate(GETPOST("tva_tx")) : ($default_vat != '' ? vatrate($default_vat) : '')) . '">'; print '</td></tr>'; if (!empty($conf->dynamicprices->enabled)) { // Price mode selector print '<tr><td class="fieldrequired">' . $langs->trans("PriceMode") . '</td><td>'; $price_expression = new PriceExpression($db); $price_expression_list = array(0 => $langs->trans("PriceNumeric")); //Put the numeric mode as first option foreach ($price_expression->list_price_expression() as $entry) { $price_expression_list[$entry->id] = $entry->title; } $price_expression_preselection = GETPOST('eid') ? GETPOST('eid') : ($object->fk_supplier_price_expression ? $object->fk_supplier_price_expression : '0'); print $form->selectarray('eid', $price_expression_list, $price_expression_preselection); print ' <div id="expression_editor" class="button">' . $langs->trans("PriceExpressionEditor") . '</div>'; print '</td></tr>'; // This code hides the numeric price input if is not selected, loads the editor page if editor button is pressed print '<script type="text/javascript"> jQuery(document).ready(run); function run() { jQuery("#expression_editor").click(on_click); jQuery("#eid").change(on_change); on_change(); } function on_click() { window.location = "' . DOL_URL_ROOT . '/product/dynamic_price/editor.php?id=' . $id . '&tab=fournisseurs&eid=" + $("#eid").attr("value"); } function on_change() { if ($("#eid").attr("value") == 0) {
function _liste(&$PDOdb) { global $langs, $db, $user, $conf; llxHeader('', $langs->trans('ListOFAsset'), '', ''); //getStandartJS(); if (isset($_REQUEST['delete_ok'])) { ?> <br><div class="error"><?php echo $langs->trans('OFAssetDeleted'); ?> </div><br> <?php } $fk_soc = __get('fk_soc', 0, 'integer'); $fk_product = __get('fk_product', 0, 'integer'); $fk_commande = __get('fk_commande', 0, 'integer'); if ($fk_product > 0) { dol_include_once('/core/lib/product.lib.php'); $product = new Product($db); $result = $product->fetch($fk_product); $head = product_prepare_head($product, $user); $titre = $langs->trans("CardProduct" . $product->type); $picto = $product->type == 1 ? 'service' : 'product'; dol_fiche_head($head, 'tabOF2', $titre, 0, $picto); } elseif ($fk_commande > 0) { dol_include_once("/core/lib/order.lib.php"); $commande = new Commande($db); $result = $commande->fetch($fk_commande); $head = commande_prepare_head($commande, $user); $titre = $langs->trans("CustomerOrder" . $product->type); dol_fiche_head($head, 'tabOF3', $titre, 0, "order"); } $form = new TFormCore(); $assetOf = new TAssetOF(); $r = new TSSRenderControler($assetOf); $sql = "SELECT ofe.rowid, ofe.numero, ofe.fk_soc, s.nom as client, SUM(ofel.qty) as nb_product_to_make\n\t\t, GROUP_CONCAT(DISTINCT ofel.fk_product SEPARATOR ',') as fk_product, p.label as product, ofe.ordre, ofe.date_lancement , ofe.date_besoin, ofe.fk_commande,ofe.fk_project\n\t\t, ofe.status, ofe.fk_user,ofe.total_estimated_cost, ofe.total_cost, '' AS printTicket\n\t\t FROM " . MAIN_DB_PREFIX . "assetOf as ofe \n\t\t LEFT JOIN " . MAIN_DB_PREFIX . "assetOf_line ofel ON (ofel.fk_assetOf=ofe.rowid AND ofel.type = 'TO_MAKE')\n\t\t LEFT JOIN " . MAIN_DB_PREFIX . "product p ON (p.rowid = ofel.fk_product)\n\t\t LEFT JOIN " . MAIN_DB_PREFIX . "societe s ON (s.rowid = ofe.fk_soc)\n\t\t WHERE ofe.entity=" . $conf->entity; if ($fk_soc > 0) { $sql .= " AND ofe.fk_soc=" . $fk_soc; } if ($fk_product > 0) { $sql .= " AND ofel.fk_product=" . $fk_product; } if ($fk_commande > 0) { $sql .= " AND ofe.fk_commande=" . $fk_commande; } $sql .= " GROUP BY ofe.rowid "; // TODO je me rappelle plus pourquoi j'ai fait cette merde mais ça fait planter le tri, donc à virer. /*if($conf->global->ASSET_OF_LIST_BY_ROWID_DESC) $orderBy['ofe.rowid']='DESC'; else $orderBy['ofe.date_cre']='DESC';*/ $TMath = array(); $THide = array('rowid', 'fk_user', 'fk_product', 'fk_soc'); if ($fk_commande > 0) { $THide[] = 'fk_commande'; } if ($conf->global->OF_NB_TICKET_PER_PAGE == -1) { $THide[] = 'printTicket'; } if (empty($user->rights->of->of->price)) { $THide[] = 'total_cost'; $THide[] = 'total_estimated_cost'; } else { $TMath['total_estimated_cost'] = 'sum'; $TMath['total_cost'] = 'sum'; } if (!empty($fk_product)) { $TMath['nb_product_to_make'] = 'sum'; } $form = new TFormCore($_SERVER['PHP_SELF'], 'form', 'GET'); echo $form->hidden('action', ''); if ($fk_commande > 0) { echo $form->hidden('fk_commande', $fk_commande); } if ($fk_product > 0) { echo $form->hidden('fk_product', $fk_product); } // permet de garder le filtre produit quand on est sur l'onglet OF d'une fiche produit $r->liste($PDOdb, $sql, array('limit' => array('nbLine' => $conf->liste_limit), 'orderBy' => $orderBy, 'subQuery' => array(), 'link' => array('Utilisateur en charge' => '<a href="' . dol_buildpath('/user/card.php?id=@fk_user@', 2) . '">' . img_picto('', 'object_user.png', '', 0) . ' @val@</a>', 'numero' => '<a href="' . dol_buildpath('/of/fiche_of.php?id=@rowid@"', 2) . '>' . img_picto('', 'object_list.png', '', 0) . ' @val@</a>', 'printTicket' => '<input style=width:40px;"" type="number" value="' . (int) $conf->global->OF_NB_TICKET_PER_PAGE . '" name="printTicket[@rowid@]" min="0" />'), 'translate' => array(), 'hide' => $THide, 'type' => array('date_lancement' => 'date', 'date_besoin' => 'date', 'total_cost' => 'money', 'total_estimated_cost' => 'money', 'nb_product_to_make' => 'number'), 'math' => $TMath, 'liste' => array('titre' => $langs->trans('ListOFAsset'), 'image' => img_picto('', 'title.png', '', 0), 'picto_precedent' => img_picto('', 'back.png', '', 0), 'picto_suivant' => img_picto('', 'next.png', '', 0), 'noheader' => (int) isset($_REQUEST['fk_soc']) | (int) isset($_REQUEST['fk_product']), 'messageNothing' => "Il n'y a aucun " . $langs->trans('OFAsset') . " à afficher", 'picto_search' => img_picto('', 'search.png', '', 0)), 'title' => array('numero' => 'Numéro', 'fk_commande' => 'Commande client', 'ordre' => 'Priorité', 'date_lancement' => 'Date du lancement', 'date_besoin' => 'Date du besoin', 'status' => 'Status', 'login' => 'Utilisateur en charge', 'product' => 'Produit', 'client' => 'Client', 'nb_product_to_make' => 'Nb produits à fabriquer', 'total_cost' => 'Coût réel', 'total_estimated_cost' => 'Coût prévu', 'printTicket' => 'impression<br />étiquette', 'fk_project' => 'Projet'), 'orderBy' => array('rowid' => 'DESC'), 'eval' => array('ordre' => 'TAssetOF::ordre(@val@)', 'status' => 'TAssetOF::status(@val@)', 'product' => 'get_format_libelle_produit("@fk_product@")', 'client' => 'get_format_libelle_societe(@fk_soc@)', 'fk_commande' => 'get_format_libelle_commande(@fk_commande@)', 'fk_project' => 'get_format_libelle_projet(@fk_project@)'), 'search' => array('numero' => array('recherche' => true, 'table' => 'ofe'), 'date_lancement' => array('recherche' => 'calendars', 'table' => 'ofe'), 'date_besoin' => array('recherche' => 'calendars', 'table' => 'ofe'), 'status' => array('recherche' => TAssetOF::$TStatus, 'table' => 'ofe')))); if ($conf->global->OF_NB_TICKET_PER_PAGE != -1) { echo '<p align="right"><input class="button" type="button" onclick="$(this).closest(\'form\').find(\'input[name=action]\').val(\'printTicket\'); $(this).closest(\'form\').submit(); " name="print" value="' . $langs->trans('ofPrintTicket') . '" /></p>'; } $form->end(); // On n'affiche pas le bouton de création d'OF si on est sur la liste OF depuis l'onglet "OF" de la fiche commande if ($fk_commande) { $commande = new Commande($db); $commande->fetch($fk_commande); $r2 = new TSSRenderControler($assetOf); $sql = "SELECT c.rowid as fk_commandedet, p.rowid as rowid, p.ref as refProd, p.label as nomProd, c.qty as qteCommandee, c.description, c.product_type"; $sql .= " FROM " . MAIN_DB_PREFIX . "commandedet c LEFT JOIN " . MAIN_DB_PREFIX . "product p"; $sql .= " ON (c.fk_product = p.rowid)"; $sql .= " WHERE c.product_type IN (0,9) AND c.fk_commande = " . $fk_commande; $resql = $db->query($sql); //var_dump($db); $num = $db->num_rows($resql); print_barre_liste($langs->trans('ListOrderProducts'), $page, "liste.php", $param, $sortfield, $sortorder, '', $num); $i = 0; $form = new TFormCore($_SERVER['PHP_SELF'], 'formMakeOk', 'post'); echo $form->hidden('fk_commande', __get('fk_commande', 0, 'int')); echo $form->hidden('action', 'createOFCommande'); echo $form->hidden('fk_soc', $commande->socid); echo $form->hidden('token', $_SESSION['newtoken']); print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print_liste_field_titre("#"); print_liste_field_titre($langs->trans("Ref"), "liste_of.php", "ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), "liste_of.php", "label", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Quantité à produire"), "liste_of.php", "", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Produits à ajouter à un OF"), "liste_of.php", "", "", $param, '', $sortfield, $sortorder); print "</tr>\n"; $var = 1; $bc = array(1 => 'class="pair"', -1 => 'class="impair"'); while ($prod = $db->fetch_object($resql)) { $var = !$var; //print "<tr ".$bc[$var].">"; if ($prod->product_type == 9) { print "<tr>"; print "<td> </td>"; print "<td colspan=\"4\"><strong>"; print $prod->description; print '</strong></td>'; } else { if (empty($prod->rowid)) { // ligne libre print "<tr>"; print "<td> </td>"; print "<td colspan=\"4\">"; print $prod->description; print '</td>'; } else { print "<tr " . $bc[$var] . ">"; print "<td>" . ($i + 1) . "</td>"; print "<td>"; $p_static = new Product($db); $p_static->ref = $prod->refProd; $p_static->id = $prod->rowid; print $p_static->getNomUrl(1); print "</td>\n"; print '<td>'; print $prod->nomProd; print '</td>'; print "<td>"; print $form->texte('', 'TQuantites[' . $prod->fk_commandedet . ']', $prod->qteCommandee, 3, 255); print "</td>"; print "<td>" . $form->checkbox1('', 'TProducts[' . $prod->fk_commandedet . '][' . (int) $prod->rowid . ']', false, true, '', 'checkOF'); print "</td>"; print "</tr>\n"; $i++; } } } print '<tr class="liste_titre">'; echo '<th class="liste_titre" colspan="2"> </th><th class="liste_titre"> </th><th class="liste_titre"> </th> <th class="liste_titre"><input type="checkbox" id="checkall" checked="checked" value="1"></th> '; print '</tr>'; print "</table>"; ?> <script type="text/javascript"> $('input#checkall').change(function() { $('input.checkOF').prop('checked',$(this).is(':checked')); }); </script> <?php echo '<p align="right">' . $form->btsubmit('Créer OFs', 'subForm') . ' ' . $form->btsubmit('Créer un seul OF', 'subFormAlone') . '</p>'; $form->end(); echo '</div>'; $db->free($resql); } else { if (!empty($fk_product)) { $sql = "SELECT ofe.rowid, ofe.numero, ofe.fk_soc, s.nom as client, SUM(IF(ofel.qty>0,ofel.qty,ofel.qty_needed) ) as nb_product_needed, ofel.fk_product, p.label as product, ofe.ordre, ofe.date_lancement , ofe.date_besoin\n , ofe.status, ofe.fk_user, ofe.total_cost\n FROM " . MAIN_DB_PREFIX . "assetOf as ofe \n LEFT JOIN " . MAIN_DB_PREFIX . "assetOf_line ofel ON (ofel.fk_assetOf=ofe.rowid AND ofel.type = 'NEEDED')\n LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = ofel.fk_product\n LEFT JOIN " . MAIN_DB_PREFIX . "societe s ON s.rowid = ofe.fk_soc\n WHERE ofe.entity=" . $conf->entity . " AND ofel.fk_product=" . $fk_product . " AND ofe.status!='CLOSE'"; $sql .= " GROUP BY ofe.rowid "; if ($conf->global->ASSET_OF_LIST_BY_ROWID_DESC) { $orderBy['ofe.rowid'] = 'DESC'; } else { $orderBy['ofe.date_cre'] = 'DESC'; } $TMath = array(); $THide = array('rowid', 'fk_user', 'fk_product', 'fk_soc'); if (empty($user->rights->asset->of->price)) { $THide[] = 'total_cost'; } else { $TMath['total_cost'] = 'sum'; } $TMath['nb_product_needed'] = 'sum'; $l = new TListviewTBS('listeofproductneeded'); echo $langs->trans('ofListProductNeeded'); echo $l->render($PDOdb, $sql, array('limit' => array('nbLine' => $conf->liste_limit), 'orderBy' => $orderBy, 'subQuery' => array(), 'link' => array('Utilisateur en charge' => '<a href="' . dol_buildpath('/user/card.php?id=@fk_user@', 2) . '">' . img_picto('', 'object_user.png', '', 0) . ' @val@</a>', 'numero' => '<a href="' . dol_buildpath('/of/fiche_of.php?id=@rowid@', 2) . '">' . img_picto('', 'object_list.png', '', 0) . ' @val@</a>', 'product' => '<a href="' . dol_buildpath('/product/card.php?id=@fk_product@', 2) . '">' . img_picto('', 'object_product.png', '', 0) . ' @val@</a>', 'client' => '<a href="' . dol_buildpath('/societe/soc.php?id=@fk_soc@', 2) . '">' . img_picto('', 'object_company.png', '', 0) . ' @val@</a>'), 'translate' => array(), 'hide' => $THide, 'type' => array('date_lancement' => 'date', 'date_besoin' => 'date', 'total_cost' => 'money', 'nb_product_needed' => 'number'), 'math' => $TMath, 'liste' => array('titre' => $langs->trans('ListOFAsset'), 'image' => img_picto('', 'title.png', '', 0), 'picto_precedent' => img_picto('', 'back.png', '', 0), 'picto_suivant' => img_picto('', 'next.png', '', 0), 'noheader' => (int) isset($_REQUEST['fk_soc']) | (int) isset($_REQUEST['fk_product']), 'messa geNothing' => "Il n'y a aucun " . $langs->trans('OFAsset') . " à afficher", 'picto_search' => img_picto('', 'search.png', '', 0)), 'title' => array('numero' => 'Numéro', 'ordre' => 'Priorité', 'date_lancement' => 'Date du lancement', 'date_besoin' => 'Date du besoin', 'status' => 'Status', 'login' => 'Utilisateur en charge', 'product' => 'Produit', 'client' => 'Client', 'nb_product_needed' => 'Nb produits nécessaire', 'total_cost' => 'Coût'), 'eval' => array('ordre' => 'TAssetOF::ordre(@val@)', 'status' => 'TAssetOF::status(@val@)', 'product' => 'get_format_libelle_produit(@fk_product@)', 'client' => 'get_format_libelle_societe(@fk_soc@)'))); } echo '<div class="tabsAction">'; echo '<a id="bt_createOf" class="butAction" href="fiche_of.php?action=new' . (!empty($fk_product) ? '&fk_product=' . $fk_product : '') . '">' . $langs->trans('CreateOFAsset') . '</a>'; if ($conf->nomenclature->enabled && !empty($fk_product)) { dol_include_once('/core/class/html.form.class.php'); dol_include_once('/asset/lib/asset.lib.php'); dol_include_once('/nomenclature/class/nomenclature.class.php'); $doliForm = new Form($db); echo $doliForm->selectarray('fk_nomenclature', TNomenclature::get($PDOdb, $fk_product, true)); echo '<script type="text/javascript"> var url_create_of = $("#bt_createOf").attr("href"); $("#bt_createOf").attr("href","#"); $("#bt_createOf").click(function() { var fk_nomenclature = $("select[name=fk_nomenclature]").val(); var href = url_create_of + "&fk_nomenclature=" + fk_nomenclature; $(this).attr("href", href); }); </script>'; } echo '</div>'; } $PDOdb->close(); llxFooter(''); }
print '</td></tr><tr><td>'; print $langs->trans("Width"); print ' </td><td><input name="sizeW" size="4" value="' . $_POST["sizeW"] . '"></td><td rowspan="3">'; print $formproduct->select_measuring_units("size_units", "size"); print '</td></tr><tr><td>'; print $langs->trans("Height"); print '</td><td><input name="sizeH" size="4" value="' . $_POST["sizeH"] . '"></td>'; print '</tr><tr><td>'; print $langs->trans("Depth"); print '</td><td><input name="sizeS" size="4" value="' . $_POST["sizeS"] . '"></td>'; print '</tr>'; // Delivery method print "<tr><td>" . $langs->trans("DeliveryMethod") . "</td>"; print '<td colspan="3">'; $expe->fetch_delivery_methods(); print $html->selectarray("expedition_method_id", $expe->meths, $_POST["expedition_method_id"], 1, 0, 0, "", 1); print "</td></tr>\n"; // Tracking number print "<tr><td>" . $langs->trans("TrackingNumber") . "</td>"; print '<td colspan="3">'; print '<input name="tracking_number" size="20" value="' . $_POST["tracking_number"] . '">'; print "</td></tr>\n"; print "</table>"; /* * Lignes de commandes * */ print '<br><table class="nobordernopadding" width="100%">'; //$lines = $object->fetch_lines(1); $numAsked = sizeof($object->lines); /* Lecture des expeditions deja effectuees */
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", !empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0, 1); print "</td></tr>\n"; if (!empty($conf->paybox->enabled) || !empty($conf->paypal->enabled)) { // Jump to an online payment page $var = !$var; print '<tr ' . $bc[$var] . ' id="trpayment"><td>'; print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); print '</td><td align="right">'; $listofval = array(); if (!empty($conf->paybox->enabled)) { $listofval['paybox'] = 'Paybox'; } if (!empty($conf->paypal->enabled)) { $listofval['paypal'] = 'PayPal'; } print $form->selectarray("MEMBER_NEWFORM_PAYONLINE", $listofval, !empty($conf->global->MEMBER_NEWFORM_PAYONLINE) ? $conf->global->MEMBER_NEWFORM_PAYONLINE : '', 1); print "</td></tr>\n"; } if (!empty($conf->paybox->enabled) || !empty($conf->paypal->enabled)) { // Jump to an online payment page $var = !$var; print '<tr ' . $bc[$var] . ' id="tremail"><td>'; print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL"); print '</td><td align="right">'; print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="' . (!empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) ? $conf->global->MEMBER_PAYONLINE_SENDEMAIL : '') . '">'; print "</td></tr>\n"; } print '</table>'; dol_fiche_end(); print '<center>'; print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
} else { print $text; } print ' <a href="' . DOL_URL_ROOT . '/societe/soc.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '">' . $langs->trans("AddThirdParty") . '</a>'; print '</td></tr>'; // Status if ($status != '') { print '<tr><td>' . $langs->trans("Status") . '</td><td>'; print '<input type="hidden" name="status" value="' . $status . '">'; print $object->LibStatut($status, 4); print '</td></tr>'; } // Public print '<tr><td>' . $langs->trans("Visibility") . '</td><td>'; $array = array(0 => $langs->trans("PrivateProject"), 1 => $langs->trans("SharedProject")); print $form->selectarray('public', $array, $object->public); print '</td></tr>'; // Date start print '<tr><td>' . $langs->trans("DateStart") . '</td><td>'; print $form->select_date($date_start ? $date_start : '', 'projectstart', 0, 0, 0, '', 1, 0, 1); print '</td></tr>'; // Date end print '<tr><td>' . $langs->trans("DateEnd") . '</td><td>'; print $form->select_date($date_end ? $date_end : -1, 'projectend', 0, 0, 0, '', 1, 0, 1); print '</td></tr>'; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status print '<tr><td>' . $langs->trans("OpportunityStatus") . '</td>'; print '<td>'; print $formproject->selectOpportunityStatus('opp_status', $object->opp_status); print '</tr>';
/** * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * * @param string $addfileaction Name of action when posting file attachments * @param string $removefileaction Name of action when removing file attachments * @return string Form to show */ function get_form($addfileaction = 'addfile', $removefileaction = 'removefile') { global $conf, $langs, $user, $hookmanager, $form; if (!is_object($form)) { $form = new Form($this->db); } $langs->load("other"); $langs->load("mails"); $hookmanager->initHooks(array('formmail')); $parameters = array('addfileaction' => $addfileaction, 'removefileaction' => $removefileaction); $reshook = $hookmanager->executeHooks('getFormMail', $parameters, $this); if (!empty($reshook)) { return $hookmanager->resPrint; } else { $out = ''; // Define list of attached files $listofpaths = array(); $listofnames = array(); $listofmimes = array(); if (!empty($_SESSION["listofpaths"])) { $listofpaths = explode(';', $_SESSION["listofpaths"]); } if (!empty($_SESSION["listofnames"])) { $listofnames = explode(';', $_SESSION["listofnames"]); } if (!empty($_SESSION["listofmimes"])) { $listofmimes = explode(';', $_SESSION["listofmimes"]); } $out .= "\n<!-- Debut form mail -->\n"; if ($this->withform == 1) { $out .= '<form method="POST" name="mailform" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">' . "\n"; $out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />'; } foreach ($this->param as $key => $value) { $out .= '<input type="hidden" id="' . $key . '" name="' . $key . '" value="' . $value . '" />' . "\n"; } $out .= '<table class="border" width="100%">' . "\n"; // Substitution array if (!empty($this->withsubstit)) { $out .= '<tr><td colspan="2">'; $help = ""; foreach ($this->substit as $key => $val) { $help .= $key . ' -> ' . $langs->trans($val) . '<br>'; } $out .= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help); $out .= "</td></tr>\n"; } // From if (!empty($this->withfrom)) { if (!empty($this->withfromreadonly)) { $out .= '<input type="hidden" id="fromname" name="fromname" value="' . $this->fromname . '" />'; $out .= '<input type="hidden" id="frommail" name="frommail" value="' . $this->frommail . '" />'; $out .= '<tr><td width="180">' . $langs->trans("MailFrom") . '</td><td>'; if ($this->fromtype == 'user' && $this->fromid > 0) { $langs->load("users"); $fuser = new User($this->db); $fuser->fetch($this->fromid); $out .= $fuser->getNomUrl(1); } else { $out .= $this->fromname; } if ($this->frommail) { $out .= " <" . $this->frommail . ">"; } else { if ($this->fromtype) { $langs->load("errors"); $out .= '<font class="warning"> <' . $langs->trans("ErrorNoMailDefinedForThisUser") . '> </font>'; } } $out .= "</td></tr>\n"; $out .= "</td></tr>\n"; } else { $out .= "<tr><td>" . $langs->trans("MailFrom") . "</td><td>"; $out .= $langs->trans("Name") . ':<input type="text" id="fromname" name="fromname" size="32" value="' . $this->fromname . '" />'; $out .= ' '; $out .= $langs->trans("EMail") . ':<<input type="text" id="frommail" name="frommail" size="32" value="' . $this->frommail . '" />>'; $out .= "</td></tr>\n"; } } // Replyto if (!empty($this->withreplyto)) { if ($this->withreplytoreadonly) { $out .= '<input type="hidden" id="replyname" name="replyname" value="' . $this->replytoname . '" />'; $out .= '<input type="hidden" id="replymail" name="replymail" value="' . $this->replytomail . '" />'; $out .= "<tr><td>" . $langs->trans("MailReply") . "</td><td>" . $this->replytoname . ($this->replytomail ? " <" . $this->replytomail . ">" : ""); $out .= "</td></tr>\n"; } } // Errorsto if (!empty($this->witherrorsto)) { //if (! $this->errorstomail) $this->errorstomail=$this->frommail; $errorstomail = !empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail; if ($this->witherrorstoreadonly) { $out .= '<input type="hidden" id="errorstomail" name="errorstomail" value="' . $errorstomail . '" />'; $out .= '<tr><td>' . $langs->trans("MailErrorsTo") . '</td><td>'; $out .= $errorstomail; $out .= "</td></tr>\n"; } else { $out .= '<tr><td>' . $langs->trans("MailErrorsTo") . '</td><td>'; $out .= '<input size="30" id="errorstomail" name="errorstomail" value="' . $errorstomail . '" />'; $out .= "</td></tr>\n"; } } // To if (!empty($this->withto) || is_array($this->withto)) { $out .= '<tr><td width="180">'; if ($this->withtofree) { $out .= $form->textwithpicto($langs->trans("MailTo"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); } else { $out .= $langs->trans("MailTo"); } $out .= '</td><td>'; if ($this->withtoreadonly) { if (!empty($this->toname) && !empty($this->tomail)) { $out .= '<input type="hidden" id="toname" name="toname" value="' . $this->toname . '" />'; $out .= '<input type="hidden" id="tomail" name="tomail" value="' . $this->tomail . '" />'; if ($this->totype == 'thirdparty') { $soc = new Societe($this->db); $soc->fetch($this->toid); $out .= $soc->getNomUrl(1); } else { if ($this->totype == 'contact') { $contact = new Contact($this->db); $contact->fetch($this->toid); $out .= $contact->getNomUrl(1); } else { $out .= $this->toname; } } $out .= ' <' . $this->tomail . '>'; if ($this->withtofree) { $out .= '<br>' . $langs->trans("or") . ' <input size="' . (is_array($this->withto) ? "30" : "60") . '" id="sendto" name="sendto" value="' . (!is_array($this->withto) && !is_numeric($this->withto) ? isset($_REQUEST["sendto"]) ? $_REQUEST["sendto"] : $this->withto : "") . '" />'; } } else { $out .= !is_array($this->withto) && !is_numeric($this->withto) ? $this->withto : ""; } } else { if (!empty($this->withtofree)) { $out .= '<input size="' . (is_array($this->withto) ? "30" : "60") . '" id="sendto" name="sendto" value="' . (!is_array($this->withto) && !is_numeric($this->withto) ? isset($_REQUEST["sendto"]) ? $_REQUEST["sendto"] : $this->withto : "") . '" />'; } if (!empty($this->withto) && is_array($this->withto)) { if (!empty($this->withtofree)) { $out .= " " . $langs->trans("or") . " "; } $out .= $form->selectarray("receiver", $this->withto, GETPOST("receiver"), 1); } if (isset($this->withtosocid) && $this->withtosocid > 0) { $liste = array(); $soc = new Societe($this->db); $soc->fetch($this->withtosocid); foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) { $liste[$key] = $value; } if ($this->withtofree) { $out .= " " . $langs->trans("or") . " "; } $out .= $form->selectarray("receiver", $liste, GETPOST("receiver"), 1); } } $out .= "</td></tr>\n"; } // CC if (!empty($this->withtocc) || is_array($this->withtocc)) { $out .= '<tr><td width="180">'; $out .= $form->textwithpicto($langs->trans("MailCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); $out .= '</td><td>'; if ($this->withtoccreadonly) { $out .= !is_array($this->withtocc) && !is_numeric($this->withtocc) ? $this->withtocc : ""; } else { $out .= '<input size="' . (is_array($this->withtocc) ? "30" : "60") . '" id="sendtocc" name="sendtocc" value="' . (!is_array($this->withtocc) && !is_numeric($this->withtocc) ? isset($_POST["sendtocc"]) ? $_POST["sendtocc"] : $this->withtocc : (isset($_POST["sendtocc"]) ? $_POST["sendtocc"] : "")) . '" />'; if (!empty($this->withtocc) && is_array($this->withtocc)) { $out .= " " . $langs->trans("or") . " "; $out .= $form->selectarray("receivercc", $this->withtocc, GETPOST("receivercc"), 1); } } $out .= "</td></tr>\n"; } // CCC if (!empty($this->withtoccc) || is_array($this->withtoccc)) { $out .= '<tr><td width="180">'; $out .= $form->textwithpicto($langs->trans("MailCCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); $out .= '</td><td>'; if (!empty($this->withtocccreadonly)) { $out .= !is_array($this->withtoccc) && !is_numeric($this->withtoccc) ? $this->withtoccc : ""; } else { $out .= '<input size="' . (is_array($this->withtoccc) ? "30" : "60") . '" id="sendtoccc" name="sendtoccc" value="' . (!is_array($this->withtoccc) && !is_numeric($this->withtoccc) ? isset($_POST["sendtoccc"]) ? $_POST["sendtoccc"] : $this->withtoccc : (isset($_POST["sendtoccc"]) ? $_POST["sendtoccc"] : "")) . '" />'; if (!empty($this->withtoccc) && is_array($this->withtoccc)) { $out .= " " . $langs->trans("or") . " "; $out .= $form->selectarray("receiverccc", $this->withtoccc, GETPOST("receiverccc"), 1); } } //if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1); $out .= "</td></tr>\n"; } // Ask delivery receipt if (!empty($this->withdeliveryreceipt)) { $out .= '<tr><td width="180">' . $langs->trans("DeliveryReceipt") . '</td><td>'; if (!empty($this->withdeliveryreceiptreadonly)) { $out .= yn($this->withdeliveryreceipt); } else { $out .= $form->selectyesno('deliveryreceipt', isset($_POST["deliveryreceipt"]) ? $_POST["deliveryreceipt"] : 0, 1); } $out .= "</td></tr>\n"; } // Topic if (!empty($this->withtopic)) { $this->withtopic = make_substitutions($this->withtopic, $this->substit); $out .= '<tr>'; $out .= '<td width="180">' . $langs->trans("MailTopic") . '</td>'; $out .= '<td>'; if ($this->withtopicreadonly) { $out .= $this->withtopic; $out .= '<input type="hidden" size="60" id="subject" name="subject" value="' . $this->withtopic . '" />'; } else { $out .= '<input type="text" size="60" id="subject" name="subject" value="' . (isset($_POST["subject"]) ? $_POST["subject"] : (is_numeric($this->withtopic) ? '' : $this->withtopic)) . '" />'; } $out .= "</td></tr>\n"; } // Attached files if (!empty($this->withfile)) { $out .= '<tr>'; $out .= '<td width="180">' . $langs->trans("MailFile") . '</td>'; $out .= '<td>'; if (is_numeric($this->withfile)) { // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript $out .= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">' . "\n"; $out .= '<script type="text/javascript" language="javascript">'; $out .= 'jQuery(document).ready(function () {'; $out .= ' jQuery(".removedfile").click(function() {'; $out .= ' jQuery(".removedfilehidden").val(jQuery(this).val());'; $out .= ' });'; $out .= '})'; $out .= '</script>' . "\n"; if (count($listofpaths)) { foreach ($listofpaths as $key => $val) { $out .= '<div id="attachfile_' . $key . '">'; $out .= img_mime($listofnames[$key]) . ' ' . $listofnames[$key]; if (!$this->withfilereadonly) { $out .= ' <input type="image" style="border: 0px;" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/delete.png" value="' . ($key + 1) . '" class="removedfile" id="removedfile_' . $key . '" name="removedfile_' . $key . '" />'; //$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).' id="removedfile_'.$key.'">'.img_delete($langs->trans("Delete").'</a>'; } $out .= '<br></div>'; } } else { $out .= $langs->trans("NoAttachedFiles") . '<br>'; } if ($this->withfile == 2) { $out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="' . $langs->trans("Upload") . '" />'; $out .= ' '; $out .= '<input type="submit" class="button" id="' . $addfileaction . '" name="' . $addfileaction . '" value="' . $langs->trans("MailingAddFile") . '" />'; } } else { $out .= $this->withfile; } $out .= "</td></tr>\n"; } // Message if (!empty($this->withbody)) { $defaultmessage = ""; // TODO A partir du type, proposer liste de messages dans table llx_c_email_template if ($this->param["models"] == 'facture_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoice"); } elseif ($this->param["models"] == 'facture_relance') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } elseif ($this->param["models"] == 'propal_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendProposal"); } elseif ($this->param["models"] == 'order_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendOrder"); } elseif ($this->param["models"] == 'order_supplier_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierOrder"); } elseif ($this->param["models"] == 'invoice_supplier_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } elseif ($this->param["models"] == 'shipping_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendShipping"); } elseif ($this->param["models"] == 'fichinter_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendFichInter"); } elseif ($this->param["models"] == 'thirdparty') { $defaultmessage = $langs->transnoentities("PredefinedMailContentThirdparty"); } elseif (!is_numeric($this->withbody)) { $defaultmessage = $this->withbody; } // Complete substitution array if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) { require_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php'; $langs->load('paypal'); if ($this->param["models"] == 'order_send') { $url = getPaypalPaymentUrl(0, 'order', $this->substit['__ORDERREF__']); $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url)); } if ($this->param["models"] == 'facture_send') { $url = getPaypalPaymentUrl(0, 'invoice', $this->substit['__FACREF__']); $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url)); } } $defaultmessage = str_replace('\\n', "\n", $defaultmessage); // Deal with format differences between message and signature (text / HTML) if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) { $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']); } else { if (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) { $defaultmessage = dol_nl2br($defaultmessage); } } if (isset($_POST["message"])) { $defaultmessage = $_POST["message"]; } else { $defaultmessage = make_substitutions($defaultmessage, $this->substit); // Clean first \n and br (to avoid empty line when CONTACTCIVNAME is empty) $defaultmessage = preg_replace("/^(<br>)+/", "", $defaultmessage); $defaultmessage = preg_replace("/^\n+/", "", $defaultmessage); } $out .= '<tr>'; $out .= '<td width="180" valign="top">' . $langs->trans("MailText") . '</td>'; $out .= '<td>'; if ($this->withbodyreadonly) { $out .= nl2br($defaultmessage); $out .= '<input type="hidden" id="message" name="message" value="' . $defaultmessage . '" />'; } else { if (!isset($this->ckeditortoolbar)) { $this->ckeditortoolbar = 'dolibarr_notes'; } // Editor wysiwyg require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; if ($this->withfckeditor == -1) { if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { $this->withfckeditor = 1; } else { $this->withfckeditor = 0; } } $doleditor = new DolEditor('message', $defaultmessage, '', 280, $this->ckeditortoolbar, 'In', true, true, $this->withfckeditor, 8, 72); $out .= $doleditor->Create(1); } $out .= "</td></tr>\n"; } if ($this->withform == 1 || $this->withform == -1) { $out .= '<tr><td align="center" colspan="2"><center>'; $out .= '<input class="button" type="submit" id="sendmail" name="sendmail" value="' . $langs->trans("SendMail") . '"'; // Add a javascript test to avoid to forget to submit file before sending email if ($this->withfile == 2 && $conf->use_javascript_ajax) { $out .= ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\'' . dol_escape_js($langs->trans("FileWasNotUploaded")) . '\'); return false; } else { return true; }"'; } $out .= ' />'; if ($this->withcancel) { $out .= ' '; $out .= '<input class="button" type="submit" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '" />'; } $out .= '</center></td></tr>' . "\n"; } $out .= '</table>' . "\n"; if ($this->withform == 1) { $out .= '</form>' . "\n"; } $out .= "<!-- Fin form mail -->\n"; return $out; } }
if ($action == 'create_updater' || $action == 'edit_updater') { //Form print '<form id="updaterform" action="' . $_SERVER["PHP_SELF"] . '" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="' . $action . '">'; print '<input type="hidden" name="selection" value="' . $selection . '">'; //Table print '<br><table summary="listofattributes" class="border centpercent">'; //Code print '<tr>'; print '<td class="fieldrequired">' . $langs->trans("Code") . '</td><td>'; $globals_list = array(); foreach ($price_globals->listGlobalVariables() as $entry) { $globals_list[$entry->id] = $entry->code; } print $form->selectarray('fk_variable', $globals_list, empty($price_updaters->fk_variable) ? 0 : $price_updaters->fk_variable); print '</td></tr>'; //Description print '<tr>'; print '<td>' . $langs->trans("Description") . '</td>'; print '<td class="valeur"><input type="text" name="description" size="50" value="' . (empty($price_updaters->description) ? '' : $price_updaters->description) . '"></td>'; print '</tr>'; //Type print '<tr>'; print '<td class="fieldrequired">' . $langs->trans("Type") . '</td><td>'; $type = empty($price_updaters->type) ? 0 : $price_updaters->type; $type_list = array(); foreach ($price_updaters->types as $val) { $type_list[$val] = $langs->trans("GlobalVariableUpdaterType" . $val); } print $form->selectarray('type', $type_list, $type);
print '<td class="liste_titre">'; print '<input type="text" class="flat" name="search_ref" value="' . $search_ref . '" size="8">'; print '</td><td class="liste_titre">'; print '<input type="text" class="flat" name="search_company" value="' . $search_company . '" size="10">'; print '</td><td class="liste_titre">'; print '<input type="text" class="flat" name="search_desc" value="' . $search_desc . '" size="12">'; print '</td>'; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { // Desc of line print '<td class="liste_titre"> </td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre"> </td>'; } print '<td class="liste_titre" align="right">'; $liststatus = $interventionstatic->statuts_short; print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1); print '</td>'; print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">'; print "</td></tr>\n"; $companystatic = new Societe($db); $var = True; $total = 0; $i = 0; while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); $var = !$var; print "<tr " . $bc[$var] . ">"; print "<td>"; $interventionstatic->id = $objp->fichid; $interventionstatic->ref = $objp->ref;
print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="' . (isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS : '1-5') . '">'; print '</td>'; print '<td width="20"> </td>'; print '</tr>'; // DefaultWorkingHours $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DefaultWorkingHours") . '</td><td>'; print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="' . (isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS : '9-18') . '">'; print '</td>'; print '<td width="20"> </td>'; print '</tr>'; // Firstname/Name $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("FirstnameNamePosition") . '</td><td>'; $array = array(0 => $langs->trans("Firstname") . ' ' . $langs->trans("Lastname"), 1 => $langs->trans("Lastname") . ' ' . $langs->trans("Firstname")); print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0); print '</td>'; print '<td width="20"> </td>'; print '</tr>'; // Hide unauthorized button $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("ButtonHideUnauthorized") . '</td><td>'; print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1); print '</td>'; print '<td width="20"> </td>'; print '</tr>'; // Hide helpcenter link on login page $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>'; print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK', isset($conf->global->MAIN_HELPCENTER_DISABLELINK) ? $conf->global->MAIN_HELPCENTER_DISABLELINK : 0, 1); print '</td>';
print '<br>'; print $langs->trans("LinkToGeneratedPagesDesc") . '<br>'; print '<br>'; dol_htmloutput_errors($mesg); print img_picto('', 'puce') . ' ' . $langs->trans("DocForAllMembersCards", $conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None")) . ' '; print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="foruserid" value="all">'; print '<input type="hidden" name="mode" value="card">'; print '<input type="hidden" name="action" value="builddoc">'; print $langs->trans("DescADHERENT_CARD_TYPE") . ' '; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php) $arrayoflabels = array(); foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } print $form->selectarray('model', $arrayoflabels, GETPOST('model') ? GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE, 1, 0, 0); print '<br><input class="button" type="submit" value="' . $langs->trans("BuildDoc") . '">'; print '</form>'; print '<br>'; print img_picto('', 'puce') . ' ' . $langs->trans("DocForOneMemberCards", $conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None")) . ' '; print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="mode" value="cardlogin">'; print '<input type="hidden" name="action" value="builddoc">'; print $langs->trans("DescADHERENT_CARD_TYPE") . ' '; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php) $arrayoflabels = array(); foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } print $form->selectarray('model', $arrayoflabels, GETPOST('model') ? GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE, 1, 0, 0); print '<br>' . $langs->trans("Login") . ': <input size="10" type="text" name="foruserlogin" value="' . GETPOST('foruserlogin') . '">';
print '<tr><td>' . $langs->trans("RepeatEvent") . '</td><td colspan="3">'; print '<input type="hidden" name="recurid" value="' . $object->recurid . '">'; $arrayrecurrulefreq = array('no' => $langs->trans("No"), 'MONTHLY' => $langs->trans("EveryMonth"), 'WEEKLY' => $langs->trans("EveryWeek")); $selectedrecurrulefreq = 'no'; $selectedrecurrulebymonthday = ''; $selectedrecurrulebyday = ''; if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { $selectedrecurrulefreq = $reg[1]; } if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\\d+)/i', $object->recurrule, $reg)) { $selectedrecurrulebymonthday = $reg[1]; } if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\\d+)/i', $object->recurrule, $reg)) { $selectedrecurrulebyday = $reg[1]; } print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq); // If recurrulefreq is MONTHLY print '<div class="repeateventBYMONTHDAY">'; print $langs->trans("DayOfMonth") . ': <input type="input" size="2" name="BYMONTHDAY" value="' . $selectedrecurrulebymonthday . '">'; print '</div>'; // If recurrulefreq is WEEKLY print '<div class="repeateventBYDAY">'; print $langs->trans("DayOfWeek") . ': <input type="input" size="4" name="BYDAY" value="' . $selectedrecurrulebyday . '">'; print '</div>'; print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { function init_repeat() { if (jQuery("#recurrulefreq").val() == \'MONTHLY\') { jQuery(".repeateventBYMONTHDAY").show();
print_liste_field_titre($langs->trans("Type"), "fiche.php", "", '', $param, '"width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print '</tr>'; $var = false; $listofemails = $object->thirdparty_and_contact_email_array(); if (count($listofemails) > 0) { $actions = array(); // Load array of available notifications $notificationtrigger = new InterfaceNotification($db); $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents(); foreach ($listofnotifiedevents as $notifiedevent) { $label = $langs->trans("Notify_" . $notifiedevent['code']) != "Notify_" . $notifiedevent['code'] ? $langs->trans("Notify_" . $notifiedevent['code']) : $notifiedevent['label']; $actions[$notifiedevent['rowid']] = $label; } print '<tr ' . $bc[$var] . '><td>'; print $form->selectarray("contactid", $listofemails); print '</td>'; print '<td>'; print $form->selectarray("actionid", $actions, '', 1); print '</td>'; print '<td>'; $type = array('email' => $langs->trans("EMail")); print $form->selectarray("typeid", $type); print '</td>'; print '<td align="right"><input type="submit" class="button" value="' . $langs->trans("Add") . '"></td>'; print '</tr>'; } else { print '<tr ' . $bc[$var] . '><td colspan="4">'; print $langs->trans("YouMustCreateContactFirst"); print '</td></tr>'; }
print '<td class="liste_titre">'; print '<input type="hidden" name="filter" value="' . $filter . '">'; print '<input type="hidden" name="mode" value="' . $mode . '">'; print '<input type="text" class="flat" size="3" name="search_contract" value="' . dol_escape_htmltag($search_contract) . '">'; print '</td>'; // Service label print '<td class="liste_titre">'; print '<input type="text" class="flat" size="12" name="search_service" value="' . dol_escape_htmltag($search_service) . '">'; print '</td>'; // Third party print '<td class="liste_titre">'; print '<input type="text" class="flat" size="12" name="search_name" value="' . dol_escape_htmltag($search_name) . '">'; print '</td>'; print '<td class="liste_titre" align="center">'; $arrayofoperators = array('<' => '<', '>' => '>'); print $form->selectarray('filter_op1', $arrayofoperators, $filter_op1, 1); print ' '; $filter_date1 = dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); print $form->select_date($filter_date1, 'op1', 0, 0, 1, '', 1, 0, 1); print '</td>'; print '<td class="liste_titre" align="center">'; $arrayofoperators = array('<' => '<', '>' => '>'); print $form->selectarray('filter_op2', $arrayofoperators, $filter_op2, 1); print ' '; $filter_date2 = dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); print $form->select_date($filter_date2, 'op2', 0, 0, 1, '', 1, 0, 1); print '</td>'; print '<td align="right">'; $arrayofstatus = array('0' => $langs->trans("ServiceStatusInitial"), '4' => $langs->trans("ServiceStatusRunning"), '4&filter=notexpired' => $langs->trans("ServiceStatusNotLate"), '4&filter=expired' => $langs->trans("ServiceStatusLate"), '5' => $langs->trans("ServiceStatusClosed")); print $form->selectarray('search_status', $arrayofstatus, strstr($search_status, ',') ? -1 : $search_status, 1); print '</td>';
/** * Return a string to show the box with list of available documents for object. * This also set the property $this->numoffiles * * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...) * @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Directory to scan * @param string $urlsource Url of origin page (for return) * @param int $genallowed Generation is allowed (1/0 or array list of templates) * @param int $delallowed Remove is allowed (1/0) * @param string $modelselected Model to preselect by default * @param string $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning) * @param string $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) * @param int $iconPDF Deprecated, see getDocumentsLink * @param int $maxfilenamelength Max length for filename shown * @param string $noform Do not output html form tags * @param string $param More param on http links * @param string $title Title to show on top of form * @param string $buttonlabel Label on submit button * @param string $codelang Default language code to use on lang combo box if multilang is enabled * @param string $morepicto Add more HTML content into cell with picto * @return string Output string with HTML array of documents (might be empty string) */ function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $maxfilenamelength = 28, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '') { // Deprecation warning if (0 !== $iconPDF) { dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING); } global $langs, $conf, $user, $hookmanager; global $form, $bc; if (!is_object($form)) { $form = new Form($this->db); } include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; // For backward compatibility if (!empty($iconPDF)) { return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); } $printer = 0; if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur'))) { $printer = !empty($user->rights->printing->read) && !empty($conf->printing->enabled) ? true : false; } $hookmanager->initHooks(array('formfile')); $forname = 'builddoc'; $out = ''; $var = true; $headershown = 0; $showempty = 0; $i = 0; $titletoshow = $langs->trans("Documents"); if (!empty($title)) { $titletoshow = $title; } $out .= "\n" . '<!-- Start show_document -->' . "\n"; //print 'filedir='.$filedir; // Show table if ($genallowed) { $modellist = array(); if ($modulepart == 'company') { $showempty = 1; if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/societe/modules_societe.class.php'; $modellist = ModeleThirdPartyDoc::liste_modeles($this->db); } } else { if ($modulepart == 'propal') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php'; $modellist = ModelePDFPropales::liste_modeles($this->db); } } else { if ($modulepart == 'supplier_proposal') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_proposal/modules_supplier_proposal.php'; $modellist = ModelePDFSupplierProposal::liste_modeles($this->db); } } else { if ($modulepart == 'commande') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php'; $modellist = ModelePDFCommandes::liste_modeles($this->db); } } elseif ($modulepart == 'expedition') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php'; $modellist = ModelePDFExpedition::liste_modeles($this->db); } } elseif ($modulepart == 'livraison') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/livraison/modules_livraison.php'; $modellist = ModelePDFDeliveryOrder::liste_modeles($this->db); } } else { if ($modulepart == 'ficheinter') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/fichinter/modules_fichinter.php'; $modellist = ModelePDFFicheinter::liste_modeles($this->db); } } elseif ($modulepart == 'facture') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; $modellist = ModelePDFFactures::liste_modeles($this->db); } } elseif ($modulepart == 'contract') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/contract/modules_contract.php'; $modellist = ModelePDFContract::liste_modeles($this->db); } } elseif ($modulepart == 'project') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/project/modules_project.php'; $modellist = ModelePDFProjects::liste_modeles($this->db); } } elseif ($modulepart == 'project_task') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/project/task/modules_task.php'; $modellist = ModelePDFTask::liste_modeles($this->db); } } elseif ($modulepart == 'export') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/export/modules_export.php'; $modellist = ModeleExports::liste_modeles($this->db); } } else { if ($modulepart == 'commande_fournisseur') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php'; $modellist = ModelePDFSuppliersOrders::liste_modeles($this->db); } } else { if ($modulepart == 'facture_fournisseur') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; $modellist = ModelePDFSuppliersInvoices::liste_modeles($this->db); } } else { if ($modulepart == 'remisecheque') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/cheque/pdf/modules_chequereceipts.php'; $modellist = ModeleChequeReceipts::liste_modeles($this->db); } } elseif ($modulepart == 'donation') { if (is_array($genallowed)) { $modellist = $genallowed; } else { include_once DOL_DOCUMENT_ROOT . '/core/modules/dons/modules_don.php'; $modellist = ModeleDon::liste_modeles($this->db); } } else { if ($modulepart == 'unpaid') { $modellist = ''; } else { if ($modulepart != 'agenda') { // For normalized standard modules $file = dol_buildpath('/core/modules/' . $modulepart . '/modules_' . $modulepart . '.php', 0); if (file_exists($file)) { $res = (include_once $file); } else { $file = dol_buildpath('/' . $modulepart . '/core/modules/' . $modulepart . '/modules_' . $modulepart . '.php', 0); $res = (include_once $file); } $class = 'Modele' . ucfirst($modulepart); if (class_exists($class)) { $modellist = call_user_func($class . '::liste_modeles', $this->db); } else { dol_print_error($this->db, 'Bad value for modulepart'); return -1; } } } } } } } } } } } $headershown = 1; $buttonlabeltoshow = $buttonlabel; if (empty($buttonlabel)) { $buttonlabel = $langs->trans('Generate'); } if (empty($noform)) { $out .= '<form action="' . $urlsource . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc') . '" name="' . $forname . '" id="' . $forname . '_form" method="post">'; } $out .= '<input type="hidden" name="action" value="builddoc">'; $out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; $out .= load_fiche_titre($titletoshow, '', ''); $out .= '<table class="liste formdoc noborder" summary="listofdocumentstable" width="100%">'; $out .= '<tr class="liste_titre">'; // Model if (!empty($modellist)) { $out .= '<th align="center" class="formdoc liste_titre maxwidthonsmartphone">'; $out .= '<span class="hideonsmartphone">' . $langs->trans('Model') . ' </span>'; if (is_array($modellist) && count($modellist) == 1) { $arraykeys = array_keys($modellist); $modelselected = $arraykeys[0]; } $out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', ''); $out .= '</th>'; } else { $out .= '<th align="left" class="formdoc liste_titre">'; $out .= $langs->trans("Files"); $out .= '</th>'; } // Language code (if multilang) $out .= '<th align="center" class="formdoc liste_titre maxwidthonsmartphone">'; if (($allowgenifempty || is_array($modellist) && count($modellist) > 0) && $conf->global->MAIN_MULTILANGS && !$forcenomultilang && (!empty($modellist) || $showempty)) { include_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); $defaultlang = $codelang ? $codelang : $langs->getDefaultLang(); $morecss = 'maxwidth150'; if (!empty($conf->browser->phone)) { $morecss = 'maxwidth100'; } $out .= $formadmin->select_language($defaultlang, 'lang_id', 0, 0, 0, 0, 0, $morecss); } else { $out .= ' '; } $out .= '</th>'; // Button $addcolumforpicto = $delallowed || $printer || $morepicto; $out .= '<th align="center" colspan="' . ($addcolumforpicto ? '2' : '1') . '" class="formdocbutton liste_titre maxwidthonsmartphone">'; $genbutton = '<input class="button" id="' . $forname . '_generatebutton" name="' . $forname . '_generatebutton"'; $genbutton .= ' type="submit" value="' . $buttonlabel . '"'; if (!$allowgenifempty && !is_array($modellist) && empty($modellist)) { $genbutton .= ' disabled'; } $genbutton .= '>'; if ($allowgenifempty && !is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') { $langs->load("errors"); $genbutton .= ' ' . img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); } if (!$allowgenifempty && !is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') { $genbutton = ''; } if (empty($modellist) && !$showempty && $modulepart != 'unpaid') { $genbutton = ''; } $out .= $genbutton; $out .= '</th>'; if (!empty($hookmanager->hooks['formfile'])) { foreach ($hookmanager->hooks['formfile'] as $module) { if (method_exists($module, 'formBuilddocLineOptions')) { $out .= '<th></th>'; } } } $out .= '</tr>'; // Execute hooks $parameters = array('socid' => isset($GLOBALS['socid']) ? $GLOBALS['socid'] : '', 'id' => isset($GLOBALS['id']) ? $GLOBALS['id'] : '', 'modulepart' => $modulepart); if (is_object($hookmanager)) { $reshook = $hookmanager->executeHooks('formBuilddocOptions', $parameters, $GLOBALS['object']); $out .= $hookmanager->resPrint; } } // Get list of files if (!empty($filedir)) { $file_list = dol_dir_list($filedir, 'files', 0, '', '(\\.meta|_preview\\.png)$', 'date', SORT_DESC); // Affiche en-tete tableau si non deja affiche if (!empty($file_list) && !$headershown) { $headershown = 1; $out .= '<div class="titre">' . $titletoshow . '</div>'; $out .= '<table class="border" summary="listofdocumentstable" width="100%">'; } // Loop on each file found if (is_array($file_list)) { foreach ($file_list as $file) { $var = !$var; // Define relative path for download link (depends on module) $relativepath = $file["name"]; // Cas general if ($modulesubdir) { $relativepath = $modulesubdir . "/" . $file["name"]; } // Cas propal, facture... if ($modulepart == 'export') { $relativepath = $file["name"]; } // Other case $out .= "<tr " . $bc[$var] . ">"; $documenturl = DOL_URL_ROOT . '/document.php'; if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; } // Show file name with link to download $out .= '<td class="nowrap">'; $out .= '<a data-ajax="false" href="' . $documenturl . '?modulepart=' . $modulepart . '&file=' . urlencode($relativepath) . '"'; $mime = dol_mimetype($relativepath, '', 0); if (preg_match('/text/', $mime)) { $out .= ' target="_blank"'; } $out .= ' target="_blank">'; $out .= img_mime($file["name"], $langs->trans("File") . ': ' . $file["name"]) . ' ' . dol_trunc($file["name"], $maxfilenamelength); $out .= '</a>' . "\n"; $out .= '</td>'; // Show file size $size = !empty($file['size']) ? $file['size'] : dol_filesize($filedir . "/" . $file["name"]); $out .= '<td align="right" class="nowrap">' . dol_print_size($size) . '</td>'; // Show file date $date = !empty($file['date']) ? $file['date'] : dol_filemtime($filedir . "/" . $file["name"]); $out .= '<td align="right" class="nowrap">' . dol_print_date($date, 'dayhour', 'tzuser') . '</td>'; if ($delallowed || $printer || $morepicto) { $out .= '<td align="right">'; if ($delallowed) { $out .= '<a href="' . $urlsource . (strpos($urlsource, '?') ? '&' : '?') . 'action=remove_file&file=' . urlencode($relativepath); $out .= $param ? '&' . $param : ''; //$out.= '&modulepart='.$modulepart; // TODO obsolete ? //$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ? $out .= '">' . img_picto($langs->trans("Delete"), 'delete.png') . '</a>'; //$out.='</td>'; } if ($printer) { //$out.= '<td align="right">'; $out .= ' <a href="' . $urlsource . (strpos($urlsource, '?') ? '&' : '?') . 'action=print_file&printer=' . $modulepart . '&file=' . urlencode($relativepath); $out .= $param ? '&' . $param : ''; $out .= '">' . img_picto($langs->trans("PrintFile", $relativepath), 'printer.png') . '</a>'; } if ($morepicto) { $morepicto = preg_replace('/__FILENAMEURLENCODED__/', urlencode($relativepath), $morepicto); $out .= $morepicto; } $out .= '</td>'; } if (is_object($hookmanager)) { $parameters = array('socid' => isset($GLOBALS['socid']) ? $GLOBALS['socid'] : '', 'id' => isset($GLOBALS['id']) ? $GLOBALS['id'] : '', 'modulepart' => $modulepart, 'relativepath' => $relativepath); $res = $hookmanager->executeHooks('formBuilddocLineOptions', $parameters, $file); if (empty($res)) { $out .= $hookmanager->resPrint; // Complete line $out .= '</tr>'; } else { $out = $hookmanager->resPrint; } // Replace line } } if (count($file_list) == 0 && $headershown) { $out .= '<tr ' . $bc[0] . '><td colspan="3">' . $langs->trans("None") . '</td></tr>'; } $this->numoffiles++; } } if ($headershown) { // Affiche pied du tableau $out .= "</table>\n"; if ($genallowed) { if (empty($noform)) { $out .= '</form>' . "\n"; } } } $out .= '<!-- End show_document -->' . "\n"; //return ($i?$i:$headershown); return $out; }
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">'; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("MoreActionsOnSubscription") . '</td>'; $arraychoices = array('0' => $langs->trans("None")); if (!empty($conf->banque->enabled)) { $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect"); } if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { $arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly"); } if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice"); } print '<td>'; print $form->selectarray('constvalue', $arraychoices, $conf->global->ADHERENT_BANK_USE, 0); print '</td><td align="center" width="80">'; print '<input type="submit" class="button" value="' . $langs->trans("Update") . '" name="Button">'; print '</td>'; print "</tr>\n"; print '</form>'; // Use vat for invoice creation if ($conf->facture->enabled) { $var = !$var; print '<form action="adherent.php" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="constname" value="ADHERENT_VAT_FOR_SUBSCRIPTIONS">'; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("VATToUseForSubscriptions") . '</td>'; if (!empty($conf->banque->enabled)) { print '<td>';
/** * Return description of a module * * @param Translate $langs Lang object to use for output * @return string Description */ function info($langs) { global $conf, $langs; $langs->load("companies"); $langs->load("errors"); $form = new Form($this->db); $texte = $this->description . ".<br>\n"; $texte .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; $texte .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; $texte .= '<input type="hidden" name="action" value="setModuleOptions">'; $texte .= '<input type="hidden" name="param1" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH">'; if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) { $texte .= '<input type="hidden" name="param2" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT">'; $texte .= '<input type="hidden" name="param3" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL">'; $texte .= '<input type="hidden" name="param4" value="SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED">'; } $texte .= '<table class="nobordernopadding" width="100%">'; // List of directories area $texte .= '<tr><td>'; $texttitle = $langs->trans("ListOfDirectories"); $listofdir = explode(',', preg_replace('/[\\r\\n]+/', ',', trim($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH))); $listoffiles = array(); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); if (!$tmpdir) { unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) { $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); } else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\\.(ods|odt)'); if (count($tmpfiles)) { $listoffiles = array_merge($listoffiles, $tmpfiles); } } } $texthelp = $langs->trans("ListOfDirectoriesForModelGenODT"); // Add list of substitution keys $texthelp .= '<br>' . $langs->trans("FollowingSubstitutionKeysCanBeUsed") . '<br>'; $texthelp .= $langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1); $texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">'; $texte .= '<textarea class="flat" cols="60" name="value1">'; $texte .= $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH; $texte .= '</textarea>'; $texte .= '</div><div style="display: inline-block; vertical-align: middle;">'; $texte .= '<input type="submit" class="button" value="' . $langs->trans("Modify") . '" name="Button">'; $texte .= '<br></div></div>'; // Scan directories if (count($listofdir)) { $texte .= $langs->trans("NumberOfModelFilesFound") . ': <b>' . count($listoffiles) . '</b>'; if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation $liste = ModelePDFSupplierProposal::liste_modeles($this->db); $texte .= '<table width="50%;">'; $texte .= '<tr>'; $texte .= '<td width="60%;">' . $langs->trans("DefaultModelSupplierProposalCreate") . '</td>'; $texte .= '<td colspan="">'; $texte .= $form->selectarray('value2', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT); $texte .= "</td></tr>"; $texte .= '<tr>'; $texte .= '<td width="60%;">' . $langs->trans("DefaultModelSupplierProposalToBill") . '</td>'; $texte .= '<td colspan="">'; $texte .= $form->selectarray('value3', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL); $texte .= "</td></tr>"; $texte .= '<tr>'; $texte .= '<td width="60%;">' . $langs->trans("DefaultModelSupplierProposalClosed") . '</td>'; $texte .= '<td colspan="">'; $texte .= $form->selectarray('value4', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED); $texte .= "</td></tr>"; $texte .= '</table>'; } } $texte .= '</td>'; $texte .= '<td valign="top" rowspan="2" class="hideonsmartphone">'; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '</td>'; $texte .= '</tr>'; $texte .= '</table>'; $texte .= '</form>'; return $texte; }
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['p.datec']['checked'])) { print '<td class="liste_titre">'; print '</td>'; } // Date modification if (!empty($arrayfields['p.tms']['checked'])) { print '<td class="liste_titre">'; print '</td>'; } if (!empty($arrayfields['p.tosell']['checked'])) { print '<td class="liste_titre" align="center">'; print $form->selectarray('tosell', array('0' => $langs->trans('ProductStatusNotOnSellShort'), '1' => $langs->trans('ProductStatusOnSellShort')), $tosell, 1); print '</td >'; } if (!empty($arrayfields['p.tobuy']['checked'])) { print '<td class="liste_titre" align="center">'; print $form->selectarray('tobuy', array('0' => $langs->trans('ProductStatusNotOnBuyShort'), '1' => $langs->trans('ProductStatusOnBuyShort')), $tobuy, 1); print '</td>'; } print '<td class="liste_titre nowrap" align="right">'; print '<input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("RemoveFilter"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">'; print '</td>'; print '</tr>'; $product_static = new Product($db); $product_fourn = new ProductFournisseur($db); $var = true;
print_titre($langs->trans('NewAttribute')); print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="fields" value="'.$_GET["fields"].'">'; print '<table summary="listofattributes" class="border" width="100%">'; print '<input type="hidden" name="action" value="add">'; // Label print '<tr><td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.GETPOST('label').'"></td></tr>'; // Code print '<tr><td class="fieldrequired" required>'.$langs->trans("AttributeCode").' ('.$langs->trans("AlphaNumOnlyCharsAndNoSpace").')</td><td class="valeur"><input type="text" name="attrname" size="10" value="'.GETPOST('attrname').'"></td></tr>'; // Type print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td><td class="valeur">'; print $form->selectarray('type',$type2label,GETPOST('type')); print '</td></tr>'; // Size print '<tr><td class="fieldrequired" required>'.$langs->trans("Size").'</td><td><input type="text" name="size" size="5" value="'.(GETPOST('size')?GETPOST('size'):'255').'"></td></tr>'; print "</table>\n"; print '<center><br><input type="submit" name="button" class="button small radius nice" value="'.$langs->trans("Save").'"> '; print '<input type="submit" name="button" class="button white small radius nice" value="'.$langs->trans("Cancel").'"></center>'; print "</form>\n"; } /* ************************************************************************** */ /* */ /* Edition d'un champ optionnel */