diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 57ed97c9b20..8bea1c6dcb7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -865,6 +865,7 @@ if ($mode == 'deploy') print '
'; } + print '
'; if ($allowfromweb >= 0) { @@ -885,12 +886,20 @@ if ($mode == 'deploy') if ($allowfromweb == 1) { print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; - print '
'; + + print '
'; + + print ''; print ''; print ''; print $langs->trans("YouCanSubmitFile").' '; print ''; print '
'; + + print '
'; + print '
'; + + print '
'; } else { diff --git a/htdocs/blockedlog/admin/fingerprints.php b/htdocs/blockedlog/admin/fingerprints.php index 95117bf2c28..f585b883c65 100644 --- a/htdocs/blockedlog/admin/fingerprints.php +++ b/htdocs/blockedlog/admin/fingerprints.php @@ -34,6 +34,9 @@ $langs->load("blockedlog"); if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); +$showonlyerrors = GETPOST('showonlyerrors','int'); + +$block_static = new BlockedLog($db); if($action === 'downloadblockchain') { @@ -49,14 +52,57 @@ if($action === 'downloadblockchain') { exit; } - +else if($action === 'downloadcsv') { + + $res = $db->query("SELECT rowid,tms,action,amounts,element,fk_object,date_object,ref_object,signature,fk_user + FROM ".MAIN_DB_PREFIX."blockedlog ORDER BY rowid ASC"); + + if($res) { + + $signature = $block_static->getSignature(); + + header('Content-Type: application/octet-stream'); + header("Content-Transfer-Encoding: Binary"); + header("Content-disposition: attachment; filename=\"" .$signature. ".csv\""); + + print $langs->transnoentities('Id') + .';'.$langs->transnoentities('Timestamp') + .';'.$langs->transnoentities('Action') + .';'.$langs->transnoentities('Amounts') + .';'.$langs->transnoentities('Element') + .';'.$langs->transnoentities('ObjectId') + .';'.$langs->transnoentities('Date') + .';'.$langs->transnoentities('Ref') + .';'.$langs->transnoentities('Fingerprint') + .';'.$langs->transnoentities('User')."\n"; + + while($obj = $db->fetch_object($res)) { + + print $obj->rowid + .';'.$obj->tms + .';'.$obj->action + .';'.$obj->amounts + .';'.$obj->element + .';'.$obj->fk_object + .';'.$obj->date_object + .';'.$obj->ref_object + .';'.$obj->signature + .';'.$obj->fk_user."\n"; + + } + + exit; + } + else{ + setEventMessage($db->lasterror, 'errors'); + } + +} /* * View */ -$block_static = new BlockedLog($db); - $blocks = $block_static->getLog('all', 0, GETPOST('all') ? 0 : 50); $form=new Form($db); @@ -74,8 +120,13 @@ print $langs->trans("FingerprintsDesc")."
\n"; print '
'; -echo '
'.$langs->trans('ShowAllFingerPrintsMightBeTooLong').' | '.$langs->trans('DownloadBlockChain').'
'; - +print '
'; +print ' '.$langs->trans('ShowAllFingerPrintsMightBeTooLong').''; +print ' | '.$langs->trans('ShowAllFingerPrintsErrorsMightBeTooLong').''; +print ' | '.$langs->trans('DownloadBlockChain').''; +print ' | '.$langs->trans('DownloadLogCSV').''; +print '
'; + print ''; print ''; @@ -92,24 +143,30 @@ print ''; print ''; foreach($blocks as &$block) { + + $checksignature = $block->checkSignature(); + $object_link = $block->getObjectLink(); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - + if(!$showonlyerrors || $block->error>0) { + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + } } print '
'.dol_print_date($block->tms,'dayhour').''.$block->ref_object.''.$langs->trans('log'.$block->action).''.$block->getObject().''.img_info($langs->trans('ShowDetails')).''.price($block->amounts).''.$block->getUser().''.$block->signature.''; - - print $block->checkSignature() ? img_picto($langs->trans('OkCheckFingerprintValidity'), 'on') : img_picto($langs->trans('KoCheckFingerprintValidity'), 'off'); - if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) { - print ' '.($block->certified ? img_picto($langs->trans('AddedByAuthority'), 'info') : img_picto($langs->trans('NotAddedByAuthorityYet'), 'info_black') ); - } - print '
'.dol_print_date($block->tms,'dayhour').''.$block->ref_object.''.$langs->trans('log'.$block->action).''.$object_link.''.img_info($langs->trans('ShowDetails')).''.price($block->amounts).''.$block->getUser().''.$block->signature.''; + + print $block->error == 0 ? img_picto($langs->trans('OkCheckFingerprintValidity'), 'on') : img_picto($langs->trans('KoCheckFingerprintValidity'), 'off'); + if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) { + print ' '.($block->certified ? img_picto($langs->trans('AddedByAuthority'), 'info') : img_picto($langs->trans('NotAddedByAuthorityYet'), 'info_black') ); + } + print '
'; @@ -121,7 +178,7 @@ $('a[rel=show-info]').click(function() { $pop = $('
trans('Field') ?>trans('Value') ?>
'); $pop.dialog({ - title:"trans('BlockedlogInfoDialog'); ?>" + title:"transnoentities('BlockedlogInfoDialog'); ?>" ,modal:true ,width:'80%' }); diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 1f93eb3cc26..b0cddd66f75 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -78,6 +78,7 @@ class BlockedLog public $object_data = null; + public $error = 0; /** * Constructor @@ -91,9 +92,9 @@ class BlockedLog } /** - * try to retrieve logged object + * try to retrieve logged object link */ - public function getObject() { + public function getObjectLink() { global $langs; if($this->element === 'facture') { @@ -103,6 +104,9 @@ class BlockedLog if($object->fetch($this->fk_object)>0) { return $object->getNomUrl(1); } + else{ + $this->error++; + } } else if($this->element === 'payment') { require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; @@ -111,6 +115,9 @@ class BlockedLog if($object->fetch($this->fk_object)>0) { return $object->getNomUrl(1); } + else{ + $this->error++; + } } return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object); @@ -388,8 +395,13 @@ class BlockedLog $this->getSignatureRecursive(); - return ($signature_to_test=== $this->signature); + $res = ($signature_to_test === $this->signature); + if(!$res) { + $this->error++; + } + + return $res; } /** @@ -490,8 +502,7 @@ class BlockedLog */ private function getCurrentValue() { - if($this->action === 'PAYMENT_CUSTOMER_CREATE' - || $this->action === 'PAYMENT_ADD_TO_BANK') { + if($this->element === 'payment') { $sql="SELECT amount FROM ".MAIN_DB_PREFIX."paiement WHERE rowid=".$this->fk_object; $res = $this->db->query($sql); @@ -500,7 +511,15 @@ class BlockedLog $this->amounts = (double) $obj->amount; } } - + elseif($this->element === 'facture') { + $sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object; + + $res = $this->db->query($sql); + if($res && $obj = $this->db->fetch_object($res)) { + $this->amounts = (double) $obj->total_ttc; + } + } + } /** diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index b5432b94eec..a2e467a35e3 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -27,6 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/keypad.php'; +$error=GETPOST('error'); + // Test if already logged if ( $_SESSION['uid'] <= 0 ) { @@ -54,9 +56,7 @@ print ''."\n"; if (!empty($error)) { - print $error; - print ''; - exit; + dol_htmloutput_events(); } print '
'."\n"; diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index ab8d660fcf1..c34e8596f01 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -106,6 +106,14 @@ p { padding-right: 5px; } +/* Force values for small screen 570 */ +@media only screen and (max-width: 570px) +{ + .menu_choix0 { + max-width: 180px; + } +} + .menu_choix0 a { font-weight: normal; text-decoration: none; @@ -259,7 +267,6 @@ p.titre { /* --------------------- Combo lists ------------------- */ .select_design { - width: 370px; overflow: auto; } diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index fce4df22c7a..580012847f5 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -38,7 +38,7 @@ $langs->load("cashdesk"); - +
@@ -89,42 +89,32 @@ $langs->load("cashdesk"); -
trans("FilterRefOrLabelOrBC"); ?>trans("Designation"); ?>
- - - +
trans("Qty"); ?>trans("Stock"); ?>
+ + - - - + - - - - - - + + + + + + + + + + +
trans("Qty"); ?> trans("PriceUHT"); ?> trans("Discount"); ?> (%)trans("TotalHT"); ?>  trans("VATRate"); ?>
- - + vatrate; // To get vat rate we just have selected @@ -133,7 +123,20 @@ $langs->load("cashdesk"); echo $form->load_tva('selTva', (isset($_POST["selTva"])?GETPOST("selTva",'alpha',2):$vatrate), $mysoc, $buyer, 0, 0, '', false, -1); ?>
trans("Stock"); ?> + + trans("TotalHT"); ?>
" /> @@ -149,13 +152,13 @@ $langs->load("cashdesk"); trans("TotalTicket"); ?>trans("Received"); ?>trans("Change"); ?> - + - + - + diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index 85de5ad9ab5..fd9bcbca77c 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -79,10 +79,11 @@ print '
'; /*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'
'; print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'
'; print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'
';*/ +print '
'; if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) { print $langs->trans("CashDeskWarehouse").': '.$warehouseLink; } -print ''; +print '
'; print '
'; print "\n".''."\n"; diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index c58a2758343..88c1e62a479 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -32,7 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $obj_facturation = unserialize($_SESSION['serObjFacturation']); -unset ($_SESSION['serObjFacturation']); $action =GETPOST('action','aZ09'); $bankaccountid=GETPOST('cashdeskbank'); @@ -129,7 +128,7 @@ switch ($action) exit; } - switch ( $obj_facturation->getSetPaymentMode() ) + switch ($obj_facturation->getSetPaymentMode() ) { case 'DIF': $mode_reglement_id = 0; @@ -159,7 +158,6 @@ switch ($action) $note .= $_POST['txtaNotes']; dol_syslog("obj_facturation->getSetPaymentMode()=".$obj_facturation->getSetPaymentMode()." mode_reglement_id=".$mode_reglement_id." cond_reglement_id=".$cond_reglement_id); - $error=0; @@ -255,14 +253,15 @@ switch ($action) } else { - $error++; + setEventMessage($invoice->error, $invoice->errors, 'errors'); + $error++; } $id = $invoice->id; } else { - $resultcreate=$invoice->create($user,0,0); + $resultcreate=$invoice->create($user,0,0); if ($resultcreate > 0) { $warehouseidtodecrease=(isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0); @@ -287,7 +286,8 @@ switch ($action) if ($invoice->type == $invoice::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref)); else $result=$mouvP->livraison($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref)); if ($result < 0) { - $error++; + setEventMessages($mouvP->error, $mouvP->errors, 'errors'); + $error++; } } } @@ -331,15 +331,18 @@ switch ($action) } else { - $error++; + setEventMessages($invoice->error, $invoice->errors, 'errors'); + $error++; } } else { - $error++; + setEventMessages($invoice->error, $invoice->errors, 'errors'); + $error++; } } + if (! $error) { $db->commit(); @@ -348,14 +351,14 @@ switch ($action) else { $db->rollback(); - $redirection = 'affIndex.php?facid='.$id.'&mesg=ErrorFailedToCreateInvoice'; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr + $redirection = 'affIndex.php?facid='.$id.'&error=1&mesg=ErrorFailedToCreateInvoice'; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr } break; // End of case: valide_facture } - +unset ($_SESSION['serObjFacturation']); $_SESSION['serObjFacturation'] = serialize($obj_facturation); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 220422a6404..47a35ff47a1 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -161,7 +161,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } } -$object = new Propal($db); // To be passed as parameter of executeHooks that need +$object = new Propal($db); // To be passed as parameter of executeHooks that need /* @@ -359,12 +359,12 @@ if ($resql) else { $title = $langs->trans('ListOfProposals'); - } + } $num = $db->num_rows($resql); - + $arrayofselected=is_array($toselect)?$toselect:array(); - + $param='&viewstatut='.$viewstatut; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -389,7 +389,7 @@ if ($resql) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + // List of mass actions available $arrayofmassactions = array( 'presend'=>$langs->trans("SendByMail"), @@ -398,7 +398,7 @@ if ($resql) if ($user->rights->propal->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); if ($massaction == 'presend') $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - + // Lignes des champs de filtre print '
'; if ($optioncss != '') print ''; @@ -408,13 +408,13 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); - + if ($massaction == 'presend') { $langs->load("mails"); - + if (! GETPOST('cancel')) { $objecttmp=new Propal($db); @@ -433,17 +433,17 @@ if ($resql) } } } - + print ''; - + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); - + dol_fiche_head(null, '', ''); - + $topicmail="SendSupplierProposalRef"; $modelmail="supplier_proposal_send"; - + // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); @@ -496,25 +496,25 @@ if ($resql) $formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; - + // Tableau des parametres complementaires du post $formmail->param['action']=$action; $formmail->param['models']=$modelmail; $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['id']=join(',',$arrayofselected); //$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - + print $formmail->get_form(); - + dol_fiche_end(); } - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + $i = 0; $moreforfilter=''; @@ -525,7 +525,7 @@ if ($resql) $langs->load("commercial"); $moreforfilter.='
'; $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300'); + $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200'); $moreforfilter.='
'; } // If the user can view prospects other than his' @@ -533,7 +533,7 @@ if ($resql) { $moreforfilter.='
'; $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; - $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
'; } // If the user can view products @@ -550,7 +550,7 @@ if ($resql) $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; - + if (! empty($moreforfilter)) { print '
'; @@ -561,12 +561,12 @@ 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['p.ref']['checked'])) + if (! empty($arrayfields['p.ref']['checked'])) { print ''; } // Date - if (! empty($arrayfields['p.date']['checked'])) + if (! empty($arrayfields['p.date']['checked'])) { print ''; } // Date end - if (! empty($arrayfields['p.fin_validite']['checked'])) + if (! empty($arrayfields['p.fin_validite']['checked'])) { print ''; } @@ -703,10 +703,10 @@ if ($resql) $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; - + print "\n"; - + // Fields title print ''; if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); @@ -726,9 +726,9 @@ if ($resql) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + 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); @@ -744,24 +744,24 @@ if ($resql) if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.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(); $i=0; $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - - + + $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; - + print ''; - + if (! empty($arrayfields['p.ref']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; } - + if (! empty($arrayfields['p.ref_client']['checked'])) { // Customer ref @@ -803,12 +803,12 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; $companystatic->code_client=$obj->code_client; - + // Thirdparty if (! empty($arrayfields['s.nom']['checked'])) { @@ -817,7 +817,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Town if (! empty($arrayfields['s.town']['checked'])) { @@ -858,7 +858,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Date proposal if (! empty($arrayfields['p.date']['checked'])) { @@ -867,7 +867,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } - + // Date end validity if (! empty($arrayfields['p.fin_validite']['checked'])) { @@ -882,7 +882,7 @@ if ($resql) } if (! $i) $totalarray['nbfield']++; } - + // Amount HT if (! empty($arrayfields['p.total_ht']['checked'])) { @@ -907,7 +907,7 @@ if ($resql) if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->total_ttc; } - + $userstatic->id=$obj->fk_user_author; $userstatic->login=$obj->login; @@ -920,7 +920,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } - + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -1008,16 +1008,16 @@ if ($resql) } $db->free($resql); - + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print '
'; print ''; @@ -608,7 +608,7 @@ if ($resql) print ''; //print $langs->trans('Month').': '; @@ -620,7 +620,7 @@ if ($resql) print ' 
'; - + print ''; // Picto + Ref print '
'; @@ -790,11 +790,11 @@ if ($resql) $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '
'; - + print "
'."\n"; print '
'."\n"; print ''."\n"; - + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { /* @@ -1025,18 +1025,18 @@ if ($resql) */ $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource.=str_replace('&','&',$param); - + $filedir=$diroutputmassaction; $genallowed=$user->rights->propal->lire; $delallowed=$user->rights->propal->lire; - + print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'',''); } else { print '
'.$langs->trans("ShowTempMassFilesArea").''; } - + } else { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c49c1b18a4a..daefc3c4cce 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -803,7 +803,7 @@ if ($resql) $langs->load("commercial"); $moreforfilter.='
'; $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300'); + $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200'); $moreforfilter.='
'; } // If the user can view other users @@ -811,7 +811,7 @@ if ($resql) { $moreforfilter.='
'; $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; - $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
'; } // If the user can view prospects other than his' @@ -821,7 +821,7 @@ if ($resql) $moreforfilter.='
'; $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter.='
'; } $parameters=array(); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a4608b59a7d..2c83cc68286 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3429,7 +3429,7 @@ else if ($id > 0 || ! empty($ref)) print $object->situation_counter; print ''; - print ''; + print ''; $prevsits_total_amount = 0; foreach ($prevsits as $situation) { @@ -3437,9 +3437,9 @@ else if ($id > 0 || ! empty($ref)) } $prevsits_total_amount += $object->total_ht; - print price($prevsits_total_amount); - print ''; - print '' . $langs->trans('Currency' . $conf->currency) . ''; + print price($prevsits_total_amount, 0, $langs, 1, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency) ); + + print ''; // Previous situation(s) deduction(s) for ($i = 0; $i < $cprevsits; $i++) { @@ -3450,10 +3450,9 @@ else if ($id > 0 || ! empty($ref)) print $prevsits[$i]->situation_counter; print ''; - print ''; - print '- ' . price($prevsits[$i]->total_ht); - print ''; - print '' . $langs->trans('Currency' . $conf->currency) . ''; + print ''; + print '- ' . price($prevsits[$i]->total_ht, 0, $langs, 1, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency) ); + print ''; } } } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 00b18c00759..2716e3a87b1 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -191,7 +191,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All tests are required to be compatible with all browsers { $search_user=''; $search_sale=''; @@ -213,7 +213,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOS $search_state=""; $search_type=''; $search_country=''; - $search_type_thirdparty=''; + $search_type_thirdparty=''; $day=''; $year=''; $month=''; @@ -239,17 +239,17 @@ if (empty($reshook)) if ($massaction == 'withdrawrequest') { $langs->load("withdrawals"); - + if (!$user->rights->prelevement->bons->creer) { $error++; setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); } - else + else { //Checking error $error = 0; - + $arrayofselected=is_array($toselect)?$toselect:array(); $listofbills=array(); foreach($arrayofselected as $toselectid) @@ -274,7 +274,7 @@ if ($massaction == 'withdrawrequest') $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("Draft"), $objecttmp->errors, 'errors'); } - + $rsql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; $rsql .= " , pfd.date_traite as date_traite"; $rsql .= " , pfd.amount"; @@ -291,7 +291,7 @@ if ($massaction == 'withdrawrequest') { $numprlv = $db->num_rows($result_sql); } - + if($numprlv>0){ $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'errors'); @@ -300,7 +300,7 @@ if ($massaction == 'withdrawrequest') $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors'); } - + } } @@ -327,13 +327,13 @@ if ($massaction == 'withdrawrequest') if ($nbwithdrawrequestok > 0) { setEventMessages($langs->trans("WithdrawRequestsDone", $nbwithdrawrequestok), null, 'mesgs'); - } + } } } } - + /* * View @@ -350,7 +350,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.rowid as id, f.facnumber as ref, 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,'; @@ -360,7 +360,7 @@ $sql.= " typent.code as typent_code,"; $sql.= " state.code_departement as state_code, state.nom as state_name"; // We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0) // TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field. -if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; +if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks @@ -424,7 +424,7 @@ 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_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) { @@ -577,7 +577,7 @@ if ($resql) $langs->load("withdrawals"); $arrayofmassactions['withdrawrequest']=$langs->trans("MakeWithdrawRequest"); } - if ($user->rights->facture->supprimer) + if ($user->rights->facture->supprimer) { //if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) || empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) @@ -608,8 +608,8 @@ if ($resql) if ($massaction == 'presend') { $langs->load("mails"); - - if (! GETPOST('cancel')) + + if (! GETPOST('cancel')) { $objecttmp=new Facture($db); $listofselectedid=array(); @@ -618,7 +618,7 @@ if ($resql) foreach($arrayofselected as $toselectid) { $result=$objecttmp->fetch($toselectid); - if ($result > 0) + if ($result > 0) { $listofselectedid[$toselectid]=$toselectid; $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; @@ -629,10 +629,10 @@ if ($resql) } print ''; - + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); - + dol_fiche_head(null, '', ''); $topicmail="SendBillRef"; @@ -700,7 +700,7 @@ if ($resql) //$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; print $formmail->get_form(); - + dol_fiche_end(); } @@ -709,7 +709,7 @@ if ($resql) foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + // If the user can view prospects other than his' $moreforfilter=''; if ($user->rights->societe->client->voir || $socid) @@ -717,7 +717,7 @@ if ($resql) $langs->load("commercial"); $moreforfilter.='
'; $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300'); + $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200'); $moreforfilter.='
'; } // If the user can view prospects other than his' @@ -725,7 +725,7 @@ if ($resql) { $moreforfilter.='
'; $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; - $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
'; } // If the user can view prospects other than his' @@ -735,7 +735,7 @@ if ($resql) $moreforfilter.='
'; $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter.='
'; } $parameters=array(); @@ -753,7 +753,7 @@ 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"; @@ -788,7 +788,7 @@ if ($resql) print ''; } // Date invoice - if (! empty($arrayfields['f.date']['checked'])) + if (! empty($arrayfields['f.date']['checked'])) { print ''; } // Date due - if (! empty($arrayfields['f.date_lim_reglement']['checked'])) + if (! empty($arrayfields['f.date_lim_reglement']['checked'])) { print ''; } // Thirpdarty - if (! empty($arrayfields['s.nom']['checked'])) + if (! empty($arrayfields['s.nom']['checked'])) { print ''; } @@ -842,7 +842,7 @@ if ($resql) print ''; } // Payment mode - if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) + if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) { print '\n"; - + print "\n"; + if ($num > 0) { $i=0; @@ -998,8 +998,8 @@ if ($resql) $obj = $db->fetch_object($resql); $datelimit=$db->jdate($obj->datelimite); - $facturestatic->id=$obj->facid; - $facturestatic->ref=$obj->facnumber; + $facturestatic->id=$obj->id; + $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; $facturestatic->statut=$obj->fk_statut; $facturestatic->date_lim_reglement=$db->jdate($obj->datelimite); @@ -1011,28 +1011,28 @@ if ($resql) $totaldeposits = $facturestatic->getSumDepositsUsed(); $totalpay = $paiement + $totalcreditnotes + $totaldeposits; $remaintopay = $obj->total_ttc - $totalpay; - + print ''; if (! empty($arrayfields['f.facnumber']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; } @@ -1089,7 +1089,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Third party if (! empty($arrayfields['s.nom']['checked'])) { @@ -1256,18 +1256,18 @@ if ($resql) print ""; if (! $i) $totalarray['nbfield']++; } - + // Action column print '' ; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; @@ -1303,31 +1303,31 @@ if ($resql) else print ''; } print ''; - + } } $db->free($resql); - + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print "
'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; @@ -797,7 +797,7 @@ if ($resql) print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; @@ -812,7 +812,7 @@ if ($resql) print ''; $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10); @@ -987,8 +987,8 @@ if ($resql) 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 "
'; print ''; - + print ''; - + print ''; print ''; print '
'; print $facturestatic->getNomUrl(1,'',200,0,'',0,1); print empty($obj->increment)?'':' ('.$obj->increment.')'; print ''; - $filename=dol_sanitizeFileName($obj->facnumber); - $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->facid; + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->id; print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print '
'; - + 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->facid, $arrayofselected)) $selected=1; - print ''; + if (in_array($obj->id, $arrayofselected)) $selected=1; + print ''; } print '
\n"; print '
'; - + print "\n"; - + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { // Show list of available documents $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource.=str_replace('&','&',$param); - + $filedir=$diroutputmassaction; $genallowed=$user->rights->facture->lire; $delallowed=$user->rights->facture->lire; - + print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); } else diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 29e13412892..a82535bfbb7 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -305,7 +305,7 @@ if ($resql) $i = 0; $arrayofselected=is_array($toselect)?$toselect:array(); - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -323,7 +323,7 @@ if ($resql) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + // List of mass actions available $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), @@ -332,7 +332,7 @@ if ($resql) if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); if ($massaction == 'presend') $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - + print '
'; if ($optioncss != '') print ''; print ''; @@ -341,7 +341,7 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); if ($sall) @@ -349,16 +349,16 @@ if ($resql) foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + $moreforfilter=''; - + // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter.='
'; $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth300'); + $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth200'); $moreforfilter.='
'; } // If the user can view other users @@ -366,7 +366,7 @@ if ($resql) { $moreforfilter.='
'; $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; - $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
'; } // If the user can view categories of products @@ -376,15 +376,15 @@ if ($resql) $moreforfilter.='
'; $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter.='
'; } - + $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; - + if (! empty($moreforfilter)) { print '
'; @@ -395,7 +395,7 @@ 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"; @@ -514,7 +514,7 @@ if ($resql) print $searchpicto; print ''; print "\n"; - + print ''; if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder); if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder); @@ -530,9 +530,9 @@ if ($resql) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + 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); @@ -558,12 +558,12 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - + $contracttmp->ref=$obj->ref; $contracttmp->id=$obj->rowid; $contracttmp->ref_customer=$obj->ref_customer; $contracttmp->ref_supplier=$obj->ref_supplier; - + print ''; if (! empty($arrayfields['c.ref']['checked'])) { @@ -578,15 +578,15 @@ if ($resql) } print ''; } - if (! empty($arrayfields['c.ref_customer']['checked'])) + if (! empty($arrayfields['c.ref_customer']['checked'])) { print ''; } - if (! empty($arrayfields['c.ref_supplier']['checked'])) + if (! empty($arrayfields['c.ref_supplier']['checked'])) { print ''; } - if (! empty($arrayfields['s.nom']['checked'])) + if (! empty($arrayfields['s.nom']['checked'])) { print ''; } @@ -629,7 +629,7 @@ if ($resql) print $typenArray[$obj->typent_code]; print ''; if (! $i) $totalarray['nbfield']++; - } + } if (! empty($arrayfields['sale_representative']['checked'])) { // Sales representatives @@ -713,7 +713,7 @@ if ($resql) if (! $i) $totalarray['nbfield']++; } // Status - if (! empty($arrayfields['status']['checked'])) + if (! empty($arrayfields['status']['checked'])) { print ''; print ''; @@ -730,7 +730,7 @@ if ($resql) } print ''; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; } @@ -738,7 +738,7 @@ if ($resql) print '
'.$obj->ref_customer.''.$obj->ref_supplier.''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''.($obj->nb_initial>0?$obj->nb_initial:'').''.($obj->nb_running>0?$obj->nb_running:'').'
'; print '
'; - + print ''; } else diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c5344ab467a..5af4024f9c2 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -309,10 +309,11 @@ class FormOther * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" * @param int $showempty Add also an empty line - * @return string Html combo list code + * @param string $morecss More CSS + * @return string Html combo list code * @see select_all_categories */ - function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0,$showempty=1) + function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='') { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -328,18 +329,16 @@ class FormOther $tab_categs = $static_categs->get_full_arbo($type); $moreforfilter = ''; - $nodatarole = ''; // Enhance with select2 if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $comboenhancement = ajax_combobox('select_categ_'.$htmlname); $moreforfilter.=$comboenhancement; - $nodatarole=($comboenhancement?' data-role="none"':''); } // Print a select with each of them - $moreforfilter.=''; if ($showempty) $moreforfilter.=''; // Should use -1 to say nothing if (is_array($tab_categs)) @@ -379,7 +378,6 @@ class FormOther $langs->load('users'); $out = ''; - $nodatarole = ''; // Enhance with select2 if ($conf->use_javascript_ajax) { @@ -389,11 +387,10 @@ class FormOther if ($comboenhancement) { $out.=$comboenhancement; - $nodatarole=($comboenhancement?' data-role="none"':''); } } // Select each sales and print them in a select input - $out.=''; if ($showempty) $out.=''; // Get list of users allowed to be viewed diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index d2441487231..074760e88ca 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -39,8 +39,11 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); require_once '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php + $langs->load("main"); $langs->load("agenda"); + $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index ac22841ad20..7f9cf523105 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -8,7 +8,7 @@ if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) } // Add extra fields -$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.')'; +$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.')'; //print $sql; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) @@ -42,10 +42,23 @@ if ($resql) // This can fail when class is used on old database (during migra if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; break; } - if ($obj->type!='separate') { - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]=$keyforelement; + if ($obj->type!='separate') + { + // If not a computed field + if (empty($obj->fieldcomputed)) + { + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; + $this->export_entities_array[$r][$fieldname]=$keyforelement; + } + // If this is a computed field + else + { + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter.'Compute'; + $this->export_special_array[$r][$fieldname]=$obj->fieldcomputed; + $this->export_entities_array[$r][$fieldname]=$keyforelement; + } } } } diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 0e2f0bcb7c3..18835a6b4d5 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -47,6 +47,8 @@ if (! defined('DISABLE_SELECT2')) define('DISABLE_SELECT2',1); require_once '../main.inc.php'; +if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php + $langs->load("main"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); @@ -123,7 +125,7 @@ print ' } li.lilevel3:last-child { padding-bottom: 10px; - } + } a.alilevel0, li.lilevel1 a { text-overflow: ellipsis; overflow: hidden; @@ -131,7 +133,7 @@ print ' display: block; } - + '; - + if (empty($user->societe_id)) // If internal user or not defined { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 60b970fffce..21fb1be7c0d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1891,6 +1891,12 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->rights->fournisseur->facture->{$lire}) $accessallowed=1; $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; } + // Wrapping pour les apercu supplier invoice + elseif (($modulepart == 'apercuexpensereport') && !empty($conf->expensereport->dir_output)) + { + if ($fuser->rights->expensereport->{$lire}) $accessallowed=1; + $original_file=$conf->expensereport->dir_output.'/'.$original_file; + } // Wrapping pour les images des stats propales elseif ($modulepart == 'propalstats' && !empty($conf->propal->dir_temp)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 27e635ebabe..7850afecaf3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -414,6 +414,9 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) case 'intcomma': if (preg_match('/[^0-9,]+/i',$out)) $out=''; break; + case 'intcomma': + if (preg_match('/[^0-9,]+/i',$out)) $out=''; + break; case 'alpha': $out=trim($out); // '"' is dangerous because param in url can close the href= or src= and add javascript functions. @@ -758,7 +761,7 @@ function dol_string_unaccent($str) */ function dol_string_nospecial($str,$newstr='_',$badcharstoreplace='') { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); + $forbidden_chars_to_replace=array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "="); $forbidden_chars_to_remove=array(); if (is_array($badcharstoreplace)) $forbidden_chars_to_replace=$badcharstoreplace; //$forbidden_chars_to_remove=array("(",")"); @@ -1158,14 +1161,15 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if (class_exists("Imagick")) { - if ($object->element == 'propal') $modulepart='propal'; - if ($object->element == 'commande') $modulepart='commande'; - if ($object->element == 'facture') $modulepart='facture'; - if ($object->element == 'fichinter') $modulepart='ficheinter'; - if ($object->element == 'contrat') $modulepart='contract'; + if ($object->element == 'propal') $modulepart='propal'; + if ($object->element == 'commande') $modulepart='commande'; + if ($object->element == 'facture') $modulepart='facture'; + if ($object->element == 'fichinter') $modulepart='ficheinter'; + if ($object->element == 'contrat') $modulepart='contract'; if ($object->element == 'supplier_proposal') $modulepart='supplier_proposal'; if ($object->element == 'order_supplier') $modulepart='supplier_order'; if ($object->element == 'invoice_supplier') $modulepart='supplier_invoice'; + if ($object->element == 'expensereport') $modulepart='expensereport'; } if ($object->element == 'product') @@ -1195,7 +1199,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { $phototoshow=''; // Check if a preview file is available - if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice')) && class_exists("Imagick")) + if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice', 'expensereport')) && class_exists("Imagick")) { $objectref = dol_sanitizeFileName($object->ref); $dir_output = $conf->$modulepart->dir_output . "/"; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index a32d3ef6886..c1de978d2df 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -166,8 +166,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Accountancy - Supplier invoice insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'accountancy', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/impayees.php?leftmenu=suppliers_bills', 'Unpaid', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'accountancy', '', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); -- Accountancy - Customer invoice insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); @@ -275,9 +276,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries.php?leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __ENTITY__); --- Account - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=5', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?action=create&type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +-- Bank - Categories +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?leftmenu=bank&type=5', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?leftmenu=bank&action=create&type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- Project insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects', 'Projects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); @@ -287,8 +288,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3703__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); + +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index cc5c0710fb9..bbe41dbab10 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -54,20 +54,20 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m if (empty($noout)) print_start_menu_array_auguria(); $usemenuhider = (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)); - + // Show/Hide vertical menu if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; $classname = 'class="tmenu menuhider"'; $idsel='menu'; - + if (empty($noout)) print_start_menu_entry_auguria($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry_auguria('', 1, '#', $id, $idsel, $classname, $atarget); if (empty($noout)) print_end_menu_entry_auguria($showmode); $menu->add('#', '', 0, $showmode, $atarget, "xxx", ''); } - + $num = count($newTabMenu); for($i = 0; $i < $num; $i++) { @@ -77,7 +77,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m if ($showmode == 1) { $url = $shorturl = $newTabMenu[$i]['url']; - + if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) { $tmp=explode('?',$newTabMenu[$i]['url'],2); @@ -85,11 +85,11 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m $param = (isset($tmp[1])?$tmp[1]:''); // Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined. - if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($newTabMenu[$i]['url'])) + if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($newTabMenu[$i]['url'])) { $param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['url'].'&leftmenu='; } - if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($newTabMenu[$i]['url'])) + if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($newTabMenu[$i]['url'])) { $param.=($param?'&':'').'leftmenu='; } @@ -110,7 +110,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m if ($search_project_user) $shorturl=preg_replace('/search_project_user=__search_project_user__/', 'search_project_user='.$search_project_user, $shorturl); else $shorturl=preg_replace('/search_project_user=__search_project_user__/', '', $shorturl); } - + // Define the class (top menu selected or not) if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"'; else if (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"'; @@ -144,7 +144,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m function print_start_menu_array_auguria() { global $conf; - + print '
'; print '
    global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>'; } @@ -258,7 +258,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $usemenuhider = (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)); global $usemenuhider; - + // Show logo company if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { @@ -292,7 +292,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM print '
'."\n"; print "\n"; } - + // We update newmenu with entries found into database $menuArbo = new Menubase($db,'auguria'); $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu); @@ -300,6 +300,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM // We update newmenu for special dynamic menus if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account { + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required for to get Account::TYPE_CASH for example + $sql = "SELECT rowid, label, courant, rappro, courant"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE entity = ".$conf->entity; @@ -409,7 +411,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM for($j = ($i + 1); $j < $num; $j++) { if (empty($menu_array[$j]['level'])) $lastopened=false; - } + } if ($altok % 2 == 0) { print '
'."\n"; @@ -470,10 +472,12 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM // Menu level > 0 if ($menu_array[$i]['level'] > 0) { + $cssmenu = ''; + if ($menu_array[$i]['url']) $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/','',$menu_array[$i]['url'])); + if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') // Enabled so visible, except if parent was not enabled. { - print ''."\n"; print "\n"; } - + return count($menu_array); } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8c83435914b..d1da533b021 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -811,7 +811,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire); } - $newmenu->add("/compta/facture/fiche-rec.php",$langs->trans("ListOfTemplates"),1,$user->rights->facture->lire); + $newmenu->add("/compta/facture/fiche-rec.php",$langs->trans("ListOfTemplates"),1,$user->rights->facture->creer); // No need to see recurring invoices, if user has no permission to create invoice. $newmenu->add("/compta/paiement/list.php",$langs->trans("Payments"),1,$user->rights->facture->lire); @@ -1322,9 +1322,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user?'&search_project_user='.$search_project_user:''), $langs->trans("Activities"), 0, $user->rights->projet->lire); $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user?'&search_project_user='.$search_project_user:''), $langs->trans("List"), 1, $user->rights->projet->lire); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user?'&search_project_user='.$search_project_user:''), $langs->trans("NewTimeSpent"), 1, $user->rights->projet->lire); $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user?'&search_project_user='.$search_project_user:''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); + // All project i have permission on /*$newmenu->add("/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire && $user->rights->projet->lire); $newmenu->add("/projet/tasks.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer && $user->rights->projet->creer); @@ -1650,10 +1651,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Menu level > 0 if ($menu_array[$i]['level'] > 0) { + $cssmenu = ''; + if ($menu_array[$i]['url']) $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/','',$menu_array[$i]['url'])); + if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') // Enabled so visible, except if parent was not enabled. { - print '