Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
e5fa7cd0a9
@ -40,6 +40,7 @@ $action = GETPOST('action','aZ09');
|
|||||||
$cancel = GETPOST('cancel','alpha');
|
$cancel = GETPOST('cancel','alpha');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$rowid = GETPOST('rowid', '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_account = GETPOST("search_account");
|
||||||
$search_label = GETPOST("search_label");
|
$search_label = GETPOST("search_label");
|
||||||
@ -74,8 +75,6 @@ $arrayfields=array(
|
|||||||
|
|
||||||
$accounting = new AccountingAccount($db);
|
$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"); }
|
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
|
// 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'));
|
$hookmanager->initHooks(array('memberlist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$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';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminaccoutant'; // To manage different context of search
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
@ -37,9 +38,6 @@ if (! $user->admin) accessforbidden();
|
|||||||
|
|
||||||
$error=0;
|
$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
|
* 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';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'admincompany'; // To manage different context of search
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
@ -47,8 +48,7 @@ if (! $user->admin) accessforbidden();
|
|||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$contextpage=array('admincompany','globaladmin');
|
$hookmanager->initHooks(array('admincompany','globaladmin'));
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -46,12 +46,10 @@ $langs->load("agenda");
|
|||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST('action','aZ09');
|
$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","");
|
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"));
|
$langs->loadLangs(array("users","companies","agenda","commercial"));
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'actioncommlist'; // To manage different context of search
|
||||||
$resourceid=GETPOST("resourceid","int");
|
$resourceid=GETPOST("resourceid","int");
|
||||||
$year=GETPOST("year",'int');
|
$year=GETPOST("year",'int');
|
||||||
$month=GETPOST("month",'int');
|
$month=GETPOST("month",'int');
|
||||||
@ -68,8 +69,6 @@ $filtert = GETPOST("filtert","int",3);
|
|||||||
$usergroup = GETPOST("usergroup","int",3);
|
$usergroup = GETPOST("usergroup","int",3);
|
||||||
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
||||||
|
|
||||||
$contextpage='actioncommlist';
|
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('actioncomm');
|
$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
|
// 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'));
|
$hookmanager->initHooks(array('agendalist'));
|
||||||
|
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
|
|||||||
@ -53,6 +53,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'proposallist';
|
||||||
|
|
||||||
$search_user=GETPOST('search_user','int');
|
$search_user=GETPOST('search_user','int');
|
||||||
$search_sale=GETPOST('search_sale','int');
|
$search_sale=GETPOST('search_sale','int');
|
||||||
@ -95,9 +96,6 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortfield) $sortfield='p.ref';
|
if (! $sortfield) $sortfield='p.ref';
|
||||||
if (! $sortorder) $sortorder='DESC';
|
if (! $sortorder) $sortorder='DESC';
|
||||||
|
|
||||||
// Initialize technical object to manage context to save list fields
|
|
||||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'proposallist';
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$module='propal';
|
$module='propal';
|
||||||
$dbtable='';
|
$dbtable='';
|
||||||
@ -114,6 +112,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
|
|||||||
$diroutputmassaction=$conf->propal->multidir_output[$conf->entity] . '/temp/massgeneration/'.$user->id;
|
$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
|
// 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'));
|
$hookmanager->initHooks(array('propallist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
|||||||
@ -51,6 +51,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'orderlist';
|
||||||
|
|
||||||
$search_orderyear=GETPOST("search_orderyear","int");
|
$search_orderyear=GETPOST("search_orderyear","int");
|
||||||
$search_ordermonth=GETPOST("search_ordermonth","int");
|
$search_ordermonth=GETPOST("search_ordermonth","int");
|
||||||
@ -95,11 +96,9 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortfield) $sortfield='c.ref';
|
if (! $sortfield) $sortfield='c.ref';
|
||||||
if (! $sortorder) $sortorder='DESC';
|
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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -54,6 +54,7 @@ $ref = GETPOST('ref','alpha');
|
|||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$cancel=GETPOST('cancel','alpha');
|
$cancel=GETPOST('cancel','alpha');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
|
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
|
$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
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('banktransactionlist', $contextpage));
|
$hookmanager->initHooks(array('banktransactionlist', $contextpage));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use Stripe\BankAccount;
|
||||||
|
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
@ -42,6 +44,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$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_ref=GETPOST('search_ref','alpha');
|
||||||
$search_label=GETPOST('search_label','alpha');
|
$search_label=GETPOST('search_label','alpha');
|
||||||
@ -66,11 +69,9 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortfield) $sortfield='b.label';
|
if (! $sortfield) $sortfield='b.label';
|
||||||
if (! $sortorder) $sortorder='ASC';
|
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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// 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');
|
dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), -1, 'bill');
|
||||||
|
|
||||||
$formconfirm = array();
|
$formconfirm = '';
|
||||||
|
|
||||||
// Confirmation de la conversion de l'avoir en reduc
|
// Confirmation de la conversion de l'avoir en reduc
|
||||||
//if ($action == 'converttoreduc') {
|
if ($action == 'converttoreduc') {
|
||||||
if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived';
|
if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived';
|
||||||
elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote';
|
elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote';
|
||||||
elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit';
|
elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit';
|
||||||
$text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac)));
|
$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
|
// Confirmation to delete invoice
|
||||||
//if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
$text = $langs->trans('ConfirmDeleteBill', $object->ref);
|
$text = $langs->trans('ConfirmDeleteBill', $object->ref);
|
||||||
$formquestion = array();
|
$formquestion = array();
|
||||||
|
|
||||||
@ -3050,15 +3050,15 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
|
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
|
||||||
// => 1),
|
// => 1),
|
||||||
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"))));
|
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 {
|
} 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
|
// Confirmation of validation
|
||||||
//if ($action == 'valid')
|
if ($action == 'valid')
|
||||||
//{
|
{
|
||||||
// we check object has a draft number
|
// we check object has a draft number
|
||||||
$objectref = substr($object->ref, 1, 4);
|
$objectref = substr($object->ref, 1, 4);
|
||||||
if ($objectref == 'PROV') {
|
if ($objectref == 'PROV') {
|
||||||
@ -3116,11 +3116,11 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$text .= '<br>' . img_warning() . ' ' . $langs->trans("ErrorInvoiceOfThisTypeMustBePositive");
|
$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
|
// Confirm back to draft status
|
||||||
//if ($action == 'modif') {
|
if ($action == 'modif') {
|
||||||
$text = $langs->trans('ConfirmUnvalidateBill', $object->ref);
|
$text = $langs->trans('ConfirmUnvalidateBill', $object->ref);
|
||||||
$formquestion = array();
|
$formquestion = array();
|
||||||
|
|
||||||
@ -3153,45 +3153,45 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $value));
|
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
|
// Confirmation du classement paye
|
||||||
if (/*$action == 'paid' && */$resteapayer <= 0) {
|
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');
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
|
||||||
} else {
|
}
|
||||||
//if ($action == 'paid' $resteapayer > 0) {
|
if ($action == 'paid' && $resteapayer > 0) {
|
||||||
// Code
|
// Code
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$close [$i] ['code'] = 'discount_vat'; // escompte
|
$close [$i]['code'] = 'discount_vat'; // escompte
|
||||||
$i ++;
|
$i ++;
|
||||||
$close [$i] ['code'] = 'badcustomer';
|
$close [$i]['code'] = 'badcustomer';
|
||||||
$i ++;
|
$i ++;
|
||||||
// Help
|
// Help
|
||||||
$i = 0;
|
$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 ++;
|
$i ++;
|
||||||
$close [$i] ['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");
|
$close [$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");
|
||||||
$i ++;
|
$i ++;
|
||||||
// Texte
|
// Texte
|
||||||
$i = 0;
|
$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 ++;
|
$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 ++;
|
$i ++;
|
||||||
// arrayreasons[code]=reason
|
// arrayreasons[code]=reason
|
||||||
foreach ($close as $key => $val) {
|
foreach ($close as $key => $val) {
|
||||||
$arrayreasons [$close [$key] ['code']] = $close [$key] ['reason'];
|
$arrayreasons[$close [$key]['code']] = $close[$key]['reason'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cree un tableau formulaire
|
// 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
|
// 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
|
// Confirmation du classement abandonne
|
||||||
//if ($action == 'canceled') {
|
if ($action == 'canceled') {
|
||||||
// S'il y a une facture de remplacement pas encore validee (etat brouillon),
|
// S'il y a une facture de remplacement pas encore validee (etat brouillon),
|
||||||
// on ne permet pas de classer abandonner la facture.
|
// on ne permet pas de classer abandonner la facture.
|
||||||
if ($objectidnext) {
|
if ($objectidnext) {
|
||||||
@ -3216,57 +3216,47 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$arrayreasons [$close [2] ['code']] = $close [2] ['reason'];
|
$arrayreasons [$close [2] ['code']] = $close [2] ['reason'];
|
||||||
|
|
||||||
// Cree un tableau formulaire
|
// 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');
|
$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
|
// Confirmation de la suppression d'une ligne produit
|
||||||
//if ($action == 'ask_deleteline') {
|
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');
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
|
||||||
//}
|
}
|
||||||
|
|
||||||
// Clone confirmation
|
// Clone confirmation
|
||||||
//if ($action == 'clone')
|
if ($action == 'clone')
|
||||||
//{
|
{
|
||||||
// Create an array for form
|
// Create an array for form
|
||||||
$formquestion = array(
|
$formquestion = array(
|
||||||
// 'text' => $langs->trans("ConfirmClone"),
|
// 'text' => $langs->trans("ConfirmClone"),
|
||||||
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
|
// 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)));
|
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
|
// 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 (! $formconfirm)
|
||||||
if (! empty($formconfirm[$action]))
|
|
||||||
{
|
{
|
||||||
$parameters = array('lineid' => $lineid);
|
$parameters = array('lineid' => $lineid);
|
||||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$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;
|
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||||
elseif ($reshook > 0) $formconfirm[$action]=$hookmanager->resPrint;
|
elseif ($reshook > 0) $formconfirm=$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>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print form confirm
|
||||||
|
print $formconfirm;
|
||||||
|
|
||||||
// Invoice content
|
// Invoice content
|
||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
$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">';
|
print '<td align="center">';
|
||||||
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
|
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 img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['deletepaiement'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
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))
|
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)))
|
|| (! 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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['modif'];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans('Modify') . '</span></div>';
|
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
|
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 {
|
} else {
|
||||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('ReOpen') . '</span></div>';
|
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))
|
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)))
|
|| (! 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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['valid'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4332,28 +4310,16 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
// For standard invoice with excess received
|
// 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))
|
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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['converttoreduc'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// For credit note
|
// For credit note
|
||||||
if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->creer && $object->getSommePaiement() == 0) {
|
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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['converttoreduc'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// For deposit invoice
|
// For deposit invoice
|
||||||
if ($object->type == Facture::TYPE_DEPOSIT && $user->rights->facture->creer && empty($discount->id))
|
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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['converttoreduc'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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))
|
|| ($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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['paid'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Classify 'closed not completely paid' (possible si validee et pas encore classee payee)
|
// 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 ($totalpaye > 0 || $totalcreditnotes > 0)
|
||||||
{
|
{
|
||||||
// If one payment or one credit note was linked to this invoice
|
// 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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['paid'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4392,7 +4350,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
else
|
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
|
// Clone
|
||||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $user->rights->facture->creer)
|
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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['clone'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone as predefined / Create template
|
// Clone as predefined / Create template
|
||||||
@ -4464,11 +4418,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
else
|
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>';
|
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>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['delete'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("NotAllowed") . '">' . $langs->trans('Delete') . '</a></div>';
|
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');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'invoicelist';
|
||||||
|
|
||||||
$lineid=GETPOST('lineid','int');
|
$lineid=GETPOST('lineid','int');
|
||||||
$userid=GETPOST('userid','int');
|
$userid=GETPOST('userid','int');
|
||||||
@ -114,9 +115,6 @@ if (! $sortfield) $sortfield='f.datef';
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $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
|
// Security check
|
||||||
$fieldid = (! empty($ref)?'facnumber':'rowid');
|
$fieldid = (! empty($ref)?'facnumber':'rowid');
|
||||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||||
@ -129,6 +127,7 @@ $object=new Facture($db);
|
|||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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'));
|
$hookmanager->initHooks(array('invoicelist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$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 '<tr><td class="'.(GETPOST('paiementcode')=='CHQ'?'fieldrequired ':'').'fieldrequireddyn">'.$langs->trans('CheckTransmitter');
|
||||||
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||||
print '</td>';
|
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
|
// Bank name
|
||||||
print '<tr><td>'.$langs->trans('Bank');
|
print '<tr><td>'.$langs->trans('Bank');
|
||||||
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||||
print '</td>';
|
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
|
// Comments
|
||||||
print '<tr><td>'.$langs->trans('Comments').'</td>';
|
print '<tr><td>'.$langs->trans('Comments').'</td>';
|
||||||
print '<td class="tdtop">';
|
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>';
|
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';
|
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';
|
if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
$langs->load('bills');
|
$langs->loadLangs(array('bills','banks','companies'));
|
||||||
$langs->load('banks');
|
|
||||||
$langs->load('companies');
|
|
||||||
|
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
$ref=GETPOST('ref', 'alpha');
|
$ref=GETPOST('ref', 'alpha');
|
||||||
@ -222,57 +220,64 @@ print '<div class="underbanner clearboth"></div>';
|
|||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent">'."\n";
|
||||||
|
|
||||||
// Date payment
|
// 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 $form->editfieldval("Date",'datep',$object->date,$object,$user->rights->facture->paiement,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Payment type (VIR, LIQ, ...)
|
// Payment type (VIR, LIQ, ...)
|
||||||
$labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$object->type_code)?$langs->trans("PaymentType".$object->type_code):$object->type_libelle;
|
$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>';
|
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$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>';
|
|
||||||
|
|
||||||
$disable_delete = 0;
|
$disable_delete = 0;
|
||||||
// Bank account
|
// Bank account
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($object->fk_account > 0)
|
if ($object->fk_account > 0)
|
||||||
{
|
{
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
$bankline->fetch($object->bank_line);
|
$bankline->fetch($object->bank_line);
|
||||||
if ($bankline->rappro)
|
if ($bankline->rappro)
|
||||||
{
|
{
|
||||||
$disable_delete = 1;
|
$disable_delete = 1;
|
||||||
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
|
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
print '<td>'.$langs->trans('BankAccount').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td>';
|
||||||
print $bankline->getNomUrl(1,0,'showconciliated');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans('BankAccount').'</td>';
|
|
||||||
print '<td colspan="3">';
|
|
||||||
$accountstatic=new Account($db);
|
$accountstatic=new Account($db);
|
||||||
$accountstatic->fetch($bankline->fk_account);
|
$accountstatic->fetch($bankline->fk_account);
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
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)
|
if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0)
|
||||||
{
|
{
|
||||||
dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php');
|
dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php');
|
||||||
@ -280,15 +285,30 @@ if (! empty($conf->banque->enabled))
|
|||||||
$bordereau->fetch($bankline->fk_bordereau);
|
$bordereau->fetch($bankline->fk_bordereau);
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('CheckReceipt').'</td>';
|
print '<td>'.$langs->trans('CheckReceipt').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td>';
|
||||||
print $bordereau->getNomUrl(1);
|
print $bordereau->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
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 '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -59,6 +59,7 @@ class Paiement extends CommonObject
|
|||||||
// de llx_paiement qui est lie aux types de
|
// de llx_paiement qui est lie aux types de
|
||||||
//paiement de llx_c_paiement
|
//paiement de llx_c_paiement
|
||||||
var $num_paiement; // Numero du CHQ, VIR, etc...
|
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_account; // Id compte bancaire du paiement
|
||||||
var $bank_line; // Id de la ligne d'ecriture bancaire
|
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, ...)
|
// 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 = '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.= ' 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.= ' 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.= ' 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';
|
$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->ref = $obj->ref?$obj->ref:$obj->rowid;
|
||||||
$this->date = $this->db->jdate($obj->dp);
|
$this->date = $this->db->jdate($obj->dp);
|
||||||
$this->datepaye = $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->montant = $obj->amount; // deprecated
|
||||||
$this->amount = $obj->amount;
|
$this->amount = $obj->amount;
|
||||||
$this->note = $obj->note;
|
$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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -45,6 +45,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractlist'; // To manage different context of search
|
||||||
|
|
||||||
$search_name=GETPOST('search_name');
|
$search_name=GETPOST('search_name');
|
||||||
$search_email=GETPOST('search_email');
|
$search_email=GETPOST('search_email');
|
||||||
@ -95,10 +96,8 @@ $staticcontratligne=new ContratLigne($db);
|
|||||||
if ($search_status == '') $search_status=1;
|
if ($search_status == '') $search_status=1;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$contextpage='contractlist';
|
$object = new Contrat($db);
|
||||||
|
$hookmanager->initHooks(array('contractlist'));
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
|
||||||
$hookmanager->initHooks(array($contextpage));
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -53,6 +53,7 @@ $search_status=GETPOST("search_status","alpha");
|
|||||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
||||||
$search_product_category=GETPOST('search_product_category','int');
|
$search_product_category=GETPOST('search_product_category','int');
|
||||||
$socid=GETPOST('socid','int');
|
$socid=GETPOST('socid','int');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractservicelist'.$mode;
|
||||||
|
|
||||||
$opouvertureprevuemonth=GETPOST('opouvertureprevuemonth');
|
$opouvertureprevuemonth=GETPOST('opouvertureprevuemonth');
|
||||||
$opouvertureprevueday=GETPOST('opouvertureprevueday');
|
$opouvertureprevueday=GETPOST('opouvertureprevueday');
|
||||||
@ -74,11 +75,10 @@ $opclotureday=GETPOST('opclotureday');
|
|||||||
$opclotureyear=GETPOST('opclotureyear');
|
$opclotureyear=GETPOST('opclotureyear');
|
||||||
$filter_opcloture=GETPOST('filter_opcloture');
|
$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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -739,6 +739,21 @@ class ExtraFields
|
|||||||
// To avoid conflicts with external modules. TODO Remove this.
|
// To avoid conflicts with external modules. TODO Remove this.
|
||||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
|
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.
|
// 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);
|
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
|
||||||
|
|
||||||
@ -778,6 +793,7 @@ class ExtraFields
|
|||||||
$this->attribute_langfile[$tab->name]=$tab->langs;
|
$this->attribute_langfile[$tab->name]=$tab->langs;
|
||||||
$this->attribute_list[$tab->name]=$tab->list;
|
$this->attribute_list[$tab->name]=$tab->list;
|
||||||
$this->attribute_entityid[$tab->name]=$tab->entity;
|
$this->attribute_entityid[$tab->name]=$tab->entity;
|
||||||
|
$this->attribute_entitylabel[$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]);
|
||||||
|
|
||||||
// New usage
|
// New usage
|
||||||
$this->attributes[$tab->elementtype]['type'][$tab->name]=$tab->type;
|
$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]['langfile'][$tab->name]=$tab->langs;
|
||||||
$this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list;
|
$this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list;
|
||||||
$this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity;
|
$this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity;
|
||||||
|
$this->attributes[$tab->elementtype]['entitylabel'][$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$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]['loaded']=1;
|
$this->attributes[$tab->elementtype]['loaded']=1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,7 +169,7 @@ class Form
|
|||||||
$ret.='<input type="hidden" name="action" value="set'.$htmlname.'">';
|
$ret.='<input type="hidden" name="action" value="set'.$htmlname.'">';
|
||||||
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$ret.='<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">';
|
$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 (empty($notabletag)) $ret.='<tr><td>';
|
||||||
if (preg_match('/^(string|email)/',$typeofdata))
|
if (preg_match('/^(string|email)/',$typeofdata))
|
||||||
{
|
{
|
||||||
@ -1072,11 +1072,11 @@ class Form
|
|||||||
// On recherche les societes
|
// 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 = "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";
|
$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').")";
|
$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 ($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";
|
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status <> 0";
|
||||||
// Add criteria
|
// Add criteria
|
||||||
if ($filterkey && $filterkey != '')
|
if ($filterkey && $filterkey != '')
|
||||||
@ -3596,8 +3596,8 @@ class Form
|
|||||||
* @param string $question Question
|
* @param string $question Question
|
||||||
* @param string $action Action
|
* @param string $action Action
|
||||||
* @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , ))
|
* @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', ...
|
* type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ...
|
||||||
* @param string $selectedchoice '' or 'no' or 'yes' or '1' or '0'
|
* @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 $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 $height Force height of box
|
||||||
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
* @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 } ?>
|
<?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
|
// End of lib_head.js.php
|
||||||
|
|||||||
@ -8,16 +8,17 @@ if (empty($conf) || ! is_object($conf))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loop to show all columns of extrafields for the title line
|
// 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']))
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
$sortonfield = "ef.".$key;
|
$sortonfield = "ef.".$key;
|
||||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
if (! empty($extrafields->attributes[$object->element]['computed'][$key])) $sortonfield='';
|
||||||
print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n";
|
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++; ?>
|
<td class="linecoldelete" align="center"><?php $coldisplay++; ?>
|
||||||
<?php
|
<?php
|
||||||
if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) {
|
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 img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
if($conf->use_javascript_ajax) {
|
|
||||||
print $formconfirm['ask_deleteline'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -32,6 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|||||||
|
|
||||||
$langs->loadLangs(array("sendings","deliveries",'companies','bills'));
|
$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');
|
$socid=GETPOST('socid','int');
|
||||||
// Security check
|
// Security check
|
||||||
$expeditionid = GETPOST('id','int');
|
$expeditionid = GETPOST('id','int');
|
||||||
@ -64,9 +66,6 @@ $offset = $limit * $page;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $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');
|
$viewstatut=GETPOST('viewstatut');
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'expensereportlist';
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
@ -82,10 +83,8 @@ $optioncss = GETPOST('optioncss','alpha');
|
|||||||
if ($search_status == '') $search_status=-1;
|
if ($search_status == '') $search_status=-1;
|
||||||
if ($search_user == '') $search_user=-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
|
// 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'));
|
$hookmanager->initHooks(array('expensereportlist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$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_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha');
|
||||||
$search_company=GETPOST('search_company','alpha');
|
$search_company=GETPOST('search_company','alpha');
|
||||||
@ -72,9 +73,6 @@ if (! $sortfield)
|
|||||||
else $sortfield="f.ref";
|
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'));
|
$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_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha');
|
||||||
$search_company=GETPOST('search_company','alpha');
|
$search_company=GETPOST('search_company','alpha');
|
||||||
@ -83,7 +81,8 @@ $search_status=GETPOST('search_status');
|
|||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -53,6 +53,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierorderlist';
|
||||||
|
|
||||||
$orderyear=GETPOST("orderyear","int");
|
$orderyear=GETPOST("orderyear","int");
|
||||||
$ordermonth=GETPOST("ordermonth","int");
|
$ordermonth=GETPOST("ordermonth","int");
|
||||||
@ -109,11 +110,9 @@ if (! $sortorder) $sortorder='DESC';
|
|||||||
|
|
||||||
if ($search_status == '') $search_status=-1;
|
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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -55,6 +55,7 @@ $show_files=GETPOST('show_files','int');
|
|||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierinvoicelist';
|
||||||
|
|
||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
|
|
||||||
@ -118,16 +119,12 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
if (! $sortfield) $sortfield="f.datef,f.rowid";
|
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;
|
$diroutputmassaction=$conf->fournisseur->facture->dir_output . '/temp/massgeneration/'.$user->id;
|
||||||
|
|
||||||
$object=new FactureFournisseur($db);
|
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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'));
|
$hookmanager->initHooks(array('supplierinvoicelist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
|||||||
@ -34,6 +34,7 @@ $langs->load('users');
|
|||||||
$langs->load('hrm');
|
$langs->load('hrm');
|
||||||
|
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'defineholidaylist';
|
||||||
|
|
||||||
$search_name=GETPOST('search_name', 'alpha');
|
$search_name=GETPOST('search_name', 'alpha');
|
||||||
$search_supervisor=GETPOST('search_supervisor', 'int');
|
$search_supervisor=GETPOST('search_supervisor', 'int');
|
||||||
@ -58,9 +59,6 @@ if ($user->societe_id > 0) accessforbidden();
|
|||||||
if (!$user->rights->holiday->read) 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
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||||
$hookmanager->initHooks(array('defineholidaylist'));
|
$hookmanager->initHooks(array('defineholidaylist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|||||||
@ -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_usergroup not in (select rowid from llx_usergroup);
|
||||||
delete from llx_usergroup_rights where fk_id not in (select id from llx_rights_def);
|
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;
|
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_creat integer, -- user making creation
|
||||||
fk_user_modif integer, -- user making last change
|
fk_user_modif integer, -- user making last change
|
||||||
fk_user_valid integer, -- valideur de la fiche
|
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,
|
status integer DEFAULT 0,
|
||||||
title varchar(255) NOT NULL,
|
title varchar(255) NOT NULL,
|
||||||
date_inventory datetime DEFAULT NULL,
|
date_inventory datetime DEFAULT NULL,
|
||||||
|
|||||||
@ -24,6 +24,7 @@ Movements=Movements
|
|||||||
ErrorWarehouseRefRequired=Warehouse reference name is required
|
ErrorWarehouseRefRequired=Warehouse reference name is required
|
||||||
ListOfWarehouses=List of warehouses
|
ListOfWarehouses=List of warehouses
|
||||||
ListOfStockMovements=List of stock movements
|
ListOfStockMovements=List of stock movements
|
||||||
|
ListOfInventories=List of inventories
|
||||||
MovementId=Movement ID
|
MovementId=Movement ID
|
||||||
StockMovementForId=Movement ID %d
|
StockMovementForId=Movement ID %d
|
||||||
ListMouvementStockProject=List of stock movements associated to project
|
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)
|
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))
|
if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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']);
|
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
|
// 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');
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
@ -210,14 +211,14 @@ foreach($object->fields as $key => $val)
|
|||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// 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
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql=preg_replace('/, $/','', $sql);
|
$sql=preg_replace('/, $/','', $sql);
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$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').")";
|
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('myobject').")";
|
||||||
else $sql.=" WHERE 1 = 1";
|
else $sql.=" WHERE 1 = 1";
|
||||||
foreach($search as $key => $val)
|
foreach($search as $key => $val)
|
||||||
@ -241,7 +242,7 @@ foreach($object->fields as $key => $val)
|
|||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// 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
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
$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
|
// Detect if we need a fetch on each output line
|
||||||
$needToFetchEachLine=0;
|
$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
|
if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,8 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$rowid=GETPOST('rowid','int');
|
$rowid=GETPOST('rowid','int');
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$cancel=GETPOST('cancel', 'alpha');
|
$cancel=GETPOST('cancel', 'alpha');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'pricesuppliercard';
|
||||||
|
|
||||||
$socid=GETPOST('socid', 'int');
|
$socid=GETPOST('socid', 'int');
|
||||||
$cost_price=GETPOST('cost_price', 'alpha');
|
$cost_price=GETPOST('cost_price', 'alpha');
|
||||||
$backtopage=GETPOST('backtopage','alpha');
|
$backtopage=GETPOST('backtopage','alpha');
|
||||||
@ -79,8 +81,6 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortfield) $sortfield="s.nom";
|
if (! $sortfield) $sortfield="s.nom";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
$contextpage='pricesuppliercard';
|
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('pricesuppliercard','globalcard'));
|
$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';
|
include_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
// Load traductions files requiredby by page
|
||||||
$langs->loadLangs(array("inventory","other"));
|
$langs->loadLangs(array("stocks","other"));
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|||||||
@ -76,11 +76,12 @@ class Inventory extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fields=array(
|
public $fields=array(
|
||||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
|
'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'),
|
'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,),
|
'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'),
|
'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'),
|
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'LinkToThirparty'),
|
||||||
'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1,),
|
'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,),
|
'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,),
|
'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 ($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('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
|
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
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('Enabled'),'statut4');
|
||||||
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6');
|
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
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('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
|
if ($status == -1) return img_picto($langs->trans('Canceled'),'statut6').' '.$langs->trans('Canceled');
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
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('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == -1) return $langs->trans('Canceled').' '.img_picto($langs->trans('Canceled'),'statut6');
|
if ($status == -1) return $langs->trans('Canceled').' '.img_picto($langs->trans('Canceled'),'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 6)
|
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('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == -1) return $langs->trans('Canceled').' '.img_picto($langs->trans('Canceled'),'statut6');
|
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';
|
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
// Load traductions files requiredby by page
|
||||||
$langs->loadLangs(array("inventory","other"));
|
$langs->loadLangs(array("stocks","other"));
|
||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||||
$massaction = GETPOST('massaction','alpha');
|
$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
|
||||||
$show_files = GETPOST('show_files','int');
|
$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ?
|
||||||
$confirm = GETPOST('confirm','alpha');
|
$confirm = GETPOST('confirm','alpha'); // Result of a confirmation
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$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
|
$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');
|
$id = GETPOST('id','int');
|
||||||
$backtopage = GETPOST('backtopage','alpha');
|
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
$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 (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
// Protection if external user
|
// Security check
|
||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
@ -101,22 +101,24 @@ $arrayfields=array();
|
|||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
// If $val['visible']==0, then we never show the field
|
// 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
|
// 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
|
* 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);
|
$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="EN:Module_Inventory|FR:Module_Inventory_FR|ES:Módulo_Inventory";
|
||||||
$help_url='';
|
$help_url='';
|
||||||
$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Inventorys"));
|
$title = $langs->trans('ListOfInventories');
|
||||||
|
|
||||||
|
|
||||||
// Build and execute select
|
// Build and execute select
|
||||||
@ -183,18 +185,19 @@ foreach($object->fields as $key => $val)
|
|||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// 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
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql=preg_replace('/, $/','', $sql);
|
$sql=preg_replace('/, $/','', $sql);
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$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('inventory').")";
|
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('myobject').")";
|
||||||
else $sql.=" WHERE 1 = 1";
|
else $sql.=" WHERE 1 = 1";
|
||||||
foreach($search as $key => $val)
|
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);
|
$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));
|
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;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
/* If a group by is required
|
/* If a group by is required
|
||||||
$sql.= " GROUP BY "
|
$sql.= " GROUP BY "
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$sql.='t.'.$key.', ';
|
$sql.='t.'.$key.', ';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// 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
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql.=$db->order($sortfield,$sortorder);
|
$sql.=$db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
@ -229,17 +232,31 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
}
|
}
|
||||||
|
// if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
if (($page * $limit) > $nbtotalofrecords)
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
|
||||||
if (! $resql)
|
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
$page = 0;
|
||||||
exit;
|
$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
|
// Direct jump if only one record found
|
||||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
|
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
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>$langs->trans("SendByMail"),
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
@ -348,7 +366,7 @@ print '<tr class="liste_titre">';
|
|||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$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 (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
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>';
|
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)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$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 (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
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";
|
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
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// 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
|
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
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";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
|
||||||
// Detect if we need a fetch on each output line
|
// Detect if we need a fetch on each output line
|
||||||
$needToFetchEachLine=0;
|
$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
|
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'; }
|
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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
$form=new Form($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)
|
'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Buy").')', 'checked'=>1, 'position'=>1000)
|
||||||
);
|
);
|
||||||
// Extra fields
|
// 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');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -274,13 +278,13 @@ else
|
|||||||
$sql .= ', pac.rowid prod_comb_id';
|
$sql .= ', pac.rowid prod_comb_id';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// 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
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
$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
|
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";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||||
// multilang
|
// multilang
|
||||||
@ -331,7 +335,7 @@ else
|
|||||||
$sql .= ', pac.rowid';
|
$sql .= ', pac.rowid';
|
||||||
}
|
}
|
||||||
// Add fields from extrafields
|
// 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
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook
|
$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");
|
$product_id=GETPOST("product_id");
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
$cancel=GETPOST('cancel','alpha');
|
$cancel=GETPOST('cancel','alpha');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist';
|
||||||
|
|
||||||
$idproduct = GETPOST('idproduct','int');
|
$idproduct = GETPOST('idproduct','int');
|
||||||
$year = GETPOST("year");
|
$year = GETPOST("year");
|
||||||
$month = GETPOST("month");
|
$month = GETPOST("month");
|
||||||
@ -77,11 +79,9 @@ if (! $sortorder) $sortorder="DESC";
|
|||||||
|
|
||||||
$pdluoid=GETPOST('pdluoid','int');
|
$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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
@ -107,7 +107,6 @@ $arrayfields=array(
|
|||||||
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
|
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
|
||||||
);
|
);
|
||||||
|
|
||||||
$object = new MouvementStock($db); // To be passed as parameter of executeHooks that need
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -81,6 +81,7 @@ if ($user->societe_id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||||
|
$object = new Productlot($db);
|
||||||
$hookmanager->initHooks(array('product_lotlist'));
|
$hookmanager->initHooks(array('product_lotlist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$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
|
// Load object if id or ref is provided as parameter
|
||||||
$object=new Productlot($db);
|
|
||||||
if (($id > 0 || ! empty($ref)) && $action != 'add')
|
if (($id > 0 || ! empty($ref)) && $action != 'add')
|
||||||
{
|
{
|
||||||
$result=$object->fetch($id,$ref);
|
$result=$object->fetch($id,$ref);
|
||||||
|
|||||||
@ -39,6 +39,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'projectlist';
|
||||||
|
|
||||||
$title = $langs->trans("Projects");
|
$title = $langs->trans("Projects");
|
||||||
|
|
||||||
@ -95,12 +96,9 @@ $search_eyear = GETPOST('search_eyear','int');
|
|||||||
|
|
||||||
if ($search_status == '') $search_status=-1; // -1 or 1
|
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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// 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';
|
$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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
@ -131,8 +132,6 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$object = new Task($db);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -72,6 +72,7 @@ if (! $sortfield) $sortfield='t.task_date,t.task_datehour,t.rowid';
|
|||||||
if (! $sortorder) $sortorder='DESC';
|
if (! $sortorder) $sortorder='DESC';
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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'));
|
$hookmanager->initHooks(array('projecttaskcard','globalcard'));
|
||||||
|
|
||||||
$object = new Task($db);
|
$object = new Task($db);
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file resource/index.php
|
* \file resource/index.php
|
||||||
* \ingroup resource
|
* \ingroup resource
|
||||||
* \brief Page to manage resource objects
|
* \brief Page to manage resource objects
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -43,8 +43,8 @@ $sortfield = GETPOST('sortfield','alpha');
|
|||||||
// Initialize context for list
|
// Initialize context for list
|
||||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'resourcelist';
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'resourcelist';
|
||||||
|
|
||||||
|
// Initialize technical objects
|
||||||
$object = new Dolresource($db);
|
$object = new Dolresource($db);
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// 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;
|
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($sortorder)) $sortorder="ASC";
|
||||||
if (empty($sortfield)) $sortfield="t.ref";
|
if (empty($sortfield)) $sortfield="t.ref";
|
||||||
|
|||||||
@ -203,7 +203,9 @@ class CompanyPaymentMode extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function create(User $user, $notrigger = false)
|
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;
|
$result = 1;
|
||||||
|
|
||||||
// Retreive all extrafield
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$this->fetch_optionals();
|
$this->fetch_optionals();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'thirdpartylist';
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
@ -106,18 +107,13 @@ $offset = $limit * $page;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $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 == 'c') { $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; }
|
||||||
if ($type == 'p') { $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; }
|
if ($type == 'p') { $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; }
|
||||||
if ($type == 'f') { $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; }
|
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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -59,16 +59,13 @@ $object=new Societe($db);
|
|||||||
$objectwebsiteaccount=new WebsiteAccount($db);
|
$objectwebsiteaccount=new WebsiteAccount($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user->id;
|
$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
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('websiteaccount');
|
$extralabels = $extrafields->fetch_name_optionals_label('websiteaccount');
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||||
|
|
||||||
unset($objectwebsiteaccount->fields['fk_soc']); // Remove this field, we are already on the thirdparty
|
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
|
// Initialize array of search criterias
|
||||||
$search_all=trim(GETPOST("search_all",'alpha'));
|
$search_all=trim(GETPOST("search_all",'alpha'));
|
||||||
$search=array();
|
$search=array();
|
||||||
|
|||||||
@ -86,7 +86,7 @@ class Stripe extends CommonObject
|
|||||||
dol_print_error($this->db);
|
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;
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,6 +120,12 @@ class Stripe extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
|
if (empty($object->id))
|
||||||
|
{
|
||||||
|
dol_syslog("customerStripe is called with param object not loaded");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$customer = null;
|
$customer = null;
|
||||||
|
|
||||||
$sql = "SELECT sa.key_account as key_account, sa.entity"; // key_account is cus_....
|
$sql = "SELECT sa.key_account as key_account, sa.entity"; // key_account is cus_....
|
||||||
|
|||||||
@ -57,6 +57,7 @@ $massaction=GETPOST('massaction','alpha');
|
|||||||
$show_files=GETPOST('show_files','int');
|
$show_files=GETPOST('show_files','int');
|
||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'supplierproposallist';
|
||||||
|
|
||||||
$search_user=GETPOST('search_user','int');
|
$search_user=GETPOST('search_user','int');
|
||||||
$search_sale=GETPOST('search_sale','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
|
// Nombre de ligne pour choix de produit/service predefinis
|
||||||
$NBLINES=4;
|
$NBLINES=4;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
|
||||||
$contextpage='supplierproposallist';
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$module='supplier_proposal';
|
$module='supplier_proposal';
|
||||||
$dbtable='';
|
$dbtable='';
|
||||||
@ -116,6 +114,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
|
|||||||
$diroutputmassaction=$conf->supplier_proposal->dir_output . '/temp/massgeneration/'.$user->id;
|
$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
|
// 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'));
|
$hookmanager->initHooks(array('supplier_proposallist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$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/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.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 . '/projet/class/project.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.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 . '/core/lib/project.lib.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
// Load traductions files requiredby by page
|
||||||
$langs->loadLangs(array("ticketsup","companies","other","projects"));
|
$langs->loadLangs(array("ticketsup","companies","other","projects"));
|
||||||
|
|||||||
@ -40,6 +40,7 @@ $langs->load("other");
|
|||||||
$def = array();
|
$def = array();
|
||||||
$actiontest=GETPOST('test','alpha');
|
$actiontest=GETPOST('test','alpha');
|
||||||
$actionsave=GETPOST('save','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;
|
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||||
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
|
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
|
||||||
@ -68,8 +69,7 @@ if (($object->id != $user->id) && (! $user->rights->user->user->lire))
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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(array('usercard','useragenda','globalcard');
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -50,10 +50,11 @@ if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categor
|
|||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$action = GETPOST('action','aZ09');
|
$action = GETPOST('action','aZ09');
|
||||||
$mode = GETPOST('mode','alpha');
|
$mode = GETPOST('mode','alpha');
|
||||||
$confirm = GETPOST('confirm','alpha');
|
$confirm = GETPOST('confirm','alpha');
|
||||||
$subaction = GETPOST('subaction','alpha');
|
$subaction = GETPOST('subaction','alpha');
|
||||||
$group = GETPOST("group","int",3);
|
$group = GETPOST("group","int",3);
|
||||||
$cancel = GETPOST('cancel','alpha');
|
$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
|
// Define value to know what current user can do on users
|
||||||
$canadduser=(! empty($user->admin) || $user->rights->user->user->creer);
|
$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);
|
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||||
$contextpage=array('usercard','globalcard');
|
$hookmanager->initHooks(array('usercard','globalcard');
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,11 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
|||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
$langs->load('other');
|
$langs->load('other');
|
||||||
|
|
||||||
|
|
||||||
$action=GETPOST('action','aZ09');
|
$action=GETPOST('action','aZ09');
|
||||||
$confirm=GETPOST('confirm');
|
$confirm=GETPOST('confirm');
|
||||||
$id=(GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('id','int'));
|
$id=(GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('id','int'));
|
||||||
$ref = GETPOST('ref', 'alpha');
|
$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
|
// Define value to know what current user can do on users
|
||||||
$canadduser=(! empty($user->admin) || $user->rights->user->user->creer);
|
$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
|
// 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(array('usercard','userdoc','globalcard');
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -49,6 +49,7 @@ $id=GETPOST('id', 'int');
|
|||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
$userid=GETPOST('user', 'int');
|
$userid=GETPOST('user', 'int');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'groupcard'; // To manage different context of search
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', 'user');
|
$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);
|
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||||
$contextpage=array('groupcard','globalcard');
|
$hookmanager->initHooks(array('groupcard','globalcard'));
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -37,7 +37,7 @@ $action=GETPOST('action', 'alpha');
|
|||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
$module=GETPOST('module', 'alpha');
|
$module=GETPOST('module', 'alpha');
|
||||||
$rights=GETPOST('rights', 'int');
|
$rights=GETPOST('rights', 'int');
|
||||||
|
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'groupperms'; // To manage different context of search
|
||||||
|
|
||||||
// Defini si peux lire les permissions
|
// Defini si peux lire les permissions
|
||||||
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
||||||
@ -60,8 +60,7 @@ $object->fetch($id);
|
|||||||
$entity=$conf->entity;
|
$entity=$conf->entity;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$contextpage=array('groupcard','globalcard');
|
$hookmanager->initHooks('groupperms','globalcard');
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.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)
|
if (! $user->rights->user->user->lire && ! $user->admin)
|
||||||
{
|
{
|
||||||
// Redirection vers la page de l'utilisateur
|
// Redirection vers la page de l'utilisateur
|
||||||
@ -47,8 +49,7 @@ $companystatic = new Societe($db);
|
|||||||
$fuserstatic = new User($db);
|
$fuserstatic = new User($db);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||||
$contextpage=array('userhome');
|
$hookmanager->initHooks(array('userhome'));
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -34,6 +34,8 @@ $langs->load("users");
|
|||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load('hrm');
|
$langs->load('hrm');
|
||||||
|
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userlist'; // To manage different context of search
|
||||||
|
|
||||||
// Security check (for external users)
|
// Security check (for external users)
|
||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
@ -54,11 +56,9 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortfield) $sortfield="u.login";
|
if (! $sortfield) $sortfield="u.login";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
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
|
// 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);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
|
|||||||
@ -33,6 +33,7 @@ $langs->load("companies");
|
|||||||
$langs->load("ldap");
|
$langs->load("ldap");
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userldap'; // To manage different context of search
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid=0;
|
||||||
@ -46,8 +47,7 @@ $object->fetch($id, '', '', 1);
|
|||||||
$object->getrights();
|
$object->getrights();
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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(array('usercard','userldap','globalcard'));
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
|||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$action = GETPOST('action','aZ09');
|
$action = GETPOST('action','aZ09');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'usernote'; // To manage different context of search
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("members");
|
$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);
|
$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
|
// 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(array('usercard','usernote','globalcard'));
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -40,6 +40,7 @@ $canreaduser=($user->admin || $user->rights->user->user->lire);
|
|||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userihm'; // To manage different context of search
|
||||||
|
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
@ -79,8 +80,7 @@ $form = new Form($db);
|
|||||||
$formadmin=new FormAdmin($db);
|
$formadmin=new FormAdmin($db);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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(array('usercard','userihm','globalcard'));
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -38,6 +38,7 @@ $action=GETPOST('action', 'alpha');
|
|||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
$module=GETPOST('module', 'alpha');
|
$module=GETPOST('module', 'alpha');
|
||||||
$rights=GETPOST('rights', 'int');
|
$rights=GETPOST('rights', 'int');
|
||||||
|
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userperms'; // To manage different context of search
|
||||||
|
|
||||||
if (! isset($id) || empty($id)) accessforbidden();
|
if (! isset($id) || empty($id)) accessforbidden();
|
||||||
|
|
||||||
@ -73,8 +74,7 @@ $object->getrights();
|
|||||||
$entity=$conf->entity;
|
$entity=$conf->entity;
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// 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(array('usercard','userperms','globalcard'));
|
||||||
$hookmanager->initHooks($contextpage);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user