diff --git a/dev/initdemo/documents_demo/adherent/1/photos/person5.jpeg b/dev/initdemo/documents_demo/adherent/1/photos/person5.jpeg index 3d541f760b8..83c7ff089cf 100644 Binary files a/dev/initdemo/documents_demo/adherent/1/photos/person5.jpeg and b/dev/initdemo/documents_demo/adherent/1/photos/person5.jpeg differ diff --git a/dev/initdemo/documents_demo/adherent/3/photos/person9.jpeg b/dev/initdemo/documents_demo/adherent/3/photos/person9.jpeg index 7aff8dccefe..704d18fbbf3 100644 Binary files a/dev/initdemo/documents_demo/adherent/3/photos/person9.jpeg and b/dev/initdemo/documents_demo/adherent/3/photos/person9.jpeg differ diff --git a/dev/initdemo/documents_demo/adherent/4/photos/person2.jpeg b/dev/initdemo/documents_demo/adherent/4/photos/person2.jpeg index 285010bb7b3..7f5f5a9a57b 100644 Binary files a/dev/initdemo/documents_demo/adherent/4/photos/person2.jpeg and b/dev/initdemo/documents_demo/adherent/4/photos/person2.jpeg differ diff --git a/dev/initdemo/documents_demo/societe/12/courrier_consult.odt b/dev/initdemo/documents_demo/societe/12/courrier_consult.odt new file mode 100644 index 00000000000..cbb3625d922 Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/courrier_consult.odt differ diff --git a/dev/initdemo/documents_demo/societe/12/logos/person8.jpeg b/dev/initdemo/documents_demo/societe/12/logos/person8.jpeg new file mode 100644 index 00000000000..2ae5d48084e Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/logos/person8.jpeg differ diff --git a/dev/initdemo/documents_demo/societe/12/logos/pierrecurie.jpg b/dev/initdemo/documents_demo/societe/12/logos/pierrecurie.jpg deleted file mode 100644 index 8ea6696ba45..00000000000 Binary files a/dev/initdemo/documents_demo/societe/12/logos/pierrecurie.jpg and /dev/null differ diff --git a/dev/initdemo/documents_demo/societe/12/logos/thumbs/person8_mini.jpeg b/dev/initdemo/documents_demo/societe/12/logos/thumbs/person8_mini.jpeg new file mode 100644 index 00000000000..399283ee190 Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/logos/thumbs/person8_mini.jpeg differ diff --git a/dev/initdemo/documents_demo/societe/12/logos/thumbs/person8_small.jpeg b/dev/initdemo/documents_demo/societe/12/logos/thumbs/person8_small.jpeg new file mode 100644 index 00000000000..1771772de3f Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/logos/thumbs/person8_small.jpeg differ diff --git a/dev/initdemo/documents_demo/societe/12/logos/thumbs/pierrecurie_mini.jpg b/dev/initdemo/documents_demo/societe/12/logos/thumbs/pierrecurie_mini.jpg deleted file mode 100644 index d97331762a8..00000000000 Binary files a/dev/initdemo/documents_demo/societe/12/logos/thumbs/pierrecurie_mini.jpg and /dev/null differ diff --git a/dev/initdemo/documents_demo/societe/12/logos/thumbs/pierrecurie_small.jpg b/dev/initdemo/documents_demo/societe/12/logos/thumbs/pierrecurie_small.jpg deleted file mode 100644 index 3595b041ca2..00000000000 Binary files a/dev/initdemo/documents_demo/societe/12/logos/thumbs/pierrecurie_small.jpg and /dev/null differ diff --git a/dev/initdemo/documents_demo/societe/12/radiography1.jpg b/dev/initdemo/documents_demo/societe/12/radiography1.jpg new file mode 100644 index 00000000000..1f6d672f250 Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/radiography1.jpg differ diff --git a/dev/initdemo/documents_demo/societe/12/radiography2-knee.jpg b/dev/initdemo/documents_demo/societe/12/radiography2-knee.jpg new file mode 100644 index 00000000000..adb5a6e2190 Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/radiography2-knee.jpg differ diff --git a/dev/initdemo/documents_demo/societe/12/thumbs/radiography1_mini.jpg b/dev/initdemo/documents_demo/societe/12/thumbs/radiography1_mini.jpg new file mode 100644 index 00000000000..488b057073a Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/thumbs/radiography1_mini.jpg differ diff --git a/dev/initdemo/documents_demo/societe/12/thumbs/radiography1_small.jpg b/dev/initdemo/documents_demo/societe/12/thumbs/radiography1_small.jpg new file mode 100644 index 00000000000..f0bd4e695e4 Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/thumbs/radiography1_small.jpg differ diff --git a/dev/initdemo/documents_demo/societe/12/thumbs/radiography2-knee_mini.jpg b/dev/initdemo/documents_demo/societe/12/thumbs/radiography2-knee_mini.jpg new file mode 100644 index 00000000000..c5640c504aa Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/thumbs/radiography2-knee_mini.jpg differ diff --git a/dev/initdemo/documents_demo/societe/12/thumbs/radiography2-knee_small.jpg b/dev/initdemo/documents_demo/societe/12/thumbs/radiography2-knee_small.jpg new file mode 100644 index 00000000000..95d4426a1b7 Binary files /dev/null and b/dev/initdemo/documents_demo/societe/12/thumbs/radiography2-knee_small.jpg differ diff --git a/dev/initdemo/documents_demo/users/11/person4.jpeg b/dev/initdemo/documents_demo/users/11/person4.jpeg index b3f67d8f2ce..4e3df4e1c2b 100644 Binary files a/dev/initdemo/documents_demo/users/11/person4.jpeg and b/dev/initdemo/documents_demo/users/11/person4.jpeg differ diff --git a/dev/initdemo/documents_demo/users/12/person6.jpeg b/dev/initdemo/documents_demo/users/12/person6.jpeg index 0be42700a41..ba2d1f4e7b2 100644 Binary files a/dev/initdemo/documents_demo/users/12/person6.jpeg and b/dev/initdemo/documents_demo/users/12/person6.jpeg differ diff --git a/dev/initdemo/documents_demo/users/13/person7.jpeg b/dev/initdemo/documents_demo/users/13/person7.jpeg index 12e84e95b5f..cb5c34b7089 100644 Binary files a/dev/initdemo/documents_demo/users/13/person7.jpeg and b/dev/initdemo/documents_demo/users/13/person7.jpeg differ diff --git a/dev/initdemo/documents_demo/users/14/person3.jpeg b/dev/initdemo/documents_demo/users/14/person3.jpeg index c53c4cb9bf9..d9facac130f 100644 Binary files a/dev/initdemo/documents_demo/users/14/person3.jpeg and b/dev/initdemo/documents_demo/users/14/person3.jpeg differ diff --git a/dev/initdemo/documents_demo/users/16/person1.jpeg b/dev/initdemo/documents_demo/users/16/person1.jpeg index 4eb94e3d5c6..bc6341953e8 100644 Binary files a/dev/initdemo/documents_demo/users/16/person1.jpeg and b/dev/initdemo/documents_demo/users/16/person1.jpeg differ diff --git a/dev/initdemo/documents_demo/users/17/person5.jpeg b/dev/initdemo/documents_demo/users/17/person5.jpeg index 3d541f760b8..83c7ff089cf 100644 Binary files a/dev/initdemo/documents_demo/users/17/person5.jpeg and b/dev/initdemo/documents_demo/users/17/person5.jpeg differ diff --git a/dev/initdemo/documents_demo/users/19/person2.jpeg b/dev/initdemo/documents_demo/users/19/person2.jpeg index 285010bb7b3..7f5f5a9a57b 100644 Binary files a/dev/initdemo/documents_demo/users/19/person2.jpeg and b/dev/initdemo/documents_demo/users/19/person2.jpeg differ diff --git a/dev/initdemo/documents_demo/users/2/person9.jpeg b/dev/initdemo/documents_demo/users/2/person9.jpeg index 7aff8dccefe..704d18fbbf3 100644 Binary files a/dev/initdemo/documents_demo/users/2/person9.jpeg and b/dev/initdemo/documents_demo/users/2/person9.jpeg differ diff --git a/dev/initdemo/documents_demo/users/4/person8.jpeg b/dev/initdemo/documents_demo/users/4/person8.jpeg index 33227fc3616..3379605c0c9 100644 Binary files a/dev/initdemo/documents_demo/users/4/person8.jpeg and b/dev/initdemo/documents_demo/users/4/person8.jpeg differ diff --git a/dev/initdemo/savedemo.sh b/dev/initdemo/savedemo.sh index cfcdcea6f70..424fed6c468 100755 --- a/dev/initdemo/savedemo.sh +++ b/dev/initdemo/savedemo.sh @@ -245,18 +245,6 @@ export list=" --ignore-table=$base.llx_c_ticketsup_category --ignore-table=$base.llx_c_ticketsup_severity --ignore-table=$base.llx_c_ticketsup_type - --ignore-table=$base.llx_cabinetmed_c_banques - --ignore-table=$base.llx_cabinetmed_c_ccam - --ignore-table=$base.llx_cabinetmed_c_examconclusion - --ignore-table=$base.llx_cabinetmed_cons - --ignore-table=$base.llx_cabinetmed_cons_extrafields - --ignore-table=$base.llx_cabinetmed_diaglec - --ignore-table=$base.llx_cabinetmed_examaut - --ignore-table=$base.llx_cabinetmed_exambio - --ignore-table=$base.llx_cabinetmed_examenprescrit - --ignore-table=$base.llx_cabinetmed_motifcons - --ignore-table=$base.llx_cabinetmed_patient - --ignore-table=$base.llx_cabinetmed_societe --ignore-table=$base.llx_congespayes --ignore-table=$base.llx_congespayes_config --ignore-table=$base.llx_congespayes_events @@ -300,6 +288,7 @@ export list=" --ignore-table=$base.llx_m_extrafields --ignore-table=$base.llx_monmodule_abcdef --ignore-table=$base.llx_notes + --ignore-table=$base.llx_packages --ignore-table=$base.llx_pos_cash --ignore-table=$base.llx_pos_control_cash --ignore-table=$base.llx_pos_facture @@ -316,6 +305,7 @@ export list=" --ignore-table=$base.llx_residence_building --ignore-table=$base.llx_residence_building_links --ignore-table=$base.llx_societe_rib2 + --ignore-table=$base.llx_sellyoursaas_cancellation --ignore-table=$base.llx_ticketsup --ignore-table=$base.llx_ultimatepdf --ignore-table=$base.llx_update_modules diff --git a/dev/translation/txpull.sh b/dev/translation/txpull.sh index 0f8906353bd..c85ea12728b 100755 --- a/dev/translation/txpull.sh +++ b/dev/translation/txpull.sh @@ -7,6 +7,9 @@ # Usage: txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] #------------------------------------------------------ +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd $DIR/../.. + # Syntax if [ "x$1" = "x" ] then diff --git a/dev/translation/txpush.sh b/dev/translation/txpush.sh index 339b24d2c30..428f7b8cbc2 100755 --- a/dev/translation/txpush.sh +++ b/dev/translation/txpush.sh @@ -9,6 +9,9 @@ export project='dolibarr' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd $DIR/../.. + # Syntax if [ "x$1" = "x" ] then diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 455c6181552..f012ce3a571 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1072,16 +1072,10 @@ else // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - //Hooks here - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (empty($reshook)) - { - print $object->showOptionals($extrafields, 'edit', $parameters); - } print ''; print "\n"; + dol_fiche_end(); print '
'; @@ -1769,7 +1763,7 @@ else /* - * Hotbar + * Action bar */ print '
'; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 2e26e3709ed..3d1885799c3 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -71,7 +71,6 @@ $adht = new AdherentType($db); $extrafields->fetch_name_optionals_label($object->table_element); $errmsg = ''; -$errmsgs = array(); $defaultdelay = 1; $defaultdelayunit = 'y'; @@ -687,20 +686,19 @@ if ($rowid > 0) $subscriptionstatic = new Subscription($db); $num = $db->num_rows($result); - $i = 0; print ''."\n"; print ''; print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder); - print ''; - print ''; - print ''; - print ''; - print ''; + print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); if (!empty($conf->banque->enabled)) { - print ''; + print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); } print "\n"; @@ -708,6 +706,7 @@ if ($rowid > 0) $adh = new Adherent($db); $adht = new AdherentType($db); + $i = 0; while ($i < $num) { $objp = $db->fetch_object($result); @@ -766,6 +765,13 @@ if ($rowid > 0) print ""; $i++; } + + if (empty($num)) { + $colspan = 6; + if (!empty($conf->banque->enabled)) $colspan++; + print ''; + } + print "
'.$langs->trans("DateCreation").''.$langs->trans("Type").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$langs->trans("Account").'
'.$langs->trans("None").'
"; } else @@ -1002,7 +1008,7 @@ if ($rowid > 0) print $langs->trans("CreateDolibarrThirdParty"); print ')'; } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0); + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { $prodtmp = new Product($db); @@ -1027,7 +1033,7 @@ if ($rowid > 0) print $langs->trans("CreateDolibarrThirdParty"); print ')'; } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0); + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { $prodtmp = new Product($db); @@ -1070,9 +1076,9 @@ if ($rowid > 0) } } - print ' '; + print ''; - print ''.$langs->trans("SendAcknowledgementByMail").''; + print ''.$langs->trans("SendAcknowledgementByMail").''; print ''; if (!$object->email) { @@ -1117,11 +1123,20 @@ if ($rowid > 0) $helpcontent .= ''.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.'
'."\n"; $helpcontent .= ''.$langs->trans("MailRecipient").': '.$object->email.'
'."\n"; $helpcontent .= ''.$langs->trans("MailTopic").':
'."\n"; - $helpcontent .= $subjecttosend."\n"; + if ($subjecttosend) { + $helpcontent .= $subjecttosend."\n"; + } else { + $langs->load("errors"); + $helpcontent .= ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Module310Name")).''."\n"; + } $helpcontent .= "
"; $helpcontent .= ''.$langs->trans("MailText").':
'; - $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; - + if ($texttosend) { + $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; + } else { + $langs->load("errors"); + $helpcontent .= ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Module310Name")).''."\n"; + } print $form->textwithpicto($tmp, $helpcontent, 1, 'help', '', 0, 2, 'helpemailtosend'); } print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 92144f50934..765502075c2 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1052,7 +1052,7 @@ if ($action == 'create') $numproject = $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   '.$langs->trans("AddProject").''; + print ' '; $urloption = '?action=create'; $url = dol_buildpath('comm/action/card.php', 2).$urloption; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e6b1b47d0b6..cc69ecd0c6c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1475,9 +1475,10 @@ if ($action == 'create') { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; + $regs = array(); if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { - $element = $regs [1]; - $subelement = $regs [2]; + $element = $regs[1]; + $subelement = $regs[2]; } if ($element == 'project') { @@ -1675,7 +1676,7 @@ if ($action == 'create') print ''; print ''.$langs->trans("Project").''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id).'">'; + print ' id).'">'; print ''; print ''; } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index e5f84bbec77..70f9846bd6b 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -61,9 +61,9 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) - $amount_ttc_1 = GETPOST('amount_ttc_1'); + $amount_ttc_1 = GETPOST('amount_ttc_1', 'alpha'); $amount_ttc_1 = price2num($amount_ttc_1); - $amount_ttc_2 = GETPOST('amount_ttc_2'); + $amount_ttc_2 = GETPOST('amount_ttc_2', 'alpha'); $amount_ttc_2 = price2num($amount_ttc_2); $error = 0; @@ -252,7 +252,7 @@ if ($socid > 0) print ''; print ''; - dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), -1, 'company'); dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); @@ -273,7 +273,7 @@ if ($socid > 0) } - print ''; + print '
'; if ($isCustomer) { // Calcul avoirs client en cours $remise_all = $remise_user = 0; @@ -342,13 +342,15 @@ if ($socid > 0) print ''; + dol_fiche_end(); + + if ($user->rights->societe->creer) { print '
'; print load_fiche_titre($langs->trans("NewGlobalDiscount"), '', ''); - print '
'; if ($isCustomer && !$isSupplier) { print ''; @@ -358,6 +360,8 @@ if ($socid > 0) print ''; } + dol_fiche_head(); + print '
'; if ($isCustomer && $isSupplier) { print ''; @@ -376,9 +380,9 @@ if ($socid > 0) print ''; print "
'.$langs->trans('DiscountType').'
"; - } - dol_fiche_end(); + dol_fiche_end(); + } if ($user->rights->societe->creer) { @@ -404,7 +408,7 @@ if ($socid > 0) /* - * Liste remises fixes client restant en cours (= liees a aucune facture ni ligne de facture) + * List remises fixes client restant en cours (= liees a aucune facture ni ligne de facture) */ print load_fiche_titre($langs->trans("DiscountStillRemaining")); @@ -511,15 +515,14 @@ if ($socid > 0) { print ''.price($obj->multicurrency_amount_ttc).''; } - print ''; + print ''; print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''; print ''; if ($user->rights->societe->creer || $user->rights->facture->creer) { - print ''; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; - //print '   '; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; + print ''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ''; } else print ' '; @@ -535,7 +538,9 @@ if ($socid > 0) } else { - print ''.$langs->trans("None").''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan+=2; + print ''.$langs->trans("None").''; } $db->free($resql); print ""; @@ -551,7 +556,7 @@ if ($socid > 0) array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, '', 0); } } else @@ -672,9 +677,8 @@ if ($socid > 0) if ($user->rights->societe->creer || $user->rights->facture->creer) { print ''; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; - //print '   '; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ''; } else print ' '; @@ -690,7 +694,9 @@ if ($socid > 0) } else { - print ''.$langs->trans("None").''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan+=2; + print ''.$langs->trans("None").''; } $db->free($resql); print ""; @@ -701,9 +707,9 @@ if ($socid > 0) $amount1 = price2num($showconfirminfo['amount_ttc'] / 2, 'MT'); $amount2 = ($showconfirminfo['amount_ttc'] - $amount1); $formquestion = array( - 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), - array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), - array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') + 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), + array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), + array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); @@ -738,7 +744,7 @@ if ($socid > 0) // Discount linked to invoice lines $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; - $sql .= " rc.fk_facture_source,"; + $sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture_source,"; $sql .= " u.login, u.rowid as user_id,"; $sql .= " f.rowid as invoiceid, f.ref,"; $sql .= " fa.ref as invoice_source_ref, fa.type as type"; @@ -890,7 +896,9 @@ if ($socid > 0) } else { - print ''.$langs->trans("None").''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan+=2; + print ''.$langs->trans("None").''; } print ""; @@ -1064,7 +1072,9 @@ if ($socid > 0) } else { - print ''.$langs->trans("None").''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan+=2; + print ''.$langs->trans("None").''; } print ""; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8d43c54cc7c..97668dcba69 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1642,7 +1642,7 @@ if ($action == 'create' && $usercancreate) }); '; } - print ' '.$langs->trans("AddThirdParty").''; + print ' '; print ''; } print ''."\n"; @@ -1734,7 +1734,7 @@ if ($action == 'create' && $usercancreate) print ''; print ''.$langs->trans("Project").''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0); - print '   id).'">'.$langs->trans("AddProject").''; + print ' id).'">'; print ''; print ''; } diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 2ba96a2cf8d..2897eb6e5c3 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -492,11 +492,11 @@ if ($action == 'create') $content = $object->code_guichet; } elseif ($val == 'BankAccountNumber') { $name = 'number'; - $sizecss = 'minwidth200'; + $sizecss = 'minwidth200'; $content = $object->number; } elseif ($val == 'BankAccountNumberKey') { $name = 'cle_rib'; - $sizecss = 'minwidth50'; + $sizecss = 'minwidth50'; $content = $object->cle_rib; } @@ -923,7 +923,7 @@ else $cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT); if (is_array($cats)) { - foreach($cats as $cat) { + foreach ($cats as $cat) { $arrayselected[] = $cat->id; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 14a4f4bae9b..9751f667b46 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2801,7 +2801,7 @@ if ($action == 'create') }); '; } - if (!GETPOST('fac_rec', 'int')) print ' '.$langs->trans("AddThirdParty").''; + if (!GETPOST('fac_rec', 'int')) print ' '; print ''; print ''."\n"; } @@ -3008,7 +3008,7 @@ if ($action == 'create') print '
'; $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; @@ -3016,7 +3016,7 @@ if ($action == 'create') print '
'; $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; @@ -3025,7 +3025,7 @@ if ($action == 'create') print '
'; $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; @@ -3114,7 +3114,7 @@ if ($action == 'create') if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp = ' '; else $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); print $desc; print '
'."\n"; @@ -3211,7 +3211,6 @@ if ($action == 'create') $rwStyle = ''; } - $retained_warranty = GETPOST('retained_warranty', 'int'); $retained_warranty = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; print ''.$langs->trans('RetainedWarranty').''; @@ -3260,7 +3259,7 @@ if ($action == 'create') $langs->load('projects'); print ''.$langs->trans('Project').''; $numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'.$langs->trans("AddProject").''; + print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; print ''; } diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index d449e7a8424..29bb1c24dce 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -28,7 +28,7 @@ */ class DolEditor { - public $tool; // Store the selected tool + public $tool; // Store the selected tool // If using fckeditor public $editor; @@ -66,55 +66,55 @@ class DolEditor */ public function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = true, $okforextendededitor = true, $rows = 0, $cols = 0, $readonly = 0) { - global $conf,$langs; + global $conf, $langs; dol_syslog(get_class($this)."::DolEditor htmlname=".$htmlname." width=".$width." height=".$height." toolbarname=".$toolbarname); - if (! $rows) $rows=round($height/20); - if (! $cols) $cols=($width?round($width/6):80); - $shorttoolbarname=preg_replace('/_encoded$/', '', $toolbarname); + if (!$rows) $rows = round($height / 20); + if (!$cols) $cols = ($width ?round($width / 6) : 80); + $shorttoolbarname = preg_replace('/_encoded$/', '', $toolbarname); // Name of extended editor to use (FCKEDITOR_EDITORNAME can be 'ckeditor' or 'fckeditor') - $defaulteditor='ckeditor'; - $this->tool=empty($conf->global->FCKEDITOR_EDITORNAME)?$defaulteditor:$conf->global->FCKEDITOR_EDITORNAME; - $this->uselocalbrowser=$uselocalbrowser; - $this->readonly=$readonly; + $defaulteditor = 'ckeditor'; + $this->tool = empty($conf->global->FCKEDITOR_EDITORNAME) ? $defaulteditor : $conf->global->FCKEDITOR_EDITORNAME; + $this->uselocalbrowser = $uselocalbrowser; + $this->readonly = $readonly; // Check if extended editor is ok. If not we force textarea if ((empty($conf->fckeditor->enabled) && $okforextendededitor != 'ace') || empty($okforextendededitor)) $this->tool = 'textarea'; - if ($okforextendededitor === 'ace') $this->tool='ace'; + if ($okforextendededitor === 'ace') $this->tool = 'ace'; //if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // ckeditor and ace seems ok with mobile // Define content and some properties if ($this->tool == 'ckeditor') { - $content=dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. + $content = dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. } if ($this->tool == 'fckeditor') { require_once DOL_DOCUMENT_ROOT.'/includes/fckeditor/fckeditor.php'; - $content=dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. + $content = dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. $this->editor = new FCKeditor($htmlname); - $this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/' ; - $this->editor->Value = $content; + $this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/'; + $this->editor->Value = $content; $this->editor->Height = $height; - if (! empty($width)) $this->editor->Width = $width; - $this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js - $this->editor->Config['AutoDetectLanguage'] = 'true'; // Language of user (browser) + if (!empty($width)) $this->editor->Width = $width; + $this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js + $this->editor->Config['AutoDetectLanguage'] = 'true'; // Language of user (browser) $this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In'; $this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded; // Rem: Le forcage de ces 2 parametres ne semble pas fonctionner. // Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart. // Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ? - $modulepart='fckeditor'; + $modulepart = 'fckeditor'; $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file='; - $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ; + $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/'; - $this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false'); - $this->editor->Config['ImageBrowser']=($uselocalbrowser?'true':'false'); + $this->editor->Config['LinkBrowser'] = ($uselocalbrowser ? 'true' : 'false'); + $this->editor->Config['ImageBrowser'] = ($uselocalbrowser ? 'true' : 'false'); if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js')) { @@ -124,15 +124,15 @@ class DolEditor } // Define some properties - if (in_array($this->tool, array('textarea','ckeditor','ace'))) + if (in_array($this->tool, array('textarea', 'ckeditor', 'ace'))) { - $this->content = $content; + $this->content = $content; $this->htmlname = $htmlname; - $this->toolbarname = $shorttoolbarname; + $this->toolbarname = $shorttoolbarname; $this->toolbarstartexpanded = $toolbarstartexpanded; $this->rows = max(ROWS_3, $rows); - $this->cols = (preg_match('/%/', $cols)?$cols:max(40, $cols)); // If $cols is a percent, we keep it, otherwise, we take max - $this->height = $height; + $this->cols = (preg_match('/%/', $cols) ? $cols : max(40, $cols)); // If $cols is a percent, we keep it, otherwise, we take max + $this->height = $height; $this->width = $width; } } @@ -152,45 +152,45 @@ class DolEditor public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '') { // phpcs:enable - global $conf,$langs; + global $conf, $langs; - $fullpage=false; + $fullpage = false; if (isset($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT)) { - $disallowAnyContent=empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed or all + $disallowAnyContent = empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed or all } - $found=0; - $out=''; + $found = 0; + $out = ''; if ($this->tool == 'fckeditor') // not used anymore { - $found=1; + $found = 1; $this->editor->Create(); } - if (in_array($this->tool, array('textarea','ckeditor'))) + if (in_array($this->tool, array('textarea', 'ckeditor'))) { - $found=1; + $found = 1; //$out.= ''; + $out .= ''; - if ($this->tool == 'ckeditor' && ! empty($conf->use_javascript_ajax) && ! empty($conf->fckeditor->enabled)) + if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && !empty($conf->fckeditor->enabled)) { - if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR', '1'); + if (!defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR', '1'); - if (! empty($conf->global->FCKEDITOR_SKIN)) { + if (!empty($conf->global->FCKEDITOR_SKIN)) { $skin = $conf->global->FCKEDITOR_SKIN; } else { $skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa } - $htmlencode_force=preg_match('/_encoded$/', $this->toolbarname)?'true':'false'; + $htmlencode_force = preg_match('/_encoded$/', $this->toolbarname) ? 'true' : 'false'; - $out.= ''."\n"; - $out.= ''."\n"; + $out .= ' })'.$morejs; + $out .= '});'."\n"; + $out .= ''."\n"; } } @@ -259,19 +259,19 @@ class DolEditor // Warning: ace.js and ext-statusbar.js must be loaded by the parent page. if (preg_match('/^ace/', $this->tool)) { - $found=1; - $format=$option; + $found = 1; + $format = $option; - $out.= "\n".''."\n"; + $out .= "\n".''."\n"; if ($titlecontent) { - $out.= '
'.$titlecontent; - $out.= '   -   '.dol_escape_htmltag($langs->trans("ShowMoreLines")).'     '; - $out.= '
'; - $out.= ''."\n"; + $out .= ''."\n"; } - $out.= '
htmlname.'aceeditorid" style="'.($this->width ? 'width: '.$this->width.'px; ' : '');
+            $out .= ($this->height ? ' height: '.$this->height.'px; ' : '');
             //$out.=" min-height: 100px;";
-            $out.= '">';
-        	$out.= htmlspecialchars($this->content);
-        	$out.= '
'; - $out.= ''; + $out .= '">'; + $out .= htmlspecialchars($this->content); + $out .= ''; + $out .= ''; - $out.= ''."\n"; + $out .= ''."\n"; } if (empty($found)) { - $out.= 'Error, unknown value for tool '.$this->tool.' in DolEditor Create function.'; + $out .= 'Error, unknown value for tool '.$this->tool.' in DolEditor Create function.'; } if ($noprint) return $out; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 23d7e88b45b..57b29e78647 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4117,7 +4117,9 @@ class Form // Now add questions $more .= '
'."\n"; - if (!empty($formquestion['text'])) $more .= ''.$formquestion['text'].''."\n"; + if (!empty($formquestion['text'])) { + $more .= '
'.$formquestion['text'].'
'."\n"; + } foreach ($formquestion as $key => $input) { if (is_array($input) && !empty($input)) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index cdea1c17e01..117af9e8f19 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -376,33 +376,33 @@ class FormTicket } $out = ''; - $out .= '' . $langs->trans("MailFile") . ''; + $out .= ''.$langs->trans("MailFile").''; $out .= ''; // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out .= '' . "\n"; + $out .= ''."\n"; $out .= '' . "\n"; + $out .= ''."\n"; if (count($listofpaths)) { foreach ($listofpaths as $key => $val) { - $out .= '
'; - $out .= img_mime($listofnames[$key]) . ' ' . $listofnames[$key]; + $out .= '
'; + $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; if (!$this->withfilereadonly) { - $out .= ' '; + $out .= ' '; } $out .= '
'; } } else { - $out .= $langs->trans("NoAttachedFiles") . '
'; + $out .= $langs->trans("NoAttachedFiles").'
'; } if ($this->withfile == 2) { // Can add other files - $out .= ''; + $out .= ''; $out .= ' '; - $out .= ''; + $out .= ''; } $out .= "\n"; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 28821f31725..455ae851a54 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -200,7 +200,7 @@ class DoliDBPgsql extends DoliDB } if (preg_match('/[\s\t\(]*(\w*)[\s\t]+bigint.*auto_increment/i', $line, $reg)) { - $newline=preg_replace('/([\s\t\(]*)([a-zA-Z_0-9]*)[\s\t]+int.*auto_increment[^,]*/i', '\\1 \\2 BIGSERIAL PRIMARY KEY', $line); + $newline=preg_replace('/([\s\t\(]*)([a-zA-Z_0-9]*)[\s\t]+bigint.*auto_increment[^,]*/i', '\\1 \\2 BIGSERIAL PRIMARY KEY', $line); //$line = "-- ".$line." replaced by --\n".$newline; $line=$newline; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 59037d18525..6306162af34 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3081,7 +3081,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'project'=>'sitemap', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'object_bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar', - 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork', + 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-branch', 'object_list'=>'list-alt', 'object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt' diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index da1abe47268..69b907036c1 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -23,8 +23,8 @@ */ // Define size of logo small and mini -$maxwidthsmall=270;$maxheightsmall=150; -$maxwidthmini=128;$maxheightmini=72; +$maxwidthsmall = 270; $maxheightsmall = 150; +$maxwidthmini = 128; $maxheightmini = 72; $quality = 80; @@ -37,14 +37,14 @@ $quality = 80; */ function image_format_supported($file) { - $regeximgext='\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.xpm|\.xbm|\.svg'; // See also into product.class.php + $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.xpm|\.xbm|\.svg'; // See also into product.class.php // Case filename is not a format image $reg = array(); - if (! preg_match('/('.$regeximgext.')$/i', $file, $reg)) return -1; + if (!preg_match('/('.$regeximgext.')$/i', $file, $reg)) return -1; // Case filename is a format image but not supported by this PHP - $imgfonction=''; + $imgfonction = ''; if (strtolower($reg[1]) == '.gif') $imgfonction = 'imagecreatefromgif'; if (strtolower($reg[1]) == '.png') $imgfonction = 'imagecreatefrompng'; if (strtolower($reg[1]) == '.jpg') $imgfonction = 'imagecreatefromjpeg'; @@ -52,10 +52,10 @@ function image_format_supported($file) if (strtolower($reg[1]) == '.bmp') $imgfonction = 'imagecreatefromwbmp'; if (strtolower($reg[1]) == '.xpm') $imgfonction = 'imagecreatefromxpm'; if (strtolower($reg[1]) == '.xbm') $imgfonction = 'imagecreatefromxbm'; - if (strtolower($reg[1]) == '.svg') $imgfonction = 'imagecreatefromsvg'; // Never available + if (strtolower($reg[1]) == '.svg') $imgfonction = 'imagecreatefromsvg'; // Never available if ($imgfonction) { - if (! function_exists($imgfonction)) + if (!function_exists($imgfonction)) { // Fonctions de conversion non presente dans ce PHP return 0; @@ -76,21 +76,21 @@ function image_format_supported($file) */ function dol_getImageSize($file, $url = false) { - $ret=array(); + $ret = array(); if (image_format_supported($file) < 0) return $ret; $filetoread = $file; if (!$url) { - $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image + $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image } if ($filetoread) { $infoImg = getimagesize($filetoread); // Recuperation des infos de l'image - $ret['width']=$infoImg[0]; // Largeur de l'image - $ret['height']=$infoImg[1]; // Hauteur de l'image + $ret['width'] = $infoImg[0]; // Largeur de l'image + $ret['height'] = $infoImg[1]; // Hauteur de l'image } return $ret; @@ -112,29 +112,29 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - global $conf,$langs; + global $conf, $langs; dol_syslog("dol_imageResizeOrCrop file=".$file." mode=".$mode." newWidth=".$newWidth." newHeight=".$newHeight." src_x=".$src_x." src_y=".$src_y); // Clean parameters - $file=trim($file); + $file = trim($file); // Check parameters - if (! $file) + if (!$file) { // Si le fichier n'a pas ete indique return 'Bad parameter file'; } - elseif (! file_exists($file)) + elseif (!file_exists($file)) { // Si le fichier passe en parametre n'existe pas return $langs->trans("ErrorFileNotFound", $file); } - elseif(image_format_supported($file) < 0) + elseif (image_format_supported($file) < 0) { return 'This filename '.$file.' does not seem to be an image filename.'; } - elseif(!is_numeric($newWidth) && !is_numeric($newHeight)) + elseif (!is_numeric($newWidth) && !is_numeric($newHeight)) { return 'Wrong value for parameter newWidth or newHeight'; } @@ -147,7 +147,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, return 'Both newHeight or newWidth must be defined for croping'; } - $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image + $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image $infoImg = getimagesize($filetoread); // Recuperation des infos de l'image $imgWidth = $infoImg[0]; // Largeur de l'image @@ -155,18 +155,18 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, if ($mode == 0) // If resize, we check parameters { - if ($newWidth <= 0) + if ($newWidth <= 0) { - $newWidth=intval(($newHeight / $imgHeight) * $imgWidth); // Keep ratio + $newWidth = intval(($newHeight / $imgHeight) * $imgWidth); // Keep ratio } if ($newHeight <= 0) { - $newHeight=intval(($newWidth / $imgWidth) * $imgHeight); // Keep ratio + $newHeight = intval(($newWidth / $imgWidth) * $imgHeight); // Keep ratio } } - $imgfonction=''; - switch($infoImg[2]) + $imgfonction = ''; + switch ($infoImg[2]) { case 1: // IMG_GIF $imgfonction = 'imagecreatefromgif'; @@ -183,7 +183,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } if ($imgfonction) { - if (! function_exists($imgfonction)) + if (!function_exists($imgfonction)) { // Fonctions de conversion non presente dans ce PHP return 'Resize not possible. This PHP does not support GD functions '.$imgfonction; @@ -191,27 +191,27 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } // Initialisation des variables selon l'extension de l'image - switch($infoImg[2]) + switch ($infoImg[2]) { case 1: // Gif $img = imagecreatefromgif($filetoread); - $extImg = '.gif'; // File name extension of image - $newquality='NU'; // Quality is not used for this format + $extImg = '.gif'; // File name extension of image + $newquality = 'NU'; // Quality is not used for this format break; case 2: // Jpg $img = imagecreatefromjpeg($filetoread); $extImg = '.jpg'; - $newquality=100; // % quality maximum + $newquality = 100; // % quality maximum break; case 3: // Png $img = imagecreatefrompng($filetoread); $extImg = '.png'; - $newquality=0; // No compression (0-9) + $newquality = 0; // No compression (0-9) break; case 4: // Bmp $img = imagecreatefromwbmp($filetoread); $extImg = '.bmp'; - $newquality='NU'; // Quality is not used for this format + $newquality = 'NU'; // Quality is not used for this format break; } @@ -239,7 +239,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } // Initialisation des variables selon l'extension de l'image - switch($infoImg[2]) + switch ($infoImg[2]) { case 1: // Gif $trans_colour = imagecolorallocate($imgThumb, 255, 255, 255); // On procede autrement pour le format GIF @@ -250,7 +250,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, break; case 3: // Png imagealphablending($imgThumb, false); // Pour compatibilite sur certain systeme - $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel + $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel break; case 4: // Bmp $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); @@ -260,7 +260,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, dol_syslog("dol_imageResizeOrCrop: convert image from ($imgWidth x $imgHeight) at position ($src_x x $src_y) to ($newWidth x $newHeight) as $extImg, newquality=$newquality"); //imagecopyresized($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee - imagecopyresampled($imgThumb, $img, 0, 0, $src_x, $src_y, $newWidth, $newHeight, ($mode==0?$imgWidth:$newWidth), ($mode==0?$imgHeight:$newHeight)); // Insere l'image de base redimensionnee + imagecopyresampled($imgThumb, $img, 0, 0, $src_x, $src_y, $newWidth, $newHeight, ($mode == 0 ? $imgWidth : $newWidth), ($mode == 0 ? $imgHeight : $newHeight)); // Insere l'image de base redimensionnee $imgThumbName = $file; @@ -269,7 +269,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, //fclose($fp); // Create image on disk - switch($infoImg[2]) + switch ($infoImg[2]) { case 1: // Gif imagegif($imgThumb, $imgThumbName); @@ -286,13 +286,13 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } // Set permissions on file - if (! empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); + if (!empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); // Free memory. This does not delete image. imagedestroy($img); imagedestroy($imgThumb); - clearstatcache(); // File was replaced by a modified one, so we clear file caches. + clearstatcache(); // File was replaced by a modified one, so we clear file caches. return $imgThumbName; } @@ -322,7 +322,7 @@ function dolRotateImage($file_path) */ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) { - if (function_exists('exif_read_data') ) { + if (function_exists('exif_read_data')) { $exif = exif_read_data($fileSource); if ($exif && isset($exif['Orientation'])) { $infoImg = getimagesize($fileSource); // Get image infos @@ -343,7 +343,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) break; } if ($deg) { - if($infoImg[2] === 'IMAGETYPE_PNG') // In fact there is no exif on PNG but just in case + if ($infoImg[2] === 'IMAGETYPE_PNG') // In fact there is no exif on PNG but just in case { imagealphablending($img, false); imagesavealpha($img, true); @@ -351,12 +351,12 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) imagealphablending($img, false); imagesavealpha($img, true); } - else{ + else { $img = imagerotate($img, $deg, 0); } } // then rewrite the rotated image back to the disk as $fileDest - if ($fileDest === false){ + if ($fileDest === false) { return $img; } else @@ -365,13 +365,13 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) // Create image on disk $image = false; - switch($infoImg[2]) + switch ($infoImg[2]) { case IMAGETYPE_GIF: // 1 $image = imagegif($img, $fileDest); break; case IMAGETYPE_JPEG: // 2 - return imagejpeg($img, $fileDest, $quality); + $image = imagejpeg($img, $fileDest, $quality); break; case IMAGETYPE_PNG: // 3 $image = imagepng($img, $fileDest, $quality); @@ -454,13 +454,14 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $imgWidth = $infoImg[0]; // Largeur de l'image $imgHeight = $infoImg[1]; // Hauteur de l'image - $exif = exif_read_data($filetoread); - $ort= false; - if ($exif && !empty($exif['Orientation'])) { - $ort = $exif['Orientation']; + $ort = false; + if (function_exists('exif_read_data')) { + $exif = exif_read_data($filetoread); + if ($exif && !empty($exif['Orientation'])) { + $ort = $exif['Orientation']; + } } - if ($maxWidth == -1) $maxWidth=$infoImg[0]; // If size is -1, we keep unchanged if ($maxHeight == -1) $maxHeight=$infoImg[1]; // If size is -1, we keep unchanged @@ -472,8 +473,8 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', //return 'Le fichier '.$file.' ne necessite pas de creation de vignette'; } - $imgfonction=''; - switch($infoImg[2]) + $imgfonction = ''; + switch ($infoImg[2]) { case IMAGETYPE_GIF: // 1 $imgfonction = 'imagecreatefromgif'; @@ -493,7 +494,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } if ($imgfonction) { - if (! function_exists($imgfonction)) + if (!function_exists($imgfonction)) { // Fonctions de conversion non presente dans ce PHP return 'Error: Creation of thumbs not possible. This PHP does not support GD function '.$imgfonction; @@ -501,12 +502,12 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } // On cree le repertoire contenant les vignettes - $dirthumb = dirname($file).($outdir?'/'.$outdir:''); // Chemin du dossier contenant les vignettes + $dirthumb = dirname($file).($outdir ? '/'.$outdir : ''); // Chemin du dossier contenant les vignettes dol_mkdir($dirthumb); // Initialisation des variables selon l'extension de l'image - $img=null; - switch($infoImg[2]) + $img = null; + switch ($infoImg[2]) { case IMAGETYPE_GIF: // 1 $img = imagecreatefromgif($filetoread); @@ -514,7 +515,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', break; case IMAGETYPE_JPEG: // 2 $img = imagecreatefromjpeg($filetoread); - $extImg = (preg_match('/\.jpeg$/', $file)?'.jpeg':'.jpg'); // Extension de l'image + $extImg = (preg_match('/\.jpeg$/', $file) ? '.jpeg' : '.jpg'); // Extension de l'image break; case IMAGETYPE_PNG: // 3 $img = imagecreatefrompng($filetoread); @@ -529,11 +530,13 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $extImg = '.bmp'; break; } + if (! is_resource($img)) { dol_syslog('Failed to detect type of image. We found infoImg[2]='.$infoImg[2], LOG_WARNING); return 0; } + $exifAngle = false; if ($ort && !empty($conf->global->MAIN_USE_EXIF_ROTATION)) { switch($ort) @@ -556,7 +559,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } } - if($exifAngle) + if ($exifAngle) { $rotated = false; @@ -568,29 +571,27 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', imagealphablending($rotated, false); imagesavealpha($rotated, true); } - else{ + else { $rotated = imagerotate($img, $exifAngle, 0); } // replace image with good orientation - if(!empty($rotated)){ + if (!empty($rotated)) { $img = $rotated; $imgWidth = $trueImgWidth; $imgHeight = $trueImgHeight; } } - - // Initialisation des dimensions de la vignette si elles sont superieures a l'original - if($maxWidth > $imgWidth){ $maxWidth = $imgWidth; } - if($maxHeight > $imgHeight){ $maxHeight = $imgHeight; } + if ($maxWidth > $imgWidth) { $maxWidth = $imgWidth; } + if ($maxHeight > $imgHeight) { $maxHeight = $imgHeight; } - $whFact = $maxWidth/$maxHeight; // Facteur largeur/hauteur des dimensions max de la vignette - $imgWhFact = $imgWidth/$imgHeight; // Facteur largeur/hauteur de l'original + $whFact = $maxWidth / $maxHeight; // Facteur largeur/hauteur des dimensions max de la vignette + $imgWhFact = $imgWidth / $imgHeight; // Facteur largeur/hauteur de l'original // Fixe les dimensions de la vignette - if($whFact < $imgWhFact) + if ($whFact < $imgWhFact) { // Si largeur determinante $thumbWidth = $maxWidth; @@ -602,11 +603,11 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $thumbHeight = $maxHeight; $thumbWidth = $thumbHeight * $imgWhFact; } - $thumbHeight=round($thumbHeight); - $thumbWidth=round($thumbWidth); + $thumbHeight = round($thumbHeight); + $thumbWidth = round($thumbWidth); // Define target format - if (empty($targetformat)) $targetformat=$infoImg[2]; + if (empty($targetformat)) $targetformat = $infoImg[2]; // Create empty image if ($targetformat == IMAGETYPE_GIF) @@ -633,35 +634,35 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', // Initialisation des variables selon l'extension de l'image // $targetformat is 0 by default, in such case, we keep original extension - switch($targetformat) + switch ($targetformat) { case IMAGETYPE_GIF: // 1 $trans_colour = imagecolorallocate($imgThumb, 255, 255, 255); // On procede autrement pour le format GIF imagecolortransparent($imgThumb, $trans_colour); $extImgTarget = '.gif'; - $newquality='NU'; + $newquality = 'NU'; break; case IMAGETYPE_JPEG: // 2 $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); - $extImgTarget = (preg_match('/\.jpeg$/i', $file)?'.jpeg':'.jpg'); - $newquality=$quality; + $extImgTarget = (preg_match('/\.jpeg$/i', $file) ? '.jpeg' : '.jpg'); + $newquality = $quality; break; case IMAGETYPE_PNG: // 3 imagealphablending($imgThumb, false); // Pour compatibilite sur certain systeme - $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel + $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel $extImgTarget = '.png'; - $newquality=$quality-100; - $newquality=round(abs($quality-100)*9/100); + $newquality = $quality - 100; + $newquality = round(abs($quality - 100) * 9 / 100); break; case IMAGETYPE_BMP: // 6 // Not supported by PHP GD $extImgTarget = '.bmp'; - $newquality='NU'; + $newquality = 'NU'; break; case IMAGETYPE_WBMP: // 15 $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); $extImgTarget = '.bmp'; - $newquality='NU'; + $newquality = 'NU'; break; } if (function_exists("imagefill")) imagefill($imgThumb, 0, 0, $trans_colour); @@ -670,10 +671,10 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', //imagecopyresized($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee imagecopyresampled($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee - $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i', '', $file); // On enleve extension quelquesoit la casse + $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i', '', $file); // On enleve extension quelquesoit la casse $fileName = basename($fileName); //$imgThumbName = $dirthumb.'/'.getImageFileNameForSize(basename($file), $extName, $extImgTarget); // Full path of thumb file - $imgThumbName = getImageFileNameForSize($file, $extName, $extImgTarget); // Full path of thumb file + $imgThumbName = getImageFileNameForSize($file, $extName, $extImgTarget); // Full path of thumb file // Check if permission are ok @@ -681,7 +682,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', //fclose($fp); // Create image on disk - switch($targetformat) + switch ($targetformat) { case IMAGETYPE_GIF: // 1 imagegif($imgThumb, $imgThumbName); @@ -701,7 +702,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } // Set permissions on file - if (! empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); + if (!empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); // Free memory. This does not delete image. imagedestroy($img); diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 66b39809b29..e7a9bd51034 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -134,7 +134,7 @@ function showOnlinePaymentUrl($type, $ref) global $langs; // Load translation files required by the page - $langs->loadLangs(array('payment', 'paybox')); + $langs->loadLangs(array('payment', 'stripe')); $servicename = $langs->transnoentitiesnoconv('Online'); diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index b15bd41f9bb..db20bf3b2ff 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -594,7 +594,7 @@ class modProduct extends DolibarrModules $this->import_fields_array[$r] = array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 379799a0ac6..4fb5cb175b0 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -563,7 +563,7 @@ class modService extends DolibarrModules $this->import_fields_array[$r] = array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', diff --git a/htdocs/document.php b/htdocs/document.php index f196cb9eda9..c1ed149649e 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -32,24 +32,24 @@ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // For direct external download link, we don't need to load/check we are into a login session -if (isset($_GET["hashp"]) && ! defined("NOLOGIN")) +if (isset($_GET["hashp"]) && !defined("NOLOGIN")) { - if (! defined("NOLOGIN")) define("NOLOGIN", 1); - if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. - if (! defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip + if (!defined("NOLOGIN")) define("NOLOGIN", 1); + if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. + if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } // Some value of modulepart can be used to get resources that are public so no login are required. if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { - if (! defined("NOLOGIN")) define("NOLOGIN", 1); - if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. - if (! defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip + if (!defined("NOLOGIN")) define("NOLOGIN", 1); + if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. + if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } /** @@ -71,30 +71,30 @@ function llxFooter() { } -require 'main.inc.php'; // Load $user and permissions +require 'main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; $encoding = ''; -$action=GETPOST('action', 'alpha'); -$original_file=GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). -$hashp=GETPOST('hashp', 'aZ09'); -$modulepart=GETPOST('modulepart', 'alpha'); -$urlsource=GETPOST('urlsource', 'alpha'); -$entity=GETPOST('entity', 'int')?GETPOST('entity', 'int'):$conf->entity; +$action = GETPOST('action', 'alpha'); +$original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). +$hashp = GETPOST('hashp', 'aZ09'); +$modulepart = GETPOST('modulepart', 'alpha'); +$urlsource = GETPOST('urlsource', 'alpha'); +$entity = GETPOST('entity', 'int') ?GETPOST('entity', 'int') : $conf->entity; // Security check if (empty($modulepart) && empty($hashp)) accessforbidden('Bad link. Bad value for parameter modulepart', 0, 0, 1); if (empty($original_file) && empty($hashp)) accessforbidden('Bad link. Missing identification to find file (original_file or hashp)', 0, 0, 1); -if ($modulepart == 'fckeditor') $modulepart='medias'; // For backward compatibility +if ($modulepart == 'fckeditor') $modulepart = 'medias'; // For backward compatibility -$socid=0; +$socid = 0; if ($user->socid > 0) $socid = $user->socid; // For some module part, dir may be privates -if (in_array($modulepart, array('facture_paiement','unpaid'))) +if (in_array($modulepart, array('facture_paiement', 'unpaid'))) { - if (! $user->rights->societe->client->voir || $socid) $original_file='private/'.$user->id.'/'.$original_file; // If user has no permission to see all, output dir is specific to user + if (!$user->rights->societe->client->voir || $socid) $original_file = 'private/'.$user->id.'/'.$original_file; // If user has no permission to see all, output dir is specific to user } @@ -111,27 +111,27 @@ if (in_array($modulepart, array('facture_paiement','unpaid'))) */ // If we have a hash public (hashp), we guess the original_file. -if (! empty($hashp)) +if (!empty($hashp)) { include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; - $ecmfile=new EcmFiles($db); + $ecmfile = new EcmFiles($db); $result = $ecmfile->fetch(0, '', '', '', $hashp); if ($result > 0) { - $tmp = explode('/', $ecmfile->filepath, 2); // $ecmfile->filepath is relative to document directory + $tmp = explode('/', $ecmfile->filepath, 2); // $ecmfile->filepath is relative to document directory // filepath can be 'users/X' or 'X/propale/PR11111' if (is_numeric($tmp[0])) // If first tmp is numeric, it is subdir of company for multicompany, we take next part. { $tmp = explode('/', $tmp[1], 2); } - $moduleparttocheck = $tmp[0]; // moduleparttocheck is first part of path + $moduleparttocheck = $tmp[0]; // moduleparttocheck is first part of path if ($modulepart) // Not required, so often not defined, for link using public hashp parameter. { if ($moduleparttocheck == $modulepart) { // We remove first level of directory - $original_file = (($tmp[1]?$tmp[1].'/':'').$ecmfile->filename); // this is relative to module dir + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir //var_dump($original_file); exit; } else @@ -142,7 +142,7 @@ if (! empty($hashp)) else { $modulepart = $moduleparttocheck; - $original_file = (($tmp[1]?$tmp[1].'/':'').$ecmfile->filename); // this is relative to module dir + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir } } else @@ -155,13 +155,13 @@ if (! empty($hashp)) // Define attachment (attachment=true to force choice popup 'open'/'save as') $attachment = true; if (preg_match('/\.(html|htm)$/i', $original_file)) $attachment = false; -if (isset($_GET["attachment"])) $attachment = GETPOST("attachment", 'alpha')?true:false; -if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false; +if (isset($_GET["attachment"])) $attachment = GETPOST("attachment", 'alpha') ?true:false; +if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment = false; // Define mime type $type = 'application/octet-stream'; -if (GETPOST('type', 'alpha')) $type=GETPOST('type', 'alpha'); -else $type=dol_mimetype($original_file); +if (GETPOST('type', 'alpha')) $type = GETPOST('type', 'alpha'); +else $type = dol_mimetype($original_file); // Security: Force to octet-stream if file is a dangerous file if (preg_match('/\.noexe$/i', $original_file)) $type = 'application/octet-stream'; @@ -169,7 +169,7 @@ if (preg_match('/\.noexe$/i', $original_file)) $type = 'application/octet-stream $original_file = str_replace("../", "/", $original_file); // Find the subdirectory name as the reference -$refname=basename(dirname($original_file)."/"); +$refname = basename(dirname($original_file)."/"); // Security check if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); @@ -178,11 +178,11 @@ if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; -$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name +$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name -if (! empty($hashp)) +if (!empty($hashp)) { - $accessallowed = 1; // When using hashp, link is public so we force $accessallowed + $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } else @@ -195,14 +195,14 @@ else $resql = $db->query($sqlprotectagainstexternals); if ($resql) { - $num=$db->num_rows($resql); - $i=0; + $num = $db->num_rows($resql); + $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); if ($user->socid != $obj->fk_soc) { - $accessallowed=0; + $accessallowed = 0; break; } $i++; @@ -214,7 +214,7 @@ else // Security: // Limit access if permissions are wrong -if (! $accessallowed) +if (!$accessallowed) { accessforbidden(); } @@ -236,10 +236,10 @@ $filename = preg_replace('/\.noexe$/i', '', $filename); // Output file on browser dol_syslog("document.php download $fullpath_original_file filename=$filename content-type=$type"); -$fullpath_original_file_osencoded=dol_osencode($fullpath_original_file); // New file name encoded in OS encoding charset +$fullpath_original_file_osencoded = dol_osencode($fullpath_original_file); // New file name encoded in OS encoding charset // This test if file exists should be useless. We keep it to find bug more easily -if (! file_exists($fullpath_original_file_osencoded)) +if (!file_exists($fullpath_original_file_osencoded)) { dol_syslog("ErrorFileDoesNotExists: ".$fullpath_original_file); print "ErrorFileDoesNotExists: ".$original_file; @@ -264,8 +264,8 @@ if (!$attachment && !empty($conf->global->MAIN_USE_EXIF_ROTATION) && image_forma $readfile = !$imgres; } -if($readfile){ - header('Content-Length: ' . dol_filesize($fullpath_original_file)); +if ($readfile) { + header('Content-Length: '.dol_filesize($fullpath_original_file)); readfile($fullpath_original_file_osencoded); } diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 39cbe6ce6a9..79b152e0bdc 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -250,6 +250,8 @@ OneLinePerUser=One line per user ServiceToUseOnLines=Service to use on lines InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). +ProjectFollowOpportunity=Follow opportunity +ProjectFollowTasks=Follow tasks UsageOpportunity=Usage: Opportunity UsageTasks=Usage: Tasks UsageBillTimeShort=Usage: Bill time \ No newline at end of file diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 116b500fb7d..df0a695cd4c 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -56,7 +56,7 @@ NoPageYet=No pages yet YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
+YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">

More examples of HTML or dynamic code available on the wiki documentation
. ClonePage=Clone page/container CloneSite=Clone site SiteAdded=Website added diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 05cc5752777..9a17a754dc1 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -488,7 +488,7 @@ if ($resql) { $oldtype = $type; $params = array(); - if ($type === "") $params['forcenohideoftext']=1; + if ($type === "") $params['forcenohideoftext'] = 1; if ($type === "") { $newcardbutton .= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', 1, $params); $type = Product::TYPE_SERVICE; @@ -853,7 +853,7 @@ if ($resql) $product_static->id = $obj->rowid; $product_static->ref = $obj->ref; - $product_static->ref_fourn = $obj->ref_supplier; // deprecated + $product_static->ref_fourn = $obj->ref_supplier; // deprecated $product_static->ref_supplier = $obj->ref_supplier; $product_static->label = $obj->label; $product_static->type = $obj->fk_product_type; @@ -886,7 +886,7 @@ if ($resql) { $option = 'nobatch'; if (empty($arrayfields['stock_virtual']['checked'])) $option .= ',novirtual'; - $product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock() + $product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock() } } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 455a5742a68..19bedc123ff 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -554,21 +554,21 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowTasks"); print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print '
'; @@ -597,7 +597,7 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1); } else print $text; - if (!GETPOSTISSET('backtopage')) print ' '.$langs->trans("AddThirdParty").''; + if (!GETPOSTISSET('backtopage')) print ' '; print ''; } @@ -712,6 +712,20 @@ if ($action == 'create' && $user->rights->projet->creer) jQuery("#opp_status").change(function() { change_percent(); }); + + jQuery("#usage_task").change(function() { + console.log("We click on usage task "+jQuery("#usage_task").is(":checked")); + if (! jQuery("#usage_task").is(":checked")) { + jQuery("#usage_bill_time").prop("checked", false); + } + }); + + jQuery("#usage_bill_time").change(function() { + console.log("We click on usage to bill time"); + if (jQuery("#usage_bill_time").is(":checked")) { + jQuery("#usage_task").prop("checked", true); + } + }); }); '; } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ba01b901f9f..828cb4c703b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1030,7 +1030,7 @@ while ($i < min($num, $limit)) print ' 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant + $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.'&place='.$place.'\'"'; } print '>'; @@ -1220,14 +1220,14 @@ while ($i < min($num, $limit)) } if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - if ($s) $s .= " / "; + if ($s) $s .= ", "; $companystatic->name = $langs->trans("Prospect"); $companystatic->name_alias = ''; $s .= $companystatic->getNomUrl(0, 'prospect', 0, 1); } if ((!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) && $obj->fournisseur) { - if ($s) $s .= " / "; + if ($s) $s .= ", "; $companystatic->name = $langs->trans("Supplier"); $companystatic->name_alias = ''; $s .= $companystatic->getNomUrl(0, 'supplier', 0, 1); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 91cedc4b172..d6c4d30496e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4017,6 +4017,11 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; } .calendarviewcontainertr { height: 100px; } +td.cal_other_month { + opacity: 0.8; +} + + /* ============================================================================== */ /* Ajax - Liste deroulante de l'autocompletion */ diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 372c4aaba90..5f7c8f60233 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,7 +67,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '233,228,230'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '140,80,10'; // 140,80,10 or 10,140,80 +$colortexttitlenotab = '0,103,111'; // 140,80,10 or 10,140,80 $colortexttitle = '0,0,0'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; @@ -108,7 +108,7 @@ $badgeStatus0 = '#cbd3d3'; $badgeStatus1 = '#bc9526'; $badgeStatus2 = '#e6f0f0'; $badgeStatus3 = '#bca52b'; -$badgeStatus4 = '#277d1e'; +$badgeStatus4 = '#55a590'; $badgeStatus5 = '#cad2d2'; $badgeStatus6 = '#cad2d2'; $badgeStatus7 = '#baa32b'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 02e819496c4..08baeb664a2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4156,6 +4156,11 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; } background-size: 24px auto; } +td.cal_other_month { + opacity: 0.8; +} + + /* ============================================================================== */ /* Ajax - Liste deroulante de l'autocompletion */ /* ============================================================================== */ diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 670ed740b5f..5c29e8212a4 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -74,8 +74,8 @@ $pagenext = $page + 1; $object = new Ticket($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->ticket->dir_output.'/temp/massgeneration/'.$user->id; -if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket')); -elseif ($project > 0) $hookmanager->initHooks(array('projectticket')); +if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket')); +elseif ($projectid > 0) $hookmanager->initHooks(array('projectticket')); else $hookmanager->initHooks(array('ticketlist')); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -149,6 +149,8 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } $parameters = array(); +if ($socid > 0) $parameters['socid'] = $socid; +if ($projectid > 0) $parameters['projectid'] = $projectid; $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 16db733b457..f2f6bc00d1f 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1034,6 +1034,8 @@ class User extends CommonObject */ public function setCategories($categories) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $type_categ = Categorie::TYPE_USER; // Handle single category @@ -1042,7 +1044,6 @@ class User extends CommonObject } // Get current categories - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $c = new Categorie($this->db); $existing = $c->containing($this->id, $type_categ, 'id'); @@ -1106,9 +1107,9 @@ class User extends CommonObject } // If contact, remove link - if ($this->contact_id) + if ($this->contactid > 0 || $this->contact_id > 0) { - $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id; + $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".(($this->contactid > 0) ? $this->contactid : $this->contact_id); if (!$error && !$this->db->query($sql)) { $error++; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ef05483d705..1d94eadf626 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2452,7 +2452,9 @@ if (!GETPOST('hide_websitemenu')) print ''; if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) { - $htmltext = $langs->transnoentitiesnoconv("YouCanEditHtmlSource").'
'; + $url = 'https://wiki.dolibarr.org/index.php/Module_Website'; + + $htmltext = $langs->transnoentitiesnoconv("YouCanEditHtmlSource", $url).'
'; if ($conf->browser->layout == 'phone') { print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');