diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 3b9019868ec..37b3540a0f5 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -612,7 +612,7 @@ class ChargeSociales extends CommonObject } $linkclose = ''; - if (empty($notooltip) && $user->rights->facture->lire) { + if (empty($notooltip) && $user->hasRight("facture", "read")) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $langs->trans("SocialContribution"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 1ce6bed212b..9dce58171ae 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -345,8 +345,8 @@ class Tva extends CommonObject $this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_modif = $obj->fk_user_modif; $this->fk_account = $obj->fk_account; - $this->fk_type = $obj->fk_type; - $this->rappro = $obj->rappro; + $this->fk_type = !empty($obj->fk_type) ? $obj->fk_type : ""; + $this->rappro = !empty($obj->fk_type) ? $obj->rappro : ""; } $this->db->free($resql); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 309ea1e4a87..ffc2ef8ca68 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -55,6 +55,7 @@ $search_type = GETPOST('search_type', 'int'); $search_account = GETPOST('search_account', 'int'); $search_amount = GETPOST('search_amount', 'alpha'); $search_status = GETPOST('search_status', 'int'); +$ltt = GETPOST("ltt", "int"); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -278,6 +279,13 @@ if (!empty($search_amount)) { if ($search_status != '' && $search_status != '-1') { $param .= '&search_status='.urlencode($search_status); } +$arrayofmassactions = array( + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), +); +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +$moreforfilter = ''; print '
'; if ($optioncss != '') { @@ -294,7 +302,7 @@ $url = DOL_URL_ROOT.'/compta/tva/card.php?action=create'; if (!empty($socid)) { $url .= '&socid='.$socid; } -$newcardbutton = dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer); +$newcardbutton = dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer); print_barre_liste($langs->trans("VATDeclarations"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); $varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage; @@ -429,6 +437,9 @@ print ''; $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; +$total = 0; + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -523,7 +534,11 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } $totalarray['pos'][$totalarray['nbfield']] = 'amount'; - $totalarray['val']['amount'] += $obj->amount; + if (empty($totalarray['val']['amount'])) { + $totalarray['val']['amount'] = $obj->amount; + } else { + $totalarray['val']['amount'] += $obj->amount; + } } if (!empty($arrayfields['t.status']['checked'])) { diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 38a5884da1c..33d5b5716bc 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -42,6 +42,7 @@ $langs->loadLangs(array('compta', 'bills')); $mode = GETPOST("mode", 'alpha'); $year = GETPOST("year", 'int'); $filtre = GETPOST("filtre", 'alpha'); +$optioncss = GETPOST('optioncss', 'alpha'); if (!$year && $mode != 'tvaonly') { $year = date("Y", time()); } @@ -113,6 +114,8 @@ print ''; print ''; print ''; +$center = ''; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit); if ($year) { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index ae73fdfd15a..761a1ea9522 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -494,7 +494,9 @@ if ($action == 'create') { print ''; print ''.$langs->trans('NotePublic').''; print ''; - + if (!isset($note_public)) { + $note_public = $object->getDefaultCreateValueFor('note_public'); + } $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ''; @@ -504,7 +506,9 @@ if ($action == 'create') { print ''; print ''.$langs->trans('NotePrivate').''; print ''; - + if (!isset($note_private)) { + $note_private = $object->getDefaultCreateValueFor('note_private'); + } $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ''; @@ -672,6 +676,7 @@ if (!empty($id) && $action == 'edit') { /* */ /* ************************************************************ */ if (!empty($id) && $action != 'edit') { + $formconfirm = ""; // Confirmation delete if ($action == 'delete') { $text = $langs->trans("ConfirmDeleteADonation"); @@ -802,7 +807,7 @@ if (!empty($id) && $action != 'edit') { $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $i = 0; $total = 0; + $i = 0; $total = 0; $totalpaid = 0; print ''; print ''; print ''; @@ -832,7 +837,7 @@ if (!empty($id) && $action != 'edit') { $remaintopay = $object->amount - $totalpaid; print ""; - print '\n"; + print '\n"; } print "
'.$langs->trans("RefPayment").'
".$langs->trans("RemainderToPay")." :'.price($remaintopay)."
'.price($remaintopay)."
"; $db->free($resql); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 080ac3b9540..b52e0974b9a 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -406,9 +406,9 @@ class Don extends CommonObject $sql .= ", ".((int) $user->id); $sql .= ", null"; $sql .= ", '".$this->db->idate($this->date)."'"; - $sql .= ", '".$this->db->escape(trim($this->email))."'"; - $sql .= ", '".$this->db->escape(trim($this->phone))."'"; - $sql .= ", '".$this->db->escape(trim($this->phone_mobile))."'"; + $sql .= ", '".(!empty($this->email) ? $this->db->escape(trim($this->email)) : "")."'"; + $sql .= ", '".(!empty($this->phone) ? $this->db->escape(trim($this->phone)) : "")."'"; + $sql .= ", '".(!empty($this->phone_mobile) ? $this->db->escape(trim($this->phone_mobile)) : "")."'"; $sql .= ")"; $resql = $this->db->query($sql); @@ -989,7 +989,7 @@ class Don extends CommonObject $this->user_creation_id = $obj->fk_user_author; $this->user_validation_id = $obj->fk_user_valid; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->tms); + $this->date_modification = (!empty($obj->tms) ? $this->db->jdate($obj->tms) : ""); } $this->db->free($result); } else { diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 219a5116658..b6b7e6a24d3 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -78,7 +78,7 @@ if (!$sortfield) { $object = new Don($db); $object->fetch($id, $ref); -$upload_dir = $conf->don->dir_output.'/'.get_exdir($filename, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); +$upload_dir = $conf->don->dir_output.'/'.get_exdir($id, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); $modulepart = 'don'; $permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 1ab7220d894..c3cb4d9ce58 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -41,6 +41,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$type = GETPOST('type', 'aZ'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -61,7 +62,7 @@ $search_company = GETPOST('search_company', 'alpha'); $search_name = GETPOST('search_name', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); - +$moreforfilter = GETPOST('moreforfilter', 'alpha'); if (!$user->rights->don->lire) { accessforbidden(); } @@ -198,7 +199,7 @@ if ($resql) { } print '
'; - print ''."\n"; + print '
'."\n"; // Filters lines print '';