';
-
-$var=true;
-
/*
* Last modified members
*/
@@ -295,12 +291,10 @@ if ($resql)
if ($num)
{
$i = 0;
- $var = True;
while ($i < $num)
{
- $var=!$var;
$obj = $db->fetch_object($resql);
- print "
';
print '';
$commandestatic->id=$obj->rowid;
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 03b9cfce56a..4185518b721 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -199,227 +199,226 @@ if (empty($reshook))
$permtodelete = $user->rights->commande->supprimer;
$uploaddir = $conf->commande->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
-}
-
-if ($massaction == 'confirm_createbills') {
-
- $orders = GETPOST('toselect');
- $createbills_onebythird = GETPOST('createbills_onebythird', 'int');
- $validate_invoices = GETPOST('valdate_invoices', 'int');
-
- $TFact = array();
- $TFactThird = array();
-
- $nb_bills_created = 0;
-
- $db->begin();
-
- foreach($orders as $id_order) {
-
- $cmd = new Commande($db);
- if($cmd->fetch($id_order) <= 0) continue;
-
- $object = new Facture($db);
- if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
- else {
-
- $object->socid = $cmd->socid;
- $object->type = Facture::TYPE_STANDARD;
- $object->cond_reglement_id = $cmd->cond_reglement_id;
- $object->mode_reglement_id = $cmd->mode_reglement_id;
- $object->fk_project = $cmd->fk_project;
-
- $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
- if (empty($datefacture))
- {
- $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
- }
-
- $object->date = $datefacture;
- $object->origin = 'commande';
- $object->origin_id = $id_order;
-
- $res = $object->create($user);
-
- if($res > 0) $nb_bills_created++;
-
- }
-
- if($object->id > 0) {
-
- $db->begin();
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
- $sql.= "fk_source";
- $sql.= ", sourcetype";
- $sql.= ", fk_target";
- $sql.= ", targettype";
- $sql.= ") VALUES (";
- $sql.= $id_order;
- $sql.= ", '".$object->origin."'";
- $sql.= ", ".$object->id;
- $sql.= ", '".$object->element."'";
- $sql.= ")";
-
- if ($db->query($sql))
- {
- $db->commit();
- }
- else
- {
- $db->rollback();
- }
-
- $lines = $cmd->lines;
- if (empty($lines) && method_exists($cmd, 'fetch_lines'))
- {
- $cmd->fetch_lines();
- $lines = $cmd->lines;
- }
-
- $fk_parent_line=0;
- $num=count($lines);
-
- for ($i=0;$i<$num;$i++)
- {
- $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
- if ($lines[$i]->subprice < 0)
- {
- // Negative line, we create a discount line
- $discount = new DiscountAbsolute($db);
- $discount->fk_soc=$object->socid;
- $discount->amount_ht=abs($lines[$i]->total_ht);
- $discount->amount_tva=abs($lines[$i]->total_tva);
- $discount->amount_ttc=abs($lines[$i]->total_ttc);
- $discount->tva_tx=$lines[$i]->tva_tx;
- $discount->fk_user=$user->id;
- $discount->description=$desc;
- $discountid=$discount->create($user);
- if ($discountid > 0)
- {
- $result=$object->insert_discount($discountid);
- //$result=$discount->link_to_invoice($lineid,$id);
- }
- else
- {
- setEventMessages($discount->error, $discount->errors, 'errors');
- $error++;
- break;
- }
- }
- else
- {
- // Positive line
- $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
- // Date start
- $date_start=false;
- if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue;
- if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
- if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
- //Date end
- $date_end=false;
- if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue;
- if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
- if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
- // Reset fk_parent_line for no child products and special product
- if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9)
- {
- $fk_parent_line = 0;
- }
- $result = $object->addline(
- $desc,
- $lines[$i]->subprice,
- $lines[$i]->qty,
- $lines[$i]->tva_tx,
- $lines[$i]->localtax1_tx,
- $lines[$i]->localtax2_tx,
- $lines[$i]->fk_product,
- $lines[$i]->remise_percent,
- $date_start,
- $date_end,
- 0,
- $lines[$i]->info_bits,
- $lines[$i]->fk_remise_except,
- 'HT',
- 0,
- $product_type,
- $ii,
- $lines[$i]->special_code,
- $object->origin,
- $lines[$i]->rowid,
- $fk_parent_line,
- $lines[$i]->fk_fournprice,
- $lines[$i]->pa_ht,
- $lines[$i]->label
- );
- if ($result > 0)
- {
- $lineid=$result;
- }
- else
- {
- $lineid=0;
- $error++;
- break;
- }
- // Defined the new fk_parent_line
- if ($result > 0 && $lines[$i]->product_type == 9)
- {
- $fk_parent_line = $result;
- }
- }
- }
-
- }
-
- $cmd->classifyBilled($user);
-
- if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
- else $TFact[$object->id] = $object;
- }
-
- // Build doc with all invoices
- $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
- $toselect = array();
-
- if(!empty($validate_invoices)) {
-
- $massaction = $action = 'builddoc';
-
- foreach($TAllFact as &$object) {
- $object->validate($user);
- $toselect[] = $object->id; // For builddoc action
-
- // Fac builddoc
- $upload_dir = $conf->facture->dir_output;
- $permissioncreate=$user->rights->facture->creer;
- include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
- }
-
- $objectclass='Facture';
- $objectlabel='Invoice';
- $permtoread = $user->rights->facture->lire;
- $permtodelete = $user->rights->facture->supprimer;
- $uploaddir = $conf->facture->dir_output;
- include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
-
- }
-
- if (! $error)
- {
- $db->commit();
- setEventMessage($langs->trans('BillCreated', $nb_bills_created));
- }
- else
- {
- $db->rollback();
- $action='create';
- $_GET["origin"]=$_POST["origin"];
- $_GET["originid"]=$_POST["originid"];
- setEventMessages($object->error, $object->errors, 'errors');
- $error++;
- }
-
+ // TODO Move this into mass action include
+ if ($massaction == 'confirm_createbills') {
+
+ $orders = GETPOST('toselect');
+ $createbills_onebythird = GETPOST('createbills_onebythird', 'int');
+ $validate_invoices = GETPOST('valdate_invoices', 'int');
+
+ $TFact = array();
+ $TFactThird = array();
+
+ $nb_bills_created = 0;
+
+ $db->begin();
+
+ foreach($orders as $id_order) {
+
+ $cmd = new Commande($db);
+ if($cmd->fetch($id_order) <= 0) continue;
+
+ $object = new Facture($db);
+ if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
+ else {
+
+ $object->socid = $cmd->socid;
+ $object->type = Facture::TYPE_STANDARD;
+ $object->cond_reglement_id = $cmd->cond_reglement_id;
+ $object->mode_reglement_id = $cmd->mode_reglement_id;
+ $object->fk_project = $cmd->fk_project;
+
+ $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
+ if (empty($datefacture))
+ {
+ $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
+ }
+
+ $object->date = $datefacture;
+ $object->origin = 'commande';
+ $object->origin_id = $id_order;
+
+ $res = $object->create($user);
+
+ if($res > 0) $nb_bills_created++;
+
+ }
+
+ if($object->id > 0) {
+
+ $db->begin();
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
+ $sql.= "fk_source";
+ $sql.= ", sourcetype";
+ $sql.= ", fk_target";
+ $sql.= ", targettype";
+ $sql.= ") VALUES (";
+ $sql.= $id_order;
+ $sql.= ", '".$object->origin."'";
+ $sql.= ", ".$object->id;
+ $sql.= ", '".$object->element."'";
+ $sql.= ")";
+
+ if ($db->query($sql))
+ {
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
+ }
+
+ $lines = $cmd->lines;
+ if (empty($lines) && method_exists($cmd, 'fetch_lines'))
+ {
+ $cmd->fetch_lines();
+ $lines = $cmd->lines;
+ }
+
+ $fk_parent_line=0;
+ $num=count($lines);
+
+ for ($i=0;$i<$num;$i++)
+ {
+ $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
+ if ($lines[$i]->subprice < 0)
+ {
+ // Negative line, we create a discount line
+ $discount = new DiscountAbsolute($db);
+ $discount->fk_soc=$object->socid;
+ $discount->amount_ht=abs($lines[$i]->total_ht);
+ $discount->amount_tva=abs($lines[$i]->total_tva);
+ $discount->amount_ttc=abs($lines[$i]->total_ttc);
+ $discount->tva_tx=$lines[$i]->tva_tx;
+ $discount->fk_user=$user->id;
+ $discount->description=$desc;
+ $discountid=$discount->create($user);
+ if ($discountid > 0)
+ {
+ $result=$object->insert_discount($discountid);
+ //$result=$discount->link_to_invoice($lineid,$id);
+ }
+ else
+ {
+ setEventMessages($discount->error, $discount->errors, 'errors');
+ $error++;
+ break;
+ }
+ }
+ else
+ {
+ // Positive line
+ $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
+ // Date start
+ $date_start=false;
+ if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue;
+ if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
+ if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
+ //Date end
+ $date_end=false;
+ if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue;
+ if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
+ if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
+ // Reset fk_parent_line for no child products and special product
+ if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9)
+ {
+ $fk_parent_line = 0;
+ }
+ $result = $object->addline(
+ $desc,
+ $lines[$i]->subprice,
+ $lines[$i]->qty,
+ $lines[$i]->tva_tx,
+ $lines[$i]->localtax1_tx,
+ $lines[$i]->localtax2_tx,
+ $lines[$i]->fk_product,
+ $lines[$i]->remise_percent,
+ $date_start,
+ $date_end,
+ 0,
+ $lines[$i]->info_bits,
+ $lines[$i]->fk_remise_except,
+ 'HT',
+ 0,
+ $product_type,
+ $ii,
+ $lines[$i]->special_code,
+ $object->origin,
+ $lines[$i]->rowid,
+ $fk_parent_line,
+ $lines[$i]->fk_fournprice,
+ $lines[$i]->pa_ht,
+ $lines[$i]->label
+ );
+ if ($result > 0)
+ {
+ $lineid=$result;
+ }
+ else
+ {
+ $lineid=0;
+ $error++;
+ break;
+ }
+ // Defined the new fk_parent_line
+ if ($result > 0 && $lines[$i]->product_type == 9)
+ {
+ $fk_parent_line = $result;
+ }
+ }
+ }
+
+ }
+
+ $cmd->classifyBilled($user);
+
+ if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
+ else $TFact[$object->id] = $object;
+ }
+
+ // Build doc with all invoices
+ $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
+ $toselect = array();
+
+ if(!empty($validate_invoices)) {
+
+ $massaction = $action = 'builddoc';
+
+ foreach($TAllFact as &$object) {
+ $object->validate($user);
+ $toselect[] = $object->id; // For builddoc action
+
+ // Fac builddoc
+ $upload_dir = $conf->facture->dir_output;
+ $permissioncreate=$user->rights->facture->creer;
+ include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
+ }
+
+ $objectclass='Facture';
+ $objectlabel='Invoice';
+ $permtoread = $user->rights->facture->lire;
+ $permtodelete = $user->rights->facture->supprimer;
+ $uploaddir = $conf->facture->dir_output;
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
+
+ }
+
+ if (! $error)
+ {
+ $db->commit();
+ setEventMessage($langs->trans('BillCreated', $nb_bills_created));
+ }
+ else
+ {
+ $db->rollback();
+ $action='create';
+ $_GET["origin"]=$_POST["origin"];
+ $_GET["originid"]=$_POST["originid"];
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
+ }
+ }
}
@@ -435,8 +434,9 @@ $formfile = new FormFile($db);
$companystatic = new Societe($db);
$formcompany=new FormCompany($db);
+$title=$langs->trans("Orders");
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
-llxHeader('',$langs->trans("Orders"),$help_url);
+llxHeader('',$title,$help_url);
$sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
@@ -563,8 +563,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
}
$sql.= $db->plimit($limit + 1,$offset);
-
//print $sql;
+
$resql = $db->query($sql);
if ($resql)
{
@@ -622,7 +622,6 @@ if ($resql)
if ($show_files) $param.='&show_files=' .$show_files;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($billed != '') $param.='&billed='.$billed;
-
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
@@ -654,6 +653,7 @@ if ($resql)
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
+ // TODO Move this into an invluce
if ($massaction == 'presend')
{
$langs->load("mails");
@@ -679,9 +679,6 @@ if ($resql)
print ' ';
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail = new FormMail($db);
-
dol_fiche_head(null, '', '');
$topicmail="SendOrderRef";
@@ -789,7 +786,6 @@ if ($resql)
print ' ';
print '';
print ' ';
-
}
if ($sall)
@@ -841,7 +837,8 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-
+ if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
+
print '';
print '
'."\n";
@@ -992,7 +989,7 @@ if ($resql)
}
// Action column
print '';
- $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
+ $searchpitco=$form->showFilterButtons();
print $searchpitco;
print ' ';
@@ -1021,7 +1018,7 @@ if ($resql)
if (! empty($arrayfields["ef.".$key]['checked']))
{
$align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
}
}
}
@@ -1033,7 +1030,7 @@ if ($resql)
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,'');
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print ''."\n";
$total=0;
@@ -1048,7 +1045,8 @@ if ($resql)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
- print '';
+
+ print ' ';
$notshippable=0;
$warning = 0;
@@ -1221,7 +1219,7 @@ if ($resql)
// Third party
if (! empty($arrayfields['s.nom']['checked']))
{
- print '';
+ print ' ';
print $companystatic->getNomUrl(1,'customer');
// If module invoices enabled and user with invoice creation permissions
@@ -1391,7 +1389,7 @@ if ($resql)
}
// Show total line
- if (isset($totalarray['totalhtfield'])
+ if (isset($totalarray['totalhtfield'])
|| isset($totalarray['totalvatfield'])
|| isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield'])
@@ -1427,8 +1425,6 @@ if ($resql)
print ''."\n";
- //print ' '.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).' ';
-
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
{
/*
@@ -1439,7 +1435,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->commande->lire;
- $delallowed=$user->rights->commande->lire;
+ $delallowed=$user->rights->commande->supprimer;
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
@@ -1454,6 +1450,5 @@ else
dol_print_error($db);
}
-// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index 17c73c82698..c6b93cb8f0f 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -653,8 +653,8 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
while ($i < $num)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
print '';
$generic_commande->id=$objp->rowid;
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index d900709b835..dd79ee54ba1 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -253,7 +253,7 @@ if ($mode == 'supplier') $type='supplier_order_stats';
complete_head_from_modules($conf,$langs,null,$head,$h,$type);
-dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
+dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
print '';
@@ -323,7 +323,7 @@ foreach ($data as $val)
while (! empty($year) && $oldyear > $year+1)
{ // If we have empty year
$oldyear--;
- $var=!$var;
+
print '
';
print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.' ';
print '0 ';
@@ -335,7 +335,7 @@ foreach ($data as $val)
print ' ';
}
- $var=!$var;
+
print '
';
print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.' ';
print ''.$val['nb'].' ';
diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php
index 38efbc91ca2..629cd3c0fb0 100644
--- a/htdocs/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php
@@ -36,7 +36,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
- $var=!$var;
+
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index af63247f48d..cb10fd8c3c7 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -144,7 +144,7 @@ else
// Onglets
$head=bank_prepare_head($object);
-dol_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0,'account');
+dol_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), -1, 'account');
$title=$langs->trans("FinancialAccount")." : ".$object->label;
$link=($year_start?"".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"')." ":"");
@@ -203,8 +203,8 @@ print ' ';
$var=true;
for ($mois = 1 ; $mois < 13 ; $mois++)
{
- $var=!$var;
- print '
';
+
+ print ' ';
print "".dol_print_date(dol_mktime(1,1,1,$mois,1,2000),"%B")." ";
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php
index 9af9b6f4707..bddf1292214 100644
--- a/htdocs/compta/bank/bankentries.php
+++ b/htdocs/compta/bank/bankentries.php
@@ -178,7 +178,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
{
$search_dt_start='';
$search_dt_end='';
@@ -298,7 +298,7 @@ if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier)
if (! $error)
{
$object->fetch($id);
- $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
+ $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user);
if ($insertid > 0)
{
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
@@ -720,43 +720,8 @@ if ($resql)
print '';
print '
'."\n";
-
- // Fields title
- print '';
- if (! empty($arrayfields['b.rowid']['checked'])) print_liste_field_titre($arrayfields['b.rowid']['label'],$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['description']['checked'])) print_liste_field_titre($arrayfields['description']['label'],$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['b.dateo']['checked'])) print_liste_field_titre($arrayfields['b.dateo']['label'],$_SERVER['PHP_SELF'],'b.dateo','',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['b.datev']['checked'])) print_liste_field_titre($arrayfields['b.datev']['label'],$_SERVER['PHP_SELF'],'b.datev, b.dateo, b.rowid','',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['type']['checked'])) print_liste_field_titre($arrayfields['type']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['b.num_chq']['checked'])) print_liste_field_titre($arrayfields['b.num_chq']['label'],$_SERVER['PHP_SELF'],'b.num_chq','',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['bu.label']['checked'])) print_liste_field_titre($arrayfields['bu.label']['label'],$_SERVER['PHP_SELF'],'bu.label','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'],$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['b.debit']['checked'])) print_liste_field_titre($arrayfields['b.debit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'],$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['b.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'],$_SERVER['PHP_SELF'],'b.rappro','',$param,'align="center"',$sortfield,$sortorder);
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
- }
- // Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
- print '';
+ print ' ';
if (! empty($arrayfields['b.rowid']['checked']))
{
print '';
@@ -837,6 +802,43 @@ if ($resql)
print ' ';
print " \n";
+
+ // Fields title
+ print '';
+ if (! empty($arrayfields['b.rowid']['checked'])) print_liste_field_titre($arrayfields['b.rowid']['label'],$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['description']['checked'])) print_liste_field_titre($arrayfields['description']['label'],$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['b.dateo']['checked'])) print_liste_field_titre($arrayfields['b.dateo']['label'],$_SERVER['PHP_SELF'],'b.dateo','',$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['b.datev']['checked'])) print_liste_field_titre($arrayfields['b.datev']['label'],$_SERVER['PHP_SELF'],'b.datev, b.dateo, b.rowid','',$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['type']['checked'])) print_liste_field_titre($arrayfields['type']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['b.num_chq']['checked'])) print_liste_field_titre($arrayfields['b.num_chq']['label'],$_SERVER['PHP_SELF'],'b.num_chq','',$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['bu.label']['checked'])) print_liste_field_titre($arrayfields['bu.label']['label'],$_SERVER['PHP_SELF'],'bu.label','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'],$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['b.debit']['checked'])) print_liste_field_titre($arrayfields['b.debit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'],$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['b.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'],$_SERVER['PHP_SELF'],'b.rappro','',$param,'align="center"',$sortfield,$sortorder);
+ // Extra fields
+ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+ {
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ $align=$extrafields->getAlignFlag($key);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ }
+ }
+ }
+ // Hook fields
+ $parameters=array('arrayfields'=>$arrayfields);
+ $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
+
$balance = 0; // For balance
$balancecalculated = false;
@@ -897,9 +899,9 @@ if ($resql)
$bankaccount = $cachebankaccount[$objp->bankid];
}
- $var=!$var;
+
- print "";
+ print ' ';
// Ref
if (! empty($arrayfields['b.rowid']['checked']))
diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php
index c1d668df8d7..eb6aea4f2dc 100644
--- a/htdocs/compta/bank/bilan.php
+++ b/htdocs/compta/bank/bilan.php
@@ -66,22 +66,22 @@ print " ";
echo ''.$langs->trans("Summary").' ';
print " \n";
-$var=!$var;
+
$sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."paiement";
$paiem = valeur($sql);
print "Somme des paiements (associes a une facture) ".price($paiem)." ";
-$var=!$var;
+
$sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank WHERE amount > 0";
$credits = valeur($sql);
print "Somme des credits ".price($credits)." ";
-$var=!$var;
+
$sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank WHERE amount < 0";
$debits = valeur($sql);
print "Somme des debits ".price($debits)." ";
-$var=!$var;
+
$sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank ";
$solde = valeur($sql);
print "".$langs->trans("BankBalance")." ".price($solde)." ";
diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php
index cd6d2adb796..699edd31b7a 100644
--- a/htdocs/compta/bank/budget.php
+++ b/htdocs/compta/bank/budget.php
@@ -74,8 +74,8 @@ if ($result)
while ($i < $num)
{
$objp = $db->fetch_object($result);
- $var=!$var;
- print "";
+
+ print ' ';
print "rowid\">$objp->label ";
print ''.$objp->nombre.' ';
print ''.price(abs($objp->somme))." ";
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index dcc0fc85ecc..df6e6b1c8c8 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -117,7 +117,7 @@ if ($action == 'add')
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number))
{
- setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), null, 'error');
+ setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), null, 'errors');
$action='create'; // Force chargement page en mode creation
$error++;
}
@@ -713,7 +713,7 @@ else
print '';
- print ''.$langs->trans("BankName").' ';
+ print ''.$langs->trans("BankName").' ';
print ''.$object->bank.' ';
// Show fields of bank account
@@ -957,7 +957,7 @@ else
print ' ';
- print '
';
+ //print '
';
print '';
@@ -991,7 +991,7 @@ else
{
print ' ';
- print '
';
+ //print '
';
print '';
diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php
index 51030242fce..0cf88224e63 100644
--- a/htdocs/compta/bank/categ.php
+++ b/htdocs/compta/bank/categ.php
@@ -80,7 +80,7 @@ if ($categid) {
llxHeader();
-print load_fiche_titre($langs->trans("Rubriques"), '', 'title_bank.png');
+print load_fiche_titre($langs->trans("RubriquesTransactions"), '', 'title_bank.png');
print '
';
@@ -3696,8 +3692,6 @@ else if ($id > 0 || ! empty($ref))
print ' ';
print '';
- $var = true;
-
// Payments already done (from payment on this invoice)
$sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
$sql .= ' c.code as payment_code, c.libelle as payment_label,';
@@ -3719,8 +3713,7 @@ else if ($id > 0 || ! empty($ref))
if ($num > 0) {
while ($i < $num) {
$objp = $db->fetch_object($result);
- $var = ! $var;
- print '';
+ print ' ';
$paymentstatic->id = $objp->rowid;
$paymentstatic->datepaye = $db->jdate($objp->dp);
$paymentstatic->ref = $objp->ref;
@@ -3745,9 +3738,10 @@ else if ($id > 0 || ! empty($ref))
print ' ';
$i ++;
}
- } else {
- print '' . $langs->trans("None") . ' ';
- }
+ }
+ /*else {
+ print '' . $langs->trans("None") . ' ';
+ }*/
// }
$db->free($result);
} else {
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 963534da934..4b9ced1c4c0 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -359,7 +359,6 @@ class Facture extends CommonInvoice
'__INVOICE_NEXT_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'),
);
- $substitutionisok=true;
complete_substitutions_array($substitutionarray, $outputlangs);
$this->note_public=make_substitutions($this->note_public,$substitutionarray);
@@ -2872,7 +2871,7 @@ class Facture extends CommonInvoice
// Cap percentages to 100
if ($percent > 100) $percent = 100;
$line->situation_percent = $percent;
- $tabprice = calcul_price_total($line->qty, $line->subprice, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->product_type, 'HT', 0, 0, $mysoc, '', $percent);
+ $tabprice = calcul_price_total($line->qty, $line->subprice, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 0, 'HT', 0, $line->product_type, $mysoc, '', $percent);
$line->total_ht = $tabprice[0];
$line->total_tva = $tabprice[1];
$line->total_ttc = $tabprice[2];
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index 45c6102ce1c..2d2ff5cc073 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
$totalpaye = $object->getSommePaiement();
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 9d4329a671b..706807c8f02 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -38,6 +38,7 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
}
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
$langs->load('bills');
$langs->load('compta');
@@ -109,6 +110,7 @@ $arrayfields=array(
'f.tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1),
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1),
'f.frequency'=>array('label'=>$langs->trans("RecurringInvoiceTemplate"), 'checked'=>1),
+ 'f.nb_gen_done'=>array('label'=>$langs->trans("NbGeneration"), 'checked'=>1),
'f.date_last_gen'=>array('label'=>$langs->trans("DateLastGeneration"), 'checked'=>1),
'f.date_when'=>array('label'=>$langs->trans("NextDateToExecution"), 'checked'=>1),
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
@@ -936,7 +938,8 @@ if ($action == 'create')
'__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%Y').')',
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')'
);
-
+ $substitutionarray['__(TRANSKEY)__']=$langs->trans("TransKey");
+
$htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").': ';
foreach($substitutionarray as $key => $val)
{
@@ -947,7 +950,7 @@ if ($action == 'create')
// Public note
print '';
print '';
- print $form->textwithpicto($langs->trans('NotePublic'), $htmltext);
+ print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic');
print ' ';
print '';
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
@@ -958,7 +961,7 @@ if ($action == 'create')
{
print ' ';
print '';
- print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext);
+ print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate');
print ' ';
print '';
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
@@ -994,7 +997,7 @@ if ($action == 'create')
// Bank account
if ($object->fk_account > 0)
{
- print " ".$langs->trans('BankAccount')." ";
+ print " ".$langs->trans('RIB')." ";
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
print " ";
}
@@ -1109,13 +1112,9 @@ else
$author = new User($db);
$author->fetch($object->user_author);
- $head=array();
- $h=0;
- $head[$h][0] = $_SERVER["PHP_SELF"].'?id='.$object->id;
- $head[$h][1] = $langs->trans("CardBill");
- $head[$h][2] = 'card';
+ $head=invoice_rec_prepare_head($object);
- dol_fiche_head($head, 'card', $langs->trans("RepeatableInvoice"),0,'bill'); // Add a div
+ dol_fiche_head($head, 'card', $langs->trans("RepeatableInvoice"), -1, 'bill'); // Add a div
// Recurring invoice content
@@ -1243,7 +1242,8 @@ else
'__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')',
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')'
);
-
+ $substitutionarray['__(TRANSKEY)__']=$langs->trans("TransKey");
+
$htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").': ';
foreach($substitutionarray as $key => $val)
{
@@ -1253,7 +1253,7 @@ else
// Note public
print '';
- print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext), 'note_public', $object->note_public, $object, $user->rights->facture->creer);
+ print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $user->rights->facture->creer);
print ' ';
print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60');
print ' ';
@@ -1261,16 +1261,18 @@ else
// Note private
print '';
- print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
+ print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
print ' ';
print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60');
print ' ';
print ' ';
// Bank Account
+ $langs->load('banks');
+
print '';
print '';
- print $langs->trans('BankAccount');
+ print $langs->trans('RIB');
print ' ';
if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon))
print ' id.'">'.img_edit($langs->trans('SetBankAccount'),1).' ';
@@ -1294,16 +1296,17 @@ else
print '';
print '
';
- print '
';
/*
* Recurrence
*/
$title = $langs->trans("Recurrence");
- print load_fiche_titre($title, '', 'calendar');
+ //print load_fiche_titre($title, '', 'calendar');
print '';
+ print ' '.$title.' ';
+
// if "frequency" is empty or = 0, the reccurence is disabled
print '';
print '';
@@ -1538,10 +1541,16 @@ else
* List mode
*/
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency,";
- $sql.= " f.date_last_gen, f.date_when";
+ $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
+ if (! $user->rights->societe->client->voir && ! $socid) {
+ $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ }
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity = ".$conf->entity;
+ if (! $user->rights->societe->client->voir && ! $socid) {
+ $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
+ }
if ($search_ref) $sql .= natural_search('f.titre', $search_ref);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_frequency) $sql .= natural_search('f.frequency', $search_frequency);
@@ -1637,61 +1646,54 @@ else
print '';
print '
'."\n";
- print '';
- print_liste_field_titre($langs->trans("Ref"),$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER['PHP_SELF'],"s.nom","",$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("AmountVAT"),$_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);
- print_liste_field_titre($langs->trans("RecurringInvoiceTemplate"),$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DateLastGeneration"),$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("NextDateToExecution"),$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre(''); // Field may contains ling text
- print " \n";
-
-
// Filters lines
- print '';
+ print ' ';
// Ref
if (! empty($arrayfields['f.titre']['checked']))
{
print '';
- print ' ';
+ print ' ';
print ' ';
}
// Thirpdarty
if (! empty($arrayfields['s.nom']['checked']))
{
- print ' ';
+ print ' ';
}
if (! empty($arrayfields['f.total']['checked']))
{
// Amount
print '';
- print ' ';
+ print ' ';
print ' ';
}
if (! empty($arrayfields['f.tva']['checked']))
{
// Amount
print '';
- print ' ';
+ print ' ';
print ' ';
}
if (! empty($arrayfields['f.total_ttc']['checked']))
{
// Amount
print '';
- print ' ';
+ print ' ';
print ' ';
}
if (! empty($arrayfields['f.frequency']['checked']))
{
- // Amount
+ // Recurring or not
print '';
print $form->selectyesno('search_frequency', $search_frequency, 1, false, 1);
print ' ';
}
+ if (! empty($arrayfields['f.nb_gen_done']['checked']))
+ {
+ // Nb generation
+ print '';
+ print ' ';
+ }
// Date invoice
if (! empty($arrayfields['f.date_last_gen']['checked']))
{
@@ -1756,28 +1758,47 @@ else
print '';
print " \n";
-
+ print '';
+ print_liste_field_titre($langs->trans("Ref"),$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER['PHP_SELF'],"s.nom","",$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("AmountVAT"),$_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);
+ print_liste_field_titre($langs->trans("RecurringInvoiceTemplate"),$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.nb_gen_done']['checked']))
+ {
+ print_liste_field_titre($langs->trans("NbOfGenerationDone"),$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder);
+ }
+ print_liste_field_titre($langs->trans("DateLastGeneration"),$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("NextDateToExecution"),$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre(''); // Field may contains ling text
+ print " \n";
+
+
if ($num > 0)
{
$var=true;
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print "";
+ print ' ';
print ''.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
print " \n";
$companystatic->id=$objp->socid;
$companystatic->name=$objp->name;
- print ''.$companystatic->getNomUrl(1,'customer').' ';
+ print ''.$companystatic->getNomUrl(1,'customer').' ';
print ''.price($objp->total).' '."\n";
print ''.price($objp->total_vat).' '."\n";
print ''.price($objp->total_ttc).' '."\n";
print ''.yn($objp->frequency?1:0).' ';
+ if (! empty($arrayfields['f.nb_gen_done']['checked']))
+ {
+ print ''.($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : '').' ';
+ }
print ''.($objp->frequency ? dol_print_date($objp->date_last_gen,'day') : '').' ';
print ''.($objp->frequency ? dol_print_date($objp->date_when,'day') : '').' ';
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 8ed52eddb97..562455e9e5a 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -7,10 +7,11 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2010-2012 Juanjo Menent
* Copyright (C) 2012 Christophe Battarel
- * Copyright (C) 2013 Florian Henry
+ * Copyright (C) 2013 Florian Henry
* Copyright (C) 2013 Cédric Salvador
- * Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2015-2016 Ferran Marcet
+ * Copyright (C) 2015 Jean-François Ferry
+ * Copyright (C) 2015-2016 Ferran Marcet
+ * Copyright (C) 2017 Josep LluÃs Amador
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -74,6 +75,8 @@ $search_type=GETPOST('search_type','int');
$search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_montant_vat=GETPOST('search_montant_vat','alpha');
+$search_montant_localtax1=GETPOST('search_montant_localtax1','alpha');
+$search_montant_localtax2=GETPOST('search_montant_localtax2','alpha');
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
$search_status=GETPOST('search_status','int');
$search_paymentmode=GETPOST('search_paymentmode','int');
@@ -155,6 +158,8 @@ $arrayfields=array(
'f.fk_mode_reglement'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>1),
'f.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
+ 'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax1_assuj=="1"),
+ 'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax2_assuj=="1"),
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
'dynamount_payed'=>array('label'=>$langs->trans("Received"), 'checked'=>0),
'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0),
@@ -198,6 +203,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOS
$search_societe='';
$search_montant_ht='';
$search_montant_vat='';
+ $search_montant_localtax1='';
+ $search_montant_localtax2='';
$search_montant_ttc='';
$search_status='';
$search_paymentmode='';
@@ -344,6 +351,7 @@ llxHeader('',$langs->trans('CustomersInvoices'),'EN:Customers_Invoices|FR:Factur
$sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
+$sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
$sql.= ' f.paye as paye, f.fk_statut,';
$sql.= ' f.datec as date_creation, f.tms as date_update,';
@@ -415,6 +423,8 @@ if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdp
if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_vat, 1);
+if ($search_montant_localtax1 != '') $sql.= natural_search('f.localtax1', $search_montant_localtax1, 1);
+if ($search_montant_localtax2 != '') $sql.= natural_search('f.localtax2', $search_montant_localtax2, 1);
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
if ($search_status != '' && $search_status >= 0)
{
@@ -478,6 +488,7 @@ $sql.=$hookmanager->resPrint;
if (! $sall)
{
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total, f.tva, f.total_ttc,';
+ $sql.= ' f.localtax1, f.localtax2,';
$sql.= ' f.datef, f.date_lim_reglement,';
$sql.= ' f.paye, f.fk_statut,';
$sql.= ' f.datec, f.tms,';
@@ -506,7 +517,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$nbtotalofrecords = $db->num_rows($result);
}
-$sql.= $db->plimit($limit+1,$offset);
+$sql.= $db->plimit($limit,$offset);
//print $sql;
$resql = $db->query($sql);
@@ -541,6 +552,8 @@ if ($resql)
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category);
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
+ if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
+ if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode);
@@ -738,64 +751,25 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-
+ if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
+
print '';
print '
'."\n";
- print '';
- if (! empty($arrayfields['f.facnumber']['checked'])) print_liste_field_titre($arrayfields['f.facnumber']['label'],$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'],$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'],$_SERVER["PHP_SELF"],'f.type','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'],$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'],$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'],$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
- if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'],$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
- }
- // Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye,type,dynamount_payed","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
-
// Filters lines
- print '';
+ print ' ';
// Ref
if (! empty($arrayfields['f.facnumber']['checked']))
{
print '';
- print ' ';
+ print ' ';
print ' ';
}
// Ref customer
if (! empty($arrayfields['f.ref_client']['checked']))
{
print '';
- print ' ';
+ print ' ';
print ' ';
}
// Type
@@ -816,8 +790,8 @@ if ($resql)
if (! empty($arrayfields['f.date']['checked']))
{
print '';
- if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ' ';
- print ' ';
+ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ' ';
+ print ' ';
$formother->select_year($year?$year:-1,'year',1, 20, 5);
print ' ';
}
@@ -825,8 +799,8 @@ if ($resql)
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
{
print '';
- if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ' ';
- print ' ';
+ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ' ';
+ print ' ';
$formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5);
print ' '.$langs->trans("Late");
print ' ';
@@ -837,9 +811,9 @@ if ($resql)
print ' ';
}
// Town
- if (! empty($arrayfields['s.town']['checked'])) print ' ';
+ if (! empty($arrayfields['s.town']['checked'])) print ' ';
// Zip
- if (! empty($arrayfields['s.zip']['checked'])) print ' ';
+ if (! empty($arrayfields['s.zip']['checked'])) print ' ';
// State
if (! empty($arrayfields['state.nom']['checked']))
{
@@ -872,21 +846,35 @@ if ($resql)
{
// Amount
print '';
- print ' ';
+ print ' ';
print ' ';
}
if (! empty($arrayfields['f.total_vat']['checked']))
{
// Amount
print '';
- print ' ';
+ print ' ';
+ print ' ';
+ }
+ if (! empty($arrayfields['f.total_localtax1']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (! empty($arrayfields['f.total_localtax2']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
print ' ';
}
if (! empty($arrayfields['f.total_ttc']['checked']))
{
// Amount
print '';
- print ' ';
+ print ' ';
print ' ';
}
if (! empty($arrayfields['dynamount_payed']['checked']))
@@ -948,20 +936,60 @@ if ($resql)
}
// Action column
print '';
- $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
+ $searchpitco=$form->showFilterButtons();
print $searchpitco;
print ' ';
print " \n";
+ print '';
+ if (! empty($arrayfields['f.facnumber']['checked'])) print_liste_field_titre($arrayfields['f.facnumber']['label'],$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'],$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'],$_SERVER["PHP_SELF"],'f.type','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'],$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'],$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'],$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
+ if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'],$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'],$_SERVER['PHP_SELF'],'f.localtax1','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'],$_SERVER['PHP_SELF'],'f.localtax2','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
+ // Extra fields
+ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+ {
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ $align=$extrafields->getAlignFlag($key);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ }
+ }
+ }
+ // Hook fields
+ $parameters=array('arrayfields'=>$arrayfields);
+ $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye,type,dynamount_payed","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
if ($num > 0)
{
$i=0;
- $var=true;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
- $var=!$var;
$datelimit=$db->jdate($obj->datelimite);
$facturestatic->id=$obj->facid;
@@ -978,7 +1006,7 @@ if ($resql)
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
- print '';
+ print ' ';
if (! empty($arrayfields['f.facnumber']['checked']))
{
print '';
@@ -1045,7 +1073,7 @@ if ($resql)
// Third party
if (! empty($arrayfields['s.nom']['checked']))
{
- print ' ';
+ print ' ';
$thirdparty=new Societe($db);
$thirdparty->id=$obj->socid;
$thirdparty->name=$obj->name;
@@ -1121,6 +1149,22 @@ if ($resql)
if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
$totalarray['totalvat'] += $obj->total_vat;
}
+ // Amount LocalTax1
+ if (! empty($arrayfields['f.total_localtax1']['checked']))
+ {
+ print ' '.price($obj->total_localtax1)." \n";
+ if (! $i) $totalarray['nbfield']++;
+ if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield'];
+ $totalarray['totallocaltax1'] += $obj->total_localtax1;
+ }
+ // Amount LocalTax2
+ if (! empty($arrayfields['f.total_localtax2']['checked']))
+ {
+ print ''.price($obj->total_localtax2)." \n";
+ if (! $i) $totalarray['nbfield']++;
+ if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield'];
+ $totalarray['totallocaltax2'] += $obj->total_localtax2;
+ }
// Amount TTC
if (! empty($arrayfields['f.total_ttc']['checked']))
{
@@ -1212,6 +1256,8 @@ if ($resql)
// Show total line
if (isset($totalarray['totalhtfield'])
|| isset($totalarray['totalvatfield'])
+ || isset($totalarray['totallocaltax1field'])
+ || isset($totalarray['totallocaltax2field'])
|| isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield'])
|| isset($totalarray['totalrtpfield'])
@@ -1229,9 +1275,11 @@ if ($resql)
}
elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).' ';
elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).' ';
+ elseif ($totalarray['totallocaltax1field'] == $i) print ''.price($totalarray['totallocaltax1']).' ';
+ elseif ($totalarray['totallocaltax2field'] == $i) print ''.price($totalarray['totallocaltax2']).' ';
elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).' ';
elseif ($totalarray['totalamfield'] == $i) print ''.price($totalarray['totalam']).' ';
- elseif ($totalarray['totalrtpfield'] == $i) print ''.price($totalarray['totalrtp']).' ';
+ elseif ($totalarray['totalrtpfield'] == $i) print ''.price($totalarray['totalrtp']).' ';
else print ' ';
}
print ' ';
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index ea886fbd65c..f3d83278885 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -612,9 +612,9 @@ if ($object->id > 0)
while ($i < $num)
{
$obj = $db->fetch_object($result_sql);
- $var=!$var;
+
- print "";
+ print ' ';
print ''.dol_print_date($db->jdate($obj->date_demande),'day')." \n";
print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' ';
print ''.price($obj->amount).' ';
@@ -663,9 +663,9 @@ if ($object->id > 0)
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print " ";
+ print ' ';
print ''.dol_print_date($db->jdate($obj->date_demande),'day')." \n";
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 5c5aa8489be..77191136338 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -225,7 +225,7 @@ if ($mode == 'supplier') $type='supplier_invoice_stats';
complete_head_from_modules($conf,$langs,null,$head,$h,$type);
-dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
+dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
$tmp_companies = $form->select_thirdparty_list($socid,'socid',$filter,1, 0, 0, array(), '', 1);
//Array passed as an argument to Form::selectarray to build a proper select input
@@ -300,7 +300,7 @@ foreach ($data as $val)
while ($year && $oldyear > $year+1)
{ // If we have empty year
$oldyear--;
- $var=!$var;
+
print ' ';
print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.' ';
print '0 ';
@@ -311,7 +311,7 @@ foreach ($data as $val)
print ' ';
print ' ';
}
- $var=!$var;
+
print '';
print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.' ';
print ''.$val['nb'].' ';
diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
index 2fb2a7089ea..63c16afae15 100644
--- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
@@ -36,7 +36,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
- $var=!$var;
+
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php
index 781f5609915..2e7858fdb08 100644
--- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php
+++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php
@@ -36,7 +36,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
- $var=!$var;
+
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index ea8d47b264e..321c2456ddd 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -172,7 +172,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- print ' ';
+ print ' ';
$facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid;
$facturestatic->total_ht=$obj->total_ht;
@@ -193,7 +193,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print ' ';
$tot_ttc+=$obj->total_ttc;
$i++;
- $var=!$var;
+
}
print ''.$langs->trans("Total").' ';
@@ -202,7 +202,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
}
else
{
- print ''.$langs->trans("NoInvoice").' ';
+ print ''.$langs->trans("NoInvoice").' ';
}
print "
";
$db->free($resql);
@@ -233,7 +233,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
if ( $resql )
{
- $var = false;
$num = $db->num_rows($resql);
print '
';
@@ -248,7 +247,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- print '';
+ print ' ';
$facturesupplierstatic->ref=$obj->ref;
$facturesupplierstatic->id=$obj->rowid;
$facturesupplierstatic->total_ht=$obj->total_ht;
@@ -269,7 +268,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print ' ';
$tot_ttc+=$obj->total_ttc;
$i++;
- $var=!$var;
}
print ''.$langs->trans("Total").' ';
@@ -278,7 +276,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
}
else
{
- print ''.$langs->trans("NoInvoice").' ';
+ print ''.$langs->trans("NoInvoice").' ';
}
print "
";
$db->free($resql);
@@ -337,7 +335,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$obj = $db->fetch_object($resql);
- print '
';
+ print ' ';
print '';
print '';
@@ -382,7 +380,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$total_ttc += $obj->total_ttc;
$total += $obj->total;
$totalam += $obj->am;
- $var=!$var;
+
$i++;
}
}
@@ -390,7 +388,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$colspan=5;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
- print ' '.$langs->trans("NoInvoice").' ';
+ print ''.$langs->trans("NoInvoice").' ';
}
print '
';
$db->free($resql);
@@ -445,7 +443,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- print ' ';
+ print ' ';
$facstatic->ref=$obj->ref;
$facstatic->id = $obj->rowid;
$facstatic->total_ht = $obj->total_ht;
@@ -477,7 +475,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{
$colspan=5;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
- print ' '.$langs->trans("NoInvoice").' ';
+ print '
'.$langs->trans("NoInvoice").' ';
}
print '
';
}
@@ -527,8 +525,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
while ($i < $num && $i < $max)
{
$objp = $db->fetch_object($result);
- $var=!$var;
- print '
';
+
+ print ' ';
$donationstatic->id=$objp->rowid;
$donationstatic->lastname=$objp->lastname;
$donationstatic->firstname=$objp->firstname;
@@ -547,7 +545,7 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
}
else
{
- print ' '.$langs->trans("None").' ';
+ print '
'.$langs->trans("None").' ';
}
print '
';
}
@@ -594,7 +592,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- print " ";
+ print ' ';
$chargestatic->id=$obj->rowid;
$chargestatic->ref=$obj->libelle;
$chargestatic->lib=$obj->libelle;
@@ -618,7 +616,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
}
else
{
- print ' '.$langs->trans("None").' ';
+ print ''.$langs->trans("None").' ';
}
print "
";
$db->free($resql);
@@ -679,7 +677,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
{
$obj = $db->fetch_object($resql);
- print "";
+ print ' ';
print '';
$commandestatic->id=$obj->rowid;
@@ -719,7 +717,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
//print "x".$tot_ttc."z".$obj->tot_fttc;
$tot_tobill += ($obj->total_ttc-$obj->tot_fttc);
$i++;
- $var=!$var;
+
}
print ' '.$langs->trans("Total").' ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') ';
@@ -768,6 +766,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$num = $db->num_rows($resql);
$i = 0;
+ print '';
print '
';
print ''.$langs->trans("BillsCustomersUnpaid",$num).' '.$num.' ';
print ''.$langs->trans("DateDue").' ';
@@ -784,7 +783,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$obj = $db->fetch_object($resql);
- print '';
+ print ' ';
print '';
print '';
@@ -830,7 +829,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$total_ttc += $obj->total_ttc;
$total += $obj->total_ht;
$totalam += $obj->am;
- $var=!$var;
+
$i++;
}
@@ -846,9 +845,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$colspan=6;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
- print ' '.$langs->trans("NoInvoice").' ';
+ print ''.$langs->trans("NoInvoice").' ';
}
- print '
';
+ print '
';
$db->free($resql);
}
else
@@ -890,6 +889,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$var=false;
$num = $db->num_rows($resql);
+ print '';
print '
';
print ''.$langs->trans("BillsSuppliersUnpaid",$num).' '.$num.' ';
print ''.$langs->trans("DateDue").' ';
@@ -907,7 +907,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{
$obj = $db->fetch_object($resql);
- print '';
+ print ' ';
$facstatic->ref=$obj->ref;
$facstatic->id = $obj->rowid;
$facstatic->total_ht = $obj->total_ht;
@@ -946,9 +946,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{
$colspan=6;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
- print ' '.$langs->trans("NoInvoice").' ';
+ print ''.$langs->trans("NoInvoice").' ';
}
- print '
';
+ print '
';
}
else
{
@@ -970,7 +970,7 @@ if ($resql)
while ($i < $db->num_rows($resql))
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
print "".dol_print_date($db->jdate($obj->da),"day")." ";
print ''.$obj->libelle.' '.$obj->label.' ';
diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php
index 5c21b67a891..40a5805f2b3 100644
--- a/htdocs/compta/localtax/clients.php
+++ b/htdocs/compta/localtax/clients.php
@@ -183,7 +183,7 @@ if($calc ==0 || $calc == 2)
{
if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) !=0)
{
- $var=!$var;
+
$intra = str_replace($find,$replace,$coll->tva_intra);
if(empty($intra))
{
@@ -196,7 +196,7 @@ if($calc ==0 || $calc == 2)
$intra = '';
}
}
- print "";
+ print ' ';
print ''.$i." ";
$company_static->id=$coll->socid;
$company_static->name=$coll->name;
@@ -258,7 +258,7 @@ if($calc ==0 || $calc == 1){
{
if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) != 0)
{
- $var=!$var;
+
$intra = str_replace($find,$replace,$coll->tva_intra);
if(empty($intra))
{
@@ -271,7 +271,7 @@ if($calc ==0 || $calc == 1){
$intra = '';
}
}
- print " ";
+ print ' ';
print ''.$i." ";
$company_static->id=$coll->socid;
$company_static->name=$coll->name;
diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php
index 642c37b9d65..5d17688fc68 100644
--- a/htdocs/compta/localtax/index.php
+++ b/htdocs/compta/localtax/index.php
@@ -81,8 +81,8 @@ function pt ($db, $sql, $date)
$var=True;
while ($i < $num) {
$obj = $db->fetch_object($result);
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$obj->dm." \n";
$total = $total + $obj->mm;
@@ -190,8 +190,8 @@ for ($m = 1 ; $m < 13 ; $m++ ) {
break;
}
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").' ';
if($CalcLT==0) {
$x_coll = 0;
diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php
index 175ff6cf98f..13c753db464 100644
--- a/htdocs/compta/localtax/quadri_detail.php
+++ b/htdocs/compta/localtax/quadri_detail.php
@@ -338,8 +338,8 @@ else
if (! empty($fields['ddate_start'])) $type=1;
if (! empty($fields['ddate_end'])) $type=1;
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print ''.$fields['link'].' ';
@@ -501,8 +501,8 @@ else
if (! empty($fields['ddate_start'])) $type=1;
if (! empty($fields['ddate_end'])) $type=1;
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print ''.$fields['link'].' ';
diff --git a/htdocs/compta/localtax/reglement.php b/htdocs/compta/localtax/reglement.php
index df96d0b7d67..54183ef72b9 100644
--- a/htdocs/compta/localtax/reglement.php
+++ b/htdocs/compta/localtax/reglement.php
@@ -66,8 +66,8 @@ if ($result)
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print " ";
+
+ print ' ';
$localtax_static->id=$obj->rowid;
$localtax_static->ref=$obj->rowid;
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 6a3e0e1a433..96f77e85758 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -599,7 +599,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
while ($i < $num)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
+
$soc = new Societe($db);
$soc->fetch($objp->socid);
@@ -622,7 +622,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$multicurrency_remaintopay=price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits,'MT');
}
- print ' ';
+ print ' ';
print '';
print $invoice->getNomUrl(1,'');
@@ -859,8 +859,8 @@ if (! GETPOST('action'))
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$objp->facnumber." \n";
print ''.dol_print_date($db->jdate($objp->dp))." \n";
print ''.$objp->paiement_type.' '.$objp->num_paiement." \n";
diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php
index a244a1feb60..1f00da90a8c 100644
--- a/htdocs/compta/paiement/avalider.php
+++ b/htdocs/compta/paiement/avalider.php
@@ -111,8 +111,8 @@ if ($resql)
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.' ';
print ''.dol_print_date($db->jdate($objp->dp),'day')." \n";
print "$objp->paiement_type $objp->num_paiement \n";
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index 31b4ea8e993..523d5256816 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -38,10 +38,12 @@ $langs->load('bills');
$langs->load('banks');
$langs->load('companies');
-// Security check
$id=GETPOST('id','int');
+$ref=GETPOST('ref', 'alpha');
$action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
+
+// Security check
if ($user->societe_id) $socid=$user->societe_id;
// TODO ajouter regle pour restreindre acces paiement
//$result = restrictedArea($user, 'facture', $id,'');
@@ -163,11 +165,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
* View
*/
-llxHeader();
+llxHeader('', $langs->trans("Payment"));
$thirdpartystatic=new Societe($db);
-$result=$object->fetch($id);
+$result=$object->fetch($id, $ref);
if ($result <= 0)
{
dol_print_error($db,'Payement '.$id.' not found in database');
@@ -178,7 +180,7 @@ $form = new Form($db);
$head = payment_prepare_head($object);
-dol_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
+dol_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'payment');
/*
* Confirmation de la suppression du paiement
@@ -199,19 +201,18 @@ if ($action == 'valide')
}
-
$linkback = '' . $langs->trans("BackToList") . ' ';
+dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+
+
+print '';
+print '
';
print '
'."\n";
-// Ref
-print ''.$langs->trans('Ref').' ';
-print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
-print ' ';
-
// Date payment
-print ''.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).' ';
+print ' '.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).' ';
print $form->editfieldval("Date",'datep',$object->date,$object,$user->rights->facture->paiement,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
print ' ';
@@ -236,7 +237,7 @@ $disable_delete = 0;
// Bank account
if (! empty($conf->banque->enabled))
{
- if ($object->bank_account)
+ if ($object->fk_account > 0)
{
$bankline=new AccountLine($db);
$bankline->fetch($object->bank_line);
@@ -257,9 +258,8 @@ if (! empty($conf->banque->enabled))
print ''.$langs->trans('BankAccount').' ';
print '';
$accountstatic=new Account($db);
- $accountstatic->id=$bankline->fk_account;
- $accountstatic->label=$bankline->bank_account_ref.' - '.$bankline->bank_account_label;
- print $accountstatic->getNomUrl(0);
+ $accountstatic->fetch($bankline->fk_account);
+ print $accountstatic->getNomUrl(1);
print ' ';
print '';
@@ -281,6 +281,8 @@ if (! empty($conf->banque->enabled))
print '
';
+print '
';
+
dol_fiche_end();
@@ -325,8 +327,8 @@ if ($resql)
while ($i < $num)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
$invoice=new Facture($db);
$invoice->fetch($objp->facid);
@@ -370,7 +372,7 @@ if ($resql)
$i++;
}
}
- $var=!$var;
+
print "
\n";
print '';
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 58a6cc3e747..625b2be518e 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -494,14 +494,14 @@ if ($action == 'new')
foreach ($lines[$bid] as $lid => $value)
{
- $var=!$var;
+
$account_id = $bid;
if (! isset($accounts[$bid]))
$accounts[$bid]=0;
$accounts[$bid] += 1;
- print " ";
+ print ' ';
print ''.dol_print_date($value["date"],'day').' ';
print ''.$value["numero"]." \n";
print ''.$value["emetteur"]." \n";
@@ -694,7 +694,7 @@ else
$accounts[$objp->bid]=0;
$accounts[$objp->bid] += 1;
- print " ";
+ print ' ';
print ''.$i.' ';
print ''.dol_print_date($db->jdate($objp->date),'day').' '; // Date operation
print ''.($objp->num_chq?$objp->num_chq:' ').' ';
@@ -742,7 +742,7 @@ else
}
print '';
print ' ';
- $var=!$var;
+
$i++;
}
print "
";
diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php
index bba49827104..2d77cb71061 100644
--- a/htdocs/compta/paiement/cheque/index.php
+++ b/htdocs/compta/paiement/cheque/index.php
@@ -77,7 +77,7 @@ if ($resql)
{
$num = $row[0];
}
- print "";
+ print ' ';
print ''.$langs->trans("BankChecksToReceipt").' ';
print '';
print ''.$num.' ';
@@ -129,7 +129,7 @@ if ($resql)
$accountstatic->id=$objp->bid;
$accountstatic->label=$objp->label;
- $var=!$var;
+
print " \n";
print ''.$checkdepositstatic->getNomUrl(1).' ';
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index ae9bc315877..f1a9a839792 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -186,8 +186,8 @@ if ($resql)
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+
+ print ' ';
// Num ref cheque
print '';
@@ -225,7 +225,7 @@ if ($resql)
}
else
{
- print " ";
+ print ' ';
print ''.$langs->trans("None")." ";
print ' ';
}
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 099d05cfa84..53035dca96f 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -37,7 +37,8 @@ class Paiement extends CommonObject
{
public $element='payment';
public $table_element='paiement';
-
+ public $picto = 'payment';
+
var $facid;
var $datepaye;
/**
@@ -95,7 +96,7 @@ class Paiement extends CommonObject
if ($id > 0)
$sql.= ' AND p.rowid = '.$id;
else if ($ref)
- $sql.= ' AND p.rowid = '.$ref;
+ $sql.= " AND p.ref = '".$ref."'";
else if ($fk_bank)
$sql.= ' AND p.fk_bank = '.$fk_bank;
@@ -964,26 +965,29 @@ class Paiement extends CommonObject
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien
+ * @param string $mode 'withlistofinvoices'=Include list of invoices into tooltip
* @return string Chaine avec URL
*/
- function getNomUrl($withpicto=0,$option='')
+ function getNomUrl($withpicto=0,$option='',$mode='withlistofinvoices')
{
global $langs;
$result='';
$label = $langs->trans("ShowPayment").': '.$this->ref;
- $arraybill = $this->getBillsArray();
- if (count($arraybill) >0)
- {
- require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
- $facturestatic=new Facture($this->db);
- foreach ($arraybill as $billid)
- {
- $facturestatic->fetch($billid);
- $label .=' '.$facturestatic->getNomUrl(1).' '.$facturestatic->getLibStatut(2,1);
- }
- }
-
+ if ($mode == 'withlistofinvoices')
+ {
+ $arraybill = $this->getBillsArray();
+ if (count($arraybill) > 0)
+ {
+ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ $facturestatic=new Facture($this->db);
+ foreach ($arraybill as $billid)
+ {
+ $facturestatic->fetch($billid);
+ $label .=' '.$facturestatic->getNomUrl(1).' '.$facturestatic->getLibStatut(2,1);
+ }
+ }
+ }
$link = '';
$linkend=' ';
@@ -1016,7 +1020,7 @@ class Paiement extends CommonObject
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
$langs->load('compta');
- if ($mode == 0)
+ /*if ($mode == 0)
{
if ($status == 0) return $langs->trans('ToValidate');
if ($status == 1) return $langs->trans('Validated');
@@ -1046,7 +1050,12 @@ class Paiement extends CommonObject
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
}
- return $langs->trans('Unknown');
+ if ($mode == 6)
+ {
+ if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
+ if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
+ }*/
+ return '';
}
}
diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php
index e1b12225aad..d0bda152b21 100644
--- a/htdocs/compta/paiement/info.php
+++ b/htdocs/compta/paiement/info.php
@@ -32,33 +32,39 @@ $langs->load("bills");
$langs->load("companies");
$id=GETPOST('id');
+$ref=GETPOST('ref', 'alpha');
+$action=GETPOST('action','alpha');
+$confirm=GETPOST('confirm','alpha');
+
+/*
+ * Actions
+ */
+
+// None
/*
* View
*/
-llxHeader();
+llxHeader('', $langs->trans("Payment"));
$object = new Paiement($db);
-$object->fetch($id);
-$object->info($id);
+$object->fetch($id, $ref);
+$object->info($object->id);
$head = payment_prepare_head($object);
-dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
+dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), -1, 'payment');
-print '';
$linkback = '' . $langs->trans("BackToList") . ' ';
+dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '');
-// Ref
-print ''.$langs->trans('Ref').' ';
-print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
-print ' ';
-print '
';
+print '';
+print '
';
print '
';
@@ -68,5 +74,7 @@ print '
';
print '';
+dol_fiche_end();
+
llxFooter();
$db->close();
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index 4cb63b7d905..d0ba0373457 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -225,29 +225,8 @@ if ($resql)
print '';
print '
'."\n";
- print '';
- print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"p.rowid","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","",$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("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder);
- if (! empty($conf->banque->enabled))
- {
- print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
- }
- print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder);
- //print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder);
-
- $parameters=array();
- $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
-
- if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
-
// Lines for filters fields
- print '';
+ print ' ';
print '';
print ' ';
print ' ';
@@ -285,12 +264,32 @@ if ($resql)
}
print " \n";
- $var=true;
+ print '';
+ print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"p.rowid","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","",$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("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder);
+ if (! empty($conf->banque->enabled))
+ {
+ print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
+ }
+ print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder);
+ //print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder);
+
+ $parameters=array();
+ $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+
+ if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print "";
+
+ print ' ';
print '';
$paymentstatic->id=$objp->rowid;
diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php
index 27f34bef269..e9a90667e69 100644
--- a/htdocs/compta/paiement/rapport.php
+++ b/htdocs/compta/paiement/rapport.php
@@ -152,7 +152,7 @@ if ($year)
{
if (preg_match('/^payment/i',$file))
{
- $var=!$var;
+
$tfile = $dir . '/'.$year.'/'.$file;
$relativepath = $year.'/'.$file;
print " ".''.img_pdf().' '.$file.' ';
diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php
index 342294dfc12..bd262eaa675 100644
--- a/htdocs/compta/paiement_charge.php
+++ b/htdocs/compta/paiement_charge.php
@@ -266,9 +266,9 @@ if ($action == 'create')
{
$objp = $charge;
- $var=!$var;
+
- print " ";
+ print ' ';
if ($objp->date_ech > 0)
{
diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php
index b64d92d873f..2d653f2ba05 100644
--- a/htdocs/compta/payment_sc/card.php
+++ b/htdocs/compta/payment_sc/card.php
@@ -239,8 +239,8 @@ if ($resql)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print '';
$socialcontrib->fetch($objp->scid);
@@ -268,7 +268,7 @@ if ($resql)
$i++;
}
}
- $var=!$var;
+
print "
\n";
$db->free($resql);
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php
index 8f90183f0f7..dbbf9d09ac7 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/bons.php
@@ -134,7 +134,7 @@ if ($result)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
print "
";
diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php
index bd16ec0e23b..62e57813886 100644
--- a/htdocs/compta/prelevement/card.php
+++ b/htdocs/compta/prelevement/card.php
@@ -322,7 +322,7 @@ if ($id > 0)
{
$obj = $db->fetch_object($result);
- print " ";
+ print ' ';
// Status of line
print "";
@@ -354,7 +354,7 @@ if ($id > 0)
print ' ';
$total += $obj->amount;
- $var=!$var;
+
$i++;
}
diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php
index b45a49dbe69..5d77a9b9771 100644
--- a/htdocs/compta/prelevement/create.php
+++ b/htdocs/compta/prelevement/create.php
@@ -194,8 +194,8 @@ if ($resql)
while ($i < $num && $i < 20)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print '
';
+
+ print ' ';
print '';
$invoicestatic->id=$obj->rowid;
$invoicestatic->ref=$obj->facnumber;
@@ -268,9 +268,9 @@ if ($result)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print " ";
+ print ' ';
print "";
$bprev->id=$obj->rowid;
diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php
index e104ba75a1a..c1c8bd7e929 100644
--- a/htdocs/compta/prelevement/demandes.php
+++ b/htdocs/compta/prelevement/demandes.php
@@ -136,8 +136,8 @@ if ($resql)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref facture
print '';
diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php
index 33a7a4486a0..72d775a49c3 100644
--- a/htdocs/compta/prelevement/factures.php
+++ b/htdocs/compta/prelevement/factures.php
@@ -197,7 +197,7 @@ if ($result)
$thirdpartytmp->id = $obj->socid;
$thirdpartytmp->name = $obj->name;
- print " ";
+ print ' ';
print "";
print $invoicetmp->getNomUrl(1);
@@ -233,7 +233,7 @@ if ($result)
print " \n";
$total += $obj->total_ttc;
- $var=!$var;
+
$i++;
}
diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php
index d013f605504..064f41e41e8 100644
--- a/htdocs/compta/prelevement/fiche-rejet.php
+++ b/htdocs/compta/prelevement/fiche-rejet.php
@@ -164,7 +164,7 @@ if ($resql)
print "
\n";
$total += $obj->amount;
- $var=!$var;
+
$i++;
}
}
diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php
index a86280e66bd..c5d441e3260 100644
--- a/htdocs/compta/prelevement/fiche-stat.php
+++ b/htdocs/compta/prelevement/fiche-stat.php
@@ -146,7 +146,7 @@ if ($prev_id)
print "\n";
- $var=!$var;
+
$i++;
}
diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php
index 440af1cdbaf..32257a71a0f 100644
--- a/htdocs/compta/prelevement/index.php
+++ b/htdocs/compta/prelevement/index.php
@@ -75,15 +75,15 @@ $var=true;
print '';
print ''.$langs->trans("Statistics").' ';
-$var=!$var;
-print ''.$langs->trans("NbOfInvoiceToWithdraw").' ';
+
+print ''.$langs->trans("NbOfInvoiceToWithdraw").' ';
print '';
print '';
print $bprev->NbFactureAPrelever();
print ' ';
print ' ';
-$var=!$var;
-print ''.$langs->trans("AmountToWithdraw").' ';
+
+print ''.$langs->trans("AmountToWithdraw").' ';
print '';
print price($bprev->SommeAPrelever(),'','',1,-1,-1,'auto');
print '
';
@@ -129,8 +129,8 @@ if ($resql)
$invoicestatic->type=$obj->type;
$alreadypayed=$invoicestatic->getSommePaiement();
- $var=!$var;
- print '';
+
+ print ' ';
print $invoicestatic->getNomUrl(1,'withdraw');
print ' ';
@@ -197,9 +197,9 @@ if ($result)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print "";
+ print ' ';
print "";
$bprev->id=$obj->rowid;
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index d5ae2514034..f7fe4b77e7d 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -165,7 +165,7 @@ if ($result)
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
print " ";
diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php
index 78a11e898df..ef72ca8f6e5 100644
--- a/htdocs/compta/prelevement/rejets.php
+++ b/htdocs/compta/prelevement/rejets.php
@@ -112,7 +112,7 @@ if ($result)
print ' '.$rej->motifs[$obj->motif].' ';
print " \n";
- $var=!$var;
+
$i++;
}
diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php
index ceeef191aee..b666b355e24 100644
--- a/htdocs/compta/prelevement/stats.php
+++ b/htdocs/compta/prelevement/stats.php
@@ -120,7 +120,7 @@ if ($resql)
print round($row[0]/$total*100,2)." %";
print '';
- $var=!$var;
+
$i++;
}
@@ -218,7 +218,7 @@ if ($resql)
print '';
- $var=!$var;
+
$i++;
}
diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php
index aec371ac0b3..2a1234fccc1 100644
--- a/htdocs/compta/recap-compta.php
+++ b/htdocs/compta/recap-compta.php
@@ -198,8 +198,8 @@ if ($id > 0)
// Display array
foreach($TData as $data) {
- $var=!$var;
- print "";
+
+ print ' ';
print "".dol_print_date($data['date'],'day')." \n";
print ''.$data['link']." \n";
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 6f780de554b..5c77bbba21d 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -235,7 +235,7 @@ if ($result) {
while ($i < $num)
{
$objp = $db->fetch_object($result);
- $var=!$var;
+
print " ";
print "".$langs->trans("Bills").' '.$objp->name." \n";
@@ -280,7 +280,7 @@ if ($modecompta != 'CREANCES-DETTES')
while ($i < $num)
{
$objp = $db->fetch_object($result);
- $var=!$var;
+
print " ";
print "".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n";
@@ -304,7 +304,7 @@ if ($modecompta != 'CREANCES-DETTES')
if ($total_ttc == 0)
{
- $var=!$var;
+
print " ";
print ''.$langs->trans("None").' ';
print ' ';
@@ -367,7 +367,7 @@ if ($result) {
while ($i < $num)
{
$objp = $db->fetch_object($result);
- $var=!$var;
+
print " ";
print "".$langs->trans("Bills")." socid."\">".$objp->name." \n";
@@ -387,7 +387,7 @@ if ($result) {
}
else
{
- $var=!$var;
+
print " ";
print ''.$langs->trans("None").' ';
print ' ';
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 5b2c6b70a13..fe64bb7b999 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -671,8 +671,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
{
$mois_modulo = $mois;
if($mois>12) {$mois_modulo = $mois-12;}
- $var=!$var;
- print '';
+
+ print ' ';
print "".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,$annee),"%B")." ";
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
@@ -704,7 +704,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
}
// Total
-$var=!$var;
+
$nbcols=0;
print ' '.$langs->trans("TotalTTC").' ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
@@ -721,7 +721,7 @@ print ' ';
print " \n";
// Balance
-$var=!$var;
+
print ''.$langs->trans("AccountingResult").' ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php
index df83f5b9958..569aa81629e 100644
--- a/htdocs/compta/salaries/card.php
+++ b/htdocs/compta/salaries/card.php
@@ -202,11 +202,7 @@ if ($id)
}
}
-/* ************************************************************************** */
-/* */
-/* create mode */
-/* */
-/* ************************************************************************** */
+// Create
if ($action == 'create')
{
$year_current = strftime("%Y",dol_now());
@@ -332,19 +328,19 @@ if ($id)
$head=salaries_prepare_head($object);
- dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), 0, 'payment');
-
- print '';
+ dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment');
$linkback = ''.$langs->trans("BackToList").' ';
- print "";
- print ''.$langs->trans("Ref").' ';
- print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
- print ' ';
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+
+ print '';
+ print '
';
+
+ print '
';
// Employee
- print ''.$langs->trans("Employee").' ';
+ print ' '.$langs->trans("Employee").' ';
$usersal=new User($db);
$usersal->fetch($object->fk_user);
print $usersal->getNomUrl(1);
@@ -394,7 +390,9 @@ if ($id)
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print '
';
-
+
+ print '
';
+
dol_fiche_end();
diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php
index a4bee09d7de..6c151272035 100644
--- a/htdocs/compta/salaries/class/paymentsalary.class.php
+++ b/htdocs/compta/salaries/class/paymentsalary.class.php
@@ -33,20 +33,21 @@ class PaymentSalary extends CommonObject
{
//public $element='payment_salary'; //!< Id that identify managed objects
//public $table_element='payment_salary'; //!< Name of table without prefix where object is stored
-
- var $tms;
- var $fk_user;
- var $datep;
- var $datev;
- var $amount;
- var $type_payment;
- var $num_payment;
- var $label;
- var $datesp;
- var $dateep;
- var $fk_bank;
- var $fk_user_author;
- var $fk_user_modif;
+ public $picto='payment';
+
+ public $tms;
+ public $fk_user;
+ public $datep;
+ public $datev;
+ public $amount;
+ public $type_payment;
+ public $num_payment;
+ public $label;
+ public $datesp;
+ public $dateep;
+ public $fk_bank;
+ public $fk_user_author;
+ public $fk_user_modif;
/**
@@ -547,4 +548,66 @@ class PaymentSalary extends CommonObject
}
}
+
+ /**
+ * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
+ *
+ * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @return string Libelle
+ */
+ function getLibStatut($mode=0)
+ {
+ return $this->LibStatut($this->statut,$mode);
+ }
+
+ /**
+ * Renvoi le libelle d'un statut donne
+ *
+ * @param int $status Statut
+ * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @return string Libelle du statut
+ */
+ function LibStatut($status,$mode=0)
+ {
+ global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
+
+ $langs->load('compta');
+ /*if ($mode == 0)
+ {
+ if ($status == 0) return $langs->trans('ToValidate');
+ if ($status == 1) return $langs->trans('Validated');
+ }
+ if ($mode == 1)
+ {
+ if ($status == 0) return $langs->trans('ToValidate');
+ if ($status == 1) return $langs->trans('Validated');
+ }
+ if ($mode == 2)
+ {
+ if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
+ if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
+ }
+ if ($mode == 3)
+ {
+ if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1');
+ if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
+ }
+ if ($mode == 4)
+ {
+ if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
+ if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
+ }
+ if ($mode == 5)
+ {
+ if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
+ if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
+ }
+ if ($mode == 6)
+ {
+ if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
+ if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
+ }*/
+ return '';
+ }
+
}
diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php
index 9e48533846a..7b24a0762f3 100644
--- a/htdocs/compta/salaries/document.php
+++ b/htdocs/compta/salaries/document.php
@@ -94,7 +94,7 @@ if ($object->id)
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php
index 88414e45566..597b8aabad0 100644
--- a/htdocs/compta/salaries/index.php
+++ b/htdocs/compta/salaries/index.php
@@ -85,7 +85,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
* View
*/
-llxHeader();
+llxHeader('', $langs->trans("Salaries"));
$form = new Form($db);
$salstatic = new PaymentSalary($db);
@@ -155,18 +155,7 @@ if ($result)
print '';
print '
'."\n";
- print '';
- print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
- if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("BankAccount"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
-
- print '';
+ print ' ';
// Ref
print '';
print ' ';
@@ -198,13 +187,24 @@ if ($result)
print $searchpitco;
print ' ';
+ print ' ';
+ print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
+ if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("BankAccount"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
print "\n";
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print "";
+
+ print ' ';
$userstatic->id=$obj->uid;
$userstatic->lastname=$obj->lastname;
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index 76456aee99b..aa479ec4369 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -602,7 +602,7 @@ if ($id > 0)
while ($i < $num)
{
$objp = $db->fetch_object($resql);
- $var=!$var;
+
print " ";
print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.' ';
print ''.dol_print_date($db->jdate($objp->dp),'day')." \n";
@@ -616,8 +616,8 @@ if ($id > 0)
}
else
{
- $var=!$var;
- print ''.$langs->trans("None").' ';
+
+ print ''.$langs->trans("None").' ';
}
//if ($object->status == ChargeSociales::STATUS_DRAFT)
diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php
index 4d3f908e73c..cf42a11b515 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -117,7 +117,7 @@ if ($object->id)
print '
';
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php
index 66d6a65dd56..706c75fab07 100644
--- a/htdocs/compta/sociales/index.php
+++ b/htdocs/compta/sociales/index.php
@@ -177,18 +177,7 @@ if ($resql)
print '';
print '
'."\n";
- print '';
- print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"cs.libelle","",$param,'align="left"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"periode","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cs.paye","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
-
- print '';
+ print ' ';
// Ref
print '';
print ' ';
@@ -218,14 +207,24 @@ if ($resql)
print ' ';
print " \n";
+ print '';
+ print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"cs.libelle","",$param,'align="left"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"periode","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cs.paye","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
$i=0;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
- $var = !$var;
- print "";
+ print ' ';
// Ref
print '';
diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php
index 017bcb7686e..eda1633480a 100644
--- a/htdocs/compta/sociales/payments.php
+++ b/htdocs/compta/sociales/payments.php
@@ -163,7 +163,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
{
$obj = $db->fetch_object($resql);
$var = !$var;
- print " ";
+ print ' ';
// Ref payment
$payment_sc_static->id=$obj->pid;
$payment_sc_static->ref=$obj->pid;
@@ -259,8 +259,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$total = $total + $obj->amount;
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.dol_print_date($db->jdate($obj->dm),'day').' '."\n";
print "".$obj->label." \n";
@@ -361,8 +361,8 @@ while($j<$numlt)
$total = $total + $obj->amount;
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.dol_print_date($db->jdate($obj->dm),'day').' '."\n";
print "".$obj->label." \n";
@@ -443,8 +443,8 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
$total = $total + $obj->amount;
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.dol_print_date($db->jdate($obj->dateep),'day').' '."\n";
diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index 236e22ba981..ee6e7f1be27 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -357,8 +357,8 @@ if ($modecompta == 'CREANCES-DETTES')
if (count($name)) {
foreach($name as $key=>$value) {
- $var=!$var;
- print " ";
+
+ print ' ';
// Product
$fullname=$name[$key];
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index d72b06a1bb0..fff94c898c2 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -352,8 +352,8 @@ if (count($amount)) {
$i = 0;
foreach($arrayforsort as $key => $value) {
- $var=!$var;
- print " ";
+
+ print ' ';
// Third party
$fullname=$name[$key];
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index 636c4e29d17..548809f4317 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -517,8 +517,8 @@ if (count($amount)) {
}
foreach($arrayforsort as $key=>$value) {
- $var=!$var;
- print " ";
+
+ print ' ';
// Third party
$fullname=$name[$key];
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 9d942caf57a..2bb9a7d50a0 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -222,8 +222,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
{
$mois_modulo = $mois;// ajout
if($mois>12){$mois_modulo = $mois-12;} // ajout
- $var=!$var;
- print " ";
+
+ print ' ';
print "".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B")." ";
for ($annee = $year_start -1 ; $annee <= $year_end ; $annee++) // We start one year before to have data to be able to make delta
@@ -312,8 +312,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
/*
for ($mois = 1 ; $mois < 13 ; $mois++)
{
- $var=!$var;
- print " ";
+
+ print ' ';
print "".dol_print_date(dol_mktime(12,0,0,$mois,1,2000),"%B")." ";
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
@@ -480,7 +480,7 @@ print '';
$totalam_Rac += $obj->am;
$i++;
}
- $var=!$var;
+
print " Facture a encaisser : ".price($total_ttc_Rac)." <-- bug ici car n'exclut pas le deja r�gl� des factures partiellement r�gl�es ";
}
$db->free($resql);
@@ -530,7 +530,7 @@ print '';
$total_pr += $obj->total_ttc-$obj->tot_fttc;
$i++;
}
- $var=!$var;
+
print "Signe et non facture: ".price($total_pr)." <-- bug ici, ca devrait exclure le deja facture ";
}
$db->free($resql);
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index 84940bae414..0ede7fa091e 100644
--- a/htdocs/compta/tva/clients.php
+++ b/htdocs/compta/tva/clients.php
@@ -260,7 +260,7 @@ if (is_array($coll_list)) {
$i = 1;
foreach ($coll_list as $coll) {
if ($min == 0 or ($min > 0 && $coll->amount > $min)) {
- $var=!$var;
+
$intra = str_replace($find,$replace,$coll->tva_intra);
if(empty($intra)) {
if($coll->assuj == '1') {
@@ -270,7 +270,7 @@ if (is_array($coll_list)) {
$intra = '';
}
}
- print "";
+ print ' ';
print ''.$i." ";
$company_static->id=$coll->socid;
$company_static->name=$coll->name;
@@ -340,7 +340,7 @@ if (is_array($coll_list)) {
$i = 1;
foreach ($coll_list as $coll) {
if ($min == 0 or ($min > 0 && $coll->amount > $min)) {
- $var=!$var;
+
$intra = str_replace($find,$replace,$coll->tva_intra);
if (empty($intra)) {
if ($coll->assuj == '1') {
@@ -350,7 +350,7 @@ if (is_array($coll_list)) {
$intra = '';
}
}
- print " ";
+ print ' ';
print ''.$i." ";
$company_static->id=$coll->socid;
$company_static->name=$coll->name;
diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php
index c9a65ac2f03..105bfcb2bf6 100644
--- a/htdocs/compta/tva/index.php
+++ b/htdocs/compta/tva/index.php
@@ -83,8 +83,8 @@ function pt ($db, $sql, $date)
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print ' ';
+
+ print ' ';
print ''.$obj->dm." \n";
$total = $total + $obj->mm;
@@ -171,8 +171,8 @@ for ($m = 1 ; $m < 13 ; $m++ )
break;
}
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").' ';
$x_coll = 0;
diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php
index 57ce32b72fe..6d33c358af2 100644
--- a/htdocs/compta/tva/quadri.php
+++ b/htdocs/compta/tva/quadri.php
@@ -259,8 +259,8 @@ if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES")
$x_paye_sum = 0;
$x_paye_ht = 0;
foreach($x_both as $rate => $both){
- $var=!$var;
- print " ";
+
+ print ' ';
print "$rate% ";
print "".price($both['coll']['totalht'])." ";
print "".price($both['coll']['vat'])." ";
@@ -282,8 +282,8 @@ if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES")
$total = $total + $diff;
$subtotal = $subtotal + $diff;
- $var=!$var;
- print " ";
+
+ print ' ';
print ' ';
print "".price($diff)." \n";
print " \n";
diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php
index e0a19d7a0f3..513eb25ff7e 100644
--- a/htdocs/compta/tva/quadri_detail.php
+++ b/htdocs/compta/tva/quadri_detail.php
@@ -396,8 +396,8 @@ else
if (! empty($fields['ddate_start'])) $type=1;
if (! empty($fields['ddate_end'])) $type=1;
- $var=!$var;
- print '';
+
+ print ' ';
// Ref
print ''.$fields['link'].' ';
@@ -553,8 +553,8 @@ else
if (! empty($fields['ddate_start'])) $type=1;
if (! empty($fields['ddate_end'])) $type=1;
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print ''.$fields['link'].' ';
diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php
index 626a0fd6c34..a3d902ed3f3 100644
--- a/htdocs/compta/tva/quarter_report.php
+++ b/htdocs/compta/tva/quarter_report.php
@@ -408,8 +408,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
$type=1;
}
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print ''.$fields['link'].' ';
@@ -576,8 +576,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
$type=1;
}
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print ''.$fields['link'].' ';
diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php
index 1a45b8a91c7..15a6df0a717 100644
--- a/htdocs/compta/tva/reglement.php
+++ b/htdocs/compta/tva/reglement.php
@@ -157,19 +157,10 @@ if ($result)
print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit);
+ print '';
print '
';
- print '';
- print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DateValue"),$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
- if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
- print '';
+ print ' ';
print ' ';
print ' ';
print ' ';
@@ -196,10 +187,20 @@ if ($result)
print '';
print " \n";
+ print '';
+ print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DateValue"),$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
+ if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- $var=!$var;
if ($obj->payment_code <> '')
{
@@ -210,7 +211,7 @@ if ($result)
$type = ' ';
}
- print "";
+ print ' ';
$tva_static->id=$obj->rowid;
$tva_static->ref=$obj->rowid;
@@ -254,7 +255,8 @@ if ($result)
print " ";
print "
";
-
+ print '
';
+
print '';
$db->free($result);
diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php
index 8d003e14cf5..b0067d81ec1 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -100,7 +100,7 @@ if ($object->id)
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 80649ef4e06..ef26c9c80e2 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -631,7 +631,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
if (! empty($arrayfields["ef.".$key]['checked']))
{
$align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
}
}
}
@@ -642,7 +642,7 @@ print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['p.statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'align="center"',$sortfield,$sortorder);
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print " \n";
@@ -651,7 +651,7 @@ while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- print "";
+ print ' ';
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname='';
@@ -669,8 +669,8 @@ while ($i < min($num,$limit))
if (! empty($arrayfields['p.lastname']['checked']))
{
print '';
- print $contactstatic->getNomUrl(1,'',0);
- print ' ';
+ print $contactstatic->getNomUrl(1,'',0);
+ print '';
}
// Firstname
if (! empty($arrayfields['p.firstname']['checked']))
@@ -784,12 +784,13 @@ while ($i < min($num,$limit))
print ''.$contactstatic->getLibStatut(3).' ';
}
// Action column - Links Add action and Export vcard
- print '';
- print ''.img_object($langs->trans("AddAction"),"action").' ';
+ print ' ';
+ /*print ''.img_object($langs->trans("AddAction"),"action").' ';
print ' ';
- print '';
+ print ' ';
print img_picto($langs->trans("VCard"),'vcard.png').' ';
- print ' ';
+ print ''; */
+ print '';
print " \n";
$i++;
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 34f44c4f690..0e5f3fca093 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -1507,7 +1507,7 @@ else
$objp = $db->fetch_object($result);
- //$var=!$var;
+ //
if ($action != 'editline' || GETPOST('rowid') != $objp->rowid)
{
@@ -1868,7 +1868,7 @@ else
print 'id.'&ligne='.GETPOST('ligne').'&action=active" method="post">';
print ' ';
- print '';
+ print '';
// Definie date debut et fin par defaut
$dateactstart = $objp->date_debut;
@@ -1887,23 +1887,25 @@ else
}
}
- print '';
+ print ' ';
print ''.$langs->trans("DateServiceActivate").' ';
print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1);
print ' ';
-
print ''.$langs->trans("DateEndPlanned").' ';
print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active",1,0,1);
print ' ';
-
- print '';
- print ' ';
- print ' ';
+ print ' ';
print ' ';
print ' ';
- print ''.$langs->trans("Comment").' ';
+ print '';
+ print ''.$langs->trans("Comment").' ';
+ print '';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
print '
';
@@ -1913,13 +1915,13 @@ else
if ($user->rights->contrat->activer && $action == 'unactivateline' && $object->lines[$cursorline-1]->id == GETPOST('ligne'))
{
/**
- * Desactiver la ligne de contrat
+ * Disable a contract line
*/
print 'id.'&ligne='.$object->lines[$cursorline-1]->id.'&action=closeline" method="post">';
print ' ';
- print '';
+ print '';
print '';
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index d4d41b2f60c..f0a34e982c8 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -1819,13 +1819,13 @@ class Contrat extends CommonObject
$text.=': ';
}
$text.=($mode == 7?'':'');
- $text.=($mode != 7 || $this->nbofserviceswait > 0) ? $this->nbofserviceswait.' '.$line->LibStatut(0,3).' ' : '';
+ $text.=($mode != 7 || $this->nbofserviceswait > 0) ? $this->nbofserviceswait.' '.$line->LibStatut(0,3).(($this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?' ':'') : '';
$text.=($mode == 7?'
':'');
- $text.=($mode != 7 || $this->nbofservicesopened > 0) ? $this->nbofservicesopened.' '.$line->LibStatut(4,3,0).' ' : '';
+ $text.=($mode != 7 || $this->nbofservicesopened > 0) ? $this->nbofservicesopened.' '.$line->LibStatut(4,3,0).(($this->nbofservicesexpired || $this->nbofservicesclosed)?' ':'') : '';
$text.=($mode == 7?'
':'');
- $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? $this->nbofservicesexpired.' '.$line->LibStatut(4,3,1).' ' : '';
+ $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? $this->nbofservicesexpired.' '.$line->LibStatut(4,3,1).(($this->nbofservicesclosed)?' ':'') : '';
$text.=($mode == 7?'
':'');
- $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? $this->nbofservicesclosed.' '.$line->LibStatut(5,3).' ' : '';
+ $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? $this->nbofservicesclosed.' '.$line->LibStatut(5,3) : '';
$text.=($mode == 7?'
':'');
return $text;
}
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index e6607729767..8510888cf35 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -130,7 +130,7 @@ if ($id > 0 || ! empty($ref))
$hselected=1;
- dol_fiche_head($head, $hselected, $langs->trans("Contract"), 0, 'contract');
+ dol_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract');
// Contract card
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 289ec50b78b..7c0263f8376 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -93,11 +93,11 @@ if ($object->id)
{
$head=contract_prepare_head($object);
- dol_fiche_head($head, 'documents', $langs->trans("Contract"), 0, 'contract');
+ dol_fiche_head($head, 'documents', $langs->trans("Contract"), -1, 'contract');
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index 9ec924254a9..ea9c06d0b2f 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -82,7 +82,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
print ' ';
print '\n";
@@ -188,8 +188,8 @@ foreach($listofstatus as $status)
$dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'data'=>(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0));
if (empty($conf->use_javascript_ajax))
{
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$staticcontratligne->LibStatut($status,0,($bool?1:0)).' ';
print ''.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).' ';
print " \n";
@@ -210,8 +210,8 @@ foreach($listofstatus as $status)
{
if (empty($conf->use_javascript_ajax))
{
- $var=!$var;
- print '';
+
+ print ' ';
print ''.$staticcontratligne->LibStatut($status,0,($bool?1:0)).' ';
print ''.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).' ';
if ($status==4 && ! $bool) $bool=true;
@@ -258,7 +258,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- print ' ';
+ print ' ';
$staticcontrat->ref=$obj->ref;
$staticcontrat->id=$obj->rowid;
print $staticcontrat->getNomUrl(1,'');
@@ -272,7 +272,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
print ' ';
//$tot_ttc+=$obj->total_ttc;
$i++;
- $var=!$var;
+
}
}
else
@@ -334,9 +334,9 @@ if ($result)
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print '';
+ print ' ';
print '';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->cid);
$staticcontrat->id=$obj->cid;
@@ -401,8 +401,8 @@ if ($resql)
while ($i < min($num,$max))
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
print '';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
$staticcontrat->id=$obj->fk_contrat;
@@ -482,8 +482,8 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
print '';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
@@ -563,8 +563,8 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
- print ' ';
+
+ print ' ';
print '';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php
index 7f20b21c888..35cca237b21 100644
--- a/htdocs/contrat/info.php
+++ b/htdocs/contrat/info.php
@@ -28,10 +28,14 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$langs->load("contracts");
+$action = GETPOST('action','alpha');
+$confirm = GETPOST('confirm','alpha');
+$id = GETPOST('id','int');
+$ref = GETPOST('ref','alpha');
+
// Security check
-$contratid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'contrat',$contratid,'');
+$result = restrictedArea($user, 'contrat', $id, '');
/*
@@ -41,13 +45,17 @@ $result = restrictedArea($user, 'contrat',$contratid,'');
llxHeader('',$langs->trans("Contract"),"");
$object = new Contrat($db);
-$object->fetch($contratid);
-$object->fetch_thirdparty();
-$object->info($contratid);
+$object->fetch($id, $ref);
+if ($object->id > 0)
+{
+ $object->fetch_thirdparty();
+}
+
+$object->info($object->id);
$head = contract_prepare_head($object);
-dol_fiche_head($head, 'info', $langs->trans("Contract"), 0, 'contract');
+dol_fiche_head($head, 'info', $langs->trans("Contract"), -1, 'contract');
// Contract card
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index c382bfc7612..be1b2e5fccf 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -534,7 +534,7 @@ if ($resql)
if (! empty($arrayfields["ef.".$key]['checked']))
{
$align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
}
}
}
@@ -551,7 +551,7 @@ if ($resql)
print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"');
print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"');
}
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print " \n";
while ($i < min($num,$limit))
@@ -563,7 +563,7 @@ if ($resql)
$contracttmp->ref_customer=$obj->ref_customer;
$contracttmp->ref_supplier=$obj->ref_supplier;
- print '';
+ print ' ';
if (! empty($arrayfields['c.ref']['checked']))
{
print '';
diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php
index 212fa465266..7d4927d19b8 100644
--- a/htdocs/contrat/note.php
+++ b/htdocs/contrat/note.php
@@ -70,7 +70,7 @@ if ($id > 0 || ! empty($ref))
$hselected = 2;
- dol_fiche_head($head, 'note', $langs->trans("Contract"), 0, 'contract');
+ dol_fiche_head($head, 'note', $langs->trans("Contract"), -1, 'contract');
// Contract card
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index 42ff4b04e83..d92bcd16679 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -371,7 +371,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
if (! empty($arrayfields["ef.".$key]['checked']))
{
$align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
}
}
}
@@ -382,7 +382,7 @@ print $hookmanager->resPrint;
if (! empty($arrayfields['cd.datec']['checked'])) print_liste_field_titre($arrayfields['cd.datec']['label'],$_SERVER["PHP_SELF"],"cd.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['cd.tms']['checked'])) print_liste_field_titre($arrayfields['cd.tms']['label'],$_SERVER["PHP_SELF"],"cd.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['status']['checked'])) print_liste_field_titre($arrayfields['status']['label'],$_SERVER["PHP_SELF"],"cd.statut,c.statut","",$param,'align="right"',$sortfield,$sortorder);
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print " \n";
print '';
@@ -519,9 +519,9 @@ while ($i < min($num,$limit))
$contractstatic->id=$obj->cid;
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
- $var=!$var;
+
- print " ";
+ print ' ';
// Ref
if (! empty($arrayfields['c.ref']['checked']))
diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
index 1257e3503a9..a2da6cef24e 100644
--- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
@@ -33,7 +33,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
- $var=!$var;
+
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 95c0c59a9cd..74badc6daae 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -434,8 +434,11 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
// Create output dir if not exists
dol_mkdir($diroutputmassaction);
- // Save merged file
+ // Defined name of merged file
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
+ $filename=preg_replace('/\s/','_',$filename);
+
+ // Save merged file
if ($filter=='paye:0')
{
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
@@ -486,7 +489,8 @@ if (! $error && $massaction == 'delete' && $permtodelete)
$result=$objecttmp->fetch($toselectid);
if ($result > 0)
{
- $result = $objecttmp->delete($user);
+ if ($objecttmp->element == 'societe') $result = $objecttmp->delete($objecttmp->id, $user, 1);
+ else $result = $objecttmp->delete($user);
if ($result <= 0)
{
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php
index 061b98d1e9c..dbf446d2112 100644
--- a/htdocs/core/actions_printing.inc.php
+++ b/htdocs/core/actions_printing.inc.php
@@ -36,7 +36,7 @@ if ($action == 'print_file' and $user->rights->printing->read)
$list = $objectprint->listDrivers($db, 10);
if (! empty($list)) {
$errorprint=0;
- $printed=0;
+ $printerfound=0;
foreach ($list as $driver) {
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
$langs->load($driver);
@@ -46,27 +46,35 @@ if ($action == 'print_file' and $user->rights->printing->read)
if (! empty($conf->global->{$printer->active}))
{
+ $printerfound++;
+
$subdir=(GETPOST('printer', 'alpha')=='expedition'?'sending':'');
$module = GETPOST('printer', 'alpha');
if ($module =='commande_fournisseur') {
$module = 'fournisseur';
$subdir = 'commande';
}
- $ret = $printer->print_file(GETPOST('file', 'alpha'), $module, $subdir);
- if ($ret > 0) {
- //print ''.print_r($printer->errors, true).' ';
- setEventMessages($printer->error, $printer->errors, 'errors');
+ try {
+ $ret = $printer->print_file(GETPOST('file', 'alpha'), $module, $subdir);
+ if ($ret > 0) {
+ //print ''.print_r($printer->errors, true).' ';
+ setEventMessages($printer->error, $printer->errors, 'errors');
+ }
+ if ($ret==0)
+ {
+ //print ''.print_r($printer->errors, true).' ';
+ setEventMessages($printer->error, $printer->errors);
+ setEventMessages($langs->trans("FileWasSentToPrinter", basename(GETPOST('file'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null);
+ }
}
- if ($ret==0)
+ catch(Exception $e)
{
- //print ''.print_r($printer->errors, true).' ';
- setEventMessages($printer->error, $printer->errors);
- setEventMessages($langs->trans("FileWasSentToPrinter", basename(GETPOST('file'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null);
- $printed++;
+ $ret = 1;
+ setEventMessages($e->getMessage(), null, 'errors');
}
}
}
- if ($printed==0) setEventMessages($langs->trans("NoActivePrintingModuleFound"), null, 'warnings');
+ if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound"), null, 'warnings');
} else {
setEventMessages($langs->trans("NoModuleFound"), null, 'warnings');
}
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 52411613e0b..3fec57091cb 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -150,7 +150,7 @@ if ($type == 'directory')
$formfile=new FormFile($db);
$maxlengthname=40;
- $excludefiles = array('^SPECIMEN\.pdf$','^\.','(\.meta|_preview\.png)$','^temp$','^payments$','^CVS$','^thumbs$');
+ $excludefiles = array('^SPECIMEN\.pdf$','^\.','(\.meta|_preview.*\.png)$','^temp$','^payments$','^CVS$','^thumbs$');
$sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC);
// Right area. If module is defined, we are in automatic ecm.
@@ -212,7 +212,7 @@ if ($type == 'directory')
{
$filearray=array();
}
- else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1);
+ else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview.*\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1);
if ($section)
{
diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php
index 41d411f01fd..331b4ceaac8 100644
--- a/htdocs/core/ajax/row.php
+++ b/htdocs/core/ajax/row.php
@@ -1,5 +1,6 @@
+/* Copyright (C) 2010-2015 Regis Houssin
+ * Copyright (C) 2017 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index b6d38d17b53..e856d52c2b6 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -191,7 +191,7 @@ class box_actions extends ModeleBoxes
// on affiche que les évènement du jours ou passé
// qui ne sont pas à 100%
$actioncejour=true;
- $var=!$var;
+
// TR
$logo=$contents[$line][0]['logo'];
$label=$contents[$line][1]['text'];
diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index fe460f7d512..be9a868109d 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -121,7 +121,7 @@ class box_commandes extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => '',
+ 'td' => 'class="tdoverflowmax100"',
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
index 315293281cc..7c3d6ab4e7f 100644
--- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
@@ -223,7 +223,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT");
$stringtoshow.=' ';
$stringtoshow.=$langs->trans("Year").' ';
- $stringtoshow.=' ';
+ $stringtoshow.=' ';
$stringtoshow.='';
$stringtoshow.='';
if ($shownb && $showtot)
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index a709a7aef3a..2b3c69a9e15 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -249,6 +249,8 @@ class box_graph_product_distribution extends ModeleBoxes
if (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire))
{
+ $langs->load("orders");
+
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showordernb)
{
diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php
index 7211877a593..05bd3043b0a 100644
--- a/htdocs/core/boxes/box_lastlogin.php
+++ b/htdocs/core/boxes/box_lastlogin.php
@@ -79,7 +79,7 @@ class box_lastlogin extends ModeleBoxes
);
$this->info_box_contents[$line][1] = array(
'td' => '',
- 'text' => $user->getNomUrl(1),
+ 'text' => $user->getNomUrl(-1),
'asis' => 1
);
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index d3945ddb940..3f7b37f186a 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -116,8 +116,8 @@ class box_propales extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => '',
- 'text' => $societestatic->getNomUrl(1,'',40),
+ 'td' => 'class="tdoverflowmax100"',
+ 'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index 26ee34bdca0..f5fa32e590d 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -234,7 +234,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
// Show box title
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']))
{
- $out.= '';
+ $out.= ' ';
$out.= ' 0) { $out.= ' colspan="'.$nbcol.'"'; }
$out.= '>';
@@ -247,25 +247,26 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
$out.= $s;
}
- $out.= ' ';
-
- $sublink='';
- if (! empty($head['sublink'])) $sublink.= '';
- if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
- if (! empty($head['sublink'])) $sublink.= ' ';
+ $out.= ' ';
+
if (! empty($conf->use_javascript_ajax))
{
- $out.= '';
+ $sublink='';
+ if (! empty($head['sublink'])) $sublink.= '';
+ if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
+ if (! empty($head['sublink'])) $sublink.= ' ';
+
+ $out.= ' ';
$out.=$sublink;
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
- $out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"');
- $out.= img_picto($langs->trans("CloseBox",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
+ $out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone cursormove"');
+ $out.= img_picto($langs->trans("CloseBox",$this->box_id),'close_title','class="boxclose cursorpointer" rel="x:y" id="imgclose'.$this->box_id.'"');
$label=$head['text'];
if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
$out.= ' ';
$out.= '
';
}
- $out.= '';
+
$out.= "\n";
}
@@ -277,7 +278,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
{
if (isset($contents[$i]))
{
- $var=!$var;
+
// TR
if (isset($contents[$i][0]['tr'])) $out.= '';
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 396952ace9c..3da7f3abcf3 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -31,16 +31,20 @@
/**
* Class to send emails (with attachments or not)
- * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid);
+ * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext);
* $mailfile->sendfile();
*/
class CMailFile
{
+ public $sendcontext;
+ public $sendmode;
+ public $sendsetup;
+
var $subject; // Topic: Subject of email
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '' or 'John Doe ' or ''). Note that with gmail smtps, value here is forced by google to account (but not the reply-to).
- // Sender: Who send the email ("Sender" has sent emails on behalf of "From").
- // Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, add Sender field with an email of the protected domain.
- // Return-Path: Email where to send bounds.
+ // Sender: Who send the email ("Sender" has sent emails on behalf of "From").
+ // Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, add Sender field with an email of the protected domain.
+ // Return-Path: Email where to send bounds.
var $reply_to; // Reply-To: Email where to send replies from mailer software (mailer use From if reply-to not defined, Gmail use gmail account if reply-to not defined)
var $errors_to; // Errors-To: Email where to send errors.
var $addr_to;
@@ -55,7 +59,6 @@ class CMailFile
var $eol;
var $eol2;
- var $atleastonefile=0;
var $error='';
var $smtps; // Contains SMTPs object (if this method is used)
@@ -74,17 +77,17 @@ class CMailFile
// Image
var $html;
var $image_boundary;
- var $atleastoneimage=0;
+ var $atleastoneimage=0; // at least one image file with file=xxx.ext into content (TODO Debug this. How can this case be tested. Remove if not used).
var $html_images=array();
var $images_encoded=array();
var $image_types = array('gif' => 'image/gif',
- 'jpg' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpe' => 'image/jpeg',
- 'bmp' => 'image/bmp',
- 'png' => 'image/png',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff');
+ 'jpg' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'jpe' => 'image/jpeg',
+ 'bmp' => 'image/bmp',
+ 'png' => 'image/png',
+ 'tif' => 'image/tiff',
+ 'tiff' => 'image/tiff');
/**
@@ -103,12 +106,23 @@ class CMailFile
* @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable)
* @param string $errors_to Email for errors-to
* @param string $css Css option
- * @param string $trackid Tracking string
+ * @param string $trackid Tracking string (contains type and id of related element)
* @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'phpmail' and 'smtps' for the moment)
+ * @param string $sendcontext 'standard', 'emailing', ...
*/
- function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='',$trackid='',$moreinheader='')
+ function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='',$trackid='',$moreinheader='',$sendcontext='standard')
{
- global $conf;
+ global $conf, $dolibarr_main_data_root;
+
+ $this->sendcontext = $sendcontext;
+
+ $this->sendmode = '';
+ if ($this->sendcontext == 'emailing') $this->sendmode = $conf->global->EMAILING_MAIL_SENDMODE;
+ if (empty($this->sendmode)) $this->sendmode=$conf->global->MAIN_MAIL_SENDMODE;
+ if (empty($this->sendmode)) $this->sendmode='mail';
+
+ $this->sendsetup = array();
+
// We define end of line (RFC 821).
$this->eol="\r\n";
@@ -130,17 +144,14 @@ class CMailFile
// On defini alternative_boundary
$this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars)
- // If ending method not defined
- if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail';
-
- dol_syslog("CMailFile::CMailfile: MAIN_MAIL_SENDMODE=".$conf->global->MAIN_MAIL_SENDMODE." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid", LOG_DEBUG);
+ dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG);
dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG);
if (empty($subject))
{
- dol_syslog("CMailFile::CMailfile: Try to send an email with empty subject");
- $this->error='ErrorSubjectIsRequired';
- return;
+ dol_syslog("CMailFile::CMailfile: Try to send an email with empty subject");
+ $this->error='ErrorSubjectIsRequired';
+ return;
}
// Detect if message is HTML (use fast method)
@@ -160,7 +171,11 @@ class CMailFile
if ($this->msgishtml)
{
$this->html = $msg;
- $findimg = $this->findHtmlImages($conf->fckeditor->dir_output);
+
+ if (! empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS))
+ {
+ $findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias');
+ }
// Define if there is at least one file
if ($findimg)
@@ -190,7 +205,7 @@ class CMailFile
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc.=($addr_bcc?', ':'').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
// Action according to choosed sending method
- if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
+ if ($this->sendmode == 'mail')
{
// Use mail php function (default PHP method)
// ------------------------------------------
@@ -210,9 +225,9 @@ class CMailFile
$this->addr_bcc = $addr_bcc;
$this->deliveryreceipt = $deliveryreceipt;
$this->trackid = $trackid;
-
+
$smtp_headers = $this->write_smtpheaders();
- if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
+ if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
// Define mime_headers
$mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
@@ -231,17 +246,6 @@ class CMailFile
// Define body in text_body
$text_body = $this->write_body($msg);
- // Encode images
- $images_encoded = '';
- if ($this->atleastoneimage)
- {
- $images_encoded.= $this->write_images($this->images_encoded);
- // always end related and end alternative after inline images
- $images_encoded.= "--" . $this->related_boundary . "--" . $this->eol;
- $images_encoded.= $this->eol . "--" . $this->alternative_boundary . "--" . $this->eol;
- $images_encoded.= $this->eol;
- }
-
// Add attachments to text_encoded
if ($this->atleastonefile)
{
@@ -255,11 +259,11 @@ class CMailFile
// comme des injections mail par les serveurs de messagerie.
$this->headers = preg_replace("/([\r\n]+)$/i","",$this->headers);
- $this->message = 'This is a message with multiple parts in MIME format.'.$this->eol;
- $this->message.= $text_body . $images_encoded . $files_encoded;
+ $this->message = $this->eol.'This is a message with multiple parts in MIME format.'.$this->eol;
+ $this->message.= $text_body . $files_encoded;
$this->message.= "--" . $this->mixed_boundary . "--" . $this->eol;
}
- else if ($conf->global->MAIN_MAIL_SENDMODE == 'smtps')
+ else if ($this->sendmode == 'smtps')
{
// Use SMTPS library
// ------------------------------------------
@@ -315,7 +319,7 @@ class CMailFile
$this->smtps=$smtps;
}
// TODO not stable, in progress
- else if ($conf->global->MAIN_MAIL_SENDMODE == 'phpmailer')
+ else if ($this->sendmode == 'phpmailer')
{
// Use PHPMailer library
// ------------------------------------------
@@ -330,7 +334,7 @@ class CMailFile
$this->phpmailer->SetReplyTo($this->getValidAddress($from,0,1)); // Set property with this->phpmailer->setReplyTo after constructor if you want to use another value than the From
// TODO Add trackid into smtp header
// TODO if (! empty($moreinheader)) ...
-
+
if (! empty($this->html))
{
if (!empty($css))
@@ -367,94 +371,94 @@ class CMailFile
$this->phpmailer->setErrorsTo($errors_to);
$this->phpmailer->setDeliveryReceipt($deliveryreceipt);
}
- else if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer')
- {
- // Use Swift Mailer library
- // ------------------------------------------
-
- $host = dol_getprefix('email');
-
- require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
- // Create the message
- $this->message = Swift_Message::newInstance();
+ else if ($this->sendmode == 'swiftmailer')
+ {
+ // Use Swift Mailer library
+ // ------------------------------------------
- // Adding a trackid header to a message
- $headers = $this->message->getHeaders();
- $headers->addTextHeader('X-Dolibarr-TRACKID', $trackid);
- $headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host;
- $msgid = $headers->get('Message-ID');
- $msgid->setId($headerID);
- $headers->addIdHeader('References', $headerID);
- // TODO if (! empty($moreinheader)) ...
-
- // Give the message a subject
- $this->message->setSubject($this->encodetorfc2822($subject));
+ $host = dol_getprefix('email');
- // Set the From address with an associative array
- //$this->message->setFrom(array('john@doe.com' => 'John Doe'));
- if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from));
+ require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
+ // Create the message
+ $this->message = Swift_Message::newInstance();
- // Set the To addresses with an associative array
- if (! empty($to)) $this->message->setTo($this->getArrayAddress($to));
+ // Adding a trackid header to a message
+ $headers = $this->message->getHeaders();
+ $headers->addTextHeader('X-Dolibarr-TRACKID', $trackid);
+ $headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host;
+ $msgid = $headers->get('Message-ID');
+ $msgid->setId($headerID);
+ $headers->addIdHeader('References', $headerID);
+ // TODO if (! empty($moreinheader)) ...
- if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from));
+ // Give the message a subject
+ $this->message->setSubject($this->encodetorfc2822($subject));
- $this->message->setCharSet($conf->file->character_set_client);
+ // Set the From address with an associative array
+ //$this->message->setFrom(array('john@doe.com' => 'John Doe'));
+ if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from));
- if (! empty($this->html))
- {
- if (!empty($css))
- {
- $this->css = $css;
- $this->buildCSS();
- }
- $msg = $this->html;
- $msg = $this->checkIfHTML($msg);
- }
+ // Set the To addresses with an associative array
+ if (! empty($to)) $this->message->setTo($this->getArrayAddress($to));
- if ($this->atleastoneimage)
- {
- foreach ($this->images_encoded as $img)
- {
- //$img['fullpath'],$img['image_encoded'],$img['name'],$img['content_type'],$img['cid']
- $attachment = Swift_Image::fromPath($img['fullpath'], $img['content_type']);
- // embed image
- $imgcid = $this->message->embed($attachment);
- // replace cid by the one created by swiftmail in html message
- $msg = str_replace("cid:".$img['cid'], $imgcid, $msg);
- }
- }
+ if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from));
- if ($this->msgishtml) {
- $this->message->setBody($msg,'text/html');
- // And optionally an alternative body
- //$this->message->addPart('Here is the message itself', 'text/plain');
- } else {
- $this->message->setBody($msg,'text/plain');
- // And optionally an alternative body
- //$this->message->addPart('Here is the message itself ', 'text/html');
- }
+ $this->message->setCharSet($conf->file->character_set_client);
- if ($this->atleastonefile)
- {
- foreach ($filename_list as $i => $val)
- {
- //$this->message->attach(Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i]));
- $attachment = Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i]);
- $this->message->attach($attachment);
- }
- }
+ if (! empty($this->html))
+ {
+ if (!empty($css))
+ {
+ $this->css = $css;
+ $this->buildCSS();
+ }
+ $msg = $this->html;
+ $msg = $this->checkIfHTML($msg);
+ }
- if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc));
- if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc));
- //if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
- if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
- }
+ if ($this->atleastoneimage)
+ {
+ foreach ($this->images_encoded as $img)
+ {
+ //$img['fullpath'],$img['image_encoded'],$img['name'],$img['content_type'],$img['cid']
+ $attachment = Swift_Image::fromPath($img['fullpath'], $img['content_type']);
+ // embed image
+ $imgcid = $this->message->embed($attachment);
+ // replace cid by the one created by swiftmail in html message
+ $msg = str_replace("cid:".$img['cid'], $imgcid, $msg);
+ }
+ }
+
+ if ($this->msgishtml) {
+ $this->message->setBody($msg,'text/html');
+ // And optionally an alternative body
+ //$this->message->addPart('Here is the message itself', 'text/plain');
+ } else {
+ $this->message->setBody($msg,'text/plain');
+ // And optionally an alternative body
+ //$this->message->addPart('Here is the message itself ', 'text/html');
+ }
+
+ if ($this->atleastonefile)
+ {
+ foreach ($filename_list as $i => $val)
+ {
+ //$this->message->attach(Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i]));
+ $attachment = Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i]);
+ $this->message->attach($attachment);
+ }
+ }
+
+ if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc));
+ if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc));
+ //if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
+ if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
+ }
else
{
// Send mail method not correctly defined
// --------------------------------------
- $this->error = 'Bad value for MAIN_MAIL_SENDMODE constant';
+ $this->error = 'Bad value for sendmode';
}
}
@@ -476,55 +480,55 @@ class CMailFile
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS))
{
- require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
- $hookmanager = new HookManager($db);
- $hookmanager->initHooks(array(
- 'maildao'
- ));
- $reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
- if (! empty($reshook))
- {
- $this->error = "Error in hook maildao doactions " . $reshook;
- dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
+ require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
+ $hookmanager = new HookManager($db);
+ $hookmanager->initHooks(array(
+ 'maildao'
+ ));
+ $reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ if (! empty($reshook))
+ {
+ $this->error = "Error in hook maildao doactions " . $reshook;
+ dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
- return $reshook;
- }
+ return $reshook;
+ }
- // Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
- if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10;
- $tmparray1 = explode(',', $this->addr_to);
- if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)
- {
- $this->error = 'Too much recipients in to:';
- dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
- return false;
- }
- if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL=10;
- $tmparray2 = explode(',', $this->addr_cc);
- if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)
- {
- $this->error = 'Too much recipients in cc:';
- dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
- return false;
- }
- if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL=10;
- $tmparray3 = explode(',', $this->addr_bcc);
- if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
- {
- $this->error = 'Too much recipients in bcc:';
- dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
- return false;
- }
- if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
- if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
- {
- $this->error = 'Too much recipients in to:, cc:, bcc:';
- dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
- return false;
- }
+ // Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
+ if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10;
+ $tmparray1 = explode(',', $this->addr_to);
+ if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)
+ {
+ $this->error = 'Too much recipients in to:';
+ dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
+ return false;
+ }
+ if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL=10;
+ $tmparray2 = explode(',', $this->addr_cc);
+ if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)
+ {
+ $this->error = 'Too much recipients in cc:';
+ dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
+ return false;
+ }
+ if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL=10;
+ $tmparray3 = explode(',', $this->addr_bcc);
+ if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
+ {
+ $this->error = 'Too much recipients in bcc:';
+ dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
+ return false;
+ }
+ if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
+ if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
+ {
+ $this->error = 'Too much recipients in to:, cc:, bcc:';
+ dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
+ return false;
+ }
// Action according to choosed sending method
- if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
+ if ($this->sendmode == 'mail')
{
// Use mail php function (default PHP method)
// ------------------------------------------
@@ -560,15 +564,15 @@ class CMailFile
// Having this variable not defined may create problems with some other sendmail (option -f required)
$additionnalparam .= ($additionnalparam?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') );
}
- if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender
- {
- $additionnalparam .= ($additionnalparam?' ':'').'-ba';
- }
+ if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender
+ {
+ $additionnalparam .= ($additionnalparam?' ':'').'-ba';
+ }
+
+ if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params
+
+ dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
- if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params
-
- dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
-
$this->message=stripslashes($this->message);
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
@@ -605,27 +609,38 @@ class CMailFile
if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_restore('SMTP');
if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_restore('smtp_port');
}
- else if ($conf->global->MAIN_MAIL_SENDMODE == 'smtps')
+ else if ($this->sendmode == 'smtps')
{
// Use SMTPS library
// ------------------------------------------
$this->smtps->setTransportType(0); // Only this method is coded in SMTPs library
- // Forcage parametres
+ // Clean parameters
if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP');
if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port');
+ // TODO Manage alternative parameters
+
// If we use SSL/TLS
$server=$conf->global->MAIN_MAIL_SMTP_SERVER;
if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $server='ssl://'.$server;
+ $port=$conf->global->MAIN_MAIL_SMTP_PORT;
$this->smtps->setHost($server);
- $this->smtps->setPort($conf->global->MAIN_MAIL_SMTP_PORT); // 25, 465...;
+ $this->smtps->setPort($port); // 25, 465...;
- if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->smtps->setID($conf->global->MAIN_MAIL_SMTPS_ID);
- if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->smtps->setPW($conf->global->MAIN_MAIL_SMTPS_PW);
- //$smtps->_msgReplyTo = 'reply@web.com';
+ $loginid=''; $loginpass='';
+ if (! empty($conf->global->MAIN_MAIL_SMTPS_ID))
+ {
+ $loginid = $conf->global->MAIN_MAIL_SMTPS_ID;
+ $this->smtps->setID($loginid);
+ }
+ if (! empty($conf->global->MAIN_MAIL_SMTPS_PW))
+ {
+ $loginpass = $conf->global->MAIN_MAIL_SMTPS_PW;
+ $this->smtps->setPW($loginpass);
+ }
$res=true;
$from=$this->smtps->getFrom('org');
@@ -646,6 +661,7 @@ class CMailFile
if ($res)
{
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->smtps->setDebug(true);
+
$result=$this->smtps->sendMsg();
//print $result;
@@ -661,63 +677,63 @@ class CMailFile
}
}
}
- else if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer')
- {
+ else if ($this->sendmode == 'swiftmailer')
+ {
- // Use Swift Mailer library
- // ------------------------------------------
- require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
+ // Use Swift Mailer library
+ // ------------------------------------------
+ require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
- // Forcage parametres
- if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP');
- if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port');
+ // Forcage parametres
+ if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP');
+ if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port');
- // If we use SSL/TLS
- $server=$conf->global->MAIN_MAIL_SMTP_SERVER;
- $secure='';
- //var_dump(stream_get_transports());
- if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $secure='ssl';
- if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $secure='tls';
+ // If we use SSL/TLS
+ $server=$conf->global->MAIN_MAIL_SMTP_SERVER;
+ $secure='';
+ //var_dump(stream_get_transports());
+ if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $secure='ssl';
+ if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $secure='tls';
- $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->MAIN_MAIL_SMTP_PORT, $secure);
+ $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->MAIN_MAIL_SMTP_PORT, $secure);
- if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->transport->setUsername($conf->global->MAIN_MAIL_SMTPS_ID);
- if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->transport->setPassword($conf->global->MAIN_MAIL_SMTPS_PW);
- //$smtps->_msgReplyTo = 'reply@web.com';
+ if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->transport->setUsername($conf->global->MAIN_MAIL_SMTPS_ID);
+ if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->transport->setPassword($conf->global->MAIN_MAIL_SMTPS_PW);
+ //$smtps->_msgReplyTo = 'reply@web.com';
- // Create the Mailer using your created Transport
- $this->mailer = Swift_Mailer::newInstance($this->transport);
+ // Create the Mailer using your created Transport
+ $this->mailer = Swift_Mailer::newInstance($this->transport);
- if (! empty($conf->global->MAIN_MAIL_DEBUG)) {
- // To use the ArrayLogger
- $this->logger = new Swift_Plugins_Loggers_ArrayLogger();
- // Or to use the Echo Logger
- //$this->logger = new Swift_Plugins_Loggers_EchoLogger();
- $this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger));
- }
- // send mail
- try {
- $result = $this->mailer->send($this->message);
- } catch (Exception $e) {
- $this->error = $e->getMessage();
- }
- if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
+ if (! empty($conf->global->MAIN_MAIL_DEBUG)) {
+ // To use the ArrayLogger
+ $this->logger = new Swift_Plugins_Loggers_ArrayLogger();
+ // Or to use the Echo Logger
+ //$this->logger = new Swift_Plugins_Loggers_EchoLogger();
+ $this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger));
+ }
+ // send mail
+ try {
+ $result = $this->mailer->send($this->message);
+ } catch (Exception $e) {
+ $this->error = $e->getMessage();
+ }
+ if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
- $res = true;
- if (! empty($this->error) && ! $result) {
- dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
- $res=false;
- } else {
- $this->error = sprintf ("Sent %d messages\n", $result);
- }
- }
+ $res = true;
+ if (! empty($this->error) && ! $result) {
+ dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
+ $res=false;
+ } else {
+ $this->error = sprintf ("Sent %d messages\n", $result);
+ }
+ }
else
{
// Send mail method not correctly defined
// --------------------------------------
- return 'Bad value for MAIN_MAIL_SENDMODE constant';
+ return 'Bad value for sendmode';
}
}
@@ -785,81 +801,81 @@ class CMailFile
$outputfile=$dolibarr_main_data_root."/dolibarr_mail.log";
$fp = fopen($outputfile,"w");
- if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
+ if ($this->sendmode == 'mail')
{
fputs($fp, $this->headers);
fputs($fp, $this->eol); // This eol is added by the mail function, so we add it in log
fputs($fp, $this->message);
}
- elseif ($conf->global->MAIN_MAIL_SENDMODE == 'smtps')
+ elseif ($this->sendmode == 'smtps')
{
fputs($fp, $this->smtps->log); // this->smtps->log is filled only if MAIN_MAIL_DEBUG was set to on
}
- elseif ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer')
- {
- fputs($fp, $this->logger->dump()); // this->logger is filled only if MAIN_MAIL_DEBUG was set to on
- }
+ elseif ($this->sendmode == 'swiftmailer')
+ {
+ fputs($fp, $this->logger->dump()); // this->logger is filled only if MAIN_MAIL_DEBUG was set to on
+ }
fclose($fp);
if (! empty($conf->global->MAIN_UMASK))
- @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
+ @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
}
}
- /**
- * Correct an uncomplete html string
- *
- * @param string $msg String
- * @return string Completed string
- */
- function checkIfHTML($msg)
- {
- if (!preg_match('/^[\s\t]* ";
- if (!empty($this->styleCSS)) $out.= $this->styleCSS;
- $out.= "bodyCSS)) $out.= $this->bodyCSS;
- $out.= ">";
- $out.= $msg;
- $out.= "";
- }
- else
- {
- $out = $msg;
- }
+ /**
+ * Correct an uncomplete html string
+ *
+ * @param string $msg String
+ * @return string Completed string
+ */
+ function checkIfHTML($msg)
+ {
+ if (!preg_match('/^[\s\t]* ";
+ if (!empty($this->styleCSS)) $out.= $this->styleCSS;
+ $out.= "bodyCSS)) $out.= $this->bodyCSS;
+ $out.= ">";
+ $out.= $msg;
+ $out.= "";
+ }
+ else
+ {
+ $out = $msg;
+ }
- return $out;
- }
+ return $out;
+ }
- /**
- * Build a css style (mode = all) into this->styleCSS and this->bodyCSS
- *
- * @return css
- */
- function buildCSS()
- {
- if (! empty($this->css))
- {
- // Style CSS
- $this->styleCSS = '';
- }
- }
+ if ($this->css['bgcolor'])
+ {
+ $this->styleCSS.= ' background-color: '.$this->css['bgcolor'].';';
+ $this->bodyCSS.= ' bgcolor="'.$this->css['bgcolor'].'"';
+ }
+ if ($this->css['bgimage'])
+ {
+ // TODO recuperer cid
+ $this->styleCSS.= ' background-image: url("cid:'.$this->css['bgimage_cid'].'");';
+ }
+ $this->styleCSS.= '}';
+ $this->styleCSS.= '';
+ }
+ }
/**
@@ -973,40 +989,56 @@ class CMailFile
$out.= "--" . $this->alternative_boundary . $this->eol;
}
- if ($this->msgishtml)
- {
- // Check if html header already in message
- $strContent = $this->checkIfHTML($msgtext);
- }
- else
- {
- $strContent = $msgtext;
- }
-
// Make RFC821 Compliant, replace bare linefeeds
- $strContent = preg_replace("/(?global->MAIN_FIX_FOR_BUGGED_MTA))
{
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
}
+ $strContentAltText = '';
+ if ($this->msgishtml)
+ {
+ $strContentAltText = html_entity_decode(strip_tags($strContent));
+ $strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n"));
+
+ // Check if html header already in message, if not complete the message
+ $strContent = $this->checkIfHTML($strContent);
+ }
+
// Make RFC2045 Compliant, split lines
- //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
- $strContent = rtrim(wordwrap($strContent)); // TODO Using this method creates unexpected line break on text/plain content.
+ //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
+ $strContent = rtrim(wordwrap($strContent)); // TODO Using this method creates unexpected line break on text/plain content.
if ($this->msgishtml)
{
if ($this->atleastoneimage)
{
$out.= "Content-Type: text/plain; charset=".$conf->file->character_set_client.$this->eol;
- $out.= $this->eol.strip_tags($strContent).$this->eol; // Add plain text message
+ $out.= $this->eol.($strContentAltText?$strContentAltText:strip_tags($strContent)).$this->eol; // Add plain text message
$out.= "--" . $this->alternative_boundary . $this->eol;
$out.= "Content-Type: multipart/related; boundary=\"".$this->related_boundary."\"".$this->eol;
$out.= $this->eol;
$out.= "--" . $this->related_boundary . $this->eol;
}
+
+ if (! $this->atleastoneimage && $strContentAltText && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part
+ {
+ $out.= "Content-Type: multipart/alternative; boundary=\"".$this->alternative_boundary."\"".$this->eol;
+ $out.= $this->eol;
+ $out.= "--" . $this->alternative_boundary . $this->eol;
+ $out.= "Content-Type: text/plain; charset=".$conf->file->character_set_client.$this->eol;
+ $out.= $this->eol.$strContentAltText.$this->eol;
+ $out.= "--" . $this->alternative_boundary . $this->eol;
+ }
+
$out.= "Content-Type: text/html; charset=".$conf->file->character_set_client.$this->eol;
$out.= $this->eol.$strContent.$this->eol;
+
+ if (! $this->atleastoneimage && $strContentAltText && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part after html part
+ {
+ $out.= "--" . $this->alternative_boundary . "--". $this->eol;
+ }
}
else
{
@@ -1016,6 +1048,16 @@ class CMailFile
$out.= $this->eol;
+ // Encode images
+ if ($this->atleastoneimage)
+ {
+ $out .= $this->write_images($this->images_encoded);
+ // always end related and end alternative after inline images
+ $out .= "--" . $this->related_boundary . "--" . $this->eol;
+ $out .= $this->eol . "--" . $this->alternative_boundary . "--" . $this->eol;
+ $out .= $this->eol;
+ }
+
return $out;
}
@@ -1041,10 +1083,12 @@ class CMailFile
if ($encoded >= 0)
{
if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i];
- if (! $mimetype_list[$i]) { $mimetype_list[$i] = "application/octet-stream"; }
+ if (! $mimetype_list[$i]) {
+ $mimetype_list[$i] = "application/octet-stream";
+ }
$out.= "--" . $this->mixed_boundary . $this->eol;
- $out.= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol;
+ $out.= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol;
$out.= "Content-Type: " . $mimetype_list[$i] . "; name=\"".$filename_list[$i]."\"".$this->eol;
$out.= "Content-Transfer-Encoding: base64".$this->eol;
$out.= "Content-Description: File Attachment".$this->eol;
@@ -1104,25 +1148,25 @@ class CMailFile
*/
function check_server_port($host,$port)
{
- global $conf;
+ global $conf;
$_retVal=0;
$timeout=5; // Timeout in seconds
if (function_exists('fsockopen'))
{
- // If we use SSL/TLS
- if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $host='ssl://'.$host;
- // tls smtp start with no encryption
- //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host;
+ // If we use SSL/TLS
+ if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $host='ssl://'.$host;
+ // tls smtp start with no encryption
+ //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host;
dol_syslog("Try socket connection to host=".$host." port=".$port);
//See if we can connect to the SMTP server
if ($socket = @fsockopen(
- $host, // Host to test, IP or domain. Add ssl:// for SSL/TLS.
- $port, // which Port number to use
- $errno, // actual system level error
- $errstr, // and any text that goes with the error
- $timeout
+ $host, // Host to test, IP or domain. Add ssl:// for SSL/TLS.
+ $port, // which Port number to use
+ $errno, // actual system level error
+ $errstr, // and any text that goes with the error
+ $timeout
)) // timeout for reading/writing data over the socket
{
// Windows still does not have support for this timeout function
@@ -1184,14 +1228,15 @@ class CMailFile
$extensions = array_keys($this->image_types);
- preg_match_all('/(?:"|\')([^"\']+\.('.implode('|', $extensions).'))(?:"|\')/Ui', $this->html, $matches);
+ preg_match_all('/(?:"|\')([^"\']+\.('.implode('|', $extensions).'))(?:"|\')/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found
if ($matches)
{
$i=0;
foreach ($matches[1] as $full)
{
- if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i',$full,$regs))
+
+ if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i',$full,$regs)) // If xxx is 'file=aaa'
{
$img = $regs[1];
@@ -1272,7 +1317,7 @@ class CMailFile
* @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com'
* @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between "
* @param int $encode 0=No encode name, 1=Encode name to RFC2822
- * @param int $maxnumberofemail 0=No limit. Otherwise, maximum number of emails returned ($address may contains several email separated with ','). Add '...' if there is more.
+ * @param int $maxnumberofemail 0=No limit. Otherwise, maximum number of emails returned ($address may contains several email separated with ','). Add '...' if there is more.
* @return string If format 0: '' or 'John Doe ' or '=?UTF-8?B?Sm9obiBEb2U=?= '
* If format 1: ''
* If format 2: 'john@doe.com'
@@ -1304,12 +1349,12 @@ class CMailFile
if ($email)
{
- $i++;
-
+ $i++;
+
$newemail='';
if ($format == 4)
{
- $newemail = $name?$name:$email;
+ $newemail = $name?$name:$email;
}
if ($format == 2)
{
@@ -1327,12 +1372,12 @@ class CMailFile
}
$ret=($ret ? $ret.',' : '').$newemail;
-
+
// Stop if we have too much records
if ($maxnumberofemail && $i >= $maxnumberofemail)
{
- if (count($arrayaddress) > $maxnumberofemail) $ret.='...';
- break;
+ if (count($arrayaddress) > $maxnumberofemail) $ret.='...';
+ break;
}
}
}
@@ -1340,38 +1385,38 @@ class CMailFile
return $ret;
}
- /**
- * Return a formatted array of address string for SMTP protocol
- *
- * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com'
- * @return array array of email => name
- */
- function getArrayAddress($address)
- {
- global $conf;
+ /**
+ * Return a formatted array of address string for SMTP protocol
+ *
+ * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com'
+ * @return array array of email => name
+ */
+ function getArrayAddress($address)
+ {
+ global $conf;
- $ret=array();
+ $ret=array();
- $arrayaddress=explode(',',$address);
+ $arrayaddress=explode(',',$address);
- // Boucle sur chaque composant de l'adresse
- foreach($arrayaddress as $val)
- {
- if (preg_match('/^(.*)<(.*)>$/i',trim($val),$regs))
- {
- $name = trim($regs[1]);
- $email = trim($regs[2]);
- }
- else
- {
- $name = null;
- $email = trim($val);
- }
+ // Boucle sur chaque composant de l'adresse
+ foreach($arrayaddress as $val)
+ {
+ if (preg_match('/^(.*)<(.*)>$/i',trim($val),$regs))
+ {
+ $name = trim($regs[1]);
+ $email = trim($regs[2]);
+ }
+ else
+ {
+ $name = null;
+ $email = trim($val);
+ }
- $ret[$email]=empty($conf->global->MAIN_MAIL_NO_FULL_EMAIL)?$name:null;
- }
+ $ret[$email]=empty($conf->global->MAIN_MAIL_NO_FULL_EMAIL)?$name:null;
+ }
- return $ret;
- }
+ return $ret;
+ }
}
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index ac7bb3175fb..3e9d56f8f8c 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -307,7 +307,7 @@ abstract class CommonInvoice extends CommonObject
*
* @param int $paye Status field paye
* @param int $status Id status
- * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @param int $type Type invoice
* @return string Libelle du statut
@@ -408,9 +408,10 @@ abstract class CommonInvoice extends CommonObject
else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('BillStatusPaid');
}
}
- if ($mode == 5)
+ if ($mode == 5 || $mode == 6)
{
- $prefix='Short';
+ $prefix='';
+ if ($mode == 5) $prefix='Short';
if (! $paye)
{
if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index b79c72e6336..e03db1b4773 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -42,50 +42,59 @@ abstract class CommonObject
* @var DoliDb Database handler (result of a new DoliDB)
*/
public $db;
-
/**
* @var int The object identifier
*/
public $id;
-
/**
* @var string Error string
* @deprecated Use instead the array of error strings
* @see errors
*/
public $error;
-
/**
* @var string[] Array of error strings
*/
public $errors=array();
-
+ /**
+ * @var string
+ */
+ public $element;
+ /**
+ * @var string
+ */
+ public $table_element;
+ /**
+ * @var
+ */
+ public $table_element_line;
/**
* @var string Key value used to track if data is coming from import wizard
*/
public $import_key;
-
/**
* @var mixed Contains data to manage extrafields
*/
public $array_options=array();
-
/**
* @var int[] Array of linked objects ids. Loaded by ->fetchObjectLinked
*/
public $linkedObjectsIds;
-
/**
* @var mixed Array of linked objects. Loaded by ->fetchObjectLinked
*/
public $linkedObjects;
-
+ /**
+ * @var Object To store a cloned copy of object before to edit it and keep track of old properties
+ */
+ public $oldcopy;
+
/**
* @var string Column name of the ref field.
*/
protected $table_ref_field = '';
-
+
// Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.
@@ -166,19 +175,6 @@ abstract class CommonObject
*/
public $ref_ext;
- /**
- * @var string
- */
- public $element;
- /**
- * @var string
- */
- public $table_element;
- /**
- * @var
- */
- public $table_element_line;
-
/**
* @var int The object's status
* @see setStatut()
@@ -332,8 +328,10 @@ abstract class CommonObject
public $firstname;
public $civility_id;
+
// No constructor as it is an abstract class
+
/**
* Check an object id/ref exists
* If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch
@@ -495,7 +493,7 @@ abstract class CommonObject
$out.=dol_print_phone($this->phone_pro,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++;
}
if (! empty($this->phone_mobile)) {
- $out.=dol_print_phone($this->phone_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++;
+ $out.=dol_print_phone($this->phone_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','mobile',$langs->trans("PhoneMobile")); $outdone++;
}
if (! empty($this->phone_perso)) {
$out.=dol_print_phone($this->phone_perso,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePerso")); $outdone++;
@@ -507,7 +505,7 @@ abstract class CommonObject
$out.=dol_print_phone($this->office_phone,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++;
}
if (! empty($this->user_mobile)) {
- $out.=dol_print_phone($this->user_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++;
+ $out.=dol_print_phone($this->user_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','mobile',$langs->trans("PhoneMobile")); $outdone++;
}
if (! empty($this->office_fax)) {
$out.=dol_print_phone($this->fax,$this->country_code,$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++;
@@ -781,7 +779,7 @@ abstract class CommonObject
$tab=array();
$sql = "SELECT ec.rowid, ec.statut as statuslink, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user
- if ($source == 'internal') $sql.=", '-1' as socid, t.statut as statuscontact";
+ if ($source == 'internal') $sql.=", '-1' as socid, t.statut as statuscontact, t.login, t.photo";
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid, t.statut as statuscontact";
$sql.= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email";
$sql.= ", tc.source, tc.element, tc.code, tc.libelle";
@@ -815,7 +813,7 @@ abstract class CommonObject
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,
'nom'=>$obj->lastname, // For backward compatibility
- 'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'statuscontact'=>$obj->statuscontact,
+ 'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'login'=>$obj->login, 'photo'=>$obj->photo, 'statuscontact'=>$obj->statuscontact,
'rowid'=>$obj->rowid, 'code'=>$obj->code, 'libelle'=>$libelle_type, 'status'=>$obj->statuslink, 'fk_c_type_contact'=>$obj->fk_c_type_contact);
}
else
@@ -3164,8 +3162,16 @@ abstract class CommonObject
$resql = $this->db->query($sql);
if ($resql)
{
- $res = $this->db->fetch_object($resql);
- return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
+ $num = $this->db->num_rows($resql);
+ if ($num > 0)
+ {
+ $res = $this->db->fetch_object($resql);
+ return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
+ }
+ else
+ {
+ return '';
+ }
}
else
{
@@ -3422,7 +3428,7 @@ abstract class CommonObject
//Line extrafield
$line->fetch_optionals($line->id,$extralabelslines);
- $var=!$var;
+
//if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
if (is_object($hookmanager)) // Old code is commented on preceding line.
@@ -3603,7 +3609,7 @@ abstract class CommonObject
foreach ($this->lines as $line)
{
- $var=!$var;
+
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
{
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 1692b58c5f9..9446020e3ff 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -128,11 +128,7 @@ class Conf
dol_syslog(get_class($this)."::setValues");
- /*
- * Definition de toutes les constantes globales d'environnement
- * - En constante php (TODO a virer)
- * - En $this->global->key=value
- */
+ //Define all global constants into $this->global->key=value
$sql = "SELECT ".$db->decrypt('name')." as name,";
$sql.= " ".$db->decrypt('value')." as value, entity";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
@@ -158,7 +154,7 @@ class Conf
$value=$objp->value;
if ($key)
{
- if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install)
+ //if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install)
$this->global->$key=$value;
if ($value && preg_match('/^MAIN_MODULE_/',$key))
@@ -207,7 +203,7 @@ class Conf
$db->free($resql);
}
- // Include other local consts.php files and fetch their values to the corresponding database constants
+ // Include other local consts.php files and fetch their values to the corresponding database constants.
if (! empty($this->global->LOCAL_CONSTS_FILES)) {
$filesList = explode(":", $this->global->LOCAL_CONSTS_FILES);
foreach ($filesList as $file) {
@@ -333,13 +329,12 @@ class Conf
$this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp";
- // Exception: Some dir are not the name of module. So we keep exception here
- // for backward compatibility.
+ // Exception: Some dir are not the name of module. So we keep exception here for backward compatibility.
// Sous module bons d'expedition
- $this->expedition_bon->enabled= defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
+ $this->expedition_bon->enabled=$this->global->MAIN_SUBMODULE_EXPEDITION?$this->global->MAIN_SUBMODULE_EXPEDITION:0;
// Sous module bons de livraison
- $this->livraison_bon->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0;
+ $this->livraison_bon->enabled=$this->global->MAIN_SUBMODULE_LIVRAISON?$this->global->MAIN_SUBMODULE_LIVRAISON:0;
// Module fournisseur
if (! empty($this->fournisseur))
@@ -390,7 +385,8 @@ class Conf
// Set some default values
$this->global->MAIN_ACTIVATE_HTML5=1;
-
+ $this->global->MAIN_MAIL_USE_MULTI_PART=1;
+
// societe
if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
@@ -598,8 +594,8 @@ class Conf
}
// We init log handlers
- if (defined('SYSLOG_HANDLERS')) {
- $handlers = json_decode(constant('SYSLOG_HANDLERS'));
+ if (! empty($this->global->SYSLOG_HANDLERS)) {
+ $handlers = json_decode($this->global->SYSLOG_HANDLERS);
} else {
$handlers = array();
}
@@ -631,6 +627,7 @@ class Conf
$this->loghandlers[$handler] = $loghandlerinstance;
}
}
+
}
}
diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php
index 869b26e2f75..99f3c14f15c 100644
--- a/htdocs/core/class/dolprintipp.class.php
+++ b/htdocs/core/class/dolprintipp.class.php
@@ -116,8 +116,8 @@ class dolprintIPP
{
foreach ($jobs as $value)
{
- $var=!$var;
- print "";
+
+ print ' ';
print ''.$value->job_id->_value0.' ';
print ''.$value->job_originating_user_name->_value0.' ';
print ''.$value->printer_uri->_value0.' ';
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 24023eb4d89..f86f786e0fb 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -112,7 +112,7 @@ class ExtraFields
*
* @param string $attrname Code of attribute
* @param string $label label of attribute
- * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour')
+ * @param int $type Type of attribute ('boolean', 'int', 'text', 'varchar', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...)
* @param int $pos Position of attribute
* @param string $size Size/length of attribute
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
@@ -164,7 +164,7 @@ class ExtraFields
* This is a private method. For public method, use addExtraField.
*
* @param string $attrname code of attribute
- * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour')
+ * @param int $type Type of attribute ('boolean', 'int', 'text', 'varchar', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...)
* @param string $length Size/length of attribute ('5', '24,8', ...)
* @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...)
* @param int $unique Is field unique or not
@@ -641,7 +641,6 @@ class ExtraFields
if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'";
$sql.= " ORDER BY pos";
- dol_syslog(get_class($this)."::fetch_name_optionals_label", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@@ -728,6 +727,10 @@ class ExtraFields
{
$showsize='minwidth400imp';
}
+ elseif ($type == 'boolean')
+ {
+ $showsize='';
+ }
else
{
if (round($size) < 12)
@@ -993,23 +996,12 @@ class ExtraFields
}
elseif ($type == 'checkbox')
{
- $out='';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
+ $form = new Form($db);
+
$value_arr=explode(',',$value);
+ $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, $param['options'], $value_arr, '', 0, '', 0, '100%');
- foreach ($param['options'] as $keyopt=>$val )
- {
-
- $out.=' '.$val.' ';
- }
}
elseif ($type == 'radio')
{
@@ -1101,6 +1093,9 @@ class ExtraFields
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
+
+ $data=array();
+
while ( $i < $num ) {
$labeltoshow = '';
$obj = $this->db->fetch_object($resql);
@@ -1126,12 +1121,9 @@ class ExtraFields
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
}
}
- $out .= ' rowid . '"';
-
- $out .= 'checked';
-
- $out .= '/>' . $labeltoshow . ' ';
+
+ $data[$obj->rowid]=$labeltoshow;
+
} else {
if (! $notrans) {
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -1145,32 +1137,25 @@ class ExtraFields
$labeltoshow = '(not defined)';
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
- $out .= ' rowid . '"';
-
- $out .= 'checked';
- $out .= '';
-
- $out .= '/>' . $labeltoshow . ' ';
+ $data[$obj->rowid]=$labeltoshow;
}
if (! empty($InfoFieldList[3])) {
$parent = $parentName . ':' . $obj->{$parentField};
}
- $out .= ' rowid . '"';
-
- $out .= ((is_array($value_arr) && in_array($obj->rowid, $value_arr)) ? ' checked ' : '');
- ;
- $out .= '';
-
- $out .= '/>' . $labeltoshow . ' ';
+ $data[$obj->rowid]=$labeltoshow;
}
-
+
$i ++;
}
$this->db->free($resql);
+
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
+ $form = new Form($db);
+
+ $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, $data, $value_arr, '', 0, '', 0, '100%');
+
} else {
print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters. ';
}
@@ -1381,9 +1366,10 @@ class ExtraFields
if (is_array($value_arr))
{
foreach ($value_arr as $keyval=>$valueval) {
- $value.=$params['options'][$valueval].' ';
+ $toprint[]=''.$params['options'][$valueval].' ';
}
}
+ $value=''.implode(' ', $toprint).' ';
}
elseif ($type == 'chkbxlst')
{
@@ -1418,7 +1404,7 @@ class ExtraFields
$resql = $this->db->query($sql);
if ($resql) {
$value = ''; // value was used, so now we reste it to use it to build final output
-
+ $toprint=array();
while ( $obj = $this->db->fetch_object($resql) ) {
// Several field into label (eq table:code|libelle:rowid)
@@ -1431,9 +1417,9 @@ class ExtraFields
$translabel = $langs->trans($obj->$field_toshow);
}
if ($translabel != $field_toshow) {
- $value .= dol_trunc($translabel, 18) . ' ';
+ $toprint[]=''.dol_trunc($translabel, 18).' ';
} else {
- $value .= $obj->$field_toshow . ' ';
+ $toprint[]=''.$obj->$field_toshow.' ';
}
}
} else {
@@ -1442,15 +1428,18 @@ class ExtraFields
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
}
if ($translabel != $obj->{$InfoFieldList[1]}) {
- $value .= dol_trunc($translabel, 18) . ' ';
+ $toprint[]=''.dol_trunc($translabel, 18).' ';
} else {
- $value .= $obj->{$InfoFieldList[1]} . ' ';
+ $toprint[]=''.$obj->{$InfoFieldList[1]}.' ';
}
}
}
}
- } else
+ $value=''.implode(' ', $toprint).' ';
+
+ } else {
dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
+ }
}
elseif ($type == 'link')
{
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index a4d84f008db..590f8060296 100644
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -126,7 +126,7 @@ class HookManager
if (! is_array($this->hooks) || empty($this->hooks)) return '';
$parameters['context']=join(':',$this->contextarray);
- dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);
+ //dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
$hooktype='output';
@@ -202,6 +202,9 @@ class HookManager
// test to avoid running twice a hook, when a module implements several active contexts
if (in_array($module,$modulealreadyexecuted)) continue;
+
+ dol_syslog(get_class($this).'::executeHooks a qualified hook was found for method='.$method.' module='.$module." action=".$action." context=".$context);
+
$modulealreadyexecuted[$module]=$module; // Use the $currentcontext in method to avoid running twice
// Clean class (an error may have been set from a previous call of another method for same module/hook)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 271f87ab4a0..3275ee0f303 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -219,10 +219,10 @@ class Form
if (empty($notabletag)) $ret.='';
if (empty($notabletag)) $ret.='';
- else $ret.='
';
- $ret.=' ';
+ //else $ret.='
';
+ $ret.=' ';
if (preg_match('/ckeditor|textarea/',$typeofdata) && empty($notabletag)) $ret.=' '."\n";
- $ret.=' ';
+ $ret.=' ';
if (empty($notabletag)) $ret.=' ';
if (empty($notabletag)) $ret.='
'."\n";
@@ -404,7 +404,7 @@ class Form
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
* @param string $incbefore Include code before the text
* @param int $noencodehtmltext Do not encode into html entity the htmltext
- * @param int $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
+ * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
* @return string Code html du tooltip (texte+picto)
* @see Use function textwithpicto if you can.
* TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip
@@ -487,7 +487,7 @@ class Form
* @param string $extracss Add a CSS style to td, div or span tag
* @param int $noencodehtmltext Do not encode into html entity the htmltext
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
- * @param int $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
+ * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
* @return string HTML code of text, picto, tooltip
*/
function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger='')
@@ -951,36 +951,40 @@ class Form
/**
* Output html form to select a third party
*
- * @param string $selected Preselected type
- * @param string $htmlname Name of field in form
- * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)')
- * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
- * @param int $showtype Show third party type in combolist (customer, prospect or supplier)
- * @param int $forcecombo Force to use combo box
- * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
- * @param int $limit Maximum number of elements
- * @param string $morecss Add more css styles to the SELECT component
- * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
- * @return string HTML string with select box for thirdparty.
+ * @param string $selected Preselected type
+ * @param string $htmlname Name of field in form
+ * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)')
+ * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
+ * @param int $showtype Show third party type in combolist (customer, prospect or supplier)
+ * @param int $forcecombo Force to use combo box
+ * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
+ * @param int $limit Maximum number of elements
+ * @param string $morecss Add more css styles to the SELECT component
+ * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
+ * @param string $selected_input_value Value of preselected input text (for use with ajax)
+ * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
+ * @param array $ajaxoptions Options for ajax_autocompleter
+ * @return string HTML string with select box for thirdparty.
*/
- function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='')
+ function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array())
{
+ global $conf,$user,$langs;
+
$out='';
- /* TODO Use ajax_autocompleter like for products (not finished)
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{
$placeholder='';
-
if ($selected && empty($selected_input_value))
{
- require_once DOL_DOCUMENT_ROOT.'/societe/ajaxcompanies.php';
- $societe = new Societe($this->db);
- $societe->fetch($selected);
- $selected_input_value=$societe->ref;
+ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+ $societetmp = new Societe($this->db);
+ $societetmp->fetch($selected);
+ $selected_input_value=$societetmp->name;
+ unset($societetmp);
}
- // mode=1 means customers products
- $urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished;
+ // mode 1
+ $urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
else if ($hidelabel > 1) {
@@ -990,15 +994,15 @@ class Form
print img_picto($langs->trans("Search"), 'search');
}
}
- print ' ';
+ print ' global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
if ($hidelabel == 3) {
print img_picto($langs->trans("Search"), 'search');
}
}
else
- {*/
+ {
$out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam);
- //}
+ }
return $out;
}
@@ -1024,7 +1028,8 @@ class Form
{
global $conf,$user,$langs;
- $out=''; $num=0;
+ $out='';
+ $num=0;
$outarray=array();
// On recherche les societes
@@ -1040,19 +1045,18 @@ class Form
if ($filterkey && $filterkey != '')
{
$sql.=" AND (";
- if (! empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) // Can use index
- {
- $sql.="(s.name LIKE '".$this->db->escape($filterkey)."%')";
+ $prefix=empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)?'%':''; // Can use index if COMPANY_DONOTSEARCH_ANYWHERE is on
+ // For natural search
+ $scrit = explode(' ', $filterkey);
+ $i=0;
+ if (count($scrit) > 1) $sql.="(";
+ foreach ($scrit as $crit) {
+ if ($i > 0) $sql.=" AND ";
+ $sql.="(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
+ $i++;
}
- else
- {
- // For natural search
- $scrit = explode(' ', $filterkey);
- foreach ($scrit as $crit) {
- $sql.=" AND (s.name LIKE '%".$this->db->escape($crit)."%')";
- }
- }
- if (! empty($conf->barcode->enabled))
+ if (count($scrit) > 1) $sql.=")";
+ if (! empty($conf->barcode->enabled))
{
$sql .= " OR s.barcode LIKE '".$this->db->escape($filterkey)."%'";
}
@@ -1061,10 +1065,13 @@ class Form
$sql.=$this->db->order("nom","ASC");
if ($limit > 0) $sql.=$this->db->plimit($limit);
+ // Build output string
dol_syslog(get_class($this)."::select_thirdparty_list", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
+ $events = null;
+
if ($conf->use_javascript_ajax && ! $forcecombo)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
@@ -1085,7 +1092,7 @@ class Form
}
if ($showempty) $out.= ''.$textifempty.' '."\n";
- $num = $this->db->num_rows($resql);
+ $num = $this->db->num_rows($resql);
$i = 0;
if ($num)
{
@@ -1128,7 +1135,7 @@ class Form
$out.= ''.$label.' ';
}
- array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->rowid, 'label'=>$label));
+ array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label));
$i++;
if (($i % 10) == 0) $out.="\n";
@@ -1634,7 +1641,7 @@ class Form
{
if ($value['id'] == $ownerid) continue;
$userstatic->fetch($value['id']);
- $out.=$userstatic->getNomUrl(1);
+ $out.=$userstatic->getNomUrl(-1);
if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; }
if ($nbassignetouser > 1 && $action != 'view') $out.=' ';
//$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional"));
@@ -3370,11 +3377,14 @@ class Form
print ' ';
print ' ';
} else {
+
+ $langs->load('banks');
+
if ($selected) {
require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
$bankstatic=new Account($this->db);
$bankstatic->fetch($selected);
- print $this->textwithpicto($bankstatic->label,$langs->trans("AccountCurrency").' '.$bankstatic->currency_code);
+ print $this->textwithpicto($bankstatic->getNomUrl(1),$langs->trans("AccountCurrency").' '.$bankstatic->currency_code);
} else {
print " ";
}
@@ -3395,7 +3405,7 @@ class Form
*/
function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0)
{
- global $langs;
+ global $conf, $langs;
$langs->load("categories");
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -3406,9 +3416,35 @@ class Form
dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
}
- $cat = new Categorie($this->db);
- $cate_arbo = $cat->get_full_arbo($type,$excludeafterid);
-
+ if ($type === Categorie::TYPE_BANK_LINE)
+ {
+ // TODO Move this into common category feature
+ $categids=array();
+ $sql = "SELECT c.label, c.rowid";
+ $sql.= " FROM ".MAIN_DB_PREFIX."bank_categ as c";
+ $sql.= " WHERE entity = ".$conf->entity;
+ $sql.= " ORDER BY c.label";
+ $result = $this->db->query($sql);
+ if ($result)
+ {
+ $num = $this->db->num_rows($result);
+ $i = 0;
+ while ($i < $num)
+ {
+ $objp = $this->db->fetch_object($result);
+ if ($objp) $cate_arbo[$objp->rowid]=array('id'=>$objp->rowid, 'fulllabel'=>$objp->label);
+ $i++;
+ }
+ $this->db->free($result);
+ }
+ else dol_print_error($this->db);
+ }
+ else
+ {
+ $cat = new Categorie($this->db);
+ $cate_arbo = $cat->get_full_arbo($type,$excludeafterid);
+ }
+
$output = '';
$outarray=array();
if (is_array($cate_arbo))
@@ -4920,7 +4956,7 @@ class Form
}
elseif ($typehour=='text' || $typehour=='textselect')
{
- $retstring.=' ';
+ $retstring.=' ';
}
else return 'BadValueForParameterTypeHour';
@@ -4944,7 +4980,7 @@ class Form
}
elseif ($typehour=='text' )
{
- $retstring.=' ';
+ $retstring.=' ';
}
if ($typehour!='text') $retstring.=' '.$langs->trans('MinuteShort');
@@ -5087,7 +5123,7 @@ class Form
* @param string $morecss Add more class to css styles
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
* @param string $placeholder String to use as placeholder
- * @param integer $acceptdelayedhtml 1 if caller request to have html delayed content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
+ * @param integer $acceptdelayedhtml 1 if caller request to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
* @return string HTML select string
*/
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0)
@@ -5282,7 +5318,7 @@ class Form
*/
static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
{
- global $conf,$user;
+ global $conf,$langs,$user;
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
@@ -5315,7 +5351,7 @@ class Form
}
if ($val['label'])
{
- $lis.=' '.dol_escape_htmltag($val['label']).' ';
+ $lis.=' '.dol_escape_htmltag($langs->trans($val['label'])).' ';
$listcheckedstring.=(empty($val['checked'])?'':$key.',');
}
}
@@ -5547,20 +5583,27 @@ class Form
if (! is_object($object->thirdparty)) $object->fetch_thirdparty();
- $possiblelinks=array(
- 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
- 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
- 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.facnumber as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
- 'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
- 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
- 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
- 'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
- 'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id)
- );
-
+ $possiblelinks=array();
+ if (is_object($object->thirdparty) && ! empty($object->thirdparty->id) && $object->thirdparty->id > 0)
+ {
+ $listofidcompanytoscan=$object->thirdparty->id;
+ if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent;
+
+ $possiblelinks=array(
+ 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal',1).')'),
+ 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande',1).')'),
+ 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.facnumber as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture',1).')'),
+ 'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract',1).')'),
+ 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention',1).')'),
+ 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal',1).')'),
+ 'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur',1).')'),
+ 'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn',1).')')
+ );
+ }
+
global $action;
- // Can complet the possiblelink array
+ // Can complete the possiblelink array
$hookmanager->initHooks(array('commonobject'));
$parameters=array();
$reshook=$hookmanager->executeHooks('showLinkToObjectBlock',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@@ -6188,7 +6231,7 @@ class Form
global $conf, $langs;
$out='';
- if (! empty($conf->use_javascript_ajax)) $out.=' ';
+ if (! empty($conf->use_javascript_ajax)) $out.='
';
$out.='
-
+
@@ -76,29 +76,28 @@ $(document).ready(function () {
-
-
+
+
+
-
-
-
">
@@ -156,14 +155,11 @@ if (! empty($hookmanager->resArray['options'])) {
-
+
+
-
-
-
-
@@ -222,9 +218,10 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
?>
-
+
+
+
-
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 83725580db5..d02f820d0d5 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -56,9 +56,11 @@ if (in_array($object->element,array('propal', 'supplier_proposal','facture','fac
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
if ($nolinesbefore) {
?>
-
-
- global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
+
+ global->MAIN_VIEW_LINE_NUMBER)) { ?>
+
+
+
trans('AddNewLine'); ?> trans("FreeZone"); ?>
element == 'supplier_proposal') { ?>
@@ -112,15 +114,20 @@ if ($nolinesbefore) {
-
+
global->MAIN_VIEW_LINE_NUMBER)) {
- $coldisplay=2; }
+ $coldisplay=2;
+ ?>
+
+
- global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
+
global->MAIN_VIEW_LINE_NUMBER)) { ?>
-
+
info_bits & 2) == 2) {
?>
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php
index b641627b789..bdc38b08873 100644
--- a/htdocs/core/tpl/passwordforgotten.tpl.php
+++ b/htdocs/core/tpl/passwordforgotten.tpl.php
@@ -32,7 +32,7 @@ print top_htmlhead('',$langs->trans('SendNewPassword'));
?>
-
+global->MAIN_LOGIN_BACKGROUND)?'':' style="background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
dol_use_jmobile)) { ?>
'."\n";
+ if (defined('JS_JQUERY') && constant('JS_JQUERY')) print ''."\n";
else print ''."\n";
- if (constant('JS_JQUERY_UI')) print ''."\n";
+ if (! empty($conf->global->MAIN_FEATURES_LEVEL))
+ {
+ if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) print ''."\n";
+ else print ''."\n";
+ }
+ if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) print ''."\n";
else print ''."\n";
if (! defined('DISABLE_JQUERY_TABLEDND')) print ''."\n";
if (! defined('DISABLE_JQUERY_TIPTIP')) print ''."\n";
@@ -1377,8 +1381,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$menumanager->showmenu('top', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // This contains a \n
print "\n";
- //$form=new Form($db);
-
// Define link to login card
$appli=constant('DOL_APPLICATION_TITLE');
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
@@ -1403,7 +1405,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$logouthtmltext.=$langs->trans("Logout").' ';
$logouttext .='';
- $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
+ //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
+ $logouttext .=' ';
$logouttext .=' ';
}
else
@@ -1427,6 +1430,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$toprightmenu.='';
$toprightmenu.='';
+
// Execute hook printTopRightMenu (hooks should output string like '
')
$parameters=array();
$result=$hookmanager->executeHooks('printTopRightMenu',$parameters); // Note that $action and $object may have been modified by some hooks
@@ -1437,7 +1441,17 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
}
else $toprightmenu.=$result; // For backward compatibility
- // Link to print main content area
+ // Link to module builder
+ if (! empty($conf->modulebuilder->enabled))
+ {
+ $text ='
';
+ //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
+ $text.=' ';
+ $text.=' ';
+ $toprightmenu.=@Form::textwithtooltip('',$langs->trans("ModuleBuilder"),2,1,$text,'login_block_elem',2);
+ }
+
+ // Link to print main content area
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && empty($conf->browser->phone))
{
$qs=$_SERVER["QUERY_STRING"];
@@ -1448,7 +1462,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
$text ='
';
- $text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
+ //$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
+ $text.=' ';
$text.=' ';
$toprightmenu.=@Form::textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2);
}
@@ -1481,7 +1496,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
if ($mode == 'wiki') $text.=sprintf($helpbaseurl,urlencode(html_entity_decode($helppage)));
else $text.=sprintf($helpbaseurl,$helppage);
$text.='">';
- $text.=img_picto('', 'helpdoc_top').' ';
+ //$text.=img_picto('', 'helpdoc_top').' ';
+ $text.='
';
//$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help');
//if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')';
$text.='';
@@ -1641,11 +1657,11 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
{
$doliurl='https://www.dolibarr.org';
//local communities
- if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.fr';
- if (preg_match('/es/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.es';
- if (preg_match('/de/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.de';
- if (preg_match('/it/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.it';
- if (preg_match('/gr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.gr';
+ if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.fr';
+ if (preg_match('/es/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.es';
+ if (preg_match('/de/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.de';
+ if (preg_match('/it/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.it';
+ if (preg_match('/gr/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.gr';
$appli=constant('DOL_APPLICATION_TITLE');
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
@@ -1676,7 +1692,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
$bugbaseurl.= '?title=';
$bugbaseurl.= urlencode("Bug: ");
$bugbaseurl.= '&body=';
- // FIXME: use .github/ISSUE_TEMPLATE.md to generate?
+ // TODO use .github/ISSUE_TEMPLATE.md to generate?
$bugbaseurl .= urlencode("# Bug\n");
$bugbaseurl .= urlencode("\n");
$bugbaseurl.= urlencode("## Environment\n");
@@ -1882,7 +1898,7 @@ if (! function_exists("llxFooter"))
if (! empty($delayedhtmlcontent)) print $delayedhtmlcontent;
- // TODO Move this in lib_head.js
+ // TODO Move this in lib_head.js.php
// Wrapper to show tooltips (html or onclick popup)
if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover))
@@ -1905,7 +1921,7 @@ if (! function_exists("llxFooter"))
}
// Wrapper to manage document_preview
- if (! empty($conf->use_javascript_ajax))
+ if (! empty($conf->use_javascript_ajax) && ($conf->browser->layout != 'phone'))
{
print "\n\n";
print '
+
+
diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php
index 099fb4f7d2b..1078e8bb94a 100644
--- a/htdocs/resource/document.php
+++ b/htdocs/resource/document.php
@@ -93,7 +93,7 @@ if ($object->id)
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index fbb75e021ff..a886dcf475b 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -39,6 +39,7 @@ if (! empty($conf->projet->enabled)) {
// Load traductions files requiredby by page
$langs->load("resource");
$langs->load("other");
+$langs->load("interventions");
/*
$sortorder = GETPOST('sortorder','alpha');
@@ -240,8 +241,10 @@ else
dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref, '&element='.$element, 0, '', '');
+ print '
';
+
print '
';
-
+
print '
';
// Type
@@ -311,6 +314,8 @@ else
print '
';
+ print '
';
+
dol_fiche_end();
}
}
diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php
index 2c97b68f7ed..559dbce4b06 100644
--- a/htdocs/resource/list.php
+++ b/htdocs/resource/list.php
@@ -194,25 +194,7 @@ $moreforfilter = '';
print '
';
print '
'."\n";
-print '';
-if (! empty($arrayfields['t.ref']['checked'])) print_liste_field_titre($arrayfields['t.ref']['label'],$_SERVER["PHP_SELF"],"t.ref","",$param,"",$sortfield,$sortorder);
-if (! empty($arrayfields['ty.label']['checked'])) print_liste_field_titre($arrayfields['ty.label']['label'],$_SERVER["PHP_SELF"],"t.code","",$param,"",$sortfield,$sortorder);
-// Extra fields
-if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
-{
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
-}
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
-print " \n";
-
-print '';
+print ' ';
if (! empty($arrayfields['t.ref']['checked']))
{
print '';
@@ -255,11 +237,30 @@ print $searchpitco;
print ' ';
print " \n";
+print '';
+if (! empty($arrayfields['t.ref']['checked'])) print_liste_field_titre($arrayfields['t.ref']['label'],$_SERVER["PHP_SELF"],"t.ref","",$param,"",$sortfield,$sortorder);
+if (! empty($arrayfields['ty.label']['checked'])) print_liste_field_titre($arrayfields['ty.label']['label'],$_SERVER["PHP_SELF"],"t.code","",$param,"",$sortfield,$sortorder);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ $align=$extrafields->getAlignFlag($key);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ }
+ }
+}
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
+print " \n";
+
+
if ($ret)
{
foreach ($object->lines as $resource)
{
- $var=!$var;
+
$style='';
if ($resource->id == GETPOST('lineid')) $style='style="background: orange;"';
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index 8e7fe40859b..517672d14ed 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -354,7 +354,7 @@ foreach ($dirsociete as $dirroot)
if ($modCodeTiers->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var = !$var;
- print ''."\n";
+ print ' '."\n";
print ''.$modCodeTiers->name.' '."\n";
print ''.$modCodeTiers->info($langs).' '."\n";
print ''.$modCodeTiers->getExample($langs).' '."\n";
@@ -431,7 +431,7 @@ foreach ($dirsociete as $dirroot)
$modCodeCompta = new $file;
$var = !$var;
- print ' ';
+ print ' ';
print ''.$modCodeCompta->name." \n";
print $modCodeCompta->info($langs);
print ' ';
@@ -534,7 +534,7 @@ foreach ($dirsociete as $dirroot)
if ($modulequalified)
{
$var = !$var;
- print ' ';
+ print ' ';
print $module->name;
print " \n";
if (method_exists($module,'info')) print $module->info($langs);
@@ -646,7 +646,7 @@ while ($i < $nbofloop)
{
$var = !$var;
- print ' ';
+ print ' ';
print ''.$profid[$i][0]." \n";
print $profid[$i][1];
print ' ';
@@ -722,8 +722,8 @@ print ''.$langs->trans("Value").' '."\n";
print ' '."\n";
// Utilisation formulaire Ajax sur choix societe
-$var=!$var;
-print "";
+
+print ' ';
print ''.$form->textwithpicto($langs->trans("DelaiedFullListToSelectCompany"),$langs->trans('UseSearchToSelectCompanyTooltip'),1).' ';
if (! $conf->use_javascript_ajax)
{
@@ -746,8 +746,8 @@ else
}
print ' ';
-$var=!$var;
-print "";
+
+print ' ';
print ''.$form->textwithpicto($langs->trans("DelaiedFullListToSelectContact"),$langs->trans('UseSearchToSelectContactTooltip'),1).' ';
if (! $conf->use_javascript_ajax)
{
@@ -771,8 +771,8 @@ else
print ' ';
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("AddRefInList").' ';
print '  ';
print '';
@@ -791,8 +791,8 @@ print ' ';
print ' ';
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("AskForPreferredShippingMethod").' ';
print '  ';
print '';
@@ -813,8 +813,8 @@ print ' ';
/*
// COMPANY_USE_SEARCH_TO_SELECT
-$var=!$var;
-print "";
+
+print ' ';
print ''.$langs->trans("HideClosedThirdpartyComboBox").' ';
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX))
{
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index 36fbe790bf3..32d13356654 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -58,7 +58,7 @@ if ($page == -1) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-if (! $sortfield) $sortfield='a.datep, a.id';
+if (! $sortfield) $sortfield='a.datep,a.id';
if (! $sortorder) $sortorder='DESC';
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@@ -83,7 +83,7 @@ if (empty($reshook))
}
// Purge search criteria
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
{
$actioncode='';
$search_agenda_label='';
@@ -180,17 +180,11 @@ if ($socid > 0)
print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
- // List of todo actions
- //show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);
-
- // List of done actions
- //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
-
// List of all actions
$filters=array();
$filters['search_agenda_label']=$search_agenda_label;
- // TODO Replace this with smae code then into listactions.php
+ // TODO Replace this with same code than into listactions.php
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder);
}
}
diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php
index d2a244f9444..32f57f73c25 100644
--- a/htdocs/societe/ajax/company.php
+++ b/htdocs/societe/ajax/company.php
@@ -18,8 +18,8 @@
*/
/**
- * \file htdocs/product/ajax/company.php
- * \brief File to return Ajax response on product list request
+ * \file htdocs/societe/ajax/company.php
+ * \brief File to return Ajax response on thirdparty list request
*/
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal
@@ -33,15 +33,11 @@ if (empty($_GET['keysearch']) && ! defined('NOREQUIREHTML')) define('NOREQUIREH
require '../../main.inc.php';
$htmlname=GETPOST('htmlname','alpha');
-$socid=GETPOST('socid','int');
-$type=GETPOST('type','int');
-$mode=GETPOST('mode','int');
-$status=((GETPOST('status','int') >= 0) ? GETPOST('status','int') : -1);
+$filter=GETPOST('filter','alpha');
$outjson=(GETPOST('outjson','int') ? GETPOST('outjson','int') : 0);
-$price_level=GETPOST('price_level','int');
$action=GETPOST('action', 'alpha');
$id=GETPOST('id', 'int');
-$price_by_qty_rowid=GETPOST('pbq', 'int');
+
/*
* View
@@ -49,7 +45,7 @@ $price_by_qty_rowid=GETPOST('pbq', 'int');
//print ''."\n";
-dol_syslog(join(',',$_GET));
+dol_syslog(join(',', $_GET));
//print_r($_GET);
if (! empty($action) && $action == 'fetch' && ! empty($id))
@@ -63,8 +59,11 @@ if (! empty($action) && $action == 'fetch' && ! empty($id))
if ($ret > 0)
{
$outname=$object->name;
-
- $outjson = array('name'=>$outname);
+ $outlabel = '';
+ $outdesc = '';
+ $outtype = $object->type;
+
+ $outjson = array('ref' => $outref,'name' => $outname,'desc' => $outdesc,'type' => $outtype);
}
echo json_encode($outjson);
@@ -73,7 +72,7 @@ else
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
- $langs->load("products");
+ $langs->load("companies");
$langs->load("main");
top_httphead();
@@ -90,14 +89,7 @@ else
$searchkey=(GETPOST($id)?GETPOST($id):(GETPOST($htmlname)?GETPOST($htmlname):''));
$form = new Form($db);
- if (empty($mode) || $mode == 'customer')
- {
- $arrayresult=$form->select_company_html($socid,$htmlname,"client IN (1,3)",0,0,0,null,$searchkey,$outjson);
- }
- elseif ($mode == 'supplier')
- {
- $arrayresult=$form->select_company_html($socid,$htmlname,"fournisseur=1",0,0,0,null,$searchkey,$outjson);
- }
+ $arrayresult=$form->select_thirdparty_list(0,$htmlname,$filter,1,0,0,null,$searchkey,$outjson);
$db->close();
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index c9fb0de6edf..bb043076157 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1670,7 +1670,7 @@ else
// Zip / Town
print ' '.fieldLabel('Zip','zipcode').' ';
- print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
+ print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth50onsmartphone');
print ' '.fieldLabel('Town','town').' ';
print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
print ' ';
@@ -2346,7 +2346,7 @@ else
if (! empty($conf->adherent->enabled))
{
$langs->load("members");
- print ''.$langs->trans("LinkedToDolibarrMember").' ';
+ print ''.$langs->trans("LinkedToDolibarrMember").' ';
print '';
$adh=new Adherent($db);
$result=$adh->fetch('','',$object->id);
@@ -2357,7 +2357,7 @@ else
}
else
{
- print $langs->trans("ThirdpartyNotLinkedToMember");
+ print ''.$langs->trans("ThirdpartyNotLinkedToMember").' ';
}
print ' ';
print " \n";
diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php
index 72f237999f8..652cd8d5d7e 100644
--- a/htdocs/societe/class/companybankaccount.class.php
+++ b/htdocs/societe/class/companybankaccount.class.php
@@ -130,7 +130,9 @@ class CompanyBankAccount extends Account
*/
function update(User $user = null, $notrigger = 0)
{
- global $conf;
+ global $conf;
+ $error = 0;
+
if (! $this->id)
{
@@ -167,12 +169,33 @@ class CompanyBankAccount extends Account
$result = $this->db->query($sql);
if ($result)
{
- return 1;
+
+
+ if (! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('COMPANY_RIB_MODIFY',$user);
+ if ($result < 0) $error++;
+ // End call triggers
+ if(! $error )
+ {
+ return 1;
+ }
+ else
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ return 1;
+ }
+
}
else
{
dol_print_error($this->db);
- return 0;
+ return -1;
}
}
@@ -252,7 +275,7 @@ class CompanyBankAccount extends Account
if (! $error && ! $notrigger)
{
// Call trigger
- $result=$this->call_trigger('COMAPNY_RIB_DELETE',$user);
+ $result=$this->call_trigger('COMPANY_RIB_DELETE',$user);
if ($result < 0) $error++;
// End call triggers
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index ed3fdad13c4..74aef09e7a9 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1559,7 +1559,7 @@ class Societe extends CommonObject
$note=trim($note);
if (! $note)
{
- $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Note"));
+ $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("NoteReason"));
return -2;
}
@@ -1838,23 +1838,41 @@ class Societe extends CommonObject
$name=$this->name?$this->name:$this->nom;
- if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto)))
- {
- if (($this->client) && (! empty ( $this->code_client ))) {
- $code = $this->code_client . ' - ';
- }
- if (($this->fournisseur) && (! empty ( $this->code_fournisseur ))) {
- $code .= $this->code_fournisseur . ' - ';
- }
- $name =$code.' '.$name;
- }
+ if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto)))
+ {
+ if (($this->client) && (! empty ( $this->code_client ))
+ && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1
+ || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2
+ )
+ )
+ $code = $this->code_client . ' - ';
- if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')';
+ if (($this->fournisseur) && (! empty ( $this->code_fournisseur ))
+ && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1
+ || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3
+ )
+ )
+ $code .= $this->code_fournisseur . ' - ';
+
+ if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1)
+ $name =$code.' '.$name;
+ else
+ $name =$code;
+ }
+
+ if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')';
$result=''; $label='';
$linkstart=''; $linkend='';
- $label.= '';
+ if (! empty($this->logo) && class_exists('Form'))
+ {
+ $label.= '
';
+ $label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
+ $label.= '
';
+ }
+
+ $label.= '
';
if ($option == 'customer' || $option == 'compta' || $option == 'category' || $option == 'category_supplier')
{
@@ -1908,12 +1926,6 @@ class Societe extends CommonObject
if (! empty($conf->accounting->enabled) && $this->fournisseur)
$label.= '
' . $langs->trans('SupplierAccountancyCode') . ': '. $this->code_compta_fournisseur;
- if (! empty($this->logo) && class_exists('Form'))
- {
- $label.= '
';
- $label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
- $label.= '
';
- }
$label.= '
';
// Add type of canvas
diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php
index 2126c81ddfe..89bb836d119 100644
--- a/htdocs/societe/commerciaux.php
+++ b/htdocs/societe/commerciaux.php
@@ -267,7 +267,7 @@ if (! empty($socid))
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
print "
";
$tmpuser->id=$obj->rowid;
$tmpuser->firstname=$obj->firstname;
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 0bff649d7d3..d0f92bb9c14 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -407,8 +407,8 @@ if ($sql_select)
if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status;
- $var=!$var;
- print " ";
+
+ print ' ';
print '';
print $documentstatic->getNomUrl(1);
print ' ';
diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php
index 48f5fd79621..a43db2da318 100644
--- a/htdocs/societe/document.php
+++ b/htdocs/societe/document.php
@@ -102,7 +102,7 @@ if ($object->id)
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 5fa0fd37210..c3508bd0cef 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -219,8 +219,8 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS
while ($i < $num)
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print ' '.$obj->label.' '.$obj->nb.' ';
+
+ print '
'.$obj->label.' '.$obj->nb.' ';
$total+=$obj->nb;
$i++;
}
@@ -281,8 +281,8 @@ if ($result)
{
$objp = $db->fetch_object($result);
- $var=!$var;
- print "
";
+
+ print ' ';
// Name
print '';
$thirdparty_static->id=$objp->rowid;
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index c4412660ea7..ef162beb750 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -35,12 +35,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
-$langs->load("companies");
-$langs->load("commercial");
-$langs->load("customers");
-$langs->load("suppliers");
-$langs->load("bills");
-$langs->load("compta");
+$langs->loadLangs(array("companies", "commercial", "customers", "suppliers", "bills", "compta", "commercial"));
+
+$action=GETPOST('action','alpha');
+$massaction=GETPOST('massaction','alpha');
+$show_files=GETPOST('show_files','int');
+$confirm=GETPOST('confirm','alpha');
+$toselect = GETPOST('toselect', 'array');
// Security check
$socid = GETPOST('socid','int');
@@ -80,7 +81,8 @@ $search_stcomm=GETPOST('search_stcomm','int');
$type=GETPOST('type');
$optioncss=GETPOST('optioncss','alpha');
$mode=GETPOST("mode");
-$action=GETPOST('action');
+
+$diroutputmassaction=$conf->societe->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield=GETPOST("sortfield",'alpha');
@@ -88,7 +90,7 @@ $sortorder=GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int');
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom";
-if (empty($page) || $page == -1) { $page = 0 ; }
+if (empty($page) || $page == -1) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -116,7 +118,9 @@ $fieldstosearchall = array(
's.nom'=>"ThirdPartyName",
's.name_alias'=>"AliasNameShort",
's.code_client'=>"CustomerCode",
- "s.code_fournisseur"=>"SupplierCode",
+ 's.code_fournisseur'=>"SupplierCode",
+ 's.code_compta'=>"CustomerAccountancyCodeShort",
+ 's.code_compta_fournisseur'=>"SupplierAccountancyCodeShort",
's.email'=>"EMail",
's.url'=>"URL",
's.tva_intra'=>"VATIntra",
@@ -147,32 +151,32 @@ $checkedprofid6=0;
$checkprospectlevel=(in_array($contextpage, array('prospectlist')) ? 1 : 0);
$checkstcomm=(in_array($contextpage, array('prospectlist')) ? 1 : 0);
$arrayfields=array(
- 's.nom'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
- 's.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))),
- 's.code_client'=>array('label'=>$langs->trans("CustomerCodeShort"), 'checked'=>$checkedcustomercode),
- 's.code_fournisseur'=>array('label'=>$langs->trans("SupplierCodeShort"), 'checked'=>$checkedsuppliercode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
- 's.code_compta'=>array('label'=>$langs->trans("CustomerAccountancyCodeShort"), 'checked'=>$checkedcustomeraccountcode),
- 's.code_compta_fournisseur'=>array('label'=>$langs->trans("SupplierAccountancyCodeShort"), 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
- 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
- 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
- 'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0),
- 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
- 's.email'=>array('label'=>$langs->trans("Email"), 'checked'=>0),
- 's.url'=>array('label'=>$langs->trans("Url"), 'checked'=>0),
- 's.phone'=>array('label'=>$langs->trans("Phone"), 'checked'=>1),
- 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
- 's.siren'=>array('label'=>$langs->trans("ProfId1Short"), 'checked'=>$checkedprofid1),
- 's.siret'=>array('label'=>$langs->trans("ProfId2Short"), 'checked'=>$checkedprofid2),
- 's.ape'=>array('label'=>$langs->trans("ProfId3Short"), 'checked'=>$checkedprofid3),
- 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4),
- 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5),
- 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6),
+ 's.nom'=>array('label'=>"Company", 'checked'=>1),
+ 's.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))),
+ 's.code_client'=>array('label'=>"CustomerCodeShort", 'checked'=>$checkedcustomercode),
+ 's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'checked'=>$checkedsuppliercode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
+ 's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'checked'=>$checkedcustomeraccountcode),
+ 's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
+ 's.town'=>array('label'=>"Town", 'checked'=>1),
+ 's.zip'=>array('label'=>"Zip", 'checked'=>1),
+ 'state.nom'=>array('label'=>"State", 'checked'=>0),
+ 'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
+ 's.email'=>array('label'=>"Email", 'checked'=>0),
+ 's.url'=>array('label'=>"Url", 'checked'=>0),
+ 's.phone'=>array('label'=>"Phone", 'checked'=>1),
+ 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
+ 's.siren'=>array('label'=>"ProfId1Short", 'checked'=>$checkedprofid1),
+ 's.siret'=>array('label'=>"ProfId2Short", 'checked'=>$checkedprofid2),
+ 's.ape'=>array('label'=>"ProfId3Short", 'checked'=>$checkedprofid3),
+ 's.idprof4'=>array('label'=>"ProfId4Short", 'checked'=>$checkedprofid4),
+ 's.idprof5'=>array('label'=>"ProfId5Short", 'checked'=>$checkedprofid5),
+ 's.idprof6'=>array('label'=>"ProfId6Short", 'checked'=>$checkedprofid6),
'customerorsupplier'=>array('label'=>'Nature', 'checked'=>1),
- 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel),
- 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm),
- 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
- 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
+ 's.fk_prospectlevel'=>array('label'=>"ProspectLevelShort", 'checked'=>$checkprospectlevel),
+ 's.fk_stcomm'=>array('label'=>"StatusProsp", 'checked'=>$checkstcomm),
+ 's.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
+ 's.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
+ 's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
@@ -230,9 +234,18 @@ if (empty($reshook))
$search_stcomm='';
$search_level_from='';
$search_level_to='';
+ $toselect='';
$search_array_options=array();
}
+ // Mass actions
+ $objectclass='Societe';
+ $objectlabel='ThirdParty';
+ $permtoread = $user->rights->societe->lire;
+ $permtodelete = $user->rights->societe->supprimer;
+ $uploaddir = $conf->societe->dir_output;
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
+
if ($action == 'setstcomm')
{
$object = new Client($db);
@@ -457,6 +470,8 @@ if (! $resql)
$num = $db->num_rows($resql);
+$arrayofselected=is_array($toselect)?$toselect:array();
+
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && $action != 'list')
{
$obj = $db->fetch_object($resql);
@@ -513,6 +528,16 @@ if (GETPOST('delsoc'))
setEventMessages($langs->trans("CompanyDeleted",GETPOST('delsoc')), null, 'mesgs');
}
+// List of mass actions available
+$arrayofmassactions = array(
+// 'presend'=>$langs->trans("SendByMail"),
+// 'builddoc'=>$langs->trans("PDFMerge"),
+);
+//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
+if ($user->rights->societe->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
+if ($massaction == 'presend') $arrayofmassactions=array();
+$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
+
print '';
if ($optioncss != '') print ' ';
print ' ';
@@ -520,7 +545,7 @@ print ' ';
print ' ';
-print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
+print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
$langs->load("other");
$textprofid=array();
@@ -586,6 +611,7 @@ if (! empty($moreforfilter))
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
if (empty($arrayfields['customerorsupplier']['checked'])) print ' ';
@@ -837,7 +863,7 @@ if (! empty($arrayfields['s.status']['checked']))
}
// Action column
print '';
-$searchpitco=$form->showFilterAndCheckAddButtons(0);
+$searchpitco=$form->showFilterButtons();
print $searchpitco;
print ' ';
@@ -870,14 +896,14 @@ if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_f
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ $align=$extrafields->getAlignFlag($key);
+ print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ }
+ }
}
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
@@ -886,7 +912,7 @@ print $hookmanager->resPrint;
if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($arrayfields['s.datec']['label'],$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($arrayfields['s.tms']['label'],$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($arrayfields['s.status']['label'],$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print " \n";
@@ -907,10 +933,10 @@ while ($i < min($num, $limit))
$companystatic->code_compta_client=$obj->code_compta;
$companystatic->code_compta_fournisseur=$obj->code_compta_fournisseur;
- $companystatic->fk_prospectlevel=$obj->fk_prospectlevel;
- $companystatic->name_alias=$obj->name_alias;
+ $companystatic->fk_prospectlevel=$obj->fk_prospectlevel;
+ $companystatic->name_alias=$obj->name_alias;
- print "
";
+ print ' ';
if (! empty($arrayfields['s.nom']['checked']))
{
print '';
@@ -1100,9 +1126,18 @@ while ($i < min($num, $limit))
{
print ' '.$companystatic->getLibStatut(3).' ';
}
- // Action column
- print ' ';
+ // Action column
+ print '';
+ if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ {
+ $selected=0;
+ if (in_array($obj->rowid, $arrayofselected)) $selected=1;
+ print ' ';
+ }
+ print ' ';
+ if (! $i) $totalarray['nbfield']++;
+
print ' '."\n";
$i++;
}
diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php
index 63d33dcee1d..d547d9e57dc 100644
--- a/htdocs/societe/notify/card.php
+++ b/htdocs/societe/notify/card.php
@@ -44,15 +44,16 @@ $actionid=GETPOST('actionid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe','','');
-$sortfield = GETPOST("sortfield",'alpha');
-$sortorder = GETPOST("sortorder",'alpha');
-$page = GETPOST("page",'int');
-if ($page == -1) { $page = 0; }
-$offset = $conf->liste_limit * $page;
-$pageprev = $page - 1;
-$pagenext = $page + 1;
+$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
+$sortfield=GETPOST("sortfield",'alpha');
+$sortorder=GETPOST("sortorder",'alpha');
+$page=GETPOST("page",'int');
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="n.daten";
+if (empty($page) || $page == -1) { $page = 0; }
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
$now=dol_now();
@@ -188,12 +189,18 @@ if ($result > 0)
print '';
}
- print '
'.$langs->trans("NbOfActiveNotifications").' ';
+ /*print ''.$langs->trans("NbOfActiveNotifications").' '; // Notification for this thirdparty
print '';
+ $nbofrecipientemails=0;
$notify=new Notify($db);
- $tmparray = $notify->getNotificationsArray('', $object->id);
- print count($tmparray);
- print ' ';
+ $tmparray = $notify->getNotificationsArray('', $object->id, null, 0, array('thirdparty'));
+ foreach($tmparray as $tmpkey => $tmpval)
+ {
+ if (! empty($tmpkey)) $nbofrecipientemails++;
+ }
+ print $nbofrecipientemails;
+ print '';*/
+
print '
';
print '
';
@@ -244,7 +251,7 @@ if ($result > 0)
$label=($langs->trans("Notify_".$managedeventfornotification['code'])!="Notify_".$managedeventfornotification['code']?$langs->trans("Notify_".$managedeventfornotification['code']):$managedeventfornotification['label']);
$actions[$managedeventfornotification['rowid']]=$label;
}
- print '
';
+ print ' ';
print $form->selectarray("contactid", $listofemails, '', 0, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone');
print ' ';
print '';
@@ -259,7 +266,7 @@ if ($result > 0)
}
else
{
- print ' ';
+ print ' ';
print $langs->trans("YouMustCreateContactFirst");
print ' ';
}
@@ -281,7 +288,7 @@ if ($result > 0)
$sql.= " WHERE a.rowid = n.fk_action";
$sql.= " AND c.rowid = n.fk_contact";
$sql.= " AND c.fk_soc = ".$object->id;
-
+
$resql=$db->query($sql);
if ($resql)
{
@@ -294,8 +301,7 @@ if ($result > 0)
// List of active notifications
print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','','');
- $var=true;
-
+
// Line with titles
print '
';
print '';
@@ -316,14 +322,12 @@ if ($result > 0)
while ($i < $num)
{
- $var = !$var;
-
$obj = $db->fetch_object($resql);
$contactstatic->id=$obj->contactid;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
- print ' '.$contactstatic->getNomUrl(1);
+ print ' '.$contactstatic->getNomUrl(1);
if ($obj->type == 'email')
{
if (isValidEmail($obj->email))
@@ -358,7 +362,7 @@ if ($result > 0)
{
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
$var = ! $var;
- print ' ';
+ print ' ';
$listtmp=explode(',',$val);
$first=1;
foreach($listtmp as $keyemail => $valemail)
@@ -394,13 +398,14 @@ if ($result > 0)
print ' '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).' ';
print ' ';
}*/
- if ($user->admin)
+
+ /*if ($user->admin)
{
$var = ! $var;
- print '';
+ print ' ';
print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).' ';
print ' ';
- }
+ }*/
print '
';
@@ -419,6 +424,16 @@ if ($result > 0)
$sql.= " AND n.fk_soc = ".$object->id;
$sql.= $db->order($sortfield, $sortorder);
+ // Count total nb of records
+ $nbtotalofrecords = '';
+ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+ {
+ $result = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($result);
+ }
+
+ $sql.= $db->plimit($limit+1, $offset);
+
$resql=$db->query($sql);
if ($resql)
{
@@ -429,9 +444,20 @@ if ($result > 0)
dol_print_error($db);
}
- // List of notifications done
- print load_fiche_titre($langs->trans("ListOfNotificationsDone").' ('.$num.')','','');
- $var=true;
+ $param='&socid='.$object->id;
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+
+ print '
';
+ if ($optioncss != '') print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+
+ // List of active notifications
+ print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
// Line with titles
print '';
@@ -451,11 +477,9 @@ if ($result > 0)
while ($i < $num)
{
- $var = !$var;
-
$obj = $db->fetch_object($resql);
- print '';
+ print ' ';
if ($obj->id > 0)
{
$contactstatic->id=$obj->id;
@@ -495,6 +519,8 @@ if ($result > 0)
}
print '
';
+
+ print ' ';
}
else dol_print_error('','RecordNotFound');
diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php
index a1042087faf..02125e8fad8 100644
--- a/htdocs/societe/notify/index.php
+++ b/htdocs/societe/notify/index.php
@@ -90,9 +90,9 @@ if ($result)
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
- print "
";
+ print ' ';
print "socid."\">".$obj->name." \n";
print "".dolGetFirstLastname($obj->firstname, $obj->lastname)." \n";
print "".$obj->titre." \n";
diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php
index 42860abb98a..185589f01cb 100644
--- a/htdocs/societe/rib.php
+++ b/htdocs/societe/rib.php
@@ -460,7 +460,7 @@ if ($socid && $action != 'edit' && $action != "create")
foreach ($rib_list as $rib)
{
- print " ";
+ print ' ';
// Label
print ''.$rib->label.' ';
// Bank name
diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php
index 876c383031a..2bda75867dc 100644
--- a/htdocs/societe/societecontact.php
+++ b/htdocs/societe/societecontact.php
@@ -259,8 +259,8 @@ if ($id > 0 || ! empty($ref))
$companyname=$objp->company;
- $var=!$var;
- print " ";
+
+ print ' ';
// Ref
print "";
diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php
index d8d4b4b08bb..34a7ce3f4c4 100644
--- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php
+++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php
@@ -37,5 +37,5 @@
if ($i < $nbofsalesrepresentative) print ', ';
}
}
- else print $langs->trans("NoSalesRepresentativeAffected");
+ else print ''.$langs->trans("NoSalesRepresentativeAffected").' ';
print ' ';
diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php
index ceb86d102bd..8d6d437f466 100644
--- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php
+++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php
@@ -90,8 +90,8 @@ print "
\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value)
{
- $var=!$var;
- print "";
+
+ print ' ';
print "".$extrafields->attribute_pos[$key]." \n";
print "".$extrafields->attribute_label[$key]." \n";
print "".$key." \n";
diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php
index 12e5d2c23e6..2b0a22c51fa 100644
--- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php
+++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php
@@ -94,8 +94,8 @@ print " \n";
$var=True;
foreach($extrafields->attribute_type as $key => $value)
{
- $var=!$var;
- print "";
+
+ print ' ';
print "".$extrafields->attribute_label[$key]." \n";
print "".$key." \n";
print "".$type2label[$extrafields->attribute_type[$key]]." \n";
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 5b007d45774..0bac6dab14f 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1907,7 +1907,7 @@ if ($action == 'create')
$formmail->withtocc = $liste;
$formmail->withtoccc = (! empty($conf->global->MAIN_EMAIL_USECCC) ? $conf->global->MAIN_EMAIL_USECCC : false);
- $formmail->withtopic = $outputlangs->trans('SendAskRef', '__ASKREF__');
+ $formmail->withtopic = $outputlangs->trans('SendAskRef', '__SUPPLIERPROPREF__');
$formmail->withfile = 2;
$formmail->withbody = 1;
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index 1f21693246b..62ff5e0c71a 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -86,7 +86,7 @@ if ($object->id > 0)
dol_fiche_head($head, 'document', $langs->trans('CommRequest'), -1, 'supplier_proposal');
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php
index f6ca9aaee45..1c16d48e086 100644
--- a/htdocs/supplier_proposal/index.php
+++ b/htdocs/supplier_proposal/index.php
@@ -68,7 +68,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
print ' ';
print ' \n";
@@ -125,8 +125,8 @@ if ($resql)
$dataseries[]=array('label'=>$supplier_proposalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0));
if (! $conf->use_javascript_ajax)
{
- $var=!$var;
- print " ";
+
+ print ' ';
print ''.$supplier_proposalstatic->LibStatut($status,0).' ';
print ''.(isset($vals[$status])?$vals[$status]:0).' ';
print " \n";
@@ -178,9 +178,9 @@ if (! empty($conf->supplier_proposal->enabled))
$var = True;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print "";
+ print ' ';
$supplier_proposalstatic->id=$obj->rowid;
$supplier_proposalstatic->ref=$obj->ref;
@@ -236,10 +236,10 @@ if ($resql)
$var = True;
while ($i < $num)
{
- $var=!$var;
+
$obj = $db->fetch_object($resql);
- print " ";
+ print ' ';
print '';
$supplier_proposalstatic->id=$obj->rowid;
@@ -317,8 +317,8 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
- $var=!$var;
- print ' ';
+
+ print ' ';
// Ref
print '';
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index caf79597e53..c0e9611e6b6 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2004-2017 Laurent Destailleur
* Copyright (C) 2004 Eric Seigne
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2013 Regis Houssin
@@ -316,11 +316,11 @@ if ($result)
{
$soc = new Societe($db);
$soc->fetch($socid);
- $title = $langs->trans('ListOfProposals') . ' - '.$soc->name;
+ $title = $langs->trans('ListOfSupplierProposals') . ' - '.$soc->name;
}
else
{
- $title = $langs->trans('ListOfProposals');
+ $title = $langs->trans('ListOfSupplierProposals');
}
$num = $db->num_rows($result);
@@ -509,23 +509,12 @@ if ($result)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+ if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '';
print '
';
- // Fields title
- print '';
- print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'sp.ref','',$param,'',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('Supplier'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'sp.date_valid','',$param, 'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('SupplierProposalDate'),$_SERVER["PHP_SELF"],'sp.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'sp.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'sp.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
- print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print " \n";
-
- print '';
+ print ' ';
print '';
print ' ';
print ' ';
@@ -564,12 +553,24 @@ if ($result)
print '';
// Check boxes
print '';
- $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
+ $searchpitco=$form->showFilterButtons();
print $searchpitco;
print ' ';
print " \n";
+ // Fields title
+ print '';
+ print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'sp.ref','',$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('Supplier'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'sp.date_valid','',$param, 'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('SupplierProposalDate'),$_SERVER["PHP_SELF"],'sp.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'sp.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'sp.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
+ print " \n";
+
$now = dol_now();
$var=true;
$total=0;
@@ -578,12 +579,12 @@ if ($result)
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
- $var=!$var;
+
$objectstatic->id=$obj->rowid;
$objectstatic->ref=$obj->ref;
- print '';
+ print ' ';
print '';
print '';
@@ -670,14 +671,14 @@ if ($result)
if ($total>0)
{
if($num<$limit){
- $var=!$var;
+
print ' '.$langs->trans("TotalHT").' ';
print ''.price($total).' ';
print ' ';
}
else
{
- $var=!$var;
+
print ''.$langs->trans("TotalHTforthispage").' ';
print ''.price($total).' ';
print ' ';
@@ -705,10 +706,10 @@ if ($result)
$urlsource.=str_replace('&','&',$param);
$filedir=$diroutputmassaction;
- $genallowed=$user->rights->propal->lire;
- $delallowed=$user->rights->propal->lire;
+ $genallowed=$user->rights->supplier_proposal->lire;
+ $delallowed=$user->rights->supplier_proposal->lire;
- print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
+ print $formfile->showdocuments('massfilesarea_supplier_proposal','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
}
else
{
diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
index 8ba1f958918..d313eca10bd 100644
--- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
@@ -33,7 +33,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
- $var=!$var;
+
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js
index a1bb5fdcf0b..eabd0c58bd3 100644
--- a/htdocs/theme/eldy/ckeditor/config.js
+++ b/htdocs/theme/eldy/ckeditor/config.js
@@ -31,7 +31,7 @@ CKEDITOR.editorConfig = function( config )
['Templates','NewPage'],
['Save'],
['Source','Maximize','Preview'],
- ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
+ ['PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['CreateDiv','ShowBlocks'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
@@ -42,14 +42,14 @@ CKEDITOR.editorConfig = function( config )
['Link','Unlink','Anchor'],
['Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
['Styles','Format','Font','FontSize'],
- ['TextColor','BGColor'],
+ ['TextColor','BGColor']
];
// Used for mailing fields
config.toolbar_dolibarr_mailings =
[
['Source','Maximize','Preview'],
- ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
+ ['SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace'],
['CreateDiv','ShowBlocks'],
['Format','Font','FontSize'],
@@ -63,7 +63,7 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_notes =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
+ ['SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Undo','Redo','-','Find','Replace'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
@@ -76,9 +76,9 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_details =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
+ ['SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Format','Font','FontSize'],
- ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
+ ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], // ,'Subscript','Superscript' useless
['NumberedList','BulletedList','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','SpecialChar']
diff --git a/htdocs/theme/eldy/graph-color.php b/htdocs/theme/eldy/graph-color.php
index 42989907747..5995303c34a 100644
--- a/htdocs/theme/eldy/graph-color.php
+++ b/htdocs/theme/eldy/graph-color.php
@@ -28,7 +28,7 @@
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235,235,224);
-$theme_datacolor = array(array(120,140,220), array(190,120,120), array(0,160,140), array(190,190,100), array(115,125,150), array(100,170,20), array(250,190,30), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
+$theme_datacolor = array(array(136,102,136), array(140,140,220), array(190,120,120), array(0,160,140), array(190,190,100), array(115,125,150), array(100,170,20), array(250,190,30), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
diff --git a/htdocs/theme/eldy/img/refresh.png b/htdocs/theme/eldy/img/refresh.png
index 9994475cdfe..a4fac077e7a 100644
Binary files a/htdocs/theme/eldy/img/refresh.png and b/htdocs/theme/eldy/img/refresh.png differ
diff --git a/htdocs/theme/eldy/img/reload.png b/htdocs/theme/eldy/img/reload.png
deleted file mode 100644
index a4029f119de..00000000000
Binary files a/htdocs/theme/eldy/img/reload.png and /dev/null differ
diff --git a/htdocs/theme/eldy/img/save.png b/htdocs/theme/eldy/img/save.png
new file mode 100644
index 00000000000..eca2d92eccc
Binary files /dev/null and b/htdocs/theme/eldy/img/save.png differ
diff --git a/htdocs/theme/eldy/img/statut3.png b/htdocs/theme/eldy/img/statut3.png
index bf4f7b8e854..158c640bb60 100644
Binary files a/htdocs/theme/eldy/img/statut3.png and b/htdocs/theme/eldy/img/statut3.png differ
diff --git a/htdocs/theme/eldy/img/statut4.png b/htdocs/theme/eldy/img/statut4.png
index 7a680ad2b2d..d0df7e40aef 100644
Binary files a/htdocs/theme/eldy/img/statut4.png and b/htdocs/theme/eldy/img/statut4.png differ
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index b16d6d13790..f0e615f29ce 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -73,16 +73,15 @@ $dol_hide_leftmenu=$conf->dol_hide_leftmenu;
$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen;
$dol_no_mouse_hover=$conf->dol_no_mouse_hover;
-
//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0;
//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0;
//var_dump($user->conf->THEME_ELDY_RGB);
// Colors
-$colorbackhmenu1='110,120,160'; // topmenu
+$colorbackhmenu1='80,90,120'; // topmenu
$colorbackvmenu1='255,255,255'; // vmenu
$colortopbordertitle1='120,120,120'; // top border of title
-$colorbacktitle1='230,230,230'; // title of tables,list
+$colorbacktitle1='240,240,240'; // title of tables,list
$colorbacktabcard1='255,255,255'; // card
$colorbacktabactive='234,234,234';
$colorbacklineimpair1='255,255,255'; // line impair
@@ -97,8 +96,6 @@ $colortext='0,0,0';
$colortextlink='0,0,120';
$fontsize='13';
$fontsizesmaller='12';
-$usegradienttop=(isset($conf->global->THEME_ELDY_TOPMENU_BACK1)?0:1);
-$usegradienttitle=(isset($conf->global->THEME_ELDY_BACKTITLE1)?0:1);
$useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEME_ELDY_USEBOLDTITLE:1);
$borderwith=2;
@@ -126,7 +123,7 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
$conf->global->THEME_ELDY_FONT_SIZE2='12';
}
-
+
// Case of option availables only if THEME_ELDY_ENABLE_PERSONALIZED is on
$colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
$colorbackvmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$user->conf->THEME_ELDY_VERMENU_BACK1);
@@ -138,7 +135,6 @@ $colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty(
$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2);
$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1);
$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2);
-$colorbacklinepairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER);
$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY);
$colortexttitlenotab =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLENOTAB)?$colortexttitlenotab:$conf->global->THEME_ELDY_TEXTTITLENOTAB) :(empty($user->conf->THEME_ELDY_TEXTTITLENOTAB)?$colortexttitlenotab:$user->conf->THEME_ELDY_TEXTTITLENOTAB);
$colortexttitle =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLE) ?$colortexttitle:$conf->global->THEME_ELDY_TEXTTITLE) :(empty($user->conf->THEME_ELDY_TEXTTITLE)?$colortexttitle:$user->conf->THEME_ELDY_TEXTTITLE);
@@ -146,6 +142,7 @@ $colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty(
$colortextlink =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTLINK) ?$colortextlink:$conf->global->THEME_ELDY_TEXTLINK) :(empty($user->conf->THEME_ELDY_TEXTLINK)?$colortextlink:$user->conf->THEME_ELDY_TEXTLINK);
$fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1);
$fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2);
+
// Hover color
$colorbacklinepairhover=((! isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '0')?'':($conf->global->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_HOVER));
if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED))
@@ -269,21 +266,25 @@ input.select2-input {
border-bottom: solid 1px rgba(0,0,0,.2) !important; /* required to avoid to lose bottom line when focus is lost on select2. */
}
-.liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre input[name=month_lim] {
+.liste_titre input[name=monthvalid], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre input[name=month_lim] {
margin-right: 4px;
}
+input[type=submit] {
+ margin-left: 5px;
+}
+input, input.flat, form.flat select, select, select.flat, .dataTables_length label select {
+ global->THEME_ELDY_SHOW_BORDER_INPUT))
+ print "border: none;"
+ ?>
+}
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {
font-size: px;
font-family: ;
-
-global->THEME_ELDY_SHOW_BORDER_INPUT))
- print "border: none;"
-?>
-
- border-bottom: solid 1px rgba(0,0,0,.2);
outline: none;
margin: 0px 0px 0px 0px;
+ border-bottom: solid 1px rgba(0,0,0,.2);
}
+
input {
line-height: 17px;
padding: 4px;
@@ -348,6 +349,12 @@ span.timesheetalreadyrecorded input {
select.flat, form.flat select {
font-weight: normal;
}
+.optionblue {
+ color: rgb() !important;
+}
+.select2-results .select2-highlighted.optionblue {
+ color: #FFF !important;
+}
.optiongrey, .opacitymedium {
opacity: 0.5;
}
@@ -404,7 +411,6 @@ hr { border: 0; border-top: 1px solid #ccc; }
margin-top: 0;
text-align: center;
cursor: pointer;
- color: #333333 !important;
text-decoration: none !important;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: #f5f5f5;
@@ -423,9 +429,6 @@ hr { border: 0; border-top: 1px solid #ccc; }
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.button:focus, .buttonDelete:focus {
-moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
@@ -519,6 +522,9 @@ textarea.centpercent {
.nowrap {
white-space: ;
}
+.nowraponall {
+ white-space: nowrap;
+}
.nobold {
font-weight: normal !important;
}
@@ -534,6 +540,9 @@ textarea.centpercent {
.cursorpointer {
cursor: pointer;
}
+.cursormove {
+ cursor: move;
+}
.badge {
display: inline-block;
min-width: 10px;
@@ -548,9 +557,6 @@ textarea.centpercent {
background-color: #777;
border-radius: 10px;
}
-.movable {
- cursor: move;
-}
.borderrightlight
{
border-right: 1px solid #DDD;
@@ -584,9 +590,10 @@ div.myavailability {
padding-bottom: 4px;
}
.checkallactions {
- vertical-align: text-bottom;
- margin-top: 6px;
- margin-left: 4px;
+ /* vertical-align: text-bottom;
+ margin-top: 6px; */
+ margin-left: 2px; /* left must be same than right to keep checkbox centered */
+ margin-right: 2px; /* left must be same than right to keep checkbox centered */
}
.selectlimit, .marginrightonly {
margin-right: 10px !important;
@@ -600,6 +607,9 @@ div.myavailability {
.strikefordisabled {
text-decoration: line-through;
}
+.widthdate {
+ width: 130px;
+}
/* using a tdoverflowxxx make the min-width not working */
.tdoverflow {
max-width: 0;
@@ -613,6 +623,12 @@ div.myavailability {
text-overflow: ellipsis;
white-space: nowrap;
}
+.tdoverflowmax200 { /* For tdoverflow, the max-midth become a minimum ! */
+ max-width: 200px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
.tdoverflowmax300 { /* For tdoverflow, the max-midth become a minimum ! */
max-width: 300px;
overflow: hidden;
@@ -680,7 +696,7 @@ div.fiche>form>div.div-table-responsive {
justify-content: flex-start;
}
.thumbstat {
- flex: 1 1 120px;
+ flex: 1 1 114px;
}
.thumbstat150 {
flex: 1 1 170px;
@@ -704,6 +720,9 @@ div.fiche>form>div.div-table-responsive {
/* rule for not too small screen only */
@media only screen and (min-width: px)
{
+ .width50 { width: 50px; }
+ .width100 { width: 100px; }
+ .width200 { width: 200px; }
.minwidth100 { min-width: 100px; }
.minwidth200 { min-width: 200px; }
.minwidth300 { min-width: 300px; }
@@ -717,6 +736,9 @@ div.fiche>form>div.div-table-responsive {
.minwidth400imp { min-width: 400px !important; }
.minwidth500imp { min-width: 500px !important; }
}
+.width50 { width: 50px; }
+.width100 { width: 100px; }
+.width200 { width: 200px; }
.maxwidth25 { max-width: 25px; }
.maxwidth50 { max-width: 50px; }
.maxwidth75 { max-width: 75px; }
@@ -758,8 +780,8 @@ div.fiche>form>div.div-table-responsive {
.minwidth100imp { min-width: 80px !important; }
.minwidth200imp { min-width: 100px !important; }
.minwidth300imp { min-width: 100px !important; }
- .minwidth400imp { min-width: 100px !important; }
- .minwidth500imp { min-width: 100px !important; }
+ .minwidth400imp { min-width: 150px !important; }
+ .minwidth500imp { min-width: 250px !important; }
}
/* Force values for small screen 570 */
@@ -809,9 +831,9 @@ div.fiche>form>div.div-table-responsive {
.minwidth75imp { min-width: 60px !important; }
.minwidth100imp { min-width: 60px !important; }
.minwidth200imp { min-width: 60px !important; }
- .minwidth300imp { min-width: 60px !important; }
- .minwidth400imp { min-width: 60px !important; }
- .minwidth500imp { min-width: 60px !important; }
+ .minwidth300imp { min-width: 100px !important; }
+ .minwidth400imp { min-width: 150px !important; }
+ .minwidth500imp { min-width: 250px !important; }
.titlefield { width: auto; }
.titlefieldcreate { width: auto; }
@@ -876,7 +898,7 @@ td.showDragHandle {
}
#id-right, #id-left {
padding-top: 16px;
- padding-bottom: 8px;
+ padding-bottom: 16px;
display: table-cell; /* DOL_XXX Empeche fonctionnement correct du scroll horizontal sur tableau, avec datatable ou CSS */
float: none;
@@ -901,14 +923,14 @@ div.blockvmenulogo
{
border-bottom: 0 !important;
}
-div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks {
+div.blockvmenupair, div.blockvmenuimpair {
border-top: none !important;
border-left: none !important;
border-right: none !important;
border-bottom: 1px solid #e0e0e0;
padding-left: 0 !important;
}
-div.blockvmenuend {
+div.blockvmenuend, div.blockvmenubookmarks {
border: none !important;
padding-left: 0 !important;
}
@@ -919,7 +941,7 @@ div.vmenu, td.vmenu {
/* For smartphone (testmenuhider is on) */
-global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
+browser->layout == 'phone' && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
#id-container {
width: 100%;
}
@@ -1063,6 +1085,9 @@ div.nopadding {
.pictowarning, .pictopreview {
padding-: 3px;
}
+.pictoedit, .pictowarning, .pictodelete {
+ vertical-align: text-bottom;
+}
.colorthumb {
padding-left: 1px !important;
padding-right: 1px;
@@ -1097,6 +1122,9 @@ div.statusref {
margin-bottom: 10px;
clear: both;
}
+div.statusref img {
+ padding-left: 8px;
+}
img.photoref, div.photoref {
border: 1px solid #CCC;
-moz-box-shadow: 3px 3px 4px #DDD;
@@ -1153,14 +1181,14 @@ div#id-top {
background: rgb();
/*-webkit-box-shadow: 0 0 6px rgba(0,0,0,0.4);
box-shadow: 0 0 6px rgba(0,0,0,0.4); */
-
+ /*
background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) );
-
+ */
/*
height: 34px;
@@ -1237,15 +1265,15 @@ ul.tmenu { /* t r b l */
display: table;
}
ul.tmenu li { /* We need this to have background color when menu entry wraps on new lines */
-/* background: rgb();
-
+ /* background: rgb();
+ /*
background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) );
- */
+ */
}
li.tmenu, li.tmenusel {
@@ -1290,7 +1318,7 @@ div.tmenuleft
div.tmenucenter
{
padding-left: 0px;
- padding-right: 0px;
+ padding-right: 3px;
padding-top: 8px;
height: 26px;
@@ -1332,7 +1360,7 @@ div.mainmenu {
position : relative;
background-repeat:no-repeat;
background-position:center top;
- height: px;
+ height: px;
margin-left: 0px;
min-width: 40px;
}
@@ -1487,21 +1515,29 @@ foreach($mainmenuusedarray as $val)
.bodylogin
{
background: #f0f0f0;
- /* background: linear-gradient(to left top, rgb(255,255,255), rgb(240,240,240)) fixed; */
+ display: table;
+ position: absolute;
+ height: 100%;
+ width: 100%;
+}
+.login_center {
+ display: table-cell;
+ vertical-align: middle;
}
.login_vertical_align {
padding: 10px;
+ padding-bottom: 80px;
}
form#login {
- margin-top: px;
- margin-bottom: 30px;
+ padding-bottom: 30px;
font-size: 13px;
vertical-align: middle;
}
.login_table_title {
max-width: 530px;
- color: #888888 !important;
- text-shadow: 1px 1px 1px #FFF;
+ color: #aaa !important;
+ padding-bottom: 20px;
+ /* text-shadow: 1px 1px 1px #FFF; */
}
.login_table label {
text-shadow: 1px 1px 1px #FFF;
@@ -1516,9 +1552,9 @@ form#login {
background-color: #FFFFFF;
- -moz-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15);
- -webkit-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15);
- box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15);
+ -moz-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
+ -webkit-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
+ box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
border-radius: 5px;
/*border-top:solid 1px rgba(180,180,180,.4);
@@ -1585,7 +1621,7 @@ div.login_block {
position: absolute;
text-align: ;
: 5px;
- top: 3px;
+ top: 4px;
font-weight: bold;
max-width: px;
@@ -1639,6 +1675,10 @@ div.login_block_other { padding-top: 3px; text-align: right; }
.alogin:hover, .atoplogin:hover {
text-decoration:underline !important;
}
+span.fa.atoplogin, span.fa.atoplogin:hover {
+ font-size: 16px;
+ text-decoration: none !important;
+}
img.login, img.printer, img.entity {
/* padding: 0px 0px 0px 4px; */
/* margin: 0px 0px 0px 8px; */
@@ -1649,11 +1689,22 @@ img.login, img.printer, img.entity {
.userimgatoplogin img.userphoto { /* size for user photo in login bar */
width: 16px;
height: 16px;
+ border-radius: 8px;
+ background-size: contain;
+ background-size: contain;
}
img.userphoto { /* size for user photo in lists */
- border-radius: 2px;
+ border-radius: 9px;
width: 18px;
height: 18px;
+ background-size: contain;
+ vertical-align: middle;
+}
+img.userphotosmall { /* size for user photo in lists */
+ border-radius: 6px;
+ width: 12px;
+ height: 12px;
+ background-size: contain;
vertical-align: middle;
}
.span-icon-user {
@@ -1685,14 +1736,19 @@ div.vmenu, td.vmenu {
}
.vmenu {
+ width: 190px;
margin-left: 4px;
display: none;
}
+/* Force vmenusearchselectcombo with type=text differently than without because beautify with select2 affect vmenusearchselectcombo differently */
+input.vmenusearchselectcombo[type=text] {
+ width: 180px !important;
+}
.vmenusearchselectcombo {
- width: 188px;
+ width: 188px;
}
.menu_contenu {
@@ -1704,7 +1760,7 @@ div.vmenu, td.vmenu {
}
#menu_contenu_logo { padding-top: 0; }
.companylogo { }
-.searchform { padding-top: 4px; }
+.searchform { padding-top: 10px; }
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { white-space: nowrap; font-size:px; font-family: ; text-align: ; font-weight: bold; }
font.vmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; }
@@ -1724,10 +1780,6 @@ a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:
a.vsmenu.addbookmarkpicto {
padding-right: 10px;
}
-.vmenu div.blockvmenubookmarks, .vmenu div.blockvmenuend, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone
-{
-/* border-bottom: 1px solid #BBB; */
-}
div.blockvmenusearchphone
{
border-bottom: none !important;
@@ -1738,7 +1790,7 @@ div.blockvmenusearchphone
}
.vmenu div.blockvmenusearch
{
- padding-bottom: 14px;
+ padding-bottom: 4px;
/* border-bottom: 1px solid #e0e0e0; */
}
.vmenu div.blockvmenuend
@@ -1752,7 +1804,7 @@ div.blockvmenusearchphone
}
div.blockvmenubookmarks
{
- padding-bottom: 6px !important;
+ padding-bottom: 16px !important;
}
div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks, div.blockvmenuend
{
@@ -1921,6 +1973,10 @@ div.tabBar {
width: auto;
background: rgb();
}
+div.tabBar div.titre {
+ padding-top: 10px;
+}
+
div.tabBarWithBottom {
padding-bottom: 18px;
border-bottom: 1px solid #aaa;
@@ -1941,7 +1997,7 @@ div.popuptab {
padding-right: 5px;
}
div.tabsAction {
- margin: 20px 0em 25px 0em;
+ margin: 20px 0em 20px 0em;
padding: 0em 0em;
text-align: right;
}
@@ -2049,82 +2105,33 @@ span.butAction, span.butActionDelete {
margin: 0em em;
padding: 0.6em em;
font-family: ;
-/* for bootstrap look
- color: #fff;
- background-color: #337ab7;
- border-color: #2e6da4;
- display: inline-block;
- padding: 6px 12px;
- margin-bottom: 0;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- */
-
- font-weight: normal;
- border-color: #c5c5c5;
- border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
- display: inline-block;
- text-align: center;
- cursor: pointer;
- color: #fff;
- background: rgb();
- background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
- background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%);
-
- color: #333333;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- background-color: #f5f5f5;
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
-
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
- border: 1px solid #bbbbbb;
- border-bottom-color: #a2a2a2;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
- border-radius: 2px;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+ font-weight: normal;
+ border-color: #c5c5c5;
+ border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
+ display: inline-block;
+ text-align: center;
+ cursor: pointer;
+ color: #fff;
+ background: rgb();
+ border: 1px solid rgb();
}
.butAction:hover {
- -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
- -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
- box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
+ -moz-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
+ -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
+ box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
}
.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
- color: #800 !important;
+ background: #633;
+ border: 1px solid #633;
+ color: #FFF;
}
.butActionDelete:hover {
- -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
- -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
- box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
+ -moz-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
+ -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
+ box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
}
.butActionRefused {
@@ -2134,130 +2141,14 @@ span.butAction, span.butActionDelete {
margin: 0em em;
padding: 0.6em em;
font-family: !important;
-/* for bootstrap look
- color: #333;
- background-color: #e6e6e6;
- border-color: #adadad;
- display: inline-block;
- margin-bottom: 0;
- font-weight: normal !important;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
-*/
-
- font-weight: normal !important;
- border-color: #c5c5c5;
- border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
- display: inline-block;
- margin: 0em em;
- padding: 0.6em em;
- text-align: center;
- cursor: pointer;
- color: #999 !important;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- background-color: #f5f5f5;
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
- border: 1px solid #bbbbbb;
- border-bottom-color: #a2a2a2;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-
+ font-weight: normal !important;
+ display: inline-block;
+ text-align: center;
+ cursor: pointer;
+ color: #999 !important;
+ border: 1px solid #bbb;
}
-/* Prepare for bootstrap look
-.butAction, .butActionDelete, .butActionRefused {
- border-color: #c5c5c5;
- border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
- display: inline-block;
- padding: 4px 14px;
- margin-bottom: 0;
- line-height: 20px;
- text-align: center;
- vertical-align: middle;
- cursor: pointer;
- color: #333333;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- background-color: #f5f5f5;
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
- border: 1px solid #bbbbbb;
- border-bottom-color: #a2a2a2;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.butAction {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #006dcc;
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
- background-image: linear-gradient(to bottom, #0088cc, #0044cc);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
- border-color: #0044cc #0044cc #002a80;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-}
-
-.butActionDelete {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #cc6d00;
- background-image: -moz-linear-gradient(top, #cc8800, #cc4400);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#cc8800), to(#cc4400));
- background-image: -webkit-linear-gradient(top, #cc8800, #cc4400);
- background-image: -o-linear-gradient(top, #cc8800, #cc4400);
- background-image: linear-gradient(to bottom, #cc8800, #cc4400);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffcc8800', endColorstr='#ffcc4400', GradientType=0);
- border-color: #cc4400 #cc4400 #802a00;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-}
-a.butAction:link, a.butAction:visited, a.butAction:hover, a.butAction:active {
- color: #FFFFFF;
-}
-End bootstrap */
-
global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin)) { ?>
.butActionRefused {
display: none;
@@ -2325,7 +2216,7 @@ table.borderplus {
border: 1px solid #BBB;
}
.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
- height: 20px;
+ height: 22px;
}
div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col {
vertical-align: middle;
@@ -2395,8 +2286,17 @@ table.paddingtopbottomonly tr td {
padding-top: 1px;
padding-bottom: 2px;
}
+.liste_titre_filter {
+ background: rgb() !important;
+}
tr.liste_titre_filter td.liste_titre {
- border-bottom: 1px solid #eee;
+ border-bottom: 1px solid #ddd;
+}
+.liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd
+{
+ /*border-top-width: 1px;
+ border-top-color: rgb();
+ border-top-style: solid;*/
}
.liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd
{
@@ -2466,7 +2366,7 @@ div.refid {
font-size: 160%;
}
div.refidno {
- padding-top: 8px;
+ padding-top: 3px;
font-weight: normal;
color: #444;
font-size: px;
@@ -2514,14 +2414,12 @@ div.pagination li.pagination span.inactive {
cursor: default;
color: #ccc;
}
+li.noborder.litext, li.noborder.litext a,
div.pagination li a.inactive:hover,
div.pagination li span.inactive:hover {
- background-color: #f5f5f5;
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
+ -moz-box-shadow: none !important;
+ -webkit-box-shadow: none !important;
+ box-shadow: none !important;
}
/*div.pagination li.litext {
padding-top: 8px;
@@ -2546,7 +2444,7 @@ div.pagination li.noborder a:hover {
}
div.pagination li a,
div.pagination li span {
- background-color: #fff;
+ /* background-color: #fff; */
/* border: 1px solid #ddd; */
}
div.pagination li:first-child a,
@@ -2564,17 +2462,10 @@ div.pagination li a:hover,
div.pagination li span:hover,
div.pagination li a:focus,
div.pagination li span:focus {
- color: #000;
- background-color: #eee;
- border-color: #ccc;
-
- background-image: -moz-linear-gradient(top, #eee, #ddd);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eee), to(#ddd));
- background-image: -webkit-linear-gradient(top, #eee, #ddd);
- background-image: -o-linear-gradient(top, #eee, #ddd);
- background-image: linear-gradient(to bottom, #eee, #ddd);
- background-repeat: repeat-x;
-
+ -moz-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
+ -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
+ box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
+ padding-top: 8px;
}
div.pagination li .active a,
div.pagination li .active span,
@@ -2601,6 +2492,7 @@ div.pagination .disabled a:focus {
}
div.pagination li.pagination .active {
text-decoration: underline;
+ box-shadow: none;
}
div.pagination li.paginationafterarrows {
margin-left: 10px;
@@ -2613,21 +2505,20 @@ div.pagination li.paginationafterarrows {
/* Set the color for hover lines */
-.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover,
-table.dataTable tr.even:hover, table.dataTable tr.odd:hover
+.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover
{
background: rgb() !important; /* Must be background to be stronger than background of odd or even */
}
-.oddeven, .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover
{
font-family: ;
margin-bottom: 1px;
color: #202020;
}
-.odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.impair, .nohover .impair:hover, tr.impair td.nohover
{
background: #;
}
@@ -2635,16 +2526,16 @@ table.dataTable tr.even:hover, table.dataTable tr.odd:hover
background-color: #;
}
-.oddeven, .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover {
font-family: ;
margin-bottom: 1px;
color: #202020;
}
-.even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.pair, .nohover .pair:hover, tr.pair td.nohover {
background-color: #;
}
-table.dataTable tr.odd, table.dataTable tr.oddeven {
+table.dataTable tr.oddeven {
background-color: # !important;
}
@@ -2653,7 +2544,7 @@ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.imp
background-color: # !important;
background: # !important;
}
-tr.nohoverpair td {
+td.evenodd, tr.nohoverpair td {
background-color: # !important;
background: # !important;
}
@@ -2662,17 +2553,17 @@ tr.nohoverpair td {
table.dataTable td {
padding: 5px 2px 5px 3px !important;
}
-tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
+tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
padding: 7px 2px 7px 3px;
border-bottom: 1px solid #ddd;
}
form.pair, form.impair {
font-weight: normal;
}
-form.tagtr:last-of-type div.tagtd, tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
+form.tagtr:last-of-type div.tagtd, tr.pair:last-of-type td, tr.impair:last-of-type td {
border-bottom: 0px !important;
}
-tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td {
+tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td {
border-bottom: 0px !important;
}
td.nobottom, td.nobottom {
@@ -2711,11 +2602,7 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl
}
div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
{
- background: linear-gradient(bottom, rgb() 85%, rgb() 100%);
- background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%);
- background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%);
- background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%);
- background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%);
+ background: rgb();
font-weight: ;
border-bottom: 1px solid #ddd;
@@ -2728,7 +2615,6 @@ tr.liste_titre th, tr.liste_titre td, th.liste_titre
/* border-bottom: 1px solid #; */
border-bottom: 1px solid #888;
}
-/* TODO Once title line is moved under title search, make border bottom of all th black and force to white when it's first tr */
tr.liste_titre:first-child th, tr:first-child th.liste_titre {
border-bottom: 1px solid #ddd ! important;
}
@@ -2737,6 +2623,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
font-family: ;
font-weight: ;
vertical-align: middle;
+ height: 24px;
}
tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
text-shadow: none !important;
@@ -2756,8 +2643,8 @@ tr.liste_titre_topborder td {
.liste_titre td a.notasortlink:hover {
background: transparent;
}
-tr.liste_titre:last-child th.liste_titre, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */
- border-bottom: 1px solid rgb();
+tr.liste_titre:last-child th.liste_titre, tr.liste_titre:last-child th.liste_titre_sel, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */
+ border-bottom: 1px solid #ddd;
}
@@ -2984,16 +2871,7 @@ tr.box_titre {
color: #000 !important;*/
/* TO MATCH ELDY */
-
- background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(,0.4) 100%);
- background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(,0.4) 100%);
- background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(,0.4) 100%);
- background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(,0.4) 100%);
- background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(,0.4) 100%);
-
- background: rgb();
-
-
+ background: rgb()
color: rgb();
font-family: , sans-serif;
font-weight: ;
@@ -3120,15 +2998,13 @@ td.legendLabel { padding: 2px 2px 2px 0 !important; }
margin-bottom: 2px;
margin-top: 10px;
}
-.photowithmargin {
-/* -webkit-box-shadow: 0px 0px 3px #777;
- -moz-box-shadow: 0px 0px 3px #777;
- box-shadow: 0px 0px 3px #777;*/
-}
-.photointoolitp {
+.photointooltip {
margin-top: 6px;
- float: left;
- /*text-align: center; */
+ margin-bottom: 6px;
+ text-align: center;
+ /*-moz-box-shadow: 3px 3px 4px #DDD;
+ -webkit-box-shadow: 3px 3px 4px #DDD;
+ box-shadow: 3px 3px 4px #DDD;*/
}
.photodelete {
margin-top: 6px !important;
@@ -3427,6 +3303,7 @@ a.websitebuttonsitepreview img {
/* Module agenda */
/* ============================================================================== */
+.agendacell { height: 60px; }
table.cal_month { border-spacing: 0px; }
table.cal_month td:first-child { border-left: 0px; }
table.cal_month td:last-child { border-right: 0px; }
@@ -3437,8 +3314,8 @@ table.cal_month td:last-child { border-right: 0px; }
.cal_other_month_peruserleft { border-top: 0; border-left: solid 2px #6C7C7B !important; border-right: 0; }
.cal_current_month_right { border-right: solid 1px #E0E0E0; }
.cal_other_month_right { border-right: solid 1px #C0C0C0; }
-.cal_other_month { opacity: 0.6; background: #EAEAEA; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
-.cal_past_month { opacity: 0.6; background: #EEEEEE; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
+.cal_other_month { /* opacity: 0.6; */ background: #EAEAEA; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
+.cal_past_month { /* opacity: 0.6; */ background: #EEEEEE; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_current_month { background: #FFFFFF; border-left: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_current_month_peruserleft { background: #FFFFFF; border-left: solid 2px #6C7C7B; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today { background: #FDFDF0; border-left: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
@@ -3450,18 +3327,10 @@ table.cal_month td:last-child { border-right: 0px; }
.cal_today_peruser_impair { background: #F8F8F0; }
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; opacity: 0.5; }
-table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
- moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
- background: -webkit-gradient(linear, left top, left bottom, from(#006aac), to(#00438d));
- min-height: 20px;
- }
+table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px; min-height: 20px; }
table.cal_event td { border: none; padding-: 2px; padding-: 2px; padding-top: 0px; padding-bottom: 0px; }
table.cal_event td.cal_event { padding: 4px 4px !important; }
table.cal_event td.cal_event_right { padding: 4px 4px !important; }
-ul.cal_event { padding-right: 2px; padding-top: 1px; border: none; list-style-type: none; margin: 0 auto; padding-left: 0px; padding-start: 0px; -khtml-padding-start: 0px; -o-padding-start: 0px; -moz-padding-start: 0px; -webkit-padding-start: 0px; }
-li.cal_event { border: none; list-style-type: none; }
.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
@@ -4024,14 +3893,19 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
+.select2-default {
+ color: #999 !important;
+ /*opacity: 0.2;*/
+}
.select2-choice, .select2-container .select2-choice {
- border-bottom: solid 1px rgba(0,0,0,.2);
+ border-bottom: solid 1px rgba(0,0,0,.4);
}
.select2-container .select2-choice > .select2-chosen {
margin-right: 23px;
}
.select2-container .select2-choice .select2-arrow {
border-radius: 0;
+ background: transparent;
}
.select2-container-multi .select2-choices {
background-image: none;
@@ -4150,18 +4024,18 @@ a span.select2-chosen
/* Special case for the select2 add widget */
-#addbox .select2-container .select2-choice > .select2-chosen {
+#addbox .select2-container .select2-choice > .select2-chosen, #actionbookmark .select2-container .select2-choice > .select2-chosen {
text-align: left;
- opacity: 0.2;
+ opacity: 0.4;
}
/* Style used before the select2 js is executed on boxcombo */
-#boxcombo.boxcombo {
+#boxbookmark.boxcombo, #boxcombo.boxcombo {
text-align: left;
- opacity: 0.2;
- border-bottom: 1px solid #000;
+ opacity: 0.4;
+ border-bottom: solid 1px rgba(0,0,0,.4) !important;
height: 26px;
line-height: 24px;
- padding: 0 0 5px 5px;
+ padding: 0 0 2px 0;
vertical-align: top;
}
@@ -4243,8 +4117,10 @@ ul.ulselectedfields {
}
dl.dropdown {
margin:0px;
+ margin-left: 2px;
+ margin-right: 2px;
padding:0px;
- vertical-align: middle;
+ vertical-align: text-bottom;
display: inline-block;
}
.dropdown dd, .dropdown dt {
@@ -4468,6 +4344,7 @@ ul.ulmenu {
}
.alilevel0 {
color: rgb() !important;
+ background: #f8f8f8
}
.ulmenu {
box-shadow: none !important;
@@ -4491,24 +4368,9 @@ ul.ulmenu {
color: # !important;
text-shadow: none !important;
}
-/*
-.ui-btn-up-c {
- background: transparent;
-}
-*/
div.tabsElem a.tab {
background: transparent;
}
-
-/*.ui-controlgroup-horizontal .ui-btn.ui-first-child {
--webkit-border-top-left-radius: 6px;
-border-top-left-radius: 6px;
-}
-.ui-controlgroup-horizontal .ui-btn.ui-last-child {
--webkit-border-top-right-radius: 6px;
-border-top-right-radius: 6px;
-}*/
-
.alilevel1 {
color: rgb() !important;
}
@@ -4648,7 +4510,7 @@ border-top-right-radius: 6px;
/* nboftopmenuentries = , fontsize= */
/* rule to reduce top menu - 1st reduction */
-@media only screen and (max-width: px)
+@media only screen and (max-width: px) /* reduction 1 */
{
div.tmenucenter {
width: px; /* size of viewport */
@@ -4677,7 +4539,7 @@ border-top-right-radius: 6px;
}
}
/* rule to reduce top menu - 2nd reduction */
-@media only screen and (max-width: px)
+@media only screen and (max-width: px) /* reduction 2 */
{
div.mainmenu {
height: 23px;
@@ -4686,6 +4548,9 @@ border-top-right-radius: 6px;
max-width: px; /* size of viewport */
text-overflow: clip;
}
+ span.mainmenuaspan {
+ margin-left: 1px;
+ }
.mainmenuaspan {
/*display: none;*/
font-size: 10px;
@@ -4693,15 +4558,23 @@ border-top-right-radius: 6px;
.topmenuimage {
background-size: 20px auto;
margin-top: 2px;
+ left: 4px;
}
}
/* rule to reduce top menu - 3rd reduction */
-@media only screen and (max-width: px)
+@media only screen and (max-width: px) /* reduction 3 */
{
- /* Reduce login top right info */
- .usertextatoplogin {
- display: none;
+ .side-nav {
+ z-index: 200;
+ background: #FFF;
+ padding-top: 70px;
+ }
+ #id-left {
+ z-index: 201;
+ background: #FFF;
}
+
+ /* Reduce login top right info */
.help {
display: none;
@@ -4711,19 +4584,40 @@ border-top-right-radius: 6px;
display:none;
- padding-: 78px;
+ padding-: 0;
}
div.login_block_user {
min-width: 0;
+ width: 100%;
}
div.login_block {
- top: 2px;
-
- max-width: 100px;
+ browser->layout == 'phone' && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
+ display: none;
+ padding-top: 20px;
+ padding-left: 20px;
+ padding-right: 20px;
- max-width: 82px;
-
+ padding-top: 10px;
+ padding-left: 5px;
+ padding-right: 5px;
+
+ top: inherit !important;
+ left: 0 !important;
+ text-align: center;
+ vertical-align: middle;
+ background: #FFF;
+ height: 42px;
+
+ z-index: 202;
+ min-width: 190px;
+ max-width: 190px;
+ width: 190px;
+ }
+ div.login_block_user, div.login_block_other { clear: both; }
+ .atoplogin, .atoplogin:hover
+ {
+ color: #000 !important;
}
.login_block_elem {
padding: 0 !important;
@@ -4740,6 +4634,7 @@ border-top-right-radius: 6px;
.topmenuimage {
background-size: 20px auto;
margin-top: 2px !important;
+ left: 2px;
}
div.mainmenu {
min-width: 20px;
diff --git a/htdocs/theme/md/ckeditor/config.js b/htdocs/theme/md/ckeditor/config.js
index eb88af48a04..6f1bbe7fb30 100644
--- a/htdocs/theme/md/ckeditor/config.js
+++ b/htdocs/theme/md/ckeditor/config.js
@@ -31,25 +31,25 @@ CKEDITOR.editorConfig = function( config )
['Templates','NewPage'],
['Save'],
['Source','Maximize','Preview'],
- ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
+ ['PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
+ ['CreateDiv','ShowBlocks'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
- ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
+ ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
['Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
['Styles','Format','Font','FontSize'],
- ['TextColor','BGColor'],
- ['Maximize', 'ShowBlocks']
+ ['TextColor','BGColor']
];
// Used for mailing fields
config.toolbar_dolibarr_mailings =
[
['Source','Maximize','Preview'],
- ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
+ ['SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Undo','Redo','-','Find','Replace'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
@@ -62,7 +62,7 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_notes =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
+ ['SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Undo','Redo','-','Find','Replace'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
@@ -75,9 +75,9 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_details =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
+ ['SpellChecker', 'Scayt'], // 'Cut','Copy','Paste','-', are useless, can be done with right click, even on smarpthone
['Format','Font','FontSize'],
- ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
+ ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], // ,'Subscript','Superscript' useless
['NumberedList','BulletedList','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','SpecialChar']
diff --git a/htdocs/theme/md/img/edit.png b/htdocs/theme/md/img/edit.png
index 7012f52be5a..6334689a36e 100644
Binary files a/htdocs/theme/md/img/edit.png and b/htdocs/theme/md/img/edit.png differ
diff --git a/htdocs/theme/md/img/reload.png b/htdocs/theme/md/img/reload.png
deleted file mode 100644
index a4fac077e7a..00000000000
Binary files a/htdocs/theme/md/img/reload.png and /dev/null differ
diff --git a/htdocs/theme/md/img/save.png b/htdocs/theme/md/img/save.png
new file mode 100644
index 00000000000..eca2d92eccc
Binary files /dev/null and b/htdocs/theme/md/img/save.png differ
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index d80630f0501..d38391504fa 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -82,7 +82,7 @@ $dol_no_mouse_hover=$conf->dol_no_mouse_hover;
$colorbackhmenu1='90,50,120'; // topmenu
$colorbackvmenu1='255,255,255'; // vmenu
$colortopbordertitle1=''; // top border of tables-lists title. not defined = default to colorbackhmenu1
-$colorbacktitle1='230,230,230'; // title of tables-lists
+$colorbacktitle1='240,240,240'; // title of tables-lists
$colorbacktabcard1='255,255,255'; // card
$colorbacktabactive='234,234,234';
$colorbacklineimpair1='255,255,255'; // line impair
@@ -90,7 +90,7 @@ $colorbacklineimpair2='255,255,255'; // line impair
$colorbacklinepair1='250,250,250'; // line pair
$colorbacklinepair2='248,248,248'; // line pair
$colorbacklinepairhover='244,244,244'; // line pair
-$colorbackbody='248,248,248';
+$colorbackbody='240,240,240';
$colortexttitlenotab='90,90,90';
$colortexttitle='20,20,20';
$colortext='0,0,0';
@@ -281,7 +281,7 @@ textarea.cke_source:focus
box-shadow: none;
}
-.liste_titre input[name=month], .liste_titre input[name=month_lim] {
+.liste_titre input[name=monthvalid], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre input[name=month_lim] {
margin-right: 4px;
}
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {
@@ -346,6 +346,12 @@ span.timesheetalreadyrecorded input {
select.flat, form.flat select {
font-weight: normal;
}
+.optionblue {
+ color: rgb() !important;
+}
+.select2-results .select2-highlighted.optionblue {
+ color: #FFF !important;
+}
.optiongrey, .opacitymedium {
opacity: 0.5;
}
@@ -521,6 +527,9 @@ textarea.centpercent {
.nowrap {
white-space: ;
}
+.nowraponall {
+ white-space: nowrap;
+}
.nobold {
font-weight: normal !important;
}
@@ -536,6 +545,9 @@ textarea.centpercent {
.cursorpointer {
cursor: pointer;
}
+.cusormove {
+ cursor: move;
+}
.badge {
display: inline-block;
min-width: 10px;
@@ -550,9 +562,6 @@ textarea.centpercent {
background-color: #777;
border-radius: 10px;
}
-.movable {
- cursor: move;
-}
.borderrightlight
{
@@ -587,9 +596,10 @@ div.myavailability {
padding-bottom: 4px;
}
.checkallactions {
- vertical-align: text-bottom;
- margin-top: 6px;
- margin-left: 4px;
+ /*vertical-align: text-bottom;
+ margin-top: 6px;*/
+ margin-left: 2px; /* left must be same than right to keep checkbox centered */
+ margin-right: 2px; /* left must be same than right to keep checkbox centered */
}
.selectlimit, .marginrightonly {
margin-right: 10px !important;
@@ -603,6 +613,9 @@ div.myavailability {
.strikefordisabled {
text-decoration: line-through;
}
+.widthdate {
+ width: 130px;
+}
/* using a tdoverflowxxx make the min-width not working */
.tdoverflow {
max-width: 0;
@@ -616,6 +629,12 @@ div.myavailability {
text-overflow: ellipsis;
white-space: nowrap;
}
+.tdoverflowmax200 { /* For tdoverflow, the max-midth become a minimum ! */
+ max-width: 200px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
.tdoverflowmax300 {
max-width: 300px;
overflow: hidden;
@@ -683,7 +702,7 @@ div.fiche>form>div.div-table-responsive {
justify-content: flex-start;
}
.thumbstat {
- flex: 1 1 120px;
+ flex: 1 1 114px;
}
.thumbstat150 {
flex: 1 1 150px;
@@ -708,6 +727,9 @@ div.fiche>form>div.div-table-responsive {
/* rule for not too small screen only */
@media only screen and (min-width: px)
{
+ .width50 { width: 50px; }
+ .width100 { width: 100px; }
+ .width200 { width: 200px; }
.minwidth100 { min-width: 100px; }
.minwidth200 { min-width: 200px; }
.minwidth300 { min-width: 300px; }
@@ -721,6 +743,9 @@ div.fiche>form>div.div-table-responsive {
.minwidth400imp { min-width: 400px !important; }
.minwidth500imp { min-width: 500px !important; }
}
+.width50 { width: 50px; }
+.width100 { width: 100px; }
+.width200 { width: 200px; }
.maxwidth25 { max-width: 25px; }
.maxwidth50 { max-width: 50px; }
.maxwidth75 { max-width: 75px; }
@@ -914,7 +939,7 @@ td.showDragHandle {
display: block;
font-family: "RobotoDraft","Roboto",sans-serif;
left: 0;
-global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
+browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
position: fixed;
top: 50px;
@@ -943,7 +968,7 @@ td.showDragHandle {
-moz-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-overflow-scrolling: touch;
-global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
+browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
overflow-x: hidden;
overflow-y: auto;
@@ -955,7 +980,7 @@ td.showDragHandle {
}
/* For smartphone (testmenuhider is on) */
-global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
+browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
#id-container {
width: 100%;
}
@@ -967,7 +992,7 @@ div.login_block {
top: inherit !important;
}
.side-nav {
-global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
+browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
overflow-x: initial !important;
overflow-y: scroll;
@@ -989,7 +1014,7 @@ div.login_block {
z-index: 201;
background: #FFF;
border-right: 1px solid rgba(0,0,0,0.3);
-global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
+browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
top: 50px ! important;
top: 60px ! important;
@@ -1109,6 +1134,9 @@ table.noborder tr.liste_titre td {
.pictowarning, .pictopreview {
padding-: 3px;
}
+.pictoedit, .pictowarning, .pictodelete {
+ vertical-align: text-bottom;
+}
.colorthumb {
padding-left: 1px !important;
padding-right: 1px;
@@ -1142,6 +1170,9 @@ div.statusref {
margin-bottom: 10px;
clear: both;
}
+div.statusref img {
+ padding-left: 8px;
+}
img.photoref, div.photoref {
border: 1px solid #CCC;
-moz-box-shadow: 3px 3px 4px #DDD;
@@ -1520,20 +1551,29 @@ foreach($mainmenuusedarray as $val)
.bodylogin
{
background: #f0f0f0;
+ display: table;
+ position: absolute;
+ height: 100%;
+ width: 100%;
}
+.login_center {
+ display: table-cell;
+ vertical-align: middle;
+}
.login_vertical_align {
padding: 10px;
+ padding-bottom: 80px;
}
form#login {
- margin-top: px;
- margin-bottom: 30px;
+ padding-bottom: 30px;
font-size: 13px;
vertical-align: middle;
}
.login_table_title {
max-width: 530px;
- color: #888888 !important;
- text-shadow: 1px 1px 1px #FFF;
+ color: #aaa !important;
+ padding-bottom: 20px;
+ /* text-shadow: 1px 1px 1px #FFF; */
}
.login_table label {
text-shadow: 1px 1px 1px #FFF;
@@ -1618,7 +1658,7 @@ div.login_block {
padding-bottom: 3px;
: 0;
top: 0px;
-global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
+browser->layout, array('phone','tablet')) && ((GETPOST('testmenuhider') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { ?>
position: absolute;
position: fixed;
@@ -1658,7 +1698,7 @@ div.login_block_other { padding-top: 3px; }
height: 16px;
}
.login_block_elem_name {
- margin-top: 5px;
+ margin-top: 1px;
}
.atoplogin, .atoplogin:hover {
color: # !important;
@@ -1672,6 +1712,10 @@ div.login_block_other { padding-top: 3px; }
.alogin:hover, .atoplogin:hover {
text-decoration:underline !important;
}
+span.fa.atoplogin, span.fa.atoplogin:hover {
+ font-size: 16px;
+ text-decoration: none !important;
+}
img.login, img.printer, img.entity {
/* padding: 0px 0px 0px 4px; */
/* margin: 0px 0px 0px 8px; */
@@ -1680,14 +1724,24 @@ img.login, img.printer, img.entity {
font-weight: bold;
}
.userimgatoplogin img.userphoto { /* size for user photo in login bar */
- border-radius: 5px;
+ border-radius: 8px;
width: 16px;
height: 16px;
+ background-size: contain;
vertical-align: text-bottom;
}
img.userphoto { /* size for user photo in lists */
+ border-radius: 9px;
width: 18px;
height: 18px;
+ background-size: contain;
+ vertical-align: middle;
+}
+img.userphotosmall { /* size for user photo in lists */
+ border-radius: 6px;
+ width: 12px;
+ height: 12px;
+ background-size: contain;
vertical-align: middle;
}
.span-icon-user {
@@ -1737,7 +1791,7 @@ div.vmenu, td.vmenu {
}
#menu_contenu_logo { padding-right: 4px; }
.companylogo { padding-top: 4px; }
-.searchform { padding-top: 8px; }
+.searchform { padding-top: 10px; }
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { white-space: nowrap; font-size:px; font-family: ; text-align: ; font-weight: bold; }
font.vmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; }
@@ -1750,8 +1804,11 @@ font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #666666; text-decoration: none; }
-
-div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks
+div.blockvmenulogo
+{
+ border-bottom: 0 !important;
+}
+div.blockvmenupair, div.blockvmenuimpair
{
font-family: ;
color: #000000;
@@ -1766,11 +1823,21 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks
padding-bottom: 10px;
border-bottom: 1px solid #e0e0e0;
}
+div.blockvmenubookmarks
+{
+ padding-bottom: 16px !important;
+}
+div.blockvmenuend {
+ border: none !important;
+ padding-left: 0 !important;
+}
a.vsmenu.addbookmarkpicto {
padding-right: 10px;
}
-
-div.blockvmenusearch
+div.blockvmenufirst {
+ padding-top: 10px;
+}
+div.blockvmenusearch, div.blockvmenubookmarks
{
font-family: ;
color: #000000;
@@ -1780,7 +1847,7 @@ div.blockvmenusearch
padding-right: 1px;
padding-top: 3px;
padding-bottom: 3px;
- margin: 1px 0px 12px 0px;
+ margin: 1px 0px 2px 0px;
padding-bottom: 10px;
/* border-bottom: 1px solid #f4f4f4; */
@@ -1925,6 +1992,9 @@ div.tabBar {
padding-bottom: 12px;
border-bottom: 1px solid #aaa;
}
+div.tabBar div.titre {
+ padding-top: 10px;
+}
div.tabBarWithBottom {
padding-bottom: 18px;
border-bottom: 1px solid #aaa;
@@ -1934,7 +2004,7 @@ div.tabBar table.tableforservicepart2:last-child {
}
div.tabsAction {
- margin: 20px 0em 25px 0em;
+ margin: 20px 0em 20px 0em;
padding: 0em 0em;
text-align: right;
}
@@ -2232,7 +2302,7 @@ table.borderplus {
}
.border tbody tr, .border tbody tr td, div.tabBar table.border tr {
- height: 20px;
+ height: 22px;
}
table.border td, div.border div div.tagtd {
@@ -2301,8 +2371,17 @@ table.paddingtopbottomonly tr td {
padding-bottom: 2px;
}
+.liste_titre_filter {
+ background: rgb() !important;
+}
tr.liste_titre_filter td.liste_titre {
- border-bottom: 1px solid #eee;
+ border-bottom: 1px solid #FDFFFF;
+}
+.liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd
+{
+ /*border-top-width: 1px;
+ border-top-color: rgb();
+ border-top-style: solid;*/
}
.liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd
{
@@ -2413,6 +2492,7 @@ div.pagination li {
div.pagination li.pagination a,
div.pagination li.pagination span {
padding: 6px 12px;
+ padding-top: 8px;
line-height: 1.42857143;
color: #000;
text-decoration: none;
@@ -2452,9 +2532,10 @@ div.pagination li a:hover,
div.pagination li span:hover,
div.pagination li a:focus,
div.pagination li span:focus {
- color: #000;
- background-color: #eee;
- border-color: #ddd;
+ color: #000;
+ background-color: #eee;
+ border-color: #ddd;
+ padding-top: 8px;
}
div.pagination li .active a,
div.pagination li .active span,
@@ -2481,6 +2562,7 @@ div.pagination .disabled a:focus {
}
div.pagination li.pagination .active {
text-decoration: underline;
+ box-shadow: none;
}
div.pagination li.paginationafterarrows {
margin-left: 10px;
@@ -2517,21 +2599,21 @@ div.pagination li.paginationafterarrows {
*/
/* Set the color for hover lines */
-.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover
+.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover
{
background: rgb() !important;
}
-.oddeven, .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover
{
font-family: ;
border: 0px;
margin-bottom: 1px;
color: #202020;
}
-.odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.impair, .nohover .impair:hover, tr.impair td.nohover
{
background: #;
}
@@ -2539,15 +2621,15 @@ div.pagination li.paginationafterarrows {
background: #;
}
-.oddeven, .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover {
font-family: ;
margin-bottom: 1px;
color: #202020;
}
-.even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.pair, .nohover .pair:hover, tr.pair td.nohover {
background-color: #;
}
-table.dataTable tr.odd, table.dataTable tr.oddeven {
+table.dataTable tr.oddeven {
background-color: # !important;
}
@@ -2556,7 +2638,7 @@ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.imp
background-color: # !important;
background: # !important;
}
-tr.nohoverpair td {
+td.evenodd, tr.nohoverpair td {
background-color: # !important;
background: # !important;
}
@@ -2564,17 +2646,17 @@ tr.nohoverpair td {
table.dataTable td {
padding: 5px 2px 5px 3px !important;
}
-tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
+tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
padding: 5px 2px 5px 3px;
border-bottom: 1px solid #eee;
}
form.pair, form.impair {
font-weight: normal;
}
-tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
+tr.pair:last-of-type td, tr.impair:last-of-type td {
border-bottom: 0px !important;
}
-tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td {
+tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td {
border-bottom: 0px !important;
}
td.nobottom, td.nobottom {
@@ -2647,6 +2729,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
font-family: ;
font-weight: ;
vertical-align: middle;
+ height: 24px;
}
tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
text-shadow: none !important;
@@ -2666,7 +2749,7 @@ tr.liste_titre_topborder td {
.liste_titre td a.notasortlink:hover {
background: transparent;
}
-tr.liste_titre:last-child th.liste_titre, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */
+tr.liste_titre:last-child th.liste_titre, tr.liste_titre:last-child th.liste_titre_sel, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */
border-bottom: 1px solid rgb();
}
@@ -3342,6 +3425,7 @@ a.websitebuttonsitepreview img {
/* Module agenda */
/* ============================================================================== */
+.agendacell { height: 60px; }
table.cal_month { border-spacing: 0px; }
table.cal_month td:first-child { border-left: 0px; }
table.cal_month td:last-child { border-right: 0px; }
@@ -3352,8 +3436,8 @@ table.cal_month td:last-child { border-right: 0px; }
.cal_other_month_peruserleft { border-top: 0; border-left: solid 2px #6C7C7B !important; border-right: 0; }
.cal_current_month_right { border-right: solid 1px #E0E0E0; }
.cal_other_month_right { border-right: solid 1px #C0C0C0; }
-.cal_other_month { opacity: 0.6; background: #EAEAEA; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
-.cal_past_month { opacity: 0.6; background: #EEEEEE; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
+.cal_other_month { /* opacity: 0.6; */ background: #EAEAEA; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
+.cal_past_month { /* opacity: 0.6; */ background: #EEEEEE; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_current_month { background: #FFFFFF; border-left: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_current_month_peruserleft { background: #FFFFFF; border-left: solid 2px #6C7C7B; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today { background: #FDFDF0; border-left: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
@@ -3365,18 +3449,10 @@ table.cal_month td:last-child { border-right: 0px; }
.cal_today_peruser_impair { background: #F8F8F0; }
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; opacity: 0.5; }
-table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 3px; border-radius: 3px;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
- moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
- background: -webkit-gradient(linear, left top, left bottom, from(#006aac), to(#00438d));
- min-height: 20px;
- }
+table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 3px; border-radius: 3px; min-height: 20px; }
table.cal_event td { border: none; padding-: 2px; padding-: 2px; padding-top: 0px; padding-bottom: 0px; }
table.cal_event td.cal_event { padding: 4px 4px !important; }
table.cal_event td.cal_event_right { padding: 4px 4px !important; }
-ul.cal_event { padding-right: 2px; padding-top: 1px; border: none; list-style-type: none; margin: 0 auto; padding-left: 0px; padding-start: 0px; -khtml-padding-start: 0px; -o-padding-start: 0px; -moz-padding-start: 0px; -webkit-padding-start: 0px; }
-li.cal_event { border: none; list-style-type: none; }
.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
@@ -4074,15 +4150,15 @@ a span.select2-chosen
/* Special case for the select2 add widget */
-#addbox .select2-container .select2-choice > .select2-chosen {
+#addbox .select2-container .select2-choice > .select2-chosen, #actionbookmark .select2-container .select2-choice > .select2-chosen {
text-align: left;
- opacity: 0.2;
+ opacity: 0.3;
}
/* Style used before the select2 js is executed on boxcombo */
-#boxcombo.boxcombo {
+#boxbookmark.boxcombo, #boxcombo.boxcombo {
text-align: left;
- opacity: 0.2;
- border-bottom: 1px solid #000;
+ opacity: 0.3;
+ border-bottom: solid 1px rgba(0,0,0,.4) !important;
height: 26px;
line-height: 24px;
padding: 0 0 5px 5px;
@@ -4095,7 +4171,7 @@ a span.select2-chosen
margin: 0 0 2px 3px;
position: relative;
line-height: 13px;
- color: #333;
+ color: #444;
cursor: default;
border: 1px solid #ddd;
border-radius: 3px;
@@ -4167,7 +4243,9 @@ ul.ulselectedfields {
dl.dropdown {
margin:0px;
padding:0px;
- vertical-align: middle;
+ margin-left: 2px;
+ margin-right: 2px;
+ vertical-align: text-bottom;
display: inline-block;
}
.dropdown dd, .dropdown dt {
diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php
index 62efff2f88f..d8aba34a934 100644
--- a/htdocs/user/agenda_extsites.php
+++ b/htdocs/user/agenda_extsites.php
@@ -151,9 +151,13 @@ print ' ';
$head=user_prepare_head($object);
-dol_fiche_head($head, 'extsites', $langs->trans("User"), 0, 'user');
+dol_fiche_head($head, 'extsites', $langs->trans("User"), -1, 'user');
-$linkback = ''.$langs->trans("BackToList").' ';
+$linkback = '';
+
+if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+}
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
@@ -185,8 +189,8 @@ while ($i <= $MAXAGENDA)
$offsettz='AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key;
$color='AGENDA_EXT_COLOR_'.$id.'_'.$key;
- $var=!$var;
- print "";
+
+ print ' ';
// Nb
print ''.$langs->trans("AgendaExtNb",$key)." ";
// Name
diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php
index 63cdacf958d..c9551cdbc23 100644
--- a/htdocs/user/bank.php
+++ b/htdocs/user/bank.php
@@ -131,9 +131,13 @@ if ($id && $action == 'create' && $user->rights->user->user->creer)
if ($id && $action != 'edit')
{
$title = $langs->trans("User");
- dol_fiche_head($head, 'bank', $title, 0, 'user');
+ dol_fiche_head($head, 'bank', $title, -1, 'user');
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = '';
+
+ if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+ }
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
@@ -232,14 +236,14 @@ if ($id && $action == 'edit' && $user->rights->user->user->creer)
$linkback = ''.$langs->trans("BackToList").' ';
- dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
+ dol_banner_tab($object, 'id', $linkback,$user->rights->user->user->lire || $user->admin);
- print '';
+ //print '
';
print '
';
print '
';
- print '
';
+ //print '
';
dol_fiche_end();
@@ -304,6 +308,10 @@ if ($id && $action == 'edit' && $user->rights->user->user->creer)
print '';
}
+if ($id && $action == 'edit' && $user->rights->user->user->creer) print '';
+
+if ($id && $action == 'edit' && $user->rights->user->user->creer) print '';
+
llxFooter();
$db->close();
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 839d09ee9c7..3255dc676cf 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -723,11 +723,10 @@ if (($action == 'create') || ($action == 'adduserldap'))
print dol_set_focus('#lastname');
- print '';
-
- print '';
+ print '';
// Lastname
+ print '';
print ''.$langs->trans("Lastname").' ';
print '';
if (! empty($ldap_lastname))
@@ -1203,7 +1202,11 @@ else
else
{
$title = $langs->trans("User");
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = '';
+
+ if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+ }
}
$head = user_prepare_head($object);
@@ -1257,7 +1260,6 @@ else
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
-
print '';
print '
';
@@ -1718,9 +1720,9 @@ else
foreach($groupslist as $group)
{
- $var=!$var;
+
- print "
";
+ print ' ';
print '';
if ($caneditgroup)
{
@@ -2346,35 +2348,38 @@ else
print '';
}
- print '';
- /*
- * Documents generes
- */
- $filename = dol_sanitizeFileName($object->ref);
- $filedir = $conf->user->dir_output . "/" . dol_sanitizeFileName($object->ref);
- $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->user->user->creer;
- $delallowed = $user->rights->user->user->supprimer;
-
- $var = true;
-
- $somethingshown = $formfile->show_documents('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
-
- // Show links to link elements
- $linktoelem = $form->showLinkToObjectBlock($object, null, null);
- $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
-
- print '
';
-
- // List of actions on element
- include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
- $formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'user', $socid);
+ if ($action != 'edit')
+ {
+ print '
';
+ /*
+ * Documents generes
+ */
+ $filename = dol_sanitizeFileName($object->ref);
+ $filedir = $conf->user->dir_output . "/" . dol_sanitizeFileName($object->ref);
+ $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
+ $genallowed = $user->rights->user->user->creer;
+ $delallowed = $user->rights->user->user->supprimer;
+
+ $var = true;
+
+ $somethingshown = $formfile->show_documents('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
+
+ // Show links to link elements
+ $linktoelem = $form->showLinkToObjectBlock($object, null, null);
+ $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
+
+ print '
';
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $somethingshown = $formactions->showactions($object, 'user', $socid);
+
+
+ print '
';
+ }
-
- print '
';
-
- if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close;
+ if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close();
}
}
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 4b9c1c9960c..f23c8aca0b6 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -104,16 +104,17 @@ class User extends CommonObject
public $lang;
public $rights; // Array of permissions user->rights->permx
- public $all_permissions_are_loaded; /**< \private all_permissions_are_loaded */
- private $_tab_loaded=array(); // Array of cache of already loaded permissions
- public $nb_rights; // Number of rights granted to the user
-
+ public $all_permissions_are_loaded; // All permission are loaded
+ public $nb_rights; // Number of rights granted to the user
+ private $_tab_loaded=array(); // Cache array of already loaded permissions
+
public $conf; // To store personal config
- var $oldcopy; // To contains a clone of this when we need to save old properties of object
-
+ public $default_values; // To store default values for user
+
public $users; // To store all tree of users hierarchy
public $parentof; // To store an array of all parents for all ids.
-
+ private $cache_childids;
+
public $accountancy_code; // Accountancy code in prevision of the complete accountancy module
public $thm; // Average cost of employee - Used for valuation of time spent
@@ -127,7 +128,6 @@ class User extends CommonObject
public $dateemployment; // Define date of employment by company
- private $cache_childids;
/**
@@ -164,11 +164,11 @@ class User extends CommonObject
* @param int $id If defined, id to used for search
* @param string $login If defined, login to used for search
* @param string $sid If defined, sid to used for search
- * @param int $loadpersonalconf 1=also load personal conf of user (in $user->conf->xxx)
+ * @param int $loadpersonalconf 1=also load personal conf of user (in $user->conf->xxx), 0=do not load personal conf.
* @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup.
* @return int <0 if KO, 0 not found, >0 if OK
*/
- function fetch($id='', $login='',$sid='',$loadpersonalconf=1, $entity=-1)
+ function fetch($id='', $login='', $sid='', $loadpersonalconf=0, $entity=-1)
{
global $conf, $user;
@@ -339,6 +339,7 @@ class User extends CommonObject
// To get back the global configuration unique to the user
if ($loadpersonalconf)
{
+ // Load user->conf for user
$sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param";
$sql.= " WHERE fk_user = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
@@ -359,11 +360,34 @@ class User extends CommonObject
}
else
{
- $this->error=$this->db->error();
+ $this->error=$this->db->lasterror();
return -2;
}
+
+ // Load user->default_values for user. TODO Save this in memcached ?
+ $sql = "SELECT rowid, entity, type, page, param, value";
+ $sql.= " FROM ".MAIN_DB_PREFIX."default_values";
+ $sql.= " WHERE entity IN (".$this->entity.",".$conf->entity.")";
+ $sql.= " AND user_id IN (0, ".$this->id.")";
+ $resql = $this->db->query($sql);
+ if ($resql)
+ {
+ while ($obj = $this->db->fetch_object($resql))
+ {
+ if (! empty($obj->page) && ! empty($obj->type) && ! empty($obj->param))
+ {
+ $this->default_values[$obj->page][$obj->type][$obj->param]=$obj->value;
+ }
+ }
+ $this->db->free($resql);
+ }
+ else
+ {
+ $this->error=$this->db->lasterror();
+ return -3;
+ }
}
-
+
return 1;
}
@@ -1968,7 +1992,7 @@ class User extends CommonObject
* Return a link to the user card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
*
- * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo)
+ * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
* @param string $option On what the link point to
* @param integer $infologin Add complete info tooltip
* @param integer $notooltip 1=Disable tooltip on picto and name
@@ -1986,12 +2010,18 @@ class User extends CommonObject
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
- $result = '';
- $companylink = '';
- $link = '';
-
- $label = '' . $langs->trans("User") . ' ';
- $label.= '';
+ $result=''; $label='';
+ $link=''; $linkstart=''; $linkend='';
+
+ if (! empty($this->photo))
+ {
+ $label.= '
';
+ $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
+ $label.= '
';
+ }
+
+ $label.= '
';
+ $label.= '' . $langs->trans("User") . ' ';
$label.= '' . $langs->trans('Name') . ': ' . $this->getFullName($langs,'','');
if (! empty($this->login))
$label.= '' . $langs->trans('Login') . ': ' . $this->login;
@@ -2008,12 +2038,6 @@ class User extends CommonObject
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$label.= '' . $langs->trans("Type") . ': ' . $type;
$label.='
';
- if (! empty($this->photo))
- {
- $label.= '
';
- $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
- $label.= '
';
- }
// Info Login
if ($infologin)
@@ -2072,12 +2096,12 @@ class User extends CommonObject
$paddafterimage='';
if (abs($withpictoimg) == 1) $paddafterimage='style="margin-right: 3px;"';
// Only picto
- if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'
';
+ if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'
';
// Picto must be a photo
- else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto', 'mini', 0, 1).'
';
+ else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1).'
';
$result.=$picto;
}
- if (abs($withpictoimg) != 2)
+ if ($withpictoimg > -2 && $withpictoimg != 2)
{
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='
';
if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen);
@@ -2086,7 +2110,9 @@ class User extends CommonObject
}
$result.=$linkend;
//if ($withpictoimg == -1) $result.='
';
+
$result.=$companylink;
+
return $result;
}
@@ -2118,7 +2144,7 @@ class User extends CommonObject
}
/**
- * Retourne le libelle du statut d'un user (actif, inactif)
+ * Return label of status of user (active, inactive)
*
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index cb1e9f875aa..5299f348431 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -96,12 +96,17 @@ if ($id > 0)
print '
';
print '
';
- dol_fiche_head($head, 'clicktodial', $title, 0, 'user');
+ dol_fiche_head($head, 'clicktodial', $title, -1, 'user');
- $linkback = '
'.$langs->trans("BackToList").' ';
+ $linkback = '';
+
+ if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = '
'.$langs->trans("BackToList").' ';
+ }
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
+ print '
';
print '
';
// Edit mode
@@ -193,6 +198,7 @@ if ($id > 0)
print '
';
}
+ print '
';
print '';
/*
diff --git a/htdocs/user/document.php b/htdocs/user/document.php
index 081bf2bc408..a8d5000e809 100644
--- a/htdocs/user/document.php
+++ b/htdocs/user/document.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2015 Laurent Destailleur
+ * Copyright (C) 2004-2017 Laurent Destailleur
* Copyright (C) 2005-2015 Regis Houssin
* Copyright (C) 2010 Juanjo Menent
* Copyright (C) 2013 Cédric Salvador
@@ -129,16 +129,20 @@ if ($object->id)
$form=new Form($db);
- dol_fiche_head($head, 'document', $langs->trans("User"),0,'user');
-
- $linkback = ''.$langs->trans("BackToList").' ';
+ dol_fiche_head($head, 'document', $langs->trans("User"), -1, 'user');
+ $linkback = '';
+ if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+ }
+
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
+ print '';
print '
';
// Construit liste des fichiers
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
@@ -158,12 +162,14 @@ if ($object->id)
print '
'.$langs->trans("TotalSizeOfAttachedFiles").' '.$totalsize.' '.$langs->trans("bytes").' ';
print '
';
-
+ print '';
+
dol_fiche_end();
$modulepart = 'user';
$permission = $user->rights->user->user->creer;
+ $permtoedit = $user->rights->user->user->creer;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 192d681ca81..eacb954e007 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -454,9 +454,9 @@ else
foreach($object->members as $useringroup)
{
- $var=!$var;
+
- print " ";
+ print ' ';
print '';
print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login');
if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"),'redstar');
diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php
index 94c12147f1a..539c1f2be23 100644
--- a/htdocs/user/group/index.php
+++ b/htdocs/user/group/index.php
@@ -171,9 +171,9 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print " ";
+ print ' ';
print ''.img_object($langs->trans("ShowGroup"),"group").' '.$obj->name.' ';
if (! $obj->entity)
{
diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php
index 888d4ca5317..734b1aa0d14 100644
--- a/htdocs/user/hierarchy.php
+++ b/htdocs/user/hierarchy.php
@@ -144,14 +144,8 @@ print '';
-print '';
-print_liste_field_titre($langs->trans("HierarchicView"));
-print_liste_field_titre('',$_SERVER['PHP_SELF'],"",'',"",'align="center"');
-print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"",'',"",'align="right"');
-print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','','','','maxwidthsearch ');
-print ' ';
-print '';
+print ' ';
print ' ';
print ' ';
// Status
@@ -164,6 +158,14 @@ print $searchpitco;
print '';
print ' ';
+print '';
+print_liste_field_titre($langs->trans("HierarchicView"));
+print_liste_field_titre('',$_SERVER['PHP_SELF'],"",'',"",'align="center"');
+print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"",'',"",'align="right"');
+print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','','','','maxwidthsearch ');
+print ' ';
+
+
$nbofentries=(count($data) - 1);
if ($nbofentries > 0)
diff --git a/htdocs/user/home.php b/htdocs/user/home.php
index 29ef7dac061..66a4448491e 100644
--- a/htdocs/user/home.php
+++ b/htdocs/user/home.php
@@ -124,9 +124,9 @@ if ($resql)
while ($i < $num && $i < $max)
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print "";
+ print ' ';
print '';
$fuserstatic->id = $obj->rowid;
$fuserstatic->statut = $obj->statut;
@@ -237,9 +237,9 @@ if ($canreadperms)
while ($i < $num && (! $max || $i < $max))
{
$obj = $db->fetch_object($resql);
- $var=!$var;
+
- print " ";
+ print ' ';
print ''.img_object($langs->trans("ShowGroup"),"group").' '.$obj->name.' ';
if (! $obj->entity)
{
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index 60defe580a7..c3a32ae02fc 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -174,6 +174,7 @@ if (empty($reshook))
* View
*/
+$user2=new User($db);
$buttonviewhierarchy=' ';
@@ -315,43 +316,8 @@ $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfiel
print '';
print '
'."\n";
-print '';
-if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.gender']['checked'])) print_liste_field_titre($langs->trans("Gender"),$_SERVER['PHP_SELF'],"u.gender",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.employee']['checked'])) print_liste_field_titre($langs->trans("Employee"),$_SERVER['PHP_SELF'],"u.employee",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER['PHP_SELF'],"u.accountancy_code",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER['PHP_SELF'],"u.email",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder);
-if (! empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder);
-if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre($langs->trans("PreviousConnexion"),$_SERVER['PHP_SELF'],"u.datepreviouslogin",$param,"",'align="center"',$sortfield,$sortorder);
-// Extra fields
-if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
-{
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
-}
-// Hook fields
-$parameters=array('arrayfields'=>$arrayfields);
-$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
-print $hookmanager->resPrint;
-if (! empty($arrayfields['u.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"u.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
-if (! empty($arrayfields['u.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"u.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
-if (! empty($arrayfields['u.statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"u.statut","",$param,'align="center"',$sortfield,$sortorder);
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
-print " \n";
-
// Search bar
-print '';
+print ' ';
if (! empty($arrayfields['u.login']['checked']))
{
print ' ';
@@ -459,7 +425,43 @@ print '';
print " \n";
-$user2=new User($db);
+
+print '';
+if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre($langs->trans("Lastname"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.gender']['checked'])) print_liste_field_titre($langs->trans("Gender"),$_SERVER['PHP_SELF'],"u.gender",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.employee']['checked'])) print_liste_field_titre($langs->trans("Employee"),$_SERVER['PHP_SELF'],"u.employee",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER['PHP_SELF'],"u.accountancy_code",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.email']['checked'])) print_liste_field_titre($langs->trans("EMail"),$_SERVER['PHP_SELF'],"u.email",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_soc",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.entity']['checked'])) print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u.fk_user",$param,"","",$sortfield,$sortorder);
+if (! empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder);
+if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre($langs->trans("PreviousConnexion"),$_SERVER['PHP_SELF'],"u.datepreviouslogin",$param,"",'align="center"',$sortfield,$sortorder);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ $align=$extrafields->getAlignFlag($key);
+ print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+ }
+ }
+}
+// Hook fields
+$parameters=array('arrayfields'=>$arrayfields);
+$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+if (! empty($arrayfields['u.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"u.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+if (! empty($arrayfields['u.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"u.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+if (! empty($arrayfields['u.statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"u.statut","",$param,'align="center"',$sortfield,$sortorder);
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
+print " \n";
+
+
$i = 0;
while ($i < min($num,$limit))
diff --git a/htdocs/user/info.php b/htdocs/user/info.php
index 5ea7200a0f7..86bff7147ff 100644
--- a/htdocs/user/info.php
+++ b/htdocs/user/info.php
@@ -65,10 +65,14 @@ llxHeader();
$head = user_prepare_head($object);
$title = $langs->trans("User");
-dol_fiche_head($head, 'info', $title, 0, 'user');
+dol_fiche_head($head, 'info', $title, -1, 'user');
-$linkback = ''.$langs->trans("BackToList").' ';
+$linkback = '';
+
+if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+}
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php
index 1da5911861c..0f0cc6b4ed7 100644
--- a/htdocs/user/ldap.php
+++ b/htdocs/user/ldap.php
@@ -96,7 +96,11 @@ $head = user_prepare_head($object);
$title = $langs->trans("User");
dol_fiche_head($head, 'ldap', $title, 0, 'user');
-$linkback = ''.$langs->trans("BackToList").' ';
+$linkback = '';
+
+if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+}
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
diff --git a/htdocs/user/note.php b/htdocs/user/note.php
index 38aef489b87..ae685391299 100644
--- a/htdocs/user/note.php
+++ b/htdocs/user/note.php
@@ -88,9 +88,13 @@ if ($id)
$head = user_prepare_head($object);
$title = $langs->trans("User");
- dol_fiche_head($head, 'note', $title, 0, 'user');
+ dol_fiche_head($head, 'note', $title, -1, 'user');
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = '';
+
+ if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+ }
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
@@ -99,6 +103,7 @@ if ($id)
print "";
print ' ';
+ print '';
print '
';
// Login
@@ -123,6 +128,7 @@ if ($id)
print "";
print "
";
+ print '
';
dol_fiche_end();
diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php
index 4e84a8b83fa..4f47578f543 100644
--- a/htdocs/user/notify/card.php
+++ b/htdocs/user/notify/card.php
@@ -44,15 +44,16 @@ $actionid=GETPOST('actionid');
if ($user->societe_id) $id=$user->societe_id;
$result = restrictedArea($user, 'societe','','');
-$sortfield = GETPOST("sortfield",'alpha');
-$sortorder = GETPOST("sortorder",'alpha');
-$page = GETPOST("page",'int');
-if ($page == -1) { $page = 0; }
-$offset = $conf->liste_limit * $page;
-$pageprev = $page - 1;
-$pagenext = $page + 1;
+$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
+$sortfield=GETPOST("sortfield",'alpha');
+$sortorder=GETPOST("sortorder",'alpha');
+$page=GETPOST("page",'int');
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="n.daten";
+if (empty($page) || $page == -1) { $page = 0; }
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
$now=dol_now();
@@ -135,36 +136,45 @@ if ($result > 0)
$head = user_prepare_head($object);
- dol_fiche_head($head, 'notify', $langs->trans("User"),0,'user');
+ dol_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user');
$linkback = ''.$langs->trans("BackToList").' ';
- dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
+ dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', '', '', 0, '', '', 0, '');
+
+ print '';
- /*print '
';
-
- // Ref
- print ''.$langs->trans("Ref").' ';
+ print '
';
+ print '';
+
+ // Login
+ print ''.$langs->trans("Login").' ';
+ if (! empty($object->ldap_sid) && $object->statut==0)
+ {
+ print ''.$langs->trans("LoginAccountDisableInDolibarr").' ';
+ }
+ else
+ {
+ print ''.$object->login.' ';
+ }
+ print ' '."\n";
+
+ /*print ''.$langs->trans("NbOfActiveNotifications").' '; // Notification for this thirdparty
print '';
- print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
- print ' ';
- print ' '."\n";
-
- print ''.$langs->trans("Lastname").' ';
- print ''.$object->lastname.' ';
-
- // Firstname
- print ''.$langs->trans("Firstname").' ';
- print ''.$object->firstname.' ';
- print ' '."\n";
-
- // EMail
- print ''.$langs->trans("EMail").' ';
- print ''.dol_print_email($object->email,0,0,1).' ';
- print " \n";
-
- print '
';*/
-
+ $nbofrecipientemails=0;
+ $notify=new Notify($db);
+ $tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
+ foreach($tmparray as $tmpkey => $tmpval)
+ {
+ $nbofrecipientemails++;
+ }
+ print $nbofrecipientemails;
+ print ' ';*/
+
+ print '
';
+
+ print '
';
+
dol_fiche_end();
print "\n";
@@ -211,7 +221,7 @@ if ($result > 0)
$label=($langs->trans("Notify_".$notifiedevent['code'])!="Notify_".$notifiedevent['code']?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']);
$actions[$notifiedevent['rowid']]=$label;
}
- print '';
+ print ' ';
print $object->getNomUrl(1);
if (isValidEmail($object->email))
{
@@ -235,7 +245,7 @@ if ($result > 0)
}
else
{
- print ' ';
+ print ' ';
print $langs->trans("YouMustAssignUserMailFirst");
print ' ';
}
@@ -297,7 +307,7 @@ if ($result > 0)
$userstatic->id=$obj->userid;
$userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname;
- print ''.$userstatic->getNomUrl(1);
+ print ' '.$userstatic->getNomUrl(1);
if ($obj->type == 'email')
{
if (isValidEmail($obj->email))
@@ -333,7 +343,7 @@ if ($result > 0)
{
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
$var = ! $var;
- print ' ';
+ print ' ';
$listtmp=explode(',',$val);
$first=1;
foreach($listtmp as $keyemail => $valemail)
@@ -369,13 +379,13 @@ if ($result > 0)
print ' '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).' ';
print ' ';
}*/
- if ($user->admin)
+ /*if ($user->admin)
{
$var = ! $var;
- print '';
+ print ' ';
print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).' ';
print ' ';
- }
+ }*/
print '
';
@@ -388,12 +398,22 @@ if ($result > 0)
$sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,";
$sql.= " a.code, a.label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
- $sql.= " ".MAIN_DB_PREFIX."notify as n ";
+ $sql.= " ".MAIN_DB_PREFIX."notify as n";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
$sql.= " WHERE a.rowid = n.fk_action";
$sql.= " AND n.fk_user = ".$object->id;
$sql.= $db->order($sortfield, $sortorder);
+ // Count total nb of records
+ $nbtotalofrecords = '';
+ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+ {
+ $result = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($result);
+ }
+
+ $sql.= $db->plimit($limit+1, $offset);
+
$resql=$db->query($sql);
if ($resql)
{
@@ -404,10 +424,21 @@ if ($result > 0)
dol_print_error($db);
}
+ $param='&id='.$object->id;
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+
+ print '
';
+ if ($optioncss != '') print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+
// List of notifications done
- print_fiche_titre($langs->trans("ListOfNotificationsDone").' ('.$num.')','','');
- $var=true;
-
+ print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
+
// Line with titles
print '';
print '';
@@ -426,11 +457,9 @@ if ($result > 0)
while ($i < $num)
{
- $var = !$var;
-
$obj = $db->fetch_object($resql);
- print ' ';
+ print ' ';
if ($obj->id > 0)
{
$userstatic->id=$obj->id;
@@ -470,6 +499,8 @@ if ($result > 0)
}
print '
';
+
+ print ' ';
}
else dol_print_error('','RecordNotFound');
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index f0ca0f17c31..473c06e7368 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2005-2017 Laurent Destailleur
* Copyright (C) 2010-2015 Regis Houssin
* Copyright (C) 2013 Florian Henry
*
@@ -65,7 +65,7 @@ $dirleft = "../core/menus/standard";
// Charge utilisateur edite
$object = new User($db);
-$object->fetch($id);
+$object->fetch($id, '', '', 1);
$object->getrights();
// Liste des zone de recherche permanentes supportees
@@ -81,9 +81,11 @@ $formadmin=new FormAdmin($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('usercard','globalcard'));
+
/*
* Actions
*/
+
$parameters=array('id'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -180,8 +182,12 @@ if ($action == 'edit')
if ($action == 'edit')
{
dol_fiche_head($head, 'guisetup', $title, 0, 'user');
-
- $linkback = ''.$langs->trans("BackToList").' ';
+
+ $linkback = '';
+
+ if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+ }
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
@@ -239,8 +245,8 @@ if ($action == 'edit')
print ''.$langs->trans("Parameter").' '.$langs->trans("DefaultValue").' '.$langs->trans("PersonalValue").' ';
// Landing page
- $var=!$var;
- print ''.$langs->trans("LandingPage").' ';
+
+ print ''.$langs->trans("LandingPage").' ';
print '';
print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
print ' ';
@@ -253,8 +259,8 @@ if ($action == 'edit')
print ' ';
// Langue par defaut
- $var=!$var;
- print ''.$langs->trans("Language").' ';
+
+ print ''.$langs->trans("Language").' ';
print '';
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
print $s?$s.' ':'';
@@ -268,8 +274,8 @@ if ($action == 'edit')
print ' ';
// Taille max des listes
- $var=!$var;
- print ''.$langs->trans("MaxSizeList").' ';
+
+ print ''.$langs->trans("MaxSizeList").' ';
print ''.$conf->global->MAIN_SIZE_LISTE_LIMIT.' ';
print ' conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"");
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
@@ -293,7 +299,7 @@ if ($action == 'edit')
}
else
{
- dol_fiche_head($head, 'guisetup', $title, 0, 'user');
+ dol_fiche_head($head, 'guisetup', $title, -1, 'user');
$linkback = ''.$langs->trans("BackToList").' ';
@@ -305,8 +311,8 @@ else
print ''.$langs->trans("Parameter").' '.$langs->trans("DefaultValue").' '.$langs->trans("PersonalValue").' ';
// Landing page
- $var=!$var;
- print ''.$langs->trans("LandingPage").' ';
+
+ print ''.$langs->trans("LandingPage").' ';
print '';
print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
print ' ';
@@ -323,8 +329,8 @@ else
print ' ';
// Language
- $var=!$var;
- print ''.$langs->trans("Language").' ';
+
+ print ''.$langs->trans("Language").' ';
print '';
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
print ($s?$s.' ':'');
@@ -337,8 +343,8 @@ else
print (isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):(! empty($object->conf->MAIN_LANG_DEFAULT)?$langs->trans("Language_".$object->conf->MAIN_LANG_DEFAULT):''));
print ' ';
- $var=!$var;
- print ''.$langs->trans("MaxSizeList").' ';
+
+ print ''.$langs->trans("MaxSizeList").' ';
print ''.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').' ';
print ' conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").' ';
print '' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:' ') . ' ';
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index cb38d1c9e49..f7acc3609c7 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -214,11 +214,11 @@ $rowspan=2;
$urllogo=DOL_URL_ROOT.'/theme/login_logo.png';
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
{
- $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small);
+ $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('thumbs/'.$mysoc->logo_small);
}
elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))
{
- $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode($mysoc->logo);
+ $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($mysoc->logo);
$width=128;
}
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'))
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 95c3eb6c87f..e84cfe09ca8 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -125,7 +125,7 @@ $form=new Form($db);
$head = user_prepare_head($object);
$title = $langs->trans("User");
-dol_fiche_head($head, 'rights', $title, 0, 'user');
+dol_fiche_head($head, 'rights', $title, -1, 'user');
$db->begin();
@@ -257,7 +257,11 @@ else
* Ecran ajout/suppression permission
*/
-$linkback = ''.$langs->trans("BackToList").' ';
+$linkback = '';
+
+if ($user->rights->user->user->lire || $user->admin) {
+ $linkback = ''.$langs->trans("BackToList").' ';
+}
dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin);
diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php
index ae921114d6b..a611767cf2f 100644
--- a/htdocs/variants/card.php
+++ b/htdocs/variants/card.php
@@ -1,5 +1,4 @@
*
* This program is free software; you can redistribute it and/or modify
@@ -28,10 +27,10 @@ $ref = GETPOST('ref');
$confirm = GETPOST('confirm');
$cancel = GETPOST('cancel');
-$prodattr = new ProductAttribute($db);
-$prodattrval = new ProductAttributeValue($db);
+$object = new ProductAttribute($db);
+$objectval = new ProductAttributeValue($db);
-if ($prodattr->fetch($id) < 1) {
+if ($object->fetch($id) < 1) {
dol_print_error($db, $langs->trans('ErrorRecordNotFound'));
exit();
}
@@ -47,10 +46,10 @@ if ($_POST) {
if ($action == 'edit') {
- $prodattr->label = $label;
- $prodattr->ref = $ref;
+ $object->label = $label;
+ $object->ref = $ref;
- if ($prodattr->update() < 1) {
+ if ($object->update() < 1) {
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
} else {
setEventMessage($langs->trans('RecordSaved'));
@@ -59,19 +58,19 @@ if ($_POST) {
}
} elseif ($action == 'edit_value') {
- if ($prodattrval->fetch($valueid) > 0) {
+ if ($objectval->fetch($valueid) > 0) {
- $prodattrval->ref = $ref;
- $prodattrval->value = GETPOST('value');
+ $objectval->ref = $ref;
+ $objectval->value = GETPOST('value');
- if ($prodattrval->update() > 0) {
+ if ($objectval->update() > 0) {
setEventMessage($langs->trans('RecordSaved'));
} else {
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
}
}
- header('Location: '.dol_buildpath('/variants/card.php?id='.$prodattr->id, 2));
+ header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
exit();
}
@@ -82,12 +81,12 @@ if ($confirm == 'yes') {
$db->begin();
- $res = $prodattrval->deleteByFkAttribute($prodattr->id);
+ $res = $objectval->deleteByFkAttribute($object->id);
- if ($res < 1 || ($prodattr->delete() < 1)) {
+ if ($res < 1 || ($object->delete() < 1)) {
$db->rollback();
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
- header('Location: '.dol_buildpath('/variants/card.php?id='.$prodattr->id, 2));
+ header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
} else {
$db->commit();
setEventMessage($langs->trans('RecordSaved'));
@@ -97,15 +96,15 @@ if ($confirm == 'yes') {
exit();
} elseif ($action == 'confirm_deletevalue') {
- if ($prodattrval->fetch($valueid) > 0) {
+ if ($objectval->fetch($valueid) > 0) {
- if ($prodattrval->delete() < 1) {
+ if ($objectval->delete() < 1) {
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
} else {
setEventMessage($langs->trans('RecordSaved'));
}
- header('Location: '.dol_buildpath('/variants/card.php?id='.$prodattr->id, 2));
+ header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
exit();
}
}
@@ -118,38 +117,50 @@ if ($confirm == 'yes') {
$langs->load('products');
-$title = $langs->trans('ProductAttributeName', dol_htmlentities($prodattr->label));
+$title = $langs->trans('ProductAttributeName', dol_htmlentities($object->label));
$var = false;
llxHeader('', $title);
-print_fiche_titre($title);
+//print_fiche_titre($title);
-dol_fiche_head();
+$h=0;
+$head[$h][0] = DOL_URL_ROOT.'/variants/card.php?id='.$object->id;
+$head[$h][1] = $langs->trans("Card");
+$head[$h][2] = 'variant';
+$h++;
+
+dol_fiche_head($head, 'variant', $langs->trans('ProductAttributeName'), -1, 'generic');
if ($action == 'edit') {
- print '';
+ print ' ';
}
+
+if ($action != 'edit')
+{
+ print '';
+ print '
';
+}
?>
';
+}
+
dol_fiche_end();
if ($action == 'edit') { ?>
@@ -173,7 +190,7 @@ if ($action == 'edit') { ?>
$form = new Form($db);
print $form->formconfirm(
- "card.php?id=".$prodattr->id,
+ "card.php?id=".$object->id,
$langs->trans('Delete'),
$langs->trans('ProductAttributeDeleteDialog'),
"confirm_delete",
@@ -183,14 +200,14 @@ if ($action == 'edit') { ?>
);
} elseif ($action == 'delete_value') {
- if ($prodattrval->fetch($valueid) > 0) {
+ if ($objectval->fetch($valueid) > 0) {
$form = new Form($db);
print $form->formconfirm(
- "card.php?id=".$prodattr->id."&valueid=".$prodattrval->id,
+ "card.php?id=".$object->id."&valueid=".$objectval->id,
$langs->trans('Delete'),
- $langs->trans('ProductAttributeValueDeleteDialog', dol_htmlentities($prodattrval->value), dol_htmlentities($prodattrval->ref)),
+ $langs->trans('ProductAttributeValueDeleteDialog', dol_htmlentities($objectval->value), dol_htmlentities($objectval->ref)),
"confirm_deletevalue",
'',
0,
@@ -203,8 +220,8 @@ if ($action == 'edit') { ?>
@@ -219,7 +236,7 @@ if ($action == 'edit') { ?>
- fetchAllByProductAttribute($prodattr->id) as $attrval): ?>
+ fetchAllByProductAttribute($object->id) as $attrval): ?>
>
id)): ?>
@@ -233,8 +250,8 @@ if ($action == 'edit') { ?>
ref) ?>
value) ?>
-
-
+
+
@@ -250,7 +267,7 @@ if ($action == 'edit') { ?>
@@ -258,3 +275,4 @@ if ($action == 'edit') { ?>
}
llxFooter();
+$db->close();
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index dabace75ac0..4342b352478 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -1,6 +1,6 @@
+/* Copyright (C) 2016 Marcos GarcÃa
+ * Copyright (C) 2017 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,7 +35,13 @@ $weight_impact = (float) GETPOST('weight_impact');
$price_impact = (float) GETPOST('price_impact');
$price_impact_percent = (bool) GETPOST('price_impact_percent');
$form = new Form($db);
-$action = GETPOST('action');
+
+$action=GETPOST('action','alpha');
+$massaction=GETPOST('massaction','alpha');
+$show_files=GETPOST('show_files','int');
+$confirm=GETPOST('confirm','alpha');
+$toselect = GETPOST('toselect', 'array');
+$cancel = GETPOST('cancel');
// Security check
$fieldvalue = (! empty($id) ? $id : $ref);
@@ -52,16 +58,34 @@ if ($id > 0 || $ref)
$object->fetch($id, $ref);
}
+$selectedvariant = $_SESSION['addvariant_'.$object->id];
+
/*
* Actions
*/
+if ($cancel) {
+ $action='';
+ $massactions='';
+ unset($_SESSION['addvariant_'.$object->id]);
+}
+
if (! $object->isProduct()) {
header('Location: '.dol_buildpath('/product/card.php?id='.$object->id, 2));
exit();
}
+if (GETPOST('selectvariant'))
+{
+ $action = 'add';
+ if (GETPOST('attribute') != '-1' && GETPOST('value') != '-1')
+ {
+ $selectedvariant[GETPOST('attribute').':'.GETPOST('value')]=GETPOST('attribute').':'.GETPOST('value');
+ $_SESSION['addvariant_'.$object->id]=$selectedvariant;
+ }
+}
+
$prodcomb = new ProductCombination($db);
$prodcomb2val = new ProductCombination2ValuePair($db);
@@ -70,13 +94,16 @@ $productCombination2ValuePairs1 = array();
if ($_POST) {
- if ($action == 'add') {
+ if (($action == 'add' || $action == 'create') && empty($massaction) && ! GETPOST('selectvariant')) {
- $features = GETPOST('features', 'array');
+ //$features = GETPOST('features', 'array');
+ $features = $_SESSION['addvariant_'.$object->id];
if (!$features) {
setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors');
- } else {
+ }
+ else
+ {
$weight_impact = price2num($weight_impact);
$price_impact = price2num($price_impact);
$sanit_features = array();
@@ -107,9 +134,10 @@ if ($_POST) {
$db->begin();
if (!$prodcomb->fetchByProductCombination2ValuePairs($id, $sanit_features)) {
- if (ProductCombination::createProductCombination($product, $sanit_features, array(), $price_impact_percent, $price_impact, $weight_impact)) {
+ if (ProductCombination::createProductCombination($object, $sanit_features, array(), $price_impact_percent, $price_impact, $weight_impact)) {
$db->commit();
setEventMessage($langs->trans('RecordSaved'));
+ unset($_SESSION['addvariant_'.$object->id]);
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2));
exit();
} else {
@@ -121,17 +149,17 @@ if ($_POST) {
$db->rollback();
}
- } elseif ($action == 'bulk_actions') {
-
- $prodarray = array_keys(GETPOST('select', 'array'));
- $bulkaction = GETPOST('bulk_action');
+ }
+ elseif (! empty($massaction))
+ {
+ $bulkaction = $massaction;
$error = 0;
$prodstatic = new Product($db);
$db->begin();
- foreach ($prodarray as $prodid) {
+ foreach ($toselect as $prodid) {
if ($prodstatic->fetch($prodid) < 0) {
continue;
@@ -175,7 +203,8 @@ if ($_POST) {
setEventMessage($langs->trans('RecordSaved'));
}
- } else {
+ }
+ elseif ($valueid > 0) {
if ($prodcomb->fetch($valueid) < 0) {
dol_print_error($db, $langs->trans('ErrorRecordNotFound'));
@@ -196,6 +225,7 @@ if ($_POST) {
}
}
+// Reload variants
$productCombinations = $prodcomb->fetchAllByFkProductParent($object->id);
if ($action === 'confirm_deletecombination') {
@@ -256,28 +286,28 @@ if ($action === 'confirm_deletecombination') {
* View
*/
-if (! empty($id) || ! empty($ref)) {
+$form = new Form($db);
+if (! empty($id) || ! empty($ref))
+{
llxHeader("", "", $langs->trans("CardProduct".$object->type));
- if ($result)
- {
- $showbarcode=empty($conf->barcode->enabled)?0:1;
- if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0;
-
- $head=product_prepare_head($object);
- $titre=$langs->trans("CardProduct".$object->type);
- $picto=($object->type== Product::TYPE_SERVICE?'service':'product');
- dol_fiche_head($head, 'combinations', $titre, 0, $picto);
-
- $linkback = ''.$langs->trans("BackToList").' ';
- $object->next_prev_filter=" fk_product_type = ".$object->type;
-
- dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
-
- dol_fiche_end();
- }
+ $showbarcode=empty($conf->barcode->enabled)?0:1;
+ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0;
+
+ $head=product_prepare_head($object);
+ $titre=$langs->trans("CardProduct".$object->type);
+ $picto=($object->type== Product::TYPE_SERVICE?'service':'product');
+ dol_fiche_head($head, 'combinations', $titre, 0, $picto);
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+ $object->next_prev_filter=" fk_product_type = ".$object->type;
+
+ dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
+
+ dol_fiche_end();
+
// Create or edit a varian
if ($action == 'add' || ($action == 'edit')) {
@@ -287,6 +317,7 @@ if (! empty($id) || ! empty($ref)) {
$title = $langs->trans('EditProductCombination');
}
+ print '
';
print_fiche_titre($title);
if ($action == 'add') {
@@ -304,7 +335,7 @@ if (! empty($id) || ! empty($ref)) {
?>
-
+
';
+ print ''."\n";
+ print ' '."\n";
+ print ' '."\n";
+
print dol_fiche_head();
?>
+
+
+
@@ -494,13 +491,12 @@ if (! empty($id) || ! empty($ref)) {
?>
+ value="trans('Create') : $langs->trans('Save') ?>" class="button">
+
+
+
-
-
-
-
-
-';
}
@@ -509,7 +505,6 @@ if (! empty($id) || ! empty($ref)) {
if ($action === 'delete') {
if ($prodcomb->fetch($valueid) > 0) {
- $form = new Form($db);
$prodstatic->fetch($prodcomb->fk_product_child);
print $form->formconfirm(
@@ -524,8 +519,6 @@ if (! empty($id) || ! empty($ref)) {
}
} elseif ($action === 'copy') {
- $form = new Form($db);
-
print $form->formconfirm(
'combinations.php?id='.$id,
$langs->trans('CloneCombinationsProduct'),
@@ -570,50 +563,85 @@ if (! empty($id) || ! empty($ref)) {
});
-
- trans('BulkActions') ?>
-
- trans('ProductStatusNotOnBuy') ?>
- trans('ProductStatusNotOnSell') ?>
- trans('ProductStatusOnBuy') ?>
- trans('ProductStatusOnSell') ?>
- trans('Delete') ?>
-
-
- " class="button">
-
-
';
+
print ' ';
+
print '';
+ $arrayofselected=is_array($toselect)?$toselect:array();
+
+
+ // List of variants
+ print ' ';
+
+
+ // List of mass actions available
+ /*
+ $arrayofmassactions = array(
+ 'presend'=>$langs->trans("SendByMail"),
+ 'builddoc'=>$langs->trans("PDFMerge"),
+ );
+ if ($user->rights->product->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
+ if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
+ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
+ */
+
+ $aaa='';
+ if (count($productCombinations))
+ {
+ $aaa = ''.$langs->trans('BulkActions').' ';
+ $aaa .= '';
+ $aaa .= ' ';
+ $aaa .= ' '.$langs->trans('ProductStatusNotOnBuy').' ';
+ $aaa .= ' '.$langs->trans('ProductStatusNotOnSell').' ';
+ $aaa .= ' '.$langs->trans('ProductStatusOnBuy').' ';
+ $aaa .= ' '.$langs->trans('ProductStatusOnSell').' ';
+ $aaa .= ' '.$langs->trans('Delete').' ';
+ $aaa .= ' ';
+ $aaa .= ' ';
+ $aaa .= ' ';
+ }
+ $massactionbutton = $aaa;
+
+ $title = $langs->trans("ProductCombinations");
+
+ print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $aaa, 0);
+
+ print '';
?>
-
-
-
-
-
';
+ print '';
}
}
llxFooter();
+
+$db->close();
diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php
index b709f240551..7b0358fd176 100644
--- a/htdocs/variants/generator.php
+++ b/htdocs/variants/generator.php
@@ -130,6 +130,8 @@ if ($_POST) {
}
}
+
+
/*
* View
*/
@@ -140,37 +142,21 @@ if (! empty($id) || ! empty($ref)) {
llxHeader("", "", $langs->trans("CardProduct".$object->type));
- if ($result) {
- $head = product_prepare_head($object);
- $titre = $langs->trans("CardProduct".$object->type);
- $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
-
+ if ($result > 0)
+ {
+ $showbarcode=empty($conf->barcode->enabled)?0:1;
+ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0;
+
+ $head=product_prepare_head($object);
+ $titre=$langs->trans("CardProduct".$object->type);
+ $picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'combinations', $titre, 0, $picto);
-
- print '
';
-
- // Reference
- print '';
- print ''.$langs->trans("Ref").' ';
- print $form->showrefnav($object, 'id', '', 0);
- print ' ';
- print ' ';
-
- // Label
- print ''.$langs->trans("Label").' '.$object->label.' ';
-
- // Status (to sell)
- print ''.$langs->trans("Status").' ('.$langs->trans("Sell").') ';
- print $object->getLibStatut(2, 0);
- print ' ';
-
- // Status (to buy)
- print ''.$langs->trans("Status").' ('.$langs->trans("Buy").') ';
- print $object->getLibStatut(2, 1);
- print ' ';
-
- print '
';
-
+
+ $linkback = '
'.$langs->trans("BackToList").' ';
+ $object->next_prev_filter=" fk_product_type = ".$object->type;
+
+ dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
+
dol_fiche_end();
}
diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php
index 6fa65660df1..f69c7e4e4aa 100644
--- a/htdocs/viewimage.php
+++ b/htdocs/viewimage.php
@@ -35,7 +35,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks
// Some value of modulepart can be used to get resources that are public so no login are required.
-if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1');
+if ((isset($_GET["modulepart"]) && ($_GET["modulepart"] == 'mycompany' || $_GET["modulepart"] == 'companylogo')) && ! defined("NOLOGIN")) define("NOLOGIN",'1');
if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN"))
{
define("NOLOGIN",'1');
@@ -179,7 +179,7 @@ else // Open and return file
dol_syslog("viewimage.php return file $original_file content-type=$type");
// This test is to avoid error images when image is not available (for example thumbs).
- if (! dol_is_file($original_file))
+ if (! dol_is_file($original_file) && empty($_GET["noalt"]))
{
$original_file=DOL_DOCUMENT_ROOT.'/public/theme/common/nophoto.png';
/*$error='Error: File '.$_GET["file"].' does not exists or filesystems permissions are not allowed';
diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php
index 385c7dc3b95..cf926c6409e 100644
--- a/htdocs/webservices/server_productorservice.php
+++ b/htdocs/webservices/server_productorservice.php
@@ -872,7 +872,7 @@ function deleteProductOrService($authentication,$listofidstring)
}
else
{
- $result=$newobject->delete();
+ $result=$newobject->delete($user);
if ($result <= 0)
{
$error++;
diff --git a/htdocs/websites/class/website.class.php b/htdocs/websites/class/website.class.php
index 51a61d90112..a77079c94a6 100644
--- a/htdocs/websites/class/website.class.php
+++ b/htdocs/websites/class/website.class.php
@@ -73,10 +73,6 @@ class Website extends CommonObject
* @var mixed
*/
public $date_creation;
- /**
- * @var mixed
- */
- public $date_modification;
/**
* @var mixed
*/
@@ -123,7 +119,6 @@ class Website extends CommonObject
$error = 0;
// Clean parameters
-
if (isset($this->entity)) {
$this->entity = trim($this->entity);
}
@@ -136,36 +131,30 @@ class Website extends CommonObject
if (isset($this->status)) {
$this->status = trim($this->status);
}
-
-
+ if (empty($this->date_creation)) $this->date_creation = dol_now();
// Check parameters
// Put here code to add control on parameters values
// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
-
$sql.= 'entity,';
$sql.= 'ref,';
$sql.= 'description,';
$sql.= 'status,';
$sql.= 'fk_default_home,';
$sql.= 'virtualhost,';
- $sql.= 'date_creation,';
- $sql.= 'date_modification';
-
+ $sql.= 'fk_user_create';
+ $sql.= 'date_creation';
$sql .= ') VALUES (';
-
$sql .= ' '.(! isset($this->entity)?'NULL':$this->entity).',';
$sql .= ' '.(! isset($this->ref)?'NULL':"'".$this->db->escape($this->ref)."'").',';
$sql .= ' '.(! isset($this->description)?'NULL':"'".$this->db->escape($this->description)."'").',';
$sql .= ' '.(! isset($this->status)?'NULL':$this->status).',';
$sql .= ' '.(! isset($this->fk_default_home)?'NULL':$this->fk_default_home).',';
$sql .= ' '.(! isset($this->virtualhost)?'NULL':$this->virtualhost).',';
- $sql .= ' '.(! isset($this->date_creation) || dol_strlen($this->date_creation)==0?'NULL':"'".$this->db->idate($this->date_creation)."'").',';
- $sql .= ' '.(! isset($this->date_modification) || dol_strlen($this->date_modification)==0?'NULL':"'".$this->db->idate($this->date_modification)."'");
-
-
+ $sql .= ' '.(! isset($this->fk_user_create)?$user->id:$this->fk_user_create).',';
+ $sql .= ' '.(! isset($this->date_creation) || dol_strlen($this->date_creation)==0?'NULL':"'".$this->db->idate($this->date_creation)."'");
$sql .= ')';
$this->db->begin();
@@ -223,8 +212,9 @@ class Website extends CommonObject
$sql .= " t.status,";
$sql .= " t.fk_default_home,";
$sql .= " t.virtualhost,";
+ $sql .= " t.fk_user_create,";
+ $sql .= " t.fk_user_modif,";
$sql .= " t.date_creation,";
- $sql .= " t.date_modification,";
$sql .= " t.tms";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
if (null !== $ref) {
@@ -247,11 +237,10 @@ class Website extends CommonObject
$this->status = $obj->status;
$this->fk_default_home = $obj->fk_default_home;
$this->virtualhost = $obj->virtualhost;
+ $this->fk_user_create = $obj->fk_user_create;
+ $this->fk_user_modif = $obj->fk_user_modif;
$this->date_creation = $this->db->jdate($obj->date_creation);
- $this->date_modification = $this->db->jdate($obj->date_modification);
$this->tms = $this->db->jdate($obj->tms);
-
-
}
$this->db->free($resql);
@@ -292,8 +281,9 @@ class Website extends CommonObject
$sql .= " t.status,";
$sql .= " t.fk_default_home,";
$sql .= " t.virtualhost,";
+ $sql .= " t.fk_user_create,";
+ $sql .= " t.fk_user_modif,";
$sql .= " t.date_creation,";
- $sql .= " t.date_modification,";
$sql .= " t.tms";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element. ' as t';
@@ -331,8 +321,9 @@ class Website extends CommonObject
$line->status = $obj->status;
$line->fk_default_home = $obj->fk_default_home;
$line->virtualhost = $obj->virtualhost;
+ $this->fk_user_create = $obj->fk_user_create;
+ $this->fk_user_modif = $obj->fk_user_modif;
$line->date_creation = $this->db->jdate($obj->date_creation);
- $line->date_modification = $this->db->jdate($obj->date_modification);
$line->tms = $this->db->jdate($obj->tms);
$this->records[$line->id] = $line;
@@ -377,25 +368,20 @@ class Website extends CommonObject
$this->status = trim($this->status);
}
-
-
// Check parameters
// Put here code to add a control on parameters values
// Update request
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
-
$sql .= ' entity = '.(isset($this->entity)?$this->entity:"null").',';
$sql .= ' ref = '.(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").',';
$sql .= ' description = '.(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").',';
$sql .= ' status = '.(isset($this->status)?$this->status:"null").',';
$sql .= ' fk_default_home = '.(($this->fk_default_home > 0)?$this->fk_default_home:"null").',';
$sql .= ' virtualhost = '.(($this->virtualhost != '')?"'".$this->db->escape($this->virtualhost)."'":"null").',';
+ $sql .= ' fk_user_modif = '.(! isset($this->fk_user_modif) ? $user->id : $this->fk_user_modif).',';
$sql .= ' date_creation = '.(! isset($this->date_creation) || dol_strlen($this->date_creation) != 0 ? "'".$this->db->idate($this->date_creation)."'" : 'null').',';
- $sql .= ' date_modification = '.(! isset($this->date_modification) || dol_strlen($this->date_modification) != 0 ? "'".$this->db->idate($this->date_modification)."'" : 'null').',';
$sql .= ' tms = '.(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : "'".$this->db->idate(dol_now())."'");
-
-
$sql .= ' WHERE rowid=' . $this->id;
$this->db->begin();
@@ -631,6 +617,8 @@ class Website extends CommonObject
*/
public function initAsSpecimen()
{
+ global $user;
+
$this->id = 0;
$this->entity = 1;
@@ -639,8 +627,9 @@ class Website extends CommonObject
$this->status = '';
$this->fk_default_home = null;
$this->virtualhost = 'http://myvirtualhost';
+ $this->fk_user_create = $user->id;
+ $this->fk_user_modif = $user->id;
$this->date_creation = dol_now();
- $this->date_modification = dol_now();
$this->tms = dol_now();
diff --git a/htdocs/websites/class/websitepage.class.php b/htdocs/websites/class/websitepage.class.php
index 883b6495c53..c80d20fe44b 100644
--- a/htdocs/websites/class/websitepage.class.php
+++ b/htdocs/websites/class/websitepage.class.php
@@ -181,7 +181,7 @@ class WebsitePage extends CommonObject
/**
* Load object in memory from the database
*
- * @param int $id Id object
+ * @param int $id Id object. If this is 0, the default page of website_id will be used, if not defined, the first one. found
* @param string $website_id Web site id
* @param string $page Page name
*
@@ -205,13 +205,16 @@ class WebsitePage extends CommonObject
$sql .= " t.tms as date_modification";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
+ //$sql .= ' WHERE entity IN ('.getEntity('website', 1).')'; // entity is on website level
+ $sql .= ' WHERE 1 = 1';
if (null !== $website_id) {
- $sql .= ' WHERE t.fk_website = ' . '\'' . $website_id . '\'';
- $sql .= ' AND t.pageurl = ' . '\'' . $page . '\'';
+ $sql .= " AND t.fk_website = '" . $this->db->escape($website_id) . "'";
+ if ($page) $sql .= " AND t.pageurl = '" . $this->db->escape($page) . "'";
} else {
- $sql .= ' WHERE t.rowid = ' . $id;
+ $sql .= ' AND t.rowid = ' . $id;
}
-
+ $sql .= $this->db->plimit(1);
+
$resql = $this->db->query($sql);
if ($resql) {
$numrows = $this->db->num_rows($resql);
diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php
index e6bfec0d84a..b78a172e01f 100644
--- a/htdocs/websites/index.php
+++ b/htdocs/websites/index.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2016-2017 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -143,6 +143,8 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
*/
if (GETPOST('refreshsite')) $pageid=0; // If we change the site, we reset the pageid.
+if (GETPOST('refreshpage')) $action='preview';
+
// Add page
if ($action == 'add')
@@ -434,120 +436,151 @@ if ($action == 'updatemeta')
}
// Update page
-if ($action == 'updatecontent')
+if ($action == 'updatecontent' || GETPOST('refreshsite') || GETPOST('refreshpage') || GETPOST('preview'))
{
- $db->begin();
$object->fetch(0, $website);
+ /*if (GETPOST('savevirtualhost') && $object->virtualhost != GETPOST('previewsite'))
+ {
+ $object->virtualhost = GETPOST('previewsite', 'alpha');
+ $object->update($user);
+ }*/
+
$objectpage->fk_website = $object->id;
- $res = $objectpage->fetch($pageid, $object->fk_website);
+ if ($pageid > 0)
+ {
+ $res = $objectpage->fetch($pageid);
+ }
+ else
+ {
+ $res = $objectpage->fetch($object->fk_default_home);
+ if (! $res > 0)
+ {
+ $res = $objectpage->fetch(0, $object->fk_website);
+ }
+ }
if ($res > 0)
{
- $objectpage->content = GETPOST('PAGE_CONTENT');
-
- // Clean data. We remove all the head section.
- $objectpage->content = preg_replace('//s', '', $objectpage->content);
- /* $objectpage->content = preg_replace('/ /s', '', $objectpage->content); */
-
- $res = $objectpage->update($user);
- if ($res < 0)
+ if ($action == 'updatecontent')
{
- $error++;
- setEventMessages($objectpage->error, $objectpage->errors, 'errors');
- }
-
- if (! $error)
- {
- $db->commit();
-
- $filemaster=$pathofwebsite.'/master.inc.php';
- //$fileoldalias=$pathofwebsite.'/'.$objectpage->old_object->pageurl.'.php';
- $filealias=$pathofwebsite.'/'.$objectpage->pageurl.'.php';
-
- dol_mkdir($pathofwebsite);
-
-
- // Now generate the master.inc.php page
- dol_syslog("We regenerate the master file");
- dol_delete_file($filemaster);
-
- $mastercontent = ''."\n";
- $result = file_put_contents($filemaster, $mastercontent);
- if (! empty($conf->global->MAIN_UMASK))
- @chmod($filemaster, octdec($conf->global->MAIN_UMASK));
-
- if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors');
-
-
- // Now generate the alias.php page
- if (! empty($fileoldalias))
- {
- dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias);
- dol_delete_file($fileoldalias);
- }
+ $db->begin();
- $aliascontent = 'id.".tpl.php';\n";
- $aliascontent.= '?>'."\n";
- $result = file_put_contents($filealias, $aliascontent);
- if (! empty($conf->global->MAIN_UMASK))
- @chmod($filealias, octdec($conf->global->MAIN_UMASK));
-
- if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors');
-
-
- // Now create the .tpl file with code to be able to make dynamic changes
- dol_delete_file($filetpl);
-
- $tplcontent ='';
- $tplcontent.= "\n";
- $tplcontent.= ''."\n";
- $tplcontent.= ''."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ' '."\n";
- $tplcontent.= ''.dol_escape_htmltag($objectpage->title).' '."\n";
- $tplcontent.= ' '."\n";
-
- $tplcontent.= ''."\n";
- $tplcontent.= $objectpage->content."\n";
- $tplcontent.= ''."\n";
-
- $tplcontent.= '"."\n";
-
- //var_dump($filetpl);exit;
- $result = file_put_contents($filetpl, $tplcontent);
- if (! empty($conf->global->MAIN_UMASK))
- @chmod($filetpl, octdec($conf->global->MAIN_UMASK));
-
- if ($result)
- {
- setEventMessages($langs->trans("Saved"), null, 'mesgs');
- header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid);
- exit;
- }
- else setEventMessages('Failed to write file '.$filetpl, null, 'errors');
- }
- else
- {
- $db->rollback();
- }
+ $objectpage->content = GETPOST('PAGE_CONTENT');
+
+ // Clean data. We remove all the head section.
+ $objectpage->content = preg_replace('//s', '', $objectpage->content);
+ /* $objectpage->content = preg_replace('/ /s', '', $objectpage->content); */
+
+ $res = $objectpage->update($user);
+ if ($res < 0)
+ {
+ $error++;
+ setEventMessages($objectpage->error, $objectpage->errors, 'errors');
+ }
+
+ if (! $error)
+ {
+ $db->commit();
+
+ $filemaster=$pathofwebsite.'/master.inc.php';
+ //$fileoldalias=$pathofwebsite.'/'.$objectpage->old_object->pageurl.'.php';
+ $filealias=$pathofwebsite.'/'.$objectpage->pageurl.'.php';
+
+ dol_mkdir($pathofwebsite);
+
+
+ // Now generate the master.inc.php page
+ dol_syslog("We regenerate the master file");
+ dol_delete_file($filemaster);
+
+ $mastercontent = ''."\n";
+ $result = file_put_contents($filemaster, $mastercontent);
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($filemaster, octdec($conf->global->MAIN_UMASK));
+
+ if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors');
+
+
+ // Now generate the alias.php page
+ if (! empty($fileoldalias))
+ {
+ dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias);
+ dol_delete_file($fileoldalias);
+ }
+
+ $aliascontent = 'id.".tpl.php';\n";
+ $aliascontent.= '?>'."\n";
+ $result = file_put_contents($filealias, $aliascontent);
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($filealias, octdec($conf->global->MAIN_UMASK));
+
+ if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors');
+
+
+ // Now create the .tpl file with code to be able to make dynamic changes
+ dol_delete_file($filetpl);
+
+ $tplcontent ='';
+ $tplcontent.= "\n";
+ $tplcontent.= ''."\n";
+ $tplcontent.= ''."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ' '."\n";
+ $tplcontent.= ''.dol_escape_htmltag($objectpage->title).' '."\n";
+ $tplcontent.= ' '."\n";
+
+ $tplcontent.= ''."\n";
+ $tplcontent.= $objectpage->content."\n";
+ $tplcontent.= ''."\n";
+
+ $tplcontent.= '"."\n";
+
+ //var_dump($filetpl);exit;
+ $result = file_put_contents($filetpl, $tplcontent);
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($filetpl, octdec($conf->global->MAIN_UMASK));
+
+ if ($result)
+ {
+ setEventMessages($langs->trans("Saved"), null, 'mesgs');
+ header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid);
+ exit;
+ }
+ else
+ {
+ setEventMessages('Failed to write file '.$filetpl, null, 'errors');
+ header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid);
+ exit;
+ }
+ }
+ else
+ {
+ $db->rollback();
+ }
+ }
+ else
+ {
+ header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid);
+ exit;
+ }
}
else
{
@@ -603,7 +636,7 @@ if ($action == 'edit')
$style='';
if ($action != 'preview' && $action != 'editcontent') $style=' margin-bottom: 5px;';
-
+//var_dump($objectpage);exit;
print '';
if (count($object->records) > 0)
@@ -617,7 +650,7 @@ if (count($object->records) > 0)
// List of websites
print '
';
$out='';
- $out.='
';
+ $out.='';
if (empty($object->records)) $out.=' ';
// Loop on each sites
$i=0;
@@ -639,9 +672,9 @@ if (count($object->records) > 0)
if ($website)
{
- $realurl=$urlwithroot.'/public/websites/index.php?website='.$website;
+ $virtualurl='';
$dataroot=DOL_DATA_ROOT.'/websites/'.$website;
- if (! empty($object->virtualhost)) $realurl=$object->virtualhost;
+ if (! empty($object->virtualhost)) $virtualurl=$object->virtualhost;
}
if ($website && $action == 'preview')
@@ -665,20 +698,23 @@ if (count($object->records) > 0)
if ($action == 'preview')
{
print '';
- print ' ';
+ print ' ';
//print ' ';
$htmltext=$langs->trans("SetHereVirtualHost", $dataroot);
print $form->textwithpicto('', $htmltext);
print '
';
- $urlext=$realurl;
- $urlint=DOL_URL_ROOT.'/public/websites/index.php?website='.$website;
- print '';
- print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $urlext), 1, 'preview_ext');
- print ' ';
+ $urlext=$virtualurl;
+ $urlint=$urlwithroot.'/public/websites/index.php?website='.$website;
+ //if (! empty($object->virtualhost))
+ //{
+ print 'transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">';
+ print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext');
+ print ' ';
+ //}
- print '';
- print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $urlint), 1, 'preview');
+ print ' transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">';
+ print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot), 1, 'preview');
print ' ';
}
@@ -788,13 +824,22 @@ if (count($object->records) > 0)
print $form->textwithpicto('', $htmltext);
print ' ';
- $urlext=$realurl.'/'.$pagealias.'.php';
- print '
';
- print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $urlext), 1, 'preview_ext');
- print ' ';
+ if (! empty($object->virtualhost))
+ {
+ $urlext=$virtualurl.'/'.$pagealias.'.php';
+ print '
transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext)).'">';
+ print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext');
+ print ' ';
+ }
+ else
+ {
+ print '
';
+ print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext');
+ print ' ';
+ }
- print '
';
- print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage), 1, 'preview');
+ print ' transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage)).'">';
+ print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview');
print ' '; // View page in new Tab
//print '
';
diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php
index 2116d51e65b..ad70190b689 100755
--- a/scripts/bank/export-bank-receipts.php
+++ b/scripts/bank/export-bank-receipts.php
@@ -262,7 +262,7 @@ if ($resql)
$totalbefore = $total;
$total = $total + $objp->amount;
- $var=!$var;
+
// Date operation
$dateop=$db->jdate($objp->do);
diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php
index fb8612977a8..27cc22448e6 100755
--- a/scripts/emailings/mailing-send.php
+++ b/scripts/emailings/mailing-send.php
@@ -189,6 +189,7 @@ if ($resql)
$substitutionisok=true;
// Fabrication du mail
+ $trackid='emailing-'.$obj2->source_type.$obj2->source_id;
$mail = new CMailFile(
$newsubject,
$sendto,
@@ -201,7 +202,11 @@ if ($resql)
'',
0,
$msgishtml,
- $errorsto
+ $errorsto,
+ '',
+ $trackid,
+ '',
+ 'emailing'
);
if ($mail->error)
diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php
index 2dfdf4cb5c2..99f9faf260d 100644
--- a/test/phpunit/AllTests.php
+++ b/test/phpunit/AllTests.php
@@ -176,6 +176,9 @@ class AllTests
$suite->addTestSuite('ChargeSocialesTest');
require_once dirname(__FILE__).'/HolidayTest.php';
$suite->addTestSuite('HolidayTest');
+ require_once dirname(__FILE__).'/ExpenseReportTest.php';
+ $suite->addTestSuite('ExpenseReportTest');
+
require_once dirname(__FILE__).'/EntrepotTest.php';
$suite->addTestSuite('EntrepotTest');
require_once dirname(__FILE__).'/MouvementStockTest.php';
diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php
index 03880a56eca..2d615e0bd06 100644
--- a/test/phpunit/CommandeFournisseurTest.php
+++ b/test/phpunit/CommandeFournisseurTest.php
@@ -264,7 +264,7 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
* @param Object $localobject Supplier order
* @return void
*
- * @depends testCommandeFournisseurValid
+ * @depends testCommandeFournisseurApprove
* The depends says test is run only if previous is ok
*/
public function testCommandeFournisseurCancel($localobject)
diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php
new file mode 100644
index 00000000000..b9af3dc1078
--- /dev/null
+++ b/test/phpunit/ExpenseReportTest.php
@@ -0,0 +1,316 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
.
+ * or see http://www.gnu.org/
+ */
+
+/**
+ * \file test/phpunit/ExpenseReportTest.php
+ * \ingroup test
+ * \brief PHPUnit test
+ * \remarks To run this script as CLI: phpunit filename.php
+ */
+
+global $conf,$user,$langs,$db;
+//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
+//require_once 'PHPUnit/Autoload.php';
+require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
+require_once dirname(__FILE__).'/../../htdocs/expensereport/class/expensereport.class.php';
+
+if (empty($user->id)) {
+ print "Load permissions for admin user nb 1\n";
+ $user->fetch(1);
+ $user->getrights();
+}
+$conf->global->MAIN_DISABLE_ALL_MAILS=1;
+
+
+
+/**
+ * Class for PHPUnit tests
+ *
+ * @backupGlobals disabled
+ * @backupStaticAttributes enabled
+ * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
+ */
+class ExpenseReportTest extends PHPUnit_Framework_TestCase
+{
+ protected $savconf;
+ protected $savuser;
+ protected $savlangs;
+ protected $savdb;
+
+ /**
+ * Constructor
+ * We save global variables into local variables
+ *
+ * @return ExpenseReportTest
+ */
+ function __construct()
+ {
+ //$this->sharedFixture
+ global $conf,$user,$langs,$db;
+ $this->savconf=$conf;
+ $this->savuser=$user;
+ $this->savlangs=$langs;
+ $this->savdb=$db;
+
+ print __METHOD__." db->type=".$db->type." user->id=".$user->id;
+ //print " - db ".$db->db;
+ print "\n";
+ }
+
+ // Static methods
+ public static function setUpBeforeClass()
+ {
+ global $conf,$user,$langs,$db;
+ $db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
+
+ print __METHOD__."\n";
+ }
+
+ // tear down after class
+ public static function tearDownAfterClass()
+ {
+ global $conf,$user,$langs,$db;
+ $db->rollback();
+
+ print __METHOD__."\n";
+ }
+
+ /**
+ * Init phpunit tests
+ *
+ * @return void
+ */
+ protected function setUp()
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ print __METHOD__."\n";
+ //print $db->getVersion()."\n";
+ }
+ /**
+ * End phpunit tests
+ *
+ * @return void
+ */
+ protected function tearDown()
+ {
+ print __METHOD__."\n";
+ }
+
+ /**
+ * testExpenseReportCreate
+ *
+ * @return void
+ */
+ public function testExpenseReportCreate()
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ // Set supplier and product to use
+ $socid=1;
+
+ // Create supplier order with a too low quantity
+ $localobject=new ExpenseReport($db);
+ $localobject->initAsSpecimen(); // Init a speciment with lines
+ $localobject->status = 0;
+ $localobject->fk_statut = 0;
+ $localobject->date_fin = null; // Force bad value
+
+ $result=$localobject->create($user);
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals(-1, $result); // must be -1 because of missing mandatory fields
+
+ $sql="DELETE FROM ".MAIN_DB_PREFIX."expensereport where ref=''";
+ $db->query($sql);
+
+ // Create supplier order
+ $localobject2=new ExpenseReport($db);
+ $localobject2->initAsSpecimen(); // Init a speciment with lines
+ $localobject2->status = 0;
+ $localobject2->fk_statut = 0;
+
+ $result=$localobject2->create($user);
+ print __METHOD__." result=".$result."\n";
+ $this->assertGreaterThanOrEqual(0, $result);
+
+ return $result;
+ }
+
+
+ /**
+ * testExpenseReportFetch
+ *
+ * @param int $id Id of supplier order
+ * @return void
+ *
+ * @depends testExpenseReportCreate
+ * The depends says test is run only if previous is ok
+ */
+ public function testExpenseReportFetch($id)
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ $localobject=new ExpenseReport($this->savdb);
+ $result=$localobject->fetch($id);
+
+ print __METHOD__." id=".$id." result=".$result."\n";
+ $this->assertLessThan($result, 0);
+ return $localobject;
+ }
+
+ /**
+ * testExpenseReportValid
+ *
+ * @param Object $localobject Supplier order
+ * @return void
+ *
+ * @depends testExpenseReportFetch
+ * The depends says test is run only if previous is ok
+ */
+ public function testExpenseReportValid($localobject)
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ $result=$localobject->setValidate($user);
+
+ print __METHOD__." id=".$localobject->id." result=".$result."\n";
+ $this->assertLessThan($result, 0);
+ return $localobject;
+ }
+
+ /**
+ * testExpenseReportApprove
+ *
+ * @param Object $localobject Supplier order
+ * @return void
+ *
+ * @depends testExpenseReportValid
+ * The depends says test is run only if previous is ok
+ */
+ public function testExpenseReportApprove($localobject)
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ $result=$localobject->setApproved($user);
+
+ print __METHOD__." id=".$localobject->id." result=".$result."\n";
+ $this->assertLessThan($result, 0);
+ return $localobject;
+ }
+
+ /**
+ * testExpenseReportCancel
+ *
+ * @param Object $localobject Supplier order
+ * @return void
+ *
+ * @depends testExpenseReportApprove
+ * The depends says test is run only if previous is ok
+ */
+ public function testExpenseReportCancel($localobject)
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ $result=$localobject->set_cancel($user, 'Because...');
+
+ print __METHOD__." id=".$localobject->id." result=".$result."\n";
+ $this->assertLessThan($result, 0);
+ return $localobject;
+ }
+
+ /**
+ * testExpenseReportOther
+ *
+ * @param Object $localobject Supplier order
+ * @return void
+ *
+ * @depends testExpenseReportCancel
+ * The depends says test is run only if previous is ok
+ */
+ public function testExpenseReportOther($localobject)
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ /*$result=$localobject->setstatus(0);
+ print __METHOD__." id=".$localobject->id." result=".$result."\n";
+ $this->assertLessThan($result, 0);
+ */
+
+ /*$localobject->info($localobject->id);
+ print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n";
+ $this->assertNotEquals($localobject->date_creation, '');
+ */
+
+ return $localobject->id;
+ }
+
+ /**
+ * testExpenseReportDelete
+ *
+ * @param int $id Id of order
+ * @return void
+ *
+ * @depends testExpenseReportOther
+ * The depends says test is run only if previous is ok
+ */
+ public function testExpenseReportDelete($id)
+ {
+ global $conf,$user,$langs,$db;
+ $conf=$this->savconf;
+ $user=$this->savuser;
+ $langs=$this->savlangs;
+ $db=$this->savdb;
+
+ $localobject=new ExpenseReport($this->savdb);
+ $result=$localobject->fetch($id);
+ $result=$localobject->delete($user);
+
+ print __METHOD__." id=".$id." result=".$result."\n";
+ $this->assertLessThan($result, 0);
+ return $result;
+ }
+
+}
diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php
index 199d397f50d..7985e8f0931 100644
--- a/test/phpunit/FactureFournisseurTest.php
+++ b/test/phpunit/FactureFournisseurTest.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2017 Juanjo Menent
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -259,7 +260,7 @@ class FactureFournisseurTest extends PHPUnit_Framework_TestCase
$localobject=new FactureFournisseur($this->savdb);
$result=$localobject->fetch($id);
- $result=$localobject->delete($id);
+ $result=$localobject->delete($user);
print __METHOD__." id=".$id." result=".$result."\n";
$this->assertLessThan($result, 0);
diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php
index a53f971904c..28e55fd793b 100644
--- a/test/phpunit/FunctionsLibTest.php
+++ b/test/phpunit/FunctionsLibTest.php
@@ -712,15 +712,15 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$s=img_picto('title','/fullpath/img.png','',1);
print __METHOD__." s=".$s."\n";
- $this->assertEquals(' ',$s,'testImgPicto3');
+ $this->assertEquals(' ',$s,'testImgPicto3');
$s=img_picto('title','/fullpath/img.png','',true);
print __METHOD__." s=".$s."\n";
- $this->assertEquals(' ',$s,'testImgPicto4');
+ $this->assertEquals(' ',$s,'testImgPicto4');
$s=img_picto('title:alt','/fullpath/img.png','',true);
print __METHOD__." s=".$s."\n";
- $this->assertEquals(' ',$s,'testImgPicto5');
+ $this->assertEquals(' ',$s,'testImgPicto5');
}
/**
diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php
index 199aace802c..87f290593f0 100644
--- a/test/phpunit/ProductTest.php
+++ b/test/phpunit/ProductTest.php
@@ -232,7 +232,7 @@ class ProductTest extends PHPUnit_Framework_TestCase
$localobject=new Product($this->savdb);
$result=$localobject->fetch($id);
- $result=$localobject->delete($id);
+ $result=$localobject->delete($user);
print __METHOD__." id=".$id." result=".$result."\n";
$this->assertLessThan($result, 0);