Merge remote-tracking branch 'Upstream/develop' into develop-loan

Conflicts:
	htdocs/install/mysql/migration/3.6.0-3.7.0.sql
This commit is contained in:
aspangaro 2014-09-29 20:40:53 +02:00
commit f70e8b766f
90 changed files with 998 additions and 1373 deletions

View File

@ -6,12 +6,10 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* ***** ***** ChangeLog for 3.7 compared to 3.6.* *****
For users: For users:
- New: PDF event report show project and status of event. - New: PDF event report show project and status of event.
- New: Onto event summary of elements, end date and status are visible.
- New: Can filter on status on interventions. - New: Can filter on status on interventions.
- New: Add help info of field type into dictionary of payment types. - New: Add help info of field type into dictionary of payment types.
- New: Add proposals into referer page of thirdparty. - New: Add proposals into referer page of thirdparty.
- New: On contact list can set filter on both active and not active (no more exclusive select). - New: On contact list can set filter on both active and not active (no more exclusive select).
- New: Each user can include its own external ics calendar into dolibarr agenda view.
- New: Intervention documents are now available in ECM module. - New: Intervention documents are now available in ECM module.
- New: Can attach supplier order to a customer order. - New: Can attach supplier order to a customer order.
- New: Supervisor is now visible into user list. - New: Supervisor is now visible into user list.
@ -22,16 +20,21 @@ For users:
- New: No more dependency between contract and service module. - New: No more dependency between contract and service module.
- New: [ task #867 ] Remove ESAEB external module code from core. - New: [ task #867 ] Remove ESAEB external module code from core.
- New: Can create proposal from an intervention. - New: Can create proposal from an intervention.
- New: An event can be assigned to several users.
- New: Can filter events on a group of users. - New: Can filter events on a group of users.
- New: Can filter events of a thirdparty. - New: Can filter events of a thirdparty.
- New: Onto event summary of elements, end date and status are visible.
- New: Split Agenda view (month, week, day) into different tabs. - New: Split Agenda view (month, week, day) into different tabs.
- New: Add a view "per user" of agenda events (with different colors according to type of event).
- New: Each user can include its own external ics calendar into dolibarr agenda view.
- New: Add event FICHINTER_CLASSIFY_BILLED into list of possible events to
create an automatic event into agenda.
- New: Add new type of event (when type of events are used, not by default).
- New: Can disable predefined type of events.
- New: Form to add a photo is immediatly available on photo page if - New: Form to add a photo is immediatly available on photo page if
permissions are ok (save one click per photo to add). permissions are ok (save one click per photo to add).
- New: Add option PRODUCT_MAX_VISIBLE_PHOTO to limit number of photos - New: Add option PRODUCT_MAX_VISIBLE_PHOTO to limit number of photos
shown on main product card. shown on main product card.
- New: Add event FICHINTER_CLASSIFY_BILLED into list of possible events to
create an automatic event into agenda.
- New: Add new type of event (when type of events are used, not by default).
- New: Add country into table of thirdparties type. This will allow to provide - New: Add country into table of thirdparties type. This will allow to provide
a list of thirdparty types specific to a country (like argentina that a list of thirdparty types specific to a country (like argentina that
need type A or B). need type A or B).

View File

@ -137,17 +137,19 @@ if ($result) {
$tabpay = array (); $tabpay = array ();
$tabbq = array (); $tabbq = array ();
$tabtp = array (); $tabtp = array ();
$tabcompany[$obj->rowid] = array (
'id' => $obj->socid,
'name' => $obj->name,
'code_client' => $obj->code_compta
);
$tabtype = array (); $tabtype = array ();
$i = 0; $i = 0;
while ( $i < $num ) { while ( $i < $num )
{
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$tabcompany[$obj->rowid] = array(
'id' => $obj->socid,
'name' => $obj->name,
'code_client' => $obj->code_compta
);
// Controls // Controls
$compta_bank = $obj->account_number; $compta_bank = $obj->account_number;
if ($obj->label == '(SupplierInvoicePayment)') if ($obj->label == '(SupplierInvoicePayment)')
@ -169,8 +171,8 @@ if ($result) {
} }
$links = $object->get_url($obj->rowid); $links = $object->get_url($obj->rowid);
foreach ( $links as $key => $val ) { foreach ( $links as $key => $val )
{
$tabtype[$obj->rowid] = $links[$key]['type']; $tabtype[$obj->rowid] = $links[$key]['type'];
if ($links[$key]['type'] == 'payment') if ($links[$key]['type'] == 'payment')
@ -259,14 +261,17 @@ if ($result) {
/* /*
* Actions * Actions
*/ */
// Write bookkeeping // Write bookkeeping
if ($action == 'writeBookKeeping') { if ($action == 'writeBookKeeping')
{
$error = 0; $error = 0;
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val )
{
// Bank // Bank
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt )
{
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"]; $bookkeeping->doc_ref = $val["ref"];
@ -317,8 +322,8 @@ if ($action == 'writeBookKeeping') {
} }
} }
// Third party // Third party
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt )
{
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"]; $bookkeeping->doc_ref = $val["ref"];
@ -399,7 +404,8 @@ if ($action == 'writeBookKeeping') {
} }
} }
// export csv // export csv
if ($action == 'export_csv') { if ($action == 'export_csv')
{
$sep = $conf->global->ACCOUNTING_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
@ -482,7 +488,9 @@ if ($action == 'export_csv') {
} }
} }
} }
} else { }
else
{
$form = new Form($db); $form = new Form($db);
@ -580,4 +588,5 @@ if ($action == 'export_csv') {
// End of page // End of page
llxFooter(); llxFooter();
} }
$db->close(); $db->close();

View File

@ -44,6 +44,8 @@ $object = new Adherent($db);
$result=$object->fetch($id); $result=$object->fetch($id);
if ($result > 0) if ($result > 0)
{ {
$object->fetch_thirdparty();
$adht = new AdherentType($db); $adht = new AdherentType($db);
$result=$adht->fetch($object->typeid); $result=$adht->fetch($object->typeid);
} }
@ -146,7 +148,23 @@ if ($object->id > 0)
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("ActionsOnMember"),'',''); $out='';
/*$objthirdparty=$object->thirdparty;
$objcon=new stdClass();
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}*/
print load_fiche_titre($langs->trans("ActionsOnMember"),$out,'');
// List of todo actions // List of todo actions
show_actions_todo($conf,$langs,$db,$object); show_actions_todo($conf,$langs,$db,$object);

View File

@ -35,8 +35,9 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scandir','alpha');
$type='contrat'; $type='contract';
if (empty($conf->global->CONTRACT_ADDON)) if (empty($conf->global->CONTRACT_ADDON))
{ {
@ -111,6 +112,35 @@ else if ($action == 'specimen') // For contract
} }
} }
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
$db->begin();
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
{
$param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
// Activate a model // Activate a model
else if ($action == 'set') else if ($action == 'set')
{ {
@ -318,7 +348,6 @@ print '</table><br>';
print_titre($langs->trans("TemplatePDFContracts")); print_titre($langs->trans("TemplatePDFContracts"));
// Defini tableau def des modeles // Defini tableau def des modeles
$type='contrat';
$def = array(); $def = array();
$sql = "SELECT nom"; $sql = "SELECT nom";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; $sql.= " FROM ".MAIN_DB_PREFIX."document_model";

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -375,7 +375,7 @@ $tabfieldcheck[24] = array();
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
// Define elementList and sourceList (used for dictionary "type of contacts") // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
$elementList = array(); $elementList = array();
$sourceList=array(); $sourceList=array();
if ($id == 11) if ($id == 11)
@ -412,7 +412,7 @@ if ($id == 11)
); );
} }
// Define localtax_typeList (used for dictionary "c_tva") // Define localtax_typeList (used for dictionary "llx_c_tva")
$localtax_typeList = array(); $localtax_typeList = array();
if ($id == 10) if ($id == 10)
{ {
@ -425,7 +425,6 @@ if ($id == 10)
"5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"), "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"), "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
); );
if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) $localtax_typeList["7"]= $langs->trans("Yes").' ('.$langs->trans("Type")." 7)"; //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
} }
@ -445,6 +444,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
if ((! isset($_POST[$value]) || $_POST[$value]=='') if ((! isset($_POST[$value]) || $_POST[$value]=='')
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory
) )
@ -1127,27 +1127,29 @@ if ($id)
} }
} }
// Est-ce une entree du dictionnaire qui peut etre desactivee ? // Can an entry be erased or disabled ?
// True by default $iserasable=1;$isdisable=1; // true by default
$iserasable=1;
if (isset($obj->code)) if (isset($obj->code))
{ {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable = 0; if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $isdisable = 0; }
else if ($obj->code == 'RECEP') $iserasable = 0; else if ($obj->code == 'RECEP') { $iserasable = 0; $isdisable = 0; }
else if ($obj->code == 'EF0') $iserasable = 0; else if ($obj->code == 'EF0') { $iserasable = 0; $isdisable = 0; }
} }
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $isdisable=0; $isdisable = 0; }
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;'; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;';
// Active // Active
print '<td align="center" class="nowrap">'; print '<td align="center" class="nowrap">';
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>'; if ($isdisable) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else else
{ {
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
else print $langs->trans("AlwaysActive"); else print $langs->trans("AlwaysActive");
} }
print "</td>"; print "</td>";

View File

@ -171,28 +171,27 @@ if ($action == 'setModuleOptions')
$db->begin(); $db->begin();
for($i=0;$i < $post_size;$i++) for($i=0;$i < $post_size;$i++)
{ {
if (array_key_exists('param'.$i,$_POST)) if (array_key_exists('param'.$i,$_POST))
{ {
$param=GETPOST("param".$i,'alpha'); $param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha'); $value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;
} }
} }
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
setEventMessage($langs->trans("SetupSaved")); setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$db->rollback(); $db->rollback();
setEventMessage($langs->trans("Error"),'errors'); setEventMessage($langs->trans("Error"),'errors');
} }
} }
// Activate a model // Activate a model
if ($action == 'set') if ($action == 'set')
{ {

View File

@ -35,7 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
if (! empty($conf->projet->enabled)) { if (! empty($conf->projet->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
@ -366,8 +367,8 @@ if ($action == 'update')
$object->location = GETPOST('location'); $object->location = GETPOST('location');
$object->socid = $_POST["socid"]; $object->socid = $_POST["socid"];
$object->contactid = $_POST["contactid"]; $object->contactid = $_POST["contactid"];
$object->societe->id = $_POST["socid"]; // deprecated //$object->societe->id = $_POST["socid"]; // deprecated
$object->contact->id = $_POST["contactid"]; // deprecated //$object->contact->id = $_POST["contactid"]; // deprecated
$object->fk_project = $_POST["projectid"]; $object->fk_project = $_POST["projectid"];
$object->note = $_POST["note"]; $object->note = $_POST["note"];
$object->pnote = $_POST["note"]; $object->pnote = $_POST["note"];
@ -380,13 +381,14 @@ if ($action == 'update')
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors');
$action = 'edit'; $action = 'edit';
} }
$transparency=(GETPOST("transparency")=='on'?1:0);
// Users // Users
$listofuserid=array(); $listofuserid=array();
//$assignedtouser=(GETPOST("assignedtouser") >0)?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : 0); $assignedtouser=(! empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : 0);
$assignedtouser=(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : 0); if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>($user->id == $assignedtouser ? $transparency : '')); // Owner first
if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>$object->transparency); // Owner first if (! empty($_SESSION['assignedtouser'])) // Now concat assigned users
if (! empty($_SESSION['assignedtouser']))
{ {
// Restore array with key with same value than param 'id' // Restore array with key with same value than param 'id'
$tmplist1=dol_json_decode($_SESSION['assignedtouser'], true); $tmplist2=array(); $tmplist1=dol_json_decode($_SESSION['assignedtouser'], true); $tmplist2=array();
@ -399,7 +401,7 @@ if ($action == 'update')
$object->userassigned=array(); // Clear old content $object->userassigned=array(); // Clear old content
foreach($listofuserid as $key => $val) foreach($listofuserid as $key => $val)
{ {
$object->userassigned[$val['id']]=array('id'=>$val['id'], 'mandatory'=>0, 'transparency'=>(GETPOST("transparency")=='on'?1:0)); $object->userassigned[$val['id']]=array('id'=>$val['id'], 'mandatory'=>0, 'transparency'=>($user->id == $val['id'] ? $transparency : ''));
} }
if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
@ -670,36 +672,19 @@ if ($action == 'create')
$listofuserid=array(); $listofuserid=array();
if (empty($donotclearsession)) if (empty($donotclearsession))
{ {
$assignedtouser=GETPOST("assignedtouser")?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id); $assignedtouser=GETPOST("assignedtouser")?GETPOST("assignedtouser"):(! empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id);
if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser,'mandatory'=>0,'transparency'=>$object->transparency); // Owner first if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser,'mandatory'=>0,'transparency'=>$object->transparency); // Owner first
$_SESSION['assignedtouser']=dol_json_encode($listofuserid); $_SESSION['assignedtouser']=dol_json_encode($listofuserid);
} }
/*
if (empty($donotclearsession))
{
$assignedtouser=GETPOST("assignedtouser")?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id);
$_SESSION['assignedtouser']=dol_json_encode(array($assignedtouser=>array('id'=>$assignedtouser,'transparency'=>1,'mandatory'=>1)));
}*/
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1);
//print $form->select_dolusers(GETPOST("assignedtouser")?GETPOST("assignedtouser"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1); print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'> '.$langs->trans("Busy");
print '</td></tr>';
print '</table>';
print '<br><br>';
print '<table class="border" width="100%">';
// Busy
print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>';
print '<input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'>';
print '</td></tr>'; print '</td></tr>';
// Realised by // Realised by
if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
{ {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td>'; print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td>';
print $form->select_dolusers(GETPOST("doneby")?GETPOST("doneby"):(! empty($object->userdone->id) && $percent==100?$object->userdone->id:0),'doneby',1); print $form->select_dolusers(GETPOST("doneby")?GETPOST("doneby"):(! empty($object->userdoneid) && $percent==100?$object->userdoneid:0),'doneby',1);
print '</td></tr>'; print '</td></tr>';
} }
@ -803,6 +788,7 @@ if ($id > 0)
{ {
$result1=$object->fetch($id); $result1=$object->fetch($id);
$result2=$object->fetch_thirdparty(); $result2=$object->fetch_thirdparty();
$result2=$object->fetch_contact();
$result3=$object->fetch_userassigned(); $result3=$object->fetch_userassigned();
$result4=$object->fetch_optionals($id,$extralabels); $result4=$object->fetch_optionals($id,$extralabels);
@ -812,20 +798,15 @@ if ($id > 0)
exit; exit;
} }
if ($object->author->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->author->id); $object->author=$tmpuser; } if ($object->authorid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->authorid); $object->author=$tmpuser; }
if ($object->usermod->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usermod->id); $object->usermod=$tmpuser; } if ($object->usermodid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usermodid); $object->usermod=$tmpuser; }
if ($object->usertodo->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usertodo->id); $object->usertodo=$tmpuser; }
if ($object->userdone->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->userdone->id); $object->userdone=$tmpuser; } if ($object->userownerid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->userownerid); $object->usertodo=$tmpuser; }
if ($object->userdoneid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->userdoneid); $object->userdone=$tmpuser; }
$contact = new Contact($db);
if ($object->contact->id)
{
$result=$contact->fetch($object->contact->id,$user);
}
$object->contact = $contact;
/* /*
* Affichage onglets * Show tabs
*/ */
$head=actions_prepare_head($object); $head=actions_prepare_head($object);
@ -867,7 +848,6 @@ if ($id > 0)
print '</script>'."\n"; print '</script>'."\n";
} }
// Fiche action en mode edition
print '<form name="formaction" action="'.$_SERVER['PHP_SELF'].'" method="POST">'; print '<form name="formaction" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
@ -926,30 +906,33 @@ if ($id > 0)
$listofuserid=array(); $listofuserid=array();
if (empty($donotclearsession)) if (empty($donotclearsession))
{ {
if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); // Owner first if ($object->userownerid > 0) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->userassigned[$user->id]['transparency'],'answer_status'=>$object->userassigned[$user->id]['answer_status'],'mandatory'=>$object->userassigned[$user->id]['mandatory']); // Owner first
$listofuserid=array_merge($listofuserid,$object->userassigned); if (! empty($object->userassigned)) // Now concat assigned users
{
// Restore array with key with same value than param 'id'
$tmplist1=$object->userassigned; $tmplist2=array();
foreach($tmplist1 as $key => $val)
{
if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val;
}
}
$_SESSION['assignedtouser']=dol_json_encode($listofuserid); $_SESSION['assignedtouser']=dol_json_encode($listofuserid);
} }
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1);
//print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'assignedtouser',1); print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked="checked"':'').'">'.$langs->trans("Busy");
print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Busy
print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>';
print '<input id="transparency" type="checkbox" name="transparency"'.($object->transparency?' checked="checked"':'').'">';
print '</td></tr>'; print '</td></tr>';
// Realised by // Realised by
if (! empty($conf->global->AGENDA_ENABLE_DONEBY)) if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
{ {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
print $form->select_dolusers($object->userdone->id> 0?$object->userdone->id:-1,'doneby',1); print $form->select_dolusers($object->userdoneid> 0?$object->userdoneid:-1,'doneby',1);
print '</td></tr>'; print '</td></tr>';
} }
print '</table><br><br>'; print '</table>';
print '<br><br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -960,12 +943,12 @@ if ($id > 0)
print '<td>'; print '<td>';
$events=array(); $events=array();
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
print $form->select_company($object->thirdparty->id,'socid','',1,1,0,$events); print $form->select_company($object->socid,'socid','',1,1,0,$events);
print '</td>'; print '</td>';
// Contact // Contact
print '<td>'.$langs->trans("Contact").'</td><td width="30%">'; print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
$form->select_contacts($object->thirdparty->id, $object->contact->id,'contactid',1); $form->select_contacts($object->socid, $object->contactid,'contactid',1);
print '</td></tr>'; print '</td></tr>';
} }
@ -979,10 +962,10 @@ if ($id > 0)
$langs->load("project"); $langs->load("project");
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">'; print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
$numprojet=$formproject->select_projects($object->thirdparty->id,$object->fk_project,'projectid'); $numprojet=$formproject->select_projects($object->socid,$object->fk_project,'projectid');
if ($numprojet==0) if ($numprojet==0)
{ {
print ' &nbsp; <a href="../../projet/card.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>'; print ' &nbsp; <a href="../../projet/card.php?socid='.$object->socid.'&action=create">'.$langs->trans("AddProject").'</a>';
} }
print '</td></tr>'; print '</td></tr>';
} }
@ -1056,99 +1039,65 @@ if ($id > 0)
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++; if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++;
// Date start // Date start
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">'; print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="3">';
if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour');
else print dol_print_date($object->datep,'day'); else print dol_print_date($object->datep,'day');
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
print '<td rowspan="'.$rowspan.'" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '<form name="listactionsfilterperuser" action="'.DOL_URL_ROOT.'/comm/action/peruser.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_peruser">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
print '</form>'."\n";
print '</td>';
print '</tr>'; print '</tr>';
// Date end // Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour'); if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour');
else print dol_print_date($object->datef,'day'); else print dol_print_date($object->datef,'day');
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>'; print '</td></tr>';
// Status // Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">'; print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
print $object->getLibStatut(4); print $object->getLibStatut(4);
print '</td></tr>'; print '</td></tr>';
// Location // Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{ {
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3">'.$object->location.'</td></tr>';
} }
// Assigned to // Assigned to
//if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1); print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$listofuserid=array(); $listofuserid=array();
if (empty($donotclearsession)) if (empty($donotclearsession))
{ {
if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); // Owner first if (is_object($object->usertodo)) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->transparency); // Owner first
$listofuserid=array_merge($listofuserid,$object->userassigned); if (! empty($object->userassigned)) // Now concat assigned users
{
// Restore array with key with same value than param 'id'
$tmplist1=$object->userassigned; $tmplist2=array();
foreach($tmplist1 as $key => $val)
{
if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val;
}
}
$_SESSION['assignedtouser']=dol_json_encode($listofuserid); $_SESSION['assignedtouser']=dol_json_encode($listofuserid);
//var_dump($_SESSION['assignedtouser']);
} }
print $form->select_dolusers_forevent('view','assignedtouser',1); print $form->select_dolusers_forevent('view','assignedtouser',1);
print '</td></tr>'; print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
print ' </td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Busy
print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td colspan="3">';
if ($object->usertodo->id > 0) print yn(($object->transparency > 0)?1:0); // We show nothing if event is assigned to nobody
print '</td></tr>';
// Done by // Done by
if ($conf->global->AGENDA_ENABLE_DONEBY) if ($conf->global->AGENDA_ENABLE_DONEBY)
{ {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
if ($object->userdone->id > 0) print $object->userdone->getNomUrl(1); if ($object->userdoneid > 0) print $object->userdone->getNomUrl(1);
print '</td></tr>'; print '</td></tr>';
} }
print '</table><br><br><table class="border" width="100%">'; print '</table>';
print '<br><br>';
print '<table class="border" width="100%">';
// Third party - Contact // Third party - Contact
if ($conf->societe->enabled) if ($conf->societe->enabled)
@ -1164,12 +1113,12 @@ if ($id > 0)
print '</td>'; print '</td>';
print '<td>'.$langs->trans("Contact").'</td>'; print '<td>'.$langs->trans("Contact").'</td>';
print '<td>'; print '<td>';
if ($object->contact->id > 0) if ($object->contactid > 0)
{ {
print $object->contact->getNomUrl(1); print $object->contact->getNomUrl(1);
if ($object->contact->id && $object->type_code == 'AC_TEL') if ($object->contactid && $object->type_code == 'AC_TEL')
{ {
if ($object->contact->fetch($object->contact->id)) if ($object->contact->fetch($object->contactid))
{ {
print "<br>".dol_print_phone($object->contact->phone_pro); print "<br>".dol_print_phone($object->contact->phone_pro);
} }
@ -1250,7 +1199,7 @@ if ($id > 0)
if ($action != 'edit') if ($action != 'edit')
{ {
if ($user->rights->agenda->allactions->create || if ($user->rights->agenda->allactions->create ||
(($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->create)) (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
} }
@ -1260,7 +1209,7 @@ if ($id > 0)
} }
if ($user->rights->agenda->allactions->delete || if ($user->rights->agenda->allactions->delete ||
(($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->delete)) (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete))
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?action=delete&id='.$object->id.'">'.$langs->trans("Delete").'</a></div>'; print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?action=delete&id='.$object->id.'">'.$langs->trans("Delete").'</a></div>';
} }
@ -1272,6 +1221,47 @@ if ($id > 0)
} }
print '</div>'; print '</div>';
// Link to agenda views
print '<div id="agendaviewbutton">';
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '<form name="listactionsfilterperuser" action="'.DOL_URL_ROOT.'/comm/action/peruser.php" method="POST" style="float: left">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_peruser">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
print '</form>'."\n";
print '</div>';
} }

View File

@ -39,9 +39,10 @@ class ActionComm extends CommonObject
var $id; var $id;
var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) var $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required). With defautl setup, should be AC_OTH_AUTO or AC_OTH var $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required) var $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
var $label; var $label;
@ -56,7 +57,7 @@ class ActionComm extends CommonObject
var $datef; // Date action end (datep2) var $datef; // Date action end (datep2)
var $durationp = -1; // -1=Unkown duration // deprecated var $durationp = -1; // -1=Unkown duration // deprecated
var $fulldayevent = 0; // 1=Event on full day var $fulldayevent = 0; // 1=Event on full day
var $punctual = 1; // Milestone var $punctual = 1; // Milestone // TODO Not sure we need this. Milestone is already event with end date = start date
var $percentage; // Percentage var $percentage; // Percentage
var $location; // Location var $location; // Location
@ -66,7 +67,8 @@ class ActionComm extends CommonObject
var $userassigned = array(); // Array of user ids var $userassigned = array(); // Array of user ids
var $userownerid; // Id of user owner var $userownerid; // Id of user owner
var $usertodo; // Object user of owner // deprecated var $userdoneid; // Id of user done
var $usertodo; // Object user of owner // deprecated
var $userdone; // Object user that did action // deprecated var $userdone; // Object user that did action // deprecated
var $socid; var $socid;
@ -310,7 +312,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,"; $sql.= " a.fk_element, a.elementtype,";
$sql.= " a.priority, a.fulldayevent, a.location, a.transparency,"; $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle,";
$sql.= " s.nom as socname,"; $sql.= " s.nom as socname,";
$sql.= " u.firstname, u.lastname as lastname"; $sql.= " u.firstname, u.lastname as lastname";
@ -352,25 +354,29 @@ class ActionComm extends CommonObject
$this->note = $obj->note; $this->note = $obj->note;
$this->percentage = $obj->percentage; $this->percentage = $obj->percentage;
$this->author->id = $obj->fk_user_author; $this->authorid = $obj->fk_user_author;
$this->author->firstname = $obj->firstname; $this->usermodid = $obj->fk_user_mod;
$this->author->lastname = $obj->lastname; $this->author->id = $obj->fk_user_author; // deprecated
$this->usermod->id = $obj->fk_user_mod; $this->author->firstname = $obj->firstname; // deprecated
$this->author->lastname = $obj->lastname; // deprecated
$this->usermod->id = $obj->fk_user_mod; // deprecated
$this->userownerid = $obj->fk_user_action; $this->userownerid = $obj->fk_user_action;
$this->userdoneid = $obj->fk_user_done;
$this->usertodo->id = $obj->fk_user_action; // deprecated $this->usertodo->id = $obj->fk_user_action; // deprecated
//$this->userdone->id = $obj->fk_user_done; $this->userdone->id = $obj->fk_user_done; // deprecated
$this->priority = $obj->priority; $this->priority = $obj->priority;
$this->fulldayevent = $obj->fulldayevent; $this->fulldayevent = $obj->fulldayevent;
$this->location = $obj->location; $this->location = $obj->location;
$this->transparency = $obj->transparency; $this->transparency = $obj->transparency;
$this->punctual = $obj->punctual;
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
$this->contactid = $obj->fk_contact; $this->contactid = $obj->fk_contact; // To have fetch_contact method working
$this->fk_project = $obj->fk_project; // To have fetch_project method working $this->fk_project = $obj->fk_project; // To have fetch_project method working
$this->societe->id = $obj->fk_soc; // For backward compatibility $this->societe->id = $obj->fk_soc; // deprecated
$this->contact->id = $obj->fk_contact; // For backward compatibility $this->contact->id = $obj->fk_contact; // deprecated
$this->fk_element = $obj->fk_element; $this->fk_element = $obj->fk_element;
$this->elementtype = $obj->elementtype; $this->elementtype = $obj->elementtype;
@ -961,7 +967,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,"; $sql.= " a.fk_element, a.elementtype,";
$sql.= " a.priority, a.fulldayevent, a.location,"; $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " u.firstname, u.lastname,"; $sql.= " u.firstname, u.lastname,";
$sql.= " s.nom as socname,"; $sql.= " s.nom as socname,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle"; $sql.= " c.id as type_id, c.code as type_code, c.libelle";
@ -1041,6 +1047,7 @@ class ActionComm extends CommonObject
$event['fulldayevent']=$obj->fulldayevent; $event['fulldayevent']=$obj->fulldayevent;
$event['location']=$obj->location; $event['location']=$obj->location;
$event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy) $event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
$event['punctual']=$obj->punctual;
$event['category']=$obj->libelle; // libelle type action $event['category']=$obj->libelle; // libelle type action
// Define $urlwithroot // Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
@ -1146,7 +1153,7 @@ class ActionComm extends CommonObject
$this->punctual=0; $this->punctual=0;
$this->percentage=0; $this->percentage=0;
$this->location='Location'; $this->location='Location';
$this->transparency=0; $this->transparency=1; // 1 means opaque
$this->priority=1; $this->priority=1;
$this->note = 'Note'; $this->note = 'Note';
} }

View File

@ -218,9 +218,9 @@ if (empty($action) || $action=='show_month')
$tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2; $tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2;
$tmpday+=((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)-1); $tmpday+=((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)-1);
if ($tmpday >= 1) $tmpday -= 7; if ($tmpday >= 1) $tmpday -= 7;
// Define firstdaytoshow and lastdaytoshow // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year); $firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year);
$next_day=7-($max_day_in_month+1-$tmpday)%7; $next_day=7 - ($max_day_in_month+1-$tmpday) % 7;
if ($next_day < 6) $next_day+=7; if ($next_day < 6) $next_day+=7;
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
} }
@ -242,9 +242,9 @@ if ($action=='show_week')
$next_month = $next['month']; $next_month = $next['month'];
$next_day = $next['day']; $next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@ -261,7 +261,7 @@ if ($action == 'show_day')
$next_month = $next['month']; $next_month = $next['month'];
$next_day = $next['day']; $next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$prev_day,$prev_year); $firstdaytoshow=dol_mktime(0,0,0,$prev_month,$prev_day,$prev_year);
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); $lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
} }
@ -522,14 +522,14 @@ if ($resql)
// Check values // Check values
if ($event->date_end_in_calendar < $firstdaytoshow || if ($event->date_end_in_calendar < $firstdaytoshow ||
$event->date_start_in_calendar > $lastdaytoshow) $event->date_start_in_calendar >= $lastdaytoshow)
{ {
// This record is out of visible range // This record is out of visible range
} }
else else
{ {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1);
// Add an entry in actionarray for each day // Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar; $daycursor=$event->date_start_in_calendar;
@ -659,7 +659,7 @@ if (count($listofextcals))
if (isset($icalevent['RRULE']) && is_array($icalevent['RRULE'])) //repeatable event if (isset($icalevent['RRULE']) && is_array($icalevent['RRULE'])) //repeatable event
{ {
//if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; //if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
//if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1);
if ($icalevent['DTSTART;VALUE=DATE']) //fullday event if ($icalevent['DTSTART;VALUE=DATE']) //fullday event
{ {
$datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1); $datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
@ -698,10 +698,10 @@ if (count($listofextcals))
$until=empty($icalevent['RRULE']['UNTIL'])?0:dol_stringtotime($icalevent['RRULE']['UNTIL'],1); $until=empty($icalevent['RRULE']['UNTIL'])?0:dol_stringtotime($icalevent['RRULE']['UNTIL'],1);
$maxrepeat=empty($icalevent['RRULE']['COUNT'])?0:$icalevent['RRULE']['COUNT']; $maxrepeat=empty($icalevent['RRULE']['COUNT'])?0:$icalevent['RRULE']['COUNT'];
if ($until && ($until+($datecurend-$datecurstart)) < $firstdaytoshow) continue; // We discard repeatable event that end before start date to show if ($until && ($until+($datecurend-$datecurstart)) < $firstdaytoshow) continue; // We discard repeatable event that end before start date to show
if ($datecurstart > $lastdaytoshow) continue; // We discard repeatable event that start after end date to show if ($datecurstart >= $lastdaytoshow) continue; // We discard repeatable event that start after end date to show
$numofevent=0; $numofevent=0;
while (($datecurstart <= $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat))) while (($datecurstart < $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat)))
{ {
if ($datecurend >= $firstdaytoshow) // We add event if ($datecurend >= $firstdaytoshow) // We add event
{ {
@ -833,7 +833,7 @@ if (count($listofextcals))
} }
// Add event into $eventarray if date range are ok. // Add event into $eventarray if date range are ok.
if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar > $lastdaytoshow) if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar >= $lastdaytoshow)
{ {
//print 'x'.$datestart.'-'.$dateend;exit; //print 'x'.$datestart.'-'.$dateend;exit;
//print 'x'.$datestart.'-'.$dateend;exit; //print 'x'.$datestart.'-'.$dateend;exit;
@ -843,7 +843,7 @@ if (count($listofextcals))
else else
{ {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1);
// Add an entry in actionarray for each day // Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar; $daycursor=$event->date_start_in_calendar;
@ -1140,7 +1140,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
// Define $color and $cssclass of event // Define $color (Hex string like '0088FF') and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1; $color=-1; $cssclass=''; $colorindex=-1;
if (in_array($user->id, $keysofuserassigned)) if (in_array($user->id, $keysofuserassigned))
{ {
@ -1163,8 +1163,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$color=$event->icalcolor; $color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable');
} }
else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } else if ($event->type_code == 'BIRTHDAY')
else { $numother++; $cssclass='family_other'; } {
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
}
else
{
$numother++; $cssclass='family_other';
}
if ($color == -1) // Color was not forced. Set color according to color index. if ($color == -1) // Color was not forced. Set color according to color index.
{ {
// Define color index if not yet defined // Define color index if not yet defined

View File

@ -96,7 +96,7 @@ if ($dateselect > 0)
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS;
$tmparray=explode('-',$tmp); $tmparray=explode('-',$tmp);
$begin_h = GETPOST('begin_h')?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9); $begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18); $end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18);
if ($begin_h < 0 || $begin_h > 23) $begin_h = 9; if ($begin_h < 0 || $begin_h > 23) $begin_h = 9;
if ($end_h < 1 || $end_h > 24) $end_h = 18; if ($end_h < 1 || $end_h > 24) $end_h = 18;
@ -108,7 +108,7 @@ $begin_d = GETPOST('begin_d')?GETPOST('begin_d','int'):($tmparray[0] != '' ? $tm
$end_d = GETPOST('end_d')?GETPOST('end_d'):($tmparray[1] != '' ? $tmparray[1] : 5); $end_d = GETPOST('end_d')?GETPOST('end_d'):($tmparray[1] != '' ? $tmparray[1] : 5);
if ($begin_d < 1 || $begin_d > 7) $begin_d = 1; if ($begin_d < 1 || $begin_d > 7) $begin_d = 1;
if ($end_d < 1 || $end_d > 7) $end_d = 7; if ($end_d < 1 || $end_d > 7) $end_d = 7;
if ($end_d <= $begin_d) $end_d = $begin_d + 1; if ($end_d < $begin_d) $end_d = $begin_d + 1;
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
@ -179,17 +179,11 @@ $next_year = $next['year'];
$next_month = $next['month']; $next_month = $next['month'];
$next_day = $next['day']; $next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
$tmpday = $first_day; $tmpday = $first_day;
//print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day;
//print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day;
//print dol_print_date($firstdaytoshow,'day');
//print dol_print_date($lastdaytoshow,'day');
$title=$langs->trans("DoneAndToDoActions"); $title=$langs->trans("DoneAndToDoActions");
if ($status == 'done') $title=$langs->trans("DoneActions"); if ($status == 'done') $title=$langs->trans("DoneActions");
@ -225,9 +219,11 @@ $next_year = $next['year'];
$next_month = $next['month']; $next_month = $next['month'];
$next_day = $next['day']; $next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd'); $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
//print dol_print_date($firstdaytoshow,'dayhour');
//print dol_print_date($lastdaytoshow,'dayhour');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@ -325,7 +321,7 @@ $sql.= ' a.percent,';
$sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,';
$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' a.fk_soc, a.fk_contact,';
$sql.= ' ca.code'; $sql.= ' ca.code, ca.color';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu";
@ -400,6 +396,7 @@ if ($resql)
$event->datep=$db->jdate($obj->datep); // datep and datef are GMT date $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date
$event->datef=$db->jdate($obj->datep2); $event->datef=$db->jdate($obj->datep2);
$event->type_code=$obj->code; $event->type_code=$obj->code;
$event->type_color=$obj->color;
//$event->libelle=$obj->label; // deprecated //$event->libelle=$obj->label; // deprecated
$event->label=$obj->label; $event->label=$obj->label;
$event->percentage=$obj->percent; $event->percentage=$obj->percent;
@ -440,14 +437,14 @@ if ($resql)
// Check values // Check values
if ($event->date_end_in_calendar < $firstdaytoshow || if ($event->date_end_in_calendar < $firstdaytoshow ||
$event->date_start_in_calendar > $lastdaytoshow) $event->date_start_in_calendar >= $lastdaytoshow)
{ {
// This record is out of visible range // This record is out of visible range
} }
else else
{ {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1);
// Add an entry in actionarray for each day // Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar; $daycursor=$event->date_start_in_calendar;
@ -459,7 +456,7 @@ if ($resql)
$loop=true; $j=0; $loop=true; $j=0;
$daykey=dol_mktime(0,0,0,$mois,$jour,$annee); $daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
do do
{ {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'<br>'; //if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'<br>';
$eventarray[$daykey][]=$event; $eventarray[$daykey][]=$event;
@ -482,7 +479,6 @@ else
dol_print_error($db); dol_print_error($db);
} }
$maxnbofchar=18; $maxnbofchar=18;
$cachethirdparties=array(); $cachethirdparties=array();
$cachecontacts=array(); $cachecontacts=array();
@ -606,6 +602,7 @@ else
$colorsbytype=array(); $colorsbytype=array();
// Loop on each user to show calendar // Loop on each user to show calendar
$todayarray=dol_getdate($now,'fast');
$sav = $tmpday; $sav = $tmpday;
$showheader = true; $showheader = true;
foreach ($usernames as $username) foreach ($usernames as $username)
@ -634,11 +631,10 @@ foreach ($usernames as $username)
$style='cal_current_month'; $style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month'; if ($iter_day == 6) $style.=' cal_other_month';
$today=0; $today=0;
$todayarray=dol_getdate($now,'fast'); if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
if ($today) $style='cal_today_peruser'; if ($today) $style='cal_today_peruser';
show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype); show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
$i++; $i++;
} }
@ -648,7 +644,6 @@ foreach ($usernames as $username)
echo "</table>\n"; echo "</table>\n";
// Add js code to manage click on a box // Add js code to manage click on a box
print '<script type="text/javascript" language="javascript"> print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
@ -671,7 +666,7 @@ jQuery(document).ready(function() {
else if (ids.indexOf(",") > -1) /* There is several events */ else if (ids.indexOf(",") > -1) /* There is several events */
{ {
/* alert(\'several events\'); */ /* alert(\'several events\'); */
url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+dateselectday;
window.location.href = url; window.location.href = url;
} }
else /* One event */ else /* One event */
@ -694,7 +689,7 @@ $db->close();
/** /**
* Show event of a particular day * Show event of a particular day for a user
* *
* @param string $username Login * @param string $username Login
* @param int $day Day * @param int $day Day
@ -729,6 +724,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
$nextindextouse=count($colorindexused); // At first run, this is 0, so fist user has 0, next 1, ... $nextindextouse=count($colorindexused); // At first run, this is 0, so fist user has 0, next 1, ...
//if ($username->id && $day==1) var_dump($eventarray);
// We are in a particular day for $username, now we scan all events // We are in a particular day for $username, now we scan all events
foreach ($eventarray as $daykey => $notused) foreach ($eventarray as $daykey => $notused)
@ -736,9 +732,11 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$annee = date('Y',$daykey); $annee = date('Y',$daykey);
$mois = date('m',$daykey); $mois = date('m',$daykey);
$jour = date('d',$daykey); $jour = date('d',$daykey);
if ($day==$jour && $month==$mois && $year==$annee) //print $annee.'-'.$mois.'-'.$jour.' '.$year.'-'.$month.'-'.$day."<br>\n";
if ($day==$jour && $month==$mois && $year==$annee) // Is it the day we are looking for when calling function ?
{ {
//Tout les events à la même date : // Scan all event for this date
foreach ($eventarray[$daykey] as $index => $event) foreach ($eventarray[$daykey] as $index => $event)
{ {
$keysofuserassigned=array_keys($event->userassigned); $keysofuserassigned=array_keys($event->userassigned);
@ -747,12 +745,12 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
// Define $color and $cssclass of event // Define $color (Hex string like '0088FF') and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1; $color=-1; $cssclass=''; $colorindex=-1;
if (in_array($user->id, $keysofuserassigned)) if (in_array($user->id, $keysofuserassigned))
{ {
$nummytasks++; $cssclass='family_mytasks'; $nummytasks++; $cssclass='family_mytasks';
// TODO Set color according to event type $color=$event->type_color;
} }
else if ($event->type_code == 'ICALEVENT') else if ($event->type_code == 'ICALEVENT')
{ {
@ -763,15 +761,19 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
} }
$numicals[dol_string_nospecial($event->icalname)]++; $numicals[dol_string_nospecial($event->icalname)]++;
} }
$color=$event->icalcolor; $color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable');
} }
else if ($event->type_code == 'BIRTHDAY') { else if ($event->type_code == 'BIRTHDAY')
{
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
} }
else { $numother++; $cssclass='family_other'; else
{
$numother++; $cssclass='family_other';
} }
if ($color == -1) // Color was not forced. Set color according to color index. if ($color < 0) // Color was not forced. Set color according to color index.
{ {
// Define color index if not yet defined // Define color index if not yet defined
$idusertouse=($event->userownerid?$event->userownerid:0); $idusertouse=($event->userownerid?$event->userownerid:0);
@ -793,7 +795,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
// Define all rects with event (cases1 is first half hour, cases2 is second half hour) // Define all rects with event (cases1 is first half hour, cases2 is second half hour)
for ($h = $begin_h; $h < $end_h; $h++) for ($h = $begin_h; $h < $end_h; $h++)
{ {
$color = ''; //init //if ($username->id == 1 && $day==1) print 'h='.$h;
$newcolor = ''; //init
if (empty($event->fulldayevent)) if (empty($event->fulldayevent))
{ {
$a = dol_mktime((int) $h,0,0,$month,$day,$year,false,false); $a = dol_mktime((int) $h,0,0,$month,$day,$year,false,false);
@ -803,27 +806,47 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$dateendtouse=$event->date_end_in_calendar; $dateendtouse=$event->date_end_in_calendar;
if ($dateendtouse==$event->date_start_in_calendar) $dateendtouse++; if ($dateendtouse==$event->date_start_in_calendar) $dateendtouse++;
//print dol_print_date($event->date_start_in_calendar,'dayhour').'-'.dol_print_date($a,'dayhour').'-'.dol_print_date($b,'dayhour').'<br>';
if ($event->date_start_in_calendar < $b && $dateendtouse > $a) if ($event->date_start_in_calendar < $b && $dateendtouse > $a)
{ {
$busy=$event->transparency; $busy=$event->transparency;
$cases1[$h][$event->id]['busy']=$busy; $cases1[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label; $cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour');
if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar)
{
$tmpa=dol_getdate($event->date_start_in_calendar,true);
$tmpb=dol_getdate($event->date_end_in_calendar,true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
else $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
}
$cases1[$h][$event->id]['string'].=' - '.$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code; $cases1[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid) if ($event->socid)
{ {
$cases1[$h][$event->id]['string'].='xxx'; //$cases1[$h][$event->id]['string'].='xxx';
} }
$cases1[$h][$event->id]['color']=$color;
} }
if ($event->date_start_in_calendar < $c && $dateendtouse > $b) if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
{ {
$busy=$event->transparency; $busy=$event->transparency;
$cases2[$h][$event->id]['busy']=$busy; $cases2[$h][$event->id]['busy']=$busy;
$cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label; $cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour');
$cases1[$h][$event->id]['typecode']=$event->type_code; if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar)
{
$tmpa=dol_getdate($event->date_start_in_calendar,true);
$tmpb=dol_getdate($event->date_end_in_calendar,true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
else $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
}
$cases2[$h][$event->id]['string'].=' - '.$event->label;
$cases2[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid) if ($event->socid)
{ {
$cases2[$h][$event->id]['string'].='xxx'; //$cases2[$h][$event->id]['string'].='xxx';
} }
$cases2[$h][$event->id]['color']=$color;
} }
} }
else else
@ -835,18 +858,20 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$cases2[$h][$event->id]['string']=$event->label; $cases2[$h][$event->id]['string']=$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code; $cases1[$h][$event->id]['typecode']=$event->type_code;
$cases2[$h][$event->id]['typecode']=$event->type_code; $cases2[$h][$event->id]['typecode']=$event->type_code;
break; $cases1[$h][$event->id]['color']='009900';
$cases2[$h][$event->id]['color']='009900';
} }
} }
$i++; $i++;
} }
break; break; // We found the date we were looking for. No need to search anymore.
} }
} }
for ($h = $begin_h; $h < $end_h; $h++) for ($h = $begin_h; $h < $end_h; $h++)
{ {
$color1='';$color2='';
$style1='';$style2=''; $style1='';$style2='';
$string1='&nbsp;';$string2='&nbsp;'; $string1='&nbsp;';$string2='&nbsp;';
$title1='';$title2=''; $title1='';$title2='';
@ -879,20 +904,25 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$ids=array_keys($cases1[$h]); $ids=array_keys($cases1[$h]);
$output = array_slice($cases1[$h], 0, 1); $output = array_slice($cases1[$h], 0, 1);
if ($output[0]['string']) $title1.=' - '.$output[0]['string']; if ($output[0]['string']) $title1.=' - '.$output[0]['string'];
if ($output[0]['color']) $color1 = $output[0]['color'];
} }
else if (count($cases1[$h]) > 1) $color1='222222';
if (count($cases2[$h]) == 1) // 1 seul evenement if (count($cases2[$h]) == 1) // 1 seul evenement
{ {
$ids=array_keys($cases2[$h]); $ids=array_keys($cases2[$h]);
$output = array_slice($cases2[$h], 0, 1); $output = array_slice($cases2[$h], 0, 1);
if ($output[0]['string']) $title2.=' - '.$output[0]['string']; if ($output[0]['string']) $title2.=' - '.$output[0]['string'];
if ($output[0]['color']) $color2 = $output[0]['color'];
} }
else if (count($cases2[$h]) > 1) $color2='222222';
$ids1=join(',',array_keys($cases1[$h])); $ids1=join(',',array_keys($cases1[$h]));
$ids2=join(',',array_keys($cases2[$h])); $ids2=join(',',array_keys($cases2[$h]));
//var_dump($cases1[$h]); //var_dump($cases1[$h]);
print '<table class="nobordernopadding" width="100%">'; print '<table class="nobordernopadding" width="100%">';
print '<tr><td class="'.($style1?$style1.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_00_'.($ids1?$ids1:'none').'"'.($title1?' title="'.$title1.'"':'').'>'; print '<tr><td '.($color1?'style="background: #'.$color1.';"':'').'class="'.($style1?$style1.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_00_'.($ids1?$ids1:'none').'"'.($title1?' title="'.$title1.'"':'').'>';
print $string1; print $string1;
print '</td><td class="'.($style2?$style2.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_30_'.($ids2?$ids2:'none').'"'.($title2?' title="'.$title2.'"':'').'>'; print '</td><td '.($color2?'style="background: #'.$color2.';"':'').'class="'.($style2?$style2.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_30_'.($ids2?$ids2:'none').'"'.($title2?' title="'.$title2.'"':'').'>';
print $string2; print $string2;
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';

View File

@ -156,8 +156,9 @@ if ($viewstatut <> '')
} }
if ($viewstatut == -3) // To bill if ($viewstatut == -3) // To bill
{ {
$sql.= ' AND c.fk_statut in (1,2,3)'; //$sql.= ' AND c.fk_statut in (1,2,3)';
$sql.= ' AND c.facture = 0'; // invoice not created //$sql.= ' AND c.facture = 0'; // invoice not created
$sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed
} }
} }
if ($ordermonth > 0) if ($ordermonth > 0)

View File

@ -866,6 +866,16 @@ else if ($action == 'add' && $user->rights->facture->creer)
// Possibility to add external linked objects with hooks // Possibility to add external linked objects with hooks
$object->linked_objects [$object->origin] = $object->origin_id; $object->linked_objects [$object->origin] = $object->origin_id;
// link with order if it is a shipping invoice
if ($object->origin == 'shipping')
{
require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
$exp = new Expedition($db);
$exp->fetch($object->origin_id);
$exp->fetchObjectLinked();
if (count ($exp->linkedObjectsIds['commande']) > 0) $object->linked_objects['commande'] = $exp->linkedObjectsIds['commande'][0];
}
if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) { if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) {
$object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']);
} }

View File

@ -1,127 +0,0 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
*
* 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/>.
*
*/
/**
* \file htdocs/compta/ventilation/fournisseur/index.php
* \ingroup compta
* \brief Page accueil ventilation
*/
require '../../../main.inc.php';
$langs->load("suppliers");
llxHeader('','Compta - Ventilation');
print_titre("Ventilation Comptable");
print '<table border="0" width="100%">';
print '<tr><td valign="top" width="30%">';
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet";
$sql .= " WHERE fk_code_ventilation = 0";
$result = $db->query($sql);
if ($result)
{
$row = $db->fetch_row($result);
$nbfac = $row[0];
$db->free($result);
}
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiement";
$sql .= " WHERE fk_code_ventilation = 0";
$result = $db->query($sql);
if ($result)
{
$row = $db->fetch_row($result);
$nbp = $row[0];
$db->free($result);
}
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facture_fourn_det";
$sql .= " WHERE fk_code_ventilation = 0";
$result = $db->query($sql);
if ($result)
{
$row = $db->fetch_row($result);
$nbfacfourn = $row[0];
$db->free($result);
}
/*$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiementfourn";
$sql .= " WHERE fk_code_ventilation = 0";
$result = $db->query($sql);
if ($result)
{
$row = $db->fetch_row($result);
$nbpfourn = $row[0];
$db->free($result);
}*/
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">Lignes a ventiler</tr>';
print '<tr class="liste_titre"><td>Type</td><td align="center">Nb</td></tr>';
print '<tr><td>Factures clients</td><td align="center">'.$nbfac.'</td></tr>';
print '<tr><td>Paiements clients</td><td align="center">'.$nbp.'</td></tr>';
print '<tr><td>Factures fournisseurs</td><td align="center">'.$nbfacfourn.'</td></tr>';
//print '<tr><td>Paiements fournisseurs</td><td align="center">'.$nbpfourn.'</td></tr>';
print "</table>\n";
print '</td><td valign="top">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>Type</td><td align="center">Nb de lignes</td></tr>';
$sql = "SELECT count(*), ccg.intitule FROM ".MAIN_DB_PREFIX."facturedet as fd";
$sql .= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg";
$sql .= " WHERE fd.fk_code_ventilation = ccg.rowid";
$sql .= " GROUP BY ccg.rowid";
$resql = $db->query($sql);
if ($resql)
{
$i = 0;
$num = $db->num_rows($resql);
while ($i < $num)
{
$row = $db->fetch_row($resql);
print '<tr><td>'.$row[1].'</td><td align="center">'.$row[0].'</td></tr>';
$i++;
}
$db->free($resql);
}
print "</table>\n";
print '</td></tr></table>';
llxFooter();

View File

@ -1,114 +0,0 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* 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/>.
*
*/
/**
* \file htdocs/compta/ventilation/fournisseur/lignes.php
* \ingroup facture
* \brief Page de detail des lignes de ventilation d'une facture
*/
require '../../../main.inc.php';
$langs->load("bills");
if (!$user->rights->facture->lire) accessforbidden();
if (!$user->rights->compta->ventilation->creer) accessforbidden();
/*
* Securite acces client
*/
if ($user->societe_id > 0) accessforbidden();
llxHeader('');
/*
* Lignes de factures
*
*/
$page = $_GET["page"];
if ($page < 0) $page = 0;
$limit = $conf->liste_limit;
$offset = $limit * $page ;
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero ";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l";
$sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f";
$sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c";
$sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 ";
$sql .= " AND c.rowid = l.fk_code_ventilation";
if (dol_strlen(trim($_GET["search_facture"])))
{
$sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'";
}
$sql .= " ORDER BY l.rowid DESC";
$sql .= $db->plimit($limit+1,$offset);
$result = $db->query($sql);
if ($result)
{
$num_lignes = $db->num_rows($result);
$i = 0;
print_barre_liste("Lignes de facture ventilées",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes);
print '<form method="GET" action="lignes.php">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td>Facture</td>";
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="right">'.$langs->trans("Montant").'</td>';
print '<td colspan="2" align="center">'.$langs->trans("Compte").'</td>';
print "</tr>\n";
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="'.$_GET["search_facture"].'"></td>';
print '<td><input type="submit"></td>';
print '<td align="right">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
$var=True;
while ($i < min($num_lignes, $limit))
{
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td>';
print '<td>'.stripslashes(nl2br($objp->description)).'</td>';
print '<td align="right">'.price($objp->price).'</td>';
print '<td align="right">'.$objp->numero.'</td>';
print '<td align="left">'.stripslashes($objp->intitule).'</td>';
print "</tr>";
$i++;
}
}
else
{
print $db->error();
}
print "</table></form>";
$db->close();
llxFooter();

View File

@ -1,102 +0,0 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 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/>.
*
*/
/**
* \file htdocs/compta/ventilation/index.php
* \ingroup compta
* \brief Page accueil ventilation
*/
require '../../main.inc.php';
$langs->load("compta");
$langs->load("bills");
llxHeader('','Compta - Ventilation');
print_fiche_titre("Ventilation Comptable");
//print '<table border="0" width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
print '<div class="fichecenter"><div class="fichethirdleft">';
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet as fd";
$sql.= " , ".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE fd.fk_code_ventilation = 0";
$sql.= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1";
$result = $db->query($sql);
if ($result)
{
$row = $db->fetch_row($result);
$nbfac = $row[0];
$db->free($result);
}
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Lines").'</tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Type").'</td><td align="right">'.$langs->trans("Nb").'</td></tr>';
$var=!$var;
print "<tr ".$bc[$var].">".'<td>'.$langs->trans("Invoices").'</td><td align="right">'.$nbfac.'</td></tr>';
$var=!$var;
print "</table>\n";
//print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Type").'</td><td align="center">'.$langs->trans("NbOfLines").'</td><td align="center">'.$langs->trans("AccountNumber").'</td><td align="center">'.$langs->trans("TransID").'</td></tr>';
$sql = "SELECT count(*), ccg.intitule, ccg.rowid,ccg.numero FROM ".MAIN_DB_PREFIX."facturedet as fd";
$sql.= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg";
$sql.= " WHERE fd.fk_code_ventilation = ccg.rowid";
$sql.= " GROUP BY ccg.rowid";
$resql = $db->query($sql);
if ($resql)
{
$i = 0;
$num = $db->num_rows($resql);
$var=true;
while ($i < $num)
{
$row = $db->fetch_row($resql);
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$row[1].'</td><td align="center">'.$row[0].'</td>';
print '<td align="center">'.$row[3].'</td><td align="center">'.$row[2].'</td></tr>';
$i++;
}
$db->free($resql);
}
print "</table>\n";
//print '</td></tr></table>';
print '</div></div></div>';
llxFooter();
$db->close();

View File

@ -1,141 +0,0 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 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/>.
*
*/
/**
* \file htdocs/compta/ventilation/lignes.php
* \ingroup facture
* \brief Page de detail des lignes de ventilation d'une facture
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("bills");
$langs->load("compta");
if (!$user->rights->facture->lire) accessforbidden();
if (!$user->rights->compta->ventilation->creer) accessforbidden();
// Securite acces client
if ($user->societe_id > 0) accessforbidden();
llxHeader('');
/*
* Lignes de factures
*
*/
$page = $_GET["page"];
if ($page < 0) $page = 0;
$limit = $conf->liste_limit;
$offset = $limit * $page ;
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total_ttc as price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero,";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c";
$sql.= " , ".MAIN_DB_PREFIX."facturedet as l";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
$sql.= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 ";
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " AND c.rowid = l.fk_code_ventilation";
if (dol_strlen(trim($_GET["search_facture"])))
{
$sql .= " AND f.facnumber LIKE '%".$_GET["search_facture"]."%'";
}
$sql .= " ORDER BY l.rowid DESC";
$sql .= $db->plimit($limit+1,$offset);
$result = $db->query($sql);
if ($result)
{
$num_lignes = $db->num_rows($result);
$i = 0;
print_barre_liste($langs->trans("InvoiceDispatched"),$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes);
print '<form method="GET" action="lignes.php">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Invoice").'</td>';
print '<td>'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="left">'.$langs->trans("Montant").'</td>';
print '<td colspan="2" align="left">'.$langs->trans("Compte").'</td>';
print "</tr>\n";
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="'.$_GET["search_facture"].'"></td>';
print '<td>&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';
print "</tr>\n";
$facture_static=new Facture($db);
$product_static=new Product($db);
$var=True;
while ($i < min($num_lignes, $limit))
{
$objp = $db->fetch_object($result);
$var=!$var;
$codeCompta = $objp->numero.' '.$objp->intitule;
print "<tr ".$bc[$var].">";
// Ref facture
$facture_static->ref=$objp->facnumber;
$facture_static->id=$objp->facid;
print '<td>'.$facture_static->getNomUrl(1).'</td>';
// Ref produit
$product_static->ref=$objp->product_ref;
$product_static->id=$objp->product_id;
$product_static->type=$objp->type;
print '<td>';
if ($product_static->id) print $product_static->getNomUrl(1);
else print '&nbsp;';
print '</td>';
print '<td>'.dol_trunc($objp->product_label,24).'</td>';
print '<td>'.nl2br(dol_trunc($objp->description,32)).'</td>';
print '<td align="left">'.price($objp->price).'</td>';
print '<td align="left">'.$codeCompta.'</td>';
print "</tr>";
$i++;
}
}
else
{
print $db->error();
}
print "</table></form>";
llxFooter();
$db->close();

View File

@ -1110,7 +1110,22 @@ else
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))
{ {
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'',''); $objthirdparty=$objsoc;
$objcon=$object;
$out='';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),$out,'');
print show_actions_todo($conf,$langs,$db,$objsoc,$object); print show_actions_todo($conf,$langs,$db,$objsoc,$object);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
@ -29,17 +29,18 @@
*/ */
require ("../main.inc.php"); require ("../main.inc.php");
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/contract/modules_contract.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
if (! empty($conf->projet->enabled)) { if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
} }
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
@ -70,6 +71,15 @@ $hookmanager->initHooks(array('contractcard'));
$object = new Contrat($db); $object = new Contrat($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// Load object
if ($id > 0 || ! empty($ref)) {
$ret = $object->fetch($id, $ref);
if ($ret > 0)
$ret = $object->fetch_thirdparty();
if ($ret < 0)
dol_print_error('', $object->error);
}
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@ -84,7 +94,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer)
{ {
$object->fetch($id);
$result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment')); $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment'));
if ($result > 0) if ($result > 0)
@ -106,7 +115,6 @@ else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->c
} }
if (! $error) if (! $error)
{ {
$object->fetch($id);
$result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment'))); $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
if ($result > 0) if ($result > 0)
{ {
@ -363,7 +371,6 @@ if ($action == 'add' && $user->rights->contrat->creer)
else if ($action == 'classin' && $user->rights->contrat->creer) else if ($action == 'classin' && $user->rights->contrat->creer)
{ {
$object->fetch($id);
$object->setProject(GETPOST('projectid')); $object->setProject(GETPOST('projectid'));
} }
@ -402,14 +409,6 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
if (! $error) if (! $error)
{ {
$ret=$object->fetch($id);
if ($ret < 0)
{
setEventMessage($object->error,'errors');
exit;
}
$ret=$object->fetch_thirdparty();
// Clean parameters // Clean parameters
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
@ -584,14 +583,6 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST('cancel')) else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST('cancel'))
{ {
$ret=$object->fetch($id);
if ($ret < 0)
{
dol_print_error($db,$object->error);
exit;
}
$object->fetch_thirdparty();
$objectline = new ContratLigne($db); $objectline = new ContratLigne($db);
if ($objectline->fetch(GETPOST('elrowid'))) if ($objectline->fetch(GETPOST('elrowid')))
{ {
@ -647,7 +638,6 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST(
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer)
{ {
$object->fetch($id);
$result = $object->deleteline(GETPOST('lineid'),$user); $result = $object->deleteline(GETPOST('lineid'),$user);
if ($result >= 0) if ($result >= 0)
@ -663,21 +653,17 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
{ {
$object->fetch($id);
$result = $object->validate($user); $result = $object->validate($user);
} }
// Close all lines // Close all lines
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
{ {
$object->fetch($id);
$result = $object->cloture($user); $result = $object->cloture($user);
} }
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer)
{ {
$object->fetch($id);
$object->fetch_thirdparty();
$result=$object->delete($user); $result=$object->delete($user);
if ($result >= 0) if ($result >= 0)
{ {
@ -714,7 +700,6 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
} }
} else if ($action == 'update_extras') { } else if ($action == 'update_extras') {
// Fill array 'array_options' with data from update form // Fill array 'array_options' with data from update form
$object->fetch($id);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
if ($ret < 0) if ($ret < 0)
@ -734,10 +719,6 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
setEventMessage($object->error,'errors'); setEventMessage($object->error,'errors');
} }
} elseif ($action=='setref_customer') { } elseif ($action=='setref_customer') {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors,'errors');
}
$object->ref_customer=GETPOST('ref_customer','alpha'); $object->ref_customer=GETPOST('ref_customer','alpha');
$result = $object->update($user); $result = $object->update($user);
@ -749,10 +730,6 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
exit; exit;
} }
} elseif ($action=='setref') { } elseif ($action=='setref') {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors,'errors');
}
$object->ref=GETPOST('ref','alpha'); $object->ref=GETPOST('ref','alpha');
$result = $object->update($user); $result = $object->update($user);
@ -765,17 +742,53 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
} }
} }
// Generation doc (depuis lien ou depuis cartouche doc)
else if ($action == 'builddoc' && $user->rights->contrat->creer) {
if (GETPOST('model')) {
$object->setDocModel($user, GETPOST('model'));
}
// Define output language
$outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
}
$ret = $object->fetch($id); // Reload to get new records
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) {
dol_print_error($db, $result);
exit();
} else {
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc'));
exit();
}
}
// Remove file in doc form
else if ($action == 'remove_file' && $user->rights->contrat->creer) {
if ($object->id > 0) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$langs->load("other");
$upload_dir = $conf->contrat->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret)
setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
else
setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer)
{ {
if ($action == 'addcontact') if ($action == 'addcontact')
{ {
$result = $object->fetch($id); $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
}
if ($result >= 0) if ($result >= 0)
{ {
@ -799,20 +812,12 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat-
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut') else if ($action == 'swapstatut')
{ {
if ($object->fetch($id)) $result=$object->swapContactStatus(GETPOST('ligne'));
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
setEventMessage($object->error,'errors');
}
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact') else if ($action == 'deletecontact')
{ {
$object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid')); $result = $object->delete_contact(GETPOST('lineid'));
if ($result >= 0) if ($result >= 0)
@ -834,6 +839,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat-
llxHeader('',$langs->trans("ContractCard"),"Contrat"); llxHeader('',$langs->trans("ContractCard"),"Contrat");
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db);
$objectlignestatic=new ContratLigne($db); $objectlignestatic=new ContratLigne($db);
@ -1032,14 +1038,10 @@ else
{ {
$now=dol_now(); $now=dol_now();
if ($id > 0 || ! empty($ref)) if ($object->id > 0)
{ {
$result=$object->fetch($id,$ref);
if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed $result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_thirdparty();
if ($result < 0) dol_print_error($db,$object->error);
$nbofservices=count($object->lines); $nbofservices=count($object->lines);
@ -1793,16 +1795,29 @@ else
print "</div>"; print "</div>";
} }
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<table width="100%"><tr><td width="50%" valign="top">'; /*
* Documents generes
*/
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->contrat->creer;
$delallowed = $user->rights->contrat->supprimer;
$var = true;
$somethingshown = $formfile->show_documents('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
/* /*
* Linked object block * Linked object block
*/ */
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown = $object->showLinkedObjectBlock();
print '</td><td valign="top" width="50%">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '</td></tr></table>';
print '</div></div></div>';
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Destailleur Laurent <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
@ -65,6 +65,7 @@ class Contrat extends CommonObject
var $note; // deprecated var $note; // deprecated
var $note_private; var $note_private;
var $note_public; var $note_public;
var $modelpdf;
var $fk_projet; var $fk_projet;
@ -401,7 +402,7 @@ class Contrat extends CommonObject
$sql.= " fk_user_author,"; $sql.= " fk_user_author,";
$sql.= " fk_projet,"; $sql.= " fk_projet,";
$sql.= " fk_commercial_signature, fk_commercial_suivi,"; $sql.= " fk_commercial_signature, fk_commercial_suivi,";
$sql.= " note_private, note_public, extraparams"; $sql.= " note_private, note_public, model_pdf, extraparams";
$sql.= " ,ref_customer"; $sql.= " ,ref_customer";
$sql.= " ,ref_ext"; $sql.= " ,ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat";
@ -436,6 +437,7 @@ class Contrat extends CommonObject
$this->note = $result["note_private"]; // deprecated $this->note = $result["note_private"]; // deprecated
$this->note_private = $result["note_private"]; $this->note_private = $result["note_private"];
$this->note_public = $result["note_public"]; $this->note_public = $result["note_public"];
$this->modelpdf = $result["model_pdf"];
$this->fk_projet = $result["fk_projet"]; // deprecated $this->fk_projet = $result["fk_projet"]; // deprecated
$this->fk_project = $result["fk_projet"]; $this->fk_project = $result["fk_projet"];
@ -1866,6 +1868,40 @@ class Contrat extends CommonObject
$this->total_tva = $xnbp*19.6; $this->total_tva = $xnbp*19.6;
$this->total_ttc = $xnbp*119.6; $this->total_ttc = $xnbp*119.6;
} }
/**
* Create a document onto disk according to template module.
*
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs;
$langs->load("contracts");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->CONTRACT_ADDON_PDF))
{
$modele = $conf->global->CONTRACT_ADDON_PDF;
}
else
{
$modele = 'strato';
}
}
$modelpath = "core/modules/contract/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} }

View File

@ -577,11 +577,15 @@ abstract class CommonObject
/** /**
* Charge le contact d'id $id dans this->contact * Charge le contact d'id $id dans this->contact
* *
* @param int $contactid Id du contact * @param int $contactid Id du contact. Use this->contactid if empty.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch_contact($contactid) function fetch_contact($contactid='')
{ {
if (empty($contactid)) $contactid=$this->contactid;
if (empty($contactid)) return 0;
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$contact = new Contact($this->db); $contact = new Contact($this->db);
$result=$contact->fetch($contactid); $result=$contact->fetch($contactid);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -152,10 +152,12 @@ class HookManager
$modulealreadyexecuted=array(); $modulealreadyexecuted=array();
$resaction=0; $error=0; $result=''; $resaction=0; $error=0; $result='';
$this->resPrint=''; $this->resArray=array(); $this->resPrint=''; $this->resArray=array();
foreach($this->hooks as $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context foreach($this->hooks as $context => $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context
{ {
if (! empty($modules)) if (! empty($modules))
{ {
$modulealreadyexecuted[$context]=array(); // Filter by context
foreach($modules as $module => $actionclassinstance) foreach($modules as $module => $actionclassinstance)
{ {
//print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."<br>\n"; //print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."<br>\n";
@ -164,8 +166,10 @@ class HookManager
// jump to next class if method does not exists // jump to next class if method does not exists
if (! method_exists($actionclassinstance,$method)) continue; if (! method_exists($actionclassinstance,$method)) continue;
// test to avoid to run twice a hook, when a module implements several active contexts // test to avoid to run twice a hook, when a module implements several active contexts
if (in_array($module,$modulealreadyexecuted)) continue; if (in_array($module,$modulealreadyexecuted[$context])) continue;
$modulealreadyexecuted[$module]=$module; $modulealreadyexecuted[$context][$module]=$module; // Use the $currentcontext in method for avoid to run twice
// Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return;
$parameters['currentcontext'] = $context;
// Hooks that must return int (hooks with type 'addreplace') // Hooks that must return int (hooks with type 'addreplace')
if ($hooktype == 'addreplace') if ($hooktype == 'addreplace')
{ {

View File

@ -1329,9 +1329,9 @@ class Form
{ {
$assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true);
} }
$numassignetouser=count($assignedtouser); $nbassignetouser=count($assignedtouser);
if ($numassignetouser && $action != 'view') $out.='<br>'; if ($nbassignetouser && $action != 'view') $out.='<br>';
$i=0; $ownerid=0; $i=0; $ownerid=0;
foreach($assignedtouser as $key => $value) foreach($assignedtouser as $key => $value)
{ {
@ -1339,7 +1339,7 @@ class Form
$userstatic->fetch($value['id']); $userstatic->fetch($value['id']);
$out.=$userstatic->getNomUrl(1); $out.=$userstatic->getNomUrl(1);
if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; } if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; }
if ($numassignetouser > 1 && $action != 'view') $out.=' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; if ($nbassignetouser > 1 && $action != 'view') $out.=' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">';
//$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional")); //$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional"));
//$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy")); //$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy"));
$out.='<br>'; $out.='<br>';

View File

@ -355,6 +355,15 @@ class FormFile
$modellist=ModelePDFFactures::liste_modeles($this->db); $modellist=ModelePDFFactures::liste_modeles($this->db);
} }
} }
elseif ($modulepart == 'contract')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
{
include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
$modellist=ModelePDFContract::liste_modeles($this->db);
}
}
elseif ($modulepart == 'project') elseif ($modulepart == 'project')
{ {
if (is_array($genallowed)) $modellist=$genallowed; if (is_array($genallowed)) $modellist=$genallowed;

View File

@ -914,22 +914,12 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Societe') $out.='</a>'; if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>'; $out.='</td>';
$out.='<td colspan="5" align="right">'; $out.='<td colspan="5" align="right">';
$permok=$user->rights->agenda->myactions->create;
if (($object->id || $objcon->id) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}
$out.='</td>'; $out.='</td>';
$out.='</tr>'; $out.='</tr>';
$sql = "SELECT a.id, a.label,"; $sql = "SELECT a.id, a.label,";
$sql.= " a.datep as dp,"; $sql.= " a.datep as dp,";
$sql.= " a.datea as da,"; $sql.= " a.datep2 as dp2,";
$sql.= " a.percent,"; $sql.= " a.percent,";
$sql.= " a.fk_user_author, a.fk_contact,"; $sql.= " a.fk_user_author, a.fk_contact,";
$sql.= " a.fk_element, a.elementtype,"; $sql.= " a.fk_element, a.elementtype,";
@ -970,10 +960,20 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$datep=$db->jdate($obj->dp); $datep=$db->jdate($obj->dp);
$datep2=$db->jdate($obj->dp2);
$out.="<tr ".$bc[$var].">"; $out.="<tr ".$bc[$var].">";
$out.='<td width="120" align="left" class="nowrap">'.dol_print_date($datep,'dayhour')."</td>\n"; $out.='<td width="120" align="left" class="nowrap">';
$out.=dol_print_date($datep,'dayhour');
if ($datep2 && $datep2 != $datep)
{
$tmpa=dol_getdate($datep,true);
$tmpb=dol_getdate($datep2,true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($datep2,'hour');
else $out.='-'.dol_print_date($datep2,'dayhour');
}
$out.="</td>\n";
// Picto warning // Picto warning
$out.='<td width="16">'; $out.='<td width="16">';
@ -1103,7 +1103,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
'type'=>'action', 'type'=>'action',
'id'=>$obj->id, 'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp), 'datestart'=>$db->jdate($obj->dp),
'date'=>$db->jdate($obj->dp2), 'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label, 'note'=>$obj->label,
'percent'=>$obj->percent, 'percent'=>$obj->percent,
'acode'=>$obj->acode, 'acode'=>$obj->acode,
@ -1154,7 +1154,8 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$histo[$numaction]=array( $histo[$numaction]=array(
'type'=>'mailing', 'type'=>'mailing',
'id'=>$obj->id, 'id'=>$obj->id,
'date'=>$db->jdate($obj->da), 'datestart'=>$db->jdate($obj->da),
'dateend'=>$db->jdate($obj->da),
'note'=>$obj->note, 'note'=>$obj->note,
'percent'=>$obj->percentage, 'percent'=>$obj->percentage,
'acode'=>$obj->acode, 'acode'=>$obj->acode,
@ -1197,16 +1198,6 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Societe') $out.='</a>'; if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>'; $out.='</td>';
$out.='<td colspan="5" align="right">'; $out.='<td colspan="5" align="right">';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($object->id) || ! empty($objcon->id)) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}
$out.='</td>'; $out.='</td>';
$out.='</tr>'; $out.='</tr>';
@ -1217,8 +1208,14 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Champ date // Champ date
$out.='<td width="120" class="nowrap">'; $out.='<td width="120" class="nowrap">';
if ($histo[$key]['date']) $out.=dol_print_date($histo[$key]['date'],'dayhour'); $out.=dol_print_date($histo[$key]['datestart'],'dayhour');
else if ($histo[$key]['datestart']) $out.=dol_print_date($histo[$key]['datestart'],'dayhour'); if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart'])
{
$tmpa=dol_getdate($histo[$key]['datestart'],true);
$tmpb=dol_getdate($histo[$key]['dateend'],true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($histo[$key]['dateend'],'hour');
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
}
$out.="</td>\n"; $out.="</td>\n";
// Picto // Picto
@ -1251,6 +1248,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Objet lie // Objet lie
// TODO uniformize // TODO uniformize
$out.='<td>'; $out.='<td>';
//var_dump($histo[$key]['elementtype']);
if (isset($histo[$key]['elementtype'])) if (isset($histo[$key]['elementtype']))
{ {
if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled)) if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled))
@ -1259,13 +1257,13 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$propalstatic->id=$histo[$key]['fk_element']; $propalstatic->id=$histo[$key]['fk_element'];
$out.=$propalstatic->getNomUrl(1); $out.=$propalstatic->getNomUrl(1);
} }
elseif ($histo[$key]['elementtype'] == 'commande' && ! empty($conf->commande->enabled)) elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled))
{ {
$orderstatic->ref=$langs->trans("Order"); $orderstatic->ref=$langs->trans("Order");
$orderstatic->id=$histo[$key]['fk_element']; $orderstatic->id=$histo[$key]['fk_element'];
$out.=$orderstatic->getNomUrl(1); $out.=$orderstatic->getNomUrl(1);
} }
elseif ($histo[$key]['elementtype'] == 'facture' && ! empty($conf->facture->enabled)) elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
{ {
$facturestatic->ref=$langs->trans("Invoice"); $facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$histo[$key]['fk_element']; $facturestatic->id=$histo[$key]['fk_element'];

View File

@ -1636,14 +1636,14 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
else $original_file=$conf->facture->dir_output.'/payments/'.$original_file; else $original_file=$conf->facture->dir_output.'/payments/'.$original_file;
} }
// Wrapping pour les exports de compta // Wrapping for accounting exports
else if ($modulepart == 'export_compta') else if ($modulepart == 'export_compta')
{ {
if ($fuser->rights->compta->ventilation->creer || preg_match('/^specimen/i',$original_file)) if ($fuser->rights->accounting->ventilation->dispatch || preg_match('/^specimen/i',$original_file))
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->compta->dir_output.'/'.$original_file; $original_file=$conf->accounting->dir_output.'/'.$original_file;
} }
// Wrapping pour les expedition // Wrapping pour les expedition

View File

@ -1,11 +1,12 @@
<?php <?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -166,7 +167,7 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
* This class is an enhanced FPDI class that support method writeHTMLCell * This class is an enhanced FPDI class that support method writeHTMLCell
*/ */
class FPDI_DolExtended extends FPDI class FPDI_DolExtended extends FPDI
{ {
/** /**
* __call * __call
* *
@ -434,9 +435,9 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
// Add a background image on document // Add a background image on document
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) // Warning, this option make TCPDF generation beeing crazy and some content disappeared behin the image if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) // Warning, this option make TCPDF generation beeing crazy and some content disappeared behin the image
{ {
$pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image $pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image
$pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_X:0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y:0), 0, $page_height); $pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_X:0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y:0), 0, $page_height);
$pdf->SetAutoPageBreak(1,0); // Restore pagebreak $pdf->SetAutoPageBreak(1,0); // Restore pagebreak
} }
} }
@ -498,7 +499,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
$diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT);
$pdf->SetXY($curx, $cury); $pdf->SetXY($curx, $cury);
if (empty($onlynumber)) if (empty($onlynumber))
@ -526,6 +526,27 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$cury+=3; $cury+=3;
} }
// Use correct name of bank id according to country
$ibankey="IBANNumber";
if ($account->getCountryCode() == 'IN') $ibankey="IFSC";
if (! empty($account->iban))
{
$ibanDisplay_temp = $outputlangs->convToOutputCharset($account->iban);
$ibanDisplay = "";
for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++){
$ibanDisplay .= $ibanDisplay_temp[$i];
if($i%4 == 3 && $i > 0){
$ibanDisplay .= " ";
}
}
$pdf->SetFont('','B',$default_font_size - 3);
$pdf->SetXY($curx, $cury);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $ibanDisplay, 0, 'L', 0);
$cury+=3;
}
if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8); if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8);
if ($usedetailedbban == 1) if ($usedetailedbban == 1)
@ -606,9 +627,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
} }
// Use correct name of bank id according to country // Use correct name of bank id according to country
$ibankey="IBANNumber";
$bickey="BICNumber"; $bickey="BICNumber";
if ($account->getCountryCode() == 'IN') $ibankey="IFSC";
if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT";
$pdf->SetFont('','',$default_font_size - $diffsizecontent); $pdf->SetFont('','',$default_font_size - $diffsizecontent);
@ -625,13 +644,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
} }
else if (! $usedetailedbban) $cury+=1; else if (! $usedetailedbban) $cury+=1;
if (! empty($account->iban))
{
$pdf->SetXY($curx, $cury);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $outputlangs->convToOutputCharset($account->iban), 0, 'L', 0);
$cury+=3;
}
if (! empty($account->bic)) if (! empty($account->bic))
{ {
$pdf->SetXY($curx, $cury); $pdf->SetXY($curx, $cury);
@ -641,7 +653,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
return $pdf->getY(); return $pdf->getY();
} }
/** /**
* Show footer of page for PDF generation * Show footer of page for PDF generation
* *
@ -671,11 +682,11 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
{ {
// Make substitution // Make substitution
$substitutionarray=array( $substitutionarray=array(
'__FROM_NAME__' => $fromcompany->nom, '__FROM_NAME__' => $fromcompany->nom,
'__FROM_EMAIL__' => $fromcompany->email, '__FROM_EMAIL__' => $fromcompany->email,
'__TOTAL_TTC__' => $object->total_ttc, '__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht, '__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat '__TOTAL_VAT__' => $object->total_vat
); );
complete_substitutions_array($substitutionarray,$outputlangs,$object); complete_substitutions_array($substitutionarray,$outputlangs,$object);
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray); $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);

View File

@ -27,7 +27,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 105__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/menus.php?leftmenu=setup', 'Menus', 1, 'admin', '', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 105__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/menus.php?leftmenu=setup', 'Menus', 1, 'admin', '', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/fiscalyear.php?leftmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 106__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/delais.php?leftmenu=setup', 'Alerts', 1, 'admin', '', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 106__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/delais.php?leftmenu=setup', 'Alerts', 1, 'admin', '', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 108__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/proxy.php?leftmenu=setup', 'Security', 1, 'admin', '', '', 2, 8, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 108__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/proxy.php?leftmenu=setup', 'Security', 1, 'admin', '', '', 2, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 9, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 9, __ENTITY__);
@ -198,6 +197,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2406__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/export/', 'Export', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2406__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/export/', 'Export', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2407__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/index.php', 'New', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2407__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/index.php', 'New', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2408__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/list.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2408__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/list.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__);
-- Fiscal year
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/fiscalyear.php?leftmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 5, __ENTITY__);
-- Rapports -- Rapports
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&amp;mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&amp;mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
@ -244,7 +245,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create&amp;mode=mine', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create&amp;mode=mine', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects&amp;mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects&amp;mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/list.php?leftmenu=projects&amp;mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/list.php?leftmenu=projects&amp;mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-- Tools
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&amp;action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&amp;action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3902__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/list.php?leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3902__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/list.php?leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->lire', '', 0, 1, __ENTITY__);

View File

@ -872,13 +872,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("accountancy"); $langs->load("accountancy");
$newmenu->add("/accountancy/customer/index.php?leftmenu=ventil_customer",$langs->trans("CustomersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_customer'); $newmenu->add("/accountancy/customer/index.php?leftmenu=ventil_customer",$langs->trans("CustomersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_customer');
if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->read); if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->dispatch);
if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read); if (empty($leftmenu) || $leftmenu=="ventil_customer") $newmenu->add("/accountancy/customer/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read);
if (! empty($conf->fournisseur->enabled)) if (! empty($conf->fournisseur->enabled))
{ {
$newmenu->add("/accountancy/supplier/index.php?leftmenu=ventil_supplier",$langs->trans("SuppliersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_supplier'); $newmenu->add("/accountancy/supplier/index.php?leftmenu=ventil_supplier",$langs->trans("SuppliersVentilation"),0,$user->rights->accounting->ventilation->read, '', $mainmenu, 'ventil_supplier');
if (empty($leftmenu) || $leftmenu=="ventil_supplier") $newmenu->add("/accountancy/supplier/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->read); if (empty($leftmenu) || $leftmenu=="ventil_supplier") $newmenu->add("/accountancy/supplier/list.php",$langs->trans("ToDispatch"),1,$user->rights->accounting->ventilation->dispatch);
if (empty($leftmenu) || $leftmenu=="ventil_supplier") $newmenu->add("/accountancy/supplier/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read); if (empty($leftmenu) || $leftmenu=="ventil_supplier") $newmenu->add("/accountancy/supplier/lines.php",$langs->trans("Dispatched"),1,$user->rights->accounting->ventilation->read);
} }
} }

View File

@ -93,30 +93,6 @@ class modComptabilite extends DolibarrModules
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'resultat'; $this->rights[$r][4] = 'resultat';
$this->rights[$r][5] = 'lire'; $this->rights[$r][5] = 'lire';
$r++;
$this->rights[$r][0] = 96;
$this->rights[$r][1] = 'Parametrer la ventilation';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'ventilation';
$this->rights[$r][5] = 'parametrer';
$r++;
$this->rights[$r][0] = 97;
$this->rights[$r][1] = 'Lire les ventilations de factures';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'ventilation';
$this->rights[$r][5] = 'lire';
$r++;
$this->rights[$r][0] = 98;
$this->rights[$r][1] = 'Ventiler les lignes de factures';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'ventilation';
$this->rights[$r][5] = 'creer';
} }

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php * \file htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
* \ingroup project * \ingroup project
* \brief File of class to build ODT documents for third parties * \brief File of class to build ODT documents for third parties
*/ */

View File

@ -17,7 +17,7 @@
*/ */
/** /**
* \file htdocs/core/modules/project/pdf/pdf_baleine.modules.php * \file htdocs/core/modules/project/doc/pdf_baleine.modules.php
* \ingroup project * \ingroup project
* \brief Fichier de la classe permettant de generer les projets au modele Baleine * \brief Fichier de la classe permettant de generer les projets au modele Baleine
* \author Regis Houssin * \author Regis Houssin

View File

@ -1,28 +1,28 @@
<?php <?php
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@ope-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/ * or see http://www.gnu.org/
*/ */
/** /**
* \file htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php * \file htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
* \ingroup project * \ingroup project
* \brief File of class to build ODT documents for third parties * \brief File of class to build ODT documents for third parties
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php';
@ -304,7 +304,7 @@ class doc_generic_task_odt extends ModelePDFTask
$texte = $this->description.".<br>\n"; $texte = $this->description.".<br>\n";
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; $texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$texte.= '<input type="hidden" name="action" value="setModuleOptionsTask">'; $texte.= '<input type="hidden" name="action" value="setModuleOptions">';
$texte.= '<input type="hidden" name="param1" value="PROJECT_TASK_ADDON_PDF_ODT_PATH">'; $texte.= '<input type="hidden" name="param1" value="PROJECT_TASK_ADDON_PDF_ODT_PATH">';
$texte.= '<table class="nobordernopadding" width="100%">'; $texte.= '<table class="nobordernopadding" width="100%">';
@ -367,7 +367,7 @@ class doc_generic_task_odt extends ModelePDFTask
*/ */
function write_file($object,$outputlangs,$srctemplatepath) function write_file($object,$outputlangs,$srctemplatepath)
{ {
global $user,$langs,$conf,$mysoc; global $user,$langs,$conf,$mysoc,$hookmanager;
if (empty($srctemplatepath)) if (empty($srctemplatepath))
{ {

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -48,6 +49,9 @@ $result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
$object = new Fournisseur($db); $object = new Fournisseur($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('suppliercard'));
/* /*
* Action * Action
*/ */
@ -426,60 +430,66 @@ if ($object->fetch($id))
/* /*
* Barre d'actions * Barre d'actions
*/ */
$parameters = array();
print '<div class="tabsAction">'; $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
if ($user->rights->fournisseur->commande->creer) if (empty($reshook))
{ {
$langs->load("orders");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>'; print '<div class="tabsAction">';
if ($user->rights->fournisseur->commande->creer)
{
$langs->load("orders");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
}
if ($user->rights->fournisseur->facture->creer)
{
$langs->load("bills");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
}
// Add action
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
{
if ($user->rights->agenda->myactions->create)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a>';
}
else
{
print '<a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a>';
}
}
print '</div>';
print '<br>';
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
{
print '<br>';
// List of contacts
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
// Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
{
print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
// List of todo actions
show_actions_todo($conf,$langs,$db,$object);
// List of done actions
show_actions_done($conf,$langs,$db,$object);
}
} }
if ($user->rights->fournisseur->facture->creer)
{
$langs->load("bills");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
}
// Add action
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
{
if ($user->rights->agenda->myactions->create)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a>';
}
else
{
print '<a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a>';
}
}
print '</div>';
print '<br>';
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
{
print '<br>';
// List of contacts
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
// Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
{
print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
// List of todo actions
show_actions_todo($conf,$langs,$db,$object);
// List of done actions
show_actions_done($conf,$langs,$db,$object);
}
} }
else else
{ {

View File

@ -1821,98 +1821,104 @@ elseif (! empty($object->id))
/** /**
* Boutons actions * Boutons actions
*/ */
if ($user->societe_id == 0 && $action != 'edit_line' && $action != 'delete') $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
if (empty($reshook))
{ {
print '<div class="tabsAction">'; if ($user->societe_id == 0 && $action != 'edit_line' && $action != 'delete')
// Validate
if ($object->statut == 0 && $num > 0)
{ {
if ($user->rights->fournisseur->commande->valider) print '<div class="tabsAction">';
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=valid"';
print '>'.$langs->trans('Validate').'</a>';
}
}
// Modify // Validate
if ($object->statut == 1) if ($object->statut == 0 && $num > 0)
{
if ($user->rights->fournisseur->commande->commander)
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans("Modify").'</a>'; if ($user->rights->fournisseur->commande->valider)
} {
} print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=valid"';
print '>'.$langs->trans('Validate').'</a>';
// Approve }
if ($object->statut == 1)
{
if ($user->rights->fournisseur->commande->approuver)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=approve">'.$langs->trans("ApproveOrder").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=refuse">'.$langs->trans("RefuseOrder").'</a>';
}
else
{
print '<a class="butActionRefused" href="#">'.$langs->trans("ApproveOrder").'</a>';
print '<a class="butActionRefused" href="#">'.$langs->trans("RefuseOrder").'</a>';
}
}
// Send
if (in_array($object->statut, array(2, 3, 4, 5)))
{
if ($user->rights->fournisseur->commande->commander)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendByMail').'</a>';
}
}
// Reopen
if (in_array($object->statut, array(2, 5, 6, 7, 9)))
{
if ($user->rights->fournisseur->commande->commander)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans("ReOpen").'</a>';
}
}
// Create bill
if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted
{
if ($user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
} }
//if ($user->rights->fournisseur->commande->creer && $object->statut > 2) // Modify
//{ if ($object->statut == 1)
// print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
//}
}
// Cancel
if ($object->statut == 2)
{
if ($user->rights->fournisseur->commande->commander)
{ {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=cancel">'.$langs->trans("CancelOrder").'</a>'; if ($user->rights->fournisseur->commande->commander)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans("Modify").'</a>';
}
} }
}
// Clone // Approve
if ($user->rights->fournisseur->commande->creer) if ($object->statut == 1)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$object->socid.'&amp;action=clone&amp;object=order">'.$langs->trans("ToClone").'</a>'; if ($user->rights->fournisseur->commande->approuver)
} {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=approve">'.$langs->trans("ApproveOrder").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=refuse">'.$langs->trans("RefuseOrder").'</a>';
}
else
{
print '<a class="butActionRefused" href="#">'.$langs->trans("ApproveOrder").'</a>';
print '<a class="butActionRefused" href="#">'.$langs->trans("RefuseOrder").'</a>';
}
}
// Delete // Send
if ($user->rights->fournisseur->commande->supprimer) if (in_array($object->statut, array(2, 3, 4, 5)))
{ {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>'; if ($user->rights->fournisseur->commande->commander)
} {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendByMail').'</a>';
}
}
print "</div>"; // Reopen
if (in_array($object->statut, array(2, 5, 6, 7, 9)))
{
if ($user->rights->fournisseur->commande->commander)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans("ReOpen").'</a>';
}
}
// Create bill
if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted
{
if ($user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
}
//if ($user->rights->fournisseur->commande->creer && $object->statut > 2)
//{
// print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
//}
}
// Cancel
if ($object->statut == 2)
{
if ($user->rights->fournisseur->commande->commander)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=cancel">'.$langs->trans("CancelOrder").'</a>';
}
}
// Clone
if ($user->rights->fournisseur->commande->creer)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$object->socid.'&amp;action=clone&amp;object=order">'.$langs->trans("ToClone").'</a>';
}
// Delete
if ($user->rights->fournisseur->commande->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
}
print "</div>";
}
} }
print "<br>"; print "<br>";

View File

@ -1125,3 +1125,5 @@ create table llx_payment_loan
fk_user_creat integer, fk_user_creat integer,
fk_user_modif integer fk_user_modif integer
)ENGINE=innodb; )ENGINE=innodb;
ALTER TABLE llx_contrat ADD COLUMN model_pdf varchar(255) DEFAULT NULL AFTER note_public;

View File

@ -1,7 +1,7 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> -- Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -40,6 +40,7 @@ create table llx_contrat
fk_user_cloture integer, fk_user_cloture integer,
note_private text, note_private text,
note_public text, note_public text,
model_pdf varchar(255),
import_key varchar(14), import_key varchar(14),
extraparams varchar(255) extraparams varchar(255)

View File

@ -582,9 +582,6 @@ Permission92=إنشاء / تعديل المساهمات الاجتماعية و
Permission93=حذف المساهمات الاجتماعية وضريبة القيمة المضافة Permission93=حذف المساهمات الاجتماعية وضريبة القيمة المضافة
Permission94=تصدير المساهمات الاجتماعية Permission94=تصدير المساهمات الاجتماعية
Permission95=قراءة تقارير Permission95=قراءة تقارير
Permission96=ارسال الإعداد
Permission97=قراءة ارسال الفواتير والمحاسبة
Permission98=ارسال الفاتورة 'sخطوط المحاسبة
Permission101=قراءة الإرسال Permission101=قراءة الإرسال
Permission102=إنشاء / تعديل الإرسال Permission102=إنشاء / تعديل الإرسال
Permission104=صحة الإرسال Permission104=صحة الإرسال

View File

@ -582,9 +582,6 @@ Permission92=Създаване / промяна на социалните вн
Permission93=Изтриване на социалноосигурителните вноски и ДДС Permission93=Изтриване на социалноосигурителните вноски и ДДС
Permission94=Експортиране на социалноосигурителните вноски Permission94=Експортиране на социалноосигурителните вноски
Permission95=Прочети доклада Permission95=Прочети доклада
Permission96=Настройка на експедиция
Permission97=Фактура за счетоводството експедиция
Permission98=Изпращането фактура линии счетоводни
Permission101=Прочети sendings Permission101=Прочети sendings
Permission102=Създаване / промяна sendings Permission102=Създаване / промяна sendings
Permission104=Проверка на sendings Permission104=Проверка на sendings

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Otpremanje postavki
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Crear/modificar impostos i IVA
Permission93=Eliminar impostos i IVA Permission93=Eliminar impostos i IVA
Permission94=Exporta impostos Permission94=Exporta impostos
Permission95=Consultar balanços i resultats Permission95=Consultar balanços i resultats
Permission96=Parametritzar desglossament
Permission97=Llegir línies de factures
Permission98=Desglossar línies de factures
Permission101=Consultar expedicions Permission101=Consultar expedicions
Permission102=Crear/modificar expedicions Permission102=Crear/modificar expedicions
Permission104=Validar expedicions Permission104=Validar expedicions

View File

@ -582,9 +582,6 @@ Permission92=Vytvořit / upravit příspěvky na sociální zabezpečení a dan
Permission93=Odstranění sociální příspěvky a daně z přidané hodnoty Permission93=Odstranění sociální příspěvky a daně z přidané hodnoty
Permission94=Export příspěvky na sociální zabezpečení Permission94=Export příspěvky na sociální zabezpečení
Permission95=Přečtěte si zprávy Permission95=Přečtěte si zprávy
Permission96=Nastavení zasílání
Permission97=Přečtěte si faktury účetnictví dispečink
Permission98=Po odeslání faktury účetní linky
Permission101=Přečtěte si sendings Permission101=Přečtěte si sendings
Permission102=Vytvořit / upravit sendings Permission102=Vytvořit / upravit sendings
Permission104=Ověřit sendings Permission104=Ověřit sendings

View File

@ -582,9 +582,6 @@ Permission92=Opret / ændre sociale bidrag og moms
Permission93=Slet sociale bidrag og moms Permission93=Slet sociale bidrag og moms
Permission94=Eksporter sociale bidrag Permission94=Eksporter sociale bidrag
Permission95=Læs rapporter Permission95=Læs rapporter
Permission96=Setup lastfordelingen
Permission97=Læs faktura regnskabspool lastfordelingen
Permission98=Ekspeditionscentre faktura's regnskabslinjer
Permission101=Læs sendings Permission101=Læs sendings
Permission102=Opret / ændre sendings Permission102=Opret / ændre sendings
Permission104=Valider sendings Permission104=Valider sendings

View File

@ -582,9 +582,6 @@ Permission92=Steuern/Sozialbeiträge erstellen/bearbeiten
Permission93=Steuern/Sozialbeiträge löschen Permission93=Steuern/Sozialbeiträge löschen
Permission94=Sozialbeiträge exportieren Permission94=Sozialbeiträge exportieren
Permission95=Berichte einsehen Permission95=Berichte einsehen
Permission96=Verbuchung einstellen
Permission97=Rechnungszuweisung einsehen
Permission98=Zuweisung der Rechnungszeilen
Permission101=Sendungen einsehen Permission101=Sendungen einsehen
Permission102=Sendungen erstellen/bearbeiten Permission102=Sendungen erstellen/bearbeiten
Permission104=Sendungen freigeben Permission104=Sendungen freigeben

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -219,6 +219,7 @@ AutomaticIfJavascriptDisabled=Automatic if Javascript is disabled
AvailableOnlyIfJavascriptNotDisabled=Available only if JavaScript is not disabled AvailableOnlyIfJavascriptNotDisabled=Available only if JavaScript is not disabled
AvailableOnlyIfJavascriptAndAjaxNotDisabled=Available only if JavaScript is not disabled AvailableOnlyIfJavascriptAndAjaxNotDisabled=Available only if JavaScript is not disabled
Required=Required Required=Required
UsedOnlyWithTypeOption=Used by some agenda option only
Security=Security Security=Security
Passwords=Passwords Passwords=Passwords
DoNotStoreClearPassword=Do no store clear passwords in database but store only encrypted value (Activated recommended) DoNotStoreClearPassword=Do no store clear passwords in database but store only encrypted value (Activated recommended)
@ -584,9 +585,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -89,3 +89,4 @@ ExtSiteNoLabel=No Description
WorkingTimeRange=Working time range WorkingTimeRange=Working time range
WorkingDaysRange=Working days range WorkingDaysRange=Working days range
AddEvent=Create event AddEvent=Create event
MyAvailability=Ma disponibilité

View File

@ -584,9 +584,6 @@ Permission92=Crear/modificar impuestos e IVA
Permission93=Eliminar impuestos e IVA Permission93=Eliminar impuestos e IVA
Permission94=Exportar impuestos Permission94=Exportar impuestos
Permission95=Consultar balances y resultados Permission95=Consultar balances y resultados
Permission96=Parametrizar desglose
Permission97=Leer líneas de facturas
Permission98=Desglosar líneas de facturas
Permission101=Consultar expediciones Permission101=Consultar expediciones
Permission102=Crear/modificar expediciones Permission102=Crear/modificar expediciones
Permission104=Validar expediciones Permission104=Validar expediciones

View File

@ -582,9 +582,6 @@ Permission92=Sotsiaal- ja käibemaksu loomine/muutmine
Permission93=Sotsiaal- ja käibemaksu kustutamine Permission93=Sotsiaal- ja käibemaksu kustutamine
Permission94=Sotsiaalmaksu eksport Permission94=Sotsiaalmaksu eksport
Permission95=Aruannete vaatamine Permission95=Aruannete vaatamine
Permission96=Saatmise seadistamine
Permission97=Arvete raamatupidamisse saatmise vaatamine
Permission98=Arvete raamatupidamisse saatmise read
Permission101=Saatmiste vaatamine Permission101=Saatmiste vaatamine
Permission102=Saatmiste loomine/muutmine Permission102=Saatmiste loomine/muutmine
Permission104=Saatmiste kinnitamine Permission104=Saatmiste kinnitamine

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=ایجاد / تغییر مشارکتهای اجتماعی و مال
Permission93=حذف کمک های اجتماعی و مالیات بر ارزش افزوده Permission93=حذف کمک های اجتماعی و مالیات بر ارزش افزوده
Permission94=کمک های اجتماعی صادرات Permission94=کمک های اجتماعی صادرات
Permission95=دفعات بازدید: گزارش Permission95=دفعات بازدید: گزارش
Permission96=راه اندازی اعزام
Permission97=خوانده شده فاکتور اعزام حسابداری
Permission98=خطوط حسابداری فاکتور اعزام
Permission101=خوانده شده sendings Permission101=خوانده شده sendings
Permission102=ایجاد / تغییر sendings Permission102=ایجاد / تغییر sendings
Permission104=اعتبارسنجی sendings Permission104=اعتبارسنجی sendings

View File

@ -582,9 +582,6 @@ Permission92=Luoda / muuttaa sosiaaliturvamaksut ja alv
Permission93=Poista sosiaaliturvamaksut ja alv Permission93=Poista sosiaaliturvamaksut ja alv
Permission94=Vienti sosiaaliturvamaksut Permission94=Vienti sosiaaliturvamaksut
Permission95=Lue raportit Permission95=Lue raportit
Permission96=Setup lähetyskeskukset
Permission97=Lue laskun kirjanpitotietojen lähetyskeskukset
Permission98=Lähetysvaihetta laskun n kirjanpitotapahtumaa
Permission101=Lue sendings Permission101=Lue sendings
Permission102=Luoda / muuttaa sendings Permission102=Luoda / muuttaa sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -584,9 +584,6 @@ Permission92=Créer/modifier les charges et la TVA
Permission93=Supprimer les charges et la TVA Permission93=Supprimer les charges et la TVA
Permission94=Exporter les charges Permission94=Exporter les charges
Permission95=Consulter CA, bilans et résultats Permission95=Consulter CA, bilans et résultats
Permission96=Paramétrer la ventilation
Permission97=Lire les lignes de factures
Permission98=Ventiler les lignes de factures
Permission101=Consulter les expéditions Permission101=Consulter les expéditions
Permission102=Créer/modifier les expéditions Permission102=Créer/modifier les expéditions
Permission104=Valider les expéditions Permission104=Valider les expéditions

View File

@ -164,9 +164,6 @@ NotUsedForGoods=Non utilisé pour les biens
ProposalStats=Statistiques sur les propales ProposalStats=Statistiques sur les propales
OrderStats=Statistiques sur les commandes OrderStats=Statistiques sur les commandes
InvoiceStats=Statistiques sur les factures InvoiceStats=Statistiques sur les factures
Dispatch=Ventilation
Dispatched=Ventilés
ToDispatch=A ventiler
ThirdPartyMustBeEditAsCustomer=Le tiers doit être défini comme client ThirdPartyMustBeEditAsCustomer=Le tiers doit être défini comme client
SellsJournal=Journal des ventes SellsJournal=Journal des ventes
PurchasesJournal=Journal des achats PurchasesJournal=Journal des achats

View File

@ -582,9 +582,6 @@ Permission92=צור / לשנות לביטוח הלאומי ומס ערך מוס
Permission93=מחק לביטוח הלאומי ומס ערך מוסף Permission93=מחק לביטוח הלאומי ומס ערך מוסף
Permission94=ייצוא הפרשות סוציאליות Permission94=ייצוא הפרשות סוציאליות
Permission95=לקרוא דוחות Permission95=לקרוא דוחות
Permission96=הגדרת שיגור
Permission97=קרא את חשבון חשבונית שיגור
Permission98=שדר הקווים חשבונאות של חשבוניות
Permission101=לקרוא sendings Permission101=לקרוא sendings
Permission102=צור / לשנות sendings Permission102=צור / לשנות sendings
Permission104=אמת sendings Permission104=אמת sendings

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Létrehozza / módosítja a társadalombiztosítási járulékok é
Permission93=Törlés társadalombiztosítási járulékok és az áfa Permission93=Törlés társadalombiztosítási járulékok és az áfa
Permission94=Export társadalombiztosítási járulékok Permission94=Export társadalombiztosítási járulékok
Permission95=Olvassa jelentések Permission95=Olvassa jelentések
Permission96=Setup szállítási
Permission97=Olvassa el szállítási nyilvántartási számla
Permission98=A számla elküldése számviteli vonalak
Permission101=Olvassa küldések Permission101=Olvassa küldések
Permission102=Létrehozza / módosítja küldések Permission102=Létrehozza / módosítja küldések
Permission104=Érvényesítés küldések Permission104=Érvényesítés küldések

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Búa til / breyta félagslegum framlögum og VSK
Permission93=Eyða félagsleg framlög og VSK Permission93=Eyða félagsleg framlög og VSK
Permission94=Útflutningur tryggingagjöld Permission94=Útflutningur tryggingagjöld
Permission95=Lesa skýrslur Permission95=Lesa skýrslur
Permission96=Skipulag dispatching
Permission97=Lesa Reikningar bókhalds dispatching
Permission98=bókhalds línur Sending Reikningar's
Permission101=Lesa sendings Permission101=Lesa sendings
Permission102=Búa til / breyta sendings Permission102=Búa til / breyta sendings
Permission104=Staðfesta sendings Permission104=Staðfesta sendings

View File

@ -582,9 +582,6 @@ Permission92=Creare/modificare contributi e iva
Permission93=Eliminare contributi e iva Permission93=Eliminare contributi e iva
Permission94=Esportare contributi Permission94=Esportare contributi
Permission95=Vedere report Permission95=Vedere report
Permission96=Impostazioni della contabilità
Permission97=Vedere la contabilità delle fatture
Permission98=Contabilità linee delle fatture
Permission101=Vedere invii Permission101=Vedere invii
Permission102=Creare/modificare spedizioni Permission102=Creare/modificare spedizioni
Permission104=Convalidare spedizioni Permission104=Convalidare spedizioni

View File

@ -582,9 +582,6 @@ Permission92=社会貢献とバットを作成/変更
Permission93=社会貢献とバットを削除します。 Permission93=社会貢献とバットを削除します。
Permission94=社会貢献をエクスポートします。 Permission94=社会貢献をエクスポートします。
Permission95=レポートを読む Permission95=レポートを読む
Permission96=派遣セットアップ
Permission97=派遣請求書会計を読む
Permission98=請求書の会計の行を派遣
Permission101=sendingsを読む Permission101=sendingsを読む
Permission102=sendingsを作成/変更 Permission102=sendingsを作成/変更
Permission104=sendingsを検証する Permission104=sendingsを検証する

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Sukurti/keisti socialines įmokas ir PVM
Permission93=Ištrinti socialines įmokas ir PVM Permission93=Ištrinti socialines įmokas ir PVM
Permission94=Eksportuoti socialinės įmokas Permission94=Eksportuoti socialinės įmokas
Permission95=Skaityti ataskaitas Permission95=Skaityti ataskaitas
Permission96=Atlikimo/įvykdymo nustatymai
Permission97=Skaityti sąskaitų apskaitos atlikimą
Permission98=Atlikti sąskaitos apskaitos eilutes
Permission101=Skaityti siuntinius Permission101=Skaityti siuntinius
Permission102=Sukurti/keisti siuntinius Permission102=Sukurti/keisti siuntinius
Permission104=Patvirtinti siuntinius Permission104=Patvirtinti siuntinius

View File

@ -582,9 +582,6 @@ Permission92=Izveidot/labot sociālās iemaksas un PVN
Permission93=Dzēst sociālās iemaksas un PVN Permission93=Dzēst sociālās iemaksas un PVN
Permission94=Eksportēt sociālās iemaksas Permission94=Eksportēt sociālās iemaksas
Permission95=Lasīt atskaites Permission95=Lasīt atskaites
Permission96=Nosūtīšanas iestatīšana
Permission97=Lasīt rēķina grāmatvedību nosūtīšana
Permission98=Nosūtīšanas rēķinu grāmatvedības līnijas
Permission101=Lasīt sūtījumus Permission101=Lasīt sūtījumus
Permission102=Izveidot/mainīt sūtījumus Permission102=Izveidot/mainīt sūtījumus
Permission104=Apstiprināt sūtījumus Permission104=Apstiprināt sūtījumus

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Lage/endre avgifter og MVA
Permission93=Slette avgifter og MVA Permission93=Slette avgifter og MVA
Permission94=Eksporter sosiale bidrag Permission94=Eksporter sosiale bidrag
Permission95=Vise rapporter Permission95=Vise rapporter
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice's accountancy lines
Permission101=Vise forsendelser Permission101=Vise forsendelser
Permission102=Lage/endre forsendelser Permission102=Lage/endre forsendelser
Permission104=Godjenne forsendelser Permission104=Godjenne forsendelser

View File

@ -582,9 +582,6 @@ Permission92=Creëer / wijzig sociale bijdragen en BTW
Permission93=Verwijder sociale bijdragen en BTW Permission93=Verwijder sociale bijdragen en BTW
Permission94=Exporteer sociale bijdragen Permission94=Exporteer sociale bijdragen
Permission95=Bekijk de verslagen Permission95=Bekijk de verslagen
Permission96=Verzendingsinstellingen
Permission97=Bekijk factuur boekhouding verzending
Permission98=Verzending van de factuur boekhoudkundige regel
Permission101=Bekijk verzendingen Permission101=Bekijk verzendingen
Permission102=Creëer / wijzig verzendingen Permission102=Creëer / wijzig verzendingen
Permission104=Valideer verzendingen Permission104=Valideer verzendingen

View File

@ -582,9 +582,6 @@ Permission92=Tworzenie / modyfikacji składek na ubezpieczenia społeczne i poda
Permission93=Usuń składek na ubezpieczenia społeczne i podatku VAT Permission93=Usuń składek na ubezpieczenia społeczne i podatku VAT
Permission94=Eksport składek na ubezpieczenia społeczne Permission94=Eksport składek na ubezpieczenia społeczne
Permission95=Przeczytaj raporty Permission95=Przeczytaj raporty
Permission96=Konfiguracja wysyłek
Permission97=Czytaj faktury rachunkowych wysyłkowe
Permission98=Wysłanie faktury w księgowości linie
Permission101=Czytaj sendings Permission101=Czytaj sendings
Permission102=Utwórz / Modyfikuj sendings Permission102=Utwórz / Modyfikuj sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -575,9 +575,6 @@ Permission92=Criar/Modificar Impostos e ICMS
Permission93=Eliminar Impostos e ICMS Permission93=Eliminar Impostos e ICMS
Permission94=Exportar Impostos Sociais Permission94=Exportar Impostos Sociais
Permission95=Consultar balanços e resultados Permission95=Consultar balanços e resultados
Permission96=Parametrizar repartição
Permission97=Ler linhas de faturas
Permission98=Repartir linhas de faturas
Permission101=Consultar Expedições Permission101=Consultar Expedições
Permission102=Criar/Modificar Expedições Permission102=Criar/Modificar Expedições
Permission104=Confirmar Expedições Permission104=Confirmar Expedições

View File

@ -582,9 +582,6 @@ Permission92=Criar/Modificar Impostos e IVA
Permission93=Eliminar Impostos e IVA Permission93=Eliminar Impostos e IVA
Permission94=Exportar Impostos Sociais Permission94=Exportar Impostos Sociais
Permission95=Consultar balanços e resultados Permission95=Consultar balanços e resultados
Permission96=Parametrizar repartição
Permission97=Leer linhas de facturas
Permission98=Repartir linhas de facturas
Permission101=Consultar Expedições Permission101=Consultar Expedições
Permission102=Criar/Modificar Expedições Permission102=Criar/Modificar Expedições
Permission104=Confirmar Expedições Permission104=Confirmar Expedições

View File

@ -582,9 +582,6 @@ Permission92=Creare / Modificare a contribuţiilor sociale şi a TVA-ului
Permission93=Ştergere a contribuţiilor sociale şi a TVA-ului Permission93=Ştergere a contribuţiilor sociale şi a TVA-ului
Permission94=Export contribuţiilor sociale Permission94=Export contribuţiilor sociale
Permission95=Citeşte rapoarte Permission95=Citeşte rapoarte
Permission96=Setup expediţie
Permission97=Citeşte contabilitate factura de expediţie
Permission98=Expedierii facturii de contabilitate linii
Permission101=Citeşte sendings Permission101=Citeşte sendings
Permission102=Creare / Modificare Livrare Permission102=Creare / Modificare Livrare
Permission104=Validează livrari Permission104=Validează livrari

View File

@ -582,9 +582,6 @@ Permission92=Создать / изменить социальных отчисл
Permission93=Удалить социального взноса и налога на добавленную стоимость Permission93=Удалить социального взноса и налога на добавленную стоимость
Permission94=Экспорт социальных взносов Permission94=Экспорт социальных взносов
Permission95=Читать сообщения Permission95=Читать сообщения
Permission96=Установка диспетчерского
Permission97=Читать счета бухгалтерского диспетчерского
Permission98=Отправка счета в бухгалтерских линий
Permission101=Читать отправок Permission101=Читать отправок
Permission102=Создать / изменить отправок Permission102=Создать / изменить отправок
Permission104=Проверка отправок Permission104=Проверка отправок

View File

@ -582,9 +582,6 @@ Permission92=Vytvoriť / upraviť príspevky na sociálne zabezpečenie a dane z
Permission93=Odstránenie sociálne príspevky a dane z pridanej hodnoty Permission93=Odstránenie sociálne príspevky a dane z pridanej hodnoty
Permission94=Export príspevky na sociálne zabezpečenie Permission94=Export príspevky na sociálne zabezpečenie
Permission95=Prečítajte si správy Permission95=Prečítajte si správy
Permission96=Nastavenie zasielania
Permission97=Prečítajte si faktúry účtovníctva dispečing
Permission98=Po odoslaní faktúry účtovné linky
Permission101=Prečítajte si sendings Permission101=Prečítajte si sendings
Permission102=Vytvoriť / upraviť sendings Permission102=Vytvoriť / upraviť sendings
Permission104=Overiť sendings Permission104=Overiť sendings

View File

@ -582,9 +582,6 @@ Permission92=Kreiranje/spreminjanje socialnih prispevkov in DDV
Permission93=Brisanje socialnih prispevkov in DDV Permission93=Brisanje socialnih prispevkov in DDV
Permission94=Izvoz socialnih prispevkov Permission94=Izvoz socialnih prispevkov
Permission95=Branje poročil Permission95=Branje poročil
Permission96=Nastavitve odpreme
Permission97=Branje odposlanih računovodskih listin
Permission98=Branje postavk računovodskih listin
Permission101=Branje pošiljk Permission101=Branje pošiljk
Permission102=Kreiranje/spreminjanje pošiljk Permission102=Kreiranje/spreminjanje pošiljk
Permission104=Potrjevanje pošiljk Permission104=Potrjevanje pošiljk

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Skapa / ändra sociala avgifter och moms
Permission93=Ta bort sociala avgifter och moms Permission93=Ta bort sociala avgifter och moms
Permission94=Export sociala avgifter Permission94=Export sociala avgifter
Permission95=Läs rapporter Permission95=Läs rapporter
Permission96=Setup avsändning
Permission97=Läs faktura bokföring expedierar
Permission98=Dispatch fakturornas bokföringsposter
Permission101=Läs sendings Permission101=Läs sendings
Permission102=Skapa / ändra sendings Permission102=Skapa / ändra sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Sosyal katkı payı ve KDV oluştur/düzenle
Permission93=Sosyal katkı payı ve KDV sil Permission93=Sosyal katkı payı ve KDV sil
Permission94=Sosyal katkı payı dışaaktar Permission94=Sosyal katkı payı dışaaktar
Permission95=Rapor oku Permission95=Rapor oku
Permission96=Dağıtım ayarla
Permission97=Fatura kayıtları dağıtımlarını oku
Permission98=Faturaların muhasebesel satırlarını dağıt
Permission101=Gönderilenleri oku Permission101=Gönderilenleri oku
Permission102=Gönderilenleri oluştur/düzenle Permission102=Gönderilenleri oluştur/düzenle
Permission104=Gönderilenleri doğrula Permission104=Gönderilenleri doğrula

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=Create/modify social contributions and vat
Permission93=Delete social contributions and vat Permission93=Delete social contributions and vat
Permission94=Export social contributions Permission94=Export social contributions
Permission95=Read reports Permission95=Read reports
Permission96=Setup dispatching
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=Read sendings Permission101=Read sendings
Permission102=Create/modify sendings Permission102=Create/modify sendings
Permission104=Validate sendings Permission104=Validate sendings

View File

@ -582,9 +582,6 @@ Permission92=建立/修改的社会贡献和增值税
Permission93=删除社会贡献和增值税 Permission93=删除社会贡献和增值税
Permission94=导出社会贡献 Permission94=导出社会贡献
Permission95=阅读报告 Permission95=阅读报告
Permission96=设置调度
Permission97=Read invoice accountancy dispatching
Permission98=Dispatch invoice accountancy lines
Permission101=读取发货资讯 Permission101=读取发货资讯
Permission102=建立/修改发货单 Permission102=建立/修改发货单
Permission104=确认发货单 Permission104=确认发货单

View File

@ -582,9 +582,6 @@ Permission92=建立/修改的社會貢獻和增值稅
Permission93=刪除的社會貢獻和增值稅 Permission93=刪除的社會貢獻和增值稅
Permission94=出口社會貢獻 Permission94=出口社會貢獻
Permission95=閲讀報告 Permission95=閲讀報告
Permission96=安裝調度
Permission97=瞭解會計調度發票
Permission98=調度發票的會計行
Permission101=讀取出貨資訊 Permission101=讀取出貨資訊
Permission102=建立/修改出貨單 Permission102=建立/修改出貨單
Permission104=驗證出貨單 Permission104=驗證出貨單

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -99,7 +99,7 @@ else if ($action == 'specimen')
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir) foreach($dirmodels as $reldir)
{ {
$file=dol_buildpath($reldir."core/modules/project/pdf/pdf_".$modele.".modules.php",0); $file=dol_buildpath($reldir."core/modules/project/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file)) if (file_exists($file))
{ {
$filefound=1; $filefound=1;
@ -144,7 +144,7 @@ else if ($action == 'specimentask')
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir) foreach($dirmodels as $reldir)
{ {
$file=dol_buildpath($reldir."core/modules/project/task/pdf/pdf_".$modele.".modules.php",0); $file=dol_buildpath($reldir."core/modules/project/task/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file)) if (file_exists($file))
{ {
$filefound=1; $filefound=1;
@ -177,6 +177,35 @@ else if ($action == 'specimentask')
} }
} }
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
$db->begin();
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
{
$param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
// Activate a model // Activate a model
else if ($action == 'set') else if ($action == 'set')
{ {
@ -256,26 +285,10 @@ else if ($action == 'setmodtask')
dolibarr_set_const($db, "PROJECT_TASK_ADDON",$value,'chaine',0,'',$conf->entity); dolibarr_set_const($db, "PROJECT_TASK_ADDON",$value,'chaine',0,'',$conf->entity);
} }
else if ($action=='setModuleOptions') {
if (dolibarr_set_const($db, "PROJECT_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->PROJECT_ADDON_PDF_ODT_PATH = GETPOST('value1');
}
}
else if ($action=='setModuleOptionsTask') {
if (dolibarr_set_const($db, "PROJECT_TASK_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->PROJECT_TASK_ADDON_PDF_ODT_PATH = GETPOST('value1');
}
}
/* /*
* View * View
*/ */
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
@ -542,99 +555,108 @@ clearstatcache();
$var=true; $var=true;
foreach ($dirmodels as $reldir) foreach ($dirmodels as $reldir)
{ {
$dir = dol_buildpath($reldir."core/modules/project/pdf/"); foreach (array('','/doc') as $valdir)
if (is_dir($dir))
{ {
$handle=opendir($dir); $dir = dol_buildpath($reldir."core/modules/project/".$valdir);
if (is_resource($handle))
if (is_dir($dir))
{ {
while (($file = readdir($handle))!==false) $handle=opendir($dir);
if (is_resource($handle))
{ {
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) while (($file = readdir($handle))!==false)
{ {
if (file_exists($dir.'/'.$file)) $filelist[]=$file;
}
closedir($handle);
arsort($filelist);
foreach($filelist as $file)
{
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{ {
$name = substr($file, 4, dol_strlen($file) -16); if (file_exists($dir.'/'.$file))
$classname = substr($file, 0, dol_strlen($file) -12);
require_once $dir.'/'.$file;
$module = new $classname($db);
$modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
if ($modulequalified)
{ {
$var=!$var; $name = substr($file, 4, dol_strlen($file) -16);
print '<tr '.$bc[$var].'><td width="100">'; $classname = substr($file, 0, dol_strlen($file) -12);
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print "</td>\n";
// Active require_once $dir.'/'.$file;
if (in_array($name, $def)) $module = new $classname($db);
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Default $modulequalified=1;
print "<td align=\"center\">"; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($conf->global->PROJECT_ADDON_PDF == "$name") if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info if ($modulequalified)
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($module->type == 'pdf')
{ {
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $var=!$var;
} print '<tr '.$bc[$var].'><td width="100">';
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; print (empty($module->name)?$name:$module->name);
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print "</td>\n";
print '<td align="center">'; // Active
print $form->textwithpicto('',$htmltooltip,1,0); if (in_array($name, $def))
print '</td>'; {
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Preview // Default
print '<td align="center">'; print "<td align=\"center\">";
if ($module->type == 'pdf') if ($conf->global->PROJECT_ADDON_PDF == "$name")
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>'; print img_picto($langs->trans("Default"),'on');
} }
else else
{ {
print img_object($langs->trans("PreviewNotAvailable"),'generic'); print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';
print "</tr>\n"; // Info
} $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($module->type == 'pdf')
{
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
}
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
// Preview
print '<td align="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print '</td>';
print "</tr>\n";
}
}
} }
} }
} }
closedir($handle);
} }
} }
} }
@ -688,98 +710,107 @@ clearstatcache();
$var=true; $var=true;
foreach ($dirmodels as $reldir) foreach ($dirmodels as $reldir)
{ {
$dir = dol_buildpath($reldir."core/modules/project/task/pdf/"); foreach (array('','/doc') as $valdir)
if (is_dir($dir))
{ {
$handle=opendir($dir); $dir = dol_buildpath($reldir."core/modules/project/task/".$valdir);
if (is_resource($handle))
if (is_dir($dir))
{ {
while (($file = readdir($handle))!==false) $handle=opendir($dir);
if (is_resource($handle))
{ {
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) while (($file = readdir($handle))!==false)
{ {
if (file_exists($dir.'/'.$file)) $filelist[]=$file;
}
closedir($handle);
arsort($filelist);
foreach($filelist as $file)
{
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{ {
$name = substr($file, 4, dol_strlen($file) -16); if (file_exists($dir.'/'.$file))
$classname = substr($file, 0, dol_strlen($file) -12);
require_once $dir.'/'.$file;
$module = new $classname($db);
$modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
if ($modulequalified)
{ {
$var = !$var; $name = substr($file, 4, dol_strlen($file) -16);
print '<tr '.$bc[$var].'><td width="100">'; $classname = substr($file, 0, dol_strlen($file) -12);
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print "</td>\n";
// Active require_once $dir.'/'.$file;
if (in_array($name, $def)) $module = new $classname($db);
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Defaut $modulequalified=1;
print "<td align=\"center\">"; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info if ($modulequalified)
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($module->type == 'pdf')
{ {
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $var = !$var;
} print '<tr '.$bc[$var].'><td width="100">';
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; print (empty($module->name)?$name:$module->name);
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print "</td>\n";
print '<td align="center">'; // Active
print $form->textwithpicto('',$htmltooltip,1,0); if (in_array($name, $def))
print '</td>'; {
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Preview // Defaut
print '<td align="center">'; print "<td align=\"center\">";
if ($module->type == 'pdf') if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name")
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimentask&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>'; print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($module->type == 'pdf')
{
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
}
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
// Preview
print '<td align="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimentask&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print '</td>';
print "</tr>\n";
} }
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print '</td>';
print "</tr>\n";
} }
} }
} }
} }
closedir($handle);
} }
} }
} }

View File

@ -1368,7 +1368,7 @@ class Project extends CommonObject
} }
} }
$modelpath = "core/modules/project/pdf/"; $modelpath = "core/modules/project/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }

View File

@ -1343,7 +1343,7 @@ class Task extends CommonObject
} }
} }
$modelpath = "core/modules/project/task/pdf/"; $modelpath = "core/modules/project/task/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }

View File

@ -171,7 +171,22 @@ if ($socid)
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); $objthirdparty=$soc;
$objcon=new stdClass();
$out='';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}
print load_fiche_titre($langs->trans("ActionsOnCompany"),$out,'');
// List of todo actions // List of todo actions
show_actions_todo($conf,$langs,$db,$soc); show_actions_todo($conf,$langs,$db,$soc);

View File

@ -136,7 +136,9 @@ $server->wsdl->addComplexType(
'minOccurs' => '0', 'minOccurs' => '0',
'maxOccurs' => 'unbounded' 'maxOccurs' => 'unbounded'
) )
) ),
null,
'tns:line'
); );
@ -197,7 +199,9 @@ $server->wsdl->addComplexType(
'minOccurs' => '0', 'minOccurs' => '0',
'maxOccurs' => 'unbounded' 'maxOccurs' => 'unbounded'
) )
) ),
null,
'tns:invoice'
); );

View File

@ -42,7 +42,7 @@ require_once dirname(__FILE__).'/../../htdocs/core/lib/pdf.lib.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/doc/pdf_azur.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/doc/pdf_azur.modules.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/doc/pdf_einstein.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/doc/pdf_einstein.modules.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/project/pdf/pdf_baleine.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/project/doc/pdf_baleine.modules.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_merou.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_merou.modules.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_rouget.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_rouget.modules.php';