diff --git a/.travis.yml b/.travis.yml index d660f89e79d..b4621de8a81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -342,6 +342,9 @@ script: php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log + php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log + php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log + php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log cd - set +e echo diff --git a/build/debian/source/include-binaries b/build/debian/source/include-binaries new file mode 100644 index 00000000000..401eae93712 --- /dev/null +++ b/build/debian/source/include-binaries @@ -0,0 +1 @@ +htdocs/install/doctemplates/websites/website_template-corporate.zip \ No newline at end of file diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 589e2a3f55c..a28fc430caa 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "7.0.0", "6.0.5", "5.0.7" ); +return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" ); } sub script_dolibarr_release @@ -263,15 +263,16 @@ if ($upgrade) { local @params = ( [ "action", "upgrade" ], [ "versionfrom", $upgrade->{'version'} ], [ "versionto", $ver ], + [ "installlock", "444" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); - # Remove the installation directory. - local $dinstall = "$opts->{'dir'}/install"; - $dinstall =~ s/\/$//; - $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + # Remove the installation directory. (deprecated) + # local $dinstall = "$opts->{'dir'}/install"; + # $dinstall =~ s/\/$//; + # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); } else { @@ -306,15 +307,18 @@ else { [ "login", "admin" ], [ "pass", $dompass ], [ "pass_verif", $dompass ], + [ "installlock", "444" ], ); local $p = $ver >= 3.8 ? "step5" : "etape5"; local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); - # Remove the installation directory and protect config file. - local $dinstall = "$opts->{'dir'}/install"; - $dinstall =~ s/\/$//; - $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + # Remove the installation directory (deprecated) + # local $dinstall = "$opts->{'dir'}/install"; + # $dinstall =~ s/\/$//; + # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall)); + + # Protect config file &set_permissions_as_domain_user($d, 0644, $cfile); &set_permissions_as_domain_user($d, 0755, $cfiledir); } @@ -386,6 +390,8 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", + $ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" : diff --git a/dev/resources/dbmodel/dolibarr.uml b/dev/resources/dbmodel/dolibarr.uml deleted file mode 100644 index 57078d6668b..00000000000 --- a/dev/resources/dbmodel/dolibarr.uml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/resources/dbmodel/dolibarr.umldi b/dev/resources/dbmodel/dolibarr.umldi deleted file mode 100644 index ff97a2a25b1..00000000000 --- a/dev/resources/dbmodel/dolibarr.umldi +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/resources/dbmodel/dolibarr_schema.mwb b/dev/resources/dbmodel/dolibarr_schema.mwb index aec0f2d2299..80d1d612d65 100644 Binary files a/dev/resources/dbmodel/dolibarr_schema.mwb and b/dev/resources/dbmodel/dolibarr_schema.mwb differ diff --git a/doc/install/README b/doc/install/README index 83bc6484cea..0c7341b196c 100644 --- a/doc/install/README +++ b/doc/install/README @@ -7,12 +7,12 @@ Download -------------------------------- * Dolibarr ERP/CRM can be downloaded at sourceforge: -http://sourceforge.net/projects/dolibarr/files -or from Dolibarr official web site: -http://www.dolibarr.org + https://sourceforge.net/projects/dolibarr/files + or from Dolibarr official web site: + https://www.dolibarr.org * Most external modules are only available on DoliStore: -http://www.dolistore.org + https://www.dolistore.com -------------------------------- @@ -22,4 +22,4 @@ Install * For a Quick guide, take a look at README file into root directory. * More complete documentations are also available on line on the Dolibarr Wiki: -http://wiki.dolibarr.org + https://wiki.dolibarr.org diff --git a/doc/install/README-DE b/doc/install/README-DE new file mode 100644 index 00000000000..c7ece3891f3 --- /dev/null +++ b/doc/install/README-DE @@ -0,0 +1,33 @@ +README (deutsch / german / allemand) +-------------------------------- + + +-------------------------------- +Download / Herunterladen +-------------------------------- + +* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website + https://www.dolibarr.org/downloads + oder direkt von Sourceforge + https://sourceforge.net/projects/dolibarr/files/ + herunterladen. + + + +* Die meisten externen Module/Themens sind über den DoliStore verfügbar: + https://www.dolistore.com/de/ + + +-------------------------------- +Installation +-------------------------------- + +* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis. + +* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden: + https://wiki.dolibarr.org/index.php/Hauptseite + +* eine Deutsche Community bietet der Dolibarr e.V. unter + https://www.dolibarr.de/ + + diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 33fdb675ac0..c777c36dca0 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -388,13 +388,13 @@ else if ($id > 0 || $ref) { if (! empty($user->rights->accounting->chartofaccount)) { print '' . $langs->trans('Modify') . ''; } else { - print '' . $langs->trans('Modify') . ''; + print '' . $langs->trans('Modify') . ''; } if (! empty($user->rights->accounting->chartofaccount)) { print '' . $langs->trans('Delete') . ''; } else { - print '' . $langs->trans('Delete') . ''; + print '' . $langs->trans('Delete') . ''; } print ''; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 62eda456fe7..6a60a031a59 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -117,7 +117,7 @@ if ($result) } else { - $addbutton = '' . $langs->trans("NewFiscalYear") . ''; + $addbutton = '' . $langs->trans("NewFiscalYear") . ''; } $title = $langs->trans('AccountingPeriods'); diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 6b60296a5f4..7d506c6c72c 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -94,7 +94,7 @@ $facture_static = new Facture($db); $formaccounting = new FormAccounting($db); if (! empty($id)) { - $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,"; + $sql = "SELECT f.ref, f.rowid as facid, l.fk_product, l.description, l.price,"; $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, p.accountancy_code_sell as code_sell,"; $sql .= " l.fk_code_ventilation, aa.account_number, aa.label"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l"; @@ -128,7 +128,7 @@ if (! empty($id)) { // Ref facture print '' . $langs->trans("Invoice") . ''; - $facture_static->ref = $objp->facnumber; + $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; print '' . $facture_static->getNomUrl(1) . ''; print ''; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index f4ed9bad1f5..f13344c936b 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -64,7 +64,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $offset = $limit * $page; if (! $sortfield) - $sortfield = "f.datef, f.facnumber, fd.rowid"; + $sortfield = "f.datef, f.ref, fd.rowid"; if (! $sortorder) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { $sortorder = "DESC"; @@ -167,7 +167,7 @@ print ' +'; +print ''; +print ''; +if(count($echeance->lines)>0) +{ + print ''; +}else{ + print ''; +} +print ''; +print ''; +$colspan = 6; +if (count($echeance->lines)>0) $colspan++; +print ''; +print ''; + +print ''; +Print ''; +Print ''; +print ''; +Print ''; +Print ''; +if (count($echeance->lines)>0) print ''; +print ''."\n"; + +if ($object->nbterm > 0 && count($echeance->lines)==0) +{ + $i=1; + $capital = $object->capital; + $insurance = $object->insurance_amount/$object->nbterm; + $insurance = price2num($insurance, 'MT'); + $regulInsurance = price2num($object->insurance_amount - ($insurance * $object->nbterm)); + while($i <$object->nbterm+1) + { + $mens = price2num($echeance->calcMonthlyPayments($capital, $object->rate/100, $object->nbterm-$i+1), 'MT'); + $int = ($capital*($object->rate/12))/100; + $int = price2num($int, 'MT'); + $insu = ($insurance+(($i == 1) ? $regulInsurance : 0)); + $cap_rest = price2num($capital - ($mens-$int), 'MT'); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; + $i++; + $capital = $cap_rest; + } +} +elseif(count($echeance->lines)>0) +{ + $i=1; + $capital = $object->capital; + $insurance = $object->insurance_amount/$object->nbterm; + $insurance = price2num($insurance, 'MT'); + $regulInsurance = price2num($object->insurance_amount - ($insurance * $object->nbterm)); + $printed = false; + foreach ($echeance->lines as $line){ + $mens = $line->amount_capital+$line->amount_interest; + $int = $line->amount_interest; + $insu = ($insurance+(($i == 1) ? $regulInsurance : 0)); + $cap_rest = price2num($capital - ($mens-$int), 'MT'); + + print ''; + print ''; + print ''; + print ''; + print ''; + if($line->datep > dol_now() && empty($line->fk_bank)){ + print ''; + }else{ + print ''; + } + + print ''; + print ''; + print ''."\n"; + $i++; + $capital = $cap_rest; + } +} + +print '
'; +print $langs->trans("FinancialCommitment"); +print '
'.$langs->trans("Term").''.$langs->trans("Date").''.$langs->trans("Insurance"); +Print ''.$langs->trans("InterestAmount").''.$langs->trans("Amount").''.$langs->trans("CapitalRemain"); +print ' ('.price2num($object->capital).')'; +print ''; +print ''.$langs->trans('DoPayment').'
' . $i .'' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'),'day') . ''.price($insurance+(($i == 1) ? $regulInsurance : 0),0,'',1).' €'.price($int,0,'',1).' €'.price($cap_rest).' €
' . $i .'' . dol_print_date($line->datep,'day') . ''.price($insu,0,'',1).' €'.price($int,0,'',1).' €' . price($mens) . ' €'.price($cap_rest).' €'; + if (!empty($line->fk_bank)) print $langs->trans('Paid'); + elseif (!$printed) + { + print ''.$langs->trans('DoPayment').''; + $printed = true; + } + print '
'; +print '
'; +print '
'; +if (count($echeance->lines)==0) $label = $langs->trans("Create"); +else $label = $langs->trans("Save"); +print '
'; +print ''; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 06f67a9b79f..0f2f8af452e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -500,6 +500,17 @@ if (! defined('NOLOGIN')) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); $test=false; + // Call trigger for the "security events" log + $user->trigger_mesg='ErrorBadValueForCode - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End Call of triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -568,6 +579,17 @@ if (! defined('NOLOGIN')) // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions if (empty($_SESSION["dol_loginmesg"])) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); + // Call trigger for the "security events" log + $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST("username","alpha",2)); + if ($result < 0) { + $error++; + } + // End Call of triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -604,12 +626,25 @@ if (! defined('NOLOGIN')) $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { $_SESSION["dol_loginmesg"]=$user->error; + + $user->trigger_mesg=$user->error; } + // Call triggers for the "security events" log + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -648,12 +683,25 @@ if (! defined('NOLOGIN')) $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { $_SESSION["dol_loginmesg"]=$user->error; + + $user->trigger_mesg=$user->error; } + // Call triggers for the "security events" log + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -741,6 +789,17 @@ if (! defined('NOLOGIN')) $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; + // Call triggers for the "security events" log + $user->trigger_mesg = $loginfo; + // Call triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on successfull login $action=''; $hookmanager->initHooks(array('login')); @@ -752,7 +811,7 @@ if (! defined('NOLOGIN')) { $db->rollback(); session_destroy(); - dol_print_error($db,'Error in some hooks afterLogin'); + dol_print_error($db,'Error in some triggers USER_LOGIN or in some hooks afterLogin'); exit; } else @@ -1015,7 +1074,7 @@ if (! function_exists("llxHeader")) if (empty($conf->dol_hide_leftmenu)) { - left_menu('', $help_url, '', '', 1, $title, 1); + left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function } // main area diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 2f7b534fbba..850b47cee17 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -49,7 +49,7 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder = "DESC"; -if (! $sortfield) $sortfield = 'f.facnumber'; +if (! $sortfield) $sortfield = 'f.ref'; $startdate = $enddate = ''; @@ -185,7 +185,7 @@ $massactionbutton=''; $sql = "SELECT"; -$sql .= " f.facnumber, f.rowid as invoiceid, d.rowid as invoicedetid, d.buy_price_ht, d.total_ht, d.subprice, d.label, d.description , d.qty"; +$sql .= " f.ref, f.rowid as invoiceid, d.rowid as invoicedetid, d.buy_price_ht, d.total_ht, d.subprice, d.label, d.description , d.qty"; $sql .= " ,d.fk_product"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f "; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as d ON d.fk_facture = f.rowid"; @@ -194,7 +194,7 @@ $sql .= " WHERE f.fk_statut > 0"; $sql .= " AND f.entity IN (" . getEntity('invoice') . ") "; if (! empty($startdate)) $sql .= " AND f.datef >= '" . $db->idate($startdate) . "'"; if (! empty($enddate)) $sql .= " AND f.datef <= '" . $db->idate($enddate) . "'"; -if ($search_ref) $sql.=natural_search('f.facnumber', $search_ref); +if ($search_ref) $sql.=natural_search('f.ref', $search_ref); $sql .= " AND d.buy_price_ht IS NOT NULL"; $sql .= $db->order($sortfield, $sortorder); @@ -249,7 +249,7 @@ if ($result) { print "\n"; print ''; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "", "", $param, 'width=20%', $sortfield, $sortorder); print_liste_field_titre("UnitPriceHT", $_SERVER["PHP_SELF"], "d.subprice", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "d.buy_price_ht", "", $param, 'align="right"', $sortfield, $sortorder); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 675fe527a47..5e04ebff091 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -202,7 +202,7 @@ print ''; $sql = "SELECT"; $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; -if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; +if ($client) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not, your database may be corrupted, you can update this) $sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; @@ -235,7 +235,7 @@ $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; -if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; +if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut"; else $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client"; $sql.=$db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination @@ -260,7 +260,7 @@ if ($result) print ''; if (! empty($client)) { - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&socid=".$socid,'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&socid=".$socid,'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&socid=".$socid,'align="center"',$sortfield,$sortorder); } else @@ -304,7 +304,7 @@ if ($result) if ($client) { print ''; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print "\n"; print ""; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 8a741c3712e..ae79cc7957f 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -176,7 +176,7 @@ print ''; $sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref, p.entity as pentity,"; if ($id > 0) $sql.= " d.fk_product,"; -if ($id > 0) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; +if ($id > 0) $sql.= " f.rowid as facid, f.ref, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " SUM(d.total_ht) as selling_price,"; // Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) $sql.= " SUM(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; @@ -204,7 +204,7 @@ if (!empty($enddate)) $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; -if ($id > 0) $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, p.entity, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; +if ($id > 0) $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, p.entity, d.fk_product, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut"; else $sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, p.entity"; $sql.=$db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination @@ -233,7 +233,7 @@ if ($result) print ''; if ($id > 0) { - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&id=".$id,'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&id=".$id,'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&id=".$id,'align="center"',$sortfield,$sortorder); } else @@ -277,7 +277,7 @@ if ($result) if ($id > 0) { print ''; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print "\n"; print ""; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 5659be448de..1d922473036 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -131,7 +131,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->facture->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; + $sql.= " f.rowid as facid, f.ref, f.total as total_ht,"; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive @@ -151,7 +151,7 @@ if ($id > 0 || ! empty($ref)) if (! empty($socid)) $sql.= " AND f.fk_soc = $socid"; $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; - $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.type"; + $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut, f.type"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user"; $sql.= $db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination @@ -169,7 +169,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&id=".$object->id,'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&id=".$object->id,'',$sortfield,$sortorder); print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","","&id=".$object->id,'',$sortfield,$sortorder); print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","","&id=".$object->id,'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&id=".$object->id,'align="center"',$sortfield,$sortorder); @@ -199,7 +199,7 @@ if ($id > 0 || ! empty($ref)) print ''; print '\n"; print ''; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 55362ac4218..2856ebb8397 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -144,7 +144,7 @@ if ($socid > 0) print '
'; $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; - $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; + $sql.= " f.rowid as facid, f.ref, f.total as total_ht,"; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive $sql.= " sum(d.qty * d.buy_price_ht) as buying_price,"; // always positive @@ -159,7 +159,7 @@ if ($socid > 0) $sql.= " AND f.fk_soc = $socid"; $sql.= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; - $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.type"; + $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total, f.datef, f.paye, f.fk_statut, f.type"; $sql.= $db->order($sortfield,$sortorder); // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); @@ -177,7 +177,7 @@ if ($socid > 0) print "
'; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print "'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'
"; print ''; - print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.facnumber","","&socid=".$_REQUEST["socid"],'',$sortfield,$sortorder); + print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],"f.ref","","&socid=".$_REQUEST["socid"],'',$sortfield,$sortorder); print_liste_field_titre("DateInvoice",$_SERVER["PHP_SELF"],"f.datef","","&socid=".$_REQUEST["socid"],'align="center"',$sortfield,$sortorder); print_liste_field_titre("SoldAmount",$_SERVER["PHP_SELF"],"selling_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder); print_liste_field_titre("PurchasedAmount",$_SERVER["PHP_SELF"],"buying_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder); @@ -211,7 +211,7 @@ if ($socid > 0) print ''; print '\n"; print "'; + switch($objp->type_mouvement){ + case "0": + print ''; + break; + case "1": + print ''; + break; + case "2": + print ''; + break; + case "3": + print ''; + break; + } } if (! empty($arrayfields['origin']['checked'])) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 852bf2a4e8d..54a4cd564ab 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -767,12 +767,12 @@ if (empty($reshook)) } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } //if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch()) @@ -783,12 +783,12 @@ if (empty($reshook)) } else { - print '' . $langs->trans("TransferStock") . ''; + print '' . $langs->trans("TransferStock") . ''; } } else { - print '' . $langs->trans("CorrectStock") . ''; + print '' . $langs->trans("CorrectStock") . ''; } print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 8bf377a9844..c9abfd7d4ad 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -552,7 +552,7 @@ if ($action == 'create' && $user->rights->projet->creer) $text=$form->select_company(GETPOST('socid','int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { - $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); + $texthelp=$langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); } else print $text; @@ -618,9 +618,9 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; - +var_dump($conf->global->PROJECT_USE_TASKS); // Bill time - if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; print ''; @@ -789,7 +789,7 @@ elseif ($object->id > 0) $text=$form->select_company($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), 0, 'minwidth300'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { - $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); + $texthelp=$langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); } else print $text; @@ -855,7 +855,7 @@ elseif ($object->id > 0) print ''; // Bill time - if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; print ''; @@ -985,7 +985,7 @@ elseif ($object->id > 0) print ''; // Bill time - if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; print ''; @@ -1118,7 +1118,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Modify').'
'; + print '
'.$langs->trans('Modify').'
'; } } @@ -1131,7 +1131,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Validate').'
'; + print '
'.$langs->trans('Validate').'
'; } } @@ -1144,7 +1144,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Close').'
'; + print '
'.$langs->trans('Close').'
'; } } @@ -1157,7 +1157,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('ReOpen').'
'; + print '
'.$langs->trans('ReOpen').'
'; } } @@ -1225,7 +1225,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('ToClone').'
'; + print '
'.$langs->trans('ToClone').'
'; } } @@ -1238,7 +1238,7 @@ elseif ($object->id > 0) } else { - print '
'.$langs->trans('Delete').'
'; + print '
'.$langs->trans('Delete').'
'; } } } diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index cd2e722ecd3..3a68eb9b5d4 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -241,7 +241,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Bill time - if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; // Bill time -if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) +if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; } +if (! empty($arrayfields['p.bill_time']['checked'])) +{ + print ''; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -669,6 +677,7 @@ if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'],$_SERVER["PHP_SELF"],'p.opp_amount',"",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'],$_SERVER["PHP_SELF"],'p.opp_percent',"",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'],$_SERVER["PHP_SELF"],'p.budget_amount',"",$param,'align="right"',$sortfield,$sortorder); +if (! empty($arrayfields['p.bill_time']['checked'])) print_liste_field_titre($arrayfields['p.bill_time']['label'],$_SERVER["PHP_SELF"],'p.bill_time',"",$param,'align="right"',$sortfield,$sortorder); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -847,6 +856,17 @@ while ($i < min($num,$limit)) if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalbudgetfield']=$totalarray['nbfield']; } + // Bill time + if (! empty($arrayfields['p.bill_time']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 2f06f698b14..fb2399175c2 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -417,7 +417,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Bill time - if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; // Progress calculated @@ -661,7 +664,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1); $arrayfields['t.task_duration']=array('label'=>$langs->trans("Duration"), 'checked'=>1); $arrayfields['value'] =array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled)?0:1)); - $arrayfields['valuebilled'] =array('label'=>$langs->trans("AmountInvoiced"), 'checked'=>1, 'enabled'=>(empty($conf->global->PROJECT_BILL_TIME_SPENT)?0:1)); + $arrayfields['valuebilled'] =array('label'=>$langs->trans("AmountInvoiced"), 'checked'=>1, 'enabled'=>((! empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT))?0:1)); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -678,7 +681,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm,"; $sql .= " pt.ref, pt.label,"; - $sql .= " u.lastname, u.firstname, u.login, u.photo,"; + $sql .= " u.lastname, u.firstname, u.login, u.photo, u.statut as user_status,"; $sql .= " il.fk_facture as invoice_id, il.total_ht"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facturedet as il ON il.rowid = t.invoice_line_id"; @@ -960,7 +963,6 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $totalarray=array(); foreach ($tasks as $task_time) { - print ''; $date1=$db->jdate($task_time->task_date); @@ -1037,6 +1039,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; $userstatic->photo = $task_time->photo; + $userstatic->statut = $task_time->user_status; print $userstatic->getNomUrl(-1); } print ''; diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index c27cb024aab..d04d6eb8020 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -23,7 +23,8 @@ /** * \file public/emailing/mailing-unsubscribe.php * \ingroup mailing - * \brief Script use to update unsubcribe contact to prospect mailing list + * \brief Script use to update unsubcribe status of an email + * https://myserver/public/emailing/mailing-unsubscribe.php?unsuscrib=1&securitykey=securitykey&tag=abcdefghijklmn */ if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. @@ -75,38 +76,51 @@ if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) if (! empty($tag) && ($unsuscrib=='1')) { - // Update status of mail in recipient mailing list table - $statut='3'; - $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE tag='".$db->escape($tag)."'"; - dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe : ".$sql, LOG_DEBUG); + dol_syslog("public/emailing/mailing-unsubscribe.php : Launch unsubscribe requests", LOG_DEBUG); - $resql=$db->query($sql); - if (! $resql) dol_print_error($db); - - // Update status communication of thirdparty prospect - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=-1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag='".$db->escape($tag)."' AND source_type='thirdparty' AND source_id is not null)"; - dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe thirdparty : ".$sql, LOG_DEBUG); - - $resql=$db->query($sql); - if (! $resql) dol_print_error($db); - - // Update status communication of contact prospect - $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET no_email=1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag = '".$db->escape($tag)."' AND source_type='contact' AND source_id is not null)"; - dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe contact : ".$sql, LOG_DEBUG); - - $resql=$db->query($sql); - if (! $resql) dol_print_error($db); - - - $sql = "SELECT mc.email"; - $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; - $sql .= " WHERE mc.tag='".$db->escape($tag)."'"; + $sql = "SELECT mc.email, m.entity"; + $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."mailing as m"; + $sql .= " WHERE mc.fk_mailing = m.rowid AND mc.tag='".$db->escape($tag)."'"; $resql=$db->query($sql); if (! $resql) dol_print_error($db); $obj = $db->fetch_object($resql); + if (empty($obj->email)) + { + print 'Email not found. No need to unsubscribe.'; + exit; + } + + // Update status of mail in recipient mailing list table + $statut='3'; + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE tag='".$db->escape($tag)."'"; + + $resql=$db->query($sql); + if (! $resql) dol_print_error($db); + + /* + // Update status communication of thirdparty prospect (old usage) + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=-1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag = '".$db->escape($tag)."' AND source_type='thirdparty' AND source_id is not null)"; + + $resql=$db->query($sql); + if (! $resql) dol_print_error($db); + + // Update status communication of contact prospect (old usage) + $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET no_email=1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag = '".$db->escape($tag)."' AND source_type='contact' AND source_id is not null)"; + + $resql=$db->query($sql); + if (! $resql) dol_print_error($db); + */ + + // Update status communication of email (new usage) + $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_unsubscribe (date_creat, entity, email) VALUES ('".$db->idate(dol_now())."', ".$obj->entity.", '".$obj->email."')"; + + $resql=$db->query($sql); + //if (! $resql) dol_print_error($db); No test on errors, may fail if already unsubscribed + + header("Content-type: text/html; charset=".$conf->file->character_set_client); print ''; diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index a9bd8a0fb70..acf986bb226 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -95,7 +95,7 @@ if (GETPOST('ajoutcomment','alpha')) } // Add vote -if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // boutonp for chrom, boutonp_x for firefox +if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // boutonp for chrome, boutonp_x for firefox { if (!$canbemodified) accessforbidden(); @@ -160,9 +160,12 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout if ($email) { include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $body = $langs->trans('EmailSomeoneVoted', $nom, getUrlSondage($numsondage, true)); + $application = ($conf->global->MAIN_APPLICATION_TITLE ? $conf->global->MAIN_APPLICATION_TITLE : 'Dolibarr ERP/CRM'); - $cmailfile=new CMailFile("[".MAIN_APPLICATION_TITLE."] ".$langs->trans("Poll").': '.$object->titre, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body); + $body = str_replace('\n', '
', $langs->transnoentities('EmailSomeoneVoted', $nom, getUrlSondage($numsondage, true))); + //var_dump($body);exit; + + $cmailfile=new CMailFile("[".$application."] ".$langs->trans("Poll").': '.$object->titre, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body, null, null, null, '', '', 0, -1); $result=$cmailfile->sendfile(); } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index cd923ee6dcd..3981731419e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -12,6 +12,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1148,7 +1149,7 @@ else } else { - print ''.fieldLabel('ThirdPartyName','name').''; + print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; print ''; @@ -1161,11 +1162,11 @@ else // If javascript on, we show option individual if ($conf->use_javascript_ajax) { - print ''; + print ''; print ''; print ''; // Title - print ''; print ''; } @@ -1175,7 +1176,7 @@ else print ''; // Prospect/Customer - print ''; + print ''; print ''; - print '
'; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; print $invoicestatic->getNomUrl(1); print ""; diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 545e53d350a..460df7e96bf 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -97,14 +97,12 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * This is the main function that returns the array of emails * * @param int $mailing_id Id of emailing - * @param array $filtersarray Requete sql de selection des destinataires * @return int <0 if error, number of emails added if ok */ - function add_to_target($mailing_id,$filtersarray=array()) + function add_to_target($mailing_id) { // phpcs:enable $target = array(); - $cibles = array(); $j = 0; @@ -114,7 +112,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets if (! empty($_POST['filter']) && $_POST['filter'] != 'none') $sql.= " AND status = '".$this->db->escape($_POST['filter'])."'"; $sql.= " ORDER BY email"; - // Stocke destinataires dans cibles + // Stocke destinataires dans target $result=$this->db->query($sql); if ($result) { @@ -129,7 +127,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets $obj = $this->db->fetch_object($result); if ($old <> $obj->email) { - $cibles[$j] = array( + $target[$j] = array( 'email' => $obj->email, 'name' => $obj->lastname, 'id' => $obj->id, @@ -162,7 +160,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets // ----- Your code end here ----- - return parent::add_to_target($mailing_id, $cibles); + return parent::add_to_target($mailing_id, $target); } diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 9c6c9265592..b1da52ad4aa 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -232,7 +232,7 @@ if ($object->id > 0) } else { - print ''.$langs->trans("AddAction").''; + print ''.$langs->trans("AddAction").''; } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index f9b3db7a99e..75754512c71 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -372,7 +372,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Modify').''."\n"; + print ''.$langs->trans('Modify').''."\n"; } // Clone @@ -401,7 +401,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } print ''."\n"; diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index f3fd135f16d..34945504943 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1050,18 +1050,20 @@ $toutsujet = explode(",", $object->sujet); // With old versions, this field was $compteursujet = 0; $meilleursujet = ''; -for ($i = 0; $i < $nbcolonnes; $i++) { - if (isset($sumfor[$i]) === true && isset($meilleurecolonne) === true && $sumfor[$i] == $meilleurecolonne) { +for ($i = 0; $i < $nbcolonnes; $i++) +{ + if (isset($sumfor[$i]) === true && isset($meilleurecolonne) === true && $sumfor[$i] == $meilleurecolonne) + { $meilleursujet.=", "; if ($object->format == "D") { $meilleursujetexport = $toutsujet[$i]; - + //var_dump($toutsujet); if (strpos($toutsujet[$i], '@') !== false) { $toutsujetdate = explode("@", $toutsujet[$i]); - $meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ' ('.dol_print_date($toutsujetdate[0],'%A').')' . ' - ' . $toutsujetdate[1]; + $meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ($toutsujetdate[0] ? ' ('.dol_print_date($toutsujetdate[0],'%A').')' : '') . ' - ' . $toutsujetdate[1]; } else { - $meilleursujet .= dol_print_date($toutsujet[$i],'daytext'). ' ('.dol_print_date($toutsujet[$i],'%A').')'; + $meilleursujet .= dol_print_date($toutsujet[$i],'daytext'). ($toutsujet[$i] ? ' ('.dol_print_date($toutsujet[$i],'%A').')' : ''); } } else @@ -1083,9 +1085,9 @@ if ($nbofcheckbox >= 2) print '

'."\n"; if (isset($meilleurecolonne) && $compteursujet == "1") { - print " " . $langs->trans('TheBestChoice') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne."" . $vote_str . ".\n"; + print " " . $langs->trans('TheBestChoice') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne." " . $vote_str . ".\n"; } elseif (isset($meilleurecolonne)) { - print " " . $langs->trans('TheBestChoices') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne."" . $vote_str . ".\n"; + print " " . $langs->trans('TheBestChoices') . ": ".$meilleursujet." " . $langs->trans("with") . " ".$meilleurecolonne." " . $vote_str . ".\n"; } print '


'."\n"; } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f94c34d1804..3e95b3cbb45 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2037,12 +2037,12 @@ if ($action != 'create' && $action != 'edit') } else { - print ''; + print ''; } } else { - print ''; + print ''; } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4fa89c20cac..b872a6e401e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -310,6 +310,7 @@ class Product extends CommonObject public $oldcopy; + public $fk_default_warehouse; /** * @var int ID */ diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index baa738c20c5..3e4a87fe9f9 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -219,7 +219,7 @@ print ' print ''.$langs->trans("Back").''; if ($eid == 0) { - print '
'.$langs->trans('Delete').'
'."\n"; + print '
'.$langs->trans('Delete').'
'."\n"; } else { diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 24848ad26c5..eaa2f3dffc2 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -336,7 +336,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Modify').''."\n"; + print ''.$langs->trans('Modify').''."\n"; } if ($permissiontodelete) @@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } print ''."\n"; diff --git a/htdocs/product/inventory/tpl/inventory.tpl.php b/htdocs/product/inventory/tpl/inventory.tpl.php index 30dc02a17d6..0b89ac8a647 100644 --- a/htdocs/product/inventory/tpl/inventory.tpl.php +++ b/htdocs/product/inventory/tpl/inventory.tpl.php @@ -201,7 +201,7 @@ if (empty($conf) || ! is_object($conf)) - trans('Delete') ?> + trans('Delete') ?> diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dda8cf267c9..323d21e5629 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -417,6 +417,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index b610e2a2914..557892da312 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1111,7 +1111,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ if ($object->isVariant()) { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } } else { if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 8b3cd4d9856..6cf8c13208a 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -147,7 +147,7 @@ if ($id > 0 || ! empty($ref)) elseif ($user->rights->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; - $sql.= " f.facnumber, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,"; + $sql.= " f.ref, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,"; $sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -239,7 +239,7 @@ if ($id > 0 || ! empty($ref)) $total_qty+=$objp->qty; $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; + $invoicestatic->ref=$objp->ref; $societestatic->fetch($objp->socid); $paiement = $invoicestatic->getSommePaiement(); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 6977ac28acf..1d9cbd7952f 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -419,12 +419,12 @@ else if ($user->rights->stock->creer) print "id."\">".$langs->trans("Modify").""; else - print "".$langs->trans("Modify").""; + print "".$langs->trans("Modify").""; if ($user->rights->stock->supprimer) print "id."\">".$langs->trans("Delete").""; else - print "".$langs->trans("Delete").""; + print "".$langs->trans("Delete").""; } } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 7991477e146..98103af8ccf 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -322,8 +322,8 @@ class MouvementStock extends CommonObject if (! $foundforbatch || $qtyisnotenough) { $langs->load("stocks"); - $this->error = $langs->trans('qtyToTranferLotIsNotEnough'); - $this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough'); + $this->error = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref; + $this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref; $this->db->rollback(); return -8; } @@ -333,8 +333,8 @@ class MouvementStock extends CommonObject if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) { $langs->load("stocks"); - $this->error = $langs->trans('qtyToTranferIsNotEnough'); - $this->errors[] = $langs->trans('qtyToTranferIsNotEnough'); + $this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref; + $this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref; $this->db->rollback(); return -8; } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index bd5ac4a4345..f6a694c57fa 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1048,7 +1048,20 @@ if ($resql) if (! empty($arrayfields['m.type_mouvement']['checked'])) { // Type of movement - print '
'.$objp->type_mouvement.''.$langs->trans('StockIncreaseAfterCorrectTransfer').''.$langs->trans('StockDecreaseAfterCorrectTransfer').''.$langs->trans('StockDecrease').''.$langs->trans('StockIncrease').''; print ''; print '
'.$langs->trans("BillTime").'
'.$langs->trans("BillTime").'bill_time) ? ' checked="checked"' : '').'">
'.$langs->trans("BillTime").''.yn($object->bill_time).'
'.$langs->trans("BillTime").''; print yn($object->bill_time); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5494c893b2a..59fda8f2123 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -218,7 +218,7 @@ print nl2br($object->description); print '
'.$langs->trans("BillTime").''; print yn($object->bill_time); diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 1f9b35b8420..d491e55a080 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -18,8 +18,8 @@ /** * \file htdocs/projet/info.php - * \ingroup commande - * \brief Page with info on project + * \ingroup project + * \brief Page with events on project */ require '../main.inc.php'; @@ -34,7 +34,7 @@ $langs->load("projects"); $id = GETPOST('id','int'); $ref = GETPOST('ref','alpha'); $socid = GETPOST('socid','int'); -$action = GETPOST('action','alpha'); +$action = GETPOST('action','aZ09'); $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield","alpha"); @@ -50,16 +50,15 @@ $pagenext = $page + 1; if (GETPOST('actioncode','array')) { - $actioncode=GETPOST('actioncode','array',3); - if (! count($actioncode)) $actioncode='0'; + $actioncode=GETPOST('actioncode','array',3); + if (! count($actioncode)) $actioncode='0'; } else { - $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label=GETPOST('search_agenda_label'); - // Security check $id = GETPOST("id",'int'); $socid=0; @@ -71,7 +70,7 @@ if (!$user->rights->projet->lire) accessforbidden(); /* - * Actions + * Actions */ $parameters=array('id'=>$socid); @@ -81,8 +80,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e // Purge search criteria if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { - $actioncode=''; - $search_agenda_label=''; + $actioncode=''; + $search_agenda_label=''; } @@ -170,7 +169,7 @@ if (! empty($conf->agenda->enabled)) } else { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; } } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index dac11d34519..e36a000674b 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -128,6 +128,7 @@ $arrayfields=array( 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104), 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105), 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), + 'p.bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), @@ -279,7 +280,7 @@ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; $distinct='DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat"; -$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; +$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount, p.bill_time"; $sql.= ", s.nom as name, s.rowid as socid"; $sql.= ", cls.code as opp_status_code"; // We'll need these fields in order to filter by categ @@ -437,6 +438,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), // 'presend'=>$langs->trans("SendByMail"), // 'builddoc'=>$langs->trans("PDFMerge"), ); @@ -620,6 +622,12 @@ if (! empty($arrayfields['p.budget_amount']['checked'])) print ''; print ''; + print ''; + print ''; + if ($obj->bill_time) + { + print yn($obj->bill_time); + } + print '
'.$langs->trans("BillTime").''; print yn($object->bill_time); @@ -450,108 +450,118 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print load_fiche_titre($langs->trans("NewTask"), '', 'title_project'); - print '
'; - print ''; - print ''; - print ''; - if (! empty($object->id)) print ''; - - dol_fiche_head(''); - - print ''; - - $defaultref=''; - $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; - if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) + if ($object->statut == Project::STATUS_CLOSED) { - require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; - $modTask = new $obj; - $defaultref = $modTask->getNextValue($object->thirdparty,null); - } - - if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; - - // Ref - print ''; - - print ''; - - // List of projects - print ''; - - print ''; - - // Date start - print ''; - - // Date end - print ''; - - // Planned workload - print ''; - - // Progress - print ''; - - // Description - print ''; - print ''; - - // Other options - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - if (empty($reshook) && ! empty($extrafields_task->attribute_label)) - { - print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project - } - - print '
'.$langs->trans("Ref").''; - if (empty($duplicate_code_error)) - { - print (GETPOSTISSET("ref")?GETPOST("ref",'alpha'):$defaultref); + print '
'; + $langs->load("errors"); + print $langs->trans("WarningProjectClosed"); + print '
'; } else { - print $defaultref; + print ''; + print ''; + print ''; + print ''; + if (! empty($object->id)) print ''; + + dol_fiche_head(''); + + print ''; + + $defaultref=''; + $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; + if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) + { + require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; + $modTask = new $obj; + $defaultref = $modTask->getNextValue($object->thirdparty,null); + } + + if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; + + // Ref + print ''; + + print ''; + + // List of projects + print ''; + + print ''; + + // Date start + print ''; + + // Date end + print ''; + + // Planned workload + print ''; + + // Progress + print ''; + + // Description + print ''; + print ''; + + // Other options + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + if (empty($reshook) && ! empty($extrafields_task->attribute_label)) + { + print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project + } + + print '
'.$langs->trans("Ref").''; + if (empty($duplicate_code_error)) + { + print (GETPOSTISSET("ref")?GETPOST("ref",'alpha'):$defaultref); + } + else + { + print $defaultref; + } + print ''; + print '
'.$langs->trans("Label").''; + print ''; + print '
'.$langs->trans("ChildOfProjectTask").''; + print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500'); + print '
'.$langs->trans("AffectedTo").''; + $contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):''); + if (is_array($contactsofproject) && count($contactsofproject)) + { + print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); + } + else + { + print $langs->trans("NoUserAssignedToTheProject"); + } + print '
'.$langs->trans("DateStart").''; + print $form->selectDate(($date_start?$date_start:''), 'dateo', 1, 1, 0, '', 1, 1); + print '
'.$langs->trans("DateEnd").''; + print $form->selectDate(($date_end?$date_end:-1),'datee', -1, 1, 0, '', 1, 1); + print '
'.$langs->trans("PlannedWorkload").''; + print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text'); + print '
'.$langs->trans("ProgressDeclared").''; + print $formother->select_percent($progress,'progress',0,5,0,100,1); + print '
'.$langs->trans("Description").''; + print ''; + print '
'; + + dol_fiche_end(); + + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print ''; } - print ''; - print '
'.$langs->trans("Label").''; - print ''; - print '
'.$langs->trans("ChildOfProjectTask").''; - print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500'); - print '
'.$langs->trans("AffectedTo").''; - $contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):''); - if (is_array($contactsofproject) && count($contactsofproject)) - { - print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); - } - else - { - print $langs->trans("NoUserAssignedToTheProject"); - } - print '
'.$langs->trans("DateStart").''; - print $form->selectDate(($date_start?$date_start:''), 'dateo', 1, 1, 0, '', 1, 1); - print '
'.$langs->trans("DateEnd").''; - print $form->selectDate(($date_end?$date_end:-1),'datee', -1, 1, 0, '', 1, 1); - print '
'.$langs->trans("PlannedWorkload").''; - print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text'); - print '
'.$langs->trans("ProgressDeclared").''; - print $formother->select_percent($progress,'progress',0,5,0,100,1); - print '
'.$langs->trans("Description").''; - print ''; - print '
'; - - dol_fiche_end(); - - print '
'; - print ''; - print '     '; - print ''; - print '
'; - - print ''; } else if ($id > 0 || ! empty($ref)) { diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 82c722f2485..e6de0743d66 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -326,7 +326,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); /* - * Lignes de contacts + * Lines of contacts */ /* // Contacts lines (modules that overwrite templates must declare this into descriptor) @@ -340,16 +340,15 @@ if ($id > 0 || ! empty($ref)) /* * Add a new contact line - * Non affiche en mode modification de ligne */ print ''; if ($action != 'editline' && $user->rights->projet->creer) { print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print "\n"; @@ -507,7 +506,7 @@ if ($id > 0 || ! empty($ref)) { print ' '; print ''; - print img_delete(); + print img_picto($langs->trans('Unlink'), 'unlink'); print ''; } print ''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 73ce4a562e4..7b96d2e2ea1 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -333,12 +333,12 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } } else { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } print ''; @@ -580,7 +580,7 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } // Delete @@ -592,12 +592,12 @@ if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4ac6f8a4621..48167edcc1d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -400,7 +400,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; // Bill time - if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; print '
'.$langs->trans("Source").''.$langs->trans("Nature").''.$langs->trans("ThirdParty").''.$langs->trans("TaskContact").''.$langs->trans("Users").''.$langs->trans("ContactType").' 
'.$langs->trans("BillTime").''; print yn($projectstatic->bill_time); @@ -515,7 +515,10 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) // Planned workload print '
'.$langs->trans("PlannedWorkload").''; - print convertSecondToTime($object->planned_workload,'allhourmin'); + if ($object->planned_workload) + { + print convertSecondToTime($object->planned_workload,'allhourmin'); + } print '
'; @@ -528,7 +531,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) // Progress declared print '
'.$langs->trans("ProgressDeclared").''; - print $object->progress.' %'; + print $object->progress != '' ? $object->progress.' %' : ''; print '
'.fieldLabel('FirstName','firstname').'
'.$form->editfieldkey('FirstName', 'firstname', '', $object, 0).'
'.fieldLabel('UserTitle','civility_id').''; + print '
'.$form->editfieldkey('UserTitle', 'civility_id', '', $object, 0).''; print $formcompany->select_civility($object->civility_id, 'civility_id', 'maxwidth100').'
'.fieldLabel('ProspectCustomer','customerprospect',1).'
'.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''; $selected=GETPOST('client','int')!=''?GETPOST('client','int'):$object->client; print ''.fieldLabel('CustomerCode','customer_code').''; + print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; // Barcode if (! empty($conf->barcode->enabled)) { - print ''; + print ''; print ''; } // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1264,11 +1265,11 @@ else { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->socialnetworks->enabled)) @@ -1287,27 +1288,33 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; - print ''; + print ''; + print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; - print ''; + print ''; + print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; - print ''; + print ''; + print ''; } } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1322,7 +1329,7 @@ else if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - print ''; @@ -1334,11 +1341,11 @@ else if ($j % 2 == 1) print ''; // Vat is used - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; // Legal Form - print ''; + print ''; print ''; // Capital - print ''; + print ''; print ''; if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -1431,7 +1438,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1444,7 +1451,7 @@ else // Customer //if ($object->prospect || $object->client || (! $object->fournisseur && ! empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER))) { - print '"; @@ -1452,7 +1459,7 @@ else // Supplier //if ($object->fournisseur) { - print '"; @@ -1463,7 +1470,7 @@ else if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1478,18 +1485,18 @@ else print $object->showOptionals($extrafields,'edit'); } - // Assign a sale representative - print ''; - print ''; - print ''; + // Assign a sale representative + print ''; + print ''; + print ''; // Ajout du logo print ''; - print ''; + print ''; print ''; @@ -1736,7 +1743,7 @@ else } // Name - print ''; + print ''; print ''; // Alias names (commercial, trademark or alias names) @@ -1746,7 +1753,7 @@ else // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; print ''; - print ''; - print ''; + print ''; print ''; @@ -2626,7 +2629,7 @@ else else { $langs->load("mails"); - print ''; + print ''; } if ($user->rights->societe->creer) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 42d1d616852..50d9710be40 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -894,7 +894,7 @@ class Thirdparties extends DolibarrApi } - $sql = "SELECT f.facnumber, f.type as factype, re.fk_facture_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_facture, re.fk_facture_line"; + $sql = "SELECT f.ref, f.type as factype, re.fk_facture_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_facture, re.fk_facture_line"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re, ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE f.rowid = re.fk_facture_source AND re.fk_soc = ".$id; if ($filter == "available") $sql .= " AND re.fk_facture IS NULL AND re.fk_facture_line IS NULL"; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 3a3fb8507c9..c1a0605b2e1 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -200,13 +200,13 @@ if ($type_element == 'invoice') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $documentstatic=new Facture($db); - $sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, '; $tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d"; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_facture = f.rowid"; $where.= " AND f.entity = ".$conf->entity; $dateprint = 'f.datef'; - $doc_number='f.facnumber'; + $doc_number='f.ref'; $thirdTypeSelect='customer'; } if ($type_element == 'propal') diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index 97e6817f5d5..5d8936060ac 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -133,7 +133,7 @@ if ($socid) /* } else { - print ''.$langs->trans("AddProject").''; + print ''.$langs->trans("AddProject").''; } } diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 69dc4e33307..a7a2e56ecff 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -215,23 +215,23 @@ class ActionsStripeconnect } else { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } elseif ($resteapayer == 0) { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } else { - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } } elseif (is_object($object) && $object->element == 'invoice_supplier'){ - print ''.$langs->trans("StripeConnectPay").''; + print ''.$langs->trans("StripeConnectPay").''; } elseif (is_object($object) && $object->element == 'member'){ - print ''.$langs->trans("StripeAutoSubscription").''; + print ''.$langs->trans("StripeAutoSubscription").''; } return 0; } diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 7a06da294ab..a99104409ef 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -762,7 +762,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie * List of unpaid invoices */ - $sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type, '; + $sql = 'SELECT f.rowid as facid, f.ref, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type, '; $sql.= ' f.datef as df, f.fk_soc as socid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; @@ -789,7 +789,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Sort invoices by date and serial number: the older one comes first - $sql.=' ORDER BY f.datef ASC, f.facnumber ASC'; + $sql.=' ORDER BY f.datef ASC, f.ref ASC'; $resql = $db->query($sql); if ($resql) @@ -1073,7 +1073,7 @@ if (! GETPOST('action')) if (! $sortorder) $sortorder='DESC'; if (! $sortfield) $sortfield='p.datep'; - $sql = 'SELECT p.datep as dp, p.amount, f.amount as fa_amount, f.facnumber'; + $sql = 'SELECT p.datep as dp, p.amount, f.amount as fa_amount, f.ref'; $sql.=', f.rowid as facid, c.libelle as paiement_type, p.num_paiement'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'c_paiement as c'; $sql.= ' WHERE p.fk_facture = f.rowid AND p.fk_paiement = c.id'; @@ -1095,7 +1095,7 @@ if (! GETPOST('action')) print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num); print '
'; $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); @@ -1202,7 +1203,7 @@ else { // Supplier print '
'.fieldLabel('Supplier','fournisseur',1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; $default = -1; if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1; print $form->selectyesno("fournisseur", (GETPOST('fournisseur','int')!=''?GETPOST('fournisseur','int'):(GETPOST("type",'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type",'alpha') == '' ? 1 : 0)); @@ -1210,7 +1211,7 @@ else print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { - print fieldLabel('SupplierCode','supplier_code'); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) @@ -1228,33 +1229,33 @@ else } // Status - print '
'.fieldLabel('Status','status').''; + print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),1); print '
'.fieldLabel('Gencod','barcode').'
'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).''; print '
'.fieldLabel('Address','address').'
'.$form->editfieldkey('Address', 'address', '', $object, 0).'
'.fieldLabel('Zip','zipcode').''; + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); - print ''.fieldLabel('Town','town').''; + print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print '
'.fieldLabel('Country','selectcountry_id').''; + print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('Region-State','state_id').''; + print '
'.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } else { - print '
'.fieldLabel('State','state_id').''; + print '
'.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code); @@ -1277,9 +1278,9 @@ else } // Email / Web - print '
'.fieldLabel('EMail','email',$conf->global->SOCIETE_EMAIL_MANDATORY).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).'
'.fieldLabel('Web','url').'
'.$form->editfieldkey('Web', 'url', '', $object, 0).'
'.fieldLabel('Skype','skype').'skype).'">
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).''; + print 'skype).'">'; + print '
'.fieldLabel('Twitter','twitter').'twitter).'">
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).''; + print 'twitter).'">'; + print '
'.fieldLabel('Facebook','facebook').'facebook).'">
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; + print 'facebook).'">'; + print '
'.fieldLabel('Phone','phone').'
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).''.fieldLabel('Fax','fax').''.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.fieldLabel($idprof,$key, (empty($conf->global->$idprof_mandatory)?0:1)).''; + print ''.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', (empty($conf->global->$idprof_mandatory)?0:1)).''; print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
'.fieldLabel('VATIsUsed','assujtva_value').'
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; print $form->selectyesno('assujtva_value', GETPOSTISSET('assujtva_value')?GETPOST('assujtva_value','int'):1, 1); // Assujeti par defaut en creation print ''.fieldLabel('VATIntra','intra_vat').''.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).''; $s = ''; @@ -1391,18 +1398,18 @@ else } // Type - Size - print '
'.fieldLabel('ThirdPartyType','typent_id').''."\n"; + print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).''."\n"; $sortparam=(empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.fieldLabel('Staff','effectif_id').''; + print ''.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('JuridicalStatus','forme_juridique_code').'
'.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).''; if ($object->country_id) { @@ -1415,13 +1422,13 @@ else print '
'.fieldLabel('Capital','capital').'
'.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '; print ''.$langs->trans("Currency".$conf->currency).'
'.fieldLabel('DefaultLang','default_lang').''."\n"; + print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print $formadmin->select_language(($object->default_lang?$object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1,0,0,'maxwidth200onsmartphone'); print '
'.fieldLabel('IncotermLabel','incoterm_id').''.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
' . fieldLabel('CustomersProspectsCategoriesShort', 'custcats') . ''; + print '
' . $form->editfieldkey('CustomersProspectsCategoriesShort', 'custcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); print "
' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . ''; + print '
' . $form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, null, "90%"); print "
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
'.fieldLabel('AllocateCommercial','commercial_id').''; - $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); - // Note: If user has no right to "see all thirdparties", we for selection of sale representative to him, so after creation he can see the record. - print $form->multiselectarray('commercial', $userlist, (count(GETPOST('commercial', 'array')) > 0?GETPOST('commercial', 'array'):(empty($user->rights->societe->client->voir)?array($user->id):array())), null, null, null, null, "90%"); - print '
'.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).''; + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); + // Note: If user has no right to "see all thirdparties", we for selection of sale representative to him, so after creation he can see the record. + print $form->multiselectarray('commercial', $userlist, (count(GETPOST('commercial', 'array')) > 0?GETPOST('commercial', 'array'):(empty($user->rights->societe->client->voir)?array($user->id):array())), null, null, null, null, "90%"); + print '
'.fieldLabel('Logo','photoinput').''.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).''; print ''; print '
'.fieldLabel('ThirdPartyName','name',1).'
'.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0, 'string', '', 1).'
'.fieldLabel('Prefix','prefix').''; + print '
'.$form->editfieldkey('Prefix', 'prefix', '', $object, 0).''; // It does not change the prefix mode using the auto numbering prefix if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) { @@ -1761,14 +1768,14 @@ else } // Prospect/Customer - print '
'.fieldLabel('ProspectCustomer','customerprospect',1).'
'.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''.fieldLabel('CustomerCode','customer_code').''; + print ''.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; print ''; + print ''; print ''; } // Status - print ''; // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1872,11 +1879,11 @@ else { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->socialnetworks->enabled)) @@ -1894,27 +1901,27 @@ else // Skype if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) { - print ''; + print ''; print ''; } // Twitter if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) { - print ''; + print ''; print ''; } // Facebook if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) { - print ''; + print ''; print ''; } } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1929,12 +1936,8 @@ else if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - if (empty($conf->global->$idprof_mandatory) || ! $object->isACompany()) - print ''; if (($j % 2) == 1) print ''; $j++; @@ -1944,7 +1947,7 @@ else if ($j % 2 == 1) print ''; // VAT is used - print ''; @@ -1952,7 +1955,7 @@ else //TODO: Place into a function to control showing by country or study better option if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - print ''; - print ''; + print ''; print ''; // Type - Size - print ''; - print ''; // Juridical type - print ''; // Capital - print ''; + print ''; print ''; @@ -2051,7 +2054,7 @@ else // Default language if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -2061,7 +2064,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -2071,7 +2074,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { // Customer - print ''; + print ''; print '"; // Supplier - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -2118,15 +2121,15 @@ else // Webservices url/key if (!empty($conf->syncsupplierwebservices->enabled)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; } // Logo print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
'; if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto) @@ -1799,13 +1806,13 @@ else || (! empty($conf->supplier_proposal->enabled) && ! empty($user->rights->supplier_proposal->lire))) { print '
'.fieldLabel('Supplier','fournisseur',1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; print $form->selectyesno("fournisseur",$object->fournisseur,1); print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { - print fieldLabel('SupplierCode','supplier_code'); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print ''; if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) @@ -1838,31 +1845,31 @@ else // Barcode if (! empty($conf->barcode->enabled)) { - print '
'.fieldLabel('Gencod','barcode').'
'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).''; print '
'.fieldLabel('Status','status').''; + print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$object->status); print '
'.fieldLabel('Address','address').'
'.$form->editfieldkey('Address', 'address', '', $object, 0).'
'.fieldLabel('Zip','zipcode').''; + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth50onsmartphone'); - print ''.fieldLabel('Town','town').''; + print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '
'.fieldLabel('Country','selectcounty_id').''; + print '
'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('Region-State','state_id').''; + print '
'.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } else { - print '
'.fieldLabel('State','state_id').''; + print '
'.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } print $formcompany->select_state($object->state_id,$object->country_code); @@ -1884,9 +1891,9 @@ else } // EMail / Web - print '
'.fieldLabel('EMail','email',(! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', (! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
'.fieldLabel('Web','url').'
'.$form->editfieldkey('Web', 'url', '', $object, 0).'
'.fieldLabel('Skype','skype').'
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'
'.fieldLabel('Twitter','twitter').'
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'
'.fieldLabel('Facebook','facebook').'
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'
'.fieldLabel('Phone','phone').'
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).''.fieldLabel('Fax','fax').''.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.fieldLabel($idprof,$key).''; - else - print ''.fieldLabel($idprof,$key).''; - - print $formcompany->get_input_id_prof($i,$key,$object->$key,$object->country_code); + print ''.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', ! (empty($conf->global->$idprof_mandatory) || ! $object->isACompany())).''; + print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
'.fieldLabel('VATIsUsed','assujtva_value').''; + print '
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; print $form->selectyesno('assujtva_value',$object->tva_assuj,1); print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print '
'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code), 'localtax1assuj_value', '', $object, 0).''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1962,7 +1965,7 @@ else } print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print ''.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if (! isOnlyOneLocalTax(2)) { @@ -1974,7 +1977,7 @@ else } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { - print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print '
'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code), 'localtax1assuj_value', '', $object, 0).''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1986,7 +1989,7 @@ else } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { - print '
'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print '
'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if(! isOnlyOneLocalTax(2)) { @@ -1998,7 +2001,7 @@ else } // VAT Code - print '
'.fieldLabel('VATIntra','intra_vat').'
'.$form->editfieldkey('VATIntra', 'intra_vat', '', $object, 0).''; $s =''; @@ -2028,22 +2031,22 @@ else print '
'.fieldLabel('ThirdPartyType','typent_id').''; + print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).''; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.fieldLabel('Staff','effectif_id').''; + print ''.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id",$formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('JuridicalStatus','forme_juridique_code').''; + print '
'.$form->editfieldkey('JuridicalStatus', 'forme_juridique_code', '', $object, 0).''; print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code'); print '
'.fieldLabel('Capital','capital').'
'.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '.$langs->trans("Currency".$conf->currency).'
'.fieldLabel('DefaultLang','default_lang').''."\n"; + print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print $formadmin->select_language($object->default_lang,'default_lang',0,0,1); print '
'.fieldLabel('IncotermLabel','incoterm_id').''.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
' . fieldLabel('CustomersCategoriesShort', 'custcats') . '
' . $form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1); $c = new Categorie($db); @@ -2084,7 +2087,7 @@ else print "
' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . '
' . $form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0) . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); $c = new Categorie($db); @@ -2101,7 +2104,7 @@ else if (! empty($conf->multicurrency->enabled)) { print '
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
'.fieldLabel('WebServiceURL','webservices_url').'
'.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).''.fieldLabel('WebServiceKey','webservices_key').''.$form->editfieldkey('WebServiceKey', 'webservices_key', '', $object, 0).'
'.fieldLabel('Logo','photoinput').''.$form->editfieldkey('Logo', 'photoinput', '', $object, 0).''; if ($object->logo) print $form->showphoto('societe',$object); $caneditfield=1; @@ -2144,7 +2147,7 @@ else // Assign sale representative print '
'.fieldLabel('AllocateCommercial','commercial_id').''.$form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0).''; $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); $arrayselected = GETPOST('commercial', 'array'); @@ -2155,7 +2158,7 @@ else print '
'; print ''; - dol_fiche_end(); + dol_fiche_end(); print '
'; print ''; @@ -2524,7 +2527,7 @@ else if (! empty($conf->multicurrency->enabled)) { print '
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print !empty($object->multicurrency_code) ? currency_name($object->multicurrency_code,1) : ''; print '
'; print ''; - print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder); + print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'ref','','','',$sortfield,$sortorder); print_liste_field_titre('Date',$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder); print_liste_field_titre('Type',$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder); print_liste_field_titre('Amount',$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder); @@ -1106,7 +1106,7 @@ if (! GETPOST('action')) { $objp = $db->fetch_object($resql); print ''; - print '\n"; + print '\n"; print '\n"; print '\n"; print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 99e99517f75..b1133616eeb 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1169,10 +1169,9 @@ if ($action == 'create') } // Multicurrency - if (! empty($conf->multicurrency->enabled)) - { + if (! empty($conf->multicurrency->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1524,7 +1523,7 @@ if ($action == 'create') print ''; print '
'.$objp->facnumber."'.$objp->ref."'.dol_print_date($db->jdate($objp->dp))."'.$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount).' 
'.fieldLabel('Currency','multicurrency_code').''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '
'; print ''; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) print ''; @@ -1541,7 +1540,7 @@ if ($action == 'create') print ''; print '
'; - print fieldLabel('Currency','multicurrency_code'); + print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; print ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) print ''; @@ -1612,17 +1611,17 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; print ''; } @@ -1778,7 +1777,7 @@ if ($action == 'create') ) { if (count($object->lines) > 0) print ''; - // else print ''.$langs->trans('Validate').''; + // else print ''.$langs->trans('Validate').''; } // Edit @@ -1797,7 +1796,7 @@ if ($action == 'create') if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) { print ''; } else - print ''; + print ''; } // Create an order diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 795564984d4..5986ac65f14 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -396,6 +396,7 @@ if ($resql) // List of mass actions available $arrayofmassactions = array( + 'generate_doc'=>$langs->trans("Generate"), //'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); diff --git a/htdocs/takepos/customers.php b/htdocs/takepos/customers.php index 5a67998f180..41738861702 100644 --- a/htdocs/takepos/customers.php +++ b/htdocs/takepos/customers.php @@ -55,7 +55,7 @@ $_GET['optioncss'] = 'print'; */ if ($action=="change") { - $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where facnumber='(PROV-POS-".$place.")'"; + $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where ref='(PROV-POS-".$place.")'"; $resql = $db->query($sql); ?>
'; - print fieldLabel('CurrencyRate','multicurrency_tx'); + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
' . $form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
' . $form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
' . $form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '