Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
9441d98890
@ -49,7 +49,7 @@ if (!$user->admin)
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'sortorder');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == - 1) {
|
||||
$page = 0;
|
||||
|
||||
@ -67,10 +67,8 @@ $pagenext = $page + 1;
|
||||
// bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed !
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
// } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
// $limit = $conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ $search_doc_ref = GETPOST("search_doc_ref");
|
||||
$search_account = GETPOST("search_account");
|
||||
$search_thirdparty = GETPOST("search_thirdparty");
|
||||
$search_journal = GETPOST("search_journal");
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
if ($sortorder == "")
|
||||
$sortorder = "ASC";
|
||||
|
||||
@ -36,7 +36,7 @@ $langs->load("accountancy");
|
||||
$page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
// Filter
|
||||
$year = GETPOST("year", 'int');
|
||||
|
||||
@ -61,9 +61,9 @@ $pagenext = $page + 1;
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
|
||||
@ -65,9 +65,9 @@ if ($page < 0)
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -169,9 +169,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -66,11 +66,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION))
|
||||
}
|
||||
else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0)
|
||||
{
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid";
|
||||
|
||||
|
||||
@ -66,9 +66,9 @@ if ($page < 0)
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -174,9 +174,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -37,7 +37,7 @@ $page = GETPOST('page','int');
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $user->admin)
|
||||
|
||||
@ -39,7 +39,7 @@ $page = GETPOST("page",'int');
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@ -58,7 +58,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
|
||||
@ -74,7 +74,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder)
|
||||
{
|
||||
|
||||
@ -55,7 +55,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
|
||||
@ -41,7 +41,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="a.datep";
|
||||
|
||||
@ -34,7 +34,7 @@ $page=GETPOST('page', 'int');
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="p.name";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$type=GETPOST('type', 'alpha');
|
||||
|
||||
@ -32,7 +32,7 @@ $result=restrictedArea($user,'mailing');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -154,7 +154,7 @@ $pagenext = $page + 1;
|
||||
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
|
||||
$sql = 'SELECT';
|
||||
|
||||
@ -67,7 +67,7 @@ $result = restrictedArea($user, 'commande', $id,'');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
|
||||
@ -70,7 +70,7 @@ if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='b.dateo';
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
$page = $_GET["page"];
|
||||
if ($page < 0) $page = 0;
|
||||
|
||||
//$limit = $conf->liste_limit;
|
||||
//$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
//$offset = $limit * $page ;
|
||||
|
||||
if (! $sortfield) $sortfield="cs.date_ech";
|
||||
|
||||
@ -45,7 +45,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="d.dated";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -46,7 +46,7 @@ $search_company=GETPOST('search_company','alpha');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
|
||||
@ -2094,8 +2094,8 @@ class Facture extends CommonInvoice
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($fk_prev_id)) $fk_prev_id = 'null';
|
||||
if (is_null($situation_percent) || $situation_percent > 100) $situation_percent = 100;
|
||||
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
@ -2282,7 +2282,7 @@ class Facture extends CommonInvoice
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($special_code) || $special_code == 3) $special_code=0;
|
||||
if ($situation_percent > 100 || is_null($situation_percent) || $situation_percent == "") $situation_percent = 100;
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$remise_percent = price2num($remise_percent);
|
||||
$qty = price2num($qty);
|
||||
@ -3881,7 +3881,8 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (empty($this->fk_prev_id)) $this->fk_prev_id = 'null';
|
||||
if (empty($this->situation_percent)) $this->situation_percent = 0;
|
||||
if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
|
||||
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
// if buy price not defined, define buyprice as configured in margin admin
|
||||
@ -4076,9 +4077,9 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (is_null($this->situation_percent)) $this->situation_percent=100;
|
||||
if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) return -1;
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ if ($page == -1)
|
||||
{
|
||||
$page = 0 ;
|
||||
}
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if ($sortorder == "")
|
||||
|
||||
@ -77,7 +77,7 @@ if ($option == 'late') $filter = 'paye:0';
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
@ -743,7 +743,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentModeShort"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentModeShort"),$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Taxes'),$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
|
||||
@ -866,7 +866,7 @@ if ($resql)
|
||||
|
||||
// Payment mode
|
||||
print '<td>';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->total_ht,0,$langs).'</td>';
|
||||
|
||||
@ -545,7 +545,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="f.date_lim_reglement";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email";
|
||||
$sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp";
|
||||
@ -605,7 +605,7 @@ if ($search_user > 0)
|
||||
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
|
||||
}
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,";
|
||||
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, fk_mode_reglement";
|
||||
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, f.fk_mode_reglement";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " ORDER BY ";
|
||||
$listfield=explode(',',$sortfield);
|
||||
@ -807,7 +807,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
@ -941,7 +941,7 @@ if ($resql)
|
||||
|
||||
// Payment mode
|
||||
print '<td>';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
|
||||
print '</td>';
|
||||
|
||||
|
||||
|
||||
@ -673,7 +673,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (! GETPOST('action'))
|
||||
{
|
||||
if ($page == -1) $page = 0 ;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
@ -53,7 +53,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="p.rowid";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
$sql = "SELECT p.rowid, p.datep as dp, p.amount, p.statut";
|
||||
$sql.=", c.libelle as paiement_type, p.num_paiement";
|
||||
|
||||
@ -54,7 +54,7 @@ $page=GETPOST('page', 'int');
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="b.dateo,b.rowid";
|
||||
if ($page < 0) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$dir=$conf->banque->dir_output.'/bordereau/';
|
||||
|
||||
@ -43,7 +43,7 @@ $search_account = GETPOST('search_account','int');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -57,7 +57,7 @@ $search_amount=GETPOST("search_amount");
|
||||
$search_company=GETPOST("search_company");
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -46,7 +46,7 @@ if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if (! $sortfield) $sortfield="s.datep";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
@ -46,7 +46,7 @@ if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if (! $sortfield) $sortfield="cs.date_ech";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if (! $sortfield) $sortfield="t.datev";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ llxHeader('','Ventilation');
|
||||
*/
|
||||
$page = $_GET["page"];
|
||||
if ($page < 0) $page = 0;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.rowid, l.fk_code_ventilation ";
|
||||
|
||||
@ -47,7 +47,7 @@ llxHeader('','Ventilation');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -288,17 +288,16 @@ if (empty($reshook))
|
||||
// Photo save
|
||||
$dir = $conf->societe->dir_output."/contact/".$object->id."/photos";
|
||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||
if (GETPOST('deletephoto') && $object->photo)
|
||||
{
|
||||
$fileimg=$dir.'/'.$object->photo;
|
||||
$dirthumbs=$dir.'/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
$object->photo = '';
|
||||
}
|
||||
if ($file_OK)
|
||||
{
|
||||
if (GETPOST('deletephoto'))
|
||||
{
|
||||
$fileimg=$dir.'/'.$object->photo;
|
||||
$dirthumbs=$dir.'/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
$object->photo = '';
|
||||
}
|
||||
|
||||
if (image_format_supported($_FILES['photo']['name']) > 0)
|
||||
{
|
||||
dol_mkdir($dir);
|
||||
@ -980,7 +979,7 @@ else
|
||||
print "<br>\n";
|
||||
}
|
||||
print '<table class="nobordernopadding">';
|
||||
if ($object->photo) print '<tr><td><input type="checkbox" class="flat" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
if ($object->photo) print '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
//print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
@ -76,7 +76,7 @@ $begin=GETPOST('begin');
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="p.lastname";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
@ -40,7 +40,7 @@ $sortfield=GETPOST('sortfield','alpha');
|
||||
$sortorder=GETPOST('sortorder','alpha');
|
||||
$page=GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$search_name=GETPOST('search_name');
|
||||
|
||||
@ -38,7 +38,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if (! $sortfield) $sortfield="c.rowid";
|
||||
|
||||
@ -1718,13 +1718,13 @@ class Form
|
||||
foreach ($scrit as $crit)
|
||||
{
|
||||
if ($i > 0) $sql.=" AND ";
|
||||
$sql.="(p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%'";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$prefix.$crit."%'";
|
||||
$sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'";
|
||||
$sql.=")";
|
||||
$i++;
|
||||
}
|
||||
if (count($scrit) > 1) $sql.=")";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$db->escape($prefix.$filterkey)."%'";
|
||||
$sql.=')';
|
||||
}
|
||||
$sql.= $db->order("p.ref");
|
||||
@ -2087,7 +2087,7 @@ class Form
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " AND p.tobuy = 1";
|
||||
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype;
|
||||
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$this->db->escape($filtertype);
|
||||
if (! empty($filtre)) $sql.=" ".$filtre;
|
||||
// Add criteria on ref/label
|
||||
if ($filterkey != '')
|
||||
@ -2101,11 +2101,11 @@ class Form
|
||||
foreach ($scrit as $crit)
|
||||
{
|
||||
if ($i > 0) $sql.=" AND ";
|
||||
$sql.="(pfp.ref_fourn LIKE '".$prefix.$crit."%' OR p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%')";
|
||||
$sql.="(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%')";
|
||||
$i++;
|
||||
}
|
||||
if (count($scrit) > 1) $sql.=")";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
|
||||
$sql.=')';
|
||||
}
|
||||
$sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC";
|
||||
@ -2619,7 +2619,7 @@ class Form
|
||||
/**
|
||||
* Charge dans cache la liste des types de paiements possibles
|
||||
*
|
||||
* @return int Nb of lines loaded, <0 if KO
|
||||
* @return int Nb of lines loaded, <0 if KO
|
||||
*/
|
||||
function load_cache_types_paiements()
|
||||
{
|
||||
@ -2632,9 +2632,9 @@ class Form
|
||||
|
||||
$this->cache_types_paiements = array();
|
||||
|
||||
$sql = "SELECT id, code, libelle as label, type";
|
||||
$sql = "SELECT id, code, libelle as label, type, active";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||
$sql.= " WHERE active > 0";
|
||||
//if ($active >= 0) $sql.= " WHERE active = ".$active;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -2651,6 +2651,7 @@ class Form
|
||||
$this->cache_types_paiements[$obj->id]['code'] =$obj->code;
|
||||
$this->cache_types_paiements[$obj->id]['label']=$label;
|
||||
$this->cache_types_paiements[$obj->id]['type'] =$obj->type;
|
||||
$this->cache_types_paiements[$obj->id]['active'] =$obj->active;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -2708,14 +2709,15 @@ class Form
|
||||
*
|
||||
* @param string $selected Id du mode de paiement pre-selectionne
|
||||
* @param string $htmlname Nom de la zone select
|
||||
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
|
||||
* @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
|
||||
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
|
||||
* @param int $empty 1=peut etre vide, 0 sinon
|
||||
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
|
||||
* @param int $maxlength Max length of label
|
||||
* @param int $active Active or not, -1 = all
|
||||
* @return void
|
||||
*/
|
||||
function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0)
|
||||
function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0, $active=1)
|
||||
{
|
||||
global $langs,$user;
|
||||
|
||||
@ -2732,6 +2734,9 @@ class Form
|
||||
if ($empty) print '<option value=""> </option>';
|
||||
foreach($this->cache_types_paiements as $id => $arraytypes)
|
||||
{
|
||||
// If not good status
|
||||
if ($active >= 0 && $arraytypes['active'] != $active) continue;
|
||||
|
||||
// On passe si on a demande de filtrer sur des modes de paiments particuliers
|
||||
if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue;
|
||||
|
||||
@ -3685,9 +3690,10 @@ class Form
|
||||
* @param int $selected Id mode pre-selectionne
|
||||
* @param string $htmlname Name of select html field
|
||||
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
|
||||
* @param int $active Active or not, -1 = all
|
||||
* @return void
|
||||
*/
|
||||
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='')
|
||||
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1)
|
||||
{
|
||||
global $langs;
|
||||
if ($htmlname != "none")
|
||||
@ -3697,7 +3703,7 @@ class Form
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td>';
|
||||
$this->select_types_paiements($selected,$htmlname,$filtertype);
|
||||
$this->select_types_paiements($selected,$htmlname,$filtertype,0,0,0,0,$active);
|
||||
print '</td>';
|
||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr></table></form>';
|
||||
@ -3707,7 +3713,6 @@ class Form
|
||||
if ($selected)
|
||||
{
|
||||
$this->load_cache_types_paiements();
|
||||
|
||||
print $this->cache_types_paiements[$selected]['label'];
|
||||
} else {
|
||||
print " ";
|
||||
@ -5323,7 +5328,7 @@ class Form
|
||||
{
|
||||
$ret.='</ul></div>';
|
||||
}
|
||||
$ret.='<div class="statusref">'.$morehtmlright.'</div>';
|
||||
if ($morehtmlright) $ret.='<div class="statusref">'.$morehtmlright.'</div>';
|
||||
$ret.='</div>';
|
||||
|
||||
return $ret;
|
||||
@ -5381,19 +5386,15 @@ class Form
|
||||
$id = (! empty($object->id) ? $object->id : $object->rowid);
|
||||
|
||||
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
|
||||
|
||||
if ($modulepart=='societe')
|
||||
{
|
||||
$dir=$conf->societe->multidir_output[$entity];
|
||||
$smallfile=$object->logo;
|
||||
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
|
||||
if (! empty($object->logo))
|
||||
{
|
||||
// TODO Introduce get_exdir
|
||||
if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini');
|
||||
else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small');
|
||||
else $file=$id.'/logos/thumbs/'.$smallfile;
|
||||
$originalfile=$id.'/logos/thumbs/'.$smallfile;
|
||||
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
|
||||
else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
|
||||
else $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
|
||||
$originalfile=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
|
||||
}
|
||||
}
|
||||
else if ($modulepart=='contact')
|
||||
@ -5401,11 +5402,10 @@ class Form
|
||||
$dir=$conf->societe->multidir_output[$entity].'/contact';
|
||||
if (! empty($object->photo))
|
||||
{
|
||||
// TODO Introduce get_exdir
|
||||
if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini');
|
||||
else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small');
|
||||
else $file=$id.'/photos/'.$object->photo;
|
||||
$originalfile=$id.'/photos/'.$object->photo;
|
||||
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini');
|
||||
else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small');
|
||||
else $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
|
||||
$originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
|
||||
}
|
||||
}
|
||||
else if ($modulepart=='userphoto')
|
||||
|
||||
@ -908,7 +908,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
|
||||
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
|
||||
}
|
||||
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
|
||||
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
@ -3961,9 +3961,12 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
// We will introduce here a common way of forging path for document storage
|
||||
// We will enhance here a common way of forging path for document storage
|
||||
// Here, object->id, object->ref and object->modulepart are required.
|
||||
|
||||
if (in_array($modulepart, array('thirdparty','contact')))
|
||||
{
|
||||
$path=$object->ref?$object->ref:$object->id;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($withoutslash) && ! empty($path)) $path.='/';
|
||||
|
||||
@ -1008,17 +1008,16 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
|
||||
{
|
||||
foreach($linkedobjects as $linkedobject)
|
||||
{
|
||||
$reftoshow = $linkedobject["ref_title"].' : '.$linkedobject["ref_value"];
|
||||
if (! empty($linkedobject["date_value"]))
|
||||
{
|
||||
$reftoshow .= ' / '.$linkedobject["date_value"];
|
||||
}
|
||||
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell($w, $h, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align);
|
||||
|
||||
if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"]))
|
||||
{
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->MultiCell($w, $h, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align);
|
||||
}
|
||||
$pdf->MultiCell($w, $h, $reftoshow, '', $align);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1826,10 +1825,11 @@ function pdf_getTotalQty($object,$type,$outputlangs)
|
||||
|
||||
/**
|
||||
* Return linked objects
|
||||
* FIXME This function returns only one link per link type instead of all links. If we fix this, we must also fix function pdf_writeLinkedObjects
|
||||
*
|
||||
* @param object $object Object
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return array Linked objects
|
||||
* @return array Linked objects
|
||||
*/
|
||||
function pdf_getLinkedObjects($object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -142,7 +142,7 @@ class modSupplierProposal extends DolibarrModules
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'fk_mainmenu=commercial', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'supplier_proposalMENU_LEFT_TITLE',
|
||||
'titre'=>'SupplierProposalShort',
|
||||
'leftmenu'=>'supplier_proposalsubmenu',
|
||||
'url'=>'/supplier_proposal/index.php',
|
||||
'langs'=>'supplier_proposal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
@ -156,7 +156,7 @@ class modSupplierProposal extends DolibarrModules
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
|
||||
'type'=>'left',
|
||||
'titre'=>'supplier_proposalMENU_LEFT_TITLE_NEW',
|
||||
'titre'=>'SupplierProposalNew',
|
||||
'url'=>'/supplier_proposal/card.php?action=create',
|
||||
'langs'=>'supplier_proposal',
|
||||
'enabled'=>'$conf->supplier_proposal->enabled',
|
||||
@ -169,7 +169,7 @@ class modSupplierProposal extends DolibarrModules
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
|
||||
'type'=>'left',
|
||||
'titre'=>'supplier_proposalMENU_LEFT_TITLE_LIST',
|
||||
'titre'=>'List',
|
||||
'url'=>'/supplier_proposal/list.php',
|
||||
'langs'=>'supplier_proposal',
|
||||
'enabled'=>'$conf->supplier_proposal->enabled',
|
||||
|
||||
@ -34,7 +34,7 @@ $langs->load("donations");
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
|
||||
@ -43,7 +43,7 @@ $optioncss = GETPOST('optioncss','alpha');
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -48,7 +48,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="d.date_create";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -93,7 +93,7 @@ $sortfield = GETPOST("sortfield");
|
||||
$page = GETPOST("page");
|
||||
if (!$sortorder) $sortorder="DESC";
|
||||
if (!$sortfield) $sortfield="d.date_debut";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
if ($page == -1) {
|
||||
$page = 0 ;
|
||||
|
||||
@ -44,7 +44,7 @@ $result = restrictedArea($user, 'ficheinter', $fichinterid,'fichinter');
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -50,7 +50,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="p.name";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -61,7 +61,7 @@ $sortorder = GETPOST("sortorder",'alpha');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
@ -53,7 +53,7 @@ if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="p.rowid";
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
@ -454,7 +454,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (empty($action))
|
||||
{
|
||||
if ($page == -1) $page = 0 ;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
@ -49,7 +49,7 @@ if ($page < 0) {
|
||||
$page = 0 ;
|
||||
}
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if (! $sortfield) $sortfield = 'p.ref';
|
||||
|
||||
@ -61,7 +61,7 @@ if ($page == -1) {
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
$form = new Form($db);
|
||||
$establishmenttmp=new Establishment($db);
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
# Dolibarr language file - Source file is en_US - supplier_proposal
|
||||
SupplierProposal=Supplier commercial proposals
|
||||
supplier_proposalDESC=Manage price requests to suppliers
|
||||
supplier_proposalMENU_LEFT_TITLE=Supplier proposals
|
||||
supplier_proposalMENU_LEFT_TITLE_NEW=New request
|
||||
supplier_proposalMENU_LEFT_TITLE_LIST=List
|
||||
SupplierProposalShort=Supplier proposals
|
||||
SupplierProposalNew=New request
|
||||
CommRequest=Price request
|
||||
CommRequests=Price requests
|
||||
SearchRequest=Find a request
|
||||
|
||||
@ -4,7 +4,7 @@ DIRECTION=ltr
|
||||
# msungstdlight or cid0ct are for traditional Chinese (traditional does not render with Ubuntu pdf reader)
|
||||
# stsongstdlight or cid0cs are for simplified Chinese
|
||||
# To read Chinese pdf with Linux: sudo apt-get install poppler-data
|
||||
FONTFORPDF=helvetica
|
||||
FONTFORPDF=DejaVuSans
|
||||
FONTSIZEFORPDF=10
|
||||
SeparatorDecimal=.
|
||||
SeparatorThousand=,
|
||||
|
||||
@ -45,7 +45,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="l.rowid";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
$search_ref=GETPOST('search_ref','int');
|
||||
$search_label=GETPOST('search_label','alpha');
|
||||
|
||||
@ -38,7 +38,7 @@ $status=GETPOST('status');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -169,8 +169,9 @@ if (! empty($action) && $action == 'fetch' && ! empty($id))
|
||||
|
||||
$match = preg_grep('/(' . $htmlname . '[0-9]+)/', array_keys($_GET));
|
||||
sort($match);
|
||||
$idprod = (! empty($match [0]) ? $match [0] : '');
|
||||
|
||||
$idprod = (! empty($match[0]) ? $match[0] : '');
|
||||
|
||||
if (! GETPOST($htmlname) && ! GETPOST($idprod))
|
||||
return;
|
||||
|
||||
|
||||
@ -1315,7 +1315,7 @@ else
|
||||
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
|
||||
dol_fiche_head($head, 'card', $titre, 0, $picto);
|
||||
|
||||
dol_banner_tab($object, 'id', '', ($user->societe_id?0:1), 'ref');
|
||||
dol_banner_tab($object, 'ref', '', ($user->societe_id?0:1), 'ref');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
@ -3119,7 +3119,7 @@ class Product extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load('products');
|
||||
if (!empty($conf->productbatch->enabled)) $langs->load("productbatch");
|
||||
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
|
||||
|
||||
if ($type == 2)
|
||||
{
|
||||
|
||||
@ -55,7 +55,7 @@ $sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if (! $sortfield) $sortfield="p.ref";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
// Load sale and categ filters
|
||||
|
||||
@ -58,7 +58,7 @@ $sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if (! $sortfield) $sortfield="p.ref";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
// Load sale and categ filters
|
||||
|
||||
@ -43,7 +43,7 @@ if (! $sortfield) $sortfield="e.label";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
$page = GETPOST("page");
|
||||
if ($page < 0) $page = 0;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
$year = strftime("%Y",time());
|
||||
|
||||
@ -63,7 +63,7 @@ if (!$sortfield) {
|
||||
if (!$sortorder) {
|
||||
$sortorder = 'ASC';
|
||||
}
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$listofdata=array();
|
||||
|
||||
@ -54,7 +54,7 @@ $search_warehouse = trim(GETPOST("search_warehouse"));
|
||||
$search_inventorycode = trim(GETPOST("search_inventorycode"));
|
||||
$search_user = trim(GETPOST("search_user"));
|
||||
$search_batch = trim(GETPOST("search_batch"));
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
|
||||
@ -58,7 +58,7 @@ $sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if (!$sortfield) {
|
||||
|
||||
@ -41,7 +41,7 @@ if (! $sortfield) $sortfield="e.label";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
$page = $_GET["page"];
|
||||
if ($page < 0) $page = 0;
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
$year = strftime("%Y",time());
|
||||
|
||||
@ -165,7 +165,7 @@ if (empty($reshook))
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans($object->error), null, 'errors');
|
||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -204,13 +204,13 @@ if (empty($reshook))
|
||||
if (empty($ref))
|
||||
{
|
||||
$error++;
|
||||
//$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet
|
||||
//$_GET["id"]=$_POST["id"]; // We return on the project card
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors');
|
||||
}
|
||||
if (empty($_POST["title"]))
|
||||
{
|
||||
$error++;
|
||||
//$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet
|
||||
//$_GET["id"]=$_POST["id"]; // We return on the project card
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ function llxFooterVierge()
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -122,7 +122,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
|
||||
$num_rows = $db->num_rows($resql);
|
||||
if ($num_rows > 0)
|
||||
{
|
||||
setEventMessage($langs->trans("VoteNameAlreadyExists"),'errors');
|
||||
setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
@ -181,7 +181,7 @@ for ($i=0; $i<$nblignes; $i++)
|
||||
$testligneamodifier=true;
|
||||
}
|
||||
|
||||
//test pour voir si une ligne est a modifier
|
||||
//test to see if a line is to be modified
|
||||
if (isset($_POST['validermodifier'.$i]))
|
||||
{
|
||||
$modifier=$i;
|
||||
@ -293,11 +293,11 @@ print '<table class="resultats">'."\n";
|
||||
// Show choice titles
|
||||
if ($object->format=="D")
|
||||
{
|
||||
//affichage des sujets du sondage
|
||||
//display of survey topics
|
||||
print '<tr>'."\n";
|
||||
print '<td></td>'."\n";
|
||||
|
||||
//affichage des années
|
||||
//display of years
|
||||
$colspan=1;
|
||||
$nbofsujet=count($toutsujet);
|
||||
for ($i=0;$i<$nbofsujet;$i++)
|
||||
@ -314,7 +314,7 @@ if ($object->format=="D")
|
||||
print '<tr>'."\n";
|
||||
print '<td></td>'."\n";
|
||||
|
||||
//affichage des mois
|
||||
//display of months
|
||||
$colspan=1;
|
||||
for ($i=0;$i<$nbofsujet;$i++) {
|
||||
$cur = intval($toutsujet[$i]); // intval() est utiliser pour supprimer le suffixe @* qui déplaît logiquement à strftime()
|
||||
@ -337,7 +337,7 @@ if ($object->format=="D")
|
||||
print '<tr>'."\n";
|
||||
print '<td></td>'."\n";
|
||||
|
||||
//affichage des jours
|
||||
//display of days
|
||||
$colspan=1;
|
||||
for ($i=0;$i<$nbofsujet;$i++) {
|
||||
$cur = intval($toutsujet[$i]);
|
||||
@ -356,7 +356,7 @@ if ($object->format=="D")
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
//affichage des horaires
|
||||
//Display schedules
|
||||
if (strpos($object->sujet, '@') !== false) {
|
||||
print '<tr>'."\n";
|
||||
print '<td></td>'."\n";
|
||||
@ -375,7 +375,7 @@ if ($object->format=="D")
|
||||
}
|
||||
else
|
||||
{
|
||||
//affichage des sujets du sondage
|
||||
//display of survey topics
|
||||
print '<tr>'."\n";
|
||||
print '<td></td>'."\n";
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ if ($action == 'confirm_add_resource')
|
||||
if (empty($ref))
|
||||
{
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
||||
setEventMessage($mesg, 'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -90,14 +90,14 @@ if ($action == 'confirm_add_resource')
|
||||
{
|
||||
// Creation OK
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('ResourceCreatedWithSuccess'));
|
||||
setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs');
|
||||
Header("Location: card.php?id=" . $object->id);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Creation KO
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,14 +96,14 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='edit';
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='edit';
|
||||
}
|
||||
}
|
||||
@ -122,17 +122,18 @@ if (empty($reshook))
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans('RessourceSuccessfullyDeleted'));
|
||||
setEventMessages($langs->trans('RessourceSuccessfullyDeleted'), null, 'mesgs');
|
||||
Header('Location: '.DOL_URL_ROOT.'/resource/list.php');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error,'errors');
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ if ($action == 'add_element_resource' && ! $cancel)
|
||||
}
|
||||
if (! $error && $res > 0)
|
||||
{
|
||||
setEventMessage($langs->trans('ResourceLinkedWithSuccess'),'mesgs');
|
||||
setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs');
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$element_id);
|
||||
exit;
|
||||
}
|
||||
@ -112,12 +112,13 @@ if ($action == 'update_linked_resource' && $user->rights->resource->write && !GE
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans('RessourceLineSuccessfullyUpdated'));
|
||||
setEventMessages($langs->trans('RessourceLineSuccessfullyUpdated'), null, 'mesgs');
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error,'errors');
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -129,13 +130,13 @@ if ($action == 'confirm_delete_linked_resource' && $user->rights->resource->dele
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans('RessourceLineSuccessfullyDeleted'));
|
||||
setEventMessages($langs->trans('RessourceLineSuccessfullyDeleted'), null, 'mesgs');
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ if ($page == -1) {
|
||||
$page = 0 ;
|
||||
}
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
@ -77,11 +77,11 @@ if ($action == 'updateoptions')
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,11 +92,11 @@ if ($action == 'updateoptions')
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -121,12 +121,12 @@ if ($action == 'setModuleOptions')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,11 +217,11 @@ if ($action=="setaddrefinlist") {
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1835,7 +1835,7 @@ class Societe extends CommonObject
|
||||
{
|
||||
$label.= '</br><div class="photointooltip">';
|
||||
//if (! is_object($form)) $form = new Form($db);
|
||||
$label.= Form::showphoto('societe', $this, 80);
|
||||
$label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
|
||||
$label.= '</div><div style="clear: both;"></div>';
|
||||
}
|
||||
$label.= '</div>';
|
||||
|
||||
@ -51,7 +51,7 @@ if ($page == -1) {
|
||||
$offset = $conf->liste_limit * $page;
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='dateprint';
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
// Search fields
|
||||
$sref=GETPOST("sref");
|
||||
|
||||
@ -468,7 +468,7 @@ if ($resql)
|
||||
// Show delete result message
|
||||
if (GETPOST('delsoc'))
|
||||
{
|
||||
setEventMessage($langs->trans("CompanyDeleted",GETPOST('delsoc')));
|
||||
setEventMessages($langs->trans("CompanyDeleted",GETPOST('delsoc')), null, 'mesgs');
|
||||
}
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
@ -69,10 +69,13 @@ if ($action == 'add_customer_price_confirm' && ! $_POST ["cancel"] && ($user->ri
|
||||
|
||||
$result = $prodcustprice->create($user, 0, $update_child_soc);
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodcustprice->error, 'errors');
|
||||
} else {
|
||||
setEventMessage($langs->trans('Save'), 'mesgs');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
}
|
||||
|
||||
$action = '';
|
||||
@ -83,10 +86,13 @@ if ($action == 'delete_customer_price' && ($user->rights->produit->creer || $use
|
||||
$prodcustprice->id = GETPOST('lineid');
|
||||
$result = $prodcustprice->delete($user);
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodcustprice->error, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans('Delete'), 'errors');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('Delete'), null, 'mesgs');
|
||||
}
|
||||
$action = '';
|
||||
}
|
||||
@ -105,10 +111,13 @@ if ($action == 'update_customer_price_confirm' && ! $_POST ["cancel"] && ($user-
|
||||
$prodcustprice->recuperableonly = (preg_match('/\*/', GETPOST("tva_tx")) ? 1 : 0);
|
||||
|
||||
$result = $prodcustprice->update($user, 0, $update_child_soc);
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodcustprice->error, 'errors');
|
||||
} else {
|
||||
setEventMessage($langs->trans('Save'), 'mesgs');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
}
|
||||
|
||||
$action = '';
|
||||
@ -181,7 +190,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == - 1) {
|
||||
$page = 0;
|
||||
@ -284,8 +293,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||
print load_fiche_titre($langs->trans('PriceByCustomer'));
|
||||
|
||||
$result = $prodcustprice->fetch(GETPOST('lineid', 'int'));
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodcustprice->error, 'errors');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||
}
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
|
||||
@ -369,8 +379,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||
}
|
||||
|
||||
$result = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
|
||||
if ($result < 0) {
|
||||
setEventMessage($prodcustprice->error, 'errors');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||
}
|
||||
|
||||
$option = '&socid=' . GETPOST('socid', 'int') . '&prodid=' . GETPOST('prodid', 'int');
|
||||
@ -423,7 +434,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||
print '</td>';
|
||||
}
|
||||
print "</table>";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans('None');
|
||||
}
|
||||
|
||||
@ -459,7 +472,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||
$result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($prodcustprice->error, 'errors');
|
||||
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||
}
|
||||
|
||||
$option = '&search_soc=' . $search_soc . '&id=' . $object->id;
|
||||
|
||||
@ -81,7 +81,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$result = $account->update($user);
|
||||
if (! $result)
|
||||
{
|
||||
setEventMessage($account->error, 'errors');
|
||||
setEventMessages($account->error, $account->errors, 'errors');
|
||||
$_GET["action"]='edit'; // Force chargement page edition
|
||||
}
|
||||
else
|
||||
@ -161,8 +161,10 @@ if ($action == 'setasdefault')
|
||||
$url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id;
|
||||
header('Location: '.$url);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessage($db->lasterror, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($db->lasterror, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,12 +182,12 @@ if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($account->error, 'errors');
|
||||
setEventMessages($account->error, $account->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($account->error, 'errors');
|
||||
setEventMessages($account->error, $account->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -121,14 +121,14 @@ if (empty($reshook))
|
||||
{
|
||||
$langs->load('errors');
|
||||
$langs->load('companies');
|
||||
setEventMessage($langs->trans('ErrorProdIdIsMandatory', $langs->trans('MergeOriginThirdparty')), 'errors');
|
||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->trans('MergeOriginThirdparty')), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (!$errors && $soc_origin->fetch($soc_origin_id) < 1)
|
||||
{
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
|
||||
$errors++;
|
||||
}
|
||||
|
||||
@ -197,10 +197,12 @@ if (empty($reshook))
|
||||
|
||||
if (!$errors)
|
||||
{
|
||||
setEventMessage($langs->trans('ThirdpartiesMergeSuccess'));
|
||||
setEventMessages($langs->trans('ThirdpartiesMergeSuccess'), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorsThirdpartyMerge'), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('ErrorsThirdpartyMerge'), null, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -567,16 +569,15 @@ if (empty($reshook))
|
||||
// Logo/Photo save
|
||||
$dir = $conf->societe->multidir_output[$object->entity]."/".$object->id."/logos";
|
||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||
if (GETPOST('deletephoto') && $object->photo)
|
||||
{
|
||||
$fileimg=$dir.'/'.$object->logo;
|
||||
$dirthumbs=$dir.'/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
}
|
||||
if ($file_OK)
|
||||
{
|
||||
if (GETPOST('deletephoto'))
|
||||
{
|
||||
$fileimg=$dir.'/'.$object->logo;
|
||||
$dirthumbs=$dir.'/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
}
|
||||
|
||||
if (image_format_supported($_FILES['photo']['name']) > 0)
|
||||
{
|
||||
dol_mkdir($dir);
|
||||
@ -1837,7 +1838,7 @@ else
|
||||
{
|
||||
if ($object->logo) print "<br>\n";
|
||||
print '<table class="nobordernopadding">';
|
||||
if ($object->logo) print '<tr><td><input type="checkbox" class="flat" name="deletephoto photodelete" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
if ($object->logo) print '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
//print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
@ -139,7 +139,7 @@ $now=dol_now();
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$limit = $conf->liste_limit;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
|
||||
@ -662,6 +662,7 @@ div.statusref {
|
||||
padding-right: 12px;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 10px;
|
||||
clear: both;
|
||||
}
|
||||
img.photoref {
|
||||
border: 1px solid #CCC;
|
||||
@ -3650,7 +3651,7 @@ a span.select2-chosen
|
||||
color: #fff !important;
|
||||
}
|
||||
span.noborderoncategories a, li.noborderoncategories a {
|
||||
color: #fff;
|
||||
color: #fff !important;
|
||||
line-height: normal;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
@ -711,6 +711,7 @@ div.statusref {
|
||||
padding-right: 12px;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 10px;
|
||||
clear: both;
|
||||
}
|
||||
img.photoref {
|
||||
height: 80px;
|
||||
@ -3492,15 +3493,15 @@ a span.select2-chosen
|
||||
color: #fff !important;
|
||||
}
|
||||
span.noborderoncategories a, li.noborderoncategories a {
|
||||
color: #fff;
|
||||
color: #fff !important;
|
||||
line-height: normal;
|
||||
vertical-align: top;
|
||||
}
|
||||
span.noborderoncategories {
|
||||
padding: 3px 5px 0px 5px;
|
||||
padding: 5px 5px 0px 5px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Multiselect with checkbox */
|
||||
/* ============================================================================== */
|
||||
|
||||
@ -98,7 +98,7 @@ if (empty($reshook)) {
|
||||
$enabled = trim(GETPOST('AGENDA_EXT_ENABLED_'.$id.'_'.$i, 'alpha'));
|
||||
|
||||
if (!empty($src) && !dol_is_url($src)) {
|
||||
setEventMessage($langs->trans("ErrorParamMustBeAnUrl"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorParamMustBeAnUrl"), null, 'errors');
|
||||
$error ++;
|
||||
$errorsaved ++;
|
||||
break;
|
||||
@ -122,11 +122,11 @@ if (empty($reshook)) {
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
if (empty($errorsaved)) {
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$result = $account->update($user);
|
||||
if (! $result)
|
||||
{
|
||||
setEventMessage($account->error, 'errors');
|
||||
setEventMessages($account->error, $account->errors, 'errors');
|
||||
$_GET["action"]='edit'; // Force chargement page edition
|
||||
}
|
||||
else
|
||||
|
||||
@ -127,7 +127,7 @@ if (empty($reshook)) {
|
||||
$nb = $object->getNbOfUsers("active");
|
||||
if ($nb >= $conf->file->main_limit_users) {
|
||||
$error ++;
|
||||
setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors');
|
||||
setEventMessages($langs->trans("YourQuotaOfUsersIsReached"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ if (empty($reshook)) {
|
||||
$result = $object->delete();
|
||||
if ($result < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorUserCannotBeDelete"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorUserCannotBeDelete"), null, 'errors');
|
||||
} else {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
@ -160,12 +160,12 @@ if (empty($reshook)) {
|
||||
|
||||
if (!$_POST["lastname"]) {
|
||||
$error ++;
|
||||
setEventMessage($langs->trans("NameNotDefined"), 'errors');
|
||||
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
|
||||
$action = "create"; // Go back to create page
|
||||
}
|
||||
if (!$_POST["login"]) {
|
||||
$error ++;
|
||||
setEventMessage($langs->trans("LoginNotDefined"), 'errors');
|
||||
setEventMessages($langs->trans("LoginNotDefined"), null, 'errors');
|
||||
$action = "create"; // Go back to create page
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ if (empty($reshook)) {
|
||||
$nb = $object->getNbOfUsers("active");
|
||||
if ($nb >= $conf->file->main_limit_users) {
|
||||
$error ++;
|
||||
setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors');
|
||||
setEventMessages($langs->trans("YourQuotaOfUsersIsReached"), null, 'errors');
|
||||
$action = "create"; // Go back to create page
|
||||
}
|
||||
}
|
||||
@ -248,14 +248,15 @@ if (empty($reshook)) {
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
|
||||
exit;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$db->rollback();
|
||||
if (is_array($object->errors) && count($object->errors)) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
if (is_array($object->errors) && count($object->errors))
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
$action = "create"; // Go back to create page
|
||||
}
|
||||
}
|
||||
@ -281,8 +282,10 @@ if (empty($reshook)) {
|
||||
if ($result > 0) {
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -295,12 +298,12 @@ if (empty($reshook)) {
|
||||
$error = 0;
|
||||
|
||||
if (!$_POST["lastname"]) {
|
||||
setEventMessage($langs->trans("NameNotDefined"), 'errors');
|
||||
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
|
||||
$action = "edit"; // Go back to create page
|
||||
$error ++;
|
||||
}
|
||||
if (!$_POST["login"]) {
|
||||
setEventMessage($langs->trans("LoginNotDefined"), 'errors');
|
||||
setEventMessages($langs->trans("LoginNotDefined"), null, 'errors');
|
||||
$action = "edit"; // Go back to create page
|
||||
$error ++;
|
||||
}
|
||||
@ -398,8 +401,10 @@ if (empty($reshook)) {
|
||||
$error ++;
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorLoginAlreadyExists", $object->login), 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
@ -427,7 +432,7 @@ if (empty($reshook)) {
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
$error ++;
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,7 +454,7 @@ if (empty($reshook)) {
|
||||
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']);
|
||||
|
||||
if (!$result > 0) {
|
||||
setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
|
||||
} else {
|
||||
// Create small thumbs for company (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
@ -468,7 +473,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if (!$error && !count($object->errors)) {
|
||||
setEventMessage($langs->trans("UserModified"));
|
||||
setEventMessages($langs->trans("UserModified"), null, 'mesgs');
|
||||
$db->commit();
|
||||
|
||||
$login = $_SESSION["dol_login"];
|
||||
@ -490,8 +495,9 @@ if (empty($reshook)) {
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
$ret = $object->setPassword($user, $_POST["password"]);
|
||||
if ($ret < 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
if ($ret < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -502,7 +508,7 @@ if (empty($reshook)) {
|
||||
$ret=$object->setPassword($user,$_POST["password"]);
|
||||
if ($ret < 0)
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -515,17 +521,22 @@ if (empty($reshook)) {
|
||||
$newpassword = $object->setPassword($user, '');
|
||||
if ($newpassword < 0) {
|
||||
// Echec
|
||||
setEventMessage($langs->trans("ErrorFailedToSetNewPassword"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailedToSetNewPassword"), null, 'errors');
|
||||
} else {
|
||||
// Succes
|
||||
if ($action == 'confirm_passwordsend' && $confirm == 'yes') {
|
||||
if ($object->send_password($user, $newpassword) > 0) {
|
||||
setEventMessage($langs->trans("PasswordChangedAndSentTo", $object->email));
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
if ($object->send_password($user, $newpassword) > 0)
|
||||
{
|
||||
setEventMessages($langs->trans("PasswordChangedAndSentTo", $object->email), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
setEventMessage($langs->trans("PasswordChangedTo", $newpassword), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("PasswordChangedTo", $newpassword), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -577,8 +588,10 @@ if (empty($reshook)) {
|
||||
$ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -664,12 +677,12 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
|
||||
// If user list is full, we show drop-down list
|
||||
@ -1123,7 +1136,7 @@ else
|
||||
$entries = $ldap->fetch($object->login,$userSearchFilter);
|
||||
if (! $entries)
|
||||
{
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
|
||||
$passDoNotExpire = 0;
|
||||
|
||||
@ -63,8 +63,9 @@ if (empty($reshook)) {
|
||||
$edituser->clicktodial_poste = GETPOST("poste");
|
||||
|
||||
$result = $edituser->update_clicktodial();
|
||||
if ($result < 0) {
|
||||
setEventMessage($edituser->error, 'errors');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($edituser->error, $edituser->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorForbidden'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorForbidden'), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ if ($action == 'add')
|
||||
if ($caneditperms)
|
||||
{
|
||||
if (! $_POST["nom"]) {
|
||||
setEventMessage($langs->trans("NameNotDefined"), 'errors');
|
||||
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
|
||||
$action="create"; // Go back to create page
|
||||
} else {
|
||||
$object->nom = trim($_POST["nom"]); // For backward compatibility
|
||||
@ -122,7 +122,7 @@ if ($action == 'add')
|
||||
$db->rollback();
|
||||
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorGroupAlreadyExists",$object->name), 'errors');
|
||||
setEventMessages($langs->trans("ErrorGroupAlreadyExists",$object->name), null, 'errors');
|
||||
$action="create"; // Go back to create page
|
||||
}
|
||||
}
|
||||
@ -130,7 +130,7 @@ if ($action == 'add')
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorForbidden'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorForbidden'), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,14 +156,14 @@ if ($action == 'adduser' || $action =='removeuser')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($edituser->error, 'errors');
|
||||
setEventMessages($edituser->error, $edituser->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorForbidden'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorForbidden'), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,19 +193,19 @@ if ($action == 'update')
|
||||
|
||||
if ($ret >= 0 && ! count($object->errors))
|
||||
{
|
||||
setEventMessage($langs->trans("GroupModified"));
|
||||
setEventMessages($langs->trans("GroupModified"), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error);
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorForbidden'));
|
||||
setEventMessages($langs->trans('ErrorForbidden'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -73,12 +73,12 @@ if ($action == 'dolibarr2ldap')
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans("GroupSynchronized"));
|
||||
setEventMessages($langs->trans("GroupSynchronized"), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($ldap->error);
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,11 +70,14 @@ if (empty($reshook)) {
|
||||
|
||||
$result = $ldap->update($dn, $info, $user, $olddn);
|
||||
|
||||
if ($result >= 0) {
|
||||
setEventMessage($langs->trans("UserSynchronized"));
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessages($langs->trans("UserSynchronized"), null, 'mesgs');
|
||||
$db->commit();
|
||||
} else {
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user