diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 062fcb1d998..485bd551976 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -44,6 +44,17 @@ $constname=GETPOST('constname', 'alpha'); $constvalue=GETPOST('constvalue', 'none'); // We shoul dbe able to send everything here $constnote=GETPOST('constnote', 'alpha'); +// Load variable for pagination +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (empty($sortfield)) $sortfield = 'entity,name'; +if (empty($sortorder)) $sortorder = 'ASC'; /* @@ -176,9 +187,11 @@ jQuery(document).ready(function() { print load_fiche_titre($langs->trans("OtherSetup"), '', 'title_setup'); -print $langs->trans("ConstDesc")."
\n"; +print ''.$langs->trans("ConstDesc")."
\n"; print "
\n"; +$param = ''; + print '
entity) && $debug)?'?debug=1':'').'" method="POST">'; print ''; print ''; @@ -186,16 +199,19 @@ print ''; print '
'; print ''; print ''; -print ''; +print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '')."\n"; print ''; print ''; -if (! empty($conf->multicompany->enabled) && !$user->entity) print ''; +print getTitleFieldOfList('DateModificationShort', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center')."\n"; +if (! empty($conf->multicompany->enabled) && !$user->entity) +{ + print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center')."\n"; +} print ''; print "\n"; // Line to add new record -$var=false; print "\n"; print ''."\n"; @@ -204,6 +220,8 @@ print ''; print ''; +print ''; // Limit to superadmin if (! empty($conf->multicompany->enabled) && !$user->entity) { @@ -229,13 +247,14 @@ $sql.= ", ".$db->decrypt('name')." as name"; $sql.= ", ".$db->decrypt('value')." as value"; $sql.= ", type"; $sql.= ", note"; +$sql.= ", tms"; $sql.= ", entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")"; if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug elseif (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name')); -$sql.= " ORDER BY entity, name ASC"; +$sql.= $db->order($sortfield, $sortorder); dol_syslog("Const::listConstant", LOG_DEBUG); $result = $db->query($sql); @@ -243,13 +262,11 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - $var=false; while ($i < $num) { $obj = $db->fetch_object($result); - print "\n"; print ''."\n"; @@ -267,6 +284,11 @@ if ($result) print ''; print ''; + // Date last change + print ''; + // Entity limit to superadmin if (! empty($conf->multicompany->enabled) && !$user->entity) { diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d15a9b960e4..5097ae7788b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -577,7 +577,7 @@ if ($id == 11) 'project' => $langs->trans('Project'), 'project_task' => $langs->trans('Task'), 'agenda' => $langs->trans('Agenda'), - 'resource' => $langs->trans('Resource'), + 'dolresource' => $langs->trans('Resource'), // old deprecated 'propal' => $langs->trans('Proposal'), 'commande' => $langs->trans('Order'), diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index 89f3e337099..2211f48e549 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -302,7 +302,7 @@ class Boms extends DolibarrApi private function _validate($data) { $myobject = array(); - foreach ($this->myobject->fields as $field => $propfield) { + foreach ($this->bom->fields as $field => $propfield) { if (in_array($field, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat')) || $propfield['notnull'] != 1) continue; // Not a mandatory field if (!isset($data[$field])) throw new RestException(400, "$field field missing"); diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 56147545f36..3e5a1a4c210 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -312,7 +312,7 @@ class Orders extends DolibarrApi * * @url PUT {id}/lines/{lineid} * - * @return object + * @return array|bool */ public function putLine($id, $lineid, $request_data = null) { diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index d558bf5ac7f..e31168fcced 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -316,7 +316,7 @@ class Invoices extends DolibarrApi * * @url PUT {id}/lines/{lineid} * - * @return object + * @return array * * @throws 200 * @throws 304 @@ -423,7 +423,7 @@ class Invoices extends DolibarrApi * * @url DELETE {id}/contact/{rowid} * - * @return int + * @return array * @throws 401 * @throws 404 * @throws 500 diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index c3914ae79db..e12dbbda0bb 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -66,10 +66,20 @@ class ChargeSociales extends CommonObject public $date_validation; /** - * @var int ID + * @var int account ID */ public $fk_account; + /** + * @var int account ID (identical to fk_account) + */ + public $accountid; + + /** + * @var int payment type (identical to mode_reglement_id in commonobject class) + */ + public $paiementtype; + /** * @var int ID */ diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 9084b6ad71a..1304c78c951 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -89,7 +89,7 @@ class box_commandes extends ModeleBoxes $sql = "SELECT s.nom as name"; $sql.= ", s.rowid as socid"; $sql.= ", s.code_client"; - $sql.= ", s.logo"; + $sql.= ", s.logo, s.email"; $sql.= ", c.ref, c.tms"; $sql.= ", c.rowid"; $sql.= ", c.date_commande"; @@ -130,6 +130,7 @@ class box_commandes extends ModeleBoxes $commandestatic->total_ttc = $objp->total_ttc; $societestatic->id = $objp->socid; $societestatic->name = $objp->name; + $societestatic->email = $objp->email; $societestatic->code_client = $objp->code_client; $societestatic->logo = $objp->logo; diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 3011234a3fb..ffd2684f369 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,7 +88,7 @@ class box_prospect extends ModeleBoxes { $sql = "SELECT s.nom as name, s.rowid as socid"; $sql.= ", s.code_client"; - $sql.= ", s.client"; + $sql.= ", s.client, s.email"; $sql.= ", s.code_fournisseur"; $sql.= ", s.fournisseur"; $sql.= ", s.logo"; @@ -116,6 +116,7 @@ class box_prospect extends ModeleBoxes $datem=$this->db->jdate($objp->tms); $thirdpartystatic->id = $objp->socid; $thirdpartystatic->name = $objp->name; + $thirdpartystatic->email = $objp->email; $thirdpartystatic->code_client = $objp->code_client; $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; $thirdpartystatic->client = $objp->client; diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 6dc7385d363..3ac555ba81f 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2006 Destailleur Laurent * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Raphaƫl Doursenaud - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,7 +85,7 @@ class box_supplier_orders extends ModeleBoxes { $sql = "SELECT s.nom as name, s.rowid as socid,"; $sql.= " s.code_client, s.code_fournisseur,"; - $sql.= " s.logo,"; + $sql.= " s.logo, s.email,"; $sql.= " c.rowid, c.ref, c.tms, c.date_commande,"; $sql.= " c.total_ht,"; $sql.= " c.tva as total_tva,"; @@ -118,6 +118,7 @@ class box_supplier_orders extends ModeleBoxes $thirdpartytmp->id = $objp->socid; $thirdpartytmp->name = $objp->name; + $thirdpartytmp->email = $objp->email; $thirdpartytmp->fournisseur = 1; $thirdpartytmp->code_fournisseur = $objp->code_fournisseur; $thirdpartytmp->logo = $objp->logo; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 577430592cf..5045660df0b 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -147,7 +147,7 @@ class FormTicket $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label($ticketstat->table_element); - print "\n\n"; + print "\n\n"; if ($withdolfichehead) dol_fiche_head(null, 'card', '', 0, ''); @@ -837,7 +837,7 @@ class FormTicket $outputlangs->load('other'); } - print "\n\n"; + print "\n\n"; $send_email = GETPOST('send_email', 'int') ? GETPOST('send_email', 'int') : 0; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 230c98a1d3c..698a8dfa67a 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -865,10 +865,42 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOST('page', 'int'); + $search_status = GETPOST("search_status", 'int'); if ($search_status=='') $search_status=1; // always display active customer first - $search_name = GETPOST("search_name", 'alpha'); - $search_addressphone = GETPOST("search_addressphone", 'alpha'); + + $search_name = GETPOST("search_name", 'alpha'); + $search_address = GETPOST("search_address", 'alpha'); + $search_poste = GETPOST("search_poste", 'alpha'); + + $searchAddressPhoneDBFields = array( + //Address + 't.address', + 't.zip', + 't.town', + + //Phone + 't.phone', + 't.phone_perso', + 't.phone_mobile', + + //Fax + 't.fax', + + //E-mail + 't.email', + + //Social media + "t.skype", + "t.jabberid", + "t.twitter", + "t.facebook", + "t.linkedin", + "t.whatsapp", + "t.youtube", + "t.snapchat", + "t.instagram" + ); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="t.lastname"; @@ -915,9 +947,12 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') // Initialize array of search criterias $search=array(); - foreach($contactstatic->fields as $key => $val) + foreach($arrayfields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); + $queryName = 'search_'.substr($key, 2); + if (GETPOST($queryName, 'alpha')){ + $search[$key]=GETPOST($queryName, 'alpha'); + } } $search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element, '', 'search_'); @@ -926,14 +961,15 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') { $search_status = ''; $search_name = ''; - $search_addressphone = ''; + $search_address = ''; + $search_poste = ''; + $search= []; $search_array_options=array(); foreach($contactstatic->fields as $key => $val) { $search[$key]=''; } - $toselect=''; } $contactstatic->fields = dol_sort_array($contactstatic->fields, 'position'); @@ -968,7 +1004,10 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $param="socid=".urlencode($object->id); if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_name != '') $param.='&search_name='.urlencode($search_name); + if ($search_poste != '') $param.='&search_poste='.urlencode($search_poste); + if ($search_address != '') $param.='&search_address='.urlencode($search_address); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + // Add $param from extra fields $extrafieldsobjectkey=$contactstatic->table_element; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -979,7 +1018,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; $sql .= " WHERE t.fk_soc = ".$object->id; if ($search_status!='' && $search_status != '-1') $sql .= " AND t.statut = ".$db->escape($search_status); - if ($search_name) $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name); + if ($search_name) $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name); + if ($search_poste) $sql .= natural_search('t.poste', $search_poste); + if ($search_address) $sql .= natural_search($searchAddressPhoneDBFields, $search_address); // Add where from extra fields $extrafieldsobjectkey=$contactstatic->table_element; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -995,17 +1036,21 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') // Fields title search // -------------------------------------------------------------------- print ''; - foreach($contactstatic->fields as $key => $val) + foreach($arrayfields as $key => $val) { $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; - if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) + if (in_array($val['type'], array('t.date','t.datetime','t.timestamp'))) $align.=($align?' ':'').'center'; + if (in_array($val['type'], array('t.timestamp'))) $align.=($align?' ':'').'nowrap'; + if ($key == 't.status' || $key == 't.statut') $align.=($align?' ':'').'center'; + if (! empty($arrayfields[$key]['checked'])) { print ''; } } @@ -1019,8 +1064,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') print $hookmanager->resPrint; // Action column print ''; print ''."\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e042d93ad36..82566804c2c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1368,12 +1368,23 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi { $width=80; $cssclass='photoref'; $showimage=$object->is_photo_available($conf->ticket->multidir_output[$entity].'/'.$object->ref); - $maxvisiblephotos=(isset($conf->global->TICKETSUP_MAX_VISIBLE_PHOTO)?$conf->global->TICKETSUP_MAX_VISIBLE_PHOTO:2); + $maxvisiblephotos=(isset($conf->global->TICKET_MAX_VISIBLE_PHOTO)?$conf->global->TICKET_MAX_VISIBLE_PHOTO:2); if ($conf->browser->layout == 'phone') $maxvisiblephotos=1; - if ($showimage) $morehtmlleft.='
'.$object->show_photos('ticket', $conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0).'
'; - else + if ($showimage) { - if (!empty($conf->global->TICKETSUP_NODISPLAYIFNOPHOTO)) { + $showphoto = $object->show_photos('ticket', $conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0); + if ($object->nbphoto > 0) + { + $morehtmlleft.='
'.$showphoto.'
'; + } + else + { + $showimage = 0; + } + } + if (! $showimage) + { + if (!empty($conf->global->TICKET_NODISPLAYIFNOPHOTO)) { $nophoto=''; $morehtmlleft.='
'; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 0b27e003b5f..f373c846ddb 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -502,38 +502,31 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $out.="\n"; $out.='
'; - $out.='
'.$langs->trans("Name").''.$langs->trans("Value").''.$langs->trans("Comment").''.$langs->trans("Entity").''.$langs->trans("Action").'
'; +print '
'.$obj->name.''; + print dol_print_date($db->jdate($obj->tms), 'dayhour'); + print '
'; - if (in_array($key, array('lastname','name'))) print ''; - elseif (in_array($key, array('statut'))) print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status); + if (in_array($key, array('t.statut'))){ + print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status); + }else{ + $fieldName = substr($key, 2); + print sprintf('', $fieldName, dol_escape_htmltag($search[$key])); + } print ''; - $searchpicto=$form->showFilterButtons(); - print $searchpicto; + print $form->showFilterButtons(); print '
'; + $out.='
'; $out.=''; - $out.=''; + //$out.=''; - $out.=''; + $out.=''; if ($donetodo) { - $out.=''; + $out.=''; } - $out.=''; - $out.=''; $out.=''; diff --git a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php index 9d24af321e7..d32b188d029 100644 --- a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php @@ -58,7 +58,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers $this->description = "Zapier triggers."; // 'development', 'experimental', 'dolibarr' or version $this->version = 'development'; - $this->picto = 'zapier@zapier'; + $this->picto = 'zapier'; } /** @@ -102,6 +102,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers return 0; } $logtriggeraction = false; + $sql = ''; if ($action!='') { $actions = explode('_', $action); $sql = 'SELECT rowid, url FROM '.MAIN_DB_PREFIX.'zapier_hook'; @@ -460,7 +461,7 @@ function cleanObjectDatas($toclean) if (isset($toclean->lines) && count($toclean->lines) > 0) { $nboflines = count($toclean->lines); for ($i=0; $i < $nboflines; $i++) { - $this->cleanObjectDatas($toclean->lines[$i]); + cleanObjectDatas($toclean->lines[$i]); } } diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 1e248071135..a8b38fe4620 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -147,6 +147,16 @@ else print 'Ok '.$langs->trans("PHPSupportCurl")."
\n"; } +// Check if PHP calendar extension is available +if (! function_exists("easter_date")) +{ + print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; +} +else +{ + print 'Ok '.$langs->trans("PHPSupportCalendar")."
\n"; +} + // Check if UTF8 supported if (! function_exists("utf8_encode")) diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 2fe7dc8c038..3ef3532a08e 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -13,6 +13,7 @@ PHPSupportPOSTGETOk=This PHP supports variables POST and GET. PHPSupportPOSTGETKo=It's possible your PHP setup does not support variables POST and/or GET. Check the parameter variables_order in php.ini. PHPSupportGD=This PHP supports GD graphical functions. PHPSupportCurl=This PHP supports Curl. +PHPSupportCalendar=This PHP supports calendars extensions. PHPSupportUTF8=This PHP supports UTF8 functions. PHPSupportIntl=This PHP supports Intl functions. PHPMemoryOK=Your PHP max session memory is set to %s. This should be enough. @@ -21,6 +22,7 @@ Recheck=Click here for a more detailed test ErrorPHPDoesNotSupportSessions=Your PHP installation does not support sessions. This feature is required to allow Dolibarr to work. Check your PHP setup and permissions of the sessions directory. ErrorPHPDoesNotSupportGD=Your PHP installation does not support GD graphical functions. No graphs will be available. ErrorPHPDoesNotSupportCurl=Your PHP installation does not support Curl. +ErrorPHPDoesNotSupportCalendar=Your PHP installation does not support php calendar extensions. ErrorPHPDoesNotSupportUTF8=Your PHP installation does not support UTF8 functions. Dolibarr cannot work correctly. Resolve this before installing Dolibarr. ErrorPHPDoesNotSupportIntl=Your PHP installation does not support Intl functions. ErrorDirDoesNotExists=Directory %s does not exist. diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index b2adc8ce5ff..f6e825b2190 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -75,7 +75,7 @@ class Contacts extends DolibarrApi throw new RestException(401, 'No permission to read contacts'); } if ($id ==0) { - $result = $this->contact->intiAsSpecimen(); + $result = $this->contact->initAsSpecimen(); } else { $result = $this->contact->fetch($id); } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 919961b4f8f..3c622a6769f 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -77,7 +77,7 @@ class Thirdparties extends DolibarrApi throw new RestException(401); } if ($id ==0) { - $result = $this->company->intiAsSpecimen(); + $result = $this->company->initAsSpecimen(); } else { $result = $this->company->fetch($id); } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 2c52ec513ff..eb47bc7044f 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -97,7 +97,7 @@ $url_page_current = DOL_URL_ROOT.'/ticket/card.php'; //if ($user->societe_id > 0) $socid = $user->societe_id; $result = restrictedArea($user, 'ticket', $object->id); -$triggermodname = 'TICKETSUP_MODIFY'; +$triggermodname = 'TICKET_MODIFY'; $permissiontoadd = $user->rights->ticket->write; $actionobject = new ActionsTicket($db); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 2f3ae74a358..586148d12f9 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2672,7 +2672,7 @@ class Ticket extends CommonObject global $conf, $langs; if ($conf->global->TICKET_DISABLE_ALL_MAILS) { - dol_syslog(get_class($this) . '::sendTicketMessageByEmail: Emails are disable into ticket setup by option TICKETSUP_DISABLE_ALL_MAILS', LOG_WARNING); + dol_syslog(get_class($this) . '::sendTicketMessageByEmail: Emails are disable into ticket setup by option TICKET_DISABLE_ALL_MAILS', LOG_WARNING); return ''; } diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index 239ee5227d6..287f1b9e3b7 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -210,7 +210,8 @@ class ZapierApi extends DolibarrApi $sql.= $db->plimit($limit + 1, $offset); } - $result = $db->query($sql); + $result = $db->query($sql); + $i = 0; if ($result) { $num = $db->num_rows($result); while ($i < $num) { @@ -240,9 +241,6 @@ class ZapierApi extends DolibarrApi */ public function post($request_data = null) { - // $debug = '
'.print_r($request_data, true).'
'; - // $debug .= '
'.print_r(DolibarrApiAccess::$user->rights->zapier, true).'
'; - // mail('frederic.france@free.fr', 'test hook', $debug); if (! DolibarrApiAccess::$user->rights->zapier->write) { throw new RestException(401); } diff --git a/htdocs/zapier/hook_agenda.php b/htdocs/zapier/hook_agenda.php index 924db3b8632..b536b264952 100644 --- a/htdocs/zapier/hook_agenda.php +++ b/htdocs/zapier/hook_agenda.php @@ -196,7 +196,7 @@ if ($object->id > 0) print '
'; $object->info($object->id); - print dol_print_object_info($object, 1); + dol_print_object_info($object, 1); print ''; diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index f52b7d21304..09880626972 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -413,7 +413,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase $result=dol_compress_file($filein, $fileout, $format, $errorstring); print __METHOD__." result=".$result."\n"; - $this->assertGreaterThanOrEqual(1, $result, "Pb with dol_compress_file ".$errorstring); + $this->assertGreaterThanOrEqual(1, $result, "Pb with dol_compress_file on ".$filein." : ".$errorstring); $result=dol_uncompress($fileout, $dirout); print __METHOD__." result=".join(',', $result)."\n";
'; - if($sortorder === 'desc') { - $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=asc' . $param; - $out .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateAsc'), 'fa fa-sort-numeric-down', $sortUrl, '', 1); - } - else{ - $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=desc' . $param; - $out .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateDesc'), 'fa fa-sort-numeric-down-alt', $sortUrl, '', 1); - } - $out.=''; + $out .= getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', '', $param, '', $sortfield, $sortorder, '')."\n"; + //$out.=''.$langs->trans("Search").' : '.$langs->trans("Search").' : '.$langs->trans("Type").' '; + $out.=''.$langs->trans("Type").' '; $out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1); - $out.=''; - $out.=''; + $out.=''; + $out.=''; $out.=$langs->trans("Label").' '; $out.=''; - $out.=''; + $out.=''; + $out.=''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); $out.=$searchpicto; - $out.=''; + $out.='