diff --git a/ChangeLog b/ChangeLog index 5e4291b727c..c74f30755c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,42 @@ Following changes may create regressions for some external modules, but were nec +***** ChangeLog for 12.0.1 compared to 12.0.0 ***** +FIX: reposition was broken if url end with #anchor +FIX: $_POST must be GETPOST +FIX: 10.0 - fatal with postgreSQL +FIX: #14109 +FIX: #14112 +FIX: #14142 +FIX: all extrafields cleared after update of one of them +FIX: Avoid warning when creating a module with already existing files +FIX: change selected fields on company card +FIX: Correct ModuleBuilder left menu +FIX: create a deposit with amount using comma didn't work +FIX: CSS +FIX: Entry from stripe intent were reported into SEPA payments +FIX: Filter on status, closing opening status +FIX: html lost on html extrafield +FIX: Label of popup on thirdparty +FIX: missing possibility to change entity when propal cloning +FIX: missing setup of extrafields for MO +FIX: Missing the tooltip when creating bank account +FIX: Missing token +FIX: non numeric value on comm/card.php +FIX: SQL Problem in customer invoice list +FIX: SQL Problem in social contribution list +FIX: SQL Problem in supplier invoice list +FIX: SQL syntax error when editing extrafields +FIX: Sql type +FIX: takepos 12 hook +FIX: Update form erased extrafields that were hidden +FIX: Update of extrafields date +FIX: Update of extrafiels on draft object +FIX: upload documents into manual ECM was reported a permission error +FIX: Use of office365 TLS with SMTPs method. +FIX: wrong origin +FIX: Permission error during import + ***** ChangeLog for 12.0.0 compared to 11.0.0 ***** For users: diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 07614dcc618..b6bfbdc9942 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -254,6 +254,8 @@ if ($result) { } else { $tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60); } + + // Load of url links to the line into llx_bank $links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) //var_dump($i); @@ -319,6 +321,7 @@ if ($result) { $chargestatic->ref = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2); + $reg = array(); if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { if ($reg[1] == 'socialcontribution') $reg[1] = 'SocialContribution'; @@ -330,11 +333,13 @@ if ($result) { $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); $tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id; + // Retreive the accounting code of the social contribution of the payment from link of payment. + // Note: We have the social contribution id, it can be faster to get accounting code from social contribution id. $sqlmid = 'SELECT cchgsoc.accountancy_code'; - $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc "; + $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc"; $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; - $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; + $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'"; $sqlmid .= " WHERE bkurl.fk_bank=".$obj->rowid; dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=".$sqlmid, LOG_DEBUG); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 42628e08031..1707ff0bf31 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -401,8 +401,8 @@ if ($result) { // Ref product print ''; - if ($product_static->id > 0) print $product_static->getNomUrl(1); - if ($product_static->id > 0 && $objp->product_label) print '
'; + if ($productstatic->id > 0) print $productstatic->getNomUrl(1); + if ($productstatic->id > 0 && $objp->product_label) print '
'; if ($objp->product_label) print ''.$objp->product_label.''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7a2966a20e1..c113d9a0e63 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -460,8 +460,9 @@ asort($orders); //var_dump($modules); $nbofactivatedmodules = count($conf->modules); -$moreinfo = $langs->trans("TotalNumberOfActivatedModules", ($nbofactivatedmodules - 1), count($modules)); -if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule")); +$moreinfo = $langs->trans("TitleNumberOfActivatedModules"); +$moreinfo2 = ($nbofactivatedmodules - 1)." / ".count($modules); +if ($nbofactivatedmodules <= 1) $moreinfo2 .= ' '.img_warning($langs->trans("YouMustEnableOneModule")); print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); @@ -524,12 +525,12 @@ if ($mode == 'common' || $mode == 'commonkanban') $moreforfilter .= ''; $moreforfilter .= ''; - $moreforfilter .= '
'; - $moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'common' ? '' : ' btnTitleSelected'))); - $moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'commonkanban' ? '' : ' btnTitleSelected'))); - $moreforfilter .= '
'; + $moreforfilter .= ''; - $moreforfilter .= '
'.$moreinfo.'
'; + $moreforfilter .= '
'.$moreinfo.'
'.$moreinfo2.'
'; $moreforfilter .= ''; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index ab0184189a8..56e6cb59657 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -69,7 +69,7 @@ print ''.$form->textwithpicto($langs print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; // Cost -print ''.$langs->trans('CostPrice').''; +print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''; print ''; // No width to allow autodim diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 667c66848ae..e1e94dc2076 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -113,7 +113,7 @@ if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') { $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { } else { - print 'id.'#line_'.$line->id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; } print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 098aaa8224b..61a81495cf6 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -111,6 +111,7 @@ $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + /* * Actions */ @@ -310,7 +311,7 @@ if (empty($reshook) && $action == 'add') if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby", "int"); } - $object->note_private = trim(GETPOST("note")); + $object->note_private = trim(GETPOST("note", "none")); if (isset($_POST["contactid"])) $object->contact = $contact; @@ -451,7 +452,7 @@ if (empty($reshook) && $action == 'update') $object->contact_id = key($object->socpeopleassigned); } $object->fk_project = GETPOST("projectid", 'int'); - $object->note_private = GETPOST("note", "none"); + $object->note_private = trim(GETPOST("note", "none")); $object->fk_element = GETPOST("fk_element", "int"); $object->elementtype = GETPOST("elementtype", "alphanohtml"); @@ -1028,14 +1029,13 @@ if ($action == 'create') // Project if (!empty($conf->projet->enabled)) { - // Projet associe $langs->load("projects"); $projectid = GETPOST('projectid', 'int'); print ''.$langs->trans("Project").''; - $numproject = $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $numproject = $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' '; $urloption = '?action=create&donotclearsession=1'; @@ -1090,7 +1090,7 @@ if ($action == 'create') // Description print ''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); + $doleditor = new DolEditor('note', (GETPOST('note', 'none') ? GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); $doleditor->Create(); print ''; @@ -1541,7 +1541,7 @@ if ($id > 0) $linkback = ''; // Link to other agenda views $linkback .= img_picto($langs->trans("BackToList"), 'object_list-alt', 'class="hideonsmartphone pictoactionview"'); - $linkback .= ''.$langs->trans("BackToList").''; + $linkback .= ''.$langs->trans("BackToList").''; $linkback .= ''; $linkback .= '
  • '; $linkback .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"'); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index dd20325c194..4fb80592adf 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1207,8 +1207,8 @@ class ActionComm extends CommonObject $response->warning_delay = $conf->agenda->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("ActionsToDo"); $response->labelShort = $langs->trans("ActionsToDoShort"); - $response->url = DOL_URL_ROOT.'/comm/action/list.php?actioncode=0&status=todo&mainmenu=agenda'; - if ($user->rights->agenda->allactions->read) $response->url .= '&filtert=-1'; + $response->url = DOL_URL_ROOT.'/comm/action/list.php?action=show_list&actioncode=0&status=todo&mainmenu=agenda'; + if ($user->rights->agenda->allactions->read) $response->url .= '&filtert=-1'; $response->img = img_object('', "action", 'class="inline-block valigntextmiddle"'); } // This assignment in condition is not a bug. It allows walking the results. diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index fa4387b0861..028de1e6fb7 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -123,7 +123,7 @@ if ($object->id > 0) dol_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action'); $linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"'); - $linkback .= ''.$langs->trans("BackToList").''; + $linkback .= ''.$langs->trans("BackToList").''; // Link to other agenda views $out = ''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index dd04e5f757c..97d732f6908 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -150,6 +150,7 @@ if (GETPOST("viewlist", 'alpha') || $action == 'show_list') $param .= '&'.$key.'='.urlencode($val); } } + if (! preg_match('/action=/', $param)) $param .= ($param ? '&' : '').'action=show_list'; //print $param; header("Location: ".DOL_URL_ROOT.'/comm/action/list.php?'.$param); exit; @@ -329,9 +330,10 @@ if ($action == 'show_day') //print dol_print_date($firstdaytoshow,'day'); //print dol_print_date($lastdaytoshow,'day'); -$title = $langs->trans("DoneAndToDoActions"); +/*$title = $langs->trans("DoneAndToDoActions"); if ($status == 'done') $title = $langs->trans("DoneActions"); if ($status == 'todo') $title = $langs->trans("ToDoActions"); +*/ $param = ''; if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) { @@ -340,7 +342,7 @@ if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_act } else $param .= "&search_actioncode=".urlencode($actioncode); } if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid); -if ($status || isset($_GET['status']) || isset($_POST['status'])) $param .= "&search_status=".urlencode($status); +if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status); if ($filter) $param .= "&search_filter=".urlencode($filter); if ($filtert) $param .= "&search_filtert=".urlencode($filtert); if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup); @@ -358,7 +360,7 @@ if (empty($action) || $action == 'show_month') $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%b %Y"); $nav .= " \n"; $nav .= "   \n"; - $nav .= "   (".$langs->trans("Today").")"; + $nav .= "   ".$langs->trans("Today")." "; $picto = 'calendar'; } if ($action == 'show_week') @@ -367,7 +369,7 @@ if ($action == 'show_week') $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week; $nav .= " \n"; $nav .= "   trans("Next"))."\">\n"; - $nav .= "   (".$langs->trans("Today").")"; + $nav .= "   ".$langs->trans("Today")." "; $picto = 'calendarweek'; } if ($action == 'show_day') @@ -376,12 +378,13 @@ if ($action == 'show_day') $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "daytextshort"); $nav .= " \n"; $nav .= "   \n"; - $nav .= "   (".$langs->trans("Today").")"; + $nav .= "   ".$langs->trans("Today")." "; $picto = 'calendarday'; } $nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0); -$nav .= ' '; +//$nav .= ' '; +$nav .= ''; // Must be after the nav definition $param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : ''); @@ -404,10 +407,55 @@ print '
    '; print ''; -dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); -dol_fiche_end(); +//dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); +//print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); +//dol_fiche_end(); +$viewmode = ''; +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewList").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewCal").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewWeek").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewDay").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewPerUser").''; + +$viewmode .= ''; + + +$newcardbutton = ''; +if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) +{ + $tmpforcreatebutton = dol_getdate(dol_now(), true); + + $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + + //$param='month='.$monthshown.'&year='.$year; + $hourminsec = '100000'; + $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); +} // Define the legend/list of calendard to show $s = ''; $link = ''; @@ -440,7 +488,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on $s .= ''."\n"; // Local calendar - $s .= '
    '.$langs->trans("LocalAgenda").'  
    '; + $s .= '
    '.$langs->trans("LocalAgenda").'  
    '; // External calendars if (is_array($showextcals) && count($showextcals) > 0) @@ -487,9 +535,6 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on $link .= ''; } -print load_fiche_titre($s, $link.'     '.$nav, '', 0, 0, 'tablelistofcalendars'); - - // Load events from database into $eventarray $eventarray = array(); @@ -1109,6 +1154,11 @@ if (is_readable($color_file)) if (!is_array($theme_datacolor)) $theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220)); +print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 1, 0, 1, $viewmode); + +print $s; + + if (empty($action) || $action == 'show_month') // View by month { $newparam = $param; // newparam is for birthday links @@ -1122,6 +1172,9 @@ if (empty($action) || $action == 'show_month') // View by month $newparam = preg_replace('/showbirthday_=/i', 'showbirthday=', $newparam); // Restore correct parameter $newparam .= '&viewcal=1'; + print '
    '; + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
    '; print '
    '; print ''; @@ -1200,6 +1253,10 @@ if (empty($action) || $action == 'show_month') // View by month $newparam = preg_replace('/showbirthday_=/i', 'showbirthday=', $newparam); // Restore correct parameter $newparam .= '&viewweek=1'; + print '
    '; + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
    '; + print '
    '; print '
    '; print ' '; @@ -1256,7 +1313,11 @@ if (empty($action) || $action == 'show_month') // View by month $timestamp = dol_mktime(12, 0, 0, $month, $day, $year); $arraytimestamp = dol_getdate($timestamp); - //echo '
    '; + print '
    '; + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
    '; + + print '
    '; echo '
    '; echo ' '; @@ -1274,6 +1335,7 @@ if (empty($action) || $action == 'show_month') // View by month */ echo '
    '; + print '
    '; /* WIP View per hour */ $useviewhour = 0; @@ -1301,9 +1363,8 @@ if (empty($action) || $action == 'show_month') // View by month { echo '
    '."\n"; echo '
    '.dol_print_date($i * 3600, 'hour', 'gmt').'
    '; - echo '
    '; - echo "
    \n"; - echo "
    \n"; + echo '
    '."\n"; + echo ' '."\n"; $i++; $j++; } diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 20b756877cc..1c21140b12a 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -152,6 +152,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +//var_dump($_POST);exit; /* * Actions @@ -301,7 +302,7 @@ if ($user->rights->agenda->allactions->delete) { $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); } - +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $sql = "SELECT"; @@ -428,7 +429,9 @@ if ($resql) $arrayofselected = is_array($toselect) ? $toselect : array(); // Local calendar - $newtitle = '
    '.$langs->trans("LocalAgenda").'  
    '; + $newtitle = '
    '; + $newtitle .= ' '.$langs->trans("LocalAgenda").'   '; + $newtitle .= '
    '; //$newtitle=$langs->trans($title); $tabactive = 'cardlist'; @@ -439,7 +442,6 @@ if ($resql) if ($optioncss != '') print ''; print ''; - print ''; print ''; print ''; print ''; @@ -450,9 +452,9 @@ if ($resql) if ($showbirthday) $nav .= ''; print $nav; - dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); - dol_fiche_end(); + //dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); + //print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + //dol_fiche_end(); // Add link to show birthdays $link = ''; @@ -484,6 +486,39 @@ if ($resql) $s = $hookmanager->resPrint; } + $viewmode = ''; + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewList").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewCal").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewWeek").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewDay").''; + + $viewmode .= ''; + //$viewmode .= ''; + $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); + //$viewmode .= ''; + $viewmode .= ''.$langs->trans("ViewPerUser").''; + + $viewmode .= ''; + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { @@ -495,8 +530,12 @@ if ($resql) $hourminsec = '100000'; $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } + $param .= '&action='.$action; - print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1); + + print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, 'object_action', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1, $viewmode); + + print $s; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; @@ -506,6 +545,11 @@ if ($resql) $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); $i = 0; + + print '
    '; + print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print '
    '; + print '
    '; print ''."\n"; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 5b91dcd8c7c..7eb5b9e5c6d 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -700,7 +700,7 @@ jQuery(document).ready(function() { else if (ids.indexOf(",") > -1) /* There is several events */ { /* alert(\'several events\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/list.php?filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; + url = "'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; window.location.href = url; } else /* One event */ diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 81028796dc2..df285ba920a 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -284,7 +284,7 @@ $nav = "".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week; $nav .= " \n"; $nav .= "   trans("Next"))."\">\n"; -$nav .= "   (".$langs->trans("Today").")"; +$nav .= "   ".$langs->trans("Today")." "; /*$nav.='   '; $nav.=''; @@ -303,7 +303,8 @@ $nav.=''; $nav.=''; */ $nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0); -$nav .= ' '; +//$nav .= ' '; +$nav .= ' '; //$nav.=''; // Must be after the nav definition @@ -325,10 +326,6 @@ $head = calendars_prepare_head($paramnoaction); print ''."\n"; -dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); -dol_fiche_end(); - $showextcals = $listofextcals; // Legend if ($conf->use_javascript_ajax) @@ -381,6 +378,41 @@ if ($conf->use_javascript_ajax) } } +$massactionbutton = ''; + +$viewmode = ''; +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewList").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewCal").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewWeek").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewDay").''; + +$viewmode .= ''; +//$viewmode .= ''; +$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); +//$viewmode .= ''; +$viewmode .= ''.$langs->trans("ViewPerUser").''; + +$viewmode .= ''; + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) @@ -394,8 +426,24 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } +print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 1, 0, 1, $viewmode); + $link = ''; -print load_fiche_titre($s, $link.'     '.$nav.' '.$newcardbutton, ''); +//print load_fiche_titre('', $link.'     '.$nav.' '.$newcardbutton, ''); + +// Local calendar +$newtitle = '
    '; +$newtitle .= ' '.$langs->trans("LocalAgenda").'   '; +$newtitle .= '
    '; +//$newtitle=$langs->trans($title); + +$s = $newtitle; + +print $s; + +print '
    '; +print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); +print '
    '; @@ -650,7 +698,7 @@ while ($currentdaytoshow < $lastdaytoshow) { continue; } echo ''; $name = "actions-".$obj->month."-".$obj->year.".pdf"; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 56174b693a1..a2259b10a37 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -253,6 +253,9 @@ if (empty($reshook)) } $model = $object->modelpdf; $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) { + $object->fetch_thirdparty(); + } $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index a7517c9cb60..cab1a311dbb 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -59,9 +59,9 @@ if (GETPOST('action', 'aZ09') == 'setremise') $discount_type = GETPOST('discount_type', 'int'); if (!empty($discount_type)) { - $result = $object->set_remise_supplier(price2num(GETPOST("remise")), GETPOST("note"), $user); + $result = $object->set_remise_supplier(price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user); } else { - $result = $object->set_remise_client(price2num(GETPOST("remise")), GETPOST("note"), $user); + $result = $object->set_remise_client(price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user); } if ($result > 0) @@ -183,7 +183,7 @@ if ($socid > 0) // Motif/Note print ''; + print $langs->trans("NoteReason").''; print "
    '; - echo $langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7)); + echo ''.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7)).''; print "
    "; if ($i) print dol_print_date(dol_time_plus_duree($currentdaytoshow, $i, 'd'), 'day'); else print dol_print_date($currentdaytoshow, 'day'); @@ -864,7 +912,7 @@ jQuery(document).ready(function() { else if (ids.indexOf(",") > -1) /* There is several events */ { /* alert(\'several events\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/list.php?filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; + url = "'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; window.location.href = url; } else /* One event */ diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 35c0f7a890e..6852ec2476b 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.pdf.php'; $langs->loadLangs(array("agenda", "commercial")); $action = GETPOST('action', 'alpha'); -$month = GETPOST('month'); -$year = GETPOST('year'); +$month = GETPOST('month', 'int'); +$year = GETPOST('year', 'int'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -119,9 +119,8 @@ if ($resql) print ''; print ''; print ''; - print ''; - print_barre_liste($langs->trans("EventReports"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_agenda', 0, '', '', $limit); + print_barre_liste($langs->trans("EventReports"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_agenda', 0, '', '', $limit, 0, 0, 1); $moreforfilter = ''; @@ -154,7 +153,7 @@ if ($resql) // Button to build doc print '
    '; - print 'month.'&year='.$obj->year.'">'.img_picto($langs->trans('BuildDoc'), 'filenew').''; + print 'month.'&year='.$obj->year.'">'.img_picto($langs->trans('BuildDoc'), 'filenew').''; print '
    '; - print $langs->trans("NoteReason").'
    "; diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index 767c8f8709b..1e9c6e3b358 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -40,13 +40,7 @@ $id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('account', 'int')); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$num = (GETPOST('num', 'alpha') ? GETPOST('num', 'alpha') : GETPOST('sectionid', 'alpha')); - -$mesg = ''; -if (isset($_SESSION['DolMessage'])) { - $mesg = $_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} +$numref = (GETPOST('num', 'alpha') ? GETPOST('num', 'alpha') : GETPOST('sectionid', 'alpha')); // Security check if ($user->socid) { @@ -71,21 +65,74 @@ if (!$sortfield) $sortfield = "name"; $object = new Account($db); -if ($id > 0 || !empty($ref)) $object->fetch($id, $ref); +if ($id > 0 || !empty($ref)) +{ + $result = $object->fetch($id, $ref); + $account = $object->id; // Force the search field on id of account +} $result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', ''); +// Define number of receipt to show (current, previous or next one ?) +$found = false; +if ($_GET["rel"] == 'prev') +{ + // Recherche valeur pour num = numero releve precedent + $sql = "SELECT DISTINCT(b.num_releve) as num"; + $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql .= " WHERE b.num_releve < '".$db->escape($numref)."'"; + $sql .= " AND b.fk_account = ".$id; + $sql .= " ORDER BY b.num_releve DESC"; + + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $numrows = $db->num_rows($resql); + if ($numrows > 0) + { + $obj = $db->fetch_object($resql); + $numref = $obj->num; + $found = true; + } + } +} elseif ($_GET["rel"] == 'next') +{ + // Recherche valeur pour num = numero releve precedent + $sql = "SELECT DISTINCT(b.num_releve) as num"; + $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql .= " WHERE b.num_releve > '".$db->escape($numref)."'"; + $sql .= " AND b.fk_account = ".$id; + $sql .= " ORDER BY b.num_releve ASC"; + + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $numrows = $db->num_rows($resql); + if ($numrows > 0) + { + $obj = $db->fetch_object($resql); + $numref = $obj->num; + $found = true; + } + } +} else { + // On veut le releve num + $found = true; +} + /* * Actions */ -if (!empty($num)) +if (!empty($numref)) { $object->fetch_thirdparty(); - $upload_dir = $conf->bank->dir_output."/".$id."/statement/".dol_sanitizeFileName($num); + $upload_dir = $conf->bank->dir_output."/".$id."/statement/".dol_sanitizeFileName($numref); } -$backtopage = $_SERVER['PHP_SELF']."?account=".$id."&num=".$num; +$backtopage = $_SERVER['PHP_SELF']."?account=".$id."&num=".$numref; include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; @@ -101,10 +148,10 @@ llxHeader('', $title, $helpurl); if ($id > 0 || !empty($ref)) { if ($object->fetch($id, $ref)) { - $upload_dir = $conf->bank->dir_output."/".$id."/statement/".dol_sanitizeFileName($num); + $upload_dir = $conf->bank->dir_output."/".$id."/statement/".dol_sanitizeFileName($numref); // Onglets - $head = account_statement_prepare_head($object, $num); + $head = account_statement_prepare_head($object, $numref); dol_fiche_head($head, 'document', $langs->trans("AccountStatement"), -1, 'account'); @@ -115,8 +162,15 @@ if ($id > 0 || !empty($ref)) { $totalsize += $file['size']; } - $title = $langs->trans("AccountStatement").' '.$num.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); - print load_fiche_titre($title, '', ''); + $morehtmlright = ''; + $morehtmlright .= ''; + + $title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); + print load_fiche_titre($title, $morehtmlright, ''); print '
    '; print '
    '; @@ -134,9 +188,9 @@ if ($id > 0 || !empty($ref)) { $modulepart = 'bank'; $permission = $user->rights->banque->modifier; $permtoedit = $user->rights->banque->modifier; - $param = '&id='.$object->id.'&num='.urlencode($num); - $moreparam = '&num='.urlencode($num); ; - $relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($num)."/"; + $param = '&id='.$object->id.'&num='.urlencode($numref); + $moreparam = '&num='.urlencode($numref); ; + $relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/"; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 09cd81d4198..e3863cd2922 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -39,12 +39,6 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$mesg = ''; -if (isset($_SESSION['DolMessage'])) { - $mesg = $_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - // Security check if ($user->socid) { $action = ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ba5896d6d7d..aee53fe3f23 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -247,6 +247,8 @@ if (empty($numref)) $linkback = ''.$langs->trans("BackToList").''; + $morehtmlref = ''; + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_fiche_end(); @@ -362,17 +364,15 @@ if (empty($numref)) dol_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account'); - $mesprevnext = ''; - $mesprevnext .= ''; + $morehtmlright = ''; + $morehtmlright .= ''; $title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); - print load_fiche_titre($title, $mesprevnext, ''); + print load_fiche_titre($title, $morehtmlright, ''); //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, 0, $nbtotalofrecords, 'bank_account', 0, '', '', 0, 1); print ""; @@ -620,7 +620,7 @@ if (empty($numref)) if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { - print ''; + print ''; print img_edit(); print ""; } else { diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index d02f75819e4..09193b3ee91 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -178,7 +178,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($langs->trans("MenuVariousPayment"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); print '
    '; print ''."\n"; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 968c93fd25f..dae7ca358ac 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -451,6 +451,7 @@ while ($j < $numlt) // Payment Salary +/* if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) { if (!$mode || $mode != 'sconly') @@ -558,6 +559,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) } } } +*/ print ''; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 242b885375a..73b99341be3 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1333,7 +1333,7 @@ class FactureRec extends CommonInvoice $result = ''; - $label = ''.$langs->trans("ShowInvoice").''; + $label = ''.$langs->trans("RepeatableInvoice").''; if (!empty($this->ref)) { $label .= '
    '.$langs->trans('Ref').': '.$this->ref; } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 9c5ceea22bf..298866a2020 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -41,6 +41,8 @@ if ($user->socid > 0) $socid = $user->socid; } +$charge = new ChargeSociales($db); + /* * Actions @@ -161,7 +163,6 @@ $form = new Form($db); // Formulaire de creation d'un paiement de charge if ($action == 'create') { - $charge = new ChargeSociales($db); $charge->fetch($chid); $charge->accountid = $charge->fk_account ? $charge->fk_account : $charge->accountid; $charge->paiementtype = $charge->mode_reglement_id ? $charge->mode_reglement_id : $charge->paiementtype; @@ -223,7 +224,7 @@ if ($action == 'create') print '"; print ''; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 7221e932ca6..9ae666cb01a 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -486,7 +486,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom } /* - * Charges sociales non deductibles + * Social contributions */ $subtotal_ht = 0; @@ -499,7 +499,6 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql .= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " WHERE cs.fk_type = c.id"; - $sql .= " AND c.deductible = 0"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } elseif ($modecompta == "RECETTES-DEPENSES") @@ -510,7 +509,6 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom $sql .= ", ".MAIN_DB_PREFIX."paiementcharge as p"; $sql .= " WHERE p.fk_charge = cs.rowid"; $sql .= " AND cs.fk_type = c.id"; - $sql .= " AND c.deductible = 0"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } @@ -518,67 +516,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom $sql .= " AND cs.entity = ".$conf->entity; $sql .= " GROUP BY c.libelle, dm"; - dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0; - $decaiss[$obj->dm] += $obj->amount; - - if (!isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm] = 0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } -} elseif ($modecompta == "BOOKKEEPING") -{ - // Nothing from this table -} - - -/* - * Charges sociales deductibles - */ - -$subtotal_ht = 0; -$subtotal_ttc = 0; -if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) -{ - if ($modecompta == 'CREANCES-DETTES') - { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql .= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql .= " WHERE cs.fk_type = c.id"; - $sql .= " AND c.deductible = 1"; - if (!empty($date_start) && !empty($date_end)) - $sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - } elseif ($modecompta == "RECETTES-DEPENSES") - { - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql .= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql .= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql .= " WHERE p.fk_charge = cs.rowid"; - $sql .= " AND cs.fk_type = c.id"; - $sql .= " AND c.deductible = 1"; - if (!empty($date_start) && !empty($date_end)) - $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - } - - $sql .= " AND cs.entity = ".$conf->entity; - $sql .= " GROUP BY c.libelle, dm"; - - dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); + dol_syslog("get social contributions", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -713,7 +651,7 @@ if (!empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' | /* - * Donation get dunning paiement + * Donation get dunning payments */ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index f9d5a90d543..bcdfe1f5238 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -481,6 +481,8 @@ if ($id > 0) } $morehtmlref .= ''; + $morehtmlright = ''; + $linkback = ''.$langs->trans("BackToList").''; $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index fd46b8eba98..18a5b561387 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -576,7 +576,7 @@ while ($i < min($num, $limit)) // Ref if (!empty($arrayfields['c.ref']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 067b92bfc38..612f988305f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1173,6 +1173,7 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permissio } } +//var_dump($_POST);var_dump($massaction);exit; // Delete record from mass action (massaction = 'delete' for direct delete, action/confirm='delete'/'yes' with a confirmation step before) if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 852910ce9e3..afb33907593 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -47,8 +47,8 @@ top_httphead(); print ''."\n"; // Registering the location of boxes -if ((!empty($_POST['roworder'])) && (!empty($_POST['table_element_line'])) - && (!empty($_POST['fk_element'])) && (!empty($_POST['element_id']))) +if (GETPOST('roworder', 'alpha') && GETPOST('table_element_line', 'alpha', 2) + && GETPOST('fk_element', 'alpha', 2) && GETPOST('element_id', 'int', 2)) { $roworder = GETPOST('roworder', 'alpha', 2); $table_element_line = GETPOST('table_element_line', 'alpha', 2); diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index f645062dcab..aae8e0356d0 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -143,7 +143,7 @@ class box_services_contracts extends ModeleBoxes $thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur; $dateline = $this->db->jdate($objp->date_line); - if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); + if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && !empty($dateline) && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); // Multilangs if (!empty($conf->global->MAIN_MULTILANGS) && $objp->product_id > 0) // if option multilang is on diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6045e4232c2..885dcb5c490 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6715,12 +6715,12 @@ abstract class CommonObject if (!is_object($form)) $form = new Form($db); + $out = ''; + $parameters=array(); - $reshook=$hookmanager->executeHooks('showOptionals',$parameters,$this,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { - $out = ''; - if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { $out .= "\n"; @@ -6942,11 +6942,15 @@ abstract class CommonObject setListDependencies(); }); '."\n"; - $out .= ' '."\n"; } + + $out .= ' '."\n"; } - return $out; - } // end of hook manager + } + + $out .= $hookmanager->resPrint; + + return $out; } @@ -7797,6 +7801,9 @@ abstract class CommonObject $sql .= ' FROM '.MAIN_DB_PREFIX.$objectline->table_element; $sql .= ' WHERE fk_'.$this->element.' = '.$this->id; if ($morewhere) $sql .= $morewhere; + if (isset($objectline->fields['position'])) { + $sql .= $this->db->order('position', 'ASC'); + } $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 97c45e2f926..089e9fb6717 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -207,6 +207,7 @@ class HookManager 'restrictedArea', 'sendMail', 'sendMailAfter', + 'showOptionals', 'showLinkToObjectBlock', 'setContentSecurityPolicy', 'setHtmlTitle', diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index f4e551c6452..6969066629c 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -926,12 +926,12 @@ class FormCompany extends Form $out .= ''; } elseif ($typeinput == 'list') { $out .= ''; - if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { - $out .= ''; - } if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $out .= ''; } + if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { + $out .= ''; + } $out .= ''; $out .= ''; } elseif ($typeinput == 'admin') { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3914f3d1e08..444c14c41c4 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -51,6 +51,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { global $conf, $user, $langs, $db, $hookmanager; global $begin_h, $end_h, $begin_d, $end_d; + global $massaction; $langs->load("companies"); @@ -63,44 +64,36 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''; print ''; - print ''; + if ($massaction != 'predelete') { // When $massaction == 'predelete', action may be already output to 'delete' by the mass action system. + print ''; + } print ''; - print '
    '; - - if ($conf->browser->layout == 'phone') print '
    '; - else print '
    '.$langs->trans("Date").''; $datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : 0; - print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); + print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1, 0, '', '', $charge->date_ech, '', 1, $langs->trans("DateOfSocialContribution")); print "
    '; + print ''; print $contractstatic->getNomUrl(1, 16); print '
    '; - - if ($conf->browser->layout == 'phone') print '
    '; - else print '
    '; - - print ''; - if ($canedit) { + print '
    '; // Type - print '
    '; - print ''; + print ''; // Assigned to - print ''; - print ''; + print ''; if ($conf->resource->enabled) { @@ -108,25 +101,21 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh $formresource = new FormResource($db); // Resource - print ''; - print ''; + print ''; } } if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { - print ''; - print ''; + print ''; } if (!empty($conf->projet->enabled) && $user->rights->projet->lire) @@ -134,80 +123,57 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; $formproject = new FormProjets($db); - print ''; - print ''; + print ''; } if ($canedit && !preg_match('/list/', $_SERVER["PHP_SELF"])) { // Status - print ''; - print ''; + print ''; } if ($canedit && $action == 'show_peruser') { + print '
    '; // Filter on hours - print '
    '; - print ''; - print "'; + print ''; // Filter on days - print ''; - print ''; - print "'; + print ''; } // Hooks $parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid); + $object = null; $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been - print '
    '; - print $langs->trans("Type"); - print ''; + print ''; + print ''.$langs->trans("Type").''; $multiselect = 0; if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" { $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); } - print ''; print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500'); - print '
    '; - print $langs->trans("ActionsToDoBy").'   '; - print ''; + print '
    '; print img_picto('', 'user', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("ActionsToDoBy").''; print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500'); - if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or").' '.$langs->trans("ToUserOfGroup").'   '; - else print '
    '; + print '
    '; + print '
    '; print img_picto('', 'object_group', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("ToUserOfGroup").''; print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500'); - print '
    '; - print $langs->trans("Resource"); - print ''; - print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); + print '
    '; + print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("Resource").''; print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); - print '
    '; - print $langs->trans("ThirdParty").'   '; - print ''; + print '
    '; print img_picto('', 'company', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("ThirdParty").''; print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); - print '
    '; - print $langs->trans("Project").'   '; - print ''; + print '
    '; print img_picto('', 'project', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("Project").''; print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); - print '
    '; - print $langs->trans("Status"); - print '  '; + print '
    '; + print img_picto('', 'setup', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("Status").''; $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); - print '
    '.$langs->trans("VisibleTimeRange").'"; - print '
    '; + print img_picto('', 'clock', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("VisibleTimeRange").''; + print "\n".'
    '; print ''; if (empty($conf->dol_use_jmobile)) print ' - '; else print '
    '; print ''; if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H"); print '
    '; - print '
    '.$langs->trans("VisibleDaysRange").'"; - print '
    '; + print '
    '; + print img_picto('', 'clock', 'class="fawidth30 inline-block"'); + print ''.$langs->trans("VisibleDaysRange").''; + print "\n".'
    '; print ''; if (empty($conf->dol_use_jmobile)) print ' - '; else print '
    '; print ''; print '
    '; - print '
    '; - - if ($conf->browser->layout == 'phone') print ''; - else print '
    '; - - print ''; - print '
    '; - print '
    '; - print ''; - print '
    '; - print '
    '; - - if ($conf->browser->layout == 'phone') print ''; - else print '
    '; - - print '
    '; // Close fichecenter print '
    '; - - //print ''; } @@ -248,7 +214,7 @@ function show_array_actions_to_do($max = 5) print '
    '; print ''; print ''; - print ''; + print ''; print ''; $var = true; @@ -344,7 +310,7 @@ function show_array_last_actions_done($max = 5) print '
    '; print '
    '.$langs->trans("LastActionsToDo", $max).''.$langs->trans("FullList").''.$langs->trans("FullList").'
    '; print ''; - print ''; + print ''; print ''; $var = true; $i = 0; @@ -520,7 +486,7 @@ function calendars_prepare_head($param) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php'.($param ? '?'.$param : ''); + $head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php?action=show_list'.($param ? '&'.$param : ''); $head[$h][1] = $langs->trans("ViewList"); $head[$h][2] = 'cardlist'; $h++; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 8e782c3a7fd..c0e6c84ea54 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -61,7 +61,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen $script .= '
    '.$langs->trans("LastDoneTasks", $max).''.$langs->trans("FullList").''.$langs->trans("FullList").'