Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop
This commit is contained in:
commit
cbddff42d3
@ -29,6 +29,9 @@ Files are saved int .gnupg directory
|
||||
[DEFAULT]
|
||||
pristine-tar = True
|
||||
|
||||
[buildpackage]
|
||||
ignore-branch = True
|
||||
|
||||
[git-buildpackage]
|
||||
sign-tags = True
|
||||
export-dir = ../build-area/
|
||||
|
||||
@ -95,3 +95,13 @@ JQUERYFILETREE:
|
||||
---------------
|
||||
* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
|
||||
|
||||
|
||||
|
||||
RESTLER:
|
||||
--------
|
||||
|
||||
if ($className == 'Luracast\Restler\string') return;
|
||||
if ($className == 'Luracast\Restler\mixed') return;
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -171,15 +171,20 @@ export list="
|
||||
--ignore-table=$base.llx_abonne_extrafields
|
||||
--ignore-table=$base.llx_abonne_type
|
||||
--ignore-table=$base.llx_abonnement
|
||||
--ignore-table=$base.llx_advanced_extrafields
|
||||
--ignore-table=$base.llx_advanced_extrafields_options
|
||||
--ignore-table=$base.llx_advanced_extrafields_values
|
||||
--ignore-table=$base.llx_bookkeeping
|
||||
--ignore-table=$base.llx_bootstrap
|
||||
--ignore-table=$base.llx_bt_namemap
|
||||
--ignore-table=$base.llx_bt_speedlimit
|
||||
--ignore-table=$base.llx_bt_summary
|
||||
--ignore-table=$base.llx_bt_timestamps
|
||||
--ignore-table=$base.llx_bt_webseedfiles
|
||||
--ignore-table=$base.llx_dolicloud_customers
|
||||
--ignore-table=$base.llx_dolicloud_stats
|
||||
--ignore-table=$base.llx_c_civilite
|
||||
--ignore-table=$base.llx_c_dolicloud_plans
|
||||
--ignore-table=$base.llx_c_lead_status
|
||||
--ignore-table=$base.llx_c_source
|
||||
--ignore-table=$base.llx_cabinetmed_c_banques
|
||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||
@ -191,16 +196,34 @@ export list="
|
||||
--ignore-table=$base.llx_cabinetmed_motifcons
|
||||
--ignore-table=$base.llx_cabinetmed_patient
|
||||
--ignore-table=$base.llx_cabinetmed_societe
|
||||
--ignore-table=$base.llx_dolicloud_customers
|
||||
--ignore-table=$base.llx_dolicloud_stats
|
||||
--ignore-table=$base.llx_dolicloud_emailstemplates
|
||||
--ignore-table=$base.llx_domain
|
||||
--ignore-table=$base.llx_element_rang
|
||||
--ignore-table=$base.llx_entity
|
||||
--ignore-table=$base.llx_filemanager_roots
|
||||
--ignore-table=$base.llx_fournisseur_ca
|
||||
--ignore-table=$base.llx_google_maps
|
||||
--ignore-table=$base.llx_monitoring_probes
|
||||
--ignore-table=$base.llx_notes
|
||||
--ignore-table=$base.llx_pos_cash
|
||||
--ignore-table=$base.llx_pos_control_cash
|
||||
--ignore-table=$base.llx_pos_facture
|
||||
--ignore-table=$base.llx_pos_moviments
|
||||
--ignore-table=$base.llx_pos_ticketdet
|
||||
--ignore-table=$base.llx_pos_paiement_ticket
|
||||
--ignore-table=$base.llx_pos_places
|
||||
--ignore-table=$base.llx_pos_ticket
|
||||
--ignore-table=$base.llx_printer_ipp
|
||||
--ignore-table=$base.llx_publi_c_contact_list
|
||||
--ignore-table=$base.llx_publi_c_dnd_list
|
||||
--ignore-table=$base.llx_publi_c_method_list
|
||||
--ignore-table=$base.llx_residence
|
||||
--ignore-table=$base.llx_residence_building
|
||||
--ignore-table=$base.llx_residence_building_links
|
||||
--ignore-table=$base.llx_ultimatepdf
|
||||
--ignore-table=$base.llx_update_modules
|
||||
--ignore-table=$base.llx_ventilation_achat
|
||||
"
|
||||
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
|
||||
|
||||
@ -335,7 +335,7 @@ $tabrowid[29]= "";
|
||||
|
||||
// Condition to show dictionary in setup page
|
||||
$tabcond=array();
|
||||
$tabcond[1] = true;
|
||||
$tabcond[1] = (! empty($conf->societe->enabled));
|
||||
$tabcond[2] = true;
|
||||
$tabcond[3] = true;
|
||||
$tabcond[4] = true;
|
||||
@ -345,7 +345,7 @@ $tabcond[7] = ! empty($conf->tax->enabled);
|
||||
$tabcond[8] = ! empty($conf->societe->enabled);
|
||||
$tabcond[9] = true;
|
||||
$tabcond[10]= true;
|
||||
$tabcond[11]= true;
|
||||
$tabcond[11]= (! empty($conf->societe->enabled));
|
||||
$tabcond[12]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled));
|
||||
$tabcond[13]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled));
|
||||
$tabcond[14]= (! empty($conf->product->enabled) && ! empty($conf->ecotax->enabled));
|
||||
|
||||
@ -147,7 +147,7 @@ if ($action == 'add')
|
||||
}
|
||||
if (! $error && ! $_POST['url'])
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Url")), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("URL")), null, 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ if ($action == 'addprinter' && $user->admin)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), $parameter);
|
||||
$result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
@ -132,7 +132,7 @@ if ($action == 'updateprinter' && $user->admin)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), $parameter, $printerid);
|
||||
$result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
|
||||
if ($result > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
@ -235,6 +235,7 @@ if ($mode == 'config' && $user->admin)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Name").'</th>';
|
||||
print '<th>'.$langs->trans("Type").'</th>';
|
||||
print '<th>'.$langs->trans("Profile").'</th>';
|
||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
||||
print '<th></th>';
|
||||
print '<th></th>';
|
||||
@ -252,6 +253,8 @@ if ($mode == 'config' && $user->admin)
|
||||
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
|
||||
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
|
||||
print '<td>'.$printer->resprint.'</td>';
|
||||
$ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
|
||||
print '<td>'.$printer->profileresprint.'</td>';
|
||||
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
@ -259,27 +262,8 @@ if ($mode == 'config' && $user->admin)
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<td>'.$printer->listprinters[$line]['name'].'</td>';
|
||||
switch ($printer->listprinters[$line]['fk_type']) {
|
||||
case 1:
|
||||
$connector = 'CONNECTOR_DUMMY';
|
||||
break;
|
||||
case 2:
|
||||
$connector = 'CONNECTOR_FILE_PRINT';
|
||||
break;
|
||||
case 3:
|
||||
$connector = 'CONNECTOR_NETWORK_PRINT';
|
||||
break;
|
||||
case 4:
|
||||
$connector = 'CONNECTOR_WINDOWS_PRINT';
|
||||
break;
|
||||
case 5:
|
||||
$connector = 'CONNECTOR_JAVA';
|
||||
break;
|
||||
default:
|
||||
$connector = 'CONNECTOR_UNKNOWN';
|
||||
break;
|
||||
}
|
||||
print '<td>'.$langs->trans($connector).'</td>';
|
||||
print '<td>'.$langs->trans($printer->listprinters[$line]['fk_type_name']).'</td>';
|
||||
print '<td>'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).'</td>';
|
||||
print '<td>'.$printer->listprinters[$line]['parameter'].'</td>';
|
||||
// edit icon
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?mode=config&action=editprinter&printerid='.$printer->listprinters[$line]['rowid'].'">';
|
||||
@ -302,6 +286,7 @@ if ($mode == 'config' && $user->admin)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Name").'</th>';
|
||||
print '<th>'.$langs->trans("Type").'</th>';
|
||||
print '<th>'.$langs->trans("Profile").'</th>';
|
||||
print '<th>'.$langs->trans("Parameters").'</th>';
|
||||
print '<th></th>';
|
||||
print '<th></th>';
|
||||
@ -311,6 +296,8 @@ if ($mode == 'config' && $user->admin)
|
||||
print '<td><input size="50" type="text" name="printername"></td>';
|
||||
$ret = $printer->selectTypePrinter();
|
||||
print '<td>'.$printer->resprint.'</td>';
|
||||
$ret = $printer->selectProfilePrinter();
|
||||
print '<td>'.$printer->profileresprint.'</td>';
|
||||
print '<td><input size="60" type="text" name="parameter"></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
@ -329,13 +316,24 @@ if ($mode == 'config' && $user->admin)
|
||||
|
||||
print '<div><p></div>';
|
||||
dol_fiche_head();
|
||||
print $langs->trans("ReceiptPrinterTypeDesc")."<br><br>\n";
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
$var=true;
|
||||
print '<tr><td>'.$langs->trans("CONNECTOR_DUMMY").':</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
|
||||
print '<td>'.$langs->trans("CONNECTOR_NETWORK_PRINT").':</td><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'</td></tr>';
|
||||
print '<td>'.$langs->trans("CONNECTOR_FILE_PRINT").':</td><td>'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'</td></tr>';
|
||||
print '<td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT").':</td><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT_HELP").'</td></tr>';
|
||||
//print '<td>'.$langs->trans("CONNECTOR_JAVA").':</td><td>'.$langs->trans("CONNECTOR_JAVA_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("CONNECTOR_DUMMY").':</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT").':</td><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("CONNECTOR_FILE_PRINT").':</td><td>'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT").':</td><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT_HELP").'</td></tr>';
|
||||
//print '<tr '.$bc[1].'><td>'.$langs->trans("CONNECTOR_JAVA").':</td><td>'.$langs->trans("CONNECTOR_JAVA_HELP").'</td></tr>';
|
||||
print '</table>';
|
||||
dol_fiche_end();
|
||||
print '<div><p></div>';
|
||||
dol_fiche_head();
|
||||
print $langs->trans("ReceiptPrinterProfileDesc")."<br><br>\n";
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("PROFILE_DEFAULT").':</td><td>'.$langs->trans("PROFILE_DEFAULT_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("PROFILE_SIMPLE").':</td><td>'.$langs->trans("PROFILE_SIMPLE_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("PROFILE_EPOSTEP").':</td><td>'.$langs->trans("PROFILE_EPOSTEP_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("PROFILE_P822D").':</td><td>'.$langs->trans("PROFILE_P822D_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("PROFILE_STAR").':</td><td>'.$langs->trans("PROFILE_STAR_HELP").'</td></tr>';
|
||||
print '</table>';
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
@ -1,24 +1,33 @@
|
||||
API howto
|
||||
=========
|
||||
API REST howto
|
||||
==============
|
||||
|
||||
This directory contains files to make Dolibarr a server of REST Web Services.
|
||||
It depends on external library Restler.
|
||||
|
||||
|
||||
Explore the api
|
||||
---------------
|
||||
|
||||
You can explore API method by using web interface : https://**yourdolibarr.tld**/htdocs/public/api/explorer/index.html (replace **yourdolibarr.tld** by real hostname of your Dolibarr installation)
|
||||
You can explore API method by using web interface : https://**yourdolibarr.tld**/mydolibarr/api/admin/explorer.php (replace **yourdolibarr.tld** by real hostname of your Dolibarr installation)
|
||||
|
||||
Access to the API
|
||||
---------------
|
||||
-----------------
|
||||
|
||||
> **Warning : access to the API should (or better : must!) be secured with SSL connection**
|
||||
|
||||
To access to the API you need a token to identify. When you access the API for the first time, you need to log in with user name and password to get a token. **Only** this token will allow to access API with.
|
||||
|
||||
To log in with the API, use this uri : https://**yourdolibarr.tld**/htdocs/public/api/login?login=**username**&password=**password** (replace bold strings with real values)
|
||||
To log in with the API, use this uri : https://**yourdolibarr.tld**/mydolibarr/api/index.php/login?login=**username**&password=**password** (replace bold strings with real values)
|
||||
|
||||
The token will be saved by Dolibarr for next user accesses to the API and it **must** be put into request uri as **api_key** parameter.
|
||||
|
||||
Then call other services with
|
||||
|
||||
https://**yourdolibarr.tld**/mydolibarr/api/index.php/otherservice?api_key=**api_key**
|
||||
|
||||
|
||||
Develop the API
|
||||
--------------
|
||||
---------------
|
||||
|
||||
The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples http://help.luracast.com/restler/examples/
|
||||
Github contains also usefull informations : https://github.com/Luracast/Restler
|
||||
|
||||
@ -25,22 +25,22 @@
|
||||
*
|
||||
*
|
||||
*/
|
||||
if (! defined("NOLOGIN")) define("NOLOGIN",'1');
|
||||
|
||||
$res=0;
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=include '../../main.inc.php';
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/api/restler.php';
|
||||
require_once '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/api/class/api_access.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
// Enable and test if module Api is enabled
|
||||
if (empty($conf->global->MAIN_MODULE_API))
|
||||
{
|
||||
$langs->load("admin");
|
||||
dol_syslog("Call Dolibarr API interfaces with module disabled");
|
||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||
print $langs->trans("WarningModuleNotActive",'Api').'.<br><br>';
|
||||
print $langs->trans("ToActivateModule");
|
||||
exit;
|
||||
@ -55,6 +55,8 @@ $api->r->addAPIClass('DolibarrApiInit',''); // Just for url root page
|
||||
$api->r->setSupportedFormats('JsonFormat', 'XmlFormat');
|
||||
$api->r->addAuthenticationClass('DolibarrApiAccess','');
|
||||
|
||||
$listofapis = array();
|
||||
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
@ -116,6 +118,17 @@ foreach ($modulesdir as $dir)
|
||||
{
|
||||
dol_syslog("Found API classname=".$classname);
|
||||
$api->r->addAPIClass($classname,'');
|
||||
|
||||
/*
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Routes.php';
|
||||
$tmpclass = new ReflectionClass($classname);
|
||||
try {
|
||||
$classMetadata = CommentParser::parse($tmpclass->getDocComment());
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(500, "Error while parsing comments of `$classname` class. " . $e->getMessage());
|
||||
}*/
|
||||
|
||||
//$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -126,4 +139,27 @@ foreach ($modulesdir as $dir)
|
||||
}
|
||||
}
|
||||
|
||||
$api->r->handle(); //serve the response
|
||||
|
||||
$listofapis=Routes::toArray();
|
||||
//var_dump($listofapis);
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup');
|
||||
|
||||
|
||||
foreach($listofapis['v1'] as $key => $val)
|
||||
{
|
||||
if ($key)
|
||||
{
|
||||
//print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx<br>\n";
|
||||
$url=DOL_MAIN_URL_ROOT.'/api/index.php/'.$key;
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/api/admin/api.php
|
||||
* \file htdocs/api/admin/index.php
|
||||
* \ingroup api
|
||||
* \brief Page to setup api module
|
||||
* \brief Page to setup Webservices REST module
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -95,18 +95,19 @@ print '</tr>';
|
||||
print '</table>';
|
||||
print '<br><br>';
|
||||
|
||||
// API endpoint
|
||||
print '<u>'.$langs->trans("ApiEndPointIs").':</u><br>';
|
||||
$url=DOL_MAIN_URL_ROOT.'/public/api/';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
$url=DOL_MAIN_URL_ROOT.'/public/api/.json';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
|
||||
// Explorer
|
||||
print '<u>'.$langs->trans("ApiExporerIs").':</u><br>';
|
||||
$url=DOL_MAIN_URL_ROOT.'/public/api/explorer/index.html';
|
||||
$url=DOL_MAIN_URL_ROOT.'/api/admin/explorer.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
|
||||
// API endpoint
|
||||
/*print '<u>'.$langs->trans("ApiEndPointIs").':</u><br>';
|
||||
$url=DOL_MAIN_URL_ROOT.'/api/index.php/xxx/list';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
$url=DOL_MAIN_URL_ROOT.'/api/xxx/list.json';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules.php');
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
use Luracast\Restler\Restler;
|
||||
use Luracast\Restler\RestException;
|
||||
use Luracast\Restler\Defaults;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
|
||||
@ -40,10 +41,16 @@ class DolibarrApi
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDb $db Database handler
|
||||
* @param DoliDb $db Database handler
|
||||
* @param string $cachedir Cache dir
|
||||
*/
|
||||
function __construct($db) {
|
||||
function __construct($db, $cachedir='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($cachedir)) $cachedir = $conf->api->dir_temp;
|
||||
Defaults::$cacheDirectory = $cachedir;
|
||||
|
||||
$this->db = $db;
|
||||
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
||||
$this->r = new Restler($production_mode);
|
||||
@ -84,7 +91,7 @@ class DolibarrApi
|
||||
// If object has lines, remove $db property
|
||||
if(isset($object->lines) && count($object->lines) > 0) {
|
||||
$nboflines = count($object->lines);
|
||||
for ($i=0; $i < $nbofline; $i++)
|
||||
for ($i=0; $i < $nboflines; $i++)
|
||||
{
|
||||
$this->_cleanObjectDatas($object->lines[$i]);
|
||||
}
|
||||
|
||||
@ -15,7 +15,21 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Create the autoloader for Luracast
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
|
||||
call_user_func(function () {
|
||||
$loader = Luracast\Restler\AutoLoader::instance();
|
||||
spl_autoload_register($loader);
|
||||
return $loader;
|
||||
});
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/iAuthenticate.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/iUseAuthentication.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Resources.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Defaults.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/RestException.php';
|
||||
use \Luracast\Restler\iAuthenticate;
|
||||
use \Luracast\Restler\iUseAuthentication;
|
||||
use \Luracast\Restler\Resources;
|
||||
use \Luracast\Restler\Defaults;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
@ -1,8 +1,148 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (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/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup api Module DolibarrApi
|
||||
* \brief API loader
|
||||
* Search files htdocs/<module>/class/api_<module>.class.php
|
||||
* \file htdocs/api/indexphp
|
||||
*
|
||||
* @todo User authentication with api_key
|
||||
*
|
||||
*
|
||||
*/
|
||||
if (! defined("NOLOGIN")) define("NOLOGIN",'1');
|
||||
|
||||
$res=0;
|
||||
if (! $res && file_exists("../main.inc.php")) $res=include '../main.inc.php';
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
|
||||
|
||||
call_user_func(function () {
|
||||
$loader = Luracast\Restler\AutoLoader::instance();
|
||||
spl_autoload_register($loader);
|
||||
return $loader;
|
||||
});
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/api/class/api_access.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
||||
|
||||
// Enable and test if module Api is enabled
|
||||
if (empty($conf->global->MAIN_MODULE_API))
|
||||
{
|
||||
$langs->load("admin");
|
||||
dol_syslog("Call Dolibarr API interfaces with module REST disabled");
|
||||
print $langs->trans("WarningModuleNotActive",'Api').'.<br><br>';
|
||||
print $langs->trans("ToActivateModule");
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Luracast\Restler\Defaults;
|
||||
|
||||
$api = new DolibarrApi($db);
|
||||
|
||||
$api->r->addAPIClass('Luracast\\Restler\\Resources'); //this creates resources.json at API Root
|
||||
$api->r->addAPIClass('DolibarrApiInit',''); // Just for url root page
|
||||
$api->r->setSupportedFormats('JsonFormat', 'XmlFormat');
|
||||
$api->r->addAuthenticationClass('DolibarrApiAccess','');
|
||||
|
||||
$listofapis = array();
|
||||
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
/*
|
||||
* Search available module
|
||||
*/
|
||||
dol_syslog("Scan directory ".$dir." for API modules");
|
||||
|
||||
$handle=@opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_readable($dir.$file) && preg_match("/^(mod.*)\.class\.php$/i",$file,$reg))
|
||||
{
|
||||
$modulename=$reg[1];
|
||||
|
||||
// Defined if module is enabled
|
||||
$enabled=true;
|
||||
$module=$part=$obj=strtolower(preg_replace('/^mod/i','',$modulename));
|
||||
//if ($part == 'propale') $part='propal';
|
||||
if ($module == 'societe') {
|
||||
$obj = 'thirdparty';
|
||||
}
|
||||
if ($module == 'categorie') {
|
||||
$part = 'categories';
|
||||
$obj = 'category';
|
||||
}
|
||||
if ($module == 'facture') {
|
||||
$part = 'compta/facture';
|
||||
$obj = 'facture';
|
||||
}
|
||||
if (empty($conf->$module->enabled)) $enabled=false;
|
||||
|
||||
if ($enabled)
|
||||
{
|
||||
/*
|
||||
* If exists, load the API class for enable module
|
||||
*
|
||||
* Search files named api_<object>.class.php into /htdocs/<module>/class directory
|
||||
*
|
||||
* @todo : take care of externals module!
|
||||
* @todo : use getElementProperties() function ?
|
||||
*/
|
||||
$dir_part = DOL_DOCUMENT_ROOT.'/'.$part.'/class/';
|
||||
|
||||
$handle_part=@opendir(dol_osencode($dir_part));
|
||||
if (is_resource($handle_part))
|
||||
{
|
||||
while (($file_searched = readdir($handle_part))!==false)
|
||||
{
|
||||
if (is_readable($dir_part.$file_searched) && preg_match("/^(api_.*)\.class\.php$/i",$file_searched,$reg))
|
||||
{
|
||||
$classname=$reg[1];
|
||||
$classname = str_replace('Api_','',ucwords($reg[1])).'Api';
|
||||
$classname = ucfirst($classname);
|
||||
require_once $dir_part.$file_searched;
|
||||
if (class_exists($classname))
|
||||
{
|
||||
dol_syslog("Found API classname=".$classname);
|
||||
$api->r->addAPIClass($classname,'');
|
||||
$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO If not found, redirect to explorer
|
||||
|
||||
$api->r->handle();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
// use the restler auto loader
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
|
||||
return call_user_func(function () {
|
||||
$loader = Luracast\Restler\AutoLoader::instance();
|
||||
spl_autoload_register($loader);
|
||||
return $loader;
|
||||
});
|
||||
@ -719,8 +719,15 @@ if ($action == 'create')
|
||||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||
}
|
||||
}
|
||||
print '<div class="assignedtouser">';
|
||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||
if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
|
||||
print '</div>';
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
print '<div class="myavailability">';
|
||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
|
||||
print '</div>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
@ -1052,8 +1059,16 @@ if ($id > 0)
|
||||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||
}
|
||||
}
|
||||
|
||||
print '<div class="assignedtouser">';
|
||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||
if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
||||
print '</div>';
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
print '<div class="myavailability">';
|
||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
||||
print '</div>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
@ -1231,8 +1246,15 @@ if ($id > 0)
|
||||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||
}
|
||||
}
|
||||
print '<div class="assignedtouser">';
|
||||
print $form->select_dolusers_forevent('view','assignedtouser',1);
|
||||
if (in_array($user->id,array_keys($listofuserid))) 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 '</div>';
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
print '<div class="myavailability">';
|
||||
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 '</div>';
|
||||
}
|
||||
print ' </td></tr>';
|
||||
|
||||
// Done by
|
||||
|
||||
@ -195,8 +195,15 @@ if ($object->id > 0)
|
||||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||
}
|
||||
}
|
||||
print '<div class="assignedtouser">';
|
||||
print $form->select_dolusers_forevent('view','assignedtouser',1);
|
||||
if (in_array($user->id,array_keys($listofuserid))) 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 '</div>';
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
print '<div class="myavailability">';
|
||||
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 '</div>';
|
||||
}
|
||||
print ' </td></tr>';
|
||||
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
@ -485,13 +485,14 @@ if ($object->fetch($id) >= 0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$m=new Adherent($db);
|
||||
$m->id=$obj->source_id;
|
||||
$m->fetch($obj->source_id);
|
||||
print $m->getNomUrl(2);
|
||||
}
|
||||
else if ($obj->source_type == 'user')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
$m=new User($db);
|
||||
$m->fetch($obj->source_id);
|
||||
$m->id=$obj->source_id;
|
||||
print $m->getNomUrl(2);
|
||||
}
|
||||
@ -499,7 +500,7 @@ if ($object->fetch($id) >= 0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$m=new Societe($db);
|
||||
$m->id=$obj->source_id;
|
||||
$m->fetch($obj->source_id);
|
||||
print $m->getNomUrl(2);
|
||||
}
|
||||
else
|
||||
|
||||
@ -1134,7 +1134,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PROPAL_CLONE',$user);
|
||||
$result=$clonedObj->call_trigger('PROPAL_CLONE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -179,6 +180,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
$object->origin_id = $orders_id[$ii];
|
||||
$object->linked_objects = $orders_id;
|
||||
$id = $object->create($user);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if ($id>0)
|
||||
{
|
||||
|
||||
@ -116,7 +116,7 @@ if (empty($reshook))
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -267,7 +267,7 @@ if (empty($reshook))
|
||||
|
||||
$id = $object->create($user);
|
||||
if ($id < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($id > 0)
|
||||
@ -364,13 +364,13 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($srcobject->error,'errors');
|
||||
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -383,7 +383,7 @@ if (empty($reshook))
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
$action='create';
|
||||
}
|
||||
@ -612,7 +612,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -676,13 +676,13 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($objectline->error,'errors');
|
||||
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($objectline->error,'errors');
|
||||
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -697,7 +697,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -722,7 +722,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -741,7 +741,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -768,7 +768,7 @@ if (empty($reshook))
|
||||
|
||||
if ($error) {
|
||||
$action = 'edit_extras';
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
elseif ($action=='setref_supplier')
|
||||
@ -778,12 +778,12 @@ if (empty($reshook))
|
||||
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
$result = $object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'editref_supplier';
|
||||
} else {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
@ -803,12 +803,12 @@ if (empty($reshook))
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
$result = $object->setValueFrom('ref_customer',GETPOST('ref_customer','alpha'));
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'editref_customer';
|
||||
} else {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
@ -827,12 +827,12 @@ if (empty($reshook))
|
||||
if (!$cancelbutton) {
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
$result = $object->setValueFrom('ref',GETPOST('ref','alpha'));;
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'editref';
|
||||
} else {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
|
||||
@ -876,8 +876,8 @@ if (empty($reshook))
|
||||
$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 ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -898,11 +898,11 @@ if (empty($reshook))
|
||||
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"),'errors');
|
||||
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -924,7 +924,7 @@ if (empty($reshook))
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ if ($action == 'addcontact' && $user->rights->contrat->creer)
|
||||
$mesg = $object->error;
|
||||
}
|
||||
|
||||
setEventMessage($mesg, 'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ if ($action == 'remove_file' && $permissioncreate)
|
||||
$filetodelete=GETPOST('file','alpha');
|
||||
$file = $upload_dir . '/' . $filetodelete;
|
||||
$ret=dol_delete_file($file,0,0,0,$object);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", $filetodelete));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", $filetodelete), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", $filetodelete), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", $filetodelete), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ if ($action == 'add')
|
||||
);
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessage($langs->trans('SetupSaved'));
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -173,7 +173,7 @@ if ($action == 'add')
|
||||
{
|
||||
$error++;
|
||||
$mesg=$extrafields->error;
|
||||
setEventMessage($mesg,'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -181,13 +181,13 @@ if ($action == 'add')
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters",$langs->transnoentities("AttributeCode"));
|
||||
setEventMessage($mesg,'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($mesg,'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -315,7 +315,7 @@ if ($action == 'update')
|
||||
);
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessage($langs->trans('SetupSaved'));
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -323,7 +323,7 @@ if ($action == 'update')
|
||||
{
|
||||
$error++;
|
||||
$mesg=$extrafields->error;
|
||||
setEventMessage($mesg,'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -331,12 +331,12 @@ if ($action == 'update')
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
setEventMessage($mesg,'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($mesg,'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ if(! empty($_POST['removAll']))
|
||||
$result = dol_delete_file($pathtodelete,1); // Delete uploded Files
|
||||
|
||||
$langs->load("other");
|
||||
setEventMessage($langs->trans("FileWasRemoved",$filetodelete));
|
||||
setEventMessages($langs->trans("FileWasRemoved",$filetodelete), null, 'mesgs');
|
||||
|
||||
$formmail->remove_attached_files($key); // Update Session
|
||||
}
|
||||
@ -119,14 +119,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$possibleuser=$dolimail->get_from_user_by_mail($_POST['sendto'],"1"); // suche in llx_societe and socpeople
|
||||
if (!$possibleaccounts && !$possibleuser)
|
||||
{
|
||||
setEventMessage($langs->trans('ErrorFailedToFindSocieteRecord',$_POST['sendto']),'errors');
|
||||
setEventMessages($langs->trans('ErrorFailedToFindSocieteRecord',$_POST['sendto']), null, 'errors');
|
||||
}
|
||||
elseif (count($possibleaccounts)>1)
|
||||
{
|
||||
$sendtosocid=$possibleaccounts[1]['id'];
|
||||
$result=$object->fetch($sendtosocid);
|
||||
|
||||
setEventMessage($langs->trans('ErrorFoundMoreThanOneRecordWithEmail',$_POST['sendto'],$object->name));
|
||||
setEventMessages($langs->trans('ErrorFoundMoreThanOneRecordWithEmail',$_POST['sendto'],$object->name), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -251,7 +251,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
{
|
||||
$info = FALSE;
|
||||
$err = $langs->trans('Error3_Imap_Connection_Error');
|
||||
setEventMessage($err,$mailboxconfig->element,'errors');
|
||||
setEventMessages($err,$mailboxconfig->element, null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -291,12 +291,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
{
|
||||
// write mail to IMAP Server
|
||||
$movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile);
|
||||
if ($movemail) setEventMessage($langs->trans("MailMovedToImapFolder",$folder),'mesgs');
|
||||
else setEventMessage($langs->trans("MailMovedToImapFolder_Warning",$folder),'warnings');
|
||||
if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisation donnees
|
||||
// Initialisation of datas
|
||||
$object->socid = $sendtosocid; // To link to a company
|
||||
$object->sendtoid = $sendtoid; // To link to a contact/address
|
||||
$object->actiontypecode = $actiontypecode;
|
||||
@ -305,14 +305,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$object->fk_element = $object->id;
|
||||
$object->elementtype = $object->element;
|
||||
|
||||
// Appel des triggers
|
||||
// Call of triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
// End call of triggers
|
||||
|
||||
if ($error)
|
||||
{
|
||||
@ -323,7 +323,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
// Redirect here
|
||||
// This avoid sending mail twice if going out and then back to page
|
||||
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
|
||||
setEventMessage($mesg);
|
||||
setEventMessages($mesg, null, 'mesgs');
|
||||
if($conf->dolimail->enabled) header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id.'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
|
||||
else header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id);
|
||||
exit;
|
||||
@ -344,7 +344,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
}
|
||||
$mesg.='</div>';
|
||||
|
||||
setEventMessage($mesg,'warnings');
|
||||
setEventMessages($mesg, null, 'warnings');
|
||||
$action = 'presend';
|
||||
}
|
||||
}
|
||||
@ -359,7 +359,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")),'warnings');
|
||||
setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")), null, 'warnings');
|
||||
dol_syslog('Try to send email with no recipiend defined', LOG_WARNING);
|
||||
$action = 'presend';
|
||||
}
|
||||
@ -367,7 +367,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
else
|
||||
{
|
||||
$langs->load("other");
|
||||
setEventMessage($langs->trans('ErrorFailedToReadEntity',$object->element),'errors');
|
||||
setEventMessages($langs->trans('ErrorFailedToReadEntity',$object->element), null, 'errors');
|
||||
dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element);
|
||||
$action = 'presend';
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
|
||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) setEventMessage($object->error,'errors');
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
// Set public note
|
||||
else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel'))
|
||||
@ -41,5 +41,5 @@ else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('
|
||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) setEventMessage($object->error,'errors');
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ class box_project extends ModeleBoxes
|
||||
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
|
||||
$sql.=" WHERE p.entity = ".$conf->entity;
|
||||
|
||||
$sql.=" AND p.rowid = ".$objp->rowid;
|
||||
$resultTask = $db->query($sql);
|
||||
if ($resultTask) {
|
||||
$objTask = $db->fetch_object($resultTask);
|
||||
|
||||
@ -4221,7 +4221,7 @@ abstract class CommonObject
|
||||
$result = $product->fetch($fk_product);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$this->error='ErrorProductIdDoesNotExists';
|
||||
$this->errors[] = 'ErrorProductIdDoesNotExists';
|
||||
return -1;
|
||||
}
|
||||
if (($product->pmp > 0))
|
||||
@ -4238,10 +4238,10 @@ abstract class CommonObject
|
||||
{
|
||||
$buyPrice = $productFournisseur->fourn_price;
|
||||
}
|
||||
else
|
||||
else if ($result < 0)
|
||||
{
|
||||
$this->error = $productFournisseur->error;
|
||||
return -1;
|
||||
$this->errors[] = $productFournisseur->error;
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,8 +74,8 @@
|
||||
* <dol_print_customer_skype> Print customer skype
|
||||
* <dol_print_customer_tax_number> Print customer VAT number
|
||||
* <dol_print_customer_account_balance> Print customer account balance
|
||||
* <dol_print_vendor_last_name> Print vendor name
|
||||
* <dol_print_vendor_first_name> Print vendor firstname
|
||||
* <dol_print_vendor_lastname> Print vendor name
|
||||
* <dol_print_vendor_firstname> Print vendor firstname
|
||||
* <dol_print_vendor_mail> Print vendor mail
|
||||
* <dol_print_customer_points> Print customer points
|
||||
* <dol_print_order_points> Print number of points for this order
|
||||
@ -204,14 +204,52 @@ class dolReceiptPrinter extends Escpos
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$line = 0;
|
||||
$sql = 'SELECT rowid, name, fk_type, parameter';
|
||||
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
$sql.= ' WHERE entity = '.$conf->entity;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
while ($line < $num) {
|
||||
$obj[] = $this->db->fetch_array($resql);
|
||||
$row = $this->db->fetch_array($resql);
|
||||
switch ($row['fk_type']) {
|
||||
case 1:
|
||||
$row['fk_type_name'] = 'CONNECTOR_DUMMY';
|
||||
break;
|
||||
case 2:
|
||||
$row['fk_type_name'] = 'CONNECTOR_FILE_PRINT';
|
||||
break;
|
||||
case 3:
|
||||
$row['fk_type_name'] = 'CONNECTOR_NETWORK_PRINT';
|
||||
break;
|
||||
case 4:
|
||||
$row['fk_type_name'] = 'CONNECTOR_WINDOWS_PRINT';
|
||||
break;
|
||||
case 5:
|
||||
$row['fk_type_name'] = 'CONNECTOR_JAVA';
|
||||
break;
|
||||
default:
|
||||
$row['fk_type_name'] = 'CONNECTOR_UNKNOWN';
|
||||
break;
|
||||
}
|
||||
switch ($row['fk_profile']) {
|
||||
case 0:
|
||||
$row['fk_profile_name'] = 'PROFILE_DEFAULT';
|
||||
break;
|
||||
case 1:
|
||||
$row['fk_profile_name'] = 'PROFILE_SIMPLE';
|
||||
break;
|
||||
case 2:
|
||||
$row['fk_profile_name'] = 'PROFILE_EPOSTEP';
|
||||
break;
|
||||
case 3:
|
||||
$row['fk_profile_name'] = 'PROFILE_P822D';
|
||||
break;
|
||||
default:
|
||||
$row['fk_profile_name'] = 'PROFILE_STAR';
|
||||
break;
|
||||
}
|
||||
$obj[] = $row;
|
||||
$line++;
|
||||
}
|
||||
} else {
|
||||
@ -275,21 +313,47 @@ class dolReceiptPrinter extends Escpos
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Form to Select Profile printer
|
||||
*
|
||||
* @param string $selected Id printer profile pre-selected
|
||||
* @param string $htmlname select html name
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
function selectProfilePrinter($selected='', $htmlname='printerprofileid')
|
||||
{
|
||||
global $langs;
|
||||
$error = 0;
|
||||
$html = '<select class="flat" name="'.$htmlname.'">';
|
||||
$html.= '<option value="0" '.($selected==0?'selected="selected"':'').'>'.$langs->trans('PROFILE_DEFAULT').'</option>';
|
||||
$html.= '<option value="1" '.($selected==1?'selected="selected"':'').'>'.$langs->trans('PROFILE_SIMPLE').'</option>';
|
||||
$html.= '<option value="2" '.($selected==2?'selected="selected"':'').'>'.$langs->trans('PROFILE_EPOSTEP').'</option>';
|
||||
$html.= '<option value="3" '.($selected==3?'selected="selected"':'').'>'.$langs->trans('PROFILE_P822D').'</option>';
|
||||
$html.= '<option value="4" '.($selected==4?'selected="selected"':'').'>'.$langs->trans('PROFILE_STAR').'</option>';
|
||||
$html.= '</select>';
|
||||
|
||||
$this->profileresprint = $html;
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to Add a printer in db
|
||||
*
|
||||
* @param string $name Printer name
|
||||
* @param int $type Printer type
|
||||
* @param int $profile Printer profile
|
||||
* @param string $parameter Printer parameter
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
function AddPrinter($name, $type, $parameter)
|
||||
function AddPrinter($name, $type, $profile, $parameter)
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
$sql.= ' (name, fk_type, parameter, entity)';
|
||||
$sql.= ' VALUES ("'.$this->db->escape($name).'", '.$type.', "'.$this->db->escape($parameter).'", '.$conf->entity.')';
|
||||
$sql.= ' (name, fk_type, fk_profile, parameter, entity)';
|
||||
$sql.= ' VALUES ("'.$this->db->escape($name).'", '.$type.', '.$profile.', "'.$this->db->escape($parameter).'", '.$conf->entity.')';
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) {
|
||||
$error++;
|
||||
@ -303,17 +367,19 @@ class dolReceiptPrinter extends Escpos
|
||||
*
|
||||
* @param string $name Printer name
|
||||
* @param int $type Printer type
|
||||
* @param int $profile Printer profile
|
||||
* @param string $parameter Printer parameter
|
||||
* @param int $printerid Printer id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
*/
|
||||
function UpdatePrinter($name, $type, $parameter, $printerid)
|
||||
function UpdatePrinter($name, $type, $profile, $parameter, $printerid)
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
$sql.= ' SET name="'.$this->db->escape($name).'"';
|
||||
$sql.= ', fk_type='.$type;
|
||||
$sql.= ', fk_profile='.$profile;
|
||||
$sql.= ', parameter="'.$this->db->escape($parameter).'"';
|
||||
$sql.= ' WHERE rowid='.$printerid;
|
||||
$resql = $this->db->query($sql);
|
||||
@ -427,9 +493,20 @@ class dolReceiptPrinter extends Escpos
|
||||
$this->template = str_replace('<dol_print_customer_skype>', $object->customer_skype, $this->template);
|
||||
$this->template = str_replace('<dol_print_customer_tax_number>', $object->customer_tax_number, $this->template);
|
||||
$this->template = str_replace('<dol_print_customer_account_balance>', $object->customer_account_balance, $this->template);
|
||||
$this->template = str_replace('<dol_print_customer_points>', $object->customer_points, $this->template);
|
||||
$this->template = str_replace('<dol_print_order_points>', $object->order_points, $this->template);
|
||||
$this->template = str_replace('<dol_print_vendor_firstname>', $object->vendor_firstname, $this->template);
|
||||
$this->template = str_replace('<dol_print_vendor_lastname>', $object->vendor_lastname, $this->template);
|
||||
$this->template = str_replace('<dol_print_vendor_mail>', $object->vendor_mail, $this->template);
|
||||
$this->template = str_replace('<dol_print_date>', $object->date, $this->template);
|
||||
$this->template = str_replace('<dol_print_date_time>', $object->date_time, $this->template);
|
||||
$this->template = str_replace('<dol_print_year>', $object->date_time, $this->template);
|
||||
$this->template = str_replace('<dol_print_month_letters>', $object->date_time, $this->template);
|
||||
$this->template = str_replace('<dol_print_month>', $object->date_time, $this->template);
|
||||
$this->template = str_replace('<dol_print_day>', $object->date_time, $this->template);
|
||||
$this->template = str_replace('<dol_print_day_letters>', $object->date_time, $this->template);
|
||||
$this->template = str_replace('<dol_print_table>', $object->table, $this->template);
|
||||
$this->template = str_replace('<dol_print_cutlery>', $object->cutlery, $this->template);
|
||||
|
||||
// parse template
|
||||
$p = xml_parser_create();
|
||||
@ -463,10 +540,18 @@ class dolReceiptPrinter extends Escpos
|
||||
$this->printer->pulse();
|
||||
$html.= ' ϟ'.nl2br($vals[$line]['value']);
|
||||
break;
|
||||
case 'DOL_ACTIVATE_BUZZER':
|
||||
//$this->printer->buzzer();
|
||||
$html.= ' ♫'.nl2br($vals[$line]['value']);
|
||||
break;
|
||||
case 'DOL_PRINT_BARCODE':
|
||||
// $vals[$line]['value'] -> barcode($content, $type)
|
||||
$this->printer->barcode($object->barcode);
|
||||
break;
|
||||
case 'DOL_PRINT_BARCODE_CUSTOMER_ID':
|
||||
// $vals[$line]['value'] -> barcode($content, $type)
|
||||
$this->printer->barcode($object->customer_id);
|
||||
break;
|
||||
case 'DOL_PRINT_QRCODE':
|
||||
// $vals[$line]['value'] -> qrCode($content, $ec, $size, $model)
|
||||
$this->printer->qrcode($vals[$line]['value']);
|
||||
@ -553,7 +638,7 @@ class dolReceiptPrinter extends Escpos
|
||||
{
|
||||
global $conf;
|
||||
$error=0;
|
||||
$sql = 'SELECT rowid, name, fk_type, parameter';
|
||||
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt';
|
||||
$sql.= ' WHERE rowid = '.$printerid;
|
||||
$sql.= ' AND entity = '.$conf->entity;
|
||||
@ -573,7 +658,7 @@ class dolReceiptPrinter extends Escpos
|
||||
try {
|
||||
switch ($obj['fk_type']) {
|
||||
case 1:
|
||||
require_once DOL_DOCUMENT_ROOT .'/includes/escpos/src/DummyPrintConnector.php';
|
||||
require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/src/DummyPrintConnector.php';
|
||||
$this->connector = new DummyPrintConnector();
|
||||
break;
|
||||
case 2:
|
||||
|
||||
@ -1511,7 +1511,7 @@ class ExtraFields
|
||||
|
||||
if($nofillrequired) {
|
||||
$langs->load('errors');
|
||||
setEventMessage($langs->trans('ErrorFieldsRequired').' : '.implode(', ',$error_field_required),'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ',$error_field_required), null, 'errors');
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -165,7 +165,9 @@ class HookManager
|
||||
'formatEvent',
|
||||
'addCalendarChoice',
|
||||
'printObjectLine',
|
||||
'printObjectSubLine'
|
||||
'printObjectSubLine',
|
||||
'createDictionaryFieldList',
|
||||
'editDictionaryFieldlist'
|
||||
)
|
||||
)) $hooktype='addreplace';
|
||||
// Deprecated hook types ('returnvalue')
|
||||
|
||||
@ -893,7 +893,7 @@ class Form
|
||||
$outarray=array();
|
||||
|
||||
// On recherche les societes
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
|
||||
@ -969,6 +969,10 @@ class Form
|
||||
$label=$obj->name;
|
||||
}
|
||||
|
||||
if(!empty($obj->name_alias)) {
|
||||
$label.=' ('.$obj->name_alias.')';
|
||||
}
|
||||
|
||||
if ($showtype)
|
||||
{
|
||||
if ($obj->client || $obj->fournisseur) $label.=' (';
|
||||
@ -1372,7 +1376,7 @@ class Form
|
||||
$out.= '>';
|
||||
}
|
||||
|
||||
$out.= $userstatic->getFullName($langs, 0, 0, $maxlength);
|
||||
$out.= $userstatic->getFullName($langs, 0, -1, $maxlength);
|
||||
// Complete name with more info
|
||||
$moreinfo=0;
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGIN))
|
||||
@ -1546,7 +1550,7 @@ class Form
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
if ($hidelabel == 3) {
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
@ -5204,8 +5208,8 @@ class Form
|
||||
|
||||
//$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'</a>':'';
|
||||
//$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'</a>':'';
|
||||
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'<':' ').'</a>':'';
|
||||
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'>':' ').'</a>':'';
|
||||
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'<':' ').'</a>':'';
|
||||
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'>':' ').'</a>':'';
|
||||
|
||||
//print "xx".$previous_ref."x".$next_ref;
|
||||
$ret.='<div style="vertical-align: middle">';
|
||||
|
||||
@ -240,14 +240,14 @@ class FormActions
|
||||
|
||||
|
||||
/**
|
||||
* Output list of type of event
|
||||
* Output html select list of type of event
|
||||
*
|
||||
* @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx')
|
||||
* @param string $htmlname Nom champ formulaire
|
||||
* @param string $excludetype Type to exclude
|
||||
* @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
|
||||
* @param int $hideinfohelp 1=Do not show info help
|
||||
* @param int $multiselect 1=Allow multiselect of action type for filter or search
|
||||
* @param int $hideinfohelp 1=Do not show info help
|
||||
* @param int $multiselect 1=Allow multiselect of action type for filter or search
|
||||
* @return void
|
||||
*/
|
||||
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0)
|
||||
@ -270,9 +270,10 @@ class FormActions
|
||||
|
||||
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']);
|
||||
|
||||
if($multiselect==1) {
|
||||
if ($multiselect==1)
|
||||
{
|
||||
if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
|
||||
print $form->multiselectarray($htmlname, $arraylist,$selected,0, 0, '', 0, 200);
|
||||
print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, '', 0, 0);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
@ -301,7 +301,7 @@ class FormMail extends Form
|
||||
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
|
||||
if ($result<0)
|
||||
{
|
||||
setEventMessage($this->error,'errors');
|
||||
setEventMessages($this->error, $this->errors, 'errors');
|
||||
}
|
||||
$modelmail_array=array();
|
||||
foreach($this->lines_model as $line)
|
||||
@ -871,6 +871,7 @@ class FormMail extends Form
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num=$this->db->num_rows($resql);
|
||||
$this->lines_model=array();
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
|
||||
@ -82,14 +82,16 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
|
||||
// Type
|
||||
print '<tr>';
|
||||
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
|
||||
print $langs->trans("Type");
|
||||
print ' </td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">';
|
||||
//select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=true)
|
||||
print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 0, 1);
|
||||
print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), 0, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?0:1));
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr>';
|
||||
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
|
||||
print $langs->trans("Status");
|
||||
|
||||
@ -1470,22 +1470,22 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
$imgThumbMini = vignette($destpath, 160, 120, '_mini', 50, "thumbs");
|
||||
}
|
||||
|
||||
setEventMessage($langs->trans("FileTransferComplete"));
|
||||
setEventMessages($langs->trans("FileTransferComplete"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
setEventMessage($langs->trans($resupload), 'errors');
|
||||
setEventMessages($langs->trans($resupload), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1501,9 +1501,9 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
$res = $linkObject->create($user);
|
||||
$langs->load('link');
|
||||
if ($res > 0) {
|
||||
setEventMessage($langs->trans("LinkComplete"));
|
||||
setEventMessages($langs->trans("LinkComplete"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans("ErrorFileNotLinked"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1549,7 +1549,7 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
|
||||
if (empty($donotdeletefile))
|
||||
{
|
||||
$langs->load("other");
|
||||
setEventMessage($langs->trans("FileWasRemoved",$filetodelete));
|
||||
setEventMessages($langs->trans("FileWasRemoved",$filetodelete), null, 'mesgs');
|
||||
}
|
||||
if (empty($donotupdatesession))
|
||||
{
|
||||
|
||||
@ -817,7 +817,14 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
//print "masktri=".$masktri." maskcounter=".$maskcounter." maskraz=".$maskraz." maskoffset=".$maskoffset."<br>\n";
|
||||
|
||||
// Define $sqlstring
|
||||
$posnumstart=strrpos($maskwithnocode,$maskcounter); // Pos of counter in final string (from 0 to ...)
|
||||
if (function_exists('mb_strrpos'))
|
||||
{
|
||||
$posnumstart=mb_strrpos($maskwithnocode,$maskcounter, 'UTF-8');
|
||||
}
|
||||
else
|
||||
{
|
||||
$posnumstart=strrpos($maskwithnocode,$maskcounter);
|
||||
} // Pos of counter in final string (from 0 to ...)
|
||||
if ($posnumstart < 0) return 'ErrorBadMaskFailedToLocatePosOfSequence';
|
||||
$sqlstring='SUBSTRING('.$field.', '.($posnumstart+1).', '.dol_strlen($maskcounter).')';
|
||||
|
||||
|
||||
@ -612,71 +612,77 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
||||
$cury+=3;
|
||||
}
|
||||
|
||||
/*
|
||||
if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8);
|
||||
|
||||
if ($usedetailedbban == 1)
|
||||
if (empty($conf->global->PDF_BANK_HIDE_NUMBER_SHOW_ONLY_BICIBAN)) // Note that some countries still need bank number, BIC/IBAN not enought for them
|
||||
{
|
||||
$fieldstoshow=array('bank','desk','number','key');
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION==1) $fieldstoshow=array('bank','desk','key','number');
|
||||
// Note:
|
||||
// bank = code_banque (FR), sort code (GB, IR. Example: 12-34-56)
|
||||
// desk = code guichet (FR), used only when $usedetailedbban = 1
|
||||
// number = account number
|
||||
// key = check control key used only when $usedetailedbban = 1
|
||||
if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+6);
|
||||
|
||||
if ($usedetailedbban == 1)
|
||||
{
|
||||
$fieldstoshow=array('bank','desk','number','key');
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == 1) $fieldstoshow=array('bank','desk','key','number');
|
||||
}
|
||||
else if ($usedetailedbban == 2)
|
||||
{
|
||||
$fieldstoshow=array('bank','number');
|
||||
}
|
||||
else dol_print_error('','Value returned by function useDetailedBBAN not managed');
|
||||
|
||||
foreach ($fieldstoshow as $val)
|
||||
{
|
||||
if ($val == 'bank')
|
||||
{
|
||||
// Bank code
|
||||
$tmplength=18;
|
||||
$pdf->SetXY($curx, $cury+4);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+7);
|
||||
}
|
||||
if ($val == 'desk')
|
||||
{
|
||||
// Desk
|
||||
$tmplength=18;
|
||||
$pdf->SetXY($curx, $cury+4);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+7);
|
||||
}
|
||||
if ($val == 'number')
|
||||
{
|
||||
// Number
|
||||
$tmplength=24;
|
||||
$pdf->SetXY($curx, $cury+4);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+7);
|
||||
}
|
||||
if ($val == 'key')
|
||||
{
|
||||
// Key
|
||||
$tmplength=13;
|
||||
$pdf->SetXY($curx, $cury+4);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+7);
|
||||
}
|
||||
}
|
||||
|
||||
$curx=$savcurx;
|
||||
$cury+=8;
|
||||
}
|
||||
else if ($usedetailedbban == 2)
|
||||
{
|
||||
$fieldstoshow=array('bank','number');
|
||||
}
|
||||
else dol_print_error('','Value returned by function useDetailedBBAN not managed');
|
||||
|
||||
foreach ($fieldstoshow as $val)
|
||||
{
|
||||
if ($val == 'bank')
|
||||
{
|
||||
// Bank code
|
||||
$tmplength=18;
|
||||
$pdf->SetXY($curx, $cury+5);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
|
||||
}
|
||||
if ($val == 'desk')
|
||||
{
|
||||
// Desk
|
||||
$tmplength=18;
|
||||
$pdf->SetXY($curx, $cury+5);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
|
||||
}
|
||||
if ($val == 'number')
|
||||
{
|
||||
// Number
|
||||
$tmplength=24;
|
||||
$pdf->SetXY($curx, $cury+5);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
|
||||
}
|
||||
if ($val == 'key')
|
||||
{
|
||||
// Key
|
||||
$tmplength=13;
|
||||
$pdf->SetXY($curx, $cury+5);
|
||||
$pdf->SetFont('','',$default_font_size - 3);$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->cle_rib), 0, 'C', 0);
|
||||
$pdf->SetXY($curx, $cury+1);
|
||||
$curx+=$tmplength;
|
||||
$pdf->SetFont('','B',$default_font_size - 4);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
|
||||
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
|
||||
}
|
||||
}
|
||||
|
||||
$curx=$savcurx;
|
||||
$cury+=9;
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -878,16 +878,18 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
|
||||
* @param int $mytasks Limited to task i am contact to
|
||||
* @param int $statut -1=No filter on statut, 0 or 1 = Filter on status
|
||||
* @param array $listofoppstatus List of opportunity status
|
||||
* @param array $hiddenfields List of fields to not show
|
||||
* @return void
|
||||
*/
|
||||
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=0, $statut=-1, $listofoppstatus=array())
|
||||
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=0, $statut=-1, $listofoppstatus=array(),$hiddenfields=array())
|
||||
{
|
||||
global $langs,$conf,$user,$bc;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
$projectstatic=new Project($db);
|
||||
|
||||
$thirdpartystatic=new Societe($db);
|
||||
|
||||
$sortfield='';
|
||||
$sortorder='';
|
||||
$project_year_filter=0;
|
||||
@ -895,9 +897,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
$title=$langs->trans("Projects");
|
||||
if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$statut]);
|
||||
|
||||
$arrayidtypeofcontact=array();
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount, COUNT(DISTINCT t.rowid) as nb"; // We use DISTINCT here because line can be doubled if task has 2 links to same user
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if ($mytasks)
|
||||
{
|
||||
@ -916,9 +919,9 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
{
|
||||
$sql.= " AND p.rowid = t.fk_projet";
|
||||
$sql.= " AND ec.element_id = t.rowid";
|
||||
$sql.= " AND ctc.rowid = ec.fk_c_type_contact";
|
||||
$sql.= " AND ctc.element = 'project_task'";
|
||||
$sql.= " AND ec.fk_socpeople = ".$user->id;
|
||||
$sql.= " AND ec.fk_c_type_contact = ctc.rowid"; // Replace the 2 lines with ec.fk_c_type_contact in $arrayidtypeofcontact
|
||||
$sql.= " AND ctc.element = 'project_task'";
|
||||
}
|
||||
if ($statut >= 0)
|
||||
{
|
||||
@ -938,14 +941,41 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
$sql.= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($project_year_filter,1,false)).")";
|
||||
}
|
||||
}
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount";
|
||||
$sql.= " ORDER BY p.title, p.ref";
|
||||
|
||||
// Get id of project we must show tasks
|
||||
$arrayidofprojects=array();
|
||||
$sql1 = "SELECT p.rowid as projectid";
|
||||
$sql1.= $sql;
|
||||
$resql = $db->query($sql1);
|
||||
if ($resql)
|
||||
{
|
||||
$i=0;
|
||||
$num = $db->num_rows($resql);
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$arrayidofprojects[$objp->projectid]=$objp->projectid;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
if (empty($arrayidofprojects)) $arrayidofprojects[0]=-1;
|
||||
|
||||
// Get list of project with calculation on tasks
|
||||
$sql2 = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_soc, s.nom as socname, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount,";
|
||||
$sql2.= " COUNT(t.rowid) as nb, SUM(t.planned_workload) as planned_workload, SUM(t.planned_workload * t.progress / 100) as declared_progess_workload";
|
||||
$sql2.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
|
||||
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
|
||||
$sql2.= " WHERE p.rowid IN (".join(',',$arrayidofprojects).")";
|
||||
$sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount";
|
||||
$sql2.= " ORDER BY p.title, p.ref";
|
||||
|
||||
$var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
$resql = $db->query($sql2);
|
||||
if ($resql)
|
||||
{
|
||||
$total_task = 0;
|
||||
$total_task = 0;
|
||||
$total_opp_amount = 0;
|
||||
$ponderated_opp_amount = 0;
|
||||
|
||||
@ -954,12 +984,18 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($title.' <span class="badge">'.$num.'</span>',$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("OpportunityAmount"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
}
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PlannedWorkload"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
if (! in_array('declaredprogress', $hiddenfields)) print_liste_field_titre($langs->trans("ProgressDeclared"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
@ -980,7 +1016,17 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
print '<td>';
|
||||
$projectstatic->ref=$objp->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print ' - '.dol_trunc($objp->title,24).'</td>';
|
||||
print ' - '.dol_trunc($objp->title,24);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($objp->fk_soc > 0)
|
||||
{
|
||||
$thirdpartystatic->id=$objp->fk_soc;
|
||||
$thirdpartystatic->ref=$objp->socname;
|
||||
$thirdpartystatic->name=$objp->socname;
|
||||
print $thirdpartystatic->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
print '<td align="right">';
|
||||
@ -992,7 +1038,25 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
print '</td>';
|
||||
}
|
||||
$projectstatic->statut = $objp->status;
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) print '<td align="right">'.$objp->nb.'</td>';
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
print '<td align="right">'.$objp->nb.'</td>';
|
||||
|
||||
$plannedworkload=$objp->planned_workload;
|
||||
$total_plannedworkload+=$plannedworkload;
|
||||
print '<td align="right">'.($plannedworkload?convertSecondToTime($plannedworkload):'').'</td>';
|
||||
|
||||
if (! in_array('declaredprogress', $hiddenfields))
|
||||
{
|
||||
$declaredprogressworkload=$objp->declared_progess_workload;
|
||||
$total_declaredprogressworkload+=$declaredprogressworkload;
|
||||
print '<td align="right">';
|
||||
//print $objp->planned_workload.'-'.$objp->declared_progess_workload."<br>";
|
||||
print ($plannedworkload?round(100*$declaredprogressworkload/$plannedworkload,0).'%':'');
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1004,14 +1068,22 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
$i++;
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("Total")."</td>";
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="2">'.$langs->trans("Total")."</td>";
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
print '<td align="right">'.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).'</td>';
|
||||
print '<td align="right">'.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1).'</td>';
|
||||
print '<td class="liste_total" align="right">'.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).'</td>';
|
||||
print '<td class="liste_total" align="right">'.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1).'</td>';
|
||||
}
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) print '<td align="right">'.$total_task.'</td>';
|
||||
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
print '<td class="liste_total" align="right">'.$total_task.'</td>';
|
||||
print '<td class="liste_total" align="right">'.($total_plannedworkload?convertSecondToTime($total_plannedworkload):'').'</td>';
|
||||
if (! in_array('declaredprogress', $hiddenfields)) print '<td class="liste_total" align="right">'.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload,0).'%':'').'</td>';
|
||||
}
|
||||
print '<td class="liste_total"></td>';
|
||||
print '</tr>';
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
@ -487,7 +487,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -280,7 +280,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -316,7 +316,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -582,7 +582,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -422,7 +422,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -57,7 +57,7 @@ class modApi extends DolibarrModules
|
||||
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->description = "REST interface";
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||
$this->version = 'development';
|
||||
$this->version = 'dolibarr';
|
||||
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
|
||||
@ -72,10 +72,10 @@ class modApi extends DolibarrModules
|
||||
|
||||
// Data directories to create when module is enabled.
|
||||
// Example: this->dirs = array("/api/temp");
|
||||
$this->dirs = array();
|
||||
$this->dirs = array('/api/temp');
|
||||
|
||||
// Config pages. Put here list of php page, stored into api/admin directory, to use to setup module.
|
||||
$this->config_page_url = array("api.php@api");
|
||||
$this->config_page_url = array("index.php@api");
|
||||
|
||||
// Dependencies
|
||||
$this->hidden = false; // A condition to hide module
|
||||
|
||||
@ -259,6 +259,45 @@ class modCategorie extends DolibarrModules
|
||||
's.url'=>"company",
|
||||
's.email'=>"company"
|
||||
); // We define here only fields that use another picto
|
||||
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople'";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$fieldname='extra.'.$obj->name;
|
||||
$fieldlabel=ucfirst($obj->label);
|
||||
$typeFilter="Text";
|
||||
switch($obj->type)
|
||||
{
|
||||
case 'int':
|
||||
case 'double':
|
||||
case 'price':
|
||||
$typeFilter="Numeric";
|
||||
break;
|
||||
case 'date':
|
||||
case 'datetime':
|
||||
$typeFilter="Date";
|
||||
break;
|
||||
case 'boolean':
|
||||
$typeFilter="Boolean";
|
||||
break;
|
||||
case 'sellist':
|
||||
$typeFilter="List:".$obj->param;
|
||||
break;
|
||||
case 'select':
|
||||
$typeFilter="Select:".$obj->param;
|
||||
break;
|
||||
}
|
||||
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
||||
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
|
||||
$this->export_entities_array[$r][$fieldname]='contact';
|
||||
}
|
||||
}
|
||||
// End add axtra fields
|
||||
|
||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid';
|
||||
|
||||
@ -45,11 +45,12 @@ class modDeplacement extends DolibarrModules
|
||||
$this->numero = 75 ;
|
||||
|
||||
$this->family = "hr";
|
||||
$this->module_position = 41;
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Gestion des notes de frais et deplacements"; // Si traduction Module75Desc non trouvee
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||
$this->version = 'dolibarr_deprecated';
|
||||
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
|
||||
@ -137,7 +137,7 @@ class modReceiptPrinter extends DolibarrModules
|
||||
// Clean before activation
|
||||
$this->remove($options);
|
||||
$sql = array(
|
||||
"CREATE TABLE IF NOT EXISTS llx_printer_receipt (rowid int(11) NOT NULL AUTO_INCREMENT, name varchar(128), fk_type int(11), parameter varchar(128), entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;",
|
||||
"CREATE TABLE IF NOT EXISTS llx_printer_receipt (rowid int(11) NOT NULL AUTO_INCREMENT, name varchar(128), fk_type int(11), fk_profile int(11), parameter varchar(128), entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;",
|
||||
"CREATE TABLE IF NOT EXISTS llx_printer_receipt_template (rowid int(11) NOT NULL AUTO_INCREMENT, name varchar(128), template text, entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;",
|
||||
);
|
||||
return $this->_init($sql,$options);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 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
|
||||
@ -153,10 +154,6 @@ class modResource extends DolibarrModules
|
||||
// 'categories_x' to add a tab in category view
|
||||
// (reresource 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
|
||||
$this->tabs = array(
|
||||
// 'thirdparty:+resources:Resources:resource:$user->rights->resource->read:/resource/element_resource.php?element=societe&element_id=__ID__'
|
||||
);
|
||||
|
||||
// Boxes
|
||||
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
|
||||
$this->boxes = array(); // Boxes list
|
||||
@ -250,6 +247,21 @@ class modResource extends DolibarrModules
|
||||
'user'=> 0
|
||||
);
|
||||
|
||||
$this->menu[$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus
|
||||
'type'=> 'left', // Toujours un menu gauche
|
||||
'titre'=> 'List',
|
||||
'mainmenu'=> 'tools',
|
||||
'leftmenu'=> '', // On n'indique rien ici car on ne souhaite pas intégrer de sous-menus à ce menu
|
||||
'url'=> '/resource/list.php',
|
||||
'langs'=> 'resource',
|
||||
'position'=> 102,
|
||||
'enabled'=> '1',
|
||||
'perms'=> '$user->rights->resource->read',
|
||||
'target'=> '',
|
||||
'user'=> 0
|
||||
);
|
||||
|
||||
// Exports
|
||||
$r = 1;
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ class modWebServices extends DolibarrModules
|
||||
|
||||
// Config pages
|
||||
//-------------
|
||||
$this->config_page_url = array("webservices.php@webservices");
|
||||
$this->config_page_url = array("index.php@webservices");
|
||||
|
||||
// Dependancies
|
||||
//-------------
|
||||
|
||||
@ -57,7 +57,7 @@ class modWebServicesClient extends DolibarrModules
|
||||
|
||||
// Config pages
|
||||
//-------------
|
||||
//$this->config_page_url = array("webservices.php@webservices");
|
||||
//$this->config_page_url = array();
|
||||
|
||||
// Dependancies
|
||||
//-------------
|
||||
|
||||
@ -250,7 +250,7 @@ class pdf_baleine extends ModelePDFProjects
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -575,7 +575,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -451,7 +451,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -473,7 +473,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -497,7 +497,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(60,60,60)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
$pdf->SetLineStyle(array('dash'=>0));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -17,9 +17,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/syslog/logHandler.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/includes/raven/raven/lib/Raven/Autoloader.php';
|
||||
Raven_Autoloader::register();
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/includes/raven/raven/lib/Raven/Autoloader.php'))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/raven/raven/lib/Raven/Autoloader.php';
|
||||
Raven_Autoloader::register();
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to manage logging to Sentry
|
||||
@ -71,7 +74,7 @@ class mod_syslog_sentry extends LogHandler implements LogHandlerInterface
|
||||
*/
|
||||
public function isActive()
|
||||
{
|
||||
return 1;
|
||||
return file_exists(DOL_DOCUMENT_ROOT.'/includes/raven/raven/lib/Raven/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -139,7 +139,7 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($result, 'errors');
|
||||
setEventMessages($result, null, 'errors');
|
||||
$_GET['file']=$_POST["file"];
|
||||
$action='';
|
||||
}
|
||||
@ -168,7 +168,7 @@ if ($action == 'confirm_crop')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($result, 'errors');
|
||||
setEventMessages($result, null, 'errors');
|
||||
$_GET['file']=$_POST["file"];
|
||||
$action='';
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -30,7 +31,10 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($object->id)
|
||||
{
|
||||
dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask'));
|
||||
if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
||||
dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask'));
|
||||
else
|
||||
dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask'));
|
||||
}
|
||||
}
|
||||
elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
@ -88,8 +92,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
}
|
||||
}
|
||||
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", $urlfile));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", $urlfile), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", $urlfile), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors');
|
||||
}
|
||||
elseif ($linkid)
|
||||
{
|
||||
@ -101,12 +105,12 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
|
||||
$langs->load('link');
|
||||
if ($res > 0) {
|
||||
setEventMessage($langs->trans("LinkRemoved", $link->label));
|
||||
setEventMessages($langs->trans("LinkRemoved", $link->label), null, 'mesgs');
|
||||
} else {
|
||||
if (count($link->errors)) {
|
||||
setEventMessages('', $link->errors, 'errors');
|
||||
} else {
|
||||
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailedToDeleteLink", $link->label), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -132,7 +136,7 @@ elseif ($action == 'confirm_updateline' && GETPOST('save') && GETPOST('link', 'a
|
||||
$res = $link->update($user);
|
||||
if (!$res)
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFailedToUpdateLink", $link->label));
|
||||
setEventMessages($langs->trans("ErrorFailedToUpdateLink", $link->label), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -138,7 +138,8 @@ else {
|
||||
// Show type selector
|
||||
if ($forceall >= 0)
|
||||
{
|
||||
echo $langs->trans("FreeLineOfType");
|
||||
if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type");
|
||||
else echo $langs->trans("FreeLineOfType");
|
||||
echo ' ';
|
||||
}
|
||||
}
|
||||
@ -512,7 +513,17 @@ jQuery(document).ready(function() {
|
||||
$("#select_type").change(function()
|
||||
{
|
||||
setforfree();
|
||||
if (jQuery('#select_type').val() >= 0) jQuery('#dp_desc').focus();
|
||||
if (jQuery('#select_type').val() >= 0)
|
||||
{
|
||||
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
|
||||
jQuery('#dp_desc').focus();
|
||||
/* focus if CKEDITOR */
|
||||
if (CKEDITOR)
|
||||
{
|
||||
var editor = CKEDITOR.instances['dp_desc'];
|
||||
if (editor) { editor.focus(); }
|
||||
}
|
||||
}
|
||||
if (jQuery('#select_type').val() == '0') jQuery('#trlinefordates').hide();
|
||||
else jQuery('#trlinefordates').show();
|
||||
});
|
||||
@ -608,8 +619,17 @@ jQuery(document).ready(function() {
|
||||
<?php } ?>
|
||||
|
||||
/* To set focus */
|
||||
if (jQuery('#idprod').val() > 0) jQuery('#dp_desc').focus();
|
||||
if (jQuery('#idprodfournprice').val() > 0) jQuery('#dp_desc').focus();
|
||||
if (jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val() > 0)
|
||||
{
|
||||
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */
|
||||
jQuery('#dp_desc').focus();
|
||||
/* focus if CKEDITOR */
|
||||
if (CKEDITOR)
|
||||
{
|
||||
var editor = CKEDITOR.instances['dp_desc'];
|
||||
if (editor) { editor.focus(); }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php if (GETPOST('prod_entry_mode') == 'predef') { // When we submit with a predef product and it fails we must start with predef ?>
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<!-- BEGIN TEMPLATE resource_add.tpl.php -->
|
||||
<?php
|
||||
|
||||
// BEGIN TPL RESOURCE_ADD.TPL.PHP
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php');
|
||||
|
||||
$form = new Form($db);
|
||||
@ -23,8 +22,8 @@ $events=array();
|
||||
$out .= $formresources->select_resource_list('','fk_resource','',1,1,0,$events,'',2);
|
||||
$out .= '</div>';
|
||||
|
||||
$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy',$linked_resource['busy']?1:0,1).'</div>';
|
||||
$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'</div>';
|
||||
$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy',(isset($_POST['busy'])?$_POST['busy']:1),1).'</div>';
|
||||
$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory',(isset($_POST['mandatory'])?$_POST['mandatory']:0),1).'</div>';
|
||||
|
||||
$out .= '<div class="tagtd" align="right">';
|
||||
$out .='<input type="submit" id="add-resource-place" class="button" value="'.$langs->trans("Add").'"/>';
|
||||
@ -33,8 +32,8 @@ $out .= '</div>';
|
||||
$out .='</form>';
|
||||
|
||||
$out .= '</div>';
|
||||
$out .= '<br />';
|
||||
$out .= '<br>';
|
||||
|
||||
print $out;
|
||||
|
||||
// END BEGIN TPL RESOURCE_ADD.TPL.PHP
|
||||
?>
|
||||
<!-- END TEMPLATE resource_add.tpl.php -->
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
<!-- BEGIN TEMPLATE resource_view.tpl.php -->
|
||||
<?php
|
||||
//var_dump($linked_resources);
|
||||
|
||||
@ -8,30 +9,27 @@ if( (array) $linked_resources && count($linked_resources) > 0)
|
||||
{
|
||||
$var=true;
|
||||
|
||||
// TODO: DEBUT DU TPL
|
||||
print '<div class="tagtable centpercent noborder allwidth">';
|
||||
|
||||
if($mode == 'edit' )
|
||||
{
|
||||
print '<div class="tagtable centpercent noborder allwidth">';
|
||||
{
|
||||
print '<form class="tagtr liste_titre">';
|
||||
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
|
||||
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
|
||||
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
|
||||
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
|
||||
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
|
||||
print '<div class="tagtd"></div>';
|
||||
print '</form>';
|
||||
//print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="tagtable centpercent noborder allwidth">';
|
||||
print '<form class="tagtr liste_titre">';
|
||||
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
|
||||
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
|
||||
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
|
||||
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
|
||||
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
|
||||
print '<div class="tagtd"></div>';
|
||||
print '</form>';
|
||||
//print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -49,11 +47,11 @@ if( (array) $linked_resources && count($linked_resources) > 0)
|
||||
print '<input type="hidden" name="resource_type" value="'.$resource_type.'" />';
|
||||
print '<input type="hidden" name="lineid" value="'.$linked_resource['rowid'].'" />';
|
||||
|
||||
print '<div class="tagtd">'.$object_resource->type_label.'</div>';
|
||||
print '<div class="tagtd">'.$object_resource->getNomUrl(1).'</div>';
|
||||
print '<div class="tagtd">'.$object_resource->type_label.'</div>';
|
||||
print '<div class="tagtd" align="center">'.$form->selectyesno('busy',$linked_resource['busy']?1:0,1).'</div>';
|
||||
print '<div class="tagtd">'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'</div>';
|
||||
print '<div class="tagtd"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div>';
|
||||
print '<div class="tagtd" align="center">'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'</div>';
|
||||
print '<div class="tagtd" align="right"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div>';
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
@ -65,14 +63,14 @@ if( (array) $linked_resources && count($linked_resources) > 0)
|
||||
|
||||
print '<div class="tagtr '.($var==true?"pair":"impair").'" '.$style.'>';
|
||||
|
||||
print '<div class="tagtd">';
|
||||
print $object_resource->type_label;
|
||||
print '</div>';
|
||||
|
||||
print '<div class="tagtd">';
|
||||
print $object_resource->getNomUrl(1);
|
||||
print '</div class="tagtd">';
|
||||
|
||||
print '<div class="tagtd">';
|
||||
print $object_resource->type_label;
|
||||
print '</div>';
|
||||
|
||||
print '<div class="tagtd" align="center">';
|
||||
print yn($linked_resource['busy']);
|
||||
print '</div>';
|
||||
@ -96,14 +94,12 @@ if( (array) $linked_resources && count($linked_resources) > 0)
|
||||
|
||||
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
print '<div class="warning">'.$langs->trans('NoResourceLinked').'</div>';
|
||||
|
||||
}
|
||||
// FIN DU TPL
|
||||
?>
|
||||
<!-- END TEMPLATE resource_view.tpl.php -->
|
||||
|
||||
@ -37,7 +37,7 @@ if (! $user->admin)
|
||||
|
||||
$actionsave=GETPOST("save");
|
||||
|
||||
// Sauvegardes parametres
|
||||
// Save parameters
|
||||
if (!empty($actionsave))
|
||||
{
|
||||
$i=0;
|
||||
@ -49,12 +49,12 @@ if (!empty($actionsave))
|
||||
if ($i >= 1)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ if (!empty($id))
|
||||
$result=$object->fetch($id);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='edit';
|
||||
}
|
||||
else
|
||||
@ -90,7 +90,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
else
|
||||
@ -98,13 +98,13 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
$res = $object->reprogram_jobs($user->login);
|
||||
if ($res > 0)
|
||||
{
|
||||
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
|
||||
else setEventMessage($langs->trans("JobFinished"),'mesgs');
|
||||
if ($object->lastresult > 0) setEventMessages($langs->trans("JobFinished"), null, 'warnings');
|
||||
else setEventMessages($langs->trans("JobFinished"), null, 'mesgs');
|
||||
$action='';
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -134,11 +134,11 @@ if ($action=='add')
|
||||
|
||||
// test du Resultat de la requete
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='create';
|
||||
}
|
||||
else {
|
||||
setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
|
||||
setEventMessages($langs->trans('CronSaveSucess'), null, 'mesgs');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -168,11 +168,11 @@ if ($action=='update')
|
||||
|
||||
// test du Resultat de la requete
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='edit';
|
||||
}
|
||||
else {
|
||||
setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
|
||||
setEventMessages($langs->trans('CronSaveSucess'), null, 'mesgs');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -186,11 +186,11 @@ if ($action=='activate')
|
||||
|
||||
// test du Resultat de la requete
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='edit';
|
||||
}
|
||||
else {
|
||||
setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
|
||||
setEventMessages($langs->trans('CronSaveSucess'), null, 'mesgs');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -204,11 +204,11 @@ if ($action=='inactive')
|
||||
|
||||
// test du Resultat de la requete
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='edit';
|
||||
}
|
||||
else {
|
||||
setEventMessage($langs->trans('CronSaveSucess'),'mesgs');
|
||||
setEventMessages($langs->trans('CronSaveSucess'), null, 'mesgs');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -277,7 +277,7 @@ if ($action == 'execute'){
|
||||
|
||||
if (empty($object->status) && $action != 'create')
|
||||
{
|
||||
setEventMessage($langs->trans("CronTaskInactive"), 'warnings');
|
||||
setEventMessages($langs->trans("CronTaskInactive"), null, 'warnings');
|
||||
}
|
||||
|
||||
if (($action=="create") || ($action=="edit"))
|
||||
|
||||
@ -85,7 +85,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del
|
||||
$result = $object->delete($user);
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,20 +98,20 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
|
||||
$result = $object->run_jobs($user->login);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $object->reprogram_jobs($user->login);
|
||||
if ($res > 0)
|
||||
{
|
||||
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
|
||||
else setEventMessage($langs->trans("JobFinished"),'mesgs');
|
||||
if ($object->lastresult > 0) setEventMessages($langs->trans("JobFinished"), null, 'warnings');
|
||||
else setEventMessages($langs->trans("JobFinished"), null, 'mesgs');
|
||||
$action='';
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -147,12 +147,12 @@ if ($action == 'execute')
|
||||
|
||||
}
|
||||
|
||||
// liste des jobs creer
|
||||
// list of jobs created
|
||||
$object = new Cronjob($db);
|
||||
$result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -71,13 +71,13 @@ if ($action == 'specimen')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($obj->error,'errors');
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@ -126,11 +126,11 @@ if ($action == 'set_DONATION_ACCOUNTINGACCOUNT')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,11 +144,11 @@ if ($action == 'set_DONATION_MESSAGE')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,9 +160,9 @@ else if ($action == 'setart200') {
|
||||
$error ++;
|
||||
|
||||
if (! $error) {
|
||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans("Error"), 'mesgs');
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
else if ($action == 'setart238') {
|
||||
@ -172,9 +172,9 @@ else if ($action == 'setart238') {
|
||||
$error ++;
|
||||
|
||||
if (! $error) {
|
||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans("Error"), 'mesgs');
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
else if ($action == 'setart885') {
|
||||
@ -184,9 +184,9 @@ else if ($action == 'setart885') {
|
||||
$error ++;
|
||||
|
||||
if (! $error) {
|
||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans("Error"), 'mesgs');
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -192,8 +192,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights-
|
||||
else
|
||||
{
|
||||
dol_syslog($object->error,LOG_DEBUG);
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessage($object->errors,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
if ($action == 'valid_promesse')
|
||||
@ -204,7 +203,7 @@ if ($action == 'valid_promesse')
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
if ($action == 'set_cancel')
|
||||
@ -215,7 +214,7 @@ if ($action == 'set_cancel')
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
if ($action == 'set_paid')
|
||||
@ -226,7 +225,7 @@ if ($action == 'set_paid')
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
// Remove file in doc form
|
||||
@ -243,8 +242,8 @@ if ($action == 'remove_file')
|
||||
$upload_dir = $conf->don->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$ret=dol_delete_file($file,0,0,0,$object);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($payment->error, 'errors');
|
||||
setEventMessages($payment->error, $payment->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->don->cree
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($payment->error);
|
||||
setEventMessages($payment->error, $payment->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,18 +117,18 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans($ecmdir->error), 'errors');
|
||||
setEventMessage($ecmdir->errors, 'errors');
|
||||
setEventMessages($langs->trans($ecmdir->error), null, 'errors');
|
||||
setEventMessages($ecmdir->error, $ecmdir->errors, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suppression fichier
|
||||
// Deleting file
|
||||
else if ($action == 'confirm_deletesection' && $confirm == 'yes')
|
||||
{
|
||||
$result=$ecmdir->delete($user);
|
||||
setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
|
||||
setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -88,23 +88,23 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
setEventMessage($langs->trans($resupload), 'errors');
|
||||
setEventMessages($langs->trans($resupload), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Echec transfert (fichier depassant la limite ?)
|
||||
// Failed transfer (exceeding the limit file?)
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailToCreateDir",$upload_dir), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ if ($action == 'confirm_deletedir' && $confirm == 'yes')
|
||||
else
|
||||
{
|
||||
$langs->load('errors');
|
||||
setEventMessage($langs->trans($ecmdir->error,$ecmdir->label), 'errors');
|
||||
setEventMessages($langs->trans($ecmdir->error,$ecmdir->label), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ if ($action == 'update' && ! GETPOST('cancel'))
|
||||
if (! $result)
|
||||
{
|
||||
$langs->load('errors');
|
||||
setEventMessage($langs->trans('ErrorFailToRenameDir',$olddir,$newdir), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFailToRenameDir',$olddir,$newdir), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -184,7 +184,7 @@ if ($action == 'update' && ! GETPOST('cancel'))
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($ecmdir->error, 'errors');
|
||||
setEventMessages($ecmdir->error, $ecmdir->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ llxHeader();
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
// Built the file List
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
foreach($filearray as $key => $file)
|
||||
@ -349,7 +349,7 @@ if ($action == 'delete_dir')
|
||||
$formfile=new FormFile($db);
|
||||
|
||||
/*
|
||||
// Affiche formulaire upload
|
||||
// Display upload form
|
||||
if ($user->rights->ecm->upload)
|
||||
{
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/docmine.php','',0,$section);
|
||||
|
||||
@ -55,15 +55,15 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
setEventMessage($langs->trans($resupload), 'errors');
|
||||
setEventMessages($langs->trans($resupload), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -81,8 +81,8 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
|
||||
$langs->load("other");
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ print load_fiche_titre($langs->trans("ECMAutoOrg"));
|
||||
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression d'une ligne produit
|
||||
* Confirmation of deleting a product line
|
||||
*/
|
||||
if ($_GET['action'] == 'delete_file')
|
||||
{
|
||||
@ -114,7 +114,7 @@ if ($_GET['action'] == 'delete_file')
|
||||
|
||||
}
|
||||
|
||||
// Construit liste des fichiers
|
||||
// Construct files list
|
||||
clearstatcache();
|
||||
$totalsize=0;
|
||||
$filearray=array();
|
||||
|
||||
@ -117,22 +117,22 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
setEventMessage($langs->trans($resupload), 'errors');
|
||||
setEventMessages($langs->trans($resupload), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailToCreateDir",$upload_dir), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,7 +154,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
|
||||
setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors');
|
||||
$action = "create";
|
||||
}
|
||||
|
||||
@ -182,8 +182,8 @@ if ($action == 'confirm_deletefile')
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
|
||||
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
|
||||
$result=$ecmdir->changeNbOfFiles('-');
|
||||
|
||||
@ -196,7 +196,7 @@ if ($action == 'confirm_deletefile')
|
||||
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$result=$ecmdir->delete($user);
|
||||
setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
|
||||
setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
|
||||
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
@ -117,22 +117,22 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
setEventMessage($langs->trans($resupload), 'errors');
|
||||
setEventMessages($langs->trans($resupload), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailToCreateDir",$upload_dir), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -155,7 +155,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
else
|
||||
{
|
||||
//TODO: Translate
|
||||
setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
|
||||
setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors');
|
||||
$action = "create";
|
||||
}
|
||||
|
||||
@ -183,8 +183,8 @@ if ($action == 'confirm_deletefile')
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
|
||||
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
|
||||
$result=$ecmdir->changeNbOfFiles('-');
|
||||
|
||||
@ -197,7 +197,7 @@ if ($action == 'confirm_deletefile')
|
||||
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$result=$ecmdir->delete($user);
|
||||
setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
|
||||
setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
|
||||
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 201 Charlie Benke <charlies@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -1525,7 +1525,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
print '<td align="right">';
|
||||
$selectmode='select';
|
||||
if (! empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) $selectmode='text';
|
||||
$form->select_duration('duration',$objp->duree, $selectmode);
|
||||
$form->select_duration('duration',$objp->duree,0, $selectmode);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
|
||||
@ -53,12 +53,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
var $id;
|
||||
|
||||
/**
|
||||
* TODO: Remove
|
||||
* @deprecated
|
||||
* @see product_ref
|
||||
* Supplier invoice reference
|
||||
* @var string
|
||||
*/
|
||||
var $ref;
|
||||
var $product_ref;
|
||||
var $ref_supplier;
|
||||
var $brouillon;
|
||||
var $statut; // 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
|
||||
@ -586,7 +584,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $conf;
|
||||
|
||||
$result='';
|
||||
$label = '<u>' . $langs->trans("ShowOrder") . '</u>';
|
||||
@ -1254,7 +1252,9 @@ class CommandeFournisseur extends CommonOrder
|
||||
*/
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null)
|
||||
{
|
||||
global $langs,$mysoc;
|
||||
global $langs,$mysoc, $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2. $fk_product, $fk_prod_fourn_price, $fourn_ref, $remise_percent, $price_base_type, $pu_ttc, $type, $fk_unit");
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
@ -301,6 +301,8 @@ class AutoLoader
|
||||
*/
|
||||
private function alias($className, $currentClass)
|
||||
{
|
||||
if ($className == 'Luracast\Restler\string') return;
|
||||
if ($className == 'Luracast\Restler\mixed') return;
|
||||
if ($className != $currentClass
|
||||
&& false !== strpos($className, $currentClass))
|
||||
if (!class_exists($currentClass, false)
|
||||
|
||||
@ -30,7 +30,7 @@ include_once 'inc.php';
|
||||
|
||||
$err = 0;
|
||||
$allowinstall = 0;
|
||||
$allowupgrade = 0;
|
||||
$allowupgrade = false;
|
||||
$checksok = 1;
|
||||
|
||||
$setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):$langs->getDefaultLang();
|
||||
@ -181,11 +181,11 @@ if (is_readable($conffile) && filesize($conffile) > 8)
|
||||
if ($databaseok)
|
||||
{
|
||||
// Already installed for all parts (config and database). We can propose upgrade.
|
||||
$allowupgrade=1;
|
||||
$allowupgrade=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$allowupgrade=0;
|
||||
$allowupgrade=false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -216,7 +216,7 @@ else
|
||||
}
|
||||
|
||||
// First install, we can't upgrade
|
||||
$allowupgrade=0;
|
||||
$allowupgrade=false;
|
||||
}
|
||||
|
||||
|
||||
@ -382,6 +382,7 @@ else
|
||||
$allowupgrade=false;
|
||||
}
|
||||
if (defined("MAIN_NOT_INSTALLED")) $allowupgrade=false;
|
||||
if (GETPOST('allowupgrade')) $allowupgrade=true;
|
||||
$migrationscript=array( array('from'=>'3.0.0', 'to'=>'3.1.0'),
|
||||
array('from'=>'3.1.0', 'to'=>'3.2.0'),
|
||||
array('from'=>'3.2.0', 'to'=>'3.3.0'),
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_fk_pcg_version (fk_pcg_version);
|
||||
ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_account_number (account_number);
|
||||
|
||||
ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version);
|
||||
--ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_account_number FOREIGN KEY (fk_account_number) REFERENCES llx_accounting_account (account_number);
|
||||
|
||||
--ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_account_number FOREIGN KEY (fk_account_number) REFERENCES llx_accounting_account (account_number);
|
||||
|
||||
-- This keys are created into foreign table after creation of foreign index
|
||||
--ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version);
|
||||
|
||||
@ -20,3 +20,5 @@
|
||||
|
||||
ALTER TABLE llx_accounting_system ADD UNIQUE INDEX uk_accounting_system_pcg_version (pcg_version);
|
||||
|
||||
-- This key is for another table but created here because must be done after foreign key index is created
|
||||
ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version);
|
||||
|
||||
@ -167,6 +167,17 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
|
||||
// Create user
|
||||
include_once DOL_DOCUMENT_ROOT .'/user/class/user.class.php';
|
||||
|
||||
// Set default encryption to yes if there is no user yet into database
|
||||
$sql = "SELECT u.rowid, u.pass, u.pass_crypted";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
//$sql.= " WHERE u.pass IS NOT NULL AND LENGTH(u.pass) < 32"; // Not a MD5 value
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numrows=$db->num_rows($resql);
|
||||
if ($numrows == 0) dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1",'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
$createuser=new User($db);
|
||||
$createuser->id=0;
|
||||
|
||||
|
||||
@ -366,7 +366,7 @@ HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF
|
||||
HideDescOnPDF=Hide products description on generated PDF
|
||||
HideRefOnPDF=Hide products ref. on generated PDF
|
||||
HideDetailsOnPDF=Hide products lines details on generated PDF
|
||||
PlaceCustomerAddressToIsoLocation=Use ISO location for customer address
|
||||
PlaceCustomerAddressToIsoLocation=Use french standard position (La Posteà for customer address position
|
||||
Library=Library
|
||||
UrlGenerationParameters=Parameters to secure URLs
|
||||
SecurityTokenIsUnique=Use a unique securekey parameter for each URL
|
||||
@ -1116,7 +1116,7 @@ GetBarCode=Get barcode
|
||||
EmptyNumRefModelDesc=The code is free. This code can be modified at any time.
|
||||
##### Module password generation
|
||||
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
|
||||
PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually.
|
||||
PasswordGenerationNone=Do not suggest any generated password. Password must be typed in manually.
|
||||
PasswordGenerationPerso=Return a password according to your personally defined configuration.
|
||||
SetupPerso=According to your configuration
|
||||
PasswordPatternDesc=Password pattern description
|
||||
@ -1570,7 +1570,7 @@ AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu
|
||||
##### ClickToDial #####
|
||||
ClickToDialDesc=This module allows to make phone numbers clickable. A click on this icon will call make your phone to call the phone number. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example.
|
||||
ClickToDialUseTelLink=Use just a link "tel:" on phone numbers
|
||||
ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or an interface install on same computer than the browser, and called when you click on a link in your browser that start with "tel:". If you need a full server solution, you must set this to "No" and fill next field.
|
||||
ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on same computer than the browser, and called when you click on a link in your browser that start with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field.
|
||||
##### Point Of Sales (CashDesk) #####
|
||||
CashDesk=Point of sales
|
||||
CashDeskSetup=Point of sales module setup
|
||||
@ -1596,7 +1596,7 @@ EndPointIs=SOAP clients must send their requests to the Dolibarr endpoint availa
|
||||
ApiSetup=API module setup
|
||||
ApiDesc=By enabling this module, Dolibarr become a REST server to provide miscellaneous web services.
|
||||
KeyForApiAccess=Key to use API (parameter "api_key")
|
||||
ApiProductionMode=Enable production mode
|
||||
ApiProductionMode=Enable production mode (this will activate use of a caches for services management)
|
||||
ApiEndPointIs=You can access to the API at url
|
||||
ApiExporerIs=You can explore the API at url
|
||||
OnlyActiveElementsAreExposed=Only elements from enabled modules are exposed
|
||||
@ -1673,7 +1673,8 @@ SomethingMakeInstallFromWebNotPossible2=For this reason, process to upgrade desc
|
||||
InstallModuleFromWebHasBeenDisabledByFile=Install of external module from application has been disabled by your administrator. You must ask him to remove the file <strong>%s</strong> to allow this feature.
|
||||
ConfFileMuseContainCustom=Installing an external module from application save the module files into directory <strong>%s</strong>. To have this directory processed by Dolibarr, you must setup your <strong>conf/conf.php</strong> to have option<br>- <strong>$dolibarr_main_url_root_alt</strong> enabled to value <strong>$dolibarr_main_url_root_alt="/custom"</strong><br>- <strong>$dolibarr_main_document_root_alt</strong> enabled to value <strong>"%s/custom"</strong>
|
||||
HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over
|
||||
HighlightLinesColor=Color of highlight line when mouse move passes over (keep empty for no highlight)
|
||||
HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight)
|
||||
LinkColor=Color of links
|
||||
PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective
|
||||
NotSupportedByAllThemes=Will works with eldy theme but is not supported by all themes
|
||||
BackgroundColor=Background color
|
||||
|
||||
@ -3,6 +3,12 @@ PrinterAdded=Printer %s added
|
||||
PrinterUpdated=Printer %s updated
|
||||
PrinterDeleted=Printer %s deleted
|
||||
TestSentToPrinter=Test Sent To Printer %s
|
||||
ReceiptPrinterDesc=Setup of printers
|
||||
ReceiptPrinterTemplateDesc=Setup of Templates
|
||||
ReceiptPrinterTypeDesc=Description of Receipt Printer's type
|
||||
ReceiptPrinterProfileDesc=Description of Receipt Printer's Profile
|
||||
ListPrinters=List of Printers
|
||||
SetupReceiptTemplate=Template Setup
|
||||
CONNECTOR_DUMMY=Dummy Printer
|
||||
CONNECTOR_NETWORK_PRINT=Network Printer
|
||||
CONNECTOR_FILE_PRINT=Local Printer
|
||||
@ -11,6 +17,16 @@ CONNECTOR_DUMMY_HELP=Fake Printer for test, does nothing
|
||||
CONNECTOR_NETWORK_PRINT_HELP=10.x.x.x:9100
|
||||
CONNECTOR_FILE_PRINT_HELP=/dev/usb/lp0, /dev/usb/lp1
|
||||
CONNECTOR_WINDOWS_PRINT_HELP=LPT1, COM1, smb://FooUser:secret@computername/workgroup/Receipt Printer
|
||||
PROFILE_DEFAULT=Default Profile
|
||||
PROFILE_SIMPLE=Simple Profile
|
||||
PROFILE_EPOSTEP=Epos Tep Profile
|
||||
PROFILE_P822D=P822D Profile
|
||||
PROFILE_STAR=Star Profile
|
||||
PROFILE_DEFAULT_HELP=Default Profile suitable for Epson printers
|
||||
PROFILE_SIMPLE_HELP=Simple Profile No Graphics
|
||||
PROFILE_EPOSTEP_HELP=Epos Tep Profile Help
|
||||
PROFILE_P822D_HELP=P822D Profile No Graphics
|
||||
PROFILE_STAR_HELP=Star Profile
|
||||
DOL_ALIGN_LEFT=Left align text
|
||||
DOL_ALIGN_CENTER=Center text
|
||||
DOL_ALIGN_RIGHT=Right align text
|
||||
|
||||
@ -17,6 +17,7 @@ ResourceFormLabel_description=Resource description
|
||||
|
||||
ResourcesLinkedToElement=Resources linked to element
|
||||
|
||||
ShowResource=Show resource
|
||||
ShowResourcePlanning=Show resource planning
|
||||
GotoDate=Go to date
|
||||
|
||||
|
||||
@ -1655,15 +1655,16 @@ SomethingMakeInstallFromWebNotPossible2=Pour cette raison, le processus de mise
|
||||
InstallModuleFromWebHasBeenDisabledByFile=L'installation de module externe depuis l'application a été désactivé par l'administrator. Vous devez lui demander de supprimer le fichier <strong>%s</strong> pour permettre cette fonctionnalité.
|
||||
ConfFileMuseContainCustom=Installé un module externe pour l'application enregistre les fichiers de module dans le répertoire <strong>%s</strong>. Pour avoir ce répertoire vu par Dolibarr, vous devez configurer votre <strong>conf/conf.php</strong> d'avoir l'option <br> - <strong>$dolibarr_main_url_root_alt</strong> activé à la valeur <strong>$dolibarr_main_url_root_alt="/custom"</strong><br> - <strong>$dolibarr_main_document_root_alt</strong> activé à la valeur <strong>"%s/custom"</strong>
|
||||
HighlightLinesOnMouseHover=Mettez en surbrillance les lignes de la table lorsque la souris passe au-dessus
|
||||
HighlightLinesColor=Color of highlight line when mouse move passes over (keep empty for no highlight)
|
||||
HighlightLinesColor=Couleur de surbrillance de la ligne quand la souris passe au dessus (garder vide pour ne pas avoir de surbrillance)
|
||||
LinkColor=Couleur des liens
|
||||
PressF5AfterChangingThis=Appuyez sur F5 sur le clavier après avoir modifié cette valeur pour que le changement soit effectif
|
||||
NotSupportedByAllThemes=Fonctionne avec le thème eldy mais n'est pas pris en charge par tous les thèmes
|
||||
BackgroundColor=Couleur de fond
|
||||
TopMenuBackgroundColor=Couleur de fond pour le menu Gauche
|
||||
TopMenuBackgroundColor=Couleur de fond pour le menu Haut
|
||||
LeftMenuBackgroundColor=Couleur de fond pour le menu Gauche
|
||||
BackgroundTableTitleColor=Background color for Table title line
|
||||
BackgroundTableTitleColor=Couleur de fond pour la ligne de titre des tables
|
||||
BackgroundTableLineOddColor=Couleur de fond pour les lignes impaires des tables
|
||||
BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tales
|
||||
BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tables
|
||||
MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai)
|
||||
NbAddedAutomatically=Nombre de jours ajoutés aux compteurs des utilisateurs (automatiquement) chaque mois
|
||||
EnterAnyCode=Ce champ contient une référence pour identifier le champ. Entrez une valeur de votre choix, mais sans caractères spéciaux.
|
||||
|
||||
@ -36,7 +36,7 @@ $langs->load("margins");
|
||||
|
||||
// Security check
|
||||
|
||||
if ($user->rights->margin->read->all) {
|
||||
if ($user->rights->margins->read->all) {
|
||||
$agentid = GETPOST('agentid', 'int');
|
||||
} else {
|
||||
$agentid = $user->id;
|
||||
@ -91,7 +91,7 @@ dol_fiche_head($head, 'agentMargins', $titre, 0, $picto);
|
||||
print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
if ($user->rights->margin->read->all) {
|
||||
if ($user->rights->margins->read->all) {
|
||||
print '<tr><td width="20%">'.$langs->trans('SalesRepresentative').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_dolusers($agentid, 'agentid', 1);
|
||||
|
||||
@ -77,7 +77,7 @@ function marges_prepare_head()
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($user->rights->margin->read->all) {
|
||||
if ($user->rights->margins->read->all) {
|
||||
$title = 'UserMargins';
|
||||
} else {
|
||||
$title = 'SalesRepresentativeMargins';
|
||||
|
||||
@ -369,6 +369,7 @@ $db->close();
|
||||
function activitytrim($product_type)
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $bc;
|
||||
|
||||
// We display the last 3 years
|
||||
$yearofbegindate=date('Y',dol_time_plus_duree(time(), -3, "y"));
|
||||
@ -415,6 +416,8 @@ function activitytrim($product_type)
|
||||
}
|
||||
$i = 0;
|
||||
|
||||
$var=true;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
@ -422,7 +425,8 @@ function activitytrim($product_type)
|
||||
{
|
||||
if ($trim1+$trim2+$trim3+$trim4 > 0)
|
||||
{
|
||||
print '<tr ><td align=left>'.$tmpyear.'</td>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td align=left>'.$tmpyear.'</td>';
|
||||
print '<td align=right>'.price($trim1).'</td>';
|
||||
print '<td align=right>'.price($trim2).'</td>';
|
||||
print '<td align=right>'.price($trim3).'</td>';
|
||||
@ -455,7 +459,8 @@ function activitytrim($product_type)
|
||||
}
|
||||
if ($trim1+$trim2+$trim3+$trim4 > 0)
|
||||
{
|
||||
print '<tr ><td align=left>'.$tmpyear.'</td>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td align=left>'.$tmpyear.'</td>';
|
||||
print '<td align=right>'.price($trim1).'</td>';
|
||||
print '<td align=right>'.price($trim2).'</td>';
|
||||
print '<td align=right>'.price($trim3).'</td>';
|
||||
|
||||
@ -216,7 +216,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
|
||||
|
||||
// List of draft projects
|
||||
print_projecttasks_array($db,$form,$socid,$projectsListId,0,0,$listofoppstatus);
|
||||
print_projecttasks_array($db,$form,$socid,$projectsListId,0,0,$listofoppstatus,array('declaredprogress'));
|
||||
|
||||
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
1
htdocs/public/api/.gitignore
vendored
1
htdocs/public/api/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/cache/
|
||||
@ -1,15 +0,0 @@
|
||||
#
|
||||
# Apache configuration file to use API
|
||||
#
|
||||
|
||||
DirectoryIndex index.php
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteRule ^$ index.php [QSA,L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
</IfModule>
|
||||
<IfModule mod_php5.c>
|
||||
php_flag display_errors On
|
||||
</IfModule>
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 824 B |
Binary file not shown.
|
Before Width: | Height: | Size: 9.0 KiB |
@ -1,95 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Restler API Explorer</title>
|
||||
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
|
||||
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
|
||||
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
|
||||
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
|
||||
<script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
|
||||
<script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
|
||||
<script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
|
||||
<script src='lib/handlebars-1.0.rc.1.js' type='text/javascript'></script>
|
||||
<script src='lib/underscore-min.js' type='text/javascript'></script>
|
||||
<script src='lib/backbone-min.js' type='text/javascript'></script>
|
||||
<script src='lib/swagger.js' type='text/javascript'></script>
|
||||
<script src='swagger-ui.js' type='text/javascript'></script>
|
||||
|
||||
<style type="text/css">
|
||||
.swagger-ui-wrap {
|
||||
max-width: 960px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.icon-btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#message-bar {
|
||||
min-height: 30px;
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.message-success {
|
||||
color: #89BF04;
|
||||
}
|
||||
|
||||
.message-fail {
|
||||
color: #cc0000;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
window.swaggerUi = new SwaggerUi({
|
||||
discoveryUrl:"../resources.json",
|
||||
apiKey:"",
|
||||
dom_id:"swagger-ui-container",
|
||||
//supportHeaderParams: true,
|
||||
supportedSubmitMethods: ['get', 'post', 'put', 'patch', 'delete'],
|
||||
onComplete: function(swaggerApi, swaggerUi){
|
||||
if(console) {
|
||||
console.log("Loaded SwaggerUI")
|
||||
console.log(swaggerApi);
|
||||
console.log(swaggerUi);
|
||||
}
|
||||
},
|
||||
onFailure: function(data) {
|
||||
if(console) {
|
||||
console.log("Unable to Load SwaggerUI");
|
||||
console.log(data);
|
||||
}
|
||||
},
|
||||
docExpansion: "none"
|
||||
});
|
||||
|
||||
window.swaggerUi.load();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id='header'>
|
||||
<div class="swagger-ui-wrap">
|
||||
<a id="logo" href="https://github.com/Luracast/Restler-API-Explorer" target="_blank">API Explorer</a>
|
||||
<form id='api_selector'>
|
||||
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="hidden"/></div>
|
||||
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
|
||||
<div class='input'><a id="explore" href="#">Explore</a></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="message-bar" class="swagger-ui-wrap">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="swagger-ui-container" class="swagger-ui-wrap">
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
38
htdocs/public/api/explorer/lib/backbone-min.js
vendored
38
htdocs/public/api/explorer/lib/backbone-min.js
vendored
@ -1,38 +0,0 @@
|
||||
// Backbone.js 0.9.2
|
||||
|
||||
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||
// Backbone may be freely distributed under the MIT license.
|
||||
// For all details and documentation:
|
||||
// http://backbonejs.org
|
||||
(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
|
||||
{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
|
||||
z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
|
||||
{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
|
||||
b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
|
||||
b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
|
||||
a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
|
||||
h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
|
||||
return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
|
||||
{};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
|
||||
!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
|
||||
this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
|
||||
l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c<d;c++)(e=a[c]).on("all",this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&&(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&&this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c<d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger("add",e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
|
||||
a.slice():[a];c=0;for(d=a.length;c<d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
|
||||
shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);1==this.comparator.length?
|
||||
this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;a.success=function(d,
|
||||
e,f){b[a.add?"add":"reset"](b.parse(d,f),a);c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&&c.add(e,b);d?d(e,f):e.trigger("sync",a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
|
||||
{};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
|
||||
arguments))}});f.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&&(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
|
||||
C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&&c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d));g.history.trigger("route",this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
|
||||
this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,"\\$&").replace(B,"([^/]+)").replace(C,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
|
||||
""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,"")},start:function(a){if(m.started)throw Error("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
|
||||
!(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
|
||||
this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
|
||||
stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
|
||||
function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
|
||||
this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
|
||||
f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
|
||||
for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b<c;b++){var d=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
|
||||
!1);else{var a=n(this,"attributes")||{};this.id&&(a.id=this.id);this.className&&(a["class"]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:"json"};c.url||(e.url=n(b,"url")||t());if(!c.data&&b&&("create"==a||"update"==a))e.contentType="application/json",
|
||||
e.data=JSON.stringify(b.toJSON());g.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&&("PUT"===d||"DELETE"===d))g.emulateJSON&&(e.data._method=d),e.type="POST",e.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)};"GET"!==e.type&&!g.emulateJSON&&(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger("error",b,e,c)}};var x=function(){},G=function(a,
|
||||
b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A "url" property or function must be specified');}}).call(this);
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,223 +0,0 @@
|
||||
// lib/handlebars/base.js
|
||||
var Handlebars = {};
|
||||
|
||||
Handlebars.VERSION = "1.0.beta.6";
|
||||
|
||||
Handlebars.helpers = {};
|
||||
Handlebars.partials = {};
|
||||
|
||||
Handlebars.registerHelper = function(name, fn, inverse) {
|
||||
if(inverse) { fn.not = inverse; }
|
||||
this.helpers[name] = fn;
|
||||
};
|
||||
|
||||
Handlebars.registerPartial = function(name, str) {
|
||||
this.partials[name] = str;
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('helperMissing', function(arg) {
|
||||
if(arguments.length === 2) {
|
||||
return undefined;
|
||||
} else {
|
||||
throw new Error("Could not find property '" + arg + "'");
|
||||
}
|
||||
});
|
||||
|
||||
var toString = Object.prototype.toString, functionType = "[object Function]";
|
||||
|
||||
Handlebars.registerHelper('blockHelperMissing', function(context, options) {
|
||||
var inverse = options.inverse || function() {}, fn = options.fn;
|
||||
|
||||
|
||||
var ret = "";
|
||||
var type = toString.call(context);
|
||||
|
||||
if(type === functionType) { context = context.call(this); }
|
||||
|
||||
if(context === true) {
|
||||
return fn(this);
|
||||
} else if(context === false || context == null) {
|
||||
return inverse(this);
|
||||
} else if(type === "[object Array]") {
|
||||
if(context.length > 0) {
|
||||
for(var i=0, j=context.length; i<j; i++) {
|
||||
ret = ret + fn(context[i]);
|
||||
}
|
||||
} else {
|
||||
ret = inverse(this);
|
||||
}
|
||||
return ret;
|
||||
} else {
|
||||
return fn(context);
|
||||
}
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('each', function(context, options) {
|
||||
var fn = options.fn, inverse = options.inverse;
|
||||
var ret = "";
|
||||
|
||||
if(context && context.length > 0) {
|
||||
for(var i=0, j=context.length; i<j; i++) {
|
||||
ret = ret + fn(context[i]);
|
||||
}
|
||||
} else {
|
||||
ret = inverse(this);
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('if', function(context, options) {
|
||||
var type = toString.call(context);
|
||||
if(type === functionType) { context = context.call(this); }
|
||||
|
||||
if(!context || Handlebars.Utils.isEmpty(context)) {
|
||||
return options.inverse(this);
|
||||
} else {
|
||||
return options.fn(this);
|
||||
}
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('unless', function(context, options) {
|
||||
var fn = options.fn, inverse = options.inverse;
|
||||
options.fn = inverse;
|
||||
options.inverse = fn;
|
||||
|
||||
return Handlebars.helpers['if'].call(this, context, options);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('with', function(context, options) {
|
||||
return options.fn(context);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('log', function(context) {
|
||||
Handlebars.log(context);
|
||||
});
|
||||
;
|
||||
// lib/handlebars/utils.js
|
||||
Handlebars.Exception = function(message) {
|
||||
var tmp = Error.prototype.constructor.apply(this, arguments);
|
||||
|
||||
for (var p in tmp) {
|
||||
if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
|
||||
}
|
||||
|
||||
this.message = tmp.message;
|
||||
};
|
||||
Handlebars.Exception.prototype = new Error;
|
||||
|
||||
// Build out our basic SafeString type
|
||||
Handlebars.SafeString = function(string) {
|
||||
this.string = string;
|
||||
};
|
||||
Handlebars.SafeString.prototype.toString = function() {
|
||||
return this.string.toString();
|
||||
};
|
||||
|
||||
(function() {
|
||||
var escape = {
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
"`": "`"
|
||||
};
|
||||
|
||||
var badChars = /&(?!\w+;)|[<>"'`]/g;
|
||||
var possible = /[&<>"'`]/;
|
||||
|
||||
var escapeChar = function(chr) {
|
||||
return escape[chr] || "&";
|
||||
};
|
||||
|
||||
Handlebars.Utils = {
|
||||
escapeExpression: function(string) {
|
||||
// don't escape SafeStrings, since they're already safe
|
||||
if (string instanceof Handlebars.SafeString) {
|
||||
return string.toString();
|
||||
} else if (string == null || string === false) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if(!possible.test(string)) { return string; }
|
||||
return string.replace(badChars, escapeChar);
|
||||
},
|
||||
|
||||
isEmpty: function(value) {
|
||||
if (typeof value === "undefined") {
|
||||
return true;
|
||||
} else if (value === null) {
|
||||
return true;
|
||||
} else if (value === false) {
|
||||
return true;
|
||||
} else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
// lib/handlebars/runtime.js
|
||||
Handlebars.VM = {
|
||||
template: function(templateSpec) {
|
||||
// Just add water
|
||||
var container = {
|
||||
escapeExpression: Handlebars.Utils.escapeExpression,
|
||||
invokePartial: Handlebars.VM.invokePartial,
|
||||
programs: [],
|
||||
program: function(i, fn, data) {
|
||||
var programWrapper = this.programs[i];
|
||||
if(data) {
|
||||
return Handlebars.VM.program(fn, data);
|
||||
} else if(programWrapper) {
|
||||
return programWrapper;
|
||||
} else {
|
||||
programWrapper = this.programs[i] = Handlebars.VM.program(fn);
|
||||
return programWrapper;
|
||||
}
|
||||
},
|
||||
programWithDepth: Handlebars.VM.programWithDepth,
|
||||
noop: Handlebars.VM.noop
|
||||
};
|
||||
|
||||
return function(context, options) {
|
||||
options = options || {};
|
||||
return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
|
||||
};
|
||||
},
|
||||
|
||||
programWithDepth: function(fn, data, $depth) {
|
||||
var args = Array.prototype.slice.call(arguments, 2);
|
||||
|
||||
return function(context, options) {
|
||||
options = options || {};
|
||||
|
||||
return fn.apply(this, [context, options.data || data].concat(args));
|
||||
};
|
||||
},
|
||||
program: function(fn, data) {
|
||||
return function(context, options) {
|
||||
options = options || {};
|
||||
|
||||
return fn(context, options.data || data);
|
||||
};
|
||||
},
|
||||
noop: function() { return ""; },
|
||||
invokePartial: function(partial, name, context, helpers, partials, data) {
|
||||
options = { helpers: helpers, partials: partials, data: data };
|
||||
|
||||
if(partial === undefined) {
|
||||
throw new Handlebars.Exception("The partial " + name + " could not be found");
|
||||
} else if(partial instanceof Function) {
|
||||
return partial(context, options);
|
||||
} else if (!Handlebars.compile) {
|
||||
throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
|
||||
} else {
|
||||
partials[name] = Handlebars.compile(partial);
|
||||
return partials[name](context, options);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.template = Handlebars.VM.template;
|
||||
;
|
||||
File diff suppressed because one or more lines are too long
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
|
||||
* http://benalman.com/projects/jquery-bbq-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
|
||||
/*
|
||||
* jQuery hashchange event - v1.2 - 2/11/2010
|
||||
* http://benalman.com/projects/jquery-hashchange-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
|
||||
@ -1 +0,0 @@
|
||||
(function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user