Merge branch 'develop' of git://github.com/Dolibarr/dolibarr.git into extrafields
This commit is contained in:
commit
520e235207
@ -76,8 +76,6 @@ dol_fiche_head($head, 'attributes', $langs->trans("Member"), 0, 'user');
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
@ -77,8 +77,6 @@ dol_fiche_head($head, 'attributes_type', $langs->trans("Member"), 0, 'user');
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
@ -78,8 +78,6 @@ dol_fiche_head($head, 'attributes', $langs->trans("Agenda"));
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
@ -162,10 +162,34 @@ if ($action == 'setdefaultduration')
|
||||
}
|
||||
}
|
||||
|
||||
/*if ($action == 'setusecustomercontactasrecipient')
|
||||
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||
if ($action == 'setModuleOptions')
|
||||
{
|
||||
dolibarr_set_const($db, "PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["value"],'chaine',0,'',$conf->entity);
|
||||
}*/
|
||||
$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();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -76,8 +76,6 @@ dol_fiche_head($head, 'attributes', $langs->trans("Propal"), 0, 'propal');
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
@ -1331,7 +1331,7 @@ if ($action == 'create')
|
||||
print '<td>'.$langs->trans("DefaultModel").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$liste=ModelePDFPropales::liste_modeles($db);
|
||||
print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF);
|
||||
print $form->selectarray('model',$liste,($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT?$conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT:$conf->global->PROPALE_ADDON_PDF));
|
||||
print "</td></tr>";
|
||||
|
||||
// Project
|
||||
|
||||
@ -1634,6 +1634,20 @@ class Propal extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->client->default_lang);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
//$ret=$object->fetch($id); // Reload to get new records
|
||||
propale_pdf_create($this->db, $this, $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL?$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
@ -1646,6 +1660,21 @@ class Propal extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->client->default_lang);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
//$ret=$object->fetch($id); // Reload to get new records
|
||||
propale_pdf_create($this->db, $this, $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
|
||||
@ -77,8 +77,6 @@ dol_fiche_head($head, 'attributes', $langs->trans("Invoices"), 0, 'invoice');
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ if ($action == 'add')
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
|
||||
$mesg[]=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
@ -49,21 +49,21 @@ if ($action == 'add')
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring);
|
||||
$mesg[]=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring);
|
||||
$action = 'create';
|
||||
}
|
||||
if (GETPOST('type')=='int' && $extrasize > $maxsizeint)
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint);
|
||||
$mesg[]=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint);
|
||||
$action = 'create';
|
||||
}
|
||||
if (GETPOST('type')=='select' && !GETPOST('param'))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorNoValueForSelectType");
|
||||
$mesg[]=$langs->trans("ErrorNoValueForSelectType");
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
@ -84,6 +84,7 @@ if ($action == 'add')
|
||||
$result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$default_value,$params);
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessage($langs->trans('SetupSaved'));
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -91,6 +92,7 @@ if ($action == 'add')
|
||||
{
|
||||
$error++;
|
||||
$mesg=$extrafields->error;
|
||||
setEventMessage($mesg,'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -98,9 +100,14 @@ if ($action == 'add')
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
setEventMessage($mesg,'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($mesg,'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,21 +121,21 @@ if ($action == 'update')
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
|
||||
$mesg[]=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
|
||||
$action = 'create';
|
||||
}
|
||||
if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring)
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring);
|
||||
$mesg[]=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring);
|
||||
$action = 'edit';
|
||||
}
|
||||
if (GETPOST('type')=='int' && $extrasize > $maxsizeint)
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint);
|
||||
$mesg[]=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint);
|
||||
$action = 'edit';
|
||||
}
|
||||
|
||||
@ -148,6 +155,7 @@ if ($action == 'update')
|
||||
$result=$extrafields->update($_POST['attrname'],$_POST['label'],$_POST['type'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$pos,$params);
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessage($langs->trans('SetupSaved'));
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -155,6 +163,7 @@ if ($action == 'update')
|
||||
{
|
||||
$error++;
|
||||
$mesg=$extrafields->error;
|
||||
setEventMessage($mesg,'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -162,8 +171,13 @@ if ($action == 'update')
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
setEventMessage($mesg,'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($mesg,'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,18 +41,9 @@ class box_activity extends ModeleBoxes
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
$this->enabled = 1;
|
||||
// FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software.
|
||||
// FIXME: Removed number_format (not compatible with all languages)
|
||||
// FIXME: Pb into some status
|
||||
}
|
||||
// FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software.
|
||||
// FIXME: Removed number_format (not compatible with all languages)
|
||||
// FIXME: Pb into some status
|
||||
|
||||
/**
|
||||
* Charge les donnees en memoire pour affichage ulterieur
|
||||
@ -66,6 +57,7 @@ class box_activity extends ModeleBoxes
|
||||
|
||||
$totalMnt = 0;
|
||||
$totalnb = 0;
|
||||
$i = 0;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
@ -99,7 +91,6 @@ class box_activity extends ModeleBoxes
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => 'bill');
|
||||
@ -140,7 +131,7 @@ class box_activity extends ModeleBoxes
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result)+$i;
|
||||
$num = $db->num_rows($result) + $i;
|
||||
$now=dol_now();
|
||||
|
||||
while ($i < $num)
|
||||
@ -195,7 +186,7 @@ class box_activity extends ModeleBoxes
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result)+$i;
|
||||
$num = $db->num_rows($result) + $i;
|
||||
while ($i < $num)
|
||||
{
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_order');
|
||||
@ -246,7 +237,7 @@ class box_activity extends ModeleBoxes
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result)+$i;
|
||||
$num = $db->num_rows($result) + $i;
|
||||
while ($i < $num)
|
||||
{
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_propal');
|
||||
|
||||
@ -33,7 +33,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
||||
var $error='';
|
||||
var $max=5;
|
||||
var $enabled=1;
|
||||
|
||||
|
||||
var $rowid;
|
||||
var $id;
|
||||
var $position;
|
||||
|
||||
@ -1640,10 +1640,11 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
|
||||
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
|
||||
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
|
||||
* @param int $pictoisfullpath If 1, image path is a full path
|
||||
* @param int $srconly Return only content of the src attribute of img.
|
||||
* @return string Return img tag
|
||||
* @see #img_object, #img_picto_common
|
||||
*/
|
||||
function img_picto($alt, $picto, $options = '', $pictoisfullpath = false)
|
||||
function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srconly=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -1678,7 +1679,8 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false)
|
||||
$fullpathpicto = $url.'/'.$path.'/img/'.$picto;
|
||||
}
|
||||
|
||||
return '<img src="'.$fullpathpicto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.(! empty($options)?' '.$options:'').'>';
|
||||
if ($srconly) return $fullpathpicto;
|
||||
else return '<img src="'.$fullpathpicto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.(! empty($options)?' '.$options:'').'>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -455,7 +455,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
|
||||
// Setup
|
||||
$newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, 1, '', $mainmenu, 'setup');
|
||||
if ($leftmenu=="setup")
|
||||
if (empty($leftmenu) || $leftmenu=="setup")
|
||||
{
|
||||
$warnpicto='';
|
||||
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY))
|
||||
@ -475,7 +475,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1);
|
||||
if (! in_array($langs->defaultlang,array('en_US','en_GB','en_NZ','en_AU','fr_FR','fr_BE','es_ES','ca_ES')))
|
||||
{
|
||||
if ($leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);
|
||||
if (empty($leftmenu) || $leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);
|
||||
}
|
||||
$newmenu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"),1);
|
||||
$newmenu->add("/admin/delais.php?mainmenu=home",$langs->trans("Alerts"),1);
|
||||
@ -490,11 +490,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
|
||||
// System tools
|
||||
$newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("SystemTools"), 0, 1, '', $mainmenu, 'admintools');
|
||||
if (preg_match('/^admintools/',$leftmenu))
|
||||
if (empty($leftmenu) || preg_match('/^admintools/',$leftmenu))
|
||||
{
|
||||
$newmenu->add('/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('InfoDolibarr'), 1);
|
||||
if ($leftmenu=='admintools_info') $newmenu->add('/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2);
|
||||
if ($leftmenu=='admintools_info') $newmenu->add('/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2);
|
||||
if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2);
|
||||
if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2);
|
||||
$newmenu->add('/admin/system/os.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoOS'), 1);
|
||||
$newmenu->add('/admin/system/web.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoWebServer'), 1);
|
||||
$newmenu->add('/admin/system/phpinfo.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoPHP'), 1);
|
||||
@ -517,7 +517,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
$newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ModulesSystemTools"), 0, 1, '', $mainmenu, 'modulesadmintools');
|
||||
if ($leftmenu=="modulesadmintools" && $user->admin)
|
||||
if ((empty($leftmenu) || $leftmenu=="modulesadmintools") && $user->admin)
|
||||
{
|
||||
$langs->load("products");
|
||||
$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
|
||||
@ -527,7 +527,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
}
|
||||
|
||||
$newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, 1, '', $mainmenu, 'users');
|
||||
if ($leftmenu=="users")
|
||||
if (empty($leftmenu) || $leftmenu=="users")
|
||||
{
|
||||
$newmenu->add("/user/index.php", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin);
|
||||
$newmenu->add("/user/fiche.php?action=create", $langs->trans("NewUser"),2, $user->rights->user->user->creer || $user->admin);
|
||||
@ -561,11 +561,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$langs->load("commercial");
|
||||
$newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects');
|
||||
|
||||
if ($leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire);
|
||||
if ($leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire);
|
||||
if ($leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire);
|
||||
if ($leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire);
|
||||
if ($leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/comm/prospect/list.php?sortfield=s.datec&sortorder=desc&begin=&stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire);
|
||||
|
||||
$newmenu->add("/societe/soc.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 2, $user->rights->societe->creer);
|
||||
//$newmenu->add("/contact/list.php?leftmenu=customers&type=p", $langs->trans("Contacts"), 2, $user->rights->societe->contact->lire);
|
||||
@ -624,7 +624,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
}
|
||||
//if ($leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
|
||||
}
|
||||
@ -643,12 +643,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Prop"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals');
|
||||
$newmenu->add("/comm/propal.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
|
||||
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire);
|
||||
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire);
|
||||
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire);
|
||||
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire);
|
||||
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire);
|
||||
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire);
|
||||
//if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire);
|
||||
//if (empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire);
|
||||
$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire);
|
||||
}
|
||||
|
||||
@ -659,12 +659,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
$newmenu->add("/societe/societe.php?leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
|
||||
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
|
||||
if ($leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire);
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); // The translation key is StatusOrderToBill but it means StatusDelivered. TODO We should renamed this later
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire);
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); // The translation key is StatusOrderToBill but it means StatusDelivered. TODO We should renamed this later
|
||||
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire);
|
||||
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);
|
||||
}
|
||||
|
||||
@ -686,10 +686,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/contrat/fiche.php?&action=create&leftmenu=contracts", $langs->trans("NewContract"), 1, $user->rights->contrat->creer);
|
||||
$newmenu->add("/contrat/liste.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire);
|
||||
$newmenu->add("/contrat/services.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire);
|
||||
if ($leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire);
|
||||
if ($leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire);
|
||||
if ($leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire);
|
||||
if ($leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire);
|
||||
}
|
||||
|
||||
// Interventions
|
||||
@ -758,7 +758,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("orders");
|
||||
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
// if ($leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
|
||||
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
|
||||
}
|
||||
|
||||
// Donations
|
||||
@ -766,8 +766,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("donations");
|
||||
$newmenu->add("/compta/dons/index.php?leftmenu=donations&mainmenu=accountancy",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations');
|
||||
if ($leftmenu=="donations") $newmenu->add("/compta/dons/fiche.php?action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer);
|
||||
if ($leftmenu=="donations") $newmenu->add("/compta/dons/liste.php",$langs->trans("List"), 1, $user->rights->don->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/compta/dons/fiche.php?action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer);
|
||||
if (empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/compta/dons/liste.php",$langs->trans("List"), 1, $user->rights->don->lire);
|
||||
//if ($leftmenu=="donations") $newmenu->add("/compta/dons/stats.php",$langs->trans("Statistics"), 1, $user->rights->don->lire);
|
||||
}
|
||||
|
||||
@ -776,36 +776,36 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("trips");
|
||||
$newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses');
|
||||
if ($leftmenu=="tripsandexpenses") $newmenu->add("/compta/deplacement/fiche.php?action=create&leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("New"), 1, $user->rights->deplacement->creer);
|
||||
if ($leftmenu=="tripsandexpenses") $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("List"), 1, $user->rights->deplacement->lire);
|
||||
if ($leftmenu=="tripsandexpenses") $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="tripsandexpenses") $newmenu->add("/compta/deplacement/fiche.php?action=create&leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("New"), 1, $user->rights->deplacement->creer);
|
||||
if (empty($leftmenu) || $leftmenu=="tripsandexpenses") $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("List"), 1, $user->rights->deplacement->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="tripsandexpenses") $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire);
|
||||
}
|
||||
|
||||
// Taxes and social contributions
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax');
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire);
|
||||
// VAT
|
||||
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
|
||||
{
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
||||
global $mysoc;
|
||||
|
||||
//Local Taxes
|
||||
if($mysoc->country_code=='ES' && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj=="1"))
|
||||
{
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
||||
//if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
|
||||
if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
||||
//if (empty($leftmenu) || preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
||||
}
|
||||
|
||||
}
|
||||
@ -816,8 +816,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->comptabilite->enabled) && ($conf->global->MAIN_FEATURES_LEVEL >= 2))
|
||||
{
|
||||
$newmenu->add("/compta/ventilation/index.php?leftmenu=ventil",$langs->trans("Dispatch"),0,$user->rights->compta->ventilation->lire, '', $mainmenu, 'ventil');
|
||||
if ($leftmenu=="ventil") $newmenu->add("/compta/ventilation/liste.php",$langs->trans("ToDispatch"),1,$user->rights->compta->ventilation->lire);
|
||||
if ($leftmenu=="ventil") $newmenu->add("/compta/ventilation/lignes.php",$langs->trans("Dispatched"),1,$user->rights->compta->ventilation->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ventil") $newmenu->add("/compta/ventilation/liste.php",$langs->trans("ToDispatch"),1,$user->rights->compta->ventilation->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ventil") $newmenu->add("/compta/ventilation/lignes.php",$langs->trans("Dispatched"),1,$user->rights->compta->ventilation->lire);
|
||||
}
|
||||
|
||||
// Compta expert
|
||||
@ -834,29 +834,29 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
// Bilan, resultats
|
||||
$newmenu->add("/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy",$langs->trans("Reportings"),0,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
||||
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/resultat/index.php?leftmenu=ca",$langs->trans("ReportInOut"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=ca",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/resultat/index.php?leftmenu=ca",$langs->trans("ReportInOut"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=ca",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
/* On verra ca avec module compabilite expert
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/resultat/compteres.php?leftmenu=ca","Compte de resultat",2,$user->rights->compta->resultat->lire);
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/resultat/bilan.php?leftmenu=ca","Bilan",2,$user->rights->compta->resultat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/resultat/compteres.php?leftmenu=ca","Compte de resultat",2,$user->rights->compta->resultat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/resultat/bilan.php?leftmenu=ca","Bilan",2,$user->rights->compta->resultat->lire);
|
||||
*/
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/stats/index.php?leftmenu=ca",$langs->trans("ReportTurnover"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/index.php?leftmenu=ca",$langs->trans("ReportTurnover"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
|
||||
/*
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/stats/cumul.php?leftmenu=ca","Cumule",2,$user->rights->compta->resultat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/cumul.php?leftmenu=ca","Cumule",2,$user->rights->compta->resultat->lire);
|
||||
if (! empty($conf->propal->enabled)) {
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/stats/prev.php?leftmenu=ca","Previsionnel",2,$user->rights->compta->resultat->lire);
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/stats/comp.php?leftmenu=ca","Transforme",2,$user->rights->compta->resultat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/prev.php?leftmenu=ca","Previsionnel",2,$user->rights->compta->resultat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/comp.php?leftmenu=ca","Transforme",2,$user->rights->compta->resultat->lire);
|
||||
}
|
||||
*/
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/stats/casoc.php?leftmenu=ca",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/stats/cabyuser.php?leftmenu=ca",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/casoc.php?leftmenu=ca",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/cabyuser.php?leftmenu=ca",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
|
||||
// Journaux
|
||||
//if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
//journaux
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=ca",$langs->trans("SellsJournal"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if ($leftmenu=="ca") $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=ca",$langs->trans("PurchasesJournal"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=ca",$langs->trans("SellsJournal"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=ca",$langs->trans("PurchasesJournal"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
|
||||
}
|
||||
}
|
||||
|
||||
@ -889,17 +889,17 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank",$langs->trans("StandingOrders"),0,$user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw');
|
||||
|
||||
//if ($leftmenu=="withdraw") $newmenu->add("/compta/prelevement/demandes.php?status=0&mainmenu=bank",$langs->trans("StandingOrderToProcess"),1,$user->rights->prelevement->bons->lire);
|
||||
//if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/demandes.php?status=0&mainmenu=bank",$langs->trans("StandingOrderToProcess"),1,$user->rights->prelevement->bons->lire);
|
||||
|
||||
if ($leftmenu=="withdraw") $newmenu->add("/compta/prelevement/create.php?mainmenu=bank",$langs->trans("NewStandingOrder"),1,$user->rights->prelevement->bons->creer);
|
||||
if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/create.php?mainmenu=bank",$langs->trans("NewStandingOrder"),1,$user->rights->prelevement->bons->creer);
|
||||
|
||||
|
||||
if ($leftmenu=="withdraw") $newmenu->add("/compta/prelevement/bons.php?mainmenu=bank",$langs->trans("WithdrawalsReceipts"),1,$user->rights->prelevement->bons->lire);
|
||||
if ($leftmenu=="withdraw") $newmenu->add("/compta/prelevement/liste.php?mainmenu=bank",$langs->trans("WithdrawalsLines"),1,$user->rights->prelevement->bons->lire);
|
||||
if ($leftmenu=="withdraw") $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank",$langs->trans("Rejects"),1,$user->rights->prelevement->bons->lire);
|
||||
if ($leftmenu=="withdraw") $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank",$langs->trans("Statistics"),1,$user->rights->prelevement->bons->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/bons.php?mainmenu=bank",$langs->trans("WithdrawalsReceipts"),1,$user->rights->prelevement->bons->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/liste.php?mainmenu=bank",$langs->trans("WithdrawalsLines"),1,$user->rights->prelevement->bons->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank",$langs->trans("Rejects"),1,$user->rights->prelevement->bons->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank",$langs->trans("Statistics"),1,$user->rights->prelevement->bons->lire);
|
||||
|
||||
//if ($leftmenu=="withdraw") $newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer);
|
||||
//if (empty($leftmenu) || $leftmenu=="withdraw") $newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer);
|
||||
}
|
||||
|
||||
// Gestion cheques
|
||||
@ -960,7 +960,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=0", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
//if ($leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
|
||||
// Stocks
|
||||
@ -968,10 +968,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("stocks");
|
||||
$newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Stocks"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock');
|
||||
if ($leftmenu=="stock") $newmenu->add("/product/stock/fiche.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer);
|
||||
if ($leftmenu=="stock") $newmenu->add("/product/stock/liste.php", $langs->trans("List"), 1, $user->rights->stock->lire);
|
||||
if ($leftmenu=="stock") $newmenu->add("/product/stock/valo.php", $langs->trans("EnhancedValue"), 1, $user->rights->stock->lire);
|
||||
if ($leftmenu=="stock") $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/fiche.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer);
|
||||
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/liste.php", $langs->trans("List"), 1, $user->rights->stock->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/valo.php", $langs->trans("EnhancedValue"), 1, $user->rights->stock->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire);
|
||||
}
|
||||
|
||||
// Expeditions
|
||||
@ -979,9 +979,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("sendings");
|
||||
$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings');
|
||||
if ($leftmenu=="sendings") $newmenu->add("/expedition/fiche.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer);
|
||||
if ($leftmenu=="sendings") $newmenu->add("/expedition/liste.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire);
|
||||
if ($leftmenu=="sendings") $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/fiche.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer);
|
||||
if (empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/liste.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1037,7 +1037,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
//if ($leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1141,13 +1141,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=3", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
//if ($leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
}
|
||||
|
||||
$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Exports"),0,$user->rights->adherent->export, '', $mainmenu, 'export');
|
||||
if (! empty($conf->export->enabled) && $leftmenu=="export") $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
|
||||
if ($leftmenu=="export") $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
|
||||
if ($leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
|
||||
if (! empty($conf->export->enabled) && (empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
|
||||
if (empty($leftmenu) || $leftmenu=="export") $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
|
||||
if (empty($leftmenu) || $leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
|
||||
|
||||
// Type
|
||||
$newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members",$langs->trans("MembersTypes"),0,$user->rights->adherent->configurer, '', $mainmenu, 'setup');
|
||||
|
||||
@ -136,32 +136,36 @@ class MenuManager
|
||||
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
print '<ul data-role="listview" data-inset="true">';
|
||||
print '<li>';
|
||||
print '<li data-role="list-divider">';
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
|
||||
print '<a href="#">'.$val['titre'].'</a>'."\n";
|
||||
|
||||
// Search submenu fot this entry
|
||||
$tmpmainmenu=$val['mainmenu'];
|
||||
$tmpleftmenu='all';
|
||||
$submenu=new Menu();
|
||||
$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$val['mainmenu'],$val['leftmenu']);
|
||||
$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
|
||||
$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
|
||||
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
|
||||
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>';
|
||||
if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home')
|
||||
{
|
||||
// We add sub entry
|
||||
print '<li><a href="'.$relurl.'">'.$langs->trans("MainArea").'-'.$val['titre'].'</a></li>'."\n";
|
||||
print '<li data-role="list-divider"><a href="'.$relurl.'">'.$langs->trans("MainArea").'-'.$val['titre'].'</a></li>'."\n";
|
||||
}
|
||||
var_dump($val['titre']);
|
||||
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
print '<li><a href="'.$relurl2.'">'.$val2['titre'].'</a></li>'."\n";
|
||||
//var_dump($val2);
|
||||
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'><a href="'.$relurl2.'">'.$val2['titre'].'</a></li>'."\n";
|
||||
}
|
||||
//var_dump($submenu);
|
||||
//var_dump($submenu);
|
||||
print '</ul>';
|
||||
}
|
||||
if ($val['enabled'] == 2)
|
||||
{
|
||||
@ -169,7 +173,6 @@ class MenuManager
|
||||
}
|
||||
print '</li>';
|
||||
print '</ul>'."\n";
|
||||
print 'wwwwwww';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||
@ -151,7 +152,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
'task_progress'=>$task->progress,
|
||||
'task_public'=>$task->public,
|
||||
'task_date_start'=>dol_print_date($task->date_start,'day'),
|
||||
'task_date_end'=>dol_print_date($task->date_end,'day')
|
||||
'task_date_end'=>dol_print_date($task->date_end,'day'),
|
||||
'task_note_private'=>$task->note_private,
|
||||
'task_note_public'=>$task->note_public
|
||||
);
|
||||
}
|
||||
|
||||
@ -218,6 +221,68 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
* @param array $taskressource Reference array
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @return array Return a substitution array
|
||||
*/
|
||||
function get_substitutionarray_tasksressource($taskressource,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
//dol_syslog(get_class($this).'::get_substitutionarray_tasksressource taskressource='.var_export($taskressource,true),LOG_DEBUG);
|
||||
return array(
|
||||
'taskressource_rowid'=>$taskressource['rowid'],
|
||||
'taskressource_role'=>$taskressource['libelle'],
|
||||
'taskressource_lastname'=>$taskressource['lastname'],
|
||||
'taskressource_firstname'=>$taskressource['firstname'],
|
||||
'taskressource_fullcivname'=>$taskressource['fullname'],
|
||||
'taskressource_socname'=>$taskressource['socname'],
|
||||
'taskressource_email'=>$taskressource['email']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
* @param object $tasktime times object
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @return array Return a substitution array
|
||||
*/
|
||||
function get_substitutionarray_taskstime($tasktime,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
return array(
|
||||
'tasktime_rowid'=>$tasktime['rowid'],
|
||||
'tasktime_task_date'=>dol_print_date($tasktime['task_date'],'day'),
|
||||
'tasktime_task_duration'=>convertSecondToTime($tasktime['task_duration'],'all'),
|
||||
'tasktime_note'=>$tasktime['note'],
|
||||
'tasktime_fk_user'=>$tasktime['fk_user'],
|
||||
'tasktime_user_name'=>$tasktime['name'],
|
||||
'tasktime_user_first'=>$tasktime['firstname'],
|
||||
'tasktime_fullcivname'=>$tasktime['fullcivname']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
* @param array $file file array
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @return array Return a substitution array
|
||||
*/
|
||||
function get_substitutionarray_task_file($file,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
return array(
|
||||
'tasksfile_name'=>$file['name'],
|
||||
'tasksfile_date'=>dol_print_date($file['date'],'day'),
|
||||
'tasksfile_size'=>$file['size']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -519,6 +584,134 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
$taskobj=new Task($this->db);
|
||||
$taskobj->fetch($task->id);
|
||||
|
||||
// Replace tags of lines for contacts task
|
||||
$sourcearray=array('internal','external');
|
||||
$contact_arrray=array();
|
||||
foreach ($sourcearray as $source) {
|
||||
$contact_temp=$taskobj->liste_contact(-1,$source);
|
||||
if ((is_array($contact_temp) && count($contact_temp) > 0))
|
||||
{
|
||||
$contact_arrray=array_merge($contact_arrray,$contact_temp);
|
||||
}
|
||||
}
|
||||
if ((is_array($contact_arrray) && count($contact_arrray) > 0))
|
||||
{
|
||||
$listlinestaskres = $listlines->__get('tasksressources');
|
||||
|
||||
foreach ($contact_arrray as $contact)
|
||||
{
|
||||
if ($contact['source']=='internal') {
|
||||
$objectdetail=new User($this->db);
|
||||
$objectdetail->fetch($contact['id']);
|
||||
$contact['socname']=$mysoc->name;
|
||||
} elseif ($contact['source']=='external') {
|
||||
$objectdetail=new Contact($this->db);
|
||||
$objectdetail->fetch($contact['id']);
|
||||
|
||||
$soc=new Societe($this->db);
|
||||
$soc->fetch($contact['socid']);
|
||||
$contact['socname']=$soc->name;
|
||||
}
|
||||
$contact['fullname']=$objectdetail->getFullName($outputlangs,1);
|
||||
|
||||
$tmparray=$this->get_substitutionarray_tasksressource($contact,$outputlangs);
|
||||
|
||||
foreach($tmparray as $key => $val)
|
||||
{
|
||||
try
|
||||
{
|
||||
$listlinestaskres->setVars($key, $val, true, 'UTF-8');
|
||||
}
|
||||
catch(OdfException $e)
|
||||
{
|
||||
}
|
||||
catch(SegmentException $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
$listlinestaskres->merge();
|
||||
}
|
||||
}
|
||||
|
||||
//Time ressources
|
||||
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
|
||||
$sql.= ", u.name, u.firstname";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE t.fk_task =".$task->id;
|
||||
$sql .= " AND t.fk_user = u.rowid";
|
||||
$sql .= " ORDER BY t.task_date DESC";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
$tasks = array();
|
||||
$listlinestasktime = $listlines->__get('taskstimes');
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $this->db->fetch_array($resql);
|
||||
if (!empty($row['fk_user'])) {
|
||||
$objectdetail=new User($this->db);
|
||||
$objectdetail->fetch($row['fk_user']);
|
||||
$row['fullcivname']=$objectdetail->getFullName($outputlangs,1);
|
||||
} else {
|
||||
$row['fullcivname']='';
|
||||
}
|
||||
|
||||
$tmparray=$this->get_substitutionarray_taskstime($row,$outputlangs);
|
||||
|
||||
foreach($tmparray as $key => $val)
|
||||
{
|
||||
try
|
||||
{
|
||||
$listlinestasktime->setVars($key, $val, true, 'UTF-8');
|
||||
}
|
||||
catch(OdfException $e)
|
||||
{
|
||||
}
|
||||
catch(SegmentException $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
$listlinestasktime->merge();
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
|
||||
|
||||
// Replace tags of project files
|
||||
$listtasksfiles = $listlines->__get('tasksfiles');
|
||||
|
||||
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref);
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$','name',SORT_ASC,1);
|
||||
|
||||
|
||||
foreach ($filearray as $filedetail)
|
||||
{
|
||||
$tmparray=$this->get_substitutionarray_task_file($filedetail,$outputlangs);
|
||||
//dol_syslog(get_class($this).'::main $tmparray'.var_export($tmparray,true));
|
||||
foreach($tmparray as $key => $val)
|
||||
{
|
||||
try
|
||||
{
|
||||
$listtasksfiles->setVars($key, $val, true, 'UTF-8');
|
||||
}
|
||||
catch(OdfException $e)
|
||||
{
|
||||
}
|
||||
catch(SegmentException $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
$listtasksfiles->merge();
|
||||
}
|
||||
$listlines->merge();
|
||||
}
|
||||
$odfHandler->mergeSegment($listlines);
|
||||
@ -541,7 +734,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
|
||||
foreach ($filearray as $filedetail)
|
||||
{
|
||||
//dol_syslog(get_class($this).'::ee $filedetail'.var_export($filedetail,true));
|
||||
//dol_syslog(get_class($this).'::main $filedetail'.var_export($filedetail,true));
|
||||
$tmparray=$this->get_substitutionarray_project_file($filedetail,$outputlangs);
|
||||
|
||||
foreach($tmparray as $key => $val)
|
||||
@ -766,7 +959,6 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
}
|
||||
|
||||
// Write new file
|
||||
//$result=$odfHandler->exportAsAttachedFile('toto');
|
||||
$odfHandler->saveToDisk($file);
|
||||
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
|
||||
@ -106,6 +106,12 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$texte.= '<input type="hidden" name="action" value="setModuleOptions">';
|
||||
$texte.= '<input type="hidden" name="param1" value="PROPALE_ADDON_PDF_ODT_PATH">';
|
||||
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0)
|
||||
{
|
||||
$texte.= '<input type="hidden" name="param2" value="PROPALE_ADDON_PDF_ODT_DEFAULT">';
|
||||
$texte.= '<input type="hidden" name="param3" value="PROPALE_ADDON_PDF_ODT_TOBILL">';
|
||||
$texte.= '<input type="hidden" name="param4" value="PROPALE_ADDON_PDF_ODT_CLOSED">';
|
||||
}
|
||||
$texte.= '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
// List of directories area
|
||||
@ -143,8 +149,38 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
$texte.= '</table>';
|
||||
|
||||
// Scan directories
|
||||
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
|
||||
if (count($listofdir))
|
||||
{
|
||||
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
|
||||
|
||||
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0)
|
||||
{
|
||||
// Model for creation
|
||||
$liste=ModelePDFPropales::liste_modeles($this->db);
|
||||
$texte.= '<table width="50%;">';
|
||||
$texte.= '<tr>';
|
||||
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelPropalCreate").'</td>';
|
||||
$texte.= '<td colspan="">';
|
||||
$texte.= $form->selectarray('value2',$liste,$conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT);
|
||||
$texte.= "</td></tr>";
|
||||
|
||||
$texte.= '<tr>';
|
||||
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelPropalToBill").'</td>';
|
||||
$texte.= '<td colspan="">';
|
||||
$texte.= $form->selectarray('value3',$liste,$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL);
|
||||
$texte.= "</td></tr>";
|
||||
$texte.= '<tr>';
|
||||
|
||||
$texte.= '<td width="60%;">'.$langs->trans("DefaultModelPropalClosed").'</td>';
|
||||
$texte.= '<td colspan="">';
|
||||
$texte.= $form->selectarray('value4',$liste,$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED);
|
||||
$texte.= "</td></tr>";
|
||||
$texte.= '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$texte.= '</td>';
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
htdocs/install/doctemplates/projects/template_project.odt
Executable file
BIN
htdocs/install/doctemplates/projects/template_project.odt
Executable file
Binary file not shown.
BIN
htdocs/install/doctemplates/projects/template_task_summary.odt
Executable file
BIN
htdocs/install/doctemplates/projects/template_task_summary.odt
Executable file
Binary file not shown.
@ -400,7 +400,7 @@ if (! $error && $db->connected && $action == "set")
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$srcroot=$main_dir.'/install/doctemplates';
|
||||
$destroot=$main_data_dir.'/doctemplates';
|
||||
$docs=array('thirdparties' => 'thirdparty', 'proposals' => 'proposal', 'orders' => 'order', 'invoices' => 'invoice', 'projects' => 'project');
|
||||
$docs=array('thirdparties' => 'thirdparty', 'proposals' => 'proposal', 'orders' => 'order', 'invoices' => 'invoice', 'projects' => 'project', 'projects' => 'task_summary');
|
||||
foreach($docs as $cursordir => $cursorfile)
|
||||
{
|
||||
$src=$srcroot.'/'.$cursordir.'/template_'.$cursorfile.'.odt';
|
||||
|
||||
@ -237,7 +237,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
|
||||
dolibarr_install_syslog('install/etape5.php Activate module file='.$file);
|
||||
$res=dol_include_once("/core/modules/".$file);
|
||||
|
||||
$res=Activate($modtoactivatenew,1);
|
||||
$res=activateModule($modtoactivatenew,1);
|
||||
if (! $result) print 'ERROR in activating module file='.$file;
|
||||
}
|
||||
}
|
||||
@ -421,4 +421,4 @@ clearstatcache();
|
||||
dolibarr_install_syslog("--- install/etape5.php Dolibarr setup finished", LOG_INFO);
|
||||
|
||||
pFooter(1,$setuplang);
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -22,12 +22,13 @@ create table llx_extrafields
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
name varchar(64) NOT NULL, -- nom de l'attribut
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
elementtype varchar(64) NOT NULL DEFAULT 'member',
|
||||
elementtype varchar(64) NOT NULL DEFAULT 'member',
|
||||
tms timestamp,
|
||||
label varchar(255) NOT NULL, -- label correspondant a l'attribut
|
||||
type varchar(8),
|
||||
size varchar(8) DEFAULT NULL,
|
||||
fieldunique integer DEFAULT 0,
|
||||
fieldrequired integer DEFAULT 0,
|
||||
pos integer DEFAULT 0
|
||||
pos integer DEFAULT 0,
|
||||
param text
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -96,3 +96,6 @@ TypeContact_propal_external_CUSTOMER=Customer contact following-up proposal
|
||||
# Document models
|
||||
DocModelAzurDescription=A complete proposal model (logo...)
|
||||
DocModelJauneDescription=Jaune proposal model
|
||||
DefaultModelPropalCreate=Default model creation
|
||||
DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced)
|
||||
DefaultModelPropalClosed=Default template when closing a business proposal (unbilled)
|
||||
|
||||
@ -97,4 +97,7 @@ TypeContact_propal_external_CUSTOMER=Contact client suivi propale
|
||||
DocModelAzurDescription=Modèle de propositions commerciales complet (logo...)
|
||||
DocModelJauneDescription=Modèle de proposition Jaune
|
||||
Numbershort=N°
|
||||
DefaultModelPropalCreate=Modèle par défaut à la création
|
||||
DefaultModelPropalToBill=Modèle par défaut lors de la cloture d'une proposition commerciale (à facturer)
|
||||
DefaultModelPropalClosed=Modèle par défaut lors de la cloture d'une proposition commerciale (non facturée)
|
||||
|
||||
|
||||
@ -76,8 +76,6 @@ dol_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), 0, '
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
@ -77,8 +77,6 @@ dol_fiche_head($head, 'attributes', $langs->trans("ThirdParties"), 0, 'company')
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
@ -2519,6 +2519,39 @@ div.dolEventError h1, div.dolEventError h2 {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* JMobile */
|
||||
/* ============================================================================== */
|
||||
|
||||
.ui-body-c .ui-link {
|
||||
color: #111 !important;
|
||||
}
|
||||
.ui-li-divider {
|
||||
background: #eee !important;
|
||||
}
|
||||
.ui-bar-b {
|
||||
border: 1px solid #ccc !important;
|
||||
background: #aaa !important;
|
||||
font-weight: bold !important;
|
||||
color: #444 !important;
|
||||
text-shadow: 0 1px 1px #fff !important;
|
||||
background-image: -webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#aaa)) !important;
|
||||
background-image: -webkit-linear-gradient(top,#fdfdfd,#aaa) !important;
|
||||
background-image: -moz-linear-gradient(top,#fdfdfd,#aaa) !important;
|
||||
background-image: -ms-linear-gradient(top,#fdfdfd,#aaa) !important;
|
||||
background-image: -o-linear-gradient(top,#fdfdfd,#aaa) !important;
|
||||
background-image: linear-gradient(top,#fdfdfd,#aaa) !important;
|
||||
}
|
||||
.ui-bar-b .ui-link {
|
||||
border: none;
|
||||
font-weight: bold !important;
|
||||
color: #444 !important;
|
||||
text-shadow: 0 1px 1px #fff !important;
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
if (is_object($db)) $db->close();
|
||||
?>
|
||||
|
||||
@ -76,8 +76,6 @@ dol_fiche_head($head, 'attributes', $langs->trans("User"), 0, 'user');
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user