Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/holiday/fiche.php
This commit is contained in:
Laurent Destailleur 2012-11-29 23:12:16 +01:00
commit b12469c562
22 changed files with 112 additions and 92 deletions

View File

@ -22,8 +22,8 @@
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$graphwidth = 700; $graphwidth = 700;
$mapratio = 0.5; $mapratio = 0.5;
@ -83,8 +83,8 @@ if ($resql)
{ {
$obj=$db->fetch_object($resql); $obj=$db->fetch_object($resql);
if ($obj->code == 'phy') $foundphy++; if ($obj->code == 'phy') $foundphy++;
if ($obj->code == 'mor') $foundmor++; if ($obj->code == 'mor') $foundmor++;
$data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate)); $data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate));
@ -122,8 +122,8 @@ print '<td align="center">'.$langs->trans("NbOfMembers").'</td>';
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>'; print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
print '</tr>'; print '</tr>';
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>''); if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>''); if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>'');
$oldyear=0; $oldyear=0;
$var=true; $var=true;

View File

@ -1066,12 +1066,12 @@ if ($id)
} }
} }
// Est-ce une entree du dictionnaire qui peut etre desactivee ? // Est-ce une entree du dictionnaire qui peut etre desactivee ?
$iserasable=1; // Oui par defaut $iserasable=1; // Oui par defaut
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0; if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0;
if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0; if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0;
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0; if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
// Active // Active
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';

View File

@ -723,7 +723,7 @@ class ActionComm extends CommonObject
{ {
$libelle=$label; $libelle=$label;
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code); if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code);
$libelleshort=dol_trunc($label, $maxlength); $libelleshort=dol_trunc($label, $maxlength);
} }
else else
{ {
@ -733,8 +733,8 @@ class ActionComm extends CommonObject
if ($withpicto) if ($withpicto)
{ {
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{ {
$libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':''); $libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':'');
} }
$result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin; $result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin;

View File

@ -111,7 +111,7 @@ if ($action == 'add_action')
{ {
$error++; $error++;
$action = 'create'; $action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'</div>';
} }
// Initialisation objet cactioncomm // Initialisation objet cactioncomm

View File

@ -1042,12 +1042,12 @@ class BonPrelevement extends CommonObject
} }
/** /**
* Get object and lines from database * Get object and lines from database
* *
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function delete() function delete()
{ {
$this->db->begin(); $this->db->begin();
@ -1057,7 +1057,7 @@ class BonPrelevement extends CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = '".$this->id."'"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = '".$this->id."'";
$resql2=$this->db->query($sql); $resql2=$this->db->query($sql);
if (! $resql2) dol_print_error($this->db); if (! $resql2) dol_print_error($this->db);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = '".$this->id."'"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = '".$this->id."'";
$resql3=$this->db->query($sql); $resql3=$this->db->query($sql);
@ -1078,7 +1078,7 @@ class BonPrelevement extends CommonObject
return -1; return -1;
} }
} }
/** /**
* Returns clickable name (with picto) * Returns clickable name (with picto)

View File

@ -54,8 +54,8 @@ if ( $action == 'confirm_delete' )
$res=$bon->delete(); $res=$bon->delete();
if ($res > 0) if ($res > 0)
{ {
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
} }
@ -100,11 +100,11 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
$error = $bon->set_infotrans($user, $dt, GETPOST('methode','alpha')); $error = $bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
if ($error) if ($error)
{ {
header("Location: fiche.php?id=".$id."&error=$error"); header("Location: fiche.php?id=".$id."&error=$error");
exit; exit;
} }
} }
if ($action == 'infocredit' && $user->rights->prelevement->bons->credit) if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
@ -244,7 +244,7 @@ if ($id > 0)
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send) if (empty($bon->date_trans) && $user->rights->prelevement->bons->send)
{ {
print "<a class=\"butAction\" href=\"fiche.php?action=settransmitted&id=".$bon->id."\">".$langs->trans("SetToStatusSent")."</a>"; print "<a class=\"butAction\" href=\"fiche.php?action=settransmitted&id=".$bon->id."\">".$langs->trans("SetToStatusSent")."</a>";
} }
if (! empty($bon->date_trans) && $bon->date_credit == 0) if (! empty($bon->date_trans) && $bon->date_credit == 0)
@ -252,7 +252,7 @@ if ($id > 0)
print "<a class=\"butAction\" href=\"fiche.php?action=setcredited&id=".$bon->id."\">".$langs->trans("ClassCredited")."</a>"; print "<a class=\"butAction\" href=\"fiche.php?action=setcredited&id=".$bon->id."\">".$langs->trans("ClassCredited")."</a>";
} }
print "<a class=\"butActionDelete\" href=\"fiche.php?action=confirm_delete&id=".$bon->id."\">".$langs->trans("Delete")."</a>"; print "<a class=\"butActionDelete\" href=\"fiche.php?action=confirm_delete&id=".$bon->id."\">".$langs->trans("Delete")."</a>";
print "</div>"; print "</div>";
} }

View File

@ -127,8 +127,8 @@ if ($result)
print $bprev->getNomUrl(1); print $bprev->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec),"dayhour")."</td>\n"; print '<td>'.dol_print_date($db->jdate($obj->datec),"dayhour")."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>\n"; print '<td align="right">'.price($obj->amount)."</td>\n";
print '<td align="right">'.$bprev->getLibStatut(3)."</td>\n"; print '<td align="right">'.$bprev->getLibStatut(3)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -170,7 +170,7 @@ class HookManager
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
// TODO. remove this. array result must be set into $actionclassinstance->results // TODO. remove this. array result must be set into $actionclassinstance->results
if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
// TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string // TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string
if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
} }

View File

@ -2238,7 +2238,7 @@ class Form
$inputko=array(); $inputko=array();
// Clean parameters // Clean parameters
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice; $newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
if (is_array($formquestion) && ! empty($formquestion)) if (is_array($formquestion) && ! empty($formquestion))
{ {

View File

@ -172,7 +172,7 @@ class FormActions
print '</tr>'; print '</tr>';
print "\n"; print "\n";
$userstatic = new User($this->db); $userstatic = new User($this->db);
foreach($listofactions as $action) foreach($listofactions as $action)
{ {
@ -219,9 +219,9 @@ class FormActions
$form=new Form($this->db); $form=new Form($this->db);
// Suggest a list with manual event or all auto events // Suggest a list with manual event or all auto events
$arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot); $arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
array_unshift($arraylist,'&nbsp;'); // Add empty line at start array_unshift($arraylist,'&nbsp;'); // Add empty line at start
//asort($arraylist); //asort($arraylist);
print $form->selectarray($htmlname, $arraylist, $selected); print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);

View File

@ -729,6 +729,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
modal: true, modal: true,
buttons: [ buttons: [
{ {
id : 'yesButton_' + code,
text : yesButton, text : yesButton,
click : function() { click : function() {
if (action == "set") { if (action == "set") {
@ -748,6 +749,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
} }
}, },
{ {
id : 'noButton_' + code,
text : noButton, text : noButton,
click : function() { click : function() {
$(this).dialog("close"); $(this).dialog("close");
@ -755,6 +757,10 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
} }
] ]
}); });
// For information dialog box only, hide the noButton
if (boxConfirm.info) {
$("#noButton_" + code).button().hide();
}
} }
/* /*

View File

@ -375,6 +375,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
// Set constant // Set constant
$("#set_" + code).click(function() { $("#set_" + code).click(function() {
if (input.alert && input.alert.set) { if (input.alert && input.alert.set) {
// Posibility to force label of buttons
if (input.alert.set.yesButton)
yesButton = input.alert.set.yesButton;
if (input.alert.set.noButton)
noButton = input.alert.set.noButton;
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton); confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
} else { } else {
setConstant(url, code, input, entity); setConstant(url, code, input, entity);
@ -384,6 +389,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
// Del constant // Del constant
$("#del_" + code).click(function() { $("#del_" + code).click(function() {
if (input.alert && input.alert.del) { if (input.alert && input.alert.del) {
// Posibility to force label of buttons
if (input.alert.del.yesButton)
yesButton = input.alert.del.yesButton;
if (input.alert.del.noButton)
noButton = input.alert.del.noButton;
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton); confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
} else { } else {
delConstant(url, code, input, entity); delConstant(url, code, input, entity);

View File

@ -184,7 +184,7 @@ class pdf_crabe extends ModelePDFFactures
$nblignes = count($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -294,7 +294,7 @@ class Export
} }
break; break;
case 'Boolean': case 'Boolean':
$szFilterQuery=" ".$NameField."=".(is_numeric($ValueField) ? $ValueField : ($ValueField =='yes' ? 1: 0) ); $szFilterQuery=" ".$NameField."=".(is_numeric($ValueField) ? $ValueField : ($ValueField =='yes' ? 1: 0) );
break; break;
case 'Status': case 'Status':
case 'List': case 'List':

View File

@ -1122,7 +1122,7 @@ print '<br>';
llxFooter(); llxFooter();
$db->close(); $db->close();
/** /**

View File

@ -953,7 +953,7 @@ class CommandeFournisseur extends CommonOrder
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur");
if ($this->id) { if ($this->id) {
$num=count($this->lines); $num=count($this->lines);
@ -994,7 +994,7 @@ class CommandeFournisseur extends CommonOrder
{ {
// On logue creation pour historique // On logue creation pour historique
$this->log($user, 0, time()); $this->log($user, 0, time());
if (! $notrigger) if (! $notrigger)
{ {
// Appel des triggers // Appel des triggers
@ -1004,7 +1004,7 @@ class CommandeFournisseur extends CommonOrder
if ($result < 0) { $error++; $this->errors=$interface->errors; } if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers // Fin appel triggers
} }
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
@ -1170,7 +1170,7 @@ class CommandeFournisseur extends CommonOrder
$this->error="No price found for this quantity. Quantity may be too low ?"; $this->error="No price found for this quantity. Quantity may be too low ?";
$this->db->rollback(); $this->db->rollback();
dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG); dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG);
return -1; return -1; // FIXME this return create an error in jenkins
} }
if ($result < -1) if ($result < -1)
{ {

View File

@ -174,36 +174,36 @@ else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
{ {
$langs->load('errors'); $langs->load('errors');
$error = false; $error = 0;
if ($_POST['pu'] < 0 && $_POST['qty'] < 0) if (GETPOST('pu') < 0 && GETPOST('qty') < 0)
{ {
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && $_POST['type'] < 0) if (! GETPOST('idprodfournprice') && GETPOST('type') < 0)
{ {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && (! isset($_POST['pu']) || $_POST['pu']=='')) // Unit price can be 0 but not '' if (! GETPOST('idprodfournprice') && (! GETPOST('pu') || GETPOST('pu')=='')) // Unit price can be 0 but not ''
{ {
setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && empty($_POST['np_desc']) && empty($_POST['dp_desc'])) if (! GETPOST('idprodfournprice') && ! GETPOST('np_desc') && ! GETPOST('dp_desc'))
{ {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error = true; $error++;
} }
if (empty($_POST['idprodfournprice']) && (! isset($_POST['qty']) || $_POST['qty'] == '') if (! GETPOST('idprodfournprice') && (! GETPOST('qty') || GETPOST('qty') == '')
|| ! empty($_POST['idprodfournprice']) && (! isset($_POST['pqty']) || $_POST['pqty'] == '')) || GETPOST('idprodfournprice') && (! GETPOST('pqty') || GETPOST('pqty') == ''))
{ {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true; $error++;
} }
if (! $error && (($_POST['qty'] || $_POST['pqty']) && (($_POST['pu'] && ($_POST['np_desc'] || $_POST['dp_desc'])) || $_POST['idprodfournprice']))) if (! $error && ((GETPOST('qty') || GETPOST('pqty')) && ((GETPOST('pu') && (GETPOST('np_desc') || GETPOST('dp_desc'))) || GETPOST('idprodfournprice'))))
{ {
if ($object->fetch($id) < 0) dol_print_error($db,$object->error); if ($object->fetch($id) < 0) dol_print_error($db,$object->error);
if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error); if ($object->fetch_thirdparty() < 0) dol_print_error($db,$object->error);
@ -211,9 +211,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
// Ecrase $pu par celui du produit // Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit // Ecrase $desc par celui du produit
// Ecrase $txtva par celui du produit // Ecrase $txtva par celui du produit
if ($_POST["idprodfournprice"]) // >0 or -1 if (GETPOST('idprodfournprice')) // >0 or -1
{ {
$qty = $_POST['qty'] ? $_POST['qty'] : $_POST['pqty']; $qty = GETPOST('qty') ? GETPOST('qty') : GETPOST('pqty');
$productsupplier = new ProductFournisseur($db); $productsupplier = new ProductFournisseur($db);
$idprod=$productsupplier->get_buyprice($_POST['idprodfournprice'], $qty); // Just to see if a price exists for the quantity. Not used to found vat $idprod=$productsupplier->get_buyprice($_POST['idprodfournprice'], $qty); // Just to see if a price exists for the quantity. Not used to found vat
@ -230,9 +230,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$desc.= $productsupplier->description && $_POST['np_desc'] ? "\n" : ""; $desc.= $productsupplier->description && $_POST['np_desc'] ? "\n" : "";
$desc.= $_POST['np_desc']; $desc.= $_POST['np_desc'];
$remise_percent = $_POST["remise_percent"] ? $_POST["remise_percent"] : $_POST["p_remise_percent"]; $remise_percent = GETPOST('remise_percent') ? GETPOST('remise_percent') : GETPOST('p_remise_percent');
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
$type = $productsupplier->type; $type = $productsupplier->type;
// Local Taxes // Local Taxes
@ -241,13 +241,13 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$result=$object->addline( $result=$object->addline(
$desc, $desc,
$pu, $pu, // FIXME $pu is not defined
$qty, $qty,
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$productsupplier->id, $productsupplier->id,
$_POST['idprodfournprice'], GETPOST('idprodfournprice'),
$productsupplier->fourn_ref, $productsupplier->fourn_ref,
$remise_percent, $remise_percent,
'HT', 'HT',
@ -257,7 +257,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
if ($idprod == -1) if ($idprod == -1)
{ {
// Quantity too low // Quantity too low
$mesg='<div class="error">'.$langs->trans("ErrorQtyTooLowForThisSupplier").'</div>'; setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors');
} }
} }
else else
@ -272,7 +272,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
if (! $_POST['dp_desc']) if (! $_POST['dp_desc'])
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
} }
else else
{ {
@ -1000,7 +1000,7 @@ if ($id > 0 || ! empty($ref))
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
if ($action == 'clone') if ($action == 'clone')
{ {
@ -1065,7 +1065,7 @@ if ($id > 0 || ! empty($ref))
$ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
*/ */
@ -1491,21 +1491,21 @@ if ($id > 0 || ! empty($ref))
print '</tr>'; print '</tr>';
// TODO Use the predefinedproductline_create.tpl.php file // TODO Use the predefinedproductline_create.tpl.php file
// Add free products/services form // Add free products/services form
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#add" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#add" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addline">'; print '<input type="hidden" name="action" value="addline">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<script type="text/javascript"> print '<script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() { jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus(); if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
}); });
}); });
</script>'; </script>';
$var=true; $var=true;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'; print '<td>';
@ -1684,7 +1684,7 @@ if ($id > 0 || ! empty($ref))
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=cancel">'.$langs->trans("CancelOrder").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=cancel">'.$langs->trans("CancelOrder").'</a>';
} }
} }
// Clone // Clone
if ($user->rights->fournisseur->commande->creer) if ($user->rights->fournisseur->commande->creer)
{ {

View File

@ -469,7 +469,7 @@ elseif ($action == 'addline')
if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or '' if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or ''
{ {
$idprod=0; $idprod=0;
$product=new Product($db); $product=new Product($db);
if (GETPOST('idprodfournprice') == '') if (GETPOST('idprodfournprice') == '')
{ {
@ -1820,12 +1820,12 @@ else
print '<input type="hidden" name="socid" value="'. $object->socid .'">'; print '<input type="hidden" name="socid" value="'. $object->socid .'">';
print '<input type="hidden" name="facid" value="'.$object->id.'">'; print '<input type="hidden" name="facid" value="'.$object->id.'">';
print '<script type="text/javascript"> print '<script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() { jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus(); if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
}); });
}); });
</script>'; </script>';
$var=! $var; $var=! $var;

View File

@ -57,7 +57,7 @@ $search_employe = GETPOST('search_employe');
$search_valideur = GETPOST('search_valideur'); $search_valideur = GETPOST('search_valideur');
$search_statut = GETPOST('select_statut'); $search_statut = GETPOST('select_statut');
$holiday = new Holiday($db); $holiday = new Holiday($db);
/* /*
* Actions * Actions

View File

@ -55,8 +55,8 @@ $db_prefix=GETPOST('db_prefix','alpha');
session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters) session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters)
// Save a flag to tell to restore input value if we do back // Save a flag to tell to restore input value if we do back
$_SESSION['dol_save_pass']=$db_pass; $_SESSION['dol_save_pass']=$db_pass;
//$_SESSION['dol_save_passroot']=$passroot; //$_SESSION['dol_save_passroot']=$passroot;
// Now we load forced value from install.forced.php file. // Now we load forced value from install.forced.php file.
$useforcedwizard=false; $useforcedwizard=false;

View File

@ -69,7 +69,7 @@ if (@file_exists($forcedfile)) {
* View * View
*/ */
session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters) session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters)
pHeader($langs->trans("ConfigurationFile"),"etape1","set","",(empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/')); pHeader($langs->trans("ConfigurationFile"),"etape1","set","",(empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/'));

View File

@ -255,9 +255,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (15
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1543,154, '10','0','VAT Frontero',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1543,154, '10','0','VAT Frontero',1);
-- BARBADOS (id country=46) -- BARBADOS (id country=46)
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (461,46, '0','0','No VAT',1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 461, 46, '0','0','No VAT',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (462,46, '15','0','VAT 15%',1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (463,46, '7.5','0','VAT 7.5%',1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1);
-- SOUTH AFRICA (id country=205)
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051,205, '0','0','No VAT',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052,205, '14','0','VAT 14%',1);
-- VENEZUELA (id country=232) -- VENEZUELA (id country=232)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1);