diff --git a/dev/namespacemig/aaa.class.php b/dev/namespacemig/aaa.class.php index 1070e96f875..7b165349472 100644 --- a/dev/namespacemig/aaa.class.php +++ b/dev/namespacemig/aaa.class.php @@ -20,4 +20,3 @@ class Aaa echo 'doaaa'."\n"; } } - diff --git a/dev/namespacemig/bbb.class.php b/dev/namespacemig/bbb.class.php index cc53aa6517d..0fb6fd3d7ae 100644 --- a/dev/namespacemig/bbb.class.php +++ b/dev/namespacemig/bbb.class.php @@ -22,4 +22,3 @@ class Bbb $globalbbb.='+bbb'; } } - diff --git a/dev/namespacemig/main.inc.php b/dev/namespacemig/main.inc.php index 5709a31f733..84fb2ddeaaa 100644 --- a/dev/namespacemig/main.inc.php +++ b/dev/namespacemig/main.inc.php @@ -4,4 +4,4 @@ var_dump('class='.$class_name); require $class_name; }); -*/ \ No newline at end of file +*/ diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index c4f68812547..6773e1d2c03 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -68,7 +68,9 @@ 0 - + + 0 + '."\n"; + $searchForm.= '
'; + $searchForm.= ''; + $searchForm.= '
'; + + // Url to list bookmark + $listbtn = ''; + $listbtn.= ' '.$langs->trans('Bookmarks').''; + + // Url to go on create new bookmark page + $newbtn = ''; + if (! empty($user->rights->bookmark->creer)) + { + //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); + $urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); + $newbtn.= ''; + $newbtn.= ' '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; + } + + + $bookmarkList=''; + + $html= ''; + if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) { + $html.= ' + + + '; + } + + $html.= ' + + + '; + + $html.= ' + + + '; + + if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) { + $html .= ''; + } + + return $html; +} diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 006482abe11..29a88111f17 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -504,8 +504,8 @@ if ($resql) if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $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['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "a.fk_contact", $param, "", "", $sortfield, $sortorder); - if (! empty($arrayfields['a.fk_element']['checked'])) print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "a.fk_element", $param, "", "", $sortfield, $sortorder); + if (! empty($arrayfields['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder); + if (! empty($arrayfields['a.fk_element']['checked'])) print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -562,7 +562,7 @@ if ($resql) // User owner if (! empty($arrayfields['owner']['checked'])) { - print ''; // With edge and chrom the td overflow is not supported correctly when content is not full text. + print ''; // With edge and chrome the td overflow is not supported correctly when content is not full text. if ($obj->fk_user_action > 0) { $userstatic->fetch($obj->fk_user_action); @@ -632,7 +632,7 @@ if ($resql) // Third party if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; if ($obj->socid > 0) { $societestatic->id=$obj->socid; @@ -650,12 +650,11 @@ if ($resql) if (! empty($arrayfields['a.fk_contact']['checked'])) { print ''; - $actionstatic->fetchResources(); if(!empty($actionstatic->socpeopleassigned)) { $contactList = array(); - foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned) + foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) { if(!isset($contactListCache[$socpeopleassigned['id']])) { @@ -663,8 +662,8 @@ if ($resql) $contact = new Contact($db); if($contact->fetch($socpeopleassigned['id'])>0) { - $contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 28); - $contactList[] = $contact->getNomUrl(1, '', 28); + $contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 0); + $contactList[] = $contact->getNomUrl(1, '', 0); } } else{ @@ -686,7 +685,7 @@ if ($resql) $contactstatic->phone_mobile=$obj->phone_mobile; $contactstatic->phone_perso=$obj->phone_perso; $contactstatic->country_id=$obj->country_id; - print $contactstatic->getNomUrl(1, '', 28); + print $contactstatic->getNomUrl(1, '', 0); } else { diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index e2410846f00..9609038ca41 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -73,7 +73,6 @@ $object->substitutionarrayfortest = $substitutionarray; // List of sending methods $listofmethods=array(); $listofmethods['mail']='PHP mail function'; -//$listofmethods['simplemail']='Simplemail class'; $listofmethods['smtps']='SMTP/SMTPS socket library'; @@ -896,17 +895,23 @@ else print ''; // Description - print ''; // From - print ''; // Errors to - print ''; @@ -1117,7 +1122,7 @@ else $htmltext.=''; // Print mail content - print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto(''.$langs->trans("AvailableVariables").'', $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'generic'); + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto(''.$langs->trans("AvailableVariables").'', $htmltext, 1, 'helpclickable', '', 0, 2, 'emailsubstitionhelp'), 'generic'); dol_fiche_head('', '', '', -1); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index d37eedd202b..321cb719f63 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -58,7 +58,7 @@ $help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES llxHeader("", $langs->trans("ProspectionArea"), $help_url); -print load_fiche_titre($langs->trans("ProspectionArea")); +print load_fiche_titre($langs->trans("ProspectionArea"), '', 'commercial'); //print '
'.$form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').''; + print '
'; + print $form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print ''; print $form->editfieldval("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); print '
'.$form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').''; + print '
'; + print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print ''; print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); print '
'.$form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').''; + print '
'; + print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print ''; print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); print '
'; //print '"; print "\n"; print "
'; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index ca9adcbd7e9..33630de2acd 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -62,7 +62,8 @@ $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Ped llxHeader("", $langs->trans("Orders"), $help_url); -print load_fiche_titre($langs->trans("OrdersArea")); + +print load_fiche_titre($langs->trans("OrdersArea"), '', 'commercial'); print '
'; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index c21cd8394c8..3b2a63cd839 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -603,7 +603,7 @@ if ($resql) print $langs->trans("EventualyAddCategory").': '; print Form::selectarray('cat', $options, GETPOST('cat'), 1); } - print '
'.$langs->trans("ThenCheckLinesAndConciliate").' '; + print '
'.$langs->trans("ThenCheckLinesAndConciliate").' '; print ''; print ' '.$langs->trans("or").' '; print ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 7f5a848fa0d..cca8f6ea9ef 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -182,169 +182,6 @@ if ($action == 'confirm_editbankreceipt' && ! empty($oldbankreceipt) && ! empty( $action='view'; } -// ZIP creation -if ($action=="dl" && $numref > 0) -{ - // TODO Replace this with a standard builddoc action that use a document generation module to build the ZIP - $log = ''; - - $outdir = $conf->bank->dir_temp.'/'.$numref.'-'.$object->label; - $outdirinvoices = $outdir.'/'.$langs->trans("BillsCustomers"); - $outdirsupplierinvoices = $outdir.'/'.$langs->trans("BillsSuppliers"); - - dol_mkdir($outdir); - dol_mkdir($outdirinvoices); - dol_mkdir($outdirsupplierinvoices); - - //$zipname = $object->label.'-'.$numref . '.zip'; - //$zip = new ZipArchive(); - //$zip->open($zipname, ZipArchive::OVERWRITE); - - $sql = $sqlrequestforbankline; - - $facturestatic=new Facture($db); - - $resd = $db->query($sql); - if ($resd) { - $numd = $db->num_rows($resd); - $i = 0; - if ($numd > 0) - { - $objd = $db->fetch_object($resd); - - $log.='Transaction '.$objd->rowid; - $links = $object->get_url($objd->rowid); - - foreach($links as $key=>$val) - { - $link = ''; $upload_dir = ''; - - switch ($val['type']) { - case "payment": - $payment = new Paiement($db); - $payment->fetch($val['url_id']); - $arraybill = $payment->getBillsArray(); - if (is_array($arraybill) && count($arraybill) > 0) - { - foreach ($arraybill as $billid) - { - $facturestatic->fetch($billid); - $subdir = get_exdir($facturestatic->id, 2, 0, 0, $facturestatic, 'invoice'); - - $arrayofinclusion=array(); // TODO Find a way to get doc ODT or other - // TODO Use get_exdir - $arrayofinclusion[]=preg_quote($facturestatic->ref.'.pdf', '/'); - $listoffiles = dol_dir_list($conf->facture->dir_output.$subdir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); - // build list of files with full path - $files = array(); - foreach($listoffiles as $filefound) - { - if (strstr($filefound["name"], $facturestatic->ref)) - { - $files[] = $uploaddir.'/'.$facturestatic->ref.'/'.$filefound["name"]; - break; - } - } - /*var_dump($files);*/ - //var_dump($listoffiles); - foreach($listoffiles as $key => $srcfileobj) - { - $srcfile = $srcfileobj['fullname']; - $destfile = $outdirinvoices.'/'.$srcfileobj['name']; - //var_dump($srcfile.' - '.$destfile); - dol_copy($srcfile, $destfile); - } - } - } - break; - case "payment_supplier": - $payment = new PaiementFourn($db); - $payment->fetch($val['url_id']); - $arraybill = $payment->getBillsArray(); - if (is_array($arraybill) && count($arraybill) > 0) - { - foreach ($arraybill as $billid) - { - $facturestatic->fetch($billid); - $subdir = get_exdir($facturestatic->id, 2, 0, 0, $facturestatic, 'invoice_supplier'); - - $arrayofinclusion=array(); // TODO Find a way to get doc ODT or other - // TODO Use get_exdir - $arrayofinclusion[]=preg_quote($facturestatic->ref.'.pdf', '/'); - $listoffiles = dol_dir_list($conf->fournisseur->facture->dir_output.$subdir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); - // build list of files with full path - $files = array(); - foreach($listoffiles as $filefound) - { - if (strstr($filefound["name"], $facturestatic->ref)) - { - $files[] = $uploaddir.'/'.$facturestatic->ref.'/'.$filefound["name"]; - break; - } - } - /*var_dump($files);*/ - //var_dump($listoffiles); - foreach($listoffiles as $key => $srcfileobj) - { - $srcfile = $srcfileobj['fullname']; - $destfile = $outdirinvoices.'/'.$srcfileobj['name']; - //var_dump($srcfile.' - '.$destfile); - dol_copy($srcfile, $destfile); - } - } - } - break; - case "payment_expensereport": - /*$subdir = dol_sanitizeFileName($objd->refe); - $upload_dir = $conf->expensereport->dir_output . '/' . $subdir;*/ - break; - case "payment_salary": - /*$subdir = dol_sanitizeFileName($objd->ids); - $upload_dir = $conf->salaries->dir_output . '/' . $subdir;*/ - break; - case "payment_donation": - /*$subdir = get_exdir(null, 2, 0, 1, $objd, 'donation') . '/' . dol_sanitizeFileName($objd->idd); - $upload_dir = $conf->don->dir_output . '/' . $subdir;*/ - break; - default: - break; - } - } - $log.="\n"; - - /*if (! empty($upload_dir)) - { - $files = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1); - - if (is_array($files)) { - foreach ($files as $file) { - $zip->addFile($file["fullname"], $file["name"]); // - $log .= $key . ',' . $file["name"] . "\n"; - } - } else { - $log .= $key . ',' . $langs->trans("Nofile") . "\n"; - } - - }*/ - } - } - - $db->free($resd); - - - //$zip->addFromString('log '.$numref.'.csv', $log); - //$zip->close(); - - // /Then download the zipped file. - /*header('Content-Type: application/zip'); - header('Content-disposition: attachment; filename=' . $zipname); - header('Content-Length: ' . filesize($zipname)); - - readfile($zipname); - - exit;*/ -} - /* * View @@ -801,16 +638,10 @@ else print '
'.price(price2num($total, 'MT'))." 
"; + print ""; print "\n"; - - // Add a download button - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // Started a rewrite to make this feature more Dolibarr compliant. Still need dev to be completed. - { - // TODO Replace this with standard box to generate document. - print ''.$langs->trans('DownloadPackageWithAllDocuments')." \n"; - } } // End of page diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 51e3819099a..6defb112efa 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -263,7 +263,7 @@ if ($action == 'create') print ''; print ''; - print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'title_accountancy.png'); + print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'invoicing'); dol_fiche_head('', ''); diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index d506cac2405..6c15c40ecaa 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -172,7 +172,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit); print '
'; print ''."\n"; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 9bd6a2117e0..d27f915fe33 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -315,7 +315,7 @@ if ($action=="create" || $action=="start") } } - print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'title_bank.png'); + print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register'); print ''; if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 98a7a2ae32c..00ba378c3b4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -342,7 +342,7 @@ $newcardbutton.= ''; $newcardbutton.= ''; //} -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit); // Add code for pre mass action (confirmation or email presend form) $topicmail="SendCashControlRef"; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5fd7474475f..171ba639efb 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2587,7 +2587,7 @@ if ($action == 'create') $facturestatic = new Facture($db); $extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element); - print load_fiche_titre($langs->trans('NewBill')); + print load_fiche_titre($langs->trans('NewBill'), '', 'invoicing'); $soc = new Societe($db); if ($socid > 0) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 48c53f1a3b0..171174ebd04 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -972,7 +972,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray[' */ if ($action == 'create') { - print load_fiche_titre($langs->trans("CreateRepeatableInvoice"), '', 'title_accountancy.png'); + print load_fiche_titre($langs->trans("CreateRepeatableInvoice"), '', 'invoicing'); $object = new Facture($db); // Source invoice $product_static = new Product($db); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 7058d976a93..14dec82f40c 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -314,7 +314,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("RepeatableInvoices"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("RepeatableInvoices"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); print $langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'

'; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d6661eaa0d0..d6bbc4d09fe 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -636,7 +636,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit); $topicmail="SendBillRef"; $modelmail="facture_send"; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index f93654947e0..d475c5c3e5f 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -75,7 +75,7 @@ if ($mode == 'supplier') $dir=$conf->fournisseur->facture->dir_temp; } -print load_fiche_titre($title, $mesg, 'title_accountancy.png'); +print load_fiche_titre($title, '', 'invoicing'); dol_mkdir($dir); diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 4f518646253..c02de96035d 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -250,7 +250,7 @@ llxHeader('', $name); //$textprevyear="".img_previous().""; //$textnextyear=" ".img_next().""; -//print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear", 'title_accountancy.png'); +//print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear", 'invoicing'); report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); //report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode); diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 387859c521f..0b0716b53a9 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -48,7 +48,7 @@ if ($user->rights->tax->charges->creer) $newcardbutton.= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt); } -print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton); +print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton, 'invoicing'); $sql = "SELECT rowid, amount, label, f.datev, f.datep"; $sql.= " FROM ".MAIN_DB_PREFIX."localtax as f "; diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 94c5f49e4c9..cdbc56896cb 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -46,7 +46,7 @@ $accountstatic=new Account($db); llxHeader('', $langs->trans("ChequesArea")); -print load_fiche_titre($langs->trans("ChequesArea")); +print load_fiche_titre($langs->trans("ChequesArea"), '', 'bank'); print '
'; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 6ea908543a0..090cc7c83fb 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -222,7 +222,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); print '
'; print '
'."\n"; diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index c5b95bbd336..f0c2b88c797 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -88,7 +88,7 @@ $formother=new FormOther($db); llxHeader(); $titre=($year?$langs->trans("PaymentsReportsForYear", $year):$langs->trans("PaymentsReports")); -print load_fiche_titre($titre, '', 'title_accountancy.png'); +print load_fiche_titre($titre, '', 'invoicing'); // Formulaire de generation print ''; @@ -152,7 +152,7 @@ if ($year) { if (preg_match('/^payment/i', $file)) { - + $tfile = $dir . '/'.$year.'/'.$file; $relativepath = $year.'/'.$file; print ''.''; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 3e95d6c99e3..61db16c505c 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -243,7 +243,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); print '
'.img_pdf().' '.$file.'
'; print ''; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 3e312b19331..56493f3bf7c 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -188,11 +188,11 @@ if ($resql) if ($year) { $center=($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":""); - print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit); } else { - print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit); } if (empty($mysoc->country_id) && empty($mysoc->country_code)) diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 314eb3a5977..d6019c1eef5 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -231,7 +231,7 @@ llxHeader('', $name); //$textprevyear="".img_previous($langs->trans("Previous"), 'class="valignbottom"').""; //$textnextyear=" ".img_next($langs->trans("Next"), 'class="valignbottom"').""; -//print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png'); +//print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'invoicing'); report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); //report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3762208b0d9..5b1e302632e 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -507,7 +507,7 @@ else $title = $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); $linkback=''; - print load_fiche_titre($title, $linkback, 'title_companies.png'); + print load_fiche_titre($title, $linkback, 'address'); // Show errors dol_htmloutput_errors(is_numeric($error)?'':$error, $errors); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 7d9c813b7c6..037606e386a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -476,7 +476,7 @@ print ''; print ''; print ''; -print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies.png', 0, $newcardbutton, '', $limit); +print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit); $topicmail="Information"; $modelmail="contact"; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9dd6b731982..ee41d96c2af 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1571,7 +1571,7 @@ class ExtraFields elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; */ if (! empty($help)) { - $out .= $form->textwithpicto("", $help); + $out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3); } return $out; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a8a0b76af9f..8f912dcab49 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -136,7 +136,7 @@ class Form if (! empty($notabletag)) $ret.=' '; if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.=''; if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.=''; @@ -442,7 +442,7 @@ class Form * @see textwithpicto() Use thisfunction if you can. * TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip */ - public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) + public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) { global $conf; @@ -458,8 +458,8 @@ class Form $htmltext=str_replace("\n", "", $htmltext); $extrastyle=''; - if ($direction < 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-left: 3px !important;'; } - if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-right: 3px !important;'; } + if ($direction < 0) { $extracss=($extracss?$extracss.' ':'').($notabs != 3 ? 'inline-block' : ''); $extrastyle='padding: 0px; padding-left: 3px !important;'; } + if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').($notabs != 3 ? 'inline-block' : ''); $extrastyle='padding: 0px; padding-right: 3px !important;'; } $classfortooltip='classfortooltip'; @@ -476,7 +476,7 @@ class Form } if ($tooltipon == 2 || $tooltipon == 3) { - $paramfortooltipimg=' class="'.$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'"'; + $paramfortooltipimg=' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'"'; if ($tooltiptrigger == '') $paramfortooltipimg.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip else $paramfortooltipimg.=' dolid="'.$tooltiptrigger.'"'; } @@ -519,15 +519,15 @@ class Form * @param string $text Text to show * @param string $htmltext Content of tooltip * @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon - * @param string $type Type of picto ('info', 'help', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none' + * @param string $type Type of picto ('info', 'infoclickable', 'help', 'helpclickable', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none' * @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 string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none') + * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) * @return string HTML code of text, picto, tooltip */ - public function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger = '', $forcenowrap = 0) + public function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 3, $tooltiptrigger = '', $forcenowrap = 0) { global $conf, $langs; @@ -541,7 +541,7 @@ class Form // If info or help with no javascript, show only text if (empty($conf->use_javascript_ajax)) { - if ($type == 'info' || $type == 'help') return $text; + if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') return $text; else { $alt = $htmltext; @@ -552,7 +552,7 @@ class Form // If info or help with smartphone, show only text (tooltip hover can't works) if (! empty($conf->dol_no_mouse_hover) && empty($tooltiptrigger)) { - if ($type == 'info' || $type == 'help') return $text; + if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') return $text; } // If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone) //if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger)) @@ -563,12 +563,13 @@ class Form $img=''; if ($type == 'info') $img = img_help(0, $alt); elseif ($type == 'help') $img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt); + elseif ($type == 'helpclickable') $img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt); elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar'); elseif ($type == 'admin') $img = img_picto($alt, 'star'); elseif ($type == 'warning') $img = img_warning($alt); elseif ($type != 'none') $img = img_picto($alt, $type); // $type can be an image path - return $this->textwithtooltip($text, $htmltext, (($tooltiptrigger && ! $img)?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger, $forcenowrap); + return $this->textwithtooltip($text, $htmltext, ((($tooltiptrigger && ! $img) || strpos($type, 'clickable'))?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger, $forcenowrap); } /** diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index b97ffc5fd28..ba5d2f37293 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -242,7 +242,7 @@ class FormTicket } include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $uselocalbrowser = true; - $doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser); + $doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET); $doleditor->Create(); print ''; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 8f9dc32901d..3780ab35b06 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -781,6 +781,8 @@ class Translate if (preg_match('/^[a-z]+_[A-Z]+/i', $dir)) { $this->load("languages"); + + if (! empty($conf->global->MAIN_LANGUAGES_ALLOWED) && ! in_array($dir, explode(',', $conf->global->MAIN_LANGUAGES_ALLOWED)) ) continue; if ($usecode == 2) { diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 8e32b59b590..3ba3b322e68 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -29,21 +29,21 @@ interface Database * Format a SQL IF * * @param string $test Test string (example: 'cd.statut=0', 'field IS NULL') - * @param string $resok resultat si test egal - * @param string $resko resultat si test non egal + * @param string $resok result if test is equal + * @param string $resko result if test is not equal * @return string SQL string */ - public function ifsql($test, $resok, $resko); + public function ifsql($test, $resok, $resko); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array Array */ - public function fetch_row($resultset); - // phpcs:enable + public function fetch_row($resultset); + // phpcs:enable /** * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. @@ -52,23 +52,23 @@ interface Database * @param int $param Date TMS to convert * @return string Date in a string YYYYMMDDHHMMSS */ - public function idate($param); + public function idate($param); /** * Return last error code * * @return string lasterrno */ - public function lasterrno(); + public function lasterrno(); /** * Start transaction * * @return int 1 if transaction successfuly opened or already opened, 0 if error */ - public function begin(); + public function begin(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated @@ -80,15 +80,15 @@ interface Database * @param string $owner Username of database owner * @return resource resource defined if OK, null if KO */ - public function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); - // phpcs:enable + public function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); + // phpcs:enable /** * Return version of database server into an array * * @return array Version array */ - public function getVersionArray(); + public function getVersionArray(); /** * Convert a SQL request in Mysql syntax to native syntax @@ -99,25 +99,25 @@ interface Database */ public static function convertSQLFromMysql($line, $type = 'ddl'); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return the number of lines in the result of a request INSERT, DELETE or UPDATE * - * @param resource $resultset Curseur de la requete voulue + * @param resource $resultset Cursor of the desired request * @return int Number of lines * @see num_rows() */ - public function affected_rows($resultset); - // phpcs:enable + public function affected_rows($resultset); + // phpcs:enable /** * Return description of last error * * @return string Error text */ - public function error(); + public function error(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * List tables into a database * @@ -125,15 +125,15 @@ interface Database * @param string $table Nmae of table filter ('xxx%') * @return array List of tables in an array */ - public function DDLListTables($database, $table = ''); - // phpcs:enable + public function DDLListTables($database, $table = ''); + // phpcs:enable /** * Return last request executed with query() * * @return string Last query */ - public function lastquery(); + public function lastquery(); /** * Define sort criteria of request @@ -142,7 +142,7 @@ interface Database * @param string $sortorder Sort order * @return string String to provide syntax of a sort sql string */ - public function order($sortfield = null, $sortorder = null); + public function order($sortfield = null, $sortorder = null); /** * Decrypt sensitive data in database @@ -150,24 +150,24 @@ interface Database * @param string $value Value to decrypt * @return string Decrypted value if used */ - public function decrypt($value); + public function decrypt($value); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array Array */ - public function fetch_array($resultset); - // phpcs:enable + public function fetch_array($resultset); + // phpcs:enable /** * Return last error label * * @return string lasterror */ - public function lasterror(); + public function lasterror(); /** * Escape a string to insert data @@ -175,9 +175,9 @@ interface Database * @param string $stringtoencode String to escape * @return string String escaped */ - public function escape($stringtoencode); + public function escape($stringtoencode); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Get last ID after an insert INSERT * @@ -185,23 +185,23 @@ interface Database * @param string $fieldid Field name * @return int Id of row */ - public function last_insert_id($tab, $fieldid = 'rowid'); - // phpcs:enable + public function last_insert_id($tab, $fieldid = 'rowid'); + // phpcs:enable /** * Return full path of restore program * * @return string Full path of restore program */ - public function getPathOfRestore(); + public function getPathOfRestore(); /** - * Annulation d'une transaction et retour aux anciennes valeurs + * Canceling a transaction and returning to old values * * @param string $log Add more log to default log line - * @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur + * @return int 1 if cancelation ok or transaction not open, 0 if error */ - public function rollback($log = ''); + public function rollback($log = ''); /** * Execute a SQL request and return the resultset @@ -212,7 +212,7 @@ interface Database * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return resource Resultset of answer */ - public function query($query, $usesavepoint = 0, $type = 'auto'); + public function query($query, $usesavepoint = 0, $type = 'auto'); /** * Connexion to server @@ -225,7 +225,7 @@ interface Database * @return resource Database access handler * @see close() */ - public function connect($host, $login, $passwd, $name, $port = 0); + public function connect($host, $login, $passwd, $name, $port = 0); /** * Define limits and offset of request @@ -234,7 +234,7 @@ interface Database * @param int $offset Numero of line from where starting fetch * @return string String with SQL syntax to add a limit and offset */ - public function plimit($limit = 0, $offset = 0); + public function plimit($limit = 0, $offset = 0); /** * Return value of server parameters @@ -242,7 +242,7 @@ interface Database * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - public function getServerParametersValues($filter = ''); + public function getServerParametersValues($filter = ''); /** * Return value of server status @@ -250,16 +250,16 @@ interface Database * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - public function getServerStatusValues($filter = ''); + public function getServerStatusValues($filter = ''); /** * Return collation used in database * * @return string Collation value */ - public function getDefaultCollationDatabase(); + public function getDefaultCollationDatabase(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return number of lines for result of a SELECT * @@ -267,77 +267,77 @@ interface Database * @return int Nb of lines * @see affected_rows() */ - public function num_rows($resultset); - // phpcs:enable + public function num_rows($resultset); + // phpcs:enable /** * Return full path of dump program * * @return string Full path of dump program */ - public function getPathOfDump(); + public function getPathOfDump(); /** * Return version of database client driver * * @return string Version string */ - public function getDriverInfo(); + public function getDriverInfo(); /** * Return generic error code of last operation. * * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ - public function errno(); + public function errno(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a table into database * * @param string $table Name of table - * @param array $fields Tableau associatif [nom champ][tableau des descriptions] - * @param string $primary_key Nom du champ qui sera la clef primaire - * @param string $type Type de la table - * @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur - * @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext - * @param array $keys Tableau des champs cles noms => valeur + * @param array $fields Associative table [field name][table of descriptions] + * @param string $primary_key Name of the field that will be the primary key + * @param string $type Type of the table + * @param array $unique_keys Associative array Name of fields that will be unique key => value + * @param array $fulltext_keys Field name table that will be indexed in fulltext + * @param array $keys Table of key fields names => value * @return int <0 if KO, >=0 if OK */ - public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); - // phpcs:enable + public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); + // phpcs:enable - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - public function DDLDropTable($table); - // phpcs:enable + public function DDLDropTable($table); + // phpcs:enable /** * Return list of available charset that can be used to store data in database * * @return array List of Charset */ - public function getListOfCharacterSet(); + public function getListOfCharacterSet(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a new field into table * * @param string $table Name of table * @param string $field_name Name of field to add - * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] - * @param string $field_position Optionnel ex.: "after champtruc" + * @param string $field_desc Associative array of description of the field to insert [parameter name][parameter value] + * @param string $field_position Optional ex .: "after field stuff" * @return int <0 if KO, >0 if OK */ - public function DDLAddField($table, $field_name, $field_desc, $field_position = ""); - // phpcs:enable + public function DDLAddField($table, $field_name, $field_desc, $field_position = ""); + // phpcs:enable - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Drop a field from table * @@ -345,10 +345,10 @@ interface Database * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - public function DDLDropField($table, $field_name); - // phpcs:enable + public function DDLDropField($table, $field_name); + // phpcs:enable - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update format of a field into a table * @@ -357,58 +357,58 @@ interface Database * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - public function DDLUpdateField($table, $field_name, $field_desc); - // phpcs:enable + public function DDLUpdateField($table, $field_name, $field_desc); + // phpcs:enable /** * Return list of available collation that can be used for database * * @return array List of Collation */ - public function getListOfCollation(); + public function getListOfCollation(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return a pointer of line with description of a table or field * * @param string $table Name of table - * @param string $field Optionnel : Name of field if we want description of field + * @param string $field Optional : Name of field if we want description of field * @return resource Resource */ - public function DDLDescTable($table, $field = ""); - // phpcs:enable + public function DDLDescTable($table, $field = ""); + // phpcs:enable /** * Return version of database server * * @return string Version string */ - public function getVersion(); + public function getVersion(); /** * Return charset used to store data in database * * @return string Charset */ - public function getDefaultCharacterSetDatabase(); + public function getDefaultCharacterSetDatabase(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user and privileges to connect to database (even if database does not exists yet) * - * @param string $dolibarr_main_db_host Ip serveur - * @param string $dolibarr_main_db_user Nom user a creer - * @param string $dolibarr_main_db_pass Mot de passe user a creer + * @param string $dolibarr_main_db_host Server IP + * @param string $dolibarr_main_db_user Username to create + * @param string $dolibarr_main_db_pass User password to create * @param string $dolibarr_main_db_name Database name where user must be granted - * @return int <0 if KO, >=0 if OK - */ - public function DDLCreateUser( - $dolibarr_main_db_host, - $dolibarr_main_db_user, - $dolibarr_main_db_pass, - $dolibarr_main_db_name - ); - // phpcs:enable + * @return int <0 if KO, >=0 if OK + */ + public function DDLCreateUser( + $dolibarr_main_db_host, + $dolibarr_main_db_user, + $dolibarr_main_db_pass, + $dolibarr_main_db_name + ); + // phpcs:enable /** * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) @@ -419,7 +419,7 @@ interface Database * @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ * @return int|string Date TMS or '' */ - public function jdate($string, $gm = false); + public function jdate($string, $gm = false); /** * Encrypt sensitive data in database @@ -429,7 +429,7 @@ interface Database * @param int $withQuotes Return string with quotes * @return string XXX(field) or XXX('value') or field or 'value' */ - public function encrypt($fieldorvalue, $withQuotes = 0); + public function encrypt($fieldorvalue, $withQuotes = 0); /** * Validate a database transaction @@ -437,25 +437,25 @@ interface Database * @param string $log Add more log to default log line * @return int 1 if validation is OK or transaction level no started, 0 if ERROR */ - public function commit($log = ''); + public function commit($log = ''); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * List information of columns into a table. * * @param string $table Name of table - * @return array Array with inforation on table - */ - public function DDLInfoTable($table); - // phpcs:enable + * @return array Array with information on table + */ + public function DDLInfoTable($table); + // phpcs:enable - /** + /** * Free last resultset used. * - * @param resource $resultset Fre cursor + * @param resource $resultset Free cursor * @return void */ - public function free($resultset = null); + public function free($resultset = null); /** * Close database connexion @@ -463,41 +463,41 @@ interface Database * @return boolean True if disconnect successfull, false otherwise * @see connect() */ - public function close(); + public function close(); /** * Return last query in error * * @return string lastqueryerror */ - public function lastqueryerror(); + public function lastqueryerror(); - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - public function DDLGetConnectId(); - // phpcs:enable + public function DDLGetConnectId(); + // phpcs:enable - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Renvoie la ligne courante (comme un objet) pour le curseur resultset + * Returns the current line (as an object) for the resultset cursor * - * @param resource $resultset Curseur de la requete voulue + * @param resource $resultset Cursor of the desired request * @return Object Object result line or false if KO or end of cursor */ - public function fetch_object($resultset); - // phpcs:enable + public function fetch_object($resultset); + // phpcs:enable - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Select a database * * @param string $database Name of database * @return boolean true if OK, false if KO */ - public function select_db($database); - // phpcs:enable + public function select_db($database); + // phpcs:enable } diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index b0cd8f33258..a5bc992a1ca 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -50,7 +50,7 @@ if (empty($conf->dol_no_mouse_hover)) { print 'jQuery(".classfortooltip").tooltip({ show: { collision: "flipfit", effect:\'toggle\', delay:50 }, - hide: { delay: 50 }, + hide: { delay: 250 }, tooltipClass: "mytooltip", content: function () { console.log("Return title for popup"); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 669c1936a50..4ead0601a40 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -956,7 +956,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') { $queryName = 'search_'.substr($key, 2); if (GETPOST($queryName, 'alpha')){ - $search[$key]=GETPOST($queryName, 'alpha'); + $search[substr($key, 2)]=GETPOST($queryName, 'alpha'); } } $search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element, '', 'search_'); @@ -1057,11 +1057,10 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') print ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7f67006b6ca..aa594a694cd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3025,13 +3025,15 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithouttext, array( - 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', + '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', + 'address', 'bank', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top', - 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic' + 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic', + 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' ) )) { $fa='fa'; @@ -3040,11 +3042,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $facolor = ''; $fasize = ''; $arrayconvpictotofa = array( - 'setup'=>'cog', 'companies'=>'building', 'products'=>'box_open', 'commercial'=>'box-tie', 'invoicing'=>'file-invoice', 'accountancy'=>'coins', 'project'=>'project-diagram', - 'hrm'=>'umbrella-beach', 'members'=>'user-friends', 'ticket'=>'sticky-note', 'generic'=>'folder-open', + 'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'project'=>'sitemap', + 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'bank'=>'bank', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork', - 'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table' + 'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', + 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'bank', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt' ); if ($pictowithouttext == 'switch_off') { diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 72a44d9267e..d16fc569961 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -935,6 +935,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ { $line1.=($line1?" ":"").$fromcompany->town; } + // Country + if ($fromcompany->country) + { + $line1.=($line1?", ":"").$fromcompany->country; + } // Phone if ($fromcompany->phone) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ff60f7fe638..dbf56429086 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -958,7 +958,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203); + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->rights->ficheinter->lire, '', '', '', 203); $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); } } diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 51bc8a85de6..670b831c25f 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -256,8 +256,8 @@ class mailing_fraise extends MailingTargets $sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")"; // Filter on status if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1"; - if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND a.datefin >= '".$this->db->idate($now)."'"; - if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')"; + if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND (a.datefin >= '".$this->db->idate($now)."' OR ta.subscription = 0)"; + if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND ta.subscription = 1)"; if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0"; // Filter on date if ($dateendsubscriptionafter > 0) $sql.=" AND datefin > '".$this->db->idate($dateendsubscriptionafter)."'"; diff --git a/htdocs/core/tools.php b/htdocs/core/tools.php index 8e1ab258d2c..4f517603d63 100644 --- a/htdocs/core/tools.php +++ b/htdocs/core/tools.php @@ -43,7 +43,7 @@ llxHeader("", $langs->trans("Tools"), ""); $text=$langs->trans("Tools"); -print load_fiche_titre($text, '', 'generic'); +print load_fiche_titre($text, '', 'wrench'); // Show description of content print '
'.$langs->trans("ToolsDesc").'


'; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 1a860e522b1..e4cb18e18bd 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -109,7 +109,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { print ''; print ''; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 0661605d847..463adce3298 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -318,7 +318,7 @@ if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } if ($action == 'create') { - print load_fiche_titre($langs->trans("AddDonation")); + print load_fiche_titre($langs->trans("AddDonation"), '', 'invoicing'); print ''; print ''; @@ -500,7 +500,7 @@ if (! empty($id) && $action == 'edit') print ''; - dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic'); + dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'invoicing'); print '
'; - if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; if (! empty($notabletag) && $notabletag == 1) $ret.=' : '; if (! empty($notabletag) && $notabletag == 3) $ret.=' '; if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='
'; if (in_array($key, array('statut'))){ print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status); - } elseif (in_array($key, array('role'))) { + }elseif (in_array($key, array('role'))) { print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles); - } else{ - $fieldName = substr($key, 2); - print sprintf('', $fieldName, dol_escape_htmltag($search[$key])); + } else { + print ''; } print '
'; - print ''; + print '
'; print ''; print ''; + print ''; } print '
' . img_edit().'' . img_edit().'
'; print '
'; diff --git a/htdocs/don/index.php b/htdocs/don/index.php index cb2c32b5ec5..c75cbf5413b 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -85,7 +85,7 @@ if ($result) dol_print_error($db); } -print load_fiche_titre($langs->trans("DonationsArea")); +print load_fiche_titre($langs->trans("DonationsArea"), '', 'invoicing'); print '
'; diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 388d5c8c158..c921eba30c8 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -154,7 +154,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton); + print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton); if ($search_all) { diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index a80df96fe50..5c4b74a04e6 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -164,8 +164,9 @@ if ($action == 'add') { $newinter->fk_projet=$object->fk_projet; $newinter->fk_project=$object->fk_projet; $newinter->fk_contrat=$object->fk_contrat; - } else + } else { $newinter->socid=GETPOST("socid"); + } $newinter->entity=$object->entity; $newinter->duree=$object->duree; @@ -184,8 +185,9 @@ if ($action == 'add') { if ($newfichinterid > 0) { // Now we add line of details - foreach ($object->lines as $ficheinterligne) - $newinter->addline($user, $newfichinterid, $ficheinterligne->desc, "", $ficheinterligne->duree, ''); + foreach ($object->lines as $line) { + $newinter->addline($user, $newfichinterid, $line->desc, '', $line->duree, ''); + } // on update le nombre d'inter crée à partir du modèle $object->updateNbGenDone(); @@ -197,7 +199,7 @@ if ($action == 'add') { $action=''; } } elseif ($action == 'delete' && $user->rights->ficheinter->supprimer) { - // delete modele + // delete modele $object->fetch($id); $object->delete(); $id = 0 ; @@ -210,13 +212,10 @@ if ($action == 'add') { } elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) { // Set next date of execution $object->fetch($id); -$date = dol_mktime( - GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, - GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear') - ); + $date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear')); if (!empty($date)) $object->setNextDate($date); } elseif ($action == 'setnb_gen_max' && $user->rights->ficheinter->creer) { -// Set max period + // Set max period $object->fetch($id); $object->setMaxPeriod(GETPOST('nb_gen_max', 'int')); } @@ -230,17 +229,16 @@ llxHeader('', $langs->trans("RepeatableInterventional"), 'ch-fichinter.html#s-fa $form = new Form($db); $companystatic = new Societe($db); -if (! empty($conf->contrat->enabled)) +if (! empty($conf->contrat->enabled)) { $contratstatic = new Contrat($db); -if (! empty($conf->projet->enabled)) +} +if (! empty($conf->projet->enabled)) { $projectstatic = new Project($db); +} $now = dol_now(); $tmparray=dol_getdate($now); -$today = dol_mktime( - 23, 59, 59, - $tmparray['mon'], $tmparray['mday'], $tmparray['year'] -); // Today is last second of current day +$today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day @@ -248,13 +246,13 @@ $today = dol_mktime( * Create mode */ if ($action == 'create') { - print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'commercial'); + print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'fichinter'); $object = new Fichinter($db); // Source invoice //$object = new Managementfichinter($db); // Source invoice if ($object->fetch($id, $ref) > 0) { - print ''; + print ''; print ''; print ''; print ''; @@ -273,7 +271,7 @@ if ($action == 'create') { print '
'; @@ -295,10 +293,7 @@ if ($action == 'create') { if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { // Duration print ''; -print ''; + print ''; print ''; } @@ -308,10 +303,7 @@ print '"; // First date of execution for cron print ""; // Number max of generation print ""; print "
'.$langs->trans("Customer").''; print $form->select_company($object->thirdparty->id, 'socid', '', 0, 1); -// .$object->thirdparty->getNomUrl(1,'customer'). + //.$object->thirdparty->getNomUrl(1,'customer'). print ''; print $langs->trans("Comment"); print '
'.$langs->trans("TotalDuration").''.convertSecondToTime( - $object->duration, 'all', - $conf->global->MAIN_DURATION_OF_WORKDAY - ).''.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'
'.convertSecondToTime( print "
".$langs->trans("Project").""; $projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project; -$numprojet = $formproject->select_projects( - $object->thirdparty->id, $projectid, 'projectid', - 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '' - ); + $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); print '   '; @@ -342,26 +334,21 @@ $numprojet = $formproject->select_projects( print '
'; print $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')); print ""; - print " "; -print $form->selectarray( - 'unit_frequency', - array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), - (GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m') - ); + print ' '; + print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m')); print "
".$langs->trans('NextDateToExecution').""; - if ($date_next_execution != "") -$date_next_execution = (GETPOST('remonth') ? dol_mktime( - 12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear') - ) : -1); + if ($date_next_execution != "") { + $date_next_execution = (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); + } print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1); print "
".$langs->trans("MaxPeriodNumber").""; - print ''; + print ''; print "
"; @@ -369,29 +356,31 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print '
'; $title = $langs->trans("ProductsAndServices"); - if (empty($conf->service->enabled)) + if (empty($conf->service->enabled)) { $title = $langs->trans("Products"); - elseif (empty($conf->product->enabled)) + } elseif (empty($conf->product->enabled)) { $title = $langs->trans("Services"); + } print load_fiche_titre($title, '', ''); /* - * Invoice lines + * Fichinter lines */ print ''; print ''; @@ -436,8 +426,9 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print ''; print "\n"; } - else - dol_print_error('', "Error, no invoice ".$object->id); + else { + dol_print_error('', "Error, no fichinter ".$object->id); + } } elseif ($action == 'selsocforcreatefrommodel') { print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'commercial'); dol_fiche_head(''); @@ -492,32 +483,25 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( $morehtmlref.=img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { - - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects( - $object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1 - ); - $morehtmlref.=''; - $morehtmlref.=''; + $morehtmlref.= ''; + $morehtmlref.= ''; + $morehtmlref.= ''; + $morehtmlref.= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.= ''; + $morehtmlref.= ''; } else { - $morehtmlref.=$form->form_project( - $_SERVER['PHP_SELF'].'?id='.$object->id, - $object->socid, $object->fk_project, - 'none', 0, 0, 0, 1 - ); + $morehtmlref.= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (! empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref.='trans('ShowProject').'">'; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; + $morehtmlref.= 'trans('ShowProject').'">'; + $morehtmlref.= $proj->ref; + $morehtmlref.= ''; } else { - $morehtmlref.=''; + $morehtmlref.= ''; } } } @@ -605,12 +589,8 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print ''; print '
'; - $sql = 'SELECT l.*'; + $sql = 'SELECT l.rowid, l.description, l.duree'; $sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet as l"; $sql.= " WHERE l.fk_fichinter= ".$object->id; - $sql.= " AND l.fk_product is null "; + //$sql.= " AND l.fk_product is null "; $sql.= " ORDER BY l.rang"; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - $i = 0; $total = 0; + $i = 0; + $total = 0; echo ''; if ($num) { @@ -413,15 +402,16 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print $text.' '.nl2br($objp->description); - // Qty + // Duration print ''; print ""; $i++; } $db->free($result); - } else + } else { print $db->error(); + } print "
'.convertSecondToTime($objp->duree).'
"; print '
'; print ''; print ''; print '
'; - print " "; - print $form->selectarray( - 'unit_frequency', - array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), - ($object->unit_frequency?$object->unit_frequency:'m') - ); + print ' '; + print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), ($object->unit_frequency?$object->unit_frequency:'m')); print '
'; @@ -625,19 +605,13 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( // Date when print ''; if ( $user->rights->ficheinter->creer && ($action == 'date_when' || $object->frequency > 0)) { - print $form->editfieldkey( - $langs->trans("NextDateToExecution"), 'date_when', $object->date_when, - $object, $user->rights->facture->creer, 'day' - ); + print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); } else { print $langs->trans("NextDateToExecution"); } print ''; if ($action == 'date_when' || $object->frequency > 0) { - print $form->editfieldval( - $langs->trans("NextDateToExecution"), 'date_when', $object->date_when, - $object, $user->rights->facture->creer, 'day' - ); + print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); } print ''; print ''; @@ -645,19 +619,13 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( // Max period / Rest period print ''; if ($user->rights->ficheinter->creer && ($action == 'nb_gen_max' || $object->frequency > 0)) { - print $form->editfieldkey( - $langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, - $object, $user->rights->facture->creer - ); + print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer); } else print $langs->trans("MaxPeriodNumber"); print ''; if ($action == 'nb_gen_max' || $object->frequency > 0) { - print $form->editfieldval( - $langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', - $object, $user->rights->facture->creer - ); + print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', $object, $user->rights->facture->creer); } else print ''; @@ -671,10 +639,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( if ($object->frequency > 0) { print '
'; if (empty($conf->cron->enabled)) { - $txtinfoadmin=$langs->trans( - "EnableAndSetupModuleCron", - $langs->transnoentitiesnoconv("Module2300Name") - ); + $txtinfoadmin = $langs->trans("EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name")); print info_admin($txtinfoadmin); } print '
'; @@ -709,10 +674,11 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( */ $title = $langs->trans("ProductsAndServices"); - if (empty($conf->service->enabled)) + if (empty($conf->service->enabled)) { $title = $langs->trans("Products"); - elseif (empty($conf->product->enabled)) + } elseif (empty($conf->product->enabled)) { $title = $langs->trans("Services"); + } print load_fiche_titre($title); @@ -850,8 +816,9 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( $companystatic->id=$objp->socid; $companystatic->name=$objp->name; print ''.$companystatic->getNomUrl(1, 'customer').''; - } else + } else { print ''.$langs->trans("None").''; + } if (! empty($conf->contrat->enabled)) { print ''; @@ -916,13 +883,15 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( $i++; } } - } else - print ''.$langs->trans("NoneF").''; + } else { + print ''.$langs->trans("NoneF").''; + } print ""; $db->free($resql); - } else + } else { dol_print_error($db); + } } } llxFooter(); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index afbf55c409e..6943b5335f7 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1645,11 +1645,10 @@ elseif ($id > 0 || ! empty($ref)) else print ''; } - // create intervention model - if ($conf->global->MAIN_FEATURE_LEVEL >=2 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { + // create intervention model + if ($conf->global->MAIN_FEATURES_LEVEL >=2 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { print '
'; - // This feature is not yet implemented - print ''.$langs->trans("ChangeIntoRepeatableIntervention").''; + print ''.$langs->trans("ChangeIntoRepeatableIntervention").''; print '
'; } diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php new file mode 100644 index 00000000000..4fabf64be49 --- /dev/null +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -0,0 +1,814 @@ + + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Marcos García + * Copyright (C) 2016-2018 Charlie Benke + * + * 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 . + */ + +/** + * \file fichinterrec/class/fichinter-rec.class.php + * \ingroup facture + * \brief Fichier de la classe des factures recurentes + */ + +require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + + +/** + * Classe de gestion des factures recurrentes/Modeles + */ +class FichinterRec extends Fichinter +{ + public $element = 'fichinterrec'; + public $table_element = 'fichinter_rec'; + public $table_element_line = 'fichinter_rec'; + public $fk_element = 'fk_fichinter'; + public $picto = 'intervention'; + + public $title; + public $number; + public $date; + public $amount; + public $remise; + public $tva; + public $total; + public $db_table; + public $propalid; + + public $date_last_gen; + public $date_when; + public $nb_gen_done; + public $nb_gen_max; + + public $rang; + public $special_code; + + public $usenewprice = 0; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + + //status dans l'ordre de l'intervention + $this->statuts[0]='Draft'; + $this->statuts[1]='Closed'; + + $this->statuts_short[0]='Draft'; + $this->statuts_short[1]='Closed'; + + $this->statuts_logo[0]='statut0'; + $this->statuts_logo[1]='statut1'; + } + + /** + * Returns the label status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->statut, $mode); + } + + + /** + * Create a predefined fichinter + * + * @param User $user User object + * @param int $notrigger no trigger + * @return int <0 if KO, id of fichinter if OK + */ + public function create($user, $notrigger = 0) + { + global $conf; + + $error=0; + $now=dol_now(); + + // Clean parameters + $this->title = trim($this->title); + $this->description = trim($this->description); + + + $this->db->begin(); + + // Load fichinter model + $fichintsrc = new Fichinter($this->db); + + $result = $fichintsrc->fetch($this->id_origin); + $result = $fichintsrc->fetch_lines(1); // to get all lines + + + if ($result > 0) { + // On positionne en mode brouillon la facture + $this->brouillon = 1; + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."fichinter_rec ("; + $sql.= "titre"; + $sql.= ", fk_soc"; + $sql.= ", entity"; + $sql.= ", datec"; + $sql.= ", duree"; + $sql.= ", description"; + $sql.= ", note_private"; + $sql.= ", note_public"; + $sql.= ", fk_user_author"; + $sql.= ", fk_projet"; + $sql.= ", fk_contrat"; + $sql.= ", modelpdf"; + + $sql.= ", frequency"; + $sql.= ", unit_frequency"; + $sql.= ", date_when"; + $sql.= ", date_last_gen"; + $sql.= ", nb_gen_done"; + $sql.= ", nb_gen_max"; + // $sql.= ", auto_validate"; + + $sql.= ") VALUES ("; + $sql.= "'".$this->db->escape($this->title)."'"; + $sql.= ", ".($this->socid >0 ? $this->socid : 'null'); + $sql.= ", ".$conf->entity; + $sql.= ", '".$this->db->idate($now)."'"; + $sql.= ", ".(!empty($fichintsrc->duree)?$fichintsrc->duree:'0'); + $sql.= ", ".(!empty($this->description)?("'".$this->db->escape($this->description)."'"):"null"); + $sql.= ", ".(!empty($fichintsrc->note_private)?("'".$this->db->escape($fichintsrc->note_private)."'"):"null"); + $sql.= ", ".(!empty($fichintsrc->note_public)?("'".$this->db->escape($fichintsrc->note_public)."'"):"null"); + $sql.= ", '".$user->id."'"; + // si c'est la même société on conserve les liens vers le projet et le contrat + if ($this->socid == $fichintsrc->socid) { + $sql.= ", ".(! empty($fichintsrc->fk_project)?$fichintsrc->fk_project:"null"); + $sql.= ", ".(! empty($fichintsrc->fk_contrat)?$fichintsrc->fk_contrat:"null"); + } else { + $sql.= ", null, null"; + } + + $sql.= ", ".(! empty($fichintsrc->modelpdf)?"'".$this->db->escape($fichintsrc->modelpdf)."'":"''"); + + // récurrence + $sql.= ", ".(! empty($this->frequency)?$this->frequency:"null"); + $sql.= ", '".$this->db->escape($this->unit_frequency)."'"; + $sql.= ", ".(!empty($this->date_when)?"'".$this->db->idate($this->date_when)."'":'null'); + $sql.= ", ".(!empty($this->date_last_gen)?"'".$this->db->idate($this->date_last_gen)."'":'null'); + $sql.= ", 0"; // we start à 0 + $sql.= ", ".$this->nb_gen_max; + // $sql.= ", ".$this->auto_validate; + $sql.= ")"; + + if ($this->db->query($sql)) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); + + /* + * Lines + */ + $num=count($fichintsrc->lines); + for ($i = 0; $i < $num; $i++) { + //$result=$fichintlignesrc->fetch($fichintsrc->lines[$i]->id); + + //var_dump($fichintsrc->lines[$i]); + $result_insert = $this->addline( + $fichintsrc->lines[$i]->desc, + $fichintsrc->lines[$i]->duration, + $fichintsrc->lines[$i]->datei, + $fichintsrc->lines[$i]->rang, + $fichintsrc->lines[$i]->subprice, + $fichintsrc->lines[$i]->qty, + $fichintsrc->lines[$i]->tva_tx, + $fichintsrc->lines[$i]->fk_product, + $fichintsrc->lines[$i]->remise_percent, + 'HT', + 0, + '', + 0, + $fichintsrc->lines[$i]->product_type, + $fichintsrc->lines[$i]->special_code, + $fichintsrc->lines[$i]->label, + $fichintsrc->lines[$i]->fk_unit + ); + + if ($result_insert < 0) + $error++; + } + + if ($error) + $this->db->rollback(); + else { + $this->db->commit(); + return $this->id; + } + } else { + $this->error=$this->db->error().' sql='.$sql; + $this->db->rollback(); + return -2; + } + } else { + $this->db->rollback(); + return -1; + } + } + + + /** + * Recupere l'objet facture et ses lignes de factures + * + * @param int $rowid Id of object to load + * @param string $ref Reference of fichinter + * @param string $ref_ext External reference of fichinter + * @param int $ref_int Internal reference of other object + * @return int >0 if OK, <0 if KO, 0 if not found + */ + public function fetch($rowid = 0, $ref = '', $ref_ext = '', $ref_int = '') + { + $sql = 'SELECT f.titre, f.fk_soc'; + $sql.= ', f.datec, f.duree, f.fk_projet, f.fk_contrat, f.description'; + $sql.= ', f.note_private, f.note_public, f.fk_user_author'; + $sql.= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.auto_validate'; + $sql.= ', f.note_private, f.note_public, f.fk_user_author'; + + $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinter_rec as f'; + if ($rowid >0 ) $sql.= ' WHERE f.rowid='.$rowid; + elseif ($ref) $sql.= " WHERE f.titre='".$this->db->escape($ref)."'"; + + /* This field are not used for template fichinter + if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; + if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; + */ + + dol_syslog(get_class($this)."::fetch rowid=".$rowid, LOG_DEBUG); + + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + + $this->id = $rowid; + $this->titre = $obj->titre; + $this->ref = $obj->titre; + $this->description = $obj->description; + $this->datec = $obj->datec; + $this->socid = $obj->fk_soc; + $this->statut = 0; + $this->fk_project = $obj->fk_projet; + $this->fk_contrat = $obj->fk_contrat; + $this->note_private = $obj->note_private; + $this->note_public = $obj->note_public; + $this->user_author = $obj->fk_user_author; + $this->modelpdf = $obj->model_pdf; + $this->rang = $obj->rang; + $this->special_code = $obj->special_code; + $this->frequency = $obj->frequency; + $this->unit_frequency = $obj->unit_frequency; + $this->date_when = $this->db->jdate($obj->date_when); + $this->date_last_gen = $this->db->jdate($obj->date_last_gen); + $this->nb_gen_done = $obj->nb_gen_done; + $this->nb_gen_max = $obj->nb_gen_max; + $this->auto_validate = $obj->auto_validate; + + $this->brouillon = 1; + + /* + * Lines + */ + $result=$this->fetch_lines(); + if ($result < 0) { + $this->error=$this->db->error(); + return -3; + } + return 1; + } else { + $this->error='Interventional with id '.$rowid.' not found sql='.$sql; + dol_syslog(get_class($this).'::Fetch Error '.$this->error, LOG_ERR); + return -2; + } + } else { + $this->error=$this->db->error(); + return -1; + } + } + + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Recupere les lignes de factures predefinies dans this->lines + * @param int $sall sall + * + * @return int 1 if OK, < 0 if KO + */ + public function fetch_lines($sall = 0) + { + // phpcs:enable + $sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, '; + $sql.= ' l.price, l.qty, l.tva_tx, l.remise, l.remise_percent, l.subprice, l.duree, '; + $sql.= ' l.total_ht, l.total_tva, l.total_ttc,'; + $sql.= ' l.rang, l.special_code,'; + $sql.= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,'; + $sql.= ' p.label as product_label, p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet_rec as l'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; + $sql.= ' WHERE l.fk_fichinter = '.$this->id; + + dol_syslog('FichInter-rec::fetch_lines', LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + $num = $this->db->num_rows($result); + $i = 0; + while ($i < $num) { + $objp = $this->db->fetch_object($result); + $line = new FichinterLigne($this->db); + + $line->rowid = $objp->rowid; + $line->label = $objp->custom_label; // Label line + $line->desc = $objp->description; // Description line + $line->product_type = $objp->product_type; // Type of line + $line->product_ref = $objp->product_ref; // Ref product + $line->libelle = $objp->product_label; // deprecated + $line->product_label = $objp->product_label; // Label product + $line->product_desc = $objp->product_desc; // Description product + $line->fk_product_type = $objp->fk_product_type; // Type of product + $line->qty = $objp->qty; + $line->duree = $objp->duree; + $line->duration = $objp->duree; + $line->datei = $objp->date; + $line->subprice = $objp->subprice; + $line->tva_tx = $objp->tva_tx; + $line->remise_percent = $objp->remise_percent; + $line->fk_remise_except = $objp->fk_remise_except; + $line->fk_product = $objp->fk_product; + $line->date_start = $objp->date_start; + $line->date_end = $objp->date_end; + $line->date_start = $objp->date_start; + $line->date_end = $objp->date_end; + $line->info_bits = $objp->info_bits; + $line->total_ht = $objp->total_ht; + $line->total_tva = $objp->total_tva; + $line->total_ttc = $objp->total_ttc; + $line->code_ventilation = $objp->fk_code_ventilation; + $line->rang = $objp->rang; + $line->special_code = $objp->special_code; + $line->fk_unit = $objp->fk_unit; + + // Ne plus utiliser + $line->price = $objp->price; + $line->remise = $objp->remise; + + $this->lines[$i] = $line; + + $i++; + } + + $this->db->free($result); + return 1; + } else { + $this->error=$this->db->error(); + return -3; + } + } + + + /** + * Delete template fichinter rec + * + * @param int $rowid Id of fichinter rec to delete. If empty, we delete current instance of fichinter rec + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK + */ + public function delete($rowid = 0, $notrigger = 0, $idwarehouse = -1) + { + if (empty($rowid)) $rowid=$this->id; + + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); + + $error=0; + $this->db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet_rec WHERE fk_fichinter = ".$rowid; + dol_syslog($sql); + if ($this->db->query($sql)) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter_rec WHERE rowid = ".$rowid; + dol_syslog($sql); + if (! $this->db->query($sql)) { + $this->error=$this->db->lasterror(); + $error=-1; + } + } else { + $this->error=$this->db->lasterror(); + $error=-2; + } + + if (! $error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return $error; + } + } + + + /** + * Add a line to fichinter rec + * + * @param string $desc Description de la ligne + * @param integer $duration Durée + * @param string $datei Date + * @param int $rang Position of line + * @param double $pu_ht Prix unitaire HT (> 0 even for credit note) + * @param double $qty Quantite + * @param double $txtva Taux de tva force, sinon -1 + * @param int $fk_product Id du produit/service predefini + * @param double $remise_percent Pourcentage de remise de la ligne + * @param string $price_base_type HT or TTC + * @param int $info_bits Bits de type de lignes + * @param int $fk_remise_except Id remise + * @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note) + * @param int $type Type of line (0=product, 1=service) + * @param int $special_code Special code + * @param string $label Label of the line + * @param string $fk_unit Unit + * @return int <0 if KO, Id of line if OK + */ + public function addline($desc, $duration, $datei, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null) + { + global $mysoc; + + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + // Check parameters + if ($type < 0) return -1; + + if ($this->brouillon) { + // Clean parameters + $remise_percent = price2num($remise_percent); + $qty = price2num($qty); + if (! $qty) $qty=1; + if (! $info_bits) $info_bits=0; + $pu_ht = price2num($pu_ht); + $pu_ttc = price2num($pu_ttc); + $txtva = price2num($txtva); + + if ($price_base_type=='HT') { + $pu=$pu_ht; + } else { + $pu=$pu_ttc; + } + + + // Calcul du total TTC et de la TVA pour la ligne a partir de + // qty, pu, remise_percent et txtva + // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker + // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, 0, 0, 0, $price_base_type, $info_bits, $type, $mysoc); + + $total_ht = $tabprice[0]; + $total_tva = $tabprice[1]; + $total_ttc = $tabprice[2]; + + $product_type = $type; + if ($fk_product) { + $product = new Product($this->db); + $result = $product->fetch($fk_product); + $product_type = $product->type; + } + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."fichinterdet_rec ("; + $sql.= "fk_fichinter"; + $sql.= ", label"; + $sql.= ", description"; + $sql.= ", date"; + $sql.= ", duree"; + //$sql.= ", price"; + //$sql.= ", qty"; + //$sql.= ", tva_tx"; + $sql.= ", fk_product"; + $sql.= ", product_type"; + $sql.= ", remise_percent"; + //$sql.= ", subprice"; + $sql.= ", remise"; + $sql.= ", total_ht"; + $sql.= ", total_tva"; + $sql.= ", total_ttc"; + $sql.= ", rang"; + //$sql.= ", special_code"; + $sql.= ", fk_unit"; + $sql.= ") VALUES ("; + $sql.= (int) $this->id; + $sql.= ", ".(! empty($label)?"'".$this->db->escape($label)."'":"null"); + $sql.= ", ".(! empty($desc)?"'".$this->db->escape($desc)."'":"null"); + $sql.= ", ".(! empty($datei)?"'".$this->db->idate($datei)."'":"null"); + $sql.= ", ".$duration; + //$sql.= ", ".price2num($pu_ht); + //$sql.= ", ".(!empty($qty)? $qty :(!empty($duration)? $duration :"null")); + //$sql.= ", ".price2num($txtva); + $sql.= ", ".(! empty($fk_product)? $fk_product :"null"); + $sql.= ", ".$product_type; + $sql.= ", ".(! empty($remise_percent)? $remise_percent:"null"); + //$sql.= ", '".price2num($pu_ht)."'"; + $sql.= ", null"; + $sql.= ", '".price2num($total_ht)."'"; + $sql.= ", '".price2num($total_tva)."'"; + $sql.= ", '".price2num($total_ttc)."'"; + $sql.= ", ".(int) $rang; + //$sql.= ", ".$special_code; + $sql.= ", ".(! empty($fk_unit) ? $fk_unit :"null"); + $sql.= ")"; + + dol_syslog(get_class($this)."::addline", LOG_DEBUG); + if ($this->db->query($sql)) { + return 1; + } else { + $this->error=$this->db->lasterror(); + return -1; + } + } + } + + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Rend la fichinter automatique + * + * @param User $user User object + * @param int $freq Freq + * @param string $courant Courant + * @return int 0 if OK, <0 if KO + */ + public function set_auto($user, $freq, $courant) + { + // phpcs:enable + if ($user->rights->fichinter->creer) { + $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter_rec "; + $sql .= " SET frequency='".$this->db->escape($freq)."'"; + $sql .= ", last_gen='".$this->db->escape($courant)."'"; + $sql .= " WHERE rowid = ".$this->id; + + $resql = $this->db->query($sql); + + if ($resql) { + $this->frequency = $freq; + $this->last_gen = $courant; + return 0; + } else { + dol_print_error($this->db); + return -1; + } + } else { + return -2; + } + } + + /** + * Return clicable name (with picto eventually) + * + * @param int $withpicto Add picto into link + * @param string $option Where point the link + * @param int $max Maxlength of ref + * @param int $short 1=Return just URL + * @param string $moretitle Add more text to title tooltip + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '') + { + global $langs; + + $result=''; + $label=$langs->trans("ShowInterventionModel").': '.$this->ref; + + $url = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$this->id; + + if ($short) return $url; + + $picto='intervention'; + + $link = ''; + $linkend=''; + + if ($withpicto) { + $result.= $link.img_object($label, $picto, 'class="classfortooltip"').$linkend; + } + if ($withpicto && $withpicto != 2) { + $result.=' '; + } + if ($withpicto != 2) { + $result.=$link.$this->ref.$linkend; + } + return $result; + } + + + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param string $option ''=Create a specimen fichinter with lines, 'nolines'=No lines + * @return void + */ + public function initAsSpecimen($option = '') + { + global $user, $langs, $conf; + + $now=dol_now(); + $arraynow=dol_getdate($now); + $nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); + + parent::initAsSpecimen($option); + + $this->usenewprice = 1; + } + + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + { + $tables = array( 'fichinter_rec' ); + + return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + } + + + /** + * Update frequency and unit + * + * @param int $frequency value of frequency + * @param string $unit unit of frequency (d, m, y) + * @return int <0 if KO, >0 if OK + */ + public function setFrequencyAndUnit($frequency, $unit) + { + if (! $this->table_element) { + dol_syslog(get_class($this)."::setFrequencyAndUnit called with table_element not defined", LOG_ERR); + return -1; + } + + if (!empty($frequency) && empty($unit)) { + dol_syslog(get_class($this)."::setFrequencyAndUnit called with frequency defined but unit not ", LOG_ERR); + return -2; + } + + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql.= ' SET frequency = '.($frequency?$this->db->escape($frequency):'null'); + if (!empty($unit)) { + $sql.= ', unit_frequency = "'.$this->db->escape($unit).'"'; + } + $sql.= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG); + if ($this->db->query($sql)) { + $this->frequency = $frequency; + if (!empty($unit)) $this->unit_frequency = $unit; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } + + /** + * Update the next date of execution + * + * @param datetime $date date of execution + * @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done + * @return int <0 if KO, >0 if OK + */ + public function setNextDate($date, $increment_nb_gen_done = 0) + { + if (! $this->table_element) { + dol_syslog(get_class($this)."::setNextDate was called on objet with property table_element not defined", LOG_ERR); + return -1; + } + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql.= " SET date_when = ".($date ? "'".$this->db->idate($date)."'" : "null"); + if ($increment_nb_gen_done>0) $sql.= ', nb_gen_done = nb_gen_done + 1'; + $sql.= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::setNextDate", LOG_DEBUG); + if ($this->db->query($sql)) { + $this->date_when = $date; + if ($increment_nb_gen_done>0) $this->nb_gen_done++; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } + + /** + * Update the maximum period + * + * @param int $nb number of maximum period + * @return int <0 if KO, >0 if OK + */ + public function setMaxPeriod($nb) + { + if (! $this->table_element) { + dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined", LOG_ERR); + return -1; + } + + if (empty($nb)) $nb=0; + + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql.= ' SET nb_gen_max = '.$nb; + $sql.= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::setMaxPeriod", LOG_DEBUG); + if ($this->db->query($sql)) { + $this->nb_gen_max = $nb; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } + + /** + * Update the auto validate fichinter + * + * @param int $validate 0 to create in draft, 1 to create and validate fichinter + * @return int <0 if KO, >0 if OK + */ + public function setAutoValidate($validate) + { + if (! $this->table_element) { + dol_syslog(get_class($this)."::setAutoValidate called with property table_element not defined", LOG_ERR); + return -1; + } + + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql.= ' SET auto_validate = '.$validate; + $sql.= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG); + if ($this->db->query($sql)) { + $this->auto_validate = $validate; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } + + /** + * Update the Number of Generation Done + * + * @return int <0 if KO, >0 if OK + */ + public function updateNbGenDone() + { + if (! $this->table_element) { + dol_syslog(get_class($this)."::updateNbGenDone called with property table_element not defined", LOG_ERR); + return -1; + } + + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql.= ' SET nb_gen_done = nb_gen_done + 1'; + $sql.= ' , date_last_gen = now()'; + // si on et arrivé à la fin des génération + if ($this->nb_gen_max == $this->nb_gen_done+1) + $sql.= ' , statut = 1'; + + $sql.= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG); + if ($this->db->query($sql)) { + $this->nb_gen_done = $this->nb_gen_done+1; + $this->nb_gen_done = dol_now(); + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } +} diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index c36138c09d7..a5a9a1e47a3 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -54,7 +54,7 @@ $commandestatic = new CommandeFournisseur($db); $userstatic=new User($db); $formfile = new FormFile($db); -print load_fiche_titre($langs->trans("SuppliersOrdersArea")); +print load_fiche_titre($langs->trans("SuppliersOrdersArea"), '', 'commercial'); print '
'; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 08edbe6f5de..7e8d8db2bda 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -484,7 +484,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); + print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit); $topicmail="SendBillRef"; $modelmail="invoice_supplier_send"; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 3b1e30bfcc2..6f9dd4c7835 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -873,7 +873,7 @@ if (empty($action) || $action == 'list') $massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); print '
'; if ($optioncss != '') print ''; diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index 2f67edb2837..94ef53f2372 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -91,7 +91,7 @@ $titre=($year?$langs->trans("PaymentsReportsForYear", $year):$langs->trans("Paym llxHeader('', $titre); -print load_fiche_titre($titre, '', 'title_accountancy.png'); +print load_fiche_titre($titre, '', 'invoicing'); // Formulaire de generation print ''; diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index e9696496f71..a7efd8616f0 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -48,17 +48,15 @@ $result = restrictedArea($user, 'holiday', $id, ''); * View */ +$html = new Form($db); +$formother = new FormOther($db); $holidaystatic = new Holiday($db); $listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon")); - llxHeader('', $langs->trans('CPTitreMenu')); -print load_fiche_titre($langs->trans('MenuReportMonth')); - -$html = new Form($db); -$formother = new FormOther($db); +print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm'); // Selection filter diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 3ddba34571c..ef8df639d26 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -141,7 +141,7 @@ if (! empty($conf->holiday->enabled)) print '
'; print ''; print ''; - print ""; + print ''; print '
'.$langs->trans("Holidays").'
'; $out=''; @@ -197,8 +197,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $i = 0; - print '
'; - print ''; + print '
'; + print '
'; print ''; print ''; print ''; @@ -244,7 +244,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) { print ''; } - print '
'.$langs->trans("BoxTitleLastLeaveRequests", min($max, $num)).''.$langs->trans("from").'
'.$langs->trans("None").'

'; + print '
'; + print '
'; } else dol_print_error($db); } @@ -272,8 +273,8 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) $i = 0; - print '
'; - print ''; + print '
'; + print '
'; print ''; print ''; print ''; @@ -344,8 +345,8 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire $i = 0; - print '
'; - print '
'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).''.$langs->trans("FeesKilometersOrAmout").'
'; + print '
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index acc6152792f..cd1b70182d9 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -141,6 +141,11 @@ ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_socpeople ALTER TABLE llx_accounting_account MODIFY COLUMN rowid bigint AUTO_INCREMENT; + +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL; +ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL; + + create table llx_c_hrm_public_holiday ( id integer AUTO_INCREMENT PRIMARY KEY, @@ -208,5 +213,77 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1); +create table llx_fichinter_rec +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + titre varchar(50) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_soc integer DEFAULT NULL, + datec datetime, -- date de creation + fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche + fk_user_author integer, -- createur + fk_projet integer, -- projet auquel est associe la facture + duree real, -- duree totale de l'intervention + description text, + modelpdf varchar(50), + note_private text, + note_public text, + frequency integer, -- frequency (for example: 3 for every 3 month) + unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ... + date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date) + date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice) + nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented) + nb_gen_max integer DEFAULT NULL, -- maximum number of generation + auto_validate integer NULL DEFAULT NULL -- statut of the generated intervention + +)ENGINE=innodb; + +ALTER TABLE llx_fichinter_rec ADD UNIQUE INDEX idx_fichinter_rec_uk_titre (titre, entity); +ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_soc (fk_soc); +ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_user_author (fk_user_author); +ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_projet (fk_projet); +ALTER TABLE llx_fichinter_rec ADD CONSTRAINT fk_fichinter_rec_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); +ALTER TABLE llx_fichinter_rec ADD CONSTRAINT fk_fichinter_rec_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); + +create table llx_fichinterdet_rec +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_fichinter integer NOT NULL, + date datetime, -- date de la ligne d'intervention + description text, -- description de la ligne d'intervention + duree integer, -- duree de la ligne d'intervention + rang integer DEFAULT 0, -- ordre affichage sur la fiche + total_ht DOUBLE(24, 8) NULL DEFAULT NULL, + subprice DOUBLE(24, 8) NULL DEFAULT NULL, + fk_parent_line integer NULL DEFAULT NULL, + fk_product integer NULL DEFAULT NULL, + label varchar(255) NULL DEFAULT NULL, + tva_tx DOUBLE(6, 3) NULL DEFAULT NULL, + localtax1_tx DOUBLE(6, 3) NULL DEFAULT 0, + localtax1_type VARCHAR(1) NULL DEFAULT NULL, + localtax2_tx DOUBLE(6, 3) NULL DEFAULT 0, + localtax2_type VARCHAR(1) NULL DEFAULT NULL, + qty double NULL DEFAULT NULL, + remise_percent double NULL DEFAULT 0, + remise double NULL DEFAULT 0, + fk_remise_except integer NULL DEFAULT NULL, + price DOUBLE(24, 8) NULL DEFAULT NULL, + total_tva DOUBLE(24, 8) NULL DEFAULT NULL, + total_localtax1 DOUBLE(24, 8) NULL DEFAULT 0, + total_localtax2 DOUBLE(24, 8) NULL DEFAULT 0, + total_ttc DOUBLE(24, 8) NULL DEFAULT NULL, + product_type INTEGER NULL DEFAULT 0, + date_start datetime NULL DEFAULT NULL, + date_end datetime NULL DEFAULT NULL, + info_bits INTEGER NULL DEFAULT 0, + buy_price_ht DOUBLE(24, 8) NULL DEFAULT 0, + fk_product_fournisseur_price integer NULL DEFAULT NULL, + fk_code_ventilation integer NOT NULL DEFAULT 0, + fk_export_commpta integer NOT NULL DEFAULT 0, + special_code integer UNSIGNED NULL DEFAULT 0, + fk_unit integer NULL DEFAULT NULL, + import_key varchar(14) NULL DEFAULT NULL +)ENGINE=innodb; + ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL AFTER product_type; ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL AFTER date_start; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ae4b100b043..fed096cf024 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1586,6 +1586,7 @@ FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines fo FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) FCKeditorForUserSignature=WYSIWIG creation/edition of user signature FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) +FCKeditorForTicket=WYSIWIG creation/edition for tickets ##### Stock ##### StockSetup=Stock module setup IfYouUsePointOfSaleCheckModule=If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup. diff --git a/htdocs/langs/en_US/bookmarks.lang b/htdocs/langs/en_US/bookmarks.lang index 5330ab6e87c..87466cadcfa 100644 --- a/htdocs/langs/en_US/bookmarks.lang +++ b/htdocs/langs/en_US/bookmarks.lang @@ -18,3 +18,4 @@ SetHereATitleForLink=Set a name for the bookmark UseAnExternalHttpLinkOrRelativeDolibarrLink=Use an external/absolute link (https://URL) or an internal/relative link (/DOLIBARR_ROOT/htdocs/...) ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should open in the current tab or a new tab BookmarksManagement=Bookmarks management +BookmarksMenuShortCut=Ctrl + shift + m diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 4e83b2f0620..d5a4ba16bf0 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -90,3 +90,4 @@ ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Choose category StocksCategoriesArea=Warehouses Categories Area +UseOrOperatorForCategories=Use or operator for categories \ No newline at end of file diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 5886c598d52..dd0a5bf49e2 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -52,6 +52,9 @@ MemberStatusResiliated=Terminated member MemberStatusResiliatedShort=Terminated MembersStatusToValid=Draft members MembersStatusResiliated=Terminated members +MemberStatusNoSubscription=Validated (no subscription needed) +MemberStatusNoSubscriptionShort=Validated +SubscriptionNotNeeded=No subscription needed NewCotisation=New contribution PaymentSubscription=New contribution payment SubscriptionEndDate=Subscription's end date diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3d15d7fe3d4..8fa04de8b11 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1586,6 +1586,7 @@ FCKeditorForProductDetails=Création/édition WYSIWIG des lignes détails produi FCKeditorForMailing= Création/édition WYSIWIG des emailings (Outils->Emailings) FCKeditorForUserSignature=Création/édition WYSIWIG de la signature des utilisateurs FCKeditorForMail=Création/édition WYSIWIG tous les emails (sauf Outils->Emailings) +FCKeditorForTicket=Création/édition WYSIWIG pour les tickets ##### Stock ##### StockSetup=Configuration du module Stock / Entrepôt IfYouUsePointOfSaleCheckModule=Si vous utilisez un module Point de Vente (module POS fourni par défaut ou un autre module externe), cette configuration peut être ignoré par votre module point de vente. La plupart de modules Point de Vente sont conçus pour créer immédiatement une facture et de réduire les stocks par défaut quelles que soient les options ici. Donc, si vous avez besoin ou non d'avoir une diminution du stock lors de l'enregistrement d'une vente dans votre Point de Vente, vérifiez également la configuration de votre module POS. diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index d70bb3139f0..06461e45acb 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -52,6 +52,9 @@ MemberStatusResiliated=Adhérent résilié MemberStatusResiliatedShort=Résilié MembersStatusToValid=Adhérents brouillons MembersStatusResiliated=Adhérents résiliés +MemberStatusNoSubscription=Validé (pas de souscription requise) +MemberStatusNoSubscriptionShort=Validé +SubscriptionNotNeeded=Pas de souscription requise NewCotisation=Nouvelle adhésion PaymentSubscription=Paiement cotisation SubscriptionEndDate=Date de fin adhésion diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 13f2e2f2550..75c0190ddcd 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1284,12 +1284,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (! defined('DISABLE_FONT_AWSOME')) { print ''."\n"; - print ''."\n"; - if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) - { - print ''."\n"; - print ''."\n"; - } + print ''."\n"; + print ''."\n"; } print ''."\n"; @@ -1606,6 +1602,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead print '
'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).''.$langs->trans("TotalTTC").''; @@ -446,7 +446,7 @@ foreach($object->fields as $key => $val) if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; elseif (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; elseif (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; - elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right'; + elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield.=($cssforfield?' ':'').'right'; if (! empty($arrayfields['t.'.$key]['checked'])) { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n"; diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index 76b9671411e..f5f723a8fac 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -48,7 +48,7 @@ $staticbom = new BOM($db); llxHeader('', $langs->trans("MRP"), ''); -print load_fiche_titre($langs->trans("MRPArea")); +print load_fiche_titre($langs->trans("MRPArea"), '', 'cubes'); print '
'; diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 1034acc47d8..ad7f78938c6 100644 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -42,8 +42,6 @@ $hookmanager->initHooks(array('opensurveyindex')); * View */ -llxHeader(); - $nbsondages=0; $sql = 'SELECT COUNT(*) as nb'; $sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage'; @@ -56,9 +54,11 @@ if ($resql) } else dol_print_error($db, ''); -llxHeader(); -print load_fiche_titre($langs->trans("OpenSurveyArea")); +$title = $langs->trans("OpenSurveyArea"); +llxHeader('', $title); + +print load_fiche_titre($title, '', 'wrench'); print '
'; diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index 9ef7cfcc2f0..9f8f44d9555 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -31,7 +31,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe trans("NewProduct"), '', 'title_products.png'); +print load_fiche_titre($langs->trans("NewProduct"), '', 'products'); dol_fiche_head(''); ?> diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php index 6b62b2e2a27..65351371a71 100644 --- a/htdocs/product/canvas/service/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php @@ -31,7 +31,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe trans("NewService"), '', 'title_products.png'); +print load_fiche_titre($langs->trans("NewService"), '', 'products'); dol_fiche_head(''); ?> diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 4a87365f49c..482dbead2c5 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -938,7 +938,7 @@ else if ($type==1) $title=$langs->trans("NewService"); else $title=$langs->trans("NewProduct"); $linkback=""; - print load_fiche_titre($title, $linkback, 'title_products.png'); + print load_fiche_titre($title, $linkback, 'products'); dol_fiche_head(''); diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index d2e0f1e1413..e35f39c12e0 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -145,7 +145,7 @@ jQuery(document).ready(function() { // Part to create if ($action == 'create') { - print load_fiche_titre($langs->trans("NewInventory", $langs->transnoentitiesnoconv("MyInventory"))); + print load_fiche_titre($langs->trans("NewInventory", $langs->transnoentitiesnoconv("MyInventory")), '', 'products'); print '
'; print ''; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 0b797a886bf..3cfaa6da371 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -321,7 +321,7 @@ print ''; print ''; print ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, '', '', $limit); // Add code for pre mass action (confirmation or email presend form) $topicmail="Information"; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index c28e8e2ca76..7c7ae303a0a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -505,7 +505,7 @@ if ($resql) print ''; if (empty($arrayfields['p.fk_product_type']['checked'])) print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_products.png', 0, $newcardbutton, '', $limit); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit); $topicmail="Information"; $modelmail="product"; @@ -537,7 +537,7 @@ if ($resql) $categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1); $categoriesProductArr[-2] = '- ' . $langs->trans('NotCategorized') . ' -'; $moreforfilter.=Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300'); - $moreforfilter.=' ' . $langs->trans('or'); + $moreforfilter.=' ' . $langs->trans('UseOrOperatorForCategories'); $moreforfilter.='
'; } diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index a95546db36e..a25ba2808d5 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -76,7 +76,7 @@ $title=$langs->trans("Statistics"); llxHeader('', $title, $helpurl); -print load_fiche_titre($title, $mesg, 'title_products.png'); +print load_fiche_titre($title, $mesg, 'products'); $param = ''; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 8467263185e..99980f879c8 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -218,7 +218,7 @@ if ($resql) print ''; print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit); if (! empty($catid)) { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 24543b63ea4..66cae5ecb56 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -233,7 +233,7 @@ if ($resql) print ''; print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit); if (! empty($catid)) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 541e7b7f880..36cd2d0e9dc 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -103,7 +103,7 @@ if (! $id && empty($ref)) $title=$langs->trans("Statistics"); } - print load_fiche_titre($title, $mesg, 'title_products.png'); + print load_fiche_titre($title, $mesg, 'products'); } else { diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 72cd34f631b..6c66ea719c5 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -104,15 +104,18 @@ $form=new Form($db); $warehouse=new Entrepot($db); $sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,"; -$sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty,"; +$sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty"; // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); +if (! empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); + } +} // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql=preg_replace('/, $/', '', $sql); +//$sql=preg_replace('/, $/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 7f667dceec1..b2ba7840f1e 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -294,7 +294,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit); $topicmail="Information"; $modelmail="productlot"; diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index c3ae712ee45..7a8e3ff2591 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -85,8 +85,8 @@ $morehtml.='