diff --git a/ChangeLog b/ChangeLog index 1ce34b5e87a..6fdbcfcd899 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ Following changes may create regressions for some external modules, but were nec * All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. * All properties 'type_libelle' were renamed into 'type_label'. * Renamed property of thirdparty "statut_commercial" into "status_prospect_label" +* The jquery plugin/dependency multiselect has been removed. It was not used by Dolibarr core. ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index c5201adedeb..e287db9c7c9 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -135,6 +135,10 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { + // Actions cancel, add, update, delete or clone + $backurlforlist = $_SERVER["PHP_SELF"].'?action=list'; + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + // Selection of new fields include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; @@ -344,7 +348,7 @@ print '
'; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -354,7 +358,7 @@ $newcardbutton = ''; if ($action != 'create') { $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER['PHP_SELF'].'?action=create', '', $permissiontoadd); } else { - print ''; + /*print ''; if ($optioncss != '') print ''; print ''; print ''; @@ -362,13 +366,18 @@ if ($action != 'create') { print ''; print ''; print ''; + */ print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("Email").'
'.$langs->trans("Signature").'
'.$langs->trans("Position").'
'.$langs->trans("Signature").''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); + print $doleditor->Create(1); + print '
'.$langs->trans("Position").'
'.$langs->trans("Status").''; - print ''; + print $form->selectyesno('active', GETPOST('active', 'int'), 1); print '
'; print '
'; @@ -377,7 +386,7 @@ if ($action != 'create') { print '   '; print ''; print ''; - print '
'; + //print ''; } print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 73408beefb0..92144f50934 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1437,7 +1437,7 @@ if ($id > 0) // related contact print ''.$langs->trans("ActionOnContact").''; print '
'; - print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 0, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid'); + print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid'); print '
'; print ''; print ''; diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 9c589c4ae3d..08736a3d268 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -294,7 +294,6 @@ class FormAdvTargetEmailing extends Form $options_array = array(); - $sql = "SELECT rowid, code, label as civilite, active FROM ".MAIN_DB_PREFIX."c_civility"; $sql .= " WHERE active = 1"; @@ -312,7 +311,6 @@ class FormAdvTargetEmailing extends Form // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut $label = ($langs->trans("Civility".$obj->code) != "Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->civilite != '-' ? $obj->civilite : '')); - $options_array[$obj->code] = $label; $i++; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index ac79c1fe0a7..47a31f11a72 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -736,35 +736,34 @@ if ($socid > 0) // Discount linked to invoice lines $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; - $sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql .= " rc.fk_facture_source,"; $sql .= " u.login, u.rowid as user_id,"; - $sql .= " f.rowid, f.ref,"; - $sql .= " fa.ref as ref, fa.type as type"; + $sql .= " f.rowid as invoiceid, f.ref,"; + $sql .= " fa.ref as invoice_source_ref, fa.type as type"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; $sql .= " , ".MAIN_DB_PREFIX."facturedet as fc"; $sql .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; - $sql .= " WHERE rc.fk_soc =".$object->id; + $sql .= " WHERE rc.fk_soc =". $object->id; $sql .= " AND rc.fk_facture_line = fc.rowid"; $sql .= " AND fc.fk_facture = f.rowid"; $sql .= " AND rc.fk_user = u.rowid"; $sql .= " AND rc.discount_type = 0"; // Eliminate supplier discounts $sql .= " ORDER BY dc DESC"; //$sql.= " UNION "; - // Remises liees a factures + // Discount linked to invoices $sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; $sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql2 .= " rc.fk_facture_source,"; $sql2 .= " u.login, u.rowid as user_id,"; - $sql2 .= " f.rowid, f.ref,"; - $sql2 .= " fa.ref as ref, fa.type as type"; + $sql2 .= " f.rowid as invoiceid, f.ref,"; + $sql2 .= " fa.ref as invoice_source_ref, fa.type as type"; $sql2 .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql2 .= " , ".MAIN_DB_PREFIX."user as u"; $sql2 .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; - $sql2 .= " WHERE rc.fk_soc =".$object->id; + $sql2 .= " WHERE rc.fk_soc =". $object->id; $sql2 .= " AND rc.fk_facture = f.rowid"; $sql2 .= " AND rc.fk_user = u.rowid"; $sql2 .= " AND rc.discount_type = 0"; // Eliminate supplier discounts @@ -833,7 +832,7 @@ if ($socid > 0) { print ''; $facturestatic->id = $obj->fk_facture_source; - $facturestatic->ref = $obj->ref; + $facturestatic->ref = $obj->invoice_source_ref; $facturestatic->type = $obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -842,7 +841,7 @@ if ($socid > 0) { print ''; $facturestatic->id = $obj->fk_facture_source; - $facturestatic->ref = $obj->ref; + $facturestatic->ref = $obj->invoice_source_ref; $facturestatic->type = $obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -851,7 +850,7 @@ if ($socid > 0) { print ''; $facturestatic->id = $obj->fk_facture_source; - $facturestatic->ref = $obj->ref; + $facturestatic->ref = $obj->invoice_source_ref; $facturestatic->type = $obj->type; print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -862,7 +861,12 @@ if ($socid > 0) print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''; + if ($obj->invoiceid) + { + print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + } + print ''; print ''.price($obj->amount_ht).''; if (!empty($conf->multicurrency->enabled)) { @@ -909,32 +913,32 @@ if ($socid > 0) $sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql .= " rc.fk_invoice_supplier_source,"; $sql .= " u.login, u.rowid as user_id,"; - $sql .= " f.rowid, f.ref as ref,"; - $sql .= " fa.ref, fa.type as type"; + $sql .= " f.rowid as invoiceid, f.ref as ref,"; + $sql .= " fa.ref as invoice_source_ref, fa.type as type"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; $sql .= " , ".MAIN_DB_PREFIX."facture_fourn_det as fc"; $sql .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; - $sql .= " WHERE rc.fk_soc =".$object->id; + $sql .= " WHERE rc.fk_soc =". $object->id; $sql .= " AND rc.fk_invoice_supplier_line = fc.rowid"; $sql .= " AND fc.fk_facture_fourn = f.rowid"; $sql .= " AND rc.fk_user = u.rowid"; $sql .= " AND rc.discount_type = 1"; // Eliminate customer discounts $sql .= " ORDER BY dc DESC"; //$sql.= " UNION "; - // Remises liees a factures + // Discount linked to invoices $sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; $sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql2 .= " rc.fk_invoice_supplier_source,"; $sql2 .= " u.login, u.rowid as user_id,"; - $sql2 .= " f.rowid, f.ref as ref,"; - $sql2 .= " fa.ref, fa.type as type"; + $sql2 .= " f.rowid as invoiceid, f.ref as ref,"; + $sql2 .= " fa.ref as invoice_source_ref, fa.type as type"; $sql2 .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql2 .= " , ".MAIN_DB_PREFIX."user as u"; $sql2 .= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql2 .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as fa ON rc.fk_invoice_supplier_source = fa.rowid"; - $sql2 .= " WHERE rc.fk_soc =".$object->id; + $sql2 .= " WHERE rc.fk_soc =". $object->id; $sql2 .= " AND rc.fk_invoice_supplier = f.rowid"; $sql2 .= " AND rc.fk_user = u.rowid"; $sql2 .= " AND rc.discount_type = 1"; // Eliminate customer discounts @@ -1003,7 +1007,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id = $obj->fk_invoice_supplier_source; - $facturefournstatic->ref = $obj->ref; + $facturefournstatic->ref = $obj->invoice_source_ref; $facturefournstatic->type = $obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1012,7 +1016,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id = $obj->fk_invoice_supplier_source; - $facturefournstatic->ref = $obj->ref; + $facturefournstatic->ref = $obj->invoice_source_ref; $facturefournstatic->type = $obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1021,7 +1025,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id = $obj->fk_invoice_supplier_source; - $facturefournstatic->ref = $obj->ref; + $facturefournstatic->ref = $obj->invoice_source_ref; $facturefournstatic->type = $obj->type; print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1032,7 +1036,11 @@ if ($socid > 0) print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''; + if ($obj->invoiceid) { + print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + } + print ''; print ''.price($obj->amount_ht).''; if (!empty($conf->multicurrency->enabled)) { diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index b6d91b235ba..5069135dd88 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -76,7 +76,7 @@ class Orders extends DolibarrApi * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id * @return array|mixed data without useless information * - * @url GET byRef/{ref} + * @url GET ref/{ref} * * @throws RestException */ @@ -94,7 +94,7 @@ class Orders extends DolibarrApi * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id * @return array|mixed data without useless information * - * @url GET byRefExt/{ref_ext} + * @url GET ref_ext/{ref_ext} * * @throws RestException */ diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 1b69e035fba..a593e10adf4 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -18,7 +18,7 @@ */ // Protection to avoid direct call of template -if (empty($conf) || ! is_object($conf)) { +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; } @@ -36,14 +36,14 @@ $langs->load("orders"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); -$total=0; -$ilink=0; -foreach($linkedObjectBlock as $key => $objectlink) +$total = 0; +$ilink = 0; +foreach ($linkedObjectBlock as $key => $objectlink) { $ilink++; - $trclass='oddeven'; - if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; + $trclass = 'oddeven'; + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total'; echo ''; echo ''.$langs->trans("CustomerOrder"); if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { @@ -62,14 +62,14 @@ foreach($linkedObjectBlock as $key => $objectlink) echo ''.$objectlink->getLibStatut(3).''; echo ''; // For now, shipments must stay linked to order, so link is not deletable - if($object->element != 'shipping') { + if ($object->element != 'shipping') { echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; } echo ''; echo "\n"; } if (count($linkedObjectBlock) > 1) { - echo ''; + echo ''; echo ''.$langs->trans("Total").''; echo ''; echo ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0d39cda6513..f0854eabde2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1216,7 +1216,7 @@ if (empty($reshook)) // Si facture standard $object->socid = GETPOST('socid', 'int'); $object->type = GETPOST('type'); - $object->ref = $_POST['ref']; + $object->ref = $_POST['ref']; $object->date = $dateinvoice; $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'none')); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index ee4208cd65e..0d718c2abc2 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -75,6 +75,7 @@ if ($action == 'add' && !empty($permissiontoadd)) if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') $value = ''; // This is an implicit foreign key field if (!empty($object->fields[$key]['foreignkey']) && $value == '-1') $value = ''; // This is an explicit foreign key field + //var_dump($key.' '.$value.' '.$object->fields[$key]['type']); $object->$key = $value; if ($val['notnull'] > 0 && $object->$key == '' && !is_null($val['default']) && $val['default'] == '(PROV)') { diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php new file mode 100644 index 00000000000..957c738ad22 --- /dev/null +++ b/htdocs/core/boxes/box_shipments.php @@ -0,0 +1,190 @@ + + * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2019 Alexandre Spangaro + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/boxes/box_shipments.php + * \ingroup shipment + * \brief Module for generating the display of the shipment box + */ + +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last shipments + */ +class box_shipments extends ModeleBoxes +{ + public $boxcode="lastcustomershipments"; + public $boximg="sending"; + public $boxlabel="BoxLastCustomerShipments"; + public $depends = array("expedition"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $param; + + public $info_box_head = array(); + public $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + global $user; + + $this->db=$db; + + $this->hidden=! ($user->rights->expedition->lire); + } + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + global $user, $langs, $conf; + $langs->loadLangs(array('orders', 'sendings')); + + $this->max = $max; + + include_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $shipmentstatic = new Expedition($this->db); + $orderstatic = new Commande($this->db); + $societestatic = new Societe($this->db); + + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomerShipments", $max)); + + if ($user->rights->expedition->lire) + { + $sql = "SELECT s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; + $sql.= ", s.logo, s.email"; + $sql.= ", e.ref, e.tms"; + $sql.= ", e.rowid"; + $sql.= ", e.ref_customer"; + $sql.= ", e.fk_statut"; + $sql.= ", e.fk_user_valid"; + $sql.= ", c.ref as commande_ref"; + $sql.= ", c.rowid as commande_id"; + $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; + $sql.= " WHERE e.entity = ".$conf->entity; + if (! empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) $sql.=" AND e.fk_statut = 1"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND sc.fk_user = " .$user->id; + else $sql.= " ORDER BY e.date_delivery, e.ref DESC "; + $sql.= $this->db->plimit($max, 0); + + $result = $this->db->query($sql); + if ($result) { + $num = $this->db->num_rows($result); + + $line = 0; + + while ($line < $num) { + $objp = $this->db->fetch_object($result); + + $shipmentstatic->id = $objp->rowid; + $shipmentstatic->ref = $objp->ref; + $shipmentstatic->ref_customer = $objp->ref_customer; + + $orderstatic->id= $objp->commande_id; + $orderstatic->ref=$objp->commande_ref; + + $societestatic->id = $objp->socid; + $societestatic->name = $objp->name; + $societestatic->email = $objp->email; + $societestatic->code_client = $objp->code_client; + $societestatic->logo = $objp->logo; + + $this->info_box_contents[$line][] = array( + 'td' => '', + 'text' => $shipmentstatic->getNomUrl(1), + 'asis' => 1, + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', + 'text' => $societestatic->getNomUrl(1), + 'asis' => 1, + ); + + $this->info_box_contents[$line][] = array( + 'td' => '', + 'text' => $orderstatic->getNomUrl(1), + 'asis' => 1, + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right" width="18"', + 'text' => $shipmentstatic->LibStatut($objp->fk_statut, 3), + ); + + $line++; + } + + if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedShipments")); + + $this->db->free($result); + } else { + $this->info_box_contents[0][0] = array( + 'td' => '', + 'maxlength'=>500, + 'text' => ($this->db->error().' sql='.$sql), + ); + } + } else { + $this->info_box_contents[0][0] = array( + 'td' => 'class="nohover opacitymedium left"', + 'text' => $langs->trans("ReadPermissionNotAllowed") + ); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1fb0fe17a75..bbd11c8f522 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6571,7 +6571,8 @@ abstract class CommonObject /** - * Function to show lines of extrafields with output datas + * Function to show lines of extrafields with output datas. + * This function is responsible to output the and according to correct number of columns received into $params['colspan'] * * @param Extrafields $extrafields Extrafield Object * @param string $mode Show output (view) or input (edit) for extrafield diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index b65d72332e0..41a0d485ce0 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -56,19 +56,28 @@ class EmailSenderProfile extends CommonObject public $picto = 'emailsenderprofile@monmodule'; + const STATUS_DISABLED = 0; + const STATUS_ENABLED = 1; + + /** - * 'type' if the field format. - * 'label' the translation key. - * 'enabled' is a condition when the filed must be managed. - * 'visible' says if field is visible in list (-1 means not shown by default but can be added into list to be viewed). - * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). - * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). - * 'position' is the sort order of field. - * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. - * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'help' is a string visible as a tooltip on field - * 'comment' is not used. You can store here any text of your choice. + * 'type' if the field format ('integer', 'integer:Class:pathtoclass', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float') + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'default' is a default value for creation (can still be replaced by the global setup of default values) + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'position' is the sort order of field. + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") */ // BEGIN MODULEBUILDER PROPERTIES @@ -78,7 +87,7 @@ class EmailSenderProfile extends CommonObject public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1), 'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1), //'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), //'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,), @@ -86,7 +95,7 @@ class EmailSenderProfile extends CommonObject 'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1), + 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1), ); /** diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cac859c53b5..d70993be51d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6521,6 +6521,7 @@ class Form elseif ($addjscombo == 2) { // Add other js lib + // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin // ... $out .= '$(document).ready(function () { $(\'#'.$htmlname.'\').multiSelect({ diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 68f4a3d5fba..d8225a1b2a5 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -133,7 +133,9 @@ class modExpedition extends DolibarrModules $r++; // Boxes - $this->boxes = array(); + $this->boxes = array( + 0=>array('file'=>'box_shipments.php','enabledbydefaulton'=>'Home'), + ); // Permissions $this->rights = array(); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 55b6907f912..e71d44cd573 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -667,6 +667,7 @@ class EmailCollector extends CommonObject /** * Return the connectstring to use with IMAP connection function * + * @param int $ssl Add /ssl tag * @param int $norsh Add /norsh to connectstring * @return string */ @@ -693,21 +694,20 @@ class EmailCollector extends CommonObject * @param string $str String to encode * @return string Encode string */ - function getEncodedUtf7($str) { + public function getEncodedUtf7($str) + { if (function_exists('mb_convert_encoding')) { - # change spaces by entropy because mb_convert fail with spaces + // change spaces by entropy because mb_convert fail with spaces $str=preg_replace("/ /", "xyxy", $str); - # if mb_convert work + // if mb_convert work if ($str = mb_convert_encoding($str, "UTF-7")) { - # change characters + // change characters $str=preg_replace("/\+A/", "&A", $str); - # change to spaces again + // change to spaces again $str=preg_replace("/xyxy/", " ", $str); - # return encoded string return $str; - # else } else { - # print error and return false + // print error and return false $this->error = "error: is not possible to encode this string '".$str."'"; return false; } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3f7abd4b4e5..ca543f5f2d5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2459,10 +2459,10 @@ elseif ($id || $ref) if (!empty($conf->productbatch->enabled)) $colspan++; if (!empty($conf->stock->enabled)) $colspan++; - $lines[$i]->fetch_optionals($lines[$i]->id); + $line = $lines[$i]; + $line->fetch_optionals($line->id); - print ''; - if ($action == 'editline' && $lines[$i]->id == $line_id) + if ($action == 'editline' && $line->id == $line_id) { print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); } @@ -2470,7 +2470,6 @@ elseif ($id || $ref) { print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); } - print ''; } } } diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index 1cc0e30934d..fbc1763beb3 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -17,7 +17,7 @@ */ // Protection to avoid direct call of template -if (empty($conf) || ! is_object($conf)) +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; @@ -35,14 +35,14 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; // Load translation files required by the page $langs->load("sendings"); -$total=0; -$ilink=0; -foreach($linkedObjectBlock as $key => $objectlink) +$total = 0; +$ilink = 0; +foreach ($linkedObjectBlock as $key => $objectlink) { $ilink++; - $trclass='oddeven'; - if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; + $trclass = 'oddeven'; + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total'; ?> trans("Shipment"); ?> @@ -58,7 +58,7 @@ foreach($linkedObjectBlock as $key => $objectlink) element != 'commande') { + if ($object->element != 'commande') { ?> ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> $objectlink) } if (count($linkedObjectBlock) > 1) { ?> - + trans("Total"); ?> diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6a5e29892d2..28610c14203 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2674,11 +2674,14 @@ else else $calculationrule = (empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND) ? 'totalofround' : 'roundoftotal'); if ($calculationrule == 'totalofround') $calculationrulenum = 1; else $calculationrulenum = 2; - $s = $langs->trans("ReCalculate").' '; - $s .= ''.$langs->trans("Mode1").''; - $s .= ' / '; - $s .= ''.$langs->trans("Mode2").''; - print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help')); + // Show link for "recalculate" + if (empty($object->getVentilExportCompta())) { + $s = $langs->trans("ReCalculate").' '; + $s .= ''.$langs->trans("Mode1").''; + $s .= ' / '; + $s .= ''.$langs->trans("Mode2").''; + print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help')); + } print ''; // Amount Local Taxes diff --git a/htdocs/includes/jquery/plugins/multiselect/jquery.multi-select.js b/htdocs/includes/jquery/plugins/multiselect/jquery.multi-select.js deleted file mode 100644 index ee62d1f588d..00000000000 --- a/htdocs/includes/jquery/plugins/multiselect/jquery.multi-select.js +++ /dev/null @@ -1,360 +0,0 @@ -// jquery.multi-select.js -// by mySociety -// https://github.com/mysociety/jquery-multi-select - -;(function($) { - - "use strict"; - - var pluginName = "multiSelect", - defaults = { - 'containerHTML': '
', - 'menuHTML': '
', - 'buttonHTML': '', - 'menuItemsHTML': '
', - 'menuItemHTML': '