diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index ca551c51e50..d35fcf44221 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -16,9 +16,10 @@ * along with this program. If not, see . */ - use Luracast\Restler\RestException; +use Luracast\Restler\RestException; + +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; /** * API class for Agenda Events @@ -51,33 +52,32 @@ class AgendaEvents extends DolibarrApi $this->actioncomm = new ActionComm($this->db); } - /** - * Get properties of a Agenda Events object - * - * Return an array with Agenda Events informations - * - * @param int $id ID of Agenda Events - * @return array|mixed Data without useless information - * - * @throws RestException - */ - public function get($id) - { - if (!DolibarrApiAccess::$user->rights->agenda->myactions->read) { - throw new RestException(401, "Insufficient rights to read an event"); - } - if ($id == 0) { - $result = $this->actioncomm->initAsSpecimen(); - } else { - $result = $this->actioncomm->fetch($id); - if ($result) { - $this->actioncomm->fetch_optionals(); - $this->actioncomm->fetchObjectLinked(); - } - } - if (!$result) { - throw new RestException(404, 'Agenda Events not found'); - } + /** + * Get properties of a Agenda Events object + * Return an array with Agenda Events informations + * + * @param int $id ID of Agenda Events + * @return array|mixed Data without useless information + * + * @throws RestException + */ + public function get($id) + { + if (!DolibarrApiAccess::$user->rights->agenda->myactions->read) { + throw new RestException(401, "Insufficient rights to read an event"); + } + if ($id === 0) { + $result = $this->actioncomm->initAsSpecimen(); + } else { + $result = $this->actioncomm->fetch($id); + if ($result) { + $this->actioncomm->fetch_optionals(); + $this->actioncomm->fetchObjectLinked(); + } + } + if (!$result) { + throw new RestException(404, 'Agenda Events not found'); + } if (!DolibarrApiAccess::$user->rights->agenda->allactions->read && $this->actioncomm->userownerid != DolibarrApiAccess::$user->id) { throw new RestException(401, "Insufficient rights to read event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index ccb413ecf6f..b44968e21bf 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -320,7 +320,7 @@ if ($action == 'create') print $langs->trans("Date"); print ''; print ''; - print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1); + print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1, 1); print ''; print "\n"; @@ -521,10 +521,10 @@ if ($id > 0) if ($action == 'edit') { print ''.$langs->trans("AmountTTC").""; - print ''; + print ''; print ""; } else { - print ''.$langs->trans("AmountTTC").''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountTTC").''.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).''; } // Mode of payment diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index e0d96112aec..d38b09d81ca 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1307,7 +1307,7 @@ class FormFile // $section is inside $param $newparam .= preg_replace('/&file=.*$/', '', $param); // We don't need param file= $backtopage = DOL_URL_ROOT.'/ecm/index.php?§ion_dir='.urlencode($relativepath).$newparam; - print ''.img_edit('default', 0, 'class="paddingrightonly"').''; + print ''.img_edit('default', 0, 'class="paddingrightonly"').''; } if (empty($useinecm) || $useinecm == 2 || $useinecm == 6) // 6=Media file manager @@ -1333,7 +1333,7 @@ class FormFile if ($permtoeditline) { $paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '§ion_dir='.urlencode($relativepath) : ''); - print ''.img_edit('default', 0, 'class="paddingrightonly"').''; + print ''.img_edit('default', 0, 'class="paddingrightonly"').''; } } if ($permonobject) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index cc00738ebeb..33e483ee757 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -422,6 +422,7 @@ if ($sql_select) $documentstatic->statut = $objp->status; $documentstatic->status = $objp->status; $documentstatic->paye = $objp->paid; + $documentstatic->alreadypaid = $objp->paid; if (is_object($documentstaticline)) $documentstaticline->statut = $objp->status; @@ -435,6 +436,8 @@ if ($sql_select) print ''; if ($type_element == 'contract') { print $documentstaticline->getLibStatut(5); + } elseif ($type_element == 'invoice') { + print $documentstatic->getLibStatut(5, $objp->paid); } else { print $documentstatic->getLibStatut(5); }