Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop_ldap
This commit is contained in:
commit
edaa558ef7
@ -18,6 +18,8 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are
|
||||
already available and are better.
|
||||
* Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better.
|
||||
* The hook contaxt commcard has been renamed thirdpartycomm
|
||||
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
|
||||
|
||||
|
||||
***** ChangeLog for 7.0.1 compared to 7.0.0 *****
|
||||
|
||||
@ -40,6 +40,7 @@ $action = GETPOST('action','aZ09');
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist'; // To manage different context of search
|
||||
|
||||
$search_account = GETPOST("search_account");
|
||||
$search_label = GETPOST("search_label");
|
||||
@ -74,8 +75,6 @@ $arrayfields=array(
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -79,6 +79,7 @@ if (! $sortorder) { $sortorder=($filter=='outofdate'?"DESC":"ASC"); }
|
||||
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); }
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new Adherent($db);
|
||||
$hookmanager->initHooks(array('memberlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
||||
$action=GETPOST('action','aZ09');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminaccoutant'; // To manage different context of search
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("companies");
|
||||
@ -37,9 +38,6 @@ if (! $user->admin) accessforbidden();
|
||||
|
||||
$error=0;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('adminaccoutant','globaladmin');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
||||
$action=GETPOST('action','aZ09');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'admincompany'; // To manage different context of search
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("companies");
|
||||
@ -47,8 +48,7 @@ if (! $user->admin) accessforbidden();
|
||||
$error=0;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('admincompany','globaladmin');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('admincompany','globaladmin'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -46,12 +46,10 @@ $langs->load("agenda");
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','aZ09');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminihm'; // To manage different context of search
|
||||
|
||||
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('adminihm','globaladmin');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -35,6 +35,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$langs->loadLangs(array("users","companies","agenda","commercial"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'actioncommlist'; // To manage different context of search
|
||||
$resourceid=GETPOST("resourceid","int");
|
||||
$year=GETPOST("year",'int');
|
||||
$month=GETPOST("month",'int');
|
||||
@ -68,8 +69,6 @@ $filtert = GETPOST("filtert","int",3);
|
||||
$usergroup = GETPOST("usergroup","int",3);
|
||||
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
||||
|
||||
$contextpage='actioncommlist';
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('actioncomm');
|
||||
@ -114,6 +113,7 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new ActionComm($db);
|
||||
$hookmanager->initHooks(array('agendalist'));
|
||||
|
||||
$arrayfields=array(
|
||||
|
||||
@ -82,7 +82,7 @@ $extrafields = new ExtraFields($db);
|
||||
$extralabels=$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('commcard','globalcard'));
|
||||
$hookmanager->initHooks(array('thirdpartycomm','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -53,6 +53,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'proposallist';
|
||||
|
||||
$search_user=GETPOST('search_user','int');
|
||||
$search_sale=GETPOST('search_sale','int');
|
||||
@ -95,9 +96,6 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='p.ref';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'proposallist';
|
||||
|
||||
// Security check
|
||||
$module='propal';
|
||||
$dbtable='';
|
||||
@ -114,6 +112,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
|
||||
$diroutputmassaction=$conf->propal->multidir_output[$conf->entity] . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new Propal($db);
|
||||
$hookmanager->initHooks(array('propallist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'orderlist';
|
||||
|
||||
$search_orderyear=GETPOST("search_orderyear","int");
|
||||
$search_ordermonth=GETPOST("search_ordermonth","int");
|
||||
@ -95,11 +96,9 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='c.ref';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'orderlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Commande($db);
|
||||
$hookmanager->initHooks(array('orderlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -54,6 +54,7 @@ $ref = GETPOST('ref','alpha');
|
||||
$action=GETPOST('action','alpha');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
|
||||
@ -120,10 +121,6 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
||||
//var_dump($contextpage);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('banktransactionlist', $contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
use Stripe\BankAccount;
|
||||
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
@ -42,6 +44,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'bankaccountlist'; // To manage different context of search
|
||||
|
||||
$search_ref=GETPOST('search_ref','alpha');
|
||||
$search_label=GETPOST('search_label','alpha');
|
||||
@ -66,11 +69,9 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='b.label';
|
||||
if (! $sortorder) $sortorder='ASC';
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage='bankaccountlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Account($db);
|
||||
$hookmanager->initHooks(array('bankaccountlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -3014,19 +3014,19 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), -1, 'bill');
|
||||
|
||||
$formconfirm = array();
|
||||
$formconfirm = '';
|
||||
|
||||
// Confirmation de la conversion de l'avoir en reduc
|
||||
//if ($action == 'converttoreduc') {
|
||||
if ($action == 'converttoreduc') {
|
||||
if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived';
|
||||
elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote';
|
||||
elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit';
|
||||
$text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac)));
|
||||
$formconfirm['converttoreduc'] = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 'converttoreduc');
|
||||
//}
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2);
|
||||
}
|
||||
|
||||
// Confirmation to delete invoice
|
||||
//if ($action == 'delete') {
|
||||
if ($action == 'delete') {
|
||||
$text = $langs->trans('ConfirmDeleteBill', $object->ref);
|
||||
$formquestion = array();
|
||||
|
||||
@ -3050,15 +3050,15 @@ else if ($id > 0 || ! empty($ref))
|
||||
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
|
||||
// => 1),
|
||||
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"))));
|
||||
$formconfirm['delete'] = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 'delete');
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1);
|
||||
} else {
|
||||
$formconfirm['delete'] = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 'delete');
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', 'no', 1);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
// Confirmation of validation
|
||||
//if ($action == 'valid')
|
||||
//{
|
||||
if ($action == 'valid')
|
||||
{
|
||||
// we check object has a draft number
|
||||
$objectref = substr($object->ref, 1, 4);
|
||||
if ($objectref == 'PROV') {
|
||||
@ -3116,11 +3116,11 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$text .= '<br>' . img_warning() . ' ' . $langs->trans("ErrorInvoiceOfThisTypeMustBePositive");
|
||||
}
|
||||
$formconfirm['valid'] = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 'valid');
|
||||
//}
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2);
|
||||
}
|
||||
|
||||
// Confirm back to draft status
|
||||
//if ($action == 'modif') {
|
||||
if ($action == 'modif') {
|
||||
$text = $langs->trans('ConfirmUnvalidateBill', $object->ref);
|
||||
$formquestion = array();
|
||||
|
||||
@ -3153,45 +3153,45 @@ else if ($id > 0 || ! empty($ref))
|
||||
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $value));
|
||||
}
|
||||
|
||||
$formconfirm['modif'] = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('UnvalidateBill'), $text, 'confirm_modif', $formquestion, "yes", 'modif');
|
||||
//}
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('UnvalidateBill'), $text, 'confirm_modif', $formquestion, "yes", 1);
|
||||
}
|
||||
|
||||
// Confirmation du classement paye
|
||||
if (/*$action == 'paid' && */$resteapayer <= 0) {
|
||||
$formconfirm['paid'] = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 'paid');
|
||||
} else {
|
||||
//if ($action == 'paid' $resteapayer > 0) {
|
||||
if ($action == 'paid' && $resteapayer <= 0) {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
|
||||
}
|
||||
if ($action == 'paid' && $resteapayer > 0) {
|
||||
// Code
|
||||
$i = 0;
|
||||
$close [$i] ['code'] = 'discount_vat'; // escompte
|
||||
$close [$i]['code'] = 'discount_vat'; // escompte
|
||||
$i ++;
|
||||
$close [$i] ['code'] = 'badcustomer';
|
||||
$close [$i]['code'] = 'badcustomer';
|
||||
$i ++;
|
||||
// Help
|
||||
$i = 0;
|
||||
$close [$i] ['label'] = $langs->trans("HelpEscompte") . '<br><br>' . $langs->trans("ConfirmClassifyPaidPartiallyReasonDiscountVatDesc");
|
||||
$close [$i]['label'] = $langs->trans("HelpEscompte") . '<br><br>' . $langs->trans("ConfirmClassifyPaidPartiallyReasonDiscountVatDesc");
|
||||
$i ++;
|
||||
$close [$i] ['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");
|
||||
$close [$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");
|
||||
$i ++;
|
||||
// Texte
|
||||
$i = 0;
|
||||
$close [$i] ['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscount", $resteapayer, $langs->trans("Currency" . $conf->currency)), $close [$i] ['label'], 1);
|
||||
$close [$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscount", $resteapayer, $langs->trans("Currency" . $conf->currency)), $close[$i]['label'], 1);
|
||||
$i ++;
|
||||
$close [$i] ['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency" . $conf->currency)), $close [$i] ['label'], 1);
|
||||
$close [$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency" . $conf->currency)), $close[$i]['label'], 1);
|
||||
$i ++;
|
||||
// arrayreasons[code]=reason
|
||||
foreach ($close as $key => $val) {
|
||||
$arrayreasons [$close [$key] ['code']] = $close [$key] ['reason'];
|
||||
$arrayreasons[$close [$key]['code']] = $close[$key]['reason'];
|
||||
}
|
||||
|
||||
// Cree un tableau formulaire
|
||||
$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"),array('type' => 'radio','name' => 'close_code','label' => $langs->trans("Reason"),'values' => $arrayreasons),array('type' => 'text','name' => 'close_note','label' => $langs->trans("Comment"),'value' => '','size' => '100'));
|
||||
$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"),array('type' => 'radio','name' => 'close_code','label' => $langs->trans("Reason"),'values' => $arrayreasons),array('type' => 'text','name' => 'close_note','label' => $langs->trans("Comment"),'value' => '','morecss' => 'minwidth300'));
|
||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||
$formconfirm['paid'] = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes", 'paid');
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes", 1, 250);
|
||||
}
|
||||
|
||||
// Confirmation du classement abandonne
|
||||
//if ($action == 'canceled') {
|
||||
if ($action == 'canceled') {
|
||||
// S'il y a une facture de remplacement pas encore validee (etat brouillon),
|
||||
// on ne permet pas de classer abandonner la facture.
|
||||
if ($objectidnext) {
|
||||
@ -3216,57 +3216,47 @@ else if ($id > 0 || ! empty($ref))
|
||||
$arrayreasons [$close [2] ['code']] = $close [2] ['reason'];
|
||||
|
||||
// Cree un tableau formulaire
|
||||
$formquestion = array('text' => $langs->trans("ConfirmCancelBillQuestion"),array('type' => 'radio','name' => 'close_code','label' => $langs->trans("Reason"),'values' => $arrayreasons),array('type' => 'text','name' => 'close_note','label' => $langs->trans("Comment"),'value' => '','size' => '100'));
|
||||
$formquestion = array('text' => $langs->trans("ConfirmCancelBillQuestion"),array('type' => 'radio','name' => 'close_code','label' => $langs->trans("Reason"),'values' => $arrayreasons),array('type' => 'text','name' => 'close_note','label' => $langs->trans("Comment"),'value' => '','morecss' => 'minwidth300'));
|
||||
|
||||
$formconfirm['canceled'] = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('CancelBill'), $langs->trans('ConfirmCancelBill', $object->ref), 'confirm_canceled', $formquestion, "yes");
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('CancelBill'), $langs->trans('ConfirmCancelBill', $object->ref), 'confirm_canceled', $formquestion, "yes", 1, 250);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
//if ($action == 'deletepaiement')
|
||||
//{
|
||||
if ($action == 'deletepaiement')
|
||||
{
|
||||
$payment_id = GETPOST('paiement_id');
|
||||
$formconfirm['deletepaiement'] = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 'deletepaiement');
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 'no', 1);
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
// Confirmation de la suppression d'une ligne produit
|
||||
//if ($action == 'ask_deleteline') {
|
||||
$formconfirm['ask_deleteline'] = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 'ask_deleteline');
|
||||
//}
|
||||
if ($action == 'ask_deleteline') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
|
||||
}
|
||||
|
||||
// Clone confirmation
|
||||
//if ($action == 'clone')
|
||||
//{
|
||||
if ($action == 'clone')
|
||||
{
|
||||
// Create an array for form
|
||||
$formquestion = array(
|
||||
// 'text' => $langs->trans("ConfirmClone"),
|
||||
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
|
||||
array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1)));
|
||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||
$formconfirm['clone'] = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 'clone');
|
||||
//}
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
}
|
||||
|
||||
|
||||
if (! empty($formconfirm[$action]))
|
||||
if (! $formconfirm)
|
||||
{
|
||||
$parameters = array('lineid' => $lineid);
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $formconfirm[$action].=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm[$action]=$hookmanager->resPrint;
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm[$action];
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
console.log("BLBL");
|
||||
$("#dialog-confirm-'.$action.'").dialog("open");
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
// Invoice content
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
@ -3914,13 +3904,9 @@ else if ($id > 0 || ! empty($ref))
|
||||
print '<td align="center">';
|
||||
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
|
||||
{
|
||||
print '<a'.($conf->use_javascript_ajax?' class="butActionFormConfirm" data-action-confirm="deletepaiement"':'').' href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['deletepaiement'];
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -4212,11 +4198,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="modif':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif">' . $langs->trans('Modify') . '</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['modif'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif">' . $langs->trans('Modify') . '</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans('Modify') . '</span></div>';
|
||||
}
|
||||
@ -4245,7 +4227,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=reopen">' . $langs->trans('ReOpen') . '</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=reopen">' . $langs->trans('ReOpen') . '</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('ReOpen') . '</span></div>';
|
||||
}
|
||||
@ -4256,11 +4238,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="valid':'').'" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=valid">' . $langs->trans('Validate') . '</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['valid'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=valid">' . $langs->trans('Validate') . '</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -4332,28 +4310,16 @@ else if ($id > 0 || ! empty($ref))
|
||||
// For standard invoice with excess received
|
||||
if ($object->type == Facture::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $user->rights->facture->creer && empty($discount->id))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="converttoreduc':'').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertExcessReceivedToReduc').'</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['converttoreduc'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertExcessReceivedToReduc').'</a></div>';
|
||||
}
|
||||
// For credit note
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->creer && $object->getSommePaiement() == 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="modif':'').'" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['converttoreduc'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>';
|
||||
}
|
||||
// For deposit invoice
|
||||
if ($object->type == Facture::TYPE_DEPOSIT && $user->rights->facture->creer && empty($discount->id))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="modif':'').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['converttoreduc'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -4362,11 +4328,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $user->rights->facture->paiement && empty($discount->id))
|
||||
)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="paid':'').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['paid'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a></div>';
|
||||
}
|
||||
|
||||
// Classify 'closed not completely paid' (possible si validee et pas encore classee payee)
|
||||
@ -4376,11 +4338,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
if ($totalpaye > 0 || $totalcreditnotes > 0)
|
||||
{
|
||||
// If one payment or one credit note was linked to this invoice
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="paid':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=paid">' . $langs->trans('ClassifyPaidPartially') . '</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['paid'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=paid">' . $langs->trans('ClassifyPaidPartially') . '</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4392,7 +4350,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=canceled">' . $langs->trans('ClassifyCanceled') . '</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=canceled">' . $langs->trans('ClassifyCanceled') . '</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4401,11 +4359,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
// Clone
|
||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $user->rights->facture->creer)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="clone':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=clone&object=invoice">' . $langs->trans("ToClone") . '</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['clone'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=clone&object=invoice">' . $langs->trans("ToClone") . '</a></div>';
|
||||
}
|
||||
|
||||
// Clone as predefined / Create template
|
||||
@ -4464,11 +4418,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete'.($conf->use_javascript_ajax?' butActionFormConfirm" data-action-confirm="delete':'').'" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a></div>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['delete'];
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a></div>';
|
||||
}
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("NotAllowed") . '">' . $langs->trans('Delete') . '</a></div>';
|
||||
|
||||
@ -66,6 +66,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'invoicelist';
|
||||
|
||||
$lineid=GETPOST('lineid','int');
|
||||
$userid=GETPOST('userid','int');
|
||||
@ -114,9 +115,6 @@ if (! $sortfield) $sortfield='f.datef';
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'invoicelist';
|
||||
|
||||
// Security check
|
||||
$fieldid = (! empty($ref)?'facnumber':'rowid');
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
@ -129,6 +127,7 @@ $object=new Facture($db);
|
||||
$now=dol_now();
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new Facture($db);
|
||||
$hookmanager->initHooks(array('invoicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -504,18 +504,18 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<tr><td class="'.(GETPOST('paiementcode')=='CHQ'?'fieldrequired ':'').'fieldrequireddyn">'.$langs->trans('CheckTransmitter');
|
||||
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||
print '</td>';
|
||||
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST('chqemetteur').'"></td></tr>';
|
||||
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST('chqemetteur','alphanohtml').'"></td></tr>';
|
||||
|
||||
// Bank name
|
||||
print '<tr><td>'.$langs->trans('Bank');
|
||||
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||
print '</td>';
|
||||
print '<td><input name="chqbank" size="30" type="text" value="'.GETPOST('chqbank').'"></td></tr>';
|
||||
print '<td><input name="chqbank" size="30" type="text" value="'.GETPOST('chqbank','alphanohtml').'"></td></tr>';
|
||||
|
||||
// Comments
|
||||
print '<tr><td>'.$langs->trans('Comments').'</td>';
|
||||
print '<td class="tdtop">';
|
||||
print '<textarea name="comment" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.GETPOST('comment').'</textarea></td></tr>';
|
||||
print '<textarea name="comment" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.GETPOST('comment','none').'</textarea></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -34,9 +34,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load('bills');
|
||||
$langs->load('banks');
|
||||
$langs->load('companies');
|
||||
$langs->loadLangs(array('bills','banks','companies'));
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$ref=GETPOST('ref', 'alpha');
|
||||
@ -222,57 +220,64 @@ print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">'."\n";
|
||||
|
||||
// Date payment
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).'</td><td>';
|
||||
print $form->editfieldval("Date",'datep',$object->date,$object,$user->rights->facture->paiement,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Payment type (VIR, LIQ, ...)
|
||||
$labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_libelle;
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="3">'.$labeltype.'</td></tr>';
|
||||
|
||||
// Payment numero
|
||||
print '<tr><td>'.$form->editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
|
||||
print $form->editfieldval("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount,'',$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
// Note
|
||||
print '<tr><td class="tdtop">'.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->facture->paiement).'</td><td colspan="3">';
|
||||
print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->facture->paiement,'textarea');
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$labeltype.'</td></tr>';
|
||||
|
||||
$disable_delete = 0;
|
||||
// Bank account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($object->fk_account > 0)
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($object->bank_line);
|
||||
if ($bankline->rappro)
|
||||
{
|
||||
$disable_delete = 1;
|
||||
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
|
||||
}
|
||||
if ($object->fk_account > 0)
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($object->bank_line);
|
||||
if ($bankline->rappro)
|
||||
{
|
||||
$disable_delete = 1;
|
||||
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
|
||||
}
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $bankline->getNomUrl(1,0,'showconciliated');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankAccount').'</td>';
|
||||
print '<td>';
|
||||
$accountstatic=new Account($db);
|
||||
$accountstatic->fetch($bankline->fk_account);
|
||||
print $accountstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print $accountstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Payment numero
|
||||
/*
|
||||
$titlefield=$langs->trans('Numero').' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||
print '<tr><td>'.$form->editfieldkey($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
|
||||
print $form->editfieldval($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Check transmitter
|
||||
$titlefield=$langs->trans('CheckTransmitter').' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||
print '<tr><td>'.$form->editfieldkey($titlefield,'chqemetteur',$object->,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
|
||||
print $form->editfieldval($titlefield,'chqemetteur',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeMakeUpdateSucceeded'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank name
|
||||
$titlefield=$langs->trans('Bank').' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||
print '<tr><td>'.$form->editfieldkey($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
|
||||
print $form->editfieldval($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeBankUpdateSucceeded'));
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
// Bank account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($object->fk_account > 0)
|
||||
{
|
||||
if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0)
|
||||
{
|
||||
dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php');
|
||||
@ -280,15 +285,30 @@ if (! empty($conf->banque->enabled))
|
||||
$bordereau->fetch($bankline->fk_bordereau);
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('CheckReceipt').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>'.$langs->trans('CheckReceipt').'</td>';
|
||||
print '<td>';
|
||||
print $bordereau->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||
print '<td>';
|
||||
print $bankline->getNomUrl(1,0,'showconciliated');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Comments
|
||||
print '<tr><td class="tdtop">'.$form->editfieldkey("Comments",'note',$object->note,$object,$user->rights->facture->paiement).'</td><td>';
|
||||
print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->facture->paiement,'textarea:'.ROWS_3.':90%');
|
||||
print '</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount,'',$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -59,6 +59,7 @@ class Paiement extends CommonObject
|
||||
// de llx_paiement qui est lie aux types de
|
||||
//paiement de llx_c_paiement
|
||||
var $num_paiement; // Numero du CHQ, VIR, etc...
|
||||
var $num_payment; // Numero du CHQ, VIR, etc...
|
||||
var $bank_account; // Id compte bancaire du paiement
|
||||
var $bank_line; // Id de la ligne d'ecriture bancaire
|
||||
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
|
||||
@ -88,7 +89,7 @@ class Paiement extends CommonObject
|
||||
{
|
||||
$sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.fk_bank,';
|
||||
$sql.= ' c.code as type_code, c.libelle as type_libelle,';
|
||||
$sql.= ' p.num_paiement, p.note,';
|
||||
$sql.= ' p.num_paiement as num_payment, p.note,';
|
||||
$sql.= ' b.fk_account';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
||||
@ -110,7 +111,9 @@ class Paiement extends CommonObject
|
||||
$this->ref = $obj->ref?$obj->ref:$obj->rowid;
|
||||
$this->date = $this->db->jdate($obj->dp);
|
||||
$this->datepaye = $this->db->jdate($obj->dp);
|
||||
$this->numero = $obj->num_paiement;
|
||||
$this->numero = $obj->num_payment; // deprecated
|
||||
$this->num_paiement = $obj->num_payment; // deprecated
|
||||
$this->num_payment = $obj->num_payment;
|
||||
$this->montant = $obj->amount; // deprecated
|
||||
$this->amount = $obj->amount;
|
||||
$this->note = $obj->note;
|
||||
|
||||
@ -121,7 +121,8 @@ else if ($type == "o")
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Contact($db);
|
||||
$hookmanager->initHooks(array('contactlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -264,6 +264,7 @@ class Contrat extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @param string $comment Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @see closeAll
|
||||
*/
|
||||
function activateAll($user, $date_start='', $notrigger=0, $comment='')
|
||||
{
|
||||
@ -279,7 +280,7 @@ class Contrat extends CommonObject
|
||||
foreach($this->lines as $contratline)
|
||||
{
|
||||
// Open lines not already open
|
||||
if ($contratline->statut != 4)
|
||||
if ($contratline->statut != ContratLigne::STATUS_OPEN)
|
||||
{
|
||||
$contratline->context = $this->context;
|
||||
|
||||
@ -319,6 +320,7 @@ class Contrat extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @param string $comment Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @see activateAll
|
||||
*/
|
||||
function closeAll(User $user, $notrigger=0, $comment='')
|
||||
{
|
||||
@ -334,11 +336,11 @@ class Contrat extends CommonObject
|
||||
foreach($this->lines as $contratline)
|
||||
{
|
||||
// Close lines not already closed
|
||||
if ($contratline->statut != 5)
|
||||
if ($contratline->statut != ContratLigne::STATUS_CLOSED)
|
||||
{
|
||||
$contratline->date_cloture=$now;
|
||||
$contratline->fk_user_cloture=$user->id;
|
||||
$contratline->statut='5';
|
||||
$contratline->statut=ContratLigne::STATUS_CLOSED;
|
||||
$result=$contratline->close_line($user, $now, $comment, $notrigger);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -806,10 +808,10 @@ class Contrat extends CommonObject
|
||||
//dol_syslog("1 ".$line->desc);
|
||||
//dol_syslog("2 ".$line->product_desc);
|
||||
|
||||
if ($line->statut == 0) $this->nbofserviceswait++;
|
||||
if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++;
|
||||
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
|
||||
if ($line->statut == 5) $this->nbofservicesclosed++;
|
||||
if ($line->statut == ContratLigne::STATUS_INITIAL) $this->nbofserviceswait++;
|
||||
if ($line->statut == ContratLigne::STATUS_OPEN && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++;
|
||||
if ($line->statut == ContratLigne::STATUS_OPEN && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
|
||||
if ($line->statut == ContratLigne::STATUS_CLOSED) $this->nbofservicesclosed++;
|
||||
|
||||
$total_ttc+=$objp->total_ttc; // TODO Not saved into database
|
||||
$total_vat+=$objp->total_tva;
|
||||
@ -2518,6 +2520,11 @@ class ContratLigne extends CommonObjectLine
|
||||
var $fk_user_cloture;
|
||||
var $commentaire;
|
||||
|
||||
const STATUS_INITIAL = 0;
|
||||
const STATUS_OPEN = 4;
|
||||
const STATUS_CLOSED = 5;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -2556,51 +2563,51 @@ class ContratLigne extends CommonObjectLine
|
||||
$langs->load("contracts");
|
||||
if ($mode == 0)
|
||||
{
|
||||
if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && $expired == 0) { return $langs->trans("ServiceStatusNotLate"); }
|
||||
if ($statut == 4 && $expired == 1) { return $langs->trans("ServiceStatusLate"); }
|
||||
if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); }
|
||||
if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLate"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLate"); }
|
||||
if ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort"); }
|
||||
if ($statut == 4 && $expired == 1) { return $langs->trans("ServiceStatusLateShort"); }
|
||||
if ($statut == 5) { return $langs->trans("ServiceStatusClosed"); }
|
||||
if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort"); }
|
||||
if ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLateShort"); }
|
||||
if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLateShort"); }
|
||||
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
|
||||
if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLateShort"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLateShort"); }
|
||||
if ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0',$moreatt); }
|
||||
if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4',$moreatt); }
|
||||
if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4',$moreatt); }
|
||||
if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3',$moreatt); }
|
||||
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6',$moreatt); }
|
||||
if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0',$moreatt); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4',$moreatt); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4',$moreatt); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3',$moreatt); }
|
||||
if ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6',$moreatt); }
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLate"); }
|
||||
if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLate"); }
|
||||
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
|
||||
if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLate"); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLate"); }
|
||||
if ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut == 0) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
|
||||
if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
|
||||
if ($statut == 4 && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort").' '.img_picto($langs->trans('ServiceStatusNotLateShort'),'statut4'); }
|
||||
if ($statut == 4 && $expired == 1) { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
|
||||
if ($statut == 5) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
|
||||
if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort").' '.img_picto($langs->trans('ServiceStatusNotLateShort'),'statut4'); }
|
||||
if ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
|
||||
if ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
|
||||
}
|
||||
}
|
||||
|
||||
@ -3096,13 +3103,13 @@ class ContratLigne extends CommonObjectLine
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "contratdet SET statut = 4,";
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "contratdet SET statut = ".ContratLigne::STATUS_OPEN.",";
|
||||
$sql .= " date_ouverture = " . (dol_strlen($date) != 0 ? "'" . $this->db->idate($date) . "'" : "null") . ",";
|
||||
if ($date_end >= 0) $sql .= " date_fin_validite = " . (dol_strlen($date_end) != 0 ? "'" . $this->db->idate($date_end) . "'" : "null") . ",";
|
||||
$sql .= " fk_user_ouverture = " . $user->id . ",";
|
||||
$sql .= " date_cloture = null,";
|
||||
$sql .= " commentaire = '" . $this->db->escape($comment) . "'";
|
||||
$sql .= " WHERE rowid = " . $this->id . " AND (statut = 0 OR statut = 3 OR statut = 5)";
|
||||
$sql .= " WHERE rowid = " . $this->id . " AND (statut = ".ContratLigne::STATUS_INITIAL." OR statut = ".ContratLigne::STATUS_CLOSED.")";
|
||||
|
||||
dol_syslog(get_class($this) . "::active_line", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@ -3114,7 +3121,7 @@ class ContratLigne extends CommonObjectLine
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->statut = 4;
|
||||
$this->statut = ContratLigne::STATUS_OPEN;
|
||||
$this->date_ouverture = $date;
|
||||
$this->date_fin_validite = $date_end;
|
||||
$this->fk_user_ouverture = $user->id;
|
||||
@ -3160,11 +3167,11 @@ class ContratLigne extends CommonObjectLine
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "contratdet SET statut = 5,";
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "contratdet SET statut = ".ContratLigne::STATUS_CLOSED.",";
|
||||
$sql .= " date_cloture = '" . $this->db->idate($date_end) . "',";
|
||||
$sql .= " fk_user_cloture = " . $user->id . ",";
|
||||
$sql .= " commentaire = '" . $this->db->escape($comment) . "'";
|
||||
$sql .= " WHERE rowid = " . $this->id . " AND statut = 4";
|
||||
$sql .= " WHERE rowid = " . $this->id . " AND statut = ".ContratLigne::STATUS_OPEN;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -45,6 +45,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractlist'; // To manage different context of search
|
||||
|
||||
$search_name=GETPOST('search_name');
|
||||
$search_email=GETPOST('search_email');
|
||||
@ -95,10 +96,8 @@ $staticcontratligne=new ContratLigne($db);
|
||||
if ($search_status == '') $search_status=1;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage='contractlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Contrat($db);
|
||||
$hookmanager->initHooks(array('contractlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -53,6 +53,7 @@ $search_status=GETPOST("search_status","alpha");
|
||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractservicelist'.$mode;
|
||||
|
||||
$opouvertureprevuemonth=GETPOST('opouvertureprevuemonth');
|
||||
$opouvertureprevueday=GETPOST('opouvertureprevueday');
|
||||
@ -74,11 +75,10 @@ $opclotureday=GETPOST('opclotureday');
|
||||
$opclotureyear=GETPOST('opclotureyear');
|
||||
$filter_opcloture=GETPOST('filter_opcloture');
|
||||
|
||||
// Initialize context for list
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractservicelist'.$mode;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new ContratLigne($db);
|
||||
$hookmanager->initHooks(array('contractservicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -739,6 +739,21 @@ class ExtraFields
|
||||
// To avoid conflicts with external modules. TODO Remove this.
|
||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
|
||||
|
||||
// Set array of label of entity
|
||||
$labelmulticompany=array();
|
||||
if (!empty($conf->multicompany->enabled))
|
||||
{
|
||||
$sql_entity_name='SELECT rowid, label FROM '.MAIN_DB_PREFIX.'entity WHERE rowid in (0,'.$conf->entity.')';
|
||||
$resql_entity_name=$this->db->query($sql_entity_name);
|
||||
if ($resql_entity_name)
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($resql_entity_name))
|
||||
{
|
||||
$labelmulticompany[$obj->rowid]=$obj->label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
|
||||
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
|
||||
|
||||
@ -778,6 +793,7 @@ class ExtraFields
|
||||
$this->attribute_langfile[$tab->name]=$tab->langs;
|
||||
$this->attribute_list[$tab->name]=$tab->list;
|
||||
$this->attribute_entityid[$tab->name]=$tab->entity;
|
||||
$this->attribute_entitylabel[$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]);
|
||||
|
||||
// New usage
|
||||
$this->attributes[$tab->elementtype]['type'][$tab->name]=$tab->type;
|
||||
@ -795,23 +811,7 @@ class ExtraFields
|
||||
$this->attributes[$tab->elementtype]['langfile'][$tab->name]=$tab->langs;
|
||||
$this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list;
|
||||
$this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity;
|
||||
|
||||
if (!empty($conf->multicompany->enabled))
|
||||
{
|
||||
$sql_entity_name='SELECT label FROM '.MAIN_DB_PREFIX.'entity WHERE rowid='.$tab->entity;
|
||||
$resql_entity_name=$this->db->query($sql_entity_name);
|
||||
if ($resql_entity_name)
|
||||
{
|
||||
if ($this->db->num_rows($resql_entity_name))
|
||||
{
|
||||
if ($obj = $this->db->fetch_object($resql_entity_name))
|
||||
{
|
||||
$this->attribute_entitylabel[$tab->name]=$obj->label; // Old usage
|
||||
$this->attributes[$tab->elementtype]['entitylabel'][$tab->name]=$obj->label;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->attributes[$tab->elementtype]['entitylabel'][$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]);
|
||||
|
||||
$this->attributes[$tab->elementtype]['loaded']=1;
|
||||
}
|
||||
@ -1743,7 +1743,7 @@ class ExtraFields
|
||||
*/
|
||||
function showSeparator($key)
|
||||
{
|
||||
$out = '<tr class="trextrafieldseparator"><td colspan="4"><strong>'.$this->attribute_label[$key].'</strong></td></tr>';
|
||||
$out = '<tr class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="4"><strong>'.$this->attribute_label[$key].'</strong></td></tr>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
@ -169,7 +169,7 @@ class Form
|
||||
$ret.='<input type="hidden" name="action" value="set'.$htmlname.'">';
|
||||
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$ret.='<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
|
||||
if (empty($notabletag)) $ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
if (empty($notabletag)) $ret.='<table class="nobordernopadding centpercent" cellpadding="0" cellspacing="0">';
|
||||
if (empty($notabletag)) $ret.='<tr><td>';
|
||||
if (preg_match('/^(string|email)/',$typeofdata))
|
||||
{
|
||||
@ -1072,11 +1072,11 @@ class Form
|
||||
// On recherche les societes
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.entity IN (".getEntity('societe').")";
|
||||
if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if (! empty($user->socid)) $sql.= " AND s.rowid = ".$user->socid;
|
||||
if ($filter) $sql.= " AND (".$filter.")";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status <> 0";
|
||||
// Add criteria
|
||||
if ($filterkey && $filterkey != '')
|
||||
@ -3596,8 +3596,8 @@ class Form
|
||||
* @param string $question Question
|
||||
* @param string $action Action
|
||||
* @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , ))
|
||||
* type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', ...
|
||||
* @param string $selectedchoice '' or 'no' or 'yes' or '1' or '0'
|
||||
* type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ...
|
||||
* @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0'
|
||||
* @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
|
||||
* @param int $height Force height of box
|
||||
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
||||
|
||||
@ -1090,13 +1090,4 @@ $(document).ready(function() {
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).on('click', 'a.butActionFormConfirm', function() {
|
||||
var action = $(this).data('action-confirm');
|
||||
$('#dialog-confirm-'+action).dialog('open');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// End of lib_head.js.php
|
||||
|
||||
@ -3083,13 +3083,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
$pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
|
||||
|
||||
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
||||
if (in_array($pictowithoutext, array('delete', 'edit', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'switch_off', 'switch_on', 'unlink', 'uparrow')))
|
||||
if (in_array($pictowithoutext, array('bank', 'delete', 'edit', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'switch_off', 'switch_on', 'unlink', 'uparrow')))
|
||||
{
|
||||
$fakey = $pictowithoutext; $facolor=''; $fasize='';
|
||||
if ($pictowithoutext == 'switch_off') { $fakey = 'fa-toggle-off'; $facolor='#999'; $fasize='2em'; }
|
||||
elseif ($pictowithoutext == 'switch_on') { $fakey = 'fa-toggle-on'; $facolor='#227722'; $fasize='2em'; }
|
||||
elseif ($pictowithoutext == 'off') { $fakey = 'fa-square-o'; $fasize='1.3em'; }
|
||||
elseif ($pictowithoutext == 'on') { $fakey = 'fa-check-square-o'; $fasize='1.3em'; }
|
||||
elseif ($pictowithoutext == 'bank') { $fakey = 'fa-bank'; $facolor='#444'; }
|
||||
elseif ($pictowithoutext == 'delete') { $fakey = 'fa-trash'; $facolor='#444'; }
|
||||
elseif ($pictowithoutext == 'edit') { $fakey = 'fa-pencil'; $facolor='#444'; }
|
||||
elseif ($pictowithoutext == 'printer') { $fakey = 'fa-print'; $fasize='1.2em'; $facolor='#444'; }
|
||||
|
||||
@ -8,16 +8,17 @@ if (empty($conf) || ! is_object($conf))
|
||||
}
|
||||
|
||||
// Loop to show all columns of extrafields for the title line
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
if (is_array($extrafields->attributes[$object->element]['label']) && count($extrafields->attributes[$object->element]['label']))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attributes[$object->element]['label'] as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n";
|
||||
if (! empty($extrafields->attributes[$object->element]['computed'][$key])) $sortonfield='';
|
||||
if ($extrafields->attributes[$object->element]['type'][$key] == 'separate') print '<th class="liste_titre thseparator"></th>';
|
||||
else print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -277,13 +277,9 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
|
||||
<td class="linecoldelete" align="center"><?php $coldisplay++; ?>
|
||||
<?php
|
||||
if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) {
|
||||
print '<a'.($conf->use_javascript_ajax?' class="butActionFormConfirm" data-action-confirm="ask_deleteline"':'').' href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action='.($conf->use_javascript_ajax?'confirm_deleteline':'ask_deleteline').'&lineid=' . $line->id . '">';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
||||
if($conf->use_javascript_ajax) {
|
||||
print $formconfirm['ask_deleteline'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
@ -32,6 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
$langs->loadLangs(array("sendings","deliveries",'companies','bills'));
|
||||
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'shipmentlist'; // To manage different context of search
|
||||
|
||||
$socid=GETPOST('socid','int');
|
||||
// Security check
|
||||
$expeditionid = GETPOST('id','int');
|
||||
@ -64,9 +66,6 @@ $offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage='shipmentlist';
|
||||
|
||||
$viewstatut=GETPOST('viewstatut');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
|
||||
@ -43,6 +43,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'expensereportlist';
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -82,10 +83,8 @@ $optioncss = GETPOST('optioncss','alpha');
|
||||
if ($search_status == '') $search_status=-1;
|
||||
if ($search_user == '') $search_user=-1;
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'expensereportlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new ExpenseReport($db);
|
||||
$hookmanager->initHooks(array('expensereportlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'interventionlist';
|
||||
|
||||
$search_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha');
|
||||
$search_company=GETPOST('search_company','alpha');
|
||||
@ -72,9 +73,6 @@ if (! $sortfield)
|
||||
else $sortfield="f.ref";
|
||||
}
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'interventionlist';
|
||||
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$search_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha');
|
||||
$search_company=GETPOST('search_company','alpha');
|
||||
@ -83,7 +81,8 @@ $search_status=GETPOST('search_status');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Fichinter($db);
|
||||
$hookmanager->initHooks(array('interventionlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -53,6 +53,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierorderlist';
|
||||
|
||||
$orderyear=GETPOST("orderyear","int");
|
||||
$ordermonth=GETPOST("ordermonth","int");
|
||||
@ -109,11 +110,9 @@ if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
if ($search_status == '') $search_status=-1;
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierorderlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new CommandeFournisseur($db);
|
||||
$hookmanager->initHooks(array('supplierorderlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -55,6 +55,7 @@ $show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierinvoicelist';
|
||||
|
||||
$socid = GETPOST('socid','int');
|
||||
|
||||
@ -118,16 +119,12 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.datef,f.rowid";
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierinvoicelist';
|
||||
|
||||
$diroutputmassaction=$conf->fournisseur->facture->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
$object=new FactureFournisseur($db);
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new FactureFournisseur($db);
|
||||
$hookmanager->initHooks(array('supplierinvoicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
@ -877,7 +874,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
// Type
|
||||
if (! empty($arrayfields['f.type']['checked']))
|
||||
{
|
||||
|
||||
@ -34,6 +34,7 @@ $langs->load('users');
|
||||
$langs->load('hrm');
|
||||
|
||||
$action=GETPOST('action','aZ09');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'defineholidaylist';
|
||||
|
||||
$search_name=GETPOST('search_name', 'alpha');
|
||||
$search_supervisor=GETPOST('search_supervisor', 'int');
|
||||
@ -58,9 +59,6 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
if (!$user->rights->holiday->read) accessforbidden();
|
||||
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'defineholidaylist';
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('defineholidaylist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -357,7 +355,7 @@ else
|
||||
print '<td>';
|
||||
if ($canedit) print '<input type="text"'.($canedit?'':' disabled="disabled"').' class="maxwidthonsmartphone" value="" name="note_holiday['.$users['rowid'].']" size="30"/>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Button modify
|
||||
print '<td>';
|
||||
if (! empty($user->rights->holiday->define_holiday)) // Allowed to set the balance of any user
|
||||
|
||||
@ -49,6 +49,8 @@ delete from llx_user_rights where fk_user not IN (select rowid from llx_user);
|
||||
delete from llx_usergroup_rights where fk_usergroup not in (select rowid from llx_usergroup);
|
||||
delete from llx_usergroup_rights where fk_id not in (select id from llx_rights_def);
|
||||
|
||||
ALTER TABLE llx_inventory ADD COLUMN fk_product integer DEFAULT NULL;
|
||||
ALTER TABLE llx_inventory MODIFY COLUMN fk_warehouse integer DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_c_type_fees ADD COLUMN llx_c_type_fees integer DEFAULT 0;
|
||||
|
||||
|
||||
@ -27,7 +27,8 @@ CREATE TABLE llx_inventory
|
||||
fk_user_creat integer, -- user making creation
|
||||
fk_user_modif integer, -- user making last change
|
||||
fk_user_valid integer, -- valideur de la fiche
|
||||
fk_warehouse integer DEFAULT 0,
|
||||
fk_warehouse integer DEFAULT NULL,
|
||||
fk_product integer DEFAULT NULL,
|
||||
status integer DEFAULT 0,
|
||||
title varchar(255) NOT NULL,
|
||||
date_inventory datetime DEFAULT NULL,
|
||||
|
||||
@ -24,6 +24,7 @@ Movements=Movements
|
||||
ErrorWarehouseRefRequired=Warehouse reference name is required
|
||||
ListOfWarehouses=List of warehouses
|
||||
ListOfStockMovements=List of stock movements
|
||||
ListOfInventories=List of inventories
|
||||
MovementId=Movement ID
|
||||
StockMovementForId=Movement ID %d
|
||||
ListMouvementStockProject=List of stock movements associated to project
|
||||
|
||||
@ -127,6 +127,11 @@ class modMyModule extends DolibarrModules
|
||||
1=>array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
||||
);
|
||||
|
||||
// Some keys to add into the overwriting translation tables
|
||||
/*$this->overwrite_translation = array(
|
||||
'en_US:ParentCompany'=>'Parent company or reseller',
|
||||
'fr_FR:ParentCompany'=>'Maison mère ou revendeur'
|
||||
)*/
|
||||
|
||||
if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled))
|
||||
{
|
||||
|
||||
@ -85,7 +85,7 @@ if (! $sortorder) $sortorder='DESC';
|
||||
$object=new MyObject($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('myobjectagenda')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('myobjectagenda','globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
||||
$object=new MyObject($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('myobjectcard')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('myobjectcard','globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
|
||||
@ -74,7 +74,7 @@ if (! $sortfield) $sortfield="name";
|
||||
$object=new MyObject($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('myobjectdocument')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('myobjectdocument','globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
||||
|
||||
@ -85,7 +85,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
||||
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
@ -130,11 +130,12 @@ foreach($object->fields as $key => $val)
|
||||
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||
}
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
if (is_array($extrafields->attributes[$object->element]['label']) && count($extrafields->attributes[$object->element]['label']))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attributes[$object->element]['label'] as $key => $val)
|
||||
{
|
||||
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
|
||||
if (! empty($extrafields->attributes[$object->element]['list'][$key]))
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->element]['list'][$key])!=3 && $extrafields->attributes[$object->element]['perms'][$key]));
|
||||
}
|
||||
}
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
@ -210,14 +211,14 @@ foreach($object->fields as $key => $val)
|
||||
$sql.='t.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
foreach ($extrafields->attributes[$object->element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql=preg_replace('/, $/','', $sql);
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
if (is_array($extrafields->attributes[$object->element]['label']) && count($extrafields->attributes[$object->element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('myobject').")";
|
||||
else $sql.=" WHERE 1 = 1";
|
||||
foreach($search as $key => $val)
|
||||
@ -241,7 +242,7 @@ foreach($object->fields as $key => $val)
|
||||
$sql.='t.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
|
||||
foreach ($extrafields->attributes[$object->element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->element]['type'][$key] != 'separate' ? ",ef.".$key : '');
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -434,7 +435,7 @@ print '</tr>'."\n";
|
||||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine=0;
|
||||
foreach ($extrafields->attribute_computed as $key => $val)
|
||||
foreach ($extrafields->attributes[$object->element]['computed'] as $key => $val)
|
||||
{
|
||||
if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
||||
$object=new MyObject($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('myobjectnote')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('myobjectnote','globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
||||
|
||||
@ -71,6 +71,7 @@ $permissionnote=1;
|
||||
//$permissionnote=$user->rights->mymodule->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
@ -47,6 +47,8 @@ $ref = GETPOST('ref', 'alpha');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$cancel=GETPOST('cancel', 'alpha');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'pricesuppliercard';
|
||||
|
||||
$socid=GETPOST('socid', 'int');
|
||||
$cost_price=GETPOST('cost_price', 'alpha');
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
@ -79,8 +81,6 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="s.nom";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$contextpage='pricesuppliercard';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('pricesuppliercard','globalcard'));
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ include_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("inventory","other"));
|
||||
$langs->loadLangs(array("stocks","other"));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
@ -76,11 +76,12 @@ class Inventory extends CommonObject
|
||||
*/
|
||||
public $fields=array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
|
||||
'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object', 'css'=>'maxwidth200'),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
||||
'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300'),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'index'=>1, 'help'=>'LinkToThirparty'),
|
||||
'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1,),
|
||||
'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object', 'css'=>'maxwidth200'),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
||||
'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300'),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'LinkToThirparty'),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'LinkToProduct'),
|
||||
'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1, 'position'=>35),
|
||||
|
||||
'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502,),
|
||||
'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512,),
|
||||
@ -358,31 +359,31 @@ class Inventory extends CommonObject
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($status == 0) return img_picto($langs->trans('Draft'),'statut5').' '.$langs->trans('Draft');
|
||||
if ($status == 0) return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($status == 0) return img_picto($langs->trans('Draft'),'statut5');
|
||||
if ($status == 0) return img_picto($langs->trans('Draft'),'statut0');
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($status == 0) return img_picto($langs->trans('Draft'),'statut5').' '.$langs->trans('Draft');
|
||||
if ($status == 0) return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($status == 0) return $langs->trans('Draft').' '.img_picto($langs->trans('Draft'),'statut5');
|
||||
if ($status == 0) return $langs->trans('Draft').' '.img_picto($langs->trans('Draft'),'statut0');
|
||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == -1) return $langs->trans('Canceled').' '.img_picto($langs->trans('Canceled'),'statut6');
|
||||
}
|
||||
if ($mode == 6)
|
||||
{
|
||||
if ($status == 0) return $langs->trans('Draft').' '.img_picto($langs->trans('Draft'),'statut5');
|
||||
if ($status == 0) return $langs->trans('Draft').' '.img_picto($langs->trans('Draft'),'statut0');
|
||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($status == -1) return $langs->trans('Canceled').' '.img_picto($langs->trans('Canceled'),'statut6');
|
||||
}
|
||||
|
||||
@ -28,19 +28,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("inventory","other"));
|
||||
$langs->loadLangs(array("stocks","other"));
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$massaction = GETPOST('massaction','alpha');
|
||||
$show_files = GETPOST('show_files','int');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
|
||||
$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ?
|
||||
$confirm = GETPOST('confirm','alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'inventorylist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$backtopage = GETPOST('backtopage','alpha');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
@ -65,7 +65,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search
|
||||
if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
// Protection if external user
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
@ -78,7 +78,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = restrictedArea($user, 'stock', $objectid, '', 'advance_inventory');
|
||||
$result = restrictedArea($user, 'stock', $objectid, '', 'advance_inventory');
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
@ -101,22 +101,24 @@ $arrayfields=array();
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']);
|
||||
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||
}
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
if (is_array($extrafields->attributes[$object->element]['label']) && count($extrafields->attributes[$object->element]['label']))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attributes[$object->element]['label'] as $key => $val)
|
||||
{
|
||||
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
|
||||
if (! empty($extrafields->attributes[$object->element]['list'][$key]))
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->element]['list'][$key])!=3 && $extrafields->attributes[$object->element]['perms'][$key]));
|
||||
}
|
||||
}
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ACTIONS
|
||||
* Actions
|
||||
*
|
||||
* Put here all code to do according to value of "$action" parameter
|
||||
*/
|
||||
@ -161,9 +163,9 @@ if (empty($reshook))
|
||||
|
||||
|
||||
/*
|
||||
* VIEW
|
||||
* View
|
||||
*
|
||||
* Put here all code to build page
|
||||
* Put here all code to render page
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
@ -172,7 +174,7 @@ $now=dol_now();
|
||||
|
||||
//$help_url="EN:Module_Inventory|FR:Module_Inventory_FR|ES:Módulo_Inventory";
|
||||
$help_url='';
|
||||
$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Inventorys"));
|
||||
$title = $langs->trans('ListOfInventories');
|
||||
|
||||
|
||||
// Build and execute select
|
||||
@ -183,18 +185,19 @@ foreach($object->fields as $key => $val)
|
||||
$sql.='t.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
foreach ($extrafields->attributes[$object->element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql=preg_replace('/, $/','', $sql);
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('inventory').")";
|
||||
if (is_array($extrafields->attributes[$object->element]['label']) && count($extrafields->attributes[$object->element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('myobject').")";
|
||||
else $sql.=" WHERE 1 = 1";
|
||||
foreach($search as $key => $val)
|
||||
{
|
||||
if ($key == 'status' && $search[$key] == -1) continue;
|
||||
$mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0);
|
||||
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
|
||||
}
|
||||
@ -207,18 +210,18 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters, $object)
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
/* If a group by is required
|
||||
$sql.= " GROUP BY "
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$sql.='t.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
*/
|
||||
$sql.= " GROUP BY "
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$sql.='t.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attributes[$object->element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->element]['type'][$key] != 'separate' ? ",ef.".$key : '');
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
*/
|
||||
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
|
||||
@ -229,17 +232,31 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if (! $resql)
|
||||
// if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
if (($page * $limit) > $nbtotalofrecords)
|
||||
{
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
// if total resultset is smaller the limit, no need to do paging.
|
||||
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
{
|
||||
$resql = $result;
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$resql=$db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
}
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
|
||||
@ -284,9 +301,10 @@ if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
'builddoc'=>$langs->trans("PDFMerge"),
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
@ -348,7 +366,7 @@ print '<tr class="liste_titre">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
||||
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
||||
@ -374,7 +392,7 @@ print '<tr class="liste_titre">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
||||
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
|
||||
@ -382,16 +400,16 @@ foreach($object->fields as $key => $val)
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine=0;
|
||||
foreach ($extrafields->attribute_computed as $key => $val)
|
||||
foreach ($extrafields->attributes[$object->element]['computed'] as $key => $val)
|
||||
{
|
||||
if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
}
|
||||
|
||||
@ -94,7 +94,8 @@ if ((string) $type == '1') { $contextpage='servicelist'; if ($search_type=='') $
|
||||
if ((string) $type == '0') { $contextpage='productlist'; if ($search_type=='') $search_type='0'; }
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object=new Product($db);
|
||||
$hookmanager->initHooks(array('productservicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form=new Form($db);
|
||||
|
||||
@ -179,13 +180,16 @@ $arrayfields=array(
|
||||
'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Buy").')', 'checked'=>1, 'position'=>1000)
|
||||
);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
if (is_array($extrafields->attributes[$object->element]['label']) && count($extrafields->attributes[$object->element]['label']))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
|
||||
}
|
||||
foreach($extrafields->attributes[$object->element]['label'] as $key => $val)
|
||||
{
|
||||
if (! empty($extrafields->attributes[$object->element]['list'][$key]))
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->element]['list'][$key])!=3 && $extrafields->attributes[$object->element]['perms'][$key]));
|
||||
}
|
||||
}
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
|
||||
|
||||
@ -274,13 +278,13 @@ else
|
||||
$sql .= ', pac.rowid prod_comb_id';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
foreach ($extrafields->attributes[$object->element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->element]['type'][$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
|
||||
if (is_array($extrafields->attributes[$object->element]['label']) && count($extrafields->attributes[$object->element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
|
||||
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
// multilang
|
||||
@ -331,7 +335,7 @@ else
|
||||
$sql .= ', pac.rowid';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
|
||||
foreach ($extrafields->attributes[$object->element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->element]['type'][$key] != 'separate' ? ",ef.".$key : '');
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@ -53,6 +53,8 @@ $msid=GETPOST('msid','int');
|
||||
$product_id=GETPOST("product_id");
|
||||
$action=GETPOST('action','aZ09');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist';
|
||||
|
||||
$idproduct = GETPOST('idproduct','int');
|
||||
$year = GETPOST("year");
|
||||
$month = GETPOST("month");
|
||||
@ -77,11 +79,9 @@ if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
$pdluoid=GETPOST('pdluoid','int');
|
||||
|
||||
// Initialize context for list
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new MouvementStock($db);
|
||||
$hookmanager->initHooks(array('movementlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
@ -107,7 +107,6 @@ $arrayfields=array(
|
||||
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
|
||||
);
|
||||
|
||||
$object = new MouvementStock($db); // To be passed as parameter of executeHooks that need
|
||||
|
||||
|
||||
/*
|
||||
@ -818,10 +817,10 @@ if ($resql)
|
||||
print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -860,7 +859,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['origin']['checked'])) print_liste_field_titre($arrayfields['origin']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['m.value']['checked'])) print_liste_field_titre($arrayfields['m.value']['label'],$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['m.price']['checked'])) print_liste_field_titre($arrayfields['m.price']['label'],$_SERVER["PHP_SELF"], "m.price","",$param,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
|
||||
@ -891,7 +890,7 @@ if ($resql)
|
||||
$productstatic->label=$objp->produit;
|
||||
$productstatic->type=$objp->type;
|
||||
$productstatic->entity=$objp->entity;
|
||||
$productstatic->status_batch=$objp->tobatch;
|
||||
$productstatic->status_batch=$objp->tobatch;
|
||||
|
||||
$productlot->id = $objp->lotid;
|
||||
$productlot->batch= $objp->batch;
|
||||
|
||||
@ -81,6 +81,7 @@ if ($user->societe_id > 0)
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$object = new Productlot($db);
|
||||
$hookmanager->initHooks(array('product_lotlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
@ -119,7 +120,6 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
}
|
||||
|
||||
// Load object if id or ref is provided as parameter
|
||||
$object=new Productlot($db);
|
||||
if (($id > 0 || ! empty($ref)) && $action != 'add')
|
||||
{
|
||||
$result=$object->fetch($id,$ref);
|
||||
|
||||
@ -39,6 +39,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'projectlist';
|
||||
|
||||
$title = $langs->trans("Projects");
|
||||
|
||||
@ -95,12 +96,9 @@ $search_eyear = GETPOST('search_eyear','int');
|
||||
|
||||
if ($search_status == '') $search_status=-1; // -1 or 1
|
||||
|
||||
|
||||
// Initialize context for list
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'projectlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Project($db);
|
||||
$hookmanager->initHooks(array('projectlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
@ -141,7 +139,6 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
}
|
||||
}
|
||||
|
||||
$object = new Project($db);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -71,7 +71,8 @@ $search_eyear = GETPOST('search_eyear','int');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'tasklist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Task($db);
|
||||
$hookmanager->initHooks(array('tasklist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
@ -131,8 +132,6 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
}
|
||||
}
|
||||
|
||||
$object = new Task($db);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -72,6 +72,7 @@ if (! $sortfield) $sortfield='t.task_date,t.task_datehour,t.rowid';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
//$object = new TaskTime($db);
|
||||
$hookmanager->initHooks(array('projecttaskcard','globalcard'));
|
||||
|
||||
$object = new Task($db);
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
|
||||
/**
|
||||
* \file resource/index.php
|
||||
* \ingroup resource
|
||||
* \brief Page to manage resource objects
|
||||
* \ingroup resource
|
||||
* \brief Page to manage resource objects
|
||||
*/
|
||||
|
||||
|
||||
@ -43,8 +43,8 @@ $sortfield = GETPOST('sortfield','alpha');
|
||||
// Initialize context for list
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'resourcelist';
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new Dolresource($db);
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
@ -84,7 +84,7 @@ foreach ($search_array_options as $key => $val)
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
|
||||
|
||||
$hookmanager->initHooks(array('resource_list'));
|
||||
$hookmanager->initHooks(array('resourcelist'));
|
||||
|
||||
if (empty($sortorder)) $sortorder="ASC";
|
||||
if (empty($sortfield)) $sortfield="t.ref";
|
||||
|
||||
@ -203,7 +203,9 @@ class CompanyPaymentMode extends CommonObject
|
||||
*/
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
return $this->createCommon($user, $notrigger);
|
||||
$idpayment = $this->createCommon($user, $notrigger);
|
||||
|
||||
return $idpayment;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1327,7 +1327,6 @@ class Societe extends CommonObject
|
||||
|
||||
$result = 1;
|
||||
|
||||
// Retreive all extrafield
|
||||
// fetch optionals attributes and labels
|
||||
$this->fetch_optionals();
|
||||
}
|
||||
|
||||
@ -69,6 +69,10 @@ if ($id > 0 || ! empty($ref))
|
||||
$courrier_dir = $conf->societe->multidir_output[$object->entity] . "/courrier/" . get_exdir($object->id,0,0,0,$object,'thirdparty');
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('thirdpartydocument','globalcard'));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -45,6 +45,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'thirdpartylist';
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -106,18 +107,13 @@ $offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage='thirdpartylist';
|
||||
/*if ($search_type == '1,3') { $contextpage='customerlist'; $type='c'; }
|
||||
if ($search_type == '2,3') { $contextpage='prospectlist'; $type='p'; }
|
||||
if ($search_type == '4') { $contextpage='supplierlist'; $type='f'; }
|
||||
*/
|
||||
if ($type == 'c') { $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; }
|
||||
if ($type == 'p') { $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; }
|
||||
if ($type == 'f') { $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; }
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new Societe($db);
|
||||
$hookmanager->initHooks(array('thirdpartylist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -43,6 +43,9 @@ if ($id > 0) $object->fetch($id);
|
||||
|
||||
$permissionnote=$user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('thirdpartynote','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -59,16 +59,13 @@ $object=new Societe($db);
|
||||
$objectwebsiteaccount=new WebsiteAccount($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('websiteaccountlist')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('websitethirdpartylist')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('websiteaccount');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
|
||||
unset($objectwebsiteaccount->fields['fk_soc']); // Remove this field, we are already on the thirdparty
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('websitethirdparty'));
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all=trim(GETPOST("search_all",'alpha'));
|
||||
$search=array();
|
||||
|
||||
@ -86,7 +86,7 @@ class Stripe extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
dol_syslog("No dedicated Stipe Connect account available for entity".$conf->entity);
|
||||
dol_syslog("No dedicated Stripe Connect account available for entity ".$conf->entity);
|
||||
return $key;
|
||||
}
|
||||
|
||||
@ -120,6 +120,12 @@ class Stripe extends CommonObject
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
if (empty($object->id))
|
||||
{
|
||||
dol_syslog("customerStripe is called with param object not loaded");
|
||||
return null;
|
||||
}
|
||||
|
||||
$customer = null;
|
||||
|
||||
$sql = "SELECT sa.key_account as key_account, sa.entity"; // key_account is cus_....
|
||||
@ -194,12 +200,12 @@ class Stripe extends CommonObject
|
||||
*
|
||||
* @param \Stripe\StripeCustomer $cu Object stripe customer
|
||||
* @param CompanyPaymentMode $object Object companypaymentmode to check, or create on stripe (create on stripe also update the societe_rib table for current entity)
|
||||
* @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
|
||||
* @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
|
||||
* @param int $status Status (0=test, 1=live)
|
||||
* @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card
|
||||
* @return \Stripe\StripeCard|null Stripe Card or null if not found
|
||||
*/
|
||||
public function cardStripe($cu, CompanyPaymentMode $object, $key='', $status=0, $createifnotlinkedtostripe=0)
|
||||
public function cardStripe($cu, CompanyPaymentMode $object, $stripeacc='', $status=0, $createifnotlinkedtostripe=0)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
@ -222,10 +228,10 @@ class Stripe extends CommonObject
|
||||
if ($cardref)
|
||||
{
|
||||
try {
|
||||
if (empty($key)) { // If the Stripe connect account not set, we use common API usage
|
||||
if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage
|
||||
$card = $cu->sources->retrieve($cardref);
|
||||
} else {
|
||||
$card = $cu->sources->retrieve($cardref, array("stripe_account" => $key));
|
||||
$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
@ -249,12 +255,12 @@ class Stripe extends CommonObject
|
||||
);
|
||||
|
||||
//$a = \Stripe\Stripe::getApiKey();
|
||||
//var_dump($a);var_dump($key);exit;
|
||||
//var_dump($a);var_dump($stripeacc);exit;
|
||||
try {
|
||||
if (empty($key)) { // If the Stripe connect account not set, we use common API usage
|
||||
if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage
|
||||
$card = $cu->sources->create($dataforcard);
|
||||
} else {
|
||||
$card = $cu->sources->create($dataforcard, array("stripe_account" => $key));
|
||||
$card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc));
|
||||
}
|
||||
|
||||
if ($card)
|
||||
|
||||
@ -57,6 +57,7 @@ $massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierproposallist';
|
||||
|
||||
$search_user=GETPOST('search_user','int');
|
||||
$search_sale=GETPOST('search_sale','int');
|
||||
@ -97,9 +98,6 @@ if ($object_statut != '') $search_status=$object_statut;
|
||||
// Nombre de ligne pour choix de produit/service predefinis
|
||||
$NBLINES=4;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage='supplierproposallist';
|
||||
|
||||
// Security check
|
||||
$module='supplier_proposal';
|
||||
$dbtable='';
|
||||
@ -116,6 +114,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
|
||||
$diroutputmassaction=$conf->supplier_proposal->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$object = new SupplierProposal($db);
|
||||
$hookmanager->initHooks(array('supplier_proposallist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -27,11 +27,9 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formticketsup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("ticketsup","companies","other","projects"));
|
||||
@ -71,7 +69,10 @@ $pagenext = $page + 1;
|
||||
$object=new Ticketsup($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction=$conf->ticketsup->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('ticketsuplist')); // Note that conf->hooks_modules contains array
|
||||
if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket'));
|
||||
elseif ($project > 0) $hookmanager->initHooks(array('projectticket'));
|
||||
else $hookmanager->initHooks(array('ticketsuplist'));
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('ticketsup');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
|
||||
@ -40,6 +40,7 @@ $langs->load("other");
|
||||
$def = array();
|
||||
$actiontest=GETPOST('test','alpha');
|
||||
$actionsave=GETPOST('save','alpha');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'useragenda'; // To manage different context of search
|
||||
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
|
||||
@ -68,8 +69,7 @@ if (($object->id != $user->id) && (! $user->rights->user->user->lire))
|
||||
accessforbidden();
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('usercard','useragenda','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('usercard','useragenda','globalcard');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -50,10 +50,11 @@ if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categor
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','aZ09');
|
||||
$mode = GETPOST('mode','alpha');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
$subaction = GETPOST('subaction','alpha');
|
||||
$group = GETPOST("group","int",3);
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'useracard'; // To manage different context of search
|
||||
|
||||
// Define value to know what current user can do on users
|
||||
$canadduser=(! empty($user->admin) || $user->rights->user->user->creer);
|
||||
@ -101,8 +102,7 @@ $extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$contextpage=array('usercard','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('usercard','globalcard');
|
||||
|
||||
|
||||
|
||||
|
||||
@ -34,11 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
$langs->load("users");
|
||||
$langs->load('other');
|
||||
|
||||
|
||||
$action=GETPOST('action','aZ09');
|
||||
$confirm=GETPOST('confirm');
|
||||
$id=(GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('id','int'));
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userdoc'; // To manage different context of search
|
||||
|
||||
// Define value to know what current user can do on users
|
||||
$canadduser=(! empty($user->admin) || $user->rights->user->user->creer);
|
||||
@ -94,8 +94,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('usercard','userdoc','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('usercard','userdoc','globalcard');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -49,6 +49,7 @@ $id=GETPOST('id', 'int');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
$userid=GETPOST('user', 'int');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'groupcard'; // To manage different context of search
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', 'user');
|
||||
@ -71,8 +72,9 @@ $extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$contextpage=array('groupcard','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('groupcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Actions
|
||||
|
||||
@ -37,7 +37,7 @@ $action=GETPOST('action', 'alpha');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
$module=GETPOST('module', 'alpha');
|
||||
$rights=GETPOST('rights', 'int');
|
||||
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'groupperms'; // To manage different context of search
|
||||
|
||||
// Defini si peux lire les permissions
|
||||
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
||||
@ -60,8 +60,7 @@ $object->fetch($id);
|
||||
$entity=$conf->entity;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('groupcard','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks('groupperms','globalcard');
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userhome'; // To manage different context of search
|
||||
|
||||
if (! $user->rights->user->user->lire && ! $user->admin)
|
||||
{
|
||||
// Redirection vers la page de l'utilisateur
|
||||
@ -47,8 +49,7 @@ $companystatic = new Societe($db);
|
||||
$fuserstatic = new User($db);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$contextpage=array('userhome');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('userhome'));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -34,6 +34,8 @@ $langs->load("users");
|
||||
$langs->load("companies");
|
||||
$langs->load('hrm');
|
||||
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userlist'; // To manage different context of search
|
||||
|
||||
// Security check (for external users)
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0)
|
||||
@ -54,11 +56,9 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="u.login";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
// Initialize context for list
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userlist';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$object = new User($db);
|
||||
$hookmanager->initHooks(array('userlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
@ -33,6 +33,7 @@ $langs->load("companies");
|
||||
$langs->load("ldap");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userldap'; // To manage different context of search
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
@ -46,8 +47,7 @@ $object->fetch($id, '', '', 1);
|
||||
$object->getrights();
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('usercard','userldap','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('usercard','userldap','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','aZ09');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'usernote'; // To manage different context of search
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("members");
|
||||
@ -50,8 +51,7 @@ if ($user->id == $id) $feature2=''; // A user can always read its own card
|
||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('usercard','usernote','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('usercard','usernote','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -40,6 +40,7 @@ $canreaduser=($user->admin || $user->rights->user->user->lire);
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userihm'; // To manage different context of search
|
||||
|
||||
if ($id)
|
||||
{
|
||||
@ -79,8 +80,7 @@ $form = new Form($db);
|
||||
$formadmin=new FormAdmin($db);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('usercard','userihm','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('usercard','userihm','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -38,6 +38,7 @@ $action=GETPOST('action', 'alpha');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
$module=GETPOST('module', 'alpha');
|
||||
$rights=GETPOST('rights', 'int');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userperms'; // To manage different context of search
|
||||
|
||||
if (! isset($id) || empty($id)) accessforbidden();
|
||||
|
||||
@ -73,8 +74,7 @@ $object->getrights();
|
||||
$entity=$conf->entity;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage=array('usercard','userperms','globalcard');
|
||||
$hookmanager->initHooks($contextpage);
|
||||
$hookmanager->initHooks(array('usercard','userperms','globalcard'));
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user