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

develop

Conflicts:
	ChangeLog
This commit is contained in:
Laurent Destailleur 2013-09-28 13:26:52 +02:00
commit 019c86dff0
101 changed files with 954 additions and 398 deletions

View File

@ -40,23 +40,27 @@ For users:
- New: Add Maghreb regions and departments.
- New: A more responsive desgin for statistic box of home page.
- Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error).
- New: [ task #1005 ] Adapting to Spanish legislation bill numbering.
- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode.
- New: [ task #1014 ] Add option to recursivly add parent category.
- New: [ task #1016 ] Can define a specific numbering for deposits.
- New: [ task #918 ] Stock replenishment.
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count.
- New: Add pdf link into supplier invoice list and supplier order list.
- New: Genrate auto the PDF for supplier invoice.
- New: Add category into filter webservice thirdparty method getListOfThirdParties.
- New: Allow to define margin or mark rate during quoting, ordering, invoicing.
- New: User permissions on margin module.
- New: Add ref supplier into muscadet model.
- New: [ task #1005 ] Adapting to Spanish legislation bill numbering
- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode
- New: [ task #1014 ] Add option to recursivly add parent category
- New: [ task #1016 ] Can define a specific numbering for deposits
- New: [ task #918 ] Stock replenishment
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count
- New : Add pdf link into supplier invoice list and supplier order list
- New : Genrate auto the PDF for supplier invoice
- New : Add category into filter webservice thirdparty method getListOfThirdParties
- New : Allow to define margin or mark rate during quoting, ordering, invoicing
- New : User permissions on margin module
- New : Add ref supplier into muscadet model
- New : Add ability to copy contact address to clipboard
- New: Can use tag {mm} before {yy} even when there is a reset into numbering masks.
- New: [ task #1060 ] Register fields localtax(1|2)_type into details tables.
- New: [ task #923 ] Localtax support for ODT templates.
- New: [ task #90 ] Barcode search.
- New: Add hidden option MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS.
- New: Can send an email from thirdparty card.
- New: Can cancel holidays that were previously validated.
- Fix: [bug #1022] correct margin calculation for credit notes.
For translators:
- Qual: Normalized sort order of all languages files with english reference files.
@ -109,6 +113,8 @@ parameter. All methods addline in this case were modified to remove this paramet
4) Method ->classer_facturee() is deprecated. It must be replace with ->classifyBilled().
5) Property ->tel on objects is now ->phone
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined

View File

@ -50,7 +50,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -564,7 +564,7 @@ class Adherent extends CommonObject
$lthirdparty->zip=$this->zip;
$lthirdparty->town=$this->town;
$lthirdparty->email=$this->email;
$lthirdparty->tel=$this->phone;
$lthirdparty->phone=$this->phone;
$lthirdparty->state_id=$this->state_id;
$lthirdparty->country_id=$this->country_id;
$lthirdparty->country_id=$this->country_id;

View File

@ -691,7 +691,7 @@ else
/* */
/* ************************************************************************** */
$object->canvas=$canvas;
$object->state_id = GETPOST('departement_id', 'int');
$object->state_id = GETPOST('state_id', 'int');
// We set country_id, country_code and country for the selected country
$object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id;

View File

@ -56,7 +56,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -87,7 +87,7 @@ $h++;
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$head[$h][1] = $langs->trans("Shipment");
$h++;
}

View File

@ -210,7 +210,7 @@ $head[$h][1] = $langs->trans("Setup");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$head[$h][1] = $langs->trans("Shipment");
$hselected=$h;
$h++;
@ -225,7 +225,7 @@ dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
/*
* Expedition numbering model
*/
*/
print_titre($langs->trans("SendingsNumberingModules"));
@ -260,13 +260,13 @@ foreach ($dirmodels as $reldir)
require_once $dir.$file.'.php';
$module = new $file;
if ($module->isEnabled())
{
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td>\n";
print '<td>';
@ -276,8 +276,8 @@ foreach ($dirmodels as $reldir)
// Show example of numbering module
print '<td class="nowrap">';
$tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
}
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
else print $tmp;

View File

@ -192,7 +192,7 @@ $h++;
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$head[$h][1] = $langs->trans("Shipment");
$h++;
}
@ -207,7 +207,7 @@ dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
/*
* Livraison numbering model
*/
print_titre($langs->trans("DeliveryOrderNumberingModules"));
print '<table class="noborder" width="100%">';
@ -240,13 +240,13 @@ foreach ($dirmodels as $reldir)
require_once $dir.$file.'.php';
$module = new $file;
if ($module->isEnabled())
{
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
@ -255,8 +255,8 @@ foreach ($dirmodels as $reldir)
// Show example of numbering module
print '<td class="nowrap">';
$tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
if (preg_match('/^Error/',$tmp)) {
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
}
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
else print $tmp;
@ -315,7 +315,7 @@ print '</table>';
print '<br>';
print_titre($langs->trans("DeliveryOrderModel"));
// Defini tableau def de modele
// Defini tableau def de modele
$type="delivery";
$def = array();

View File

@ -57,7 +57,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -58,7 +58,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -58,7 +58,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -57,7 +57,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -199,11 +199,11 @@ if (empty($reshook))
}
else
{
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
}
else
else
{
setEventMessage($cat->error,'errors');
setEventMessage($cat->errors,'errors');
@ -305,7 +305,7 @@ if ($socid)
print '</td></tr>';
// Phone
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
// Assujeti a TVA ou pas

View File

@ -43,23 +43,24 @@ $confirm = GETPOST('confirm');
$lineid = GETPOST('lineid','int');
// Security check
$socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
if ($user->societe_id > 0)
{
unset($_GET["action"]);
$action='';
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id');
$object = new ActionComm($db);
/*
* Actions
*/
/*
* Ajout d'un nouveau contact
*/
// Add new nouveau contact
if ($action == 'addcontact')
{
$result = $object->fetch($id);

View File

@ -44,14 +44,14 @@ $objectid = GETPOST('id','int');
$action=GETPOST('action','alpha');
// Security check
$socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
if ($user->societe_id > 0)
{
unset($_GET["action"]);
$action='';
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', '', 'id');
$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id');
$act = new ActionComm($db);
@ -208,7 +208,7 @@ if ($act->id > 0)
{
if ($act->societe->fetch($act->societe->id))
{
print "<br>".dol_print_phone($act->societe->tel);
print "<br>".dol_print_phone($act->societe->phone);
}
}
print '</td>';

View File

@ -51,12 +51,14 @@ $action=GETPOST('action','alpha');
$cancel=GETPOST('cancel','alpha');
$backtopage=GETPOST('backtopage','alpha');
$contactid=GETPOST('contactid','int');
$origin=GETPOST('origin','alpha');
$originid=GETPOST('originid','int');
// Security check
$socid = GETPOST('socid','int');
$id = GETPOST('id','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', '', 'id');
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id');
if ($user->societe_id && $socid) $result = restrictedArea($user,'societe',$socid);
$error=GETPOST("error");
@ -77,8 +79,10 @@ $hookmanager->initHooks(array('actioncard'));
/*
* Action creation de l'action
* Actions
*/
// Add action
if ($action == 'add_action')
{
$error=0;
@ -142,6 +146,8 @@ if ($action == 'add_action')
$actioncomm->location = GETPOST("location");
$actioncomm->transparency = (GETPOST("transparency")=='on'?1:0);
$actioncomm->label = trim(GETPOST('label'));
$actioncomm->fk_element = GETPOST("fk_element");
$actioncomm->elementtype = GETPOST("elementtype");
if (! GETPOST('label'))
{
if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs))
@ -327,7 +333,8 @@ if ($action == 'update')
$actioncomm->fk_project = $_POST["projectid"];
$actioncomm->note = $_POST["note"];
$actioncomm->pnote = $_POST["note"];
$actioncomm->fk_element = $_POST["fk_element"];
$actioncomm->elementtype = $_POST["elementtype"];
if (! $datef && $percentage == 100)
{
$error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd"));
@ -476,7 +483,7 @@ if ($action == 'create')
// Full day
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
// Date start
$datep=$actioncomm->datep;
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
@ -593,6 +600,11 @@ if ($action == 'create')
}
print '</td></tr>';
}
if(!empty($origin) && !empty($originid))
{
print '<input type="hidden" name="fk_element" size="10" value="'.GETPOST('originid').'">';
print '<input type="hidden" name="elementtype" size="10" value="'.GETPOST('origin').'">';
}
if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',GETPOST("datep"),$reg))
{
@ -610,6 +622,7 @@ if ($action == 'create')
$doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$actioncomm->note),'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90);
$doleditor->Create();
print '</td></tr>';
// Other attributes
$parameters=array();
@ -971,7 +984,7 @@ if ($id > 0)
{
if ($act->societe->fetch($act->societe->id))
{
print "<br>".dol_print_phone($act->societe->tel);
print "<br>".dol_print_phone($act->societe->phone);
}
}
print '</td>';

View File

@ -84,7 +84,7 @@ $type=GETPOST("type");
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
if (GETPOST('viewcal')) {
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
$action='show_month'; $day='';
} // View by month
if (GETPOST('viewweek')) {
@ -1140,7 +1140,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cachethirdparties[$event->societe->id]=$thirdparty;
}
else $thirdparty=$cachethirdparties[$event->societe->id];
$linerelatedto.=$thirdparty->getNomUrl(1,'',$length);
if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',$length);
}
if (! empty($event->contact->id) && $event->contact->id > 0)
{
@ -1152,7 +1152,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
else $contact=$cachecontacts[$event->contact->id];
if ($linerelatedto) $linerelatedto.=' / ';
$linerelatedto.=$contact->getNomUrl(1,'',$length);
if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',$length);
}
if ($linerelatedto) print '<br>'.$linerelatedto;
}

View File

@ -40,7 +40,7 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', '', 'id');
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id');
/*

View File

@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -59,7 +59,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -254,7 +254,7 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Web").'</td><td colspan="3">'.dol_print_url($object->url,'_blank').'</td></tr>';
// Phone
print '<tr><td>'.$langs->trans('Phone').'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td style="min-width: 25%;">'.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').'</td>';
// Fax
print '<td>'.$langs->trans('Fax').'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'</td></tr>';

View File

@ -1655,8 +1655,9 @@ else
if ($absolute_discount)
{
if ($object->statut > 0)
{
{
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
}
else
{
@ -2105,7 +2106,11 @@ else
if (count($object->lines) > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=validate">'.$langs->trans('Validate').'</a></div>';
//else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
}
// Create event
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddAction").'</a>';
}
// Edit
if ($object->statut == 1 && $user->rights->propal->creer)
{

View File

@ -2386,13 +2386,16 @@ else
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=validate">'.$langs->trans('Validate').'</a></div>';
}
// Edit
if ($object->statut == 1 && $user->rights->commande->creer)
{
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?id='.$object->id.'&amp;action=modif">'.$langs->trans('Modify').'</a></div>';
}
// Create event
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddAction").'</a>';
}
// Send
if ($object->statut > 0)
{

View File

@ -1296,7 +1296,7 @@ class AccountLine extends CommonObject
// No error check. Can fail if category already affected
}
$bankline->rappro=1;
$this->rappro=1;
$this->db->commit();
return 1;

View File

@ -1588,6 +1588,15 @@ else if ($action == 'down' && $user->rights->facture->creer)
exit;
}
// Link invoice to order
if (GETPOST('linkedOrder'))
{
$object->fetch($id);
$object->fetch_thirdparty();
$result=$object->add_object_linked('commande',GETPOST('linkedOrder'));
}
/*
* Add file in email form
*/
@ -1960,6 +1969,16 @@ $now=dol_now();
llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
print '
<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#linktoorder").click(function() {
jQuery("#commande").toggle();
});
});
</script>
';
/*********************************************************************
*
@ -3727,74 +3746,64 @@ else if ($id > 0 || ! empty($ref))
// Linked object block
$somethingshown=$object->showLinkedObjectBlock();
if (empty($somethingshown) && $object->statut > 0)
{
print '<br><a href="#" id="linktoorder">'.$langs->trans('LinkedOrder').'</a>';
print '<a href="#" onClick="lier_commande(commande)">'.$langs->trans('LinkedOrder').'</a>';
print '<div id="commande" style="display:none">';
{
print '<div id="commande" style="display:none">';
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_client, c.total_ht";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
$sql.= ' WHERE c.fk_soc = '.$soc->id.'';
$result = $db->query($sql);
if ($result)
$resqlorderlist = $db->query($sql);
if ($resqlorderlist)
{
$num = $db->num_rows($result);
$num = $db->num_rows($resqlorderlist);
$i = 0;
print_titre($langs->trans("LinkedOrder"));
print '<table><tr class="liste_titre">';
print '<td class="nowrap"></td>';
print '<td align="center">'.$langs->trans("Ref").'</td>';
print '<td align="left">'.$langs->trans("RefCustomer").'</td>';
print '<td align="left">'.$langs->trans("AmountHTShort").'</td>';
print '<td align="left">'.$langs->trans("Company").'</td>
</tr>';
print '<form action=" " method="post" name="LinkedOrder">';
print '<form action="" method="POST" name="LinkedOrder">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td class="nowrap"></td>';
print '<td align="center">'.$langs->trans("Ref").'</td>';
print '<td align="left">'.$langs->trans("RefCustomer").'</td>';
print '<td align="left">'.$langs->trans("AmountHTShort").'</td>';
print '<td align="left">'.$langs->trans("Company").'</td>';
print '</tr>';
while ($i < $num)
{
$objp = $db->fetch_object($result);
$objp = $db->fetch_object($resqlorderlist);
if ($objp->socid == $soc->id)
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td aling="left">';
print '<input type="radio" name="linkedOrder" value='.$objp->rowid.'>';
print '<td align="center">'.$objp->ref.'</td>';
print '<td>'.$objp->ref_client.'</td>';
print '<td>'.price($objp->total_ht).'</td>';
print '<td>'.$objp->name.'</td>';
print '</td>';
}
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td aling="left">';
print '<input type="radio" name="linkedOrder" value='.$objp->rowid.'>';
print '<td align="center">'.$objp->ref.'</td>';
print '<td>'.$objp->ref_client.'</td>';
print '<td>'.price($objp->total_ht).'</td>';
print '<td>'.$objp->name.'</td>';
print '</td>';
print '</tr>';
}
$i++;
}
}
print '</table>';
print '</br>';
print '<br><center><input type="submit" class="button" value="'.$langs->trans('OK').'"></center>';
print '<br><center><input type="submit" class="button" value="'.$langs->trans('ToLink').'"></center>';
print '</form>';
$db->free($resqlorderlist);
}
else
else
{
dol_print_error($db);
}
$result=$object->add_object_linked('commande',$_POST['linkedOrder']);
if($result>0)
{
echo '<meta http-equiv="refresh" content="0;URL=facture.php?facid='.$object->id.'">';
print '</div>';
}
}
print '</div>';
}
// Link for paypal payment
if (! empty($conf->paypal->enabled) && $object->statut != 0)
{
@ -3946,20 +3955,4 @@ dol_htmloutput_mesg('',$mesgs);
llxFooter();
$db->close();
?>
<script>
function lier_commande(commande)
{
if(commande.style.display=='none')
{
commande.style.display='inline';
}
else
{
commande.style.display="none";
}
}
</script>
?>

View File

@ -52,7 +52,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -53,7 +53,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -57,7 +57,12 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array
$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('paiementcard'));
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
/*
* Action add_paiement et confirm_paiement
@ -579,6 +584,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook
print "</tr>\n";
@ -713,6 +720,10 @@ if (! GETPOST('action'))
print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n";
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount).'</td><td>&nbsp;</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook
print '</tr>';
$i++;
}

View File

@ -285,10 +285,10 @@ abstract class ActionsContactCardCommon
}
// Zip
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
// Town
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id'));
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id'));
if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id;
@ -432,9 +432,9 @@ abstract class ActionsContactCardCommon
$this->object->address = $_POST["address"];
$this->object->zip = $_POST["zipcode"];
$this->object->town = $_POST["town"];
$this->object->fk_departement = $_POST["departement_id"];
$this->object->fk_departement = $_POST["state_id"];
$this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
$this->object->state_id = $_POST["departement_id"];
$this->object->state_id = $_POST["state_id"];
$this->object->phone_pro = $_POST["phone_pro"];
$this->object->phone_perso = $_POST["phone_perso"];
$this->object->phone_mobile = $_POST["phone_mobile"];

View File

@ -130,7 +130,7 @@ if (empty($reshook))
$error=$object->error; $errors=$object->errors;
}
}
/*
* Confirmation desactivation
@ -152,7 +152,7 @@ if (empty($reshook))
$object->setstatus(1);
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit;
}
// Add contact
if ($action == 'add' && $user->rights->societe->contact->creer)
@ -344,7 +344,7 @@ else
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
}
}
@ -499,7 +499,7 @@ else
}
// Phone / Fax
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->tel; // Predefined with third party
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->phone; // Predefined with third party
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" id="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" id="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
@ -735,7 +735,7 @@ else
print '<textarea name="note" cols="70" rows="'.ROWS_3.'">';
print isset($_POST["note"])?$_POST["note"]:$object->note;
print '</textarea></td></tr>';
// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>';
@ -840,7 +840,7 @@ else
else $text.=$langs->trans("UserWillBeInternalUser");
}
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
}
print '<table class="border" width="100%">';
@ -945,7 +945,7 @@ else
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
print nl2br($object->note);
print '</td></tr>';
// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>';

View File

@ -70,7 +70,7 @@ $v->setTitle($contact->poste);
if ($company->id)
{
$v->setURL($company->url, "WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->tel, "WORK;VOICE");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email,'internet');

View File

@ -54,7 +54,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -17,7 +17,7 @@
*/
/**
* \file htdocs/core/admin_extrafields.inc.php
* \file htdocs/core/actions_extrafields.inc.php
* \brief Code for actions on extrafields admin pages
*/
@ -306,4 +306,4 @@ if ($action == 'delete')
}
}
?>
?>

View File

@ -0,0 +1,233 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/actions_sendmails.inc.php
* \brief Code for actions on sending mails from object page
*/
// TODO Include this include file into all class objects
// $id must be defined
// $actiontypecode must be defined
/*
* Add file in email form
*/
if (GETPOST('addfile'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp';
dol_add_file_process($upload_dir_tmp,0,0);
$action='presend';
}
/*
* Remove file in email form
*/
if (! empty($_POST['removedfile']))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp';
// TODO Delete only files that was uploaded from email form
dol_remove_file_process($_POST['removedfile'],0);
$action='presend';
}
/*
* Send mail
*/
if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel'])
{
$langs->load('mails');
$subject='';$actionmsg='';$actionmsg2='';
$result=$object->fetch($id);
$sendtosocid=0;
if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe')
{
$result=$object->fetch_thirdparty();
$thirdparty=$object->thirdparty;
$sendtosocid=$thirdparty->id;
}
else if ($object->element == 'societe')
{
$thirdparty=$object;
$sendtosocid=$thirdparty->id;
}
else dol_print_error('','Use actions_sendmails.in.php for a type that is not supported');
if ($result > 0)
{
if ($_POST['sendto'])
{
// Recipient is provided into free text
$sendto = $_POST['sendto'];
$sendtoid = 0;
}
elseif ($_POST['receiver'] != '-1')
{
// Recipient was provided from combo list
if ($_POST['receiver'] == 'thirdparty') // Id of third party
{
$sendto = $thirdparty->email;
$sendtoid = 0;
}
else // Id du contact
{
$sendto = $thirdparty->contact_get_property($_POST['receiver'],'email');
$sendtoid = $_POST['receiver'];
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$deliveryreceipt = $_POST['deliveryreceipt'];
if ($action == 'send' || $action == 'relance')
{
if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
$actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
if ($message)
{
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
$actionmsg.=$message;
}
}
// Create form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
// Send mail
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1);
if ($mailfile->error)
{
$mesgs[]='<div class="error">'.$mailfile->error.'</div>';
}
else
{
$result=$mailfile->sendfile();
if ($result)
{
$error=0;
// Initialisation donnees
$object->socid = $sendtosocid; // To link to a company
$object->sendtoid = $sendtoid; // To link to a contact/address
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('COMPANY_SENTBYMAIL',$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
if ($error)
{
dol_print_error($db);
}
else
{
// Redirect here
// This avoid sending mail twice if going out and then back to page
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
setEventMessage($mesg);
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id);
exit;
}
}
else
{
$langs->load("other");
$mesg='<div class="error">';
if ($mailfile->error)
{
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.='<br>'.$mailfile->error;
}
else
{
$mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg.='</div>';
setEventMessage($mesg,'warnings');
$action = 'presend';
}
}
/* }
else
{
$langs->load("other");
$mesgs[]='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').'</div>';
dol_syslog('Recipient email is empty');
}*/
}
else
{
$langs->load("errors");
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")),'warnings');
dol_syslog('Try to send email with no recipiend defined', LOG_WARNING);
$action = 'presend';
}
}
else
{
$langs->load("other");
setEventMessage($langs->trans('ErrorFailedToReadEntity',$object->element),'errors');
dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element);
$action = 'presend';
}
}
?>

View File

@ -116,7 +116,6 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
$row_array['value'] = $row['town'];
$row_array['zipcode'] = $row['zip'];
}
$row_array['departement_id'] = $row['fk_county']; // deprecated
$row_array['selectcountry_id'] = $row['fk_country'];
$row_array['state_id'] = $row['fk_county'];

View File

@ -79,7 +79,7 @@ class box_members extends ModeleBoxes
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers",$max));
if ($user->rights->societe->lire)
if ($user->rights->adherent->lire)
{
$sql = "SELECT a.rowid, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";

View File

@ -451,9 +451,10 @@ abstract class CommonObject
* @param string $source 'internal', 'external' or 'all'
* @param string $order Sort order by : 'code' or 'rowid'
* @param string $option 0=Return array id->label, 1=Return array code->label
* @param string $activeonly 0=all type of contact, 1=only the active
* @return array Array list of type of contacts (id->label if option=0, code->label if option=1)
*/
function liste_type_contact($source='internal', $order='code', $option=0)
function liste_type_contact($source='internal', $order='code', $option=0, $activeonly=0)
{
global $langs;
@ -461,6 +462,9 @@ abstract class CommonObject
$sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.= " WHERE tc.element='".$this->element."'";
if ($activeonly == 1)
$sql.= " AND tc.active=1"; // only the active type
if (! empty($source)) $sql.= " AND tc.source='".$source."'";
$sql.= " ORDER by tc.".$order;
@ -2617,6 +2621,7 @@ abstract class CommonObject
}
}
/* This is to show add lines */
@ -3129,53 +3134,80 @@ abstract class CommonObject
// calcul des marges
if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise
$pa = $line->qty * $line->pa_ht;
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
if ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '1') { // remise globale considérée comme produit
$marginInfos['pa_products'] += $line->pa_ht;// ($line->pa_ht != 0)?$line->pa_ht:$line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pv_products'] += $line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pa_total'] += $line->pa_ht;// ($line->pa_ht != 0)?$line->pa_ht:$line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pv_total'] += $line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pa_products'] += $pa;
$marginInfos['pv_products'] += $pv;
$marginInfos['pa_total'] += $pa;
$marginInfos['pv_total'] += $pv;
// if credit note, margin = -1 * (abs(selling_price) - buying_price)
if ($pv < 0)
$marginInfos['margin_on_products'] += -1 * (abs($pv) - $pa);
else
$marginInfos['margin_on_products'] += $pv - $pa;
}
elseif ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '2') { // remise globale considérée comme service
$marginInfos['pa_services'] += $line->pa_ht;// ($line->pa_ht != 0)?$line->pa_ht:$line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pv_services'] += $line->subprice * (1 - ($line->remise_percent / 100));
$marginInfos['pa_total'] += $line->pa_ht;// ($line->pa_ht != 0)?$line->pa_ht:$line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pv_total'] += $line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pa_services'] += $pa;
$marginInfos['pv_services'] += $pv;
$marginInfos['pa_total'] += $pa;
$marginInfos['pv_total'] += $pv;
// if credit note, margin = -1 * (abs(selling_price) - buying_price)
if ($pv < 0)
$marginInfos['margin_on_services'] += -1 * (abs($pv) - $pa);
else
$marginInfos['margin_on_services'] += $pv - $pa;
}
elseif ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '3') { // remise globale prise en compte uniqt sur total
$marginInfos['pa_total'] += $line->pa_ht;// ($line->pa_ht != 0)?$line->pa_ht:$line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pv_total'] += $line->subprice * (1 - ($line->remise_percent / 100));
$marginInfos['pa_total'] += $pa;
$marginInfos['pv_total'] += $pv;
}
}
else {
$type=$line->product_type?$line->product_type:$line->fk_product_type;
if ($type == 0) { // product
$marginInfos['pa_products'] += $line->qty * $line->pa_ht;
$marginInfos['pv_products'] += $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pa_total'] += $line->qty * $line->pa_ht;
$marginInfos['pv_total'] += $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$pa = $line->qty * $line->pa_ht;
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pa_products'] += $pa;
$marginInfos['pv_products'] += $pv;
$marginInfos['pa_total'] += $pa;
$marginInfos['pv_total'] += $pv;
// if credit note, margin = -1 * (abs(selling_price) - buying_price)
if ($pv < 0)
$marginInfos['margin_on_products'] += -1 * (abs($pv) - $pa);
else
$marginInfos['margin_on_products'] += $pv - $pa;
}
elseif ($type == 1) { // service
$marginInfos['pa_services'] += $line->qty * $line->pa_ht;
$marginInfos['pv_services'] += $line->qty * $line->subprice * (1 - ($line->remise_percent / 100));
$marginInfos['pa_total'] += $line->qty * $line->pa_ht;
$marginInfos['pv_total'] += $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$pa = $line->qty * $line->pa_ht;
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$marginInfos['pa_services'] += $pa;
$marginInfos['pv_services'] += $pv;
$marginInfos['pa_total'] += $pa;
$marginInfos['pv_total'] += $pv;
// if credit note, margin = -1 * (abs(selling_price) - buying_price)
if ($pv < 0)
$marginInfos['margin_on_services'] += -1 * (abs($pv) - $pa);
else
$marginInfos['margin_on_services'] += $pv - $pa;
}
}
}
$marginInfos['margin_on_products'] = $marginInfos['pv_products'] - $marginInfos['pa_products'];
if ($marginInfos['pa_products'] > 0)
$marginInfos['margin_rate_products'] = 100 * round($marginInfos['margin_on_products'] / $marginInfos['pa_products'],5);
if ($marginInfos['pv_products'] > 0)
$marginInfos['mark_rate_products'] = 100 * round($marginInfos['margin_on_products'] / $marginInfos['pv_products'],5);
$marginInfos['margin_on_services'] = $marginInfos['pv_services'] - $marginInfos['pa_services'];
if ($marginInfos['pa_services'] > 0)
$marginInfos['margin_rate_services'] = 100 * round($marginInfos['margin_on_services'] / $marginInfos['pa_services'],5);
if ($marginInfos['pv_services'] > 0)
$marginInfos['mark_rate_services'] = 100 * round($marginInfos['margin_on_services'] / $marginInfos['pv_services'],5);
$marginInfos['total_margin'] = $marginInfos['pv_total'] - $marginInfos['pa_total'];
// if credit note, margin = -1 * (abs(selling_price) - buying_price)
if ($marginInfos['pv_total'] < 0)
$marginInfos['total_margin'] = -1 * (abs($marginInfos['pv_total']) - $marginInfos['pa_total']);
else
$marginInfos['total_margin'] = $marginInfos['pv_total'] - $marginInfos['pa_total'];
if ($marginInfos['pa_total'] > 0)
$marginInfos['total_margin_rate'] = 100 * round($marginInfos['total_margin'] / $marginInfos['pa_total'],5);
if ($marginInfos['pv_total'] > 0)

View File

@ -191,7 +191,7 @@ class FormCompany
* @param string $htmlname Id of department
* @return void
*/
function select_departement($selected='',$country_codeid=0, $htmlname='departement_id')
function select_departement($selected='',$country_codeid=0, $htmlname='state_id')
{
print $this->select_state($selected,$country_codeid, $htmlname);
}
@ -208,7 +208,7 @@ class FormCompany
* @param string $htmlname Id of department
* @return string String with HTML select
*/
function select_state($selected='',$country_codeid=0, $htmlname='departement_id')
function select_state($selected='',$country_codeid=0, $htmlname='state_id')
{
global $conf,$langs,$user;
@ -627,7 +627,7 @@ class FormCompany
{
if (is_object($object) && method_exists($object, 'liste_type_contact'))
{
$lesTypes = $object->liste_type_contact($source, $order);
$lesTypes = $object->liste_type_contact($source, $order, 0, 1);
print '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($showempty) print '<option value="0"></option>';
foreach($lesTypes as $key=>$value)

View File

@ -46,8 +46,8 @@ class FormMail
var $withsubstit; // Show substitution array
var $withfrom;
var $withto;
var $withtofree;
var $withto; // Show recipient emails
var $withtofree; // Show free text for recipient emails
var $withtocc;
var $withtoccc;
var $withtopic;
@ -493,7 +493,7 @@ class FormMail
}
else
{
$out.= '<input type="text" size="60" id="subject" name="subject" value="'. (isset($_POST["subject"])?$_POST["subject"]:$this->withtopic) .'" />';
$out.= '<input type="text" size="60" id="subject" name="subject" value="'. (isset($_POST["subject"])?$_POST["subject"]:(is_numeric($this->withtopic)?'':$this->withtopic)) .'" />';
}
$out.= "</td></tr>\n";
}

View File

@ -210,7 +210,7 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,
jQuery("#'.$htmlname.'").val(item.value);
// TODO move this to specific request
if (item.states) {
jQuery("#departement_id").html(item.states);
jQuery("#state_id").html(item.states);
}
for (i=0;i<length;i++) {
if (item[fields[i]]) { // If defined
@ -233,12 +233,12 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,
{
jQuery("#" + fields[i]).val(ui.item[fields[i]]);
// If we set new country and new state, we need to set a new list of state to allow change
if (ui.item.states && ui.item["departement_id"] != jQuery("#departement_id").value) {
jQuery("#departement_id").html(ui.item.states);
if (ui.item.states && ui.item["state_id"] != jQuery("#state_id").value) {
jQuery("#state_id").html(ui.item.states);
}
}
}
else if (fields[i]=="state_id" || fields[i]=="departement_id")
else if (fields[i]=="state_id" || fields[i]=="state_id")
{
if (ui.item[fields[i]] > 0) // Do not erase state if unknown
{

View File

@ -5,7 +5,8 @@
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
* *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@ -546,7 +547,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print "\n".'<table class="noborder" width="100%">'."\n";
$colspan=6;
$colspan=8;
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Poste").'</td>';
@ -561,10 +562,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$colspan++;
print '<td>&nbsp;</td>';
}
if ($user->rights->societe->contact->creer)
{
$colspan++;
print '<td>&nbsp;</td>';
}
print "</tr>";
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.statut ";
$sql .= ", p.civilite, p.address, p.zip, p.town";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
$sql .= " ORDER by p.datec";
@ -592,17 +599,17 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '<td>'.$obj->poste.'</td>';
$country_code = getCountry($obj->fk_pays, 2);
$country_code = getCountry($obj->fk_pays, 'all');
// Lien click to dial
print '<td>';
print dol_print_phone($obj->phone,$country_code,$obj->rowid,$object->id,'AC_TEL');
print dol_print_phone($obj->phone,$country_code['code'],$obj->rowid,$object->id,'AC_TEL');
print '</td>';
print '<td>';
print dol_print_phone($obj->phone_mobile,$country_code,$obj->rowid,$object->id,'AC_TEL');
print dol_print_phone($obj->phone_mobile,$country_code['code'],$obj->rowid,$object->id,'AC_TEL');
print '</td>';
print '<td>';
print dol_print_phone($obj->fax,$country_code,$obj->rowid,$object->id,'AC_FAX');
print dol_print_phone($obj->fax,$country_code['code'],$obj->rowid,$object->id,'AC_FAX');
print '</td>';
print '<td>';
print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL');
@ -610,6 +617,42 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if ($obj->statut==0) print '<td>'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('StatusContactDraftShort'),'statut0').'</td>';
elseif ($obj->statut==1) print '<td>'.$langs->trans('Enabled').' </span>'.img_picto($langs->trans('StatusContactValidatedShort'),'statut1').'</td>';
// copy in clipboard
$coords = '';
if (!empty($object->name))
$coords .= addslashes($object->name)."<br />";
if (!empty($obj->civilite))
$coords .= addslashes($obj->civilite).' ';
if (!empty($obj->firstname))
$coords .= addslashes($obj->firstname).' ';
if (!empty($obj->lastname))
$coords .= addslashes($obj->lastname);
$coords .= "<br />";
if (!empty($obj->address))
{
$coords .= addslashes(dol_nl2br($obj->address,1,true))."<br />";
if (!empty($obj->cp))
$coords .= addslashes($obj->zip).' ';
if (!empty($obj->ville))
$coords .= addslashes($obj->town);
if (!empty($obj->pays))
$coords .= "<br />".addslashes($country_code['label']);
}
elseif (!empty($object->address))
{
$coords .= addslashes(dol_nl2br($object->address,1,true))."<br />";
if (!empty($object->zip))
$coords .= addslashes($object->zip).' ';
if (!empty($object->town))
$coords .= addslashes($object->town);
if (!empty($object->country))
$coords .= "<br />".addslashes($object->country);
}
print '<td align="center"><a href="#" onclick="return copyToClipboard(\''.$coords.'\');">';
print img_picto($langs->trans("Address"), 'object_address.png');
print '</a></td>';
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
print '<td align="center">';
@ -648,6 +691,20 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print "\n</table>\n";
print "<br>\n";
?>
<div id="dialog" title="<?php echo dol_escape_htmltag($langs->trans('Address')); ?>" style="display: none;">
</div>
<?php
print '<script type="text/javascript">
function copyToClipboard (text) {
text = text.replace(/<br \/>/g,"\n");
var newElem = "<textarea id=\"coords\" style=\"border: none; width: 90%; height: 120px;\">"+text+"</textarea><br/><br/>'.$langs->trans('HelpCopyToClipboard').'";
$("#dialog").html(newElem);
$( "#dialog" ).dialog();
$("#coords").select();
return false;
}
</script>';
return $i;
}

View File

@ -4095,14 +4095,14 @@ function dol_osencode($str)
/**
* Return an id or code from a code or id. Store Code-Id in a cache.
* Return an id or code from a code or id. Store also Code-Id into a cache for next use.
*
* @param DoliDB $db Database handler
* @param string $key Code to get Id
* @param string $tablename Table name without prefix
* @param string $fieldkey Field for code
* @param string $fieldid Field for id
* @return int Id of code
* @return int <0 if KO, Id of code if OK
* @see getLabelFromKey
*/
function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
@ -4121,7 +4121,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
$sql = "SELECT ".$fieldid." as id";
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
$sql.= " WHERE ".$fieldkey." = '".$key."'";
dol_syslog('dol_getIdFromCode sql='.$sql,LOG_DEBUG);
dol_syslog('dol_getIdFromCode sql='.$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
@ -4133,7 +4133,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
}
else
{
dol_syslog("dol_getIdFromCode error=".$db->lasterror(),LOG_ERR);
dol_syslog("dol_getIdFromCode error=".$db->lasterror(), LOG_ERR);
return -1;
}
}

View File

@ -52,7 +52,7 @@ function commande_prepare_head($object)
|| ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire))
{
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text=$langs->trans("Sendings");
if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipment");
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text.='/';
if ($conf->livraison_bon->enabled) $text.=$langs->trans("Receivings");
$head[$h][1] = $text;
@ -93,7 +93,7 @@ function commande_prepare_head($object)
$head[$h][2] = 'note';
$h++;
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files'));
@ -137,7 +137,7 @@ function order_admin_prepare_head($object)
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/orderdet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines';

View File

@ -312,7 +312,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
{
// Tel
if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel);
if ($sourcecompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->phone);
// Fax
if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
// EMail
@ -345,7 +345,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{
// Tel
if ($targetcontact->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->tel);
if ($targetcontact->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone);
// Fax
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
// EMail
@ -363,7 +363,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{
// Tel
if ($targetcompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->tel);
if ($targetcompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->phone);
// Fax
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
// EMail
@ -459,7 +459,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
elseif ($unit=='in') $k=72;
$savx=$pdf->getX(); $savy=$pdf->getY();
$watermark_angle=atan($h/$w)/2;
$watermark_x_pos=0;
$watermark_y_pos=$h/3;
@ -1031,7 +1031,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice;
}
}
// Add an additional description for the category products
if (! empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && ! empty($conf->categorie->enabled))
{
@ -1047,7 +1047,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$libelleproduitservice.='__N__'.$desccateg;
}
}
if (! empty($object->lines[$i]->date_start) || ! empty($object->lines[$i]->date_end))
{
$format='day';

View File

@ -48,7 +48,7 @@ function propal_prepare_head($object)
{
$langs->load("sendings");
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text=$langs->trans("Sendings");
if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipment");
if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings");
$head[$h][1] = $text;
$head[$h][2] = 'shipping';
@ -135,7 +135,7 @@ function propal_admin_prepare_head($object)
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines';

View File

@ -215,7 +215,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
{
foreach($feature2 as $subfeature)
{
if (empty($user->rights->$feature->$subfeature->creer)
if (empty($user->rights->$feature->$subfeature->creer)
&& empty($user->rights->$feature->$subfeature->write)
&& empty($user->rights->$feature->$subfeature->create)) $createok=0;
else { $createok=1; break; } // For bypass the second test if the first is ok
@ -411,7 +411,8 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
// If external user: Check permission for external users
if ($user->societe_id > 0)
{
$sql = "SELECT dbt.".$dbt_keyfield;
if (empty($dbt_keyfield)) dol_print_error('','Param dbt_keyfield is required but not defined');
$sql = "SELECT dbt.".$dbt_keyfield;
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
$sql.= " WHERE dbt.rowid = ".$objectid;
$sql.= " AND dbt.".$dbt_keyfield." = ".$user->societe_id;
@ -419,6 +420,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
// If internal user: Check permission for internal users that are restricted on their objects
else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
{
if (empty($dbt_keyfield)) dol_print_error('','Param dbt_keyfield is required but not defined');
$sql = "SELECT sc.fk_soc";
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";

View File

@ -172,10 +172,10 @@ class pdf_merou extends ModelePdfExpedition
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
$pdf->SetSubject($outputlangs->transnoentities("Shipment"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending"));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Shipment"));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right

View File

@ -157,10 +157,10 @@ class pdf_rouget extends ModelePdfExpedition
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
$pdf->SetSubject($outputlangs->transnoentities("Shipment"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending"));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Shipment"));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right

View File

@ -53,10 +53,10 @@ class mod_expedition_ribera extends ModelNumRefExpedition
$texte.= '<input type="hidden" name="maskconstexpedition" value="EXPEDITION_RIBERA_MASK">';
$texte.= '<table class="nobordernopadding" width="100%">';
$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Sending"),$langs->transnoentities("Sending"));
$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Shipment"),$langs->transnoentities("Shipment"));
$tooltip.=$langs->trans("GenericMaskCodes2");
$tooltip.=$langs->trans("GenericMaskCodes3");
$tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Sending"),$langs->transnoentities("Sending"));
$tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Shipment"),$langs->transnoentities("Shipment"));
$tooltip.=$langs->trans("GenericMaskCodes5");
$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';

View File

@ -697,6 +697,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$posy+=2;
// Add list of linked orders on shipment
// Currently not supported by pdf_writeLinkedObjects, link for delivery to order is done through shipment)
if ($object->origin == 'expedition' || $object->origin == 'shipping')
{
$Yoff=$posy-5;
@ -708,7 +709,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$origin = $shipment->origin;
$origin_id = $shipment->origin_id;
// TODO move to external function
if ($conf->$origin->enabled)
{
$outputlangs->load('orders');

View File

@ -44,7 +44,7 @@ class modAgenda extends DolibarrModules
function __construct($db)
{
global $conf;
$this->db = $db;
$this->numero = 2400;
@ -74,6 +74,7 @@ class modAgenda extends DolibarrModules
// Constantes
//-----------
$this->const = array();
$this->const[15] = array("MAIN_AGENDA_ACTIONAUTO_COMPANY_SENTBYMAIL","chaine","1");
$this->const[0] = array("MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE","chaine","1");
$this->const[1] = array("MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE","chaine","1");
$this->const[2] = array("MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE","chaine","1");
@ -166,7 +167,7 @@ class modAgenda extends DolibarrModules
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'export';
// Main menu entries
$this->menu = array(); // List of menus to add
$r=0;
@ -376,7 +377,7 @@ class modAgenda extends DolibarrModules
'a.datea'=>'Date','a.datea2'=>'Date','a.percent'=>'Numeric','a.fk_user_author'=>'List:user:name','a.fk_user_action'=>'List:user:name',
'a.fk_user_done'=>"List:user:name","a.priority"=>"Numeric","a.fulldayevent"=>"Boolean","a.location"=>"Text",
"a.fk_soc"=>"List:Societe:nom","a.fk_contact"=>"List:socpeople:name","a.fk_action"=>"List:c_actioncomm:libelle:code");
$this->export_entities_array[$r]=array('a.id'=>'action','a.label'=>'action','a.datep'=>'action','a.datep2'=>'action',
'a.datea'=>'action','a.datea2'=>'action','a.percent'=>'action','a.fk_user_author'=>'action','a.fk_user_action'=>'action',
'a.fk_user_done'=>"action","a.priority"=>"action","a.fulldayevent"=>"action","a.location"=>"action",

View File

@ -176,27 +176,34 @@ class modProjet extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("projet","export"));
$this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid');
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote",
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc");
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote",
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc",
'ptt.task_date'=>'TaskTimeDate','ptt.task_duration'=>"TimesSpent",'ptt.fk_user'=>"TaskTimeUser",'ptt.note'=>"TaskTimeNote");
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project",
'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.planned_workload'=>"task",'pt.progress'=>"task",'pt.description'=>"task");
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Number",'pt.progress'=>"Number",'pt.description'=>"Text",
'ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:Name",'ptt.note'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company',
's.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project",
'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.planned_workload'=>"task",'pt.progress'=>"task",'pt.description'=>"task",
'ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time");
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'projet_task as pt, '.MAIN_DB_PREFIX.'societe as s)';
$this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid AND p.rowid = pt.fk_projet ';
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'projet as p, '.MAIN_DB_PREFIX.'societe as s)';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON (p.rowid = pt.fk_projet)";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON (pt.rowid = ptt.fk_task)";
$this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity;
$r++;
}

View File

@ -141,13 +141,21 @@ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{
$margin_rate = (isset($_POST["marginRate"])?$_POST["marginRate"]:(($line->pa_ht == 0)?'':price($line->marge_tx)));
echo '<td align="right"><input type="text" size="2" name="marginRate" value="'.$margin_rate.'">%</td>';
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td align="right">'.$margin_rate.'%</td>';
else
echo '<td align="right"><input type="text" size="2" name="marginRate" value="'.$margin_rate.'">%</td>';
$coldisplay++;
}
elseif (! empty($conf->global->DISPLAY_MARK_RATES))
{
$mark_rate = (isset($_POST["markRate"])?$_POST["markRate"]:price($line->marque_tx));
echo '<td align="right"><input type="text" size="2" name="markRate" value="'.$mark_rate.'">%</td>';
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td align="right">'.$mark_rate.'%</td>';
else
echo '<td align="right"><input type="text" size="2" name="markRate" value="'.$mark_rate.'">%</td>';
$coldisplay++;
}
}

View File

@ -140,6 +140,20 @@ class InterfaceActionsAuto
$object->socid=$object->id;
$ok=1;
}
elseif ($action == 'COMPANY_SENTBYMAIL')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("orders");
$langs->load("agenda");
if (empty($object->actiontypecode)) $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) dol_syslog('Trigger called with property actionmsg2 on object not defined', LOG_ERR);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
// Parameters $object->sendtoid defined by caller
//$object->sendtoid=0;
$ok=1;
}
elseif ($action == 'CONTRACT_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
@ -625,7 +639,7 @@ class InterfaceActionsAuto
$error ="Failed to insert event : ".$actioncomm->error." ".join(',',$actioncomm->errors);
$this->error=$error;
$this->errors=$actioncomm->errors;
dol_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);
return -1;
}

View File

@ -153,7 +153,7 @@ if ($id > 0 || ! empty($ref))
$langs->trans("OrderCard");
$head = shipping_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("Sending"), 0, 'sending');
dol_fiche_head($head, 'contact', $langs->trans("Shipment"), 0, 'sending');
/*

View File

@ -61,9 +61,6 @@ $socid='';
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user, $origin, $origin_id);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('expeditioncard'));
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
@ -73,6 +70,11 @@ $hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty(
$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
$object = new Expedition($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Load object
if ($id > 0 || ! empty($ref))
@ -80,14 +82,19 @@ if ($id > 0 || ! empty($ref))
$ret=$object->fetch($id, $ref);
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('expeditioncard'));
/*
* Actions
*/
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($action == 'add')
{
$error=0;
$object = new Expedition($db);
$db->begin();
@ -517,7 +524,7 @@ else if ($action == 'classifybilled')
* View
*/
llxHeader('',$langs->trans('Sending'),'Expedition');
llxHeader('',$langs->trans('Shipment'),'Expedition');
$form = new Form($db);
$formfile = new FormFile($db);
@ -916,7 +923,7 @@ else
$soc->fetch($object->socid);
$head=shipping_prepare_head($object);
dol_fiche_head($head, 'shipping', $langs->trans("Sending"), 0, 'sending');
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), 0, 'sending');
dol_htmloutput_mesg($mesg);
@ -926,7 +933,7 @@ else
if ($action == 'delete')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1);
}
/*
@ -955,7 +962,7 @@ else
}
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
}
/*
* Confirmation de l'annulation
@ -963,7 +970,7 @@ else
if ($action == 'annuler')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
}
// Calculate true totalWeight and totalVolume for all products

View File

@ -39,7 +39,7 @@ $companystatic=new Societe($db);
$shipment=new Expedition($db);
$helpurl='EN:Module_Shipments|FR:Module_Exp&eacute;ditions|ES:M&oacute;dulo_Expediciones';
llxHeader('',$langs->trans("Sendings"),$helpurl);
llxHeader('',$langs->trans("Shipment"),$helpurl);
print_fiche_titre($langs->trans("SendingsArea"));

View File

@ -88,7 +88,7 @@ if ($id > 0 || ! empty($ref))
$soc->fetch($object->socid);
$head=shipping_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans("Sending"), 0, 'sending');
dol_fiche_head($head, 'note', $langs->trans("Shipment"), 0, 'sending');
print '<table class="border" width="100%">';

View File

@ -506,9 +506,9 @@ if ($step == 2 && $datatoexport)
print '<td>'.$langs->trans("Entities").'</td>';
print '<td>'.$langs->trans("ExportableFields").'</td>';
print '<td width="100" align="center">';
print '<a title='.$langs->trans("All").' alt='.$langs->trans("All").' href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field=all">'.$langs->trans("All")."</a>";
print '<a class="liste_titre" title='.$langs->trans("All").' alt='.$langs->trans("All").' href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field=all">'.$langs->trans("All")."</a>";
print '/';
print '<a title='.$langs->trans("None").' alt='.$langs->trans("None").' href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=unselectfield&field=all">'.$langs->trans("None")."</a>";
print '<a class="liste_titre" title='.$langs->trans("None").' alt='.$langs->trans("None").' href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=unselectfield&field=all">'.$langs->trans("None")."</a>";
print '</td>';
print '<td width="44%">'.$langs->trans("ExportedFields").'</td>';
print '</tr>';

View File

@ -53,7 +53,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -155,7 +155,7 @@ if ($object->fetch($id))
print '<tr><td>'.$langs->trans("Web").'</td><td colspan="3">'.dol_print_url($object->url).'</td></tr>';
// Phone
print '<tr><td>'.$langs->trans("Phone").'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans("Phone").'</td><td style="min-width: 25%;">'.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').'</td>';
// Fax
print '<td>'.$langs->trans("Fax").'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'</td></tr>';

View File

@ -47,7 +47,7 @@ class Holiday extends CommonObject
var $date_debut='';
var $date_fin='';
var $halfday='';
var $statut='';
var $statut=''; // 1=draft, 2=validated, 3=approved
var $fk_validator;
var $date_valid='';
var $fk_user_valid;
@ -871,7 +871,7 @@ class Holiday extends CommonObject
*
* @param int $userID Id of user
* @param int $nbHoliday Nb of days
* @return void
* @return int 0=Nothing done, 1=OK, -1=KO
*/
function updateSoldeCP($userID='',$nbHoliday='')
{
@ -907,7 +907,7 @@ class Holiday extends CommonObject
$i = 0;
while($i < $nbUser)
while ($i < $nbUser)
{
$now_holiday = $this->getCPforUser($users[$i]['rowid']);
$new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth');
@ -922,11 +922,18 @@ class Holiday extends CommonObject
$sql2.= " nb_holiday = nb_holiday + ".$nb_holiday;
dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql2);
$this->db->query($sql2);
$result= $this->db->query($sql2);
if ($result) return 1;
else return -1;
}
} else {
return 0;
}
else
{
// Mise à jour pour un utilisateur
$nbHoliday = number_format($nbHoliday,2,'.','');
$nbHoliday = price2num($nbHoliday,2);
// Mise à jour pour un utilisateur
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_users SET";
@ -934,7 +941,10 @@ class Holiday extends CommonObject
$sql.= " WHERE fk_user = '".$userID."'";
dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql);
$this->db->query($sql);
$result = $this->db->query($sql);
if ($result) return 1;
else return -1;
}
}

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2012-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -46,9 +46,9 @@ $user_id = $user->id;
$now=dol_now();
/*******************************************************************
/*
* Actions
********************************************************************/
*/
// Si création de la demande
if ($action == 'create')
@ -232,27 +232,41 @@ if ($action == 'update')
}
// Si suppression de la demande
if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes')
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes')
{
if($user->rights->holiday->delete)
{
$error=0;
$db->begin();
$cp = new Holiday($db);
$cp->fetch($id);
// Si c'est bien un brouillon
if ($cp->statut == 1)
if ($cp->statut == 1 || $cp->statut == 3)
{
// Si l'utilisateur à le droit de lire cette demande, il peut la supprimer
if ($user->id == $cp->fk_user || $user->rights->holiday->lire_tous)
{
$cp->delete($id);
header('Location: index.php');
exit;
$result=$cp->delete($id);
}
else {
else
{
$error = $langs->trans('ErrorCantDeleteCP');
}
}
if (! $error)
{
$db->commit();
header('Location: index.php');
exit;
}
else
{
$db->rollback();
}
}
}
@ -315,9 +329,9 @@ if ($action == 'confirm_send')
}
// Si l'option pour avertir le valideur en cas de solde inférieur à la demande
if($cp->getConfCP('AlertValidatorSolde'))
if ($cp->getConfCP('AlertValidatorSolde'))
{
$nbopenedday=num_open_day($cp->date_debut,$cp->date_fin,0,1);
$nbopenedday=num_open_day($cp->date_debut,$cp->date_fin,0,1,$cp->halfday);
if ($nbopenedday > $cp->getCPforUser($cp->fk_user))
{
$message.= "\n";
@ -361,9 +375,8 @@ if($action == 'confirm_valid')
$cp->fetch($id);
// Si statut en attente de validation et valideur = utilisateur
if($cp->statut == 2 && $user->id == $cp->fk_validator)
if ($cp->statut == 2 && $user->id == $cp->fk_validator)
{
$cp->date_valid = dol_now();
$cp->fk_user_valid = $user->id;
$cp->statut = 3;
@ -371,13 +384,13 @@ if($action == 'confirm_valid')
$verif = $cp->update($user->id);
// Si pas d'erreur SQL on redirige vers la fiche de la demande
if($verif > 0) {
// Retrait du nombre de jours prit
$nbJour = $nbopenedday=num_open_day($cp->date_debut,$cp->date_fin,0,1);
if ($verif > 0)
{
// Calculcate number of days consummed
$nbopenedday=num_open_day($cp->date_debut,$cp->date_fin,0,1);
$soldeActuel = $cp->getCpforUser($cp->fk_user);
$newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted'));
$newSolde = $soldeActuel - ($nbopenedday * $cp->getConfCP('nbHolidayDeducted'));
// On ajoute la modification dans le LOG
$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde);
@ -441,13 +454,13 @@ if($action == 'confirm_valid')
if ($action == 'confirm_refuse')
{
if(!empty($_POST['detail_refuse']))
if (!empty($_POST['detail_refuse']))
{
$cp = new Holiday($db);
$cp->fetch($_GET['id']);
// Si statut en attente de validation et valideur = utilisateur
if($cp->statut == 2 && $user->id == $cp->fk_validator)
if ($cp->statut == 2 && $user->id == $cp->fk_validator)
{
$cp->date_refuse = date('Y-m-d H:i:s', time());
$cp->fk_user_refuse = $user->id;
@ -457,8 +470,8 @@ if ($action == 'confirm_refuse')
$verif = $cp->update($user->id);
// Si pas d'erreur SQL on redirige vers la fiche de la demande
if($verif > 0) {
if ($verif > 0)
{
// To
$destinataire = new User($db);
$destinataire->fetch($cp->fk_user);
@ -525,16 +538,48 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes')
$cp->fetch($_GET['id']);
// Si statut en attente de validation et valideur = utilisateur
if ($cp->statut == 2 && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user))
if (($cp->statut == 2 || $cp->statut == 3) && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user))
{
$db->begin();
$oldstatus = $cp->statut;
$cp->date_cancel = dol_now();
$cp->fk_user_cancel = $user->id;
$cp->statut = 4;
$verif = $cp->update($user->id);
$result = $cp->update($user->id);
if ($result >= 0 && $oldstatus == 3) // holiday was already validated, status 3, so we must increase back sold
{
// Calculcate number of days consummed
$nbopenedday=num_open_day($cp->date_debut,$cp->date_fin,0,1,$cp->halfday);
$soldeActuel = $cp->getCpforUser($cp->fk_user);
$newSolde = $soldeActuel + ($nbopenedday * $cp->getConfCP('nbHolidayDeducted'));
// On ajoute la modification dans le LOG
$result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde);
// Mise à jour du solde
$result2=$cp->updateSoldeCP($cp->fk_user, $newSolde);
if ($result1 < 0 || $result2 < 0)
{
$error = $langs->trans('ErrorCantDeleteCP');
}
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
// Si pas d'erreur SQL on redirige vers la fiche de la demande
if($verif > 0)
if (! $error && $result > 0)
{
// To
$destinataire = new User($db);
@ -829,11 +874,11 @@ else
if($user->id == $cp->fk_user || $user->rights->holiday->lire_tous)
{
if ($action == 'delete' && $cp->statut == 1) {
if ($action == 'delete')
{
if($user->rights->holiday->delete)
{
print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1);
if ($ret == 'html') print '<br />';
}
}
@ -841,29 +886,25 @@ else
if ($action == 'sendToValidate' && $cp->statut == 1 && $user->id == $cp->fk_user)
{
print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1);
if ($ret == 'html') print '<br />';
}
// Si validation de la demande
if ($action == 'valid' && $cp->statut == 2 && $user->id == $cp->fk_validator)
if ($action == 'valid')
{
print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1);
if ($ret == 'html') print '<br />';
}
// Si refus de la demande
if ($action == 'refuse' && $cp->statut == 2 && $user->id == $cp->fk_validator)
if ($action == 'refuse')
{
$array_input = array(array('type'=>"text",'label'=> $langs->trans('DetailRefusCP'),'name'=>"detail_refuse",'size'=>"50",'value'=>""));
print $form->formconfirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0);
if ($ret == 'html') print '<br />';
}
// Si annulation de la demande
if ($action == 'cancel' && $cp->statut == 2 && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user))
if ($action == 'cancel')
{
print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1);
if ($ret == 'html') print '<br />';
}
$head=holiday_prepare_head($cp);
@ -893,7 +934,8 @@ else
$starthalfday=($cp->halfday == -1 || $cp->halfday == 2)?'afternoon':'morning';
$endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon';
if(!$edit) {
if(!$edit)
{
print '<tr>';
print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td>'.dol_print_date($cp->date_debut,'day');
@ -901,7 +943,9 @@ else
print $langs->trans($listhalfday[$starthalfday]);
print '</td>';
print '</tr>';
} else {
}
else
{
print '<tr>';
print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td>';
@ -921,7 +965,9 @@ else
print $langs->trans($listhalfday[$endhalfday]);
print '</td>';
print '</tr>';
} else {
}
else
{
print '<tr>';
print '<td>'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
print '<td>';
@ -1053,7 +1099,7 @@ else
{
print '<a href="fiche.php?id='.$_GET['id'].'&action=sendToValidate" class="butAction">'.$langs->trans("Validate").'</a>';
}
if($user->rights->holiday->delete && $cp->statut == 1)
if ($user->rights->holiday->delete && $cp->statut == 1) // If draft
{
print '<a href="fiche.php?id='.$_GET['id'].'&action=delete" class="butActionDelete">'.$langs->trans("DeleteCP").'</a>';
}
@ -1064,7 +1110,7 @@ else
print '<a href="fiche.php?id='.$_GET['id'].'&action=refuse" class="butAction">'.$langs->trans("ActionRefuseCP").'</a>';
}
if (($user->id == $cp->fk_validator || $user->id == $cp->fk_user) && $cp->statut == 2)
if (($user->id == $cp->fk_validator || $user->id == $cp->fk_user) && ($cp->statut == 2 || $cp->statut == 3)) // Status validated or approved
{
if (($cp->date_debut > dol_now()) || $user->admin) print '<a href="fiche.php?id='.$_GET['id'].'&action=cancel" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
else print '<a href="#" class="butActionRefused" title="'.$langs->trans("HolidayStarted").'">'.$langs->trans("ActionCancelCP").'</a>';

View File

@ -37,6 +37,7 @@ insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang)
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (4,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (5,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (6,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (9,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (10,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (11,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (12,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3);

View File

@ -102,7 +102,7 @@ ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_shipping_method;
ALTER TABLE llx_expedition DROP INDEX idx_expedition_fk_expedition_methode;
ALTER TABLE llx_expedition CHANGE COLUMN fk_expedition_methode fk_shipping_method integer;
ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(256) NOT NULL DEFAULT '' AFTER description;
ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(255) NOT NULL DEFAULT '' AFTER description;
--ALTER TABLE llx_c_shipment_mode DROP COLUMN CASCADE;
--ALTER TABLE llx_c_shipment_mode ADD COLUMN rowid INTEGER AUTO_INCREMENT PRIMARY KEY;
@ -249,7 +249,7 @@ CREATE TABLE llx_printer_ipp
datec datetime,
printer_name text NOT NULL,
printer_location text NOT NULL,
printer_uri varchar(256) NOT NULL,
printer_uri varchar(255) NOT NULL,
copy integer NOT NULL DEFAULT '1',
module varchar(16) NOT NULL,
login varchar(32) NOT NULL

View File

@ -298,3 +298,6 @@ ALTER TABLE llx_facture_fourn ADD fk_mode_reglement integer NULL AFTER fk_cond_r
ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_mode_reglement integer NULL;
ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_cond_reglement integer NULL;
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (9,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);

View File

@ -23,7 +23,7 @@ create table llx_c_shipment_mode
code varchar(30) NOT NULL,
libelle varchar(50) NOT NULL,
description text,
tracking varchar(256) NOT NULL,
tracking varchar(255) NOT NULL,
active tinyint DEFAULT 0,
module varchar(32) NULL
)ENGINE=innodb;

View File

@ -23,7 +23,7 @@ CREATE TABLE llx_printer_ipp
datec datetime,
printer_name text NOT NULL,
printer_location text NOT NULL,
printer_uri varchar(256) NOT NULL,
printer_uri varchar(255) NOT NULL,
copy integer NOT NULL DEFAULT '1',
module varchar(16) NOT NULL,
login varchar(32) NOT NULL

View File

@ -89,6 +89,7 @@ FirstDayOfHoliday=First day of holiday
LastDayOfHoliday=Last day of holiday
HolidaysMonthlyUpdate=Monthly update
ManualUpdate=Manual update
HolidaysCancelation=Holidays cancelation
## Configuration du Module ##
ConfCP=Configuration of holidays module

View File

@ -658,6 +658,7 @@ Deductible=Deductible
from=from
toward=toward
Access=Access
HelpCopyToClipboard=Use Ctrl+C to copy to clipboard
# Week day
Monday=Monday

View File

@ -56,8 +56,6 @@ DraftOrWaitingShipped=Draft or validated not yet shipped
MenuOrdersToBill=Orders delivered
MenuOrdersToBill2=Orders to bill
SearchOrder=Search order
Sending=Sending
Sendings=Sendings
ShipProduct=Ship product
Discount=Discount
CreateOrder=Create Order

View File

@ -3,6 +3,7 @@ CHARSET=UTF-8
RefSending=Ref. shipment
Sending=Shipment
Sendings=Shipments
Shipment=Shipment
Shipments=Shipments
Receivings=Receivings
SendingsArea=Shipments area

View File

@ -37,7 +37,7 @@ AutoActions= Alimentation automatique
AgendaAutoActionDesc= Définissez dans cet onglet les événements pour lesquels Dolibarr créera automatiquement une action dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda.
AgendaSetupOtherDesc= Cette page permet de configurer quelques options permettant d'exporter une vue de votre agenda Dolibarr vers un calendrier externe (Thunderbird, Google calendar, …)
AgendaExtSitesDesc=Cette page permet d'ajouter des sources de calendriers externes pour les visualiser au sein de l'agenda Dolibarr.
ActionsEvents= Événements pour lesquels Dolibarr doit créer une action dans l'agenda en automatique.
ActionsEvents= Événements pour lesquels Dolibarr doit insérer un évènement dans l'agenda en automatique.
PropalValidatedInDolibarr= Proposition %s validée
InvoiceValidatedInDolibarr= Facture %s validée
InvoiceBackToDraftInDolibarr=Facture %s repassée en brouillon

View File

@ -89,6 +89,7 @@ FirstDayOfHoliday=Premier jour de congés
LastDayOfHoliday=Dernier jour de congés
HolidaysMonthlyUpdate=Mise à jour mensuelle
ManualUpdate=Mise à jour manuelle
HolidaysCancelation=Annulation de congès
## Configuration du Module ##
ConfCP=Configuration du module Congés

View File

@ -105,7 +105,7 @@ NbOfCompaniesContacts=Contacts/adresses uniques
MailNoChangePossible=Destinataires d'un emailing validé non modifiables
SearchAMailing=Rechercher un emailing
SendMailing=Envoi emailing
SendMail=Envoi email
SendMail=Envoyer email
SentBy=Envoyé par
MailingNeedCommand=Pour des raisons de sécurité, il est recommandé de faire les envois d'un mailing de masse depuis la ligne de commande. Si en avez, demandez à votre administrateur de serveurs de lancer la commande suivante pour envoyer le mailing à tous les destinataires :
MailingNeedCommand2=Vous pouvez toutefois quand même les envoyer par l'interface écran en ajoutant le paramètre MAILING_LIMIT_SENDBYWEB avec la valeur du nombre max de mails envoyés par session d'envoi. Pour cela, aller dans Accueil - Configuration - Divers.

View File

@ -658,6 +658,7 @@ Deductible=Déductible
from=de
toward=vers
Access=Accès
HelpCopyToClipboard=Ctrl+C pour copier dans le presse-papier
# Week day
Monday=Lundi

View File

@ -56,8 +56,6 @@ DraftOrWaitingShipped=Brouillon ou validée pas encore expédiée
MenuOrdersToBill=Commandes délivrées
MenuOrdersToBill2=Commandes à facturer
SearchOrder=Rechercher une commande
Sending=Expédition
Sendings=Expéditions
ShipProduct=Expédier produit
Discount=Remise
CreateOrder=Créer Commande

View File

@ -3,6 +3,7 @@ CHARSET=UTF-8
RefSending=Réf. expédition
Sending=Expédition
Sendings=Expéditions
Shipment=Expédition
Shipments=Expéditions
Receivings=Réceptions
SendingsArea=Espace expéditions

View File

@ -479,7 +479,7 @@ else
$soc->fetch($delivery->socid);
$head=delivery_prepare_head($delivery);
dol_fiche_head($head, 'delivery', $langs->trans("Sending"), 0, 'sending');
dol_fiche_head($head, 'delivery', $langs->trans("Shipment"), 0, 'sending');
/*
* Confirmation de la suppression
@ -489,7 +489,7 @@ else
{
$expedition_id = $_GET["expid"];
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1);
}
/*
@ -499,7 +499,7 @@ else
if ($action == 'valid')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$delivery->ref),'confirm_valid','','',1);
}

View File

@ -117,12 +117,18 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
// calcul pu_ht remisés
$tabprice=calcul_price_total(1, $pvht, $remise_percent, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 'HT', 0, 0); // FIXME Parameter type is missing, i put 0 to avoid blocking error
$pu_ht_remise = $tabprice[0];
// calcul marge
if ($pu_ht_remise < 0)
$marge = -1 * (abs($pu_ht_remise) - $paht_ret);
else
$marge = $pu_ht_remise - $paht_ret;
// calcul taux marge
if ($paht_ret != 0)
$marge_tx_ret = round((100 * ($pu_ht_remise - $paht_ret)) / $paht_ret, 3);
$marge_tx_ret = round((100 * $marge) / $paht_ret, 3);
// calcul taux marque
if ($pu_ht_remise != 0)
$marque_tx_ret = round((100 * ($pu_ht_remise - $paht_ret)) / $pu_ht_remise, 3);
$marque_tx_ret = round((100 * $marge) / $pu_ht_remise, 3);
return array($paht_ret, $marge_tx_ret, $marque_tx_ret);
}

View File

@ -52,7 +52,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -191,9 +191,9 @@ if ($action == 'create')
// Zip / Town
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
print '</td><td>'.$langs->trans('Town').'</td><td>';
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id'));
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';
// Country
@ -510,9 +510,9 @@ else
// Zip / Town
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
print '</td><td>'.$langs->trans('Town').'</td><td>';
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id'));
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';
// Country

View File

@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -476,7 +476,7 @@ if (GETPOST("source") == 'order' && $valid)
$shipToCountryCode=$order->thirdparty->country_code;
$shipToZip=$order->thirdparty->zip;
$shipToStreet2='';
$phoneNum=$order->thirdparty->tel;
$phoneNum=$order->thirdparty->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
@ -583,7 +583,7 @@ if (GETPOST("source") == 'invoice' && $valid)
$shipToCountryCode=$invoice->thirdparty->country_code;
$shipToZip=$invoice->thirdparty->zip;
$shipToStreet2='';
$phoneNum=$invoice->thirdparty->tel;
$phoneNum=$invoice->thirdparty->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
@ -778,7 +778,7 @@ if (GETPOST("source") == 'contractline' && $valid)
$shipToCountryCode=$contract->thirdparty->country_code;
$shipToZip=$contract->thirdparty->zip;
$shipToStreet2='';
$phoneNum=$contract->thirdparty->tel;
$phoneNum=$contract->thirdparty->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
@ -908,7 +908,7 @@ if (GETPOST("source") == 'membersubscription' && $valid)
$shipToCountryCode=$member->country_code;
$shipToZip=$member->zip;
$shipToStreet2='';
$phoneNum=$member->tel;
$phoneNum=$member->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";

View File

@ -50,7 +50,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -51,7 +51,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -142,7 +142,7 @@ if ($socid)
print '</td></tr>';
// Phone / Fax
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
print '</table>';

View File

@ -133,8 +133,8 @@ abstract class ActionsCardCommon
$this->object->zip = $_POST["zipcode"];
$this->object->town = $_POST["town"];
$this->object->country_id = $_POST["country_id"];
$this->object->state_id = $_POST["departement_id"];
$this->object->tel = $_POST["tel"];
$this->object->state_id = $_POST["state_id"];
$this->object->phone = $_POST["tel"];
$this->object->fax = $_POST["fax"];
$this->object->email = trim($_POST["email"]);
$this->object->url = $_POST["url"];
@ -160,7 +160,7 @@ abstract class ActionsCardCommon
$this->object->effectif_id = $_POST["effectif_id"];
if (GETPOST("private") == 1)
{
$this->object->typent_id = 8; // TODO predict another method if the field "special" change of rowid
$this->object->typent_id = dol_getIdFromCode($db,'TE_PRIVATE','c_typent');
}
else
{
@ -483,10 +483,10 @@ abstract class ActionsCardCommon
}
// Zip
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
// Town
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id'));
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id'));
// Country
$this->object->country_id = ($this->object->country_id ? $this->object->country_id : $mysoc->country_id);
@ -555,7 +555,7 @@ abstract class ActionsCardCommon
if ($this->object->isInEEC()) $this->tpl['country'] = $form->textwithpicto(($img?$img.' ':'').$this->object->country,$langs->trans("CountryIsInEEC"),1,0);
$this->tpl['country'] = ($img?$img.' ':'').$this->object->country;
$this->tpl['phone'] = dol_print_phone($this->object->tel,$this->object->country_code,0,$this->object->id,'AC_TEL');
$this->tpl['phone'] = dol_print_phone($this->object->phone,$this->object->country_code,0,$this->object->id,'AC_TEL');
$this->tpl['fax'] = dol_print_phone($this->object->fax,$this->object->country_code,0,$this->object->id,'AC_FAX');
$this->tpl['email'] = dol_print_email($this->object->email,0,$this->object->id,'AC_EMAIL');
$this->tpl['url'] = dol_print_url($this->object->url);
@ -670,8 +670,8 @@ abstract class ActionsCardCommon
$this->object->zip = $_POST["zipcode"];
$this->object->town = $_POST["town"];
$this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
$this->object->state_id = $_POST["departement_id"];
$this->object->tel = $_POST["tel"];
$this->object->state_id = $_POST["state_id"];
$this->object->phone = $_POST["tel"];
$this->object->fax = $_POST["fax"];
$this->object->email = $_POST["email"];
$this->object->url = $_POST["url"];

View File

@ -54,10 +54,9 @@ class Societe extends CommonObject
var $town;
var $status; // 0=activity ceased, 1= in activity
var $state_id;
var $state_id; // Id of department
var $state_code;
var $state;
var $departement_id; // deprecated
var $departement_code; // deprecated
var $departement; // deprecated
@ -404,10 +403,9 @@ class Societe extends CommonObject
$this->town = $this->town?trim($this->town):trim($this->town);
$this->state_id = trim($this->state_id);
$this->country_id = ($this->country_id > 0)?$this->country_id:$this->country_id;
$this->phone = trim($this->phone?$this->phone:$this->tel);
$this->phone = trim($this->phone);
$this->phone = preg_replace("/\s/","",$this->phone);
$this->phone = preg_replace("/\./","",$this->phone);
$this->tel = $this->phone; // TODO obsolete
$this->fax = trim($this->fax);
$this->fax = preg_replace("/\s/","",$this->fax);
$this->fax = preg_replace("/\./","",$this->fax);
@ -780,7 +778,6 @@ class Societe extends CommonObject
$this->email = $obj->email;
$this->url = $obj->url;
$this->tel = $obj->phone; // TODO obsolete
$this->phone = $obj->phone;
$this->fax = $obj->fax;
@ -1568,8 +1565,6 @@ class Societe extends CommonObject
{
global $langs;
if (empty($this->phone) && ! empty($this->tel)) $this->phone=$this->tel;
$contact_phone = $this->contact_property_array('mobile');
if ($this->phone)
{
@ -2410,7 +2405,6 @@ class Societe extends CommonObject
$this->town=$member->town;
$this->country_code=$member->country_code;
$this->country_id=$member->country_id;
$this->tel=$member->phone; // deprecated
$this->phone=$member->phone; // Prof phone
$this->email=$member->email;
@ -2498,7 +2492,6 @@ class Societe extends CommonObject
$this->country=$country_label;
if (is_object($langs)) $this->country=($langs->trans('Country'.$country_code)!='Country'.$country_code)?$langs->trans('Country'.$country_code):$country_label;
$this->tel=empty($conf->global->MAIN_INFO_SOCIETE_TEL)?'':$conf->global->MAIN_INFO_SOCIETE_TEL; // TODO deprecated
$this->phone=empty($conf->global->MAIN_INFO_SOCIETE_TEL)?'':$conf->global->MAIN_INFO_SOCIETE_TEL;
$this->fax=empty($conf->global->MAIN_INFO_SOCIETE_FAX)?'':$conf->global->MAIN_INFO_SOCIETE_FAX;
$this->url=empty($conf->global->MAIN_INFO_SOCIETE_WEB)?'':$conf->global->MAIN_INFO_SOCIETE_WEB;

View File

@ -151,7 +151,7 @@ if ($_GET["socid"])
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->country.'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';

View File

@ -137,7 +137,7 @@ if ($socid)
print '</td></tr>';
// Phone / Fax
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->tel,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';

View File

@ -129,7 +129,7 @@ if (empty($reshook))
$object->zip = GETPOST('zipcode');
$object->town = GETPOST('town');
$object->country_id = GETPOST('country_id');
$object->state_id = GETPOST('departement_id');
$object->state_id = GETPOST('state_id');
$object->phone = GETPOST('phone');
$object->fax = GETPOST('fax');
$object->email = GETPOST('email');
@ -158,7 +158,7 @@ if (empty($reshook))
$object->effectif_id = GETPOST('effectif_id');
if (GETPOST("private") == 1)
{
$object->typent_id = 8; // TODO predict another method if the field "special" change of rowid
$object->typent_id = dol_getIdFromCode($db,'TE_PRIVATE','c_typent');
}
else
{
@ -450,6 +450,14 @@ if (empty($reshook))
$result = $object->set_parent(GETPOST('editparentcompany','int'));
}
// Actions to send emails
$id=$socid;
$actiontypecode='AC_OTH_AUTO';
$paramname='socid';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
/*
* Generate document
*/
@ -588,7 +596,7 @@ else
$object->address = GETPOST('address');
$object->zip = GETPOST('zipcode');
$object->town = GETPOST('town');
$object->state_id = GETPOST('departement_id');
$object->state_id = GETPOST('state_id');
$object->phone = GETPOST('phone');
$object->fax = GETPOST('fax');
$object->email = GETPOST('email');
@ -812,9 +820,9 @@ else
// Zip / Town
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
print '</td><td>'.$langs->trans('Town').'</td><td>';
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id'));
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';
// Country
@ -827,7 +835,7 @@ else
if (empty($conf->global->SOCIETE_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code,'departement_id');
if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code,'state_id');
else print $countrynotdefined;
print '</td></tr>';
}
@ -1069,7 +1077,7 @@ else
$object->zip = GETPOST('zipcode');
$object->town = GETPOST('town');
$object->country_id = GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id;
$object->state_id = GETPOST('departement_id');
$object->state_id = GETPOST('state_id');
$object->phone = GETPOST('phone');
$object->fax = GETPOST('fax');
$object->email = GETPOST('email');
@ -1230,9 +1238,9 @@ else
// Zip / Town
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
print '</td><td>'.$langs->trans('Town').'</td><td>';
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','departement_id'));
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';
// Country
@ -1771,6 +1779,15 @@ else
*/
print '<div class="tabsAction">'."\n";
if (! empty($object->email))
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendMail').'</a></div>';
}
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEmailDefined")).'">'.$langs->trans('SendMail').'</a></div>';
}
if ($user->rights->societe->creer)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
@ -1790,51 +1807,138 @@ else
print '</div>'."\n";
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC))
{
print '<div class="fichecenter"><div class="fichethirdleft">';
//print '<table width="100%"><tr><td valign="top" width="50%">';
print '<a name="builddoc"></a>'; // ancre
/*
* Documents generes
*/
$filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
$genallowed=$user->rights->societe->creer;
$delallowed=$user->rights->societe->supprimer;
if ($action == 'presend')
{
/*
* Affiche formulaire mail
*/
$var=true;
// By default if $action=='presend'
$titreform='SendMail';
$topicmail='';
$action='send';
$modelmail='thirdparty';
$somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang);
print '<br>';
print_titre($langs->trans($titreform));
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromtype = 'user';
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
$formmail->withtopic=1;
$liste=array();
foreach ($object->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
$formmail->withtofree=0;
$formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withfile=2;
$formmail->withbody=1;
$formmail->withdeliveryreceipt=1;
$formmail->withcancel=1;
// Tableau des substitutions
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
//Find the good contact adress
/*
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');
if (is_array($contactarr) && count($contactarr)>0)
{
foreach($contactarr as $contact)
{
if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) {
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
$contactstatic=new Contact($db);
$contactstatic->fetch($contact['id']);
$custcontact=$contactstatic->getFullName($langs,1);
}
}
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}*/
print '</div></div></div>';
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;
$formmail->param['socid']=$object->id;
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?socid='.$object->id;
print '<br>';
}
// Init list of files
if (GETPOST("mode")=='init')
{
$formmail->clear_attached_files();
$formmail->add_attached_files($file,basename($file),dol_mimetype($file));
}
print '<div class="fichecenter"><br></div>';
$formmail->show_form();
// Subsidiaries list
$result=show_subsidiaries($conf,$langs,$db,$object);
print '<br>';
}
else
{
// Contacts list
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
$result=show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC))
{
print '<div class="fichecenter"><div class="fichethirdleft">';
//print '<table width="100%"><tr><td valign="top" width="50%">';
print '<a name="builddoc"></a>'; // ancre
// Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
/*
* Documents generes
*/
$filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
$genallowed=$user->rights->societe->creer;
$delallowed=$user->rights->societe->supprimer;
// Projects list
$result=show_projects($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
$var=true;
$somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang);
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
print '</div></div></div>';
print '<br>';
}
print '<div class="fichecenter"><br></div>';
// Subsidiaries list
$result=show_subsidiaries($conf,$langs,$db,$object);
// Contacts list
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
$result=show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
// Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
// Projects list
$result=show_projects($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
}
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -22,7 +22,7 @@
/**
* \file htdocs/societe/societe.php
* \ingroup societe
* \brief Page to show a third party
* \brief Page to show list of third parties
*/
require_once '../main.inc.php';

View File

@ -610,6 +610,7 @@ img.login, img.printer, img.entity {
div.vmenu, td.vmenu {
margin-<?php print $right; ?>: 2px;
margin-<?php print $left; ?>: 2px;
padding: 0px;
padding-bottom: 0px;
width: 164px;
@ -726,11 +727,8 @@ div.blockvmenuhelp
div.menu_contenu {
background: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/bg-rubrique.png',1); ?>);
padding: 8px 0px 0px 0px;
padding: 2px 1px 1px 3px;
margin: 0px;
padding: 1px;
padding-right: 8px;
font-size : 11px;
font-weight:normal;
color : #000000;

View File

@ -1759,6 +1759,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
}
.liste_titre td a {
text-shadow: none !important;
color: #<?php echo $colortexttitle; ?>;
}
div.liste_titre {
padding-left: 3px;

View File

@ -50,7 +50,7 @@ if (!$user->admin) accessforbidden();
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';

View File

@ -312,7 +312,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
'country_id' => $thirdparty->country_id,
'country_code' => $thirdparty->country_code,
'country' => $thirdparty->country,
'phone' => $thirdparty->tel,
'phone' => $thirdparty->phone,
'fax' => $thirdparty->fax,
'email' => $thirdparty->email,
'url' => $thirdparty->url,

View File

@ -197,7 +197,7 @@ class SocieteTest extends PHPUnit_Framework_TestCase
$localobject->town='New town';
$localobject->country_id=2;
$localobject->status=0;
$localobject->tel='New tel';
$localobject->phone='New tel';
$localobject->fax='New fax';
$localobject->email='newemail@newemail.com';
$localobject->url='New url';
@ -205,15 +205,15 @@ class SocieteTest extends PHPUnit_Framework_TestCase
$localobject->idprof2='new idprof2';
$localobject->idprof3='new idprof3';
$localobject->idprof4='new idprof4';
$result=$localobject->update($localobject->id,$user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
$result=$localobject->update_note($localobject->note_private,'_private');
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0, 'Holiday::update_note_private error');
$result=$localobject->update_note_public($localobject->note_public);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0, 'Holiday::update_note_public error');
@ -232,7 +232,7 @@ class SocieteTest extends PHPUnit_Framework_TestCase
$this->assertEquals($localobject->country_id, $newobject->country_id);
$this->assertEquals('BE', $newobject->country_code);
$this->assertEquals($localobject->status, $newobject->status);
$this->assertEquals($localobject->tel, $newobject->tel);
$this->assertEquals($localobject->phone, $newobject->phone);
$this->assertEquals($localobject->fax, $newobject->fax);
$this->assertEquals($localobject->email, $newobject->email);
$this->assertEquals($localobject->url, $newobject->url);

Some files were not shown because too many files have changed in this diff Show More