Merge branch 'develop' into new-import-product-country-code
This commit is contained in:
commit
b85c4f0864
@ -36,6 +36,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$massaction = GETPOST('massaction', 'aZ09');
|
||||
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'accountingaccountlist'; // To manage different context of search
|
||||
|
||||
$search_account = GETPOST('search_account', 'alpha');
|
||||
@ -100,7 +101,7 @@ if (empty($reshook))
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
if (GETPOST('change_chart', 'alpha'))
|
||||
if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax)))
|
||||
{
|
||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||
|
||||
@ -236,6 +237,24 @@ if ($resql)
|
||||
if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<!-- Add javascript to update a flag when we select "Change plan" -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$("#searchFormList").on("submit", function (e) {
|
||||
console.log("chartofaccounts focus = "+$("#chartofaccounts").is(":focus"));
|
||||
console.log("change_chart focus = "+$("#change_chart").is(":focus"));
|
||||
if ($("#change_chart").is(":focus"))
|
||||
{
|
||||
console.log("We set valid_change_chart to 1");
|
||||
$("#valid_change_chart").val(1);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@ -278,7 +297,8 @@ if ($resql)
|
||||
else dol_print_error($db);
|
||||
print "</select>";
|
||||
print ajax_combobox("chartofaccounts");
|
||||
print '<input type="submit" class="button" name="change_chart" tabindex="-1" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||
print '<input type="submit" class="button" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||
print '<input type="hidden" name="valid_change_chart" id="valid_change_chart" value="0">';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
@ -286,6 +306,9 @@ if ($resql)
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
$moreforfilter = '';
|
||||
$massactionbutton = '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
|
||||
@ -265,7 +265,7 @@ if ($action != 'export_csv')
|
||||
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
||||
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
||||
if (empty($description)) {
|
||||
$link = '<a href="../admin/card.php?action=create&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
}
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
@ -439,7 +439,7 @@ if ($action == 'create')
|
||||
print $langs->trans('Docdate');
|
||||
print '</td>';
|
||||
if ($action != 'editdate')
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate&piece_num='. $object->piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&piece_num='. $object->piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editdate') {
|
||||
@ -463,7 +463,7 @@ if ($action == 'create')
|
||||
print $langs->trans('Codejournal');
|
||||
print '</td>';
|
||||
if ($action != 'editjournal')
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editjournal&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editjournal') {
|
||||
@ -487,7 +487,7 @@ if ($action == 'create')
|
||||
print $langs->trans('Piece');
|
||||
print '</td>';
|
||||
if ($action != 'editdocref')
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdocref&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&piece_num='.$object->piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editdocref') {
|
||||
|
||||
@ -68,7 +68,7 @@ $object = new Adherent($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($id);
|
||||
@ -320,7 +320,7 @@ if (empty($reshook))
|
||||
$object->public = GETPOST("public", 'alpha');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
// Check if we need to also synchronize user information
|
||||
@ -497,7 +497,7 @@ if (empty($reshook))
|
||||
$object->public = $public;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
// Check parameters
|
||||
@ -1362,15 +1362,8 @@ else
|
||||
else print $langs->trans("NoDolibarrAccess");
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
//Hooks here
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook))
|
||||
{
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
dol_fiche_end();
|
||||
|
||||
@ -48,7 +48,7 @@ $object=new Adherent($db);
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -89,7 +89,7 @@ $hookmanager->initHooks(array('memberlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ $extrafields = new ExtraFields($db);
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$errmsg='';
|
||||
$errmsgs=array();
|
||||
@ -571,7 +571,7 @@ if ($rowid > 0)
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||
print '</td>';
|
||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2" class="valeur">';
|
||||
if ($action == 'editthirdparty')
|
||||
@ -614,7 +614,7 @@ if ($rowid > 0)
|
||||
print '<td class="right">';
|
||||
if ($user->rights->user->user->creer)
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ $hookmanager->initHooks(array('subscriptionlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ $object = new AdherentType($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
@ -113,7 +113,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
|
||||
$object->vote = (int) $vote;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (empty($object->label)) {
|
||||
@ -168,7 +168,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
$object->vote = (boolean) trim($vote);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$ret=$object->update($user);
|
||||
@ -713,7 +713,7 @@ if ($rowid > 0)
|
||||
print '<td class="center">';
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
print '<a href="card.php?rowid='.$objp->rowid.'&action=edit&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda" href="card.php?rowid='.$objp->rowid.'&action=edit&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
}
|
||||
print ' ';
|
||||
if ($user->rights->adherent->supprimer)
|
||||
|
||||
@ -57,7 +57,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration
|
||||
$hookmanager->initHooks(array('emailcollectorcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
@ -378,7 +378,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
if ($action != 'classify')
|
||||
{
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
|
||||
@ -68,7 +68,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration
|
||||
$hookmanager->initHooks(array('emailcollectorlist')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012-20113 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Christophe Battarel <christophe@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -49,7 +50,8 @@ $modules = array(
|
||||
'DETAILS' => 'FCKeditorForProductDetails',
|
||||
'USERSIGN' => 'FCKeditorForUserSignature',
|
||||
'MAILING' => 'FCKeditorForMailing',
|
||||
'MAIL' => 'FCKeditorForMail'
|
||||
'MAIL' => 'FCKeditorForMail',
|
||||
'TICKET' => 'FCKeditorForTicket'
|
||||
);
|
||||
// Conditions pour que l'option soit proposee
|
||||
$conditions = array(
|
||||
@ -58,7 +60,8 @@ $conditions = array(
|
||||
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
||||
'USERSIGN' => 1,
|
||||
'MAILING' => ! empty($conf->mailing->enabled),
|
||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)),
|
||||
'TICKET' => ! empty($conf->ticket->enabled)
|
||||
);
|
||||
// Picto
|
||||
$picto = array(
|
||||
@ -67,7 +70,8 @@ $picto = array(
|
||||
'DETAILS' => 'product',
|
||||
'USERSIGN' => 'user',
|
||||
'MAILING' => 'email',
|
||||
'MAIL' => 'email'
|
||||
'MAIL' => 'email',
|
||||
'TICKET' => 'ticket'
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -160,7 +160,6 @@ print '<ul>';
|
||||
|
||||
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
|
||||
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
|
||||
print '<li><a href="https://plus.google.com/+DolibarrOrg" target="_blank" rel="external">Google Plus page</a></li>';
|
||||
|
||||
print '</ul>';
|
||||
|
||||
|
||||
@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scandir', 'alpha');
|
||||
$type = 'ticket';
|
||||
|
||||
$error = 0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstticket = GETPOST('maskconstticket', 'alpha');
|
||||
$maskticket = GETPOST('maskticket', 'alpha');
|
||||
@ -91,7 +97,7 @@ if ($action == 'updateMask') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
|
||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'restricthtml');
|
||||
if (!empty($mail_intro)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
@ -101,7 +107,7 @@ if ($action == 'updateMask') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
|
||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'restricthtml');
|
||||
if (!empty($mail_signature)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
@ -110,16 +116,6 @@ if ($action == 'updateMask') {
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
|
||||
if (!empty($text_help)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setvarother') {
|
||||
|
||||
@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scandir', 'alpha');
|
||||
$type = 'ticket';
|
||||
|
||||
$error = 0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
|
||||
{
|
||||
if (GETPOST('value')) dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
|
||||
@ -51,95 +57,54 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
|
||||
if ($action == 'setvar') {
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
|
||||
|
||||
$notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha');
|
||||
if (!empty($notification_email)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity);
|
||||
$topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'nohtml');
|
||||
if (!empty($topic_interface)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// altairis : differentiate notification email FROM and TO
|
||||
$notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha');
|
||||
if (!empty($notification_email_to)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity);
|
||||
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
|
||||
if (!empty($text_home)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'alpha');
|
||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
|
||||
if (!empty($text_help)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
|
||||
if (!empty($mail_new_ticket)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
|
||||
if (!empty($mail_intro)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
|
||||
if (!empty($mail_signature)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $langs->trans('TicketMessageMailSignatureText'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
$url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
|
||||
if (!empty($url_interface)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alpha');
|
||||
if (!empty($topic_interface)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'alpha');
|
||||
if (!empty($text_home)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
|
||||
if (!empty($text_help)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,14 +127,11 @@ if ($action == 'setvarother') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
$param_show_module_logo = GETPOST('TICKET_SHOW_MODULE_LOGO', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
$param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
@ -179,12 +141,6 @@ if ($action == 'setvarother') {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -238,8 +194,7 @@ print '<br><br>';
|
||||
|
||||
if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
{
|
||||
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data" >';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="setvarother">';
|
||||
@ -349,16 +304,6 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// Url public interface
|
||||
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
||||
print '<tr><td>' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . '</label>';
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="TICKET_URL_PUBLIC_INTERFACE" value="' . $conf->global->TICKET_URL_PUBLIC_INTERFACE . '" size="40" ></td>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
||||
print '</td></tr>';
|
||||
|
||||
// Interface topic
|
||||
$url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC;
|
||||
print '<tr><td>' . $langs->trans("TicketPublicInterfaceTopicLabelAdmin") . '</label>';
|
||||
@ -420,6 +365,16 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
|
||||
print '</td></tr>';
|
||||
|
||||
// Url public interface
|
||||
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
||||
print '<tr><td>' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . '</label>';
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="TICKET_URL_PUBLIC_INTERFACE" value="' . $conf->global->TICKET_URL_PUBLIC_INTERFACE . '" size="40" ></td>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '"></div>';
|
||||
|
||||
@ -45,7 +45,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
@ -64,9 +64,6 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
|
||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
//$result = restrictedArea($user, 'asset', $id);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
|
||||
@ -207,7 +204,7 @@ if (($id || $ref) && $action == 'edit')
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||
{
|
||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
||||
$res = $object->fetch_optionals($object->id);
|
||||
|
||||
$head = asset_prepare_head($object);
|
||||
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
||||
|
||||
@ -62,7 +62,7 @@ $diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->
|
||||
$hookmanager->initHooks(array('assetdocument')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
|
||||
@ -62,7 +62,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('assetnote')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Security check - Protection if external user
|
||||
//if ($user->societe_id > 0) access_forbidden();
|
||||
@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->asset->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -65,7 +65,7 @@ $object = new AssetType($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
@ -102,7 +102,7 @@ if ($action == 'add' && $user->rights->asset->write)
|
||||
$object->note = trim($comment);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (empty($object->label)) {
|
||||
@ -155,7 +155,7 @@ if ($action == 'update' && $user->rights->asset->write)
|
||||
$object->note = trim($comment);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$ret=$object->update($user);
|
||||
|
||||
@ -74,7 +74,7 @@ $extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomagenda','globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('bom');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
@ -149,7 +149,7 @@ if ($object->id > 0)
|
||||
if ($user->rights->bom->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -48,7 +48,7 @@ $extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Initialize array of search criterias
|
||||
@ -339,7 +339,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($user->rights->bom->write)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
|
||||
@ -63,7 +63,7 @@ $extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomdocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
|
||||
@ -62,7 +62,7 @@ $diroutputmassaction = $conf->bom->dir_output . '/temp/massgeneration/'.$user->i
|
||||
$hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); // Load $extrafields->attributes['bom']
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ $diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomnote','globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Security check - Protection if external user
|
||||
//if ($user->societe_id > 0) access_forbidden();
|
||||
@ -104,7 +104,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->bom->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -140,7 +140,7 @@ if ($nolinesbefore) {
|
||||
|
||||
<?php
|
||||
if (is_object($objectline)) {
|
||||
print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ $coldisplay=0;
|
||||
|
||||
<?php
|
||||
if (is_object($objectline)) {
|
||||
print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@ -149,9 +149,9 @@ $objectline = new BOMLine($object->db);
|
||||
|
||||
<?php
|
||||
//Line extrafield
|
||||
if (!empty($extrafieldsline))
|
||||
if (!empty($extrafields))
|
||||
{
|
||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@ -150,3 +150,140 @@ function printBookmarksList($aDb, $aLangs)
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add area with bookmarks in top menu
|
||||
*
|
||||
* @param DoliDb $aDb Database handler
|
||||
* @param Translate $aLangs Object lang
|
||||
* @return string
|
||||
*/
|
||||
function printDropdownBookmarksList($aDb, $aLangs)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
$db = $aDb;
|
||||
$langs = $aLangs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
||||
|
||||
$langs->load("bookmarks");
|
||||
|
||||
$url= $_SERVER["PHP_SELF"];
|
||||
|
||||
if (! empty($_SERVER["QUERY_STRING"]))
|
||||
{
|
||||
$url.=(dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):'');
|
||||
}
|
||||
else
|
||||
{
|
||||
global $sortfield,$sortorder;
|
||||
$tmpurl='';
|
||||
// No urlencode, all param $url will be urlencoded later
|
||||
if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield;
|
||||
if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder;
|
||||
if (is_array($_POST))
|
||||
{
|
||||
foreach($_POST as $key => $val)
|
||||
{
|
||||
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
|
||||
}
|
||||
}
|
||||
$url.=($tmpurl?'?'.$tmpurl:'');
|
||||
}
|
||||
|
||||
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||
$searchForm.= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="" onsubmit="return false" >';
|
||||
$searchForm.= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||
$searchForm.= '</form>';
|
||||
|
||||
// Url to list bookmark
|
||||
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
||||
$listbtn.= '<span class="fa fa-list"></span> '.$langs->trans('Bookmarks').'</a>';
|
||||
|
||||
// Url to go on create new bookmark page
|
||||
$newbtn = '';
|
||||
if (! empty($user->rights->bookmark->creer))
|
||||
{
|
||||
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||
$newbtn.= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
|
||||
$newbtn.= '<span class="fa fa-star-o"></span> '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
||||
}
|
||||
|
||||
|
||||
$bookmarkList='<div id="dropdown-bookmarks-list" >';
|
||||
// Menu with all bookmarks
|
||||
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
||||
{
|
||||
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||
$sql.= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
|
||||
$sql.= " AND entity IN (".getEntity('bookmarks').")";
|
||||
$sql.= " ORDER BY position";
|
||||
if ($resql = $db->query($sql) )
|
||||
{
|
||||
$i=0;
|
||||
while ($i < $conf->global->BOOKMARKS_SHOW_IN_MENU && $obj = $db->fetch_object($resql))
|
||||
{
|
||||
$bookmarkList.='<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1?' target="_blank"':'').' href="'.dol_escape_htmltag($obj->url).'" >';
|
||||
$bookmarkList.= dol_escape_htmltag($obj->title);
|
||||
$bookmarkList.='</a>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$bookmarkList.='</div>';
|
||||
|
||||
$html= '';
|
||||
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
|
||||
$html.= '
|
||||
<!-- search input -->
|
||||
<div class="dropdown-header bookmark-header">
|
||||
' . $searchForm . '
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
$html.= '
|
||||
<!-- Menu Body -->
|
||||
<div class="bookmark-body dropdown-body">
|
||||
'.$bookmarkList.'
|
||||
</div>
|
||||
';
|
||||
|
||||
$html.= '
|
||||
<!-- Menu Footer-->
|
||||
<div class="bookmark-footer">
|
||||
'.$newbtn.$listbtn.'
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
';
|
||||
|
||||
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
|
||||
$html .= '<script>
|
||||
$( document ).on("keyup", "#top-bookmark-search-input", function () {
|
||||
|
||||
var filter = $(this).val(), count = 0;
|
||||
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
||||
|
||||
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
||||
$(this).addClass("hidden-search-result");
|
||||
} else {
|
||||
$(this).removeClass("hidden-search-result");
|
||||
count++;
|
||||
}
|
||||
});
|
||||
$("#top-bookmark-search-filter-count").text(count);
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ if ($resql)
|
||||
print '<td class="nowrap right">';
|
||||
if ($user->rights->bookmark->creer)
|
||||
{
|
||||
print "<a href=\"".DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> ";
|
||||
print '<a href="'.DOL_URL_ROOT."/bookmarks/card.php?action=edit&id=".$obj->rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
|
||||
}
|
||||
if ($user->rights->bookmark->supprimer)
|
||||
{
|
||||
|
||||
@ -68,7 +68,7 @@ if ($catorigin && $type == Categorie::TYPE_PRODUCT) $idCatOrigin = $catorigin;
|
||||
$object = new Categorie($db);
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
@ -137,7 +137,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
||||
|
||||
if ($parent != "-1") $object->fk_parent = $parent;
|
||||
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $object->label)
|
||||
|
||||
@ -62,7 +62,7 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
@ -102,7 +102,7 @@ if ($action == 'update' && $user->rights->categorie->creer)
|
||||
}
|
||||
if (! $error && empty($object->error))
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error && $object->update($user) > 0)
|
||||
|
||||
@ -84,7 +84,7 @@ $type=$object->type;
|
||||
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard','globalcard'));
|
||||
|
||||
@ -99,7 +99,7 @@ if ($id > 0 && $action!='add') {
|
||||
}
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
//var_dump($_POST);
|
||||
|
||||
@ -361,7 +361,7 @@ if (empty($reshook) && $action == 'add')
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
@ -526,7 +526,7 @@ if (empty($reshook) && $action == 'update')
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
@ -1582,7 +1582,7 @@ if ($id > 0)
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
@ -1622,7 +1622,7 @@ if ($id > 0)
|
||||
// Type
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td colspan="3">'.$langs->trans($object->type).'</td></tr>';
|
||||
}
|
||||
|
||||
// Full day event
|
||||
|
||||
@ -82,7 +82,7 @@ $hookmanager->initHooks(array('agendalist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
// If not choice done on calendar owner, we filter on user.
|
||||
|
||||
@ -80,7 +80,7 @@ $object = new Client($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('thirdpartycomm','globalcard'));
|
||||
@ -194,8 +194,7 @@ if (empty($reshook))
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||
if ($ret < 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
@ -324,7 +323,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('PaymentConditions');
|
||||
print '<td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editconditions')
|
||||
@ -343,7 +342,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '<td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode')
|
||||
@ -364,7 +363,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('PaymentBankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount')
|
||||
@ -390,7 +389,7 @@ if ($object->id > 0)
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
|
||||
@ -457,7 +456,7 @@ if ($object->id > 0)
|
||||
print '<td><td class="right">';
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td><td>';
|
||||
@ -474,7 +473,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('SendingMethod');
|
||||
print '<td>';
|
||||
if (($action != 'editshipping') && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshipping&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
if (($action != 'editshipping') && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshipping&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editshipping')
|
||||
@ -542,7 +541,7 @@ if ($object->id > 0)
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('ProspectLevel');
|
||||
print '<td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editlevel')
|
||||
|
||||
@ -51,7 +51,7 @@ $result=$object->fetch($id);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('mailingcard','globalcard'));
|
||||
|
||||
@ -544,7 +544,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
public function query_thirdparty($arrayquery)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
global $langs,$conf,$extrafields;
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid";
|
||||
@ -617,29 +617,29 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
//Standard Extrafield feature
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||
// fetch optionals attributes and labels
|
||||
dol_include_once('/core/class/extrafields.class.php');
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('societe');
|
||||
|
||||
foreach($extralabels as $key=>$val) {
|
||||
$elementtype = Societe::$table_element;
|
||||
|
||||
if (($extrafields->attribute_type[$key] == 'varchar') ||
|
||||
($extrafields->attribute_type[$key] == 'text')) {
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
|
||||
|
||||
if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
|
||||
if (!empty($arrayquery['options_'.$key])) {
|
||||
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key]."')";
|
||||
}
|
||||
} elseif (($extrafields->attribute_type[$key] == 'int') ||
|
||||
($extrafields->attribute_type[$key] == 'double')) {
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_max'])) {
|
||||
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
|
||||
}
|
||||
} elseif (($extrafields->attribute_type[$key] == 'date') ||
|
||||
($extrafields->attribute_type[$key] == 'datetime')) {
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
|
||||
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
|
||||
}
|
||||
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
|
||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||
if ($arrayquery['options_'.$key]!=''){
|
||||
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key].")";
|
||||
}
|
||||
@ -757,29 +757,33 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
//Standard Extrafield feature
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||
$elementtype = Contact::$table_element;
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
dol_include_once('/core/class/extrafields.class.php');
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('socpeople');
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
foreach($extralabels as $key=>$val) {
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
if (($extrafields->attribute_type[$key] == 'varchar') ||
|
||||
($extrafields->attribute_type[$key] == 'text')) {
|
||||
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
|
||||
|
||||
if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_cnct'])) {
|
||||
$sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key.'_cnct']."')";
|
||||
}
|
||||
} elseif (($extrafields->attribute_type[$key] == 'int') ||
|
||||
($extrafields->attribute_type[$key] == 'double')) {
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) {
|
||||
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")";
|
||||
}
|
||||
} elseif (($extrafields->attribute_type[$key] == 'date') ||
|
||||
($extrafields->attribute_type[$key] == 'datetime')) {
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){
|
||||
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
|
||||
}
|
||||
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
|
||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||
if ($arrayquery['options_'.$key.'_cnct']!=''){
|
||||
if ($arrayquery['options_'.$key.'_cnct']==0) {
|
||||
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))";
|
||||
@ -857,29 +861,32 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
//Standard Extrafield feature
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
|
||||
$elementtype = Societe::$table_element;
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
dol_include_once('/core/class/extrafields.class.php');
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('societe');
|
||||
|
||||
foreach($extralabels as $key=>$val) {
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
if (($extrafields->attribute_type[$key] == 'varchar') ||
|
||||
($extrafields->attribute_type[$key] == 'text')) {
|
||||
foreach($extrafields->attributes[$elementtype]['label'] as $key=>$val) {
|
||||
|
||||
if (($extrafields->attributes[$elementtype]['type'][$key] == 'varchar') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'text')) {
|
||||
if (!empty($arrayquery['options_'.$key])) {
|
||||
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
|
||||
}
|
||||
} elseif (($extrafields->attribute_type[$key] == 'int') ||
|
||||
($extrafields->attribute_type[$key] == 'double')) {
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_max'])) {
|
||||
$sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
|
||||
}
|
||||
} elseif (($extrafields->attribute_type[$key] == 'date') ||
|
||||
($extrafields->attribute_type[$key] == 'datetime')) {
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
|
||||
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
|
||||
}
|
||||
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
|
||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||
if ($arrayquery['options_'.$key]!=''){
|
||||
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ $hookmanager->initHooks(array('mailinglist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ $object = new Propal($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Load object
|
||||
if ($id > 0 || ! empty($ref)) {
|
||||
@ -410,7 +410,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
$error ++;
|
||||
$action = 'create';
|
||||
@ -841,9 +841,8 @@ if (empty($reshook))
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@ -1210,9 +1209,8 @@ if (empty($reshook))
|
||||
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@ -1379,8 +1377,7 @@ if (empty($reshook))
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||
if ($ret < 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
@ -1903,7 +1900,7 @@ if ($action == 'create')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$formquestion = array_merge($formquestion, array(
|
||||
$formquestion = array_merge($formquestion, array(
|
||||
array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
|
||||
));
|
||||
}
|
||||
@ -1983,7 +1980,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
if ($usercancreate)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
@ -2049,7 +2046,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $langs->trans('Date');
|
||||
print '</td>';
|
||||
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdate&id=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdate&id=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
|
||||
@ -2075,7 +2072,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $langs->trans('DateEndPropal');
|
||||
print '</td>';
|
||||
if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
|
||||
@ -2103,7 +2100,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editconditions' && $usercancreate) {
|
||||
@ -2131,7 +2128,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print ' (' . $langs->trans('AfterOrder') . ')';
|
||||
print '</td>';
|
||||
if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editavailability' && $usercancreate) {
|
||||
@ -2150,7 +2147,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $langs->trans('SendingMethod');
|
||||
print '</td>';
|
||||
if ($action != 'editshippingmethod' && $usercancreate)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editshippingmethod' && $usercancreate) {
|
||||
@ -2168,7 +2165,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $langs->trans('Source');
|
||||
print '</td>';
|
||||
if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdemandreason' && $usercancreate) {
|
||||
@ -2186,7 +2183,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) {
|
||||
@ -2206,7 +2203,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencycode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmulticurrencycode' && $usercancreate) {
|
||||
@ -2223,7 +2220,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencyrate' && $object->statut == Propal::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') && $usercancreate) {
|
||||
@ -2263,7 +2260,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print $langs->trans('BankAccount');
|
||||
print '</td>';
|
||||
if ($action != 'editbankaccount' && $usercancreate)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount') {
|
||||
@ -2298,7 +2295,7 @@ $formquestion = array_merge($formquestion, array(
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
print '<td><td class="right">';
|
||||
if ($usercancreate) print '<a href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
if ($usercancreate) print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
else print ' ';
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
|
||||
@ -171,7 +171,7 @@ if ($object->id > 0)
|
||||
if ($user->rights->propal->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -122,7 +122,7 @@ if ($object->id > 0)
|
||||
if ($user->rights->propal->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -87,7 +87,7 @@ if (! empty($conf->projet->enabled))
|
||||
if ($user->rights->propal->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -129,7 +129,7 @@ $hookmanager->initHooks(array('propallist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->propal->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -88,7 +88,7 @@ $object = new Commande($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
@ -284,7 +284,7 @@ if (empty($reshook))
|
||||
// Fill array 'array_options' with data from add form
|
||||
if (! $error)
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
}
|
||||
|
||||
@ -673,9 +673,8 @@ if (empty($reshook))
|
||||
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@ -1037,9 +1036,8 @@ if (empty($reshook))
|
||||
$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value
|
||||
|
||||
// Extrafields Lines
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield POST Data
|
||||
if (is_array($extralabelsline)) {
|
||||
foreach ($extralabelsline as $key => $value) {
|
||||
@ -1297,8 +1295,7 @@ if (empty($reshook))
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
@ -2096,7 +2093,7 @@ if ($action == 'create' && $usercancreate)
|
||||
if ($usercancreate)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
|
||||
@ -165,7 +165,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -124,7 +124,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -85,7 +85,7 @@ if (! empty($conf->projet->enabled))
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -111,7 +111,7 @@ $hookmanager->initHooks(array('orderlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('commande');
|
||||
$extrafields->fetch_name_optionals_label('commande');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -98,7 +98,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -72,8 +72,10 @@ $date_endy = dol_mktime(23, 59, 59, $_REQUEST["date_end_delymonth"], $_REQUEST["
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
$object=new Facture($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('facture');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
@ -141,7 +143,6 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
|
||||
|
||||
$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
|
||||
$object=new Facture($db);
|
||||
|
||||
// Insert new invoice in database
|
||||
if ($action == 'add' && $user->rights->facture->creer)
|
||||
@ -177,7 +178,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
$object->remise_absolue = $_POST['remise_absolue'];
|
||||
$object->remise_percent = $_POST['remise_percent'];
|
||||
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if ($_POST['origin'] && $_POST['originid'])
|
||||
|
||||
@ -137,7 +137,7 @@ $hookmanager->initHooks(array('banktransactionlist', $contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('banktransaction');
|
||||
$extrafields->fetch_name_optionals_label('banktransaction');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost('banktransaction', '', 'search_');
|
||||
|
||||
$arrayfields=array(
|
||||
@ -909,7 +909,7 @@ if ($resql)
|
||||
}
|
||||
if (! empty($arrayfields['balance']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print '<td class="liste_titre right">';
|
||||
$htmltext=$langs->trans("BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv("DateValue"));
|
||||
print $form->textwithpicto('', $htmltext, 1);
|
||||
print '</td>';
|
||||
|
||||
@ -57,8 +57,9 @@ $result=restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', ''
|
||||
|
||||
$object = new Account($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('bankcard','globalcard'));
|
||||
@ -136,7 +137,7 @@ if ($action == 'add')
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -241,7 +242,7 @@ if ($action == 'update')
|
||||
if (! $error)
|
||||
{
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -433,7 +434,7 @@ if ($action == 'create')
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook))
|
||||
{
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -142,7 +142,8 @@ if ($result)
|
||||
print "<td >".$objp->label."</td>";
|
||||
print '<td style="text-align: center;">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&action=edit">'.img_edit().'</a> ';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&action=delete">'.img_delete().'</a></td>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&action=delete">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>";
|
||||
$i++;
|
||||
|
||||
@ -73,7 +73,7 @@ $hookmanager->initHooks(array('bankaccountlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('bank_account');
|
||||
$extrafields->fetch_name_optionals_label('bank_account');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -428,7 +428,7 @@ if ($id)
|
||||
if ($user->rights->banque->modifier)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
|
||||
@ -93,7 +93,7 @@ if ($object->id)
|
||||
if ($user->rights->banque->modifier && 0)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
|
||||
@ -62,7 +62,7 @@ if (! empty($conf->projet->enabled))
|
||||
if ($user->rights->banque->modifier && 0)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
|
||||
@ -72,7 +72,7 @@ $object= new CashControl($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('cashcontrolcard','globalcard'));
|
||||
|
||||
@ -78,8 +78,10 @@ $object=new CashControl($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->monmodule->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('cashcontrol')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('cashcontrol'); // Load $extrafields->attributes['cashcontrol']
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
|
||||
@ -902,8 +902,7 @@ if (empty($reshook))
|
||||
$error = 0;
|
||||
$originentity = GETPOST('originentity');
|
||||
// Fill array 'array_options' with data from add form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
// Replacement invoice
|
||||
@ -1679,8 +1678,8 @@ if (empty($reshook))
|
||||
$nextSituationInvoice = new Facture($db);
|
||||
$nextSituationInvoice->fetch($id);
|
||||
// create extrafields with data from create form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $nextSituationInvoice);
|
||||
$extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $nextSituationInvoice);
|
||||
if ($ret > 0) {
|
||||
$nextSituationInvoice->insertExtraFields();
|
||||
}
|
||||
@ -1752,9 +1751,8 @@ if (empty($reshook))
|
||||
$remise_percent = GETPOST('remise_percent' . $predef);
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@ -2075,9 +2073,8 @@ if (empty($reshook))
|
||||
$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@ -2496,8 +2493,7 @@ if (empty($reshook))
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
@ -2585,7 +2581,7 @@ llxHeader('', $title, $helpurl);
|
||||
if ($action == 'create')
|
||||
{
|
||||
$facturestatic = new Facture($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element);
|
||||
$extrafields->fetch_name_optionals_label($facturestatic->table_element);
|
||||
|
||||
print load_fiche_titre($langs->trans('NewBill'), '', 'invoicing');
|
||||
|
||||
@ -3050,7 +3046,7 @@ if ($action == 'create')
|
||||
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : '');
|
||||
if (! $optionsav) $tmp.=' disabled';
|
||||
if (! $optionsav && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp.=' disabled';
|
||||
$tmp.= '> ';
|
||||
// Show credit note options only if we checked credit note
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
@ -3460,7 +3456,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if ($user->societe_id > 0 && $user->societe_id != $object->socid)
|
||||
{
|
||||
@ -3809,7 +3805,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
if ($usercancreate)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
@ -3913,7 +3909,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('DateInvoice');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && ! empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION))
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editinvoicedate&facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editinvoicedate&facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
|
||||
@ -3937,7 +3933,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DatePointOfTax');
|
||||
print '</td>';
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdate_pointoftax&facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdate_pointoftax&facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editdate_pointoftax') {
|
||||
@ -3954,7 +3950,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
@ -3975,7 +3971,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('DateMaxPayment');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editpaymentterm&facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editpaymentterm&facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
@ -3999,7 +3995,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $usercancreate)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode')
|
||||
@ -4022,7 +4018,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon))
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
$htmlname = (($usercancreate && $action == 'editmulticurrencycode')?'multicurrency_code':'none');
|
||||
@ -4060,7 +4056,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $usercancreate)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount')
|
||||
@ -4081,7 +4077,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
print '<td><td class="right">';
|
||||
if ($usercancreate) print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
if ($usercancreate) print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
else print ' ';
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
@ -4119,7 +4115,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('RetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarranty' && $user->rights->facture->creer){
|
||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editretainedwarranty&facid=' . $object->id . '">' . img_edit($langs->trans('setretainedwarranty'), 1) . '</a></td>';
|
||||
print '<td align="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editretainedwarranty&facid=' . $object->id . '">' . img_edit($langs->trans('setretainedwarranty'), 1) . '</a></td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
@ -4145,7 +4141,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('PaymentConditionsShortRetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer){
|
||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editretainedwarrantypaymentterms&facid=' . $object->id . '">' . img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1) . '</a></td>';
|
||||
print '<td align="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editretainedwarrantypaymentterms&facid=' . $object->id . '">' . img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1) . '</a></td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
@ -4188,7 +4184,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print $langs->trans('RetainedWarrantyDateLimit');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantydatelimit' && $user->rights->facture->creer){
|
||||
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editretainedwarrantydatelimit&facid=' . $object->id . '">' . img_edit($langs->trans('setretainedwarrantyDateLimit'), 1) . '</a></td>';
|
||||
print '<td align="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editretainedwarrantydatelimit&facid=' . $object->id . '">' . img_edit($langs->trans('setretainedwarrantyDateLimit'), 1) . '</a></td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
@ -4276,7 +4272,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $usercancreate)
|
||||
{
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4838,12 +4834,12 @@ elseif ($id > 0 || ! empty($ref))
|
||||
// Editer une facture deja validee, sans paiement effectue et pas exporte en compta
|
||||
if ($object->statut == Facture::STATUS_VALIDATED)
|
||||
{
|
||||
// We check that invlice lines are transferred into accountancy
|
||||
// We check if lines of invoice are not already transfered into accountancy
|
||||
$ventilExportCompta = $object->getVentilExportCompta();
|
||||
|
||||
if ($ventilExportCompta == 0)
|
||||
{
|
||||
if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_EDITED) || ($resteapayer == $object->total_ttc && empty($object->paye)))
|
||||
if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_EDITED) || ($resteapayer == price2num($object->total_ttc, 'MT', 1) && empty($object->paye)))
|
||||
{
|
||||
if (! $objectidnext && $object->is_last_in_cycle())
|
||||
{
|
||||
@ -4873,7 +4869,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|
||||
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|
||||
&& ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
|
||||
{
|
||||
if ($object->close_code != 'replaced' || (! $objectidnext)) // Not replaced by another invoice or replaced but the replacement invoice has been deleted
|
||||
@ -5055,7 +5051,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
// remove situation from cycle
|
||||
// Remove situation from cycle
|
||||
if ($object->statut > Facture::STATUS_DRAFT
|
||||
&& $object->type == Facture::TYPE_SITUATION
|
||||
&& $usercancreate
|
||||
|
||||
@ -518,14 +518,19 @@ class FactureRec extends CommonInvoice
|
||||
*/
|
||||
public function fetch_lines()
|
||||
{
|
||||
global $extrafields;
|
||||
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
|
||||
// Retreive all extrafield for line
|
||||
// fetch optionals attributes and labels
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafieldsline=new ExtraFields($this->db);
|
||||
$extrafieldsline=$extrafieldsline->fetch_name_optionals_label('facturedet_rec', true);
|
||||
if (! is_object($extrafields))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields=new ExtraFields($this->db);
|
||||
}
|
||||
$extrafields->fetch_name_optionals_label($this->table_element_line, true);
|
||||
|
||||
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, ';
|
||||
$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,';
|
||||
@ -599,7 +604,7 @@ class FactureRec extends CommonInvoice
|
||||
$line->price = $objp->price;
|
||||
$line->remise = $objp->remise;
|
||||
|
||||
$extralabelsline = $line->fetch_optionals($line->id);
|
||||
$line->fetch_optionals($line->id);
|
||||
|
||||
// Multicurrency
|
||||
$line->fk_multicurrency = $objp->fk_multicurrency;
|
||||
|
||||
@ -164,7 +164,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -131,7 +131,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -93,7 +93,8 @@ $hookmanager->initHooks(array('invoicereccard','globalcard'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('facture_rec');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||
@ -426,8 +427,7 @@ if (empty($reshook))
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
@ -468,9 +468,8 @@ if (empty($reshook))
|
||||
$remise_percent = GETPOST('remise_percent' . $predef);
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline))
|
||||
{
|
||||
@ -771,9 +770,8 @@ if (empty($reshook))
|
||||
$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
|
||||
$objectline = new FactureLigneRec($db);
|
||||
if ($objectline->fetch(GETPOST('lineid', 'int')))
|
||||
@ -1245,7 +1243,7 @@ else
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
@ -1310,7 +1308,7 @@ else
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($action != 'editconditions' && $user->rights->facture->creer)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
@ -1334,7 +1332,7 @@ else
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $user->rights->facture->creer)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode')
|
||||
@ -1397,7 +1395,7 @@ else
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount')
|
||||
@ -1419,7 +1417,7 @@ else
|
||||
print $langs->trans('Model');
|
||||
print '<td>';
|
||||
if (($action != 'editmodelpdf') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmodelpdf&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmodelpdf&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmodelpdf')
|
||||
@ -1468,7 +1466,7 @@ else
|
||||
print $langs->trans('Frequency');
|
||||
print '</td>';
|
||||
if ($action != 'editfrequency' && $user->rights->facture->creer)
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editfrequency')
|
||||
|
||||
@ -78,7 +78,7 @@ if (! empty($conf->projet->enabled))
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -108,7 +108,8 @@ $hookmanager->initHooks(array('invoicereccard','globalcard'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('facture_rec');
|
||||
$extrafields->fetch_name_optionals_label('facture_rec');
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
@ -141,7 +141,8 @@ $hookmanager->initHooks(array('invoicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('facture');
|
||||
$extrafields->fetch_name_optionals_label('facture');
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -101,7 +101,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -190,7 +190,7 @@ if ($object->id > 0)
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
@ -284,7 +284,7 @@ if ($object->id > 0)
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DateInvoice');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
|
||||
@ -311,7 +311,7 @@ if ($object->id > 0)
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
@ -336,7 +336,7 @@ if ($object->id > 0)
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DateMaxPayment');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
@ -364,7 +364,7 @@ if ($object->id > 0)
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
if ($action != 'editmode' && ! empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editmode')
|
||||
@ -383,7 +383,7 @@ if ($object->id > 0)
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon))
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editbankaccount')
|
||||
@ -457,7 +457,7 @@ if ($object->id > 0)
|
||||
print '</td>';
|
||||
if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer)
|
||||
{
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
|
||||
@ -639,7 +639,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
print $invoice->getNomUrl(1, '');
|
||||
if ($objp->socid != $facture->thirdparty->id) print ' - '.$soc->getNomUrl(1).' ';
|
||||
print "</td>\n";
|
||||
@ -650,7 +650,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
// Due date
|
||||
if ($objp->dlr > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td class="nowraponall center">';
|
||||
print dol_print_date($db->jdate($objp->dlr), 'day');
|
||||
|
||||
if ($invoice->hasDelay())
|
||||
|
||||
@ -576,7 +576,7 @@ else
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Date');
|
||||
print '</td>';
|
||||
if ($action != 'editdate') print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
if ($action != 'editdate') print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($action == 'editdate')
|
||||
@ -603,7 +603,7 @@ else
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('RefExt');
|
||||
print '</td>';
|
||||
if ($action != 'editrefext') print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editrefext&id='.$object->id.'">'.img_edit($langs->trans('SetRefExt'),1).'</a></td>';
|
||||
if ($action != 'editrefext') print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editrefext&id='.$object->id.'">'.img_edit($langs->trans('SetRefExt'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($action == 'editrefext')
|
||||
|
||||
@ -455,7 +455,7 @@ if ($id > 0)
|
||||
if ($user->rights->tax->charges->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
@ -537,7 +537,7 @@ if ($id > 0)
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode')
|
||||
print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&id=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode') {
|
||||
@ -555,7 +555,7 @@ if ($id > 0)
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if ($action != 'editbankaccount' && $user->rights->tax->charges->creer)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount') {
|
||||
|
||||
@ -59,7 +59,7 @@ $object = new Contact($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($id);
|
||||
|
||||
@ -60,7 +60,7 @@ $object = new Contact($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($id);
|
||||
@ -206,7 +206,7 @@ if (empty($reshook))
|
||||
$object->birthday_alert = GETPOST("birthday_alert", 'alpha');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0)
|
||||
{
|
||||
$error++;
|
||||
@ -373,7 +373,7 @@ if (empty($reshook))
|
||||
$object->note_private = GETPOST("note_private", 'none');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
|
||||
@ -136,7 +136,8 @@ $hookmanager->initHooks(array('contactlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('contact');
|
||||
$extrafields->fetch_name_optionals_label('contact');
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -165,7 +165,7 @@ if ($id > 0)
|
||||
if ($user->rights->contrat->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
|
||||
@ -81,11 +81,10 @@ if ($id > 0 || ! empty($ref) && $action!='add') {
|
||||
}
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// fetch optionals attributes lines and labels
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$extralabelslines=$extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
|
||||
$permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink=$user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php
|
||||
@ -217,7 +216,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
$error ++;
|
||||
$action = 'create';
|
||||
@ -455,9 +454,8 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@ -736,9 +734,8 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($objectline->table_element);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$objectline->array_options=$array_options;
|
||||
|
||||
// TODO verifier price_min si fk_product et multiprix
|
||||
@ -876,8 +873,7 @@ if (empty($reshook))
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error) {
|
||||
@ -1425,7 +1421,7 @@ else
|
||||
if ($user->rights->contrat->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
@ -1712,7 +1708,7 @@ else
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid);
|
||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $line->showOptionals($extrafields, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
}
|
||||
// Ligne en mode update
|
||||
@ -1786,7 +1782,7 @@ else
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid);
|
||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -745,8 +745,9 @@ class Contrat extends CommonObject
|
||||
*/
|
||||
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
// phpcs:enable
|
||||
// phpcs:enable
|
||||
global $langs, $conf, $extrafields;
|
||||
|
||||
$this->nbofserviceswait=0;
|
||||
$this->nbofservicesopened=0;
|
||||
$this->nbofservicesexpired=0;
|
||||
@ -758,10 +759,14 @@ class Contrat extends CommonObject
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafieldsline=new ExtraFields($this->db);
|
||||
if (! is_object($extrafields))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields=new ExtraFields($this->db);
|
||||
}
|
||||
|
||||
$line = new ContratLigne($this->db);
|
||||
$extralabelsline=$extrafieldsline->fetch_name_optionals_label($line->table_element, true);
|
||||
$extrafields->fetch_name_optionals_label($line->table_element, true);
|
||||
|
||||
$this->lines=array();
|
||||
$pos = 0;
|
||||
@ -2072,7 +2077,7 @@ class Contrat extends CommonObject
|
||||
* Return list of line rowid
|
||||
*
|
||||
* @param int $statut Status of lines to get
|
||||
* @return array Array of line's rowid
|
||||
* @return array|int Array of line's rowid or <0 if error
|
||||
*/
|
||||
public function array_detail($statut = -1)
|
||||
{
|
||||
@ -2109,7 +2114,7 @@ class Contrat extends CommonObject
|
||||
* Return list of other contracts for same company than current contract
|
||||
*
|
||||
* @param string $option 'all' or 'others'
|
||||
* @return array Array of contracts id
|
||||
* @return array|int Array of contracts id or <0 if error
|
||||
*/
|
||||
public function getListOfContracts($option = 'all')
|
||||
{
|
||||
|
||||
@ -169,7 +169,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->contrat->creer) {
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
|
||||
@ -143,7 +143,7 @@ if ($object->id)
|
||||
if ($user->rights->contrat->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -100,7 +100,8 @@ $hookmanager->initHooks(array('contractlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('contrat');
|
||||
$extrafields->fetch_name_optionals_label('contrat');
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
|
||||
@ -111,7 +111,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->contrat->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
|
||||
@ -84,7 +84,8 @@ $hookmanager->initHooks(array('contractservicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('contratdet');
|
||||
$extrafields->fetch_name_optionals_label('contratdet');
|
||||
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Security check
|
||||
|
||||
@ -163,7 +163,7 @@ abstract class CommonDocGenerator
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param Societe $object Object
|
||||
* @param Translate $outputlangs Language object for output
|
||||
* @return array Array of substitution key->code
|
||||
*/
|
||||
@ -221,7 +221,7 @@ abstract class CommonDocGenerator
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('societe', true);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element, true);
|
||||
$object->fetch_optionals();
|
||||
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
@ -295,7 +295,7 @@ abstract class CommonDocGenerator
|
||||
// Retrieve extrafields
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element, true);
|
||||
$object->fetch_optionals();
|
||||
|
||||
foreach($extrafields->attribute_label as $key => $label)
|
||||
@ -517,7 +517,7 @@ abstract class CommonDocGenerator
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true);
|
||||
$extrafields->fetch_name_optionals_label($extrafieldkey, true);
|
||||
$object->fetch_optionals();
|
||||
|
||||
$resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs);
|
||||
@ -592,7 +592,7 @@ abstract class CommonDocGenerator
|
||||
$array_key="line";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true);
|
||||
$extrafields->fetch_name_optionals_label($extrafieldkey, true);
|
||||
$line->fetch_optionals();
|
||||
|
||||
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
|
||||
@ -662,7 +662,7 @@ abstract class CommonDocGenerator
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('expedition', true);
|
||||
$extrafields->fetch_name_optionals_label('expedition', true);
|
||||
$object->fetch_optionals();
|
||||
|
||||
$array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs);
|
||||
@ -712,7 +712,7 @@ abstract class CommonDocGenerator
|
||||
$array_key = "line";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true);
|
||||
$extrafields->fetch_name_optionals_label($extrafieldkey, true);
|
||||
$line->fetch_optionals();
|
||||
|
||||
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
|
||||
|
||||
@ -3737,7 +3737,7 @@ abstract class CommonObject
|
||||
if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''
|
||||
|
||||
//var_dump($line->volume_units);
|
||||
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
|
||||
if ($weight_units < 50) // < 50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
|
||||
{
|
||||
$trueWeightUnit=pow(10, $weightUnit);
|
||||
$totalWeight += $weight * $qty * $trueWeightUnit;
|
||||
@ -3918,13 +3918,16 @@ abstract class CommonObject
|
||||
*/
|
||||
public function formAddObjectLine($dateSelector, $seller, $buyer, $defaulttpldir = '/core/tpl')
|
||||
{
|
||||
global $conf,$user,$langs,$object,$hookmanager;
|
||||
global $conf,$user,$langs,$object,$hookmanager,$extrafields;
|
||||
global $form,$bcnd,$var;
|
||||
|
||||
// Line extrafield
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafieldsline = new ExtraFields($this->db);
|
||||
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line);
|
||||
if (! is_object($extrafields))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
}
|
||||
$extrafields->fetch_name_optionals_label($this->table_element_line);
|
||||
|
||||
// Output template part (modules that overwrite templates must declare this into descriptor)
|
||||
// Use global variables + $dateSelector + $seller and $buyer
|
||||
@ -3970,7 +3973,7 @@ abstract class CommonObject
|
||||
*/
|
||||
public function printObjectLines($action, $seller, $buyer, $selected = 0, $dateSelector = 0, $defaulttpldir = '/core/tpl')
|
||||
{
|
||||
global $conf, $hookmanager, $langs, $user, $object, $form;
|
||||
global $conf, $hookmanager, $langs, $user, $object, $form, $extrafields;
|
||||
// TODO We should not use global var for this
|
||||
global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax;
|
||||
|
||||
@ -3981,11 +3984,14 @@ abstract class CommonObject
|
||||
$num = count($this->lines);
|
||||
|
||||
// Line extrafield
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafieldsline = new ExtraFields($this->db);
|
||||
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line);
|
||||
if (! is_object($extrafields))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
}
|
||||
$extrafields->fetch_name_optionals_label($this->table_element_line);
|
||||
|
||||
$parameters = array('num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline);
|
||||
$parameters = array('num'=>$num, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer, 'selected'=>$selected, 'table_element_line'=>$this->table_element_line);
|
||||
$reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($reshook))
|
||||
{
|
||||
@ -4025,18 +4031,18 @@ abstract class CommonObject
|
||||
{
|
||||
if (empty($line->fk_parent_line))
|
||||
{
|
||||
$parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline);
|
||||
$parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'table_element_line'=>$line->table_element);
|
||||
$reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
{
|
||||
$parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline, 'fk_parent_line'=>$line->fk_parent_line);
|
||||
$parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'table_element_line'=>$line->table_element, 'fk_parent_line'=>$line->fk_parent_line);
|
||||
$reshook = $hookmanager->executeHooks('printObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
}
|
||||
if (empty($reshook))
|
||||
{
|
||||
$this->printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected, $extrafieldsline, $defaulttpldir);
|
||||
$this->printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected, $extrafields, $defaulttpldir);
|
||||
}
|
||||
|
||||
$i++;
|
||||
@ -4057,11 +4063,11 @@ abstract class CommonObject
|
||||
* @param string $seller Object of seller third party
|
||||
* @param string $buyer Object of buyer third party
|
||||
* @param int $selected Object line selected
|
||||
* @param int $extrafieldsline Object of extrafield line attribute
|
||||
* @param Extrafields $extrafields Object of extrafields
|
||||
* @param string $defaulttpldir Directory where to find the template
|
||||
* @return void
|
||||
*/
|
||||
public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafieldsline = 0, $defaulttpldir = '/core/tpl')
|
||||
public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafields = null, $defaulttpldir = '/core/tpl')
|
||||
{
|
||||
global $conf,$langs,$user,$object,$hookmanager;
|
||||
global $form,$bc,$bcdd;
|
||||
@ -4897,6 +4903,8 @@ abstract class CommonObject
|
||||
public function fetch_optionals($rowid = null, $optionsArray = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $extrafields;
|
||||
|
||||
if (empty($rowid)) $rowid=$this->id;
|
||||
|
||||
// To avoid SQL errors. Probably not the better solution though
|
||||
@ -4909,7 +4917,6 @@ abstract class CommonObject
|
||||
if (! is_array($optionsArray))
|
||||
{
|
||||
// If $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page.
|
||||
global $extrafields;
|
||||
if (! isset($extrafields) || ! is_object($extrafields))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
@ -6591,8 +6598,8 @@ abstract class CommonObject
|
||||
//$out .= "titlefield";
|
||||
//if (GETPOST('action', 'none') == 'create') $out.='create';
|
||||
// BUG #11554 : For public page, use red dot for required fields, instead of bold label
|
||||
$context = isset($params["context"]) ? $params["context"] : "none";
|
||||
if ($context=="public") { // Public page : red dot instead of bold ble characters
|
||||
$tpl_context = isset($params["tpl_context"]) ? $params["tpl_context"] : "none";
|
||||
if ($tpl_context=="public") { // Public page : red dot instead of fieldrequired characters
|
||||
$out .= '">';
|
||||
if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
|
||||
else $out .= $labeltoshow;
|
||||
|
||||
@ -139,7 +139,7 @@ class DiscountAbsolute
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid";
|
||||
$sql.= " WHERE sr.entity = " . $conf->entity;
|
||||
$sql.= " WHERE sr.entity IN (".getEntity('invoice').")";
|
||||
if ($rowid) $sql.= " AND sr.rowid=".$rowid;
|
||||
if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source;
|
||||
if ($fk_invoice_supplier_source) $sql.= " AND sr.fk_invoice_supplier_source=".$fk_invoice_supplier_source;
|
||||
|
||||
@ -941,7 +941,7 @@ class DolGraph
|
||||
$tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-','.'))));
|
||||
|
||||
$this->stringtoshow ='<!-- Build using '.$this->_library.' -->'."\n";
|
||||
if (! empty($this->title)) $this->stringtoshow.='<div class="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
|
||||
if (! empty($this->title)) $this->stringtoshow.='<div class="center dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
|
||||
if (! empty($this->shownographyet))
|
||||
{
|
||||
$this->stringtoshow.='<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>';
|
||||
|
||||
@ -825,7 +825,7 @@ class ExtraFields
|
||||
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
|
||||
*
|
||||
* @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required.
|
||||
* @param boolean $forceload Force load of extra fields whatever is status of cache.
|
||||
* @return array Array of attributes keys+label for all extra fields.
|
||||
*/
|
||||
public function fetch_name_optionals_label($elementtype, $forceload = false)
|
||||
@ -835,14 +835,18 @@ class ExtraFields
|
||||
|
||||
if (empty($elementtype)) return array();
|
||||
|
||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
if ($elementtype == 'order_supplier') $elementtype='commande_fournisseur';
|
||||
|
||||
$array_name_label=array();
|
||||
|
||||
// To avoid conflicts with external modules. TODO Remove this.
|
||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
|
||||
if (empty($forceload) && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
|
||||
|
||||
// If already loaded
|
||||
// TODO Enable this cache test
|
||||
// if (empty($forceload) && ! empty($this->attributes[$tab->elementtype]['loaded'])) return $array_name_label;
|
||||
|
||||
// Set array of label of entity
|
||||
// TODO Remove completely loading of label. This should be done by presentation.
|
||||
@ -2007,14 +2011,15 @@ class ExtraFields
|
||||
/**
|
||||
* Fill array_options property of object by extrafields value (using for data sent by forms)
|
||||
*
|
||||
* @param array $extralabels Deprecated $array of extrafields
|
||||
* @param array $extralabels Deprecated (old $array of extrafields, now set this to null)
|
||||
* @param object $object Object
|
||||
* @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset.
|
||||
* @param string $onlykey Only the following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must set this to avoid to have other extrafields being reset.
|
||||
* @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example)
|
||||
*/
|
||||
public function setOptionalsFromPost($extralabels, &$object, $onlykey = '')
|
||||
{
|
||||
global $_POST, $langs;
|
||||
|
||||
$nofillrequired=0;// For error when required field left blank
|
||||
$error_field_required = array();
|
||||
|
||||
|
||||
@ -7450,11 +7450,7 @@ class Form
|
||||
*/
|
||||
public function showFilterButtons()
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$out='<div class="nowrap">';
|
||||
//$out.='<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")).'">';
|
||||
//$out.='<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")).'">';
|
||||
$out.='<button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
|
||||
$out.='<button type="submit" class="liste_titre button_removefilter" name="button_removefilter_x" value="x"><span class="fa fa-remove"></span></button>';
|
||||
$out.='</div>';
|
||||
|
||||
@ -241,7 +241,7 @@ class FormActions
|
||||
// Ref
|
||||
print '<td class="nowraponall">'.$ref.'</td>';
|
||||
// Onwer
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if (! empty($action->userownerid))
|
||||
{
|
||||
if (is_object($cacheusers[$action->userownerid]))
|
||||
|
||||
@ -1285,14 +1285,14 @@ class FormFile
|
||||
{
|
||||
if ($useinecm == 5 || $useinecm == 6)
|
||||
{
|
||||
$minifile=getImageFileNameForSize($file['name'], ''); // There is no thumb for ECM module and Media filemanager, so we use true image
|
||||
$smallfile=getImageFileNameForSize($file['name'], ''); // There is no thumb for ECM module and Media filemanager, so we use true image
|
||||
}
|
||||
else
|
||||
{
|
||||
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
|
||||
$smallfile=getImageFileNameForSize($file['name'], '_small'); // For new thumbs using same ext (in lower case however) than original
|
||||
}
|
||||
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
|
||||
//print $file['path'].'/'.$minifile.'<br>';
|
||||
if (! dol_is_file($file['path'].'/'.$smallfile)) $smallfile=getImageFileNameForSize($file['name'], '_small', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
|
||||
//print $file['path'].'/'.$smallfile.'<br>';
|
||||
|
||||
$urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity));
|
||||
if (empty($urlforhref)) {
|
||||
@ -1301,7 +1301,7 @@ class FormFile
|
||||
} else {
|
||||
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
|
||||
}
|
||||
print '<img class="photo" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6)? '12' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
|
||||
print '<img class="photo" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6)? '12' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
|
||||
print '</a>';
|
||||
}
|
||||
else print ' ';
|
||||
|
||||
@ -212,7 +212,7 @@ class FormMail extends Form
|
||||
/**
|
||||
* Remove a file from the list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @param string $keytodelete Key in file array (0, 1, 2, ...)
|
||||
* @param string $keytodelete Key index in file array (0, 1, 2, ...)
|
||||
* @return void
|
||||
*/
|
||||
public function remove_attached_files($keytodelete)
|
||||
|
||||
@ -145,7 +145,7 @@ class FormTicket
|
||||
$ticketstat = new Ticket($this->db);
|
||||
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($ticketstat->table_element);
|
||||
$extrafields->fetch_name_optionals_label($ticketstat->table_element);
|
||||
|
||||
print "\n<!-- Begin form TICKET -->\n";
|
||||
|
||||
@ -242,7 +242,7 @@ class FormTicket
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$uselocalbrowser = true;
|
||||
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser);
|
||||
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -939,13 +939,13 @@ class FormTicket
|
||||
if (is_array($contacts) && count($contacts) > 0) {
|
||||
foreach ($contacts as $key => $info_sendto) {
|
||||
if ($info_sendto['email'] != '') {
|
||||
$sendto[] = dol_escape_htmltag(trim($info_sendto['firstname'] . " " . $info_sendto['lastname']) . " <" . $info_sendto['email'] . "> (" . $info_sendto['libelle'] . ")");
|
||||
$sendto[] = dol_escape_htmltag(trim($info_sendto['firstname'] . " " . $info_sendto['lastname']) . " <" . $info_sendto['email'] . ">")." <small>(" . dol_escape_htmltag($info_sendto['libelle']) . ")</small>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($ticketstat->origin_email && !in_array($this->dao->origin_email, $sendto)) {
|
||||
$sendto[] = $ticketstat->origin_email . "(origin)";
|
||||
$sendto[] = dol_escape_htmltag($ticketstat->origin_email) . " <small>(".$langs->trans("TicketEmailOriginIssuer").")</small>";
|
||||
}
|
||||
|
||||
if ($ticketstat->fk_soc > 0) {
|
||||
@ -953,12 +953,12 @@ class FormTicket
|
||||
$ticketstat->fetch_thirdparty();
|
||||
|
||||
if (is_array($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) {
|
||||
$sendto[] = $ticketstat->thirdparty->email . '(' . $langs->trans('Customer') . ')';
|
||||
$sendto[] = $ticketstat->thirdparty->email . ' <small>(' . $langs->trans('Customer') . ')</small>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS) {
|
||||
$sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO . '(generic email)';
|
||||
$sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO . ' <small>(generic email)</small>';
|
||||
}
|
||||
|
||||
// Print recipient list
|
||||
|
||||
@ -781,6 +781,8 @@ class Translate
|
||||
if (preg_match('/^[a-z]+_[A-Z]+/i', $dir))
|
||||
{
|
||||
$this->load("languages");
|
||||
|
||||
if (! empty($conf->global->MAIN_LANGUAGES_ALLOWED) && ! in_array($dir, explode(',', $conf->global->MAIN_LANGUAGES_ALLOWED)) ) continue;
|
||||
|
||||
if ($usecode == 2)
|
||||
{
|
||||
|
||||
@ -50,7 +50,7 @@ if (empty($conf->dol_no_mouse_hover))
|
||||
{
|
||||
print 'jQuery(".classfortooltip").tooltip({
|
||||
show: { collision: "flipfit", effect:\'toggle\', delay:50 },
|
||||
hide: { delay: 50 },
|
||||
hide: { delay: 250 },
|
||||
tooltipClass: "mytooltip",
|
||||
content: function () {
|
||||
console.log("Return title for popup");
|
||||
|
||||
@ -913,7 +913,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
||||
|
||||
$contactstatic = new Contact($db);
|
||||
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($contactstatic->table_element);
|
||||
$extrafields->fetch_name_optionals_label($contactstatic->table_element);
|
||||
|
||||
$contactstatic->fields=array(
|
||||
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
||||
|
||||
@ -560,6 +560,9 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
|
||||
$out=dol_string_nohtmltag($out);
|
||||
}
|
||||
break;
|
||||
case 'restricthtml': // Recommended for most html textarea
|
||||
$out=dol_string_onlythesehtmltags($out, 0);
|
||||
break;
|
||||
case 'custom':
|
||||
if (empty($filter)) return 'BadFourthParameterForGETPOST';
|
||||
$out=filter_var($out, $filter, $options);
|
||||
@ -4581,7 +4584,7 @@ function price2num($amount, $rounding = '', $alreadysqlnb = 0)
|
||||
* Output a dimension with best unit
|
||||
*
|
||||
* @param float $dimension Dimension
|
||||
* @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, 98=ounce, 99=pound, ...)
|
||||
* @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...)
|
||||
* @param string $type 'weight', 'volume', ...
|
||||
* @param Translate $outputlangs Translate language object
|
||||
* @param int $round -1 = non rounding, x = number of decimal
|
||||
@ -4625,7 +4628,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
|
||||
$unit = $forceunitoutput;
|
||||
}*/
|
||||
|
||||
$ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type);
|
||||
$ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string(0, $type, $unit);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user