Merge remote-tracking branch 'upstream/develop' into Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword

This commit is contained in:
Frédéric FRANCE 2020-05-23 18:54:33 +02:00
commit 5aa84c64d0
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
29 changed files with 682 additions and 200 deletions

View File

@ -263,7 +263,7 @@ if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$param = ''; $param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
if ($search_account) $param .= '&search_account='.urlencode($search_account); if ($search_account) $param .= '&search_account='.urlencode($search_account);

View File

@ -438,7 +438,17 @@ if ($conf->use_javascript_ajax) {
} }
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AlwaysShowFullArbo").'</td>';
print '<td class="right">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_ALWAYS_SHOW_FULL_ARBO');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval, $conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
}
print "</td>\n";
print "</tr>\n";
print '</table>'; print '</table>';
/* /*

View File

@ -537,13 +537,14 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} elseif ($action == 'setdate_livraison' && $usercancreate) { } elseif ($action == 'setdate_livraison' && $usercancreate) {
// print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$result = $object->set_date_livraison($user, $datelivraison); $object->fetch($id);
if ($result < 0) { $result = $object->set_date_livraison($user, $datedelivery);
setEventMessages($object->error, $object->errors, 'errors'); if ($result < 0) {
} setEventMessages($object->error, $object->errors, 'errors');
}
} elseif ($action == 'setmode' && $usercancreate) { } elseif ($action == 'setmode' && $usercancreate) {
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
if ($result < 0) if ($result < 0)
@ -1617,15 +1618,14 @@ if ($action == 'create' && $usercancreate)
print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date
print '</td></tr>'; print '</td></tr>';
// Delivery date planed // Date delivery planned
print "<tr><td>".$langs->trans("DateDeliveryPlanned").'</td><td>'; print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
if (empty($datedelivery)) print '<td colspan="3">';
{ //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed.
if (!empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
else $datedelivery = empty($conf->global->MAIN_AUTOFILL_DATE_DELIVERY) ?-1 : ''; print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
} print "</td>\n";
print $form->selectDate($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1); print '</tr>';
print "</td></tr>";
// terms of the settlement // terms of the settlement
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>'; print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
@ -2139,11 +2139,11 @@ if ($action == 'create' && $usercancreate)
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">'; print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison"); print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print $object->date_livraison ? dol_print_date($object->date_livraison, 'daytext') : '&nbsp;'; print $object->date_livraison ? dol_print_date($object->date_livraison, 'dayhour') : '&nbsp;';
if ($object->hasDelay() && !empty($object->date_livraison)) { if ($object->hasDelay() && !empty($object->date_livraison)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
} }

View File

@ -1142,7 +1142,7 @@ if ($resql)
if (!empty($arrayfields['c.date_delivery']['checked'])) if (!empty($arrayfields['c.date_delivery']['checked']))
{ {
print '<td class="center">'; print '<td class="center">';
print dol_print_date($db->jdate($obj->date_delivery), 'day'); print dol_print_date($db->jdate($obj->date_delivery), 'dayhour');
print '</td>'; print '</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }

View File

@ -157,10 +157,15 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
$tplcontent .= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n"; $tplcontent .= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n";
$tplcontent .= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n"; $tplcontent .= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n";
$tplcontent .= '<meta name="dolibarr:pageid" content="'.dol_string_nohtmltag($objectpage->id).'" />'."\n"; $tplcontent .= '<meta name="dolibarr:pageid" content="'.dol_string_nohtmltag($objectpage->id).'" />'."\n";
// Add canonical reference
if ($object->virtualhost) {
$tplcontent .= '<link rel="canonical" href="'.(($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')).'" />'."\n";
}
// Add translation reference (main language) // Add translation reference (main language)
if ($object->isMultiLang()) { if ($object->isMultiLang()) {
// Add myself // Add myself
$tplcontent .= '<link rel="alternate" hreflang="'.$shortlangcode.'" href="'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php').'" />'."\n"; $tplcontent .= '<?php if ($_SERVER["PHP_SELF"] == "'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n";
$tplcontent .= '<link rel="alternate" hreflang="'.$shortlangcode.'" href="'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php').'" />'."\n";
// Add page "translation of" // Add page "translation of"
$translationof = $objectpage->fk_page; $translationof = $objectpage->fk_page;
@ -171,7 +176,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
$tmpshortlangcode = ''; $tmpshortlangcode = '';
if ($tmppage->lang) $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en if ($tmppage->lang) $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en
if ($tmpshortlangcode != $shortlangcode) { if ($tmpshortlangcode != $shortlangcode) {
$tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="'.($object->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$tmppage->pageurl.'.php').'" />'."\n"; $tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="'.($object->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php').'" />'."\n";
} }
} }
} }
@ -192,11 +197,10 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
} }
} }
} }
} else dol_print_error($db); } else {
} dol_print_error($db);
// Add canonical reference }
if ($object->virtualhost) { $tplcontent .= '<?php } ?>'."\n";
$tplcontent .= '<link rel="canonical" href="'.(($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')).'" />'."\n";
} }
// Add manifest.json on homepage // Add manifest.json on homepage
$tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n"; $tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n";

View File

@ -1024,11 +1024,11 @@ class pdf_azur extends ModelePDFPropales
* Show total to pay * Show total to pay
* *
* @param PDF $pdf Object PDF * @param PDF $pdf Object PDF
* @param Facture $object Object invoice * @param Propal $object Object propal
* @param int $deja_regle Montant deja regle * @param int $deja_regle Amount already paid
* @param int $posy Position depart * @param int $posy Start position
* @param Translate $outputlangs Objet langs * @param Translate $outputlangs Objet langs
* @return int Position pour suite * @return int Position for continuation
*/ */
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{ {
@ -1040,7 +1040,7 @@ class pdf_azur extends ModelePDFPropales
$tab2_hl = 4; $tab2_hl = 4;
$pdf->SetFont('', '', $default_font_size - 1); $pdf->SetFont('', '', $default_font_size - 1);
// Tableau total // Total table
$col1x = 120; $col2x = 170; $col1x = 120; $col2x = 170;
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {

View File

@ -56,6 +56,7 @@ $search_ref_exp = GETPOST("search_ref_exp", 'alpha');
$search_ref_liv = GETPOST('search_ref_liv', 'alpha'); $search_ref_liv = GETPOST('search_ref_liv', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha');
$search_company = GETPOST("search_company", 'alpha'); $search_company = GETPOST("search_company", 'alpha');
$search_tracking = GETPOST("search_tracking", 'alpha');
$search_town = GETPOST('search_town', 'alpha'); $search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state")); $search_state = trim(GETPOST("search_state"));
@ -106,6 +107,7 @@ $fieldstosearchall = array(
'e.ref'=>"Ref", 'e.ref'=>"Ref",
's.nom'=>"ThirdParty", 's.nom'=>"ThirdParty",
'e.note_public'=>'NotePublic', 'e.note_public'=>'NotePublic',
'e.tracking_number'=>"TrackingNumber",
); );
if (empty($user->socid)) $fieldstosearchall["e.note_private"] = "NotePrivate"; if (empty($user->socid)) $fieldstosearchall["e.note_private"] = "NotePrivate";
@ -120,6 +122,7 @@ $arrayfields = array(
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
'e.date_delivery'=>array('label'=>$langs->trans("DateDeliveryPlanned"), 'checked'=>1), 'e.date_delivery'=>array('label'=>$langs->trans("DateDeliveryPlanned"), 'checked'=>1),
'e.tracking_number'=>array('label'=>$langs->trans("TrackingNumber"), 'checked'=>1),
'e.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0), 'e.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0),
'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
@ -172,6 +175,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_state = ""; $search_state = "";
$search_type = ''; $search_type = '';
$search_country = ''; $search_country = '';
$search_tracking='';
$search_type_thirdparty = ''; $search_type_thirdparty = '';
$search_billed = ''; $search_billed = '';
$search_datedelivery_start = ''; $search_datedelivery_start = '';
@ -214,7 +218,7 @@ llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
$sql = 'SELECT'; $sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed,"; $sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,";
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, "; $sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
$sql .= " typent.code as typent_code,"; $sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -273,6 +277,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_zip) $sql .= natural_search("s.zip", $search_zip); if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
if ($search_state) $sql .= natural_search("state.nom", $search_state); if ($search_state) $sql .= natural_search("state.nom", $search_state);
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
if ($search_tracking) $sql.= natural_search("e.tracking_number", $search_tracking);
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale; if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp); if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
@ -330,6 +335,7 @@ if ($resql)
if ($search_user > 0) $param .= '&search_user='.urlencode($search_user); if ($search_user > 0) $param .= '&search_user='.urlencode($search_user);
if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale); if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale);
if ($search_company) $param .= "&amp;search_company=".urlencode($search_company); if ($search_company) $param .= "&amp;search_company=".urlencode($search_company);
if ($search_tracking) $param.= "&amp;search_tracking=".urlencode($search_tracking);
if ($search_town) $param .= '&search_town='.urlencode($search_town); if ($search_town) $param .= '&search_town='.urlencode($search_town);
if ($search_zip) $param .= '&search_zip='.urlencode($search_zip); if ($search_zip) $param .= '&search_zip='.urlencode($search_zip);
@ -507,6 +513,13 @@ if ($resql)
print '</div>'; print '</div>';
print '</td>'; print '</td>';
} }
// Tracking number
if (! empty($arrayfields['e.tracking_number']['checked']))
{
print '<td class="liste_titre center">';
print '<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).'">';
print '</td>';
}
if (!empty($arrayfields['l.ref']['checked'])) if (!empty($arrayfields['l.ref']['checked']))
{ {
// Delivery ref // Delivery ref
@ -579,6 +592,7 @@ if ($resql)
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['e.weight']['checked'])) print_liste_field_titre($arrayfields['e.weight']['label'], $_SERVER["PHP_SELF"], "e.weight", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['e.weight']['checked'])) print_liste_field_titre($arrayfields['e.weight']['label'], $_SERVER["PHP_SELF"], "e.weight", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['e.date_delivery']['checked'])) print_liste_field_titre($arrayfields['e.date_delivery']['label'], $_SERVER["PHP_SELF"], "e.date_delivery", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['e.date_delivery']['checked'])) print_liste_field_titre($arrayfields['e.date_delivery']['label'], $_SERVER["PHP_SELF"], "e.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['e.tracking_number']['checked'])) print_liste_field_titre($arrayfields['e.tracking_number']['label'], $_SERVER["PHP_SELF"], "e.tracking_number", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['l.ref']['checked'])) print_liste_field_titre($arrayfields['l.ref']['label'], $_SERVER["PHP_SELF"], "l.ref", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['l.ref']['checked'])) print_liste_field_titre($arrayfields['l.ref']['label'], $_SERVER["PHP_SELF"], "l.ref", "", $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['l.date_delivery']['checked'])) print_liste_field_titre($arrayfields['l.date_delivery']['label'], $_SERVER["PHP_SELF"], "l.date_delivery", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['l.date_delivery']['checked'])) print_liste_field_titre($arrayfields['l.date_delivery']['label'], $_SERVER["PHP_SELF"], "l.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
// Extra fields // Extra fields
@ -697,13 +711,19 @@ if ($resql)
if (!empty($arrayfields['e.date_delivery']['checked'])) if (!empty($arrayfields['e.date_delivery']['checked']))
{ {
print '<td class="center">'; print '<td class="center">';
print dol_print_date($db->jdate($obj->date_livraison), "day"); print dol_print_date($db->jdate($obj->date_livraison), "dayhour");
/*$now = time(); /*$now = time();
if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 ) if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 )
{ {
}*/ }*/
print "</td>\n"; print "</td>\n";
} }
// Tracking number
if (! empty($arrayfields['e.tracking_number']['checked']))
{
print '<td class="center">'.$obj->tracking_number."</td>\n";
if (! $i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked'])) if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked']))
{ {

View File

@ -103,16 +103,17 @@ if (empty($reshook))
} }
if ($action == 'setdatedelivery' && $user->rights->commande->creer) if ($action == 'setdatedelivery' && $user->rights->commande->creer)
{ {
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$object = new Commande($db); $object->fetch($id);
$object->fetch($id); $result = $object->set_date_livraison($user, $datedelivery);
$result = $object->set_date_livraison($user, $datelivraison); if ($result < 0)
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
}
/* /*
if ($action == 'setdeliveryaddress' && $user->rights->commande->creer) if ($action == 'setdeliveryaddress' && $user->rights->commande->creer)
{ {
@ -352,7 +353,7 @@ if ($id > 0 || !empty($ref))
// Date // Date
print '<tr><td>'.$langs->trans('Date').'</td>'; print '<tr><td>'.$langs->trans('Date').'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print dol_print_date($object->date, 'daytext'); print dol_print_date($object->date, 'day');
if ($object->hasDelay() && empty($object->date_livraison)) { if ($object->hasDelay() && empty($object->date_livraison)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
} }
@ -373,11 +374,11 @@ if ($id > 0 || !empty($ref))
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdatedelivery">'; print '<input type="hidden" name="action" value="setdatedelivery">';
print $form->selectDate($object->date_livraison > 0 ? $object->date_livraison : -1, 'liv_', '', '', '', "setdatedelivery"); print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print dol_print_date($object->date_livraison, 'daytext'); print dol_print_date($object->date_livraison, 'dayhour');
if ($object->hasDelay() && !empty($object->date_livraison)) { if ($object->hasDelay() && !empty($object->date_livraison)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
} }

View File

@ -435,7 +435,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) { if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
$board = new RemiseCheque($db); $board = new RemiseCheque($db);
$dashboardlines['RemiseCheque'] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);
} }
// Number of foundation members // Number of foundation members
@ -450,21 +450,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) { if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db); $board = new ExpenseReport($db);
$dashboardlines['ExpenseReport'] = $board->load_board($user, 'toapprove'); $dashboardlines[$board->element . '_toapprove'] = $board->load_board($user, 'toapprove');
} }
// Number of expense reports to pay // Number of expense reports to pay
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) { if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db); $board = new ExpenseReport($db);
$dashboardlines['ExpenseReport'] = $board->load_board($user, 'topay'); $dashboardlines[$board->element . '_topay'] = $board->load_board($user, 'topay');
} }
// Number of holidays to approve // Number of holidays to approve
if (!empty($conf->holiday->enabled) && $user->rights->holiday->approve) { if (!empty($conf->holiday->enabled) && $user->rights->holiday->approve) {
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$board = new Holiday($db); $board = new Holiday($db);
$dashboardlines['Holiday'] = $board->load_board($user); $dashboardlines[$board->element] = $board->load_board($user);
} }
$object = new stdClass(); $object = new stdClass();
@ -549,28 +549,28 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
array( array(
'groupName' => 'BankAccount', 'groupName' => 'BankAccount',
'stats' => 'stats' =>
array('bank_account', 'RemiseCheque'), array('bank_account', 'chequereceipt'),
), ),
'Adherent' => 'member' =>
array( array(
'groupName' => 'Members', 'groupName' => 'Members',
'globalStatsKey' => 'members', 'globalStatsKey' => 'members',
'stats' => 'stats' =>
array('member_shift', 'member_expired'), array('member_shift', 'member_expired'),
), ),
'ExpenseReport' => 'expensereport' =>
array( array(
'groupName' => 'ExpenseReport', 'groupName' => 'ExpenseReport',
'globalStatsKey' => 'expensereports', 'globalStatsKey' => 'expensereports',
'stats' => 'stats' =>
array('ExpenseReport'), array('expensereport_toapprove', 'expensereport_topay'),
), ),
'Holiday' => 'holiday' =>
array( array(
'groupName' => 'Holidays', 'groupName' => 'Holidays',
'globalStatsKey' => 'holidays', 'globalStatsKey' => 'holidays',
'stats' => 'stats' =>
array('Holiday'), array('holiday'),
), ),
); );

View File

@ -252,6 +252,7 @@ ALTER TABLE llx_blockedlog ADD COLUMN object_version varchar(32) DEFAULT '';
ALTER TABLE llx_product_lot MODIFY COLUMN batch varchar(128); ALTER TABLE llx_product_lot MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_product_batch MODIFY COLUMN batch varchar(128); ALTER TABLE llx_product_batch MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_expeditiondet_batch MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_commande_fournisseur_dispatch MODIFY COLUMN batch varchar(128); ALTER TABLE llx_commande_fournisseur_dispatch MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_stock_mouvement MODIFY COLUMN batch varchar(128); ALTER TABLE llx_stock_mouvement MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_mrp_production MODIFY COLUMN batch varchar(128); ALTER TABLE llx_mrp_production MODIFY COLUMN batch varchar(128);

View File

@ -33,4 +33,7 @@
-- For v13 -- For v13
ALTER TABLE llx_commande MODIFY COLUMN date_livraison DATETIME;
ALTER TABLE llx_website ADD COLUMN position integer DEFAULT 0; ALTER TABLE llx_website ADD COLUMN position integer DEFAULT 0;

View File

@ -64,8 +64,8 @@ create table llx_commande
fk_currency varchar(3), -- currency code fk_currency varchar(3), -- currency code
fk_cond_reglement integer, -- condition de reglement fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement fk_mode_reglement integer, -- mode de reglement
date_livraison date default NULL, date_livraison datetime default NULL,
fk_shipping_method integer, -- shipping method id fk_shipping_method integer, -- shipping method id
fk_warehouse integer default NULL, fk_warehouse integer default NULL,
fk_availability integer NULL, fk_availability integer NULL,

View File

@ -187,6 +187,8 @@ ShowCardHere=Show card
Search=Search Search=Search
SearchOf=Search SearchOf=Search
SearchMenuShortCut=Ctrl + shift + f SearchMenuShortCut=Ctrl + shift + f
QuickAdd=Quick add
QuickAddMenuShortCut=Ctrl + shift + l
Valid=Valid Valid=Valid
Approve=Approve Approve=Approve
Disapprove=Disapprove Disapprove=Disapprove
@ -1032,4 +1034,4 @@ DeleteFileHeader=Confirm file delete
DeleteFileText=Do you really want delete this file? DeleteFileText=Do you really want delete this file?
ShowOtherLanguages=Show other languages ShowOtherLanguages=Show other languages
SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language
NotUsedForThisCustomer=Not used for this customer NotUsedForThisCustomer=Not used for this customer

View File

@ -218,3 +218,4 @@ InventoryForASpecificWarehouse=Inventory for a specific warehouse
InventoryForASpecificProduct=Inventory for a specific product InventoryForASpecificProduct=Inventory for a specific product
StockIsRequiredToChooseWhichLotToUse=Stock is required to choose which lot to use StockIsRequiredToChooseWhichLotToUse=Stock is required to choose which lot to use
ForceTo=Force to ForceTo=Force to
AlwaysShowFullArbo=Display full tree of warehouse on popup of warehouse links (Warning: This may decrease dramatically performances)

View File

@ -218,3 +218,4 @@ InventoryForASpecificWarehouse=Inventaire pour un entrepôt spécifique
InventoryForASpecificProduct=Inventaire pour un produit spécifique InventoryForASpecificProduct=Inventaire pour un produit spécifique
StockIsRequiredToChooseWhichLotToUse=Le module Stock est requis pour choisir une lot StockIsRequiredToChooseWhichLotToUse=Le module Stock est requis pour choisir une lot
ForceTo=Forcer à ForceTo=Forcer à
AlwaysShowFullArbo=Toujours afficher l'arborescence complète dans le lien vers la fiche

View File

@ -1678,6 +1678,11 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$toprightmenu .= top_menu_search(); $toprightmenu .= top_menu_search();
} }
if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) {
// Add search dropdown
$toprightmenu .= top_menu_quickadd();
}
// Add bookmark dropdown // Add bookmark dropdown
$toprightmenu .= top_menu_bookmark(); $toprightmenu .= top_menu_bookmark();
@ -1886,6 +1891,226 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
return $btnUser; return $btnUser;
} }
/**
* Build the tooltip on top menu quick add
*
* @return string HTML content
*/
function top_menu_quickadd()
{
global $langs, $conf, $db, $hookmanager, $user;
global $menumanager;
$html = '';
// Define $dropDownQuickAddHtml
$dropDownQuickAddHtml = '<div class="dropdown-header bookmark-header center">';
$dropDownQuickAddHtml.= $langs->trans('QuickAdd');
$dropDownQuickAddHtml.= '</div>';
$dropDownQuickAddHtml.= '<div class="quickadd-body dropdown-body">';
$dropDownQuickAddHtml.= '<div class="quickadd">';
if (! empty($conf->societe->enabled) && $user->rights->societe->creer) {
$langs->load("companies");
$dropDownQuickAddHtml.= '
<!-- Thirdparty link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/societe/card.php?action=create" title="'.$langs->trans("MenuNewThirdParty").'">
<i class="fal fa-building fa-2x"></i><br>
'.$langs->trans("ThirdParty").'
</a>
</div>
';
}
if (! empty($conf->societe->enabled) && $user->rights->societe->contact->creer) {
$langs->load("companies");
$dropDownQuickAddHtml.= '
<!-- Contact link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/contact/card.php?action=create" title="'.$langs->trans("NewContactAddress").'">
<i class="fal fa-address-book fa-2x"></i><br>
'.$langs->trans("Contact").'
</a>
</div>
';
}
if (! empty($conf->propal->enabled) && $user->rights->propale->creer) {
$langs->load("propal");
$dropDownQuickAddHtml.= '
<!-- Propal link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create" title="'.$langs->trans("NewPropal").'">
<i class="fal fa-suitcase fa-2x"></i><br>
'.$langs->trans("Proposal").'
</a>
</div>
';
}
if (! empty($conf->commande->enabled) && $user->rights->commande->creer) {
$langs->load("orders");
$dropDownQuickAddHtml.= '
<!-- Order link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
<i class="fal fa-file-alt fa-2x"></i><br>
'.$langs->trans("Order").'
</a>
</div>
';
}
if (! empty($conf->facture->enabled) && $user->rights->facture->creer) {
$langs->load("bills");
$dropDownQuickAddHtml.= '
<!-- Invoice link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
<i class="fal fa-coins fa-2x"></i><br>
'.$langs->trans("Bill").'
</a>
</div>
';
}
if (! empty($conf->contrat->enabled) && $user->rights->contrat->creer) {
$langs->load("contracts");
$dropDownQuickAddHtml.= '
<!-- Contract link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create" title="'.$langs->trans("NewContractSubscription").'">
<i class="fal fa-file-contract fa-2x"></i><br>
'.$langs->trans("Contract").'
</a>
</div>
';
}
if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) {
$langs->load("supplier_proposal");
$dropDownQuickAddHtml.= '
<!-- Supplier proposal link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create" title="'.$langs->trans("NewAskPrice").'">
<i class="fal fa-suitcase fa-2x"></i><br>
'.$langs->trans("AskPrice").'
</a>
</div>
';
}
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer) {
$langs->load("orders");
$dropDownQuickAddHtml.= '
<!-- Supplier order link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create" title="'.$langs->trans("NewOrder").'">
<i class="fal fa-file-alt fa-2x"></i><br>
'.$langs->trans("SupplierOrder").'
</a>
</div>
';
}
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer) {
$langs->load("bills");
$dropDownQuickAddHtml.= '
<!-- Supplier invoice link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create" title="'.$langs->trans("NewBill").'">
<i class="fal fa-coins fa-2x"></i><br>
'.$langs->trans("SupplierBill").'
</a>
</div>
';
}
if (! empty($conf->product->enabled) && $user->rights->produit->creer) {
$langs->load("products");
$dropDownQuickAddHtml.= '
<!-- Product link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=0" title="'.$langs->trans("NewProduct").'">
<i class="fal fa-cube fa-2x"></i><br>
'.$langs->trans("Product").'
</a>
</div>
';
}
if (! empty($conf->service->enabled) && $user->rights->service->creer) {
$langs->load("products");
$dropDownQuickAddHtml.= '
<!-- Service link -->
<div class="quickaddblock center">
<a class="quickadddropdown-icon-link" href="'.DOL_URL_ROOT.'/product/card.php?action=create&amp;type=1" title="'.$langs->trans("NewService").'">
<i class="fal fa-concierge-bell fa-2x"></i><br>
'.$langs->trans("Service").'
</a>
</div>
';
}
// Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>')
$parameters = array();
$result = $hookmanager->executeHooks('printQuickAddBlock', $parameters); // Note that $action and $object may have been modified by some hooks
if (is_numeric($result))
{
if ($result == 0)
$dropDownQuickAddHtml.= $hookmanager->resPrint; // add
else
$dropDownQuickAddHtml = $hookmanager->resPrint; // replace
}
else
{
$dropDownQuickAddHtml.= $result; // For backward compatibility
}
$dropDownQuickAddHtml.= '</div>';
$dropDownQuickAddHtml.= '</div>';
$html.= '<!-- div for quick add link -->
<div id="topmenu-quickadd-dropdown" class="atoplogin dropdown inline-block">
<a class="dropdown-toggle login-dropdown-a" data-toggle="dropdown" href="#" title="'.$langs->trans('QuickAdd').' ('.$langs->trans('QuickAddMenuShortCut').')">
<i class="fal fa-plus-circle" ></i>
</a>
<div class="dropdown-menu">
'.$dropDownQuickAddHtml.'
</div>
</div>';
$html .= '
<!-- Code to show/hide the user drop-down -->
<script>
$( document ).ready(function() {
$(document).on("click", function(event) {
if (!$(event.target).closest("#topmenu-quickadd-dropdown").length) {
// Hide the menus.
$("#topmenu-quickadd-dropdown").removeClass("open");
}
});
$("#topmenu-quickadd-dropdown .dropdown-toggle").on("click", function(event) {
openQuickAddDropDown();
});
// Key map shortcut
$(document).keydown(function(e){
if( e.which === 76 && e.ctrlKey && e.shiftKey ){
console.log(\'control + shift + l : trigger open quick add dropdown\');
openQuickAddDropDown();
}
});
var openQuickAddDropDown = function() {
event.preventDefault();
$("#topmenu-quickadd-dropdown").toggleClass("open");
//$("#top-quickadd-search-input").focus();
}
});
</script>
';
return $html;
}
/** /**
* Build the tooltip on top menu bookmark * Build the tooltip on top menu bookmark

View File

@ -121,7 +121,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject
{ {
global $db, $conf; global $db, $conf;
// D'abord on recupere la valeur max // First we get the max value
$posindice = 9; $posindice = 9;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; $sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject";

View File

@ -724,7 +724,7 @@ class Entrepot extends CommonObject
$result .= $linkstart; $result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto != 2) $result .= ($showfullpath ? $this->get_full_arbo() : (empty($this->label) ? $this->libelle : $this->label)); if ($withpicto != 2) $result .= (($showfullpath || !empty($conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO)) ? $this->get_full_arbo() : (empty($this->label)?$this->libelle:$this->label));
$result .= $linkend; $result .= $linkend;
return $result; return $result;

View File

@ -4,6 +4,7 @@ html,body {
margin:0; margin:0;
height:100%; height:100%;
width:100%; width:100%;
background-color: #FFF !important;
} }
.container{ .container{
@ -17,14 +18,14 @@ html,body {
.phonerow1{ .phonerow1{
margin: 0 auto; margin: 0 auto;
width: 100%; width: 100%;
height: 40%; height: auto;
min-height: 40%; min-height: 40%;
} }
.phonerow2{ .phonerow2{
margin: 0 auto; margin: 0 auto;
width: 100%; width: 100%;
height: 40%; height: auto;
} }
.phonebuttonsrow{ .phonebuttonsrow{
@ -90,7 +91,71 @@ button.publicphonebutton {
text-align: center; text-align: center;
overflow: visible; /* removes extra width in IE */ overflow: visible; /* removes extra width in IE */
width:33%; width:33%;
height:90%; height:50px;
font-weight: bold;
color: #fff;
}
.phoneblue{
color: #fff;
background-color: #428bca;
border-color: #357ebd;
}
.phonegreen{
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
font-size:20px;
text-align:center;
width:20px;
}
.phonetable{
width:130px;
}
.phoneqty{
font-size:24px;
font-weight: bold;
}
.phonered{
color: #fff;
background-color: #dc3545;
border-color: #dc3545;
font-size:20px;
text-align:center;
width:20px;
}
.phoneorange{
color: #fff;
background-color: #f0ad4e;
border-color: #eea236;
}
.total{
width:100% !important;
font-size:24px;
}
.width24{
font-size:24px;
}
.leftcat{
margin-top:15px;
float:left;
width: 50%;
text-align:center;
height:150px;;
overflow:hidden;
margin-bottom:5px;
font-size:18px;
color:#5B5858;
font-weight: bold; font-weight: bold;
} }
@ -107,3 +172,28 @@ button.publicphonebutton2 {
font-weight: bold; font-weight: bold;
padding: 8px 16px; padding: 8px 16px;
} }
.div-table-responsive-no-min{
margin-top:20px;
}
.comment {
float: left;
width: 100%;
height: auto;
}
.comment-text-area {
float: left;
width: 80%;
height: auto;
}
.textinput {
float: left;
width: 100%;
min-height: 75px;
outline: none;
resize: none;
border: 1px solid grey;
}

View File

@ -73,8 +73,15 @@ if ($query == "cat")
preg_match('@src="([^"]+)"@', $image, $match); preg_match('@src="([^"]+)"@', $image, $match);
$file = array_pop($match); $file = array_pop($match);
if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); if ($file == "") {
else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); header('Location: ../../public/theme/common/nophoto.png');
} else {
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
header('Location: '.$file.'&cache=1');
} else {
header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
}
}
} else { } else {
// TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded. // TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded.

View File

@ -69,10 +69,12 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout ==
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>'; <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
$arrayofcss = array(
'/takepos/css/pos.css.php',
'/takepos/js/jquery.colorbox-min.js'
);
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="css/pos.css.php">
<link rel="stylesheet" href="css/colorbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>';
} }
/** /**
@ -856,6 +858,7 @@ if ($_SESSION["basiclayout"] != 1)
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>'; print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
print '<td class="linecolht right nowraponall">'.$langs->trans('TotalTTCShort').'</td>'; print '<td class="linecolht right nowraponall">'.$langs->trans('TotalTTCShort').'</td>';
} }
else print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
print "</tr>\n"; print "</tr>\n";
@ -868,12 +871,11 @@ if ($_SESSION["basiclayout"] == 1)
$categories = $categorie->get_full_arbo('product'); $categories = $categorie->get_full_arbo('product');
$htmlforlines = ''; $htmlforlines = '';
foreach ($categories as $row) { foreach ($categories as $row) {
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline'; $htmlforlines .= '<div class="leftcat';
$htmlforlines .= '" onclick="LoadProducts('.$row['id'].');">'; $htmlforlines .= '" onclick="LoadProducts('.$row['id'].');">';
$htmlforlines .= '<td class="left">'; $htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=cat&query=cat&id='.$row['id'].'"><br>';
$htmlforlines .= $row['label']; $htmlforlines .= $row['label'];
$htmlforlines .= '</td>'; $htmlforlines .= '</div>'."\n";
$htmlforlines .= '</tr>'."\n";
} }
$htmlforlines .= '</table>'; $htmlforlines .= '</table>';
$htmlforlines .= '</table>'; $htmlforlines .= '</table>';
@ -889,12 +891,11 @@ if ($_SESSION["basiclayout"] == 1)
$prods = $object->getObjectsInCateg("product"); $prods = $object->getObjectsInCateg("product");
$htmlforlines = ''; $htmlforlines = '';
foreach ($prods as $row) { foreach ($prods as $row) {
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline'; $htmlforlines .= '<div class="leftcat';
$htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">'; $htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">';
$htmlforlines .= '<td class="left">'; $htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$row->id.'"><br>';
$htmlforlines .= $row->label; $htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency);
$htmlforlines .= '<div class="right">'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'</div>'; $htmlforlines .= '</div>'."\n";
$htmlforlines .= '</tr>'."\n";
} }
$htmlforlines .= '</table>'; $htmlforlines .= '</table>';
print $htmlforlines; print $htmlforlines;
@ -968,7 +969,7 @@ if ($placeid > 0)
} }
$htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= '" id="'.$line->id.'">';
$htmlforlines .= '<td class="left">'; $htmlforlines .= '<td class="left">';
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x "; if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
//if ($line->product_label) $htmlforlines.= '<b>'.$line->product_label.'</b>'; //if ($line->product_label) $htmlforlines.= '<b>'.$line->product_label.'</b>';
if (isset($line->product_type)) if (isset($line->product_type))
{ {
@ -1001,7 +1002,8 @@ if ($placeid > 0)
} }
} }
if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "<br>(".$line->array_options['options_order_notes'].")"; if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "<br>(".$line->array_options['options_order_notes'].")";
if ($_SESSION["basiclayout"] != 1) if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '</td><td class="right phonetable"><button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty-1).');" class="publicphonebutton2 phonered">-</button>&nbsp;&nbsp;<button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty+1).');" class="publicphonebutton2 phonegreen">+</button>';
if ($_SESSION["basiclayout"] != 1)
{ {
$moreinfo = ''; $moreinfo = '';
$moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht); $moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht);

View File

@ -61,26 +61,31 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI
* View * View
*/ */
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/takepos/css/phone.css">';
if ($action == "productinfo") { if ($action == "productinfo") {
$prod = new Product($db); $prod = new Product($db);
$prod->fetch($idproduct); $prod->fetch($idproduct);
print "<b>".$prod->label."</b><br>"; print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
print "<br><b>".$prod->label."</b><br>";
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$idproduct.'">'; print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$idproduct.'">';
print "<br>".$prod->description; print "<br>".$prod->description;
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>"; print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
print '<br>'; print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>'; } elseif ($action == "publicpreorder") {
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="TakeposPrintingOrder();">'.$langs->trans('Confirm').'</button>';
print "<br><br>";
print '<div class="comment">
<textarea class="textinput" placeholder="'.$langs->trans('Note').'"></textarea>
</div>';
print '<br>';
} elseif ($action == "publicpayment") {
$langs->loadLangs(array("orders"));
print '<h1>'.$langs->trans('StatusOrderDelivered').'</h1>';
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('Payment').'</button>';
print '<br>';
} elseif ($action == "checkplease") {
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('Cash').'</button>';
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('CreditCard').'</button>';
print '<br>';
} elseif ($action == "editline") { } elseif ($action == "editline") {
$placeid = GETPOST('placeid', 'int'); $placeid = GETPOST('placeid', 'int');
$selectedline = GETPOST('selectedline', 'int'); $selectedline = GETPOST('selectedline', 'int');
@ -97,12 +102,26 @@ if ($action == "productinfo") {
print "<br>".$prod->description; print "<br>".$prod->description;
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>"; print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
print '<br>'; print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty - 1).');">-</button>'; print '<button type="button" class="publicphonebutton2 phonered width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty - 1).');">-</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty + 1).');">+</button>'; print '<button type="button" class="publicphonebutton2 phonegreen width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty + 1).');">+</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>'; print '<button type="button" class="publicphonebutton2 phoneblue width24" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
} }
} }
<<<<<<< HEAD
} else { } else {
=======
}
else {
// Title
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
$arrayofcss = array('/takepos/css/phone.css');
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
>>>>>>> upstream/develop
?> ?>
<script language="javascript"> <script language="javascript">
<?php <?php
@ -187,6 +206,11 @@ function AddProduct(placeid, productid){
?> ?>
} }
function PublicPreOrder(){
$("#phonediv1").load("auto_order.php?action=publicpreorder&place="+place, function() {
});
}
function AddProductConfirm(placeid, productid){ function AddProductConfirm(placeid, productid){
place=placeid; place=placeid;
<?php <?php
@ -213,7 +237,7 @@ function SetQty(place, selectedline, qty){
} }
function SetNote(place, selectedline){ function SetNote(place, selectedline){
var note = prompt("<?php $langs->trans('Note'); ?>", "Harry Potter"); var note = prompt("<?php $langs->trans('Note'); ?>", "");
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() { $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
}); });
LoadCats(); LoadCats();
@ -232,7 +256,7 @@ function LoadCats(){
} }
function LoadProducts(idcat){ function LoadProducts(idcat){
<?php <?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv1").load("auto_order.php?mobilepage=products&catid="+idcat+"&place="+place, function() { echo '$("#phonediv1").load("auto_order.php?mobilepage=products&catid="+idcat+"&place="+place, function() {
@ -253,7 +277,9 @@ function TakeposPrintingOrder(){
console.log("TakeposPrintingOrder"); console.log("TakeposPrintingOrder");
<?php <?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv2").load("auto_order.php?action=order&place="+place, function() { echo '$("#phonediv2").load("auto_order.php?action=order&mobilepage=order&place="+place, function() {
});';
echo '$("#phonediv1").load("auto_order.php?action=publicpayment&place="+place, function() {
});'; });';
} else { } else {
echo '$("#phonediv2").load("invoice.php?action=order&place="+place, function() { echo '$("#phonediv2").load("invoice.php?action=order&place="+place, function() {
@ -267,6 +293,8 @@ function Exit(){
} }
function CheckPlease(){ function CheckPlease(){
$("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() {
});
console.log("Request the check to the waiter"); console.log("Request the check to the waiter");
$.ajax({ $.ajax({
type: "GET", type: "GET",
@ -276,7 +304,7 @@ function CheckPlease(){
</script> </script>
<body style="overflow: hidden; background-color:#D1D1D1;"> <body style="background-color:#D1D1D1;">
<?php <?php
if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '<div class="dialog-info-takepos-terminal" id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>'; if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '<div class="dialog-info-takepos-terminal" id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>';
?> ?>
@ -288,19 +316,27 @@ function CheckPlease(){
print '<button type="button" class="phonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 3)).'</button>'; print '<button type="button" class="phonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 3)).'</button>'; print '<button type="button" class="phonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="Exit();">'.strtoupper(substr($langs->trans('Logout'), 0, 3)).'</button>'; print '<button type="button" class="phonebutton" onclick="Exit();">'.strtoupper(substr($langs->trans('Logout'), 0, 3)).'</button>';
<<<<<<< HEAD
} else { } else {
print '<button type="button" class="publicphonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>'; print '<button type="button" class="publicphonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>'; print '<button type="button" class="publicphonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>'; print '<button type="button" class="publicphonebutton" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
=======
}
else {
print '<button type="button" class="publicphonebutton phoneblue" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton phoneorange" onclick="PublicPreOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton phonegreen" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
>>>>>>> upstream/develop
} }
?> ?>
</div> </div>
<div class="row1"> <div class="phonerow2">
<div id="phonediv1" class="phonediv1"></div>
</div>
<div class="row2">
<div id="phonediv2" class="phonediv2"></div> <div id="phonediv2" class="phonediv2"></div>
</div> </div>
<div class="phonerow1">
<div id="phonediv1" class="phonediv1"></div>
</div>
</div> </div>
</body> </body>
<?php <?php

View File

@ -9,7 +9,7 @@ button.dropdown-item.global-search-item {
outline: none; outline: none;
} }
.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu, .dropdown dd ul.open { .open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-quickadd, .open>.dropdown-menu, .dropdown dd ul.open {
display: block; display: block;
} }
@ -59,6 +59,29 @@ button.dropdown-item.global-search-item {
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175); -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175); box-shadow: 0 6px 12px rgba(0,0,0,.175);
} }
.dropdown-quickadd {
border-color: #eee;
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 240px;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
.dropdown-menu { .dropdown-menu {
border-color: #eee; border-color: #eee;
@ -163,7 +186,7 @@ button.dropdown-item.global-search-item {
max-width: 100%; max-width: 100%;
} }
div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown { div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown, div#topmenu-quickadd-dropdown {
<?php if (empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { ?> <?php if (empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { ?>
line-height: 46px; line-height: 46px;
<?php } ?> <?php } ?>
@ -383,6 +406,58 @@ a.top-menu-dropdown-link {
display: none !important; display: none !important;
} }
/*
* QUICK ADD
*/
#topmenu-quickadd-dropdown .dropdown-menu {
width: 300px !important;
color: #444;
}
.quickadd-header {
color: #444 !important;
}
div.quickadd {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-align-content: center;
-ms-flex-line-pack: center;
align-content: center;
-webkit-align-items: flex-start;
-ms-flex-align: start;
align-items: flex-start;
}
div.quickadd a {
color: #444;
}
div.quickadd a:hover, div.quickadd a:active {
color: #000000;
}
div.quickaddblock {
width: 80px;
display: block ruby;
}
div.quickaddblock:hover,
div.quickaddblock:active,
div.quickaddblock:focus {
background: <?php print $colorbacklinepair1; ?>;
}
/* smartphone */ /* smartphone */
@media only screen and (max-width: 767px) @media only screen and (max-width: 767px)
{ {

View File

@ -1339,7 +1339,7 @@ td.showDragHandle {
#id-left { #id-left {
padding-top: 20px; padding-top: 20px;
padding-bottom: 5px; padding-bottom: 5px;
<?php if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { ?> <?php if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN) && ! empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) { ?>
padding-top: 8px; padding-top: 8px;
<?php } ?> <?php } ?>
} }

View File

@ -235,7 +235,7 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
.bg-infobox-bank_account{ .bg-infobox-bank_account{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important; <?php echo $prefix; ?>color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
} }
.bg-infobox-adherent{ .bg-infobox-adherent, .bg-infobox-member {
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important; <?php echo $prefix; ?>color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
} }
.bg-infobox-expensereport{ .bg-infobox-expensereport{
@ -273,7 +273,7 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
.fa-dol-bank_account:before { .fa-dol-bank_account:before {
content: "\f19c"; content: "\f19c";
} }
.fa-dol-adherent:before { .fa-dol-member:before {
content: "\f0c0"; content: "\f0c0";
} }
.fa-dol-expensereport:before { .fa-dol-expensereport:before {

View File

@ -199,7 +199,7 @@ $disableimages = 0;
$maxwidthloginblock = 180; $maxwidthloginblock = 180;
if (!empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = $maxwidthloginblock + 50; $minwidthtmenu = 0; } if (!empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = $maxwidthloginblock + 50; $minwidthtmenu = 0; }
if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; }
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; } if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; }
if (!empty($conf->bookmark->enabled)) { $maxwidthloginblock = $maxwidthloginblock + 55; } if (!empty($conf->bookmark->enabled)) { $maxwidthloginblock = $maxwidthloginblock + 55; }

View File

@ -34,7 +34,7 @@ if (!empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) $prefix = 'backgro
.bg-infobox-bank_account{ .bg-infobox-bank_account{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important; <?php echo $prefix; ?>color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
} }
.bg-infobox-adherent{ .bg-infobox-adherent, .bg-infobox-member{
<?php echo $prefix; ?>color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important; <?php echo $prefix; ?>color: <?php print colorAgressiveness('#79633f', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
} }
.bg-infobox-expensereport{ .bg-infobox-expensereport{
@ -258,7 +258,7 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
.bg-infobox-bank_account i.fa{ .bg-infobox-bank_account i.fa{
color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important; color: <?php print colorAgressiveness('#b0a53e', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
} }
.bg-infobox-adherent i.fa{ .bg-infobox-adherent i.fa, .bg-infobox-member i.fa{
color: <?php print colorAgressiveness('#f39c12', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important; color: <?php print colorAgressiveness('#f39c12', $conf->global->THEME_AGRESSIVENESS_RATIO); ?> !important;
} }
.bg-infobox-expensereport i.fa{ .bg-infobox-expensereport i.fa{
@ -296,7 +296,7 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
.fa-dol-bank_account:before { .fa-dol-bank_account:before {
content: "\f19c"; content: "\f19c";
} }
.fa-dol-adherent:before { .fa-dol-member:before {
content: "\f0c0"; content: "\f0c0";
} }
.fa-dol-expensereport:before { .fa-dol-expensereport:before {

View File

@ -71,12 +71,12 @@ class ProductCombination
*/ */
public $entity; public $entity;
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
public function __construct(DoliDB $db) public function __construct(DoliDB $db)
{ {
global $conf; global $conf;
@ -189,16 +189,16 @@ class ProductCombination
*/ */
public function countNbOfCombinationForFkProductParent($fk_product_parent) public function countNbOfCombinationForFkProductParent($fk_product_parent)
{ {
$nb = 0; $nb = 0;
$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."product_attribute_combination WHERE fk_product_parent = ".(int) $fk_product_parent." AND entity IN (".getEntity('product').")"; $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."product_attribute_combination WHERE fk_product_parent = ".(int) $fk_product_parent." AND entity IN (".getEntity('product').")";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
if ($obj) $nb = $obj->nb; if ($obj) $nb = $obj->nb;
} }
return $nb; return $nb;
} }
/** /**
@ -326,20 +326,20 @@ class ProductCombination
$child = new Product($this->db); $child = new Product($this->db);
$child->fetch($this->fk_product_child); $child->fetch($this->fk_product_child);
$child->price_autogen = $parent->price_autogen; $child->price_autogen = $parent->price_autogen;
$child->weight = $parent->weight; $child->weight = $parent->weight;
if ($this->variation_weight) { // If we must add a delta on weight if ($this->variation_weight) { // If we must add a delta on weight
$child->weight = ($child->weight ? $child->weight : 0) + $this->variation_weight; $child->weight = ($child->weight ? $child->weight : 0) + $this->variation_weight;
} }
$child->weight_units = $parent->weight_units; $child->weight_units = $parent->weight_units;
// Don't update the child label if the user has already modified it. // Don't update the child label if the user has already modified it.
if ($child->label == $parent->label) { if ($child->label == $parent->label) {
// This will trigger only at variant creation time // This will trigger only at variant creation time
$varlabel = $this->getCombinationLabel($this->fk_product_child); $varlabel = $this->getCombinationLabel($this->fk_product_child);
$child->label = $parent->label.$varlabel;; $child->label = $parent->label.$varlabel;;
} }
if ($child->update($child->id, $user) > 0) { if ($child->update($child->id, $user) > 0) {
$new_vat = $parent->tva_tx; $new_vat = $parent->tva_tx;
@ -536,9 +536,9 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
$newproduct->ref = $forced_refvar; $newproduct->ref = $forced_refvar;
} }
} else { } else {
$forced_refvar = false; $forced_refvar = false;
$existingProduct = false; $existingProduct = false;
$newproduct = clone $product; $newproduct = clone $product;
} }
//Final weight impact //Final weight impact
@ -599,11 +599,11 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
} }
if ($forced_refvar === false) { if ($forced_refvar === false) {
if (isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) { if (isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) {
$newproduct->ref .= $conf->global->PRODUIT_ATTRIBUTES_SEPARATOR.$prodattrval->ref; $newproduct->ref .= $conf->global->PRODUIT_ATTRIBUTES_SEPARATOR.$prodattrval->ref;
} else { } else {
$newproduct->ref .= '_'.$prodattrval->ref; $newproduct->ref .= '_'.$prodattrval->ref;
} }
} }
//The first one should not contain a linebreak //The first one should not contain a linebreak
@ -622,62 +622,62 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
// Now create the product // Now create the product
//print 'Create prod '.$newproduct->ref.'<br>'."\n"; //print 'Create prod '.$newproduct->ref.'<br>'."\n";
if ($existingProduct === false) { if ($existingProduct === false) {
//To avoid wrong information in price history log //To avoid wrong information in price history log
$newproduct->price = 0; $newproduct->price = 0;
$newproduct->price_ttc = 0; $newproduct->price_ttc = 0;
$newproduct->price_min = 0; $newproduct->price_min = 0;
$newproduct->price_min_ttc = 0; $newproduct->price_min_ttc = 0;
// A new variant must use a new barcode (not same product) // A new variant must use a new barcode (not same product)
$newproduct->barcode = -1; $newproduct->barcode = -1;
$result = $newproduct->create($user); $result = $newproduct->create($user);
if ($result < 0) if ($result < 0)
{ {
//In case the error is not related with an already existing product //In case the error is not related with an already existing product
if ($newproduct->error != 'ErrorProductAlreadyExists') { if ($newproduct->error != 'ErrorProductAlreadyExists') {
$this->error[] = $newproduct->error; $this->error[] = $newproduct->error;
$this->errors = $newproduct->errors; $this->errors = $newproduct->errors;
$db->rollback(); $db->rollback();
return -1; return -1;
} }
/** /**
* If there is an existing combination, then we update the prices and weight * If there is an existing combination, then we update the prices and weight
* Otherwise, we try adding a random number to the ref * Otherwise, we try adding a random number to the ref
*/ */
if ($newcomb->fk_product_child) { if ($newcomb->fk_product_child) {
$res = $newproduct->fetch($existingCombination->fk_product_child); $res = $newproduct->fetch($existingCombination->fk_product_child);
} else { } else {
$orig_prod_ref = $newproduct->ref; $orig_prod_ref = $newproduct->ref;
$i = 1; $i = 1;
do { do {
$newproduct->ref = $orig_prod_ref.$i; $newproduct->ref = $orig_prod_ref.$i;
$res = $newproduct->create($user); $res = $newproduct->create($user);
if ($newproduct->error != 'ErrorProductAlreadyExists') { if ($newproduct->error != 'ErrorProductAlreadyExists') {
$this->errors[] = $newproduct->error; $this->errors[] = $newproduct->error;
break; break;
} }
$i++; $i++;
} while ($res < 0); } while ($res < 0);
} }
if ($res < 0) { if ($res < 0) {
$db->rollback(); $db->rollback();
return -1; return -1;
} }
} }
} else { } else {
$result = $newproduct->update($newproduct->id, $user); $result = $newproduct->update($newproduct->id, $user);
if ($result < 0) if ($result < 0)
{ {
$db->rollback(); $db->rollback();
return -1; return -1;
} }
} }
$newcomb->fk_product_child = $newproduct->id; $newcomb->fk_product_child = $newproduct->id;
@ -692,14 +692,14 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
return $newproduct->id; return $newproduct->id;
} }
/** /**
* Copies all product combinations from the origin product to the destination product * Copies all product combinations from the origin product to the destination product
* *
* @param User $user Object user * @param User $user Object user
* @param int $origProductId Origin product id * @param int $origProductId Origin product id
* @param Product $destProduct Destination product * @param Product $destProduct Destination product
* @return int >0 OK <0 KO * @return int >0 OK <0 KO
*/ */
public function copyAll(User $user, $origProductId, Product $destProduct) public function copyAll(User $user, $origProductId, Product $destProduct)
{ {
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.class.php';
@ -721,7 +721,7 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
$variations[$tmp_pc2v->fk_prod_attr] = $tmp_pc2v->fk_prod_attr_val; $variations[$tmp_pc2v->fk_prod_attr] = $tmp_pc2v->fk_prod_attr_val;
} }
if ($this->createProductCombination( if ($this->createProductCombination(
$user, $user,
$destProduct, $destProduct,
$variations, $variations,
@ -729,7 +729,7 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1";
$combination->variation_price_percentage, $combination->variation_price_percentage,
$combination->variation_price, $combination->variation_price,
$combination->variation_weight $combination->variation_weight
) < 0) ) < 0)
{ {
return -1; return -1;
} }

View File

@ -2232,7 +2232,11 @@ if (!GETPOST('hide_websitemenu'))
*/ */
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=replacesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"><span></a>'; print '<a href="'.$_SERVER["PHP_SEFL"].'?action=replacesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"><span></a>';
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=website&type=website_page&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("Categories")).'"><span class="fa fa-tags"><span></a>';
if (! empty($conf->categorie->enabled)) {
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=website&type=website_page&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("Categories")).'"><span class="fa fa-tags"><span></a>';
}
if (! empty($conf->global->WEBSITE_ADD_REGENERATE_BUTTON)) { if (! empty($conf->global->WEBSITE_ADD_REGENERATE_BUTTON)) {
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=regeneratesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="fa fa-cogs"><span></a>'; print '<a href="'.$_SERVER["PHP_SEFL"].'?action=regeneratesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="fa fa-cogs"><span></a>';
} }