diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 6289f382273..a1f07f4f7ad 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -79,7 +79,7 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_CUSTOM_RECEIPT", GETPOST('TAKEPOS_CUSTOM_RECEIPT', 'int'), 'int', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); if ($conf->global->TAKEPOS_ORDER_NOTES==1) { @@ -247,15 +247,15 @@ $formmail = new FormMail($db); $nboftemplates = $formmail->fetchAllEMailTemplate('facture_send', $user, null, -1); // We set lang=null to get in priority record with no lang //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, ''); $arrayofmessagename=array(); -if (is_array($formmail->lines_model)) -{ - foreach($formmail->lines_model as $modelmail) - { - //var_dump($modelmail); - $moreonlabel=''; - if (! empty($arrayofmessagename[$modelmail->label])) $moreonlabel=' ('.$langs->trans("SeveralLangugeVariatFound").')'; - $arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; - } +if (is_array($formmail->lines_model)) { + foreach($formmail->lines_model as $modelmail) { + //var_dump($modelmail); + $moreonlabel=''; + if (! empty($arrayofmessagename[$modelmail->label])) { + $moreonlabel=' ('.$langs->trans("SeveralLangugeVariatFound").')'; + } + $arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; + } } //var_dump($arraydefaultmessage); //var_dump($arrayofmessagename); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index b34889a3dce..b009d01659b 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -166,12 +166,12 @@ if (! empty($conf->stock->enabled)) print ''.$langs->trans("CashDeskDoNotDecreaseStock").''; // Force warehouse (this is not a default value) print ''; if (empty($conf->productbatch->enabled)) { - print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1); + print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1); } else { if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) { - $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity); } print $langs->trans("Yes").'
'; print ''.$langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch').''; diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 74e83ffbef3..cd45d0c1792 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -157,8 +157,7 @@ $( document ).ready(function() { $('#'+val.label).draggable().bind('click', function(){ $(this).focus(); }) - + $('body').append('
'+val.label+'
'); }); @@ -168,13 +167,13 @@ $( document ).ready(function() { -admin){?> +admin) {?>
- + trans("AddTable"); ?> - + trans("Edit"); ?> - +
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 349c03540b2..aea8d14ebba 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -223,7 +223,7 @@ $numpad=$conf->global->TAKEPOS_NUMPAD; if ($paycode == 'LIQ') $paycode = 'cash'; if ($paycode == 'CB') $paycode = 'card'; if ($paycode == 'CHQ') $paycode = 'cheque'; -?> + ?> @@ -236,11 +236,11 @@ $numpad=$conf->global->TAKEPOS_NUMPAD; if ($paycode == 'LIQ') $paycode = 'cash'; if ($paycode == 'CB') $paycode = 'card'; if ($paycode == 'CHQ') $paycode = 'cheque'; -?> + ?> + $button = array_pop($action_buttons); + ?> @@ -251,12 +251,11 @@ $button = array_pop($action_buttons); if ($paycode == 'LIQ') $paycode = 'cash'; if ($paycode == 'CB') $paycode = 'card'; if ($paycode == 'CHQ') $paycode = 'cheque'; -?> + ?> - - + @@ -265,17 +264,17 @@ $button = array_pop($action_buttons); + ?> - + ?> - diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 38ad9103ab9..ae61b5ec287 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -130,16 +130,17 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME lines as $line) { - ?> + ?> - product_label)) echo $line->product_label; - else echo $line->description;?> + + product_label)) echo $line->product_label; + else echo $line->description;?> qty;?> total_ttc/$line->qty;?> total_ttc);?> - @@ -150,30 +151,28 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME trans("TotalHT");?> total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";?> -global->TAKEPOS_TICKET_VAT_GROUPPED):?> -global->TAKEPOS_TICKET_VAT_GROUPPED) { $vat_groups = array(); foreach ($object->lines as $line) { - if(!array_key_exists($line->tva_tx, $vat_groups)){ + if(!array_key_exists($line->tva_tx, $vat_groups)) { $vat_groups[$line->tva_tx] = 0; } $vat_groups[$line->tva_tx] += $line->total_tva; } - foreach($vat_groups as $key => $val){ - ?> + foreach($vat_groups as $key => $val) { + ?> trans("VAT").' '.vatrate($key, 1);?> currency)."\n";?> - - +} else { ?> trans("TotalVAT").''.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";?> - + trans("TotalTTC").''.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";?> diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index d3a0f466fc8..dd65469ec05 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -747,7 +747,7 @@ $menus[$r++]=array('title'=>'< print ' '; print ''.img_picto('', 'searchclear').''; print ''; -?> + ?> @@ -759,7 +759,7 @@ $menus[$r++]=array('title'=>'< $count=0; while ($count < $MAXCATEG) { - ?> + ?>
id="catdiv"> '<
+
- @@ -794,7 +794,7 @@ $menus[$r++]=array('title'=>'< $count=0; while ($count < $MAXPRODUCT) { - ?> + ?>
onclick="MoreProducts('less');" onclick="MoreProducts('more');" > '<
+
- diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 9549fbe2ef1..778823d3d7d 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -72,7 +72,7 @@ class Users extends DolibarrApi $obj_ret = array(); if(! DolibarrApiAccess::$user->rights->user->user->lire) { - throw new RestException(401, "You are not allowed to read list of users"); + throw new RestException(401, "You are not allowed to read list of users"); } // case of external user, $societe param is ignored and replaced by user's socid @@ -226,10 +226,10 @@ class Users extends DolibarrApi if ($field == 'statut') { $result = $this->useraccount->setstatus($value); if ($result < 0) { - throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error); + throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error); } } else { - $this->useraccount->$field = $value; + $this->useraccount->$field = $value; } } diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 79b285bc114..04a0f4c3883 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -110,7 +110,7 @@ if ($id > 0) // Edit mode if ($action == 'edit') { - print ''; + print '
'; if ($user->admin) { diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 8952b32f30b..a89fe447aa0 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -4,6 +4,7 @@ * Copyright (C) 2006-2015 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2019 Frédéric France * * 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 @@ -81,138 +82,138 @@ if (! is_array($user_arbo) && $user_arbo < 0) } else { -// Define fulltree array -$fulltree=$user_arbo; -//var_dump($fulltree); -// Define data (format for treeview) -$data=array(); -$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>''); -foreach($fulltree as $key => $val) -{ - $userstatic->id=$val['id']; - $userstatic->ref=$val['label']; - $userstatic->login=$val['login']; - $userstatic->firstname=$val['firstname']; - $userstatic->lastname=$val['lastname']; - $userstatic->statut=$val['statut']; - $userstatic->email=$val['email']; - $userstatic->gender=$val['gender']; - $userstatic->societe_id=$val['fk_soc']; - $userstatic->admin=$val['admin']; - $userstatic->entity=$val['entity']; - $userstatic->photo=$val['photo']; + // Define fulltree array + $fulltree=$user_arbo; + //var_dump($fulltree); + // Define data (format for treeview) + $data=array(); + $data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>''); + foreach($fulltree as $key => $val) + { + $userstatic->id=$val['id']; + $userstatic->ref=$val['label']; + $userstatic->login=$val['login']; + $userstatic->firstname=$val['firstname']; + $userstatic->lastname=$val['lastname']; + $userstatic->statut=$val['statut']; + $userstatic->email=$val['email']; + $userstatic->gender=$val['gender']; + $userstatic->societe_id=$val['fk_soc']; + $userstatic->admin=$val['admin']; + $userstatic->entity=$val['entity']; + $userstatic->photo=$val['photo']; - $entity=$val['entity']; - $entitystring=''; + $entity=$val['entity']; + $entitystring=''; - // TODO Set of entitystring should be done with a hook - if (! empty($conf->multicompany->enabled) && is_object($mc)) - { - if (empty($entity)) - { - $entitystring=$langs->trans("AllEntities"); - } - else - { - $mc->getInfo($entity); - $entitystring=$mc->label; - } - } + // TODO Set of entitystring should be done with a hook + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + if (empty($entity)) + { + $entitystring=$langs->trans("AllEntities"); + } + else + { + $mc->getInfo($entity); + $entitystring=$mc->label; + } + } - $li=$userstatic->getNomUrl(-1, '', 0, 1); - if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity) - { - $li.=img_picto($langs->trans("SuperAdministrator"), 'redstar'); - } - elseif ($userstatic->admin) - { - $li.=img_picto($langs->trans("Administrator"), 'star'); - } - $li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')'; + $li=$userstatic->getNomUrl(-1, '', 0, 1); + if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity) + { + $li.=img_picto($langs->trans("SuperAdministrator"), 'redstar'); + } + elseif ($userstatic->admin) + { + $li.=img_picto($langs->trans("Administrator"), 'star'); + } + $li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')'; - $data[] = array( - 'rowid'=>$val['rowid'], - 'fk_menu'=>$val['fk_user'], - 'statut'=>$val['statut'], - 'entry'=>'
'.$li.''.$userstatic->getLibStatut(3).'
' - ); -} + $data[] = array( + 'rowid'=>$val['rowid'], + 'fk_menu'=>$val['fk_user'], + 'statut'=>$val['statut'], + 'entry'=>'
'.$li.''.$userstatic->getLibStatut(3).'
' + ); + } -//var_dump($data); + //var_dump($data); -$title = $langs->trans("ListOfUsers"). ' - '.$langs->trans("HierarchicView"); + $title = $langs->trans("ListOfUsers"). ' - '.$langs->trans("HierarchicView"); -$param="search_statut=".urlencode($search_statut); + $param="search_statut=".urlencode($search_statut); -$newcardbutton=''; -if ($canadduser) -{ - $newcardbutton.= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu='); -} + $newcardbutton=''; + if ($canadduser) + { + $newcardbutton.= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1': '').'&leftmenu='); + } -$morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); + $morehtmlright.= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ?'?search_statut='.$search_statut:'')); -print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton); + print load_fiche_titre($title, $morehtmlright.' '.$newcardbutton); -print '
'."\n"; -if ($optioncss != '') print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; + print ''."\n"; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; -print ''; + print '
'; -print ''; -print ''; -print ''; -// Status -print ''; -print ''; -print ''; + print ''; + print ''; + print ''; + // Status + print ''; + print ''; + print ''; -print ''; -print_liste_field_titre("HierarchicView"); -print_liste_field_titre('', $_SERVER['PHP_SELF'], "", '', "", 'align="center"'); -print_liste_field_titre("Status", $_SERVER['PHP_SELF'], "", '', "", 'align="right"'); -print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch '); -print ''; + print ''; + print_liste_field_titre("HierarchicView"); + print_liste_field_titre('', $_SERVER['PHP_SELF'], "", '', "", 'align="center"'); + print_liste_field_titre("Status", $_SERVER['PHP_SELF'], "", '', "", 'align="right"'); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch '); + print ''; -$nbofentries=(count($data) - 1); + $nbofentries=(count($data) - 1); -if ($nbofentries > 0) -{ - print ''; - print ''; - print ''; -} -else -{ - print ''; - print ''; - print ''; - print ''; -} + if ($nbofentries > 0) + { + print ''; + print ''; + print ''; + } + else + { + print ''; + print ''; + print ''; + print ''; + } -print "
  '; -print $form->selectarray('search_statut', array('-1'=>'','1'=>$langs->trans('Enabled')), $search_statut); -print ''; -$searchpicto=$form->showFilterAndCheckAddButtons(0); -print $searchpicto; -print '
  '; + print $form->selectarray('search_statut', array('-1'=>'','1'=>$langs->trans('Enabled')), $search_statut); + print ''; + $searchpicto=$form->showFilterAndCheckAddButtons(0); + print $searchpicto; + print '
'; - tree_recur($data, $data[0], 0); - print '
'; - print ''; - print ''; - print ''; - print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; - print $langs->trans("NoCategoryYet"); - print ' 
'; - print '
'; + tree_recur($data, $data[0], 0); + print '
'; + print ''; + print ''; + print ''; + print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; + print $langs->trans("NoCategoryYet"); + print ' 
'; + print '
"; -print "
\n"; + print ""; + print "\n"; } // diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 95b9529017c..3b334871c06 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -27,21 +27,24 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (! empty($conf->categorie->enabled)) +if (! empty($conf->categorie->enabled)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +} -if (! $user->rights->user->user->lire && ! $user->admin) +if (! $user->rights->user->user->lire && ! $user->admin) { accessforbidden(); +} - // Load translation files required by page +// Load translation files required by page $langs->loadLangs(array('users', 'companies', 'hrm')); $contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'userlist'; // To manage different context of search // Security check (for external users) $socid=0; -if ($user->societe_id > 0) +if ($user->societe_id > 0) { $socid = $user->societe_id; +} // Load mode employee $mode = GETPOST("mode", 'alpha'); @@ -535,29 +538,29 @@ while ($i < min($num, $limit)) } if (! empty($arrayfields['u.firstname']['checked'])) { - print ''.$obj->firstname.''; + print ''.$obj->firstname.''; if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['u.gender']['checked'])) { - print ''; - if ($obj->gender) print $langs->trans("Gender".$obj->gender); - print ''; + print ''; + if ($obj->gender) print $langs->trans("Gender".$obj->gender); + print ''; if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['u.employee']['checked'])) { - print ''.yn($obj->employee).''; + print ''.yn($obj->employee).''; if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['u.accountancy_code']['checked'])) { - print ''.$obj->accountancy_code.''; + print ''.$obj->accountancy_code.''; if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['u.email']['checked'])) { - print ''.$obj->email.''; + print ''.$obj->email.''; if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['u.api_key']['checked'])) @@ -580,7 +583,7 @@ while ($i < min($num, $limit)) print $langs->trans("DomainUser"); } else - { + { print $langs->trans("InternalUser"); } print ''; @@ -673,9 +676,9 @@ while ($i < min($num, $limit)) // Status if (! empty($arrayfields['u.statut']['checked'])) { - $userstatic->statut=$obj->statut; - print ''.$userstatic->getLibStatut(3).''; - if (! $i) $totalarray['nbfield']++; + $userstatic->statut=$obj->statut; + print ''.$userstatic->getLibStatut(3).''; + if (! $i) $totalarray['nbfield']++; } // Action column print ''; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index b48823d2aa0..577af6c04ba 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -208,7 +208,7 @@ if ($result > 0) print "\n"; -// $listofemails=$object->thirdparty_and_contact_email_array(); + // $listofemails=$object->thirdparty_and_contact_email_array(); if ($object->email) { $actions=array(); @@ -294,7 +294,7 @@ if ($result > 0) if ($num) { - $i = 0; + $i = 0; $userstatic=new user($db);