Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into dev_new_add_ref_clinet_intervention

This commit is contained in:
Florian HENRY 2022-05-20 10:31:29 +02:00
commit 93831663d1
121 changed files with 1282 additions and 809 deletions

174
ChangeLog
View File

@ -10,20 +10,176 @@ For users:
---------------
NEW: PHP 8.1 compatibility
NEW: Support for recurring purchase invoices.
NEW: #20292 Include German public holidays
NEW: #17123 added ExtraFields for Stock Mouvement
NEW: #20609 : new massaction to assign a sale representatives on a selection of thirdparties
NEW: #20653 edit discount pourcentage for all lines in one shot
NEW: Accept 'auto' for ref of object on import of purchase order/proposal
NEW: Accountancy - Add more filters and info on page to bind accounting accounts
NEW: Accountancy - Add subledger account when we generate a transaction with a deposit invoice
NEW: Accountancy - Add a massaction to preselect an account (customer and supplier list)
NEW: ACE Editor is restored at same cursor position after a save.
NEW: Add "addMoreActionsButtons" hook to subscription form
NEW: Add an option in GUI to show a Quick add button into top menu bar
NEW: Module Recruitment - Add a public page with all list of open job positions.
NEW: Module Recruitment - Add a tab with list of application on the jobposition file.
NEW: Add a workflow to auto link contract on a ticket
NEW: Add column date of Signature on proposal list
NEW: Add column template invoice in invoice list
NEW: Add column "Total HT" to products array on document creation card
NEW: ADD configuration for text color of button action
NEW: Add constant to hide categories in TakePos
NEW: Add constant to show category description in TakePos
NEW: Add constant to show only the products in stock in TakePos
NEW: Add entity filter in exports
NEW: Show the event block on recurring invoices #20870
NEW: Add filter "opportunity status" on statistics of projects.
NEW: Add firstname, lastname and max number of attendees for module "Event Organization"
NEW: add margin info in proposal and order list
NEW: Add massaction "Edit Extrafield" for Product
NEW: Add more fields to detect duplicate during import of thirdparties
NEW: Add option to foce delivery on email for purchase order receipt to yes
NEW: Add param boder table for md theme
NEW: Add param color button action
NEW: Add possibility to create contract from invoice
NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad character unauthorized into login name
NEW: Add private and public notes on tax files.
NEW: Add status "Obsolete" to KM articles
NEW: Add substitutions "user numbers"
NEW: Add the possibility to add sub-BOMs to BOM
NEW: allow a ticket to be automatically marked as read when created from backend.
NEW: allow cut&paste as real numeric value to excel
NEW: A public form to send a message and create a lead is available
NEW: automatically set totally received status in reception
NEW: Auto set invoice paid when adding credit not and remain to pay is 0
NEW: Availibility dictionnary has a new column unit and number
NEW: barcode rule to insert product in takepos
NEW: Can change value of AWP during the inventory
NEW: Can enter price with tax for predefined products on purchase objects
NEW: Can filter on a thirdparty on product statistics
NEW: Can removed doc templates from setup page of thirdparty
NEW: Can set the parent company during the creation of thirdparty (action=add of societe/card.php)
NEW: Can use ! to make a search that exclude a string
NEW: Change in theme colors does not need to use the refresh button
NEW: clean values and amount in FEC import
NEW: const MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND for mailing mass action
NEW: Contact filter project list
NEW: Create contract from invoice
NEW: create third-party with contact if not found on public ticket
NEW: Default value for MAIN_SECURITY_CSRF_WITH_TOKEN is now 2 (GET are also protected agains CSRF attacks)
NEW: deposit payment terms: add field into dictionary admin page to define default percentage of deposit.
NEW: Dictionaries - add possibility to manage countries in EEC
NEW: display errors in a message box after generating documents
NEW: Display physical and virtual stock of the products when creating OF from a BOM
NEW: Display product ref in "Object link" product tab for BOM
NEW: Enhance the import. Can use 'auto' for the ref (import of orders)
NEW: Events on Proposal to Return to Draft
NEW: Page to list expense report payments
NEW: JS inventory autocalc input
NEW: language support for more emailing target selectors
NEW: leave requests: add field into type dictionary to block request if balance is negative
NEW: MAIN_MAIL_AUTOCOPY_TO can accept several email and special keys
NEW: MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category
NEW: Mass action "Close shipments"
NEW: Module website now supports the multicompany module
NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...)
NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens)
NEW: Add tabs for nets Bom
NEW: on redirect of page in website module, GET parameters are kept.
NEW: optional display warning icons on ticket list
NEW: option to default check "notify tier at creation" in ticket module
NEW: option update prices on proposal cloning
NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439)
NEW: possibility to consume multiple batch
NEW: Reverse movement product consumption
NEW: Send email to the supplier order contact
NEW: New permission to report time on timesheet.
NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level
NEW: Show number of votes into the label of tab "Results" of a survey
NEW: Show product reference in Takepos
NEW: Some core tables are created only at module activation
NEW: split consumption line on MO
NEW: stock filter in reassort lists
NEW: stock limit in stock export CSV
NEW: Sub-bom are availables
NEW: Supplier order - Show ref supplier of reception in linked object block
NEW: support user_modif in order
NEW: TakePos - pagination on search results
NEW: The backup tools has an "lowmemory" option for mysqldump on large database
NEW: The 'reposition' class works on ajax constantonoff that make redirects
NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice
NEW: thumbnail field in product list
NEW: total mark rate in list
NEW: uncheck "send message" by default on a ticket when private messages has been checked
NEW: VAT Report by month - Show detail by rate and also by code
NEW: Ticket triggers: allow to automatically send messages on new tickets
NEW: Accountancy - Add hidden feature for accounting reconciliation
NEW: Can store the session into database (instead of beeing managed by PHP)
Modules
NEW: Module Partnership Management
NEW: Experimental module Event Organization Management
NEW: Experimental module Workstations Management
NEW: Experimental module Partnership Management
For developers:
---------------
NEW: A lot of addition of hooks.
For developers or integrators:
------------------------------
NEW: dol_uncompress() supports more extensions (.gz, .bz2, .zstd). Only .zip was supported before.
NEW: Implement a generic method for Kaban views
NEW: Upgrade chartjs library to 3.7.1
NEW: update rank line is possible on API for customer invoices, sales orders and supplier invoice
NEW: stripe element with more gateways
NEW: solde() function evolution to be able to get solde until a chosen date
NEW: Suggest a way to run upgrade per entities.
NEW: Support html content for multiselect component.
NEW: ModuleBuilder - Add tabs view in module builder
NEW: ModuleBuilder - More feature that can be modifed after module generation
NEW: Hook getNomUrl available everywhere in tooltip of ref links
NEW: Identification of tr is possible with by attribute data-id on some pages
NEW: Import with select boxes V2
NEW: Can update rank of invoice, proposal and order lines with API update
NEW: Can use current entity filter on 'chkbxlst'
NEW: Creation of the function select_bom() used to display bom select list
NEW: add printFieldListWhere hook in product reassort card
NEW: Add trigger and event on completely received status change
NEW: Add utility function send backup by mail
NEW: add WordPress OAuth to save a token (not SSO)
NEW: A module can embed a sql script run at each Dolibarr upgrade
NEW: API Proposals - Add POST lines
NEW: API REST filter states by country
NEW: Add option INVOICEREC_SET_AUTOFILL_DATE_START/END
NEW: Add option MAIN_API_DEBUG to save API logs into a file
NEW: Add param to keep the robot=index meta tag on public pages
NEW: Add method hintindex() in database handlers.
NEW: add modifications for new function "$db->prefix()"
NEW: addMoreActionsButtonsList hook for button in list
NEW: Add API to get a template invoice
NEW: Standardize a lot of code.
NEW: #20736 Allow extrafields SQL filters on REST API product lookup
NEW: #19294 implement detailed timespent in task of project API
NEW: Add a protection into PHPunit to avoid to forget a var_dump
NEW: Add datem and type parameters to API to create movements
NEW: Add hidden option on contract PDF line to hide qty and price
NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action
NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook
NEW: TakePos - add hooks complete product display
NEW: TakePos - add hooks for cart display
NEW: TakePos - add hooks to complete ajax return array
NEW: Add hook before the public ticket list
NEW: Add hook doaction in takepos invoice
NEW: Add Hook for Notif
NEW: Add hook for more buttons
NEW: Add hook printFieldListWhere in "show_contacts" function
NEW: Add hook printFieldWhere in load_state_board function
NEW: Add hooks contact tab badge and hooks parameter for avoid conflicts
NEW: Add hook selectProductsListWhere in select_produits_list function
NEW: Add hooks in commercial index
NEW: Add hooks in customers and products boxes
NEW: Add hooks in thirdparty index page
NEW: Add hooks on project task time page
NEW: Add hooks on salaries and sociales card
NEW: Add hooks select product list and select thirdparty list function
NEW: Add hook to getSellPrice function
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:

View File

@ -349,7 +349,7 @@ if ($action != 'export_csv') {
$sql .= " GROUP BY t.numero_compte";
$resql = $db->query($sql);
$nrows = $resql->num_rows;
$nrows = $db->num_rows($resql);
$opening_balances = array();
for ($i = 0; $i < $nrows; $i++) {
$arr = $resql->fetch_array();

View File

@ -43,17 +43,6 @@ if ($in_bookkeeping == '') {
$in_bookkeeping = 'notyet';
}
// Security check
if (empty($conf->accounting->enabled)) {
accessforbidden();
}
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->mouvements->lire)) {
accessforbidden();
}
// Get information of journal
$object = new AccountingJournal($db);
$result = $object->fetch($id_journal);
@ -65,7 +54,7 @@ if ($result > 0) {
accessforbidden($langs->trans('ErrorRecordNotFound'));
}
$hookmanager->initHooks(array('globaljournal', $object->nature_text . 'journal'));
$hookmanager->initHooks(array('globaljournal', $object->nature.'journal'));
$parameters = array();
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
@ -93,6 +82,18 @@ if (!is_array($journal_data)) {
setEventMessages($object->error, $object->errors, 'errors');
}
// Security check
if (empty($conf->accounting->enabled)) {
accessforbidden();
}
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->mouvements->lire)) {
accessforbidden();
}
/*
* Actions
*/

View File

@ -2030,7 +2030,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$MAX = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -305,6 +305,8 @@ $formother = new FormOther($db);
$membertypestatic = new AdherentType($db);
$memberstatic = new Adherent($db);
$title = $langs->trans("Members");
$now = dol_now();
if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) {
@ -471,42 +473,41 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
exit;
}
llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
llxHeader('', $title, 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
$titre = $langs->trans("MembersList");
if (GETPOSTISSET("search_status")) {
if ($search_status == '-1,1') { // TODO : check this test as -1 == Adherent::STATUS_DRAFT and -2 == Adherent::STATUS_EXLCUDED
$titre = $langs->trans("MembersListQualified");
$title = $langs->trans("MembersListQualified");
}
if ($search_status == Adherent::STATUS_DRAFT) {
$titre = $langs->trans("MembersListToValid");
$title = $langs->trans("MembersListToValid");
}
if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') {
$titre = $langs->trans("MenuMembersValidated");
$title = $langs->trans("MenuMembersValidated");
}
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') {
$titre = $langs->trans("MembersWithSubscriptionToReceive");
$title = $langs->trans("MembersWithSubscriptionToReceive");
}
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'uptodate') {
$titre = $langs->trans("MembersListUpToDate");
$title = $langs->trans("MembersListUpToDate");
}
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
$titre = $langs->trans("MembersListNotUpToDate");
$title = $langs->trans("MembersListNotUpToDate");
}
if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is ''
$titre = $langs->trans("MembersListResiliated");
$title = $langs->trans("MembersListResiliated");
}
if ($search_status == Adherent::STATUS_EXCLUDED) {
$titre = $langs->trans("MembersListExcluded");
$title = $langs->trans("MembersListExcluded");
}
} elseif ($action == 'search') {
$titre = $langs->trans("MembersListQualified");
$title = $langs->trans("MembersListQualified");
}
if ($search_type > 0) {
$membertype = new AdherentType($db);
$result = $membertype->fetch($search_type);
$titre .= " (".$membertype->label.")";
$title .= " (".$membertype->label.")";
}
$param = '';
@ -623,7 +624,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "Information";
$modelmail = "member";

View File

@ -529,7 +529,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br>'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitleSeparator();
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition'));
$moreforfilter .= '</li></ul></div>';
//$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="paddingright">'.$moreinfo.'</span> '.$moreinfo2.'</div>';

View File

@ -78,7 +78,7 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td class="right" width="60">'.$langs->trans("Value").'</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '<td></td>';
@ -106,6 +106,15 @@ if (empty($conf->use_javascript_ajax)) {
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
print '<td class="right">';
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
print '</td>';
print '<td></td>';
print '</tr>';
/*
print '<tr class="oddeven">';
print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
print '<td class="right">';
@ -122,15 +131,7 @@ echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
print '</td>';
print '<td></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
print '<td class="right">';
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
print '</td>';
print '<td></td>';
print '</tr>';
*/
print '</table>';
print '</div>';

View File

@ -74,7 +74,6 @@ llxHeader('', $langs->trans("ResourceSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("ResourceSetup"), $linkback, 'title_setup');
print "<br>\n";
$head = resource_admin_prepare_head();

View File

@ -408,7 +408,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print '<br><br>';
print_fiche_titre($langs->trans("Emails"));
print load_fiche_titre($langs->trans("Emails"));
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';

View File

@ -100,7 +100,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$url = $_SERVER['PHP_SELF'];
if (preg_match('/api\/index\.php$/', $url)) { // sometimes $_SERVER['PHP_SELF'] is 'api\/index\.php' instead of 'api\/index\.php/explorer.php' or 'api\/index\.php/method'
$url = $_SERVER['PHP_SELF'].$_SERVER['PATH_INFO'];
$url = $_SERVER['PHP_SELF'].(empty($_SERVER['PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : $_SERVER['PATH_INFO']);
}
// Fix for some NGINX setups (this should not be required even with NGINX, however setup of NGINX are often mysterious and this may help is such cases)
if (!empty($conf->global->MAIN_NGINX_FIX)) {

View File

@ -408,7 +408,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/asset/agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/asset/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -315,7 +315,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// $MAXEVENT = 10;
//
// $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT . '/asset/model/agenda.php?id=' . $object->id);
// $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/asset/model/agenda.php?id=' . $object->id);
//
// // List of actions on element
// include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';

View File

@ -742,7 +742,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -184,7 +184,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print dol_get_fiche_end();
$viewlink = dolGetButtonTitle($langs->trans('GroupByProduct'), '', 'fa fa-list-alt imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&token='.newToken(), '', 1, array('morecss' => 'reposition '.($action !== 'treeview' ? 'btnTitleSelected':'')));
$viewlink = dolGetButtonTitle($langs->trans('GroupByProduct'), '', 'fa fa-bars imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&token='.newToken(), '', 1, array('morecss' => 'reposition '.($action !== 'treeview' ? 'btnTitleSelected':'')));
$viewlink .= dolGetButtonTitle($langs->trans('TreeStructure'), '', 'fa fa-stream imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=treeview&token='.newToken(), '', 1, array('morecss' => 'reposition marginleftonly '.($action == 'treeview' ? 'btnTitleSelected':'')));
print load_fiche_titre($langs->trans("BillOfMaterials"), $viewlink, 'cubes');

View File

@ -461,6 +461,13 @@ if (empty($reshook) && $action == 'add') {
}
}
// Modify $moreparam so we are sure to see the event we have just created, whatever are the default value of filter on next page.
/*$moreparam .= ($moreparam ? '&' : '').'search_actioncode=0';
$moreparam .= ($moreparam ? '&' : '').'search_status=-1';
$moreparam .= ($moreparam ? '&' : '').'search_filtert='.$object->userownerid;
*/
$moreparam .= ($moreparam ? '&' : '').'disabledefaultvalues=1';
if ($error) {
$db->rollback();
} else {
@ -674,7 +681,7 @@ if (empty($reshook) && $action == 'update') {
$object->errors[] = $object->error;
} else {
if ($db->num_rows($resql) > 0) {
// already in use
// Resource already in use
$error++;
$object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
while ($obj = $db->fetch_object($resql)) {
@ -853,7 +860,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
$object->errors[] = $object->error;
} else {
if ($db->num_rows($resql) > 0) {
// already in use
// Resource already in use
$error++;
$object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
while ($obj = $db->fetch_object($resql)) {
@ -952,16 +959,17 @@ if ($action == 'create') {
console.log("setdatefields");
setdatefields();
});
$("#selectcomplete").change(function() {
if ($("#selectcomplete").val() == 100)
{
console.log("we change the complete status - set the doneby");
if ($("#selectcomplete").val() == 100) {
if ($("#doneby").val() <= 0) $("#doneby").val(\''.((int) $user->id).'\');
}
if ($("#selectcomplete").val() == 0)
{
if ($("#selectcomplete").val() == 0) {
$("#doneby").val(-1);
}
});
$("#actioncode").change(function() {
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
else $("#dateend").removeClass("fieldrequired");
@ -1019,59 +1027,15 @@ if ($action == 'create') {
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td><label for="fullday">'.$langs->trans("EventOnFullDay").'</label></td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday') ? ' checked' : '').'></td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td class="valignmiddle height30 small"><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday') ? ' checked' : '').'><label for="fullday">'.$langs->trans("EventOnFullDay").'</label>';
$datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep));
if (GETPOST('datep', 'int', 1)) {
$datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser');
}
$datef = ($datef ? $datef : $object->datef);
if (GETPOST('datef', 'int', 1)) {
$datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser');
}
if (empty($datef) && !empty($datep)) {
if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) {
$datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h');
}
}
// Date start
print '<tr><td class="nowrap">';
print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
print ' - ';
print '<span id="dateend"'.(GETPOST("actioncode", 'aZ09') == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
print '</td><td>';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo"
} else {
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel');
}
print ' <span class="hideonsmartphone">&nbsp; &nbsp; - &nbsp; &nbsp;</span> ';
//print ' - ';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel');
} else {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel');
}
print '</td></tr>';
// Date end
/*print '<tr><td>';
print '<span id="dateend"'.(GETPOST("actioncode", 'aZ09') == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
print '</td>';
print '<td>';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 2, 0, 'fulldayend');
} else {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 2, 0, 'fulldayend');
}
print '</td></tr>';*/
// Dev in progress
// Recurring event
$userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
if ($userepeatevent) {
// Repeat
print '<tr><td></td><td colspan="3">';
//print '<tr><td></td><td colspan="3" class="opacitymedium">';
print ' &nbsp; &nbsp; &nbsp; &nbsp; <div class="opacitymedium inline-block">';
print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"');
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
$selectedrecurrulefreq = 'no';
$selectedrecurrulebymonthday = '';
@ -1120,34 +1084,51 @@ if ($action == 'create') {
});
});
</script>';
print '</td></tr>';
print '</div>';
//print '</td></tr>';
}
// Status
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
print '<td>';
$percent = $complete !=='' ? $complete : -1;
if (GETPOSTISSET('status')) {
$percent = GETPOST('status');
} elseif (GETPOSTISSET('percentage')) {
$percent = GETPOST('percentage', 'int');
} else {
if ($complete == '0' || GETPOST("afaire") == 1) {
$percent = '0';
} elseif ($complete == 100 || GETPOST("afaire") == 2) {
$percent = 100;
}
}
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>';
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
print '<tr><td>'.$langs->trans("Location").'</td><td><input type="text" name="location" class="minwidth300 maxwidth150onsmartphone" value="'.(GETPOST('location') ? GETPOST('location') : $object->location).'"></td></tr>';
$datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep));
if (GETPOST('datep', 'int', 1)) {
$datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser');
}
$datef = ($datef ? $datef : $object->datef);
if (GETPOST('datef', 'int', 1)) {
$datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser');
}
if (empty($datef) && !empty($datep)) {
if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) {
$datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h');
}
}
// Date start
print '<tr><td class="nowrap">';
/*
print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
print ' - ';
print '<span id="dateend"'.(GETPOST("actioncode", 'aZ09') == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
*/
print '</td><td>';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo"
} else {
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel');
}
print ' <span class="hideonsmartphone">&nbsp; &nbsp; - &nbsp; &nbsp;</span> ';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel');
} else {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel');
}
print '</td></tr>';
print '<tr><td class="">&nbsp;</td><td></td></tr>';
// Assigned to
print '<tr><td class="tdtop nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
print '<tr><td class="tdtop nowrap"><span class="fieldrequired">'.$langs->trans("ActionAffectedTo").'</span></td><td>';
$listofuserid = array();
$listofcontactid = array();
$listofotherid = array();
@ -1181,6 +1162,29 @@ if ($action == 'create') {
print '</td></tr>';
}
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
print '<tr><td>'.$langs->trans("Location").'</td><td><input type="text" name="location" class="minwidth300 maxwidth150onsmartphone" value="'.(GETPOST('location') ? GETPOST('location') : $object->location).'"></td></tr>';
}
// Status
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
print '<td>';
$percent = $complete !=='' ? $complete : -1;
if (GETPOSTISSET('status')) {
$percent = GETPOST('status');
} elseif (GETPOSTISSET('percentage')) {
$percent = GETPOST('percentage', 'int');
} else {
if ($complete == '0' || GETPOST("afaire") == 1) {
$percent = '0';
} elseif ($complete == 100 || GETPOST("afaire") == 2) {
$percent = 100;
}
}
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>';
if ($conf->categorie->enabled) {
// Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
@ -1523,6 +1527,7 @@ if ($id > 0) {
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
if ($object->type_code != 'AC_OTH_AUTO') {
print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
print $formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ? GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto", 0, 0, 0, 1);
} else {
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
@ -1533,40 +1538,19 @@ if ($id > 0) {
}
// Title
print '<tr><td class="fieldrequired">'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="soixantepercent" value="'.$object->label.'"></td></tr>';
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="soixantepercent" value="'.$object->label.'"></td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'></td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td colspan="3" class="valignmiddle height30 small"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'>';
print '<label for="fullday">'.$langs->trans("EventOnFullDay").'</label>';
// Date start - end
print '<tr><td class="nowrap">';
print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
print ' - ';
print '<span id="dateend"'.($object->type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
print '</td><td td colspan="3">';
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} else {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
}
print ' - ';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} else {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
}
print '</td></tr>';
// Dev in progress
// Recurring event
$userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
if ($userepeatevent) {
// Repeat
print '<tr><td></td><td colspan="3">';
//print '<tr><td></td><td colspan="3">';
print ' &nbsp; &nbsp; &nbsp; &nbsp; <div class="opacitymedium inline-block">';
print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"');
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
$selectedrecurrulefreq = 'no';
$selectedrecurrulebymonthday = '';
@ -1615,19 +1599,37 @@ if ($id > 0) {
});
});
</script>';
print '</td></tr>';
print '</div>';
//print '</td></tr>';
}
// Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
$percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage;
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>';
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="width500" value="'.$object->location.'"></td></tr>';
// Date start - end
print '<tr><td class="nowrap">';
/*print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
print ' - ';
print '<span id="dateend"'.($object->type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
*/
print '</td><td td colspan="3">';
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} else {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
}
print ' <span class="hideonsmartphone">&nbsp; &nbsp; - &nbsp; &nbsp;</span> ';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
} else {
print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
}
print '</td></tr>';
print '<tr><td class="">&nbsp;</td><td></td></tr>';
// Assigned to
$listofuserid = array(); // User assigned
@ -1678,6 +1680,18 @@ if ($id > 0) {
print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1);
print '</td></tr>';
}
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="width500" value="'.$object->location.'"></td></tr>';
}
// Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
$percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage;
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>';
// Tags-Categories
if ($conf->categorie->enabled) {
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
@ -1786,7 +1800,7 @@ if ($id > 0) {
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', $object->note_private, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%');
$doleditor = new DolEditor('note', $object->note_private, '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>';

View File

@ -49,6 +49,8 @@ if (empty($conf->global->AGENDA_EXT_NB)) {
}
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int');
$check_holiday = GETPOST('check_holiday', 'int');
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
@ -128,14 +130,11 @@ if (GETPOST('search_actioncode', 'array:aZ09')) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) {
$actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($status == '' && !GETPOSTISSET('search_status')) {
$status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
$status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
}
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);

View File

@ -45,6 +45,11 @@ $langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", "
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
$toselect = GETPOST('toselect', 'array');
$confirm = GETPOST('confirm', 'alpha');
$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int');
$mode = GETPOST('mode', 'aZ09');
if (empty($mode) && preg_match('/show_/', $action)) {
@ -54,12 +59,9 @@ $resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid",
$pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3);
$search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09');
$type = GETPOST('search_type', 'alphanohtml') ?GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml');
$optioncss = GETPOST('optioncss', 'alpha');
$year = GETPOST("year", 'int');
$month = GETPOST("month", 'int');
$day = GETPOST("day", 'int');
$toselect = GETPOST('toselect', 'array');
$confirm = GETPOST('confirm', 'alpha');
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
if (GETPOST('search_actioncode', 'array')) {
@ -68,11 +70,9 @@ if (GETPOST('search_actioncode', 'array')) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) {
$actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
$search_id = GETPOST('search_id', 'alpha');
$search_title = GETPOST('search_title', 'alpha');
$search_note = GETPOST('search_note', 'alpha');
@ -83,7 +83,7 @@ $datestart_dtend = dol_mktime(23, 59, 59, GETPOST('datestart_dtendmonth', 'int')
$dateend_dtstart = dol_mktime(0, 0, 0, GETPOST('dateend_dtstartmonth', 'int'), GETPOST('dateend_dtstartday', 'int'), GETPOST('dateend_dtstartyear', 'int'), 'tzuserrel');
$dateend_dtend = dol_mktime(23, 59, 59, GETPOST('dateend_dtendmonth', 'int'), GETPOST('dateend_dtendday', 'int'), GETPOST('dateend_dtendyear', 'int'), 'tzuserrel');
if ($search_status == '' && !GETPOSTISSET('search_status')) {
$search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
$search_status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
}
if (empty($mode) && !GETPOSTISSET('mode')) {
$mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
@ -216,7 +216,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$datestart_dtend = '';
$dateend_dtstart = '';
$dateend_dtend = '';
$actioncode = '';
$search_status = '';
$pid = '';
$socid = '';
$resourceid = '';
$filter = '';
$filtert = '';
$usergroup = '';
$toselect = array();
$search_array_options = array();
}
@ -299,7 +306,7 @@ if ($actioncode != '') {
if ($resourceid > 0) {
$param .= "&search_resourceid=".urlencode($resourceid);
}
if ($search_status != '' && $search_status > -1) {
if ($search_status != '') {
$param .= "&search_status=".urlencode($search_status);
}
if ($filter) {

View File

@ -45,6 +45,8 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) {
$action = GETPOST('action', 'aZ09');
$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int');
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
@ -110,10 +112,7 @@ if (GETPOST('search_actioncode', 'array')) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) {
$actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'));
@ -145,7 +144,7 @@ $begin_d = 1;
$end_d = 53;
if ($status == '' && !GETPOSTISSET('search_status')) {
$status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
$status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
}
if (empty($mode) && !GETPOSTISSET('mode')) {
$mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);

View File

@ -45,6 +45,8 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) {
$action = GETPOST('action', 'aZ09');
$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int');
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
@ -110,10 +112,7 @@ if (GETPOST('search_actioncode', 'array:aZ09')) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) {
$actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'));
@ -154,7 +153,7 @@ if ($end_d < $begin_d) {
}
if ($status == '' && !GETPOSTISSET('search_status')) {
$status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
$status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
}
if (empty($mode) && !GETPOSTISSET('mode')) {

View File

@ -961,7 +961,7 @@ if ($action == 'create') {
if (GETPOST('cancel', 'alpha') || $confirm == 'no' || $action == '' || in_array($action, array('settodraft', 'valid', 'delete', 'sendall', 'clone', 'test'))) {
print "\n\n<div class=\"tabsAction\">\n";
if (($object->statut == 1) && ($user->rights->mailing->valider || $object->fk_user_valid == $user->id)) {
if (($object->statut == 1) && ($user->rights->mailing->valider || $object->user_validation == $user->id)) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&token='.newToken().'&id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
}
@ -1066,7 +1066,7 @@ if ($action == 'create') {
print dol_get_fiche_end();
print dol_set_focus('#sendto');
dol_set_focus('#sendto');
}

View File

@ -86,6 +86,11 @@ class Mailing extends CommonObject
*/
public $email_from;
/**
* @var string email to
*/
public $sendto;
/**
* @var string email reply to
*/
@ -175,6 +180,11 @@ class Mailing extends CommonObject
*/
public $statuts = array();
/**
* @var array substitutionarray
*/
public $substitutionarray;
/**
* Constructor

View File

@ -645,7 +645,7 @@ class Proposals extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$contacts = $this->invoice->liste_contact();
$contacts = $this->propal->liste_contact();
foreach ($contacts as $contact) {
if ($contact['id'] == $contactid && $contact['code'] == $type) {

View File

@ -490,7 +490,6 @@ class Propal extends CommonObject
$line->subprice = -$remise->amount_ht;
$line->fk_product = 0; // Id produit predefined
$line->qty = 1;
$line->remise = 0;
$line->remise_percent = 0;
$line->rang = -1;
$line->info_bits = 2;
@ -736,7 +735,6 @@ class Propal extends CommonObject
// TODO deprecated
$this->line->price = $price;
$this->line->remise = $remise;
if (is_array($array_options) && count($array_options) > 0) {
$this->line->array_options = $array_options;
@ -936,7 +934,6 @@ class Propal extends CommonObject
// TODO deprecated
$this->line->price = $price;
$this->line->remise = $remise;
if (is_array($array_options) && count($array_options) > 0) {
// We replace values in this->line->array_options only for entries defined into $array_options
@ -1900,14 +1897,15 @@ class Propal extends CommonObject
// multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
$line->multilangs = $tmpproduct->multilangs;
}
$this->lines[$i] = $line;
//dol_syslog("1 ".$line->fk_product);
//print "xx $i ".$this->lines[$i]->fk_product;
$i++;
}
@ -3993,6 +3991,7 @@ class PropaleLigne extends CommonObjectLine
public $multicurrency_total_tva;
public $multicurrency_total_ttc;
/**
* Class line Contructor
*
@ -4132,9 +4131,6 @@ class PropaleLigne extends CommonObjectLine
if (empty($this->rang)) {
$this->rang = 0;
}
if (empty($this->remise)) {
$this->remise = 0;
}
if (empty($this->remise_percent) || !is_numeric($this->remise_percent)) {
$this->remise_percent = 0;
}
@ -4364,9 +4360,6 @@ class PropaleLigne extends CommonObjectLine
if (empty($this->price)) {
$this->price = 0; // TODO A virer
}
if (empty($this->remise)) {
$this->remise = 0; // TODO A virer
}
if (empty($this->remise_percent)) {
$this->remise_percent = 0;
}

View File

@ -377,14 +377,14 @@ if ($action == 'validate' && $permissiontovalidate) {
if ($tmpproposal->fetch($checked) > 0) {
if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) {
if ($tmpproposal->valid($user) > 0) {
setEventMessage($langs->trans('hasBeenValidated', $tmpproposal->ref), 'mesgs');
setEventMessages($langs->trans('hasBeenValidated', $tmpproposal->ref), null, 'mesgs');
} else {
setEventMessage($tmpproposal->error, $tmpproposal->errors, 'errors');
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
$error++;
}
} else {
$langs->load("errors");
setEventMessage($langs->trans('ErrorIsNotADraft', $tmpproposal->ref), 'errors');
setEventMessages($langs->trans('ErrorIsNotADraft', $tmpproposal->ref), null, 'errors');
$error++;
}
} else {
@ -410,7 +410,7 @@ if ($action == "sign" && $permissiontoclose) {
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
$tmpproposal->statut = $tmpproposal::STATUS_SIGNED;
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) {
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
setEventMessages($tmpproposal->ref." ".$langs->trans('Signed'), null, 'mesgs');
} else {
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
$error++;

View File

@ -1666,7 +1666,6 @@ class Commande extends CommonOrder
// TODO Ne plus utiliser
$this->line->price = $price;
$this->line->remise = $remise;
if (is_array($array_options) && count($array_options) > 0) {
$this->line->array_options = $array_options;
@ -2010,7 +2009,6 @@ class Commande extends CommonOrder
$line->price = -$remise->amount_ht;
$line->fk_product = 0; // Id produit predefini
$line->qty = 1;
$line->remise = 0;
$line->remise_percent = 0;
$line->rang = -1;
$line->info_bits = 2;
@ -2154,9 +2152,11 @@ class Commande extends CommonOrder
// multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
$line->multilangs = $tmpproduct->multilangs;
}
$this->lines[$i] = $line;
@ -3262,7 +3262,6 @@ class Commande extends CommonOrder
// TODO deprecated
$this->line->price = $price;
$this->line->remise = $remise;
if (is_array($array_options) && count($array_options) > 0) {
// We replace values in this->line->array_options only for entries defined into $array_options
@ -4404,9 +4403,6 @@ class OrderLine extends CommonOrderLine
if (empty($this->rang)) {
$this->rang = 0;
}
if (empty($this->remise)) {
$this->remise = 0;
}
if (empty($this->remise_percent)) {
$this->remise_percent = 0;
}
@ -4579,9 +4575,6 @@ class OrderLine extends CommonOrderLine
if (empty($this->marge_tx)) {
$this->marge_tx = 0;
}
if (empty($this->remise)) {
$this->remise = 0;
}
if (empty($this->remise_percent)) {
$this->remise_percent = 0;
}

View File

@ -1700,7 +1700,7 @@ if ($action == 'create') {
$MAXEVENT = 10;
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -560,7 +560,6 @@ class Facture extends CommonInvoice
$this->array_options = $_facrec->array_options;
//if (! $this->remise) $this->remise = 0;
if (!$this->mode_reglement_id) {
$this->mode_reglement_id = 0;
}
@ -2194,9 +2193,11 @@ class Facture extends CommonInvoice
// multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
$line->multilangs = $tmpproduct->multilangs;
}
$this->lines[$i] = $line;
@ -5024,7 +5025,7 @@ class Facture extends CommonInvoice
$sql .= " WHERE f.entity IN (".getEntity('invoice', 0).")";
$resql = $this->db->query($sql);
if ($resql) {
if ($resql->num_rows > 0) {
if ($this->db->num_rows($resql) > 0) {
$res = $this->db->fetch_array($resql);
$ref = $res['max(situation_cycle_ref)'];
$ref++;
@ -5069,7 +5070,7 @@ class Facture extends CommonInvoice
$sql .= ' AND entity = '.($this->entity > 0 ? $this->entity : $conf->entity);
$resql = $this->db->query($sql);
$res = array();
if ($resql && $resql->num_rows > 0) {
if ($resql && $this->db->num_rows($resql) > 0) {
while ($row = $this->db->fetch_object($resql)) {
$id = $row->rowid;
$situation = new Facture($this->db);
@ -5147,7 +5148,7 @@ class Facture extends CommonInvoice
$sql .= ' AND entity = '.($this->entity > 0 ? $this->entity : $conf->entity);
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
if ($resql && $this->db->num_rows($resql) > 0) {
$res = $this->db->fetch_array($resql);
$last = $res['max(situation_counter)'];
return ($last == $this->situation_counter);
@ -6287,7 +6288,7 @@ class FactureLigne extends CommonInvoiceLine
$sql = "SELECT situation_percent FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".((int) $this->fk_prev_id);
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
if ($resql && $this->db->num_rows($resql) > 0) {
$res = $this->db->fetch_array($resql);
$returnPercent = floatval($res['situation_percent']);

View File

@ -857,7 +857,7 @@ if ($resql) {
}
}
if (!empty($arrayfields['f.datec']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($objp->datec), 'dayhour');
print '</td>';
if (!$i) {
@ -865,7 +865,7 @@ if ($resql) {
}
}
if (!empty($arrayfields['f.tms']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($objp->tms), 'dayhour');
print '</td>';
if (!$i) {

View File

@ -863,7 +863,7 @@ if ($id > 0) {
/*
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -853,7 +853,7 @@ if ($id > 0) {
/*
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -1550,7 +1550,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$MAXEVENT = 10;
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id);
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -181,6 +181,12 @@ class Contact extends CommonObject
*/
public $email;
/**
* URL
* @var string
*/
public $url;
/**
* Unsuscribe all : 1 = contact has globaly unsubscribe of all mass emailings
* @var int
@ -315,6 +321,7 @@ class Contact extends CommonObject
*/
public $stcomm_picto;
/**
* Constructor
*

View File

@ -2161,7 +2161,7 @@ if ($action == 'create') {
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -871,9 +871,11 @@ class Contrat extends CommonObject
// multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
$tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs();
$line->multilangs = $tmpproduct->multilangs;
}
$this->lines[$pos] = $line;
@ -2744,6 +2746,7 @@ class ContratLigne extends CommonObjectLine
public $commentaire;
const STATUS_INITIAL = 0;
const STATUS_OPEN = 4;
const STATUS_CLOSED = 5;
@ -2988,7 +2991,6 @@ class ContratLigne extends CommonObjectLine
$this->localtax2_type = $obj->localtax2_type;
$this->qty = $obj->qty;
$this->remise_percent = $obj->remise_percent;
$this->remise = $obj->remise;
$this->fk_remise_except = $obj->fk_remise_except;
$this->subprice = $obj->subprice;
$this->price_ht = $obj->price_ht;
@ -3046,7 +3048,6 @@ class ContratLigne extends CommonObjectLine
$this->localtax2_tx = trim($this->localtax2_tx);
$this->qty = trim($this->qty);
$this->remise_percent = trim($this->remise_percent);
$this->remise = trim($this->remise);
$this->fk_remise_except = (int) $this->fk_remise_except;
$this->subprice = price2num($this->subprice);
$this->price_ht = price2num($this->price_ht);

View File

@ -93,12 +93,17 @@ abstract class CommonInvoice extends CommonObject
const STATUS_ABANDONED = 3;
public $totalpaid; // duplicate with sumpayed
public $totaldeposits; // duplicate with sumdeposit
public $totalcreditnotes; // duplicate with sumcreditnote
public $sumpayed;
public $sumpayed_multicurrency;
public $sumdeposit;
public $sumdeposit_multicurrency;
public $sumcreditnote;
public $sumcreditnote_multicurrency;
public $remaintopay;
/**

View File

@ -115,6 +115,11 @@ abstract class CommonObject
*/
public $array_languages = null; // Value is array() when load already tried
/**
* @var array To sotre result of ->liste_contact()
*/
public $contacts_ids;
/**
* @var mixed Array of linked objects, set and used when calling ->create() to be able to create links during the creation of object
*/

View File

@ -74,6 +74,21 @@ abstract class CommonObjectLine extends CommonObject
public $volume;
public $volume_units;
public $multilangs;
public $product_type; // type in line
public $product_ref; // ref in product table
public $product_label; // label in product table
public $product_desc; // desc in product table
public $fk_product_type; // type in product table
public $qty;
public $duree;
public $remise_percent;
public $info_bits;
public $special_code;
/**
* Constructor

View File

@ -64,10 +64,40 @@ abstract class CommonStickerGenerator
public $code; // Code of format
/**
* @var array format Array with informations
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidVariableName.PublicUnderscore
// protected
// Nom du format de l'etiquette
@ -100,6 +130,8 @@ abstract class CommonStickerGenerator
protected $_COUNTY = 1;
protected $_First = 1;
public $Tformat;
// phpcs:enable
/**
* Constructor

View File

@ -917,44 +917,46 @@ class dolReceiptPrinter extends Printer
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_array($resql);
if (empty($obj)) {
$error++;
$this->errors[] = 'PrinterDontExist';
}
if (!$error) {
$parameter = (isset($obj['parameter']) ? $obj['parameter'] : '');
try {
$type = $obj['fk_type'];
switch ($type) {
case 1:
$this->connector = new DummyPrintConnector();
break;
case 2:
$this->connector = new FilePrintConnector($parameter);
break;
case 3:
$parameters = explode(':', $parameter);
$this->connector = new NetworkPrintConnector($parameters[0], $parameters[1]);
break;
case 4: // LPT1, smb://...
$this->connector = new WindowsPrintConnector(dol_sanitizePathName($parameter));
break;
case 5:
$this->connector = new CupsPrintConnector($parameter);
break;
default:
$this->connector = 'CONNECTOR_UNKNOWN';
break;
}
$this->printer = new Printer($this->connector, $this->profile);
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
$error++;
}
}
} else {
$error++;
$this->errors[] = $this->db->lasterror;
}
if (empty($obj)) {
$error++;
$this->errors[] = 'PrinterDontExist';
}
if (!$error) {
$parameter = $obj['parameter'];
try {
switch ($obj['fk_type']) {
case 1:
$this->connector = new DummyPrintConnector();
break;
case 2:
$this->connector = new FilePrintConnector($parameter);
break;
case 3:
$parameters = explode(':', $parameter);
$this->connector = new NetworkPrintConnector($parameters[0], $parameters[1]);
break;
case 4: // LPT1, smb://...
$this->connector = new WindowsPrintConnector(dol_sanitizePathName($parameter));
break;
case 5:
$this->connector = new CupsPrintConnector($parameter);
break;
default:
$this->connector = 'CONNECTOR_UNKNOWN';
break;
}
$this->printer = new Printer($this->connector, $this->profile);
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
$error++;
}
}
return $error;
}
}

View File

@ -56,6 +56,8 @@ class EmailSenderProfile extends CommonObject
*/
public $picto = 'emailsenderprofile';
public $fk_user_creat;
const STATUS_DISABLED = 0;
const STATUS_ENABLED = 1;

View File

@ -2755,7 +2755,6 @@ class Form
$objp->price = $objp2->price;
$objp->unitprice = $objp2->unitprice;
$objp->remise_percent = $objp2->remise_percent;
$objp->remise = $objp2->remise;
//$objp->tva_tx is not overwritten by $objp2 value
//$objp->default_vat_code is not overwritten by $objp2 value
@ -10142,9 +10141,6 @@ class Form
window.parent.jQuery(\'#idfordialog'.$dol_openinpopup.'\').dialog(\'close\');
});';
$retstring .= '</script>';
// TODO @LDR for the save button, in action "add", set parent var to return data and close the window
//$retstring .= '<a onclick="javascript:$(\'#varforreturndialogid'.$dol_openinpopup.'\', window.parent.document).text(\'setid\');">setid</a> ';
//$retstring .= '<a onclick="javascript:$(\'#varforreturndialoglabel'.$dol_openinpopup.'\', window.parent.document).text(\'setlabel\');">setlabel</a>';
}
return $retstring;

View File

@ -86,23 +86,21 @@ class FormActions
select_status();
$('#select' + htmlname).change(function() {
console.log('We change field select '+htmlname);
select_status();
});
// FIXME use another method for update combobox
//$('#val' + htmlname).change(function() {
//select_status();
//});
});
function select_status() {
var defaultvalue = $('#select' + htmlname).val();
console.log('val='+defaultvalue);
var percentage = $('input[name=percentage]');
var selected = '".(isset($selected) ? dol_escape_js($selected) : '')."';
var value = (selected>0?selected:(defaultvalue>=0?defaultvalue:''));
percentage.val(value);
if (defaultvalue == -1) {
if (defaultvalue == 'na' || defaultvalue == -1) {
percentage.prop('disabled', true);
$('.hideifna').hide();
}
@ -131,7 +129,7 @@ class FormActions
}
print '<select '.($canedit ? '' : 'disabled ').'name="'.$htmlname.'" id="select'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'">';
if ($showempty) {
print '<option value=""'.($selected == '' ? ' selected' : '').'>&nbsp;</option>';
print '<option value="-1"'.($selected == '' ? ' selected' : '').'>&nbsp;</option>';
}
foreach ($listofstatus as $key => $val) {
print '<option value="'.$key.'"'.(($selected == $key && strlen($selected) == strlen($key)) || (($selected > 0 && $selected < 100) && $key == '50') ? ' selected' : '').'>'.$val.'</option>';

View File

@ -38,7 +38,10 @@ class DoliDBSqlite3 extends DoliDB
const LABEL = 'Sqlite3';
//! Version min database
const VERSIONMIN = '3.0.0';
/** @var SQLite3Result Resultset of last query */
/**
* @var SQLite3Result|boolean Resultset of last query
*/
private $_results;
const WEEK_MONDAY_FIRST = 1;

View File

@ -547,6 +547,9 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
}
} elseif (isset($user->default_values[$relativepathstring]['filters'])) {
foreach ($user->default_values[$relativepathstring]['filters'] as $defkey => $defval) { // $defkey is a querystring like 'a=b&c=d', $defval is key of user
if (!empty($_GET['disabledefaultvalues'])) { // If set of default values has been disabled by a request parameter
continue;
}
$qualified = 0;
if ($defkey != '_noquery_') {
$tmpqueryarraytohave = explode('&', $defkey);
@ -1581,8 +1584,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
* @param string $disabled Disabled text
* @param string $morecss More CSS
* @param string $backtopagejsfields The back to page must be managed using javascript instead of a redirect.
* Value is 'Name of html component to set with id:Name of html component to set with label'
* TODO Support this mode, for example when used from the page create a project on thirdparty creation.
* Value is 'keyforpopupid:Name_of_html_component_to_set_with id,Name_of_html_component_to_set_with_label'
* @return string HTML component with button
*/
function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled = '', $morecss = 'button bordertransp', $backtopagejsfields = '')
@ -1597,10 +1599,16 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
$backtopagejsfieldsid = ''; $backtopagejsfieldslabel = '';
if ($backtopagejsfields) {
$url .= '&backtopagejsfields='.urlencode($backtopagejsfields);
$tmpbacktopagejsfields = explode(':', $backtopagejsfields);
$backtopagejsfieldsid = empty($tmpbacktopagejsfields[0]) ? '' : $tmpbacktopagejsfields[0];
$backtopagejsfieldslabel = empty($tmpbacktopagejsfields[1]) ? '' : $tmpbacktopagejsfields[1];
if (empty($tmpbacktopagejsfields[1])) { // If the part 'keyforpopupid:' is missing, we add $name for it.
$backtopagejsfields = $name.":".$backtopagejsfields;
$tmp2backtopagejsfields = explode(',', $tmpbacktopagejsfields[0]);
} else {
$tmp2backtopagejsfields = explode(',', $tmpbacktopagejsfields[1]);
}
$backtopagejsfieldsid = empty($tmp2backtopagejsfields[0]) ? '' : $tmp2backtopagejsfields[0];
$backtopagejsfieldslabel = empty($tmp2backtopagejsfields[1]) ? '' : $tmp2backtopagejsfields[1];
$url .= '&backtopagejsfields='.urlencode($backtopagejsfields);
}
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
@ -1623,7 +1631,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
width: \'80%\',
title: \''.dol_escape_js($label).'\',
open: function (event, ui) {
console.log("open popup");
console.log("open popup name='.$name.', backtopagejsfields='.$backtopagejsfields.'");
},
close: function (event, ui) {
returnedid = jQuery("#varforreturndialogid'.$name.'").text();

View File

@ -527,102 +527,100 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t
if ($mode == 'target' || preg_match('/targetwithdetails/', $mode)) {
if ($usecontact) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
if (is_object($targetcontact)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact));
} else {
$companytouseforaddress = $targetcompany;
if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact));
} else {
$companytouseforaddress = $targetcompany;
// Contact on a thirdparty that is a different thirdparty than the thirdparty of object
if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) {
$targetcontact->fetch_thirdparty();
$companytouseforaddress = $targetcontact->thirdparty;
// Contact on a thirdparty that is a different thirdparty than the thirdparty of object
if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) {
$targetcontact->fetch_thirdparty();
$companytouseforaddress = $targetcontact->thirdparty;
}
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress));
}
// Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code));
} elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
}
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress));
}
// Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code));
} elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
}
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) {
// Phone
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) {
if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": ";
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) {
// Phone
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) {
if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": ";
}
if (!empty($targetcontact->phone_pro)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
}
if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) {
$stringaddress .= " / ";
}
if (!empty($targetcontact->phone_mobile)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
}
}
if (!empty($targetcontact->phone_pro)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
// Fax
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) {
if ($targetcontact->fax) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
}
}
if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) {
$stringaddress .= " / ";
// EMail
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) {
if ($targetcontact->email) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
}
}
if (!empty($targetcontact->phone_mobile)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
}
}
// Fax
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) {
if ($targetcontact->fax) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
}
}
// EMail
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) {
if ($targetcontact->email) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
}
}
// Web
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) {
if ($targetcontact->url) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
// Web
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) {
if ($targetcontact->url) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
}
}
}
}
} else {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany));
// Country
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
}
if (is_object($targetcompany)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany));
// Country
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
}
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) {
// Phone
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) {
if (!empty($targetcompany->phone) || !empty($targetcompany->phone_mobile)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": ";
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) {
// Phone
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) {
if (!empty($targetcompany->phone)) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": ";
}
if (!empty($targetcompany->phone)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone);
}
}
if (!empty($targetcompany->phone)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone);
// Fax
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) {
if ($targetcompany->fax) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
}
}
if (!empty($targetcompany->phone) && !empty($targetcompany->phone_mobile)) {
$stringaddress .= " / ";
// EMail
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) {
if ($targetcompany->email) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email);
}
}
if (!empty($targetcompany->phone_mobile)) {
$stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile);
}
}
// Fax
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) {
if ($targetcompany->fax) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
}
}
// EMail
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) {
if ($targetcompany->email) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email);
}
}
// Web
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) {
if ($targetcompany->url) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url);
// Web
if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) {
if ($targetcompany->url) {
$stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url);
}
}
}
}

View File

@ -37,6 +37,41 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/
abstract class ModelePDFAsset extends CommonDocGenerator
{
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**

View File

@ -81,41 +81,6 @@ class pdf_standard extends ModeleExpenseReport
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe

View File

@ -28,6 +28,41 @@ abstract class ModeleExpenseReport extends CommonDocGenerator
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**

View File

@ -804,11 +804,12 @@ class ImportCsv extends ModeleImports
$resql = $this->db->query($sqlSelect);
if ($resql) {
$res = $this->db->fetch_object($resql);
if ($resql->num_rows == 1) {
$num_rows = $this->db->num_rows($resql);
if ($num_rows == 1) {
$res = $this->db->fetch_object($resql);
$lastinsertid = $res->rowid;
$last_insert_id_array[$tablename] = $lastinsertid;
} elseif ($resql->num_rows > 1) {
} elseif ($num_rows > 1) {
$this->errors[$error]['lib'] = $langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters));
$this->errors[$error]['type'] = 'SQL';
$error++;
@ -837,7 +838,7 @@ class ImportCsv extends ModeleImports
$resql = $this->db->query($sqlSelect);
if ($resql) {
$res = $this->db->fetch_object($resql);
if ($resql->num_rows == 1) {
if ($this->db->num_rows($resql) == 1) {
// We have a row referencing this last foreign key, continue with UPDATE.
} else {
// No record found referencing this last foreign key,

View File

@ -844,11 +844,12 @@ class ImportXlsx extends ModeleImports
$resql = $this->db->query($sqlSelect);
if ($resql) {
$res = $this->db->fetch_object($resql);
if ($resql->num_rows == 1) {
$num_rows = $this->db->num_rows($resql);
if ($num_rows == 1) {
$res = $this->db->fetch_object($resql);
$lastinsertid = $res->rowid;
$last_insert_id_array[$tablename] = $lastinsertid;
} elseif ($resql->num_rows > 1) {
} elseif ($num_rows > 1) {
$this->errors[$error]['lib'] = $langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters));
$this->errors[$error]['type'] = 'SQL';
$error++;
@ -877,7 +878,7 @@ class ImportXlsx extends ModeleImports
$resql = $this->db->query($sqlSelect);
if ($resql) {
$res = $this->db->fetch_object($resql);
if ($resql->num_rows == 1) {
if ($this->db->num_rows($resql) == 1) {
// We have a row referencing this last foreign key, continue with UPDATE.
} else {
// No record found referencing this last foreign key,

View File

@ -211,8 +211,8 @@ class modAgenda extends DolibarrModules
'url'=>'/comm/action/index.php',
'langs'=>'agenda',
'position'=>86,
'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled',
'perms'=>'$user->rights->agenda->myactions->read || $user->rights->resource->read',
'enabled'=>'$conf->agenda->enabled || $conf->resource->enabled',
'target'=>'',
'user'=>2,
);

View File

@ -91,7 +91,7 @@ class modResource extends DolibarrModules
// Dependencies
// List of modules id that must be enabled if this module is enabled
$this->depends = array();
$this->depends = array('modResource');
// List of modules id to disable if this one is disabled
$this->requiredby = array('modPlace');
// Minimum version of PHP required by module
@ -185,11 +185,11 @@ class modResource extends DolibarrModules
// Menus declaration
$this->menu[$r] = array(
'fk_menu'=>'fk_mainmenu=tools',
'fk_menu'=>'fk_mainmenu=agenda',
'type'=>'left',
'titre'=> 'MenuResourceIndex',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em92"'),
'mainmenu'=>'tools',
'mainmenu'=>'agenda',
'leftmenu'=> 'resource',
'url'=> '/resource/list.php',
'langs'=> 'resource',
@ -201,10 +201,10 @@ class modResource extends DolibarrModules
$r++;
$this->menu[$r++] = array(
'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus
'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus
'type'=> 'left', // Toujours un menu gauche
'titre'=> 'MenuResourceAdd',
'mainmenu'=> 'tools',
'mainmenu'=> 'agenda',
'leftmenu'=> 'resource_add',
'url'=> '/resource/card.php?action=create',
'langs'=> 'resource',
@ -216,10 +216,10 @@ class modResource extends DolibarrModules
);
$this->menu[$r++] = array(
'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus
'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus
'type'=> 'left', // Toujours un menu gauche
'titre'=> 'List',
'mainmenu'=> 'tools',
'mainmenu'=> 'agenda',
'leftmenu'=> 'resource_list',
'url'=> '/resource/list.php',
'langs'=> 'resource',

View File

@ -52,6 +52,11 @@ class pdf_standard extends ModelePDFMovement
*/
public $description;
/**
* @var int Save the name of generated file as the main doc when generating a doc with this template
*/
public $update_main_doc_field;
/**
* @var string document type
*/
@ -70,42 +75,8 @@ class pdf_standard extends ModelePDFMovement
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* @var Societe Issuer
* Issuer
* @var Societe Object that emits
*/
public $emetteur;
@ -139,7 +110,7 @@ class pdf_standard extends ModelePDFMovement
$this->name = "stdmouvement";
$this->description = $langs->trans("DocumentModelStandardPDF");
// Page size for A4 format
// Dimension page
$this->type = 'pdf';
$formatarray = pdf_getFormat();
$this->page_largeur = $formatarray['width'];
@ -157,7 +128,7 @@ class pdf_standard extends ModelePDFMovement
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
if (empty($this->emetteur->country_code)) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
}
@ -202,10 +173,12 @@ class pdf_standard extends ModelePDFMovement
* @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $db, $hookmanager;
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null'));
if (!is_object($outputlangs)) {
$outputlangs = $langs;
@ -215,7 +188,7 @@ class pdf_standard extends ModelePDFMovement
$outputlangs->charset_output = 'ISO-8859-1';
}
// Load traductions files required by page
// Load traductions files required by the page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries"));
/**
@ -487,7 +460,7 @@ class pdf_standard extends ModelePDFMovement
$pdf->useTemplate($tplidx);
}
$pagenb++;
$this->_pagehead($pdf, $object, 1, $outputlangs);
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0, 0, 0);
@ -499,7 +472,8 @@ class pdf_standard extends ModelePDFMovement
// Show list of product of the MouvementStock
$nexY += 5;
$nexY = $tab_top - 1;
$nexY = $pdf->GetY();
$nexY += 10;

View File

@ -35,6 +35,42 @@ abstract class ModelePDFMovement extends CommonDocGenerator
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
public $option_codestockservice;

View File

@ -68,41 +68,6 @@ class pdf_standard extends ModelePDFProduct
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe

View File

@ -38,6 +38,41 @@ abstract class ModelePDFProduct extends CommonDocGenerator
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**

View File

@ -138,6 +138,14 @@ class pdf_beluga extends ModelePDFProjects
*/
public $emetteur;
public $posxref;
public $posxdate;
public $posxsociete;
public $posxamountht;
public $posxamountttc;
public $posstatut;
/**
* Constructor
*
@ -479,7 +487,7 @@ class pdf_beluga extends ModelePDFProjects
}
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, $projectField);
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, '', '', $projectField);
$num = count($elementarray);
if ($num >= 0) {
@ -492,7 +500,7 @@ class pdf_beluga extends ModelePDFProjects
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
$selectList = $formproject->select_element($tablename, $project->thirdparty->id, '', -2, $projectField);
$selectList = $formproject->select_element($tablename, $object->thirdparty->id, '', -2, $projectField);
$nexY = $pdf->GetY() + 1;
$curY = $nexY;
$pdf->SetXY($this->posxref, $curY);
@ -790,8 +798,6 @@ class pdf_beluga extends ModelePDFProjects
*/
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
{
global $conf, $mysoc;
$heightoftitleline = 10;
$default_font_size = pdf_getPDFFontSize($outputlangs);
@ -806,24 +812,6 @@ class pdf_beluga extends ModelePDFProjects
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size);
$pdf->SetXY($this->posxref, $tab_top + 1);
$pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->transnoentities("Tasks"), '', 'L');
$pdf->SetXY($this->posxlabel, $tab_top + 1);
$pdf->MultiCell($this->posxworkload - $this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L');
$pdf->SetXY($this->posxworkload, $tab_top + 1);
$pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R');
$pdf->SetXY($this->posxprogress, $tab_top + 1);
$pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, '%', 0, 'R');
$pdf->SetXY($this->posxdatestart, $tab_top + 1);
$pdf->MultiCell($this->posxdateend - $this->posxdatestart, 3, '', 0, 'C');
$pdf->SetXY($this->posxdateend, $tab_top + 1);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@ -70,41 +70,6 @@ class pdf_standard extends ModelePDFStock
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe

View File

@ -28,6 +28,41 @@ abstract class ModelePDFStock extends CommonDocGenerator
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**

View File

@ -76,41 +76,6 @@ class pdf_standard extends ModelePDFSuppliersPayments
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe

View File

@ -27,6 +27,41 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
*/
public $error = '';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**

View File

@ -240,7 +240,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
unset($linked_contacts);
}
if ($sendto) {
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf);
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs);
}
}
$ok = 1;

View File

@ -1920,7 +1920,7 @@ class EmailCollector extends CommonObject
if (count($pj) > 0) {
$sql = "SELECT rowid as id FROM " . MAIN_DB_PREFIX . "user WHERE email LIKE '%" . $from . "%'";
$resql = $this->db->query($sql);
if ($resql->num_rows == 0) {
if ($this->db->num_rows($resql) == 0) {
$this->errors = 'User Not allowed to add documents';
}
$arrayobject = array(

View File

@ -1494,6 +1494,8 @@ class FichinterLigne extends CommonObjectLine
*/
public $fk_element = 'fk_fichinter';
/**
* Constructor
*

View File

@ -350,7 +350,7 @@ class FichinterRec extends Fichinter
// phpcs:enable
$this->lines = array();
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, ';
$sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description, ';
$sql .= ' l.price, l.qty, l.tva_tx, l.remise, l.remise_percent, l.subprice, l.duree, ';
$sql .= ' l.total_ht, l.total_tva, l.total_ttc,';
$sql .= ' l.rang, l.special_code,';
@ -378,7 +378,7 @@ class FichinterRec extends Fichinter
$line->product_ref = $objp->product_ref; // Ref product
$line->product_label = $objp->product_label; // Label product
$line->product_desc = $objp->product_desc; // Description product
$line->fk_product_type = $objp->fk_product_type; // Type of product
$line->fk_product_type = $objp->fk_product_type; // Type in product
$line->qty = $objp->qty;
$line->duree = $objp->duree;
$line->duration = $objp->duree;
@ -401,10 +401,6 @@ class FichinterRec extends Fichinter
$line->special_code = $objp->special_code;
$line->fk_unit = $objp->fk_unit;
// Ne plus utiliser
$line->price = $objp->price;
$line->remise = $objp->remise;
$this->lines[$i] = $line;
$i++;

View File

@ -3751,9 +3751,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
if (empty($this->rang)) {
$this->rang = 0;
}
if (empty($this->remise)) {
$this->remise = 0;
}
if (empty($this->remise_percent)) {
$this->remise_percent = 0;
}

View File

@ -680,7 +680,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/evaluation_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/evaluation_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -451,7 +451,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';

View File

@ -39,17 +39,17 @@ function jobPrepareHead($object)
$h = 0;
$head = array();
$head[$h][0] = dol_buildpath("/hrm/job_card.php", 1).'?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id;
$head[$h][1] = $langs->trans("JobCard");
$head[$h][2] = 'job_card';
$h++;
$head[$h][0] = dol_buildpath("/hrm/skill_tab.php", 1).'?id='.$object->id.'&objecttype=job';
$head[$h][0] = DOL_URL_ROOT."/hrm/skill_tab.php?id=".$object->id.'&objecttype=job';
$head[$h][1] = $langs->trans("RequiredSkills");
$head[$h][2] = 'skill_tab';
$h++;
$head[$h][0] = dol_buildpath("/hrm/position.php", 1).'?fk_job='.$object->id;
$head[$h][0] = DOL_URL_ROOT."/hrm/position.php?fk_job=".$object->id;
$head[$h][1] = $langs->trans("EmployeesInThisPosition");
$head[$h][2] = 'position';
$h++;

View File

@ -348,7 +348,7 @@ function DisplayPositionCard(&$object)
//
// $MAXEVENT = 10;
//
// $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
// $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
//
// // List of actions on element
// include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
@ -377,7 +377,7 @@ if ($action !== 'edit' && $action !== 'create') {
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';

View File

@ -856,7 +856,7 @@ if ($action != "create" && $action != "edit") {
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';

View File

@ -120,10 +120,10 @@ if (empty($reshook)) {
$skillAdded->fk_object = $id;
$skillAdded->objecttype = $objecttype;
$ret = $skillAdded->create($user);
if ($ret < 0) setEventMessage($skillAdded->error, 'errors');
if ($ret < 0) setEventMessages($skillAdded->error, null, 'errors');
//else unset($TSkillsToAdd);
}
if ($ret > 0) setEventMessage($langs->trans("SaveAddSkill"));
if ($ret > 0) setEventMessages($langs->trans("SaveAddSkill"), null);
}
} elseif ($action == 'saveSkill') {
if (!empty($TNote)) {
@ -136,14 +136,14 @@ if (empty($reshook)) {
}
}
}
setEventMessage($langs->trans("SaveLevelSkill"));
header("Location: " . dol_buildpath('/hrm/skill_tab.php', 1) . '?id=' . $id. '&objecttype=job');
setEventMessages($langs->trans("SaveLevelSkill"), null);
header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job');
exit;
}
} elseif ($action == 'confirm_deleteskill' && $confirm == 'yes') {
$skillToDelete = new SkillRank($db);
$ret = $skillToDelete->fetch($lineid);
setEventMessage($langs->trans("DeleteSkill"));
setEventMessages($langs->trans("DeleteSkill"), null);
if ($ret > 0) {
$skillToDelete->delete($user);
}
@ -247,12 +247,67 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">' . "\n";
print '<table class="border centpercent tableforfield">';
// Login
print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
if (!empty($object->ldap_sid) && $object->statut == 0) {
print '<td class="error">';
print $langs->trans("LoginAccountDisableInDolibarr");
print '</td>';
} else {
print '<td>';
$addadmin = '';
if (property_exists($object, 'admin')) {
if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
$addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
} elseif (!empty($object->admin)) {
$addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
}
}
print showValueWithClipboardCPButton($object->login).$addadmin;
print '</td>';
}
print '</tr>'."\n";
$object->fields['label']['visible']=0; // Already in banner
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
$object->fields['firstname']['visible']=0; // Already in banner
$object->fields['lastname']['visible']=0; // Already in banner
//include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Ref employee
print '<tr><td class="titlefield">'.$langs->trans("RefEmployee").'</td>';
print '<td class="error">';
print showValueWithClipboardCPButton($object->ref_employee);
print '</td>';
print '</tr>'."\n";
// National Registration Number
print '<tr><td class="titlefield">'.$langs->trans("NationalRegistrationNumber").'</td>';
print '<td class="error">';
print showValueWithClipboardCPButton($object->national_registration_number);
print '</td>';
print '</tr>'."\n";
/*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
print '<td colspan="3">';
$nbofrecipientemails=0;
$notify=new Notify($db);
$tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
foreach($tmparray as $tmpkey => $tmpval)
{
$nbofrecipientemails++;
}
print $nbofrecipientemails;
print '</td></tr>';*/
print '</table>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div><br>';
@ -296,7 +351,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
print '</tr>';
if (!is_array($TSkillsJob) || empty($TSkillsJob)) {
print '<tr><td>' . $langs->trans("NoRecordFound") . '</td></tr>';
print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
} else {
$sk = new Skill($db);
foreach ($TSkillsJob as $skillElement) {

View File

@ -317,6 +317,7 @@ if ($step == 4 && $action == 'select_model') {
}
}
$_SESSION["dol_array_match_file_to_database"] = $serialized_array_match_file_to_database;
$_SESSION['dol_array_match_file_to_database_select'] = $_SESSION["dol_array_match_file_to_database"];
}
}
if ($action == 'saveselectorder') {
@ -745,6 +746,7 @@ if ($step == 3 && $datatoimport) {
// STEP 4: Page to make matching between source file and database fields
if ($step == 4 && $datatoimport) {
//var_dump($_SESSION["dol_array_match_file_to_database_select"]);
$serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database_select"]) ? $_SESSION["dol_array_match_file_to_database_select"] : '';
$array_match_file_to_database = array();
$fieldsarray = explode(',', $serialized_array_match_file_to_database);
@ -793,7 +795,7 @@ if ($step == 4 && $datatoimport) {
$i = 1;
foreach ($arrayrecord as $key => $val) {
if ($val["type"] != -1) {
$fieldssource[$i]['example1'] = dol_trunc($val['val'], 24);
$fieldssource[$i]['example1'] = dol_trunc($val['val'], 128);
$i++;
}
}
@ -805,6 +807,11 @@ if ($step == 4 && $datatoimport) {
$minpos = min(count($fieldssource), count($fieldstarget));
//var_dump($array_match_file_to_database);
$initialloadofstep4 = false;
if (empty($_SESSION['dol_array_match_file_to_database_select'])) {
$initialloadofstep4 = true;
}
// Is it a first time in page (if yes, we must initialize array_match_file_to_database)
if (count($array_match_file_to_database) == 0) {
// This is first input in screen, we need to define
@ -837,6 +844,7 @@ if ($step == 4 && $datatoimport) {
}
$array_match_database_to_file = array_flip($array_match_file_to_database);
$fieldstarget_tmp = array();
$arraykeysfieldtarget = array_keys($fieldstarget);
$position = 0;
@ -876,6 +884,7 @@ if ($step == 4 && $datatoimport) {
//print $serialized_array_match_file_to_database;
//print $_SESSION["dol_array_match_file_to_database"];
//print $_SESSION["dol_array_match_file_to_database_select"];
//var_dump($array_match_file_to_database);exit;
// Now $array_match_file_to_database contains fieldnb(1,2,3...)=>fielddatabase(key in $array_match_file_to_database)
@ -903,7 +912,7 @@ if ($step == 4 && $datatoimport) {
print '<div class="underbanner clearboth"></div>';
print '<div class="fichecenter">';
print '<table width="100%" class="border tableforfield">';
print '<table class="centpercent border tableforfield">';
// Module
print '<tr><td class="titlefieldcreate">'.$langs->trans("Module").'</td>';
@ -1029,10 +1038,9 @@ if ($step == 4 && $datatoimport) {
print '<div id="left" class="connectedSortable">'."\n";
// List of source fields
$var = true;
$var = false;
$lefti = 1;
foreach ($fieldssource as $key => $val) {
$var = !$var;
show_elem($fieldssource, $key, $val, $var); // key is field number in source file
$listofkeys[$key] = 1;
$fieldsplaced[$key] = 1;
@ -1051,7 +1059,7 @@ if ($step == 4 && $datatoimport) {
print '</td><td width="50%" class="nopaddingrightimp">';
// List of target fields
// Set the list of all possible target fields in Dolibarr.
$optionsnotused = "";
$optionsall = array();
foreach ($fieldstarget as $code => $line) {
@ -1064,15 +1072,27 @@ if ($step == 4 && $datatoimport) {
if (!$line["imported"]) {
$optionsnotused .= $text;
}
$optionsall[$code] = array('label'=>$langs->trans($line["label"]), 'required'=>(empty($line["required"]) ? 0 : 1));
$optionsall[$code] = array('label'=>$langs->trans($line["label"]), 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>$line['position']);
}
// $optionsall is an array of all possible fields. key=>array('label'=>..., 'xxx')
$height = '32px'; //needs px for css height attribute below
$i = 0;
$mandatoryfieldshavesource = true;
//var_dump($fieldstarget);
//var_dump($optionsall);
//exit;
/*
var_dump($_SESSION['dol_array_match_file_to_database']);
var_dump($_SESSION['dol_array_match_file_to_database_select']);
var_dump($optionsall);
var_dump($fieldssource);
var_dump($fieldstarget);
*/
print '<table class="nobordernopadding centpercent tableimport">';
foreach ($fieldstarget as $code => $line) {
foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file.
if ($i == $minpos) {
break;
}
@ -1087,8 +1107,17 @@ if ($step == 4 && $datatoimport) {
//print '<td class="nowraponall" style="font-weight: normal">=> '.img_object('', $entityicon).' '.$langs->trans($entitylang).'</td>';
print '<td class="nowraponall" style="font-weight: normal">=> </td>';
print '<td class="nowraponall" style="font-weight: normal">';
$modetoautofillmapping = 'session'; // Use setup in session
if ($initialloadofstep4) {
$modetoautofillmapping = 'guess';
}
//var_dump($_SESSION['dol_array_match_file_to_database_select']);
//var_dump($modetoautofillmapping);
//var_dump($_SESSION['dol_array_match_file_to_database']);
//var_dump($modetoautofillmapping);
print '<select id="selectorderimport_'.($i+1).'" class="targetselectchange minwidth300" name="select_'.$line["label"].'">';
if ($line["imported"]) {
print '<option value="-1">&nbsp;</option>';
@ -1097,14 +1126,50 @@ if ($step == 4 && $datatoimport) {
}
$j = 0;
foreach ($optionsall as $code => $val) {
$label = $val['required'] ? '<strong>' : '';
$label .= $val['label'];
$label .= $val['required'] ? '*</strong>' : '';
foreach ($optionsall as $tmpcode => $tmpval) { // Loop on each entry to add into each combo list.
$label = $tmpval['required'] ? '<strong>' : '';
$label .= $tmpval['label'];
$label .= $tmpval['required'] ? '*</strong>' : '';
print '<option value="'.$code.'"';
if ($j == $i) {
print ' selected';
// If we must guess how to fill the preselected value, and we can't because input value are not string
if ($modetoautofillmapping == 'guess' && $j == 0 && is_numeric($tmpval)) {
$modetoautofillmapping = 'orderoftargets';
}
print '<option value="'.$tmpcode.'"';
if ($modetoautofillmapping == 'orderoftargets') {
// The mode where we fill the preselected value of combo one by one in order of available targets fields in the declaration in descriptor file.
if ($j == $i) {
print ' selected';
}
} elseif ($modetoautofillmapping == 'guess') {
// The mode where we try to guess which value to preselect from the name in first column of source file.
$regs = array();
if (preg_match('/^(.+)\((.+)\)$/', $line['example1'], $regs)) {
$tmpstring1 = $regs[1];
$tmpstring2 = $regs[2];
} else {
$tmpstring1 = $line['example1'];
$tmpstring2 = '';
}
$tmpstring1 = str_replace('*', '', trim($tmpstring1));
$tmpstring2 = str_replace('*', '', trim($tmpstring2));
if ($tmpstring1 && ($tmpstring1 == $tmpcode || $tmpstring1 == $tmpval)) {
print ' selected';
// TODO Check that $tmpcode not already selected
} elseif ($tmpstring2 && ($tmpstring2 == $tmpcode || $tmpstring2 == $tmpval)) {
print ' selected';
// TODO Check that $tmpcode not already selected
}
} elseif ($modetoautofillmapping == 'session' && !empty($_SESSION['dol_array_match_file_to_database_select'])) {
$tmpselectioninsession = dolExplodeIntoArray($_SESSION['dol_array_match_file_to_database_select'], ',', '=');
//var_dump($code);
//var_dump($tmpselectioninsession);
//if ($tmpselectioninsession[$j] == $code) {
if ($tmpselectioninsession[($i+1)] == $tmpcode) {
print ' selected';
}
print ' data-debug="'.$tmpcode.'-'.$code.'-'.$j.'-'.$tmpselectioninsession[($i+1)].'"';
}
print ' data-html="'.dol_escape_htmltag($label).'"';
print '>';
@ -1124,7 +1189,7 @@ if ($step == 4 && $datatoimport) {
$htmltext .= $langs->trans("DataComeFromNoWhere").'<br>';
} else {
if (empty($objimport->array_import_convertvalue[0][$code])) { // If source file does not need convertion
$filecolumntoshow = $i + 1;
$filecolumntoshow = num2Alpha($i);
$htmltext .= $langs->trans("DataComeFromFileFieldNb", $filecolumntoshow).'<br>';
} else {
if ($objimport->array_import_convertvalue[0][$code]['rule'] == 'fetchidfromref') {
@ -1248,25 +1313,28 @@ if ($step == 4 && $datatoimport) {
// - Then we set to disabled all fields that are selected
print 'function setOptionsToDisabled() {'."\n";
print ' console.log("Remove the disabled flag everywhere");'."\n";
print ' $(".targetselectchange").not($( this )).find(\'option\').prop("disabled", false);'."\n";
print ' $("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);'."\n"; // Enable all options
print ' arrayofselectedvalues = [];'."\n";
print ' $(".targetselectchange").each(function(){'."\n";
print ' $("select.targetselectchange").each(function(){'."\n";
print ' id = $(this).attr(\'id\')'."\n";
print ' value = $(this).val()'."\n";
//print ' console.log("a selected value has been found for component "+id+" = "+value);'."\n";
print ' arrayofselectedvalues.push(value);'."\n";
print ' });'."\n";
print ' console.log("List of all selected values");'."\n";
print ' console.log(arrayofselectedvalues);'."\n";
print ' console.log("Set the disabled flag for every entry in arrayofselectedvalues");'."\n";
print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n";
print ' console.log("Set the option to disabled for every entry that is currently selected somewhere else (so into arrayofselectedvalues)");'."\n";
print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n"; // Loop on each selected value
print ' if (value != -1) {'."\n";
print ' console.log("Process key="+key+" value="+value);'."\n";
print ' $(".targetselectchange").find(\'option[value="\'+value+\'"]\').prop("disabled", true);'."\n";
//print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n";
print ' $("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);'."\n"; // Set to disabled except if currently selected
print ' }'."\n";
print ' });'."\n";
print '};'."\n";
// Function to save the selection
// Function to save the selection in database
print 'function saveSelection() {'."\n";
//print ' console.log(arrayofselectedvalues);'."\n";
print ' arrayselectedfields = [];'."\n";
print ' arrayselectedfields.push("0");'."\n";
print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n";
@ -2210,7 +2278,7 @@ $db->close();
* @param array $fieldssource List of source fields
* @param int $pos Pos
* @param string $key Key
* @param boolean $var Line style (odd or not)
* @param boolean $var Line style (odd or not). No more used.
* @param int $nostyle Hide style
* @return void
*/
@ -2257,14 +2325,14 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
//print img_picto($langs->trans("MoveField", $pos), 'grip_title', 'class="boxhandle" style="cursor:move;"');
print img_picto($langs->trans("Field").' '.$pos, 'file', 'class="pictofixedwith"');
print img_picto($langs->trans("Column").' '.num2Alpha($pos - 1), 'file', 'class="pictofixedwith"');
print '</td>';
if (isset($fieldssource[$pos]['imported']) && $fieldssource[$pos]['imported'] == false) {
print '<td class="nowraponall boxtdunused" style="font-weight: normal">';
} else {
print '<td class="nowraponall" style="font-weight: normal">';
}
print $langs->trans("Field").' '.$pos;
print $langs->trans("Column").' '.num2Alpha($pos - 1).' (#'.$pos.')';
if (empty($fieldssource[$pos]['example1'])) {
$example = $fieldssource[$pos]['label'];
} else {
@ -2289,6 +2357,20 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
}
/**
* Return a numeric into an Excel like column number
*
* @param string $n Numeric value
* @return string Column in Excel format
*/
function num2Alpha($n)
{
for ($r = ""; $n >= 0; $n = intval($n / 26) - 1)
$r = chr($n%26 + 0x41) . $r;
return $r;
}
/**
* Return not used field number
*

View File

@ -30,6 +30,6 @@
-- Type resources
--
insert into llx_c_type_resource (code,label,active) values ('RES_ROOMS', 'Rooms', 1);
insert into llx_c_type_resource (code,label,active) values ('RES_CARS', 'Cars', 1);
insert into llx_c_type_resource (code, label, active) values ('RES_ROOMS', 'Rooms', 1);
insert into llx_c_type_resource (code, label, active) values ('RES_CARS', 'Cars', 1);

View File

@ -34,6 +34,9 @@ ALTER TABLE llx_holiday ADD COLUMN nb_open_day double(24,8) DEFAULT NULL;
-- Missing in v15 or lower
insert into llx_c_type_resource (code, label, active) values ('RES_ROOMS', 'Rooms', 1);
insert into llx_c_type_resource (code, label, active) values ('RES_CARS', 'Cars', 1);
ALTER TABLE llx_c_actioncomm MODIFY COLUMN libelle varchar(128);
ALTER TABLE llx_c_availability MODIFY COLUMN label varchar(128);
ALTER TABLE llx_c_barcode_type MODIFY COLUMN libelle varchar(128);

View File

@ -1422,11 +1422,9 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf)
if ($select_resql) {
$select_num = $db->num_rows($select_resql);
$i = 0;
$var = true;
// Pour chaque paiement fournisseur, on insere une ligne dans paiementfourn_facturefourn
while (($i < $select_num) && (!$error)) {
$var = !$var;
$select_obj = $db->fetch_object($select_resql);
// Verifier si la ligne est deja dans la nouvelle table. On ne veut pas inserer de doublons.

View File

@ -231,7 +231,7 @@ class IntracommReport extends CommonObject
if ($resql) {
$i = 1;
if (empty($resql->num_rows)) {
if ($this->db->num_rows($resql) <= 0) {
$this->errors[] = 'No data for this period';
return 0;
}

View File

@ -521,7 +521,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -2112,7 +2112,7 @@ ResourceSetup=Configuration of Resource module
UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).
DisabledResourceLinkUser=Disable feature to link a resource to users
DisabledResourceLinkContact=Disable feature to link a resource to contacts
EnableResourceUsedInEventCheck=Enable feature to check if a resource is in use in an event
EnableResourceUsedInEventCheck=Prohibit the use of the same resource at the same time in the agenda
ConfirmUnactivation=Confirm module reset
OnMobileOnly=On small screen (smartphone) only
DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be "Prospect" or "Customer", but can't be both)

View File

@ -1367,7 +1367,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
if ($dirins && $action == 'initdic' && $module && $dicname) {
if (!$error) {
$newdicname = $dicname;
if (!preg_match('/^c_/, $newdicname')) {
if (!preg_match('/^c_/', $newdicname)) {
$newdicname = 'c_'.$dicname;
}

View File

@ -80,41 +80,6 @@ class pdf_standard_myobject extends ModelePDFMyObject
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe Object that emits

View File

@ -38,6 +38,42 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
abstract class ModelePDFMyObject extends CommonDocGenerator
{
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules

View File

@ -591,7 +591,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -692,7 +692,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/mrp/mo_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/mrp/mo_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -641,7 +641,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/partnership/partnership_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/partnership/partnership_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -2890,7 +2890,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -360,8 +360,8 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us
print $product_static->getNomUrl(1, '', 16);
print "</td>\n";
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->label).'">'.dol_escape_htmltag($objp->label).'</td>';
print "<td>";
print dol_print_date($db->jdate($objp->datem), 'day');
print '<td title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($db->jdate($objp->datem), 'dayhour', 'tzuserrel')).'">';
print dol_print_date($db->jdate($objp->datem), 'day', 'tzuserrel');
print "</td>";
// Sell price
if (empty($conf->global->PRODUIT_MULTIPRICES)) {

View File

@ -461,7 +461,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/inventory/inventory_info.php?id='.$object->id);
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/inventory/inventory_info.php?id='.$object->id);
$morehtmlcenter = '';
// List of actions on element

View File

@ -968,7 +968,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
$MAXEVENT = 10;
$morehtmlcenter = '';
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/stock/agenda.php?id='.$object->id);
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/stock/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -677,7 +677,7 @@ while ($i < min($num, $limit)) {
}
} else {
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
print $form->textwithtooltip('<span class="opacitymedium">'.$langs->trans("Variable").'</span>', $htmltext);
}
print '</td>';
if (!$i) {

View File

@ -484,7 +484,7 @@ print '</span>';
print '<input type="file" name="userfile" size="20" maxlength="80"> &nbsp; &nbsp; ';
$out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : '');
print '<input type="submit" class="button" value="'.$langs->trans("ImportFromCSV").'"'.$out.' name="sendit">';
print '<input type="submit" class="button small" value="'.$langs->trans("ImportFromCSV").'"'.$out.' name="sendit">';
$out = '';
if (!empty($conf->global->MAIN_UPLOAD_DOC)) {
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb

View File

@ -1207,7 +1207,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id > 0)
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -225,10 +225,10 @@ if ($resql) {
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_user" value="'.dol_escape_htmltag($suser).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_ttc" value="'.dol_escape_htmltag($sttc).'">';
print '<td class="liste_titre right">';
print '<input type="text" class="flat width75" name="search_ttc" value="'.dol_escape_htmltag($sttc).'">';
print '</td>';
print '<td class="liste_titre">';
print '<td class="liste_titre center">';
print $form->selectDate($search_date, 'search_date', 0, 0, 1, '', 1, 0, 0, '');
print '</td>';
print '<td class="liste_titre right">';
@ -276,7 +276,8 @@ if ($resql) {
$param,
'',
$sortfield,
$sortorder
$sortorder,
'right '
);
print_liste_field_titre(
'OrderCreation',
@ -286,7 +287,8 @@ if ($resql) {
$param,
'',
$sortfield,
$sortorder
$sortorder,
'center '
);
print_liste_field_titre(
'Status',
@ -333,15 +335,15 @@ if ($resql) {
print '<td>'.$txt.'</td>';
// Amount
print '<td>'.price($obj->total_ttc).'</td>';
print '<td class="right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
// Date
if ($obj->dc) {
$date = dol_print_date($db->jdate($obj->dc), 'dayhour');
$date = dol_print_date($db->jdate($obj->dc), 'dayhour', 'tzuserrel');
} else {
$date = '-';
}
print '<td>'.$date.'</td>';
print '<td class="center">'.$date.'</td>';
// Statut
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';

View File

@ -565,7 +565,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// PMP value
print '<td class="right">';
if (price2num($objp->estimatedvalue, 'MT')) {
print price(price2num($objp->estimatedvalue, 'MT'), 1);
print '<span class="amount">'.price(price2num($objp->estimatedvalue, 'MT'), 1).'</span>';
} else {
print '';
}
@ -578,7 +578,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
print price(price2num($objp->sellvalue, 'MT'), 1);
} else {
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
print $form->textwithtooltip('<span class="opacitymedium">'.$langs->trans("Variable").'</span>', $htmltext);
}
print'</td>';

View File

@ -46,6 +46,7 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'aZ09');
@ -620,9 +621,12 @@ if ($action == 'create' && $user->rights->projet->creer) {
$url = '/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create');
$newbutton = '<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span>';
// TODO @LDR Implement this
//$tmpbacktopagejsfields = 'socid:search_socid';
//print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields);
print ' <a href="'.DOL_URL_ROOT.$url.'">'.$newbutton.'</a>';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$tmpbacktopagejsfields = 'addthirdparty:socid,search_socid';
print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields);
} else {
print ' <a href="'.DOL_URL_ROOT.$url.'">'.$newbutton.'</a>';
}
}
print '</td></tr>';
}
@ -1399,7 +1403,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/projet/info.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/info.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -247,7 +247,7 @@ if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition'));
$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition'));
$linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly btnTitleSelected'));
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);

View File

@ -834,7 +834,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$title = $langs->trans("ListOfTasks");
$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition btnTitleSelected'));
$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition btnTitleSelected'));
$linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly'));
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);

View File

@ -80,41 +80,6 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe Object that emits

View File

@ -38,6 +38,42 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
abstract class ModelePDFRecruitmentJobPosition extends CommonDocGenerator
{
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules

View File

@ -632,7 +632,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentcandidature_agenda.php?id='.$object->id);
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentcandidature_agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

Some files were not shown because too many files have changed in this diff Show More